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
10 changes: 4 additions & 6 deletions ext/openssl/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,7 @@ PHP_FUNCTION(openssl_spki_export_challenge)
goto cleanup;
}

RETVAL_STRING(ASN1_STRING_data(spki->spkac->challenge), 1);
RETVAL_STRING((char *) ASN1_STRING_data(spki->spkac->challenge), 1);
goto cleanup;

cleanup:
Expand Down Expand Up @@ -1676,7 +1676,7 @@ static int php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_boo
{
unsigned char md[EVP_MAX_MD_SIZE];
const EVP_MD *mdtype;
int n;
unsigned int n;

if (!(mdtype = EVP_get_digestbyname(method))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm");
Expand All @@ -1688,7 +1688,7 @@ static int php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_boo

if (raw) {
*out_len = n;
*out = estrndup(md, n);
*out = estrndup((char *) md, n);
} else {
*out_len = n * 2;
*out = emalloc(*out_len + 1);
Expand Down Expand Up @@ -4916,14 +4916,12 @@ static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) /* {{{ */
{
php_stream *stream;
SSL *ssl;
X509 *err_cert;
int err, depth, ret;
zval **val;

ret = preverify_ok;

/* determine the status for the current cert */
err_cert = X509_STORE_CTX_get_current_cert(ctx);
err = X509_STORE_CTX_get_error(ctx);
depth = X509_STORE_CTX_get_error_depth(ctx);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Everything looks totally obvious, but what's this change about?

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.

The err_cert is not used anywhere in the function. The X509_STORE_CTX_get_current_cert is just a getter for ctx->current_cert:

X509 *X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx)
    {
    return ctx->current_cert;
    }

It means that this line is useless. The only thing that it does is generating compiler warning about unused variable... :)

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.

The warning is actually generated because of definition but the definition is there only because of this useless line... :)


Expand Down Expand Up @@ -4997,7 +4995,7 @@ static zend_bool matches_san_list(X509 *peer, const char *subject_name)

if (GEN_DNS == san->type) {
ASN1_STRING_to_UTF8(&cert_name, san->d.dNSName);
is_match = matches_wildcard_name(subject_name, cert_name);
is_match = matches_wildcard_name(subject_name, (char *) cert_name);
OPENSSL_free(cert_name);
}

Expand Down