From 2826d7a9300ad75672bee1b8aea6459d6f1cdb3e Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 22 Sep 2015 23:46:13 -0400 Subject: initial commit --- tests/__init__.py | 0 tests/corpus/OpenPGP/.gitignore | 1 + tests/corpus/OpenPGP/README.md | 4 +++ tests/corpus/OpenPGP/genkeys | 31 ++++++++++++++++++ tests/corpus/OpenPGP/gnupg-import | 27 +++++++++++++++ tests/corpus/OpenPGP/julia.key | 59 +++++++++++++++++++++++++++++++++ tests/corpus/OpenPGP/julia.pgp | 30 +++++++++++++++++ tests/corpus/OpenPGP/obrian.key | 59 +++++++++++++++++++++++++++++++++ tests/corpus/OpenPGP/obrian.pgp | 30 +++++++++++++++++ tests/corpus/OpenPGP/winston.key | 59 +++++++++++++++++++++++++++++++++ tests/corpus/OpenPGP/winston.pgp | 30 +++++++++++++++++ tests/corpus/expected.A.eml | 69 +++++++++++++++++++++++++++++++++++++++ tests/corpus/sample.A.eml | 32 ++++++++++++++++++ 13 files changed, 431 insertions(+) create mode 100644 tests/__init__.py create mode 100644 tests/corpus/OpenPGP/.gitignore create mode 100644 tests/corpus/OpenPGP/README.md create mode 100755 tests/corpus/OpenPGP/genkeys create mode 100755 tests/corpus/OpenPGP/gnupg-import create mode 100644 tests/corpus/OpenPGP/julia.key create mode 100644 tests/corpus/OpenPGP/julia.pgp create mode 100644 tests/corpus/OpenPGP/obrian.key create mode 100644 tests/corpus/OpenPGP/obrian.pgp create mode 100644 tests/corpus/OpenPGP/winston.key create mode 100644 tests/corpus/OpenPGP/winston.pgp create mode 100644 tests/corpus/expected.A.eml create mode 100644 tests/corpus/sample.A.eml (limited to 'tests') diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/corpus/OpenPGP/.gitignore b/tests/corpus/OpenPGP/.gitignore new file mode 100644 index 0000000..03f357b --- /dev/null +++ b/tests/corpus/OpenPGP/.gitignore @@ -0,0 +1 @@ +GNUPGHOME diff --git a/tests/corpus/OpenPGP/README.md b/tests/corpus/OpenPGP/README.md new file mode 100644 index 0000000..037d893 --- /dev/null +++ b/tests/corpus/OpenPGP/README.md @@ -0,0 +1,4 @@ +This directory contains OpenPGP public and private key material that +can be used to interpret messages from this corpus. + +See the genkey script for how they were generated. diff --git a/tests/corpus/OpenPGP/genkeys b/tests/corpus/OpenPGP/genkeys new file mode 100755 index 0000000..d5e74b8 --- /dev/null +++ b/tests/corpus/OpenPGP/genkeys @@ -0,0 +1,31 @@ +#!/bin/bash + +# Daniel Kahn Gillmor +# 2015-07-15 + +# How to generate the keys used for the creation of the message +# corpus. + +export WORKDIR=$(mktemp -d) +export GNUPGHOME="$WORKDIR" + +cat >"${WORKDIR}/gpg-agent.conf"<' +gpg2 --batch --pinentry-mode=loopback --passphrase=_julia_ --quick-gen-key 'Julia ' +gpg2 --batch --pinentry-mode=loopback --passphrase=_obrian_ --quick-gen-key "O'Brian " + +for x in winston julia obrian; do + gpg2 --armor --batch --pinentry-mode=loopback --passphrase=_${x}_ --output $x.key --export-secret-key $x + gpg2 --armor --batch --output $x.pgp --export $x +done + diff --git a/tests/corpus/OpenPGP/gnupg-import b/tests/corpus/OpenPGP/gnupg-import new file mode 100755 index 0000000..a92bce2 --- /dev/null +++ b/tests/corpus/OpenPGP/gnupg-import @@ -0,0 +1,27 @@ +#!/bin/bash + +mkdir -p -m 0700 GNUPGHOME +export GNUPGHOME=$(pwd)/GNUPGHOME + +cat >GNUPGHOME/gpg-agent.conf < +From: Winston + +--cccccccccccc +Content-Type: multipart/mixed; boundary="bbbbbbbbbbbb" + +--bbbbbbbbbbbb +Content-Type: text/rfc822-headers +Content-Disposition: attachment + +Date: Thu, 16 Jul 2015 11:44:44 +0200 +Subject: alternative text/html message with embedded header, signed +Message-ID: A@memoryhole.example +To: Julia +From: Winston + +--bbbbbbbbbbbb +Content-Type: multipart/alternative; boundary="aaaaaaaaaaaa" + +--aaaaaaaaaaaa +Content-Type: text/plain + +This is a test +message on multiple lines + +with a silly bit more. +-- +and a .sig here. + +--aaaaaaaaaaaa +Content-Type: text/html + + + +titles are usually unrendered + + +

This is a test
message on multiple lines

+

with a silly bit more.

+
+

and a .sig here.

+ + +--aaaaaaaaaaaa-- + +--bbbbbbbbbbbb-- + +--cccccccccccc +Content-Type: application/pgp-signature; name="signature.asc" + +-----BEGIN PGP SIGNATURE----- + +iQEcBAABCAAGBQJWAiCsAAoJEBX7TryOLWy3JpEH/Ao8INvddDi7OJhsXWlLAHiu +GaDS/xSXvsXgVe3IstKQLeepwvjkrismFNxQ7+5uBJxVXr+TgQgG8KAXZM7VYl+D +rBnZYTlLnepSeeqeS3gcB9EWNABopCuDjEdCDO+CHudR4vFaN8wlqafxMdKqR74z +i+49RXUXlBJMJJNNKrzJyatltRRyGBM0sqUIt6ZqrhwT5DwJZFbMBLx23X9heFFi +7oLGSrAzlSfVr8KM5DoniAyNXSNWtVjj1hl8xCVJtIfsOcvpwCVR15vzfuH623og +0Ag7G0GyKb1yNKlIZeUvJ7uo4Tm2+gUikn7Pk1eGqAEC5R7Ip1u8bkEtgdftinw= +=OeWg +-----END PGP SIGNATURE----- + +--cccccccccccc-- + diff --git a/tests/corpus/sample.A.eml b/tests/corpus/sample.A.eml new file mode 100644 index 0000000..cf67839 --- /dev/null +++ b/tests/corpus/sample.A.eml @@ -0,0 +1,32 @@ +Subject: alternative text/html message with embedded header, signed +Message-ID: A@memoryhole.example +Date: Thu, 16 Jul 2015 11:44:44 +0200 +To: Julia +From: Winston +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="aaaaaaaaaaaa" + +--aaaaaaaaaaaa +Content-Type: text/plain + +This is a test +message on multiple lines + +with a silly bit more. +-- +and a .sig here. + +--aaaaaaaaaaaa +Content-Type: text/html + + + +titles are usually unrendered + + +

This is a test
message on multiple lines

+

with a silly bit more.

+
+

and a .sig here.

+ + -- cgit v1.2.3