summaryrefslogtreecommitdiffstats
path: root/src/fastd.h
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-09-21 15:07:11 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-09-21 15:10:28 +0200
commit2acd81bd7a1b364b02831ae5f8e46457d9d07865 (patch)
tree969429177db12b56e402ad767531189b7a41834c /src/fastd.h
parent65912e3e6fce703b03eafc2b4bf11a17a02bd39e (diff)
downloadfastd-2acd81bd7a1b364b02831ae5f8e46457d9d07865.tar
fastd-2acd81bd7a1b364b02831ae5f8e46457d9d07865.zip
Nicely encapsulate different crypto algorithm implementations
Diffstat (limited to 'src/fastd.h')
-rw-r--r--src/fastd.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/fastd.h b/src/fastd.h
index 4d435a7..1ee8939 100644
--- a/src/fastd.h
+++ b/src/fastd.h
@@ -163,8 +163,13 @@ struct _fastd_config {
char *secret;
unsigned key_valid;
unsigned key_refresh;
- fastd_alg_impl alg_impl_aes128ctr;
- fastd_alg_impl alg_impl_ghash;
+
+#ifdef USE_CRYPTO_AES128CTR
+ const fastd_crypto_aes128ctr *crypto_aes128ctr;
+#endif
+#ifdef USE_CRYPTO_GHASH
+ const fastd_crypto_ghash *crypto_ghash;
+#endif
fastd_string_stack *peer_dirs;
fastd_peer_config *peers;
@@ -217,8 +222,12 @@ struct _fastd_context {
int sockfd;
int sock6fd;
- int algfd_ghash;
- int algfd_aesctr;
+#ifdef USE_CRYPTO_AES128CTR
+ fastd_crypto_aes128ctr_context *crypto_aes128ctr;
+#endif
+#ifdef USE_CRYPTO_GHASH
+ fastd_crypto_ghash_context *crypto_ghash;
+#endif
size_t eth_addr_size;
size_t n_eth_addr;
@@ -249,7 +258,7 @@ bool fastd_read_config(fastd_context *ctx, fastd_config *conf, const char *filen
bool fastd_config_protocol(fastd_context *ctx, fastd_config *conf, const char *name);
bool fastd_config_method(fastd_context *ctx, fastd_config *conf, const char *name);
-bool fastd_config_algorithm(fastd_context *ctx, fastd_config *conf, const char *alg, const char *impl);
+bool fastd_config_crypto(fastd_context *ctx, fastd_config *conf, const char *alg, const char *impl);
bool fastd_config_add_log_file(fastd_context *ctx, fastd_config *conf, const char *name, int level);
void fastd_configure(fastd_context *ctx, fastd_config *conf, int argc, char *const argv[]);
void fastd_reconfigure(fastd_context *ctx, fastd_config *conf);