mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-09 11:55:21 +02: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
|
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
|
// look for the exact principal
|
||||||
principalLoop:
|
principalLoop:
|
||||||
for _, principal := range cert.ValidPrincipals {
|
for _, principal := range cert.ValidPrincipals {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue