aboutsummaryrefslogtreecommitdiff
path: root/server/signer
diff options
context:
space:
mode:
Diffstat (limited to 'server/signer')
-rw-r--r--server/signer/signer.go4
-rw-r--r--server/signer/signer_test.go1
2 files changed, 5 insertions, 0 deletions
diff --git a/server/signer/signer.go b/server/signer/signer.go
index 2a8fc98..47ff7c8 100644
--- a/server/signer/signer.go
+++ b/server/signer/signer.go
@@ -62,6 +62,7 @@ func (s *KeySigner) SignUserKeyFromRPC(req *proto.SignRequest, username string)
r := &lib.SignRequest{
Key: string(req.GetKey()),
ValidUntil: valid,
+ Message: string(req.GetMessage()),
}
return s.SignUserKey(r, username)
}
@@ -89,6 +90,9 @@ func (s *KeySigner) SignUserKey(req *lib.SignRequest, username string) (*ssh.Cer
if err := cert.SignCert(rand.Reader, s.ca); err != nil {
return nil, err
}
+ if req.Message != "" {
+ log.Printf("Message from %s: %s", username, req.Message)
+ }
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
}
diff --git a/server/signer/signer_test.go b/server/signer/signer_test.go
index 726a69b..c07d62b 100644
--- a/server/signer/signer_test.go
+++ b/server/signer/signer_test.go
@@ -28,6 +28,7 @@ func TestCert(t *testing.T) {
r := &lib.SignRequest{
Key: string(testdata.Pub),
ValidUntil: time.Now().Add(1 * time.Hour),
+ Message: "hello world",
}
cert, err := signer.SignUserKey(r, "gopher1")
if err != nil {