Skip to content

Commit 812070f

Browse files
authored
Merge pull request #22 from 42wim/cert
Match on prefix for certificates
2 parents 10fde50 + 38d4006 commit 812070f

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

httpsig.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"crypto"
1212
"fmt"
1313
"net/http"
14+
"strings"
1415
"time"
1516

1617
"golang.org/x/crypto/ssh"
@@ -229,10 +230,10 @@ func NewSSHSigner(s ssh.Signer, dAlgo DigestAlgorithm, headers []string, scheme
229230
}
230231

231232
func getSSHAlgorithm(pkType string) Algorithm {
232-
switch pkType {
233-
case sshPrefix + "-" + ed25519Prefix:
233+
switch {
234+
case strings.HasPrefix(pkType, sshPrefix+"-"+ed25519Prefix):
234235
return ED25519
235-
case sshPrefix + "-" + rsaPrefix:
236+
case strings.HasPrefix(pkType, sshPrefix+"-"+rsaPrefix):
236237
return RSA_SHA1
237238
}
238239

0 commit comments

Comments
 (0)