summaryrefslogtreecommitdiff
path: root/src/authAlgo.h
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2014-06-22 23:09:15 +0000
committerChristian Pointner <equinox@anytun.org>2014-06-22 23:09:15 +0000
commitfac90fc49e667b18522b442ff15edd3bb8eb804b (patch)
tree7530b98b4b7c50f0512184e9a2369a0b196306a7 /src/authAlgo.h
parentfixed typo in license header (diff)
parentimplemented key derivation using libnettle (diff)
merged nettle featuer branch to trunk
Diffstat (limited to 'src/authAlgo.h')
-rw-r--r--src/authAlgo.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/authAlgo.h b/src/authAlgo.h
index 3074014..1e86407 100644
--- a/src/authAlgo.h
+++ b/src/authAlgo.h
@@ -37,11 +37,15 @@
#include "encryptedPacket.h"
#ifndef NO_CRYPT
-#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
+
#endif
#include "keyDerivation.h"
@@ -95,10 +99,12 @@ public:
static const uint32_t DIGEST_LENGTH = 20;
private:
-#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
Buffer key_;