diff options
| author | jsing <> | 2017-08-30 16:24:21 +0000 | 
|---|---|---|
| committer | jsing <> | 2017-08-30 16:24:21 +0000 | 
| commit | d5403ea18a4111f78be17230a52dc7b8b58ffd06 (patch) | |
| tree | 2e9868ec4720db25f2bcedb389793fdebefae7a9 /src | |
| parent | e93767c2b5f30f3ec6c7482212044b9300295b55 (diff) | |
| download | openbsd-d5403ea18a4111f78be17230a52dc7b8b58ffd06.tar.gz openbsd-d5403ea18a4111f78be17230a52dc7b8b58ffd06.tar.bz2 openbsd-d5403ea18a4111f78be17230a52dc7b8b58ffd06.zip | |
Bring back the NPN related symbols.
Several pieces of software make use of these based on a conditional around
OPENSSL_NPN_NEGOTIATED, rather than using the presence of the symbols, the
non-existence of a OPENSSL_NO_NEXTPROTONEG define or even the existence of
the TLS extension type.
Unfortunately we cannot remove OPENSSL_NPN_NEGOTIATED since the API for
ALPN was effectively botched and reuses two parts from the NPN
implementation, rather than providing ALPN specific or generic versions.
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libssl/Symbols.list | 3 | ||||
| -rw-r--r-- | src/lib/libssl/ssl.h | 10 | ||||
| -rw-r--r-- | src/lib/libssl/ssl_lib.c | 26 | 
3 files changed, 36 insertions, 3 deletions
| diff --git a/src/lib/libssl/Symbols.list b/src/lib/libssl/Symbols.list index 7b54776d55..e147ff873d 100644 --- a/src/lib/libssl/Symbols.list +++ b/src/lib/libssl/Symbols.list | |||
| @@ -100,6 +100,8 @@ SSL_CTX_set_info_callback | |||
| 100 | SSL_CTX_set_min_proto_version | 100 | SSL_CTX_set_min_proto_version | 
| 101 | SSL_CTX_set_max_proto_version | 101 | SSL_CTX_set_max_proto_version | 
| 102 | SSL_CTX_set_msg_callback | 102 | SSL_CTX_set_msg_callback | 
| 103 | SSL_CTX_set_next_proto_select_cb | ||
| 104 | SSL_CTX_set_next_protos_advertised_cb | ||
| 103 | SSL_CTX_set_purpose | 105 | SSL_CTX_set_purpose | 
| 104 | SSL_CTX_set_quiet_shutdown | 106 | SSL_CTX_set_quiet_shutdown | 
| 105 | SSL_CTX_set_session_id_context | 107 | SSL_CTX_set_session_id_context | 
| @@ -159,6 +161,7 @@ SSL_dup_CA_list | |||
| 159 | SSL_export_keying_material | 161 | SSL_export_keying_material | 
| 160 | SSL_free | 162 | SSL_free | 
| 161 | SSL_get0_alpn_selected | 163 | SSL_get0_alpn_selected | 
| 164 | SSL_get0_next_proto_negotiated | ||
| 162 | SSL_get1_session | 165 | SSL_get1_session | 
| 163 | SSL_get_SSL_CTX | 166 | SSL_get_SSL_CTX | 
| 164 | SSL_get_certificate | 167 | SSL_get_certificate | 
| diff --git a/src/lib/libssl/ssl.h b/src/lib/libssl/ssl.h index 2f0b9df402..d431b175ad 100644 --- a/src/lib/libssl/ssl.h +++ b/src/lib/libssl/ssl.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ssl.h,v 1.133 2017/08/28 17:36:58 jsing Exp $ */ | 1 | /* $OpenBSD: ssl.h,v 1.134 2017/08/30 16:24:21 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 | * | 
| @@ -752,11 +752,17 @@ void SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx, | |||
| 752 | void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx, | 752 | void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx, | 
| 753 | int (*app_verify_cookie_cb)(SSL *ssl, unsigned char *cookie, | 753 | int (*app_verify_cookie_cb)(SSL *ssl, unsigned char *cookie, | 
| 754 | unsigned int cookie_len)); | 754 | unsigned int cookie_len)); | 
| 755 | void SSL_CTX_set_next_protos_advertised_cb(SSL_CTX *s, int (*cb)(SSL *ssl, | ||
| 756 | const unsigned char **out, unsigned int *outlen, void *arg), void *arg); | ||
| 757 | void SSL_CTX_set_next_proto_select_cb(SSL_CTX *s, int (*cb)(SSL *ssl, | ||
| 758 | unsigned char **out, unsigned char *outlen, const unsigned char *in, | ||
| 759 | unsigned int inlen, void *arg), void *arg); | ||
| 755 | 760 | ||
| 756 | /* NPN support function used by ALPN */ | ||
| 757 | int SSL_select_next_proto(unsigned char **out, unsigned char *outlen, | 761 | int SSL_select_next_proto(unsigned char **out, unsigned char *outlen, | 
| 758 | const unsigned char *in, unsigned int inlen, const unsigned char *client, | 762 | const unsigned char *in, unsigned int inlen, const unsigned char *client, | 
| 759 | unsigned int client_len); | 763 | unsigned int client_len); | 
| 764 | void SSL_get0_next_proto_negotiated(const SSL *s, const unsigned char **data, | ||
| 765 | unsigned *len); | ||
| 760 | 766 | ||
| 761 | #define OPENSSL_NPN_UNSUPPORTED 0 | 767 | #define OPENSSL_NPN_UNSUPPORTED 0 | 
| 762 | #define OPENSSL_NPN_NEGOTIATED 1 | 768 | #define OPENSSL_NPN_NEGOTIATED 1 | 
| diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index b365ebd496..471fd7009e 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.169 2017/08/28 17:36:58 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_lib.c,v 1.170 2017/08/30 16:24:21 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 | * | 
| @@ -1590,6 +1590,30 @@ found: | |||
| 1590 | return (status); | 1590 | return (status); | 
| 1591 | } | 1591 | } | 
| 1592 | 1592 | ||
| 1593 | /* SSL_get0_next_proto_negotiated is deprecated. */ | ||
| 1594 | void | ||
| 1595 | SSL_get0_next_proto_negotiated(const SSL *s, const unsigned char **data, | ||
| 1596 | unsigned *len) | ||
| 1597 | { | ||
| 1598 | *data = NULL; | ||
| 1599 | *len = 0; | ||
| 1600 | } | ||
| 1601 | |||
| 1602 | /* SSL_CTX_set_next_protos_advertised_cb is deprecated. */ | ||
| 1603 | void | ||
| 1604 | SSL_CTX_set_next_protos_advertised_cb(SSL_CTX *ctx, int (*cb) (SSL *ssl, | ||
| 1605 | const unsigned char **out, unsigned int *outlen, void *arg), void *arg) | ||
| 1606 | { | ||
| 1607 | } | ||
| 1608 | |||
| 1609 | /* SSL_CTX_set_next_proto_select_cb is deprecated. */ | ||
| 1610 | void | ||
| 1611 | SSL_CTX_set_next_proto_select_cb(SSL_CTX *ctx, int (*cb) (SSL *s, | ||
| 1612 | unsigned char **out, unsigned char *outlen, const unsigned char *in, | ||
| 1613 | unsigned int inlen, void *arg), void *arg) | ||
| 1614 | { | ||
| 1615 | } | ||
| 1616 | |||
| 1593 | /* | 1617 | /* | 
| 1594 | * SSL_CTX_set_alpn_protos sets the ALPN protocol list to the specified | 1618 | * SSL_CTX_set_alpn_protos sets the ALPN protocol list to the specified | 
| 1595 | * protocols, which must be in wire-format (i.e. a series of non-empty, | 1619 | * protocols, which must be in wire-format (i.e. a series of non-empty, | 
