Skip to content

Commit b3fcfed

Browse files
authoredAug 5, 2024
Merge pull request smallstep#1951 from smallstep/herman/clarify-ssh-policy-errors
2 parents 1b2d999 + 42bea94 commit b3fcfed

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎authority/policy/engine.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (e *Engine) IsSSHCertificateAllowed(cert *ssh.Certificate) error {
9191
// when no host policy engine is configured, but a user policy engine is
9292
// configured, the host certificate is denied.
9393
if e.sshHostPolicy == nil && e.sshUserPolicy != nil {
94-
return errors.New("authority not allowed to sign ssh host certificates")
94+
return errors.New("authority not allowed to sign SSH host certificates when SSH user certificate policy is active")
9595
}
9696

9797
// return result of SSH host policy evaluation
@@ -100,12 +100,12 @@ func (e *Engine) IsSSHCertificateAllowed(cert *ssh.Certificate) error {
100100
// when no user policy engine is configured, but a host policy engine is
101101
// configured, the user certificate is denied.
102102
if e.sshUserPolicy == nil && e.sshHostPolicy != nil {
103-
return errors.New("authority not allowed to sign ssh user certificates")
103+
return errors.New("authority not allowed to sign SSH user certificates when SSH host certificate policy is active")
104104
}
105105

106106
// return result of SSH user policy evaluation
107107
return e.sshUserPolicy.IsSSHCertificateAllowed(cert)
108108
default:
109-
return fmt.Errorf("unexpected ssh certificate type %q", cert.CertType)
109+
return fmt.Errorf("unexpected SSH certificate type %q", cert.CertType)
110110
}
111111
}

0 commit comments

Comments
 (0)
Please sign in to comment.