diff options
Diffstat (limited to 'src/lib/libssl/ssl_lib.c')
-rw-r--r-- | src/lib/libssl/ssl_lib.c | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index adcaa1b3cc..bf370cbfb2 100644 --- a/src/lib/libssl/ssl_lib.c +++ b/src/lib/libssl/ssl_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_lib.c,v 1.204 2019/03/25 17:33:26 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_lib.c,v 1.205 2019/05/15 09:13:16 bcook 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 | * |
@@ -696,14 +696,12 @@ err: | |||
696 | size_t | 696 | size_t |
697 | SSL_get_finished(const SSL *s, void *buf, size_t count) | 697 | SSL_get_finished(const SSL *s, void *buf, size_t count) |
698 | { | 698 | { |
699 | size_t ret = 0; | 699 | size_t ret; |
700 | 700 | ||
701 | if (s->s3 != NULL) { | 701 | ret = S3I(s)->tmp.finish_md_len; |
702 | ret = S3I(s)->tmp.finish_md_len; | 702 | if (count > ret) |
703 | if (count > ret) | 703 | count = ret; |
704 | count = ret; | 704 | memcpy(buf, S3I(s)->tmp.finish_md, count); |
705 | memcpy(buf, S3I(s)->tmp.finish_md, count); | ||
706 | } | ||
707 | return (ret); | 705 | return (ret); |
708 | } | 706 | } |
709 | 707 | ||
@@ -711,14 +709,12 @@ SSL_get_finished(const SSL *s, void *buf, size_t count) | |||
711 | size_t | 709 | size_t |
712 | SSL_get_peer_finished(const SSL *s, void *buf, size_t count) | 710 | SSL_get_peer_finished(const SSL *s, void *buf, size_t count) |
713 | { | 711 | { |
714 | size_t ret = 0; | 712 | size_t ret; |
715 | 713 | ||
716 | if (s->s3 != NULL) { | 714 | ret = S3I(s)->tmp.peer_finish_md_len; |
717 | ret = S3I(s)->tmp.peer_finish_md_len; | 715 | if (count > ret) |
718 | if (count > ret) | 716 | count = ret; |
719 | count = ret; | 717 | memcpy(buf, S3I(s)->tmp.peer_finish_md, count); |
720 | memcpy(buf, S3I(s)->tmp.peer_finish_md, count); | ||
721 | } | ||
722 | return (ret); | 718 | return (ret); |
723 | } | 719 | } |
724 | 720 | ||
@@ -1637,10 +1633,8 @@ SSL_get0_alpn_selected(const SSL *ssl, const unsigned char **data, | |||
1637 | *data = NULL; | 1633 | *data = NULL; |
1638 | *len = 0; | 1634 | *len = 0; |
1639 | 1635 | ||
1640 | if (ssl->s3 != NULL) { | 1636 | *data = ssl->s3->internal->alpn_selected; |
1641 | *data = ssl->s3->internal->alpn_selected; | 1637 | *len = ssl->s3->internal->alpn_selected_len; |
1642 | *len = ssl->s3->internal->alpn_selected_len; | ||
1643 | } | ||
1644 | } | 1638 | } |
1645 | 1639 | ||
1646 | int | 1640 | int |