From: Matt Caswell Date: Mon, 26 Sep 2016 13:59:08 +0000 (+0100) Subject: Convert HelloRequest construction to WPACKET X-Git-Tag: OpenSSL_1_1_1-pre1~3450 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0086ca4e9bcfc9b8598c81ee356f57130f5fbe5f;p=oweals%2Fopenssl.git Convert HelloRequest construction to WPACKET Reviewed-by: Rich Salz --- diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c index fbca5a168a..8a2791ad77 100644 --- a/ssl/statem/statem_srvr.c +++ b/ssl/statem/statem_srvr.c @@ -831,9 +831,14 @@ static int ssl_check_srp_ext_ClientHello(SSL *s, int *al) int tls_construct_hello_request(SSL *s) { - if (!ssl_set_handshake_header(s, SSL3_MT_HELLO_REQUEST, 0)) { + WPACKET pkt; + + if (!WPACKET_init(&pkt, s->init_buf) + || !ssl_set_handshake_header2(s, &pkt, SSL3_MT_HELLO_REQUEST) + || !ssl_close_construct_packet(s, &pkt)) { SSLerr(SSL_F_TLS_CONSTRUCT_HELLO_REQUEST, ERR_R_INTERNAL_ERROR); ossl_statem_set_error(s); + WPACKET_cleanup(&pkt); return 0; }