From a13b8f234aa057547a16eaa43c26f1e71ef9bb96 Mon Sep 17 00:00:00 2001 From: Andrew Engelbrecht Date: Thu, 23 Jul 2015 13:42:06 -0400 Subject: [PATCH] updated expected test results; added more tests --- run-tests | 2 +- tests/flatten-1.eml | 54 ++++++++++++++++++++++++++++ tests/flatten-1.out | 11 ++++++ tests/{plain-1.eml => flatten-2.eml} | 0 tests/flatten-2.out | 9 +++++ tests/{plain-2.eml => flatten-3.eml} | 0 tests/flatten-3.out | 9 +++++ tests/flatten-4.eml | 41 +++++++++++++++++++++ tests/flatten-4.out | 9 +++++ tests/gpg-flatten-1.out | 10 ++++-- tests/gpg-flatten-2.out | 11 ++++-- tests/gpg-flatten-3.out | 13 +++---- tests/gpg-flatten-4.out | 27 +++++--------- tests/gpg-flatten-5.eml | 33 +++++++++++++++++ tests/gpg-flatten-5.out | 9 +++++ tests/gpg-flatten-6.eml | 43 ++++++++++++++++++++++ tests/gpg-flatten-6.out | 20 +++++++++++ tests/plain-1.out | 5 --- tests/plain-2.out | 5 --- 19 files changed, 271 insertions(+), 40 deletions(-) create mode 100644 tests/flatten-1.eml create mode 100644 tests/flatten-1.out rename tests/{plain-1.eml => flatten-2.eml} (100%) create mode 100644 tests/flatten-2.out rename tests/{plain-2.eml => flatten-3.eml} (100%) create mode 100644 tests/flatten-3.out create mode 100644 tests/flatten-4.eml create mode 100644 tests/flatten-4.out create mode 100644 tests/gpg-flatten-5.eml create mode 100644 tests/gpg-flatten-5.out create mode 100644 tests/gpg-flatten-6.eml create mode 100644 tests/gpg-flatten-6.out delete mode 100644 tests/plain-1.out delete mode 100644 tests/plain-2.out diff --git a/run-tests b/run-tests index 1cf9d71..715ba4d 100755 --- a/run-tests +++ b/run-tests @@ -19,7 +19,7 @@ NUM_TESTS=1 #TEST_TYPES="gpg-flatten flatten plain" -TEST_TYPES="gpg-flatten plain" +TEST_TYPES="gpg-flatten flatten" function _main { diff --git a/tests/flatten-1.eml b/tests/flatten-1.eml new file mode 100644 index 0000000..885f5f8 --- /dev/null +++ b/tests/flatten-1.eml @@ -0,0 +1,54 @@ +From: No One +MIME-Version: 1.0 +To: No One +Subject: =?UTF-8?B?44GT44KT44Gr44Gh44Gv44CB44GK5YWD5rCX44Gn44GZ44GL77yf?= +Content-Type: multipart/signed; micalg=pgp-sha512; + protocol="application/pgp-signature"; + boundary="69pEqCNMs7DnfdpwkAdpUCaf0lwnKu6Vr" + +This is an OpenPGP/MIME signed message (RFC 4880 and 3156) +--69pEqCNMs7DnfdpwkAdpUCaf0lwnKu6Vr +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: quoted-printable + +thanks for the message! + +> =C3=9Cber Spa=C3=9F. +> +> qual =C3=A8 il suono di una mano sola? +> +> =E3=81=93=E3=82=93=E3=81=AB=E3=81=A1=E3=81=AF=E3=80=81=E3=81=8A=E5=85=83= +=E6=B0=97=E3=81=A7=E3=81=99=E3=81=8B=EF=BC=9F +> + +test. + +-andrew + + + + + + + + + +--69pEqCNMs7DnfdpwkAdpUCaf0lwnKu6Vr +Content-Type: application/pgp-signature; name="signature.asc" +Content-Description: OpenPGP digital signature +Content-Disposition: attachment; filename="signature.asc" + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1 + +iQEcBAEBCgAGBQJVr7ynAAoJEO8exSA5s25YknEH/isrM1jly/A0uwd6mgh60ob9 +1R6+Z8P68Prx19uGBbURkRQwXQUCv9v/Q7eJAOCi3fFqWtPZjPjW3bC4apOKguEU +2DjjinZ9uBeHZz6W6R9Hs0JhbF038vMBmRz3BGouRqg06gTDwnj1l13RkbaZSsi2 +T/PjyaIS5P8ffEbIEwQtpgmFR2x/+eE3Ot/vzupdR8jZFk4oJ/YxtEOYFIc3Mnav +8km9V1AKBlskASY0cW84R7pngFDTZeB2ElYdGslDu1r1GdeX4qAUhqYZVmZ8O4op +4tv/gR51nw83lqJPgleZFMSFPPaafKb7JjeeYW6w4xjLKJ+xN1OV2Sjd5FM2KJs= +=tTBC +-----END PGP SIGNATURE----- + +--69pEqCNMs7DnfdpwkAdpUCaf0lwnKu6Vr-- + diff --git a/tests/flatten-1.out b/tests/flatten-1.out new file mode 100644 index 0000000..c26c99c --- /dev/null +++ b/tests/flatten-1.out @@ -0,0 +1,11 @@ + + +Your signature was verified. + +I'm sorry, I was not able to find your public key. Did you remember to attach it? + +- Edward, the friendly GnuPG bot +The Free Software Foundation created me. + +Can you donate to support their work? +https://www.fsf.org/donate diff --git a/tests/plain-1.eml b/tests/flatten-2.eml similarity index 100% rename from tests/plain-1.eml rename to tests/flatten-2.eml diff --git a/tests/flatten-2.out b/tests/flatten-2.out new file mode 100644 index 0000000..eec4110 --- /dev/null +++ b/tests/flatten-2.out @@ -0,0 +1,9 @@ + + +I'm sorry, I was not able to find your public key. Did you remember to attach it? + +- Edward, the friendly GnuPG bot +The Free Software Foundation created me. + +Can you donate to support their work? +https://www.fsf.org/donate diff --git a/tests/plain-2.eml b/tests/flatten-3.eml similarity index 100% rename from tests/plain-2.eml rename to tests/flatten-3.eml diff --git a/tests/flatten-3.out b/tests/flatten-3.out new file mode 100644 index 0000000..e95ca68 --- /dev/null +++ b/tests/flatten-3.out @@ -0,0 +1,9 @@ +I'm sorry, I was not able to decrypt your message. Are you sure you encrypted it with my public key? + +I'm sorry, I was not able to find your public key. Did you remember to attach it? + +- Edward, the friendly GnuPG bot +The Free Software Foundation created me. + +Can you donate to support their work? +https://www.fsf.org/donate diff --git a/tests/flatten-4.eml b/tests/flatten-4.eml new file mode 100644 index 0000000..f84a9d0 --- /dev/null +++ b/tests/flatten-4.eml @@ -0,0 +1,41 @@ +From: No One +MIME-Version: 1.0 +To: No One +Subject: test +Content-Type: multipart/mixed; + boundary="------------050208050701010001050209" + +This is a multi-part message in MIME format. +--------------050208050701010001050209 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: 7bit + + +--------------050208050701010001050209 +Content-Type: application/octet-stream; + name="tmp.img" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; + filename="tmp.img" + +w8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/4cCuCM +voCl2d60fjNPA/m3x9BuAERSXcROltF/CMkSdHniSiSyEEaWMlOC7wipeUa9ubwrP3/83irI +V+SU5dtt1O1jqCBEqxEhngWhyKJp+YBQiTaitpUz59SjCdpmnw+euAKLyQjGg6dY9QCtuPqD +sWmlZxXedry9GX3w7WC0g4J3B29YozW+IX2dI8VgIcg52xe0ohB4HJdmGbVQNyATDnJuM2L5 +r1y1sSpNCXTEuge0wwSGcbQaEZcxcqStYWiIOSbrxeKtZXk4GlEutC88IWOZstMuRdE72g== +--------------050208050701010001050209-- + diff --git a/tests/flatten-4.out b/tests/flatten-4.out new file mode 100644 index 0000000..eec4110 --- /dev/null +++ b/tests/flatten-4.out @@ -0,0 +1,9 @@ + + +I'm sorry, I was not able to find your public key. Did you remember to attach it? + +- Edward, the friendly GnuPG bot +The Free Software Foundation created me. + +Can you donate to support their work? +https://www.fsf.org/donate diff --git a/tests/gpg-flatten-1.out b/tests/gpg-flatten-1.out index 6a7350b..5aab701 100644 --- a/tests/gpg-flatten-1.out +++ b/tests/gpg-flatten-1.out @@ -1,5 +1,4 @@ -thanks for the message! - +Hello, I am Edward, the friendly GnuPG bot. I received your message and decrypted it. Here's a copy of your message: > thanks for the message! > @@ -15,4 +14,9 @@ thanks for the message! > -andrew > > -> + +- Edward, the friendly GnuPG bot +The Free Software Foundation created me. + +Can you donate to support their work? +https://www.fsf.org/donate diff --git a/tests/gpg-flatten-2.out b/tests/gpg-flatten-2.out index 1e69340..1da887f 100644 --- a/tests/gpg-flatten-2.out +++ b/tests/gpg-flatten-2.out @@ -1,5 +1,4 @@ -thanks for the message! - +Hello, I am Edward, the friendly GnuPG bot. I received your message and decrypted it. Here's a copy of your message: > thanks for the message! > @@ -17,3 +16,11 @@ thanks for the message! > > > + +I received your public key. Thanks. + +- Edward, the friendly GnuPG bot +The Free Software Foundation created me. + +Can you donate to support their work? +https://www.fsf.org/donate diff --git a/tests/gpg-flatten-3.out b/tests/gpg-flatten-3.out index b77846c..f5eb59f 100644 --- a/tests/gpg-flatten-3.out +++ b/tests/gpg-flatten-3.out @@ -1,8 +1,9 @@ -thanks for the message! -> hi, i didn't encrypt this part. is that a mistake? -> -> bye! -> -> +Your signature was verified. + +- Edward, the friendly GnuPG bot +The Free Software Foundation created me. + +Can you donate to support their work? +https://www.fsf.org/donate diff --git a/tests/gpg-flatten-4.out b/tests/gpg-flatten-4.out index 214b734..ae4f5f2 100644 --- a/tests/gpg-flatten-4.out +++ b/tests/gpg-flatten-4.out @@ -1,26 +1,17 @@ -thanks for the message! +Hello, I am Edward, the friendly GnuPG bot. I received your message and decrypted it. Here's a copy of your message: - -> -----BEGIN PGP SIGNED MESSAGE----- -> Hash: SHA1 -> > hello again!!!! > > i think i'll try this encryption thing and paste this in. > > let's see how it works! -> -----BEGIN PGP SIGNATURE----- -> Version: GnuPG v1 -> -> iJwEAQECAAYFAlWthW0ACgkQsT5tL2pPbuh5DQQAnkjHaeOoOKICD0o7ne5hp1TD -> 7l7A2TszHerbk7SLSC3W5PV9PV8frj4NxyFUe6n1x2hYiIqJqxjctB2+7oV12Z1w -> l3IYtYwjLk1Rqc+iHTb+S2+1XycXoTesRcK5f1bZIIl50RUpx4hLZVbIYyA6CoyE -> ldPslQXK+wrNm3mkspY= -> =+Jmq -> -----END PGP SIGNATURE----- -> -> hi, i didn't encrypt this part. is that a mistake? -> -> bye! > > + +Your signature was verified. + +- Edward, the friendly GnuPG bot +The Free Software Foundation created me. + +Can you donate to support their work? +https://www.fsf.org/donate diff --git a/tests/gpg-flatten-5.eml b/tests/gpg-flatten-5.eml new file mode 100644 index 0000000..11fe6fe --- /dev/null +++ b/tests/gpg-flatten-5.eml @@ -0,0 +1,33 @@ +From: No One +MIME-Version: 1.0 +To: No One +Subject: =?UTF-8?B?44GT44KT44Gr44Gh44Gv44CB44GK5YWD5rCX44Gn44GZ44GL77yf?= +Content-Type: multipart/encrypted; + protocol="application/pgp-encrypted"; + boundary="x2iAciceo0NrKsl4uFVFGTgJ6k0ocg8FW" + +This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156) +--x2iAciceo0NrKsl4uFVFGTgJ6k0ocg8FW +Content-Type: application/pgp-encrypted +Content-Description: PGP/MIME version identification + +Version: 1 + +--x2iAciceo0NrKsl4uFVFGTgJ6k0ocg8FW +Content-Type: application/octet-stream; name="encrypted.asc" +Content-Description: OpenPGP encrypted message +Content-Disposition: inline; filename="encrypted.asc" + +-----BEGIN PGP MESSAGE----- +Version: GnuPG v1 + +owGbwMvMwMS40S5XP8s/7wXjabskhtCNIq9LMjKLFYAoUaEktbhEITe1uDgxPVVP +oTK/VKE4I780J0UhL79EoTg1VQGsNL+0pKC0RI+rYw4LAyMTAxsrE8gUBi5OAZjR +/w2Z/2kxf6n7XqaQ+m96/xz+I86XLqnd65y+W+eg1e5LLfMVTRkOlJ6c/dnwpkOu +heLnxuezYx5w5hdY6XEXzNBgCC5xzstINbyVWxBTl7jknH/XCTvO5mPSB84mnLCO +W+jQYpDzRdOt6i2TxFmek1V+8/8uNzmwf3UI0wI+pe6Eox/sle+f/OXjAQA= +=AT2s +-----END PGP MESSAGE----- + +--x2iAciceo0NrKsl4uFVFGTgJ6k0ocg8FW-- + diff --git a/tests/gpg-flatten-5.out b/tests/gpg-flatten-5.out new file mode 100644 index 0000000..f5eb59f --- /dev/null +++ b/tests/gpg-flatten-5.out @@ -0,0 +1,9 @@ + + +Your signature was verified. + +- Edward, the friendly GnuPG bot +The Free Software Foundation created me. + +Can you donate to support their work? +https://www.fsf.org/donate diff --git a/tests/gpg-flatten-6.eml b/tests/gpg-flatten-6.eml new file mode 100644 index 0000000..ca6e69a --- /dev/null +++ b/tests/gpg-flatten-6.eml @@ -0,0 +1,43 @@ +From: No One +MIME-Version: 1.0 +To: No One +Subject: =?UTF-8?B?44GT44KT44Gr44Gh44Gv44CB44GK5YWD5rCX44Gn44GZ44GL77yf?= +Content-Type: multipart/encrypted; + protocol="application/pgp-encrypted"; + boundary="x2iAciceo0NrKsl4uFVFGTgJ6k0ocg8FW" + +This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156) +--x2iAciceo0NrKsl4uFVFGTgJ6k0ocg8FW +Content-Type: application/pgp-encrypted +Content-Description: PGP/MIME version identification + +Version: 1 + +--x2iAciceo0NrKsl4uFVFGTgJ6k0ocg8FW +Content-Type: application/octet-stream; name="encrypted.asc" +Content-Description: OpenPGP encrypted message +Content-Disposition: inline; filename="encrypted.asc" + +-----BEGIN PGP MESSAGE----- +Version: GnuPG v1 + +hIwDWouAYlp2iv8BBAC+TPb/Fdoye+wORbVhPNslOQo829IK2nhRYkVcxouDoRQP +M+q6vI0RMqwobFCqsyK6LIutS3JAqHIB7tsl//MN3hHUcIiF4ZgsyPpX+wazLMCp +XFapg0WsuJjnBi5h0ugkpg/B4HuyiPYYIoH1wxCwp449MZzGHLmIMG02JlmiQtLp +AV50UCk6OUoclVbJhpz6vttUxPPihTuVSTHGVJA25S3yF5Z2TTTosA5hwcEEN8/R +fZ/cgYE88ewXcuo9/vYnXnQUGOzbEtFJ9g2wdnEpf0XzKgm60KcZCNXbDfHF9X9X +BrimYlfjjaQ+vL7LEfEinhxZLbdu/yA5ej/colSP7IkefUVOE1J8mW2zmO5vNoRT +mYj0T66+grP7ILPy+T68eY7pWaCoUWNqTQULyAfAyYpEmb6SBw/qtq0ZWVgAuIwM ++sA5vVgKDeb6+Rntesjs7YwIqKzp0LP/u/Dn+jp6D+3njltrkp/zhMUX2PL97CH7 +v9kZbwcxFFqjOvdtFn4bbHa+F1CjS6MakGDG8H609VtdL7vee7goaM9+PUCNYFur +DOsEW0ML8a5gLNFzIScZTxsNwretctsJWu3TkVD+wY1UcqD/h4yIuKF7ZuJOGcW0 +CkxJ6U9OZsFgPzGqpLY3+Q/zb1Z0Tipex0FuKTw6gCpK9gieJKw04ZUFb7MuYPrj +xSCY7ruJiHRz5Vby8a2uQMisjs8ajXtkzinfRRQe7vQd8WJGKBs5pUe+7kLgBhx+ +xI5oHuAQ3SkmdMjhFSQ7idgl+MV+7TVLBx96qdxfUhSw65uW2TySPkBpM1JDxU6A +4hDENnhdBM6/o6JDbClGjVLCN1vgvBAZ8ToOShXOZ1AulZu2sazolhwzvEMzkQyH +gURIeMRulCLM1ufflHaKzDFBOP24gK1Zl+B7g5BDvg== +=Hetx +-----END PGP MESSAGE----- + +--x2iAciceo0NrKsl4uFVFGTgJ6k0ocg8FW-- + diff --git a/tests/gpg-flatten-6.out b/tests/gpg-flatten-6.out new file mode 100644 index 0000000..3fb2496 --- /dev/null +++ b/tests/gpg-flatten-6.out @@ -0,0 +1,20 @@ +こんにちは! 私はGnuPGボットのEdwardです。あなたから送られたメールの暗号を解きました。確認のため、内容を返信します: + +> thanks for the message! +> +> > Über Spaß. +> > +> > qual è il suono di una mano sola? +> > +> > こんにちは、お元気ですか? +> > +> +> test. +> +> -andrew +> +> + +- GnuPGボットのEdward + +Free Software Foundationが私を制作しました。 Free Software Foundationに寄付しませんか。| https://www.fsf.org/donate diff --git a/tests/plain-1.out b/tests/plain-1.out deleted file mode 100644 index c5a2dc9..0000000 --- a/tests/plain-1.out +++ /dev/null @@ -1,5 +0,0 @@ -To: No One -Subject: =?UTF-8?B?44GT44KT44Gr44Gh44Gv44CB44GK5YWD5rCX44Gn44GZ44GL77yf?= - -Sorry, i couldn't find your key. -I'll need that to encrypt a message to you. diff --git a/tests/plain-2.out b/tests/plain-2.out deleted file mode 100644 index c5a2dc9..0000000 --- a/tests/plain-2.out +++ /dev/null @@ -1,5 +0,0 @@ -To: No One -Subject: =?UTF-8?B?44GT44KT44Gr44Gh44Gv44CB44GK5YWD5rCX44Gn44GZ44GL77yf?= - -Sorry, i couldn't find your key. -I'll need that to encrypt a message to you. -- 2.25.1