Verified Commit 066c6e4c authored by Andre Heinecke's avatar Andre Heinecke
Browse files

Fix signature guessing

If called with a data file for which a signature exists next
to it, try to verify the data file using that signature.

This worked before but did not survive the change to the
AutoDecryptVerifyFilesController.

GnuPG-Bug-Id: T3658
parent 366f9aea
......@@ -352,16 +352,26 @@ std::vector< std::shared_ptr<Task> > AutoDecryptVerifyFilesController::Private::
if (!mayBeAnyMessageType(cFile.classification)) {
// Not a Message? Maybe there is a signature for this file?
const auto signatures = findSignatures(cFile.fileName);
bool foundSig = false;
if (!signatures.empty()) {
for (const QString &sig : signatures) {
qCDebug(KLEOPATRA_LOG) << "Guessing: " << sig << " is a signature for: " << cFile.fileName;
const auto classification = classify(sig);
qCDebug(KLEOPATRA_LOG) << "Guessing: " << sig << " is a signature for: " << cFile.fileName
<< "Classification: " << classification;
const auto proto = findProtocol(classification);
if (proto == GpgME::UnknownProtocol) {
qCDebug(KLEOPATRA_LOG) << "Could not determine protocol. Skipping guess.";
continue;
}
foundSig = true;
std::shared_ptr<VerifyDetachedTask> t(new VerifyDetachedTask);
t->setInput(Input::createFromFile(sig));
t->setSignedData(Input::createFromFile(cFile.fileName));
t->setProtocol(cFile.protocol);
t->setProtocol(findProtocol(classification));
tasks.push_back(t);
}
} else {
}
if (!foundSig) {
undetected << cFile.fileName;
qCDebug(KLEOPATRA_LOG) << "Failed detection for: " << cFile.fileName << " adding to undetected.";
}
......
Supports Markdown
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