Article View: news.software.nntp
Article #87880Re: [INN] TLS Signature algorithm selection
From: Michael Bäuerle
Date: Mon, 29 Oct 2018 13:31
Date: Mon, 29 Oct 2018 13:31
94 lines
5056 bytes
5056 bytes
Julien ÉLIE wrote: > Michael Bäuerle wrote: > > > > While testing TLSv1.3 from flnews-0.16pre6 via OpenSSL 1.1.1-pre8 to > > INN 2.6.1 the question comes up how INN selects the signature algorithm > > from the list provided by a client. > > > > flnews behaves like (first one preferred): > > | > > | $ openssl s_client -sigalgs "RSA-PSS+SHA512:RSA-PSS+SHA384:RSA-PSS+SHA256" > > Just to be sure, is the behaviour similar when you use TLSv1.3 > signature scheme names? (rsa_pss_pss_sha256 and rsa_pss_pss_sha512) > Maybe it is treated differently (but that would be a bug; note that > RSA-PSS is not mentioned in SSL_CONF_cmd man page): > > https://www.openssl.org/docs/man1.1.1/man3/SSL_CONF_cmd.html > > "The value argument should be a colon separated list of signature > algorithms in order of decreasing preference of the form algorithm+hash > or signature_scheme. algorithm is one of RSA, DSA or ECDSA and hash is > a supported algorithm OID short name such as SHA1, SHA224, SHA256, > SHA384 of SHA512. Note: algorithm and hash names are case sensitive. > signature_scheme is one of the signature schemes defined in TLSv1.3, > specified using the IETF name, e.g., ecdsa_secp256r1_sha256, ed25519, > or rsa_pss_pss_sha256." > > > https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set1_sigalgs.html > > "The short or long name values for digests can be used in a string (for > example "MD5", "SHA1", "SHA224", "SHA256", "SHA384", "SHA512") and the > public key algorithm strings "RSA", "RSA-PSS", "DSA" or "ECDSA". > > The TLS 1.3 signature scheme names (such as "rsa_pss_pss_sha256") can > also be used with the _list forms of the API." I have now tested (with s_client): -sigalgs "rsa_pss_pss_sha512" This should offer signature scheme code 0x080B according to RFC 8446 [1] (and really do so according to Wireshark), but it doesn't work: | | 140187577419520:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:ssl/record/rec_layer_s3.c:1528:SSL alert number 40 Both: -sigalgs "rsa_pss_rsae_sha512" and -sigalgs "RSA-PSS+SHA512" do the same and offer signature scheme code 0x0806. With that code I can connect via TLSv1.3 (tested with the server from Emil Schuster): | | [...] | Peer signing digest: SHA512 | Peer signature type: RSA-PSS I have tested flnews in September and checked the Client Hello with Wireshark and the offered list was correctly transmitted: <https://micha.freeshell.org/tmp/2018-09-14_flnews_TLS1.3_CH.png> The first three elements are the list quoted above, the last three elements are for TLSv1.2 (and for signatures in certificates using RSA with PKCSv1.5 padding). The other (server) side has rejected my preference in favour of the weaker RSA-PSS+SHA256 (0x0804) signature scheme (as long as Emil had his server configured to use local OpenSSLs preferences, currently his server follows the clients preferences). This is the default list offered by s_client (from OpenSSL 1.1.1): <https://micha.freeshell.org/tmp/2018-10-29_OpenSSL_signature_schemes.png> Weaker hash algorithms are preferred not only for RSA. For ECDSA and EdDSA weaker curves are preferred. Only for RSA PSS is preferred over the weaker PKCSv1.5 padding and for DSA the SHA224 hash is preferred over the weaker SHA1. Looks like OpenSSLs server code uses the same list (maybe to reduce CPU load instead of maximizing strength). BTW: Your server has still rejected the PSS-based signature algorithm (when I offered it without alternatives): | | 140187577419520:error:14094417:SSL routines:ssl3_read_bytes:sslv3 alert illegal parameter:ssl/record/rec_layer_s3.c:1528:SSL alert number 47 and negotiates TLSv1.2 when I use OpenSSLs default list. _________________ [1] <https://tools.ietf.org/html/rfc8446#section-4.2.3>
Technical Details
Message-ID:
<AABb1wvPmJQAAAbe.A1.flnews@WStation5.stz-e.de>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mailReferences:
<AABbZFbxOtIAAB1o.A1.flnews@WStation5.stz-e.de> <pr58lj$ohh$1@news.trigofacile.com>Show Full Headers
Complete Article Headers
Message-ID: <AABb1wvPmJQAAAbe.A1.flnews@WStation5.stz-e.de> Subject: Re: [INN] TLS Signature algorithm selection Date: Mon, 29 Oct 2018 14:31:59 +0100 From: Michael Bäuerle <michael.baeuerle@stz-e.de> References: <AABbZFbxOtIAAB1o.A1.flnews@WStation5.stz-e.de> <pr58lj$ohh$1@news.trigofacile.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mail Newsgroups: news.software.nntp Lines: 92 Reply-To: Michael Bäuerle <michael.baeuerle@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=fixed Content-Transfer-Encoding: 8bit X-Trace: individual.net ImR0BT1RtskZrO8LXTJSnwswo8cLQ8cpNoySTJ5tu8ltqi2dNW X-Orig-Path: not-for-mail Cancel-Lock: sha1:35Z/dgxQ/gPSL/R+nhTiVaR0W78= sha256:2FAs3TDcellj1F6IBlO2tf2Qz+WbbHW5+9COTMifR3k= sha1:cegaZ502oBNzRx2rRCo6/lKMy+E= Injection-Date: Mon, 29 Oct 2018 13:31:59 -0000 User-Agent: flnews/0.16pre15 (for NetBSD) X-Received-Bytes: 4947 X-Received-Body-CRC: 379162116