Skip to content

Commit

Permalink
fix: ensure error is thrown when pubkey is not found in load_pubkey_c…
Browse files Browse the repository at this point in the history
…ompat
  • Loading branch information
matteo-cristino authored and jaromil committed Jan 20, 2025
1 parent 072a33b commit 99e86eb
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/lua/zencode_keyring.lua
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,13 @@ function load_pubkey_compat(_key, algo)
local pubkey = ACK[_key]
if pubkey then return pubkey end
pubkey = ACK[algo..'_public_key']
if luatype(pubkey) == 'table' then
pubkey = pubkey[_key]
end
if not pubkey then
error('Public key not found for: ' .. _key, 2)
end
if luatype(pubkey) == 'table' then
return pubkey[_key]
else
return pubkey
end
return pubkey
end

function havekey(ktype)
Expand Down

0 comments on commit 99e86eb

Please sign in to comment.