1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +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:
David Shaw 2002-11-02 21:39:37 +00:00
parent bdf0e306df
commit d6693c144c
3 changed files with 33 additions and 8 deletions

View file

@ -211,12 +211,6 @@ load_cipher_modules(void)
return 0;
}
/****************
* Map a string to the cipher algo
*/
@ -245,6 +239,20 @@ string_to_cipher_algo( const char *string )
return cipher_table[i].algo;
}
} while( load_cipher_modules() );
/* Didn't find it, so try the Sx format */
if(string[0]=='S' || string[0]=='s')
{
long val;
char *endptr;
string++;
val=strtol(string,&endptr,10);
if(*string!='\0' && *endptr=='\0' && check_cipher_algo(val)==0)
return val;
}
return 0;
}
@ -675,4 +683,3 @@ cipher_sync( CIPHER_HANDLE c )
c->unused = 0;
}
}