diff options
author | Gilles Chehade <gilles@poolp.org> | 2019-09-28 17:24:56 +0200 |
---|---|---|
committer | Gilles Chehade <gilles@poolp.org> | 2019-09-28 17:24:56 +0200 |
commit | ac7a62b7b643a412c9169f5a97fb6d49ae826f16 (patch) | |
tree | f8f7ca62c4a4cf04cac104e199bd868b13201974 | |
parent | what about linking srs.c to the build ? (diff) | |
download | OpenSMTPD-ac7a62b7b643a412c9169f5a97fb6d49ae826f16.tar.xz OpenSMTPD-ac7a62b7b643a412c9169f5a97fb6d49ae826f16.zip |
sync
-rw-r--r-- | smtpd/ca.c | 6 | ||||
-rw-r--r-- | smtpd/lka_report.c | 7 | ||||
-rw-r--r-- | smtpd/parse.y | 6 | ||||
-rw-r--r-- | smtpd/smtp_session.c | 3 | ||||
-rw-r--r-- | smtpd/smtpc.c | 6 | ||||
-rw-r--r-- | smtpd/smtpd.conf.5 | 5 | ||||
-rw-r--r-- | smtpd/srs.c | 12 |
7 files changed, 19 insertions, 26 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: ca.c,v 1.35 2019/07/23 08:05:44 gilles Exp $ */ +/* $OpenBSD: ca.c,v 1.36 2019/09/21 07:46:53 semarie Exp $ */ /* * Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org> @@ -705,8 +705,10 @@ ecdsa_engine_init(void) ENGINE *e; const char *errstr, *name; - if ((ecdsae_method = ECDSA_METHOD_new_temporary("ECDSA privsep engine", 0)) == NULL) + if ((ecdsae_method = ECDSA_METHOD_new_temporary("ECDSA privsep engine", 0)) == NULL) { + errstr = "ECDSA_METHOD_new_temporary"; goto fail; + } ecdsae_method->ecdsa_do_sign = ecdsae_do_sign; ecdsae_method->ecdsa_sign_setup = ecdsae_sign_setup; diff --git a/smtpd/lka_report.c b/smtpd/lka_report.c index 8b745935..109609a5 100644 --- a/smtpd/lka_report.c +++ b/smtpd/lka_report.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lka_report.c,v 1.32 2019/09/11 04:19:19 martijn Exp $ */ +/* $OpenBSD: lka_report.c,v 1.33 2019/09/21 08:10:44 semarie Exp $ */ /* * Copyright (c) 2018 Gilles Chehade <gilles@poolp.org> @@ -155,9 +155,12 @@ report_smtp_broadcast(uint64_t reqid, const char *direction, struct timeval *tv, if (strcmp("smtp-in", direction) == 0) d = &smtp_in; - if (strcmp("smtp-out", direction) == 0) + else if (strcmp("smtp-out", direction) == 0) d = &smtp_out; + else + fatalx("unexpected direction: %s", direction); + tailq = dict_xget(d, event); TAILQ_FOREACH(rp, tailq, entries) { if (!lka_filter_proc_in_session(reqid, rp->name)) diff --git a/smtpd/parse.y b/smtpd/parse.y index 4801d14f..2fff100e 100644 --- a/smtpd/parse.y +++ b/smtpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.262 2019/09/20 17:46:05 gilles Exp $ */ +/* $OpenBSD: parse.y,v 1.263 2019/09/22 11:49:53 semarie Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -542,8 +542,8 @@ srs: SRS KEY STRING { conf->sc_srs_key = $3; } -SRS KEY BACKUP STRING { - conf->sc_srs_key_backup = $3; +| SRS KEY BACKUP STRING { + conf->sc_srs_key_backup = $4; } | SRS TTL STRING { conf->sc_srs_ttl = delaytonum($3); diff --git a/smtpd/smtp_session.c b/smtpd/smtp_session.c index 4e4978e4..5df9476e 100644 --- a/smtpd/smtp_session.c +++ b/smtpd/smtp_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp_session.c,v 1.411 2019/09/19 16:00:59 gilles Exp $ */ +/* $OpenBSD: smtp_session.c,v 1.412 2019/09/21 09:01:52 semarie Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -298,7 +298,6 @@ header_append_domain_buffer(char *buffer, char *domain, size_t len) int pos_bracket, pos_component, pos_insert; char copy[APPEND_DOMAIN_BUFFER_SIZE]; - i = 0; escape = quote = comment = bracket = 0; has_domain = has_bracket = has_group = 0; pos_bracket = pos_insert = pos_component = 0; diff --git a/smtpd/smtpc.c b/smtpd/smtpc.c index fb6d711d..deb99c63 100644 --- a/smtpd/smtpc.c +++ b/smtpd/smtpc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpc.c,v 1.9 2019/09/18 11:26:30 eric Exp $ */ +/* $OpenBSD: smtpc.c,v 1.10 2019/09/21 09:04:08 semarie Exp $ */ /* * Copyright (c) 2018 Eric Faurot <eric@openbsd.org> @@ -351,10 +351,10 @@ smtp_verify_server_cert(void *tag, struct smtp_client *proto, void *ctx) SSL *ssl = ctx; X509 *cert; long res; - int r, match; + int match; if ((cert = SSL_get_peer_certificate(ssl))) { - r = ssl_check_name(cert, servname, &match); + (void)ssl_check_name(cert, servname, &match); X509_free(cert); res = SSL_get_verify_result(ssl); if (res == X509_V_OK) { diff --git a/smtpd/smtpd.conf.5 b/smtpd/smtpd.conf.5 index 1da4189c..580d5838 100644 --- a/smtpd/smtpd.conf.5 +++ b/smtpd/smtpd.conf.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: smtpd.conf.5,v 1.225 2019/09/20 17:46:05 gilles Exp $ +.\" $OpenBSD: smtpd.conf.5,v 1.226 2019/09/20 18:47:23 jmc Exp $ .\" .\" Copyright (c) 2008 Janne Johansson <jj@openbsd.org> .\" Copyright (c) 2009 Jacek Masiulaniec <jacekm@dobremiasto.net> @@ -850,14 +850,13 @@ Set the secret key to use for SRS, the Sender Rewriting Scheme. .It Ic srs Cm key backup Ar secret Set a backup secret key to use as a fallback for SRS. -This can be used to implementation SRS key rotation. +This can be used to implement SRS key rotation. .It Ic srs Cm ttl Ar delay Set the time-to-live delay for SRS envelopes. After this delay, a bounce reply to the SRS address will be discarded to limit risks of forged addresses. The default is four days .Pq 4d . -The delay .It Ic table Ar name Oo Ar type : Oc Ns Ar pathname Tables provide additional configuration information for .Xr smtpd 8 diff --git a/smtpd/srs.c b/smtpd/srs.c index 9d0daade..dc34ae48 100644 --- a/smtpd/srs.c +++ b/smtpd/srs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: srs.c,v 1.1 2019/09/20 17:46:05 gilles Exp $ */ +/* $OpenBSD: srs.c,v 1.2 2019/09/21 06:40:48 semarie Exp $ */ /* * Copyright (c) 2019 Gilles Chehade <gilles@poolp.org> @@ -16,8 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include "includes.h" - #include <sys/types.h> #include <sys/queue.h> #include <sys/tree.h> @@ -146,12 +144,8 @@ srs1_encode_srs0(const char *sender, const char *rcpt_domain) char tmp[SMTPD_MAXMAILADDRSIZE]; char md[SHA_DIGEST_LENGTH*4+1]; struct mailaddr maddr; - uint16_t timestamp; int ret; - /* compute 10 bits timestamp according to spec */ - timestamp = (time(NULL) / (60 * 60 * 24)) % 1024; - /* parse sender into user and domain */ if (! text_to_mailaddr(&maddr, sender)) return sender; @@ -182,12 +176,8 @@ srs1_encode_srs1(const char *sender, const char *rcpt_domain) char tmp[SMTPD_MAXMAILADDRSIZE]; char md[SHA_DIGEST_LENGTH*4+1]; struct mailaddr maddr; - uint16_t timestamp; int ret; - /* compute 10 bits timestamp according to spec */ - timestamp = (time(NULL) / (60 * 60 * 24)) % 1024; - /* parse sender into user and domain */ if (! text_to_mailaddr(&maddr, sender)) return sender; |