diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2024-11-21 20:01:57 +0100 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2024-11-22 16:44:02 +0100 |
| commit | d2e34a441bad904798bf62fb850d4fb5b1b90656 (patch) | |
| tree | 0ea3ba13255685b3de653ac3e6db570220f0589e /test/integration | |
| parent | 222301d7a36a09db80a8832cd16db41f7946a9ea (diff) | |
test-releasefile-verification: Test empty/invalid signatures
Diffstat (limited to 'test/integration')
| -rwxr-xr-x | test/integration/test-releasefile-verification | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/integration/test-releasefile-verification b/test/integration/test-releasefile-verification index 6b1f7d364..fcd5d987c 100755 --- a/test/integration/test-releasefile-verification +++ b/test/integration/test-releasefile-verification @@ -420,6 +420,28 @@ runtest2() { " aptcache show apt failaptnew + msgmsg 'Cold archive signed by' 'Empty signature' + rm -rf rootdir/var/lib/apt/lists + find aptarchive -name Release -exec touch {}.gpg \; + testfailuremsg "E: GPG error: http://localhost:${APTHTTPPORT} Release: Signed file isn't valid, got 'NODATA' (does the network require authentication?)" aptget update -o Debug::gpgv=1 + + msgmsg 'Cold archive signed by' 'Unknown format signature' + rm -rf rootdir/var/lib/apt/lists + find aptarchive -name Release -exec sh -c "echo Hello > {}.gpg" \; + testfailuremsg "E: GPG error: http://localhost:${APTHTTPPORT} Release: Signed file isn't valid, got 'NODATA' (does the network require authentication?)" aptget update + + msgmsg 'Cold archive signed by' 'Empty inline' + rm -rf rootdir/var/lib/apt/lists + find aptarchive -name Release -exec sh -c '( echo -----BEGIN PGP SIGNED MESSAGE-----; echo Hash: SHA512; echo; cat {} ; echo; echo -----BEGIN PGP SIGNATURE-----; echo ; echo -----END PGP SIGNATURE----- ) > $(dirname {})/In$(basename {})' \; + testfailuremsg "E: GPG error: http://localhost:${APTHTTPPORT} InRelease: Signed file isn't valid, got 'NODATA' (does the network require authentication?)" aptget update + + msgmsg 'Cold archive signed by' 'Bad inline' + rm -rf rootdir/var/lib/apt/lists + find aptarchive -name Release -exec sh -c '( echo -----BEGIN PGP SIGNED MESSAGE-----; echo Hash: SHA512; echo; cat {} ; echo; echo -----BEGIN PGP SIGNATURE-----; echo ; echo SGVsbG8K; echo =nFa9; echo -----END PGP SIGNATURE----- ) > $(dirname {})/In$(basename {})' \; + testfailuremsg "E: GPG error: http://localhost:${APTHTTPPORT} InRelease: Signed file isn't valid, got 'NODATA' (does the network require authentication?)" aptget update + + find aptarchive/ \( -name InRelease -o -name Release.gpg \) -delete + # Unsigned archive from the beginning must also be detected. msgmsg 'Cold archive signed by' 'nobody' rm -rf rootdir/var/lib/apt/lists |
