diff options
author | tb <> | 2020-09-19 10:17:56 +0000 |
---|---|---|
committer | tb <> | 2020-09-19 10:17:56 +0000 |
commit | ecd45aad00b8302c0634f02c3fe281a9e68c54ed (patch) | |
tree | 9ead28bad57f20e29da93290281695e380d50735 /src | |
parent | ea977a7fe6f863754263a4149c1ea1c7a9a803fd (diff) | |
download | openbsd-ecd45aad00b8302c0634f02c3fe281a9e68c54ed.tar.gz openbsd-ecd45aad00b8302c0634f02c3fe281a9e68c54ed.tar.bz2 openbsd-ecd45aad00b8302c0634f02c3fe281a9e68c54ed.zip |
Prepare to provide SSL_get0_peername
This is a convenience reacharound to libcrypto that trivially wraps
X509_VERIFY_PARAM_get0_peername(). It is used by unbound 1.11.0 for
better logging. As it's part of the API that landed with OpenSSL's
DANE, more recent postfix snapshots use it as well.
ok beck inoguchi jsing
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libssl/ssl.h | 3 | ||||
-rw-r--r-- | src/lib/libssl/ssl_lib.c | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/lib/libssl/ssl.h b/src/lib/libssl/ssl.h index 093c4bde2d..ea1b9993df 100644 --- a/src/lib/libssl/ssl.h +++ b/src/lib/libssl/ssl.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl.h,v 1.176 2020/09/19 10:12:06 tb Exp $ */ | 1 | /* $OpenBSD: ssl.h,v 1.177 2020/09/19 10:17:56 tb 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 | * |
@@ -1443,6 +1443,7 @@ int SSL_set_purpose(SSL *s, int purpose); | |||
1443 | int SSL_CTX_set_trust(SSL_CTX *s, int trust); | 1443 | int SSL_CTX_set_trust(SSL_CTX *s, int trust); |
1444 | int SSL_set_trust(SSL *s, int trust); | 1444 | int SSL_set_trust(SSL *s, int trust); |
1445 | int SSL_set1_host(SSL *s, const char *hostname); | 1445 | int SSL_set1_host(SSL *s, const char *hostname); |
1446 | const char *SSL_get0_peername(SSL *s); | ||
1446 | 1447 | ||
1447 | X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx); | 1448 | X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx); |
1448 | int SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm); | 1449 | int SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm); |
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index b04b67df41..65d5614bfb 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.232 2020/09/19 10:12:06 tb Exp $ */ | 1 | /* $OpenBSD: ssl_lib.c,v 1.233 2020/09/19 10:17:56 tb 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 | * |
@@ -470,6 +470,12 @@ SSL_set1_host(SSL *s, const char *hostname) | |||
470 | return X509_VERIFY_PARAM_set1_host(s->param, hostname, 0); | 470 | return X509_VERIFY_PARAM_set1_host(s->param, hostname, 0); |
471 | } | 471 | } |
472 | 472 | ||
473 | const char * | ||
474 | SSL_get0_peername(SSL *s) | ||
475 | { | ||
476 | return X509_VERIFY_PARAM_get0_peername(s->param); | ||
477 | } | ||
478 | |||
473 | X509_VERIFY_PARAM * | 479 | X509_VERIFY_PARAM * |
474 | SSL_CTX_get0_param(SSL_CTX *ctx) | 480 | SSL_CTX_get0_param(SSL_CTX *ctx) |
475 | { | 481 | { |