This diff removes unused code and lib depends from smtp(1).
Eric.
Index: smtpc.c
===================================================================
RCS file: /cvs/src/usr.sbin/smtpd/smtpc.c,v
retrieving revision 1.14
diff -u -p -r1.14 smtpc.c
--- smtpc.c 5 Mar 2021 12:37:32 -0000 1.14
+++ smtpc.c 10 Apr 2021 08:25:20 -0000
@@ -32,10 +32,7 @@
#include <tls.h>
#include <unistd.h>
-#include <openssl/ssl.h>
-
#include "smtp.h"
-#include "ssl.h"
#include "log.h"
static void parse_server(char *);
@@ -368,37 +365,6 @@ log_trace(int lvl, const char *emsg, ...
vlog(LOG_DEBUG, emsg, ap);
va_end(ap);
}
-}
-
-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
Index: smtp/Makefile
===================================================================
RCS file: /cvs/src/usr.sbin/smtpd/smtp/Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile
--- smtp/Makefile 5 Mar 2021 12:37:32 -0000 1.4
+++ smtp/Makefile 10 Apr 2021 08:25:20 -0000
@@ -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
+DPADD+= ${LIBEVENT} ${LIBUTIL} ${LIBTLS}
.include <bsd.prog.mk>