Skip to content

Commit 818f0fc

Browse files
committed
Explicitly gpg verify the expected signed
1 parent 9ea2e78 commit 818f0fc

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

image/Dockerfile-base

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ RUN <<EOF
4444
echo "C874011F0AB405110D02105534365D9472D7468F:6:" | gpg --import-ownertrust
4545

4646
curl https://get.opentofu.org/opentofu.gpg | gpg --import
47+
gpg --fingerprint E3E6E43D84CB852EADB0051D0C0AF313E5FD9F80
4748
echo "E3E6E43D84CB852EADB0051D0C0AF313E5FD9F80:6:" | gpg --import-ownertrust
4849

4950
gpg --check-trustdb

image/src/opentofu/download.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def get_checksums(version: Version, checksum_dir: Path) -> Path:
6565
if signature_path.exists():
6666
try:
6767
subprocess.run(
68-
['gpg', '--verify', signature_path, checksums_path],
68+
['gpg', '--assert-signer', 'E3E6E43D84CB852EADB0051D0C0AF313E5FD9F80', '--verify', signature_path, checksums_path],
6969
check=True,
7070
env={'GNUPGHOME': '/root/.gnupg'} | os.environ
7171
)

image/src/terraform/download.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def get_checksums(version: Version, checksum_dir: Path) -> Path:
9898

9999
try:
100100
subprocess.run(
101-
['gpg', '--verify', signature_path, checksums_path],
101+
['gpg', '--assert-signer', 'C874011F0AB405110D02105534365D9472D7468F', '--verify', signature_path, checksums_path],
102102
check=True,
103103
env={'GNUPGHOME': '/root/.gnupg'} | os.environ
104104
)

0 commit comments

Comments
 (0)