aboutsummaryrefslogtreecommitdiffstats
path: root/cipher/md.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2002-11-02 21:39:37 +0000
committerDavid Shaw <[email protected]>2002-11-02 21:39:37 +0000
commitd6693c144c19e0f29114d7e121c549a6e2079798 (patch)
treeaf3e124b449ceeb83e576a6393c7b4c1d1297a4c /cipher/md.c
parent* g10.c (main): Add --no-throw-keyid. (diff)
downloadgnupg-d6693c144c19e0f29114d7e121c549a6e2079798.tar.gz
gnupg-d6693c144c19e0f29114d7e121c549a6e2079798.zip
* cipher.c (string_to_cipher_algo), md.c (string_to_digest_algo): Allow
the Sxxx and Hxxx format for cipher and digest names.
Diffstat (limited to 'cipher/md.c')
-rw-r--r--cipher/md.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/cipher/md.c b/cipher/md.c
index d0811e254..098c83be6 100644
--- a/cipher/md.c
+++ b/cipher/md.c
@@ -120,10 +120,23 @@ string_to_digest_algo( const char *string )
if( !ascii_strcasecmp( r->name, string ) )
return r->algo;
} while( !r && load_digest_module () );
+
+ /* Didn't find it, so try the Hx format */
+ if(string[0]=='H' || string[0]=='h')
+ {
+ long val;
+ char *endptr;
+
+ string++;
+
+ val=strtol(string,&endptr,10);
+ if(*string!='\0' && *endptr=='\0' && check_digest_algo(val)==0)
+ return val;
+ }
+
return 0;
}
-
/****************
* Map a digest algo to a string
*/