Commit ac296d4e authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

USe new settings

parent 6a62e453
......@@ -487,11 +487,20 @@ void DKIMCheckSignatureJob::verifyRSASignature()
//qDebug() << "publicKey.exponent" << rsaPublicKey.e().toString();
if (rsaPublicKey.e().toString().toLong() * 4 < 1024) {
mError = MessageViewer::DKIMCheckSignatureJob::DKIMError::PublicKeyTooSmall;
mStatus = MessageViewer::DKIMCheckSignatureJob::DKIMStatus::Invalid;
Q_EMIT result(createCheckResult());
deleteLater();
return;
const int publicRsaTooSmallPolicyValue = mPolicy.publicRsaTooSmallPolicy();
if (publicRsaTooSmallPolicyValue == MessageViewer::MessageViewerSettings::EnumPublicRsaTooSmall::Nothing) {
; //Nothing
} else if (publicRsaTooSmallPolicyValue == MessageViewer::MessageViewerSettings::EnumPublicRsaTooSmall::Warning) {
mWarning = MessageViewer::DKIMCheckSignatureJob::DKIMWarning::PublicRsaKeyTooSmall;
} else if (publicRsaTooSmallPolicyValue == MessageViewer::MessageViewerSettings::EnumPublicRsaTooSmall::Error) {
mError = MessageViewer::DKIMCheckSignatureJob::DKIMError::PublicKeyTooSmall;
mStatus = MessageViewer::DKIMCheckSignatureJob::DKIMStatus::Invalid;
Q_EMIT result(createCheckResult());
deleteLater();
return;
}
} else if (rsaPublicKey.e().toString().toLong() * 4 < 2048) {
//TODO
}
......
......@@ -77,6 +77,7 @@ public:
SignatureCreatedInFuture = 2,
SignatureTooSmall = 3,
HashAlgorithmUnsafe = 4,
PublicRsaKeyTooSmall = 5,
};
Q_ENUM(DKIMWarning)
......
......@@ -211,6 +211,9 @@ void DKIMWidgetInfo::updateToolTip()
case DKIMCheckSignatureJob::DKIMWarning::HashAlgorithmUnsafe:
tooltip += (tooltip.isEmpty() ? QChar() : QLatin1Char('\n')) + i18n("Hash Algorithm unsafe (sha1)");
break;
case DKIMCheckSignatureJob::DKIMWarning::PublicRsaKeyTooSmall:
tooltip += (tooltip.isEmpty() ? QChar() : QLatin1Char('\n')) + i18n("Public Key too small");
break;
}
for (const DKIMCheckSignatureJob::DKIMCheckSignatureAuthenticationResult &result : qAsConst(mResult.listSignatureAuthenticationResult)) {
......
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