FreeRTOS-Plus/ThirdParty/WolfSSL-FIPS-Ready/wolfcrypt/src/asn.c
/* write DER encoded cert req to buffer, size already checked */
write DER encoded cert req to buffer, size already checked
write DER encoded cert req to buffer size already checked
static int WriteCertReqBody(DerCert* der, byte* buf)
{
    int idx;
    idx = SetSequence(der->total, buf);
    if (buf)
        XMEMCPY(buf + idx, der->version, der->versionSz);
    idx += der->versionSz;
    if (buf)
        XMEMCPY(buf + idx, der->subject, der->subjectSz);
    idx += der->subjectSz;
    if (buf)
        XMEMCPY(buf + idx, der->publicKey, der->publicKeySz);
    idx += der->publicKeySz;
    if (buf)
        XMEMCPY(buf + idx, der->attrib, der->attribSz);
    idx += der->attribSz;
    if (der->extensionsSz) {
        if (buf)
            XMEMCPY(buf + idx, der->extensions, min(der->extensionsSz,
                                               (int)sizeof(der->extensions)));
        idx += der->extensionsSz;
    }
    return idx;
}
static int WriteCertReqBody ( DerCert * der , byte * buf ) { int idx ; idx = SetSequence ( der -> total , buf ) ; if ( buf ) XMEMCPY ( buf + idx , der -> version , der -> versionSz ) ; idx += der -> versionSz ; if ( buf ) XMEMCPY ( buf + idx , der -> subject , der -> subjectSz ) ; idx += der -> subjectSz ; if ( buf ) XMEMCPY ( buf + idx , der -> publicKey , der -> publicKeySz ) ; idx += der -> publicKeySz ; if ( buf ) XMEMCPY ( buf + idx , der -> attrib , der -> attribSz ) ; idx += der -> attribSz ; if ( der -> extensionsSz ) { if ( buf ) XMEMCPY ( buf + idx , der -> extensions , min ( der -> extensionsSz , ( int ) sizeof ( der -> extensions ) ) ) ; idx += der -> extensionsSz ; } return idx ; }
write DER encoded cert req to buffer, size already checked
write DER encoded cert req to buffer size already checked
/* signed part header */ /* version */ /* subject */ /* public key */ /* attributes */ /* extensions */