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 83
83
// supportedKexAlgos specifies key-exchange algorithms implemented by this
84
84
// package in preference order, excluding those with security issues.
85
85
supportedKexAlgos = []string {
86
+ KeyExchangeMLKEM768X25519 ,
86
87
KeyExchangeCurve25519 ,
87
88
KeyExchangeECDHP256 ,
88
89
KeyExchangeECDHP384 ,
94
95
// defaultKexAlgos specifies the default preference for key-exchange
95
96
// algorithms in preference order.
96
97
defaultKexAlgos = []string {
98
+ KeyExchangeMLKEM768X25519 ,
97
99
KeyExchangeCurve25519 ,
98
100
KeyExchangeECDHP256 ,
99
101
KeyExchangeECDHP384 ,
Original file line number Diff line number Diff line change @@ -438,6 +438,7 @@ func init() {
438
438
kexAlgoMap [keyExchangeCurve25519LibSSH ] = & curve25519sha256 {}
439
439
kexAlgoMap [InsecureKeyExchangeDHGEXSHA1 ] = & dhGEXSHA {hashFunc : crypto .SHA1 }
440
440
kexAlgoMap [KeyExchangeDHGEXSHA256 ] = & dhGEXSHA {hashFunc : crypto .SHA256 }
441
+ kexAlgoMap [KeyExchangeMLKEM768X25519 ] = & mlkem768WithCurve25519sha256 {}
441
442
}
442
443
443
444
// curve25519sha256 implements the curve25519-sha256 (formerly known as
Original file line number Diff line number Diff line change 2
2
// Use of this source code is governed by a BSD-style
3
3
// license that can be found in the LICENSE file.
4
4
5
- //go:build go1.24
6
-
7
5
package ssh
8
6
9
7
import (
@@ -13,23 +11,10 @@ import (
13
11
"errors"
14
12
"fmt"
15
13
"io"
16
- "runtime"
17
- "slices"
18
14
19
15
"golang.org/x/crypto/curve25519"
20
16
)
21
17
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
-
33
18
// mlkem768WithCurve25519sha256 implements the hybrid ML-KEM768 with
34
19
// curve25519-sha256 key exchange method, as described by
35
20
// draft-kampanakis-curdle-ssh-pq-ke-05 section 2.3.3.
You can’t perform that action at this time.
0 commit comments