Register some less common AF_ALG ciphers (cast5, serpent, twofish, blowfish)
authorMartin Willi <martin@revosec.ch>
Mon, 8 Nov 2010 10:58:01 +0000 (11:58 +0100)
committerMartin Willi <martin@revosec.ch>
Mon, 20 Dec 2010 08:52:02 +0000 (09:52 +0100)
src/libstrongswan/plugins/af_alg/af_alg_crypter.c
src/libstrongswan/plugins/af_alg/af_alg_plugin.c

index e7a46a7..ea80374 100644 (file)
@@ -79,6 +79,16 @@ static size_t lookup_alg(encryption_algorithm_t algo, char **name,
                {ENCR_CAMELLIA_CTR,     "rfc3686(ctr(camellia))",        1,     16,     20,      8,     },
                {ENCR_CAMELLIA_CTR,     "rfc3686(ctr(camellia))",        1,     24,     28,      8,     },
                {ENCR_CAMELLIA_CTR,     "rfc3686(ctr(camellia))",        1,     32,     36,      8,     },
+               {ENCR_CAST,                     "cbc(cast5)",                            8,     16,     16,      8,     },
+               {ENCR_BLOWFISH,         "cbc(blowfish)",                         8,     16,     16,      8,     },
+               {ENCR_BLOWFISH,         "cbc(blowfish)",                         8,     24,     24,      8,     },
+               {ENCR_BLOWFISH,         "cbc(blowfish)",                         8,     32,     32,      8,     },
+               {ENCR_SERPENT_CBC,      "cbc(serpent)",                         16,     16,     16,     16,     },
+               {ENCR_SERPENT_CBC,      "cbc(serpent)",                         16,     24,     24,     16,     },
+               {ENCR_SERPENT_CBC,      "cbc(serpent)",                         16,     32,     32,     16,     },
+               {ENCR_TWOFISH_CBC,      "cbc(twofish)",                         16,     16,     16,     16,     },
+               {ENCR_TWOFISH_CBC,      "cbc(twofish)",                         16,     24,     24,     16,     },
+               {ENCR_TWOFISH_CBC,      "cbc(twofish)",                         16,     32,     32,     16,     },
        };
        int i;
 
index 01031d7..b8bbd26 100644 (file)
@@ -134,6 +134,14 @@ plugin_t *af_alg_plugin_create()
                                        (crypter_constructor_t)af_alg_crypter_create);
        lib->crypto->add_crypter(lib->crypto, ENCR_CAMELLIA_CTR,
                                        (crypter_constructor_t)af_alg_crypter_create);
+       lib->crypto->add_crypter(lib->crypto, ENCR_CAST,
+                                       (crypter_constructor_t)af_alg_crypter_create);
+       lib->crypto->add_crypter(lib->crypto, ENCR_BLOWFISH,
+                                       (crypter_constructor_t)af_alg_crypter_create);
+       lib->crypto->add_crypter(lib->crypto, ENCR_SERPENT_CBC,
+                                       (crypter_constructor_t)af_alg_crypter_create);
+       lib->crypto->add_crypter(lib->crypto, ENCR_TWOFISH_CBC,
+                                       (crypter_constructor_t)af_alg_crypter_create);
 
        return &this->public.plugin;
 }