aboutsummaryrefslogtreecommitdiffstats
path: root/g10/seskey.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/seskey.c')
-rw-r--r--g10/seskey.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/g10/seskey.c b/g10/seskey.c
index 2ef00869f..c0efc3ae7 100644
--- a/g10/seskey.c
+++ b/g10/seskey.c
@@ -267,7 +267,9 @@ encode_md_value (PKT_public_key *pk, PKT_secret_key *sk,
byte *asn;
size_t asnlen;
- rc = gcry_md_algo_info (hash_algo, GCRYCTL_GET_ASNOID, NULL, &asnlen);
+ rc = gcry_md_test_algo (hash_algo);
+ if (!rc)
+ rc = gcry_md_algo_info (hash_algo, GCRYCTL_GET_ASNOID, NULL, &asnlen);
if (rc)
log_fatal ("can't get OID of algo %d: %s\n",
hash_algo, gpg_strerror (rc));