diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2011-11-08 14:08:40 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2011-11-08 14:08:40 +0200 |
commit | 8b524080c6b5311e885b673d9430d31789671451 (patch) | |
tree | 7c028770ac766bf5d5112ce487cfc8bedb601cb6 /rpmio | |
parent | 1c8e56729df08d577930160af5192a8c8c8c60e5 (diff) | |
download | rpm-8b524080c6b5311e885b673d9430d31789671451.tar.gz rpm-8b524080c6b5311e885b673d9430d31789671451.tar.bz2 rpm-8b524080c6b5311e885b673d9430d31789671451.zip |
Tolerate NULL key in pgpVerifySignature()
Diffstat (limited to 'rpmio')
-rw-r--r-- | rpmio/rpmpgp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c index d4cbd279f..43e6c5dc2 100644 --- a/rpmio/rpmpgp.c +++ b/rpmio/rpmpgp.c @@ -1018,9 +1018,7 @@ rpmRC pgpVerifySignature(pgpDigParams key, pgpDigParams sig, DIGEST_CTX hashctx) * If we have a key, verify the signature for real. Otherwise we've * done all we can, return NOKEY to indicate "looks okay but dunno." */ - if (key->alg == NULL) { - res = RPMRC_NOKEY; - } else { + if (key && key->alg) { pgpDigAlg sa = sig->alg; pgpDigAlg ka = key->alg; if (sa && sa->verify) { @@ -1028,6 +1026,8 @@ rpmRC pgpVerifySignature(pgpDigParams key, pgpDigParams sig, DIGEST_CTX hashctx) res = RPMRC_OK; } } + } else { + res = RPMRC_NOKEY; } exit: |