p=buf_in;
i2d(data,&p);
- if (!EVP_VerifyInit_ex(&ctx,type, NULL)
- || !EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl))
+ ret=
+ EVP_VerifyInit_ex(&ctx,type, NULL)
+ && EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl);
+
+ OPENSSL_cleanse(buf_in,(unsigned int)inl);
+ OPENSSL_free(buf_in);
+
+ if (!ret)
{
ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_EVP_LIB);
- ret=0;
goto err;
}
+ ret = -1;
- OPENSSL_cleanse(buf_in,(unsigned int)inl);
- OPENSSL_free(buf_in);
if (EVP_VerifyFinal(&ctx,(unsigned char *)signature->data,
(unsigned int)signature->length,pkey) <= 0)
goto err;
}
- if (!EVP_DigestVerifyUpdate(&ctx,buf_in,inl))
+ ret = EVP_DigestVerifyUpdate(&ctx,buf_in,inl);
+
+ OPENSSL_cleanse(buf_in,(unsigned int)inl);
+ OPENSSL_free(buf_in);
+
+ if (!ret)
{
ASN1err(ASN1_F_ASN1_ITEM_VERIFY,ERR_R_EVP_LIB);
- ret=0;
goto err;
}
-
- OPENSSL_cleanse(buf_in,(unsigned int)inl);
- OPENSSL_free(buf_in);
+ ret = -1;
if (EVP_DigestVerifyFinal(&ctx,signature->data,
(size_t)signature->length) <= 0)