From fa676d96cf86fa7a85492456fca36a4d99d0ca9e Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Fri, 9 Feb 2018 09:37:51 -0700 Subject: [PATCH] detect and set keyAgreeOID from CMS EnvelopedData if user has not set --- wolfcrypt/src/pkcs7.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wolfcrypt/src/pkcs7.c b/wolfcrypt/src/pkcs7.c index a9858ae79..f4105e977 100644 --- a/wolfcrypt/src/pkcs7.c +++ b/wolfcrypt/src/pkcs7.c @@ -3907,6 +3907,10 @@ static int wc_PKCS7_DecodeKari(PKCS7* pkcs7, byte* pkiMsg, word32 pkiMsgSz, return ret; } + /* if user has not explicitly set keyAgreeOID, set from one in bundle */ + if (pkcs7->keyAgreeOID == 0) + pkcs7->keyAgreeOID = keyAgreeOID; + /* set direction based on key wrap algorithm */ switch (keyWrapOID) { #ifndef NO_AES