Skip to content

Commit 8e99e81

Browse files
committed
ssl: Make PQC signature algorithms preferred by default
1 parent 11d07de commit 8e99e81

3 files changed

Lines changed: 49 additions & 47 deletions

File tree

lib/ssl/src/ssl.erl

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ Common certificate related options to both client and server.
751751
connection will be selected.
752752

753753
The different signature algorithms are prioritized in the following
754-
order: `eddsa`, `ecdsa`, `rsa_pss_pss`, `rsa`, and `dsa`. If more
754+
order: `mldsa`, `slh-dsa`, `eddsa`, `ecdsa`, `rsa_pss_pss`, `rsa`, and `dsa`. If more
755755
than one key is supplied for the same signature algorithm, they will
756756
be prioritized by strength (except for _engine keys_; see the next
757757
paragraph). This offers flexibility to, for instance, configure a
@@ -769,7 +769,7 @@ Common certificate related options to both client and server.
769769

770770
> #### Note {: .info }
771771
>
772-
> `eddsa` certificates are only supported by TLS-1.3 implementations that do not support `dsa`
772+
> `mldsa`, `slhdsa`, `eddsa` certificates are only supported by TLS-1.3 implementations that do not support `dsa`
773773
> certificates. `rsa_pss_pss` (RSA certificates using Probabilistic Signature
774774
> Scheme) are supported in TLS-1.2 and TLS-1.3, but some TLS-1.2 implementations
775775
> do not support `rsa_pss_pss`.
@@ -3024,25 +3024,29 @@ Example:
30243024

30253025
```erlang
30263026
1> ssl:signature_algs(default, 'tlsv1.3').
3027-
[eddsa_ed25519,eddsa_ed448,ecdsa_secp521r1_sha512,
3028-
ecdsa_secp384r1_sha384,ecdsa_secp256r1_sha256,
3029-
ecdsa_brainpoolP512r1tls13_sha512,
3030-
ecdsa_brainpoolP384r1tls13_sha384,
3031-
ecdsa_brainpoolP256r1tls13_sha256,rsa_pss_pss_sha512,
3032-
rsa_pss_pss_sha384,rsa_pss_pss_sha256,rsa_pss_rsae_sha512,
3033-
rsa_pss_rsae_sha384,rsa_pss_rsae_sha256,mldsa44,mldsa65,
3034-
mldsa87,rsa_pkcs1_sha512,rsa_pkcs1_sha384,rsa_pkcs1_sha256,
3027+
[mldsa87,mldsa65,mldsa44,slh_dsa_shake_256f,slh_dsa_shake_256s,
3028+
slh_dsa_sha2_256f,slh_dsa_sha2_256s,slh_dsa_shake_192f,slh_dsa_shake_192s,
3029+
slh_dsa_sha2_192f,slh_dsa_sha2_192s,slh_dsa_shake_128f,slh_dsa_shake_128s,
3030+
slh_dsa_sha2_128f,slh_dsa_sha2_128s,eddsa_ed25519,eddsa_ed448,
3031+
ecdsa_secp521r1_sha512,ecdsa_secp384r1_sha384,ecdsa_secp256r1_sha256,
3032+
ecdsa_brainpoolP512r1tls13_sha512,ecdsa_brainpoolP384r1tls13_sha384,
3033+
ecdsa_brainpoolP256r1tls13_sha256,rsa_pss_pss_sha512,rsa_pss_pss_sha384,
3034+
rsa_pss_pss_sha256,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,
3035+
rsa_pss_rsae_sha256,rsa_pkcs1_sha512,rsa_pkcs1_sha384,rsa_pkcs1_sha256,
30353036
{sha512,ecdsa},
30363037
{sha384,ecdsa},
3037-
{sha256,ecdsa}]
3038+
{sha256,ecdsa}].
30383039

30393040
2> ssl:signature_algs(all, 'tlsv1.3').
3040-
[eddsa_ed25519,eddsa_ed448,ecdsa_secp521r1_sha512,ecdsa_secp384r1_sha384,
3041-
ecdsa_secp256r1_sha256,ecdsa_brainpoolP512r1tls13_sha512,
3042-
ecdsa_brainpoolP384r1tls13_sha384,ecdsa_brainpoolP256r1tls13_sha256,
3043-
rsa_pss_pss_sha512,rsa_pss_pss_sha384,rsa_pss_pss_sha256,rsa_pss_rsae_sha512,
3044-
rsa_pss_rsae_sha384,rsa_pss_rsae_sha256,mldsa44,mldsa65,mldsa87,
3045-
rsa_pkcs1_sha512,rsa_pkcs1_sha384,rsa_pkcs1_sha256,
3041+
[mldsa87,mldsa65,mldsa44,slh_dsa_shake_256f,slh_dsa_shake_256s,
3042+
slh_dsa_sha2_256f,slh_dsa_sha2_256s,slh_dsa_shake_192f,slh_dsa_shake_192s,
3043+
slh_dsa_sha2_192f,slh_dsa_sha2_192s,slh_dsa_shake_128f,slh_dsa_shake_128s,
3044+
slh_dsa_sha2_128f,slh_dsa_sha2_128s,eddsa_ed25519,eddsa_ed448,
3045+
ecdsa_secp521r1_sha512,ecdsa_secp384r1_sha384,ecdsa_secp256r1_sha256,
3046+
ecdsa_brainpoolP512r1tls13_sha512,ecdsa_brainpoolP384r1tls13_sha384,
3047+
ecdsa_brainpoolP256r1tls13_sha256,rsa_pss_pss_sha512,rsa_pss_pss_sha384,
3048+
rsa_pss_pss_sha256,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,
3049+
rsa_pss_rsae_sha256,rsa_pkcs1_sha512,rsa_pkcs1_sha384,rsa_pkcs1_sha256,
30463050
{sha512,ecdsa},
30473051
{sha384,ecdsa},
30483052
{sha256,ecdsa},
@@ -3055,15 +3059,15 @@ Example:
30553059
{sha,dsa}]
30563060

30573061
3> [ssl:signature_algs(exclusive, 'tlsv1.3').
3058-
[eddsa_ed25519,eddsa_ed448,ecdsa_secp521r1_sha512,ecdsa_secp384r1_sha384,
3059-
ecdsa_secp256r1_sha256,ecdsa_brainpoolP512r1tls13_sha512,
3060-
ecdsa_brainpoolP384r1tls13_sha384,ecdsa_brainpoolP256r1tls13_sha256,
3061-
rsa_pss_pss_sha512,rsa_pss_pss_sha384,rsa_pss_pss_sha256,rsa_pss_rsae_sha512,
3062-
rsa_pss_rsae_sha384,rsa_pss_rsae_sha256,mldsa44,mldsa65,mldsa87,
3063-
rsa_pkcs1_sha512,rsa_pkcs1_sha384,rsa_pkcs1_sha256,slh_dsa_shake_256f,
3064-
slh_dsa_shake_256s,slh_dsa_sha2_256f,slh_dsa_sha2_256s,slh_dsa_shake_192f,
3065-
slh_dsa_shake_192s,slh_dsa_sha2_192f,slh_dsa_sha2_192s,slh_dsa_shake_128f,
3066-
slh_dsa_shake_128s,slh_dsa_sha2_128f,slh_dsa_sha2_128s]
3062+
[mldsa87,mldsa65,mldsa44,slh_dsa_shake_256f,slh_dsa_shake_256s,
3063+
slh_dsa_sha2_256f,slh_dsa_sha2_256s,slh_dsa_shake_192f,slh_dsa_shake_192s,
3064+
slh_dsa_sha2_192f,slh_dsa_sha2_192s,slh_dsa_shake_128f,slh_dsa_shake_128s,
3065+
slh_dsa_sha2_128f,slh_dsa_sha2_128s,eddsa_ed25519,eddsa_ed448,
3066+
ecdsa_secp521r1_sha512,ecdsa_secp384r1_sha384,ecdsa_secp256r1_sha256,
3067+
ecdsa_brainpoolP512r1tls13_sha512,ecdsa_brainpoolP384r1tls13_sha384,
3068+
ecdsa_brainpoolP256r1tls13_sha256,rsa_pss_pss_sha512,rsa_pss_pss_sha384,
3069+
rsa_pss_pss_sha256,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,
3070+
rsa_pss_rsae_sha256,rsa_pkcs1_sha512,rsa_pkcs1_sha384,rsa_pkcs1_sha256]
30673071
```
30683072

30693073
> #### Note {: .info }
@@ -3089,15 +3093,13 @@ signature_algs(default, 'tlsv1.2') ->
30893093
signature_algs(all, 'tlsv1.3') ->
30903094
tls_v1:default_signature_algs([tls_record:protocol_version_name('tlsv1.3'),
30913095
tls_record:protocol_version_name('tlsv1.2')]) ++
3092-
tls_v1:slh_dsa_schemes() ++
30933096
[ecdsa_sha1, rsa_pkcs1_sha1 | tls_v1:legacy_signature_algs_pre_13()] --
30943097
[{sha, ecdsa}, {sha, rsa}];
30953098
signature_algs(all, 'tlsv1.2') ->
30963099
tls_v1:default_signature_algs([tls_record:protocol_version_name('tlsv1.2')]) ++
30973100
tls_v1:legacy_signature_algs_pre_13();
30983101
signature_algs(exclusive, 'tlsv1.3') ->
3099-
tls_v1:default_signature_algs([tls_record:protocol_version_name('tlsv1.3')]) ++
3100-
tls_v1:slh_dsa_schemes();
3102+
tls_v1:default_signature_algs([tls_record:protocol_version_name('tlsv1.3')]);
31013103
signature_algs(exclusive, 'tlsv1.2') ->
31023104
Algs = tls_v1:default_signature_algs([tls_record:protocol_version_name('tlsv1.2')]),
31033105
Algs ++ tls_v1:legacy_signature_algs_pre_13();

lib/ssl/src/ssl_certificate.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ available_cert_key_pairs(CertKeyGroups) ->
361361
%% Create the prioritized list of cert key pairs that
362362
%% are availble for use in the negotiated version
363363
available_cert_key_pairs(CertKeyGroups, ?TLS_1_3) ->
364-
RevAlgos = [slhdsa, mldsa, rsa, rsa_pss_pss, ecdsa, eddsa],
364+
RevAlgos = [rsa, rsa_pss_pss, ecdsa, eddsa, slhdsa, mldsa],
365365
cert_key_group_to_list(RevAlgos, CertKeyGroups, []);
366366
available_cert_key_pairs(CertKeyGroups, ?TLS_1_2) ->
367367
RevAlgos = [dsa, rsa, rsa_pss_pss, ecdsa],

lib/ssl/src/tls_v1.erl

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,24 +1047,24 @@ signature_schemes(_, _) ->
10471047
[].
10481048

10491049
default_signature_schemes(Version) ->
1050-
Default = [eddsa_ed25519,
1051-
eddsa_ed448,
1052-
ecdsa_secp521r1_sha512,
1053-
ecdsa_secp384r1_sha384,
1054-
ecdsa_secp256r1_sha256,
1055-
ecdsa_brainpoolP512r1tls13_sha512,
1056-
ecdsa_brainpoolP384r1tls13_sha384,
1057-
ecdsa_brainpoolP256r1tls13_sha256,
1058-
rsa_pss_pss_sha512,
1059-
rsa_pss_pss_sha384,
1060-
rsa_pss_pss_sha256,
1061-
rsa_pss_rsae_sha512,
1062-
rsa_pss_rsae_sha384,
1063-
rsa_pss_rsae_sha256,
1064-
mldsa44,
1050+
Default = [mldsa87,
10651051
mldsa65,
1066-
mldsa87
1067-
],
1052+
mldsa44] ++ slh_dsa_schemes() ++
1053+
[eddsa_ed25519,
1054+
eddsa_ed448,
1055+
ecdsa_secp521r1_sha512,
1056+
ecdsa_secp384r1_sha384,
1057+
ecdsa_secp256r1_sha256,
1058+
ecdsa_brainpoolP512r1tls13_sha512,
1059+
ecdsa_brainpoolP384r1tls13_sha384,
1060+
ecdsa_brainpoolP256r1tls13_sha256,
1061+
rsa_pss_pss_sha512,
1062+
rsa_pss_pss_sha384,
1063+
rsa_pss_pss_sha256,
1064+
rsa_pss_rsae_sha512,
1065+
rsa_pss_rsae_sha384,
1066+
rsa_pss_rsae_sha256
1067+
],
10681068
signature_schemes(Version, Default).
10691069

10701070
legacy_signature_schemes(Version) ->

0 commit comments

Comments
 (0)