aboutsummaryrefslogtreecommitdiffstats
path: root/agent
diff options
context:
space:
mode:
Diffstat (limited to 'agent')
-rw-r--r--agent/ChangeLog4
-rw-r--r--agent/agent.h2
-rw-r--r--agent/command.c9
3 files changed, 13 insertions, 2 deletions
diff --git a/agent/ChangeLog b/agent/ChangeLog
index e91731d5f..c55199135 100644
--- a/agent/ChangeLog
+++ b/agent/ChangeLog
@@ -1,5 +1,9 @@
2009-03-26 Werner Koch <[email protected]>
+ * agent.h (MAX_DIGEST_LEN): Change to 64.
+ * command.c (cmd_sethash): Allow digest length of 48 and 64.
+ (cmd_sethash): Allow more hash algos.
+
* trustlist.c (reformat_name): New.
(agent_marktrusted): Use a reformatted name. Reload the table
before the update and always reload it at the end.
diff --git a/agent/agent.h b/agent/agent.h
index 48b199be0..ba31d9396 100644
--- a/agent/agent.h
+++ b/agent/agent.h
@@ -42,7 +42,7 @@
#define MD_USER_TLS_MD5SHA1 (GCRY_MODULE_ID_USER+1)
/* Maximum length of a digest. */
-#define MAX_DIGEST_LEN 36
+#define MAX_DIGEST_LEN 64
/* A large struct name "opt" to keep global flags */
struct
diff --git a/agent/command.c b/agent/command.c
index b31e40553..56d390bd8 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -637,8 +637,14 @@ cmd_sethash (assuan_context_t ctx, char *line)
{
if (has_option (line, "--hash=sha1"))
algo = GCRY_MD_SHA1;
+ else if (has_option (line, "--hash=sha224"))
+ algo = GCRY_MD_SHA224;
else if (has_option (line, "--hash=sha256"))
algo = GCRY_MD_SHA256;
+ else if (has_option (line, "--hash=sha384"))
+ algo = GCRY_MD_SHA384;
+ else if (has_option (line, "--hash=sha512"))
+ algo = GCRY_MD_SHA512;
else if (has_option (line, "--hash=rmd160"))
algo = GCRY_MD_RMD160;
else if (has_option (line, "--hash=md5"))
@@ -671,7 +677,8 @@ cmd_sethash (assuan_context_t ctx, char *line)
n /= 2;
if (algo == MD_USER_TLS_MD5SHA1 && n == 36)
;
- else if (n != 16 && n != 20 && n != 24 && n != 32)
+ else if (n != 16 && n != 20 && n != 24
+ && n != 28 && n != 32 && n != 48 && n != 64)
return set_error (GPG_ERR_ASS_PARAMETER, "unsupported length of hash");
if (n > MAX_DIGEST_LEN)