used detached sigs; at least this way gpgme++ is giving me fingerprints on success
This commit is contained in:
parent
5f0face742
commit
7c095ebd31
@ -509,7 +509,7 @@ QString Signing::signerOf(const KUrl &package, const KUrl &signature) const
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString signaturePath = signature.isEmpty() ? packagePath + (".asc")
|
const QString signaturePath = signature.isEmpty() ? packagePath + (".sig")
|
||||||
: signature.path();
|
: signature.path();
|
||||||
|
|
||||||
if (!QFile::exists(signaturePath)) {
|
if (!QFile::exists(signaturePath)) {
|
||||||
@ -517,7 +517,7 @@ QString Signing::signerOf(const KUrl &package, const KUrl &signature) const
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
kDebug() << "Cheking if " << packagePath << " and " << signaturePath << " matches";
|
//kDebug() << "Cheking if " << packagePath << " and " << signaturePath << " matches";
|
||||||
|
|
||||||
FILE *pFile = fopen(packagePath.toLocal8Bit().data(), "r");
|
FILE *pFile = fopen(packagePath.toLocal8Bit().data(), "r");
|
||||||
if (!pFile) {
|
if (!pFile) {
|
||||||
@ -539,8 +539,15 @@ QString Signing::signerOf(const KUrl &package, const KUrl &signature) const
|
|||||||
QString rv;
|
QString rv;
|
||||||
|
|
||||||
if (!vRes.error()) {
|
if (!vRes.error()) {
|
||||||
kDebug() << "message " << packagePath << " and signature " << signaturePath << "matched! The fingerprint of the signer is: " << vRes.signature(0).fingerprint();
|
//kDebug() << "got" << vRes.signatures().size() << "signatures out" << vRes.error().asString();
|
||||||
rv = vRes.signature(0).fingerprint();
|
foreach (GpgME::Signature sig, vRes.signatures()) {
|
||||||
|
if (sig.fingerprint()) {
|
||||||
|
rv = sig.fingerprint();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//kDebug() << "message " << packagePath << " and signature " << signaturePath << "matched! The fingerprint of the signer is: " << rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(pFile);
|
fclose(pFile);
|
||||||
|
@ -119,7 +119,9 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Tests for a successful match between the object and signature files, referenced by their
|
* Tests for a successful match between the object and signature files, referenced by their
|
||||||
* absolute path. The signature path is optional and, if not specified, the function will
|
* absolute path. The signature path is optional and, if not specified, the function will
|
||||||
* automatically try to retrieve it by appending the string ".asc" to the object path.
|
* automatically try to retrieve it by appending the string ".sig" to the package path.
|
||||||
|
*
|
||||||
|
* The signature should be a "detached signature" for correct results.
|
||||||
*
|
*
|
||||||
* @arg package the full path of the package we want to test
|
* @arg package the full path of the package we want to test
|
||||||
* @arg signature optional path for the signature file
|
* @arg signature optional path for the signature file
|
||||||
|
Loading…
x
Reference in New Issue
Block a user