|
|
|
@ -6594,16 +6594,16 @@ static int DecodeRsaPssParams(const byte* params, word32 sz,
|
|
|
|
|
defined(WOLFSSL_KCAPI_RSA) || defined(WOLFSSL_SE050)))
|
|
|
|
|
/* Byte offset of numbers in RSA key. */
|
|
|
|
|
size_t rsaIntOffset[] = {
|
|
|
|
|
OFFSETOF(RsaKey, n),
|
|
|
|
|
OFFSETOF(RsaKey, e),
|
|
|
|
|
WC_OFFSETOF(RsaKey, n),
|
|
|
|
|
WC_OFFSETOF(RsaKey, e),
|
|
|
|
|
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
|
|
|
|
|
OFFSETOF(RsaKey, d),
|
|
|
|
|
OFFSETOF(RsaKey, p),
|
|
|
|
|
OFFSETOF(RsaKey, q),
|
|
|
|
|
WC_OFFSETOF(RsaKey, d),
|
|
|
|
|
WC_OFFSETOF(RsaKey, p),
|
|
|
|
|
WC_OFFSETOF(RsaKey, q),
|
|
|
|
|
#if defined(WOLFSSL_KEY_GEN) || defined(OPENSSL_EXTRA) || !defined(RSA_LOW_MEM)
|
|
|
|
|
OFFSETOF(RsaKey, dP),
|
|
|
|
|
OFFSETOF(RsaKey, dQ),
|
|
|
|
|
OFFSETOF(RsaKey, u)
|
|
|
|
|
WC_OFFSETOF(RsaKey, dP),
|
|
|
|
|
WC_OFFSETOF(RsaKey, dQ),
|
|
|
|
|
WC_OFFSETOF(RsaKey, u)
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
};
|
|
|
|
@ -13097,13 +13097,13 @@ static const CertNameData certNameSubject[] = {
|
|
|
|
|
{
|
|
|
|
|
"/CN=", 4,
|
|
|
|
|
#if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
|
|
|
|
|
OFFSETOF(DecodedCert, subjectCN),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectCNLen),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectCNEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectCN),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectCNLen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectCNEnc),
|
|
|
|
|
#ifdef WOLFSSL_HAVE_ISSUER_NAMES
|
|
|
|
|
OFFSETOF(DecodedCert, issuerCN),
|
|
|
|
|
OFFSETOF(DecodedCert, issuerCNLen),
|
|
|
|
|
OFFSETOF(DecodedCert, issuerCNEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerCN),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerCNLen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerCNEnc),
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
|
|
|
@ -13114,13 +13114,13 @@ static const CertNameData certNameSubject[] = {
|
|
|
|
|
{
|
|
|
|
|
"/SN=", 4,
|
|
|
|
|
#if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
|
|
|
|
|
OFFSETOF(DecodedCert, subjectSN),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectSNLen),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectSNEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectSN),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectSNLen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectSNEnc),
|
|
|
|
|
#ifdef WOLFSSL_HAVE_ISSUER_NAMES
|
|
|
|
|
OFFSETOF(DecodedCert, issuerSN),
|
|
|
|
|
OFFSETOF(DecodedCert, issuerSNLen),
|
|
|
|
|
OFFSETOF(DecodedCert, issuerSNEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerSN),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerSNLen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerSNEnc),
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
|
|
|
@ -13131,13 +13131,13 @@ static const CertNameData certNameSubject[] = {
|
|
|
|
|
{
|
|
|
|
|
"/serialNumber=", 14,
|
|
|
|
|
#if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
|
|
|
|
|
OFFSETOF(DecodedCert, subjectSND),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectSNDLen),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectSNDEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectSND),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectSNDLen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectSNDEnc),
|
|
|
|
|
#ifdef WOLFSSL_HAVE_ISSUER_NAMES
|
|
|
|
|
OFFSETOF(DecodedCert, issuerSND),
|
|
|
|
|
OFFSETOF(DecodedCert, issuerSNDLen),
|
|
|
|
|
OFFSETOF(DecodedCert, issuerSNDEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerSND),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerSNDLen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerSNDEnc),
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
|
|
|
@ -13148,13 +13148,13 @@ static const CertNameData certNameSubject[] = {
|
|
|
|
|
{
|
|
|
|
|
"/C=", 3,
|
|
|
|
|
#if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
|
|
|
|
|
OFFSETOF(DecodedCert, subjectC),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectCLen),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectCEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectC),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectCLen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectCEnc),
|
|
|
|
|
#ifdef WOLFSSL_HAVE_ISSUER_NAMES
|
|
|
|
|
OFFSETOF(DecodedCert, issuerC),
|
|
|
|
|
OFFSETOF(DecodedCert, issuerCLen),
|
|
|
|
|
OFFSETOF(DecodedCert, issuerCEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerC),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerCLen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerCEnc),
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
|
|
|
@ -13165,13 +13165,13 @@ static const CertNameData certNameSubject[] = {
|
|
|
|
|
{
|
|
|
|
|
"/L=", 3,
|
|
|
|
|
#if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
|
|
|
|
|
OFFSETOF(DecodedCert, subjectL),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectLLen),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectLEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectL),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectLLen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectLEnc),
|
|
|
|
|
#ifdef WOLFSSL_HAVE_ISSUER_NAMES
|
|
|
|
|
OFFSETOF(DecodedCert, issuerL),
|
|
|
|
|
OFFSETOF(DecodedCert, issuerLLen),
|
|
|
|
|
OFFSETOF(DecodedCert, issuerLEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerL),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerLLen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerLEnc),
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
|
|
|
@ -13182,13 +13182,13 @@ static const CertNameData certNameSubject[] = {
|
|
|
|
|
{
|
|
|
|
|
"/ST=", 4,
|
|
|
|
|
#if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
|
|
|
|
|
OFFSETOF(DecodedCert, subjectST),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectSTLen),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectSTEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectST),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectSTLen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectSTEnc),
|
|
|
|
|
#ifdef WOLFSSL_HAVE_ISSUER_NAMES
|
|
|
|
|
OFFSETOF(DecodedCert, issuerST),
|
|
|
|
|
OFFSETOF(DecodedCert, issuerSTLen),
|
|
|
|
|
OFFSETOF(DecodedCert, issuerSTEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerST),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerSTLen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerSTEnc),
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
|
|
|
@ -13199,9 +13199,9 @@ static const CertNameData certNameSubject[] = {
|
|
|
|
|
{
|
|
|
|
|
"/street=", 8,
|
|
|
|
|
#if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
|
|
|
|
|
OFFSETOF(DecodedCert, subjectStreet),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectStreetLen),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectStreetEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectStreet),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectStreetLen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectStreetEnc),
|
|
|
|
|
#ifdef WOLFSSL_HAVE_ISSUER_NAMES
|
|
|
|
|
0,
|
|
|
|
|
0,
|
|
|
|
@ -13216,13 +13216,13 @@ static const CertNameData certNameSubject[] = {
|
|
|
|
|
{
|
|
|
|
|
"/O=", 3,
|
|
|
|
|
#if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
|
|
|
|
|
OFFSETOF(DecodedCert, subjectO),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectOLen),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectOEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectO),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectOLen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectOEnc),
|
|
|
|
|
#ifdef WOLFSSL_HAVE_ISSUER_NAMES
|
|
|
|
|
OFFSETOF(DecodedCert, issuerO),
|
|
|
|
|
OFFSETOF(DecodedCert, issuerOLen),
|
|
|
|
|
OFFSETOF(DecodedCert, issuerOEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerO),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerOLen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerOEnc),
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
|
|
|
@ -13233,13 +13233,13 @@ static const CertNameData certNameSubject[] = {
|
|
|
|
|
{
|
|
|
|
|
"/OU=", 4,
|
|
|
|
|
#if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
|
|
|
|
|
OFFSETOF(DecodedCert, subjectOU),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectOULen),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectOUEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectOU),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectOULen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectOUEnc),
|
|
|
|
|
#ifdef WOLFSSL_HAVE_ISSUER_NAMES
|
|
|
|
|
OFFSETOF(DecodedCert, issuerOU),
|
|
|
|
|
OFFSETOF(DecodedCert, issuerOULen),
|
|
|
|
|
OFFSETOF(DecodedCert, issuerOUEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerOU),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerOULen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, issuerOUEnc),
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef WOLFSSL_X509_NAME_AVAILABLE
|
|
|
|
@ -13301,9 +13301,9 @@ static const CertNameData certNameSubject[] = {
|
|
|
|
|
{
|
|
|
|
|
"/businessCategory=", 18,
|
|
|
|
|
#if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
|
|
|
|
|
OFFSETOF(DecodedCert, subjectBC),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectBCLen),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectBCEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectBC),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectBCLen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectBCEnc),
|
|
|
|
|
#ifdef WOLFSSL_HAVE_ISSUER_NAMES
|
|
|
|
|
0,
|
|
|
|
|
0,
|
|
|
|
@ -13335,9 +13335,9 @@ static const CertNameData certNameSubject[] = {
|
|
|
|
|
{
|
|
|
|
|
"/postalCode=", 12,
|
|
|
|
|
#if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
|
|
|
|
|
OFFSETOF(DecodedCert, subjectPC),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectPCLen),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectPCEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectPC),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectPCLen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectPCEnc),
|
|
|
|
|
#ifdef WOLFSSL_HAVE_ISSUER_NAMES
|
|
|
|
|
0,
|
|
|
|
|
0,
|
|
|
|
@ -13352,9 +13352,9 @@ static const CertNameData certNameSubject[] = {
|
|
|
|
|
{
|
|
|
|
|
"/userid=", 8,
|
|
|
|
|
#if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
|
|
|
|
|
OFFSETOF(DecodedCert, subjectUID),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectUIDLen),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectUIDEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectUID),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectUIDLen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectUIDEnc),
|
|
|
|
|
#ifdef WOLFSSL_HAVE_ISSUER_NAMES
|
|
|
|
|
0,
|
|
|
|
|
0,
|
|
|
|
@ -13370,9 +13370,9 @@ static const CertNameData certNameSubject[] = {
|
|
|
|
|
{
|
|
|
|
|
"/N=", 3,
|
|
|
|
|
#if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
|
|
|
|
|
OFFSETOF(DecodedCert, subjectN),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectNLen),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectNEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectN),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectNLen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectNEnc),
|
|
|
|
|
#ifdef WOLFSSL_HAVE_ISSUER_NAMES
|
|
|
|
|
0,
|
|
|
|
|
0,
|
|
|
|
@ -13387,9 +13387,9 @@ static const CertNameData certNameSubject[] = {
|
|
|
|
|
{
|
|
|
|
|
"/GN=", 4,
|
|
|
|
|
#if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
|
|
|
|
|
OFFSETOF(DecodedCert, subjectGN),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectGNLen),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectGNEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectGN),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectGNLen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectGNEnc),
|
|
|
|
|
#ifdef WOLFSSL_HAVE_ISSUER_NAMES
|
|
|
|
|
0,
|
|
|
|
|
0,
|
|
|
|
@ -13404,9 +13404,9 @@ static const CertNameData certNameSubject[] = {
|
|
|
|
|
{
|
|
|
|
|
"/initials=", 10,
|
|
|
|
|
#if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
|
|
|
|
|
OFFSETOF(DecodedCert, subjectI),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectILen),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectIEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectI),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectILen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectIEnc),
|
|
|
|
|
#ifdef WOLFSSL_HAVE_ISSUER_NAMES
|
|
|
|
|
0,
|
|
|
|
|
0,
|
|
|
|
@ -13421,9 +13421,9 @@ static const CertNameData certNameSubject[] = {
|
|
|
|
|
{
|
|
|
|
|
"/dnQualifier=", 13,
|
|
|
|
|
#if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
|
|
|
|
|
OFFSETOF(DecodedCert, subjectDNQ),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectDNQLen),
|
|
|
|
|
OFFSETOF(DecodedCert, subjectDNQEnc),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectDNQ),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectDNQLen),
|
|
|
|
|
WC_OFFSETOF(DecodedCert, subjectDNQEnc),
|
|
|
|
|
#ifdef WOLFSSL_HAVE_ISSUER_NAMES
|
|
|
|
|
0,
|
|
|
|
|
0,
|
|
|
|
|