@@ -14878,7 +14878,8 @@ int wc_PKCS7_SetDecodeEncryptedCtx(wc_PKCS7* pkcs7, void* ctx)
1487814878#endif /* NO_PKCS7_ENCRYPTED_DATA */
1487914879
1488014880
14881- /* Unwrap and decrypt PKCS#7/CMS EncryptedKeyPackage object, return decoded size. */
14881+ /* Unwrap and decrypt PKCS#7/CMS EncryptedKeyPackage object, return the
14882+ * decoded size. */
1488214883WOLFSSL_API int wc_PKCS7_DecodeEncryptedKeyPackage(wc_PKCS7 * pkcs7,
1488314884 byte * pkiMsg, word32 pkiMsgSz, byte * output, word32 outputSz)
1488414885{
@@ -14893,7 +14894,8 @@ WOLFSSL_API int wc_PKCS7_DecodeEncryptedKeyPackage(wc_PKCS7 * pkcs7,
1489314894 break;
1489414895 }
1489514896
14896- /* Expect a SEQUENCE header to start the EncryptedKeyPackage ContentInfo. */
14897+ /* Expect a SEQUENCE header to start the EncryptedKeyPackage
14898+ * ContentInfo. */
1489714899 if (GetSequence_ex(pkiMsg, &pkiIndex, &length, pkiMsgSz, 1) < 0) {
1489814900 ret = ASN_PARSE_E;
1489914901 break;
@@ -14918,18 +14920,20 @@ WOLFSSL_API int wc_PKCS7_DecodeEncryptedKeyPackage(wc_PKCS7 * pkcs7,
1491814920 break;
1491914921 }
1492014922
14921- /* Check for EncryptedKeyPackage explicit CHOICE [0] tag, indicating EnvelopedData subtype. */
14923+ /* Check for an EncryptedKeyPackage explicit CHOICE [0] tag, indicating
14924+ * an EnvelopedData subtype. */
1492214925 if (GetASNHeader(pkiMsg, ASN_CONTEXT_SPECIFIC | ASN_CONSTRUCTED,
1492314926 &pkiIndex, &length, pkiMsgSz) >= 0) {
14924- /* Explicit CHOICE [0] tag found. pkiIndex now should point to the
14925- * EnvelopedData ContentInfo object within the EncryptedKeyPackage. */
14927+ /* An explicit CHOICE [0] tag was found. pkiIndex now should point
14928+ * to the EnvelopedData ContentInfo object within the
14929+ * EncryptedKeyPackage. */
1492614930 ret = wc_PKCS7_DecodeEnvelopedData(pkcs7, &pkiMsg[pkiIndex],
1492714931 pkiMsgSz - pkiIndex, output, outputSz);
1492814932 }
1492914933 else {
1493014934#ifndef NO_PKCS7_ENCRYPTED_DATA
14931- /* An explicit CHOICE [0] tag was not found. We do not currently
14932- * support AuthEnvelopedData, so check if we have an EncryptedData blob. */
14935+ /* An explicit CHOICE [0] tag was not found. Check if we have an
14936+ * EncryptedData blob. */
1493314937 ret = wc_PKCS7_DecodeEncryptedData(pkcs7, &pkiMsg[pkiIndex],
1493414938 pkiMsgSz - pkiIndex, output, outputSz);
1493514939#else
0 commit comments