Skip to content

Commit 43970e3

Browse files
committed
Fix missing libctx in x509 info read bio
1 parent 84c7c03 commit 43970e3

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

ext/openssl/openssl_backend_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ STACK_OF(X509) *php_openssl_load_all_certs_from_file(
711711
}
712712

713713
/* This loads from a file, a stack of x509/crl/pkey sets */
714-
if (!(sk = PEM_X509_INFO_read_bio(in, NULL, NULL, NULL))) {
714+
if (!(sk = php_openssl_pem_read_bio_x509_info(in))) {
715715
php_openssl_store_errors();
716716
php_error_docref(NULL, E_WARNING, "Error reading the file, %s", cert_path);
717717
sk_X509_free(stack);

ext/openssl/openssl_backend_v1.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,11 @@ X509_REQ *php_openssl_pem_read_bio_x509_req(BIO *in)
723723
return PEM_read_bio_X509_REQ(in, NULL, NULL, NULL);
724724
}
725725

726+
STACK_OF(X509_INFO) *php_openssl_pem_read_bio_x509_info(BIO *in)
727+
{
728+
return PEM_X509_INFO_read_bio(in, NULL, NULL, NULL);
729+
}
730+
726731
EVP_PKEY *php_openssl_pem_read_bio_public_key(BIO *in)
727732
{
728733
return PEM_read_bio_PUBKEY(in, NULL, NULL, NULL);

ext/openssl/openssl_backend_v3.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,11 @@ X509_REQ *php_openssl_pem_read_bio_x509_req(BIO *in)
903903
return xr;
904904
}
905905

906+
STACK_OF(X509_INFO) *php_openssl_pem_read_bio_x509_info(BIO *in)
907+
{
908+
return PEM_X509_INFO_read_bio_ex(in, NULL, NULL, NULL, PHP_OPENSSL_LIBCTX, PHP_OPENSSL_PROPQ);
909+
}
910+
906911
EVP_PKEY *php_openssl_pem_read_bio_public_key(BIO *in)
907912
{
908913
return PEM_read_bio_PUBKEY_ex(in, NULL, NULL, NULL, PHP_OPENSSL_LIBCTX, PHP_OPENSSL_PROPQ);

ext/openssl/php_openssl_backend.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ zend_string *php_openssl_pkey_derive(EVP_PKEY *key, EVP_PKEY *peer_key, size_t r
195195
X509 *php_openssl_pem_read_asn1_bio_x509(BIO *in);
196196
X509 *php_openssl_pem_read_bio_x509(BIO *in);
197197
X509_REQ *php_openssl_pem_read_bio_x509_req(BIO *in);
198+
STACK_OF(X509_INFO) *php_openssl_pem_read_bio_x509_info(BIO *in);
198199
EVP_PKEY *php_openssl_pem_read_bio_public_key(BIO *in);
199200
EVP_PKEY *php_openssl_pem_read_bio_private_key(BIO *in, pem_password_cb *cb, void *u);
200201
PKCS7 *php_openssl_pem_read_bio_pkcs7(BIO *in);

0 commit comments

Comments
 (0)