Skip to content

Commit f8c1eaf

Browse files
committed
Ignore insecure ssh.KeyAlgoDSA usages using nolint
1 parent edca39f commit f8c1eaf

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

command/crypto/key/format.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ func formatAction(ctx *cli.Context) error {
286286
func isSSHPublicKey(in []byte) bool {
287287
switch {
288288
case bytes.HasPrefix(in, []byte(ssh.KeyAlgoRSA)),
289-
bytes.HasPrefix(in, []byte(ssh.KeyAlgoDSA)),
289+
bytes.HasPrefix(in, []byte(ssh.InsecureKeyAlgoDSA)), //nolint:staticcheck // compatibility with older tooling
290290
bytes.HasPrefix(in, []byte(ssh.KeyAlgoECDSA256)),
291291
bytes.HasPrefix(in, []byte(ssh.KeyAlgoECDSA384)),
292292
bytes.HasPrefix(in, []byte(ssh.KeyAlgoECDSA521)),

internal/sshutil/sshutil.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func PublicKey(key ssh.PublicKey) (crypto.PublicKey, error) {
5858
return parseECDSA(in)
5959
case ssh.KeyAlgoED25519, ssh.KeyAlgoSKED25519:
6060
return parseED25519(in)
61-
case ssh.KeyAlgoDSA:
61+
case ssh.InsecureKeyAlgoDSA: //nolint:staticcheck // compatibility with older tooling
6262
return parseDSA(in)
6363
default:
6464
return nil, errors.Errorf("public key %s is not supported", key.Type())
@@ -98,7 +98,7 @@ func publicKeyTypeAndSize(key ssh.PublicKey) (string, int, error) {
9898
return "", 0, err
9999
}
100100
size = 8 * k.Size()
101-
case ssh.KeyAlgoDSA:
101+
case ssh.InsecureKeyAlgoDSA: //nolint:staticcheck // compatibility with older tooling
102102
typ = "DSA"
103103
_, in, ok := parseString(key.Marshal())
104104
if !ok {

0 commit comments

Comments
 (0)