#! /bin/sh

# $NetBSD: t_netpgpverify.sh,v 1.4 2016/08/28 15:59:15 christos Exp $

#
# Copyright (c) 2016 The NetBSD Foundation, Inc.
# All rights reserved.
#
# This code is derived from software contributed to The NetBSD Foundation
# by Alistair Crooks (agc@NetBSD.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
# AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#

# Define test sets with atf_test_case
# There may well be only one test set - these are tests for different
# functionality, so netpgpverify has 2 sets, 1 for RSA and 1 for DSA
# each test set has a
# + *_head() function, to define the set, and
# + *_body(), to set up the supporting input and expected output files
#	and some atf_check calls, which actually carry out the tests

# any binary files should be uuencoded
# we need to give the input and expected output files like this as tests
# take place in a clean directory, so we need to be able to set them up
# from the shell script

# Test set 1 (rsa_signatures) for netpgpverify
atf_test_case netpgpverify_testset_1_rsa_signatures

netpgpverify_testset_1_rsa_signatures_head() {
	atf_set "descr" "Test set 1 (rsa_signatures) for netpgpverify"
}
netpgpverify_testset_1_rsa_signatures_body() {
	uudecode << EOF
begin-base64 644 a.gpg
owGbwMvMwMQonXHnz4HIDGXGNduSGBPD/Rq2KSuo+KWWOAW7WCn4JmanpmXmpOqU
KRjqGSoYGRga6Rsa6hsZKBiYW5maWpmaKCSmJyu4VhQoqHBx6WXmJeeUpqQq2CQV
p+jll+fp5WbbcXGFuAaHBLt4BtkqqFSD2U6Owa61+qXFRXpJmXn6eaklBekFZalF
mWmVUMXxwR7atgol8ahSqMaXpBaXgM3vZJRhYWBkYmBjZQK5noGLUwDmp2X32f/X
n4pynyaz+0jbeluli8/NgkI2bK65Ud+ecUelqkvNaXlNVo3TKyX9TuNUpmX3l7l2
t2xy4e8veH8/OpurgK9V4EXAB98rbddTgtpzTxhuWH5x0Qf3O0xOzL5MR5SfLH7/
zJMl72uqUExspt5UJuXIEw+LTj2JKfA7Mcl219+lKebOVlfqpA20HzSeXmaatynY
NrX2BWfpS++vxxJiWL/wtLvzSVk/uZVunlXBsfDV/rbUxFDGPdMuNT/98f6cQ1Fz
/+nLOY84rsk7K/NnulZuvNzb9jw3Qv58qPvep1saRDy6XhcUxhwOmZvh1DvLz/HG
HNZMdVcl/iahoFURvHryU72zzz5eKXgoSc0SAA==
====
EOF
	uudecode << EOF
begin-base64 644 b.gpg
xA0DAAgBG2jc/MBZaCMBy4tiAAAAAABQUk9HPXAKU1JDUz1wYXJzZS5jCldBUk5T
PTUKTUtNQU49bm8KQ1BQRkxBR1MrPS1nIC1PMApMREZMQUdTKz0tZyAtTzAKCi5p
bmNsdWRlIDxic2QucHJvZy5taz4KCnQ6ICR7UFJPR30KCS4vJHtQUk9HfSBncGdz
aWduZWQtYS5ncGcKwsBiBAABCAAWBQJQTZOaBQMAAAAACRAbaNz8wFloIwAABT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base64 644 pubring.gpg
[encoded data, 26065 characters]
StZtC+VbuN66pfHwsAIAAw==
====
EOF
	uudecode << EOF
begin-base64 644 NetBSD-6.0_hashes.asc.gz
[encoded data, 415935 characters]
5fP5xwfmgf3mvV8/uvZ/H33yXT/ZJLc+v3neFvn/qZKFEe79DQA=
====
EOF
  gunzip NetBSD-6.0_hashes.asc.gz
	uudecode << EOF
begin-base64 644 expected16
R29vZCBzaWduYXR1cmUgZm9yIGIuZ3BnIG1hZGUgTW9uIFNlcCAxMCAwMDoxNToz
OCAyMDEyCnNpZ25hdHVyZSAgICAgMjA0OC9SU0EgKEVuY3J5cHQgb3IgU2lnbikg
MWI2OGRjZmNjMDU5NjgyMyAyMDA0LTAxLTEyCmZpbmdlcnByaW50ICAgZDQxNSA5
ZGViIDMzNmQgZTRjYyBjZGZhIDAwY2QgMWI2OCBkY2ZjIGMwNTkgNjgyMyAKdWlk
ICAgICAgICAgICBBbGlzdGFpciBDcm9va3MgPGFnY0BhbGlzdGFpcmNyb29rcy5j
b20+CnVpZCAgICAgICAgICAgQWxpc3RhaXIgQ3Jvb2tzIDxhZ2NAcGtnc3JjLm9y
Zz4KdWlkICAgICAgICAgICBBbGlzdGFpciBDcm9va3MgPGFnY0BuZXRic2Qub3Jn
Pgp1aWQgICAgICAgICAgIEFsaXN0YWlyIENyb29rcyA8YWdjQG5ldGZsaXguY29t
PgoK
====
EOF
	uudecode << EOF
begin-base64 644 expected17
R29vZCBzaWduYXR1cmUgZm9yIGEuZ3BnIG1hZGUgU3VuIFNlcCAgOSAxNzo0NDox
MSAyMDEyCnNpZ25hdHVyZSAgMjA0OC9SU0EgKEVuY3J5cHQgb3IgU2lnbikgMWI2
OGRjZmNjMDU5NjgyMyAyMDA0LTAxLTEyCmZpbmdlcnByaW50OiAgZDQxNSA5ZGVi
IDMzNmQgZTRjYyBjZGZhIDAwY2QgMWI2OCBkY2ZjIGMwNTkgNjgyMyAKdWlkICAg
ICAgICAgICAgICBBbGlzdGFpciBDcm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IDA4MDEgZmJkOCBmNDVkIDg5ZjIg
MDIwNSA5ZmYyIGMyNGYgZGYyYyBlNjIwIAoK
====
EOF
	uudecode << EOF
begin-base64 644 expected27
R29vZCBzaWduYXR1cmUgZm9yIFtzdGRpbl0gbWFkZSBNb24gT2N0IDE1IDA5OjI4
OjU0IDIwMTIKc2lnbmF0dXJlICAgICA0MDk2L1JTQSAoRW5jcnlwdCBvciBTaWdu
KSAwNjQ5NzNhYzRjNGE3MDZlIDIwMDktMDYtMjMKZmluZ2VycHJpbnQgICBkZGVl
IDJiZGIgOWM5OCBhMGQxIGQ0ZmIgZGJmNyAwNjQ5IDczYWMgNGM0YSA3MDZlIAp1
aWQgICAgICAgICAgIE5ldEJTRCBTZWN1cml0eSBPZmZpY2VyIDxzZWN1cml0eS1v
ZmZpY2VyQE5ldEJTRC5vcmc+Cgo=
====
EOF
	uudecode << EOF
begin-base64 644 expected28
R29vZCBzaWduYXR1cmUgZm9yIE5ldEJTRC02LjBfaGFzaGVzLmFzYyBtYWRlIE1v
biBPY3QgMTUgMDk6Mjg6NTQgMjAxMgpzaWduYXR1cmUgICAgIDQwOTYvUlNBIChF
bmNyeXB0IG9yIFNpZ24pIDA2NDk3M2FjNGM0YTcwNmUgMjAwOS0wNi0yMwpmaW5n
ZXJwcmludCAgIGRkZWUgMmJkYiA5Yzk4IGEwZDEgZDRmYiBkYmY3IDA2NDkgNzNh
YyA0YzRhIDcwNmUgCnVpZCAgICAgICAgICAgTmV0QlNEIFNlY3VyaXR5IE9mZmlj
ZXIgPHNlY3VyaXR5LW9mZmljZXJATmV0QlNELm9yZz4KCg==
====
EOF
	uudecode << EOF
begin-base64 644 expected29
R29vZCBzaWduYXR1cmUgZm9yIE5ldEJTRC02LjBfUkMxX2hhc2hlc19hc2NpaS5n
cGcgbWFkZSBTdW4gU2VwICA5IDE3OjQxOjI0IDIwMTIKc2lnbmF0dXJlICA0MDk2
L1JTQSAoRW5jcnlwdCBvciBTaWduKSAwNjQ5NzNhYz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2dzcmMu
b3JnPgp1aWQgICAgICAgICAgIEFsaXN0YWlyIENyb29rcyA8YWdjQG5ldGJzZC5v
cmc+CnVpZCAgICAgICAgICAgQWxpc3RhaXIgQ3Jvb2tzIDxhZ2NAbmV0ZmxpeC5j
b20+Cgo=
====
EOF
	uudecode << EOF
begin-base64 644 expected35
VG8gRG8KPT09PT0KdGVzdHMgd2l0aCAtayBzaWcKZGV0YWNoZWQgc2lncwpEU0EK
CkRvbmUKPT09PQpiYXNpY3MKbG9jYWxpc2UgcGdwX3JlYWRfcGFja2V0cwpmaXgg
bGludApXQVJOUz01CmxpYiBtYW4gcGFnZQpwcm9nIG1hbiBwYWdlCmRvIHdlIGRv
IGl0IHN0YXRpY2FsbHkgbGlua2VkIGFzIHdlbGw/Cm11bHRpcGxlIGZpbGVzIGlu
IG5ldHBncHZlcmlmeQo=
====
EOF
	atf_check -s eq:0 -o file:expected16 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c verify b.gpg
	atf_check -s eq:0 -o file:expected18 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c verify a.gpg
#	atf_check -s eq:0 -o file:expected19 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c verify NetBSD-6.0_RC2_hashes.asc
	atf_check -s eq:0 -o file:expected20 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat jj.asc
	atf_check -s eq:0 -o file:expected21 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < a.gpg
	atf_check -s eq:0 -o file:expected22 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < jj.asc
#	atf_check -s eq:0 -o file:expected23 -e empty env TZ=US/Pacific netpgpverify < NetBSD-6.0_RC2_hashes.asc
	atf_check -s eq:0 -o file:expected24 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < b.gpg
	#atf_check -s eq:0 -o file:expected25 -e empty netpgpverify NetBSD-6.0_RC1_hashes.gpg
	#atf_check -s eq:0 -o file:expected26 -e empty netpgpverify < NetBSD-6.0_RC1_hashes.gpg
	atf_check -s eq:0 -o file:expected27 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < NetBSD-6.0_hashes.asc
	atf_check -s eq:0 -o file:expected28 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg NetBSD-6.0_hashes.asc
	#atf_check -s eq:0 -o file:expected29 -e empty netpgpverify NetBSD-6.0_RC1_hashes_ascii.gpg
	#atf_check -s eq:0 -o file:expected30 -e empty netpgpverify < NetBSD-6.0_RC1_hashes_ascii.gpg
	atf_check -s eq:0 -o file:expected31 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat b.gpg b.gpg b.gpg
	atf_check -s eq:0 -o file:expected32 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg b.gpg b.gpg b.gpg
	atf_check -s eq:0 -o file:expected33 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat b.gpg jj.asc b.gpg
	atf_check -s eq:0 -o file:expected34 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg det.sig
	atf_check -s eq:0 -o file:expected35 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat det.sig
	#atf_check -s eq:0 -o file:expected46 -e empty netpgpverify -k problem-pubring.gpg NetBSD-6.0_hashes.asc
}

# Test set 2 (dsa_signatures) for netpgpverify
atf_test_case netpgpverify_testset_2_dsa_signatures

netpgpverify_testset_2_dsa_signatures_head() {
	atf_set "descr" "Test set 2 (dsa_signatures) for netpgpverify"
}
netpgpverify_testset_2_dsa_signatures_body() {
	uudecode << EOF
begin-base64 644 dsa-pubring.gpg
mQMuBFCEe2cRCACCpppLdv4Ku5vSFNOp4Qrjc0bO28aoVK77w2lJiPS7F9OAWYg0
N7AzamDMZolNdanmm4QZv8txwQC/d8XDB3viLmNDgi4D8/MNPvyL3PJ8AWi4ulkz
/D6e4DPvLvjZzOH+ZroqIwiixzfIx50crLJdbCM3c5A/dzRSY9IIAthdQsNNIVvX
jQNck9nCt3O2IOPGceZrmbNJ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2s9n/36yaOmu9HPs8/V
8pg+SdfaxMhwdEOjtLVOGtuaizmXnJ8oa4fN/bfL0WfP1smOn38vsLFlBQA=
====
EOF
	uudecode << EOF
begin-base64 644 in2.asc
LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQpIYXNoOiBTSEEyNTYK
CiMJLk5ldEJTRDogTWFrZWZpbGUsdiAxLjUuMTAuMSAyMDEyLzA1LzA2IDE4OjE0
OjE2IGFnYyBFeHAgLiAKClNVQkRJUis9CWxpYiAuV0FJVApTVUJESVIrPQliaW4K
Ci5pbmNsdWRlIDxic2Quc3ViZGlyLm1rPgotLS0tLUJFR0lOIFBHUCBTSUdOQVRV
UkUtLS0tLQpWZXJzaW9uOiBHbnVQRyB2MS40LjExIChOZXRCU0QpCgppRjRFQVJF
SUFBWUZBbENGU1FvQUNna1FKai9uaFdMaS9INmFLQUQ5SENMVHdZOEN3aXFUWHJ6
S3hIWjVsSFFuCnFFWmJjYlhqa0N4bGsrbS9QSFVBLzJXaGxjMHQ1WnRtSTIyMUxR
eTVpblRuenB1MVU3NUU1bEp2dzBZTVRkWEoKPXY3ODgKLS0tLS1FTkQgUEdQIFNJ
R05BVFVSRS0tLS0tCg==
====
EOF
	uudecode << EOF
begin-base64 644 expected36
R29vZCBzaWduYXR1cmUgZm9yIGluMS5ncGcgbWFkZSBNb24gT2N0IDIyIDA0OjQ1
OjQxIDIwMTIKc2lnbmF0dXJlICAgICAyMDQ4L0RTQSAyNjNmZTc4NTYyZTJmYzdl
IDIwMTItMTAtMjEKZmluZ2VycHJpbnQgICBkMmU1IDA3YjYgNWQ1OSAzM2QzIDlj
OGQgYTYxOCAyNjNmIGU3ODUgNjJlMiBmYzdlIAp1aWQgICAgICAgICAgIERhdmlk
IEFybXN0cm9uZyAoVGVzdCBEU0Ega2V5IC0gZG8gbm90IHVzZSkgPGRzYUBkc2Eu
Y29tPgoK
====
EOF
	uudecode << EOF
begin-base64 644 expected37
R29vZCBzaWduYX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ecode << EOF
begin-base64 644 expected40
IwkuTmV0QlNEOiBNYWtlZmlsZSx2IDEuNS4xMC4xIDIwMTIvMDUvMDYgMTg6MTQ6
MTYgYWdjIEV4cCAuCgpTVUJESVIrPQlsaWIgLldBSVQKU1VCRElSKz0JYmluCgou
aW5jbHVkZSA8YnNkLnN1YmRpci5taz4K
====
EOF
	uudecode << EOF
begin-base64 644 expected41
IwkuTmV0QlNEOiBNYWtlZmlsZSx2IDEuNS4xMC4xIDIwMTIvMDUvMDYgMTg6MTQ6
MTYgYWdjIEV4cCAuCgpTVUJESVIrPQlsaWIgLldBSVQKU1VCRElSKz0JYmluCgou
aW5jbHVkZSA8YnNkLnN1YmRpci5taz4K
====
EOF
	uudecode << EOF
begin-base64 644 expected42
IwkuTmV0QlNEOiBNYWtlZmlsZSx2IDEuNS4xMC4xIDIwMTIvMDUvMDYgMTg6MTQ6
MTYgYWdjIEV4cCAuCgpTVUJESVIrPQlsaWIgLldBSVQKU1VCRElSKz0JYmluCgou
aW5jbHVkZSA8YnNkLnN1YmRpci5taz4K
====
EOF
	uudecode << EOF
begin-base64 644 expected43
IwkuTmV0QlNEOiBNYWtlZmlsZSx2IDEuNS4xMC4xIDIwMTIvMDUvMDYgMTg6MTQ6
MTYgYWdjIEV4cCAuCgpTVUJESVIrPQlsaWIgLldBSVQKU1VCRElSKz0JYmluCgou
aW5jbHVkZSA8YnNkLnN1YmRpci5taz4K
====
EOF
	uudecode << EOF
begin-base64 644 expected44
R29vZCBzaWduYXR1cmUgZm9yIGluMi5ncGcgbWFkZSBNb24gT2N0IDIyIDA2OjI0
OjA5IDIwMTIKc2lnbmF0dXJlICAgICAyMDQ4L0RTQSAyNjNmZTc4NTYyZTJmYzdl
IDIwMTItMTAtMjEKZmluZ2VycHJpbnQgICBkMmU1IDA3YjYgNWQ1OSAzM2QzIDlj
OGQgYTYxOCAyNjNmIGU3ODUgNjJlMiBmYzdlIAp1aWQgICAgICAgICAgIERhdmlk
IEFybXN0cm9uZyAoV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Dg5ZjIgMDIwNSA5ZmYyIGMyNGYgZGYyYyBlNjIwIAoK
====
EOF
	atf_check -s eq:0 -o file:expected36 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in1.gpg
	atf_check -s eq:0 -o file:expected37 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg < in1.gpg
	atf_check -s eq:0 -o file:expected38 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in1.asc
	atf_check -s eq:0 -o file:expected39 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg < in1.asc
	atf_check -s eq:0 -o file:expected40 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat in1.gpg
	atf_check -s eq:0 -o file:expected41 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat < in1.gpg
	atf_check -s eq:0 -o file:expected42 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat in1.asc
	atf_check -s eq:0 -o file:expected43 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat < in1.asc
	atf_check -s eq:0 -o file:expected44 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in2.gpg
	atf_check -s eq:0 -o file:expected45 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in2.asc
}

# all test sets
atf_init_test_cases() {
	atf_add_test_case netpgpverify_testset_1_rsa_signatures
	atf_add_test_case netpgpverify_testset_2_dsa_signatures
}

