summaryrefslogtreecommitdiff
path: root/lib/libssl
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2015-09-12 13:25:27 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2015-09-12 13:25:27 +0000
commit7e029939dfa8444a46006e5a9d4ee8f115f44891 (patch)
treecfe5301dba8ffd95b7e7ea94ca997ecd3645bcef /lib/libssl
parent017ce82cf56feb298f159ff17d12f2d7acd955d5 (diff)
Uncopy and unpaste dtls1_send_server_hello().
Diffstat (limited to 'lib/libssl')
-rw-r--r--lib/libssl/src/ssl/d1_srvr.c68
-rw-r--r--lib/libssl/src/ssl/ssl_locl.h3
2 files changed, 3 insertions, 68 deletions
diff --git a/lib/libssl/src/ssl/d1_srvr.c b/lib/libssl/src/ssl/d1_srvr.c
index ab5c3fcb2cf..5c77a62e1d9 100644
--- a/lib/libssl/src/ssl/d1_srvr.c
+++ b/lib/libssl/src/ssl/d1_srvr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: d1_srvr.c,v 1.59 2015/09/12 13:09:07 jsing Exp $ */
+/* $OpenBSD: d1_srvr.c,v 1.60 2015/09/12 13:25:26 jsing Exp $ */
/*
* DTLS implementation written by Nagendra Modadugu
* (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -346,7 +346,7 @@ dtls1_accept(SSL *s)
case SSL3_ST_SW_SRVR_HELLO_B:
s->renegotiate = 2;
dtls1_start_timer(s);
- ret = dtls1_send_server_hello(s);
+ ret = ssl3_send_server_hello(s);
if (ret <= 0)
goto end;
@@ -700,70 +700,6 @@ dtls1_send_hello_verify_request(SSL *s)
}
int
-dtls1_send_server_hello(SSL *s)
-{
- unsigned char *bufend;
- unsigned char *p, *d;
- unsigned int sl;
-
- if (s->state == SSL3_ST_SW_SRVR_HELLO_A) {
- d = p = ssl3_handshake_msg_start(s, SSL3_MT_SERVER_HELLO);
-
- *(p++) = s->version >> 8;
- *(p++) = s->version & 0xff;
-
- /* Random stuff */
- arc4random_buf(s->s3->server_random, SSL3_RANDOM_SIZE);
- memcpy(p, s->s3->server_random, SSL3_RANDOM_SIZE);
- p += SSL3_RANDOM_SIZE;
-
- /* now in theory we have 3 options to sending back the
- * session id. If it is a re-use, we send back the
- * old session-id, if it is a new session, we send
- * back the new session-id or we send back a 0 length
- * session-id if we want it to be single use.
- * Currently I will not implement the '0' length session-id
- * 12-Jan-98 - I'll now support the '0' length stuff.
- */
- if (!(s->ctx->session_cache_mode & SSL_SESS_CACHE_SERVER))
- s->session->session_id_length = 0;
-
- sl = s->session->session_id_length;
- if (sl > sizeof s->session->session_id) {
- SSLerr(SSL_F_DTLS1_SEND_SERVER_HELLO,
- ERR_R_INTERNAL_ERROR);
- return -1;
- }
- *(p++) = sl;
- memcpy(p, s->session->session_id, sl);
- p += sl;
-
- /* put the cipher */
- if (s->s3->tmp.new_cipher == NULL)
- return -1;
- s2n(ssl3_cipher_get_value(s->s3->tmp.new_cipher), p);
-
- /* put the compression method */
- *(p++) = 0;
-
- bufend = (unsigned char *)s->init_buf->data +
- SSL3_RT_MAX_PLAIN_LENGTH;
- if ((p = ssl_add_serverhello_tlsext(s, p, bufend)) == NULL) {
- SSLerr(SSL_F_DTLS1_SEND_SERVER_HELLO,
- ERR_R_INTERNAL_ERROR);
- return -1;
- }
-
- ssl3_handshake_msg_finish(s, p - d);
-
- s->state = SSL3_ST_SW_SRVR_HELLO_B;
- }
-
- /* SSL3_ST_SW_SRVR_HELLO_B */
- return (ssl3_handshake_write(s));
-}
-
-int
dtls1_send_server_done(SSL *s)
{
if (s->state == SSL3_ST_SW_SRVR_DONE_A) {
diff --git a/lib/libssl/src/ssl/ssl_locl.h b/lib/libssl/src/ssl/ssl_locl.h
index e817620d8bf..aa615055dfd 100644
--- a/lib/libssl/src/ssl/ssl_locl.h
+++ b/lib/libssl/src/ssl/ssl_locl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_locl.h,v 1.122 2015/09/12 13:09:07 jsing Exp $ */
+/* $OpenBSD: ssl_locl.h,v 1.123 2015/09/12 13:25:26 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -724,7 +724,6 @@ int ssl3_get_client_key_exchange(SSL *s);
int ssl3_get_cert_verify(SSL *s);
int ssl3_get_next_proto(SSL *s);
-int dtls1_send_server_hello(SSL *s);
int dtls1_send_server_certificate(SSL *s);
int dtls1_send_server_key_exchange(SSL *s);
int dtls1_send_certificate_request(SSL *s);