Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/openssl/openssl_backend_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ int php_openssl_check_cert(X509_STORE *ctx, X509 *x, STACK_OF(X509) *untrustedch
csc = X509_STORE_CTX_new();
if (csc == NULL) {
php_openssl_store_errors();
php_error_docref(NULL, E_ERROR, "Memory allocation failure");
php_error_docref(NULL, E_WARNING, "Memory allocation failure");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's basically impossible to create a test for this, but as I'm unfamilar with openssl, I'm assuming that the call to X509_STORE_CTX_new doesn't store any relevant error, so that's why we need the extra warning?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will store an error that can be looked at via the error queue.
However, ext/openssl is inconsistent: in some cases only the error in the error queue is stored and in other cases an additional warning is emitted

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, well pre-exiting behaviour so lets just leave it like that then.

return 0;
}
if (!X509_STORE_CTX_init(csc, ctx, x, untrustedchain)) {
Expand Down
Loading