mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-27 02:10:40 +00:00
Merge pull request '[GITEA] Restrict certificate type for builtin SSH server' (#1172) from Gusted/forgejo:forgejo-cert-user into forgejo-dependency
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1172
This commit is contained in:
commit
c929bfd22c
1 changed files with 6 additions and 0 deletions
|
@ -186,6 +186,12 @@ func publicKeyHandler(ctx ssh.Context, key ssh.PublicKey) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
if cert.CertType != gossh.UserCert {
|
||||
log.Warn("Certificate Rejected: Not a user certificate")
|
||||
log.Warn("Failed authentication attempt from %s", ctx.RemoteAddr())
|
||||
return false
|
||||
}
|
||||
|
||||
// look for the exact principal
|
||||
principalLoop:
|
||||
for _, principal := range cert.ValidPrincipals {
|
||||
|
|
Loading…
Reference in a new issue