FreeRTOS-Plus/ThirdParty/WolfSSL-FIPS-Ready/wolfcrypt/src/asn.c
/* Set cert raw issuer from DER buffer */
Set cert raw issuer from DER buffer
Set cert raw issuer from DER buffer
int wc_SetIssuerRaw(Cert* cert, const byte* der, int derSz)
{
    int ret = 0;
    if (cert == NULL) {
        ret = BAD_FUNC_ARG;
    }
    else {
        if (cert->der != der) {
            ret = wc_SetCert_LoadDer(cert, der, derSz);
        }
        if (ret >= 0) {
            if ((((DecodedCert*)cert->decodedCert)->issuerRaw) &&
                (((DecodedCert*)cert->decodedCert)->issuerRawLen <=
                        (int)sizeof(CertName))) {
                XMEMCPY(cert->issRaw,
                        ((DecodedCert*)cert->decodedCert)->issuerRaw,
                        ((DecodedCert*)cert->decodedCert)->issuerRawLen);
            }
#ifndef WOLFSSL_CERT_GEN_CACHE
            wc_SetCert_Free(cert);
#endif
        }
    }
    return ret;
}
int wc_SetIssuerRaw ( Cert * cert , const byte * der , int derSz ) { int ret = 0 ; if ( cert == NULL ) { ret = BAD_FUNC_ARG ; } else { if ( cert -> der != der ) { ret = wc_SetCert_LoadDer ( cert , der , derSz ) ; } if ( ret >= 0 ) { if ( ( ( ( DecodedCert * ) cert -> decodedCert ) -> issuerRaw ) && ( ( ( DecodedCert * ) cert -> decodedCert ) -> issuerRawLen <= ( int ) sizeof ( CertName ) ) ) { XMEMCPY ( cert -> issRaw , ( ( DecodedCert * ) cert -> decodedCert ) -> issuerRaw , ( ( DecodedCert * ) cert -> decodedCert ) -> issuerRawLen ) ; } #ifndef WOLFSSL_CERT_GEN_CACHE wc_SetCert_Free ( cert ) ; #endif } } return ret ; }
Set cert raw issuer from DER buffer
Set cert raw issuer from DER buffer
/* Check if decodedCert is cached */ /* Allocate cache for the decoded cert */