ssl/statem/statem_srvr.c:3291: error: UNINITIALIZED_VALUE
  The value read from al was never initialized.
Showing all 1 steps of the trace


ssl/statem/statem_srvr.c:3291:5: 
3289.   
3290.    f_err:
3291. >     ssl3_send_alert(s, SSL3_AL_FATAL, al);
3292.       ossl_statem_set_error(s);
3293.    done:

enum MSG_PROCESS_RETURN tls_process_client_certificate(SSL *s, PACKET *pkt)
{
    int i, al, ret = MSG_PROCESS_ERROR;
    X509 *x = NULL;
    unsigned long l, llen;
    const unsigned char *certstart;
    unsigned char *certbytes;
    STACK_OF(X509) *sk = NULL;
    PACKET spkt;
    if ((sk = sk_X509_new_null()) == NULL) {
        SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE, ERR_R_MALLOC_FAILURE);
        goto f_err;
    }
    if (!PACKET_get_net_3(pkt, &llen)
            || !PACKET_get_sub_packet(pkt, &spkt, llen)
            || PACKET_remaining(pkt) != 0) {
        al = SSL_AD_DECODE_ERROR;
        SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE, SSL_R_LENGTH_MISMATCH);
        goto f_err;
    }
    while (PACKET_remaining(&spkt) > 0) {
        if (!PACKET_get_net_3(&spkt, &l)
                || !PACKET_get_bytes(&spkt, &certbytes, l)) {
            al = SSL_AD_DECODE_ERROR;
            SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE,
                   SSL_R_CERT_LENGTH_MISMATCH);
            goto f_err;
        }
        certstart = certbytes;
        x = d2i_X509(NULL, (const unsigned char **)&certbytes, l);
        if (x == NULL) {
            SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE, ERR_R_ASN1_LIB);
            goto f_err;
        }
        if (certbytes != (certstart + l)) {
            al = SSL_AD_DECODE_ERROR;
            SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE,
                   SSL_R_CERT_LENGTH_MISMATCH);
            goto f_err;
        }
        if (!sk_X509_push(sk, x)) {
            SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE, ERR_R_MALLOC_FAILURE);
            goto f_err;
        }
        x = NULL;
    }
    if (sk_X509_num(sk) <= 0) {
        if (s->version == SSL3_VERSION) {
            al = SSL_AD_HANDSHAKE_FAILURE;
            SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE,
                   SSL_R_NO_CERTIFICATES_RETURNED);
            goto f_err;
        }
        else if ((s->verify_mode & SSL_VERIFY_PEER) &&
                 (s->verify_mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT)) {
            SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE,
                   SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE);
            al = SSL_AD_HANDSHAKE_FAILURE;
            goto f_err;
        }
        if (s->s3->handshake_buffer && !ssl3_digest_cached_records(s, 0)) {
            al = SSL_AD_INTERNAL_ERROR;
            goto f_err;
        }
    } else {
        EVP_PKEY *pkey;
        i = ssl_verify_cert_chain(s, sk);
        if (i <= 0) {
            al = ssl_verify_alarm_type(s->verify_result);
            SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE,
                   SSL_R_CERTIFICATE_VERIFY_FAILED);
            goto f_err;
        }
        if (i > 1) {
            SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE, i);
            al = SSL_AD_HANDSHAKE_FAILURE;
            goto f_err;
        }
        pkey = X509_get_pubkey(sk_X509_value(sk, 0));
        if (pkey == NULL) {
            al = SSL3_AD_HANDSHAKE_FAILURE;
            SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE,
                   SSL_R_UNKNOWN_CERTIFICATE_TYPE);
            goto f_err;
        }
        EVP_PKEY_free(pkey);
    }
    X509_free(s->session->peer);
    s->session->peer = sk_X509_shift(sk);
    s->session->verify_result = s->verify_result;
    sk_X509_pop_free(s->session->peer_chain, X509_free);
    s->session->peer_chain = sk;
    sk = NULL;
    ret = MSG_PROCESS_CONTINUE_READING;
    goto done;
 f_err:
    ssl3_send_alert(s, SSL3_AL_FATAL, al);
    ossl_statem_set_error(s);
 done:
    X509_free(x);
    sk_X509_pop_free(sk, X509_free);
    return ret;
}
['enum MSG_PROCESS_RETURN tls_process_client_certificate(SSL *s, PACKET *pkt)\n{\n    int i, al, ret = MSG_PROCESS_ERROR;\n    X509 *x = NULL;\n    unsigned long l, llen;\n    const unsigned char *certstart;\n    unsigned char *certbytes;\n    STACK_OF(X509) *sk = NULL;\n    PACKET spkt;\n    if ((sk = sk_X509_new_null()) == NULL) {\n        SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE, ERR_R_MALLOC_FAILURE);\n        goto f_err;\n    }\n    if (!PACKET_get_net_3(pkt, &llen)\n            || !PACKET_get_sub_packet(pkt, &spkt, llen)\n            || PACKET_remaining(pkt) != 0) {\n        al = SSL_AD_DECODE_ERROR;\n        SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE, SSL_R_LENGTH_MISMATCH);\n        goto f_err;\n    }\n    while (PACKET_remaining(&spkt) > 0) {\n        if (!PACKET_get_net_3(&spkt, &l)\n                || !PACKET_get_bytes(&spkt, &certbytes, l)) {\n            al = SSL_AD_DECODE_ERROR;\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE,\n                   SSL_R_CERT_LENGTH_MISMATCH);\n            goto f_err;\n        }\n        certstart = certbytes;\n        x = d2i_X509(NULL, (const unsigned char **)&certbytes, l);\n        if (x == NULL) {\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE, ERR_R_ASN1_LIB);\n            goto f_err;\n        }\n        if (certbytes != (certstart + l)) {\n            al = SSL_AD_DECODE_ERROR;\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE,\n                   SSL_R_CERT_LENGTH_MISMATCH);\n            goto f_err;\n        }\n        if (!sk_X509_push(sk, x)) {\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE, ERR_R_MALLOC_FAILURE);\n            goto f_err;\n        }\n        x = NULL;\n    }\n    if (sk_X509_num(sk) <= 0) {\n        if (s->version == SSL3_VERSION) {\n            al = SSL_AD_HANDSHAKE_FAILURE;\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE,\n                   SSL_R_NO_CERTIFICATES_RETURNED);\n            goto f_err;\n        }\n        else if ((s->verify_mode & SSL_VERIFY_PEER) &&\n                 (s->verify_mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT)) {\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE,\n                   SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE);\n            al = SSL_AD_HANDSHAKE_FAILURE;\n            goto f_err;\n        }\n        if (s->s3->handshake_buffer && !ssl3_digest_cached_records(s, 0)) {\n            al = SSL_AD_INTERNAL_ERROR;\n            goto f_err;\n        }\n    } else {\n        EVP_PKEY *pkey;\n        i = ssl_verify_cert_chain(s, sk);\n        if (i <= 0) {\n            al = ssl_verify_alarm_type(s->verify_result);\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE,\n                   SSL_R_CERTIFICATE_VERIFY_FAILED);\n            goto f_err;\n        }\n        if (i > 1) {\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE, i);\n            al = SSL_AD_HANDSHAKE_FAILURE;\n            goto f_err;\n        }\n        pkey = X509_get_pubkey(sk_X509_value(sk, 0));\n        if (pkey == NULL) {\n            al = SSL3_AD_HANDSHAKE_FAILURE;\n            SSLerr(SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE,\n                   SSL_R_UNKNOWN_CERTIFICATE_TYPE);\n            goto f_err;\n        }\n        EVP_PKEY_free(pkey);\n    }\n    X509_free(s->session->peer);\n    s->session->peer = sk_X509_shift(sk);\n    s->session->verify_result = s->verify_result;\n    sk_X509_pop_free(s->session->peer_chain, X509_free);\n    s->session->peer_chain = sk;\n    sk = NULL;\n    ret = MSG_PROCESS_CONTINUE_READING;\n    goto done;\n f_err:\n    ssl3_send_alert(s, SSL3_AL_FATAL, al);\n    ossl_statem_set_error(s);\n done:\n    X509_free(x);\n    sk_X509_pop_free(sk, X509_free);\n    return ret;\n}']