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;
|
return idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef NO_PWDBASED
|
#ifndef NO_PWDBASED
|
||||||
|
|
||||||
|
|
||||||
@ -7511,6 +7510,7 @@ static int wc_PKCS7_DecryptOri(PKCS7* pkcs7, byte* in, word32 inSz,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NO_PWDBASED
|
||||||
|
|
||||||
/* decode ASN.1 PasswordRecipientInfo (pwri), return 0 on success,
|
/* decode ASN.1 PasswordRecipientInfo (pwri), return 0 on success,
|
||||||
* < 0 on error */
|
* < 0 on error */
|
||||||
@ -7718,6 +7718,7 @@ static int wc_PKCS7_DecryptPwri(PKCS7* pkcs7, byte* in, word32 inSz,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* NO_PWDBASED */
|
||||||
|
|
||||||
/* decode ASN.1 KEKRecipientInfo (kekri), return 0 on success,
|
/* decode ASN.1 KEKRecipientInfo (kekri), return 0 on success,
|
||||||
* < 0 on error */
|
* < 0 on error */
|
||||||
@ -8062,8 +8063,12 @@ static int wc_PKCS7_DecryptRecipientInfos(PKCS7* pkcs7, byte* in,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WC_PKCS7_DECRYPT_PWRI:
|
case WC_PKCS7_DECRYPT_PWRI:
|
||||||
|
#ifndef NO_PWDBASED
|
||||||
ret = wc_PKCS7_DecryptPwri(pkcs7, in, inSz, idx,
|
ret = wc_PKCS7_DecryptPwri(pkcs7, in, inSz, idx,
|
||||||
decryptedKey, decryptedKeySz, recipFound);
|
decryptedKey, decryptedKeySz, recipFound);
|
||||||
|
#else
|
||||||
|
return NOT_COMPILED_IN;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WC_PKCS7_DECRYPT_ORI:
|
case WC_PKCS7_DECRYPT_ORI:
|
||||||
@ -8174,6 +8179,7 @@ static int wc_PKCS7_DecryptRecipientInfos(PKCS7* pkcs7, byte* in,
|
|||||||
/* pwri is IMPLICIT[3] */
|
/* pwri is IMPLICIT[3] */
|
||||||
} else if (pkiMsg[*idx] == (ASN_CONSTRUCTED |
|
} else if (pkiMsg[*idx] == (ASN_CONSTRUCTED |
|
||||||
ASN_CONTEXT_SPECIFIC | 3)) {
|
ASN_CONTEXT_SPECIFIC | 3)) {
|
||||||
|
#ifndef NO_PWDBASED
|
||||||
(*idx)++;
|
(*idx)++;
|
||||||
|
|
||||||
if (GetLength(pkiMsg, idx, &version, pkiMsgSz) < 0)
|
if (GetLength(pkiMsg, idx, &version, pkiMsgSz) < 0)
|
||||||
@ -8199,6 +8205,9 @@ static int wc_PKCS7_DecryptRecipientInfos(PKCS7* pkcs7, byte* in,
|
|||||||
recipFound);
|
recipFound);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
#else
|
||||||
|
return NOT_COMPILED_IN;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ori is IMPLICIT[4] */
|
/* ori is IMPLICIT[4] */
|
||||||
} else if (pkiMsg[*idx] == (ASN_CONSTRUCTED |
|
} 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) {
|
} else if (testVectors[i].password != NULL) {
|
||||||
|
#ifndef NO_PWDBASED
|
||||||
/* PWRI recipient type */
|
/* PWRI recipient type */
|
||||||
|
|
||||||
ret = wc_PKCS7_Init(pkcs7, pkcs7->heap, pkcs7->devId);
|
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);
|
wc_PKCS7_Free(pkcs7);
|
||||||
return -9317;
|
return -9317;
|
||||||
}
|
}
|
||||||
|
#endif /* NO_PWDBASED */
|
||||||
|
|
||||||
} else if (testVectors[i].isOri == 1) {
|
} else if (testVectors[i].isOri == 1) {
|
||||||
/* ORI recipient type */
|
/* ORI recipient type */
|
||||||
@ -19880,6 +19882,7 @@ static int pkcs7authenveloped_run_vectors(byte* rsaCert, word32 rsaCertSz,
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else if (testVectors[i].password != NULL) {
|
} else if (testVectors[i].password != NULL) {
|
||||||
|
#ifndef NO_PWDBASED
|
||||||
/* PWRI recipient type */
|
/* PWRI recipient type */
|
||||||
|
|
||||||
ret = wc_PKCS7_Init(pkcs7, pkcs7->heap, pkcs7->devId);
|
ret = wc_PKCS7_Init(pkcs7, pkcs7->heap, pkcs7->devId);
|
||||||
@ -19919,6 +19922,7 @@ static int pkcs7authenveloped_run_vectors(byte* rsaCert, word32 rsaCertSz,
|
|||||||
return -9378;
|
return -9378;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* NO_PWDBASED */
|
||||||
} else if (testVectors[i].isOri == 1) {
|
} else if (testVectors[i].isOri == 1) {
|
||||||
/* ORI recipient type */
|
/* ORI recipient type */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user