diff options
| author | tb <> | 2023-11-19 15:51:49 +0000 |
|---|---|---|
| committer | tb <> | 2023-11-19 15:51:49 +0000 |
| commit | aeabb2194b33a83bfaeb9720b483321f7244a982 (patch) | |
| tree | 4d4566481f9384da75d08186ae99eaccd2b1b02d /src | |
| parent | 0822368d2c2280cffb45de621306b0a04716bb24 (diff) | |
| download | openbsd-aeabb2194b33a83bfaeb9720b483321f7244a982.tar.gz openbsd-aeabb2194b33a83bfaeb9720b483321f7244a982.tar.bz2 openbsd-aeabb2194b33a83bfaeb9720b483321f7244a982.zip | |
Unifdef OPENSSL_NO_ENGINE in libssl
As usual, a few manual fixes to avoid duplicate lines.
ok jsing
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libssl/ssl.h | 5 | ||||
| -rw-r--r-- | src/lib/libssl/ssl_ciph.c | 6 | ||||
| -rw-r--r-- | src/lib/libssl/ssl_lib.c | 30 | ||||
| -rw-r--r-- | src/lib/libssl/ssl_local.h | 8 | ||||
| -rw-r--r-- | src/lib/libssl/ssl_sess.c | 25 |
5 files changed, 5 insertions, 69 deletions
diff --git a/src/lib/libssl/ssl.h b/src/lib/libssl/ssl.h index acde94c749..4ef6f6df7f 100644 --- a/src/lib/libssl/ssl.h +++ b/src/lib/libssl/ssl.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ssl.h,v 1.230 2022/12/26 07:31:44 jmc Exp $ */ | 1 | /* $OpenBSD: ssl.h,v 1.231 2023/11/19 15:51:49 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 | * |
| @@ -610,9 +610,6 @@ void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx, | |||
| 610 | int (*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey)); | 610 | int (*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey)); |
| 611 | int (*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx))(SSL *ssl, X509 **x509, | 611 | int (*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx))(SSL *ssl, X509 **x509, |
| 612 | EVP_PKEY **pkey); | 612 | EVP_PKEY **pkey); |
| 613 | #ifndef OPENSSL_NO_ENGINE | ||
| 614 | int SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e); | ||
| 615 | #endif | ||
| 616 | void SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx, | 613 | void SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx, |
| 617 | int (*app_gen_cookie_cb)(SSL *ssl, unsigned char *cookie, | 614 | int (*app_gen_cookie_cb)(SSL *ssl, unsigned char *cookie, |
| 618 | unsigned int *cookie_len)); | 615 | unsigned int *cookie_len)); |
diff --git a/src/lib/libssl/ssl_ciph.c b/src/lib/libssl/ssl_ciph.c index b735cd7b30..38ebea1629 100644 --- a/src/lib/libssl/ssl_ciph.c +++ b/src/lib/libssl/ssl_ciph.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ssl_ciph.c,v 1.136 2023/07/08 16:40:13 beck Exp $ */ | 1 | /* $OpenBSD: ssl_ciph.c,v 1.137 2023/11/19 15:51:49 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 | * |
| @@ -145,10 +145,6 @@ | |||
| 145 | #include <openssl/objects.h> | 145 | #include <openssl/objects.h> |
| 146 | #include <openssl/opensslconf.h> | 146 | #include <openssl/opensslconf.h> |
| 147 | 147 | ||
| 148 | #ifndef OPENSSL_NO_ENGINE | ||
| 149 | #include <openssl/engine.h> | ||
| 150 | #endif | ||
| 151 | |||
| 152 | #include "ssl_local.h" | 148 | #include "ssl_local.h" |
| 153 | 149 | ||
| 154 | #define CIPHER_ADD 1 | 150 | #define CIPHER_ADD 1 |
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index 0ac393f73c..9e65095c6c 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.314 2023/09/19 01:22:31 tb Exp $ */ | 1 | /* $OpenBSD: ssl_lib.c,v 1.315 2023/11/19 15:51:49 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 | * |
| @@ -154,10 +154,6 @@ | |||
| 154 | #include <openssl/opensslconf.h> | 154 | #include <openssl/opensslconf.h> |
| 155 | #include <openssl/x509v3.h> | 155 | #include <openssl/x509v3.h> |
| 156 | 156 | ||
| 157 | #ifndef OPENSSL_NO_ENGINE | ||
| 158 | #include <openssl/engine.h> | ||
| 159 | #endif | ||
| 160 | |||
| 161 | #include "bytestring.h" | 157 | #include "bytestring.h" |
| 162 | #include "dtls_local.h" | 158 | #include "dtls_local.h" |
| 163 | #include "ssl_local.h" | 159 | #include "ssl_local.h" |
| @@ -2164,26 +2160,6 @@ SSL_CTX_new(const SSL_METHOD *meth) | |||
| 2164 | ret->tlsext_status_cb = 0; | 2160 | ret->tlsext_status_cb = 0; |
| 2165 | ret->tlsext_status_arg = NULL; | 2161 | ret->tlsext_status_arg = NULL; |
| 2166 | 2162 | ||
| 2167 | #ifndef OPENSSL_NO_ENGINE | ||
| 2168 | ret->client_cert_engine = NULL; | ||
| 2169 | #ifdef OPENSSL_SSL_CLIENT_ENGINE_AUTO | ||
| 2170 | #define eng_strx(x) #x | ||
| 2171 | #define eng_str(x) eng_strx(x) | ||
| 2172 | /* Use specific client engine automatically... ignore errors */ | ||
| 2173 | { | ||
| 2174 | ENGINE *eng; | ||
| 2175 | eng = ENGINE_by_id(eng_str(OPENSSL_SSL_CLIENT_ENGINE_AUTO)); | ||
| 2176 | if (!eng) { | ||
| 2177 | ERR_clear_error(); | ||
| 2178 | ENGINE_load_builtin_engines(); | ||
| 2179 | eng = ENGINE_by_id(eng_str( | ||
| 2180 | OPENSSL_SSL_CLIENT_ENGINE_AUTO)); | ||
| 2181 | } | ||
| 2182 | if (!eng || !SSL_CTX_set_client_cert_engine(ret, eng)) | ||
| 2183 | ERR_clear_error(); | ||
| 2184 | } | ||
| 2185 | #endif | ||
| 2186 | #endif | ||
| 2187 | /* | 2163 | /* |
| 2188 | * Default is to connect to non-RI servers. When RI is more widely | 2164 | * Default is to connect to non-RI servers. When RI is more widely |
| 2189 | * deployed might change this. | 2165 | * deployed might change this. |
| @@ -2241,10 +2217,6 @@ SSL_CTX_free(SSL_CTX *ctx) | |||
| 2241 | sk_SRTP_PROTECTION_PROFILE_free(ctx->srtp_profiles); | 2217 | sk_SRTP_PROTECTION_PROFILE_free(ctx->srtp_profiles); |
| 2242 | #endif | 2218 | #endif |
| 2243 | 2219 | ||
| 2244 | #ifndef OPENSSL_NO_ENGINE | ||
| 2245 | ENGINE_finish(ctx->client_cert_engine); | ||
| 2246 | #endif | ||
| 2247 | |||
| 2248 | free(ctx->tlsext_ecpointformatlist); | 2220 | free(ctx->tlsext_ecpointformatlist); |
| 2249 | free(ctx->tlsext_supportedgroups); | 2221 | free(ctx->tlsext_supportedgroups); |
| 2250 | 2222 | ||
diff --git a/src/lib/libssl/ssl_local.h b/src/lib/libssl/ssl_local.h index 9666f3882a..dd8895f018 100644 --- a/src/lib/libssl/ssl_local.h +++ b/src/lib/libssl/ssl_local.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ssl_local.h,v 1.7 2023/07/06 07:56:32 beck Exp $ */ | 1 | /* $OpenBSD: ssl_local.h,v 1.8 2023/11/19 15:51:49 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 | * |
| @@ -865,12 +865,6 @@ struct ssl_ctx_st { | |||
| 865 | */ | 865 | */ |
| 866 | unsigned int max_send_fragment; | 866 | unsigned int max_send_fragment; |
| 867 | 867 | ||
| 868 | #ifndef OPENSSL_NO_ENGINE | ||
| 869 | /* Engine to pass requests for client certs to | ||
| 870 | */ | ||
| 871 | ENGINE *client_cert_engine; | ||
| 872 | #endif | ||
| 873 | |||
| 874 | /* RFC 4507 session ticket keys */ | 868 | /* RFC 4507 session ticket keys */ |
| 875 | unsigned char tlsext_tick_key_name[16]; | 869 | unsigned char tlsext_tick_key_name[16]; |
| 876 | unsigned char tlsext_tick_hmac_key[16]; | 870 | unsigned char tlsext_tick_hmac_key[16]; |
diff --git a/src/lib/libssl/ssl_sess.c b/src/lib/libssl/ssl_sess.c index aa6b08eae6..ae7532d1ad 100644 --- a/src/lib/libssl/ssl_sess.c +++ b/src/lib/libssl/ssl_sess.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ssl_sess.c,v 1.122 2023/07/08 16:40:13 beck Exp $ */ | 1 | /* $OpenBSD: ssl_sess.c,v 1.123 2023/11/19 15:51:49 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 | * |
| @@ -138,10 +138,6 @@ | |||
| 138 | #include <openssl/lhash.h> | 138 | #include <openssl/lhash.h> |
| 139 | #include <openssl/opensslconf.h> | 139 | #include <openssl/opensslconf.h> |
| 140 | 140 | ||
| 141 | #ifndef OPENSSL_NO_ENGINE | ||
| 142 | #include <openssl/engine.h> | ||
| 143 | #endif | ||
| 144 | |||
| 145 | #include "ssl_local.h" | 141 | #include "ssl_local.h" |
| 146 | 142 | ||
| 147 | static void SSL_SESSION_list_remove(SSL_CTX *ctx, SSL_SESSION *s); | 143 | static void SSL_SESSION_list_remove(SSL_CTX *ctx, SSL_SESSION *s); |
| @@ -1320,25 +1316,6 @@ int | |||
| 1320 | } | 1316 | } |
| 1321 | LSSL_ALIAS(SSL_CTX_get_client_cert_cb); | 1317 | LSSL_ALIAS(SSL_CTX_get_client_cert_cb); |
| 1322 | 1318 | ||
| 1323 | #ifndef OPENSSL_NO_ENGINE | ||
| 1324 | int | ||
| 1325 | SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e) | ||
| 1326 | { | ||
| 1327 | if (!ENGINE_init(e)) { | ||
| 1328 | SSLerrorx(ERR_R_ENGINE_LIB); | ||
| 1329 | return 0; | ||
| 1330 | } | ||
| 1331 | if (!ENGINE_get_ssl_client_cert_function(e)) { | ||
| 1332 | SSLerrorx(SSL_R_NO_CLIENT_CERT_METHOD); | ||
| 1333 | ENGINE_finish(e); | ||
| 1334 | return 0; | ||
| 1335 | } | ||
| 1336 | ctx->client_cert_engine = e; | ||
| 1337 | return 1; | ||
| 1338 | } | ||
| 1339 | LSSL_ALIAS(SSL_CTX_set_client_cert_engine); | ||
| 1340 | #endif | ||
| 1341 | |||
| 1342 | void | 1319 | void |
| 1343 | SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx, | 1320 | SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx, |
| 1344 | int (*cb)(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len)) | 1321 | int (*cb)(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len)) |
