Backport #37256 by wxiaoguang 1. Make sure OmitEmail won't panic 2. SSH principal keys are not for signing or authentication Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -655,6 +655,9 @@ func ShowSSHKeys(ctx *context.Context) {
|
||||
// "authorized_keys" file format: "#" followed by comment line per key
|
||||
buf.WriteString("# Gitea isn't a key server. The keys are exported as the user uploaded and might not have been fully verified.\n")
|
||||
for i := range keys {
|
||||
if keys[i].Type == asymkey_model.KeyTypePrincipal {
|
||||
continue // SSH principal keys are not for signing or authentication
|
||||
}
|
||||
buf.WriteString(keys[i].OmitEmail())
|
||||
buf.WriteString("\n")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user