From bc968d5f7e2f73f3d246597964ba2b2700940403 Mon Sep 17 00:00:00 2001 From: Matt Bacchi Date: Fri, 25 Jan 2019 08:43:09 -0700 Subject: [PATCH] Only accept the full GPG key ID when signing linux packages Fixes: https://github.com/brave/brave-browser/issues/3107 --- script/upload_to_aptly | 6 ++++++ script/upload_to_rpm_repo | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/script/upload_to_aptly b/script/upload_to_aptly index 780a8d23ccc..a5ed02959d6 100755 --- a/script/upload_to_aptly +++ b/script/upload_to_aptly @@ -16,6 +16,12 @@ set -exu ### The first argument is the S3 bucket, the second is the GPG key fingerprint OPTION=${1:-brave-browser-apt-staging-nightly} GPG_KEY_ID=${2:-E85FFA8E2E90B40B33ED39274FE13824E3FFC656} # Defaults to New Brave Software signing key + +if [[ $2 == 0x* ]]; then + echo "Error: Please pass the Full GPG KEY ID to sign with! (i.e. '9228DBCE20DDE5EC46488DE90B31DBA06A8A26F9')" + exit 1 +fi + if [ "$GPG_KEY_ID" = "E85FFA8E2E90B40B33ED39274FE13824E3FFC656" ]; then KEY_NAME=brave-core.asc else diff --git a/script/upload_to_rpm_repo b/script/upload_to_rpm_repo index e87952d947a..44e6bcb27b4 100755 --- a/script/upload_to_rpm_repo +++ b/script/upload_to_rpm_repo @@ -16,6 +16,12 @@ set -exu BUCKET=${1:-brave-browser-rpm-staging-nightly} GPG_KEY_ID=${2:-E85FFA8E2E90B40B33ED39274FE13824E3FFC656} # Defaults to New Brave Software signing key GPG_KEY_SHORT_ID=${GPG_KEY_ID:(-8)} + +if [[ $2 == 0x* ]]; then + echo "Error: Please pass the Full GPG KEY ID to sign with! (i.e. '9228DBCE20DDE5EC46488DE90B31DBA06A8A26F9')" + exit 1 +fi + if [ "$GPG_KEY_ID" = "E85FFA8E2E90B40B33ED39274FE13824E3FFC656" ]; then KEY_NAME=brave-core.asc else