diff options
Diffstat (limited to 'sm')
-rw-r--r-- | sm/ChangeLog | 4 | ||||
-rw-r--r-- | sm/certcheck.c | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/sm/ChangeLog b/sm/ChangeLog index dd469ae16..1a4157717 100644 --- a/sm/ChangeLog +++ b/sm/ChangeLog @@ -1,3 +1,7 @@ +2006-10-05 Werner Koch <[email protected]> + + * certcheck.c (do_encode_md): Check that the has algo is valid. + 2006-10-02 Marcus Brinkmann <[email protected]> * server.c (register_commands): New commands DUMPKEYS and 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); |