summaryrefslogtreecommitdiffstats
path: root/sm
diff options
context:
space:
mode:
authorJustus Winter <justus@g10code.com>2017-05-31 12:51:56 +0200
committerJustus Winter <justus@g10code.com>2017-05-31 17:38:19 +0200
commitf9cb15b385f64f7c9403670f03632f81a874f213 (patch)
treefffb15203ed0e89722de48e2198aedff1f75c699 /sm
parentsm: Fix typo. (diff)
downloadgnupg2-f9cb15b385f64f7c9403670f03632f81a874f213.tar.xz
gnupg2-f9cb15b385f64f7c9403670f03632f81a874f213.zip
sm: Simplify code.
* sm/verify.c (gpgsm_verify): Simplify by using a newer gcrypt interface. Signed-off-by: Justus Winter <justus@g10code.com>
Diffstat (limited to 'sm')
-rw-r--r--sm/verify.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/sm/verify.c b/sm/verify.c
index 6c034e692..7bdc68b80 100644
--- a/sm/verify.c
+++ b/sm/verify.c
@@ -341,16 +341,11 @@ gpgsm_verify (ctrl_t ctrl, int in_fd, int data_fd, estream_t out_fp)
&msgdigest, &msgdigestlen);
if (!rc)
{
- size_t is_enabled;
-
algoid = ksba_cms_get_digest_algo (cms, signer);
algo = gcry_md_map_name (algoid);
if (DBG_X509)
log_debug ("signer %d - digest algo: %d\n", signer, algo);
- is_enabled = sizeof algo;
- if ( gcry_md_info (data_md, GCRYCTL_IS_ALGO_ENABLED,
- &algo, &is_enabled)
- || !is_enabled)
+ if (! gcry_md_is_enabled (data_md, algo))
{
log_error ("digest algo %d (%s) has not been enabled\n",
algo, algoid?algoid:"");