mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 11:17:29 +02:00
Merge pull request #6902 from dgarske/various_20231020
Fixes for PKCS w/out RSA and Cert/CSR signing with unknown OID
This commit is contained in:
@ -27647,6 +27647,7 @@ static int test_wc_PKCS7_EncodeDecodeEnvelopedData(void)
|
|||||||
tmpBytePtr = pkcs7->singleCert;
|
tmpBytePtr = pkcs7->singleCert;
|
||||||
pkcs7->singleCert = NULL;
|
pkcs7->singleCert = NULL;
|
||||||
}
|
}
|
||||||
|
#ifndef NO_RSA
|
||||||
#if defined(NO_PKCS7_STREAM)
|
#if defined(NO_PKCS7_STREAM)
|
||||||
/* when none streaming mode is used and PKCS7 is in bad state buffer error
|
/* when none streaming mode is used and PKCS7 is in bad state buffer error
|
||||||
* is returned from kari parse which gets set to bad func arg */
|
* is returned from kari parse which gets set to bad func arg */
|
||||||
@ -27658,6 +27659,7 @@ static int test_wc_PKCS7_EncodeDecodeEnvelopedData(void)
|
|||||||
(word32)sizeof(output), decoded, (word32)sizeof(decoded)),
|
(word32)sizeof(output), decoded, (word32)sizeof(decoded)),
|
||||||
ASN_PARSE_E);
|
ASN_PARSE_E);
|
||||||
#endif
|
#endif
|
||||||
|
#endif /* !NO_RSA */
|
||||||
if (pkcs7 != NULL) {
|
if (pkcs7 != NULL) {
|
||||||
pkcs7->singleCert = tmpBytePtr;
|
pkcs7->singleCert = tmpBytePtr;
|
||||||
}
|
}
|
||||||
|
@ -29007,6 +29007,12 @@ int AddSignature(byte* buf, int bodySz, const byte* sig, int sigSz,
|
|||||||
/* Set signature OID and signature data. */
|
/* Set signature OID and signature data. */
|
||||||
SetASN_OID(&dataASN[SIGASN_IDX_SIGALGO_OID], (word32)sigAlgoType,
|
SetASN_OID(&dataASN[SIGASN_IDX_SIGALGO_OID], (word32)sigAlgoType,
|
||||||
oidSigType);
|
oidSigType);
|
||||||
|
if (dataASN[SIGASN_IDX_SIGALGO_OID].data.buffer.data == NULL) {
|
||||||
|
/* The OID was not found or compiled in! */
|
||||||
|
ret = ASN_UNKNOWN_OID_E;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ret == 0) {
|
||||||
if (IsSigAlgoECC((word32)sigAlgoType)) {
|
if (IsSigAlgoECC((word32)sigAlgoType)) {
|
||||||
/* ECDSA and EdDSA doesn't have NULL tagged item. */
|
/* ECDSA and EdDSA doesn't have NULL tagged item. */
|
||||||
dataASN[SIGASN_IDX_SIGALGO_NULL].noOut = 1;
|
dataASN[SIGASN_IDX_SIGALGO_NULL].noOut = 1;
|
||||||
|
Reference in New Issue
Block a user