mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-05-08 14:05:28 +00:00
Merge pull request #1062 from NVIDIA/dependabot/go_modules/tests/main/golang.org/x/crypto-0.38.0
Bump golang.org/x/crypto from 0.37.0 to 0.38.0 in /tests
This commit is contained in:
commit
f50e815837
@ -7,7 +7,7 @@ toolchain go1.24.1
|
||||
require (
|
||||
github.com/onsi/ginkgo/v2 v2.23.4
|
||||
github.com/onsi/gomega v1.37.0
|
||||
golang.org/x/crypto v0.37.0
|
||||
golang.org/x/crypto v0.38.0
|
||||
)
|
||||
|
||||
require (
|
||||
@ -17,8 +17,8 @@ require (
|
||||
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
|
||||
go.uber.org/automaxprocs v1.6.0 // indirect
|
||||
golang.org/x/net v0.38.0 // indirect
|
||||
golang.org/x/sys v0.32.0 // indirect
|
||||
golang.org/x/text v0.24.0 // indirect
|
||||
golang.org/x/sys v0.33.0 // indirect
|
||||
golang.org/x/text v0.25.0 // indirect
|
||||
golang.org/x/tools v0.31.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
16
tests/go.sum
16
tests/go.sum
@ -24,16 +24,16 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
|
||||
go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
|
||||
golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE=
|
||||
golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc=
|
||||
golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8=
|
||||
golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw=
|
||||
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
|
||||
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
|
||||
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
|
||||
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o=
|
||||
golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw=
|
||||
golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
|
||||
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
|
||||
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
|
||||
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
|
||||
golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
|
||||
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
|
||||
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
|
||||
golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU=
|
||||
golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ=
|
||||
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
|
||||
|
187
tests/vendor/golang.org/x/crypto/ssh/mlkem.go
generated
vendored
Normal file
187
tests/vendor/golang.org/x/crypto/ssh/mlkem.go
generated
vendored
Normal file
@ -0,0 +1,187 @@
|
||||
// Copyright 2024 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build go1.24
|
||||
|
||||
package ssh
|
||||
|
||||
import (
|
||||
"crypto"
|
||||
"crypto/mlkem"
|
||||
"crypto/sha256"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"runtime"
|
||||
"slices"
|
||||
|
||||
"golang.org/x/crypto/curve25519"
|
||||
)
|
||||
|
||||
const (
|
||||
kexAlgoMLKEM768xCurve25519SHA256 = "mlkem768x25519-sha256"
|
||||
)
|
||||
|
||||
func init() {
|
||||
// After Go 1.24rc1 mlkem swapped the order of return values of Encapsulate.
|
||||
// See #70950.
|
||||
if runtime.Version() == "go1.24rc1" {
|
||||
return
|
||||
}
|
||||
supportedKexAlgos = slices.Insert(supportedKexAlgos, 0, kexAlgoMLKEM768xCurve25519SHA256)
|
||||
preferredKexAlgos = slices.Insert(preferredKexAlgos, 0, kexAlgoMLKEM768xCurve25519SHA256)
|
||||
kexAlgoMap[kexAlgoMLKEM768xCurve25519SHA256] = &mlkem768WithCurve25519sha256{}
|
||||
}
|
||||
|
||||
// mlkem768WithCurve25519sha256 implements the hybrid ML-KEM768 with
|
||||
// curve25519-sha256 key exchange method, as described by
|
||||
// draft-kampanakis-curdle-ssh-pq-ke-05 section 2.3.3.
|
||||
type mlkem768WithCurve25519sha256 struct{}
|
||||
|
||||
func (kex *mlkem768WithCurve25519sha256) Client(c packetConn, rand io.Reader, magics *handshakeMagics) (*kexResult, error) {
|
||||
var c25519kp curve25519KeyPair
|
||||
if err := c25519kp.generate(rand); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
seed := make([]byte, mlkem.SeedSize)
|
||||
if _, err := io.ReadFull(rand, seed); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
mlkemDk, err := mlkem.NewDecapsulationKey768(seed)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
hybridKey := append(mlkemDk.EncapsulationKey().Bytes(), c25519kp.pub[:]...)
|
||||
if err := c.writePacket(Marshal(&kexECDHInitMsg{hybridKey})); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
packet, err := c.readPacket()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var reply kexECDHReplyMsg
|
||||
if err = Unmarshal(packet, &reply); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if len(reply.EphemeralPubKey) != mlkem.CiphertextSize768+32 {
|
||||
return nil, errors.New("ssh: peer's mlkem768x25519 public value has wrong length")
|
||||
}
|
||||
|
||||
// Perform KEM decapsulate operation to obtain shared key from ML-KEM.
|
||||
mlkem768Secret, err := mlkemDk.Decapsulate(reply.EphemeralPubKey[:mlkem.CiphertextSize768])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Complete Curve25519 ECDH to obtain its shared key.
|
||||
c25519Secret, err := curve25519.X25519(c25519kp.priv[:], reply.EphemeralPubKey[mlkem.CiphertextSize768:])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("ssh: peer's mlkem768x25519 public value is not valid: %w", err)
|
||||
}
|
||||
// Compute actual shared key.
|
||||
h := sha256.New()
|
||||
h.Write(mlkem768Secret)
|
||||
h.Write(c25519Secret)
|
||||
secret := h.Sum(nil)
|
||||
|
||||
h.Reset()
|
||||
magics.write(h)
|
||||
writeString(h, reply.HostKey)
|
||||
writeString(h, hybridKey)
|
||||
writeString(h, reply.EphemeralPubKey)
|
||||
|
||||
K := make([]byte, stringLength(len(secret)))
|
||||
marshalString(K, secret)
|
||||
h.Write(K)
|
||||
|
||||
return &kexResult{
|
||||
H: h.Sum(nil),
|
||||
K: K,
|
||||
HostKey: reply.HostKey,
|
||||
Signature: reply.Signature,
|
||||
Hash: crypto.SHA256,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (kex *mlkem768WithCurve25519sha256) Server(c packetConn, rand io.Reader, magics *handshakeMagics, priv AlgorithmSigner, algo string) (*kexResult, error) {
|
||||
packet, err := c.readPacket()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var kexInit kexECDHInitMsg
|
||||
if err = Unmarshal(packet, &kexInit); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if len(kexInit.ClientPubKey) != mlkem.EncapsulationKeySize768+32 {
|
||||
return nil, errors.New("ssh: peer's ML-KEM768/curve25519 public value has wrong length")
|
||||
}
|
||||
|
||||
encapsulationKey, err := mlkem.NewEncapsulationKey768(kexInit.ClientPubKey[:mlkem.EncapsulationKeySize768])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("ssh: peer's ML-KEM768 encapsulation key is not valid: %w", err)
|
||||
}
|
||||
// Perform KEM encapsulate operation to obtain ciphertext and shared key.
|
||||
mlkem768Secret, mlkem768Ciphertext := encapsulationKey.Encapsulate()
|
||||
|
||||
// Perform server side of Curve25519 ECDH to obtain server public value and
|
||||
// shared key.
|
||||
var c25519kp curve25519KeyPair
|
||||
if err := c25519kp.generate(rand); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
c25519Secret, err := curve25519.X25519(c25519kp.priv[:], kexInit.ClientPubKey[mlkem.EncapsulationKeySize768:])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("ssh: peer's ML-KEM768/curve25519 public value is not valid: %w", err)
|
||||
}
|
||||
hybridKey := append(mlkem768Ciphertext, c25519kp.pub[:]...)
|
||||
|
||||
// Compute actual shared key.
|
||||
h := sha256.New()
|
||||
h.Write(mlkem768Secret)
|
||||
h.Write(c25519Secret)
|
||||
secret := h.Sum(nil)
|
||||
|
||||
hostKeyBytes := priv.PublicKey().Marshal()
|
||||
|
||||
h.Reset()
|
||||
magics.write(h)
|
||||
writeString(h, hostKeyBytes)
|
||||
writeString(h, kexInit.ClientPubKey)
|
||||
writeString(h, hybridKey)
|
||||
|
||||
K := make([]byte, stringLength(len(secret)))
|
||||
marshalString(K, secret)
|
||||
h.Write(K)
|
||||
|
||||
H := h.Sum(nil)
|
||||
|
||||
sig, err := signAndMarshal(priv, rand, H, algo)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
reply := kexECDHReplyMsg{
|
||||
EphemeralPubKey: hybridKey,
|
||||
HostKey: hostKeyBytes,
|
||||
Signature: sig,
|
||||
}
|
||||
if err := c.writePacket(Marshal(&reply)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &kexResult{
|
||||
H: H,
|
||||
K: K,
|
||||
HostKey: hostKeyBytes,
|
||||
Signature: sig,
|
||||
Hash: crypto.SHA256,
|
||||
}, nil
|
||||
}
|
11
tests/vendor/golang.org/x/sys/cpu/cpu.go
generated
vendored
11
tests/vendor/golang.org/x/sys/cpu/cpu.go
generated
vendored
@ -232,6 +232,17 @@ var RISCV64 struct {
|
||||
HasZba bool // Address generation instructions extension
|
||||
HasZbb bool // Basic bit-manipulation extension
|
||||
HasZbs bool // Single-bit instructions extension
|
||||
HasZvbb bool // Vector Basic Bit-manipulation
|
||||
HasZvbc bool // Vector Carryless Multiplication
|
||||
HasZvkb bool // Vector Cryptography Bit-manipulation
|
||||
HasZvkt bool // Vector Data-Independent Execution Latency
|
||||
HasZvkg bool // Vector GCM/GMAC
|
||||
HasZvkn bool // NIST Algorithm Suite (AES/SHA256/SHA512)
|
||||
HasZvknc bool // NIST Algorithm Suite with carryless multiply
|
||||
HasZvkng bool // NIST Algorithm Suite with GCM
|
||||
HasZvks bool // ShangMi Algorithm Suite
|
||||
HasZvksc bool // ShangMi Algorithm Suite with carryless multiplication
|
||||
HasZvksg bool // ShangMi Algorithm Suite with GCM
|
||||
_ CacheLinePad
|
||||
}
|
||||
|
||||
|
23
tests/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go
generated
vendored
23
tests/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go
generated
vendored
@ -58,6 +58,15 @@ const (
|
||||
riscv_HWPROBE_EXT_ZBA = 0x8
|
||||
riscv_HWPROBE_EXT_ZBB = 0x10
|
||||
riscv_HWPROBE_EXT_ZBS = 0x20
|
||||
riscv_HWPROBE_EXT_ZVBB = 0x20000
|
||||
riscv_HWPROBE_EXT_ZVBC = 0x40000
|
||||
riscv_HWPROBE_EXT_ZVKB = 0x80000
|
||||
riscv_HWPROBE_EXT_ZVKG = 0x100000
|
||||
riscv_HWPROBE_EXT_ZVKNED = 0x200000
|
||||
riscv_HWPROBE_EXT_ZVKNHB = 0x800000
|
||||
riscv_HWPROBE_EXT_ZVKSED = 0x1000000
|
||||
riscv_HWPROBE_EXT_ZVKSH = 0x2000000
|
||||
riscv_HWPROBE_EXT_ZVKT = 0x4000000
|
||||
riscv_HWPROBE_KEY_CPUPERF_0 = 0x5
|
||||
riscv_HWPROBE_MISALIGNED_FAST = 0x3
|
||||
riscv_HWPROBE_MISALIGNED_MASK = 0x7
|
||||
@ -99,6 +108,20 @@ func doinit() {
|
||||
RISCV64.HasZba = isSet(v, riscv_HWPROBE_EXT_ZBA)
|
||||
RISCV64.HasZbb = isSet(v, riscv_HWPROBE_EXT_ZBB)
|
||||
RISCV64.HasZbs = isSet(v, riscv_HWPROBE_EXT_ZBS)
|
||||
RISCV64.HasZvbb = isSet(v, riscv_HWPROBE_EXT_ZVBB)
|
||||
RISCV64.HasZvbc = isSet(v, riscv_HWPROBE_EXT_ZVBC)
|
||||
RISCV64.HasZvkb = isSet(v, riscv_HWPROBE_EXT_ZVKB)
|
||||
RISCV64.HasZvkg = isSet(v, riscv_HWPROBE_EXT_ZVKG)
|
||||
RISCV64.HasZvkt = isSet(v, riscv_HWPROBE_EXT_ZVKT)
|
||||
// Cryptography shorthand extensions
|
||||
RISCV64.HasZvkn = isSet(v, riscv_HWPROBE_EXT_ZVKNED) &&
|
||||
isSet(v, riscv_HWPROBE_EXT_ZVKNHB) && RISCV64.HasZvkb && RISCV64.HasZvkt
|
||||
RISCV64.HasZvknc = RISCV64.HasZvkn && RISCV64.HasZvbc
|
||||
RISCV64.HasZvkng = RISCV64.HasZvkn && RISCV64.HasZvkg
|
||||
RISCV64.HasZvks = isSet(v, riscv_HWPROBE_EXT_ZVKSED) &&
|
||||
isSet(v, riscv_HWPROBE_EXT_ZVKSH) && RISCV64.HasZvkb && RISCV64.HasZvkt
|
||||
RISCV64.HasZvksc = RISCV64.HasZvks && RISCV64.HasZvbc
|
||||
RISCV64.HasZvksg = RISCV64.HasZvks && RISCV64.HasZvkg
|
||||
}
|
||||
if pairs[1].key != -1 {
|
||||
v := pairs[1].value & riscv_HWPROBE_MISALIGNED_MASK
|
||||
|
12
tests/vendor/golang.org/x/sys/cpu/cpu_riscv64.go
generated
vendored
12
tests/vendor/golang.org/x/sys/cpu/cpu_riscv64.go
generated
vendored
@ -16,5 +16,17 @@ func initOptions() {
|
||||
{Name: "zba", Feature: &RISCV64.HasZba},
|
||||
{Name: "zbb", Feature: &RISCV64.HasZbb},
|
||||
{Name: "zbs", Feature: &RISCV64.HasZbs},
|
||||
// RISC-V Cryptography Extensions
|
||||
{Name: "zvbb", Feature: &RISCV64.HasZvbb},
|
||||
{Name: "zvbc", Feature: &RISCV64.HasZvbc},
|
||||
{Name: "zvkb", Feature: &RISCV64.HasZvkb},
|
||||
{Name: "zvkg", Feature: &RISCV64.HasZvkg},
|
||||
{Name: "zvkt", Feature: &RISCV64.HasZvkt},
|
||||
{Name: "zvkn", Feature: &RISCV64.HasZvkn},
|
||||
{Name: "zvknc", Feature: &RISCV64.HasZvknc},
|
||||
{Name: "zvkng", Feature: &RISCV64.HasZvkng},
|
||||
{Name: "zvks", Feature: &RISCV64.HasZvks},
|
||||
{Name: "zvksc", Feature: &RISCV64.HasZvksc},
|
||||
{Name: "zvksg", Feature: &RISCV64.HasZvksg},
|
||||
}
|
||||
}
|
||||
|
6
tests/vendor/modules.txt
vendored
6
tests/vendor/modules.txt
vendored
@ -56,7 +56,7 @@ go.uber.org/automaxprocs
|
||||
go.uber.org/automaxprocs/internal/cgroups
|
||||
go.uber.org/automaxprocs/internal/runtime
|
||||
go.uber.org/automaxprocs/maxprocs
|
||||
# golang.org/x/crypto v0.37.0
|
||||
# golang.org/x/crypto v0.38.0
|
||||
## explicit; go 1.23.0
|
||||
golang.org/x/crypto/blowfish
|
||||
golang.org/x/crypto/chacha20
|
||||
@ -70,11 +70,11 @@ golang.org/x/crypto/ssh/internal/bcrypt_pbkdf
|
||||
golang.org/x/net/html
|
||||
golang.org/x/net/html/atom
|
||||
golang.org/x/net/html/charset
|
||||
# golang.org/x/sys v0.32.0
|
||||
# golang.org/x/sys v0.33.0
|
||||
## explicit; go 1.23.0
|
||||
golang.org/x/sys/cpu
|
||||
golang.org/x/sys/unix
|
||||
# golang.org/x/text v0.24.0
|
||||
# golang.org/x/text v0.25.0
|
||||
## explicit; go 1.23.0
|
||||
golang.org/x/text/encoding
|
||||
golang.org/x/text/encoding/charmap
|
||||
|
Loading…
Reference in New Issue
Block a user