mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
Signing using Netkey 3 cards does now work.
This commit is contained in:
parent
6e63e54b00
commit
990585ad7d
14 changed files with 153 additions and 49 deletions
|
@ -1,5 +1,9 @@
|
|||
2009-03-26 Werner Koch <wk@g10code.com>
|
||||
|
||||
* 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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue