mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-14 21:47:19 +02:00
* cipher.c (string_to_cipher_algo), md.c (string_to_digest_algo): Allow
the Sxxx and Hxxx format for cipher and digest names.
This commit is contained in:
parent
bdf0e306df
commit
d6693c144c
3 changed files with 33 additions and 8 deletions
15
cipher/md.c
15
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
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue