src/wolfSSL/src/internal.c
static int DoCertificateRequest(WOLFSSL* ssl, const byte* input, word32*
                                    inOutIdx, word32 size)
    {
        word16 len;
        word32 begin = *inOutIdx;

        #ifdef WOLFSSL_CALLBACKS
            if (ssl->hsInfoOn)
                AddPacketName("CertificateRequest", &ssl->handShakeInfo);
            if (ssl->toInfoOn)
                AddLateName("CertificateRequest", &ssl->timeoutInfo);
        #endif

        if ((*inOutIdx - begin) + OPAQUE8_LEN > size)
            return BUFFER_ERROR;

        len = input[(*inOutIdx)++];

        if ((*inOutIdx - begin) + len > size)
            return BUFFER_ERROR;

        /* types, read in here */
        *inOutIdx += len;

        /* signature and hash signature algorithm */
        if (IsAtLeastTLSv1_2(ssl)) {
            if ((*inOutIdx - begin) + OPAQUE16_LEN > size)
                return BUFFER_ERROR;

            ato16(input + *inOutIdx, &len);
            *inOutIdx += OPAQUE16_LEN;

            if ((*inOutIdx - begin) + len > size)
                return BUFFER_ERROR;

            PickHashSigAlgo(ssl, input + *inOutIdx, len);
            *inOutIdx += len;
        }

        /* authorities */
        if ((*inOutIdx - begin) + OPAQUE16_LEN > size)
            return BUFFER_ERROR;

        ato16(input + *inOutIdx, &len);
        *inOutIdx += OPAQUE16_LEN;

        if ((*inOutIdx - begin) + len > size)
            return BUFFER_ERROR;

        while (len) {
            word16 dnSz;

            if ((*inOutIdx - begin) + OPAQUE16_LEN > size)
                return BUFFER_ERROR;

            ato16(input + *inOutIdx, &dnSz);
            *inOutIdx += OPAQUE16_LEN;

            if ((*inOutIdx - begin) + dnSz > size)
                return BUFFER_ERROR;

            *inOutIdx += dnSz;
            len -= OPAQUE16_LEN + dnSz;
        }

        /* don't send client cert or cert verify if user hasn't provided
           cert and private key */
        if (ssl->buffers.certificate && ssl->buffers.certificate->buffer &&
            ssl->buffers.key && ssl->buffers.key->buffer)
            ssl->options.sendVerify = SEND_CERT;
        else if (IsTLS(ssl))
            ssl->options.sendVerify = SEND_BLANK_CERT;

        if (IsEncryptionOn(ssl, 0))
            *inOutIdx += ssl->keys.padSz;

        return 0;
    }
/* just read in and ignore for now TODO: */
just read in and ignore for now TODO.
just read in and ignore for now TODO .
static int DoCertificateRequest(WOLFSSL* ssl, const byte* input, word32*
                                    inOutIdx, word32 size)
    {
        word16 len;
        word32 begin = *inOutIdx;
        #ifdef WOLFSSL_CALLBACKS
            if (ssl->hsInfoOn)
                AddPacketName("CertificateRequest", &ssl->handShakeInfo);
            if (ssl->toInfoOn)
                AddLateName("CertificateRequest", &ssl->timeoutInfo);
        #endif
        if ((*inOutIdx - begin) + OPAQUE8_LEN > size)
            return BUFFER_ERROR;
        len = input[(*inOutIdx)++];
        if ((*inOutIdx - begin) + len > size)
            return BUFFER_ERROR;
        *inOutIdx += len;
        if (IsAtLeastTLSv1_2(ssl)) {
            if ((*inOutIdx - begin) + OPAQUE16_LEN > size)
                return BUFFER_ERROR;
            ato16(input + *inOutIdx, &len);
            *inOutIdx += OPAQUE16_LEN;
            if ((*inOutIdx - begin) + len > size)
                return BUFFER_ERROR;
            PickHashSigAlgo(ssl, input + *inOutIdx, len);
            *inOutIdx += len;
        }
        if ((*inOutIdx - begin) + OPAQUE16_LEN > size)
            return BUFFER_ERROR;
        ato16(input + *inOutIdx, &len);
        *inOutIdx += OPAQUE16_LEN;
        if ((*inOutIdx - begin) + len > size)
            return BUFFER_ERROR;
        while (len) {
            word16 dnSz;
            if ((*inOutIdx - begin) + OPAQUE16_LEN > size)
                return BUFFER_ERROR;
            ato16(input + *inOutIdx, &dnSz);
            *inOutIdx += OPAQUE16_LEN;
            if ((*inOutIdx - begin) + dnSz > size)
                return BUFFER_ERROR;
            *inOutIdx += dnSz;
            len -= OPAQUE16_LEN + dnSz;
        }
        if (ssl->buffers.certificate && ssl->buffers.certificate->buffer &&
            ssl->buffers.key && ssl->buffers.key->buffer)
            ssl->options.sendVerify = SEND_CERT;
        else if (IsTLS(ssl))
            ssl->options.sendVerify = SEND_BLANK_CERT;
        if (IsEncryptionOn(ssl, 0))
            *inOutIdx += ssl->keys.padSz;
        return 0;
    }
static int DoCertificateRequest ( WOLFSSL * ssl , const byte * input , word32 * inOutIdx , word32 size ) { word16 len ; word32 begin = * inOutIdx ; #ifdef WOLFSSL_CALLBACKS if ( ssl -> hsInfoOn ) AddPacketName ( " " , & ssl -> handShakeInfo ) ; if ( ssl -> toInfoOn ) AddLateName ( " " , & ssl -> timeoutInfo ) ; #endif if ( ( * inOutIdx - begin ) + OPAQUE8_LEN > size ) return BUFFER_ERROR ; len = input [ ( * inOutIdx ) ++ ] ; if ( ( * inOutIdx - begin ) + len > size ) return BUFFER_ERROR ; * inOutIdx += len ; if ( IsAtLeastTLSv1_2 ( ssl ) ) { if ( ( * inOutIdx - begin ) + OPAQUE16_LEN > size ) return BUFFER_ERROR ; ato16 ( input + * inOutIdx , & len ) ; * inOutIdx += OPAQUE16_LEN ; if ( ( * inOutIdx - begin ) + len > size ) return BUFFER_ERROR ; PickHashSigAlgo ( ssl , input + * inOutIdx , len ) ; * inOutIdx += len ; } if ( ( * inOutIdx - begin ) + OPAQUE16_LEN > size ) return BUFFER_ERROR ; ato16 ( input + * inOutIdx , & len ) ; * inOutIdx += OPAQUE16_LEN ; if ( ( * inOutIdx - begin ) + len > size ) return BUFFER_ERROR ; while ( len ) { word16 dnSz ; if ( ( * inOutIdx - begin ) + OPAQUE16_LEN > size ) return BUFFER_ERROR ; ato16 ( input + * inOutIdx , & dnSz ) ; * inOutIdx += OPAQUE16_LEN ; if ( ( * inOutIdx - begin ) + dnSz > size ) return BUFFER_ERROR ; * inOutIdx += dnSz ; len -= OPAQUE16_LEN + dnSz ; } if ( ssl -> buffers . certificate && ssl -> buffers . certificate -> buffer && ssl -> buffers . key && ssl -> buffers . key -> buffer ) ssl -> options . sendVerify = SEND_CERT ; else if ( IsTLS ( ssl ) ) ssl -> options . sendVerify = SEND_BLANK_CERT ; if ( IsEncryptionOn ( ssl , 0 ) ) * inOutIdx += ssl -> keys . padSz ; return 0 ; }
just read in and ignore for now TODO:
just read in and ignore for now TODO :
/* types, read in here */ /* signature and hash signature algorithm */ /* authorities */ /* don't send client cert or cert verify if user hasn't provided
           cert and private key */