Stop PKCS7_verify() core dumping with unknown public
[openssl.git] / crypto / pkcs7 / pk7_doit.c
index 98f3b49..de96148 100644 (file)
@@ -764,6 +764,11 @@ for (ii=0; ii<md_len; ii++) printf("%02X",md_dat[ii]); printf(" calc\n");
 
        os=si->enc_digest;
        pkey = X509_get_pubkey(x509);
+       if (!pkey)
+               {
+               ret = -1;
+               goto err;
+               }
        if(pkey->type == EVP_PKEY_DSA) mdc_tmp.digest=EVP_dss1();
 
        i=EVP_VerifyFinal(&mdc_tmp,os->data,os->length, pkey);