diff options
Diffstat (limited to 'ssl/statem/extensions_srvr.c')
-rw-r--r-- | ssl/statem/extensions_srvr.c | 64 |
1 files changed, 34 insertions, 30 deletions
diff --git a/ssl/statem/extensions_srvr.c b/ssl/statem/extensions_srvr.c index f2fc979d34..dfe5fc5aca 100644 --- a/ssl/statem/extensions_srvr.c +++ b/ssl/statem/extensions_srvr.c @@ -14,7 +14,7 @@ /* * Parse the client's renegotiation binding and abort if it's not right */ -int tls_parse_ctos_renegotiate(SSL *s, PACKET *pkt, X509 *x, size_t chain, +int tls_parse_ctos_renegotiate(SSL *s, PACKET *pkt, X509 *x, size_t chainidx, int *al) { unsigned int ilen; @@ -73,7 +73,7 @@ int tls_parse_ctos_renegotiate(SSL *s, PACKET *pkt, X509 *x, size_t chain, * extension. * - On session reconnect, the servername extension may be absent. */ -int tls_parse_ctos_server_name(SSL *s, PACKET *pkt, X509 *x, size_t chain, +int tls_parse_ctos_server_name(SSL *s, PACKET *pkt, X509 *x, size_t chainidx, int *al) { unsigned int servname_type; @@ -136,7 +136,7 @@ int tls_parse_ctos_server_name(SSL *s, PACKET *pkt, X509 *x, size_t chain, } #ifndef OPENSSL_NO_SRP -int tls_parse_ctos_srp(SSL *s, PACKET *pkt, X509 *x, size_t chain, int *al) +int tls_parse_ctos_srp(SSL *s, PACKET *pkt, X509 *x, size_t chainidx, int *al) { PACKET srp_I; @@ -160,7 +160,7 @@ int tls_parse_ctos_srp(SSL *s, PACKET *pkt, X509 *x, size_t chain, int *al) #endif #ifndef OPENSSL_NO_EC -int tls_parse_ctos_ec_pt_formats(SSL *s, PACKET *pkt, X509 *x, size_t chain, +int tls_parse_ctos_ec_pt_formats(SSL *s, PACKET *pkt, X509 *x, size_t chainidx, int *al) { PACKET ec_point_format_list; @@ -184,7 +184,7 @@ int tls_parse_ctos_ec_pt_formats(SSL *s, PACKET *pkt, X509 *x, size_t chain, } #endif /* OPENSSL_NO_EC */ -int tls_parse_ctos_session_ticket(SSL *s, PACKET *pkt, X509 *x, size_t chain, +int tls_parse_ctos_session_ticket(SSL *s, PACKET *pkt, X509 *x, size_t chainidx, int *al) { if (s->tls_session_ticket_ext_cb && @@ -198,7 +198,8 @@ int tls_parse_ctos_session_ticket(SSL *s, PACKET *pkt, X509 *x, size_t chain, return 1; } -int tls_parse_ctos_sig_algs(SSL *s, PACKET *pkt, X509 *x, size_t chain, int *al) +int tls_parse_ctos_sig_algs(SSL *s, PACKET *pkt, X509 *x, size_t chainidx, + int *al) { PACKET supported_sig_algs; @@ -219,7 +220,7 @@ int tls_parse_ctos_sig_algs(SSL *s, PACKET *pkt, X509 *x, size_t chain, int *al) } #ifndef OPENSSL_NO_OCSP -int tls_parse_ctos_status_request(SSL *s, PACKET *pkt, X509 *x, size_t chain, +int tls_parse_ctos_status_request(SSL *s, PACKET *pkt, X509 *x, size_t chainidx, int *al) { PACKET responder_id_list, exts; @@ -318,7 +319,7 @@ int tls_parse_ctos_status_request(SSL *s, PACKET *pkt, X509 *x, size_t chain, #endif #ifndef OPENSSL_NO_NEXTPROTONEG -int tls_parse_ctos_npn(SSL *s, PACKET *pkt, X509 *x, size_t chain, int *al) +int tls_parse_ctos_npn(SSL *s, PACKET *pkt, X509 *x, size_t chainidx, int *al) { /* * We shouldn't accept this extension on a @@ -349,7 +350,7 @@ int tls_parse_ctos_npn(SSL *s, PACKET *pkt, X509 *x, size_t chain, int *al) * extension, not including type and length. |al| is a pointer to the alert * value to send in the event of a failure. Returns: 1 on success, 0 on error. */ -int tls_parse_ctos_alpn(SSL *s, PACKET *pkt, X509 *x, size_t chain, int *al) +int tls_parse_ctos_alpn(SSL *s, PACKET *pkt, X509 *x, size_t chainidx, int *al) { PACKET protocol_list, save_protocol_list, protocol; @@ -382,7 +383,8 @@ int tls_parse_ctos_alpn(SSL *s, PACKET *pkt, X509 *x, size_t chain, int *al) } #ifndef OPENSSL_NO_SRTP -int tls_parse_ctos_use_srtp(SSL *s, PACKET *pkt, X509 *x, size_t chain, int *al) +int tls_parse_ctos_use_srtp(SSL *s, PACKET *pkt, X509 *x, size_t chainidx, + int *al) { STACK_OF(SRTP_PROTECTION_PROFILE) *srvr; unsigned int ct, mki_len, id; @@ -452,7 +454,7 @@ int tls_parse_ctos_use_srtp(SSL *s, PACKET *pkt, X509 *x, size_t chain, int *al) } #endif -int tls_parse_ctos_etm(SSL *s, PACKET *pkt, X509 *x, size_t chain, int *al) +int tls_parse_ctos_etm(SSL *s, PACKET *pkt, X509 *x, size_t chainidx, int *al) { if (!(s->options & SSL_OP_NO_ENCRYPT_THEN_MAC)) s->s3->flags |= TLS1_FLAGS_ENCRYPT_THEN_MAC; @@ -496,7 +498,7 @@ static int check_in_list(SSL *s, unsigned int group_id, * the raw PACKET data for the extension. Returns 1 on success or 0 on failure. * If a failure occurs then |*al| is set to an appropriate alert value. */ -int tls_parse_ctos_key_share(SSL *s, PACKET *pkt, X509 *x, size_t chain, +int tls_parse_ctos_key_share(SSL *s, PACKET *pkt, X509 *x, size_t chainidx, int *al) { #ifndef OPENSSL_NO_TLS1_3 @@ -626,8 +628,8 @@ int tls_parse_ctos_key_share(SSL *s, PACKET *pkt, X509 *x, size_t chain, } #ifndef OPENSSL_NO_EC -int tls_parse_ctos_supported_groups(SSL *s, PACKET *pkt, X509 *x, size_t chain, - int *al) +int tls_parse_ctos_supported_groups(SSL *s, PACKET *pkt, X509 *x, + size_t chainidx, int *al) { PACKET supported_groups_list; @@ -651,7 +653,7 @@ int tls_parse_ctos_supported_groups(SSL *s, PACKET *pkt, X509 *x, size_t chain, } #endif -int tls_parse_ctos_ems(SSL *s, PACKET *pkt, X509 *x, size_t chain, int *al) +int tls_parse_ctos_ems(SSL *s, PACKET *pkt, X509 *x, size_t chainidx, int *al) { /* The extension must always be empty */ if (PACKET_remaining(pkt) != 0) { @@ -667,8 +669,8 @@ int tls_parse_ctos_ems(SSL *s, PACKET *pkt, X509 *x, size_t chain, int *al) /* * Add the server's renegotiation binding */ -int tls_construct_stoc_renegotiate(SSL *s, WPACKET *pkt, X509 *x, size_t chain, - int *al) +int tls_construct_stoc_renegotiate(SSL *s, WPACKET *pkt, X509 *x, size_t + chainidx, int *al) { if (!s->s3->send_connection_binding) return 1; @@ -689,8 +691,8 @@ int tls_construct_stoc_renegotiate(SSL *s, WPACKET *pkt, X509 *x, size_t chain, return 1; } -int tls_construct_stoc_server_name(SSL *s, WPACKET *pkt, X509 *x, size_t chain, - int *al) +int tls_construct_stoc_server_name(SSL *s, WPACKET *pkt, X509 *x, + size_t chainidx, int *al) { if (s->hit || s->servername_done != 1 || s->session->tlsext_hostname == NULL) @@ -707,7 +709,7 @@ int tls_construct_stoc_server_name(SSL *s, WPACKET *pkt, X509 *x, size_t chain, #ifndef OPENSSL_NO_EC int tls_construct_stoc_ec_pt_formats(SSL *s, WPACKET *pkt, X509 *x, - size_t chain, int *al) + size_t chainidx, int *al) { unsigned long alg_k = s->s3->tmp.new_cipher->algorithm_mkey; unsigned long alg_a = s->s3->tmp.new_cipher->algorithm_auth; @@ -733,7 +735,7 @@ int tls_construct_stoc_ec_pt_formats(SSL *s, WPACKET *pkt, X509 *x, #endif int tls_construct_stoc_session_ticket(SSL *s, WPACKET *pkt, X509 *x, - size_t chain, int *al) + size_t chainidx, int *al) { if (!s->tlsext_ticket_expected || !tls_use_ticket(s)) { s->tlsext_ticket_expected = 0; @@ -751,12 +753,12 @@ int tls_construct_stoc_session_ticket(SSL *s, WPACKET *pkt, X509 *x, #ifndef OPENSSL_NO_OCSP int tls_construct_stoc_status_request(SSL *s, WPACKET *pkt, X509 *x, - size_t chain, int *al) + size_t chainidx, int *al) { if (!s->tlsext_status_expected) return 1; - if (SSL_IS_TLS13(s) && chain != 0) + if (SSL_IS_TLS13(s) && chainidx != 0) return 1; if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_status_request) @@ -782,7 +784,7 @@ int tls_construct_stoc_status_request(SSL *s, WPACKET *pkt, X509 *x, #ifndef OPENSSL_NO_NEXTPROTONEG int tls_construct_stoc_next_proto_neg(SSL *s, WPACKET *pkt, X509 *x, - size_t chain, int *al) + size_t chainidx, int *al) { const unsigned char *npa; unsigned int npalen; @@ -809,7 +811,7 @@ int tls_construct_stoc_next_proto_neg(SSL *s, WPACKET *pkt, X509 *x, } #endif -int tls_construct_stoc_alpn(SSL *s, WPACKET *pkt, X509 *x, size_t chain, +int tls_construct_stoc_alpn(SSL *s, WPACKET *pkt, X509 *x, size_t chainidx, int *al) { if (s->s3->alpn_selected == NULL) @@ -831,7 +833,7 @@ int tls_construct_stoc_alpn(SSL *s, WPACKET *pkt, X509 *x, size_t chain, } #ifndef OPENSSL_NO_SRTP -int tls_construct_stoc_use_srtp(SSL *s, WPACKET *pkt, X509 *x, size_t chain, +int tls_construct_stoc_use_srtp(SSL *s, WPACKET *pkt, X509 *x, size_t chainidx, int *al) { if (s->srtp_profile == NULL) @@ -851,7 +853,8 @@ int tls_construct_stoc_use_srtp(SSL *s, WPACKET *pkt, X509 *x, size_t chain, } #endif -int tls_construct_stoc_etm(SSL *s, WPACKET *pkt, X509 *x, size_t chain, int *al) +int tls_construct_stoc_etm(SSL *s, WPACKET *pkt, X509 *x, size_t chainidx, + int *al) { if ((s->s3->flags & TLS1_FLAGS_ENCRYPT_THEN_MAC) == 0) return 1; @@ -877,7 +880,8 @@ int tls_construct_stoc_etm(SSL *s, WPACKET *pkt, X509 *x, size_t chain, int *al) return 1; } -int tls_construct_stoc_ems(SSL *s, WPACKET *pkt, X509 *x, size_t chain, int *al) +int tls_construct_stoc_ems(SSL *s, WPACKET *pkt, X509 *x, size_t chainidx, + int *al) { if ((s->s3->flags & TLS1_FLAGS_RECEIVED_EXTMS) == 0) return 1; @@ -891,7 +895,7 @@ int tls_construct_stoc_ems(SSL *s, WPACKET *pkt, X509 *x, size_t chain, int *al) return 1; } -int tls_construct_stoc_key_share(SSL *s, WPACKET *pkt, X509 *x, size_t chain, +int tls_construct_stoc_key_share(SSL *s, WPACKET *pkt, X509 *x, size_t chainidx, int *al) { #ifndef OPENSSL_NO_TLS1_3 @@ -949,7 +953,7 @@ int tls_construct_stoc_key_share(SSL *s, WPACKET *pkt, X509 *x, size_t chain, } int tls_construct_stoc_cryptopro_bug(SSL *s, WPACKET *pkt, X509 *x, - size_t chain, int *al) + size_t chainidx, int *al) { const unsigned char cryptopro_ext[36] = { 0xfd, 0xe8, /* 65000 */ |