summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libssl/d1_both.c43
-rw-r--r--src/lib/libssl/d1_clnt.c4
-rw-r--r--src/lib/libssl/d1_srvr.c4
-rw-r--r--src/lib/libssl/src/ssl/d1_both.c43
-rw-r--r--src/lib/libssl/src/ssl/d1_clnt.c4
-rw-r--r--src/lib/libssl/src/ssl/d1_srvr.c4
-rw-r--r--src/lib/libssl/src/ssl/ssl_locl.h3
-rw-r--r--src/lib/libssl/ssl_locl.h3
8 files changed, 12 insertions, 96 deletions
diff --git a/src/lib/libssl/d1_both.c b/src/lib/libssl/d1_both.c
index 4d2827a2c0..dd67028a38 100644
--- a/src/lib/libssl/d1_both.c
+++ b/src/lib/libssl/d1_both.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: d1_both.c,v 1.36 2015/09/11 15:59:21 jsing Exp $ */ 1/* $OpenBSD: d1_both.c,v 1.37 2015/09/11 16:28:37 jsing Exp $ */
2/* 2/*
3 * DTLS implementation written by Nagendra Modadugu 3 * DTLS implementation written by Nagendra Modadugu
4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -902,47 +902,6 @@ f_err:
902 return (-1); 902 return (-1);
903} 903}
904 904
905int
906dtls1_send_finished(SSL *s, int a, int b, const char *sender, int slen)
907{
908 unsigned char *p;
909 int i;
910 unsigned long l;
911
912 if (s->state == a) {
913 p = ssl3_handshake_msg_start(s, SSL3_MT_FINISHED);
914
915 i = s->method->ssl3_enc->final_finish_mac(s, sender, slen,
916 s->s3->tmp.finish_md);
917 s->s3->tmp.finish_md_len = i;
918 memcpy(p, s->s3->tmp.finish_md, i);
919 p += i;
920 l = i;
921
922 /*
923 * Copy the finished so we can use it for
924 * renegotiation checks
925 */
926 if (s->type == SSL_ST_CONNECT) {
927 OPENSSL_assert(i <= EVP_MAX_MD_SIZE);
928 memcpy(s->s3->previous_client_finished,
929 s->s3->tmp.finish_md, i);
930 s->s3->previous_client_finished_len = i;
931 } else {
932 OPENSSL_assert(i <= EVP_MAX_MD_SIZE);
933 memcpy(s->s3->previous_server_finished,
934 s->s3->tmp.finish_md, i);
935 s->s3->previous_server_finished_len = i;
936 }
937
938 ssl3_handshake_msg_finish(s, l);
939
940 s->state = b;
941 }
942
943 return (ssl3_handshake_write(s));
944}
945
946/* 905/*
947 * for these 2 messages, we need to 906 * for these 2 messages, we need to
948 * ssl->enc_read_ctx re-init 907 * ssl->enc_read_ctx re-init
diff --git a/src/lib/libssl/d1_clnt.c b/src/lib/libssl/d1_clnt.c
index 5a755c3bbe..f5745b1e7d 100644
--- a/src/lib/libssl/d1_clnt.c
+++ b/src/lib/libssl/d1_clnt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: d1_clnt.c,v 1.50 2015/09/10 17:57:50 jsing Exp $ */ 1/* $OpenBSD: d1_clnt.c,v 1.51 2015/09/11 16:28:37 jsing Exp $ */
2/* 2/*
3 * DTLS implementation written by Nagendra Modadugu 3 * DTLS implementation written by Nagendra Modadugu
4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -457,7 +457,7 @@ dtls1_connect(SSL *s)
457 case SSL3_ST_CW_FINISHED_B: 457 case SSL3_ST_CW_FINISHED_B:
458 if (!s->hit) 458 if (!s->hit)
459 dtls1_start_timer(s); 459 dtls1_start_timer(s);
460 ret = dtls1_send_finished(s, 460 ret = ssl3_send_finished(s,
461 SSL3_ST_CW_FINISHED_A, SSL3_ST_CW_FINISHED_B, 461 SSL3_ST_CW_FINISHED_A, SSL3_ST_CW_FINISHED_B,
462 s->method->ssl3_enc->client_finished_label, 462 s->method->ssl3_enc->client_finished_label,
463 s->method->ssl3_enc->client_finished_label_len); 463 s->method->ssl3_enc->client_finished_label_len);
diff --git a/src/lib/libssl/d1_srvr.c b/src/lib/libssl/d1_srvr.c
index e41c119b9c..66f79c3953 100644
--- a/src/lib/libssl/d1_srvr.c
+++ b/src/lib/libssl/d1_srvr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: d1_srvr.c,v 1.56 2015/09/10 17:57:50 jsing Exp $ */ 1/* $OpenBSD: d1_srvr.c,v 1.57 2015/09/11 16:28:37 jsing Exp $ */
2/* 2/*
3 * DTLS implementation written by Nagendra Modadugu 3 * DTLS implementation written by Nagendra Modadugu
4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -584,7 +584,7 @@ dtls1_accept(SSL *s)
584 584
585 case SSL3_ST_SW_FINISHED_A: 585 case SSL3_ST_SW_FINISHED_A:
586 case SSL3_ST_SW_FINISHED_B: 586 case SSL3_ST_SW_FINISHED_B:
587 ret = dtls1_send_finished(s, 587 ret = ssl3_send_finished(s,
588 SSL3_ST_SW_FINISHED_A, SSL3_ST_SW_FINISHED_B, 588 SSL3_ST_SW_FINISHED_A, SSL3_ST_SW_FINISHED_B,
589 s->method->ssl3_enc->server_finished_label, 589 s->method->ssl3_enc->server_finished_label,
590 s->method->ssl3_enc->server_finished_label_len); 590 s->method->ssl3_enc->server_finished_label_len);
diff --git a/src/lib/libssl/src/ssl/d1_both.c b/src/lib/libssl/src/ssl/d1_both.c
index 4d2827a2c0..dd67028a38 100644
--- a/src/lib/libssl/src/ssl/d1_both.c
+++ b/src/lib/libssl/src/ssl/d1_both.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: d1_both.c,v 1.36 2015/09/11 15:59:21 jsing Exp $ */ 1/* $OpenBSD: d1_both.c,v 1.37 2015/09/11 16:28:37 jsing Exp $ */
2/* 2/*
3 * DTLS implementation written by Nagendra Modadugu 3 * DTLS implementation written by Nagendra Modadugu
4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -902,47 +902,6 @@ f_err:
902 return (-1); 902 return (-1);
903} 903}
904 904
905int
906dtls1_send_finished(SSL *s, int a, int b, const char *sender, int slen)
907{
908 unsigned char *p;
909 int i;
910 unsigned long l;
911
912 if (s->state == a) {
913 p = ssl3_handshake_msg_start(s, SSL3_MT_FINISHED);
914
915 i = s->method->ssl3_enc->final_finish_mac(s, sender, slen,
916 s->s3->tmp.finish_md);
917 s->s3->tmp.finish_md_len = i;
918 memcpy(p, s->s3->tmp.finish_md, i);
919 p += i;
920 l = i;
921
922 /*
923 * Copy the finished so we can use it for
924 * renegotiation checks
925 */
926 if (s->type == SSL_ST_CONNECT) {
927 OPENSSL_assert(i <= EVP_MAX_MD_SIZE);
928 memcpy(s->s3->previous_client_finished,
929 s->s3->tmp.finish_md, i);
930 s->s3->previous_client_finished_len = i;
931 } else {
932 OPENSSL_assert(i <= EVP_MAX_MD_SIZE);
933 memcpy(s->s3->previous_server_finished,
934 s->s3->tmp.finish_md, i);
935 s->s3->previous_server_finished_len = i;
936 }
937
938 ssl3_handshake_msg_finish(s, l);
939
940 s->state = b;
941 }
942
943 return (ssl3_handshake_write(s));
944}
945
946/* 905/*
947 * for these 2 messages, we need to 906 * for these 2 messages, we need to
948 * ssl->enc_read_ctx re-init 907 * ssl->enc_read_ctx re-init
diff --git a/src/lib/libssl/src/ssl/d1_clnt.c b/src/lib/libssl/src/ssl/d1_clnt.c
index 5a755c3bbe..f5745b1e7d 100644
--- a/src/lib/libssl/src/ssl/d1_clnt.c
+++ b/src/lib/libssl/src/ssl/d1_clnt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: d1_clnt.c,v 1.50 2015/09/10 17:57:50 jsing Exp $ */ 1/* $OpenBSD: d1_clnt.c,v 1.51 2015/09/11 16:28:37 jsing Exp $ */
2/* 2/*
3 * DTLS implementation written by Nagendra Modadugu 3 * DTLS implementation written by Nagendra Modadugu
4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -457,7 +457,7 @@ dtls1_connect(SSL *s)
457 case SSL3_ST_CW_FINISHED_B: 457 case SSL3_ST_CW_FINISHED_B:
458 if (!s->hit) 458 if (!s->hit)
459 dtls1_start_timer(s); 459 dtls1_start_timer(s);
460 ret = dtls1_send_finished(s, 460 ret = ssl3_send_finished(s,
461 SSL3_ST_CW_FINISHED_A, SSL3_ST_CW_FINISHED_B, 461 SSL3_ST_CW_FINISHED_A, SSL3_ST_CW_FINISHED_B,
462 s->method->ssl3_enc->client_finished_label, 462 s->method->ssl3_enc->client_finished_label,
463 s->method->ssl3_enc->client_finished_label_len); 463 s->method->ssl3_enc->client_finished_label_len);
diff --git a/src/lib/libssl/src/ssl/d1_srvr.c b/src/lib/libssl/src/ssl/d1_srvr.c
index e41c119b9c..66f79c3953 100644
--- a/src/lib/libssl/src/ssl/d1_srvr.c
+++ b/src/lib/libssl/src/ssl/d1_srvr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: d1_srvr.c,v 1.56 2015/09/10 17:57:50 jsing Exp $ */ 1/* $OpenBSD: d1_srvr.c,v 1.57 2015/09/11 16:28:37 jsing Exp $ */
2/* 2/*
3 * DTLS implementation written by Nagendra Modadugu 3 * DTLS implementation written by Nagendra Modadugu
4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -584,7 +584,7 @@ dtls1_accept(SSL *s)
584 584
585 case SSL3_ST_SW_FINISHED_A: 585 case SSL3_ST_SW_FINISHED_A:
586 case SSL3_ST_SW_FINISHED_B: 586 case SSL3_ST_SW_FINISHED_B:
587 ret = dtls1_send_finished(s, 587 ret = ssl3_send_finished(s,
588 SSL3_ST_SW_FINISHED_A, SSL3_ST_SW_FINISHED_B, 588 SSL3_ST_SW_FINISHED_A, SSL3_ST_SW_FINISHED_B,
589 s->method->ssl3_enc->server_finished_label, 589 s->method->ssl3_enc->server_finished_label,
590 s->method->ssl3_enc->server_finished_label_len); 590 s->method->ssl3_enc->server_finished_label_len);
diff --git a/src/lib/libssl/src/ssl/ssl_locl.h b/src/lib/libssl/src/ssl/ssl_locl.h
index 8c8dec77b6..ea14ae0398 100644
--- a/src/lib/libssl/src/ssl/ssl_locl.h
+++ b/src/lib/libssl/src/ssl/ssl_locl.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_locl.h,v 1.103 2015/09/02 17:59:15 jsing Exp $ */ 1/* $OpenBSD: ssl_locl.h,v 1.104 2015/09/11 16:28:37 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 *
@@ -685,7 +685,6 @@ int dtls1_write_app_data_bytes(SSL *s, int type, const void *buf, int len);
685int dtls1_write_bytes(SSL *s, int type, const void *buf, int len); 685int dtls1_write_bytes(SSL *s, int type, const void *buf, int len);
686 686
687int dtls1_send_change_cipher_spec(SSL *s, int a, int b); 687int dtls1_send_change_cipher_spec(SSL *s, int a, int b);
688int dtls1_send_finished(SSL *s, int a, int b, const char *sender, int slen);
689unsigned long dtls1_output_cert_chain(SSL *s, X509 *x); 688unsigned long dtls1_output_cert_chain(SSL *s, X509 *x);
690int dtls1_read_failed(SSL *s, int code); 689int dtls1_read_failed(SSL *s, int code);
691int dtls1_buffer_message(SSL *s, int ccs); 690int dtls1_buffer_message(SSL *s, int ccs);
diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h
index 8c8dec77b6..ea14ae0398 100644
--- a/src/lib/libssl/ssl_locl.h
+++ b/src/lib/libssl/ssl_locl.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_locl.h,v 1.103 2015/09/02 17:59:15 jsing Exp $ */ 1/* $OpenBSD: ssl_locl.h,v 1.104 2015/09/11 16:28:37 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 *
@@ -685,7 +685,6 @@ int dtls1_write_app_data_bytes(SSL *s, int type, const void *buf, int len);
685int dtls1_write_bytes(SSL *s, int type, const void *buf, int len); 685int dtls1_write_bytes(SSL *s, int type, const void *buf, int len);
686 686
687int dtls1_send_change_cipher_spec(SSL *s, int a, int b); 687int dtls1_send_change_cipher_spec(SSL *s, int a, int b);
688int dtls1_send_finished(SSL *s, int a, int b, const char *sender, int slen);
689unsigned long dtls1_output_cert_chain(SSL *s, X509 *x); 688unsigned long dtls1_output_cert_chain(SSL *s, X509 *x);
690int dtls1_read_failed(SSL *s, int code); 689int dtls1_read_failed(SSL *s, int code);
691int dtls1_buffer_message(SSL *s, int ccs); 690int dtls1_buffer_message(SSL *s, int ccs);