diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-05-05 10:39:32 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-05-06 17:21:01 +0200 |
commit | 01594e68275a09c67b5ee258e2af86598118a6a0 (patch) | |
tree | 4f859815f6455906bb656f9cc27ba5d6e4111599 /framework/src/domain/mime/mimetreeparser/messagepart.h | |
parent | 481cb9f600caf3f45596bf78b5ba2bd07007969c (diff) | |
download | kube-01594e68275a09c67b5ee258e2af86598118a6a0.tar.gz kube-01594e68275a09c67b5ee258e2af86598118a6a0.zip |
Port to gpgme only.
QGpgme and Gpgmepp are not readily available, the cmake files buggy, the
buildsystem horrendous and generally just difficult to build on windows.
Given that all they are is a wrapper around gpgme, we're better of
without all the indirections.
What we loose is:
* QGpgme moved the work to separate threads (but we then blocked
anyways), something that we can just do in our own code should we want to.
* QGpgme has a function to prettify dn's that was used to show the
signer. Also something we could bring back should we need to (don't know
where it is useful atm.)
Ported messagepart to gpgme
Almost there
Moved the crypto bits to a separate file
All gpg code is in one place.
All tests passing
Use error codes
Cleanup
Diffstat (limited to 'framework/src/domain/mime/mimetreeparser/messagepart.h')
-rw-r--r-- | framework/src/domain/mime/mimetreeparser/messagepart.h | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/framework/src/domain/mime/mimetreeparser/messagepart.h b/framework/src/domain/mime/mimetreeparser/messagepart.h index 3c07ca88..c576699e 100644 --- a/framework/src/domain/mime/mimetreeparser/messagepart.h +++ b/framework/src/domain/mime/mimetreeparser/messagepart.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "util.h" | 23 | #include "util.h" |
24 | #include "enums.h" | 24 | #include "enums.h" |
25 | #include "partmetadata.h" | 25 | #include "partmetadata.h" |
26 | #include <crypto.h> | ||
26 | 27 | ||
27 | #include <KMime/Message> | 28 | #include <KMime/Message> |
28 | 29 | ||
@@ -32,13 +33,6 @@ | |||
32 | class QTextCodec; | 33 | class QTextCodec; |
33 | class PartPrivate; | 34 | class PartPrivate; |
34 | 35 | ||
35 | namespace GpgME | ||
36 | { | ||
37 | class ImportResult; | ||
38 | class VerificationResult; | ||
39 | class Signature; | ||
40 | } | ||
41 | |||
42 | namespace KMime | 36 | namespace KMime |
43 | { | 37 | { |
44 | class Content; | 38 | class Content; |
@@ -55,11 +49,10 @@ class MultiPartAlternativeBodyPartFormatter; | |||
55 | class SignedMessagePart; | 49 | class SignedMessagePart; |
56 | class EncryptedMessagePart; | 50 | class EncryptedMessagePart; |
57 | 51 | ||
58 | enum CryptoProtocol { | 52 | using Crypto::CryptoProtocol; |
59 | UnknownProtocol, | 53 | using Crypto::CryptoProtocol::CMS; |
60 | OpenPGP, | 54 | using Crypto::CryptoProtocol::OpenPGP; |
61 | CMS | 55 | using Crypto::CryptoProtocol::UnknownProtocol; |
62 | }; | ||
63 | 56 | ||
64 | class MessagePart : public QObject | 57 | class MessagePart : public QObject |
65 | { | 58 | { |
@@ -366,8 +359,8 @@ public: | |||
366 | QString htmlContent() const Q_DECL_OVERRIDE; | 359 | QString htmlContent() const Q_DECL_OVERRIDE; |
367 | 360 | ||
368 | private: | 361 | private: |
369 | void sigStatusToMetaData(const GpgME::Signature &signature); | 362 | void sigStatusToMetaData(const Crypto::Signature &signature); |
370 | void setVerificationResult(const GpgME::VerificationResult &result, bool parseText, const QByteArray &plainText); | 363 | void setVerificationResult(const Crypto::VerificationResult &result, bool parseText, const QByteArray &plainText); |
371 | 364 | ||
372 | protected: | 365 | protected: |
373 | CryptoProtocol mProtocol; | 366 | CryptoProtocol mProtocol; |