From: eric Date: Sat, 10 Apr 2021 10:19:19 +0000 (+0000) Subject: remove dead code and unused dependencies X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=5d567127386aabb8c62f17552a91e4e0db54786b;p=openbsd remove dead code and unused dependencies ok tb@ --- diff --git a/usr.sbin/smtpd/smtp/Makefile b/usr.sbin/smtpd/smtp/Makefile index db5f178312f..0555dad027c 100644 --- a/usr.sbin/smtpd/smtp/Makefile +++ b/usr.sbin/smtpd/smtp/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.4 2021/03/05 12:37:32 eric Exp $ +# $OpenBSD: Makefile,v 1.5 2021/04/10 10:19:19 eric Exp $ .PATH: ${.CURDIR}/.. @@ -12,12 +12,10 @@ SRCS+= ioev.c SRCS+= log.c SRCS+= smtp_client.c SRCS+= smtpc.c -SRCS+= ssl.c -SRCS+= ssl_verify.c CPPFLAGS+= -DIO_TLS -LDADD+= -levent -lutil -ltls -lssl -lcrypto -lm -lz -DPADD+= ${LIBEVENT} ${LIBUTIL} ${LIBTLS} ${LIBSSL} ${LIBCRYPTO} ${LIBM} ${LIBZ} +LDADD+= -levent -lutil -ltls -lssl -lcrypto +DPADD+= ${LIBEVENT} ${LIBUTIL} ${LIBTLS} ${LIBSSL} ${LIBCRYPTO} .include diff --git a/usr.sbin/smtpd/smtpc.c b/usr.sbin/smtpd/smtpc.c index fd0f8ef3652..ca48604feb5 100644 --- a/usr.sbin/smtpd/smtpc.c +++ b/usr.sbin/smtpd/smtpc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpc.c,v 1.14 2021/03/05 12:37:32 eric Exp $ */ +/* $OpenBSD: smtpc.c,v 1.15 2021/04/10 10:19:19 eric Exp $ */ /* * Copyright (c) 2018 Eric Faurot @@ -32,10 +32,7 @@ #include #include -#include - #include "smtp.h" -#include "ssl.h" #include "log.h" static void parse_server(char *); @@ -370,37 +367,6 @@ log_trace(int lvl, const char *emsg, ...) } } -void -smtp_verify_server_cert(void *tag, struct smtp_client *proto, void *ctx) -{ - SSL *ssl = ctx; - X509 *cert; - long res; - int match; - - if ((cert = SSL_get_peer_certificate(ssl))) { - (void)ssl_check_name(cert, servname, &match); - X509_free(cert); - res = SSL_get_verify_result(ssl); - if (res == X509_V_OK) { - if (match) { - log_debug("valid certificate"); - smtp_cert_verified(proto, CERT_OK); - } - else { - log_debug("certificate does not match hostname"); - smtp_cert_verified(proto, CERT_INVALID); - } - return; - } - log_debug("certificate validation error %ld", res); - } - else - log_debug("no certificate provided"); - - smtp_cert_verified(proto, CERT_INVALID); -} - void smtp_require_tls(void *tag, struct smtp_client *proto) {