From 9702801129f0090124ffb1b6626ffa79ab8bef79 Mon Sep 17 00:00:00 2001 From: op Date: Sun, 25 Jun 2023 08:08:03 +0000 Subject: [PATCH] remove ssl_init() it's a noop; nowadays both LibreSSL and OpenSSL libcrypto and libssl initialize themselves automatically before doing anything. noticed by jsing, ok tb --- usr.sbin/smtpd/ssl.c | 25 +------------------------ usr.sbin/smtpd/ssl.h | 3 +-- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/usr.sbin/smtpd/ssl.c b/usr.sbin/smtpd/ssl.c index 9802ee144e8..ef719264f71 100644 --- a/usr.sbin/smtpd/ssl.c +++ b/usr.sbin/smtpd/ssl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl.c,v 1.99 2023/06/11 10:30:10 op Exp $ */ +/* $OpenBSD: ssl.c,v 1.100 2023/06/25 08:08:03 op Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard @@ -22,7 +22,6 @@ #include #include -#include #include #include #include @@ -31,25 +30,6 @@ #include "log.h" #include "ssl.h" -void -ssl_init(void) -{ - static int inited = 0; - - if (inited) - return; - - SSL_library_init(); - SSL_load_error_strings(); - - OpenSSL_add_all_algorithms(); - - /* Init hardware crypto engines. */ - ENGINE_load_builtin_engines(); - ENGINE_register_all_complete(); - inited = 1; -} - static char * ssl_load_file(const char *name, off_t *len, mode_t perm) { @@ -140,9 +120,6 @@ ssl_load_key(const char *name, off_t *len, char *pass, mode_t perm, const char * char mode[12]; char prompt[2048]; - /* Initialize SSL library once */ - ssl_init(); - /* * Read (possibly) encrypted key from file */ diff --git a/usr.sbin/smtpd/ssl.h b/usr.sbin/smtpd/ssl.h index 912e6a25f4e..ced63ebd6d4 100644 --- a/usr.sbin/smtpd/ssl.h +++ b/usr.sbin/smtpd/ssl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl.h,v 1.26 2022/02/18 16:57:36 millert Exp $ */ +/* $OpenBSD: ssl.h,v 1.27 2023/06/25 08:08:03 op Exp $ */ /* * Copyright (c) 2013 Gilles Chehade * @@ -39,7 +39,6 @@ struct ca { /* ssl.c */ -void ssl_init(void); void ssl_error(const char *); int ssl_load_certificate(struct pki *, const char *); int ssl_load_keyfile(struct pki *, const char *, const char *); -- 2.20.1