FreeRTOS-Plus/ThirdParty/WolfSSL-FIPS-Ready/wolfcrypt/src/asn.c
/* write DER encoded cert to buffer, size already checked */
write DER encoded cert to buffer, size already checked
write DER encoded cert to buffer size already checked
static int WriteCertBody(DerCert* der, byte* buf)
{
    int idx;
    idx = SetSequence(der->total, buf);
    XMEMCPY(buf + idx, der->version, der->versionSz);
    idx += der->versionSz;
    XMEMCPY(buf + idx, der->serial, der->serialSz);
    idx += der->serialSz;
    XMEMCPY(buf + idx, der->sigAlgo, der->sigAlgoSz);
    idx += der->sigAlgoSz;
    XMEMCPY(buf + idx, der->issuer, der->issuerSz);
    idx += der->issuerSz;
    XMEMCPY(buf + idx, der->validity, der->validitySz);
    idx += der->validitySz;
    XMEMCPY(buf + idx, der->subject, der->subjectSz);
    idx += der->subjectSz;
    XMEMCPY(buf + idx, der->publicKey, der->publicKeySz);
    idx += der->publicKeySz;
    if (der->extensionsSz) {
        XMEMCPY(buf + idx, der->extensions, min(der->extensionsSz,
                                                   (int)sizeof(der->extensions)));
        idx += der->extensionsSz;
    }
    return idx;
}
static int WriteCertBody ( DerCert * der , byte * buf ) { int idx ; idx = SetSequence ( der -> total , buf ) ; XMEMCPY ( buf + idx , der -> version , der -> versionSz ) ; idx += der -> versionSz ; XMEMCPY ( buf + idx , der -> serial , der -> serialSz ) ; idx += der -> serialSz ; XMEMCPY ( buf + idx , der -> sigAlgo , der -> sigAlgoSz ) ; idx += der -> sigAlgoSz ; XMEMCPY ( buf + idx , der -> issuer , der -> issuerSz ) ; idx += der -> issuerSz ; XMEMCPY ( buf + idx , der -> validity , der -> validitySz ) ; idx += der -> validitySz ; XMEMCPY ( buf + idx , der -> subject , der -> subjectSz ) ; idx += der -> subjectSz ; XMEMCPY ( buf + idx , der -> publicKey , der -> publicKeySz ) ; idx += der -> publicKeySz ; if ( der -> extensionsSz ) { XMEMCPY ( buf + idx , der -> extensions , min ( der -> extensionsSz , ( int ) sizeof ( der -> extensions ) ) ) ; idx += der -> extensionsSz ; } return idx ; }
write DER encoded cert to buffer, size already checked
write DER encoded cert to buffer size already checked
/* signed part header */ /* version */ /* serial */ /* sig algo */ /* issuer */ /* validity */ /* subject */ /* public key */ /* extensions */