[openssl-commits] [openssl] master update

kaduk at mit.edu kaduk at mit.edu
Thu Mar 1 15:16:28 UTC 2018


The branch master has been updated
       via  178989b4a3ed714fa169cae5865c75f156ec9fdb (commit)
      from  e72bf967186a2ac26459926a20dbf03dc119eb5b (commit)


- Log -----------------------------------------------------------------
commit 178989b4a3ed714fa169cae5865c75f156ec9fdb
Author: Brad Spencer <bspencer at blackberry.com>
Date:   Wed Dec 20 13:41:14 2017 -0400

    Test the result of CMS_RecipientInfo_ktri_get0_algs() before using its output in rsa_cms_encrypt().
    
    CLA: trivial
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    Reviewed-by: Ben Kaduk <kaduk at mit.edu>
    (Merged from https://github.com/openssl/openssl/pull/4966)

-----------------------------------------------------------------------

Summary of changes:
 crypto/rsa/rsa_ameth.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/crypto/rsa/rsa_ameth.c b/crypto/rsa/rsa_ameth.c
index 98121b5..de9e3c1 100644
--- a/crypto/rsa/rsa_ameth.c
+++ b/crypto/rsa/rsa_ameth.c
@@ -967,7 +967,8 @@ static int rsa_cms_encrypt(CMS_RecipientInfo *ri)
     int pad_mode = RSA_PKCS1_PADDING, rv = 0, labellen;
     unsigned char *label;
 
-    CMS_RecipientInfo_ktri_get0_algs(ri, NULL, NULL, &alg);
+    if (CMS_RecipientInfo_ktri_get0_algs(ri, NULL, NULL, &alg) <= 0)
+        return 0;
     if (pkctx) {
         if (EVP_PKEY_CTX_get_rsa_padding(pkctx, &pad_mode) <= 0)
             return 0;


More information about the openssl-commits mailing list