From 769bcd6997ac6f3154e27b73b3587295f7720e66 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Sun, 26 Jan 2025 10:45:16 +0100 Subject: [PATCH] ssh: use the configured rand in kex init Change-Id: I4f89c395886b9dd07b584d1fcf1a0f2df215b91b Reviewed-on: https://go-review.googlesource.com/c/crypto/+/644435 Reviewed-by: Filippo Valsorda Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI Auto-Submit: Carlos Amedee Reviewed-by: Carlos Amedee --- ssh/handshake.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ssh/handshake.go b/ssh/handshake.go index c9202b0..b6bf546 100644 --- a/ssh/handshake.go +++ b/ssh/handshake.go @@ -5,7 +5,6 @@ package ssh import ( - "crypto/rand" "errors" "fmt" "io" @@ -501,7 +500,7 @@ func (t *handshakeTransport) sendKexInit() error { CompressionClientServer: supportedCompressions, CompressionServerClient: supportedCompressions, } - io.ReadFull(rand.Reader, msg.Cookie[:]) + io.ReadFull(t.config.Rand, msg.Cookie[:]) // We mutate the KexAlgos slice, in order to add the kex-strict extension algorithm, // and possibly to add the ext-info extension algorithm. Since the slice may be the