mirror of https://github.com/wolfSSL/wolfssl.git
additional fixes and peer review for -DOPENSSL_EXTRA -DOPENSSL_COEXIST: cover -DWOLFSSL_QUIC, fix -DNO_ASN, rename WOLFSSL_ASN1_TYPE_* to WOLFSSL_V_ASN1_*, completed nativization of NID_*, and switch to prefix WC_NID_ rather than wc_NID_.
parent
ca9d012a24
commit
a2bcbf7ecf
|
@ -29,16 +29,15 @@
|
|||
#include <wolfssl/options.h>
|
||||
#endif
|
||||
|
||||
#undef TEST_OPENSSL_COEXIST /* can't use this option with this example */
|
||||
#ifdef OPENSSL_EXTRA
|
||||
#undef OPENSSL_COEXIST /* can't use this option with this example */
|
||||
/* Force enable the compatibility macros for this example */
|
||||
#undef TEST_OPENSSL_COEXIST
|
||||
#undef OPENSSL_COEXIST
|
||||
#ifndef OPENSSL_EXTRA_X509_SMALL
|
||||
#define OPENSSL_EXTRA_X509_SMALL
|
||||
#endif
|
||||
|
||||
/* let's use cyassl layer AND cyassl openssl layer */
|
||||
#undef TEST_OPENSSL_COEXIST /* can't use this option with this example */
|
||||
#include <wolfssl/ssl.h>
|
||||
|
||||
/* Force enable the compatibility macros for this example */
|
||||
#ifdef WOLFSSL_DTLS
|
||||
#include <wolfssl/error-ssl.h>
|
||||
#endif
|
||||
|
@ -54,9 +53,6 @@
|
|||
|
||||
#include <wolfssl/test.h>
|
||||
|
||||
#ifndef OPENSSL_EXTRA_X509_SMALL
|
||||
#define OPENSSL_EXTRA_X509_SMALL
|
||||
#endif
|
||||
#include <wolfssl/openssl/ssl.h>
|
||||
|
||||
#include <examples/echoclient/echoclient.h>
|
||||
|
|
|
@ -234,7 +234,7 @@ static int wolfSSL_BIO_SSL_read(WOLFSSL_BIO* bio, void* buf,
|
|||
|
||||
static int wolfSSL_BIO_MD_read(WOLFSSL_BIO* bio, void* buf, int sz)
|
||||
{
|
||||
if (wolfSSL_EVP_MD_CTX_type(bio->ptr.md_ctx) == wc_NID_hmac) {
|
||||
if (wolfSSL_EVP_MD_CTX_type(bio->ptr.md_ctx) == WC_NID_hmac) {
|
||||
if (wolfSSL_EVP_DigestSignUpdate(bio->ptr.md_ctx, buf,
|
||||
(unsigned int)sz) != WOLFSSL_SUCCESS)
|
||||
{
|
||||
|
@ -642,7 +642,7 @@ static int wolfSSL_BIO_MD_write(WOLFSSL_BIO* bio, const void* data, int len)
|
|||
return BAD_FUNC_ARG;
|
||||
}
|
||||
|
||||
if (wolfSSL_EVP_MD_CTX_type(bio->ptr.md_ctx) == wc_NID_hmac) {
|
||||
if (wolfSSL_EVP_MD_CTX_type(bio->ptr.md_ctx) == WC_NID_hmac) {
|
||||
if (wolfSSL_EVP_DigestSignUpdate(bio->ptr.md_ctx, data,
|
||||
(unsigned int)len) != WOLFSSL_SUCCESS) {
|
||||
ret = WOLFSSL_BIO_ERROR;
|
||||
|
|
|
@ -12917,7 +12917,7 @@ static int CopyREQAttributes(WOLFSSL_X509* x509, DecodedCert* dCert)
|
|||
x509->challengePw[dCert->cPwdLen] = '\0';
|
||||
#if defined(OPENSSL_ALL) && defined(WOLFSSL_CERT_GEN)
|
||||
if (wolfSSL_X509_REQ_add1_attr_by_NID(x509,
|
||||
NID_pkcs9_challengePassword,
|
||||
WC_NID_pkcs9_challengePassword,
|
||||
MBSTRING_ASC,
|
||||
(const byte*)dCert->cPwd,
|
||||
dCert->cPwdLen) != WOLFSSL_SUCCESS) {
|
||||
|
@ -12939,7 +12939,7 @@ static int CopyREQAttributes(WOLFSSL_X509* x509, DecodedCert* dCert)
|
|||
}
|
||||
#if defined(OPENSSL_ALL) && defined(WOLFSSL_CERT_GEN)
|
||||
if (wolfSSL_X509_REQ_add1_attr_by_NID(x509,
|
||||
NID_pkcs9_contentType,
|
||||
WC_NID_pkcs9_contentType,
|
||||
MBSTRING_ASC,
|
||||
(const byte*)dCert->contentType,
|
||||
dCert->contentTypeLen) !=
|
||||
|
@ -12953,7 +12953,7 @@ static int CopyREQAttributes(WOLFSSL_X509* x509, DecodedCert* dCert)
|
|||
#if defined(OPENSSL_ALL) && defined(WOLFSSL_CERT_GEN)
|
||||
if (dCert->sNum) {
|
||||
if (wolfSSL_X509_REQ_add1_attr_by_NID(x509,
|
||||
NID_serialNumber,
|
||||
WC_NID_serialNumber,
|
||||
MBSTRING_ASC,
|
||||
(const byte*)dCert->sNum,
|
||||
dCert->sNumLen) != WOLFSSL_SUCCESS) {
|
||||
|
@ -12963,7 +12963,7 @@ static int CopyREQAttributes(WOLFSSL_X509* x509, DecodedCert* dCert)
|
|||
}
|
||||
if (dCert->unstructuredName) {
|
||||
if (wolfSSL_X509_REQ_add1_attr_by_NID(x509,
|
||||
NID_pkcs9_unstructuredName,
|
||||
WC_NID_pkcs9_unstructuredName,
|
||||
MBSTRING_ASC,
|
||||
(const byte*)dCert->unstructuredName,
|
||||
dCert->unstructuredNameLen)
|
||||
|
@ -12974,7 +12974,7 @@ static int CopyREQAttributes(WOLFSSL_X509* x509, DecodedCert* dCert)
|
|||
}
|
||||
if (dCert->surname) {
|
||||
if (wolfSSL_X509_REQ_add1_attr_by_NID(x509,
|
||||
NID_surname,
|
||||
WC_NID_surname,
|
||||
MBSTRING_ASC,
|
||||
(const byte*)dCert->surname,
|
||||
dCert->surnameLen) != WOLFSSL_SUCCESS) {
|
||||
|
@ -12984,7 +12984,7 @@ static int CopyREQAttributes(WOLFSSL_X509* x509, DecodedCert* dCert)
|
|||
}
|
||||
if (dCert->givenName) {
|
||||
if (wolfSSL_X509_REQ_add1_attr_by_NID(x509,
|
||||
NID_givenName,
|
||||
WC_NID_givenName,
|
||||
MBSTRING_ASC,
|
||||
(const byte*)dCert->givenName,
|
||||
dCert->givenNameLen) != WOLFSSL_SUCCESS) {
|
||||
|
@ -12994,7 +12994,7 @@ static int CopyREQAttributes(WOLFSSL_X509* x509, DecodedCert* dCert)
|
|||
}
|
||||
if (dCert->dnQualifier) {
|
||||
if (wolfSSL_X509_REQ_add1_attr_by_NID(x509,
|
||||
NID_dnQualifier,
|
||||
WC_NID_dnQualifier,
|
||||
MBSTRING_ASC,
|
||||
(const byte*)dCert->dnQualifier,
|
||||
dCert->dnQualifierLen) != WOLFSSL_SUCCESS) {
|
||||
|
@ -13004,7 +13004,7 @@ static int CopyREQAttributes(WOLFSSL_X509* x509, DecodedCert* dCert)
|
|||
}
|
||||
if (dCert->initials) {
|
||||
if (wolfSSL_X509_REQ_add1_attr_by_NID(x509,
|
||||
NID_initials,
|
||||
WC_NID_initials,
|
||||
MBSTRING_ASC,
|
||||
(const byte*)dCert->initials,
|
||||
dCert->initialsLen) != WOLFSSL_SUCCESS) {
|
||||
|
|
182
src/pk.c
182
src/pk.c
|
@ -3858,7 +3858,7 @@ static int wolfssl_rsa_sig_encode(int hashAlg, const unsigned char* hash,
|
|||
ret = 0;
|
||||
}
|
||||
|
||||
if ((ret == 1) && (hashAlg != wc_NID_undef) &&
|
||||
if ((ret == 1) && (hashAlg != WC_NID_undef) &&
|
||||
(padding == WC_RSA_PKCS1_PADDING)) {
|
||||
/* Convert hash algorithm to hash type for PKCS#1.5 padding. */
|
||||
hType = (int)nid2oid(hashAlg, oidHashType);
|
||||
|
@ -6509,17 +6509,17 @@ static int wolfssl_dh_set_nid(WOLFSSL_DH* dh, int nid)
|
|||
* FIPS v2 module */
|
||||
switch (nid) {
|
||||
#ifdef HAVE_FFDHE_2048
|
||||
case wc_NID_ffdhe2048:
|
||||
case WC_NID_ffdhe2048:
|
||||
params = wc_Dh_ffdhe2048_Get();
|
||||
break;
|
||||
#endif /* HAVE_FFDHE_2048 */
|
||||
#ifdef HAVE_FFDHE_3072
|
||||
case wc_NID_ffdhe3072:
|
||||
case WC_NID_ffdhe3072:
|
||||
params = wc_Dh_ffdhe3072_Get();
|
||||
break;
|
||||
#endif /* HAVE_FFDHE_3072 */
|
||||
#ifdef HAVE_FFDHE_4096
|
||||
case wc_NID_ffdhe4096:
|
||||
case WC_NID_ffdhe4096:
|
||||
params = wc_Dh_ffdhe4096_Get();
|
||||
break;
|
||||
#endif /* HAVE_FFDHE_4096 */
|
||||
|
@ -6605,17 +6605,17 @@ static int wolfssl_dh_set_nid(WOLFSSL_DH* dh, int nid)
|
|||
|
||||
switch (nid) {
|
||||
#ifdef HAVE_FFDHE_2048
|
||||
case NID_ffdhe2048:
|
||||
case WC_NID_ffdhe2048:
|
||||
name = WC_FFDHE_2048;
|
||||
break;
|
||||
#endif /* HAVE_FFDHE_2048 */
|
||||
#ifdef HAVE_FFDHE_3072
|
||||
case NID_ffdhe3072:
|
||||
case WC_NID_ffdhe3072:
|
||||
name = WC_FFDHE_3072;
|
||||
break;
|
||||
#endif /* HAVE_FFDHE_3072 */
|
||||
#ifdef HAVE_FFDHE_4096
|
||||
case NID_ffdhe4096:
|
||||
case WC_NID_ffdhe4096:
|
||||
name = WC_FFDHE_4096;
|
||||
break;
|
||||
#endif /* HAVE_FFDHE_4096 */
|
||||
|
@ -9029,7 +9029,7 @@ int wolfSSL_EC_METHOD_get_field_type(const WOLFSSL_EC_METHOD *meth)
|
|||
|
||||
if (meth != NULL) {
|
||||
/* Only field type supported by code base. */
|
||||
nid = wc_NID_X9_62_prime_field;
|
||||
nid = WC_NID_X9_62_prime_field;
|
||||
}
|
||||
|
||||
return nid;
|
||||
|
@ -9053,62 +9053,62 @@ int EccEnumToNID(int n)
|
|||
|
||||
switch(n) {
|
||||
case ECC_SECP192R1:
|
||||
return wc_NID_X9_62_prime192v1;
|
||||
return WC_NID_X9_62_prime192v1;
|
||||
case ECC_PRIME192V2:
|
||||
return wc_NID_X9_62_prime192v2;
|
||||
return WC_NID_X9_62_prime192v2;
|
||||
case ECC_PRIME192V3:
|
||||
return wc_NID_X9_62_prime192v3;
|
||||
return WC_NID_X9_62_prime192v3;
|
||||
case ECC_PRIME239V1:
|
||||
return wc_NID_X9_62_prime239v1;
|
||||
return WC_NID_X9_62_prime239v1;
|
||||
case ECC_PRIME239V2:
|
||||
return wc_NID_X9_62_prime239v2;
|
||||
return WC_NID_X9_62_prime239v2;
|
||||
case ECC_PRIME239V3:
|
||||
return wc_NID_X9_62_prime239v3;
|
||||
return WC_NID_X9_62_prime239v3;
|
||||
case ECC_SECP256R1:
|
||||
return wc_NID_X9_62_prime256v1;
|
||||
return WC_NID_X9_62_prime256v1;
|
||||
case ECC_SECP112R1:
|
||||
return wc_NID_secp112r1;
|
||||
return WC_NID_secp112r1;
|
||||
case ECC_SECP112R2:
|
||||
return wc_NID_secp112r2;
|
||||
return WC_NID_secp112r2;
|
||||
case ECC_SECP128R1:
|
||||
return wc_NID_secp128r1;
|
||||
return WC_NID_secp128r1;
|
||||
case ECC_SECP128R2:
|
||||
return wc_NID_secp128r2;
|
||||
return WC_NID_secp128r2;
|
||||
case ECC_SECP160R1:
|
||||
return wc_NID_secp160r1;
|
||||
return WC_NID_secp160r1;
|
||||
case ECC_SECP160R2:
|
||||
return wc_NID_secp160r2;
|
||||
return WC_NID_secp160r2;
|
||||
case ECC_SECP224R1:
|
||||
return wc_NID_secp224r1;
|
||||
return WC_NID_secp224r1;
|
||||
case ECC_SECP384R1:
|
||||
return wc_NID_secp384r1;
|
||||
return WC_NID_secp384r1;
|
||||
case ECC_SECP521R1:
|
||||
return wc_NID_secp521r1;
|
||||
return WC_NID_secp521r1;
|
||||
case ECC_SECP160K1:
|
||||
return wc_NID_secp160k1;
|
||||
return WC_NID_secp160k1;
|
||||
case ECC_SECP192K1:
|
||||
return wc_NID_secp192k1;
|
||||
return WC_NID_secp192k1;
|
||||
case ECC_SECP224K1:
|
||||
return wc_NID_secp224k1;
|
||||
return WC_NID_secp224k1;
|
||||
case ECC_SECP256K1:
|
||||
return wc_NID_secp256k1;
|
||||
return WC_NID_secp256k1;
|
||||
case ECC_BRAINPOOLP160R1:
|
||||
return wc_NID_brainpoolP160r1;
|
||||
return WC_NID_brainpoolP160r1;
|
||||
case ECC_BRAINPOOLP192R1:
|
||||
return wc_NID_brainpoolP192r1;
|
||||
return WC_NID_brainpoolP192r1;
|
||||
case ECC_BRAINPOOLP224R1:
|
||||
return wc_NID_brainpoolP224r1;
|
||||
return WC_NID_brainpoolP224r1;
|
||||
case ECC_BRAINPOOLP256R1:
|
||||
return wc_NID_brainpoolP256r1;
|
||||
return WC_NID_brainpoolP256r1;
|
||||
case ECC_BRAINPOOLP320R1:
|
||||
return wc_NID_brainpoolP320r1;
|
||||
return WC_NID_brainpoolP320r1;
|
||||
case ECC_BRAINPOOLP384R1:
|
||||
return wc_NID_brainpoolP384r1;
|
||||
return WC_NID_brainpoolP384r1;
|
||||
case ECC_BRAINPOOLP512R1:
|
||||
return wc_NID_brainpoolP512r1;
|
||||
return WC_NID_brainpoolP512r1;
|
||||
#ifdef WOLFSSL_SM2
|
||||
case ECC_SM2P256V1:
|
||||
return wc_NID_sm2;
|
||||
return WC_NID_sm2;
|
||||
#endif
|
||||
default:
|
||||
WOLFSSL_MSG("NID not found");
|
||||
|
@ -9133,85 +9133,85 @@ int NIDToEccEnum(int nid)
|
|||
WOLFSSL_ENTER("NIDToEccEnum");
|
||||
|
||||
switch (nid) {
|
||||
case wc_NID_X9_62_prime192v1:
|
||||
case WC_NID_X9_62_prime192v1:
|
||||
id = ECC_SECP192R1;
|
||||
break;
|
||||
case wc_NID_X9_62_prime192v2:
|
||||
case WC_NID_X9_62_prime192v2:
|
||||
id = ECC_PRIME192V2;
|
||||
break;
|
||||
case wc_NID_X9_62_prime192v3:
|
||||
case WC_NID_X9_62_prime192v3:
|
||||
id = ECC_PRIME192V3;
|
||||
break;
|
||||
case wc_NID_X9_62_prime239v1:
|
||||
case WC_NID_X9_62_prime239v1:
|
||||
id = ECC_PRIME239V1;
|
||||
break;
|
||||
case wc_NID_X9_62_prime239v2:
|
||||
case WC_NID_X9_62_prime239v2:
|
||||
id = ECC_PRIME239V2;
|
||||
break;
|
||||
case wc_NID_X9_62_prime239v3:
|
||||
case WC_NID_X9_62_prime239v3:
|
||||
id = ECC_PRIME239V3;
|
||||
break;
|
||||
case wc_NID_X9_62_prime256v1:
|
||||
case WC_NID_X9_62_prime256v1:
|
||||
id = ECC_SECP256R1;
|
||||
break;
|
||||
case wc_NID_secp112r1:
|
||||
case WC_NID_secp112r1:
|
||||
id = ECC_SECP112R1;
|
||||
break;
|
||||
case wc_NID_secp112r2:
|
||||
case WC_NID_secp112r2:
|
||||
id = ECC_SECP112R2;
|
||||
break;
|
||||
case wc_NID_secp128r1:
|
||||
case WC_NID_secp128r1:
|
||||
id = ECC_SECP128R1;
|
||||
break;
|
||||
case wc_NID_secp128r2:
|
||||
case WC_NID_secp128r2:
|
||||
id = ECC_SECP128R2;
|
||||
break;
|
||||
case wc_NID_secp160r1:
|
||||
case WC_NID_secp160r1:
|
||||
id = ECC_SECP160R1;
|
||||
break;
|
||||
case wc_NID_secp160r2:
|
||||
case WC_NID_secp160r2:
|
||||
id = ECC_SECP160R2;
|
||||
break;
|
||||
case wc_NID_secp224r1:
|
||||
case WC_NID_secp224r1:
|
||||
id = ECC_SECP224R1;
|
||||
break;
|
||||
case wc_NID_secp384r1:
|
||||
case WC_NID_secp384r1:
|
||||
id = ECC_SECP384R1;
|
||||
break;
|
||||
case wc_NID_secp521r1:
|
||||
case WC_NID_secp521r1:
|
||||
id = ECC_SECP521R1;
|
||||
break;
|
||||
case wc_NID_secp160k1:
|
||||
case WC_NID_secp160k1:
|
||||
id = ECC_SECP160K1;
|
||||
break;
|
||||
case wc_NID_secp192k1:
|
||||
case WC_NID_secp192k1:
|
||||
id = ECC_SECP192K1;
|
||||
break;
|
||||
case wc_NID_secp224k1:
|
||||
case WC_NID_secp224k1:
|
||||
id = ECC_SECP224K1;
|
||||
break;
|
||||
case wc_NID_secp256k1:
|
||||
case WC_NID_secp256k1:
|
||||
id = ECC_SECP256K1;
|
||||
break;
|
||||
case wc_NID_brainpoolP160r1:
|
||||
case WC_NID_brainpoolP160r1:
|
||||
id = ECC_BRAINPOOLP160R1;
|
||||
break;
|
||||
case wc_NID_brainpoolP192r1:
|
||||
case WC_NID_brainpoolP192r1:
|
||||
id = ECC_BRAINPOOLP192R1;
|
||||
break;
|
||||
case wc_NID_brainpoolP224r1:
|
||||
case WC_NID_brainpoolP224r1:
|
||||
id = ECC_BRAINPOOLP224R1;
|
||||
break;
|
||||
case wc_NID_brainpoolP256r1:
|
||||
case WC_NID_brainpoolP256r1:
|
||||
id = ECC_BRAINPOOLP256R1;
|
||||
break;
|
||||
case wc_NID_brainpoolP320r1:
|
||||
case WC_NID_brainpoolP320r1:
|
||||
id = ECC_BRAINPOOLP320R1;
|
||||
break;
|
||||
case wc_NID_brainpoolP384r1:
|
||||
case WC_NID_brainpoolP384r1:
|
||||
id = ECC_BRAINPOOLP384R1;
|
||||
break;
|
||||
case wc_NID_brainpoolP512r1:
|
||||
case WC_NID_brainpoolP512r1:
|
||||
id = ECC_BRAINPOOLP512R1;
|
||||
break;
|
||||
default:
|
||||
|
@ -9623,53 +9623,53 @@ int wolfSSL_EC_GROUP_get_degree(const WOLFSSL_EC_GROUP *group)
|
|||
}
|
||||
else {
|
||||
switch (group->curve_nid) {
|
||||
case wc_NID_secp112r1:
|
||||
case wc_NID_secp112r2:
|
||||
case WC_NID_secp112r1:
|
||||
case WC_NID_secp112r2:
|
||||
degree = 112;
|
||||
break;
|
||||
case wc_NID_secp128r1:
|
||||
case wc_NID_secp128r2:
|
||||
case WC_NID_secp128r1:
|
||||
case WC_NID_secp128r2:
|
||||
degree = 128;
|
||||
break;
|
||||
case wc_NID_secp160k1:
|
||||
case wc_NID_secp160r1:
|
||||
case wc_NID_secp160r2:
|
||||
case wc_NID_brainpoolP160r1:
|
||||
case WC_NID_secp160k1:
|
||||
case WC_NID_secp160r1:
|
||||
case WC_NID_secp160r2:
|
||||
case WC_NID_brainpoolP160r1:
|
||||
degree = 160;
|
||||
break;
|
||||
case wc_NID_secp192k1:
|
||||
case wc_NID_brainpoolP192r1:
|
||||
case wc_NID_X9_62_prime192v1:
|
||||
case wc_NID_X9_62_prime192v2:
|
||||
case wc_NID_X9_62_prime192v3:
|
||||
case WC_NID_secp192k1:
|
||||
case WC_NID_brainpoolP192r1:
|
||||
case WC_NID_X9_62_prime192v1:
|
||||
case WC_NID_X9_62_prime192v2:
|
||||
case WC_NID_X9_62_prime192v3:
|
||||
degree = 192;
|
||||
break;
|
||||
case wc_NID_secp224k1:
|
||||
case wc_NID_secp224r1:
|
||||
case wc_NID_brainpoolP224r1:
|
||||
case WC_NID_secp224k1:
|
||||
case WC_NID_secp224r1:
|
||||
case WC_NID_brainpoolP224r1:
|
||||
degree = 224;
|
||||
break;
|
||||
case wc_NID_X9_62_prime239v1:
|
||||
case wc_NID_X9_62_prime239v2:
|
||||
case wc_NID_X9_62_prime239v3:
|
||||
case WC_NID_X9_62_prime239v1:
|
||||
case WC_NID_X9_62_prime239v2:
|
||||
case WC_NID_X9_62_prime239v3:
|
||||
degree = 239;
|
||||
break;
|
||||
case wc_NID_secp256k1:
|
||||
case wc_NID_brainpoolP256r1:
|
||||
case wc_NID_X9_62_prime256v1:
|
||||
case WC_NID_secp256k1:
|
||||
case WC_NID_brainpoolP256r1:
|
||||
case WC_NID_X9_62_prime256v1:
|
||||
degree = 256;
|
||||
break;
|
||||
case wc_NID_brainpoolP320r1:
|
||||
case WC_NID_brainpoolP320r1:
|
||||
degree = 320;
|
||||
break;
|
||||
case wc_NID_secp384r1:
|
||||
case wc_NID_brainpoolP384r1:
|
||||
case WC_NID_secp384r1:
|
||||
case WC_NID_brainpoolP384r1:
|
||||
degree = 384;
|
||||
break;
|
||||
case wc_NID_brainpoolP512r1:
|
||||
case WC_NID_brainpoolP512r1:
|
||||
degree = 512;
|
||||
break;
|
||||
case wc_NID_secp521r1:
|
||||
case WC_NID_secp521r1:
|
||||
degree = 521;
|
||||
break;
|
||||
}
|
||||
|
@ -11858,7 +11858,7 @@ WOLFSSL_EC_KEY *wolfSSL_EC_KEY_new_ex(void* heap, int devId)
|
|||
|
||||
if (!err) {
|
||||
/* Group unknown at creation */
|
||||
key->group = wolfSSL_EC_GROUP_new_by_curve_name(wc_NID_undef);
|
||||
key->group = wolfSSL_EC_GROUP_new_by_curve_name(WC_NID_undef);
|
||||
if (key->group == NULL) {
|
||||
WOLFSSL_MSG("wolfSSL_EC_KEY_new malloc WOLFSSL_EC_GROUP failure");
|
||||
err = 1;
|
||||
|
|
20
src/quic.c
20
src/quic.c
|
@ -1193,7 +1193,7 @@ int wolfSSL_quic_hkdf_extract(uint8_t* dest, const WOLFSSL_EVP_MD* md,
|
|||
|
||||
WOLFSSL_ENTER("wolfSSL_quic_hkdf_extract");
|
||||
|
||||
pctx = wolfSSL_EVP_PKEY_CTX_new_id(NID_hkdf, NULL);
|
||||
pctx = wolfSSL_EVP_PKEY_CTX_new_id(WC_NID_hkdf, NULL);
|
||||
if (pctx == NULL) {
|
||||
ret = WOLFSSL_FAILURE;
|
||||
goto cleanup;
|
||||
|
@ -1201,7 +1201,7 @@ int wolfSSL_quic_hkdf_extract(uint8_t* dest, const WOLFSSL_EVP_MD* md,
|
|||
|
||||
if (wolfSSL_EVP_PKEY_derive_init(pctx) != WOLFSSL_SUCCESS
|
||||
|| wolfSSL_EVP_PKEY_CTX_hkdf_mode(
|
||||
pctx, EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY) != WOLFSSL_SUCCESS
|
||||
pctx, WOLFSSL_EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY) != WOLFSSL_SUCCESS
|
||||
|| wolfSSL_EVP_PKEY_CTX_set_hkdf_md(pctx, md) != WOLFSSL_SUCCESS
|
||||
|| wolfSSL_EVP_PKEY_CTX_set1_hkdf_salt(
|
||||
pctx, (byte*)salt, (int)saltlen) != WOLFSSL_SUCCESS
|
||||
|
@ -1230,7 +1230,7 @@ int wolfSSL_quic_hkdf_expand(uint8_t* dest, size_t destlen,
|
|||
|
||||
WOLFSSL_ENTER("wolfSSL_quic_hkdf_expand");
|
||||
|
||||
pctx = wolfSSL_EVP_PKEY_CTX_new_id(NID_hkdf, NULL);
|
||||
pctx = wolfSSL_EVP_PKEY_CTX_new_id(WC_NID_hkdf, NULL);
|
||||
if (pctx == NULL) {
|
||||
ret = WOLFSSL_FAILURE;
|
||||
goto cleanup;
|
||||
|
@ -1238,7 +1238,7 @@ int wolfSSL_quic_hkdf_expand(uint8_t* dest, size_t destlen,
|
|||
|
||||
if (wolfSSL_EVP_PKEY_derive_init(pctx) != WOLFSSL_SUCCESS
|
||||
|| wolfSSL_EVP_PKEY_CTX_hkdf_mode(
|
||||
pctx, EVP_PKEY_HKDEF_MODE_EXPAND_ONLY) != WOLFSSL_SUCCESS
|
||||
pctx, WOLFSSL_EVP_PKEY_HKDEF_MODE_EXPAND_ONLY) != WOLFSSL_SUCCESS
|
||||
|| wolfSSL_EVP_PKEY_CTX_set_hkdf_md(pctx, md) != WOLFSSL_SUCCESS
|
||||
|| wolfSSL_EVP_PKEY_CTX_set1_hkdf_salt(
|
||||
pctx, (byte*)"", 0) != WOLFSSL_SUCCESS
|
||||
|
@ -1253,7 +1253,7 @@ int wolfSSL_quic_hkdf_expand(uint8_t* dest, size_t destlen,
|
|||
|
||||
cleanup:
|
||||
if (pctx)
|
||||
EVP_PKEY_CTX_free(pctx);
|
||||
wolfSSL_EVP_PKEY_CTX_free(pctx);
|
||||
WOLFSSL_LEAVE("wolfSSL_quic_hkdf_expand", ret);
|
||||
return ret;
|
||||
}
|
||||
|
@ -1270,7 +1270,7 @@ int wolfSSL_quic_hkdf(uint8_t* dest, size_t destlen,
|
|||
|
||||
WOLFSSL_ENTER("wolfSSL_quic_hkdf");
|
||||
|
||||
pctx = wolfSSL_EVP_PKEY_CTX_new_id(NID_hkdf, NULL);
|
||||
pctx = wolfSSL_EVP_PKEY_CTX_new_id(WC_NID_hkdf, NULL);
|
||||
if (pctx == NULL) {
|
||||
ret = WOLFSSL_FAILURE;
|
||||
goto cleanup;
|
||||
|
@ -1278,7 +1278,7 @@ int wolfSSL_quic_hkdf(uint8_t* dest, size_t destlen,
|
|||
|
||||
if (wolfSSL_EVP_PKEY_derive_init(pctx) != WOLFSSL_SUCCESS
|
||||
|| wolfSSL_EVP_PKEY_CTX_hkdf_mode(
|
||||
pctx, EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND) != WOLFSSL_SUCCESS
|
||||
pctx, WOLFSSL_EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND) != WOLFSSL_SUCCESS
|
||||
|| wolfSSL_EVP_PKEY_CTX_set_hkdf_md(pctx, md) != WOLFSSL_SUCCESS
|
||||
|| wolfSSL_EVP_PKEY_CTX_set1_hkdf_salt(
|
||||
pctx, (byte*)salt, (int)saltlen) != WOLFSSL_SUCCESS
|
||||
|
@ -1293,7 +1293,7 @@ int wolfSSL_quic_hkdf(uint8_t* dest, size_t destlen,
|
|||
|
||||
cleanup:
|
||||
if (pctx)
|
||||
EVP_PKEY_CTX_free(pctx);
|
||||
wolfSSL_EVP_PKEY_CTX_free(pctx);
|
||||
WOLFSSL_LEAVE("wolfSSL_quic_hkdf", ret);
|
||||
return ret;
|
||||
}
|
||||
|
@ -1346,7 +1346,7 @@ int wolfSSL_quic_aead_encrypt(uint8_t* dest, WOLFSSL_EVP_CIPHER_CTX* ctx,
|
|||
ctx, dest, &len, plain, (int)plainlen) != WOLFSSL_SUCCESS
|
||||
|| wolfSSL_EVP_CipherFinal(ctx, dest + len, &len) != WOLFSSL_SUCCESS
|
||||
|| wolfSSL_EVP_CIPHER_CTX_ctrl(
|
||||
ctx, EVP_CTRL_AEAD_GET_TAG, ctx->authTagSz, dest + plainlen)
|
||||
ctx, WOLFSSL_EVP_CTRL_AEAD_GET_TAG, ctx->authTagSz, dest + plainlen)
|
||||
!= WOLFSSL_SUCCESS) {
|
||||
return WOLFSSL_FAILURE;
|
||||
}
|
||||
|
@ -1373,7 +1373,7 @@ int wolfSSL_quic_aead_decrypt(uint8_t* dest, WOLFSSL_EVP_CIPHER_CTX* ctx,
|
|||
|
||||
if (wolfSSL_EVP_CipherInit(ctx, NULL, NULL, iv, 0) != WOLFSSL_SUCCESS
|
||||
|| wolfSSL_EVP_CIPHER_CTX_ctrl(
|
||||
ctx, EVP_CTRL_AEAD_SET_TAG, ctx->authTagSz, (uint8_t*)tag)
|
||||
ctx, WOLFSSL_EVP_CTRL_AEAD_SET_TAG, ctx->authTagSz, (uint8_t*)tag)
|
||||
!= WOLFSSL_SUCCESS
|
||||
|| wolfSSL_EVP_CipherUpdate(ctx, NULL, &len, aad, (int)aadlen)
|
||||
!= WOLFSSL_SUCCESS
|
||||
|
|
130
src/ssl_asn1.c
130
src/ssl_asn1.c
|
@ -1019,7 +1019,7 @@ static void wolfssl_asn1_integer_reset_data(WOLFSSL_ASN1_INTEGER* a)
|
|||
/* No data, not negative. */
|
||||
a->negative = 0;
|
||||
/* Set type to positive INTEGER. */
|
||||
a->type = WOLFSSL_ASN1_TYPE_INTEGER;
|
||||
a->type = WOLFSSL_V_ASN1_INTEGER;
|
||||
}
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
|
||||
|
@ -1318,7 +1318,7 @@ WOLFSSL_ASN1_INTEGER* wolfSSL_d2i_ASN1_INTEGER(WOLFSSL_ASN1_INTEGER** a,
|
|||
}
|
||||
if (!err) {
|
||||
/* Set type. */
|
||||
ret->type = WOLFSSL_ASN1_TYPE_INTEGER;
|
||||
ret->type = WOLFSSL_V_ASN1_INTEGER;
|
||||
|
||||
/* Copy DER encoding and length. */
|
||||
XMEMCPY(ret->data, *in, (size_t)(idx + (word32)len));
|
||||
|
@ -1331,7 +1331,7 @@ WOLFSSL_ASN1_INTEGER* wolfSSL_d2i_ASN1_INTEGER(WOLFSSL_ASN1_INTEGER** a,
|
|||
}
|
||||
if ((!err) && ret->negative) {
|
||||
/* Update type if number was negative. */
|
||||
ret->type |= WOLFSSL_ASN1_TYPE_NEG_INTEGER;
|
||||
ret->type |= WOLFSSL_V_ASN1_NEG_INTEGER;
|
||||
}
|
||||
|
||||
if (err) {
|
||||
|
@ -1751,10 +1751,10 @@ WOLFSSL_ASN1_INTEGER* wolfSSL_BN_to_ASN1_INTEGER(const WOLFSSL_BIGNUM *bn,
|
|||
int length;
|
||||
|
||||
/* Set type and negative. */
|
||||
a->type = WOLFSSL_ASN1_TYPE_INTEGER;
|
||||
a->type = WOLFSSL_V_ASN1_INTEGER;
|
||||
if (wolfSSL_BN_is_negative(bn) && !wolfSSL_BN_is_zero(bn)) {
|
||||
a->negative = 1;
|
||||
a->type |= WOLFSSL_ASN1_TYPE_NEG_INTEGER;
|
||||
a->type |= WOLFSSL_V_ASN1_NEG_INTEGER;
|
||||
}
|
||||
|
||||
/* Get length in bytes of encoded number. */
|
||||
|
@ -1883,7 +1883,7 @@ int wolfSSL_ASN1_INTEGER_set(WOLFSSL_ASN1_INTEGER *a, long v)
|
|||
if (v < 0) {
|
||||
/* Set negative and 2's complement the value. */
|
||||
a->negative = 1;
|
||||
a->type |= WOLFSSL_ASN1_TYPE_NEG;
|
||||
a->type |= WOLFSSL_V_ASN1_NEG;
|
||||
v = -v;
|
||||
}
|
||||
|
||||
|
@ -2651,7 +2651,7 @@ int wolfSSL_ASN1_UNIVERSALSTRING_to_string(WOLFSSL_ASN1_STRING *s)
|
|||
}
|
||||
|
||||
/* Check type of ASN.1 STRING. */
|
||||
if ((ret == 1) && (s->type != WOLFSSL_ASN1_TYPE_UNIVERSALSTRING)) {
|
||||
if ((ret == 1) && (s->type != WOLFSSL_V_ASN1_UNIVERSALSTRING)) {
|
||||
WOLFSSL_MSG("Input is not a universal string");
|
||||
ret = 0;
|
||||
}
|
||||
|
@ -2685,7 +2685,7 @@ int wolfSSL_ASN1_UNIVERSALSTRING_to_string(WOLFSSL_ASN1_STRING *s)
|
|||
*copy = '\0';
|
||||
/* Update length and type. */
|
||||
s->length /= 4;
|
||||
s->type = WOLFSSL_ASN1_TYPE_PRINTABLESTRING;
|
||||
s->type = WOLFSSL_V_ASN1_PRINTABLESTRING;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -3208,7 +3208,7 @@ int wolfSSL_ASN1_STRING_canon(WOLFSSL_ASN1_STRING* asn_out,
|
|||
if (ret == 1) {
|
||||
switch (asn_in->type) {
|
||||
case WOLFSSL_MBSTRING_UTF8:
|
||||
case WOLFSSL_ASN1_TYPE_PRINTABLESTRING:
|
||||
case WOLFSSL_V_ASN1_PRINTABLESTRING:
|
||||
/* Set type to UTF8. */
|
||||
asn_out->type = WOLFSSL_MBSTRING_UTF8;
|
||||
/* Dispose of any dynamic data already in asn_out. */
|
||||
|
@ -3327,8 +3327,8 @@ const char* wolfSSL_ASN1_tag2str(int tag)
|
|||
const char* str = "(unknown)";
|
||||
|
||||
/* Clear negative flag. */
|
||||
if ((tag == WOLFSSL_ASN1_TYPE_NEG_INTEGER) || (tag == WOLFSSL_ASN1_TYPE_NEG_ENUMERATED)) {
|
||||
tag &= ~WOLFSSL_ASN1_TYPE_NEG;
|
||||
if ((tag == WOLFSSL_V_ASN1_NEG_INTEGER) || (tag == WOLFSSL_V_ASN1_NEG_ENUMERATED)) {
|
||||
tag &= ~WOLFSSL_V_ASN1_NEG;
|
||||
}
|
||||
/* Check for known basic types. */
|
||||
if ((tag >= 0) && (tag <= 30)) {
|
||||
|
@ -3621,7 +3621,7 @@ int wolfSSL_ASN1_GENERALIZEDTIME_print(WOLFSSL_BIO* bio,
|
|||
ret = BAD_FUNC_ARG;
|
||||
}
|
||||
/* Check type is GENERALIZED TIME. */
|
||||
if ((ret == 1) && (asnTime->type != WOLFSSL_ASN1_TYPE_GENERALIZEDTIME)) {
|
||||
if ((ret == 1) && (asnTime->type != WOLFSSL_V_ASN1_GENERALIZEDTIME)) {
|
||||
WOLFSSL_MSG("Error, not GENERALIZED_TIME");
|
||||
ret = 0;
|
||||
}
|
||||
|
@ -4036,8 +4036,8 @@ int wolfSSL_ASN1_TIME_set_string(WOLFSSL_ASN1_TIME *t, const char *str)
|
|||
/* Do not include NUL terminator in length. */
|
||||
t->length = slen - 1;
|
||||
/* Set ASN.1 type based on string length. */
|
||||
t->type = ((slen == ASN_UTC_TIME_SIZE) ? WOLFSSL_ASN1_TYPE_UTCTIME :
|
||||
WOLFSSL_ASN1_TYPE_GENERALIZEDTIME);
|
||||
t->type = ((slen == ASN_UTC_TIME_SIZE) ? WOLFSSL_V_ASN1_UTCTIME :
|
||||
WOLFSSL_V_ASN1_GENERALIZEDTIME);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -4078,8 +4078,8 @@ WOLFSSL_ASN1_TIME* wolfSSL_ASN1_TIME_to_generalizedtime(WOLFSSL_ASN1_TIME *t,
|
|||
WOLFSSL_MSG("Invalid ASN_TIME value");
|
||||
}
|
||||
/* Ensure ASN.1 type is one that is supported. */
|
||||
else if ((t->type != WOLFSSL_ASN1_TYPE_UTCTIME) &&
|
||||
(t->type != WOLFSSL_ASN1_TYPE_GENERALIZEDTIME)) {
|
||||
else if ((t->type != WOLFSSL_V_ASN1_UTCTIME) &&
|
||||
(t->type != WOLFSSL_V_ASN1_GENERALIZEDTIME)) {
|
||||
WOLFSSL_MSG("Invalid ASN_TIME type.");
|
||||
}
|
||||
/* Check for ASN.1 GENERALIZED TIME object being passed in. */
|
||||
|
@ -4097,9 +4097,9 @@ WOLFSSL_ASN1_TIME* wolfSSL_ASN1_TIME_to_generalizedtime(WOLFSSL_ASN1_TIME *t,
|
|||
|
||||
if (ret != NULL) {
|
||||
/* Set the ASN.1 type and length of string. */
|
||||
ret->type = WOLFSSL_ASN1_TYPE_GENERALIZEDTIME;
|
||||
ret->type = WOLFSSL_V_ASN1_GENERALIZEDTIME;
|
||||
|
||||
if (t->type == WOLFSSL_ASN1_TYPE_GENERALIZEDTIME) {
|
||||
if (t->type == WOLFSSL_V_ASN1_GENERALIZEDTIME) {
|
||||
ret->length = ASN_GENERALIZED_TIME_SIZE;
|
||||
|
||||
/* Just copy as data already appropriately formatted. */
|
||||
|
@ -4151,7 +4151,7 @@ WOLFSSL_ASN1_TIME* wolfSSL_ASN1_UTCTIME_set(WOLFSSL_ASN1_TIME *s, time_t t)
|
|||
ret = NULL;
|
||||
}
|
||||
else {
|
||||
ret->type = WOLFSSL_ASN1_TYPE_UTCTIME;
|
||||
ret->type = WOLFSSL_V_ASN1_UTCTIME;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -4311,7 +4311,7 @@ static int wolfssl_asn1_time_to_tm(const WOLFSSL_ASN1_TIME* asnTime,
|
|||
/* Zero out values in broken-down time. */
|
||||
XMEMSET(tm, 0, sizeof(struct tm));
|
||||
|
||||
if (asnTime->type == WOLFSSL_ASN1_TYPE_UTCTIME) {
|
||||
if (asnTime->type == WOLFSSL_V_ASN1_UTCTIME) {
|
||||
/* Get year from UTC TIME string. */
|
||||
int tm_year;
|
||||
if ((ret = wolfssl_utctime_year(asn1TimeBuf, asn1TimeBufLen,
|
||||
|
@ -4321,7 +4321,7 @@ static int wolfssl_asn1_time_to_tm(const WOLFSSL_ASN1_TIME* asnTime,
|
|||
i = 2;
|
||||
}
|
||||
}
|
||||
else if (asnTime->type == WOLFSSL_ASN1_TYPE_GENERALIZEDTIME) {
|
||||
else if (asnTime->type == WOLFSSL_V_ASN1_GENERALIZEDTIME) {
|
||||
/* Get year from GENERALIZED TIME string. */
|
||||
int tm_year;
|
||||
if ((ret = wolfssl_gentime_year(asn1TimeBuf, asn1TimeBufLen,
|
||||
|
@ -4522,7 +4522,7 @@ int wolfSSL_ASN1_UTCTIME_print(WOLFSSL_BIO* bio, const WOLFSSL_ASN1_UTCTIME* a)
|
|||
ret = 0;
|
||||
}
|
||||
/* Validate ASN.1 UTC TIME object is of type UTC_TIME. */
|
||||
if ((ret == 1) && (a->type != WOLFSSL_ASN1_TYPE_UTCTIME)) {
|
||||
if ((ret == 1) && (a->type != WOLFSSL_V_ASN1_UTCTIME)) {
|
||||
WOLFSSL_MSG("Error, not UTC_TIME");
|
||||
ret = 0;
|
||||
}
|
||||
|
@ -4574,28 +4574,28 @@ WOLFSSL_ASN1_TYPE* wolfSSL_ASN1_TYPE_new(void)
|
|||
static void wolfssl_asn1_type_free_value(WOLFSSL_ASN1_TYPE* at)
|
||||
{
|
||||
switch (at->type) {
|
||||
case WOLFSSL_ASN1_TYPE_NULL:
|
||||
case WOLFSSL_V_ASN1_NULL:
|
||||
break;
|
||||
case WOLFSSL_ASN1_TYPE_OBJECT:
|
||||
case WOLFSSL_V_ASN1_OBJECT:
|
||||
wolfSSL_ASN1_OBJECT_free(at->value.object);
|
||||
break;
|
||||
case WOLFSSL_ASN1_TYPE_UTCTIME:
|
||||
case WOLFSSL_V_ASN1_UTCTIME:
|
||||
#if !defined(NO_ASN_TIME) && defined(OPENSSL_EXTRA)
|
||||
wolfSSL_ASN1_TIME_free(at->value.utctime);
|
||||
#endif
|
||||
break;
|
||||
case WOLFSSL_ASN1_TYPE_GENERALIZEDTIME:
|
||||
case WOLFSSL_V_ASN1_GENERALIZEDTIME:
|
||||
#if !defined(NO_ASN_TIME) && defined(OPENSSL_EXTRA)
|
||||
wolfSSL_ASN1_TIME_free(at->value.generalizedtime);
|
||||
#endif
|
||||
break;
|
||||
case WOLFSSL_ASN1_TYPE_UTF8STRING:
|
||||
case WOLFSSL_ASN1_TYPE_OCTET_STRING:
|
||||
case WOLFSSL_ASN1_TYPE_PRINTABLESTRING:
|
||||
case WOLFSSL_ASN1_TYPE_T61STRING:
|
||||
case WOLFSSL_ASN1_TYPE_IA5STRING:
|
||||
case WOLFSSL_ASN1_TYPE_UNIVERSALSTRING:
|
||||
case WOLFSSL_ASN1_TYPE_SEQUENCE:
|
||||
case WOLFSSL_V_ASN1_UTF8STRING:
|
||||
case WOLFSSL_V_ASN1_OCTET_STRING:
|
||||
case WOLFSSL_V_ASN1_PRINTABLESTRING:
|
||||
case WOLFSSL_V_ASN1_T61STRING:
|
||||
case WOLFSSL_V_ASN1_IA5STRING:
|
||||
case WOLFSSL_V_ASN1_UNIVERSALSTRING:
|
||||
case WOLFSSL_V_ASN1_SEQUENCE:
|
||||
wolfSSL_ASN1_STRING_free(at->value.asn1_string);
|
||||
break;
|
||||
default:
|
||||
|
@ -4626,25 +4626,25 @@ int wolfSSL_i2d_ASN1_TYPE(WOLFSSL_ASN1_TYPE* at, unsigned char** pp)
|
|||
return WOLFSSL_FATAL_ERROR;
|
||||
|
||||
switch (at->type) {
|
||||
case WOLFSSL_ASN1_TYPE_NULL:
|
||||
case WOLFSSL_V_ASN1_NULL:
|
||||
break;
|
||||
case WOLFSSL_ASN1_TYPE_OBJECT:
|
||||
case WOLFSSL_V_ASN1_OBJECT:
|
||||
ret = wolfSSL_i2d_ASN1_OBJECT(at->value.object, pp);
|
||||
break;
|
||||
case WOLFSSL_ASN1_TYPE_UTF8STRING:
|
||||
case WOLFSSL_V_ASN1_UTF8STRING:
|
||||
ret = wolfSSL_i2d_ASN1_UTF8STRING(at->value.utf8string, pp);
|
||||
break;
|
||||
case WOLFSSL_ASN1_TYPE_GENERALIZEDTIME:
|
||||
case WOLFSSL_V_ASN1_GENERALIZEDTIME:
|
||||
ret = wolfSSL_i2d_ASN1_GENERALSTRING(at->value.utf8string, pp);
|
||||
break;
|
||||
case WOLFSSL_ASN1_TYPE_SEQUENCE:
|
||||
case WOLFSSL_V_ASN1_SEQUENCE:
|
||||
ret = wolfSSL_i2d_ASN1_SEQUENCE(at->value.sequence, pp);
|
||||
break;
|
||||
case WOLFSSL_ASN1_TYPE_UTCTIME:
|
||||
case WOLFSSL_ASN1_TYPE_PRINTABLESTRING:
|
||||
case WOLFSSL_ASN1_TYPE_T61STRING:
|
||||
case WOLFSSL_ASN1_TYPE_IA5STRING:
|
||||
case WOLFSSL_ASN1_TYPE_UNIVERSALSTRING:
|
||||
case WOLFSSL_V_ASN1_UTCTIME:
|
||||
case WOLFSSL_V_ASN1_PRINTABLESTRING:
|
||||
case WOLFSSL_V_ASN1_T61STRING:
|
||||
case WOLFSSL_V_ASN1_IA5STRING:
|
||||
case WOLFSSL_V_ASN1_UNIVERSALSTRING:
|
||||
default:
|
||||
WOLFSSL_MSG("asn1 i2d type not supported");
|
||||
break;
|
||||
|
@ -4661,16 +4661,16 @@ int wolfSSL_i2d_ASN1_TYPE(WOLFSSL_ASN1_TYPE* at, unsigned char** pp)
|
|||
* Set ASN.1 TYPE object with a type and value.
|
||||
*
|
||||
* Type of value for different types:
|
||||
* WOLFSSL_ASN1_TYPE_NULL : Value should be NULL.
|
||||
* WOLFSSL_ASN1_TYPE_OBJECT : WOLFSSL_ASN1_OBJECT.
|
||||
* WOLFSSL_ASN1_TYPE_UTCTIME : WOLFSSL_ASN1_TIME.
|
||||
* WOLFSSL_ASN1_TYPE_GENERALIZEDTIME : WOLFSSL_ASN1_TIME.
|
||||
* WOLFSSL_ASN1_TYPE_UTF8STRING : WOLFSSL_ASN1_STRING.
|
||||
* WOLFSSL_ASN1_TYPE_PRINTABLESTRING : WOLFSSL_ASN1_STRING.
|
||||
* WOLFSSL_ASN1_TYPE_T61STRING : WOLFSSL_ASN1_STRING.
|
||||
* WOLFSSL_ASN1_TYPE_IA5STRING : WOLFSSL_ASN1_STRING.
|
||||
* WOLFSSL_ASN1_TYPE_UNINVERSALSTRING: WOLFSSL_ASN1_STRING.
|
||||
* WOLFSSL_ASN1_TYPE_SEQUENCE : WOLFSSL_ASN1_STRING.
|
||||
* WOLFSSL_V_ASN1_NULL : Value should be NULL.
|
||||
* WOLFSSL_V_ASN1_OBJECT : WOLFSSL_ASN1_OBJECT.
|
||||
* WOLFSSL_V_ASN1_UTCTIME : WOLFSSL_ASN1_TIME.
|
||||
* WOLFSSL_V_ASN1_GENERALIZEDTIME : WOLFSSL_ASN1_TIME.
|
||||
* WOLFSSL_V_ASN1_UTF8STRING : WOLFSSL_ASN1_STRING.
|
||||
* WOLFSSL_V_ASN1_PRINTABLESTRING : WOLFSSL_ASN1_STRING.
|
||||
* WOLFSSL_V_ASN1_T61STRING : WOLFSSL_ASN1_STRING.
|
||||
* WOLFSSL_V_ASN1_IA5STRING : WOLFSSL_ASN1_STRING.
|
||||
* WOLFSSL_V_ASN1_UNINVERSALSTRING: WOLFSSL_ASN1_STRING.
|
||||
* WOLFSSL_V_ASN1_SEQUENCE : WOLFSSL_ASN1_STRING.
|
||||
*
|
||||
* @param [in, out] a ASN.1 TYPE object to set.
|
||||
* @param [in] type ASN.1 type of value.
|
||||
|
@ -4680,22 +4680,22 @@ void wolfSSL_ASN1_TYPE_set(WOLFSSL_ASN1_TYPE *a, int type, void *value)
|
|||
{
|
||||
if (a != NULL) {
|
||||
switch (type) {
|
||||
case WOLFSSL_ASN1_TYPE_NULL:
|
||||
case WOLFSSL_V_ASN1_NULL:
|
||||
if (value != NULL) {
|
||||
WOLFSSL_MSG("NULL tag meant to be always empty!");
|
||||
/* No way to return error - value will not be used. */
|
||||
}
|
||||
FALL_THROUGH;
|
||||
case WOLFSSL_ASN1_TYPE_OBJECT:
|
||||
case WOLFSSL_ASN1_TYPE_UTCTIME:
|
||||
case WOLFSSL_ASN1_TYPE_GENERALIZEDTIME:
|
||||
case WOLFSSL_ASN1_TYPE_UTF8STRING:
|
||||
case WOLFSSL_ASN1_TYPE_OCTET_STRING:
|
||||
case WOLFSSL_ASN1_TYPE_PRINTABLESTRING:
|
||||
case WOLFSSL_ASN1_TYPE_T61STRING:
|
||||
case WOLFSSL_ASN1_TYPE_IA5STRING:
|
||||
case WOLFSSL_ASN1_TYPE_UNIVERSALSTRING:
|
||||
case WOLFSSL_ASN1_TYPE_SEQUENCE:
|
||||
case WOLFSSL_V_ASN1_OBJECT:
|
||||
case WOLFSSL_V_ASN1_UTCTIME:
|
||||
case WOLFSSL_V_ASN1_GENERALIZEDTIME:
|
||||
case WOLFSSL_V_ASN1_UTF8STRING:
|
||||
case WOLFSSL_V_ASN1_OCTET_STRING:
|
||||
case WOLFSSL_V_ASN1_PRINTABLESTRING:
|
||||
case WOLFSSL_V_ASN1_T61STRING:
|
||||
case WOLFSSL_V_ASN1_IA5STRING:
|
||||
case WOLFSSL_V_ASN1_UNIVERSALSTRING:
|
||||
case WOLFSSL_V_ASN1_SEQUENCE:
|
||||
/* Dispose of any value currently set. */
|
||||
wolfssl_asn1_type_free_value(a);
|
||||
/* Assign anonymously typed input to anonymously typed field. */
|
||||
|
@ -4712,7 +4712,7 @@ void wolfSSL_ASN1_TYPE_set(WOLFSSL_ASN1_TYPE *a, int type, void *value)
|
|||
|
||||
int wolfSSL_ASN1_TYPE_get(const WOLFSSL_ASN1_TYPE *a)
|
||||
{
|
||||
if (a != NULL && (a->type == WOLFSSL_ASN1_TYPE_BOOLEAN || a->type == WOLFSSL_ASN1_TYPE_NULL
|
||||
if (a != NULL && (a->type == WOLFSSL_V_ASN1_BOOLEAN || a->type == WOLFSSL_V_ASN1_NULL
|
||||
|| a->value.ptr != NULL))
|
||||
return a->type;
|
||||
return 0;
|
||||
|
|
|
@ -5285,7 +5285,9 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||
defined(WOLFSSL_WPAS_SMALL)
|
||||
/* Check if client has disabled TLS 1.2 */
|
||||
if (args->pv.minor == TLSv1_2_MINOR &&
|
||||
(ssl->options.mask & WOLFSSL_OP_NO_TLSv1_2) == WOLFSSL_OP_NO_TLSv1_2) {
|
||||
(ssl->options.mask & WOLFSSL_OP_NO_TLSv1_2)
|
||||
== WOLFSSL_OP_NO_TLSv1_2)
|
||||
{
|
||||
WOLFSSL_MSG("\tOption set to not allow TLSv1.2");
|
||||
WOLFSSL_ERROR_VERBOSE(VERSION_ERROR);
|
||||
return VERSION_ERROR;
|
||||
|
|
304
src/x509.c
304
src/x509.c
|
@ -532,7 +532,7 @@ static int wolfssl_dns_entry_othername_to_gn(DNS_entry* dns,
|
|||
goto err;
|
||||
}
|
||||
|
||||
tag = WOLFSSL_ASN1_TYPE_UTF8STRING;
|
||||
tag = WOLFSSL_V_ASN1_UTF8STRING;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
@ -555,7 +555,7 @@ static int wolfssl_dns_entry_othername_to_gn(DNS_entry* dns,
|
|||
len -= idx;
|
||||
|
||||
/* Set the tag to object so that it gets output in raw form */
|
||||
tag = WOLFSSL_ASN1_TYPE_SEQUENCE;
|
||||
tag = WOLFSSL_V_ASN1_SEQUENCE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -922,7 +922,7 @@ WOLFSSL_X509_EXTENSION* wolfSSL_X509_set_ext(WOLFSSL_X509* x509, int loc)
|
|||
obj->obj = (byte*)x509->authInfoCaIssuer;
|
||||
obj->objSz = (unsigned int)x509->authInfoCaIssuerSz;
|
||||
obj->grp = oidCertAuthInfoType;
|
||||
obj->nid = wc_NID_ad_ca_issuers;
|
||||
obj->nid = WC_NID_ad_ca_issuers;
|
||||
|
||||
ret = wolfSSL_sk_ASN1_OBJECT_push(sk, obj) > 0
|
||||
? WOLFSSL_SUCCESS : WOLFSSL_FAILURE;
|
||||
|
@ -958,7 +958,7 @@ WOLFSSL_X509_EXTENSION* wolfSSL_X509_set_ext(WOLFSSL_X509* x509, int loc)
|
|||
obj->obj = x509->authInfo;
|
||||
obj->objSz = (unsigned int)x509->authInfoSz;
|
||||
obj->grp = oidCertAuthInfoType;
|
||||
obj->nid = wc_NID_ad_OCSP;
|
||||
obj->nid = WC_NID_ad_OCSP;
|
||||
|
||||
ret = wolfSSL_sk_ASN1_OBJECT_push(sk, obj) > 0
|
||||
? WOLFSSL_SUCCESS : WOLFSSL_FAILURE;
|
||||
|
@ -1256,7 +1256,7 @@ int wolfSSL_X509_add_ext(WOLFSSL_X509 *x509, WOLFSSL_X509_EXTENSION *ext, int lo
|
|||
nid = (ext->obj != NULL) ? ext->obj->type : ext->value.nid;
|
||||
|
||||
switch (nid) {
|
||||
case wc_NID_authority_key_identifier:
|
||||
case WC_NID_authority_key_identifier:
|
||||
if (x509->authKeyIdSrc != NULL) {
|
||||
/* If authKeyId points into authKeyIdSrc then free it and
|
||||
* revert to old functionality */
|
||||
|
@ -1271,7 +1271,7 @@ int wolfSSL_X509_add_ext(WOLFSSL_X509 *x509, WOLFSSL_X509_EXTENSION *ext, int lo
|
|||
}
|
||||
x509->authKeyIdCrit = (byte)ext->crit;
|
||||
break;
|
||||
case wc_NID_subject_key_identifier:
|
||||
case WC_NID_subject_key_identifier:
|
||||
if (asn1_string_copy_to_buffer(&ext->value, &x509->subjKeyId,
|
||||
&x509->subjKeyIdSz, x509->heap) != WOLFSSL_SUCCESS) {
|
||||
WOLFSSL_MSG("asn1_string_copy_to_buffer error");
|
||||
|
@ -1279,7 +1279,7 @@ int wolfSSL_X509_add_ext(WOLFSSL_X509 *x509, WOLFSSL_X509_EXTENSION *ext, int lo
|
|||
}
|
||||
x509->subjKeyIdCrit = (byte)ext->crit;
|
||||
break;
|
||||
case wc_NID_subject_alt_name:
|
||||
case WC_NID_subject_alt_name:
|
||||
{
|
||||
WOLFSSL_GENERAL_NAMES* gns = ext->ext_sk;
|
||||
while (gns) {
|
||||
|
@ -1323,7 +1323,7 @@ int wolfSSL_X509_add_ext(WOLFSSL_X509 *x509, WOLFSSL_X509_EXTENSION *ext, int lo
|
|||
x509->subjAltNameCrit = (byte)ext->crit;
|
||||
break;
|
||||
}
|
||||
case wc_NID_key_usage:
|
||||
case WC_NID_key_usage:
|
||||
if (ext && ext->value.data) {
|
||||
if (ext->value.length == sizeof(word16)) {
|
||||
/* if ext->value is already word16, set directly */
|
||||
|
@ -1345,7 +1345,7 @@ int wolfSSL_X509_add_ext(WOLFSSL_X509 *x509, WOLFSSL_X509_EXTENSION *ext, int lo
|
|||
}
|
||||
}
|
||||
break;
|
||||
case wc_NID_ext_key_usage:
|
||||
case WC_NID_ext_key_usage:
|
||||
if (ext && ext->value.data) {
|
||||
if (ext->value.length == sizeof(byte)) {
|
||||
/* if ext->value is already word16, set directly */
|
||||
|
@ -1365,7 +1365,7 @@ int wolfSSL_X509_add_ext(WOLFSSL_X509 *x509, WOLFSSL_X509_EXTENSION *ext, int lo
|
|||
}
|
||||
}
|
||||
break;
|
||||
case wc_NID_basic_constraints:
|
||||
case WC_NID_basic_constraints:
|
||||
if (ext->obj) {
|
||||
x509->isCa = (byte)ext->obj->ca;
|
||||
x509->basicConstCrit = (byte)ext->crit;
|
||||
|
@ -1593,7 +1593,7 @@ int wolfSSL_X509_EXTENSION_set_critical(WOLFSSL_X509_EXTENSION* ex, int crit)
|
|||
* Returns NULL on error or pointer to the v3_ext_method populated with extension
|
||||
* type-specific X509V3_EXT_* function(s).
|
||||
*
|
||||
* NOTE: wc_NID_subject_key_identifier is currently the only extension implementing
|
||||
* NOTE: WC_NID_subject_key_identifier is currently the only extension implementing
|
||||
* the X509V3_EXT_* functions, as it is the only type called directly by QT. The
|
||||
* other extension types return a pointer to a v3_ext_method struct that contains
|
||||
* only the NID.
|
||||
|
@ -1622,30 +1622,30 @@ WOLFSSL_v3_ext_method* wolfSSL_X509V3_EXT_get(WOLFSSL_X509_EXTENSION* ex)
|
|||
}
|
||||
XMEMSET(&method, 0, sizeof(WOLFSSL_v3_ext_method));
|
||||
switch (nid) {
|
||||
case wc_NID_basic_constraints:
|
||||
case WC_NID_basic_constraints:
|
||||
break;
|
||||
case wc_NID_subject_key_identifier:
|
||||
case WC_NID_subject_key_identifier:
|
||||
method.i2s = (X509V3_EXT_I2S)wolfSSL_i2s_ASN1_STRING;
|
||||
break;
|
||||
case wc_NID_subject_alt_name:
|
||||
case WC_NID_subject_alt_name:
|
||||
WOLFSSL_MSG("i2v function not yet implemented for Subject Alternative Name");
|
||||
break;
|
||||
case wc_NID_key_usage:
|
||||
case WC_NID_key_usage:
|
||||
WOLFSSL_MSG("i2v function not yet implemented for Key Usage");
|
||||
break;
|
||||
case wc_NID_authority_key_identifier:
|
||||
case WC_NID_authority_key_identifier:
|
||||
WOLFSSL_MSG("i2v function not yet implemented for Auth Key Id");
|
||||
break;
|
||||
case wc_NID_info_access:
|
||||
case WC_NID_info_access:
|
||||
WOLFSSL_MSG("i2v function not yet implemented for Info Access");
|
||||
break;
|
||||
case wc_NID_ext_key_usage:
|
||||
case WC_NID_ext_key_usage:
|
||||
WOLFSSL_MSG("i2v function not yet implemented for Ext Key Usage");
|
||||
break;
|
||||
case wc_NID_certificate_policies:
|
||||
case WC_NID_certificate_policies:
|
||||
WOLFSSL_MSG("r2i function not yet implemented for Cert Policies");
|
||||
break;
|
||||
case wc_NID_crl_distribution_points:
|
||||
case WC_NID_crl_distribution_points:
|
||||
WOLFSSL_MSG("r2i function not yet implemented for CRL Dist Points");
|
||||
break;
|
||||
default:
|
||||
|
@ -1832,7 +1832,7 @@ void* wolfSSL_X509V3_EXT_d2i(WOLFSSL_X509_EXTENSION* ext)
|
|||
/* Return pointer to proper internal structure based on NID */
|
||||
switch (object->type) {
|
||||
/* basicConstraints */
|
||||
case (wc_NID_basic_constraints):
|
||||
case (WC_NID_basic_constraints):
|
||||
WOLFSSL_MSG("basicConstraints");
|
||||
/* Allocate new BASIC_CONSTRAINTS structure */
|
||||
bc = wolfSSL_BASIC_CONSTRAINTS_new();
|
||||
|
@ -1855,7 +1855,7 @@ void* wolfSSL_X509V3_EXT_d2i(WOLFSSL_X509_EXTENSION* ext)
|
|||
return bc;
|
||||
|
||||
/* subjectKeyIdentifier */
|
||||
case (wc_NID_subject_key_identifier):
|
||||
case (WC_NID_subject_key_identifier):
|
||||
WOLFSSL_MSG("subjectKeyIdentifier");
|
||||
asn1String = wolfSSL_X509_EXTENSION_get_data(ext);
|
||||
if (asn1String == NULL) {
|
||||
|
@ -1878,7 +1878,7 @@ void* wolfSSL_X509V3_EXT_d2i(WOLFSSL_X509_EXTENSION* ext)
|
|||
return newString;
|
||||
|
||||
/* authorityKeyIdentifier */
|
||||
case (wc_NID_authority_key_identifier):
|
||||
case (WC_NID_authority_key_identifier):
|
||||
WOLFSSL_MSG("AuthorityKeyIdentifier");
|
||||
|
||||
akey = (WOLFSSL_AUTHORITY_KEYID*)
|
||||
|
@ -1921,7 +1921,7 @@ void* wolfSSL_X509V3_EXT_d2i(WOLFSSL_X509_EXTENSION* ext)
|
|||
return akey;
|
||||
|
||||
/* keyUsage */
|
||||
case (wc_NID_key_usage):
|
||||
case (WC_NID_key_usage):
|
||||
WOLFSSL_MSG("keyUsage");
|
||||
/* This may need to be updated for future use. The i2v method for
|
||||
keyUsage is not currently set. For now, return the ASN1_STRING
|
||||
|
@ -1947,21 +1947,21 @@ void* wolfSSL_X509V3_EXT_d2i(WOLFSSL_X509_EXTENSION* ext)
|
|||
return newString;
|
||||
|
||||
/* extKeyUsage */
|
||||
case (wc_NID_ext_key_usage):
|
||||
case (WC_NID_ext_key_usage):
|
||||
WOLFSSL_MSG("extKeyUsage not supported yet");
|
||||
return NULL;
|
||||
|
||||
/* certificatePolicies */
|
||||
case (wc_NID_certificate_policies):
|
||||
case (WC_NID_certificate_policies):
|
||||
WOLFSSL_MSG("certificatePolicies not supported yet");
|
||||
return NULL;
|
||||
|
||||
/* cRLDistributionPoints */
|
||||
case (wc_NID_crl_distribution_points):
|
||||
case (WC_NID_crl_distribution_points):
|
||||
WOLFSSL_MSG("cRLDistributionPoints not supported yet");
|
||||
return NULL;
|
||||
|
||||
case wc_NID_subject_alt_name:
|
||||
case WC_NID_subject_alt_name:
|
||||
if (ext->ext_sk == NULL) {
|
||||
WOLFSSL_MSG("Subject alt name stack NULL");
|
||||
return NULL;
|
||||
|
@ -1974,7 +1974,7 @@ void* wolfSSL_X509V3_EXT_d2i(WOLFSSL_X509_EXTENSION* ext)
|
|||
return sk;
|
||||
|
||||
/* authorityInfoAccess */
|
||||
case wc_NID_info_access:
|
||||
case WC_NID_info_access:
|
||||
WOLFSSL_MSG("AuthorityInfoAccess");
|
||||
return wolfssl_x509v3_ext_aia_d2i(ext);
|
||||
|
||||
|
@ -2258,7 +2258,7 @@ void* wolfSSL_X509_get_ext_d2i(const WOLFSSL_X509* x509, int nid, int* c,
|
|||
WOLFSSL_MSG("ASN1_STRING_set failed");
|
||||
goto err;
|
||||
}
|
||||
gn->d.dNSName->type = WOLFSSL_ASN1_TYPE_IA5STRING;
|
||||
gn->d.dNSName->type = WOLFSSL_V_ASN1_IA5STRING;
|
||||
}
|
||||
|
||||
dns = dns->next;
|
||||
|
@ -2754,8 +2754,8 @@ static WOLFSSL_X509_EXTENSION* createExtFromStr(int nid, const char *value)
|
|||
ext->value.nid = nid;
|
||||
|
||||
switch (nid) {
|
||||
case wc_NID_subject_key_identifier:
|
||||
case wc_NID_authority_key_identifier:
|
||||
case WC_NID_subject_key_identifier:
|
||||
case WC_NID_authority_key_identifier:
|
||||
if (wolfSSL_ASN1_STRING_set(&ext->value, value, -1)
|
||||
!= WOLFSSL_SUCCESS) {
|
||||
WOLFSSL_MSG("wolfSSL_ASN1_STRING_set error");
|
||||
|
@ -2763,7 +2763,7 @@ static WOLFSSL_X509_EXTENSION* createExtFromStr(int nid, const char *value)
|
|||
}
|
||||
ext->value.type = CTC_UTF8;
|
||||
break;
|
||||
case wc_NID_subject_alt_name:
|
||||
case WC_NID_subject_alt_name:
|
||||
{
|
||||
WOLFSSL_GENERAL_NAMES* gns;
|
||||
WOLFSSL_GENERAL_NAME* gn;
|
||||
|
@ -2802,7 +2802,7 @@ static WOLFSSL_X509_EXTENSION* createExtFromStr(int nid, const char *value)
|
|||
gn->type = ASN_DNS_TYPE;
|
||||
break;
|
||||
}
|
||||
case wc_NID_key_usage:
|
||||
case WC_NID_key_usage:
|
||||
if (wolfSSL_ASN1_STRING_set(&ext->value, value, -1)
|
||||
!= WOLFSSL_SUCCESS) {
|
||||
WOLFSSL_MSG("wolfSSL_ASN1_STRING_set error");
|
||||
|
@ -2810,7 +2810,7 @@ static WOLFSSL_X509_EXTENSION* createExtFromStr(int nid, const char *value)
|
|||
}
|
||||
ext->value.type = KEY_USAGE_OID;
|
||||
break;
|
||||
case wc_NID_ext_key_usage:
|
||||
case WC_NID_ext_key_usage:
|
||||
if (wolfSSL_ASN1_STRING_set(&ext->value, value, -1)
|
||||
!= WOLFSSL_SUCCESS) {
|
||||
WOLFSSL_MSG("wolfSSL_ASN1_STRING_set error");
|
||||
|
@ -2901,22 +2901,22 @@ static void wolfSSL_X509V3_EXT_METHOD_populate(WOLFSSL_v3_ext_method *method,
|
|||
|
||||
WOLFSSL_ENTER("wolfSSL_X509V3_EXT_METHOD_populate");
|
||||
switch (nid) {
|
||||
case wc_NID_subject_key_identifier:
|
||||
case WC_NID_subject_key_identifier:
|
||||
method->i2s = (X509V3_EXT_I2S)wolfSSL_i2s_ASN1_STRING;
|
||||
FALL_THROUGH;
|
||||
case wc_NID_authority_key_identifier:
|
||||
case wc_NID_key_usage:
|
||||
case wc_NID_certificate_policies:
|
||||
case wc_NID_policy_mappings:
|
||||
case wc_NID_subject_alt_name:
|
||||
case wc_NID_issuer_alt_name:
|
||||
case wc_NID_basic_constraints:
|
||||
case wc_NID_name_constraints:
|
||||
case wc_NID_policy_constraints:
|
||||
case wc_NID_ext_key_usage:
|
||||
case wc_NID_crl_distribution_points:
|
||||
case wc_NID_inhibit_any_policy:
|
||||
case wc_NID_info_access:
|
||||
case WC_NID_authority_key_identifier:
|
||||
case WC_NID_key_usage:
|
||||
case WC_NID_certificate_policies:
|
||||
case WC_NID_policy_mappings:
|
||||
case WC_NID_subject_alt_name:
|
||||
case WC_NID_issuer_alt_name:
|
||||
case WC_NID_basic_constraints:
|
||||
case WC_NID_name_constraints:
|
||||
case WC_NID_policy_constraints:
|
||||
case WC_NID_ext_key_usage:
|
||||
case WC_NID_crl_distribution_points:
|
||||
case WC_NID_inhibit_any_policy:
|
||||
case WC_NID_info_access:
|
||||
WOLFSSL_MSG("Nothing to populate for current NID");
|
||||
break;
|
||||
default:
|
||||
|
@ -2928,7 +2928,7 @@ static void wolfSSL_X509V3_EXT_METHOD_populate(WOLFSSL_v3_ext_method *method,
|
|||
}
|
||||
|
||||
/**
|
||||
* @param nid One of the wc_NID_* constants defined in asn.h
|
||||
* @param nid One of the WC_NID_* constants defined in asn.h
|
||||
* @param crit
|
||||
* @param data This data is copied to the returned extension.
|
||||
* @return
|
||||
|
@ -2952,9 +2952,9 @@ WOLFSSL_X509_EXTENSION *wolfSSL_X509V3_EXT_i2d(int nid, int crit,
|
|||
wolfSSL_X509V3_EXT_METHOD_populate(&ext->ext_method, nid);
|
||||
|
||||
switch (nid) {
|
||||
case wc_NID_subject_key_identifier:
|
||||
case WC_NID_subject_key_identifier:
|
||||
/* WOLFSSL_ASN1_STRING */
|
||||
case wc_NID_key_usage:
|
||||
case WC_NID_key_usage:
|
||||
/* WOLFSSL_ASN1_STRING */
|
||||
{
|
||||
asn1str = (WOLFSSL_ASN1_STRING*)data;
|
||||
|
@ -2981,13 +2981,13 @@ WOLFSSL_X509_EXTENSION *wolfSSL_X509V3_EXT_i2d(int nid, int crit,
|
|||
|
||||
break;
|
||||
}
|
||||
case wc_NID_subject_alt_name:
|
||||
case WC_NID_subject_alt_name:
|
||||
/* typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES */
|
||||
case wc_NID_issuer_alt_name:
|
||||
case WC_NID_issuer_alt_name:
|
||||
/* typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES */
|
||||
case wc_NID_ext_key_usage:
|
||||
case WC_NID_ext_key_usage:
|
||||
/* typedef STACK_OF(ASN1_OBJECT) EXTENDED_KEY_USAGE */
|
||||
case wc_NID_info_access:
|
||||
case WC_NID_info_access:
|
||||
/* typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS */
|
||||
{
|
||||
WOLFSSL_STACK* sk = (WOLFSSL_STACK*)data;
|
||||
|
@ -3008,7 +3008,7 @@ WOLFSSL_X509_EXTENSION *wolfSSL_X509V3_EXT_i2d(int nid, int crit,
|
|||
|
||||
break;
|
||||
}
|
||||
case wc_NID_basic_constraints:
|
||||
case WC_NID_basic_constraints:
|
||||
{
|
||||
/* WOLFSSL_BASIC_CONSTRAINTS */
|
||||
WOLFSSL_BASIC_CONSTRAINTS* bc = (WOLFSSL_BASIC_CONSTRAINTS*)data;
|
||||
|
@ -3028,7 +3028,7 @@ WOLFSSL_X509_EXTENSION *wolfSSL_X509V3_EXT_i2d(int nid, int crit,
|
|||
}
|
||||
break;
|
||||
}
|
||||
case wc_NID_authority_key_identifier:
|
||||
case WC_NID_authority_key_identifier:
|
||||
{
|
||||
/* AUTHORITY_KEYID */
|
||||
WOLFSSL_AUTHORITY_KEYID* akey = (WOLFSSL_AUTHORITY_KEYID*)data;
|
||||
|
@ -3055,22 +3055,22 @@ WOLFSSL_X509_EXTENSION *wolfSSL_X509V3_EXT_i2d(int nid, int crit,
|
|||
}
|
||||
}
|
||||
else {
|
||||
WOLFSSL_MSG("wc_NID_authority_key_identifier empty data");
|
||||
WOLFSSL_MSG("WC_NID_authority_key_identifier empty data");
|
||||
goto err_cleanup;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case wc_NID_inhibit_any_policy:
|
||||
case WC_NID_inhibit_any_policy:
|
||||
/* ASN1_INTEGER */
|
||||
case wc_NID_certificate_policies:
|
||||
case WC_NID_certificate_policies:
|
||||
/* STACK_OF(POLICYINFO) */
|
||||
case wc_NID_policy_mappings:
|
||||
case WC_NID_policy_mappings:
|
||||
/* STACK_OF(POLICY_MAPPING) */
|
||||
case wc_NID_name_constraints:
|
||||
case WC_NID_name_constraints:
|
||||
/* NAME_CONSTRAINTS */
|
||||
case wc_NID_policy_constraints:
|
||||
case WC_NID_policy_constraints:
|
||||
/* POLICY_CONSTRAINTS */
|
||||
case wc_NID_crl_distribution_points:
|
||||
case WC_NID_crl_distribution_points:
|
||||
/* typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS */
|
||||
default:
|
||||
WOLFSSL_MSG("Unknown or unsupported NID");
|
||||
|
@ -4388,7 +4388,7 @@ WOLFSSL_GENERAL_NAME* wolfSSL_GENERAL_NAME_dup(WOLFSSL_GENERAL_NAME* gn)
|
|||
}
|
||||
break;
|
||||
case WOLFSSL_GEN_OTHERNAME:
|
||||
if (gn->d.otherName->value->type != WOLFSSL_ASN1_TYPE_UTF8STRING) {
|
||||
if (gn->d.otherName->value->type != WOLFSSL_V_ASN1_UTF8STRING) {
|
||||
WOLFSSL_MSG("Unsupported othername value type");
|
||||
goto error;
|
||||
}
|
||||
|
@ -5606,17 +5606,17 @@ int wolfSSL_X509_cmp(const WOLFSSL_X509 *a, const WOLFSSL_X509 *b)
|
|||
|
||||
if (x509 != NULL) {
|
||||
switch (nid) {
|
||||
case wc_NID_basic_constraints: isSet = x509->basicConstSet; break;
|
||||
case wc_NID_subject_alt_name: isSet = x509->subjAltNameSet; break;
|
||||
case wc_NID_authority_key_identifier: isSet = x509->authKeyIdSet; break;
|
||||
case wc_NID_subject_key_identifier: isSet = x509->subjKeyIdSet; break;
|
||||
case wc_NID_key_usage: isSet = x509->keyUsageSet; break;
|
||||
case wc_NID_crl_distribution_points: isSet = x509->CRLdistSet; break;
|
||||
case wc_NID_ext_key_usage: isSet = ((x509->extKeyUsageSrc) ? 1 : 0);
|
||||
case WC_NID_basic_constraints: isSet = x509->basicConstSet; break;
|
||||
case WC_NID_subject_alt_name: isSet = x509->subjAltNameSet; break;
|
||||
case WC_NID_authority_key_identifier: isSet = x509->authKeyIdSet; break;
|
||||
case WC_NID_subject_key_identifier: isSet = x509->subjKeyIdSet; break;
|
||||
case WC_NID_key_usage: isSet = x509->keyUsageSet; break;
|
||||
case WC_NID_crl_distribution_points: isSet = x509->CRLdistSet; break;
|
||||
case WC_NID_ext_key_usage: isSet = ((x509->extKeyUsageSrc) ? 1 : 0);
|
||||
break;
|
||||
case wc_NID_info_access: isSet = x509->authInfoSet; break;
|
||||
case WC_NID_info_access: isSet = x509->authInfoSet; break;
|
||||
#if defined(WOLFSSL_SEP) || defined(WOLFSSL_QT)
|
||||
case wc_NID_certificate_policies: isSet = x509->certPolicySet; break;
|
||||
case WC_NID_certificate_policies: isSet = x509->certPolicySet; break;
|
||||
#endif /* WOLFSSL_SEP || WOLFSSL_QT */
|
||||
default:
|
||||
WOLFSSL_MSG("NID not in table");
|
||||
|
@ -5637,15 +5637,15 @@ int wolfSSL_X509_cmp(const WOLFSSL_X509 *a, const WOLFSSL_X509 *b)
|
|||
|
||||
if (x509 != NULL) {
|
||||
switch (nid) {
|
||||
case wc_NID_basic_constraints: crit = x509->basicConstCrit; break;
|
||||
case wc_NID_subject_alt_name: crit = x509->subjAltNameCrit; break;
|
||||
case wc_NID_authority_key_identifier: crit = x509->authKeyIdCrit; break;
|
||||
case wc_NID_subject_key_identifier: crit = x509->subjKeyIdCrit; break;
|
||||
case wc_NID_key_usage: crit = x509->keyUsageCrit; break;
|
||||
case wc_NID_crl_distribution_points: crit= x509->CRLdistCrit; break;
|
||||
case wc_NID_ext_key_usage: crit= x509->extKeyUsageCrit; break;
|
||||
case WC_NID_basic_constraints: crit = x509->basicConstCrit; break;
|
||||
case WC_NID_subject_alt_name: crit = x509->subjAltNameCrit; break;
|
||||
case WC_NID_authority_key_identifier: crit = x509->authKeyIdCrit; break;
|
||||
case WC_NID_subject_key_identifier: crit = x509->subjKeyIdCrit; break;
|
||||
case WC_NID_key_usage: crit = x509->keyUsageCrit; break;
|
||||
case WC_NID_crl_distribution_points: crit= x509->CRLdistCrit; break;
|
||||
case WC_NID_ext_key_usage: crit= x509->extKeyUsageCrit; break;
|
||||
#ifdef WOLFSSL_SEP
|
||||
case wc_NID_certificate_policies: crit = x509->certPolicyCrit; break;
|
||||
case WC_NID_certificate_policies: crit = x509->certPolicyCrit; break;
|
||||
#endif /* WOLFSSL_SEP */
|
||||
}
|
||||
}
|
||||
|
@ -6534,11 +6534,11 @@ static int X509PrintExtensions(WOLFSSL_BIO* bio, WOLFSSL_X509* x509, int indent)
|
|||
}
|
||||
nid = wolfSSL_OBJ_obj2nid(obj);
|
||||
switch (nid) {
|
||||
case wc_NID_subject_alt_name:
|
||||
case WC_NID_subject_alt_name:
|
||||
ret = X509PrintSubjAltName(bio, x509, indent + 8);
|
||||
break;
|
||||
|
||||
case wc_NID_subject_key_identifier:
|
||||
case WC_NID_subject_key_identifier:
|
||||
if (!x509->subjKeyIdSet || x509->subjKeyId == NULL ||
|
||||
x509->subjKeyIdSz == 0)
|
||||
{
|
||||
|
@ -6583,7 +6583,7 @@ static int X509PrintExtensions(WOLFSSL_BIO* bio, WOLFSSL_X509* x509, int indent)
|
|||
}
|
||||
break;
|
||||
|
||||
case wc_NID_authority_key_identifier:
|
||||
case WC_NID_authority_key_identifier:
|
||||
if (!x509->authKeyIdSet || x509->authKeyId == NULL ||
|
||||
x509->authKeyIdSz == 0) {
|
||||
ret = WOLFSSL_FAILURE;
|
||||
|
@ -6632,7 +6632,7 @@ static int X509PrintExtensions(WOLFSSL_BIO* bio, WOLFSSL_X509* x509, int indent)
|
|||
}
|
||||
break;
|
||||
|
||||
case wc_NID_basic_constraints:
|
||||
case WC_NID_basic_constraints:
|
||||
if (!x509->basicConstSet) {
|
||||
ret = WOLFSSL_FAILURE;
|
||||
break;
|
||||
|
@ -6653,11 +6653,11 @@ static int X509PrintExtensions(WOLFSSL_BIO* bio, WOLFSSL_X509* x509, int indent)
|
|||
}
|
||||
break;
|
||||
|
||||
case wc_NID_key_usage:
|
||||
case WC_NID_key_usage:
|
||||
ret = X509PrintKeyUsage(bio, x509, indent + 8);
|
||||
break;
|
||||
|
||||
case wc_NID_ext_key_usage:
|
||||
case WC_NID_ext_key_usage:
|
||||
ret = X509PrintExtendedKeyUsage(bio, x509, indent + 8);
|
||||
break;
|
||||
|
||||
|
@ -9733,8 +9733,8 @@ void wolfSSL_X509_ALGOR_get0(const WOLFSSL_ASN1_OBJECT **paobj, int *pptype,
|
|||
*pptype = algor->parameter->type;
|
||||
}
|
||||
else {
|
||||
/* Default to WOLFSSL_ASN1_TYPE_OBJECT */
|
||||
*pptype = WOLFSSL_ASN1_TYPE_OBJECT;
|
||||
/* Default to WOLFSSL_V_ASN1_OBJECT */
|
||||
*pptype = WOLFSSL_V_ASN1_OBJECT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10008,7 +10008,7 @@ int wolfSSL_X509_PUBKEY_set(WOLFSSL_X509_PUBKEY **x, WOLFSSL_EVP_PKEY *key)
|
|||
#ifndef NO_RSA
|
||||
case WC_EVP_PKEY_RSA:
|
||||
pval = NULL;
|
||||
ptype = WOLFSSL_ASN1_TYPE_NULL;
|
||||
ptype = WOLFSSL_V_ASN1_NULL;
|
||||
pk->pubKeyOID = RSAk;
|
||||
break;
|
||||
#endif
|
||||
|
@ -10030,7 +10030,7 @@ int wolfSSL_X509_PUBKEY_set(WOLFSSL_X509_PUBKEY **x, WOLFSSL_EVP_PKEY *key)
|
|||
str->isDynamic = 1;
|
||||
|
||||
pval = str;
|
||||
ptype = WOLFSSL_ASN1_TYPE_SEQUENCE;
|
||||
ptype = WOLFSSL_V_ASN1_SEQUENCE;
|
||||
pk->pubKeyOID = DSAk;
|
||||
break;
|
||||
#endif
|
||||
|
@ -10051,7 +10051,7 @@ int wolfSSL_X509_PUBKEY_set(WOLFSSL_X509_PUBKEY **x, WOLFSSL_EVP_PKEY *key)
|
|||
if (!pval)
|
||||
goto error;
|
||||
|
||||
ptype = WOLFSSL_ASN1_TYPE_OBJECT;
|
||||
ptype = WOLFSSL_V_ASN1_OBJECT;
|
||||
pk->pubKeyOID = ECDSAk;
|
||||
break;
|
||||
#endif
|
||||
|
@ -10062,7 +10062,7 @@ int wolfSSL_X509_PUBKEY_set(WOLFSSL_X509_PUBKEY **x, WOLFSSL_EVP_PKEY *key)
|
|||
|
||||
keyTypeObj = wolfSSL_OBJ_nid2obj(key->type);
|
||||
if (keyTypeObj == NULL) {
|
||||
if (ptype == WOLFSSL_ASN1_TYPE_OBJECT)
|
||||
if (ptype == WOLFSSL_V_ASN1_OBJECT)
|
||||
ASN1_OBJECT_free((WOLFSSL_ASN1_OBJECT *)pval);
|
||||
else
|
||||
ASN1_STRING_free((WOLFSSL_ASN1_STRING *)pval);
|
||||
|
@ -10071,7 +10071,7 @@ int wolfSSL_X509_PUBKEY_set(WOLFSSL_X509_PUBKEY **x, WOLFSSL_EVP_PKEY *key)
|
|||
if (!wolfSSL_X509_ALGOR_set0(pk->algor, keyTypeObj, ptype, pval)) {
|
||||
WOLFSSL_MSG("Failed to create algorithm object");
|
||||
ASN1_OBJECT_free(keyTypeObj);
|
||||
if (ptype == WOLFSSL_ASN1_TYPE_OBJECT)
|
||||
if (ptype == WOLFSSL_V_ASN1_OBJECT)
|
||||
ASN1_OBJECT_free((WOLFSSL_ASN1_OBJECT *)pval);
|
||||
else
|
||||
ASN1_STRING_free((WOLFSSL_ASN1_STRING *)pval);
|
||||
|
@ -10347,7 +10347,7 @@ WOLF_STACK_OF(WOLFSSL_X509)* wolfSSL_X509_chain_up_ref(
|
|||
|
||||
#if defined(OPENSSL_ALL)
|
||||
idx = wolfSSL_X509_REQ_get_attr_by_NID(req,
|
||||
wc_NID_pkcs9_unstructuredName, -1);
|
||||
WC_NID_pkcs9_unstructuredName, -1);
|
||||
if (idx != WC_NO_ERR_TRACE(WOLFSSL_FATAL_ERROR)) {
|
||||
WOLFSSL_X509_ATTRIBUTE *attr;
|
||||
attr = wolfSSL_X509_REQ_get_attr(req, idx);
|
||||
|
@ -11326,7 +11326,7 @@ cleanup:
|
|||
|
||||
#if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL) || defined(WOLFSSL_WPAS_SMALL)
|
||||
/* Converts from wc_NID_* value to wolfSSL value if needed.
|
||||
/* Converts from WC_NID_* value to wolfSSL value if needed.
|
||||
*
|
||||
* @param [in] nid Numeric Id of a domain name component.
|
||||
* @return Domain name tag values - wolfSSL internal values.
|
||||
|
@ -11335,28 +11335,28 @@ cleanup:
|
|||
static int ConvertNIDToWolfSSL(int nid)
|
||||
{
|
||||
switch (nid) {
|
||||
case wc_NID_commonName : return ASN_COMMON_NAME;
|
||||
case WC_NID_commonName : return ASN_COMMON_NAME;
|
||||
#ifdef WOLFSSL_CERT_NAME_ALL
|
||||
case wc_NID_name : return ASN_NAME;
|
||||
case wc_NID_givenName: return ASN_GIVEN_NAME;
|
||||
case wc_NID_dnQualifier : return ASN_DNQUALIFIER;
|
||||
case wc_NID_initials: return ASN_INITIALS;
|
||||
case WC_NID_name : return ASN_NAME;
|
||||
case WC_NID_givenName: return ASN_GIVEN_NAME;
|
||||
case WC_NID_dnQualifier : return ASN_DNQUALIFIER;
|
||||
case WC_NID_initials: return ASN_INITIALS;
|
||||
#endif /* WOLFSSL_CERT_NAME_ALL */
|
||||
case wc_NID_surname : return ASN_SUR_NAME;
|
||||
case wc_NID_countryName: return ASN_COUNTRY_NAME;
|
||||
case wc_NID_localityName: return ASN_LOCALITY_NAME;
|
||||
case wc_NID_stateOrProvinceName: return ASN_STATE_NAME;
|
||||
case wc_NID_streetAddress: return ASN_STREET_ADDR;
|
||||
case wc_NID_organizationName: return ASN_ORG_NAME;
|
||||
case wc_NID_organizationalUnitName: return ASN_ORGUNIT_NAME;
|
||||
case wc_NID_emailAddress: return ASN_EMAIL_NAME;
|
||||
case wc_NID_pkcs9_contentType: return ASN_CONTENT_TYPE;
|
||||
case wc_NID_serialNumber: return ASN_SERIAL_NUMBER;
|
||||
case wc_NID_userId: return ASN_USER_ID;
|
||||
case wc_NID_businessCategory: return ASN_BUS_CAT;
|
||||
case wc_NID_domainComponent: return ASN_DOMAIN_COMPONENT;
|
||||
case wc_NID_postalCode: return ASN_POSTAL_CODE;
|
||||
case wc_NID_favouriteDrink: return ASN_FAVOURITE_DRINK;
|
||||
case WC_NID_surname : return ASN_SUR_NAME;
|
||||
case WC_NID_countryName: return ASN_COUNTRY_NAME;
|
||||
case WC_NID_localityName: return ASN_LOCALITY_NAME;
|
||||
case WC_NID_stateOrProvinceName: return ASN_STATE_NAME;
|
||||
case WC_NID_streetAddress: return ASN_STREET_ADDR;
|
||||
case WC_NID_organizationName: return ASN_ORG_NAME;
|
||||
case WC_NID_organizationalUnitName: return ASN_ORGUNIT_NAME;
|
||||
case WC_NID_emailAddress: return ASN_EMAIL_NAME;
|
||||
case WC_NID_pkcs9_contentType: return ASN_CONTENT_TYPE;
|
||||
case WC_NID_serialNumber: return ASN_SERIAL_NUMBER;
|
||||
case WC_NID_userId: return ASN_USER_ID;
|
||||
case WC_NID_businessCategory: return ASN_BUS_CAT;
|
||||
case WC_NID_domainComponent: return ASN_DOMAIN_COMPONENT;
|
||||
case WC_NID_postalCode: return ASN_POSTAL_CODE;
|
||||
case WC_NID_favouriteDrink: return ASN_FAVOURITE_DRINK;
|
||||
default:
|
||||
WOLFSSL_MSG("Attribute NID not found");
|
||||
return WOLFSSL_FATAL_ERROR;
|
||||
|
@ -11559,7 +11559,7 @@ int wolfSSL_i2d_X509_NAME(WOLFSSL_X509_NAME* name, unsigned char** out)
|
|||
type = CTC_UTF8;
|
||||
break;
|
||||
case WOLFSSL_MBSTRING_ASC:
|
||||
case WOLFSSL_ASN1_TYPE_PRINTABLESTRING:
|
||||
case WOLFSSL_V_ASN1_PRINTABLESTRING:
|
||||
type = CTC_PRINTABLE;
|
||||
break;
|
||||
default:
|
||||
|
@ -12579,7 +12579,7 @@ err:
|
|||
}
|
||||
|
||||
nid = wolfSSL_OBJ_txt2nid(txt);
|
||||
if (nid == wc_NID_undef) {
|
||||
if (nid == WC_NID_undef) {
|
||||
WOLFSSL_MSG("Unable to find text");
|
||||
ne = NULL;
|
||||
}
|
||||
|
@ -12856,7 +12856,7 @@ WOLFSSL_ASN1_OBJECT* wolfSSL_X509_NAME_ENTRY_get_object(
|
|||
if (name == NULL || field == NULL)
|
||||
return WOLFSSL_FAILURE;
|
||||
|
||||
if ((nid = wolfSSL_OBJ_txt2nid(field)) == wc_NID_undef) {
|
||||
if ((nid = wolfSSL_OBJ_txt2nid(field)) == WC_NID_undef) {
|
||||
WOLFSSL_MSG("Unable convert text to NID");
|
||||
return WOLFSSL_FAILURE;
|
||||
}
|
||||
|
@ -13506,79 +13506,79 @@ static int get_dn_attr_by_nid(int n, const char** buf)
|
|||
|
||||
switch(n)
|
||||
{
|
||||
case wc_NID_commonName :
|
||||
case WC_NID_commonName :
|
||||
str = "CN";
|
||||
len = 2;
|
||||
break;
|
||||
case wc_NID_countryName:
|
||||
case WC_NID_countryName:
|
||||
str = "C";
|
||||
len = 1;
|
||||
break;
|
||||
case wc_NID_localityName:
|
||||
case WC_NID_localityName:
|
||||
str = "L";
|
||||
len = 1;
|
||||
break;
|
||||
case wc_NID_stateOrProvinceName:
|
||||
case WC_NID_stateOrProvinceName:
|
||||
str = "ST";
|
||||
len = 2;
|
||||
break;
|
||||
case wc_NID_streetAddress:
|
||||
case WC_NID_streetAddress:
|
||||
str = "street";
|
||||
len = 6;
|
||||
break;
|
||||
case wc_NID_organizationName:
|
||||
case WC_NID_organizationName:
|
||||
str = "O";
|
||||
len = 1;
|
||||
break;
|
||||
case wc_NID_organizationalUnitName:
|
||||
case WC_NID_organizationalUnitName:
|
||||
str = "OU";
|
||||
len = 2;
|
||||
break;
|
||||
case wc_NID_postalCode:
|
||||
case WC_NID_postalCode:
|
||||
str = "postalCode";
|
||||
len = 10;
|
||||
break;
|
||||
case wc_NID_emailAddress:
|
||||
case WC_NID_emailAddress:
|
||||
str = "emailAddress";
|
||||
len = 12;
|
||||
break;
|
||||
case wc_NID_surname:
|
||||
case WC_NID_surname:
|
||||
str = "SN";
|
||||
len = 2;
|
||||
break;
|
||||
case wc_NID_givenName:
|
||||
case WC_NID_givenName:
|
||||
str = "GN";
|
||||
len = 2;
|
||||
break;
|
||||
case wc_NID_dnQualifier:
|
||||
case WC_NID_dnQualifier:
|
||||
str = "dnQualifier";
|
||||
len = 11;
|
||||
break;
|
||||
case wc_NID_name:
|
||||
case WC_NID_name:
|
||||
str = "name";
|
||||
len = 4;
|
||||
break;
|
||||
case wc_NID_initials:
|
||||
case WC_NID_initials:
|
||||
str = "initials";
|
||||
len = 8;
|
||||
break;
|
||||
case wc_NID_domainComponent:
|
||||
case WC_NID_domainComponent:
|
||||
str = "DC";
|
||||
len = 2;
|
||||
break;
|
||||
case wc_NID_pkcs9_contentType:
|
||||
case WC_NID_pkcs9_contentType:
|
||||
str = "contentType";
|
||||
len = 11;
|
||||
break;
|
||||
case wc_NID_userId:
|
||||
case WC_NID_userId:
|
||||
str = "UID";
|
||||
len = 3;
|
||||
break;
|
||||
case wc_NID_serialNumber:
|
||||
case WC_NID_serialNumber:
|
||||
str = "serialNumber";
|
||||
len = 12;
|
||||
break;
|
||||
case wc_NID_title:
|
||||
case WC_NID_title:
|
||||
str = "title";
|
||||
len = 5;
|
||||
break;
|
||||
|
@ -13926,7 +13926,7 @@ int wolfSSL_X509_get_ex_new_index(int idx, void *arg,
|
|||
{
|
||||
WOLFSSL_ENTER("wolfSSL_X509_get_ex_new_index");
|
||||
|
||||
return wolfssl_get_ex_new_index(CRYPTO_EX_INDEX_X509, idx, arg,
|
||||
return wolfssl_get_ex_new_index(WOLF_CRYPTO_EX_INDEX_X509, idx, arg,
|
||||
new_func, dup_func, free_func);
|
||||
}
|
||||
#endif
|
||||
|
@ -14147,7 +14147,7 @@ int wolfSSL_X509_check_email(WOLFSSL_X509 *x, const char *chk, size_t chkLen,
|
|||
return WOLFSSL_FAILURE;
|
||||
|
||||
/* Call with NULL buffer to get required length. */
|
||||
emailLen = wolfSSL_X509_NAME_get_text_by_NID(subjName, wc_NID_emailAddress,
|
||||
emailLen = wolfSSL_X509_NAME_get_text_by_NID(subjName, WC_NID_emailAddress,
|
||||
NULL, 0);
|
||||
if (emailLen < 0)
|
||||
return WOLFSSL_FAILURE;
|
||||
|
@ -14158,7 +14158,7 @@ int wolfSSL_X509_check_email(WOLFSSL_X509 *x, const char *chk, size_t chkLen,
|
|||
if (emailBuf == NULL)
|
||||
return WOLFSSL_FAILURE;
|
||||
|
||||
emailLen = wolfSSL_X509_NAME_get_text_by_NID(subjName, wc_NID_emailAddress,
|
||||
emailLen = wolfSSL_X509_NAME_get_text_by_NID(subjName, WC_NID_emailAddress,
|
||||
emailBuf, emailLen);
|
||||
if (emailLen < 0) {
|
||||
XFREE(emailBuf, x->heap, DYNAMIC_TYPE_OPENSSL);
|
||||
|
@ -15047,7 +15047,7 @@ int wolfSSL_X509_REQ_add1_attr_by_NID(WOLFSSL_X509 *req,
|
|||
}
|
||||
|
||||
switch (nid) {
|
||||
case wc_NID_pkcs9_challengePassword:
|
||||
case WC_NID_pkcs9_challengePassword:
|
||||
if (len < 0)
|
||||
len = (int)XSTRLEN((char*)bytes);
|
||||
if (len < CTC_NAME_SIZE) {
|
||||
|
@ -15060,7 +15060,7 @@ int wolfSSL_X509_REQ_add1_attr_by_NID(WOLFSSL_X509 *req,
|
|||
return WOLFSSL_FAILURE;
|
||||
}
|
||||
break;
|
||||
case wc_NID_serialNumber:
|
||||
case WC_NID_serialNumber:
|
||||
if (len < 0)
|
||||
len = (int)XSTRLEN((char*)bytes);
|
||||
if (len + 1 > EXTERNAL_SERIAL_SIZE) {
|
||||
|
@ -15072,12 +15072,12 @@ int wolfSSL_X509_REQ_add1_attr_by_NID(WOLFSSL_X509 *req,
|
|||
req->serialSz = len;
|
||||
break;
|
||||
|
||||
case wc_NID_pkcs9_unstructuredName:
|
||||
case wc_NID_pkcs9_contentType:
|
||||
case wc_NID_surname:
|
||||
case wc_NID_initials:
|
||||
case wc_NID_givenName:
|
||||
case wc_NID_dnQualifier:
|
||||
case WC_NID_pkcs9_unstructuredName:
|
||||
case WC_NID_pkcs9_contentType:
|
||||
case WC_NID_surname:
|
||||
case WC_NID_initials:
|
||||
case WC_NID_givenName:
|
||||
case WC_NID_dnQualifier:
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -15087,7 +15087,7 @@ int wolfSSL_X509_REQ_add1_attr_by_NID(WOLFSSL_X509 *req,
|
|||
|
||||
attr = wolfSSL_X509_ATTRIBUTE_new();
|
||||
ret = wolfSSL_X509_ATTRIBUTE_set(attr, (const char*)bytes, len,
|
||||
WOLFSSL_ASN1_TYPE_PRINTABLESTRING, nid);
|
||||
WOLFSSL_V_ASN1_PRINTABLESTRING, nid);
|
||||
if (ret != WOLFSSL_SUCCESS) {
|
||||
wolfSSL_X509_ATTRIBUTE_free(attr);
|
||||
}
|
||||
|
|
|
@ -5549,7 +5549,7 @@ const byte* OidFromId(word32 id, word32 type, word32* oidSz)
|
|||
#ifdef WOLFSSL_APACHE_HTTPD
|
||||
case oidCertNameType:
|
||||
switch (id) {
|
||||
case wc_NID_id_on_dnsSRV:
|
||||
case WC_NID_id_on_dnsSRV:
|
||||
oid = dnsSRVOid;
|
||||
*oidSz = sizeof(dnsSRVOid);
|
||||
break;
|
||||
|
@ -13102,7 +13102,7 @@ static const CertNameData certNameSubject[] = {
|
|||
#endif
|
||||
#endif
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
wc_NID_commonName
|
||||
WC_NID_commonName
|
||||
#endif
|
||||
},
|
||||
/* Surname */
|
||||
|
@ -13119,7 +13119,7 @@ static const CertNameData certNameSubject[] = {
|
|||
#endif
|
||||
#endif
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
wc_NID_surname
|
||||
WC_NID_surname
|
||||
#endif
|
||||
},
|
||||
/* Serial Number */
|
||||
|
@ -13136,7 +13136,7 @@ static const CertNameData certNameSubject[] = {
|
|||
#endif
|
||||
#endif
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
wc_NID_serialNumber
|
||||
WC_NID_serialNumber
|
||||
#endif
|
||||
},
|
||||
/* Country Name */
|
||||
|
@ -13153,7 +13153,7 @@ static const CertNameData certNameSubject[] = {
|
|||
#endif
|
||||
#endif
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
wc_NID_countryName
|
||||
WC_NID_countryName
|
||||
#endif
|
||||
},
|
||||
/* Locality Name */
|
||||
|
@ -13170,7 +13170,7 @@ static const CertNameData certNameSubject[] = {
|
|||
#endif
|
||||
#endif
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
wc_NID_localityName
|
||||
WC_NID_localityName
|
||||
#endif
|
||||
},
|
||||
/* State Name */
|
||||
|
@ -13187,7 +13187,7 @@ static const CertNameData certNameSubject[] = {
|
|||
#endif
|
||||
#endif
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
wc_NID_stateOrProvinceName
|
||||
WC_NID_stateOrProvinceName
|
||||
#endif
|
||||
},
|
||||
/* Street Address */
|
||||
|
@ -13204,7 +13204,7 @@ static const CertNameData certNameSubject[] = {
|
|||
#endif
|
||||
#endif
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
wc_NID_streetAddress
|
||||
WC_NID_streetAddress
|
||||
#endif
|
||||
},
|
||||
/* Organization Name */
|
||||
|
@ -13221,7 +13221,7 @@ static const CertNameData certNameSubject[] = {
|
|||
#endif
|
||||
#endif
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
wc_NID_organizationName
|
||||
WC_NID_organizationName
|
||||
#endif
|
||||
},
|
||||
/* Organization Unit Name */
|
||||
|
@ -13238,7 +13238,7 @@ static const CertNameData certNameSubject[] = {
|
|||
#endif
|
||||
#endif
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
wc_NID_organizationalUnitName
|
||||
WC_NID_organizationalUnitName
|
||||
#endif
|
||||
},
|
||||
/* Title */
|
||||
|
@ -13306,7 +13306,7 @@ static const CertNameData certNameSubject[] = {
|
|||
#endif
|
||||
#endif
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
wc_NID_businessCategory
|
||||
WC_NID_businessCategory
|
||||
#endif
|
||||
},
|
||||
/* Undefined */
|
||||
|
@ -13340,7 +13340,7 @@ static const CertNameData certNameSubject[] = {
|
|||
#endif
|
||||
#endif
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
wc_NID_postalCode
|
||||
WC_NID_postalCode
|
||||
#endif
|
||||
},
|
||||
/* User Id */
|
||||
|
@ -13357,7 +13357,7 @@ static const CertNameData certNameSubject[] = {
|
|||
#endif
|
||||
#endif
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
wc_NID_userId
|
||||
WC_NID_userId
|
||||
#endif
|
||||
},
|
||||
#ifdef WOLFSSL_CERT_NAME_ALL
|
||||
|
@ -13375,7 +13375,7 @@ static const CertNameData certNameSubject[] = {
|
|||
#endif
|
||||
#endif
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
wc_NID_name
|
||||
WC_NID_name
|
||||
#endif
|
||||
},
|
||||
/* Given Name, id 42 */
|
||||
|
@ -13392,7 +13392,7 @@ static const CertNameData certNameSubject[] = {
|
|||
#endif
|
||||
#endif
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
wc_NID_givenName
|
||||
WC_NID_givenName
|
||||
#endif
|
||||
},
|
||||
/* initials, id 43 */
|
||||
|
@ -13409,7 +13409,7 @@ static const CertNameData certNameSubject[] = {
|
|||
#endif
|
||||
#endif
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
wc_NID_initials
|
||||
WC_NID_initials
|
||||
#endif
|
||||
},
|
||||
/* DN Qualifier Name, id 46 */
|
||||
|
@ -13426,7 +13426,7 @@ static const CertNameData certNameSubject[] = {
|
|||
#endif
|
||||
#endif
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
wc_NID_dnQualifier
|
||||
WC_NID_dnQualifier
|
||||
#endif
|
||||
},
|
||||
#endif /* WOLFSSL_CERT_NAME_ALL */
|
||||
|
@ -13863,7 +13863,7 @@ static int GetRDN(DecodedCert* cert, char* full, word32* idx, int* nid,
|
|||
typeStr = WOLFSSL_EMAIL_ADDR;
|
||||
typeStrLen = sizeof(WOLFSSL_EMAIL_ADDR) - 1;
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
*nid = wc_NID_emailAddress;
|
||||
*nid = WC_NID_emailAddress;
|
||||
#endif
|
||||
}
|
||||
else if (oidSz == sizeof(uidOid) && XMEMCMP(oid, uidOid, oidSz) == 0) {
|
||||
|
@ -13872,7 +13872,7 @@ static int GetRDN(DecodedCert* cert, char* full, word32* idx, int* nid,
|
|||
typeStr = WOLFSSL_USER_ID;
|
||||
typeStrLen = sizeof(WOLFSSL_USER_ID) - 1;
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
*nid = wc_NID_userId;
|
||||
*nid = WC_NID_userId;
|
||||
#endif
|
||||
}
|
||||
else if (oidSz == sizeof(dcOid) && XMEMCMP(oid, dcOid, oidSz) == 0) {
|
||||
|
@ -13881,7 +13881,7 @@ static int GetRDN(DecodedCert* cert, char* full, word32* idx, int* nid,
|
|||
typeStr = WOLFSSL_DOMAIN_COMPONENT;
|
||||
typeStrLen = sizeof(WOLFSSL_DOMAIN_COMPONENT) - 1;
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
*nid = wc_NID_domainComponent;
|
||||
*nid = WC_NID_domainComponent;
|
||||
#endif
|
||||
}
|
||||
else if (oidSz == sizeof(fvrtDrk) && XMEMCMP(oid, fvrtDrk, oidSz) == 0) {
|
||||
|
@ -13890,7 +13890,7 @@ static int GetRDN(DecodedCert* cert, char* full, word32* idx, int* nid,
|
|||
typeStr = WOLFSSL_FAVOURITE_DRINK;
|
||||
typeStrLen = sizeof(WOLFSSL_FAVOURITE_DRINK) - 1;
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
*nid = wc_NID_favouriteDrink;
|
||||
*nid = WC_NID_favouriteDrink;
|
||||
#endif
|
||||
}
|
||||
#ifdef WOLFSSL_CERT_REQ
|
||||
|
@ -13901,7 +13901,7 @@ static int GetRDN(DecodedCert* cert, char* full, word32* idx, int* nid,
|
|||
typeStr = WOLFSSL_CONTENT_TYPE;
|
||||
typeStrLen = sizeof(WOLFSSL_CONTENT_TYPE) - 1;
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
*nid = wc_NID_pkcs9_contentType;
|
||||
*nid = WC_NID_pkcs9_contentType;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
@ -13921,14 +13921,14 @@ static int GetRDN(DecodedCert* cert, char* full, word32* idx, int* nid,
|
|||
typeStr = WOLFSSL_JOI_C;
|
||||
typeStrLen = sizeof(WOLFSSL_JOI_C) - 1;
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
*nid = wc_NID_jurisdictionCountryName;
|
||||
*nid = WC_NID_jurisdictionCountryName;
|
||||
#endif /* WOLFSSL_X509_NAME_AVAILABLE */
|
||||
}
|
||||
else if (oid[ASN_JOI_PREFIX_SZ] == ASN_JOI_ST) {
|
||||
typeStr = WOLFSSL_JOI_ST;
|
||||
typeStrLen = sizeof(WOLFSSL_JOI_ST) - 1;
|
||||
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
||||
*nid = wc_NID_jurisdictionStateOrProvinceName;
|
||||
*nid = WC_NID_jurisdictionStateOrProvinceName;
|
||||
#endif /* WOLFSSL_X509_NAME_AVAILABLE */
|
||||
}
|
||||
else {
|
||||
|
@ -14063,7 +14063,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
byte id = 0;
|
||||
#if (defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
int nid = wc_NID_undef;
|
||||
int nid = WC_NID_undef;
|
||||
int enc;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
|
||||
|
@ -14146,7 +14146,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
copyLen = sizeof(WOLFSSL_COMMON_NAME) - 1;
|
||||
#if (defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_commonName;
|
||||
nid = WC_NID_commonName;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
}
|
||||
#ifdef WOLFSSL_CERT_NAME_ALL
|
||||
|
@ -14163,7 +14163,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#if (defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_name;
|
||||
nid = WC_NID_name;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
}
|
||||
else if (id == ASN_INITIALS) {
|
||||
|
@ -14179,7 +14179,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#if (defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_initials;
|
||||
nid = WC_NID_initials;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
}
|
||||
else if (id == ASN_GIVEN_NAME) {
|
||||
|
@ -14195,7 +14195,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#if (defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_givenName;
|
||||
nid = WC_NID_givenName;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
}
|
||||
else if (id == ASN_DNQUALIFIER) {
|
||||
|
@ -14211,7 +14211,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#if (defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_dnQualifier;
|
||||
nid = WC_NID_dnQualifier;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
}
|
||||
#endif /* WOLFSSL_CERT_NAME_ALL */
|
||||
|
@ -14235,7 +14235,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#if (defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_surname;
|
||||
nid = WC_NID_surname;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
}
|
||||
else if (id == ASN_COUNTRY_NAME) {
|
||||
|
@ -14258,7 +14258,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#if (defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_countryName;
|
||||
nid = WC_NID_countryName;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
}
|
||||
else if (id == ASN_LOCALITY_NAME) {
|
||||
|
@ -14281,7 +14281,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#if (defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_localityName;
|
||||
nid = WC_NID_localityName;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
}
|
||||
else if (id == ASN_STATE_NAME) {
|
||||
|
@ -14304,7 +14304,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#if (defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_stateOrProvinceName;
|
||||
nid = WC_NID_stateOrProvinceName;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
}
|
||||
else if (id == ASN_ORG_NAME) {
|
||||
|
@ -14327,7 +14327,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#if (defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_organizationName;
|
||||
nid = WC_NID_organizationName;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
}
|
||||
else if (id == ASN_ORGUNIT_NAME) {
|
||||
|
@ -14350,7 +14350,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#if (defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_organizationalUnitName;
|
||||
nid = WC_NID_organizationalUnitName;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
}
|
||||
else if (id == ASN_SERIAL_NUMBER) {
|
||||
|
@ -14373,7 +14373,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#if (defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_serialNumber;
|
||||
nid = WC_NID_serialNumber;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
}
|
||||
else if (id == ASN_USER_ID) {
|
||||
|
@ -14389,7 +14389,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#if (defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_userId;
|
||||
nid = WC_NID_userId;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
}
|
||||
#ifdef WOLFSSL_CERT_EXT
|
||||
|
@ -14406,7 +14406,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#if (defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_streetAddress;
|
||||
nid = WC_NID_streetAddress;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
}
|
||||
else if (id == ASN_BUS_CAT) {
|
||||
|
@ -14421,7 +14421,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#endif /* WOLFSSL_CERT_GEN || WOLFSSL_CERT_EXT */
|
||||
#if (defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_businessCategory;
|
||||
nid = WC_NID_businessCategory;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
}
|
||||
else if (id == ASN_POSTAL_CODE) {
|
||||
|
@ -14437,7 +14437,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#if (defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_postalCode;
|
||||
nid = WC_NID_postalCode;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
}
|
||||
#endif /* WOLFSSL_CERT_EXT */
|
||||
|
@ -14476,7 +14476,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#if (defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_jurisdictionCountryName;
|
||||
nid = WC_NID_jurisdictionCountryName;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
}
|
||||
|
||||
|
@ -14494,7 +14494,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#if (defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_jurisdictionStateOrProvinceName;
|
||||
nid = WC_NID_jurisdictionStateOrProvinceName;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
}
|
||||
|
||||
|
@ -14564,7 +14564,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#if (defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_emailAddress;
|
||||
nid = WC_NID_emailAddress;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
}
|
||||
|
||||
|
@ -14576,7 +14576,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#if (defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_userId;
|
||||
nid = WC_NID_userId;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
break;
|
||||
case ASN_DOMAIN_COMPONENT:
|
||||
|
@ -14585,7 +14585,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#if (defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_domainComponent;
|
||||
nid = WC_NID_domainComponent;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
break;
|
||||
case ASN_FAVOURITE_DRINK:
|
||||
|
@ -14594,7 +14594,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#if (defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_favouriteDrink;
|
||||
nid = WC_NID_favouriteDrink;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
break;
|
||||
case ASN_CONTENT_TYPE:
|
||||
|
@ -14603,7 +14603,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
#if (defined(OPENSSL_EXTRA) || \
|
||||
defined(OPENSSL_EXTRA_X509_SMALL)) \
|
||||
&& !defined(WOLFCRYPT_ONLY)
|
||||
nid = wc_NID_pkcs9_contentType;
|
||||
nid = WC_NID_pkcs9_contentType;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
break;
|
||||
default:
|
||||
|
@ -14632,17 +14632,17 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
!defined(WOLFCRYPT_ONLY)
|
||||
switch (b) {
|
||||
case CTC_UTF8:
|
||||
enc = MBSTRING_UTF8;
|
||||
enc = WOLFSSL_MBSTRING_UTF8;
|
||||
break;
|
||||
case CTC_PRINTABLE:
|
||||
enc = WOLFSSL_ASN1_TYPE_PRINTABLESTRING;
|
||||
enc = WOLFSSL_V_ASN1_PRINTABLESTRING;
|
||||
break;
|
||||
default:
|
||||
WOLFSSL_MSG("Unknown encoding type, using UTF8 by default");
|
||||
enc = MBSTRING_UTF8;
|
||||
enc = WOLFSSL_MBSTRING_UTF8;
|
||||
}
|
||||
|
||||
if (nid != wc_NID_undef) {
|
||||
if (nid != WC_NID_undef) {
|
||||
if (wolfSSL_X509_NAME_add_entry_by_NID(dName, nid, enc,
|
||||
&input[srcIdx], strLen, -1, -1) !=
|
||||
WOLFSSL_SUCCESS) {
|
||||
|
@ -14775,7 +14775,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
|||
enc = WOLFSSL_MBSTRING_UTF8;
|
||||
break;
|
||||
case CTC_PRINTABLE:
|
||||
enc = WOLFSSL_ASN1_TYPE_PRINTABLESTRING;
|
||||
enc = WOLFSSL_V_ASN1_PRINTABLESTRING;
|
||||
break;
|
||||
default:
|
||||
WOLFSSL_MSG("Unknown encoding type, default UTF8");
|
||||
|
|
|
@ -52,67 +52,67 @@ static const struct s_ent {
|
|||
const char *name;
|
||||
} md_tbl[] = {
|
||||
#ifndef NO_MD4
|
||||
{WC_HASH_TYPE_MD4, wc_NID_md4, "MD4"},
|
||||
{WC_HASH_TYPE_MD4, WC_NID_md4, "MD4"},
|
||||
#endif /* NO_MD4 */
|
||||
|
||||
#ifndef NO_MD5
|
||||
{WC_HASH_TYPE_MD5, wc_NID_md5, "MD5"},
|
||||
{WC_HASH_TYPE_MD5, WC_NID_md5, "MD5"},
|
||||
#endif /* NO_MD5 */
|
||||
|
||||
#ifndef NO_SHA
|
||||
{WC_HASH_TYPE_SHA, wc_NID_sha1, "SHA1"},
|
||||
{WC_HASH_TYPE_SHA, wc_NID_sha1, "SHA"}, /* Leave for backwards compatibility */
|
||||
{WC_HASH_TYPE_SHA, WC_NID_sha1, "SHA1"},
|
||||
{WC_HASH_TYPE_SHA, WC_NID_sha1, "SHA"}, /* Leave for backwards compatibility */
|
||||
#endif /* NO_SHA */
|
||||
|
||||
#ifdef WOLFSSL_SHA224
|
||||
{WC_HASH_TYPE_SHA224, wc_NID_sha224, "SHA224"},
|
||||
{WC_HASH_TYPE_SHA224, WC_NID_sha224, "SHA224"},
|
||||
#endif /* WOLFSSL_SHA224 */
|
||||
#ifndef NO_SHA256
|
||||
{WC_HASH_TYPE_SHA256, wc_NID_sha256, "SHA256"},
|
||||
{WC_HASH_TYPE_SHA256, WC_NID_sha256, "SHA256"},
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_SHA384
|
||||
{WC_HASH_TYPE_SHA384, wc_NID_sha384, "SHA384"},
|
||||
{WC_HASH_TYPE_SHA384, WC_NID_sha384, "SHA384"},
|
||||
#endif /* WOLFSSL_SHA384 */
|
||||
|
||||
#ifdef WOLFSSL_SHA512
|
||||
{WC_HASH_TYPE_SHA512, wc_NID_sha512, "SHA512"},
|
||||
{WC_HASH_TYPE_SHA512, WC_NID_sha512, "SHA512"},
|
||||
#endif /* WOLFSSL_SHA512 */
|
||||
|
||||
#if defined(WOLFSSL_SHA512) && !defined(WOLFSSL_NOSHA512_224)
|
||||
{WC_HASH_TYPE_SHA512_224, wc_NID_sha512_224, "SHA512_224"},
|
||||
{WC_HASH_TYPE_SHA512_224, WC_NID_sha512_224, "SHA512_224"},
|
||||
#endif /* WOLFSSL_SHA512 && !WOLFSSL_NOSHA512_224 */
|
||||
|
||||
#if defined(WOLFSSL_SHA512) && !defined(WOLFSSL_NOSHA512_256)
|
||||
{WC_HASH_TYPE_SHA512_256, wc_NID_sha512_256, "SHA512_256"},
|
||||
{WC_HASH_TYPE_SHA512_256, WC_NID_sha512_256, "SHA512_256"},
|
||||
#endif /* WOLFSSL_SHA512 && !WOLFSSL_NOSHA512_256 */
|
||||
|
||||
#ifndef WOLFSSL_NOSHA3_224
|
||||
{WC_HASH_TYPE_SHA3_224, wc_NID_sha3_224, "SHA3_224"},
|
||||
{WC_HASH_TYPE_SHA3_224, WC_NID_sha3_224, "SHA3_224"},
|
||||
#endif
|
||||
#ifndef WOLFSSL_NOSHA3_256
|
||||
{WC_HASH_TYPE_SHA3_256, wc_NID_sha3_256, "SHA3_256"},
|
||||
{WC_HASH_TYPE_SHA3_256, WC_NID_sha3_256, "SHA3_256"},
|
||||
#endif
|
||||
#ifndef WOLFSSL_NOSHA3_384
|
||||
{WC_HASH_TYPE_SHA3_384, wc_NID_sha3_384, "SHA3_384"},
|
||||
{WC_HASH_TYPE_SHA3_384, WC_NID_sha3_384, "SHA3_384"},
|
||||
#endif
|
||||
#ifndef WOLFSSL_NOSHA3_512
|
||||
{WC_HASH_TYPE_SHA3_512, wc_NID_sha3_512, "SHA3_512"},
|
||||
{WC_HASH_TYPE_SHA3_512, WC_NID_sha3_512, "SHA3_512"},
|
||||
#endif
|
||||
#ifdef WOLFSSL_SM3
|
||||
{WC_HASH_TYPE_SM3, wc_NID_sm3, "SM3"},
|
||||
{WC_HASH_TYPE_SM3, WC_NID_sm3, "SM3"},
|
||||
#endif /* WOLFSSL_SHA512 */
|
||||
#ifdef HAVE_BLAKE2
|
||||
{WC_HASH_TYPE_BLAKE2B, wc_NID_blake2b512, "BLAKE2B512"},
|
||||
{WC_HASH_TYPE_BLAKE2B, WC_NID_blake2b512, "BLAKE2B512"},
|
||||
#endif
|
||||
#ifdef HAVE_BLAKE2S
|
||||
{WC_HASH_TYPE_BLAKE2S, wc_NID_blake2s256, "BLAKE2S256"},
|
||||
{WC_HASH_TYPE_BLAKE2S, WC_NID_blake2s256, "BLAKE2S256"},
|
||||
#endif
|
||||
#ifdef WOLFSSL_SHAKE128
|
||||
{WC_HASH_TYPE_SHAKE128, wc_NID_shake128, "SHAKE128"},
|
||||
{WC_HASH_TYPE_SHAKE128, WC_NID_shake128, "SHAKE128"},
|
||||
#endif
|
||||
#ifdef WOLFSSL_SHAKE256
|
||||
{WC_HASH_TYPE_SHAKE256, wc_NID_shake256, "SHAKE256"},
|
||||
{WC_HASH_TYPE_SHAKE256, WC_NID_shake256, "SHAKE256"},
|
||||
#endif
|
||||
{WC_HASH_TYPE_NONE, 0, NULL}
|
||||
};
|
||||
|
@ -2628,7 +2628,7 @@ int wolfSSL_EVP_PKEY_derive(WOLFSSL_EVP_PKEY_CTX *ctx, unsigned char *key, size_
|
|||
WOLFSSL_MSG("Invalid hash type for HKDF.");
|
||||
return WOLFSSL_FAILURE;
|
||||
}
|
||||
if (ctx->pkey->hkdfMode == EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND) {
|
||||
if (ctx->pkey->hkdfMode == WOLFSSL_EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND) {
|
||||
if (wc_HKDF(hkdfHashType, ctx->pkey->hkdfKey, ctx->pkey->hkdfKeySz,
|
||||
ctx->pkey->hkdfSalt, ctx->pkey->hkdfSaltSz,
|
||||
ctx->pkey->hkdfInfo, ctx->pkey->hkdfInfoSz, key,
|
||||
|
@ -2637,7 +2637,7 @@ int wolfSSL_EVP_PKEY_derive(WOLFSSL_EVP_PKEY_CTX *ctx, unsigned char *key, size_
|
|||
return WOLFSSL_FAILURE;
|
||||
}
|
||||
}
|
||||
else if (ctx->pkey->hkdfMode == EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY) {
|
||||
else if (ctx->pkey->hkdfMode == WOLFSSL_EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY) {
|
||||
if (wc_HKDF_Extract(hkdfHashType, ctx->pkey->hkdfSalt,
|
||||
ctx->pkey->hkdfSaltSz, ctx->pkey->hkdfKey,
|
||||
ctx->pkey->hkdfKeySz, key) != 0) {
|
||||
|
@ -2654,7 +2654,7 @@ int wolfSSL_EVP_PKEY_derive(WOLFSSL_EVP_PKEY_CTX *ctx, unsigned char *key, size_
|
|||
*keylen = (size_t)hkdfHashSz;
|
||||
}
|
||||
}
|
||||
else if (ctx->pkey->hkdfMode == EVP_PKEY_HKDEF_MODE_EXPAND_ONLY) {
|
||||
else if (ctx->pkey->hkdfMode == WOLFSSL_EVP_PKEY_HKDEF_MODE_EXPAND_ONLY) {
|
||||
if (wc_HKDF_Expand(hkdfHashType, ctx->pkey->hkdfKey,
|
||||
ctx->pkey->hkdfKeySz, ctx->pkey->hkdfInfo,
|
||||
ctx->pkey->hkdfInfoSz, key,
|
||||
|
@ -2830,9 +2830,10 @@ int wolfSSL_EVP_PKEY_CTX_hkdf_mode(WOLFSSL_EVP_PKEY_CTX* ctx, int mode)
|
|||
}
|
||||
|
||||
if (ret == WOLFSSL_SUCCESS &&
|
||||
mode != EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND &&
|
||||
mode != EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY &&
|
||||
mode != EVP_PKEY_HKDEF_MODE_EXPAND_ONLY) {
|
||||
mode != WOLFSSL_EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND &&
|
||||
mode != WOLFSSL_EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY &&
|
||||
mode != WOLFSSL_EVP_PKEY_HKDEF_MODE_EXPAND_ONLY)
|
||||
{
|
||||
WOLFSSL_MSG("Invalid HKDF mode.");
|
||||
ret = WOLFSSL_FAILURE;
|
||||
}
|
||||
|
@ -4954,159 +4955,159 @@ static const struct cipher{
|
|||
#ifndef NO_AES
|
||||
#if defined(HAVE_AES_CBC) || defined(WOLFSSL_AES_DIRECT)
|
||||
#ifdef WOLFSSL_AES_128
|
||||
{WC_AES_128_CBC_TYPE, EVP_AES_128_CBC, wc_NID_aes_128_cbc},
|
||||
{WC_AES_128_CBC_TYPE, EVP_AES_128_CBC, WC_NID_aes_128_cbc},
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_192
|
||||
{WC_AES_192_CBC_TYPE, EVP_AES_192_CBC, wc_NID_aes_192_cbc},
|
||||
{WC_AES_192_CBC_TYPE, EVP_AES_192_CBC, WC_NID_aes_192_cbc},
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_256
|
||||
{WC_AES_256_CBC_TYPE, EVP_AES_256_CBC, wc_NID_aes_256_cbc},
|
||||
{WC_AES_256_CBC_TYPE, EVP_AES_256_CBC, WC_NID_aes_256_cbc},
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_AES_CFB
|
||||
#ifdef WOLFSSL_AES_128
|
||||
{WC_AES_128_CFB1_TYPE, EVP_AES_128_CFB1, wc_NID_aes_128_cfb1},
|
||||
{WC_AES_128_CFB1_TYPE, EVP_AES_128_CFB1, WC_NID_aes_128_cfb1},
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_192
|
||||
{WC_AES_192_CFB1_TYPE, EVP_AES_192_CFB1, wc_NID_aes_192_cfb1},
|
||||
{WC_AES_192_CFB1_TYPE, EVP_AES_192_CFB1, WC_NID_aes_192_cfb1},
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_256
|
||||
{WC_AES_256_CFB1_TYPE, EVP_AES_256_CFB1, wc_NID_aes_256_cfb1},
|
||||
{WC_AES_256_CFB1_TYPE, EVP_AES_256_CFB1, WC_NID_aes_256_cfb1},
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_AES_128
|
||||
{WC_AES_128_CFB8_TYPE, EVP_AES_128_CFB8, wc_NID_aes_128_cfb8},
|
||||
{WC_AES_128_CFB8_TYPE, EVP_AES_128_CFB8, WC_NID_aes_128_cfb8},
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_192
|
||||
{WC_AES_192_CFB8_TYPE, EVP_AES_192_CFB8, wc_NID_aes_192_cfb8},
|
||||
{WC_AES_192_CFB8_TYPE, EVP_AES_192_CFB8, WC_NID_aes_192_cfb8},
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_256
|
||||
{WC_AES_256_CFB8_TYPE, EVP_AES_256_CFB8, wc_NID_aes_256_cfb8},
|
||||
{WC_AES_256_CFB8_TYPE, EVP_AES_256_CFB8, WC_NID_aes_256_cfb8},
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_AES_128
|
||||
{WC_AES_128_CFB128_TYPE, EVP_AES_128_CFB128, wc_NID_aes_128_cfb128},
|
||||
{WC_AES_128_CFB128_TYPE, EVP_AES_128_CFB128, WC_NID_aes_128_cfb128},
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_192
|
||||
{WC_AES_192_CFB128_TYPE, EVP_AES_192_CFB128, wc_NID_aes_192_cfb128},
|
||||
{WC_AES_192_CFB128_TYPE, EVP_AES_192_CFB128, WC_NID_aes_192_cfb128},
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_256
|
||||
{WC_AES_256_CFB128_TYPE, EVP_AES_256_CFB128, wc_NID_aes_256_cfb128},
|
||||
{WC_AES_256_CFB128_TYPE, EVP_AES_256_CFB128, WC_NID_aes_256_cfb128},
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_AES_OFB
|
||||
#ifdef WOLFSSL_AES_128
|
||||
{WC_AES_128_OFB_TYPE, EVP_AES_128_OFB, wc_NID_aes_128_ofb},
|
||||
{WC_AES_128_OFB_TYPE, EVP_AES_128_OFB, WC_NID_aes_128_ofb},
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_192
|
||||
{WC_AES_192_OFB_TYPE, EVP_AES_192_OFB, wc_NID_aes_192_ofb},
|
||||
{WC_AES_192_OFB_TYPE, EVP_AES_192_OFB, WC_NID_aes_192_ofb},
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_256
|
||||
{WC_AES_256_OFB_TYPE, EVP_AES_256_OFB, wc_NID_aes_256_ofb},
|
||||
{WC_AES_256_OFB_TYPE, EVP_AES_256_OFB, WC_NID_aes_256_ofb},
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(WOLFSSL_AES_XTS) && \
|
||||
(!defined(HAVE_FIPS) || FIPS_VERSION_GE(5,3))
|
||||
#ifdef WOLFSSL_AES_128
|
||||
{WC_AES_128_XTS_TYPE, EVP_AES_128_XTS, wc_NID_aes_128_xts},
|
||||
{WC_AES_128_XTS_TYPE, EVP_AES_128_XTS, WC_NID_aes_128_xts},
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_256
|
||||
{WC_AES_256_XTS_TYPE, EVP_AES_256_XTS, wc_NID_aes_256_xts},
|
||||
{WC_AES_256_XTS_TYPE, EVP_AES_256_XTS, WC_NID_aes_256_xts},
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AESGCM
|
||||
#ifdef WOLFSSL_AES_128
|
||||
{WC_AES_128_GCM_TYPE, EVP_AES_128_GCM, wc_NID_aes_128_gcm},
|
||||
{WC_AES_128_GCM_TYPE, EVP_AES_128_GCM, WC_NID_aes_128_gcm},
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_192
|
||||
{WC_AES_192_GCM_TYPE, EVP_AES_192_GCM, wc_NID_aes_192_gcm},
|
||||
{WC_AES_192_GCM_TYPE, EVP_AES_192_GCM, WC_NID_aes_192_gcm},
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_256
|
||||
{WC_AES_256_GCM_TYPE, EVP_AES_256_GCM, wc_NID_aes_256_gcm},
|
||||
{WC_AES_256_GCM_TYPE, EVP_AES_256_GCM, WC_NID_aes_256_gcm},
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AESCCM
|
||||
#ifdef WOLFSSL_AES_128
|
||||
{WC_AES_128_CCM_TYPE, EVP_AES_128_CCM, wc_NID_aes_128_ccm},
|
||||
{WC_AES_128_CCM_TYPE, EVP_AES_128_CCM, WC_NID_aes_128_ccm},
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_192
|
||||
{WC_AES_192_CCM_TYPE, EVP_AES_192_CCM, wc_NID_aes_192_ccm},
|
||||
{WC_AES_192_CCM_TYPE, EVP_AES_192_CCM, WC_NID_aes_192_ccm},
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_256
|
||||
{WC_AES_256_CCM_TYPE, EVP_AES_256_CCM, wc_NID_aes_256_ccm},
|
||||
{WC_AES_256_CCM_TYPE, EVP_AES_256_CCM, WC_NID_aes_256_ccm},
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_AES_COUNTER
|
||||
#ifdef WOLFSSL_AES_128
|
||||
{WC_AES_128_CTR_TYPE, EVP_AES_128_CTR, wc_NID_aes_128_ctr},
|
||||
{WC_AES_128_CTR_TYPE, EVP_AES_128_CTR, WC_NID_aes_128_ctr},
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_192
|
||||
{WC_AES_192_CTR_TYPE, EVP_AES_192_CTR, wc_NID_aes_192_ctr},
|
||||
{WC_AES_192_CTR_TYPE, EVP_AES_192_CTR, WC_NID_aes_192_ctr},
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_256
|
||||
{WC_AES_256_CTR_TYPE, EVP_AES_256_CTR, wc_NID_aes_256_ctr},
|
||||
{WC_AES_256_CTR_TYPE, EVP_AES_256_CTR, WC_NID_aes_256_ctr},
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AES_ECB
|
||||
#ifdef WOLFSSL_AES_128
|
||||
{WC_AES_128_ECB_TYPE, EVP_AES_128_ECB, wc_NID_aes_128_ecb},
|
||||
{WC_AES_128_ECB_TYPE, EVP_AES_128_ECB, WC_NID_aes_128_ecb},
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_192
|
||||
{WC_AES_192_ECB_TYPE, EVP_AES_192_ECB, wc_NID_aes_192_ecb},
|
||||
{WC_AES_192_ECB_TYPE, EVP_AES_192_ECB, WC_NID_aes_192_ecb},
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_256
|
||||
{WC_AES_256_ECB_TYPE, EVP_AES_256_ECB, wc_NID_aes_256_ecb},
|
||||
{WC_AES_256_ECB_TYPE, EVP_AES_256_ECB, WC_NID_aes_256_ecb},
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ARIA
|
||||
{WC_ARIA_128_GCM_TYPE, EVP_ARIA_128_GCM, wc_NID_aria_128_gcm},
|
||||
{WC_ARIA_192_GCM_TYPE, EVP_ARIA_192_GCM, wc_NID_aria_192_gcm},
|
||||
{WC_ARIA_256_GCM_TYPE, EVP_ARIA_256_GCM, wc_NID_aria_256_gcm},
|
||||
{WC_ARIA_128_GCM_TYPE, EVP_ARIA_128_GCM, WC_NID_aria_128_gcm},
|
||||
{WC_ARIA_192_GCM_TYPE, EVP_ARIA_192_GCM, WC_NID_aria_192_gcm},
|
||||
{WC_ARIA_256_GCM_TYPE, EVP_ARIA_256_GCM, WC_NID_aria_256_gcm},
|
||||
#endif
|
||||
|
||||
#ifndef NO_DES3
|
||||
{WC_DES_CBC_TYPE, EVP_DES_CBC, wc_NID_des_cbc},
|
||||
{WC_DES_ECB_TYPE, EVP_DES_ECB, wc_NID_des_ecb},
|
||||
{WC_DES_CBC_TYPE, EVP_DES_CBC, WC_NID_des_cbc},
|
||||
{WC_DES_ECB_TYPE, EVP_DES_ECB, WC_NID_des_ecb},
|
||||
|
||||
{WC_DES_EDE3_CBC_TYPE, EVP_DES_EDE3_CBC, wc_NID_des_ede3_cbc},
|
||||
{WC_DES_EDE3_ECB_TYPE, EVP_DES_EDE3_ECB, wc_NID_des_ede3_ecb},
|
||||
{WC_DES_EDE3_CBC_TYPE, EVP_DES_EDE3_CBC, WC_NID_des_ede3_cbc},
|
||||
{WC_DES_EDE3_ECB_TYPE, EVP_DES_EDE3_ECB, WC_NID_des_ede3_ecb},
|
||||
#endif
|
||||
|
||||
#ifndef NO_RC4
|
||||
{WC_ARC4_TYPE, EVP_ARC4, wc_NID_undef},
|
||||
{WC_ARC4_TYPE, EVP_ARC4, WC_NID_undef},
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
|
||||
{WC_CHACHA20_POLY1305_TYPE, EVP_CHACHA20_POLY1305, wc_NID_chacha20_poly1305},
|
||||
{WC_CHACHA20_POLY1305_TYPE, EVP_CHACHA20_POLY1305, WC_NID_chacha20_poly1305},
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CHACHA
|
||||
{WC_CHACHA20_TYPE, EVP_CHACHA20, wc_NID_chacha20},
|
||||
{WC_CHACHA20_TYPE, EVP_CHACHA20, WC_NID_chacha20},
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_SM4_ECB
|
||||
{WC_SM4_ECB_TYPE, EVP_SM4_ECB, wc_NID_sm4_ecb},
|
||||
{WC_SM4_ECB_TYPE, EVP_SM4_ECB, WC_NID_sm4_ecb},
|
||||
#endif
|
||||
#ifdef WOLFSSL_SM4_CBC
|
||||
{WC_SM4_CBC_TYPE, EVP_SM4_CBC, wc_NID_sm4_cbc},
|
||||
{WC_SM4_CBC_TYPE, EVP_SM4_CBC, WC_NID_sm4_cbc},
|
||||
#endif
|
||||
#ifdef WOLFSSL_SM4_CTR
|
||||
{WC_SM4_CTR_TYPE, EVP_SM4_CTR, wc_NID_sm4_ctr},
|
||||
{WC_SM4_CTR_TYPE, EVP_SM4_CTR, WC_NID_sm4_ctr},
|
||||
#endif
|
||||
#ifdef WOLFSSL_SM4_GCM
|
||||
{WC_SM4_GCM_TYPE, EVP_SM4_GCM, wc_NID_sm4_gcm},
|
||||
{WC_SM4_GCM_TYPE, EVP_SM4_GCM, WC_NID_sm4_gcm},
|
||||
#endif
|
||||
#ifdef WOLFSSL_SM4_CCM
|
||||
{WC_SM4_CCM_TYPE, EVP_SM4_CCM, wc_NID_sm4_ccm},
|
||||
{WC_SM4_CCM_TYPE, EVP_SM4_CCM, WC_NID_sm4_ccm},
|
||||
#endif
|
||||
|
||||
{ 0, NULL, 0}
|
||||
|
@ -5292,128 +5293,128 @@ const WOLFSSL_EVP_CIPHER *wolfSSL_EVP_get_cipherbynid(int id)
|
|||
#ifndef NO_AES
|
||||
#if defined(HAVE_AES_CBC) || defined(WOLFSSL_AES_DIRECT)
|
||||
#ifdef WOLFSSL_AES_128
|
||||
case wc_NID_aes_128_cbc:
|
||||
case WC_NID_aes_128_cbc:
|
||||
return wolfSSL_EVP_aes_128_cbc();
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_192
|
||||
case wc_NID_aes_192_cbc:
|
||||
case WC_NID_aes_192_cbc:
|
||||
return wolfSSL_EVP_aes_192_cbc();
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_256
|
||||
case wc_NID_aes_256_cbc:
|
||||
case WC_NID_aes_256_cbc:
|
||||
return wolfSSL_EVP_aes_256_cbc();
|
||||
#endif
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_COUNTER
|
||||
#ifdef WOLFSSL_AES_128
|
||||
case wc_NID_aes_128_ctr:
|
||||
case WC_NID_aes_128_ctr:
|
||||
return wolfSSL_EVP_aes_128_ctr();
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_192
|
||||
case wc_NID_aes_192_ctr:
|
||||
case WC_NID_aes_192_ctr:
|
||||
return wolfSSL_EVP_aes_192_ctr();
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_256
|
||||
case wc_NID_aes_256_ctr:
|
||||
case WC_NID_aes_256_ctr:
|
||||
return wolfSSL_EVP_aes_256_ctr();
|
||||
#endif
|
||||
#endif /* WOLFSSL_AES_COUNTER */
|
||||
#ifdef HAVE_AES_ECB
|
||||
#ifdef WOLFSSL_AES_128
|
||||
case wc_NID_aes_128_ecb:
|
||||
case WC_NID_aes_128_ecb:
|
||||
return wolfSSL_EVP_aes_128_ecb();
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_192
|
||||
case wc_NID_aes_192_ecb:
|
||||
case WC_NID_aes_192_ecb:
|
||||
return wolfSSL_EVP_aes_192_ecb();
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_256
|
||||
case wc_NID_aes_256_ecb:
|
||||
case WC_NID_aes_256_ecb:
|
||||
return wolfSSL_EVP_aes_256_ecb();
|
||||
#endif
|
||||
#endif /* HAVE_AES_ECB */
|
||||
#ifdef HAVE_AESGCM
|
||||
#ifdef WOLFSSL_AES_128
|
||||
case wc_NID_aes_128_gcm:
|
||||
case WC_NID_aes_128_gcm:
|
||||
return wolfSSL_EVP_aes_128_gcm();
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_192
|
||||
case wc_NID_aes_192_gcm:
|
||||
case WC_NID_aes_192_gcm:
|
||||
return wolfSSL_EVP_aes_192_gcm();
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_256
|
||||
case wc_NID_aes_256_gcm:
|
||||
case WC_NID_aes_256_gcm:
|
||||
return wolfSSL_EVP_aes_256_gcm();
|
||||
#endif
|
||||
#endif
|
||||
#ifdef HAVE_AESCCM
|
||||
#ifdef WOLFSSL_AES_128
|
||||
case wc_NID_aes_128_ccm:
|
||||
case WC_NID_aes_128_ccm:
|
||||
return wolfSSL_EVP_aes_128_ccm();
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_192
|
||||
case wc_NID_aes_192_ccm:
|
||||
case WC_NID_aes_192_ccm:
|
||||
return wolfSSL_EVP_aes_192_ccm();
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_256
|
||||
case wc_NID_aes_256_ccm:
|
||||
case WC_NID_aes_256_ccm:
|
||||
return wolfSSL_EVP_aes_256_ccm();
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ARIA
|
||||
case wc_NID_aria_128_gcm:
|
||||
case WC_NID_aria_128_gcm:
|
||||
return wolfSSL_EVP_aria_128_gcm();
|
||||
case wc_NID_aria_192_gcm:
|
||||
case WC_NID_aria_192_gcm:
|
||||
return wolfSSL_EVP_aria_192_gcm();
|
||||
case wc_NID_aria_256_gcm:
|
||||
case WC_NID_aria_256_gcm:
|
||||
return wolfSSL_EVP_aria_256_gcm();
|
||||
#endif
|
||||
|
||||
#ifndef NO_DES3
|
||||
case wc_NID_des_cbc:
|
||||
case WC_NID_des_cbc:
|
||||
return wolfSSL_EVP_des_cbc();
|
||||
#ifdef WOLFSSL_DES_ECB
|
||||
case wc_NID_des_ecb:
|
||||
case WC_NID_des_ecb:
|
||||
return wolfSSL_EVP_des_ecb();
|
||||
#endif
|
||||
case wc_NID_des_ede3_cbc:
|
||||
case WC_NID_des_ede3_cbc:
|
||||
return wolfSSL_EVP_des_ede3_cbc();
|
||||
#ifdef WOLFSSL_DES_ECB
|
||||
case wc_NID_des_ede3_ecb:
|
||||
case WC_NID_des_ede3_ecb:
|
||||
return wolfSSL_EVP_des_ede3_ecb();
|
||||
#endif
|
||||
#endif /*NO_DES3*/
|
||||
|
||||
#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
|
||||
case wc_NID_chacha20_poly1305:
|
||||
case WC_NID_chacha20_poly1305:
|
||||
return wolfSSL_EVP_chacha20_poly1305();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CHACHA
|
||||
case wc_NID_chacha20:
|
||||
case WC_NID_chacha20:
|
||||
return wolfSSL_EVP_chacha20();
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_SM4_ECB
|
||||
case wc_NID_sm4_ecb:
|
||||
case WC_NID_sm4_ecb:
|
||||
return wolfSSL_EVP_sm4_ecb();
|
||||
#endif
|
||||
#ifdef WOLFSSL_SM4_CBC
|
||||
case wc_NID_sm4_cbc:
|
||||
case WC_NID_sm4_cbc:
|
||||
return wolfSSL_EVP_sm4_cbc();
|
||||
#endif
|
||||
#ifdef WOLFSSL_SM4_CTR
|
||||
case wc_NID_sm4_ctr:
|
||||
case WC_NID_sm4_ctr:
|
||||
return wolfSSL_EVP_sm4_ctr();
|
||||
#endif
|
||||
#ifdef WOLFSSL_SM4_GCM
|
||||
case wc_NID_sm4_gcm:
|
||||
case WC_NID_sm4_gcm:
|
||||
return wolfSSL_EVP_sm4_gcm();
|
||||
#endif
|
||||
#ifdef WOLFSSL_SM4_CCM
|
||||
case wc_NID_sm4_ccm:
|
||||
case WC_NID_sm4_ccm:
|
||||
return wolfSSL_EVP_sm4_ccm();
|
||||
#endif
|
||||
|
||||
|
@ -8044,120 +8045,120 @@ void wolfSSL_EVP_init(void)
|
|||
WOLFSSL_ENTER("wolfSSL_EVP_CIPHER_CTX_nid");
|
||||
if (ctx == NULL) {
|
||||
WOLFSSL_ERROR_MSG("Bad parameters");
|
||||
return wc_NID_undef;
|
||||
return WC_NID_undef;
|
||||
}
|
||||
|
||||
switch (ctx->cipherType) {
|
||||
#ifndef NO_AES
|
||||
#if defined(HAVE_AES_CBC) || defined(WOLFSSL_AES_DIRECT)
|
||||
case WC_AES_128_CBC_TYPE :
|
||||
return wc_NID_aes_128_cbc;
|
||||
return WC_NID_aes_128_cbc;
|
||||
case WC_AES_192_CBC_TYPE :
|
||||
return wc_NID_aes_192_cbc;
|
||||
return WC_NID_aes_192_cbc;
|
||||
case WC_AES_256_CBC_TYPE :
|
||||
return wc_NID_aes_256_cbc;
|
||||
return WC_NID_aes_256_cbc;
|
||||
#endif
|
||||
#ifdef HAVE_AESGCM
|
||||
case WC_AES_128_GCM_TYPE :
|
||||
return wc_NID_aes_128_gcm;
|
||||
return WC_NID_aes_128_gcm;
|
||||
case WC_AES_192_GCM_TYPE :
|
||||
return wc_NID_aes_192_gcm;
|
||||
return WC_NID_aes_192_gcm;
|
||||
case WC_AES_256_GCM_TYPE :
|
||||
return wc_NID_aes_256_gcm;
|
||||
return WC_NID_aes_256_gcm;
|
||||
#endif
|
||||
#ifdef HAVE_AESCCM
|
||||
case WC_AES_128_CCM_TYPE :
|
||||
return wc_NID_aes_128_ccm;
|
||||
return WC_NID_aes_128_ccm;
|
||||
case WC_AES_192_CCM_TYPE :
|
||||
return wc_NID_aes_192_ccm;
|
||||
return WC_NID_aes_192_ccm;
|
||||
case WC_AES_256_CCM_TYPE :
|
||||
return wc_NID_aes_256_ccm;
|
||||
return WC_NID_aes_256_ccm;
|
||||
#endif
|
||||
#ifdef HAVE_AES_ECB
|
||||
case WC_AES_128_ECB_TYPE :
|
||||
return wc_NID_aes_128_ecb;
|
||||
return WC_NID_aes_128_ecb;
|
||||
case WC_AES_192_ECB_TYPE :
|
||||
return wc_NID_aes_192_ecb;
|
||||
return WC_NID_aes_192_ecb;
|
||||
case WC_AES_256_ECB_TYPE :
|
||||
return wc_NID_aes_256_ecb;
|
||||
return WC_NID_aes_256_ecb;
|
||||
#endif
|
||||
#ifdef WOLFSSL_AES_COUNTER
|
||||
case WC_AES_128_CTR_TYPE :
|
||||
return wc_NID_aes_128_ctr;
|
||||
return WC_NID_aes_128_ctr;
|
||||
case WC_AES_192_CTR_TYPE :
|
||||
return wc_NID_aes_192_ctr;
|
||||
return WC_NID_aes_192_ctr;
|
||||
case WC_AES_256_CTR_TYPE :
|
||||
return wc_NID_aes_256_ctr;
|
||||
return WC_NID_aes_256_ctr;
|
||||
#endif
|
||||
|
||||
#endif /* NO_AES */
|
||||
|
||||
#ifdef HAVE_ARIA
|
||||
case WC_ARIA_128_GCM_TYPE :
|
||||
return wc_NID_aria_128_gcm;
|
||||
return WC_NID_aria_128_gcm;
|
||||
case WC_ARIA_192_GCM_TYPE :
|
||||
return wc_NID_aria_192_gcm;
|
||||
return WC_NID_aria_192_gcm;
|
||||
case WC_ARIA_256_GCM_TYPE :
|
||||
return wc_NID_aria_256_gcm;
|
||||
return WC_NID_aria_256_gcm;
|
||||
#endif
|
||||
|
||||
#ifndef NO_DES3
|
||||
case WC_DES_CBC_TYPE :
|
||||
return wc_NID_des_cbc;
|
||||
return WC_NID_des_cbc;
|
||||
|
||||
case WC_DES_EDE3_CBC_TYPE :
|
||||
return wc_NID_des_ede3_cbc;
|
||||
return WC_NID_des_ede3_cbc;
|
||||
#endif
|
||||
#ifdef WOLFSSL_DES_ECB
|
||||
case WC_DES_ECB_TYPE :
|
||||
return wc_NID_des_ecb;
|
||||
return WC_NID_des_ecb;
|
||||
case WC_DES_EDE3_ECB_TYPE :
|
||||
return wc_NID_des_ede3_ecb;
|
||||
return WC_NID_des_ede3_ecb;
|
||||
#endif
|
||||
|
||||
case WC_ARC4_TYPE :
|
||||
return wc_NID_rc4;
|
||||
return WC_NID_rc4;
|
||||
|
||||
#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
|
||||
case WC_CHACHA20_POLY1305_TYPE:
|
||||
return wc_NID_chacha20_poly1305;
|
||||
return WC_NID_chacha20_poly1305;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CHACHA
|
||||
case WC_CHACHA20_TYPE:
|
||||
return wc_NID_chacha20;
|
||||
return WC_NID_chacha20;
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_SM4_ECB
|
||||
case WC_SM4_ECB_TYPE:
|
||||
return wc_NID_sm4_ecb;
|
||||
return WC_NID_sm4_ecb;
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_SM4_CBC
|
||||
case WC_SM4_CBC_TYPE:
|
||||
return wc_NID_sm4_cbc;
|
||||
return WC_NID_sm4_cbc;
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_SM4_CTR
|
||||
case WC_SM4_CTR_TYPE:
|
||||
return wc_NID_sm4_ctr;
|
||||
return WC_NID_sm4_ctr;
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_SM4_GCM
|
||||
case WC_SM4_GCM_TYPE:
|
||||
return wc_NID_sm4_gcm;
|
||||
return WC_NID_sm4_gcm;
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_SM4_CCM
|
||||
case WC_SM4_CCM_TYPE:
|
||||
return wc_NID_sm4_ccm;
|
||||
return WC_NID_sm4_ccm;
|
||||
#endif
|
||||
|
||||
case WC_NULL_CIPHER_TYPE :
|
||||
WOLFSSL_ERROR_MSG("Null cipher has no NID");
|
||||
FALL_THROUGH;
|
||||
default:
|
||||
return wc_NID_undef;
|
||||
return WC_NID_undef;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9359,22 +9360,22 @@ int wolfSSL_EVP_MD_pkey_type(const WOLFSSL_EVP_MD* type)
|
|||
|
||||
if (type != NULL) {
|
||||
if (XSTRCMP(type, "MD5") == 0) {
|
||||
ret = wc_NID_md5WithRSAEncryption;
|
||||
ret = WC_NID_md5WithRSAEncryption;
|
||||
}
|
||||
else if (XSTRCMP(type, "SHA1") == 0) {
|
||||
ret = wc_NID_sha1WithRSAEncryption;
|
||||
ret = WC_NID_sha1WithRSAEncryption;
|
||||
}
|
||||
else if (XSTRCMP(type, "SHA224") == 0) {
|
||||
ret = wc_NID_sha224WithRSAEncryption;
|
||||
ret = WC_NID_sha224WithRSAEncryption;
|
||||
}
|
||||
else if (XSTRCMP(type, "SHA256") == 0) {
|
||||
ret = wc_NID_sha256WithRSAEncryption;
|
||||
ret = WC_NID_sha256WithRSAEncryption;
|
||||
}
|
||||
else if (XSTRCMP(type, "SHA384") == 0) {
|
||||
ret = wc_NID_sha384WithRSAEncryption;
|
||||
ret = WC_NID_sha384WithRSAEncryption;
|
||||
}
|
||||
else if (XSTRCMP(type, "SHA512") == 0) {
|
||||
ret = wc_NID_sha512WithRSAEncryption;
|
||||
ret = WC_NID_sha512WithRSAEncryption;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -9691,7 +9692,7 @@ int wolfSSL_EVP_X_STATE_LEN(const WOLFSSL_EVP_CIPHER_CTX* ctx)
|
|||
*
|
||||
* type type of EVP_PKEY
|
||||
*
|
||||
* returns type or if type is not found then wc_NID_undef
|
||||
* returns type or if type is not found then WC_NID_undef
|
||||
*/
|
||||
int wolfSSL_EVP_PKEY_type(int type)
|
||||
{
|
||||
|
@ -9707,7 +9708,7 @@ int wolfSSL_EVP_PKEY_type(int type)
|
|||
case WC_EVP_PKEY_DH:
|
||||
return WC_EVP_PKEY_DH;
|
||||
default:
|
||||
return wc_NID_undef;
|
||||
return WC_NID_undef;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9723,7 +9724,7 @@ int wolfSSL_EVP_PKEY_id(const WOLFSSL_EVP_PKEY *pkey)
|
|||
int wolfSSL_EVP_PKEY_base_id(const WOLFSSL_EVP_PKEY *pkey)
|
||||
{
|
||||
if (pkey == NULL)
|
||||
return wc_NID_undef;
|
||||
return WC_NID_undef;
|
||||
return wolfSSL_EVP_PKEY_type(pkey->type);
|
||||
}
|
||||
|
||||
|
@ -9747,7 +9748,7 @@ int wolfSSL_EVP_PKEY_get_default_digest_nid(WOLFSSL_EVP_PKEY *pkey, int *pnid)
|
|||
#ifdef HAVE_ECC
|
||||
case WC_EVP_PKEY_EC:
|
||||
#endif
|
||||
*pnid = wc_NID_sha256;
|
||||
*pnid = WC_NID_sha256;
|
||||
return WOLFSSL_SUCCESS;
|
||||
default:
|
||||
return WOLFSSL_FAILURE;
|
||||
|
@ -9982,7 +9983,7 @@ const WOLFSSL_EVP_MD *wolfSSL_EVP_get_digestbyname(const char *name)
|
|||
*
|
||||
* type - pointer to WOLFSSL_EVP_MD for which to return NID value
|
||||
*
|
||||
* Returns NID on success, or wc_NID_undef if none exists.
|
||||
* Returns NID on success, or WC_NID_undef if none exists.
|
||||
*/
|
||||
int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD* type)
|
||||
{
|
||||
|
@ -9991,7 +9992,7 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD* type)
|
|||
|
||||
if (type == NULL) {
|
||||
WOLFSSL_MSG("MD type arg is NULL");
|
||||
return wc_NID_undef;
|
||||
return WC_NID_undef;
|
||||
}
|
||||
|
||||
for( ent = md_tbl; ent->name != NULL; ent++){
|
||||
|
@ -9999,7 +10000,7 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD* type)
|
|||
return ent->nid;
|
||||
}
|
||||
}
|
||||
return wc_NID_undef;
|
||||
return WC_NID_undef;
|
||||
}
|
||||
|
||||
#ifndef NO_MD4
|
||||
|
@ -10222,7 +10223,7 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD* type)
|
|||
const struct s_ent *ent;
|
||||
|
||||
if (ctx->isHMAC) {
|
||||
return wc_NID_hmac;
|
||||
return WC_NID_hmac;
|
||||
}
|
||||
|
||||
for(ent = md_tbl; ent->name != NULL; ent++) {
|
||||
|
@ -10876,31 +10877,31 @@ const WOLFSSL_EVP_MD* wolfSSL_EVP_get_digestbynid(int id)
|
|||
|
||||
switch(id) {
|
||||
#ifndef NO_MD5
|
||||
case wc_NID_md5:
|
||||
case WC_NID_md5:
|
||||
return wolfSSL_EVP_md5();
|
||||
#endif
|
||||
#ifndef NO_SHA
|
||||
case wc_NID_sha1:
|
||||
case WC_NID_sha1:
|
||||
return wolfSSL_EVP_sha1();
|
||||
#endif
|
||||
#ifdef WOLFSSL_SHA224
|
||||
case wc_NID_sha224:
|
||||
case WC_NID_sha224:
|
||||
return wolfSSL_EVP_sha224();
|
||||
#endif
|
||||
#ifndef NO_SHA256
|
||||
case wc_NID_sha256:
|
||||
case WC_NID_sha256:
|
||||
return wolfSSL_EVP_sha256();
|
||||
#endif
|
||||
#ifdef WOLFSSL_SHA384
|
||||
case wc_NID_sha384:
|
||||
case WC_NID_sha384:
|
||||
return wolfSSL_EVP_sha384();
|
||||
#endif
|
||||
#ifdef WOLFSSL_SHA512
|
||||
case wc_NID_sha512:
|
||||
case WC_NID_sha512:
|
||||
return wolfSSL_EVP_sha512();
|
||||
#endif
|
||||
#ifdef WOLFSSL_SM3
|
||||
case wc_NID_sm3:
|
||||
case WC_NID_sm3:
|
||||
return wolfSSL_EVP_sm3();
|
||||
#endif
|
||||
default:
|
||||
|
|
|
@ -39,10 +39,10 @@
|
|||
#define d2i_ASN1_OBJECT wolfSSL_d2i_ASN1_OBJECT
|
||||
#define c2i_ASN1_OBJECT wolfSSL_c2i_ASN1_OBJECT
|
||||
|
||||
#define V_ASN1_INTEGER WOLFSSL_ASN1_TYPE_INTEGER
|
||||
#define V_ASN1_NEG WOLFSSL_ASN1_TYPE_NEG
|
||||
#define V_ASN1_NEG_INTEGER WOLFSSL_ASN1_TYPE_NEG_INTEGER
|
||||
#define V_ASN1_NEG_ENUMERATED WOLFSSL_ASN1_TYPE_NEG_ENUMERATED
|
||||
#define V_ASN1_INTEGER WOLFSSL_V_ASN1_INTEGER
|
||||
#define V_ASN1_NEG WOLFSSL_V_ASN1_NEG
|
||||
#define V_ASN1_NEG_INTEGER WOLFSSL_V_ASN1_NEG_INTEGER
|
||||
#define V_ASN1_NEG_ENUMERATED WOLFSSL_V_ASN1_NEG_ENUMERATED
|
||||
|
||||
/* Type for ASN1_print_ex */
|
||||
#define ASN1_STRFLGS_ESC_2253 WOLFSSL_ASN1_STRFLGS_ESC_2253
|
||||
|
@ -68,23 +68,23 @@
|
|||
#define ASN1_TIME_compare wolfSSL_ASN1_TIME_compare
|
||||
#define ASN1_TIME_set wolfSSL_ASN1_TIME_set
|
||||
|
||||
#define V_ASN1_EOC WOLFSSL_ASN1_TYPE_EOC
|
||||
#define V_ASN1_BOOLEAN WOLFSSL_ASN1_TYPE_BOOLEAN
|
||||
#define V_ASN1_OCTET_STRING WOLFSSL_ASN1_TYPE_OCTET_STRING
|
||||
#define V_ASN1_NULL WOLFSSL_ASN1_TYPE_NULL
|
||||
#define V_ASN1_OBJECT WOLFSSL_ASN1_TYPE_OBJECT
|
||||
#define V_ASN1_UTF8STRING WOLFSSL_ASN1_TYPE_UTF8STRING
|
||||
#define V_ASN1_SEQUENCE WOLFSSL_ASN1_TYPE_SEQUENCE
|
||||
#define V_ASN1_SET WOLFSSL_ASN1_TYPE_SET
|
||||
#define V_ASN1_PRINTABLESTRING WOLFSSL_ASN1_TYPE_PRINTABLESTRING
|
||||
#define V_ASN1_T61STRING WOLFSSL_ASN1_TYPE_T61STRING
|
||||
#define V_ASN1_IA5STRING WOLFSSL_ASN1_TYPE_IA5STRING
|
||||
#define V_ASN1_UTCTIME WOLFSSL_ASN1_TYPE_UTCTIME
|
||||
#define V_ASN1_GENERALIZEDTIME WOLFSSL_ASN1_TYPE_GENERALIZEDTIME
|
||||
#define V_ASN1_UNIVERSALSTRING WOLFSSL_ASN1_TYPE_UNIVERSALSTRING
|
||||
#define V_ASN1_BMPSTRING WOLFSSL_ASN1_TYPE_BMPSTRING
|
||||
#define V_ASN1_EOC WOLFSSL_V_ASN1_EOC
|
||||
#define V_ASN1_BOOLEAN WOLFSSL_V_ASN1_BOOLEAN
|
||||
#define V_ASN1_OCTET_STRING WOLFSSL_V_ASN1_OCTET_STRING
|
||||
#define V_ASN1_NULL WOLFSSL_V_ASN1_NULL
|
||||
#define V_ASN1_OBJECT WOLFSSL_V_ASN1_OBJECT
|
||||
#define V_ASN1_UTF8STRING WOLFSSL_V_ASN1_UTF8STRING
|
||||
#define V_ASN1_SEQUENCE WOLFSSL_V_ASN1_SEQUENCE
|
||||
#define V_ASN1_SET WOLFSSL_V_ASN1_SET
|
||||
#define V_ASN1_PRINTABLESTRING WOLFSSL_V_ASN1_PRINTABLESTRING
|
||||
#define V_ASN1_T61STRING WOLFSSL_V_ASN1_T61STRING
|
||||
#define V_ASN1_IA5STRING WOLFSSL_V_ASN1_IA5STRING
|
||||
#define V_ASN1_UTCTIME WOLFSSL_V_ASN1_UTCTIME
|
||||
#define V_ASN1_GENERALIZEDTIME WOLFSSL_V_ASN1_GENERALIZEDTIME
|
||||
#define V_ASN1_UNIVERSALSTRING WOLFSSL_V_ASN1_UNIVERSALSTRING
|
||||
#define V_ASN1_BMPSTRING WOLFSSL_V_ASN1_BMPSTRING
|
||||
|
||||
#define V_ASN1_CONSTRUCTED WOLFSSL_ASN1_TYPE_CONSTRUCTED
|
||||
#define V_ASN1_CONSTRUCTED WOLFSSL_V_ASN1_CONSTRUCTED
|
||||
|
||||
#define ASN1_STRING_FLAG_BITS_LEFT WOLFSSL_ASN1_STRING_FLAG_BITS_LEFT
|
||||
#define ASN1_STRING_FLAG_NDEF WOLFSSL_ASN1_STRING_FLAG_NDEF
|
||||
|
|
|
@ -45,46 +45,46 @@ enum {
|
|||
#ifdef HAVE_ECC
|
||||
/* Use OpenSSL NIDs. NIDs can be mapped to ecc_curve_id enum values by
|
||||
calling NIDToEccEnum() in ssl.c */
|
||||
wc_NID_X9_62_prime192v1 = 409,
|
||||
wc_NID_X9_62_prime192v2 = 410,
|
||||
wc_NID_X9_62_prime192v3 = 411,
|
||||
wc_NID_X9_62_prime239v1 = 412,
|
||||
wc_NID_X9_62_prime239v2 = 413,
|
||||
wc_NID_X9_62_prime239v3 = 418, /* Previous value conflicted with AES128CBCb */
|
||||
wc_NID_X9_62_prime256v1 = 415,
|
||||
wc_NID_secp112r1 = 704,
|
||||
wc_NID_secp112r2 = 705,
|
||||
wc_NID_secp128r1 = 706,
|
||||
wc_NID_secp128r2 = 707,
|
||||
wc_NID_secp160r1 = 709,
|
||||
wc_NID_secp160r2 = 710,
|
||||
wc_NID_secp224r1 = 713,
|
||||
wc_NID_secp384r1 = 715,
|
||||
wc_NID_secp521r1 = 716,
|
||||
wc_NID_secp160k1 = 708,
|
||||
wc_NID_secp192k1 = 711,
|
||||
wc_NID_secp224k1 = 712,
|
||||
wc_NID_secp256k1 = 714,
|
||||
wc_NID_brainpoolP160r1 = 921,
|
||||
wc_NID_brainpoolP192r1 = 923,
|
||||
wc_NID_brainpoolP224r1 = 925,
|
||||
wc_NID_brainpoolP256r1 = 927,
|
||||
wc_NID_brainpoolP320r1 = 929,
|
||||
wc_NID_brainpoolP384r1 = 931,
|
||||
wc_NID_brainpoolP512r1 = 933,
|
||||
WC_NID_X9_62_prime192v1 = 409,
|
||||
WC_NID_X9_62_prime192v2 = 410,
|
||||
WC_NID_X9_62_prime192v3 = 411,
|
||||
WC_NID_X9_62_prime239v1 = 412,
|
||||
WC_NID_X9_62_prime239v2 = 413,
|
||||
WC_NID_X9_62_prime239v3 = 418, /* Previous value conflicted with AES128CBCb */
|
||||
WC_NID_X9_62_prime256v1 = 415,
|
||||
WC_NID_secp112r1 = 704,
|
||||
WC_NID_secp112r2 = 705,
|
||||
WC_NID_secp128r1 = 706,
|
||||
WC_NID_secp128r2 = 707,
|
||||
WC_NID_secp160r1 = 709,
|
||||
WC_NID_secp160r2 = 710,
|
||||
WC_NID_secp224r1 = 713,
|
||||
WC_NID_secp384r1 = 715,
|
||||
WC_NID_secp521r1 = 716,
|
||||
WC_NID_secp160k1 = 708,
|
||||
WC_NID_secp192k1 = 711,
|
||||
WC_NID_secp224k1 = 712,
|
||||
WC_NID_secp256k1 = 714,
|
||||
WC_NID_brainpoolP160r1 = 921,
|
||||
WC_NID_brainpoolP192r1 = 923,
|
||||
WC_NID_brainpoolP224r1 = 925,
|
||||
WC_NID_brainpoolP256r1 = 927,
|
||||
WC_NID_brainpoolP320r1 = 929,
|
||||
WC_NID_brainpoolP384r1 = 931,
|
||||
WC_NID_brainpoolP512r1 = 933,
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ED448
|
||||
wc_NID_ED448 = ED448k,
|
||||
WC_NID_ED448 = ED448k,
|
||||
#endif
|
||||
#ifdef HAVE_CURVE448
|
||||
wc_NID_X448 = X448k,
|
||||
WC_NID_X448 = X448k,
|
||||
#endif
|
||||
#ifdef HAVE_ED25519
|
||||
wc_NID_ED25519 = ED25519k,
|
||||
WC_NID_ED25519 = ED25519k,
|
||||
#endif
|
||||
#ifdef HAVE_CURVE25519
|
||||
wc_NID_X25519 = X25519k,
|
||||
WC_NID_X25519 = X25519k,
|
||||
#endif
|
||||
|
||||
WOLFSSL_EC_EXPLICIT_CURVE = 0x000,
|
||||
|
@ -97,46 +97,46 @@ enum {
|
|||
#define POINT_CONVERSION_UNCOMPRESSED WC_POINT_CONVERSION_UNCOMPRESSED
|
||||
|
||||
#ifdef HAVE_ECC
|
||||
#define NID_X9_62_prime192v1 wc_NID_X9_62_prime192v1
|
||||
#define NID_X9_62_prime192v2 wc_NID_X9_62_prime192v2
|
||||
#define NID_X9_62_prime192v3 wc_NID_X9_62_prime192v3
|
||||
#define NID_X9_62_prime239v1 wc_NID_X9_62_prime239v1
|
||||
#define NID_X9_62_prime239v2 wc_NID_X9_62_prime239v2
|
||||
#define NID_X9_62_prime239v3 wc_NID_X9_62_prime239v3
|
||||
#define NID_X9_62_prime256v1 wc_NID_X9_62_prime256v1
|
||||
#define NID_secp112r1 wc_NID_secp112r1
|
||||
#define NID_secp112r2 wc_NID_secp112r2
|
||||
#define NID_secp128r1 wc_NID_secp128r1
|
||||
#define NID_secp128r2 wc_NID_secp128r2
|
||||
#define NID_secp160r1 wc_NID_secp160r1
|
||||
#define NID_secp160r2 wc_NID_secp160r2
|
||||
#define NID_secp224r1 wc_NID_secp224r1
|
||||
#define NID_secp384r1 wc_NID_secp384r1
|
||||
#define NID_secp521r1 wc_NID_secp521r1
|
||||
#define NID_secp160k1 wc_NID_secp160k1
|
||||
#define NID_secp192k1 wc_NID_secp192k1
|
||||
#define NID_secp224k1 wc_NID_secp224k1
|
||||
#define NID_secp256k1 wc_NID_secp256k1
|
||||
#define NID_brainpoolP160r1 wc_NID_brainpoolP160r1
|
||||
#define NID_brainpoolP192r1 wc_NID_brainpoolP192r1
|
||||
#define NID_brainpoolP224r1 wc_NID_brainpoolP224r1
|
||||
#define NID_brainpoolP256r1 wc_NID_brainpoolP256r1
|
||||
#define NID_brainpoolP320r1 wc_NID_brainpoolP320r1
|
||||
#define NID_brainpoolP384r1 wc_NID_brainpoolP384r1
|
||||
#define NID_brainpoolP512r1 wc_NID_brainpoolP512r1
|
||||
#define NID_X9_62_prime192v1 WC_NID_X9_62_prime192v1
|
||||
#define NID_X9_62_prime192v2 WC_NID_X9_62_prime192v2
|
||||
#define NID_X9_62_prime192v3 WC_NID_X9_62_prime192v3
|
||||
#define NID_X9_62_prime239v1 WC_NID_X9_62_prime239v1
|
||||
#define NID_X9_62_prime239v2 WC_NID_X9_62_prime239v2
|
||||
#define NID_X9_62_prime239v3 WC_NID_X9_62_prime239v3
|
||||
#define NID_X9_62_prime256v1 WC_NID_X9_62_prime256v1
|
||||
#define NID_secp112r1 WC_NID_secp112r1
|
||||
#define NID_secp112r2 WC_NID_secp112r2
|
||||
#define NID_secp128r1 WC_NID_secp128r1
|
||||
#define NID_secp128r2 WC_NID_secp128r2
|
||||
#define NID_secp160r1 WC_NID_secp160r1
|
||||
#define NID_secp160r2 WC_NID_secp160r2
|
||||
#define NID_secp224r1 WC_NID_secp224r1
|
||||
#define NID_secp384r1 WC_NID_secp384r1
|
||||
#define NID_secp521r1 WC_NID_secp521r1
|
||||
#define NID_secp160k1 WC_NID_secp160k1
|
||||
#define NID_secp192k1 WC_NID_secp192k1
|
||||
#define NID_secp224k1 WC_NID_secp224k1
|
||||
#define NID_secp256k1 WC_NID_secp256k1
|
||||
#define NID_brainpoolP160r1 WC_NID_brainpoolP160r1
|
||||
#define NID_brainpoolP192r1 WC_NID_brainpoolP192r1
|
||||
#define NID_brainpoolP224r1 WC_NID_brainpoolP224r1
|
||||
#define NID_brainpoolP256r1 WC_NID_brainpoolP256r1
|
||||
#define NID_brainpoolP320r1 WC_NID_brainpoolP320r1
|
||||
#define NID_brainpoolP384r1 WC_NID_brainpoolP384r1
|
||||
#define NID_brainpoolP512r1 WC_NID_brainpoolP512r1
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ED448
|
||||
#define NID_ED448 wc_NID_ED448
|
||||
#define NID_ED448 WC_NID_ED448
|
||||
#endif
|
||||
#ifdef HAVE_CURVE448
|
||||
#define NID_X448 wc_NID_X448
|
||||
#define NID_X448 WC_NID_X448
|
||||
#endif
|
||||
#ifdef HAVE_ED25519
|
||||
#define NID_ED25519 wc_NID_ED25519
|
||||
#define NID_ED25519 WC_NID_ED25519
|
||||
#endif
|
||||
#ifdef HAVE_CURVE25519
|
||||
#define NID_X25519 wc_NID_X25519
|
||||
#define NID_X25519 WC_NID_X25519
|
||||
#endif
|
||||
|
||||
#define OPENSSL_EC_EXPLICIT_CURVE WOLFSSL_EC_EXPLICIT_CURVE
|
||||
|
|
|
@ -270,142 +270,147 @@ typedef union {
|
|||
|
||||
#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
|
||||
|
||||
#define wc_NID_aes_128_cbc 419
|
||||
#define wc_NID_aes_192_cbc 423
|
||||
#define wc_NID_aes_256_cbc 427
|
||||
#define wc_NID_aes_128_ccm 896
|
||||
#define wc_NID_aes_192_ccm 899
|
||||
#define wc_NID_aes_256_ccm 902
|
||||
#define wc_NID_aes_128_gcm 895
|
||||
#define wc_NID_aes_192_gcm 898
|
||||
#define wc_NID_aes_256_gcm 901
|
||||
#define wc_NID_aes_128_ctr 904
|
||||
#define wc_NID_aes_192_ctr 905
|
||||
#define wc_NID_aes_256_ctr 906
|
||||
#define wc_NID_aes_128_ecb 418
|
||||
#define wc_NID_aes_192_ecb 422
|
||||
#define wc_NID_aes_256_ecb 426
|
||||
#define wc_NID_des_cbc 31
|
||||
#define wc_NID_des_ecb 29
|
||||
#define wc_NID_des_ede3_cbc 44
|
||||
#define wc_NID_des_ede3_ecb 33
|
||||
#define wc_NID_aes_128_cfb1 650
|
||||
#define wc_NID_aes_192_cfb1 651
|
||||
#define wc_NID_aes_256_cfb1 652
|
||||
#define wc_NID_aes_128_cfb8 653
|
||||
#define wc_NID_aes_192_cfb8 654
|
||||
#define wc_NID_aes_256_cfb8 655
|
||||
#define wc_NID_aes_128_cfb128 421
|
||||
#define wc_NID_aes_192_cfb128 425
|
||||
#define wc_NID_aes_256_cfb128 429
|
||||
#define wc_NID_aes_128_ofb 420
|
||||
#define wc_NID_aes_192_ofb 424
|
||||
#define wc_NID_aes_256_ofb 428
|
||||
#define wc_NID_aes_128_xts 913
|
||||
#define wc_NID_aes_256_xts 914
|
||||
#define wc_NID_camellia_128_cbc 751
|
||||
#define wc_NID_camellia_256_cbc 753
|
||||
#define wc_NID_chacha20_poly1305 1018
|
||||
#define wc_NID_chacha20 1019
|
||||
#define wc_NID_sm4_ecb 1133
|
||||
#define wc_NID_sm4_cbc 1134
|
||||
#define wc_NID_sm4_ctr 1139
|
||||
#define wc_NID_sm4_gcm 1248
|
||||
#define wc_NID_sm4_ccm 1249
|
||||
#define wc_NID_md5WithRSA 104
|
||||
#define wc_NID_md2WithRSAEncryption 9
|
||||
#define wc_NID_md5WithRSAEncryption 99
|
||||
#define wc_NID_dsaWithSHA1 113
|
||||
#define wc_NID_dsaWithSHA1_2 70
|
||||
#define wc_NID_sha1WithRSA 115
|
||||
#define wc_NID_sha1WithRSAEncryption 65
|
||||
#define wc_NID_sha224WithRSAEncryption 671
|
||||
#define wc_NID_sha256WithRSAEncryption 668
|
||||
#define wc_NID_sha384WithRSAEncryption 669
|
||||
#define wc_NID_sha512WithRSAEncryption 670
|
||||
#define wc_NID_RSA_SHA3_224 1116
|
||||
#define wc_NID_RSA_SHA3_256 1117
|
||||
#define wc_NID_RSA_SHA3_384 1118
|
||||
#define wc_NID_RSA_SHA3_512 1119
|
||||
#define wc_NID_rsassaPss 912
|
||||
#define wc_NID_ecdsa_with_SHA1 416
|
||||
#define wc_NID_ecdsa_with_SHA224 793
|
||||
#define wc_NID_ecdsa_with_SHA256 794
|
||||
#define wc_NID_ecdsa_with_SHA384 795
|
||||
#define wc_NID_ecdsa_with_SHA512 796
|
||||
#define wc_NID_ecdsa_with_SHA3_224 1112
|
||||
#define wc_NID_ecdsa_with_SHA3_256 1113
|
||||
#define wc_NID_ecdsa_with_SHA3_384 1114
|
||||
#define wc_NID_ecdsa_with_SHA3_512 1115
|
||||
#define wc_NID_dsa_with_SHA224 802
|
||||
#define wc_NID_dsa_with_SHA256 803
|
||||
#define wc_NID_sha3_224 1096
|
||||
#define wc_NID_sha3_256 1097
|
||||
#define wc_NID_sha3_384 1098
|
||||
#define wc_NID_sha3_512 1099
|
||||
#define wc_NID_blake2b512 1056
|
||||
#define wc_NID_blake2s256 1057
|
||||
#define wc_NID_shake128 1100
|
||||
#define wc_NID_shake256 1101
|
||||
#define wc_NID_sha1 64
|
||||
#define wc_NID_sha224 675
|
||||
#define wc_NID_sm3 1143
|
||||
#define wc_NID_md2 77
|
||||
#define wc_NID_md4 257
|
||||
#define wc_NID_md5 40
|
||||
#define wc_NID_hmac 855
|
||||
#define wc_NID_hmacWithSHA1 163
|
||||
#define wc_NID_hmacWithSHA224 798
|
||||
#define wc_NID_hmacWithSHA256 799
|
||||
#define wc_NID_hmacWithSHA384 800
|
||||
#define wc_NID_hmacWithSHA512 801
|
||||
#define wc_NID_hkdf 1036
|
||||
#define wc_NID_cmac 894
|
||||
#define wc_NID_dhKeyAgreement 28
|
||||
#define wc_NID_ffdhe2048 1126
|
||||
#define wc_NID_ffdhe3072 1127
|
||||
#define wc_NID_ffdhe4096 1128
|
||||
#define wc_NID_rc4 5
|
||||
#define wc_NID_bf_cbc 91
|
||||
#define wc_NID_bf_ecb 92
|
||||
#define wc_NID_bf_cfb64 93
|
||||
#define wc_NID_bf_ofb64 94
|
||||
#define wc_NID_cast5_cbc 108
|
||||
#define wc_NID_cast5_ecb 109
|
||||
#define wc_NID_cast5_cfb64 110
|
||||
#define wc_NID_cast5_ofb64 111
|
||||
/* key exchange */
|
||||
#define wc_NID_kx_rsa 1037
|
||||
#define wc_NID_kx_ecdhe 1038
|
||||
#define wc_NID_kx_dhe 1039
|
||||
#define wc_NID_kx_ecdhe_psk 1040
|
||||
#define wc_NID_kx_dhe_psk 1041
|
||||
#define wc_NID_kx_rsa_psk 1042
|
||||
#define wc_NID_kx_psk 1043
|
||||
#define wc_NID_kx_srp 1044
|
||||
#define wc_NID_kx_gost 1045
|
||||
#define wc_NID_kx_any 1063
|
||||
/* server authentication */
|
||||
#define wc_NID_auth_rsa 1046
|
||||
#define wc_NID_auth_ecdsa 1047
|
||||
#define wc_NID_auth_psk 1048
|
||||
#define wc_NID_auth_dss 1049
|
||||
#define wc_NID_auth_srp 1052
|
||||
#define wc_NID_auth_null 1054
|
||||
#define wc_NID_auth_any 1055
|
||||
/* Curve */
|
||||
#define wc_NID_aria_128_gcm 1123
|
||||
#define wc_NID_aria_192_gcm 1124
|
||||
#define wc_NID_aria_256_gcm 1125
|
||||
#define wc_NID_sm2 1172
|
||||
/* note, this WC_NID_undef definition duplicates the definition in
|
||||
* wolfcrypt/asn.h, which is gated out when -DNO_ASN.
|
||||
*/
|
||||
#define WC_NID_undef 0
|
||||
|
||||
#define wc_NID_X9_62_id_ecPublicKey WC_EVP_PKEY_EC
|
||||
#define wc_NID_rsaEncryption WC_EVP_PKEY_RSA
|
||||
#define wc_NID_rsa WC_EVP_PKEY_RSA
|
||||
#define wc_NID_dsa WC_EVP_PKEY_DSA
|
||||
#define WC_NID_aes_128_cbc 419
|
||||
#define WC_NID_aes_192_cbc 423
|
||||
#define WC_NID_aes_256_cbc 427
|
||||
#define WC_NID_aes_128_ccm 896
|
||||
#define WC_NID_aes_192_ccm 899
|
||||
#define WC_NID_aes_256_ccm 902
|
||||
#define WC_NID_aes_128_gcm 895
|
||||
#define WC_NID_aes_192_gcm 898
|
||||
#define WC_NID_aes_256_gcm 901
|
||||
#define WC_NID_aes_128_ctr 904
|
||||
#define WC_NID_aes_192_ctr 905
|
||||
#define WC_NID_aes_256_ctr 906
|
||||
#define WC_NID_aes_128_ecb 418
|
||||
#define WC_NID_aes_192_ecb 422
|
||||
#define WC_NID_aes_256_ecb 426
|
||||
#define WC_NID_des_cbc 31
|
||||
#define WC_NID_des_ecb 29
|
||||
#define WC_NID_des_ede3_cbc 44
|
||||
#define WC_NID_des_ede3_ecb 33
|
||||
#define WC_NID_aes_128_cfb1 650
|
||||
#define WC_NID_aes_192_cfb1 651
|
||||
#define WC_NID_aes_256_cfb1 652
|
||||
#define WC_NID_aes_128_cfb8 653
|
||||
#define WC_NID_aes_192_cfb8 654
|
||||
#define WC_NID_aes_256_cfb8 655
|
||||
#define WC_NID_aes_128_cfb128 421
|
||||
#define WC_NID_aes_192_cfb128 425
|
||||
#define WC_NID_aes_256_cfb128 429
|
||||
#define WC_NID_aes_128_ofb 420
|
||||
#define WC_NID_aes_192_ofb 424
|
||||
#define WC_NID_aes_256_ofb 428
|
||||
#define WC_NID_aes_128_xts 913
|
||||
#define WC_NID_aes_256_xts 914
|
||||
#define WC_NID_camellia_128_cbc 751
|
||||
#define WC_NID_camellia_256_cbc 753
|
||||
#define WC_NID_chacha20_poly1305 1018
|
||||
#define WC_NID_chacha20 1019
|
||||
#define WC_NID_sm4_ecb 1133
|
||||
#define WC_NID_sm4_cbc 1134
|
||||
#define WC_NID_sm4_ctr 1139
|
||||
#define WC_NID_sm4_gcm 1248
|
||||
#define WC_NID_sm4_ccm 1249
|
||||
#define WC_NID_md5WithRSA 104
|
||||
#define WC_NID_md2WithRSAEncryption 9
|
||||
#define WC_NID_md5WithRSAEncryption 99
|
||||
#define WC_NID_dsaWithSHA1 113
|
||||
#define WC_NID_dsaWithSHA1_2 70
|
||||
#define WC_NID_sha1WithRSA 115
|
||||
#define WC_NID_sha1WithRSAEncryption 65
|
||||
#define WC_NID_sha224WithRSAEncryption 671
|
||||
#define WC_NID_sha256WithRSAEncryption 668
|
||||
#define WC_NID_sha384WithRSAEncryption 669
|
||||
#define WC_NID_sha512WithRSAEncryption 670
|
||||
#define WC_NID_RSA_SHA3_224 1116
|
||||
#define WC_NID_RSA_SHA3_256 1117
|
||||
#define WC_NID_RSA_SHA3_384 1118
|
||||
#define WC_NID_RSA_SHA3_512 1119
|
||||
#define WC_NID_rsassaPss 912
|
||||
#define WC_NID_ecdsa_with_SHA1 416
|
||||
#define WC_NID_ecdsa_with_SHA224 793
|
||||
#define WC_NID_ecdsa_with_SHA256 794
|
||||
#define WC_NID_ecdsa_with_SHA384 795
|
||||
#define WC_NID_ecdsa_with_SHA512 796
|
||||
#define WC_NID_ecdsa_with_SHA3_224 1112
|
||||
#define WC_NID_ecdsa_with_SHA3_256 1113
|
||||
#define WC_NID_ecdsa_with_SHA3_384 1114
|
||||
#define WC_NID_ecdsa_with_SHA3_512 1115
|
||||
#define WC_NID_dsa_with_SHA224 802
|
||||
#define WC_NID_dsa_with_SHA256 803
|
||||
#define WC_NID_sha3_224 1096
|
||||
#define WC_NID_sha3_256 1097
|
||||
#define WC_NID_sha3_384 1098
|
||||
#define WC_NID_sha3_512 1099
|
||||
#define WC_NID_blake2b512 1056
|
||||
#define WC_NID_blake2s256 1057
|
||||
#define WC_NID_shake128 1100
|
||||
#define WC_NID_shake256 1101
|
||||
#define WC_NID_sha1 64
|
||||
#define WC_NID_sha224 675
|
||||
#define WC_NID_sm3 1143
|
||||
#define WC_NID_md2 77
|
||||
#define WC_NID_md4 257
|
||||
#define WC_NID_md5 40
|
||||
#define WC_NID_hmac 855
|
||||
#define WC_NID_hmacWithSHA1 163
|
||||
#define WC_NID_hmacWithSHA224 798
|
||||
#define WC_NID_hmacWithSHA256 799
|
||||
#define WC_NID_hmacWithSHA384 800
|
||||
#define WC_NID_hmacWithSHA512 801
|
||||
#define WC_NID_hkdf 1036
|
||||
#define WC_NID_cmac 894
|
||||
#define WC_NID_dhKeyAgreement 28
|
||||
#define WC_NID_ffdhe2048 1126
|
||||
#define WC_NID_ffdhe3072 1127
|
||||
#define WC_NID_ffdhe4096 1128
|
||||
#define WC_NID_rc4 5
|
||||
#define WC_NID_bf_cbc 91
|
||||
#define WC_NID_bf_ecb 92
|
||||
#define WC_NID_bf_cfb64 93
|
||||
#define WC_NID_bf_ofb64 94
|
||||
#define WC_NID_cast5_cbc 108
|
||||
#define WC_NID_cast5_ecb 109
|
||||
#define WC_NID_cast5_cfb64 110
|
||||
#define WC_NID_cast5_ofb64 111
|
||||
/* key exchange */
|
||||
#define WC_NID_kx_rsa 1037
|
||||
#define WC_NID_kx_ecdhe 1038
|
||||
#define WC_NID_kx_dhe 1039
|
||||
#define WC_NID_kx_ecdhe_psk 1040
|
||||
#define WC_NID_kx_dhe_psk 1041
|
||||
#define WC_NID_kx_rsa_psk 1042
|
||||
#define WC_NID_kx_psk 1043
|
||||
#define WC_NID_kx_srp 1044
|
||||
#define WC_NID_kx_gost 1045
|
||||
#define WC_NID_kx_any 1063
|
||||
/* server authentication */
|
||||
#define WC_NID_auth_rsa 1046
|
||||
#define WC_NID_auth_ecdsa 1047
|
||||
#define WC_NID_auth_psk 1048
|
||||
#define WC_NID_auth_dss 1049
|
||||
#define WC_NID_auth_srp 1052
|
||||
#define WC_NID_auth_null 1054
|
||||
#define WC_NID_auth_any 1055
|
||||
/* Curve */
|
||||
#define WC_NID_aria_128_gcm 1123
|
||||
#define WC_NID_aria_192_gcm 1124
|
||||
#define WC_NID_aria_256_gcm 1125
|
||||
#define WC_NID_sm2 1172
|
||||
|
||||
#define WC_NID_X9_62_id_ecPublicKey WC_EVP_PKEY_EC
|
||||
#define WC_NID_rsaEncryption WC_EVP_PKEY_RSA
|
||||
#define WC_NID_rsa WC_EVP_PKEY_RSA
|
||||
#define WC_NID_dsa WC_EVP_PKEY_DSA
|
||||
|
||||
enum {
|
||||
WC_EVP_PKEY_NONE = wc_NID_undef,
|
||||
WC_EVP_PKEY_NONE = WC_NID_undef,
|
||||
WC_AES_128_CBC_TYPE = 1,
|
||||
WC_AES_192_CBC_TYPE = 2,
|
||||
WC_AES_256_CBC_TYPE = 3,
|
||||
|
@ -427,10 +432,10 @@ enum {
|
|||
WC_AES_128_GCM_TYPE = 21,
|
||||
WC_AES_192_GCM_TYPE = 22,
|
||||
WC_AES_256_GCM_TYPE = 23,
|
||||
WC_EVP_PKEY_DH = wc_NID_dhKeyAgreement,
|
||||
WC_EVP_PKEY_HMAC = wc_NID_hmac,
|
||||
WC_EVP_PKEY_CMAC = wc_NID_cmac,
|
||||
WC_EVP_PKEY_HKDF = wc_NID_hkdf,
|
||||
WC_EVP_PKEY_DH = WC_NID_dhKeyAgreement,
|
||||
WC_EVP_PKEY_HMAC = WC_NID_hmac,
|
||||
WC_EVP_PKEY_CMAC = WC_NID_cmac,
|
||||
WC_EVP_PKEY_HKDF = WC_NID_hkdf,
|
||||
WC_EVP_PKEY_FALCON = 300, /* Randomly picked value. */
|
||||
WC_EVP_PKEY_DILITHIUM = 301, /* Randomly picked value. */
|
||||
WC_AES_128_CFB1_TYPE = 24,
|
||||
|
@ -528,139 +533,139 @@ enum {
|
|||
#define ARIA_192_GCM_TYPE WC_ARIA_192_GCM_TYPE
|
||||
#define ARIA_256_GCM_TYPE WC_ARIA_256_GCM_TYPE
|
||||
|
||||
#define NID_aes_128_cbc wc_NID_aes_128_cbc
|
||||
#define NID_aes_192_cbc wc_NID_aes_192_cbc
|
||||
#define NID_aes_256_cbc wc_NID_aes_256_cbc
|
||||
#define NID_aes_128_ccm wc_NID_aes_128_ccm
|
||||
#define NID_aes_192_ccm wc_NID_aes_192_ccm
|
||||
#define NID_aes_256_ccm wc_NID_aes_256_ccm
|
||||
#define NID_aes_128_gcm wc_NID_aes_128_gcm
|
||||
#define NID_aes_192_gcm wc_NID_aes_192_gcm
|
||||
#define NID_aes_256_gcm wc_NID_aes_256_gcm
|
||||
#define NID_aes_128_ctr wc_NID_aes_128_ctr
|
||||
#define NID_aes_192_ctr wc_NID_aes_192_ctr
|
||||
#define NID_aes_256_ctr wc_NID_aes_256_ctr
|
||||
#define NID_aes_128_ecb wc_NID_aes_128_ecb
|
||||
#define NID_aes_192_ecb wc_NID_aes_192_ecb
|
||||
#define NID_aes_256_ecb wc_NID_aes_256_ecb
|
||||
#define NID_des_cbc wc_NID_des_cbc
|
||||
#define NID_des_ecb wc_NID_des_ecb
|
||||
#define NID_des_ede3_cbc wc_NID_des_ede3_cbc
|
||||
#define NID_des_ede3_ecb wc_NID_des_ede3_ecb
|
||||
#define NID_aes_128_cfb1 wc_NID_aes_128_cfb1
|
||||
#define NID_aes_192_cfb1 wc_NID_aes_192_cfb1
|
||||
#define NID_aes_256_cfb1 wc_NID_aes_256_cfb1
|
||||
#define NID_aes_128_cfb8 wc_NID_aes_128_cfb8
|
||||
#define NID_aes_192_cfb8 wc_NID_aes_192_cfb8
|
||||
#define NID_aes_256_cfb8 wc_NID_aes_256_cfb8
|
||||
#define NID_aes_128_cfb128 wc_NID_aes_128_cfb128
|
||||
#define NID_aes_192_cfb128 wc_NID_aes_192_cfb128
|
||||
#define NID_aes_256_cfb128 wc_NID_aes_256_cfb128
|
||||
#define NID_aes_128_ofb wc_NID_aes_128_ofb
|
||||
#define NID_aes_192_ofb wc_NID_aes_192_ofb
|
||||
#define NID_aes_256_ofb wc_NID_aes_256_ofb
|
||||
#define NID_aes_128_xts wc_NID_aes_128_xts
|
||||
#define NID_aes_256_xts wc_NID_aes_256_xts
|
||||
#define NID_camellia_128_cbc wc_NID_camellia_128_cbc
|
||||
#define NID_camellia_256_cbc wc_NID_camellia_256_cbc
|
||||
#define NID_chacha20_poly1305 wc_NID_chacha20_poly1305
|
||||
#define NID_chacha20 wc_NID_chacha20
|
||||
#define NID_sm4_ecb wc_NID_sm4_ecb
|
||||
#define NID_sm4_cbc wc_NID_sm4_cbc
|
||||
#define NID_sm4_ctr wc_NID_sm4_ctr
|
||||
#define NID_sm4_gcm wc_NID_sm4_gcm
|
||||
#define NID_sm4_ccm wc_NID_sm4_ccm
|
||||
#define NID_md5WithRSA wc_NID_md5WithRSA
|
||||
#define NID_md2WithRSAEncryption wc_NID_md2WithRSAEncryption
|
||||
#define NID_md5WithRSAEncryption wc_NID_md5WithRSAEncryption
|
||||
#define NID_dsaWithSHA1 wc_NID_dsaWithSHA1
|
||||
#define NID_dsaWithSHA1_2 wc_NID_dsaWithSHA1_2
|
||||
#define NID_sha1WithRSA wc_NID_sha1WithRSA
|
||||
#define NID_sha1WithRSAEncryption wc_NID_sha1WithRSAEncryption
|
||||
#define NID_sha224WithRSAEncryption wc_NID_sha224WithRSAEncryption
|
||||
#define NID_sha256WithRSAEncryption wc_NID_sha256WithRSAEncryption
|
||||
#define NID_sha384WithRSAEncryption wc_NID_sha384WithRSAEncryption
|
||||
#define NID_sha512WithRSAEncryption wc_NID_sha512WithRSAEncryption
|
||||
#define NID_RSA_SHA3_224 wc_NID_RSA_SHA3_224
|
||||
#define NID_RSA_SHA3_256 wc_NID_RSA_SHA3_256
|
||||
#define NID_RSA_SHA3_384 wc_NID_RSA_SHA3_384
|
||||
#define NID_RSA_SHA3_512 wc_NID_RSA_SHA3_512
|
||||
#define NID_rsassaPss wc_NID_rsassaPss
|
||||
#define NID_ecdsa_with_SHA1 wc_NID_ecdsa_with_SHA1
|
||||
#define NID_ecdsa_with_SHA224 wc_NID_ecdsa_with_SHA224
|
||||
#define NID_ecdsa_with_SHA256 wc_NID_ecdsa_with_SHA256
|
||||
#define NID_ecdsa_with_SHA384 wc_NID_ecdsa_with_SHA384
|
||||
#define NID_ecdsa_with_SHA512 wc_NID_ecdsa_with_SHA512
|
||||
#define NID_ecdsa_with_SHA3_224 wc_NID_ecdsa_with_SHA3_224
|
||||
#define NID_ecdsa_with_SHA3_256 wc_NID_ecdsa_with_SHA3_256
|
||||
#define NID_ecdsa_with_SHA3_384 wc_NID_ecdsa_with_SHA3_384
|
||||
#define NID_ecdsa_with_SHA3_512 wc_NID_ecdsa_with_SHA3_512
|
||||
#define NID_dsa_with_SHA224 wc_NID_dsa_with_SHA224
|
||||
#define NID_dsa_with_SHA256 wc_NID_dsa_with_SHA256
|
||||
#define NID_sha3_224 wc_NID_sha3_224
|
||||
#define NID_sha3_256 wc_NID_sha3_256
|
||||
#define NID_sha3_384 wc_NID_sha3_384
|
||||
#define NID_sha3_512 wc_NID_sha3_512
|
||||
#define NID_blake2b512 wc_NID_blake2b512
|
||||
#define NID_blake2s256 wc_NID_blake2s256
|
||||
#define NID_shake128 wc_NID_shake128
|
||||
#define NID_shake256 wc_NID_shake256
|
||||
#define NID_sha1 wc_NID_sha1
|
||||
#define NID_sha224 wc_NID_sha224
|
||||
#define NID_sm3 wc_NID_sm3
|
||||
#define NID_md2 wc_NID_md2
|
||||
#define NID_md4 wc_NID_md4
|
||||
#define NID_md5 wc_NID_md5
|
||||
#define NID_hmac wc_NID_hmac
|
||||
#define NID_hmacWithSHA1 wc_NID_hmacWithSHA1
|
||||
#define NID_hmacWithSHA224 wc_NID_hmacWithSHA224
|
||||
#define NID_hmacWithSHA256 wc_NID_hmacWithSHA256
|
||||
#define NID_hmacWithSHA384 wc_NID_hmacWithSHA384
|
||||
#define NID_hmacWithSHA512 wc_NID_hmacWithSHA512
|
||||
#define NID_hkdf wc_NID_hkdf
|
||||
#define NID_cmac wc_NID_cmac
|
||||
#define NID_dhKeyAgreement wc_NID_dhKeyAgreement
|
||||
#define NID_ffdhe2048 wc_NID_ffdhe2048
|
||||
#define NID_ffdhe3072 wc_NID_ffdhe3072
|
||||
#define NID_ffdhe4096 wc_NID_ffdhe4096
|
||||
#define NID_rc4 wc_NID_rc4
|
||||
#define NID_bf_cbc wc_NID_bf_cbc
|
||||
#define NID_bf_ecb wc_NID_bf_ecb
|
||||
#define NID_bf_cfb64 wc_NID_bf_cfb64
|
||||
#define NID_bf_ofb64 wc_NID_bf_ofb64
|
||||
#define NID_cast5_cbc wc_NID_cast5_cbc
|
||||
#define NID_cast5_ecb wc_NID_cast5_ecb
|
||||
#define NID_cast5_cfb64 wc_NID_cast5_cfb64
|
||||
#define NID_cast5_ofb64 wc_NID_cast5_ofb64
|
||||
#define NID_aes_128_cbc WC_NID_aes_128_cbc
|
||||
#define NID_aes_192_cbc WC_NID_aes_192_cbc
|
||||
#define NID_aes_256_cbc WC_NID_aes_256_cbc
|
||||
#define NID_aes_128_ccm WC_NID_aes_128_ccm
|
||||
#define NID_aes_192_ccm WC_NID_aes_192_ccm
|
||||
#define NID_aes_256_ccm WC_NID_aes_256_ccm
|
||||
#define NID_aes_128_gcm WC_NID_aes_128_gcm
|
||||
#define NID_aes_192_gcm WC_NID_aes_192_gcm
|
||||
#define NID_aes_256_gcm WC_NID_aes_256_gcm
|
||||
#define NID_aes_128_ctr WC_NID_aes_128_ctr
|
||||
#define NID_aes_192_ctr WC_NID_aes_192_ctr
|
||||
#define NID_aes_256_ctr WC_NID_aes_256_ctr
|
||||
#define NID_aes_128_ecb WC_NID_aes_128_ecb
|
||||
#define NID_aes_192_ecb WC_NID_aes_192_ecb
|
||||
#define NID_aes_256_ecb WC_NID_aes_256_ecb
|
||||
#define NID_des_cbc WC_NID_des_cbc
|
||||
#define NID_des_ecb WC_NID_des_ecb
|
||||
#define NID_des_ede3_cbc WC_NID_des_ede3_cbc
|
||||
#define NID_des_ede3_ecb WC_NID_des_ede3_ecb
|
||||
#define NID_aes_128_cfb1 WC_NID_aes_128_cfb1
|
||||
#define NID_aes_192_cfb1 WC_NID_aes_192_cfb1
|
||||
#define NID_aes_256_cfb1 WC_NID_aes_256_cfb1
|
||||
#define NID_aes_128_cfb8 WC_NID_aes_128_cfb8
|
||||
#define NID_aes_192_cfb8 WC_NID_aes_192_cfb8
|
||||
#define NID_aes_256_cfb8 WC_NID_aes_256_cfb8
|
||||
#define NID_aes_128_cfb128 WC_NID_aes_128_cfb128
|
||||
#define NID_aes_192_cfb128 WC_NID_aes_192_cfb128
|
||||
#define NID_aes_256_cfb128 WC_NID_aes_256_cfb128
|
||||
#define NID_aes_128_ofb WC_NID_aes_128_ofb
|
||||
#define NID_aes_192_ofb WC_NID_aes_192_ofb
|
||||
#define NID_aes_256_ofb WC_NID_aes_256_ofb
|
||||
#define NID_aes_128_xts WC_NID_aes_128_xts
|
||||
#define NID_aes_256_xts WC_NID_aes_256_xts
|
||||
#define NID_camellia_128_cbc WC_NID_camellia_128_cbc
|
||||
#define NID_camellia_256_cbc WC_NID_camellia_256_cbc
|
||||
#define NID_chacha20_poly1305 WC_NID_chacha20_poly1305
|
||||
#define NID_chacha20 WC_NID_chacha20
|
||||
#define NID_sm4_ecb WC_NID_sm4_ecb
|
||||
#define NID_sm4_cbc WC_NID_sm4_cbc
|
||||
#define NID_sm4_ctr WC_NID_sm4_ctr
|
||||
#define NID_sm4_gcm WC_NID_sm4_gcm
|
||||
#define NID_sm4_ccm WC_NID_sm4_ccm
|
||||
#define NID_md5WithRSA WC_NID_md5WithRSA
|
||||
#define NID_md2WithRSAEncryption WC_NID_md2WithRSAEncryption
|
||||
#define NID_md5WithRSAEncryption WC_NID_md5WithRSAEncryption
|
||||
#define NID_dsaWithSHA1 WC_NID_dsaWithSHA1
|
||||
#define NID_dsaWithSHA1_2 WC_NID_dsaWithSHA1_2
|
||||
#define NID_sha1WithRSA WC_NID_sha1WithRSA
|
||||
#define NID_sha1WithRSAEncryption WC_NID_sha1WithRSAEncryption
|
||||
#define NID_sha224WithRSAEncryption WC_NID_sha224WithRSAEncryption
|
||||
#define NID_sha256WithRSAEncryption WC_NID_sha256WithRSAEncryption
|
||||
#define NID_sha384WithRSAEncryption WC_NID_sha384WithRSAEncryption
|
||||
#define NID_sha512WithRSAEncryption WC_NID_sha512WithRSAEncryption
|
||||
#define NID_RSA_SHA3_224 WC_NID_RSA_SHA3_224
|
||||
#define NID_RSA_SHA3_256 WC_NID_RSA_SHA3_256
|
||||
#define NID_RSA_SHA3_384 WC_NID_RSA_SHA3_384
|
||||
#define NID_RSA_SHA3_512 WC_NID_RSA_SHA3_512
|
||||
#define NID_rsassaPss WC_NID_rsassaPss
|
||||
#define NID_ecdsa_with_SHA1 WC_NID_ecdsa_with_SHA1
|
||||
#define NID_ecdsa_with_SHA224 WC_NID_ecdsa_with_SHA224
|
||||
#define NID_ecdsa_with_SHA256 WC_NID_ecdsa_with_SHA256
|
||||
#define NID_ecdsa_with_SHA384 WC_NID_ecdsa_with_SHA384
|
||||
#define NID_ecdsa_with_SHA512 WC_NID_ecdsa_with_SHA512
|
||||
#define NID_ecdsa_with_SHA3_224 WC_NID_ecdsa_with_SHA3_224
|
||||
#define NID_ecdsa_with_SHA3_256 WC_NID_ecdsa_with_SHA3_256
|
||||
#define NID_ecdsa_with_SHA3_384 WC_NID_ecdsa_with_SHA3_384
|
||||
#define NID_ecdsa_with_SHA3_512 WC_NID_ecdsa_with_SHA3_512
|
||||
#define NID_dsa_with_SHA224 WC_NID_dsa_with_SHA224
|
||||
#define NID_dsa_with_SHA256 WC_NID_dsa_with_SHA256
|
||||
#define NID_sha3_224 WC_NID_sha3_224
|
||||
#define NID_sha3_256 WC_NID_sha3_256
|
||||
#define NID_sha3_384 WC_NID_sha3_384
|
||||
#define NID_sha3_512 WC_NID_sha3_512
|
||||
#define NID_blake2b512 WC_NID_blake2b512
|
||||
#define NID_blake2s256 WC_NID_blake2s256
|
||||
#define NID_shake128 WC_NID_shake128
|
||||
#define NID_shake256 WC_NID_shake256
|
||||
#define NID_sha1 WC_NID_sha1
|
||||
#define NID_sha224 WC_NID_sha224
|
||||
#define NID_sm3 WC_NID_sm3
|
||||
#define NID_md2 WC_NID_md2
|
||||
#define NID_md4 WC_NID_md4
|
||||
#define NID_md5 WC_NID_md5
|
||||
#define NID_hmac WC_NID_hmac
|
||||
#define NID_hmacWithSHA1 WC_NID_hmacWithSHA1
|
||||
#define NID_hmacWithSHA224 WC_NID_hmacWithSHA224
|
||||
#define NID_hmacWithSHA256 WC_NID_hmacWithSHA256
|
||||
#define NID_hmacWithSHA384 WC_NID_hmacWithSHA384
|
||||
#define NID_hmacWithSHA512 WC_NID_hmacWithSHA512
|
||||
#define NID_hkdf WC_NID_hkdf
|
||||
#define NID_cmac WC_NID_cmac
|
||||
#define NID_dhKeyAgreement WC_NID_dhKeyAgreement
|
||||
#define NID_ffdhe2048 WC_NID_ffdhe2048
|
||||
#define NID_ffdhe3072 WC_NID_ffdhe3072
|
||||
#define NID_ffdhe4096 WC_NID_ffdhe4096
|
||||
#define NID_rc4 WC_NID_rc4
|
||||
#define NID_bf_cbc WC_NID_bf_cbc
|
||||
#define NID_bf_ecb WC_NID_bf_ecb
|
||||
#define NID_bf_cfb64 WC_NID_bf_cfb64
|
||||
#define NID_bf_ofb64 WC_NID_bf_ofb64
|
||||
#define NID_cast5_cbc WC_NID_cast5_cbc
|
||||
#define NID_cast5_ecb WC_NID_cast5_ecb
|
||||
#define NID_cast5_cfb64 WC_NID_cast5_cfb64
|
||||
#define NID_cast5_ofb64 WC_NID_cast5_ofb64
|
||||
/* key exchange */
|
||||
#define NID_kx_rsa wc_NID_kx_rsa
|
||||
#define NID_kx_ecdhe wc_NID_kx_ecdhe
|
||||
#define NID_kx_dhe wc_NID_kx_dhe
|
||||
#define NID_kx_ecdhe_psk wc_NID_kx_ecdhe_psk
|
||||
#define NID_kx_dhe_psk wc_NID_kx_dhe_psk
|
||||
#define NID_kx_rsa_psk wc_NID_kx_rsa_psk
|
||||
#define NID_kx_psk wc_NID_kx_psk
|
||||
#define NID_kx_srp wc_NID_kx_srp
|
||||
#define NID_kx_gost wc_NID_kx_gost
|
||||
#define NID_kx_any wc_NID_kx_any
|
||||
#define NID_kx_rsa WC_NID_kx_rsa
|
||||
#define NID_kx_ecdhe WC_NID_kx_ecdhe
|
||||
#define NID_kx_dhe WC_NID_kx_dhe
|
||||
#define NID_kx_ecdhe_psk WC_NID_kx_ecdhe_psk
|
||||
#define NID_kx_dhe_psk WC_NID_kx_dhe_psk
|
||||
#define NID_kx_rsa_psk WC_NID_kx_rsa_psk
|
||||
#define NID_kx_psk WC_NID_kx_psk
|
||||
#define NID_kx_srp WC_NID_kx_srp
|
||||
#define NID_kx_gost WC_NID_kx_gost
|
||||
#define NID_kx_any WC_NID_kx_any
|
||||
/* server authentication */
|
||||
#define NID_auth_rsa wc_NID_auth_rsa
|
||||
#define NID_auth_ecdsa wc_NID_auth_ecdsa
|
||||
#define NID_auth_psk wc_NID_auth_psk
|
||||
#define NID_auth_dss wc_NID_auth_dss
|
||||
#define NID_auth_srp wc_NID_auth_srp
|
||||
#define NID_auth_null wc_NID_auth_null
|
||||
#define NID_auth_any wc_NID_auth_any
|
||||
#define NID_auth_rsa WC_NID_auth_rsa
|
||||
#define NID_auth_ecdsa WC_NID_auth_ecdsa
|
||||
#define NID_auth_psk WC_NID_auth_psk
|
||||
#define NID_auth_dss WC_NID_auth_dss
|
||||
#define NID_auth_srp WC_NID_auth_srp
|
||||
#define NID_auth_null WC_NID_auth_null
|
||||
#define NID_auth_any WC_NID_auth_any
|
||||
/* Curve */
|
||||
#define NID_aria_128_gcm wc_NID_aria_128_gcm
|
||||
#define NID_aria_192_gcm wc_NID_aria_192_gcm
|
||||
#define NID_aria_256_gcm wc_NID_aria_256_gcm
|
||||
#define NID_sm2 wc_NID_sm2
|
||||
#define NID_aria_128_gcm WC_NID_aria_128_gcm
|
||||
#define NID_aria_192_gcm WC_NID_aria_192_gcm
|
||||
#define NID_aria_256_gcm WC_NID_aria_256_gcm
|
||||
#define NID_sm2 WC_NID_sm2
|
||||
|
||||
#define NID_X9_62_id_ecPublicKey wc_NID_X9_62_id_ecPublicKey
|
||||
#define NID_rsaEncryption wc_NID_rsaEncryption
|
||||
#define NID_rsa wc_NID_rsa
|
||||
#define NID_dsa wc_NID_dsa
|
||||
#define NID_X9_62_id_ecPublicKey WC_NID_X9_62_id_ecPublicKey
|
||||
#define NID_rsaEncryption WC_NID_rsaEncryption
|
||||
#define NID_rsa WC_NID_rsa
|
||||
#define NID_dsa WC_NID_dsa
|
||||
|
||||
#define EVP_PKEY_OP_SIGN WC_EVP_PKEY_OP_SIGN
|
||||
#define EVP_PKEY_OP_VERIFY WC_EVP_PKEY_OP_VERIFY
|
||||
|
|
|
@ -26,9 +26,17 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND 0
|
||||
#define EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY 1
|
||||
#define EVP_PKEY_HKDEF_MODE_EXPAND_ONLY 2
|
||||
#define WOLFSSL_EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND 0
|
||||
#define WOLFSSL_EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY 1
|
||||
#define WOLFSSL_EVP_PKEY_HKDEF_MODE_EXPAND_ONLY 2
|
||||
|
||||
#ifndef OPENSSL_COEXIST
|
||||
|
||||
#define EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND WOLFSSL_EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND
|
||||
#define EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY WOLFSSL_EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY
|
||||
#define EVP_PKEY_HKDEF_MODE_EXPAND_ONLY WOLFSSL_EVP_PKEY_HKDEF_MODE_EXPAND_ONLY
|
||||
|
||||
#endif /* !OPENSSL_COEXIST */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
|
|
|
@ -27,20 +27,39 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define NID_sect163k1 721
|
||||
#define NID_sect163r1 722
|
||||
#define NID_sect163r2 723
|
||||
#define NID_sect193r1 724
|
||||
#define NID_sect193r2 725
|
||||
#define NID_sect233k1 726
|
||||
#define NID_sect233r1 727
|
||||
#define NID_sect239k1 728
|
||||
#define NID_sect283k1 729
|
||||
#define NID_sect283r1 730
|
||||
#define NID_sect409k1 731
|
||||
#define NID_sect409r1 732
|
||||
#define NID_sect571k1 733
|
||||
#define NID_sect571r1 734
|
||||
#define WC_NID_sect163k1 721
|
||||
#define WC_NID_sect163r1 722
|
||||
#define WC_NID_sect163r2 723
|
||||
#define WC_NID_sect193r1 724
|
||||
#define WC_NID_sect193r2 725
|
||||
#define WC_NID_sect233k1 726
|
||||
#define WC_NID_sect233r1 727
|
||||
#define WC_NID_sect239k1 728
|
||||
#define WC_NID_sect283k1 729
|
||||
#define WC_NID_sect283r1 730
|
||||
#define WC_NID_sect409k1 731
|
||||
#define WC_NID_sect409r1 732
|
||||
#define WC_NID_sect571k1 733
|
||||
#define WC_NID_sect571r1 734
|
||||
|
||||
#ifndef OPENSSL_COEXIST
|
||||
|
||||
#define NID_sect163k1 WC_NID_sect163k1
|
||||
#define NID_sect163r1 WC_NID_sect163r1
|
||||
#define NID_sect163r2 WC_NID_sect163r2
|
||||
#define NID_sect193r1 WC_NID_sect193r1
|
||||
#define NID_sect193r2 WC_NID_sect193r2
|
||||
#define NID_sect233k1 WC_NID_sect233k1
|
||||
#define NID_sect233r1 WC_NID_sect233r1
|
||||
#define NID_sect239k1 WC_NID_sect239k1
|
||||
#define NID_sect283k1 WC_NID_sect283k1
|
||||
#define NID_sect283r1 WC_NID_sect283r1
|
||||
#define NID_sect409k1 WC_NID_sect409k1
|
||||
#define NID_sect409r1 WC_NID_sect409r1
|
||||
#define NID_sect571k1 WC_NID_sect571k1
|
||||
#define NID_sect571r1 WC_NID_sect571r1
|
||||
|
||||
#endif /* !OPENSSL_COEXIST */
|
||||
|
||||
/* the definition is for Qt Unit test */
|
||||
#define SN_jurisdictionCountryName "jurisdictionC"
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
|
||||
#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
|
||||
|
||||
#define wc_NID_ad_OCSP 178
|
||||
#define wc_NID_ad_ca_issuers 179
|
||||
#define WC_NID_ad_OCSP 178
|
||||
#define WC_NID_ad_ca_issuers 179
|
||||
|
||||
#ifndef OPENSSL_COEXIST
|
||||
|
||||
|
@ -69,8 +69,8 @@
|
|||
/* not required for wolfSSL */
|
||||
#define OPENSSL_load_builtin_modules() WC_DO_NOTHING
|
||||
|
||||
#define NID_ad_OCSP wc_NID_ad_OCSP
|
||||
#define NID_ad_ca_issuers wc_NID_ad_ca_issuers
|
||||
#define NID_ad_OCSP WC_NID_ad_OCSP
|
||||
#define NID_ad_ca_issuers WC_NID_ad_ca_issuers
|
||||
|
||||
#endif /* !OPENSSL_COEXIST */
|
||||
|
||||
|
|
|
@ -28,15 +28,15 @@
|
|||
#ifndef WOLFSSL_PKCS12_COMPAT_H_
|
||||
#define WOLFSSL_PKCS12_COMPAT_H_
|
||||
|
||||
#define wc_NID_pbe_WithSHA1AndDES_CBC 2
|
||||
#define wc_NID_pbe_WithSHA1And3_Key_TripleDES_CBC 3
|
||||
#define wc_NID_pbe_WithSHA1And128BitRC4 1
|
||||
#define WC_NID_pbe_WithSHA1AndDES_CBC 2
|
||||
#define WC_NID_pbe_WithSHA1And3_Key_TripleDES_CBC 3
|
||||
#define WC_NID_pbe_WithSHA1And128BitRC4 1
|
||||
|
||||
#ifndef OPENSSL_COEXIST
|
||||
|
||||
#define NID_pbe_WithSHA1AndDES_CBC wc_NID_pbe_WithSHA1AndDES_CBC
|
||||
#define NID_pbe_WithSHA1And3_Key_TripleDES_CBC wc_NID_pbe_WithSHA1And3_Key_TripleDES_CBC
|
||||
#define NID_pbe_WithSHA1And128BitRC4 wc_NID_pbe_WithSHA1And128BitRC4
|
||||
#define NID_pbe_WithSHA1AndDES_CBC WC_NID_pbe_WithSHA1AndDES_CBC
|
||||
#define NID_pbe_WithSHA1And3_Key_TripleDES_CBC WC_NID_pbe_WithSHA1And3_Key_TripleDES_CBC
|
||||
#define NID_pbe_WithSHA1And128BitRC4 WC_NID_pbe_WithSHA1And128BitRC4
|
||||
|
||||
#define PKCS12_DEFAULT_ITER WC_PKCS12_ITT_DEFAULT
|
||||
|
||||
|
|
|
@ -113,6 +113,20 @@
|
|||
|
||||
#define WOLFSSL_TLSEXT_STATUSTYPE_ocsp 1
|
||||
|
||||
#if defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) || \
|
||||
defined(WOLFSSL_MYSQL_COMPATIBLE) || defined(OPENSSL_EXTRA) || \
|
||||
defined(HAVE_LIGHTY) || defined(HAVE_STUNNEL) || \
|
||||
defined(WOLFSSL_WPAS_SMALL)
|
||||
|
||||
#define WOLFSSL_NPN_UNSUPPORTED 0
|
||||
#define WOLFSSL_NPN_NEGOTIATED 1
|
||||
#define WOLFSSL_NPN_NO_OVERLAP 2
|
||||
|
||||
#endif /* WOLFSSL_NGINX || WOLFSSL_HAPROXY || \
|
||||
WOLFSSL_MYSQL_COMPATIBLE || OPENSSL_EXTRA || \
|
||||
HAVE_LIGHTY || HAVE_STUNNEL || \
|
||||
WOLFSSL_WPAS_SMALL */
|
||||
|
||||
#if !defined(OPENSSL_COEXIST) && (defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL))
|
||||
|
||||
typedef WOLFSSL SSL;
|
||||
|
@ -1615,9 +1629,9 @@ typedef WOLFSSL_SRTP_PROTECTION_PROFILE SRTP_PROTECTION_PROFILE;
|
|||
#define TLSEXT_TYPE_application_layer_protocol_negotiation \
|
||||
TLSXT_APPLICATION_LAYER_PROTOCOL
|
||||
|
||||
#define OPENSSL_NPN_UNSUPPORTED 0
|
||||
#define OPENSSL_NPN_NEGOTIATED 1
|
||||
#define OPENSSL_NPN_NO_OVERLAP 2
|
||||
#define OPENSSL_NPN_UNSUPPORTED WOLFSSL_NPN_UNSUPPORTED
|
||||
#define OPENSSL_NPN_NEGOTIATED WOLFSSL_NPN_NEGOTIATED
|
||||
#define OPENSSL_NPN_NO_OVERLAP WOLFSSL_NPN_NO_OVERLAP
|
||||
|
||||
/* Nginx checks these to see if the error was a handshake error. */
|
||||
#define SSL_R_BAD_CHANGE_CIPHER_SPEC LENGTH_ERROR
|
||||
|
@ -1714,7 +1728,7 @@ typedef WOLFSSL_SRTP_PROTECTION_PROFILE SRTP_PROTECTION_PROFILE;
|
|||
#define ERR_NUM_ERRORS 16
|
||||
#define SN_pkcs9_emailAddress "Email"
|
||||
#define LN_pkcs9_emailAddress "emailAddress"
|
||||
#define NID_pkcs9_emailAddress 48
|
||||
#define NID_pkcs9_emailAddress WC_NID_pkcs9_emailAddress
|
||||
#define OBJ_pkcs9_emailAddress 1L,2L,840L,113539L,1L,9L,1L
|
||||
|
||||
#define LN_basic_constraints "X509v3 Basic Constraints"
|
||||
|
@ -1806,11 +1820,19 @@ typedef WOLFSSL_CONF_CTX SSL_CONF_CTX;
|
|||
* SSL_CIPHER_get_id(cipher)
|
||||
* used by QUIC implementations, such as HAProxy
|
||||
*/
|
||||
#define TLS1_3_CK_AES_128_GCM_SHA256 0x1301
|
||||
#define TLS1_3_CK_AES_256_GCM_SHA384 0x1302
|
||||
#define TLS1_3_CK_CHACHA20_POLY1305_SHA256 0x1303
|
||||
#define TLS1_3_CK_AES_128_CCM_SHA256 0x1304
|
||||
#define TLS1_3_CK_AES_128_CCM_8_SHA256 0x1305
|
||||
#define WOLF_TLS1_3_CK_AES_128_GCM_SHA256 0x1301
|
||||
#define WOLF_TLS1_3_CK_AES_256_GCM_SHA384 0x1302
|
||||
#define WOLF_TLS1_3_CK_CHACHA20_POLY1305_SHA256 0x1303
|
||||
#define WOLF_TLS1_3_CK_AES_128_CCM_SHA256 0x1304
|
||||
#define WOLF_TLS1_3_CK_AES_128_CCM_8_SHA256 0x1305
|
||||
|
||||
#ifndef OPENSSL_COEXIST
|
||||
|
||||
#define TLS1_3_CK_AES_128_GCM_SHA256 WOLF_TLS1_3_CK_AES_128_GCM_SHA256
|
||||
#define TLS1_3_CK_AES_256_GCM_SHA384 WOLF_TLS1_3_CK_AES_256_GCM_SHA384
|
||||
#define TLS1_3_CK_CHACHA20_POLY1305_SHA256 WOLF_TLS1_3_CK_CHACHA20_POLY1305_SHA256
|
||||
#define TLS1_3_CK_AES_128_CCM_SHA256 WOLF_TLS1_3_CK_AES_128_CCM_SHA256
|
||||
#define TLS1_3_CK_AES_128_CCM_8_SHA256 WOLF_TLS1_3_CK_AES_128_CCM_8_SHA256
|
||||
|
||||
#define SSL_R_MISSING_QUIC_TRANSPORT_PARAMETERS_EXTENSION QUIC_TP_MISSING_E
|
||||
#define SSL_R_WRONG_ENCRYPTION_LEVEL_RECEIVED QUIC_WRONG_ENC_LEVEL
|
||||
|
@ -1852,6 +1874,8 @@ typedef WOLFSSL_ENCRYPTION_LEVEL OSSL_ENCRYPTION_LEVEL;
|
|||
int SSL_CIPHER_get_prf_nid(const SSL_CIPHER *c);
|
||||
*/
|
||||
|
||||
#endif /* !OPENSSL_COEXIST */
|
||||
|
||||
#endif /* WOLFSSL_QUIC */
|
||||
|
||||
|
||||
|
|
|
@ -45,10 +45,20 @@
|
|||
|
||||
#ifdef WOLFSSL_QUIC
|
||||
/* from rfc9001 */
|
||||
#define WOLFSSL_TLSEXT_TYPE_quic_transport_parameters_draft \
|
||||
TLSXT_KEY_QUIC_TP_PARAMS_DRAFT
|
||||
#define WOLFSSL_TLSEXT_TYPE_quic_transport_parameters \
|
||||
TLSXT_KEY_QUIC_TP_PARAMS
|
||||
|
||||
#ifndef OPENSSL_COEXIST
|
||||
|
||||
#define TLSEXT_TYPE_quic_transport_parameters_draft \
|
||||
TLSXT_KEY_QUIC_TP_PARAMS_DRAFT
|
||||
#define TLSEXT_TYPE_quic_transport_parameters \
|
||||
TLSXT_KEY_QUIC_TP_PARAMS
|
||||
#endif
|
||||
|
||||
#endif /* !OPENSSL_COEXIST */
|
||||
|
||||
#endif /* WOLFSSL_QUIC */
|
||||
|
||||
#endif /* WOLFSSL_OPENSSL_TLS1_H_ */
|
||||
|
|
|
@ -251,10 +251,10 @@ typedef int (*WOLFSSL_X509_STORE_CTX_get_crl_cb)(WOLFSSL_X509_STORE_CTX *,
|
|||
typedef int (*WOLFSSL_X509_STORE_CTX_check_crl_cb)(WOLFSSL_X509_STORE_CTX *,
|
||||
WOLFSSL_X509_CRL *);
|
||||
|
||||
#define WOLFSSL_ASN1_TYPE_INTEGER 0x02
|
||||
#define WOLFSSL_ASN1_TYPE_NEG 0x100
|
||||
#define WOLFSSL_ASN1_TYPE_NEG_INTEGER (2 | WOLFSSL_ASN1_TYPE_NEG)
|
||||
#define WOLFSSL_ASN1_TYPE_NEG_ENUMERATED (10 | WOLFSSL_ASN1_TYPE_NEG)
|
||||
#define WOLFSSL_V_ASN1_INTEGER 0x02
|
||||
#define WOLFSSL_V_ASN1_NEG 0x100
|
||||
#define WOLFSSL_V_ASN1_NEG_INTEGER (2 | WOLFSSL_V_ASN1_NEG)
|
||||
#define WOLFSSL_V_ASN1_NEG_ENUMERATED (10 | WOLFSSL_V_ASN1_NEG)
|
||||
|
||||
/* Type for ASN1_print_ex */
|
||||
#define WOLFSSL_ASN1_STRFLGS_ESC_2253 1
|
||||
|
@ -279,24 +279,24 @@ typedef int (*WOLFSSL_X509_STORE_CTX_check_crl_cb)(WOLFSSL_X509_STORE_CTX *,
|
|||
#define WOLFSSL_MBSTRING_BMP 0x1002
|
||||
#define WOLFSSL_MBSTRING_UNIV 0x1004
|
||||
|
||||
#define WOLFSSL_ASN1_TYPE_EOC 0
|
||||
#define WOLFSSL_ASN1_TYPE_BOOLEAN 1
|
||||
#define WOLFSSL_ASN1_TYPE_OCTET_STRING 4
|
||||
#define WOLFSSL_ASN1_TYPE_NULL 5
|
||||
#define WOLFSSL_ASN1_TYPE_OBJECT 6
|
||||
#define WOLFSSL_ASN1_TYPE_UTF8STRING 12
|
||||
#define WOLFSSL_ASN1_TYPE_SEQUENCE 16
|
||||
#define WOLFSSL_ASN1_TYPE_SET 17
|
||||
#define WOLFSSL_ASN1_TYPE_PRINTABLESTRING 19
|
||||
#define WOLFSSL_ASN1_TYPE_T61STRING 20
|
||||
#define WOLFSSL_ASN1_TYPE_IA5STRING 22
|
||||
#define WOLFSSL_ASN1_TYPE_UTCTIME 23
|
||||
#define WOLFSSL_ASN1_TYPE_GENERALIZEDTIME 24
|
||||
#define WOLFSSL_ASN1_TYPE_UNIVERSALSTRING 28
|
||||
#define WOLFSSL_ASN1_TYPE_BMPSTRING 30
|
||||
#define WOLFSSL_V_ASN1_EOC 0
|
||||
#define WOLFSSL_V_ASN1_BOOLEAN 1
|
||||
#define WOLFSSL_V_ASN1_OCTET_STRING 4
|
||||
#define WOLFSSL_V_ASN1_NULL 5
|
||||
#define WOLFSSL_V_ASN1_OBJECT 6
|
||||
#define WOLFSSL_V_ASN1_UTF8STRING 12
|
||||
#define WOLFSSL_V_ASN1_SEQUENCE 16
|
||||
#define WOLFSSL_V_ASN1_SET 17
|
||||
#define WOLFSSL_V_ASN1_PRINTABLESTRING 19
|
||||
#define WOLFSSL_V_ASN1_T61STRING 20
|
||||
#define WOLFSSL_V_ASN1_IA5STRING 22
|
||||
#define WOLFSSL_V_ASN1_UTCTIME 23
|
||||
#define WOLFSSL_V_ASN1_GENERALIZEDTIME 24
|
||||
#define WOLFSSL_V_ASN1_UNIVERSALSTRING 28
|
||||
#define WOLFSSL_V_ASN1_BMPSTRING 30
|
||||
|
||||
|
||||
#define WOLFSSL_ASN1_TYPE_CONSTRUCTED 0x20
|
||||
#define WOLFSSL_V_ASN1_CONSTRUCTED 0x20
|
||||
|
||||
#define WOLFSSL_ASN1_STRING_FLAG_BITS_LEFT 0x008
|
||||
#define WOLFSSL_ASN1_STRING_FLAG_NDEF 0x010
|
||||
|
|
|
@ -809,151 +809,152 @@ extern const WOLFSSL_ObjectInfo wolfssl_object_info[];
|
|||
#define WOLFSSL_MAX_NAME_CONSTRAINTS 128
|
||||
#endif
|
||||
|
||||
#define wc_NID_undef 0
|
||||
#define WC_NID_undef 0
|
||||
|
||||
#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
|
||||
/* NIDs */
|
||||
#define wc_NID_netscape_cert_type wc_NID_undef
|
||||
#define wc_NID_des 66
|
||||
#define wc_NID_des3 67
|
||||
#define wc_NID_sha256 672
|
||||
#define wc_NID_sha384 673
|
||||
#define wc_NID_sha512 674
|
||||
#define wc_NID_sha512_224 1094
|
||||
#define wc_NID_sha512_256 1095
|
||||
#define wc_NID_pkcs7_signed 22
|
||||
#define wc_NID_pkcs7_enveloped 23
|
||||
#define wc_NID_pkcs7_signedAndEnveloped 24
|
||||
#define wc_NID_pkcs9_unstructuredName 49
|
||||
#define wc_NID_pkcs9_contentType 50 /* 1.2.840.113549.1.9.3 */
|
||||
#define wc_NID_pkcs9_challengePassword 54
|
||||
#define wc_NID_hw_name_oid 73
|
||||
#define wc_NID_id_pkix_OCSP_basic 74
|
||||
#define wc_NID_any_policy 75
|
||||
#define wc_NID_anyExtendedKeyUsage 76
|
||||
#define wc_NID_givenName 100 /* 2.5.4.42 */
|
||||
#define wc_NID_initials 101 /* 2.5.4.43 */
|
||||
#define wc_NID_title 106
|
||||
#define wc_NID_description 107
|
||||
#define wc_NID_basic_constraints 133
|
||||
#define wc_NID_key_usage 129 /* 2.5.29.15 */
|
||||
#define wc_NID_ext_key_usage 151 /* 2.5.29.37 */
|
||||
#define wc_NID_subject_key_identifier 128
|
||||
#define wc_NID_authority_key_identifier 149
|
||||
#define wc_NID_private_key_usage_period 130 /* 2.5.29.16 */
|
||||
#define wc_NID_subject_alt_name 131
|
||||
#define wc_NID_issuer_alt_name 132
|
||||
#define wc_NID_info_access 69
|
||||
#define wc_NID_sinfo_access 79 /* id-pe 11 */
|
||||
#define wc_NID_name_constraints 144 /* 2.5.29.30 */
|
||||
#define wc_NID_crl_distribution_points 145 /* 2.5.29.31 */
|
||||
#define wc_NID_certificate_policies 146
|
||||
#define wc_NID_policy_mappings 147
|
||||
#define wc_NID_policy_constraints 150
|
||||
#define wc_NID_inhibit_any_policy 168 /* 2.5.29.54 */
|
||||
#define wc_NID_tlsfeature 1020 /* id-pe 24 */
|
||||
#define wc_NID_buildingName 1494
|
||||
#define WC_NID_netscape_cert_type WC_NID_undef
|
||||
#define WC_NID_des 66
|
||||
#define WC_NID_des3 67
|
||||
#define WC_NID_sha256 672
|
||||
#define WC_NID_sha384 673
|
||||
#define WC_NID_sha512 674
|
||||
#define WC_NID_sha512_224 1094
|
||||
#define WC_NID_sha512_256 1095
|
||||
#define WC_NID_pkcs7_signed 22
|
||||
#define WC_NID_pkcs7_enveloped 23
|
||||
#define WC_NID_pkcs7_signedAndEnveloped 24
|
||||
#define WC_NID_pkcs9_emailAddress 48
|
||||
#define WC_NID_pkcs9_unstructuredName 49
|
||||
#define WC_NID_pkcs9_contentType 50 /* 1.2.840.113549.1.9.3 */
|
||||
#define WC_NID_pkcs9_challengePassword 54
|
||||
#define WC_NID_hw_name_oid 73
|
||||
#define WC_NID_id_pkix_OCSP_basic 74
|
||||
#define WC_NID_any_policy 75
|
||||
#define WC_NID_anyExtendedKeyUsage 76
|
||||
#define WC_NID_givenName 100 /* 2.5.4.42 */
|
||||
#define WC_NID_initials 101 /* 2.5.4.43 */
|
||||
#define WC_NID_title 106
|
||||
#define WC_NID_description 107
|
||||
#define WC_NID_basic_constraints 133
|
||||
#define WC_NID_key_usage 129 /* 2.5.29.15 */
|
||||
#define WC_NID_ext_key_usage 151 /* 2.5.29.37 */
|
||||
#define WC_NID_subject_key_identifier 128
|
||||
#define WC_NID_authority_key_identifier 149
|
||||
#define WC_NID_private_key_usage_period 130 /* 2.5.29.16 */
|
||||
#define WC_NID_subject_alt_name 131
|
||||
#define WC_NID_issuer_alt_name 132
|
||||
#define WC_NID_info_access 69
|
||||
#define WC_NID_sinfo_access 79 /* id-pe 11 */
|
||||
#define WC_NID_name_constraints 144 /* 2.5.29.30 */
|
||||
#define WC_NID_crl_distribution_points 145 /* 2.5.29.31 */
|
||||
#define WC_NID_certificate_policies 146
|
||||
#define WC_NID_policy_mappings 147
|
||||
#define WC_NID_policy_constraints 150
|
||||
#define WC_NID_inhibit_any_policy 168 /* 2.5.29.54 */
|
||||
#define WC_NID_tlsfeature 1020 /* id-pe 24 */
|
||||
#define WC_NID_buildingName 1494
|
||||
|
||||
#define wc_NID_dnQualifier 174 /* 2.5.4.46 */
|
||||
#define wc_NID_commonName 14 /* CN Changed to not conflict
|
||||
#define WC_NID_dnQualifier 174 /* 2.5.4.46 */
|
||||
#define WC_NID_commonName 14 /* CN Changed to not conflict
|
||||
* with PBE_SHA1_DES3 */
|
||||
#define wc_NID_name 173 /* N , OID = 2.5.4.41 */
|
||||
#define wc_NID_surname 0x04 /* SN */
|
||||
#define wc_NID_serialNumber 0x05 /* serialNumber */
|
||||
#define wc_NID_countryName 0x06 /* C */
|
||||
#define wc_NID_localityName 0x07 /* L */
|
||||
#define wc_NID_stateOrProvinceName 0x08 /* ST */
|
||||
#define wc_NID_streetAddress ASN_STREET_ADDR /* street */
|
||||
#define wc_NID_organizationName 0x0a /* O */
|
||||
#define wc_NID_organizationalUnitName 0x0b /* OU */
|
||||
#define wc_NID_jurisdictionCountryName 0xc
|
||||
#define wc_NID_jurisdictionStateOrProvinceName 0xd
|
||||
#define wc_NID_businessCategory ASN_BUS_CAT
|
||||
#define wc_NID_domainComponent ASN_DOMAIN_COMPONENT
|
||||
#define wc_NID_postalCode ASN_POSTAL_CODE /* postalCode */
|
||||
#define wc_NID_favouriteDrink 462
|
||||
#define wc_NID_userId 458
|
||||
#define wc_NID_emailAddress 0x30 /* emailAddress */
|
||||
#define wc_NID_id_on_dnsSRV 82 /* 1.3.6.1.5.5.7.8.7 */
|
||||
#define wc_NID_ms_upn 265 /* 1.3.6.1.4.1.311.20.2.3 */
|
||||
#define WC_NID_name 173 /* N , OID = 2.5.4.41 */
|
||||
#define WC_NID_surname 0x04 /* SN */
|
||||
#define WC_NID_serialNumber 0x05 /* serialNumber */
|
||||
#define WC_NID_countryName 0x06 /* C */
|
||||
#define WC_NID_localityName 0x07 /* L */
|
||||
#define WC_NID_stateOrProvinceName 0x08 /* ST */
|
||||
#define WC_NID_streetAddress ASN_STREET_ADDR /* street */
|
||||
#define WC_NID_organizationName 0x0a /* O */
|
||||
#define WC_NID_organizationalUnitName 0x0b /* OU */
|
||||
#define WC_NID_jurisdictionCountryName 0xc
|
||||
#define WC_NID_jurisdictionStateOrProvinceName 0xd
|
||||
#define WC_NID_businessCategory ASN_BUS_CAT
|
||||
#define WC_NID_domainComponent ASN_DOMAIN_COMPONENT
|
||||
#define WC_NID_postalCode ASN_POSTAL_CODE /* postalCode */
|
||||
#define WC_NID_favouriteDrink 462
|
||||
#define WC_NID_userId 458
|
||||
#define WC_NID_emailAddress 0x30 /* emailAddress */
|
||||
#define WC_NID_id_on_dnsSRV 82 /* 1.3.6.1.5.5.7.8.7 */
|
||||
#define WC_NID_ms_upn 265 /* 1.3.6.1.4.1.311.20.2.3 */
|
||||
|
||||
#define wc_NID_X9_62_prime_field 406 /* 1.2.840.10045.1.1 */
|
||||
#define WC_NID_X9_62_prime_field 406 /* 1.2.840.10045.1.1 */
|
||||
|
||||
#define wc_NID_id_GostR3410_2001 811
|
||||
#define wc_NID_id_GostR3410_2012_256 979
|
||||
#define wc_NID_id_GostR3410_2012_512 980
|
||||
#define WC_NID_id_GostR3410_2001 811
|
||||
#define WC_NID_id_GostR3410_2012_256 979
|
||||
#define WC_NID_id_GostR3410_2012_512 980
|
||||
|
||||
#ifndef OPENSSL_COEXIST
|
||||
|
||||
#define NID_undef wc_NID_undef
|
||||
#define NID_netscape_cert_type wc_NID_netscape_cert_type
|
||||
#define NID_des wc_NID_des
|
||||
#define NID_des3 wc_NID_des3
|
||||
#define NID_sha256 wc_NID_sha256
|
||||
#define NID_sha384 wc_NID_sha384
|
||||
#define NID_sha512 wc_NID_sha512
|
||||
#define NID_sha512_224 wc_NID_sha512_224
|
||||
#define NID_sha512_256 wc_NID_sha512_256
|
||||
#define NID_pkcs7_signed wc_NID_pkcs7_signed
|
||||
#define NID_pkcs7_enveloped wc_NID_pkcs7_enveloped
|
||||
#define NID_pkcs7_signedAndEnveloped wc_NID_pkcs7_signedAndEnveloped
|
||||
#define NID_pkcs9_unstructuredName wc_NID_pkcs9_unstructuredName
|
||||
#define NID_pkcs9_contentType wc_NID_pkcs9_contentType
|
||||
#define NID_pkcs9_challengePassword wc_NID_pkcs9_challengePassword
|
||||
#define NID_hw_name_oid wc_NID_hw_name_oid
|
||||
#define NID_id_pkix_OCSP_basic wc_NID_id_pkix_OCSP_basic
|
||||
#define NID_any_policy wc_NID_any_policy
|
||||
#define NID_anyExtendedKeyUsage wc_NID_anyExtendedKeyUsage
|
||||
#define NID_givenName wc_NID_givenName
|
||||
#define NID_initials wc_NID_initials
|
||||
#define NID_title wc_NID_title
|
||||
#define NID_description wc_NID_description
|
||||
#define NID_basic_constraints wc_NID_basic_constraints
|
||||
#define NID_key_usage wc_NID_key_usage
|
||||
#define NID_ext_key_usage wc_NID_ext_key_usage
|
||||
#define NID_subject_key_identifier wc_NID_subject_key_identifier
|
||||
#define NID_authority_key_identifier wc_NID_authority_key_identifier
|
||||
#define NID_private_key_usage_period wc_NID_private_key_usage_period
|
||||
#define NID_subject_alt_name wc_NID_subject_alt_name
|
||||
#define NID_issuer_alt_name wc_NID_issuer_alt_name
|
||||
#define NID_info_access wc_NID_info_access
|
||||
#define NID_sinfo_access wc_NID_sinfo_access
|
||||
#define NID_name_constraints wc_NID_name_constraints
|
||||
#define NID_crl_distribution_points wc_NID_crl_distribution_points
|
||||
#define NID_certificate_policies wc_NID_certificate_policies
|
||||
#define NID_policy_mappings wc_NID_policy_mappings
|
||||
#define NID_policy_constraints wc_NID_policy_constraints
|
||||
#define NID_inhibit_any_policy wc_NID_inhibit_any_policy
|
||||
#define NID_tlsfeature wc_NID_tlsfeature
|
||||
#define NID_buildingName wc_NID_buildingName
|
||||
#define NID_undef WC_NID_undef
|
||||
#define NID_netscape_cert_type WC_NID_netscape_cert_type
|
||||
#define NID_des WC_NID_des
|
||||
#define NID_des3 WC_NID_des3
|
||||
#define NID_sha256 WC_NID_sha256
|
||||
#define NID_sha384 WC_NID_sha384
|
||||
#define NID_sha512 WC_NID_sha512
|
||||
#define NID_sha512_224 WC_NID_sha512_224
|
||||
#define NID_sha512_256 WC_NID_sha512_256
|
||||
#define NID_pkcs7_signed WC_NID_pkcs7_signed
|
||||
#define NID_pkcs7_enveloped WC_NID_pkcs7_enveloped
|
||||
#define NID_pkcs7_signedAndEnveloped WC_NID_pkcs7_signedAndEnveloped
|
||||
#define NID_pkcs9_unstructuredName WC_NID_pkcs9_unstructuredName
|
||||
#define NID_pkcs9_contentType WC_NID_pkcs9_contentType
|
||||
#define NID_pkcs9_challengePassword WC_NID_pkcs9_challengePassword
|
||||
#define NID_hw_name_oid WC_NID_hw_name_oid
|
||||
#define NID_id_pkix_OCSP_basic WC_NID_id_pkix_OCSP_basic
|
||||
#define NID_any_policy WC_NID_any_policy
|
||||
#define NID_anyExtendedKeyUsage WC_NID_anyExtendedKeyUsage
|
||||
#define NID_givenName WC_NID_givenName
|
||||
#define NID_initials WC_NID_initials
|
||||
#define NID_title WC_NID_title
|
||||
#define NID_description WC_NID_description
|
||||
#define NID_basic_constraints WC_NID_basic_constraints
|
||||
#define NID_key_usage WC_NID_key_usage
|
||||
#define NID_ext_key_usage WC_NID_ext_key_usage
|
||||
#define NID_subject_key_identifier WC_NID_subject_key_identifier
|
||||
#define NID_authority_key_identifier WC_NID_authority_key_identifier
|
||||
#define NID_private_key_usage_period WC_NID_private_key_usage_period
|
||||
#define NID_subject_alt_name WC_NID_subject_alt_name
|
||||
#define NID_issuer_alt_name WC_NID_issuer_alt_name
|
||||
#define NID_info_access WC_NID_info_access
|
||||
#define NID_sinfo_access WC_NID_sinfo_access
|
||||
#define NID_name_constraints WC_NID_name_constraints
|
||||
#define NID_crl_distribution_points WC_NID_crl_distribution_points
|
||||
#define NID_certificate_policies WC_NID_certificate_policies
|
||||
#define NID_policy_mappings WC_NID_policy_mappings
|
||||
#define NID_policy_constraints WC_NID_policy_constraints
|
||||
#define NID_inhibit_any_policy WC_NID_inhibit_any_policy
|
||||
#define NID_tlsfeature WC_NID_tlsfeature
|
||||
#define NID_buildingName WC_NID_buildingName
|
||||
|
||||
#define NID_dnQualifier wc_NID_dnQualifier
|
||||
#define NID_commonName wc_NID_commonName
|
||||
#define NID_name wc_NID_name
|
||||
#define NID_surname wc_NID_surname
|
||||
#define NID_serialNumber wc_NID_serialNumber
|
||||
#define NID_countryName wc_NID_countryName
|
||||
#define NID_localityName wc_NID_localityName
|
||||
#define NID_stateOrProvinceName wc_NID_stateOrProvinceName
|
||||
#define NID_streetAddress wc_NID_streetAddress
|
||||
#define NID_organizationName wc_NID_organizationName
|
||||
#define NID_organizationalUnitName wc_NID_organizationalUnitName
|
||||
#define NID_jurisdictionCountryName wc_NID_jurisdictionCountryName
|
||||
#define NID_jurisdictionStateOrProvinceName wc_NID_jurisdictionStateOrProvinceName
|
||||
#define NID_businessCategory wc_NID_businessCategory
|
||||
#define NID_domainComponent wc_NID_domainComponent
|
||||
#define NID_postalCode wc_NID_postalCode
|
||||
#define NID_favouriteDrink wc_NID_favouriteDrink
|
||||
#define NID_userId wc_NID_userId
|
||||
#define NID_emailAddress wc_NID_emailAddress
|
||||
#define NID_id_on_dnsSRV wc_NID_id_on_dnsSRV
|
||||
#define NID_ms_upn wc_NID_ms_upn
|
||||
#define NID_dnQualifier WC_NID_dnQualifier
|
||||
#define NID_commonName WC_NID_commonName
|
||||
#define NID_name WC_NID_name
|
||||
#define NID_surname WC_NID_surname
|
||||
#define NID_serialNumber WC_NID_serialNumber
|
||||
#define NID_countryName WC_NID_countryName
|
||||
#define NID_localityName WC_NID_localityName
|
||||
#define NID_stateOrProvinceName WC_NID_stateOrProvinceName
|
||||
#define NID_streetAddress WC_NID_streetAddress
|
||||
#define NID_organizationName WC_NID_organizationName
|
||||
#define NID_organizationalUnitName WC_NID_organizationalUnitName
|
||||
#define NID_jurisdictionCountryName WC_NID_jurisdictionCountryName
|
||||
#define NID_jurisdictionStateOrProvinceName WC_NID_jurisdictionStateOrProvinceName
|
||||
#define NID_businessCategory WC_NID_businessCategory
|
||||
#define NID_domainComponent WC_NID_domainComponent
|
||||
#define NID_postalCode WC_NID_postalCode
|
||||
#define NID_favouriteDrink WC_NID_favouriteDrink
|
||||
#define NID_userId WC_NID_userId
|
||||
#define NID_emailAddress WC_NID_emailAddress
|
||||
#define NID_id_on_dnsSRV WC_NID_id_on_dnsSRV
|
||||
#define NID_ms_upn WC_NID_ms_upn
|
||||
|
||||
#define NID_X9_62_prime_field wc_NID_X9_62_prime_field
|
||||
#define NID_X9_62_prime_field WC_NID_X9_62_prime_field
|
||||
|
||||
#define NID_id_GostR3410_2001 wc_NID_id_GostR3410_2001
|
||||
#define NID_id_GostR3410_2012_256 wc_NID_id_GostR3410_2012_256
|
||||
#define NID_id_GostR3410_2012_512 wc_NID_id_GostR3410_2012_512
|
||||
#define NID_id_GostR3410_2001 WC_NID_id_GostR3410_2001
|
||||
#define NID_id_GostR3410_2012_256 WC_NID_id_GostR3410_2012_256
|
||||
#define NID_id_GostR3410_2012_512 WC_NID_id_GostR3410_2012_512
|
||||
|
||||
#endif /* !OPENSSL_COEXIST */
|
||||
|
||||
|
|
|
@ -3605,6 +3605,15 @@ extern void uITRON4_free(void *p) ;
|
|||
#endif
|
||||
#endif
|
||||
|
||||
/* if building the library proper without OPENSSL_ALL, always disable
|
||||
* compatibility mappings -- the library proper uses only native names
|
||||
* internally.
|
||||
*/
|
||||
#if defined(BUILDING_WOLFSSL) && !defined(OPENSSL_ALL) \
|
||||
&& !defined(OPENSSL_COEXIST)
|
||||
#define OPENSSL_COEXIST
|
||||
#endif
|
||||
|
||||
#ifdef OPENSSL_COEXIST
|
||||
/* make sure old names are disabled */
|
||||
#ifndef NO_OLD_SSL_NAMES
|
||||
|
|
Loading…
Reference in New Issue