File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1414 "description" : " Whether to check the integrity of the downloaded file" ,
1515 "default" : true
1616 },
17- "key_id" : {
18- "type" : " String" ,
19- "description" : " The GPG key ID to use when verifying the download" ,
20- "default" : " 4528B6CD9E61EF26"
21- },
2217 "key_server" : {
2318 "type" : " String" ,
24- "description" : " The GPG keyserver to retrieve the GPG key from" ,
19+ "description" : " The GPG keyserver to retrieve GPG keys from" ,
2520 "default" : " hkp://keyserver.ubuntu.com:11371"
2621 }
2722 },
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ EX_UNAVAILABLE=69
88verify-file () {
99 local sig=" $1 "
1010 local doc=" $2 "
11+ local keyid
1112
1213 # The GPG binary is required to be present in order to perform file download
1314 # verification. If it is not present, return EX_UNAVAILABLE.
@@ -19,8 +20,12 @@ verify-file() {
1920 # The verification key must be present, or it must be possible to download it
2021 # from the keyserver to perform file verification. If it is not present,
2122 # return EX_UNAVAILABLE.
22- if ! { gpg --list-keys " $PT_key_id " || gpg --keyserver " $PT_key_server " --recv-key " $PT_key_id " ; } then
23- echo " Unable to download verification key ${PT_key_id} "
23+ keyid=$( gpg --list-packets --with-colons " $sig " | awk ' /:signature packet:/{print $NF; exit 0}' )
24+ if [[ -z " $keyid " ]]; then
25+ echo " Unable to determine verification key from ${sig} "
26+ return " $EX_UNAVAILABLE "
27+ elif ! { gpg --list-keys " $keyid " || gpg --keyserver " $PT_key_server " --recv-key " $keyid " ; } then
28+ echo " Unable to download verification key ${keyid} "
2429 return " $EX_UNAVAILABLE "
2530 fi
2631
You can’t perform that action at this time.
0 commit comments