OpenBSD CVS

CVS log for src/usr.sbin/smtpd/ca.c


[BACK] Up to [local] / src / usr.sbin / smtpd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.47 / (download) - annotate - [select for diffs], Tue Jul 11 16:40:22 2023 UTC (10 months, 3 weeks ago) by op
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, HEAD
Changes since 1.46: +9 -62 lines
Diff to previous 1.46 (colored)

drop engine support

diff originally by tb@, tweaked to apply after the useless logging
methods removal.

ok tb

Revision 1.46 / (download) - annotate - [select for diffs], Tue Jul 11 16:39:41 2023 UTC (10 months, 3 weeks ago) by op
Branch: MAIN
Changes since 1.45: +22 -183 lines
Diff to previous 1.45 (colored)

remove the useless logging methods

Instead of wrapping all the methods of the RSA and ECDSA ENGINE,
duplicate the default and override only the ones that are actually
needed for the privsep crypto engine.

part of a larger diff that's ok tb@

Revision 1.45 / (download) - annotate - [select for diffs], Sun Jun 18 19:08:52 2023 UTC (11 months, 2 weeks ago) by op
Branch: MAIN
Changes since 1.44: +1 -25 lines
Diff to previous 1.44 (colored)

remove ca_verify_cb().  was initially used for debugging, then the
logging went away but the no-op callback remained.

noticed by tb@

Revision 1.44 / (download) - annotate - [select for diffs], Sun Jun 18 11:43:49 2023 UTC (11 months, 2 weeks ago) by op
Branch: MAIN
Changes since 1.43: +96 -50 lines
Diff to previous 1.43 (colored)

smtpd: switch ECDSA_METHOD usage to EC_KEY_METHOD

smtpd and the bits it needs in libtls are the only consumer left of
ECDSA_METHOD, which is long deprecated.  This paves the way for the
removal in libcrypto.

The diff is from gilles' work on OpenSMTPD-portable, with minor changes
by me.

ok tb@, jsing@

Revision 1.43 / (download) - annotate - [select for diffs], Sun Mar 26 18:11:48 2023 UTC (14 months, 1 week ago) by tb
Branch: MAIN
Changes since 1.42: +2 -1 lines
Diff to previous 1.42 (colored)

Another missing #include <openssl/err.h>

Revision 1.42 / (download) - annotate - [select for diffs], Fri Feb 18 16:57:36 2022 UTC (2 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.41: +576 -65 lines
Diff to previous 1.41 (colored)

Revert changes to use the new libtls signer api
There are bugs in the new libtls signer that can lead to a crash.
OK tb@ jsing@

Revision 1.41 / (download) - annotate - [select for diffs], Sat Feb 12 18:22:04 2022 UTC (2 years, 3 months ago) by eric
Branch: MAIN
Changes since 1.40: +66 -577 lines
Diff to previous 1.40 (colored)

use new libtls signer api

ok tb@

Revision 1.40 / (download) - annotate - [select for diffs], Mon Jun 14 17:58:15 2021 UTC (2 years, 11 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.39: +3 -17 lines
Diff to previous 1.39 (colored)

add required headers for smtpd.h and remove unnecessary ones in other files.

ok jung@

Revision 1.39 / (download) - annotate - [select for diffs], Wed May 26 18:08:55 2021 UTC (3 years ago) by eric
Branch: MAIN
Changes since 1.38: +3 -4 lines
Diff to previous 1.38 (colored)

replaces calls to err(3)/errx(3) with fatal()/fatalx() from log.c
for code that runs in the daemon.

ok florian@ millert@

Revision 1.38 / (download) - annotate - [select for diffs], Fri Mar 5 12:37:32 2021 UTC (3 years, 2 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.37: +33 -30 lines
Diff to previous 1.37 (colored)

Start porting smtpd to libtls.

Note that it changes the way SNI works: The certificate to use is now
selected by looking at the names found in the certificates themselves,
rather than the names of the pki entries in the configuration file.
The set of certificates for a tls listener must be defined explicitly by
using the pki listener option multiple times.

ok tb@

Revision 1.37 / (download) - annotate - [select for diffs], Thu Dec 31 08:27:15 2020 UTC (3 years, 5 months ago) by martijn
Branch: MAIN
Changes since 1.36: +8 -8 lines
Diff to previous 1.36 (colored)

Rename the pony process to dispatcher and klondike to crypto.

From gilles@
OK millert@ giovanni@

Revision 1.36 / (download) - annotate - [select for diffs], Sat Sep 21 07:46:53 2019 UTC (4 years, 8 months ago) by semarie
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.35: +4 -2 lines
Diff to previous 1.35 (colored)

properly initialize errstr before going to fail label.

ok gilles@

Revision 1.35 / (download) - annotate - [select for diffs], Tue Jul 23 08:05:44 2019 UTC (4 years, 10 months ago) by gilles
Branch: MAIN
Changes since 1.34: +4 -2 lines
Diff to previous 1.34 (colored)

errstr may be uninitialized in error code path

Revision 1.34 / (download) - annotate - [select for diffs], Wed Jun 5 16:24:54 2019 UTC (4 years, 11 months ago) by gilles
Branch: MAIN
Changes since 1.33: +32 -31 lines
Diff to previous 1.33 (colored)

assume RSA_METHOD is opaque and only access members through setters/getters

Revision 1.33 / (download) - annotate - [select for diffs], Wed Jun 5 06:40:13 2019 UTC (4 years, 11 months ago) by gilles
Branch: MAIN
Changes since 1.32: +243 -20 lines
Diff to previous 1.32 (colored)

a long long time ago, in a galaxy quite close actually, reyk@ introduced an
RSA privsep engine to isolate private keys in the ca process. ECDSA support
in smtpd is become a frequent request so here's an ECDSA privsep engine and
the code required for smtpd to load ECDSA certificates and use them.

Revision 1.32 / (download) - annotate - [select for diffs], Fri May 24 15:34:05 2019 UTC (5 years ago) by gilles
Branch: MAIN
Changes since 1.31: +6 -3 lines
Diff to previous 1.31 (colored)

assume X509_STORE_CTX is opaque, don't access ->error but use the
X509_STORE_CTX_get_error() function instead

Revision 1.31 / (download) - annotate - [select for diffs], Fri May 24 14:40:33 2019 UTC (5 years ago) by gilles
Branch: MAIN
Changes since 1.30: +22 -24 lines
Diff to previous 1.30 (colored)

mechanical change to dynamically allocate rsae_method

Revision 1.30 / (download) - annotate - [select for diffs], Fri May 24 12:51:15 2019 UTC (5 years ago) by gilles
Branch: MAIN
Changes since 1.29: +1 -4 lines
Diff to previous 1.29 (colored)

remove useless check, it's never been and will never be hit

Revision 1.29 / (download) - annotate - [select for diffs], Thu May 24 11:38:24 2018 UTC (6 years ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored)

switch smtpd to new grammar

ok eric@

Revision 1.28 / (download) - annotate - [select for diffs], Tue Nov 21 12:20:34 2017 UTC (6 years, 6 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.27: +58 -67 lines
Diff to previous 1.27 (colored)

no need to check the sending process in imsg handlers when there is no
ambiguity: just use a single switch.

ok gilles@ sunil@

Revision 1.27 / (download) - annotate - [select for diffs], Wed May 17 14:00:06 2017 UTC (7 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.26: +4 -7 lines
Diff to previous 1.26 (colored)

Introduce more use of freezero().  Also, remove ptr conditionals before
many functions which are free(NULL)-compat
ok gilles

Revision 1.26 / (download) - annotate - [select for diffs], Mon Jan 9 09:53:23 2017 UTC (7 years, 4 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

smtpd joins the 7 other daemons that share the same log.c file.

The only major difference was the "log_trace" concept that is only
used by smtpd - move it from log.c into util.c and make it a local
concept.  This also needed to rename the global "verbose" variable to
"tracing" in a few places.

OK krw@ gilles@ eric@

Revision 1.25 / (download) - annotate - [select for diffs], Thu Sep 8 12:06:43 2016 UTC (7 years, 8 months ago) by eric
Branch: MAIN
Changes since 1.24: +7 -21 lines
Diff to previous 1.24 (colored)

Streamline the daemon shutdown sequence.

Only the parent process handles SIGTERM and SIGINT.  Upon receiving one
of those, it closes all imsg sockets and waitpid() for the children. It
fatal()s if one of the sockets is closed unexpectedly.  Other processes
exit() "normally" when one of the imsg sockets is closed.

ok gilles@ sunil@

Revision 1.24 / (download) - annotate - [select for diffs], Sun Sep 4 16:10:31 2016 UTC (7 years, 8 months ago) by eric
Branch: MAIN
Changes since 1.23: +3 -4 lines
Diff to previous 1.23 (colored)

The smtpd processes are not expected to ever leave their event loop.
So stop pretending that the *_shutdown() functions could ever be called
in this context, and just fatal() if event_dispatch() returns.

ok gilles@ sunil@ giovanni@

Revision 1.23 / (download) - annotate - [select for diffs], Thu Sep 1 10:54:25 2016 UTC (7 years, 9 months ago) by eric
Branch: MAIN
Changes since 1.22: +1 -2 lines
Diff to previous 1.22 (colored)

remove noop function

ok sunil@

Revision 1.22 / (download) - annotate - [select for diffs], Sat May 28 21:21:20 2016 UTC (8 years ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.21: +2 -13 lines
Diff to previous 1.21 (colored)

Implement the fork+exec pattern in smtpd.

The parent process forks child processes and re-exec each of them with
an additional "-x <proc>" argument.  During the early setup phase, the
parent process sends ipc socket pairs to interconnect the child
processes as needed, and it passes the queue encryption key to the
queue if necessary. When this is done, all processes have their
environment set as in the fork-only case, and they can start doing
their work as before.

ok gilles@ jung@

Revision 1.21 / (download) - annotate - [select for diffs], Tue Feb 2 21:18:04 2016 UTC (8 years, 4 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.20: +3 -25 lines
Diff to previous 1.20 (colored)

in RSA privsep engine, do not provide methods for rsa_sign / rsa_verify,
they are unused in OpenSMTPD and lead to crashes in -portable when we're
linked to OpenSSL starting with 1.0.2f

ok reyk@

Revision 1.20 / (download) - annotate - [select for diffs], Mon Dec 28 22:08:30 2015 UTC (8 years, 5 months ago) by jung
Branch: MAIN
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

remove spaces after '!'

no binary change

ok millert

Revision 1.19 / (download) - annotate - [select for diffs], Sat Dec 5 13:14:21 2015 UTC (8 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

EAGAIN handling for imsg_read. OK henning@ benno@

Revision 1.18 / (download) - annotate - [select for diffs], Thu Nov 5 12:35:58 2015 UTC (8 years, 6 months ago) by jung
Branch: MAIN
Changes since 1.17: +30 -22 lines
Diff to previous 1.17 (colored)

replace u_char and u_int* with standard stdint.h types to ease portable version
also remove trailing whitespaces while here

no binary change

ok sunil millert gilles

Revision 1.17 / (download) - annotate - [select for diffs], Sat Oct 17 13:06:03 2015 UTC (8 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.16: +6 -7 lines
Diff to previous 1.16 (colored)

KNF

Revision 1.16 / (download) - annotate - [select for diffs], Wed Oct 14 21:05:31 2015 UTC (8 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.15: +1 -5 lines
Diff to previous 1.15 (colored)

remove a handful of log_warn that we should handle at a different place to
make them really useful

Revision 1.15 / (download) - annotate - [select for diffs], Tue Oct 13 08:07:35 2015 UTC (8 years, 7 months ago) by gilles
Branch: MAIN
Changes since 1.14: +4 -1 lines
Diff to previous 1.14 (colored)

pledge("stdio") the RSA-privsep process

Revision 1.14 / (download) - annotate - [select for diffs], Tue Jan 20 17:37:54 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.13: +3 -1 lines
Diff to previous 1.13 (colored)

use <limits.h> comprehensively.  For now try to push <> includes to
each .c file, and out of the .h files.  To avoid overinclude.
ok gilles, in principle.  If this has been done right, -portable should
become easier to maintain.

Revision 1.13 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:20 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.12: +2 -1 lines
Diff to previous 1.12 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

Revision 1.12 / (download) - annotate - [select for diffs], Wed Dec 24 08:43:58 2014 UTC (9 years, 5 months ago) by eric
Branch: MAIN
Changes since 1.11: +2 -1 lines
Diff to previous 1.11 (colored)

missing include

Revision 1.11 / (download) - annotate - [select for diffs], Thu Oct 2 19:14:56 2014 UTC (9 years, 8 months ago) by gilles
Branch: MAIN
Changes since 1.10: +1 -3 lines
Diff to previous 1.10 (colored)

no need to set the same field NULL twice ;-)

ok reyk@

Revision 1.10 / (download) - annotate - [select for diffs], Thu Jul 10 20:16:48 2014 UTC (9 years, 10 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.9: +2 -1 lines
Diff to previous 1.9 (colored)

add additional includes required to build with -DOPENSSL_NO_DEPRECATED
ok eric@ gilles@

Revision 1.9 / (download) - annotate - [select for diffs], Thu Jul 10 15:54:55 2014 UTC (9 years, 10 months ago) by eric
Branch: MAIN
Changes since 1.8: +6 -0 lines
Diff to previous 1.8 (colored)

make the control process broadcast verbose/profile admin requests directly,
rather than going through the parent process. simplify code in the meantime.

Revision 1.8 / (download) - annotate - [select for diffs], Tue Jul 8 11:03:51 2014 UTC (9 years, 10 months ago) by eric
Branch: MAIN
Changes since 1.7: +3 -4 lines
Diff to previous 1.7 (colored)

fatalx(errorstr) -> fatalx("%s", errorstr)
add missing include and remove redundant debug trace while here.

Revision 1.7 / (download) - annotate - [select for diffs], Sun May 4 16:38:19 2014 UTC (10 years, 1 month ago) by reyk
Branch: MAIN
Changes since 1.6: +38 -11 lines
Diff to previous 1.6 (colored)

Create a new default RSA engine instead of patching the existing one
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)

Revision 1.6 / (download) - annotate - [select for diffs], Thu May 1 15:50:20 2014 UTC (10 years, 1 month ago) by reyk
Branch: MAIN
Changes since 1.5: +165 -45 lines
Diff to previous 1.5 (colored)

Move RSA keys from "lka" to a new dedicated "ca" process because lka
is handling some async requests and shouldn't be busy with sync RSA.

ok gilles@

Revision 1.5 / (download) - annotate - [select for diffs], Wed Apr 30 08:23:42 2014 UTC (10 years, 1 month ago) by reyk
Branch: MAIN
Changes since 1.4: +25 -3 lines
Diff to previous 1.4 (colored)

The RSA engine (used by pony) has to wait for a response from the
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@

Revision 1.4 / (download) - annotate - [select for diffs], Tue Apr 29 19:13:13 2014 UTC (10 years, 1 month ago) by reyk
Branch: MAIN
Changes since 1.3: +326 -7 lines
Diff to previous 1.3 (colored)

Implement RSA privilege separation for OpenSMTPD, based on my previous
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@

Revision 1.3 / (download) - annotate - [select for diffs], Thu Nov 21 08:36:51 2013 UTC (10 years, 6 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.2: +4 -1 lines
Diff to previous 1.2 (colored)

fail if lka can't load cert file

Revision 1.2 / (download) - annotate - [select for diffs], Mon Oct 28 17:02:08 2013 UTC (10 years, 7 months ago) by eric
Branch: MAIN
Changes since 1.1: +28 -0 lines
Diff to previous 1.1 (colored)

Report the ssl certificate verification status in the mail header.
Log ssl certificate validation errors.
Fix several ssl-related leaks.

Revision 1.1 / (download) - annotate - [select for diffs], Sat Jan 26 09:37:23 2013 UTC (11 years, 4 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3

Sync with our smtpd repo:

* first bricks of ldap and sqlite support (not finished but both working)
* new table API to replace map API, all lookups are done through tables
* improved handling of temporary errors throughout the daemon
* improved scheduler and mta logic: connection reuse, optimizes batches
* improved queue: more tolerant to admin errors, new layout, less disk-IO
* improved memory usage under high load
* SSL certs/keys isolated to lookup process to avoid facing network
* VIRTUAL support improved, fully virtual setups possible now
* runtime tracing of processes through smtpctl trace
* ssl_privsep.c sync-ed with relayd
* ssl.c no longer contains smtpd specific interfaces
* smtpd-specific ssl bits moved to ssl_smtpd.c
* update mail address in copyright

FLUSH YOUR QUEUE. FLUSH YOUR QUEUE. FLUSH YOUR QUEUE. FLUSH YOUR QUEUE.

smtpd.conf(5) simplified, it will require adaptations

ok eric@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.