diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2009-08-07 20:21:49 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2009-08-07 20:21:49 +0000 |
commit | b10b63a94e21cd3e2dc553a03a4964b967b9420f (patch) | |
tree | 8893c52e3609bac905690af485100ab30d6c81ce /usr.sbin/smtpd | |
parent | 468afa9966703755ed46f0394e66dda494a978dc (diff) |
we were linking to libkeynote to use kn_base64_encode/decode, but honestly
this was a ugly hack, and i'd rather include resolv.h and use __b64_encode
and __b64_decode as openssh does. this commit kills all references to
libkeynote in smtpd, should help a bit with porting ... no functionnal
change.
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r-- | usr.sbin/smtpd/lka.c | 7 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtp_session.c | 11 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpd.c | 4 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpd/Makefile | 6 |
4 files changed, 12 insertions, 16 deletions
diff --git a/usr.sbin/smtpd/lka.c b/usr.sbin/smtpd/lka.c index 66978b8165d..b3e24c5c23e 100644 --- a/usr.sbin/smtpd/lka.c +++ b/usr.sbin/smtpd/lka.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lka.c,v 1.60 2009/06/07 05:56:25 eric Exp $ */ +/* $OpenBSD: lka.c,v 1.61 2009/08/07 20:21:48 gilles Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -33,14 +33,13 @@ #include <netdb.h> #include <pwd.h> #include <regex.h> +#include <resolv.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <keynote.h> - #include "smtpd.h" __dead void lka_shutdown(void); @@ -1161,7 +1160,7 @@ lka_encode_credentials(char *dst, size_t size, char *user) if ((buflen = asprintf(&buf, "%c%s%c%s", '\0', user, '\0', pass)) == -1) fatal(NULL); - if (kn_encode_base64(buf, buflen, dst, size) == -1) { + if (__b64_ntop(buf, buflen, dst, size) == -1) { free(buf); return 0; } diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c index 51e91b0b845..530c682a3c6 100644 --- a/usr.sbin/smtpd/smtp_session.c +++ b/usr.sbin/smtpd/smtp_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp_session.c,v 1.110 2009/08/06 17:09:13 gilles Exp $ */ +/* $OpenBSD: smtp_session.c,v 1.111 2009/08/07 20:21:48 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -34,13 +34,12 @@ #include <event.h> #include <pwd.h> #include <regex.h> +#include <resolv.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <keynote.h> - #include "smtpd.h" int session_rfc5321_helo_handler(struct session *, char *); @@ -195,7 +194,7 @@ session_rfc4954_auth_plain(struct session *s, char *arg) case S_AUTH_INIT: /* String is not NUL terminated, leave room. */ - if ((len = kn_decode_base64(arg, buf, sizeof(buf) - 1)) == -1) + if ((len = __b64_pton(arg, buf, sizeof(buf) - 1)) == -1) goto abort; /* buf is a byte string, NUL terminate. */ buf[len] = '\0'; @@ -248,7 +247,7 @@ session_rfc4954_auth_login(struct session *s, char *arg) case S_AUTH_USERNAME: bzero(a->user, sizeof(a->user)); - if (kn_decode_base64(arg, a->user, sizeof(a->user) - 1) == -1) + if (__b64_pton(arg, a->user, sizeof(a->user) - 1) == -1) goto abort; s->s_state = S_AUTH_PASSWORD; @@ -257,7 +256,7 @@ session_rfc4954_auth_login(struct session *s, char *arg) case S_AUTH_PASSWORD: bzero(a->pass, sizeof(a->pass)); - if (kn_decode_base64(arg, a->pass, sizeof(a->pass) - 1) == -1) + if (__b64_pton(arg, a->pass, sizeof(a->pass) - 1) == -1) goto abort; s->s_state = S_AUTH_FINALIZE; diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c index 02bdf26240d..207adeb2e23 100644 --- a/usr.sbin/smtpd/smtpd.c +++ b/usr.sbin/smtpd/smtpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.c,v 1.81 2009/08/07 19:02:55 gilles Exp $ */ +/* $OpenBSD: smtpd.c,v 1.82 2009/08/07 20:21:48 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -46,8 +46,6 @@ #include <time.h> #include <unistd.h> -#include <keynote.h> - #include "smtpd.h" __dead void usage(void); diff --git a/usr.sbin/smtpd/smtpd/Makefile b/usr.sbin/smtpd/smtpd/Makefile index 0bba5ba39ba..03549ef816d 100644 --- a/usr.sbin/smtpd/smtpd/Makefile +++ b/usr.sbin/smtpd/smtpd/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.10 2009/08/07 19:02:55 gilles Exp $ +# $OpenBSD: Makefile,v 1.11 2009/08/07 20:21:48 gilles Exp $ PROG= smtpd SRCS= parse.y authenticate.c log.c bounce.c config.c buffer.c \ @@ -9,8 +9,8 @@ SRCS= parse.y authenticate.c log.c bounce.c config.c buffer.c \ MAN= smtpd.8 smtpd.conf.5 BINDIR= /usr/sbin -LDADD+= -levent -lutil -lkeynote -lssl -lcrypto -lm -DPADD+= ${LIBEVENT} ${LIBUTIL} ${LIBKEYNOTE} ${LIBSSL} ${LIBCRYPTO} ${LIBM} +LDADD+= -levent -lutil -lssl -lcrypto -lm +DPADD+= ${LIBEVENT} ${LIBUTIL} ${LIBSSL} ${LIBCRYPTO} ${LIBM} CFLAGS= -g3 -ggdb -I${.CURDIR}/.. CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes CFLAGS+= -Wmissing-declarations |