summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
AgeCommit message (Collapse)Author
2014-07-04It makes much more sense to do the loop checking on incoming mails ratherEric Faurot
than on outgoing mails... ok gilles@
2014-07-04always attempt to use tls for relaying to the primary server whenEric Faurot
acting as a backup mx. reported by otto@. ok gilles@
2014-07-01Fix snprintf() return value tests. ok gilles@Matthieu Herrb
2014-06-10we should really zero a buffer we strlcat to otherwise aliases resolutionGilles Chehade
really resolves nothing :-)
2014-06-07Clint Pachl points out "authtable" is optional;Jason McIntyre
2014-06-06when relying on the local enqueuer, fix an issue with long To and Cc linesGilles Chehade
that can lead to broken headers and confuse some MUA issue spotted by tedu@
2014-05-28remove an errant semicolon.Daniel Dickman
ok gilles@
2014-05-25use reallocarray.Marc Espie
okay gilles@
2014-05-23use reallocarrayMarc Espie
okay gilles@
2014-05-22when we reduced the number of iovec's we passed through an imsg, the iovecGilles Chehade
declaration was not bumped down causing us to pass extra junk leading to a crash in the pki lookup code. i'm amazed no one else crashed on that :-/ reported by Olivier Antoine who kindly provided access to his box
2014-05-20format string cleanup: change "%i" to "%d" and fix a few typosEric Faurot
2014-05-20Unify the SSL privsep key loading functions.Reyk Floeter
ok eric@
2014-05-20Deep down inside OpenSSL, err... LibreSSL, RSA_set_ex_data attempts toReyk Floeter
free() the external data when releasing the RSA object. The RSA_GET_EX_NEW_INDEX(3) manual page doesn't mention that this is the default behaviour - it just describes the possible free_func() callback - and the code path in libcrypto is hiding the fact behind layers of abstraction. Fix possible double free by allocating and copying the external data reference that is used for RSA privsep (pkiname in smtpd's case). ok eric@ gilles@
2014-05-20remove dead filesEric Faurot
2014-05-17add missing header needed by str* and mem* functionsCharles Longeau
ok gilles@
2014-05-15use <> for tables;Jason McIntyre
original report from creamy; diff from Frank Brodbeck, tweaked
2014-05-12fix a possible double free when tls is required but not advertised byEric Faurot
the server. ok gilles@
2014-05-10fix typo in function prototypeCharles Longeau
ok gilles@
2014-05-10Fix SSL breakage that I accidentally introduced with my previous commit.Reyk Floeter
2014-05-09stop casting sizeof to intTed Unangst
2014-05-06Fix two memory leaks: EVP_PKEY_get1_RSA() returns a referenced keyReyk Floeter
that requires to call RSA_free() to dereference it after use. Also free a temporary key that was read by PEM_read_PrivateKey() and immediately written into a bio. ok markus@
2014-05-04Create a new default RSA engine instead of patching the existing oneReyk Floeter
if none is available. Fixes SSL/TLS and a possible fatalx() on machines without a default RSA engine. Thanks to Bjorn Ketelaars for reporting and testing. ok gilles@ (for the relayd part)
2014-05-01Move RSA keys from "lka" to a new dedicated "ca" process because lkaReyk Floeter
is handling some async requests and shouldn't be busy with sync RSA. ok gilles@
2014-04-30when doing opportunistic TLS, do not only downgrade during negotiation, butGilles Chehade
also downgrade if a TLS error happens during the session. ok eric@ who helped me with this
2014-04-30when using maildir, do not create automatically create folders to match tagGilles Chehade
in email address (ie: gilles+tag => ~/Maildir/.tag), instead use the folder if it already exists and deliver to the mail Maildir otherwise. ok eric@ and chl@
2014-04-30The RSA engine (used by pony) has to wait for a response from theReyk Floeter
privileged process (lka) and receive the imsgs in a while loop synchronously. But the lka also sends other imsgs (DNS etc.) that can still be queued up in the buffer when waiting for the RSA response. This only happens under load with many concurrent connections. For now, we just call the pony imsg handler for non-RSA imsgs that are already in the buffer. ok gilles@ eric@ blambert@
2014-04-29For RSA private key privsep, only ever load the keys after forking theReyk Floeter
separated process. This improves the previous because we don't trust the PEM and BIO routines to cleanup the keys correctly. ok gilles@
2014-04-29Implement RSA privilege separation for OpenSMTPD, based on my previousReyk Floeter
implementation for relayd(8). The smtpd(8) pony processes (mta client, smtp server) don't keep the private keys in memory but send their private key operations as imsgs to the "lookup"/mta process. It's worth mentioning that this prevents acidental private key leakage as it could have been caused by "Heartbleed". ok gilles@
2014-04-29when a session fails due to a TLS error in a smtp+tls:// connection, tryGilles Chehade
plain before giving up ok eric@
2014-04-29Remove unused arguments from ssl_smtp_init()Reyk Floeter
ok gilles@
2014-04-29use explicit_bzero() instead of memset() to clear out sensitive data.Reyk Floeter
ok gilles@
2014-04-29It is only required to load the keys and certs into the same SSLReyk Floeter
context once. Simplify the code path by moving the loading from three different places into ssl_ctx_create(): ok gilles@
2014-04-22malloc -> callocGilles Chehade
2014-04-19these snprintf() calls can't possibly truncate because they copy data fromGilles Chehade
buffers that are already protected against truncation and that do not exceed the destination buffer size when copied together ... however, i think we should add checks here too because it'll help us catch errors in table backends when adding new ones if we miss a truncation check there.
2014-04-19(void) cast snprintf() that cannot truncateGilles Chehade
2014-04-19(void) cast snprintf() call used to craft fatalx() message from withinGilles Chehade
smtpd, buffer is large enough and truncation harmless, we want to avoid memory allocation in that case and use a best-effort
2014-04-19(void) cast snprintf calls that cannot truncate or for which earlier checksGilles Chehade
ensure the copy won't fail
2014-04-19(void) cast snprintf() calls that cannot truncate (and would be harmlessGilles Chehade
otherwise)
2014-04-19remove dead code ... in code that's not plugged in yet ;-)Gilles Chehade
2014-04-19(void) cast snprintf that cannot truncateGilles Chehade
2014-04-19(void) cast snprintf calls that cannot truncateGilles Chehade
2014-04-19(void) cast snprintf call that cannot truncateGilles Chehade
2014-04-19(void) cast snprintf() calls that cannot truncateGilles Chehade
2014-04-19replace warnx messageGilles Chehade
2014-04-19add missing strlcpy() check in create_filter_chain() that would cause smtpdGilles Chehade
to fatal at startup if truncation occured and we had enabled filters (void) cast a strlcpy() that cannot truncate
2014-04-19add missing strlcpy() checks in create_filter() that would cause smtpd toGilles Chehade
fatal at startup if truncation occured and we had enabled filters
2014-04-19add missing strlcpy() check in is_if_in_group() to detect and warn aboutGilles Chehade
the truncation rather than failing the ioctl() call that follows.
2014-04-19add missing strlcpy() check when parsing "backup hostname" in smtpd.conf,Gilles Chehade
it could lead to smtpd not finding itself in a MX lookup if a hostname is specified that exceeds the max hostname len. while at it, add a missing free()
2014-04-19(void) cast strlcpy() calls that cannot truncateGilles Chehade
2014-04-19certs are looked up by hostname, the size of the buffer should use theGilles Chehade
max hostname len, not max pathname len as before