ASN1: Fix d2i_KeyParams() to advance |pp| like all other d2i functions do
authorRichard Levitte <levitte@openssl.org>
Thu, 23 Jul 2020 14:30:38 +0000 (16:30 +0200)
committerRichard Levitte <levitte@openssl.org>
Thu, 3 Sep 2020 15:48:31 +0000 (17:48 +0200)
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12587)

crypto/asn1/d2i_param.c

index c82b4a8fa83e93b19babe9807b649edff5fe8427..bd6ef1ce51256701a388cd34f5294bcd70f268c0 100644 (file)
@@ -18,7 +18,6 @@ EVP_PKEY *d2i_KeyParams(int type, EVP_PKEY **a, const unsigned char **pp,
                         long length)
 {
     EVP_PKEY *ret = NULL;
-    const unsigned char *p = *pp;
 
     if ((a == NULL) || (*a == NULL)) {
         if ((ret = EVP_PKEY_new()) == NULL)
@@ -34,7 +33,7 @@ EVP_PKEY *d2i_KeyParams(int type, EVP_PKEY **a, const unsigned char **pp,
         goto err;
     }
 
-    if (!ret->ameth->param_decode(ret, &p, length))
+    if (!ret->ameth->param_decode(ret, pp, length))
         goto err;
 
     if (a != NULL)