expand functions included in opensslextra and add REQ print out

This commit is contained in:
Jacob Barthelmeh
2022-06-03 15:32:58 -06:00
committed by JacobBarthelmeh
parent 4602e6d892
commit 52b80ea52a
5 changed files with 545 additions and 882 deletions

View File

@@ -11101,7 +11101,7 @@ static int CopyREQAttributes(WOLFSSL_X509* x509, DecodedCert* dCert)
if (dCert->cPwdLen < CTC_NAME_SIZE) {
XMEMCPY(x509->challengePw, dCert->cPwd, dCert->cPwdLen);
x509->challengePw[dCert->cPwdLen] = '\0';
#ifdef OPENSSL_ALL
#if defined(OPENSSL_ALL) && defined(WOLFSSL_CERT_GEN)
if (wolfSSL_X509_REQ_add1_attr_by_NID(x509,
NID_pkcs9_challengePassword,
MBSTRING_ASC,
@@ -11122,7 +11122,7 @@ static int CopyREQAttributes(WOLFSSL_X509* x509, DecodedCert* dCert)
XMEMCPY(x509->contentType, dCert->contentType, dCert->contentTypeLen);
x509->contentType[dCert->contentTypeLen] = '\0';
}
#ifdef OPENSSL_ALL
#if defined(OPENSSL_ALL) && defined(WOLFSSL_CERT_GEN)
if (wolfSSL_X509_REQ_add1_attr_by_NID(x509,
NID_pkcs9_contentType,
MBSTRING_ASC,
@@ -11134,7 +11134,7 @@ static int CopyREQAttributes(WOLFSSL_X509* x509, DecodedCert* dCert)
#endif
}
#ifdef OPENSSL_ALL
#if defined(OPENSSL_ALL) && defined(WOLFSSL_CERT_GEN)
if (dCert->sNum) {
if (wolfSSL_X509_REQ_add1_attr_by_NID(x509,
NID_serialNumber,
@@ -11366,8 +11366,6 @@ int CopyDecodedToX509(WOLFSSL_X509* x509, DecodedCert* dCert)
x509->altNames = dCert->altNames;
dCert->weOwnAltNames = 0;
x509->altNamesNext = x509->altNames; /* index hint */
#if (defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)) && \
!defined(IGNORE_NAME_CONSTRAINTS)
/* add copies of email names from dCert to X509 */
@@ -11383,6 +11381,7 @@ int CopyDecodedToX509(WOLFSSL_X509* x509, DecodedCert* dCert)
return MEMORY_E;
}
#endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
x509->altNamesNext = x509->altNames; /* index hint */
x509->isCa = dCert->isCA;
#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)

1401
src/x509.c

File diff suppressed because it is too large Load Diff

View File

@@ -52429,9 +52429,9 @@ static int test_wolfSSL_X509_print(void)
#if defined(OPENSSL_ALL) || defined(WOLFSSL_IP_ALT_NAME)
/* Will print IP address subject alt name. */
AssertIntEQ(BIO_get_mem_data(bio, NULL), 3341);
AssertIntEQ(BIO_get_mem_data(bio, NULL), 3240);
#else
AssertIntEQ(BIO_get_mem_data(bio, NULL), 3319);
AssertIntEQ(BIO_get_mem_data(bio, NULL), 3218);
#endif
BIO_free(bio);

View File

@@ -4117,12 +4117,12 @@ struct WOLFSSL_X509 {
int hwSerialNumSz;
byte hwSerialNum[EXTERNAL_SERIAL_SIZE];
#endif /* WOLFSSL_SEP */
#if (defined(WOLFSSL_SEP) || defined(WOLFSSL_QT) || defined (OPENSSL_ALL)) && \
#if (defined(WOLFSSL_SEP) || defined(WOLFSSL_QT) || defined (OPENSSL_EXTRA)) && \
(defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL))
byte certPolicySet;
byte certPolicyCrit;
#endif /* (WOLFSSL_SEP || WOLFSSL_QT) && (OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL) */
#if defined(WOLFSSL_QT) || defined(OPENSSL_ALL)
#if defined(WOLFSSL_QT) || defined(OPENSSL_EXTRA)
WOLFSSL_STACK* ext_sk; /* Store X509_EXTENSIONS from wolfSSL_X509_get_ext */
WOLFSSL_STACK* ext_sk_full; /* Store X509_EXTENSIONS from wolfSSL_X509_get0_extensions */
WOLFSSL_STACK* ext_d2i;/* Store d2i extensions from wolfSSL_X509_get_ext_d2i */
@@ -4172,7 +4172,7 @@ struct WOLFSSL_X509 {
byte* rawCRLInfo;
byte* CRLInfo;
byte* authInfo;
#if defined(OPENSSL_ALL) || defined(WOLFSSL_QT)
#if defined(OPENSSL_EXTRA) || defined(WOLFSSL_QT)
byte* authInfoCaIssuer;
int authInfoCaIssuerSz;
#endif

View File

@@ -323,7 +323,7 @@ struct WOLFSSL_ASN1_OBJECT {
int grp; /* type of OID, i.e. oidCertPolicyType */
int nid;
unsigned int objSz;
#if defined(OPENSSL_ALL) || defined(WOLFSSL_QT) || defined(WOLFSSL_APACHE_HTTPD)
#if defined(OPENSSL_EXTRA) || defined(WOLFSSL_QT) || defined(WOLFSSL_APACHE_HTTPD)
int ca;
WOLFSSL_ASN1_INTEGER *pathlen;
#endif
@@ -1413,7 +1413,7 @@ WOLFSSL_API int wolfSSL_sk_push(WOLFSSL_STACK *st, const void *data);
#include "wolfssl/wolfcrypt/asn.h"
#endif
#if defined(OPENSSL_ALL) || defined(WOLFSSL_QT)
#if defined(OPENSSL_EXTRA) || defined(WOLFSSL_QT)
WOLFSSL_API int wolfSSL_sk_ACCESS_DESCRIPTION_push(
WOLF_STACK_OF(ACCESS_DESCRIPTION)* sk,
WOLFSSL_ACCESS_DESCRIPTION* a);
@@ -1745,6 +1745,7 @@ WOLFSSL_API int wolfSSL_X509_signature_print(WOLFSSL_BIO *bp,
WOLFSSL_API void wolfSSL_X509_get0_signature(const WOLFSSL_ASN1_BIT_STRING **psig,
const WOLFSSL_X509_ALGOR **palg, const WOLFSSL_X509 *x509);
WOLFSSL_API int wolfSSL_X509_print(WOLFSSL_BIO* bio, WOLFSSL_X509* x509);
WOLFSSL_API int wolfSSL_X509_REQ_print(WOLFSSL_BIO* bio, WOLFSSL_X509* x509);
WOLFSSL_ABI WOLFSSL_API char* wolfSSL_X509_NAME_oneline(WOLFSSL_X509_NAME* name,
char* in, int sz);
WOLFSSL_API unsigned long wolfSSL_X509_NAME_hash(WOLFSSL_X509_NAME* name);
@@ -4157,7 +4158,7 @@ WOLFSSL_API int wolfSSL_use_RSAPrivateKey_ASN1(WOLFSSL* ssl, unsigned char* der,
WOLFSSL_API int wolfSSL_CTX_use_PrivateKey_ASN1(int pri, WOLFSSL_CTX* ctx,
unsigned char* der, long derSz);
#if defined(WOLFSSL_QT) || defined(OPENSSL_ALL)
#if defined(WOLFSSL_QT) || defined(OPENSSL_EXTRA)
WOLFSSL_API int wolfSSL_X509_cmp(const WOLFSSL_X509* a, const WOLFSSL_X509* b);
WOLFSSL_API const WOLFSSL_STACK *wolfSSL_X509_get0_extensions(const WOLFSSL_X509 *x);
WOLFSSL_API const WOLFSSL_STACK *wolfSSL_X509_REQ_get_extensions(const WOLFSSL_X509 *x);