From 8cff98973996ea82734de3db273cf47ae2b2e3bf Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Wed, 15 Jun 2022 10:02:07 +0200 Subject: [PATCH] send server-sig-algs using the same order as OpenSSH Signed-off-by: Nicola Murino --- ssh/common.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ssh/common.go b/ssh/common.go index 39cbbf734e..ba781a5303 100644 --- a/ssh/common.go +++ b/ssh/common.go @@ -97,13 +97,13 @@ var supportedMACs = []string{ var supportedCompressions = []string{compressionNone} -// supportedServerSigAlgs defines the algorithms supported for pubkey authentication -// in no particular order. See RFC 8308, Section 3.1. -var supportedServerSigAlgs = []string{KeyAlgoRSASHA256, - KeyAlgoRSASHA512, KeyAlgoRSA, - KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521, - KeyAlgoSKECDSA256, KeyAlgoED25519, KeyAlgoSKED25519, - KeyAlgoDSA, +// supportedServerSigAlgs defines the algorithms supported for pubkey authentication. +// Order should not matter, but to avoid any issues we use the same order as OpenSSH. +// See RFC 8308, Section 3.1. +var supportedServerSigAlgs = []string{KeyAlgoED25519, KeyAlgoSKED25519, + KeyAlgoRSA, KeyAlgoRSASHA256, KeyAlgoRSASHA512, + KeyAlgoDSA, KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521, + KeyAlgoSKECDSA256, } // hashFuncs keeps the mapping of supported signature algorithms to their