summaryrefslogtreecommitdiffstats
path: root/src/methods/cipher_test/cipher_test.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-11-29 23:18:21 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-11-30 00:42:35 +0100
commit1111dc8e5e9e78254c1a7a891d961713e1be9db0 (patch)
tree3490dad7d1c43d32a9c5d362d6f03bb17cb5408a /src/methods/cipher_test/cipher_test.c
parenta09d04a02231964fa5a8f0113e9909cfb140fe4e (diff)
downloadfastd-1111dc8e5e9e78254c1a7a891d961713e1be9db0.tar
fastd-1111dc8e5e9e78254c1a7a891d961713e1be9db0.zip
Remove cipher and MAC contexts
Not a single implementation was using them...
Diffstat (limited to 'src/methods/cipher_test/cipher_test.c')
-rw-r--r--src/methods/cipher_test/cipher_test.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/methods/cipher_test/cipher_test.c b/src/methods/cipher_test/cipher_test.c
index 573e90a..067835e 100644
--- a/src/methods/cipher_test/cipher_test.c
+++ b/src/methods/cipher_test/cipher_test.c
@@ -33,12 +33,11 @@ struct fastd_method_session_state {
const fastd_cipher_info_t *cipher_info;
const fastd_cipher_t *cipher;
- const fastd_cipher_context_t *cipher_ctx;
fastd_cipher_state_t *cipher_state;
};
-static bool cipher_get(fastd_context_t *ctx, const char *name, const fastd_cipher_info_t **info, const fastd_cipher_t **cipher, const fastd_cipher_context_t **cctx) {
+static bool cipher_get(fastd_context_t *ctx, const char *name, const fastd_cipher_info_t **info, const fastd_cipher_t **cipher) {
size_t len = strlen(name);
if (len < 12)
@@ -54,7 +53,7 @@ static bool cipher_get(fastd_context_t *ctx, const char *name, const fastd_ciphe
const fastd_cipher_info_t *cipher_info = NULL;
if (ctx) {
- *cipher = fastd_cipher_get_by_name(ctx, cipher_name, &cipher_info, cctx);
+ *cipher = fastd_cipher_get_by_name(ctx, cipher_name, &cipher_info);
if (!*cipher)
return false;
}
@@ -72,12 +71,12 @@ static bool cipher_get(fastd_context_t *ctx, const char *name, const fastd_ciphe
static bool method_provides(const char *name) {
- return cipher_get(NULL, name, NULL, NULL, NULL);
+ return cipher_get(NULL, name, NULL, NULL);
}
static size_t method_key_length(fastd_context_t *ctx, const char *name) {
const fastd_cipher_info_t *info;
- if (!cipher_get(NULL, name, &info, NULL, NULL))
+ if (!cipher_get(NULL, name, &info, NULL))
exit_bug(ctx, "cipher-test: can't get cipher key length");
return info->key_length;
@@ -88,10 +87,10 @@ static fastd_method_session_state_t* method_session_init(fastd_context_t *ctx, c
fastd_method_common_init(ctx, &session->common, initiator);
- if (!cipher_get(ctx, name, &session->cipher_info, &session->cipher, &session->cipher_ctx))
+ if (!cipher_get(ctx, name, &session->cipher_info, &session->cipher))
exit_bug(ctx, "cipher-test: can't instanciate cipher");
- session->cipher_state = session->cipher->init_state(ctx, session->cipher_ctx, secret);
+ session->cipher_state = session->cipher->init(ctx, secret);
pr_warn(ctx, "using cipher-test method; this method must be used for testing and benchmarks only");
@@ -116,7 +115,7 @@ static void method_session_superseded(fastd_context_t *ctx, fastd_method_session
static void method_session_free(fastd_context_t *ctx, fastd_method_session_state_t *session) {
if (session) {
- session->cipher->free_state(ctx, session->cipher_state);
+ session->cipher->free(ctx, session->cipher_state);
free(session);
}
}