296 lines
18 KiB
Bash
Executable file
296 lines
18 KiB
Bash
Executable file
#!/bin/sh
|
|
set -e
|
|
|
|
TESTDIR="$(readlink -f "$(dirname "$0")")"
|
|
. "$TESTDIR/framework"
|
|
|
|
setupenvironment
|
|
configarchitecture 'i386'
|
|
|
|
cat > faked-gpgv <<EOF
|
|
#!/bin/sh
|
|
set -e
|
|
find_gpgv_status_fd() {
|
|
while [ -n "\$1" ]; do
|
|
if [ "\$1" = '--status-fd' ]; then
|
|
shift
|
|
echo "\$1"
|
|
break
|
|
fi
|
|
shift
|
|
done
|
|
}
|
|
GPGSTATUSFD="\$(find_gpgv_status_fd "\$@")"
|
|
cat >&\${GPGSTATUSFD} gpgv.output
|
|
cat gpgv.output
|
|
EOF
|
|
chmod +x faked-gpgv
|
|
|
|
testgpgv() {
|
|
echo "$4" > gpgv.output
|
|
msgtest "$1" "$2"
|
|
gpgvmethod >method.output 2>&1 || true
|
|
testsuccess --nomsg grep "^ $2\$" method.output
|
|
msgtest 'The reported signedby key is' "${3:-empty}"
|
|
testsuccess --nomsg grep "^ Signed-By:\s\+$3\$" method.output
|
|
}
|
|
|
|
testrun() {
|
|
testgpgv 'Good signed with long keyid' 'Good: GOODSIG 5A90D141DBAC8DAE' '34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE!' '[GNUPG:] GOODSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>
|
|
[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2016-09-01 1472742625 0 4 0 1 11 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE'
|
|
testsuccess grep '^201 URI Done$' method.output
|
|
testgpgv 'Good signed with fingerprint' 'Good: GOODSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE' '34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE!' '[GNUPG:] GOODSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>
|
|
[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2016-09-01 1472742625 0 4 0 1 11 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE'
|
|
testsuccess grep '^201 URI Done$' method.output
|
|
|
|
testgpgv 'Good signed with long keyid and asserted' 'Good: GOODSIG 5A90D141DBAC8DAE' '34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE!' '[GNUPG:] GOODSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>
|
|
[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2016-09-01 1472742625 0 4 0 1 11 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE
|
|
[GNUPG:] ASSERT_PUBKEY_ALGO 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 1 rsa1024'
|
|
testsuccess grep '^201 URI Done$' method.output
|
|
testgpgv 'Good signed with fingerprint and asserted' 'Good: GOODSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE' '34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE!' '[GNUPG:] GOODSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>
|
|
[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2016-09-01 1472742625 0 4 0 1 11 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE
|
|
[GNUPG:] ASSERT_PUBKEY_ALGO 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 1 rsa1024'
|
|
testsuccess grep '^201 URI Done$' method.output
|
|
|
|
testgpgv 'Not asserted in the next level' 'SoonWorthless: 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE, ' '34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE!' '[GNUPG:] GOODSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>
|
|
[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2016-09-01 1472742625 0 4 0 1 11 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE
|
|
[GNUPG:] ASSERT_PUBKEY_ALGO 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 1 brainpoolP256r1'
|
|
testsuccess grep '^201 URI Done$' method.output
|
|
|
|
testgpgv 'Not asserted in the future level' 'LaterWorthless: 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE, ' '34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE!' '[GNUPG:] GOODSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>
|
|
[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2016-09-01 1472742625 0 4 0 1 11 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE
|
|
[GNUPG:] ASSERT_PUBKEY_ALGO 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 1 nistp256'
|
|
testsuccess grep '^201 URI Done$' method.output
|
|
|
|
testgpgv 'Good subkey signed with long keyid' 'Good: GOODSIG 5B6896415D44C43E' '34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE, 4281DEDBD466EAE8C1F4157E5B6896415D44C43E!' '[GNUPG:] GOODSIG 5B6896415D44C43E Sebastian Subkey <subkey@example.org>
|
|
[GNUPG:] VALIDSIG 4281DEDBD466EAE8C1F4157E5B6896415D44C43E 2018-08-16 1534459673 0 4 0 1 11 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE'
|
|
testsuccess grep '^201 URI Done$' method.output
|
|
testgpgv 'Good subkey signed with fingerprint' 'Good: GOODSIG 4281DEDBD466EAE8C1F4157E5B6896415D44C43E' '34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE, 4281DEDBD466EAE8C1F4157E5B6896415D44C43E!' '[GNUPG:] GOODSIG 4281DEDBD466EAE8C1F4157E5B6896415D44C43E Sebastian Subkey <subkey@example.org>
|
|
[GNUPG:] VALIDSIG 4281DEDBD466EAE8C1F4157E5B6896415D44C43E 2018-08-16 1534459673 0 4 0 1 11 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE'
|
|
testsuccess grep '^201 URI Done$' method.output
|
|
|
|
testgpgv 'Untrusted signed with long keyid' 'Worthless: 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE, ' '' '[GNUPG:] GOODSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>
|
|
[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2016-09-01 1472742625 0 4 0 1 1 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE'
|
|
testsuccess grep '^400 URI Failure$' method.output
|
|
testsuccess grep '^\s\+Good:\s\+$' method.output
|
|
testgpgv 'Untrusted signed with fingerprint' 'Worthless: 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE, ' '' '[GNUPG:] GOODSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>
|
|
[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2016-09-01 1472742625 0 4 0 1 1 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE'
|
|
testsuccess grep '^\s\+Good:\s\+$' method.output
|
|
testsuccess grep '^400 URI Failure$' method.output
|
|
|
|
testgpgv 'Unasserted signed with long keyid' 'Worthless: 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE, ' '' '[GNUPG:] GOODSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>
|
|
[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2016-09-01 1472742625 0 4 0 1 11 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE
|
|
[GNUPG:] ASSERT_PUBKEY_ALGO 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 0 rsa1024'
|
|
testsuccess grep '^\s\+Good:\s\+$' method.output
|
|
testsuccess grep '^400 URI Failure$' method.output
|
|
testgpgv 'Unaserted signed with fingerprint' 'Worthless: 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE, ' '' '[GNUPG:] GOODSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>
|
|
[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2016-09-01 1472742625 0 4 0 1 11 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE
|
|
[GNUPG:] ASSERT_PUBKEY_ALGO 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 0 rsa1024'
|
|
testsuccess grep '^\s\+Good:\s\+$' method.output
|
|
testsuccess grep '^400 URI Failure$' method.output
|
|
|
|
testgpgv 'Weak signed with long keyid' 'Good: GOODSIG 5A90D141DBAC8DAE' '34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE!' '[GNUPG:] GOODSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>
|
|
[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2016-09-01 1472742625 0 4 0 1 2 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE'
|
|
testsuccess grep '^Message: Signature by key 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE uses weak algorithm (SHA1)$' method.output
|
|
testsuccess grep '^201 URI Done$' method.output
|
|
testgpgv 'Weak signed with fingerprint' 'Good: GOODSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE' '34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE!' '[GNUPG:] GOODSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>
|
|
[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2016-09-01 1472742625 0 4 0 1 2 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE'
|
|
testsuccess grep '^Message: Signature by key 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE uses weak algorithm (SHA1)$' method.output
|
|
testsuccess grep '^201 URI Done$' method.output
|
|
|
|
testgpgv 'No Pubkey with long keyid' 'NoPubKey: NO_PUBKEY E8525D47528144E2' '' '[GNUPG:] ERRSIG E8525D47528144E2 1 11 00 1472744666 9
|
|
[GNUPG:] NO_PUBKEY E8525D47528144E2'
|
|
testsuccess grep '^\s\+Good:\s\+$' method.output
|
|
testsuccess grep '^400 URI Failure$' method.output
|
|
testsuccess grep 'Message: .*public key is not available' method.output
|
|
testgpgv 'No Pubkey with fingerprint' 'NoPubKey: NO_PUBKEY DE66AECA9151AFA1877EC31DE8525D47528144E2' '' '[GNUPG:] ERRSIG DE66AECA9151AFA1877EC31DE8525D47528144E2 1 11 00 1472744666 9
|
|
[GNUPG:] NO_PUBKEY DE66AECA9151AFA1877EC31DE8525D47528144E2'
|
|
testsuccess grep '^\s\+Good:\s\+$' method.output
|
|
testsuccess grep '^400 URI Failure$' method.output
|
|
testsuccess grep 'Message: .*public key is not available' method.output
|
|
|
|
testgpgv 'Expired key with long keyid' 'Worthless: EXPKEYSIG 4BC0A39C27CE74F9 Rex Expired <rex@example.org>, ' '' '[GNUPG:] EXPKEYSIG 4BC0A39C27CE74F9 Rex Expired <rex@example.org>
|
|
[GNUPG:] VALIDSIG 891CC50E605796A0C6E733F74BC0A39C27CE74F9 2016-09-01 1472742629 0 4 0 1 11 00 891CC50E605796A0C6E733F74BC0A39C27CE74F9'
|
|
testsuccess grep '^\s\+Good:\s\+$' method.output
|
|
testsuccess grep '^400 URI Failure$' method.output
|
|
testsuccess grep 'Message: The following signatures were invalid: EXPKEYSIG' method.output
|
|
testgpgv 'Expired key with fingerprint' 'Worthless: EXPKEYSIG 891CC50E605796A0C6E733F74BC0A39C27CE74F9 Rex Expired <rex@example.org>, ' '' '[GNUPG:] EXPKEYSIG 891CC50E605796A0C6E733F74BC0A39C27CE74F9 Rex Expired <rex@example.org>
|
|
[GNUPG:] VALIDSIG 891CC50E605796A0C6E733F74BC0A39C27CE74F9 2016-09-01 1472742629 0 4 0 1 11 00 891CC50E605796A0C6E733F74BC0A39C27CE74F9'
|
|
testsuccess grep '^\s\+Good:\s\+$' method.output
|
|
testsuccess grep '^400 URI Failure$' method.output
|
|
testsuccess grep 'Message: The following signatures were invalid: EXPKEYSIG' method.output
|
|
|
|
testgpgv 'Expired signature (gpgv-g10code)' 'Worthless: EXPSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>, ' '' '[GNUPG:] NEWSIG joe@example.org
|
|
[GNUPG:] KEY_CONSIDERED 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 0
|
|
[GNUPG:] SIG_ID pwbegSQxpqXn4lSZ1N4DLwyM4rc 2016-09-24 1474732092
|
|
[GNUPG:] KEY_CONSIDERED 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 0
|
|
[GNUPG:] EXPSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>
|
|
[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2016-09-24 1474732092 1491040800 4 0 1 11 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE'
|
|
testsuccess grep '^\s\+Good:\s\+$' method.output
|
|
testsuccess grep '^400 URI Failure$' method.output
|
|
testsuccess grep 'Message: The following signatures were invalid: EXPSIG' method.output
|
|
|
|
testgpgv 'Expired signature (gpgv-sq)' 'Bad: BADSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>' '' '[GNUPG:] NEWSIG joe@example.org
|
|
[GNUPG:] KEY_CONSIDERED 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 0
|
|
[GNUPG:] KEYEXPIRED 1491040800
|
|
[GNUPG:] BADSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>
|
|
'
|
|
testsuccess grep '^\s\+Good:\s\+$' method.output
|
|
testsuccess grep '^400 URI Failure$' method.output
|
|
testsuccess grep 'Message: The following signatures were invalid: BADSIG' method.output
|
|
|
|
testgpgv 'GPG-untrusted digest (MD5)' 'Worthless: ERRSIG 5A90D141DBAC8DAE, ' '' '[GNUPG:] NEWSIG joe@example.org
|
|
[GNUPG:] KEY_CONSIDERED 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 0
|
|
[GNUPG:] ERRSIG 5A90D141DBAC8DAE 1 1 00 1734647007 5 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE'
|
|
testsuccess grep '^\s\+Good:\s\+$' method.output
|
|
testsuccess grep '^400 URI Failure$' method.output
|
|
testsuccess grep 'Message: The following signatures were invalid: ERRSIG' method.output
|
|
}
|
|
|
|
echo 'Test' > message.data
|
|
cat >message.sig <<EOF
|
|
-----BEGIN PGP SIGNATURE-----
|
|
|
|
iQFEBAEBCgAuFiEENKjp0Y2zIPNn6OqgWpDRQdusja4FAlhT7+kQHGpvZUBleGFt
|
|
cGxlLm9yZwAKCRBakNFB26yNrjvEB/9/e3jA1l0fvPafx9LEXcH8CLpUFQK7ra9l
|
|
3M4YAH4JKQlTG1be7ixruBRlCTh3YiSs66fKMeJeUYoxA2HPhvbGFEjQFAxunEYg
|
|
X/LBKv1mQWa+Q34P5GBjK8kQdLCN+yJAiUErmWNQG3GPninrxsC9tY5jcWvHeP1k
|
|
V7N3MLnNqzXaCJM24mnKidC5IDadUdQ8qC8c3rjUexQ8vBz0eucH56jbqV5oOcvx
|
|
pjlW965dCPIf3OI8q6J7bIOjyY+u/PTcVlqPq3TUz/ti6RkVbKpLH0D4ll3lUTns
|
|
JQt/+gJCPxHUJphy8sccBKhW29CLELJIIafvU30E1nWn9szh2Xjq
|
|
=TB1F
|
|
-----END PGP SIGNATURE-----
|
|
EOF
|
|
|
|
|
|
gpgvmethod() {
|
|
echo "601 Configuration
|
|
Config-Item: Debug::Acquire::gpgv=1
|
|
Config-Item: APT::Key::GPGVCommand=$PWD/faked-gpgv
|
|
Config-Item: APT::Hashes::SHA1::Weak=true
|
|
Config-Item: APT::Key::Assert-Pubkey-Algo=>=rsa2048,nistp256,brainpoolP256r1
|
|
Config-Item: APT::Key::Assert-Pubkey-Algo::Next=>=rsa2048,nistp256
|
|
Config-Item: APT::Key::Assert-Pubkey-Algo::Future=>=rsa2048
|
|
|
|
600 URI Acquire
|
|
URI: file://${TMPWORKINGDIRECTORY}/message.sig
|
|
Filename: ${TMPWORKINGDIRECTORY}/message.data
|
|
" | runapt "${METHODSDIR}/gpgv"
|
|
}
|
|
testrun
|
|
|
|
gpgvmethod() {
|
|
echo "601 Configuration
|
|
Config-Item: Debug::Acquire::gpgv=1
|
|
Config-Item: APT::Key::GPGVCommand=$PWD/faked-gpgv
|
|
Config-Item: APT::Hashes::SHA1::Weak=true
|
|
Config-Item: APT::Key::Assert-Pubkey-Algo=>=rsa2048,nistp256,brainpoolP256r1
|
|
Config-Item: APT::Key::Assert-Pubkey-Algo::Next=>=rsa2048,nistp256
|
|
Config-Item: APT::Key::Assert-Pubkey-Algo::Future=>=rsa2048
|
|
|
|
600 URI Acquire
|
|
URI: file://${TMPWORKINGDIRECTORY}/message.sig
|
|
Filename: ${TMPWORKINGDIRECTORY}/message.data
|
|
Signed-By: /dev/null,34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE
|
|
" | runapt "${METHODSDIR}/gpgv"
|
|
}
|
|
testrun
|
|
|
|
gpgvmethod() {
|
|
echo "601 Configuration
|
|
Config-Item: Debug::Acquire::gpgv=1
|
|
Config-Item: APT::Key::GPGVCommand=$PWD/faked-gpgv
|
|
Config-Item: APT::Hashes::SHA1::Weak=true
|
|
Config-Item: APT::Key::Assert-Pubkey-Algo=>=rsa2048,nistp256,brainpoolP256r1
|
|
Config-Item: APT::Key::Assert-Pubkey-Algo::Next=>=rsa2048,nistp256
|
|
Config-Item: APT::Key::Assert-Pubkey-Algo::Future=>=rsa2048
|
|
|
|
600 URI Acquire
|
|
URI: file://${TMPWORKINGDIRECTORY}/message.sig
|
|
Filename: ${TMPWORKINGDIRECTORY}/message.data
|
|
Signed-By: 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE,/dev/null
|
|
" | runapt "${METHODSDIR}/gpgv"
|
|
}
|
|
testrun
|
|
|
|
testgpgv 'Good signed with long keyid but not signed-by key' 'NoPubKey: GOODSIG 4BC0A39C27CE74F9' '' '[GNUPG:] GOODSIG 4BC0A39C27CE74F9 Rex Expired <rex@example.org>
|
|
[GNUPG:] VALIDSIG 891CC50E605796A0C6E733F74BC0A39C27CE74F9 2016-09-01 1472742625 0 4 0 1 11 00 891CC50E605796A0C6E733F74BC0A39C27CE74F9'
|
|
testsuccess grep '^\s\+Good:\s\+$' method.output
|
|
testsuccess grep 'verified because the public key is not available: GOODSIG' method.output
|
|
testgpgv 'Good signed with fingerprint but not signed-by key' 'NoPubKey: GOODSIG 891CC50E605796A0C6E733F74BC0A39C27CE74F9' '' '[GNUPG:] GOODSIG 891CC50E605796A0C6E733F74BC0A39C27CE74F9 Rex Expired <rex@example.org>
|
|
[GNUPG:] VALIDSIG 891CC50E605796A0C6E733F74BC0A39C27CE74F9 2016-09-01 1472742625 0 4 0 1 11 00 891CC50E605796A0C6E733F74BC0A39C27CE74F9'
|
|
testsuccess grep '^\s\+Good:\s\+$' method.output
|
|
testsuccess grep 'verified because the public key is not available: GOODSIG' method.output
|
|
|
|
gpgvmethod() {
|
|
echo "601 Configuration
|
|
Config-Item: Debug::Acquire::gpgv=1
|
|
Config-Item: APT::Key::GPGVCommand=$PWD/faked-gpgv
|
|
Config-Item: APT::Hashes::SHA1::Weak=true
|
|
Config-Item: APT::Key::Assert-Pubkey-Algo=>=rsa2048,nistp256,brainpoolP256r1
|
|
Config-Item: APT::Key::Assert-Pubkey-Algo::Next=>=rsa2048,nistp256
|
|
Config-Item: APT::Key::Assert-Pubkey-Algo::Future=>=rsa2048
|
|
|
|
600 URI Acquire
|
|
URI: file://${TMPWORKINGDIRECTORY}/message.sig
|
|
Filename: ${TMPWORKINGDIRECTORY}/message.data
|
|
Signed-By: 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE!
|
|
" | runapt "${METHODSDIR}/gpgv"
|
|
}
|
|
testgpgv 'Exact matched subkey signed with long keyid' 'Good: GOODSIG 5A90D141DBAC8DAE' '34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE!' '[GNUPG:] GOODSIG 5A90D141DBAC8DAE Sebastian Subkey <subkey@example.org>
|
|
[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2018-08-16 1534459673 0 4 0 1 11 00 4281DEDBD466EAE8C1F4157E5B6896415D44C43E'
|
|
testgpgv 'Exact matched subkey signed with fingerprint' 'Good: GOODSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE' '34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE!' '[GNUPG:] GOODSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE Sebastian Subkey <subkey@example.org>
|
|
[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2018-08-16 1534459673 0 4 0 1 11 00 4281DEDBD466EAE8C1F4157E5B6896415D44C43E'
|
|
|
|
testgpgv 'Exact unmatched subkey signed with long keyid' 'NoPubKey: GOODSIG 5B6896415D44C43E' '' '[GNUPG:] GOODSIG 5B6896415D44C43E Sebastian Subkey <subkey@example.org>
|
|
[GNUPG:] VALIDSIG 4281DEDBD466EAE8C1F4157E5B6896415D44C43E 2018-08-16 1534459673 0 4 0 1 11 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE'
|
|
testsuccess grep '^\s\+Good:\s\+$' method.output
|
|
testsuccess grep 'verified because the public key is not available: GOODSIG' method.output
|
|
testgpgv 'Exact unmatched subkey signed with fingerprint' 'NoPubKey: GOODSIG 4281DEDBD466EAE8C1F4157E5B6896415D44C43E' '' '[GNUPG:] GOODSIG 4281DEDBD466EAE8C1F4157E5B6896415D44C43E Sebastian Subkey <subkey@example.org>
|
|
[GNUPG:] VALIDSIG 4281DEDBD466EAE8C1F4157E5B6896415D44C43E 2018-08-16 1534459673 0 4 0 1 11 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE'
|
|
testsuccess grep '^\s\+Good:\s\+$' method.output
|
|
testsuccess grep 'verified because the public key is not available: GOODSIG' method.output
|
|
|
|
insertpackage 'unstable' 'foo' 'all' '1'
|
|
setupaptarchive --no-update
|
|
|
|
echo '[GNUPG:] GOODSIG 5A90D141DBAC8DAE Sebastian Subkey <subkey@example.org>
|
|
[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2018-08-16 1534459673 0 4 0 1 11 00 4281DEDBD466EAE8C1F4157E5B6896415D44C43E' > gpgv.output
|
|
testsuccess apt update -o APT::Key::GPGVCommand="$PWD/faked-gpgv" -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::gpgv=1
|
|
rm -rf rootdir/var/lib/apt/lists
|
|
|
|
echo '[GNUPG:] GOODSIG 5A90D141DBAC8DAE Sebastian Subkey <subkey@example.org>' > gpgv.output
|
|
testfailure apt update -o APT::Key::GPGVCommand="$PWD/faked-gpgv" -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::gpgv=1
|
|
rm -rf rootdir/var/lib/apt/lists
|
|
|
|
echo '[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2018-08-16 1534459673 0 4 0 1 11 00 4281DEDBD466EAE8C1F4157E5B6896415D44C43E' > gpgv.output
|
|
testfailure apt update -o APT::Key::GPGVCommand="$PWD/faked-gpgv" -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::gpgv=1
|
|
rm -rf rootdir/var/lib/apt/lists
|
|
|
|
echo '[GNUPG:] GOODSIG 5A90D141DBAC8DAE Sebastian Subkey <subkey@example.org>
|
|
[GNUPG:] VALIDSIG 0000000000000000000000000000000000000000 2018-08-16 1534459673 0 4 0 1 11 00 4281DEDBD466EAE8C1F4157E5B6896415D44C43E' > gpgv.output
|
|
testfailure apt update -o APT::Key::GPGVCommand="$PWD/faked-gpgv" -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::gpgv=1
|
|
rm -rf rootdir/var/lib/apt/lists
|
|
|
|
gpgvmethod() {
|
|
echo "601 Configuration
|
|
Config-Item: Debug::Acquire::gpgv=1
|
|
Config-Item: APT::Key::GPGVCommand=$PWD/faked-gpgv
|
|
Config-Item: APT::Hashes::SHA1::Weak=true
|
|
Config-Item: APT::Key::Assert-Pubkey-Algo::Next=>=invalid
|
|
|
|
600 URI Acquire
|
|
URI: file://${TMPWORKINGDIRECTORY}/message.sig
|
|
Filename: ${TMPWORKINGDIRECTORY}/message.data
|
|
Signed-By: 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE!
|
|
" | runapt "${METHODSDIR}/gpgv"
|
|
}
|
|
|
|
|
|
echo '[GNUPG:] GOODSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>
|
|
[GNUPG:] VALIDSIG 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 2016-09-01 1472742625 0 4 0 1 11 00 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE
|
|
[GNUPG:] ASSERT_PUBKEY_ALGO 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE 1 brainpoolP256r1' > gpgv.output
|
|
|
|
msgtest "Warns about invalid specification" ">=invalid"
|
|
gpgvmethod >method.output 2>&1 || true
|
|
testsuccess --nomsg grep "Message: Unrecognized public key specification '>=invalid' in option APT::Key::Assert-Pubkey-Algo::Next" method.output
|