File tree Expand file tree Collapse file tree 3 files changed +3
-15
lines changed Expand file tree Collapse file tree 3 files changed +3
-15
lines changed Original file line number Diff line number Diff line change 8383 // supportedKexAlgos specifies key-exchange algorithms implemented by this
8484 // package in preference order, excluding those with security issues.
8585 supportedKexAlgos = []string {
86+ KeyExchangeMLKEM768X25519 ,
8687 KeyExchangeCurve25519 ,
8788 KeyExchangeECDHP256 ,
8889 KeyExchangeECDHP384 ,
9495 // defaultKexAlgos specifies the default preference for key-exchange
9596 // algorithms in preference order.
9697 defaultKexAlgos = []string {
98+ KeyExchangeMLKEM768X25519 ,
9799 KeyExchangeCurve25519 ,
98100 KeyExchangeECDHP256 ,
99101 KeyExchangeECDHP384 ,
Original file line number Diff line number Diff line change @@ -438,6 +438,7 @@ func init() {
438438 kexAlgoMap [keyExchangeCurve25519LibSSH ] = & curve25519sha256 {}
439439 kexAlgoMap [InsecureKeyExchangeDHGEXSHA1 ] = & dhGEXSHA {hashFunc : crypto .SHA1 }
440440 kexAlgoMap [KeyExchangeDHGEXSHA256 ] = & dhGEXSHA {hashFunc : crypto .SHA256 }
441+ kexAlgoMap [KeyExchangeMLKEM768X25519 ] = & mlkem768WithCurve25519sha256 {}
441442}
442443
443444// curve25519sha256 implements the curve25519-sha256 (formerly known as
Original file line number Diff line number Diff line change 22// Use of this source code is governed by a BSD-style
33// license that can be found in the LICENSE file.
44
5- //go:build go1.24
6-
75package ssh
86
97import (
@@ -13,23 +11,10 @@ import (
1311 "errors"
1412 "fmt"
1513 "io"
16- "runtime"
17- "slices"
1814
1915 "golang.org/x/crypto/curve25519"
2016)
2117
22- func init () {
23- // After Go 1.24rc1 mlkem swapped the order of return values of Encapsulate.
24- // See #70950.
25- if runtime .Version () == "go1.24rc1" {
26- return
27- }
28- supportedKexAlgos = slices .Insert (supportedKexAlgos , 0 , KeyExchangeMLKEM768X25519 )
29- defaultKexAlgos = slices .Insert (defaultKexAlgos , 0 , KeyExchangeMLKEM768X25519 )
30- kexAlgoMap [KeyExchangeMLKEM768X25519 ] = & mlkem768WithCurve25519sha256 {}
31- }
32-
3318// mlkem768WithCurve25519sha256 implements the hybrid ML-KEM768 with
3419// curve25519-sha256 key exchange method, as described by
3520// draft-kampanakis-curdle-ssh-pq-ke-05 section 2.3.3.
You can’t perform that action at this time.
0 commit comments