From: op Date: Sun, 25 Jun 2023 08:07:38 +0000 (+0000) Subject: remove ssl_init() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4958adbcc07dab37012b2df3f33ffe005be875c7;p=openbsd remove ssl_init() it's a noop; nowadays both LibreSSL and OpenSSL libcrypto and libssl initialize themselves automatically before doing anything. ok tb --- diff --git a/usr.sbin/relayd/config.c b/usr.sbin/relayd/config.c index a2f1c130d6b..b8f91bb7ad1 100644 --- a/usr.sbin/relayd/config.c +++ b/usr.sbin/relayd/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.43 2021/12/05 13:48:14 jsg Exp $ */ +/* $OpenBSD: config.c,v 1.44 2023/06/25 08:07:38 op Exp $ */ /* * Copyright (c) 2011 - 2014 Reyk Floeter @@ -293,7 +293,6 @@ config_getcfg(struct relayd *env, struct imsg *imsg) } if (env->sc_conf.flags & (F_TLS|F_TLSCLIENT)) { - ssl_init(env); if (what & CONFIG_CA_ENGINE) ca_engine_init(env); } diff --git a/usr.sbin/relayd/relayd.c b/usr.sbin/relayd/relayd.c index edc86218960..df93c9527cb 100644 --- a/usr.sbin/relayd/relayd.c +++ b/usr.sbin/relayd/relayd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relayd.c,v 1.190 2022/11/10 00:00:11 mbuhl Exp $ */ +/* $OpenBSD: relayd.c,v 1.191 2023/06/25 08:07:38 op Exp $ */ /* * Copyright (c) 2007 - 2016 Reyk Floeter @@ -255,9 +255,6 @@ main(int argc, char *argv[]) exit(0); } - if (env->sc_conf.flags & (F_TLS|F_TLSCLIENT)) - ssl_init(env); - /* rekey the TLS tickets before pushing the config */ parent_tls_ticket_rekey(0, 0, env); if (parent_configure(env) == -1) diff --git a/usr.sbin/relayd/relayd.h b/usr.sbin/relayd/relayd.h index 990cec3505f..ca178871a51 100644 --- a/usr.sbin/relayd/relayd.h +++ b/usr.sbin/relayd/relayd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: relayd.h,v 1.270 2023/06/21 07:54:54 claudio Exp $ */ +/* $OpenBSD: relayd.h,v 1.271 2023/06/25 08:07:39 op Exp $ */ /* * Copyright (c) 2006 - 2016 Reyk Floeter @@ -1293,7 +1293,6 @@ void script_done(struct relayd *, struct ctl_script *); int script_exec(struct relayd *, struct ctl_script *); /* ssl.c */ -void ssl_init(struct relayd *); char *ssl_load_key(struct relayd *, const char *, off_t *, char *); uint8_t *ssl_update_certificate(const uint8_t *, size_t, EVP_PKEY *, EVP_PKEY *, X509 *, size_t *); diff --git a/usr.sbin/relayd/ssl.c b/usr.sbin/relayd/ssl.c index 0d76f8ba5eb..31eebee64e4 100644 --- a/usr.sbin/relayd/ssl.c +++ b/usr.sbin/relayd/ssl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl.c,v 1.36 2021/12/08 19:25:04 tb Exp $ */ +/* $OpenBSD: ssl.c,v 1.37 2023/06/25 08:07:39 op Exp $ */ /* * Copyright (c) 2007 - 2014 Reyk Floeter @@ -27,30 +27,11 @@ #include #include -#include #include "relayd.h" int ssl_password_cb(char *, int, int, void *); -void -ssl_init(struct relayd *env) -{ - static int initialized = 0; - - if (initialized) - return; - - SSL_library_init(); - SSL_load_error_strings(); - - /* Init hardware crypto engines. */ - ENGINE_load_builtin_engines(); - ENGINE_register_all_complete(); - - initialized = 1; -} - int ssl_password_cb(char *buf, int size, int rwflag, void *u) { @@ -73,9 +54,6 @@ ssl_load_key(struct relayd *env, const char *name, off_t *len, char *pass) long size; char *data, *buf = NULL; - /* Initialize SSL library once */ - ssl_init(env); - /* * Read (possibly) encrypted key from file */