summaryrefslogtreecommitdiffstats
path: root/src/daemon
diff options
context:
space:
mode:
authorMiroslav Lichvar <mlichvar@redhat.com>2011-04-18 18:19:36 +0200
committerMiroslav Lichvar <mlichvar@redhat.com>2011-04-19 12:42:58 +0200
commit759cf65b3f1927e08383c962faf2f7ff0613168d (patch)
tree2119d9babe27d371af578b22902627a156e4b860 /src/daemon
parent60077789ea177de931ab5d68418678e258459398 (diff)
downloadabrt-759cf65b3f1927e08383c962faf2f7ff0613168d.zip
abrt-759cf65b3f1927e08383c962faf2f7ff0613168d.tar.gz
abrt-759cf65b3f1927e08383c962faf2f7ff0613168d.tar.xz
Fix rpm signature check (trac#198)
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/abrt-action-save-package-data.c2
-rw-r--r--src/daemon/rpm.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/daemon/abrt-action-save-package-data.c b/src/daemon/abrt-action-save-package-data.c
index e58b425..7249551 100644
--- a/src/daemon/abrt-action-save-package-data.c
+++ b/src/daemon/abrt-action-save-package-data.c
@@ -198,7 +198,7 @@ static int SavePackageDescriptionToDebugDump(const char *dump_dir_name)
if (g_settings_bOpenGPGCheck && !remote)
{
- if (rpm_chk_fingerprint(package_short_name))
+ if (!rpm_chk_fingerprint(package_short_name))
{
log("Package '%s' isn't signed with proper key", package_short_name);
goto ret; /* return 1 (failure) */
diff --git a/src/daemon/rpm.c b/src/daemon/rpm.c
index 1295211..97b71e5 100644
--- a/src/daemon/rpm.c
+++ b/src/daemon/rpm.c
@@ -107,7 +107,7 @@ int rpm_chk_fingerprint(const char* pkg)
if (!header)
goto error;
- pgpsig = headerFormat(header, "%{SIGGPG:pgpsig}", &errmsg);
+ pgpsig = headerFormat(header, "%|SIGGPG?{%{SIGGPG:pgpsig}}:{%{SIGPGP:pgpsig}}|", &errmsg);
if (!pgpsig && errmsg)
{
VERB1 log("cannot get siggpg:pgpsig. reason: %s", errmsg);
@@ -119,7 +119,7 @@ int rpm_chk_fingerprint(const char* pkg)
if (pgpsig_tmp)
{
pgpsig_tmp += sizeof(" Key ID ") - 1;
- ret = (g_list_find(list_fingerprints, pgpsig_tmp) != NULL);
+ ret = g_list_find_custom(list_fingerprints, pgpsig_tmp, (GCompareFunc)g_strcmp0) != NULL;
}
}