Codebase list openssl / ea8d9ce
Test the result of CMS_RecipientInfo_ktri_get0_algs() before using its output in rsa_cms_encrypt(). CLA: trivial Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/4966) (cherry picked from commit 178989b4a3ed714fa169cae5865c75f156ec9fdb) Brad Spencer authored 6 years ago Ben Kaduk committed 6 years ago
1 changed file(s) with 2 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
772772 EVP_PKEY_CTX *pkctx = CMS_RecipientInfo_get0_pkey_ctx(ri);
773773 int pad_mode = RSA_PKCS1_PADDING, rv = 0, labellen;
774774 unsigned char *label;
775 CMS_RecipientInfo_ktri_get0_algs(ri, NULL, NULL, &alg);
775 if (CMS_RecipientInfo_ktri_get0_algs(ri, NULL, NULL, &alg) <= 0)
776 return 0;
776777 if (pkctx) {
777778 if (EVP_PKEY_CTX_get_rsa_padding(pkctx, &pad_mode) <= 0)
778779 return 0;