diff options
author | Matt Caswell <matt@openssl.org> | 2016-07-08 11:09:02 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-07-18 23:05:15 +0100 |
commit | a7a752285a4fdb716fa5e184b84fe1474de6dbcf (patch) | |
tree | c8fad51cb620e7a85098b5d96e67880459d2c3a0 /ssl/statem/statem_clnt.c | |
parent | 840a2bf8eccc5efa77f84e8470b33ac0c64bb020 (diff) |
Some tidy ups after the CKE construction refactor
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'ssl/statem/statem_clnt.c')
-rw-r--r-- | ssl/statem/statem_clnt.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/ssl/statem/statem_clnt.c b/ssl/statem/statem_clnt.c index 125f7c4cc9..236fffc2f5 100644 --- a/ssl/statem/statem_clnt.c +++ b/ssl/statem/statem_clnt.c @@ -2458,7 +2458,7 @@ static int tls_construct_cke_srp(SSL *s, unsigned char **p, int *len, int *al) int tls_construct_client_key_exchange(SSL *s) { unsigned char *p; - int n; + int len; size_t pskhdrlen = 0; unsigned long alg_k; int al = -1; @@ -2467,28 +2467,26 @@ int tls_construct_client_key_exchange(SSL *s) p = ssl_handshake_start(s); - - if ((alg_k & SSL_PSK) && !tls_construct_cke_psk_preamble(s, &p, &pskhdrlen, &al)) goto err; if (alg_k & SSL_kPSK) { - n = 0; + len = 0; } else if (alg_k & (SSL_kRSA | SSL_kRSAPSK)) { - if (!tls_construct_cke_rsa(s, &p, &n, &al)) + if (!tls_construct_cke_rsa(s, &p, &len, &al)) goto err; } else if (alg_k & (SSL_kDHE | SSL_kDHEPSK)) { - if (!tls_construct_cke_dhe(s, &p, &n, &al)) + if (!tls_construct_cke_dhe(s, &p, &len, &al)) goto err; } else if (alg_k & (SSL_kECDHE | SSL_kECDHEPSK)) { - if (!tls_construct_cke_ecdhe(s, &p, &n, &al)) + if (!tls_construct_cke_ecdhe(s, &p, &len, &al)) goto err; } else if (alg_k & SSL_kGOST) { - if (!tls_construct_cke_gost(s, &p, &n, &al)) + if (!tls_construct_cke_gost(s, &p, &len, &al)) goto err; } else if (alg_k & SSL_kSRP) { - if (!tls_construct_cke_srp(s, &p, &n, &al)) + if (!tls_construct_cke_srp(s, &p, &len, &al)) goto err; } else { ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); @@ -2496,9 +2494,9 @@ int tls_construct_client_key_exchange(SSL *s) goto err; } - n += pskhdrlen; + len += pskhdrlen; - if (!ssl_set_handshake_header(s, SSL3_MT_CLIENT_KEY_EXCHANGE, n)) { + if (!ssl_set_handshake_header(s, SSL3_MT_CLIENT_KEY_EXCHANGE, len)) { ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); goto err; |