提交 2248dbeb 编写于 作者: M Matt Caswell

Various style fixes following review feedback

Reviewed-by: NRichard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2341)
上级 b0bfd140
...@@ -1020,7 +1020,7 @@ static int final_key_share(SSL *s, unsigned int context, int sent, int *al) ...@@ -1020,7 +1020,7 @@ static int final_key_share(SSL *s, unsigned int context, int sent, int *al)
size_t num_curves, clnt_num_curves, i; size_t num_curves, clnt_num_curves, i;
unsigned int group_id; unsigned int group_id;
/* Check a shared group exists */ /* Check if a shared group exists */
/* Get the clients list of supported groups. */ /* Get the clients list of supported groups. */
if (!tls1_get_curvelist(s, 1, &clntcurves, &clnt_num_curves)) { if (!tls1_get_curvelist(s, 1, &clntcurves, &clnt_num_curves)) {
......
...@@ -531,8 +531,8 @@ int tls_construct_ctos_psk_kex_modes(SSL *s, WPACKET *pkt, unsigned int context, ...@@ -531,8 +531,8 @@ int tls_construct_ctos_psk_kex_modes(SSL *s, WPACKET *pkt, unsigned int context,
#ifndef OPENSSL_NO_TLS1_3 #ifndef OPENSSL_NO_TLS1_3
static int add_key_share(SSL *s, WPACKET *pkt, unsigned int curve_id) static int add_key_share(SSL *s, WPACKET *pkt, unsigned int curve_id)
{ {
unsigned char *encodedPoint = NULL; unsigned char *encoded_point;
EVP_PKEY *key_share_key = NULL; EVP_PKEY *key_share_key;
size_t encodedlen; size_t encodedlen;
key_share_key = ssl_generate_pkey_curve(curve_id); key_share_key = ssl_generate_pkey_curve(curve_id);
...@@ -543,7 +543,7 @@ static int add_key_share(SSL *s, WPACKET *pkt, unsigned int curve_id) ...@@ -543,7 +543,7 @@ static int add_key_share(SSL *s, WPACKET *pkt, unsigned int curve_id)
/* Encode the public key. */ /* Encode the public key. */
encodedlen = EVP_PKEY_get1_tls_encodedpoint(key_share_key, encodedlen = EVP_PKEY_get1_tls_encodedpoint(key_share_key,
&encodedPoint); &encoded_point);
if (encodedlen == 0) { if (encodedlen == 0) {
SSLerr(SSL_F_ADD_KEY_SHARE, ERR_R_EC_LIB); SSLerr(SSL_F_ADD_KEY_SHARE, ERR_R_EC_LIB);
EVP_PKEY_free(key_share_key); EVP_PKEY_free(key_share_key);
...@@ -552,10 +552,10 @@ static int add_key_share(SSL *s, WPACKET *pkt, unsigned int curve_id) ...@@ -552,10 +552,10 @@ static int add_key_share(SSL *s, WPACKET *pkt, unsigned int curve_id)
/* Create KeyShareEntry */ /* Create KeyShareEntry */
if (!WPACKET_put_bytes_u16(pkt, curve_id) if (!WPACKET_put_bytes_u16(pkt, curve_id)
|| !WPACKET_sub_memcpy_u16(pkt, encodedPoint, encodedlen)) { || !WPACKET_sub_memcpy_u16(pkt, encoded_point, encodedlen)) {
SSLerr(SSL_F_ADD_KEY_SHARE, ERR_R_INTERNAL_ERROR); SSLerr(SSL_F_ADD_KEY_SHARE, ERR_R_INTERNAL_ERROR);
EVP_PKEY_free(key_share_key); EVP_PKEY_free(key_share_key);
OPENSSL_free(encodedPoint); OPENSSL_free(encoded_point);
return 0; return 0;
} }
...@@ -566,7 +566,7 @@ static int add_key_share(SSL *s, WPACKET *pkt, unsigned int curve_id) ...@@ -566,7 +566,7 @@ static int add_key_share(SSL *s, WPACKET *pkt, unsigned int curve_id)
*/ */
s->s3->tmp.pkey = key_share_key; s->s3->tmp.pkey = key_share_key;
s->s3->group_id = curve_id; s->s3->group_id = curve_id;
OPENSSL_free(encodedPoint); OPENSSL_free(encoded_point);
return 1; return 1;
} }
......
...@@ -1466,7 +1466,7 @@ MSG_PROCESS_RETURN tls_process_server_hello(SSL *s, PACKET *pkt) ...@@ -1466,7 +1466,7 @@ MSG_PROCESS_RETURN tls_process_server_hello(SSL *s, PACKET *pkt)
static MSG_PROCESS_RETURN tls_process_hello_retry_request(SSL *s, PACKET *pkt) static MSG_PROCESS_RETURN tls_process_hello_retry_request(SSL *s, PACKET *pkt)
{ {
unsigned int sversion; unsigned int sversion;
int protverr; int errorcode;
RAW_EXTENSION *extensions = NULL; RAW_EXTENSION *extensions = NULL;
int al; int al;
PACKET extpkt; PACKET extpkt;
...@@ -1480,10 +1480,10 @@ static MSG_PROCESS_RETURN tls_process_hello_retry_request(SSL *s, PACKET *pkt) ...@@ -1480,10 +1480,10 @@ static MSG_PROCESS_RETURN tls_process_hello_retry_request(SSL *s, PACKET *pkt)
s->hello_retry_request = 1; s->hello_retry_request = 1;
/* This will fail if it doesn't choose TLSv1.3+ */ /* This will fail if it doesn't choose TLSv1.3+ */
protverr = ssl_choose_client_version(s, sversion); errorcode = ssl_choose_client_version(s, sversion);
if (protverr != 0) { if (errorcode != 0) {
al = SSL_AD_PROTOCOL_VERSION; al = SSL_AD_PROTOCOL_VERSION;
SSLerr(SSL_F_TLS_PROCESS_HELLO_RETRY_REQUEST, protverr); SSLerr(SSL_F_TLS_PROCESS_HELLO_RETRY_REQUEST, errorcode);
goto f_err; goto f_err;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册