Skip to content

Commit

Permalink
Bugfix for short IDs that match on two lines
Browse files Browse the repository at this point in the history
Fix for cases where grep also finds the line starting with sec.
The second line has  the full PGP fingerprint alone.
Therefore, it always ends with the shortened fingerprint.
  • Loading branch information
oh2fih committed Feb 11, 2025
1 parent d1b71a9 commit a5f6b57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion securitytxt-signer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ else

# Replace PGP IDs with the full PGP fingerprint.
GREPABLE_KEY=${KEY//0x/}
FP=$(echo "$KEY_INFO" | grep -i "$GREPABLE_KEY" | sed -e 's/[^A-F0-9]//g')
FP=$(echo "$KEY_INFO" | grep -i "${GREPABLE_KEY}\$" | sed -e 's/[^A-F0-9]//g')
KEY="0x${FP}"
if ! [[ "${KEY}" = "0x${GREPABLE_KEY^^}" ]]; then
echo -e "\033[0;33mEXPANDED 0x${GREPABLE_KEY^^} TO ${KEY}\033[0;0m"
Expand Down

0 comments on commit a5f6b57

Please sign in to comment.