summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2015-09-12 10:25:38 +0000
committerjsing <>2015-09-12 10:25:38 +0000
commit71c66c3cf85e874d743ea388506c9a1faf4806dd (patch)
tree2a0c2a3680de43d7b40a672791a1c69bf68773fc /src
parent68941769a0e1449e5b2ef20cadf46f6dbcdc34fc (diff)
downloadopenbsd-71c66c3cf85e874d743ea388506c9a1faf4806dd.tar.gz
openbsd-71c66c3cf85e874d743ea388506c9a1faf4806dd.tar.bz2
openbsd-71c66c3cf85e874d743ea388506c9a1faf4806dd.zip
Pull variable assignment out from function call, fix indentation and set
state after calling ssl3_handshake_msg_finish().
Diffstat (limited to 'src')
-rw-r--r--src/lib/libssl/s3_clnt.c15
-rw-r--r--src/lib/libssl/src/ssl/s3_clnt.c15
2 files changed, 14 insertions, 16 deletions
diff --git a/src/lib/libssl/s3_clnt.c b/src/lib/libssl/s3_clnt.c
index 1424641047..c2da428955 100644
--- a/src/lib/libssl/s3_clnt.c
+++ b/src/lib/libssl/s3_clnt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s3_clnt.c,v 1.128 2015/09/12 10:09:16 jsing Exp $ */ 1/* $OpenBSD: s3_clnt.c,v 1.129 2015/09/12 10:25:38 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1974,8 +1974,8 @@ ssl3_send_client_key_exchange(SSL *s)
1974 1974
1975 /* Generate master key from the result. */ 1975 /* Generate master key from the result. */
1976 s->session->master_key_length = 1976 s->session->master_key_length =
1977 s->method->ssl3_enc->generate_master_secret(s, 1977 s->method->ssl3_enc->generate_master_secret(s,
1978 s->session->master_key, p, n); 1978 s->session->master_key, p, n);
1979 1979
1980 /* Clean up. */ 1980 /* Clean up. */
1981 memset(p, 0, n); 1981 memset(p, 0, n);
@@ -2131,9 +2131,8 @@ ssl3_send_client_key_exchange(SSL *s)
2131 goto err; 2131 goto err;
2132 } 2132 }
2133 2133
2134 pkey_ctx = EVP_PKEY_CTX_new( 2134 pub_key = X509_get_pubkey(peer_cert);
2135 pub_key = X509_get_pubkey(peer_cert), 2135 pkey_ctx = EVP_PKEY_CTX_new(pub_key, NULL);
2136 NULL);
2137 2136
2138 /* 2137 /*
2139 * If we have send a certificate, and certificate key 2138 * If we have send a certificate, and certificate key
@@ -2232,9 +2231,9 @@ ssl3_send_client_key_exchange(SSL *s)
2232 goto err; 2231 goto err;
2233 } 2232 }
2234 2233
2235 s->state = SSL3_ST_CW_KEY_EXCH_B;
2236
2237 ssl3_handshake_msg_finish(s, n); 2234 ssl3_handshake_msg_finish(s, n);
2235
2236 s->state = SSL3_ST_CW_KEY_EXCH_B;
2238 } 2237 }
2239 2238
2240 /* SSL3_ST_CW_KEY_EXCH_B */ 2239 /* SSL3_ST_CW_KEY_EXCH_B */
diff --git a/src/lib/libssl/src/ssl/s3_clnt.c b/src/lib/libssl/src/ssl/s3_clnt.c
index 1424641047..c2da428955 100644
--- a/src/lib/libssl/src/ssl/s3_clnt.c
+++ b/src/lib/libssl/src/ssl/s3_clnt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s3_clnt.c,v 1.128 2015/09/12 10:09:16 jsing Exp $ */ 1/* $OpenBSD: s3_clnt.c,v 1.129 2015/09/12 10:25:38 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1974,8 +1974,8 @@ ssl3_send_client_key_exchange(SSL *s)
1974 1974
1975 /* Generate master key from the result. */ 1975 /* Generate master key from the result. */
1976 s->session->master_key_length = 1976 s->session->master_key_length =
1977 s->method->ssl3_enc->generate_master_secret(s, 1977 s->method->ssl3_enc->generate_master_secret(s,
1978 s->session->master_key, p, n); 1978 s->session->master_key, p, n);
1979 1979
1980 /* Clean up. */ 1980 /* Clean up. */
1981 memset(p, 0, n); 1981 memset(p, 0, n);
@@ -2131,9 +2131,8 @@ ssl3_send_client_key_exchange(SSL *s)
2131 goto err; 2131 goto err;
2132 } 2132 }
2133 2133
2134 pkey_ctx = EVP_PKEY_CTX_new( 2134 pub_key = X509_get_pubkey(peer_cert);
2135 pub_key = X509_get_pubkey(peer_cert), 2135 pkey_ctx = EVP_PKEY_CTX_new(pub_key, NULL);
2136 NULL);
2137 2136
2138 /* 2137 /*
2139 * If we have send a certificate, and certificate key 2138 * If we have send a certificate, and certificate key
@@ -2232,9 +2231,9 @@ ssl3_send_client_key_exchange(SSL *s)
2232 goto err; 2231 goto err;
2233 } 2232 }
2234 2233
2235 s->state = SSL3_ST_CW_KEY_EXCH_B;
2236
2237 ssl3_handshake_msg_finish(s, n); 2234 ssl3_handshake_msg_finish(s, n);
2235
2236 s->state = SSL3_ST_CW_KEY_EXCH_B;
2238 } 2237 }
2239 2238
2240 /* SSL3_ST_CW_KEY_EXCH_B */ 2239 /* SSL3_ST_CW_KEY_EXCH_B */