Merge pull request #1365 from cconlon/p7karifix

detect and set keyAgreeOID from CMS EnvelopedData if user has not set
pull/1368/head
Kaleb Himes 2018-02-09 13:27:40 -07:00 committed by GitHub
commit 87179837e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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