Update filenames in makefiles.
[openssl.git] / crypto / evp / p5_crpt.c
index 39306f4564597812463f4f7edfa5e0c57d3c3ae2..48d50014a04147843fc93ef5dc9390f4e76e4322 100644 (file)
@@ -110,12 +110,18 @@ int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen,
        int i;
        PBEPARAM *pbe;
        int saltlen, iter;
-       unsigned char *salt, *pbuf;
+       unsigned char *salt;
+       const unsigned char *pbuf;
 
        /* Extract useful info from parameter */
+       if (param == NULL || param->type != V_ASN1_SEQUENCE ||
+           param->value.sequence == NULL) {
+               EVPerr(EVP_F_PKCS5_PBE_KEYIVGEN,EVP_R_DECODE_ERROR);
+               return 0;
+       }
+
        pbuf = param->value.sequence->data;
-       if (!param || (param->type != V_ASN1_SEQUENCE) ||
-          !(pbe = d2i_PBEPARAM (NULL, &pbuf, param->value.sequence->length))) {
+       if (!(pbe = d2i_PBEPARAM(NULL, &pbuf, param->value.sequence->length))) {
                EVPerr(EVP_F_PKCS5_PBE_KEYIVGEN,EVP_R_DECODE_ERROR);
                return 0;
        }