FreeRTOS-Plus/ThirdParty/WolfSSL-FIPS-Ready/wolfcrypt/src/asn.c
/*
 * cert structure to set EKU oid in
 * oid  the oid in byte representation
 * sz   size of oid buffer
 * idx  index of array to place oid
 *
 * returns 0 on success
 */
cert structure to set EKU oid in
oid  the oid in byte representation
sz   size of oid buffer
idx  index of array to place oid

returns 0 on success
cert structure to set EKU oid in oid the oid in byte representation sz size of oid buffer idx index of array to place oid returns 0 on success
int wc_SetExtKeyUsageOID(Cert *cert, const char *in, word32 sz, byte idx,
        void* heap)
{
    byte oid[MAX_OID_SZ];
    word32 oidSz = MAX_OID_SZ;
    if (idx >= CTC_MAX_EKU_NB || sz >= CTC_MAX_EKU_OID_SZ) {
        WOLFSSL_MSG("Either idx or sz was too large");
        return BAD_FUNC_ARG;
    }
    if (EncodePolicyOID(oid, &oidSz, in, heap) != 0) {
        return BUFFER_E;
    }
    XMEMCPY(cert->extKeyUsageOID[idx], oid, oidSz);
    cert->extKeyUsageOIDSz[idx] = oidSz;
    cert->extKeyUsage |= EXTKEYUSE_USER;
    return 0;
}
int wc_SetExtKeyUsageOID ( Cert * cert , const char * in , word32 sz , byte idx , void * heap ) { byte oid [ MAX_OID_SZ ] ; word32 oidSz = MAX_OID_SZ ; if ( idx >= CTC_MAX_EKU_NB || sz >= CTC_MAX_EKU_OID_SZ ) { WOLFSSL_MSG ( " " ) ; return BAD_FUNC_ARG ; } if ( EncodePolicyOID ( oid , & oidSz , in , heap ) != 0 ) { return BUFFER_E ; } XMEMCPY ( cert -> extKeyUsageOID [ idx ] , oid , oidSz ) ; cert -> extKeyUsageOIDSz [ idx ] = oidSz ; cert -> extKeyUsage |= EXTKEYUSE_USER ; return 0 ; }
cert structure to set EKU oid in
 oid  the oid in byte representation
 sz   size of oid buffer
 idx  index of array to place oid
cert structure to set EKU oid in oid the oid in byte representation sz size of oid buffer idx index of array to place oid