gcrypt blowfish supports 128 bit key size only
authorMartin Willi <martin@strongswan.org>
Thu, 11 Jun 2009 09:05:00 +0000 (11:05 +0200)
committerMartin Willi <martin@strongswan.org>
Thu, 11 Jun 2009 12:13:17 +0000 (14:13 +0200)
src/libstrongswan/plugins/gcrypt/gcrypt_crypter.c

index 4d68f1b..3bf513f 100644 (file)
@@ -149,6 +149,10 @@ gcrypt_crypter_t *gcrypt_crypter_create(encryption_algorithm_t algo,
                        gcrypt_alg = GCRY_CIPHER_CAST5;
                        break;
                case ENCR_BLOWFISH:
+                       if (key_size != 16)
+                       {       /* gcrypt currently supports 128 bit blowfish only */
+                               return NULL;
+                       }
                        gcrypt_alg = GCRY_CIPHER_BLOWFISH;
                        break;
                /* case ENCR_AES_CTR: