On Thu, May 25, 2023 at 07:23:48PM +0200, Omar Polo wrote:
> As far as I (and grep) can see, smtpd and the part it needs in libtls
> are the only user of ECDSA_METHOD in tree.

Yes, nothing else should be using this anymore, including ports.

ECDSA_METHOD and ECDH_METHOD were merged into EC_KEY_METHOD and removed
as part of the OpenSSL 1.1 API transition. We still have the former two
because removal is blocked by smtpd, so this diff is definitely a most
welcome step in the right direction.

>From the libcrypto perspective this paves the way for removal of a still
exposed public struct and unneded API and will subsequently allow more
internal simplifications. In particular, it should allow us to clean up
and get rid of the messy split between ec/ecdsa/ecdh.

> What I've understood talking with tb (and apologizes if I'm making
> mistakes) is that ECDSA_METHOD was replaced with EC_KEY_METHOD.  "We"
> inherited the former, it got used in smtpd, and then added the latter
> for openssh.  smtpd and libtls were never updated to these new shiny
> APIs.

This is also correct. We (markus) added EC_KEY_METHOD to libcrypto to
allow OpenSSH to switch to OpenSSL 1.1 API which simplified their
portable efforts. (Now EC_KEY_METHOD is deprecated in OpenSSL 3 thanks
to the new provider things, but one step at a time...)

> Diff below is 99% gilles' work on OpenSMTPD-portable.  I only had to
> tweak EC_KEY_METHOD_get_compute_key() since the compute key function
> has a different signature in LibreSSL than OpenSSL, and some minor
> style nits.

Addressing this signature difference will something to look into later.

> While I've tested it (on localhost and between vms), and I'm also
> running it on linux and freebsd with OpenSSL 3.1 and 1.1 respectively
> via OpenSMTPD-portable, additional testing on busier mx is greatly
> appreciated.  I don't expect regressions however.

It should also be noted that libretls carries a similar diff.

> 
> To test:
> 
>  - apply the diff
>  - rebuild and reinstall libtls
>  - rebuild, reinstall and restart smtpd
> 
> It doesn't change the libtls ABI (tls_signer_ecdsa_method is internal)
> and the parts it touches are only used by smtpd AFAIK, so no need to
> rebuild anything else.

I am ok with the diff, but some more testing in the real world would be
nice.

Reply via email to