diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-11-02 04:32:18 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-11-02 04:32:18 +0100 |
commit | 20ee3b5a4f110f53a73746e18fc0eb0cbbb7845c (patch) | |
tree | bbf62cb65ba716e7cefcfc41904bb3460c3ddb58 /src/fastd.c | |
parent | de66ca829d22f939900635968d1b3fd7a7d598da (diff) | |
download | fastd-20ee3b5a4f110f53a73746e18fc0eb0cbbb7845c.tar fastd-20ee3b5a4f110f53a73746e18fc0eb0cbbb7845c.zip |
Implement the first step towards a more flexible way to support crypto methods
Diffstat (limited to 'src/fastd.c')
-rw-r--r-- | src/fastd.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/fastd.c b/src/fastd.c index ea197d3..534a30e 100644 --- a/src/fastd.c +++ b/src/fastd.c @@ -145,12 +145,8 @@ static void close_log(fastd_context_t *ctx) { closelog(); } -static void crypto_init(fastd_context_t *ctx UNUSED) { -#ifdef USE_CRYPTO_AES128CTR - ctx->crypto_aes128ctr = ctx->conf->crypto_aes128ctr->init(ctx); - if (!ctx->crypto_aes128ctr) - exit_error(ctx, "Unable to initialize AES128-CTR implementation"); -#endif +static void crypto_init(fastd_context_t *ctx) { + fastd_cipher_init(ctx); #ifdef USE_CRYPTO_GHASH ctx->crypto_ghash = ctx->conf->crypto_ghash->init(ctx); @@ -160,15 +156,12 @@ static void crypto_init(fastd_context_t *ctx UNUSED) { } static void crypto_free(fastd_context_t *ctx UNUSED) { -#ifdef USE_CRYPTO_AES128CTR - ctx->conf->crypto_aes128ctr->free(ctx, ctx->crypto_aes128ctr); - ctx->crypto_aes128ctr = NULL; -#endif - #ifdef USE_CRYPTO_GHASH ctx->conf->crypto_ghash->free(ctx, ctx->crypto_ghash); ctx->crypto_ghash = NULL; #endif + + fastd_cipher_free(ctx); } |