add NULL param in CMS KARI OriginatorPublicKey parameters

This commit is contained in:
Chris Conlon
2019-03-08 09:13:22 -08:00
parent 0e962aa6e5
commit d8bec5e034

View File

@@ -5164,8 +5164,11 @@ int wc_PKCS7_AddRecipient_KARI(PKCS7* pkcs7, const byte* cert, word32 certSz,
origPubKeyStr + 1) + 2;
totalSz += (origPubKeyStrSz + kari->senderKeyExportSz);
/* Originator AlgorithmIdentifier */
origAlgIdSz = SetAlgoID(ECDSAk, origAlgId, oidKeyType, 0);
/* Originator AlgorithmIdentifier, params set to NULL for interop
compatibility */
origAlgIdSz = SetAlgoID(ECDSAk, origAlgId, oidKeyType, 2);
origAlgId[origAlgIdSz++] = ASN_TAG_NULL;
origAlgId[origAlgIdSz++] = 0;
totalSz += origAlgIdSz;
/* outer OriginatorPublicKey IMPLICIT [1] */
@@ -5209,8 +5212,11 @@ int wc_PKCS7_AddRecipient_KARI(PKCS7* pkcs7, const byte* cert, word32 certSz,
idx += origIdOrKeySeqSz;
XMEMCPY(recip->recip + idx, origPubKeySeq, origPubKeySeqSz);
idx += origPubKeySeqSz;
/* AlgorithmIdentifier with NULL parameter */
XMEMCPY(recip->recip + idx, origAlgId, origAlgIdSz);
idx += origAlgIdSz;
XMEMCPY(recip->recip + idx, origPubKeyStr, origPubKeyStrSz);
idx += origPubKeyStrSz;
/* ephemeral public key */