fix logic and log statement
All checks were successful
tests / go test (push) Successful in 8s
tests / golangci-lint (push) Successful in 16s

This commit is contained in:
Jared Allard 2025-03-06 21:41:19 -08:00
parent c86cc3da61
commit 404acf6b7f
Signed by: jaredallard
SSH key fingerprint: SHA256:wyRyyv28jBYw8Yp/oABNPUYvbGd6hyZj23XVXEm5G/U
2 changed files with 2 additions and 2 deletions

View file

@ -96,7 +96,7 @@ func newGetKeyCommand() *cobra.Command {
return fmt.Errorf("failed to create private key for decryption: %w", err)
}
fmt.Printf("Sending GetKeyRequest: machine_id=%s\n", machineID)
fmt.Printf("Sending GetKey request: machine_id=%s\n", machineID)
kc, kcclose, err := client.Dial(hostname)
if err != nil {

View file

@ -117,7 +117,7 @@ func (s *Server) GetKey(ctx context.Context, req *pbgrpcv1.GetKeyRequest) (*pbgr
return nil, fmt.Errorf("failed to parsed signed at %q: %w", req.GetSignedAt(), err)
}
ts = ts.UTC() // Always operate with UTC time.
if time.Since(ts) < 5*time.Minute {
if time.Since(ts) > 5*time.Minute {
return nil, fmt.Errorf("signature has expired")
}