@@ -31,12 +31,12 @@ func getPublicKeyFromResponse(ctx context.Context, b []byte, keyID *url.URL) (p
31
31
err = fmt .Errorf ("ActivityStreams type cannot be converted to one known to have publicKey property: %v" , err )
32
32
return
33
33
}
34
- pkey := person .PublicKey
35
- if pkey .ID .String () != keyID .String () {
34
+ pubKey := person .PublicKey
35
+ if pubKey .ID .String () != keyID .String () {
36
36
err = fmt .Errorf ("cannot find publicKey with id: %s in %s" , keyID , b )
37
37
return
38
38
}
39
- pubKeyPem := pkey .PublicKeyPem
39
+ pubKeyPem := pubKey .PublicKeyPem
40
40
block , _ := pem .Decode ([]byte (pubKeyPem ))
41
41
if block == nil || block .Type != "PUBLIC KEY" {
42
42
err = fmt .Errorf ("could not decode publicKeyPem to PUBLIC KEY pem block type" )
@@ -83,13 +83,13 @@ func verifyHTTPSignatures(ctx *gitea_context.APIContext) (authenticated bool, er
83
83
if err != nil {
84
84
return
85
85
}
86
- pKey , err := getPublicKeyFromResponse (* ctx , b , idIRI )
86
+ pubKey , err := getPublicKeyFromResponse (* ctx , b , idIRI )
87
87
if err != nil {
88
88
return
89
89
}
90
90
// 3. Verify the other actor's key
91
91
algo := httpsig .Algorithm (setting .Federation .Algorithms [0 ])
92
- authenticated = v .Verify (pKey , algo ) == nil
92
+ authenticated = v .Verify (pubKey , algo ) == nil
93
93
return
94
94
}
95
95
0 commit comments