Hi,

With the settings below, postfix 3.5.6 and openssl 1.1.1k successfully connected to a server with a 2048-bit RSA key, which should be disallowed by openssl's security level 4.

tls_high_cipherlist = DEFAULT:!eNULL:!aNULL:@SECLEVEL=4:@STRENGTH
smtp_tls_mandatory_ciphers = high

When I use openssl directly, I get the error I'd expect:

$ openssl s_client -connect mail.mandelberg.org:submissions -cipher 'DEFAULT:!eNULL:!aNULL:@SECLEVEL=4:@STRENGTH' -verify_return_error
...
verify error:num=66:EE certificate key too weak
...

So I dug around the code a bit. Is https://github.com/vdukhovni/postfix/blob/1f2df46e5211065a16f78739308131122e185c7c/postfix/src/tls/tls_client.c#L864 the relevant function? It looks like it calls tls_set_ciphers() on line 939, and that function looks like it does what I'd expect. But then lower down in the function on lines 1068-1069, it looks like it explicitly sets the security level to 1 if `TLS_MUST_MATCH(TLScontext->level)`.

Does that mean that if I'm using a postfix security level (which is different from the openssl security level) greater than or equal to encrypt, there's no way to set the openssl security level? Or am I missing another way to do it / misunderstanding the code? Openssl's level 1 is really low.

P.S. Searching for SSL_set_security_level and SSL_CTX_set_security_level, I see a few other calls. I think those calls aren't as relevant as the one above, but I'm not sure. I do also want to change the openssl security level for smtpd though, which looks like it might also be a similar issue?

Reply via email to