summaryrefslogtreecommitdiffstats
path: root/sm/certcheck.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2006-10-05 13:06:42 +0200
committerWerner Koch <wk@gnupg.org>2006-10-05 13:06:42 +0200
commit158a69aff7b75fa3a6bd5e6990520852c602ae03 (patch)
treeac99d3084ba3aa1bf33fa245bff546a6afa85092 /sm/certcheck.c
parent* gpgrlhelp.c: readline requires stdio.h. (diff)
downloadgnupg2-158a69aff7b75fa3a6bd5e6990520852c602ae03.tar.xz
gnupg2-158a69aff7b75fa3a6bd5e6990520852c602ae03.zip
bug fixes
Diffstat (limited to '')
-rw-r--r--sm/certcheck.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sm/certcheck.c b/sm/certcheck.c
index e8b842b88..efb1414cc 100644
--- a/sm/certcheck.c
+++ b/sm/certcheck.c
@@ -68,6 +68,8 @@ do_encode_md (gcry_md_hd_t md, int algo, int pkalgo, unsigned int nbits,
nframe = (nbits+7) / 8;
asnlen = DIM(asn);
+ if (!algo || gcry_md_test_algo (algo))
+ return gpg_error (GPG_ERR_DIGEST_ALGO);
if (gcry_md_algo_info (algo, GCRYCTL_GET_ASNOID, asn, &asnlen))
{
log_error ("no object identifier for algo %d\n", algo);