@@ -12,7 +12,7 @@ import (
12
12
"net/http"
13
13
"strings"
14
14
15
- "code.gitea.io/gitea/models"
15
+ asymkey_model "code.gitea.io/gitea/models/asymkey "
16
16
user_model "code.gitea.io/gitea/models/user"
17
17
"code.gitea.io/gitea/modules/log"
18
18
"code.gitea.io/gitea/modules/setting"
@@ -79,8 +79,8 @@ func (h *HTTPSign) Verify(req *http.Request, w http.ResponseWriter, store DataSt
79
79
// VerifyCert verifies the validity of the ssh certificate and returns the publickey of the signer
80
80
// We verify that the certificate is signed with the correct CA
81
81
// We verify that the http request is signed with the private key (of the public key mentioned in the certificate)
82
- func VerifyCert (r * http.Request ) (* models .PublicKey , error ) {
83
- var validpk * models .PublicKey
82
+ func VerifyCert (r * http.Request ) (* asymkey_model .PublicKey , error ) {
83
+ var validpk * asymkey_model .PublicKey
84
84
85
85
// Get our certificate from the header
86
86
bcert , err := base64 .RawStdEncoding .DecodeString (r .Header .Get ("x-ssh-certificate" ))
@@ -101,13 +101,13 @@ func VerifyCert(r *http.Request) (*models.PublicKey, error) {
101
101
cert := pk .(* ssh.Certificate )
102
102
103
103
for _ , principal := range cert .ValidPrincipals {
104
- validpk , err = models .SearchPublicKeyByContentExact (principal )
104
+ validpk , err = asymkey_model .SearchPublicKeyByContentExact (principal )
105
105
if err != nil {
106
106
log .Error ("SearchPublicKeyByContentExact: %v" , err )
107
107
return validpk , err
108
108
}
109
109
110
- if models .IsErrKeyNotExist (err ) {
110
+ if asymkey_model .IsErrKeyNotExist (err ) {
111
111
continue
112
112
}
113
113
0 commit comments