]> git.ipfire.org Git - people/ms/strongswan.git/commitdiff
botan: Support of AES-CFB encryption
authorAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 6 Dec 2021 12:28:31 +0000 (13:28 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 6 Dec 2021 12:28:31 +0000 (13:28 +0100)
src/libstrongswan/plugins/botan/botan_crypter.c
src/libstrongswan/plugins/botan/botan_plugin.c

index 3ec5c4d5e4182cf4cbefd738cc08b9a184c9c852..d3ccb4bb9b03dc9d4974c26115835320095ecc8a 100644 (file)
@@ -185,6 +185,26 @@ botan_crypter_t *botan_crypter_create(encryption_algorithm_t algo,
                                        return NULL;
                        }
                        break;
+               case ENCR_AES_CFB:
+                       switch (key_size)
+                       {
+                               case 16:
+                                       /* AES 128 */
+                                       this->cipher_name = "AES-128/CFB";
+                                       break;
+                               case 24:
+                                       /* AES-192 */
+                                       this->cipher_name = "AES-192/CFB";
+                                       break;
+                               case 32:
+                                       /* AES-256 */
+                                       this->cipher_name = "AES-256/CFB";
+                                       break;
+                               default:
+                                       free(this);
+                                       return NULL;
+                       }
+                       break;
                default:
                        free(this);
                        return NULL;
index 205a274f4bd37c1909d9dba56292f9ec576fa1d4..41ad101ab9abedff8b88204c1c6954263adfd860 100644 (file)
@@ -112,6 +112,11 @@ METHOD(plugin_t, get_features, int,
                        PLUGIN_PROVIDE(CRYPTER, ENCR_AES_CBC, 24),
                        PLUGIN_PROVIDE(CRYPTER, ENCR_AES_CBC, 32),
        #endif
+       #ifdef BOTAN_HAS_MODE_CFB
+                       PLUGIN_PROVIDE(CRYPTER, ENCR_AES_CFB, 16),
+                       PLUGIN_PROVIDE(CRYPTER, ENCR_AES_CFB, 24),
+                       PLUGIN_PROVIDE(CRYPTER, ENCR_AES_CFB, 32),
+       #endif
 #endif
 #endif