aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/signer/signer.go11
1 files changed, 1 insertions, 10 deletions
diff --git a/server/signer/signer.go b/server/signer/signer.go
index 5ee170a..a4cf919 100644
--- a/server/signer/signer.go
+++ b/server/signer/signer.go
@@ -1,11 +1,9 @@
package signer
import (
- "crypto/md5"
"crypto/rand"
"fmt"
"log"
- "strings"
"time"
"go4.org/wkfs"
@@ -49,7 +47,7 @@ func (s *KeySigner) SignUserKey(req *lib.SignRequest, username string) (*ssh.Cer
if err := cert.SignCert(rand.Reader, s.ca); err != nil {
return nil, err
}
- log.Printf("Issued cert id: %s principals: %s fp: %s valid until: %s\n", cert.KeyId, cert.ValidPrincipals, fingerprint(pubkey), time.Unix(int64(cert.ValidBefore), 0).UTC())
+ log.Printf("Issued cert id: %s principals: %s fp: %s valid until: %s\n", cert.KeyId, cert.ValidPrincipals, ssh.FingerprintSHA256(pubkey), time.Unix(int64(cert.ValidBefore), 0).UTC())
return cert, nil
}
@@ -107,10 +105,3 @@ func New(conf *config.SSH) (*KeySigner, error) {
permissions: makeperms(conf.Permissions),
}, nil
}
-
-func fingerprint(pubkey ssh.PublicKey) string {
- md5String := md5.New()
- md5String.Write(pubkey.Marshal())
- fp := fmt.Sprintf("% x", md5String.Sum(nil))
- return strings.Replace(fp, " ", ":", -1)
-}