summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-03-28 17:24:55 +0000
committerGitHub <noreply@github.com>2020-03-28 19:24:55 +0200
commitea67e563dd9fc20e508d41079ea00312b880ac82 (patch)
tree0e66a5157866ae99f84995f7478fc6c05d2dd26d /routers
parentf9f2c163b12f60a6bf9c3652cdc4bdf59e3d53c4 (diff)
downloadgitea-ea67e563dd9fc20e508d41079ea00312b880ac82.tar.gz
gitea-ea67e563dd9fc20e508d41079ea00312b880ac82.zip
Use ErrKeyUnableToVerify if fail to calc fingerprint in ssh-keygen (#10863)
* Use ErrKeyUnableToVerify if fail to calc fingerprint in ssh-keygen Fix #3985 Signed-off-by: Andrew Thornton <art27@cantab.net> * Pass up the unable to verify
Diffstat (limited to 'routers')
-rw-r--r--routers/user/setting/keys.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/routers/user/setting/keys.go b/routers/user/setting/keys.go
index 3475299437..73ae73da40 100644
--- a/routers/user/setting/keys.go
+++ b/routers/user/setting/keys.go
@@ -92,6 +92,9 @@ func KeysPost(ctx *context.Context, form auth.AddKeyForm) {
ctx.Data["Err_Title"] = true
ctx.RenderWithErr(ctx.Tr("settings.ssh_key_name_used"), tplSettingsKeys, &form)
+ case models.IsErrKeyUnableVerify(err):
+ ctx.Flash.Info(ctx.Tr("form.unable_verify_ssh_key"))
+ ctx.Redirect(setting.AppSubURL + "/user/settings/keys")
default:
ctx.ServerError("AddPublicKey", err)
}