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

USe new settings

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