forked from wolfSSL/wolfssl
remove content type restriction and fix build with compkey
This commit is contained in:
committed by
David Garske
parent
98efc1e9de
commit
b3506c836c
@ -5754,7 +5754,6 @@ int wc_PKCS7_AddRecipient_ORI(PKCS7* pkcs7, CallbackOriEncrypt oriEncryptCb,
|
||||
return idx;
|
||||
}
|
||||
|
||||
|
||||
#ifndef NO_PWDBASED
|
||||
|
||||
|
||||
@ -7511,6 +7510,7 @@ static int wc_PKCS7_DecryptOri(PKCS7* pkcs7, byte* in, word32 inSz,
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifndef NO_PWDBASED
|
||||
|
||||
/* decode ASN.1 PasswordRecipientInfo (pwri), return 0 on success,
|
||||
* < 0 on error */
|
||||
@ -7718,6 +7718,7 @@ static int wc_PKCS7_DecryptPwri(PKCS7* pkcs7, byte* in, word32 inSz,
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* NO_PWDBASED */
|
||||
|
||||
/* decode ASN.1 KEKRecipientInfo (kekri), return 0 on success,
|
||||
* < 0 on error */
|
||||
@ -8062,8 +8063,12 @@ static int wc_PKCS7_DecryptRecipientInfos(PKCS7* pkcs7, byte* in,
|
||||
break;
|
||||
|
||||
case WC_PKCS7_DECRYPT_PWRI:
|
||||
#ifndef NO_PWDBASED
|
||||
ret = wc_PKCS7_DecryptPwri(pkcs7, in, inSz, idx,
|
||||
decryptedKey, decryptedKeySz, recipFound);
|
||||
#else
|
||||
return NOT_COMPILED_IN;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case WC_PKCS7_DECRYPT_ORI:
|
||||
@ -8174,6 +8179,7 @@ static int wc_PKCS7_DecryptRecipientInfos(PKCS7* pkcs7, byte* in,
|
||||
/* pwri is IMPLICIT[3] */
|
||||
} else if (pkiMsg[*idx] == (ASN_CONSTRUCTED |
|
||||
ASN_CONTEXT_SPECIFIC | 3)) {
|
||||
#ifndef NO_PWDBASED
|
||||
(*idx)++;
|
||||
|
||||
if (GetLength(pkiMsg, idx, &version, pkiMsgSz) < 0)
|
||||
@ -8199,6 +8205,9 @@ static int wc_PKCS7_DecryptRecipientInfos(PKCS7* pkcs7, byte* in,
|
||||
recipFound);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
#else
|
||||
return NOT_COMPILED_IN;
|
||||
#endif
|
||||
|
||||
/* ori is IMPLICIT[4] */
|
||||
} else if (pkiMsg[*idx] == (ASN_CONSTRUCTED |
|
||||
|
@ -19263,6 +19263,7 @@ static int pkcs7enveloped_run_vectors(byte* rsaCert, word32 rsaCertSz,
|
||||
}
|
||||
|
||||
} else if (testVectors[i].password != NULL) {
|
||||
#ifndef NO_PWDBASED
|
||||
/* PWRI recipient type */
|
||||
|
||||
ret = wc_PKCS7_Init(pkcs7, pkcs7->heap, pkcs7->devId);
|
||||
@ -19297,6 +19298,7 @@ static int pkcs7enveloped_run_vectors(byte* rsaCert, word32 rsaCertSz,
|
||||
wc_PKCS7_Free(pkcs7);
|
||||
return -9317;
|
||||
}
|
||||
#endif /* NO_PWDBASED */
|
||||
|
||||
} else if (testVectors[i].isOri == 1) {
|
||||
/* ORI recipient type */
|
||||
@ -19880,6 +19882,7 @@ static int pkcs7authenveloped_run_vectors(byte* rsaCert, word32 rsaCertSz,
|
||||
}
|
||||
|
||||
} else if (testVectors[i].password != NULL) {
|
||||
#ifndef NO_PWDBASED
|
||||
/* PWRI recipient type */
|
||||
|
||||
ret = wc_PKCS7_Init(pkcs7, pkcs7->heap, pkcs7->devId);
|
||||
@ -19919,6 +19922,7 @@ static int pkcs7authenveloped_run_vectors(byte* rsaCert, word32 rsaCertSz,
|
||||
return -9378;
|
||||
}
|
||||
|
||||
#endif /* NO_PWDBASED */
|
||||
} else if (testVectors[i].isOri == 1) {
|
||||
/* ORI recipient type */
|
||||
|
||||
|
Reference in New Issue
Block a user