Commit 72b9397d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add more option

(cherry picked from commit 3958c7b3)
parent 5cf93ba8
......@@ -40,6 +40,7 @@ void DKIMCheckPolicyTest::shouldHaveDefaultValues()
QVERIFY(!pol.useDefaultRules());
QCOMPARE(pol.rsaSha1Policy(), 1);
QVERIFY(!pol.useRelaxedParsing());
QVERIFY(!pol.useOnlyAuthenticationResults());
}
void DKIMCheckPolicyTest::shouldAssignValues()
......@@ -63,6 +64,8 @@ void DKIMCheckPolicyTest::shouldAssignValues()
pol.setUseDefaultRules(mUseDefaultRules);
bool mRelaxedParsing = true;
pol.setUseRelaxedParsing(mRelaxedParsing);
bool mUseOnlyAuthenticationResults = true;
pol.setUseOnlyAuthenticationResults(mUseOnlyAuthenticationResults);
QCOMPARE(pol.verifySignatureWhenOnlyTest(), mVerifySignatureWhenOnlyTest);
QCOMPARE(pol.saveDkimResult(), mSaveDkimResult);
......@@ -73,4 +76,5 @@ void DKIMCheckPolicyTest::shouldAssignValues()
QCOMPARE(pol.useDefaultRules(), mUseDefaultRules);
QCOMPARE(pol.rsaSha1Policy(), mRsaSha1Policy);
QCOMPARE(pol.useRelaxedParsing(), mRelaxedParsing);
QCOMPARE(pol.useOnlyAuthenticationResults(), mUseOnlyAuthenticationResults);
}
......@@ -57,9 +57,9 @@ QVector<DKIMCheckSignatureJob::CheckSignatureResult> DKIMAuthenticationStatusInf
QString sdid;
QString auid;
for (const DKIMAuthenticationStatusInfo::AuthStatusInfo::Property &prop : info.header) {
if (prop.type == QLatin1String("d")) {
if (prop.type == QLatin1Char('d')) {
sdid = prop.value;
} else if (prop.type == QLatin1String("i")) {
} else if (prop.type == QLatin1Char('i')) {
auid = prop.value;
}
}
......
......@@ -33,6 +33,7 @@ DKIMCheckPolicy::DKIMCheckPolicy()
mUseDefaultRules = MessageViewer::MessageViewerSettings::useDefaultRules();
mUseAuthenticationResults = MessageViewer::MessageViewerSettings::useAuthenticationResults();
mUseRelaxedParsing = MessageViewer::MessageViewerSettings::useRelaxedParsingAuthenticationResults();
mUseOnlyAuthenticationResults = MessageViewer::MessageViewerSettings::useOnlyAuthenticationResults();
}
int DKIMCheckPolicy::rsaSha1Policy() const
......@@ -134,3 +135,13 @@ void DKIMCheckPolicy::setUseRelaxedParsing(bool useRelaxedParsing)
{
mUseRelaxedParsing = useRelaxedParsing;
}
bool DKIMCheckPolicy::useOnlyAuthenticationResults() const
{
return mUseOnlyAuthenticationResults;
}
void DKIMCheckPolicy::setUseOnlyAuthenticationResults(bool useOnlyAuthenticationResults)
{
mUseOnlyAuthenticationResults = useOnlyAuthenticationResults;
}
......@@ -63,6 +63,9 @@ public:
Q_REQUIRED_RESULT bool useRelaxedParsing() const;
void setUseRelaxedParsing(bool useRelaxedParsing);
Q_REQUIRED_RESULT bool useOnlyAuthenticationResults() const;
void setUseOnlyAuthenticationResults(bool useOnlyAuthenticationResults);
private:
int mRsaSha1Policy = -1;
bool mVerifySignatureWhenOnlyTest = false;
......@@ -74,6 +77,7 @@ private:
bool mUseDefaultRules = false;
bool mUseAuthenticationResults = false;
bool mUseRelaxedParsing = false;
bool mUseOnlyAuthenticationResults = false;
};
}
......
......@@ -279,6 +279,9 @@ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/sta
<entry name="UseRelaxedParsingAuthenticationResults" type="bool">
<default>false</default>
</entry>
<entry name="UseOnlyAuthenticationResults" type="bool">
<default>false</default>
</entry>
<entry name="PolicyRsaSha1" type="Enum">
<choices>
......
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