summaryrefslogtreecommitdiff
path: root/src/auth_algo.h
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2014-06-21 19:48:12 +0000
committerChristian Pointner <equinox@anytun.org>2014-06-21 19:48:12 +0000
commitb0eb467680943a45f7ef2346d37efce073b837b2 (patch)
tree6b26bf687a2e6fb22f57db12b7b14ea70a91a210 /src/auth_algo.h
parentfixed typo in description (diff)
parentimplemented key derivation in nettle (diff)
merged nettle branch to trunk
Diffstat (limited to 'src/auth_algo.h')
-rw-r--r--src/auth_algo.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/auth_algo.h b/src/auth_algo.h
index c3caaa6..b8a20b8 100644
--- a/src/auth_algo.h
+++ b/src/auth_algo.h
@@ -36,10 +36,12 @@
#ifndef UANYTUN_auth_algo_h_INCLUDED
#define UANYTUN_auth_algo_h_INCLUDED
-#ifndef USE_SSL_CRYPTO
-#include <gcrypt.h>
-#else
+#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
#include "key_derivation.h"
#include "encrypted_packet.h"
@@ -66,10 +68,12 @@ 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 {
-#ifndef USE_SSL_CRYPTO
- gcry_md_hd_t handle_;
-#else
+#if defined(USE_SSL_CRYPTO)
HMAC_CTX ctx_;
+#elif defined(USE_NETTLE)
+ struct hmac_sha1_ctx ctx_;
+#else // USE_GCRYPT is the default
+ gcry_md_hd_t handle_;
#endif
};
typedef struct auth_algo_sha1_param_struct auth_algo_sha1_param_t;