[git] GpgOL - branch, nomapi, updated. gpgol-1.4.0-55-g1ae8bc5
by Andre Heinecke
cvs at cvs.gnupg.org
Thu Sep 22 16:44:47 CEST 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG extension for MS Outlook".
The branch, nomapi has been updated
via 1ae8bc5317557369a68d7270104b2e03bb4dd263 (commit)
via 38131c6136d95989c018e26305e77e55fb5626a0 (commit)
via 7e1688e578bb724a5d2a647bf95bebc1e314262d (commit)
from 5d47b7be70199f6c40040b38ac90529808a0d2ed (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 1ae8bc5317557369a68d7270104b2e03bb4dd263
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Thu Sep 22 16:44:28 2016 +0200
tests: Add Opaque signed S/MIME mail
--
diff --git a/tests/data/smime-opaque-sign.mbox b/tests/data/smime-opaque-sign.mbox
new file mode 100644
index 0000000..6e1739a
--- /dev/null
+++ b/tests/data/smime-opaque-sign.mbox
@@ -0,0 +1,25 @@
+From test at example.com Fri Sep 11 10:16:06 2015
+From: test <test at example.com>
+To: you at you.com
+Subject: sign only
+Date: Fri, 11 Sep 2015 12:16:06 +0200
+Message-ID: <3182420.pXWeMPZlAJ at tabin.local>
+X-KMail-Identity: 792434561
+User-Agent: KMail/4.13.0.1 (Linux/4.1.5-towo.1-siduction-amd64; KDE/4.14.2; x86_64; ; )
+MIME-Version: 1.0
+Content-Type: application/pkcs7-mime; name="smime.p7m"; smime-type="signed-data"
+Content-Transfer-Encoding: base64
+Content-Disposition: attachment; filename="smime.p7m"
+
+MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAaCAJIAEZUNvbnRl
+bnQtVHJhbnNmZXItRW5jb2Rpbmc6IDdCaXQKQ29udGVudC1UeXBlOiB0ZXh0L3BsYWluOyBjaGFy
+c2V0PSJ1dGYtOCIKCkEgc2ltcGxlIHNpZ25lZCBvbmx5IHRlc3QuAAAAAAAAMYIBkjCCAY4CAQEw
+YjBVMQswCQYDVQQGEwJVUzENMAsGA1UECgwES0RBQjEWMBQGA1UEAwwNdW5pdHRlc3QgY2VydDEf
+MB0GCSqGSIb3DQEJARYQdGVzdEBleGFtcGxlLmNvbQIJANNFIDoYY4XJMAkGBSsOAwIaBQCggYcw
+GAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTMwMTEwMTU0ODEyWjAj
+BgkqhkiG9w0BCQQxFgQUvJ5zI7oyv5fNx1H1wabIa6atsdcwKAYJKoZIhvcNAQkPMRswGTALBglg
+hkgBZQMEAQIwCgYIKoZIhvcNAwcwDQYJKoZIhvcNAQEBBQAEgYAHFCw88FPy1n2lu5ql5sD2J4Yi
+2/N9gUQvNQF5F/kd48HncdihLPZRs7eEX7IzDZNeylTmyp2WIiGEwQrIHbxtqU32NRouc09Zv4bu
+iUwUoz1SM2s7qipikwayQMD3d5zWNhszNLBsw8z48uXAzjZAejBCfPP0/w3z7DZDJC2R2QAAAAAA
+AA==
+
diff --git a/tests/data/smime-opaque-sign.plain b/tests/data/smime-opaque-sign.plain
new file mode 100644
index 0000000..f136305
--- /dev/null
+++ b/tests/data/smime-opaque-sign.plain
@@ -0,0 +1 @@
+A simple signed only test.
\ No newline at end of file
diff --git a/tests/t-parser.cpp b/tests/t-parser.cpp
index f8ddf44..9e43d5e 100644
--- a/tests/t-parser.cpp
+++ b/tests/t-parser.cpp
@@ -68,6 +68,13 @@ struct
NULL,
1,
"us-ascii"},
+ { DATADIR "/smime-opaque-sign.mbox",
+ MSGTYPE_GPGOL_OPAQUE_SIGNED,
+ DATADIR "/smime-opaque-sign.plain",
+ NULL,
+ NULL,
+ 0,
+ "utf-8"},
{ NULL, MSGTYPE_UNKNOWN, NULL, NULL, NULL, 0, NULL }
};
commit 38131c6136d95989c018e26305e77e55fb5626a0
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Thu Sep 22 16:36:31 2016 +0200
Collect S/MIME Opaque as crypto data
* src/mimedataprovider.cpp (t2body): Start collecting crypto
data when encountering an smime attachment.
--
This also removes is and maybe opaque signed as this complicated
the code (actually needing some X509 parsing in GpgOL) and
is not needed imo. We can just try to verify it and verification
will fail if its not validly signed.
diff --git a/src/mimedataprovider.cpp b/src/mimedataprovider.cpp
index 5761a43..1727da2 100644
--- a/src/mimedataprovider.cpp
+++ b/src/mimedataprovider.cpp
@@ -80,8 +80,6 @@ struct mime_context
int is_qp_encoded; /* Current part is QP encoded. */
int is_base64_encoded; /* Current part is base 64 encoded. */
int is_body; /* The current part belongs to the body. */
- int is_opaque_signed; /* Flag indicating opaque signed S/MIME. */
- int may_be_opaque_signed;/* Hack, see code. */
protocol_t protocol; /* The detected crypto protocol. */
int part_counter; /* Counts the number of processed parts. */
@@ -323,17 +321,8 @@ t2body (MimeDataProvider *provider, rfc822parse_t msg)
{
const char *smtype = rfc822parse_query_parameter (field,
"smime-type", 0);
- if (smtype && !strcmp (smtype, "signed-data"))
- ctx->is_opaque_signed++;
- else
- {
- /* CryptoEx is notorious in setting wrong MIME header.
- Mark that so we can test later if possible. */
- ctx->may_be_opaque_signed++;
- }
+ ctx->collect_crypto_data = 1;
}
-
- ctx->collect_attachment = 1;
}
rfc822parse_release_field (field); /* (Content-type) */
ctx->in_data = 1;
@@ -343,11 +332,10 @@ t2body (MimeDataProvider *provider, rfc822parse_t msg)
if (is_text && not_inline_text)
ctx->collect_attachment = 1;
- log_mime_parser ("%s:%s: this body: nesting=%d partno=%d is_text=%d, is_opq=%d"
+ log_mime_parser ("%s:%s: this body: nesting=%d partno=%d is_text=%d"
" charset=\"%s\"\n",
SRCNAME, __func__,
ctx->nesting_level, ctx->part_counter, is_text,
- ctx->is_opaque_signed,
ctx->mimestruct_cur->charset?ctx->mimestruct_cur->charset:"");
/* If this is a text part, decide whether we treat it as our body. */
commit 7e1688e578bb724a5d2a647bf95bebc1e314262d
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Thu Sep 22 16:30:14 2016 +0200
tests: Add test mail with attachments
--
diff --git a/tests/data/openpgp-encrypted-attachment.mbox b/tests/data/openpgp-encrypted-attachment.mbox
new file mode 100644
index 0000000..4204fb0
--- /dev/null
+++ b/tests/data/openpgp-encrypted-attachment.mbox
@@ -0,0 +1,57 @@
+From test at kolab.org Fri May 01 15:13:18 2015
+From: testkey <test at kolab.org>
+To: you at you.com
+Subject: enc attachment
+Date: Fri, 01 May 2015 17:13:18 +0200
+Message-ID: <2401407.XhOc2XYoOt at tabin.local>
+X-KMail-Identity: 1197256126
+User-Agent: KMail/4.13.0.1 (Linux/3.19.1-towo.1-siduction-amd64; KDE/4.14.2; x86_64; git-cd33034; 2015-04-11)
+MIME-Version: 1.0
+Content-Type: multipart/encrypted; boundary="nextPart4793536.cjk9hKXLQ5"; protocol="application/pgp-encrypted"
+
+
+--nextPart4793536.cjk9hKXLQ5
+Content-Type: application/pgp-encrypted
+Content-Disposition: attachment
+Content-Transfer-Encoding: 7Bit
+
+Version: 1
+--nextPart4793536.cjk9hKXLQ5
+Content-Type: application/octet-stream
+Content-Disposition: inline; filename="msg.asc"
+Content-Transfer-Encoding: 7Bit
+
+-----BEGIN PGP MESSAGE-----
+Version: GnuPG v2
+
+hIwDGJlthTT7oq0BBACLMnR5Mln6JGCccvqZCgM3qUkFWZ7a33b7Nl2g5lSOLX6q
+dlGOr/0jAuqdkRwCDTom3hsrH2vf1kARTSST+5cewngS2CgBTAwwc8JymEagTkKf
+VK/tTnM6G7puMVkwuafpuRggyJAUYvjktgUKOUaXtuxX71g0NagAFQGqlvGuq4UB
+DAMMzkNap8zaOwEH+wWSs5xdV1x37T11EnUvkhoOMu+uId2U7NEx2JdQ/FGJZdti
+mtqfM9GKTtQlGVcn3ISH7Wmrw3x0bsOLuW7oxkU4xIS3tVvibxaaWdmponN5TUai
+Dr4LCTEmG7+jLNopF6V4zPmpQ9YxMwQOm8ITml+auNOg9EtH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tcPLZ7QWz
+9mN94NKLmeYWjrMiRbNQk8BYXR9K17SHb4BkIMdBxRsJjgMEC8qniUH64Nnf8/x4
+yaRCuUo0bkHDE3AqCzZE1R0he66dDkfOIz+mLwcpG8jZWjFm7sXAflBe3jvIc0lm
+NyWQ1WnMkP83fWm/+YqrLLf+tTQtievRPeS1Dd/7v9yqUWEmQ0pUOj3MNf9Ej2KI
+vu5ap7fHIevcBn42BPwQgSnp4YmXEY0ir5Ccwogusnt7QliNSRmkN6Jap4AF
+=AVJ4
+-----END PGP MESSAGE-----
+
+--nextPart4793536.cjk9hKXLQ5--
+
diff --git a/tests/data/openpgp-encrypted-attachment.plain b/tests/data/openpgp-encrypted-attachment.plain
new file mode 100644
index 0000000..db48412
--- /dev/null
+++ b/tests/data/openpgp-encrypted-attachment.plain
@@ -0,0 +1 @@
+test text
diff --git a/tests/t-parser.cpp b/tests/t-parser.cpp
index 5befee3..f8ddf44 100644
--- a/tests/t-parser.cpp
+++ b/tests/t-parser.cpp
@@ -61,6 +61,13 @@ struct
NULL,
0,
"us-ascii"},
+ { DATADIR "/openpgp-encrypted-attachment.mbox",
+ MSGTYPE_GPGOL_MULTIPART_SIGNED,
+ DATADIR "/openpgp-encrypted-attachment.plain",
+ NULL,
+ NULL,
+ 1,
+ "us-ascii"},
{ NULL, MSGTYPE_UNKNOWN, NULL, NULL, NULL, 0, NULL }
};
-----------------------------------------------------------------------
Summary of changes:
src/mimedataprovider.cpp | 16 +-------
tests/data/openpgp-encrypted-attachment.mbox | 57 +++++++++++++++++++++++++++
tests/data/openpgp-encrypted-attachment.plain | 1 +
tests/data/smime-opaque-sign.mbox | 25 ++++++++++++
tests/data/smime-opaque-sign.plain | 1 +
tests/t-parser.cpp | 14 +++++++
6 files changed, 100 insertions(+), 14 deletions(-)
create mode 100644 tests/data/openpgp-encrypted-attachment.mbox
create mode 100644 tests/data/openpgp-encrypted-attachment.plain
create mode 100644 tests/data/smime-opaque-sign.mbox
create mode 100644 tests/data/smime-opaque-sign.plain
hooks/post-receive
--
GnuPG extension for MS Outlook
http://git.gnupg.org
More information about the Gnupg-commits
mailing list