mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 19:54:40 +02:00
Added PKCS7 PEM support: "-----BEGIN PKCS7-----" and "-----END PKCS7-----"
This commit is contained in:
@@ -24414,6 +24414,10 @@ wcchar END_ENC_PRIV_KEY = "-----END ENCRYPTED PRIVATE KEY-----";
|
|||||||
wcchar END_EC_PARAM = "-----END EC PARAMETERS-----";
|
wcchar END_EC_PARAM = "-----END EC PARAMETERS-----";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_PKCS7
|
||||||
|
wcchar BEGIN_PKCS7 = "-----BEGIN PKCS7-----";
|
||||||
|
wcchar END_PKCS7 = "-----END PKCS7-----";
|
||||||
|
#endif
|
||||||
#if defined(HAVE_ECC) || defined(HAVE_ED25519) || defined(HAVE_ED448) || \
|
#if defined(HAVE_ECC) || defined(HAVE_ED25519) || defined(HAVE_ED448) || \
|
||||||
!defined(NO_DSA)
|
!defined(NO_DSA)
|
||||||
wcchar BEGIN_DSA_PRIV = "-----BEGIN DSA PRIVATE KEY-----";
|
wcchar BEGIN_DSA_PRIV = "-----BEGIN DSA PRIVATE KEY-----";
|
||||||
@@ -24521,6 +24525,13 @@ int wc_PemGetHeaderFooter(int type, const char** header, const char** footer)
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_PKCS7
|
||||||
|
case PKCS7_TYPE:
|
||||||
|
if (header) *header = BEGIN_PKCS7;
|
||||||
|
if (footer) *footer = END_PKCS7;
|
||||||
|
ret = 0;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
#ifndef NO_DSA
|
#ifndef NO_DSA
|
||||||
case DSA_TYPE:
|
case DSA_TYPE:
|
||||||
case DSA_PRIVATEKEY_TYPE:
|
case DSA_PRIVATEKEY_TYPE:
|
||||||
@@ -25558,7 +25569,7 @@ int wc_CertPemToDer(const unsigned char* pem, int pemSz,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (type != CERT_TYPE && type != CHAIN_CERT_TYPE && type != CA_TYPE &&
|
if (type != CERT_TYPE && type != CHAIN_CERT_TYPE && type != CA_TYPE &&
|
||||||
type != CERTREQ_TYPE) {
|
type != CERTREQ_TYPE && type != PKCS7_TYPE) {
|
||||||
WOLFSSL_MSG("Bad cert type");
|
WOLFSSL_MSG("Bad cert type");
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
}
|
}
|
||||||
|
@@ -177,7 +177,8 @@ enum CertType {
|
|||||||
SPHINCS_SMALL_LEVEL3_TYPE,
|
SPHINCS_SMALL_LEVEL3_TYPE,
|
||||||
SPHINCS_SMALL_LEVEL5_TYPE,
|
SPHINCS_SMALL_LEVEL5_TYPE,
|
||||||
ECC_PARAM_TYPE,
|
ECC_PARAM_TYPE,
|
||||||
CHAIN_CERT_TYPE
|
CHAIN_CERT_TYPE,
|
||||||
|
PKCS7_TYPE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user