PHP 8.0: NewFunctions/Constants: account for new OpenSSL CMS support by jrfnl · Pull Request #1182 · PHPCompatibility/PHPCompatibility
Conversation
Copy link Copy Markdown
Member
jrfnl
commented
Jul 19, 2020
jrfnl
commented
PHP 8.0: NewFunctions: account for new OpenSSL CMS functions
- Added openssl_cms_encrypt() encrypts the message in the file with the
certificates and outputs the result to the supplied file.- Added openssl_cms_decrypt() that decrypts the S/MIME message in the file
and outputs the results to the supplied file.- Added openssl_cms_read() that exports the CMS file to an array of PEM
certificates.- Added openssl_cms_sign() that signs the MIME message in the file with
a cert and key and output the result to the supplied file.- Added openssl_cms_verify() that verifies that the data block is intact,
the signer is who they say they are, and returns the certs of the signers.
Refs:
- https://wiki.php.net/rfc/add-cms-support
- https://github.com/php/php-src/blob/c0172aa2bdb9ea223c8491bdb300995b93a857a0/UPGRADING#L727-L736
- This PR adds support for CMS. php/php-src#5251
- php/php-src@8583b8a
Includes unit tests.
PHP 8.0: NewConstants: account for new OpenSSL CMS constants
Added Cryptographic Message Syntax (CMS) (RFC 5652) support composed of
functions for encryption, decryption, signing, verifying and reading. The
API is similar to the API for PKCS #7 functions with an addition of new
encoding constants: OPENSSL_ENCODING_DER, OPENSSL_ENCODING_SMIME and
OPENSSL_ENCODING_PEM.
And from the RFC:
The following analogs to PKCS#7 are also added:
OPENSSL_CMS_DETACHED
OPENSSL_CMS_TEXT
OPENSSL_CMS_NOINTERN
OPENSSL_CMS_NOVERIFY
OPENSSL_CMS_NOCERTS
OPENSSL_CMS_NOATTR
OPENSSL_CMS_BINARY
OPENSSL_CMS_NOSIGS
Refs:
- https://wiki.php.net/rfc/add-cms-support
- https://github.com/php/php-src/blob/c0172aa2bdb9ea223c8491bdb300995b93a857a0/UPGRADING#L603-L608
- This PR adds support for CMS. php/php-src#5251
- php/php-src@8583b8a
Includes unit tests.
Related to #809
jrfnl added 2 commits
July 20, 2020 00:17> - Added openssl_cms_encrypt() encrypts the message in the file with the > certificates and outputs the result to the supplied file. > - Added openssl_cms_decrypt() that decrypts the S/MIME message in the file > and outputs the results to the supplied file. > - Added openssl_cms_read() that exports the CMS file to an array of PEM > certificates. > - Added openssl_cms_sign() that signs the MIME message in the file with > a cert and key and output the result to the supplied file. > - Added openssl_cms_verify() that verifies that the data block is intact, > the signer is who they say they are, and returns the certs of the signers. Refs: * https://wiki.php.net/rfc/add-cms-support * https://github.com/php/php-src/blob/c0172aa2bdb9ea223c8491bdb300995b93a857a0/UPGRADING#L727-L736 * php/php-src#5251 * php/php-src@8583b8a Includes unit tests.
> Added Cryptographic Message Syntax (CMS) (RFC 5652) support composed of > functions for encryption, decryption, signing, verifying and reading. The > API is similar to the API for PKCS #7 functions with an addition of new > encoding constants: OPENSSL_ENCODING_DER, OPENSSL_ENCODING_SMIME and > OPENSSL_ENCODING_PEM. And from the RFC: > The following analogs to PKCS#7 are also added: > OPENSSL_CMS_DETACHED > OPENSSL_CMS_TEXT > OPENSSL_CMS_NOINTERN > OPENSSL_CMS_NOVERIFY > OPENSSL_CMS_NOCERTS > OPENSSL_CMS_NOATTR > OPENSSL_CMS_BINARY > OPENSSL_CMS_NOSIGS Refs: * https://wiki.php.net/rfc/add-cms-support * https://github.com/php/php-src/blob/c0172aa2bdb9ea223c8491bdb300995b93a857a0/UPGRADING#L603-L608 * php/php-src#5251 * php/php-src@8583b8a Includes unit test.
jrfnl
added
Type: enhancement
PR: quick merge
PR: ready for review labels
Jul 19, 2020
jrfnl
added this to the
10.0.0 milestone
jrfnl
requested a review
from wimg
jrfnl
mentioned this pull request
40 tasks
wimg approved these changes Aug 5, 2020
wimg
merged commit
1fdb16f
into
develop
wimg
deleted the
php8.0/openssl-support-cms-api
branch
jrfnl
removed
PR: quick merge
PR: ready for review labels
Aug 5, 2020This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment