FreeRTOS-Plus/ThirdParty/WolfSSL-FIPS-Ready/wolfcrypt/src/asn.c
/* parses certificate up to point of X.509 public key
 *
 * if cert date is invalid then badDate gets set to error value, otherwise is 0
 *
 * returns a negative value on fail case
 */
parses certificate up to point of X.509 public key
if cert date is invalid then badDate gets set to error value, otherwise is 0

returns a negative value on fail case
parses certificate up to point of X . 509 public key if cert date is invalid then badDate gets set to error value otherwise is 0 returns a negative value on fail case
int wc_GetPubX509(DecodedCert* cert, int verify, int* badDate)
{
    int ret;
    if (cert == NULL || badDate == NULL)
        return BAD_FUNC_ARG;
    *badDate = 0;
    if ( (ret = GetCertHeader(cert)) < 0)
        return ret;
    WOLFSSL_MSG("Got Cert Header");
    if ( (ret = GetAlgoId(cert->source, &cert->srcIdx, &cert->signatureOID,
                          oidSigType, cert->sigIndex)) < 0)
        return ret;
    WOLFSSL_MSG("Got Algo ID");
    if ( (ret = GetName(cert, ISSUER, cert->sigIndex)) < 0)
        return ret;
    if ( (ret = GetValidity(cert, verify, cert->sigIndex)) < 0)
        *badDate = ret;
    if ( (ret = GetName(cert, SUBJECT, cert->sigIndex)) < 0)
        return ret;
    WOLFSSL_MSG("Got Subject Name");
    return ret;
}
int wc_GetPubX509 ( DecodedCert * cert , int verify , int * badDate ) { int ret ; if ( cert == NULL || badDate == NULL ) return BAD_FUNC_ARG ; * badDate = 0 ; if ( ( ret = GetCertHeader ( cert ) ) < 0 ) return ret ; WOLFSSL_MSG ( " " ) ; if ( ( ret = GetAlgoId ( cert -> source , & cert -> srcIdx , & cert -> signatureOID , oidSigType , cert -> sigIndex ) ) < 0 ) return ret ; WOLFSSL_MSG ( " " ) ; if ( ( ret = GetName ( cert , ISSUER , cert -> sigIndex ) ) < 0 ) return ret ; if ( ( ret = GetValidity ( cert , verify , cert -> sigIndex ) ) < 0 ) * badDate = ret ; if ( ( ret = GetName ( cert , SUBJECT , cert -> sigIndex ) ) < 0 ) return ret ; WOLFSSL_MSG ( " " ) ; return ret ; }
parses certificate up to point of X.509 public key
 if cert date is invalid then badDate gets set to error value, otherwise is 0
parses certificate up to point of X . 509 public key if cert date is invalid then badDate gets set to error value otherwise is 0
/* Using the sigIndex as the upper bound because that's where the
     * actual certificate data ends. */