diff options
author | Giteabot <teabot@gitea.io> | 2024-03-31 14:48:33 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-31 06:48:33 +0000 |
commit | e581efe238d1f735787b5dbdfcce9a1d73384ef3 (patch) | |
tree | 9508a60e111894d224eb9ebf3cc231baa6bf4b97 | |
parent | cd117863f32f0e5fd69db9805ff06df2d22234ad (diff) | |
download | gitea-e581efe238d1f735787b5dbdfcce9a1d73384ef3.tar.gz gitea-e581efe238d1f735787b5dbdfcce9a1d73384ef3.zip |
Fix GPG subkey verify (#30193) (#30203)
Backport #30193 by @KN4CK3R
Fixes #30189
Can't verify subkeys if they are not loaded.
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
-rw-r--r-- | models/asymkey/gpg_key_verify.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/models/asymkey/gpg_key_verify.go b/models/asymkey/gpg_key_verify.go index 4cf46ab556..01812a2d54 100644 --- a/models/asymkey/gpg_key_verify.go +++ b/models/asymkey/gpg_key_verify.go @@ -46,6 +46,10 @@ func VerifyGPGKey(ctx context.Context, ownerID int64, keyID, token, signature st return "", ErrGPGKeyNotExist{} } + if err := key.LoadSubKeys(ctx); err != nil { + return "", err + } + sig, err := extractSignature(signature) if err != nil { return "", ErrGPGInvalidTokenSignature{ |