From e581efe238d1f735787b5dbdfcce9a1d73384ef3 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sun, 31 Mar 2024 14:48:33 +0800 Subject: 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 --- models/asymkey/gpg_key_verify.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'models') 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{ -- cgit v1.2.3