Use conditional compilation for cryptographic functions.
[tinc] / src / gcrypt / ecdh.c
similarity index 60%
rename from src/openssl/ecdh.h
rename to src/gcrypt/ecdh.c
index ef7de6e..4e30733 100644 (file)
@@ -1,6 +1,6 @@
 /*
-    ecdh.h -- header file for ecdh.c
-    Copyright (C) 2011 Guus Sliepen <guus@tinc-vpn.org>
+    ecdh.c -- Diffie-Hellman key exchange handling
+    Copyright (C) 2011-2013 Guus Sliepen <guus@tinc-vpn.org>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
-#ifndef __TINC_ECDH_H__
-#define __TINC_ECDH_H__
+#include "../system.h"
 
-#include <openssl/ecdh.h>
+#include "../ecdh.h"
+#include "../logger.h"
+#include "../utils.h"
+#include "../xalloc.h"
 
-#define ECDH_SIZE 67
-#define ECDH_SHARED_SIZE 66
+ecdh_t *ecdh_generate_public(void *pubkey) {
+       logger(DEBUG_ALWAYS, LOG_ERR, "EC support using libgcrypt not implemented");
+       return NULL;
+}
 
-typedef EC_KEY *ecdh_t;
+bool ecdh_compute_shared(ecdh_t *ecdh, const void *pubkey, void *shared) {
+       return false
+}
 
-extern bool ecdh_generate_public(ecdh_t *ecdh, void *pubkey);
-extern bool ecdh_compute_shared(ecdh_t *ecdh, const void *pubkey, void *shared);
-extern void ecdh_free(ecdh_t *ecdh);
-
-#endif
+void ecdh_free(ecdh_t *ecdh) {
+}