summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-10-11 21:04:42 -0400
committerUnknwon <joe2010xtmf@163.com>2014-10-11 21:04:42 -0400
commit452ccff81ca736a07bec44a059a0562a08656bf4 (patch)
tree15487dbe076319793515a34586991753a2ef34cd /models
parentfb839ca0fb998f2dfdd280e959f85a576bb7742b (diff)
downloadgitea-452ccff81ca736a07bec44a059a0562a08656bf4.tar.gz
gitea-452ccff81ca736a07bec44a059a0562a08656bf4.zip
Mirror fix on add ssh key
Diffstat (limited to 'models')
-rw-r--r--models/publickey.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/models/publickey.go b/models/publickey.go
index aac5a81aeb..762d7333fa 100644
--- a/models/publickey.go
+++ b/models/publickey.go
@@ -33,6 +33,7 @@ const (
var (
ErrKeyAlreadyExist = errors.New("Public key already exist")
ErrKeyNotExist = errors.New("Public key does not exist")
+ ErrKeyUnableVerify = errors.New("Unable to verify public key")
)
var sshOpLocker = sync.Mutex{}
@@ -134,9 +135,10 @@ func CheckPublicKeyString(content string) (bool, error) {
return true, nil
}
+ fmt.Println(stdout)
sshKeygenOutput := strings.Split(stdout, " ")
if len(sshKeygenOutput) < 4 {
- return false, fmt.Errorf("not enough fields returned by ssh-keygen -l -f: %v", sshKeygenOutput)
+ return false, ErrKeyUnableVerify
}
// Check if key type and key size match.