]> granicus.if.org Git - php/commitdiff
Remove confusing spkstr checks
authorNikita Popov <nikita.ppv@gmail.com>
Fri, 31 May 2019 14:59:46 +0000 (16:59 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 31 May 2019 15:00:00 +0000 (17:00 +0200)
This is a required parameter, it can never be NULL.

ext/openssl/openssl.c

index 23ce1c9242ffa08f437a45b074a0e36840379f64..30d984c30072ce3dde1b36aca5b206bcc031f33a 100644 (file)
@@ -1933,7 +1933,7 @@ PHP_FUNCTION(openssl_spki_verify)
 {
        size_t spkstr_len;
        int i = 0, spkstr_cleaned_len = 0;
-       char *spkstr = NULL, * spkstr_cleaned = NULL;
+       char *spkstr, * spkstr_cleaned = NULL;
 
        EVP_PKEY *pkey = NULL;
        NETSCAPE_SPKI *spki = NULL;
@@ -1943,11 +1943,6 @@ PHP_FUNCTION(openssl_spki_verify)
        }
        RETVAL_FALSE;
 
-       if (spkstr == NULL) {
-               php_error_docref(NULL, E_WARNING, "Unable to use supplied SPKAC");
-               goto cleanup;
-       }
-
        spkstr_cleaned = emalloc(spkstr_len + 1);
        spkstr_cleaned_len = (int)(spkstr_len - php_openssl_spki_cleanup(spkstr, spkstr_cleaned));
 
@@ -1997,7 +1992,7 @@ cleanup:
 PHP_FUNCTION(openssl_spki_export)
 {
        size_t spkstr_len;
-       char *spkstr = NULL, * spkstr_cleaned = NULL, * s = NULL;
+       char *spkstr, * spkstr_cleaned = NULL, * s = NULL;
        int spkstr_cleaned_len;
 
        EVP_PKEY *pkey = NULL;
@@ -2009,11 +2004,6 @@ PHP_FUNCTION(openssl_spki_export)
        }
        RETVAL_FALSE;
 
-       if (spkstr == NULL) {
-               php_error_docref(NULL, E_WARNING, "Unable to use supplied SPKAC");
-               goto cleanup;
-       }
-
        spkstr_cleaned = emalloc(spkstr_len + 1);
        spkstr_cleaned_len = (int)(spkstr_len - php_openssl_spki_cleanup(spkstr, spkstr_cleaned));
 
@@ -2072,7 +2062,7 @@ cleanup:
 PHP_FUNCTION(openssl_spki_export_challenge)
 {
        size_t spkstr_len;
-       char *spkstr = NULL, * spkstr_cleaned = NULL;
+       char *spkstr, * spkstr_cleaned = NULL;
        int spkstr_cleaned_len;
 
        NETSCAPE_SPKI *spki = NULL;
@@ -2082,11 +2072,6 @@ PHP_FUNCTION(openssl_spki_export_challenge)
        }
        RETVAL_FALSE;
 
-       if (spkstr == NULL) {
-               php_error_docref(NULL, E_WARNING, "Unable to use supplied SPKAC");
-               goto cleanup;
-       }
-
        spkstr_cleaned = emalloc(spkstr_len + 1);
        spkstr_cleaned_len = (int)(spkstr_len - php_openssl_spki_cleanup(spkstr, spkstr_cleaned));