Re: Can Openssl still use a null cipher?

Viktor Dukhovni <[email protected]>
Newsgroups gmane.comp.encryption.openssl.user
Message-ID <[email protected]>
On Tue, Feb 25, 2025 at 10:49:02AM -0800, Bryan Henderson wrote:

> I used to use the *openssl* program to demonstrate a client/server 
> connection with no certificates (*openssl s_server -nocert*), using

For that you need "aNULL" ciphers (no authentication), not "eNULL"
ciphers (no encryption).

>    *$ openssl s_client -cipher AECDH-NULL-SHA ...*

That is one is both:

    $ openssl ciphers -s -tls1_2 -v aNULL+eNULL:@SECLEVEL=0
    AECDH-NULL-SHA                 TLSv1   Kx=ECDH     Au=None  Enc=None                   Mac=SHA1

There are a few more, but none that work with TLS 1.3, because that
protocol version does not currently support any "aNULL" or "eNULL"
ciphers, and the TLS WG is not very receptive to having these
introduced. :-(

If you only want to turn off certificates, but encryption is OK as is
TLS <= 1.2, then your choice is broader:

    $ openssl ciphers -s -tls1_2 -v aNULL:@SECLEVEL=0
    ADH-AES256-GCM-SHA384          TLSv1.2 Kx=DH       Au=None  Enc=AESGCM(256)            Mac=AEAD
    ADH-AES128-GCM-SHA256          TLSv1.2 Kx=DH       Au=None  Enc=AESGCM(128)            Mac=AEAD
    ADH-AES256-SHA256              TLSv1.2 Kx=DH       Au=None  Enc=AES(256)               Mac=SHA256
    ADH-CAMELLIA256-SHA256         TLSv1.2 Kx=DH       Au=None  Enc=Camellia(256)          Mac=SHA256
    ADH-AES128-SHA256              TLSv1.2 Kx=DH       Au=None  Enc=AES(128)               Mac=SHA256
    ADH-CAMELLIA128-SHA256         TLSv1.2 Kx=DH       Au=None  Enc=Camellia(128)          Mac=SHA256
    AECDH-AES256-SHA               TLSv1   Kx=ECDH     Au=None  Enc=AES(256)               Mac=SHA1
    ADH-AES256-SHA                 SSLv3   Kx=DH       Au=None  Enc=AES(256)               Mac=SHA1
    ADH-CAMELLIA256-SHA            SSLv3   Kx=DH       Au=None  Enc=Camellia(256)          Mac=SHA1
    AECDH-AES128-SHA               TLSv1   Kx=ECDH     Au=None  Enc=AES(128)               Mac=SHA1
    ADH-AES128-SHA                 SSLv3   Kx=DH       Au=None  Enc=AES(128)               Mac=SHA1
    ADH-CAMELLIA128-SHA            SSLv3   Kx=DH       Au=None  Enc=Camellia(128)          Mac=SHA1
    AECDH-NULL-SHA                 TLSv1   Kx=ECDH     Au=None  Enc=None                   Mac=SHA1

> Why does Openssl ignore my cipher request, and is there any other way to do 
> a certificate-free connection?

You need to set a ceiling on the protocol version:

    -max_protocol TLSv1.2

For example:

    $ openssl s_client -max_protocol TLSv1.2 -connect 127.0.0.1:25 -starttls smtp \
        -cipher aNULL+kECDHE:@SECLEVEL=0 -brief
    Connecting to 127.0.0.1
    Can't use SSL_get_servername
    CONNECTION ESTABLISHED
    Protocol version: TLSv1.2
    Ciphersuite: AECDH-AES256-SHA
    No peer certificate or raw public key
    Supported Elliptic Curve Point Formats: uncompressed:ansiX962_compressed_prime:ansiX962_compressed_char2
    Peer Temp Key: X25519, 253 bits
    250 CHUNKING
    quit
    221 2.0.0 Bye

[ There are sadly no code points for TLS 1.2 ciphers that combine aNULL
  with ECHDHE and an AEAD.  I think the stronger key agreement is more
  compelling. ]

And without the protocol ceiling (and RPK + DANE just for the fun of it,
just so the connection is verified, but not otherwise relevant) I get
TLS 1.3:

    $ openssl s_client -connect 127.0.0.1:25 -starttls smtp -cipher aNULL:@SECLEVEL=0 -brief \
        -enable_server_rpk \
        -dane_tlsa_domain=example.com \
        -dane_tlsa_rrdata="3 1 1 c0b67b03dab597a5d8b743e709ae080d7d3e509a7bab0a0288d8987feaeae803"
    Connecting to 127.0.0.1
    CONNECTION ESTABLISHED
    Protocol version: TLSv1.3
    Ciphersuite: TLS_AES_256_GCM_SHA384
    Peer used raw public key
    Signature type: mldsa65
    Verification: OK
    DANE TLSA 3 1 1 ...7bab0a0288d8987feaeae803 matched the peer raw public key
    Negotiated TLS1.3 group: X25519MLKEM768
    250 CHUNKING
    quit
    221 2.0.0 Bye

-- 
    Viktor.

-- 
You received this message because you are subscribed to the Google Groups "openssl-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openssl-users+unsubscribe-MCmKBN63+Bmbup2nOX2J7Q@public.gmane.org
To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-users/Z76CTaaOALdky9Bz%40chardros.imrryr.org.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.