Commit 6afabe16 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Store DKIMCheckSignatureJob::DKIMCheckSignatureAuthenticationResult

parent e3140a42
...@@ -83,8 +83,9 @@ void DKIMCheckFullJob::checkAuthenticationResults() ...@@ -83,8 +83,9 @@ void DKIMCheckFullJob::checkAuthenticationResults()
} }
} }
void DKIMCheckFullJob::checkSignature() void DKIMCheckFullJob::checkSignature(const QVector<DKIMCheckSignatureJob::DKIMCheckSignatureAuthenticationResult> &lst)
{ {
//TODO store lst;
DKIMCheckSignatureJob *job = new DKIMCheckSignatureJob(this); DKIMCheckSignatureJob *job = new DKIMCheckSignatureJob(this);
connect(job, &DKIMCheckSignatureJob::storeKey, this, &DKIMCheckFullJob::storeKey); connect(job, &DKIMCheckSignatureJob::storeKey, this, &DKIMCheckFullJob::storeKey);
connect(job, &DKIMCheckSignatureJob::result, this, &DKIMCheckFullJob::slotCheckSignatureResult); connect(job, &DKIMCheckSignatureJob::result, this, &DKIMCheckFullJob::slotCheckSignatureResult);
...@@ -150,7 +151,7 @@ void DKIMCheckFullJob::slotCheckAuthenticationStatusResult(const MessageViewer:: ...@@ -150,7 +151,7 @@ void DKIMCheckFullJob::slotCheckAuthenticationStatusResult(const MessageViewer::
if (mCheckPolicy.useOnlyAuthenticationResults()) { if (mCheckPolicy.useOnlyAuthenticationResults()) {
//Don't check signature if not necessary. //Don't check signature if not necessary.
} }
checkSignature(); checkSignature(lst);
} }
void DKIMCheckFullJob::storeResult(const DKIMCheckSignatureJob::CheckSignatureResult &checkResult) void DKIMCheckFullJob::storeResult(const DKIMCheckSignatureJob::CheckSignatureResult &checkResult)
......
...@@ -47,7 +47,7 @@ private: ...@@ -47,7 +47,7 @@ private:
void slotCheckSignatureResult(const DKIMCheckSignatureJob::CheckSignatureResult &checkResult); void slotCheckSignatureResult(const DKIMCheckSignatureJob::CheckSignatureResult &checkResult);
void slotCheckAuthenticationStatusResult(const MessageViewer::DKIMAuthenticationStatusInfo &info); void slotCheckAuthenticationStatusResult(const MessageViewer::DKIMAuthenticationStatusInfo &info);
void checkFullInfo(const Akonadi::Item &item); void checkFullInfo(const Akonadi::Item &item);
void checkSignature(); void checkSignature(const QVector<DKIMCheckSignatureJob::DKIMCheckSignatureAuthenticationResult> &lst = {});
void checkDKim(const KMime::Message::Ptr &message); void checkDKim(const KMime::Message::Ptr &message);
void storeKey(const QString &key, const QString &domain, const QString &selector); void storeKey(const QString &key, const QString &domain, const QString &selector);
void storeInKeyManager(const QString &key, const QString &domain, const QString &selector, bool verify); void storeInKeyManager(const QString &key, const QString &domain, const QString &selector, bool verify);
......
...@@ -52,6 +52,7 @@ MessageViewer::DKIMCheckSignatureJob::CheckSignatureResult DKIMCheckSignatureJob ...@@ -52,6 +52,7 @@ MessageViewer::DKIMCheckSignatureJob::CheckSignatureResult DKIMCheckSignatureJob
result.sdid = mDkimInfo.domain(); result.sdid = mDkimInfo.domain();
result.auid = mDkimInfo.agentOrUserIdentifier(); result.auid = mDkimInfo.agentOrUserIdentifier();
result.fromEmail = mFromEmail; result.fromEmail = mFromEmail;
//TODO result.listSignatureAuthenticationResult =
return result; return result;
} }
...@@ -700,3 +701,9 @@ bool DKIMCheckSignatureJob::DKIMCheckSignatureAuthenticationResult::operator==(c ...@@ -700,3 +701,9 @@ bool DKIMCheckSignatureJob::DKIMCheckSignatureAuthenticationResult::operator==(c
sdid == other.sdid && sdid == other.sdid &&
auid == other.auid; auid == other.auid;
} }
bool DKIMCheckSignatureJob::DKIMCheckSignatureAuthenticationResult::isValid() const
{
//TODO improve it
return (method != AuthenticationMethod::Unknown);
}
...@@ -97,6 +97,7 @@ public: ...@@ -97,6 +97,7 @@ public:
QString sdid; //Signing Domain Identifier QString sdid; //Signing Domain Identifier
QString auid; //DKIM MAY optionally provide a single responsible Agent or User Identifier (AUID). QString auid; //DKIM MAY optionally provide a single responsible Agent or User Identifier (AUID).
Q_REQUIRED_RESULT bool operator==(const DKIMCheckSignatureAuthenticationResult &other) const; Q_REQUIRED_RESULT bool operator==(const DKIMCheckSignatureAuthenticationResult &other) const;
Q_REQUIRED_RESULT bool isValid() const;
}; };
struct CheckSignatureResult { struct CheckSignatureResult {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment