Merge pull request #1829 from embhorn/zd3928

Make DecodedCert elements available with WOLFSSL_CERT_EXT
This commit is contained in:
David Garske
2018-09-11 14:38:31 -07:00
committed by GitHub
2 changed files with 9 additions and 2 deletions

View File

@ -4264,6 +4264,13 @@ static int GetName(DecodedCert* cert, int nameType)
}
else if (id == ASN_SERIAL_NUMBER) {
copy = WOLFSSL_SERIAL_NUMBER;
#ifdef WOLFSSL_CERT_GEN
if (nameType == SUBJECT) {
cert->subjectSND = (char*)&cert->source[cert->srcIdx];
cert->subjectSNDLen = strLen;
cert->subjectSNDEnc = b;
}
#endif /* WOLFSSL_CERT_GEN */
#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
dName->snIdx = cert->srcIdx;
dName->snLen = strLen;

View File

@ -681,7 +681,7 @@ struct DecodedCert {
byte* subjectRaw; /* pointer to subject inside source */
int subjectRawLen;
#endif
#ifdef WOLFSSL_CERT_GEN
#if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
/* easy access to subject info for other sign */
char* subjectSN;
int subjectSNLen;
@ -733,7 +733,7 @@ struct DecodedCert {
#ifdef WOLFSSL_CERT_EXT
char extCertPolicies[MAX_CERTPOL_NB][MAX_CERTPOL_SZ];
int extCertPoliciesNb;
#endif /* WOLFSSL_CERT_EXT */
#endif /* defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT) */
Signer* ca;
SignatureCtx sigCtx;