diff options
author | tb <> | 2021-09-10 08:59:56 +0000 |
---|---|---|
committer | tb <> | 2021-09-10 08:59:56 +0000 |
commit | a357ad8885ef643d07e2a6e6f4ccdf007d2d32b8 (patch) | |
tree | 920356e0a3fdd8308ee7f126bce5e3726386f5dc /src/lib | |
parent | 58d4b18b5c6fa0174ab459a1e96813c5050552af (diff) | |
download | openbsd-a357ad8885ef643d07e2a6e6f4ccdf007d2d32b8.tar.gz openbsd-a357ad8885ef643d07e2a6e6f4ccdf007d2d32b8.tar.bz2 openbsd-a357ad8885ef643d07e2a6e6f4ccdf007d2d32b8.zip |
Prepare to provide SSL_CTX_get0_privatekey()
ok beck
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libssl/ssl.h | 5 | ||||
-rw-r--r-- | src/lib/libssl/ssl_lib.c | 11 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/lib/libssl/ssl.h b/src/lib/libssl/ssl.h index 49335fc55a..7da3658d3f 100644 --- a/src/lib/libssl/ssl.h +++ b/src/lib/libssl/ssl.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl.h,v 1.200 2021/09/08 17:27:33 tb Exp $ */ | 1 | /* $OpenBSD: ssl.h,v 1.201 2021/09/10 08:59: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 | * |
@@ -1240,6 +1240,9 @@ long SSL_CTX_get_timeout(const SSL_CTX *ctx); | |||
1240 | X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *); | 1240 | X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *); |
1241 | void SSL_CTX_set_cert_store(SSL_CTX *, X509_STORE *); | 1241 | void SSL_CTX_set_cert_store(SSL_CTX *, X509_STORE *); |
1242 | X509 *SSL_CTX_get0_certificate(const SSL_CTX *ctx); | 1242 | X509 *SSL_CTX_get0_certificate(const SSL_CTX *ctx); |
1243 | #if defined(LIBRESSL_INTERNAL) | ||
1244 | EVP_PKEY *SSL_CTX_get0_privatekey(const SSL_CTX *ctx); | ||
1245 | #endif | ||
1243 | int SSL_want(const SSL *s); | 1246 | int SSL_want(const SSL *s); |
1244 | int SSL_clear(SSL *s); | 1247 | int SSL_clear(SSL *s); |
1245 | 1248 | ||
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index 430e9bdc12..0f86238d5e 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.267 2021/09/08 17:27:33 tb Exp $ */ | 1 | /* $OpenBSD: ssl_lib.c,v 1.268 2021/09/10 08:59: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 | * |
@@ -3058,6 +3058,15 @@ SSL_CTX_get0_certificate(const SSL_CTX *ctx) | |||
3058 | return ctx->internal->cert->key->x509; | 3058 | return ctx->internal->cert->key->x509; |
3059 | } | 3059 | } |
3060 | 3060 | ||
3061 | EVP_PKEY * | ||
3062 | SSL_CTX_get0_privatekey(const SSL_CTX *ctx) | ||
3063 | { | ||
3064 | if (ctx->internal->cert == NULL) | ||
3065 | return NULL; | ||
3066 | |||
3067 | return ctx->internal->cert->key->privatekey; | ||
3068 | } | ||
3069 | |||
3061 | int | 3070 | int |
3062 | SSL_want(const SSL *s) | 3071 | SSL_want(const SSL *s) |
3063 | { | 3072 | { |