const unsigned char *certstart, *certbytes;
STACK_OF(X509) *sk = NULL;
EVP_PKEY *pkey = NULL;
- size_t chain;
+ size_t chainidx;
unsigned int context = 0;
if ((sk = sk_X509_new_null()) == NULL) {
SSLerr(SSL_F_TLS_PROCESS_SERVER_CERTIFICATE, SSL_R_LENGTH_MISMATCH);
goto f_err;
}
- for (chain = 0; PACKET_remaining(pkt); chain++) {
+ for (chainidx = 0; PACKET_remaining(pkt); chainidx++) {
if (!PACKET_get_net_3(pkt, &cert_len)
|| !PACKET_get_bytes(pkt, &certbytes, cert_len)) {
al = SSL_AD_DECODE_ERROR;
if (!tls_collect_extensions(s, &extensions, EXT_TLS1_3_CERTIFICATE,
&rawexts, &al)
|| !tls_parse_all_extensions(s, EXT_TLS1_3_CERTIFICATE,
- rawexts, x, chain, &al))
+ rawexts, x, chainidx, &al))
goto f_err;
}
/*
* If we have a certificate specific chain use it, else use parent ctx.
*/
- if (cpk->chain)
+ if (cpk->chain != NULL)
extra_certs = cpk->chain;
else
extra_certs = s->ctx->extra_certs;
else
chain_store = s->ctx->cert_store;
- if (chain_store) {
+ if (chain_store != NULL) {
X509_STORE_CTX *xs_ctx = X509_STORE_CTX_new();
if (xs_ctx == NULL) {
return WRITE_TRAN_CONTINUE;
case TLS_ST_SW_CERT:
- st->hand_state = TLS_ST_SW_FINISHED;
+ st->hand_state = TLS_ST_SW_FINISHED;
return WRITE_TRAN_CONTINUE;
case TLS_ST_SW_FINISHED:
const unsigned char *certstart, *certbytes;
STACK_OF(X509) *sk = NULL;
PACKET spkt, context;
- size_t chain;
+ size_t chainidx;
if ((sk = sk_X509_new_null()) == NULL) {
SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE, ERR_R_MALLOC_FAILURE);
goto f_err;
}
- for (chain = 0; PACKET_remaining(&spkt) > 0; chain++) {
+ for (chainidx = 0; PACKET_remaining(&spkt) > 0; chainidx++) {
if (!PACKET_get_net_3(&spkt, &l)
|| !PACKET_get_bytes(&spkt, &certbytes, l)) {
al = SSL_AD_DECODE_ERROR;
if (!tls_collect_extensions(s, &extensions, EXT_TLS1_3_CERTIFICATE,
&rawexts, &al)
|| !tls_parse_all_extensions(s, EXT_TLS1_3_CERTIFICATE,
- rawexts, x, chain, &al))
+ rawexts, x, chainidx, &al))
goto f_err;
}
}
static int ssl_print_extensions(BIO *bio, int indent, int server,
- const unsigned char **msgin, size_t *msglenin)
+ const unsigned char **msgin, size_t *msginlen)
{
- size_t extslen, msglen = *msglenin;
+ size_t extslen, msglen = *msginlen;
const unsigned char *msg = *msgin;
BIO_indent(bio, indent, 80);
}
*msgin = msg;
- *msglenin = msglen;
+ *msginlen = msglen;
return 1;
}