summaryrefslogtreecommitdiff
path: root/src/auth_algo.h
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2014-06-21 18:26:51 +0000
committerChristian Pointner <equinox@anytun.org>2014-06-21 18:26:51 +0000
commit01ef67da5564e1dcb380adead3e7f869fa3be2c8 (patch)
tree2d61c96e2aed44703955ce731ffa28a5f055fff7 /src/auth_algo.h
parentrefactored crypto lib selection (diff)
added defines for nettle as crypto lib
further improved selection of crypto lib
Diffstat (limited to 'src/auth_algo.h')
-rw-r--r--src/auth_algo.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/auth_algo.h b/src/auth_algo.h
index 2c20410..e800c8e 100644
--- a/src/auth_algo.h
+++ b/src/auth_algo.h
@@ -36,8 +36,10 @@
#ifndef UANYTUN_auth_algo_h_INCLUDED
#define UANYTUN_auth_algo_h_INCLUDED
-#ifdef USE_SSL_CRYPTO
+#if defined(USE_SSL_CRYPTO)
#include <openssl/hmac.h>
+#elif defined(USE_NETTLE)
+#include <nettle/hmac.h>
#else // USE_GCRYPT is the default
#include <gcrypt.h>
#endif
@@ -66,8 +68,11 @@ int auth_algo_check_tag(auth_algo_t* aa, key_derivation_t* kd, key_derivation_di
#define SHA1_LENGTH 20
struct auth_algo_sha1_param_struct {
-#ifdef USE_SSL_CRYPTO
+#if defined(USE_SSL_CRYPTO)
HMAC_CTX ctx_;
+#elif defined(USE_NETTLE)
+ // TOOD: nettle
+
#else // USE_GCRYPT is the default
gcry_md_hd_t handle_;
#endif