diff options
Diffstat (limited to 'cipher')
-rw-r--r-- | cipher/ChangeLog | 7 | ||||
-rw-r--r-- | cipher/cipher.c | 28 | ||||
-rw-r--r-- | cipher/rijndael.c | 6 |
3 files changed, 31 insertions, 10 deletions
diff --git a/cipher/ChangeLog b/cipher/ChangeLog index 27c64b621..e2ff61f30 100644 --- a/cipher/ChangeLog +++ b/cipher/ChangeLog @@ -1,3 +1,10 @@ +2002-04-06 Werner Koch <[email protected]> + + * rijndael.c (rijndael_get_info): We do only support a 128 bit + blocksize so it makes sense to change the algorithm strings to + AES. + * cipher.c (string_to_cipher_algo): Map "RIJNDAEL" to "AES". + 2002-02-14 Werner Koch <[email protected]> * random.c (mix_pool): Removed the failsafe stuff again. It makes diff --git a/cipher/cipher.c b/cipher/cipher.c index 0d9ebaf01..d2b4032f2 100644 --- a/cipher/cipher.c +++ b/cipher/cipher.c @@ -253,15 +253,29 @@ load_cipher_modules(void) int string_to_cipher_algo( const char *string ) { - int i; - const char *s; + int i; + const char *s; + + /* kludge to alias RIJNDAEL to AES */ + if ( *string == 'R' || *string == 'r') + { + if (!ascii_strcasecmp (string, "RIJNDAEL")) + string = "AES"; + else if (!ascii_strcasecmp (string, "RIJNDAEL192")) + string = "AES192"; + else if (!ascii_strcasecmp (string, "RIJNDAEL256")) + string = "AES256"; + } - do { - for(i=0; (s=cipher_table[i].name); i++ ) - if( !ascii_strcasecmp( s, string ) ) - return cipher_table[i].algo; + do + { + for(i=0; (s=cipher_table[i].name); i++ ) + { + if( !ascii_strcasecmp( s, string ) ) + return cipher_table[i].algo; + } } while( load_cipher_modules() ); - return 0; + return 0; } /**************** diff --git a/cipher/rijndael.c b/cipher/rijndael.c index 50079cb75..cd29beaad 100644 --- a/cipher/rijndael.c +++ b/cipher/rijndael.c @@ -2151,11 +2151,11 @@ rijndael_get_info (int algo, size_t *keylen, = rijndael_decrypt; if( algo == 7 ) - return "RIJNDAEL"; + return "AES"; if (algo == 8) - return "RIJNDAEL192"; + return "AES192"; if (algo == 9) - return "RIJNDAEL256"; + return "AES256"; return NULL; } |