FreeRTOS-Plus/ThirdParty/WolfSSL-FIPS-Ready/wolfcrypt/src/asn.c
/* encode OID and associated value, return total bytes written */
encode OID and associated value, return total bytes written
encode OID and associated value return total bytes written
static int SetOidValue(byte* out, word32 outSz, const byte *oid, word32 oidSz,
                       byte *in, word32 inSz)
{
    int idx = 0;
    if (out == NULL || oid == NULL || in == NULL)
        return BAD_FUNC_ARG;
    if (outSz < 3)
        return BUFFER_E;
    idx = SetSequence(inSz + oidSz + 1, out);
    if ((idx + inSz + oidSz + 1) > outSz)
        return BUFFER_E;
    XMEMCPY(out+idx, oid, oidSz);
    idx += oidSz;
    out[idx++] = (byte)inSz;
    XMEMCPY(out+idx, in, inSz);
    return (idx+inSz);
}
static int SetOidValue ( byte * out , word32 outSz , const byte * oid , word32 oidSz , byte * in , word32 inSz ) { int idx = 0 ; if ( out == NULL || oid == NULL || in == NULL ) return BAD_FUNC_ARG ; if ( outSz < 3 ) return BUFFER_E ; idx = SetSequence ( inSz + oidSz + 1 , out ) ; if ( ( idx + inSz + oidSz + 1 ) > outSz ) return BUFFER_E ; XMEMCPY ( out + idx , oid , oidSz ) ; idx += oidSz ; out [ idx ++ ] = ( byte ) inSz ; XMEMCPY ( out + idx , in , inSz ) ; return ( idx + inSz ) ; }
encode OID and associated value, return total bytes written
encode OID and associated value return total bytes written
/* sequence,  + 1 => byte to put value size */