aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-08-28 14:29:17 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-08-28 14:29:17 +0200
commit7c28d0ce6d38a4e99e981fc3abf380e4cf29a57e (patch)
treea8469d98e0b03f2102cde90bc6bbdf21df7047d1
parent5cf23522de543153fc0abcb4d33be1c1115a7aef (diff)
downloadlibssh-7c28d0ce6d38a4e99e981fc3abf380e4cf29a57e.tar.gz
libssh-7c28d0ce6d38a4e99e981fc3abf380e4cf29a57e.tar.xz
libssh-7c28d0ce6d38a4e99e981fc3abf380e4cf29a57e.zip
pki: Compile pki_gcrypt.c only if we need it.
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/pki_gcrypt.c30
2 files changed, 2 insertions, 30 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 392944a1..79b69532 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -103,7 +103,6 @@ set(libssh_SRCS
packet.c
pcap.c
pki.c
- pki_gcrypt.c
poll.c
session.c
scp.c
@@ -118,6 +117,7 @@ if (WITH_GCRYPT)
${libssh_SRCS}
libgcrypt.c
gcrypt_missing.c
+ pki_gcrypt.c
)
else (WITH_GCRYPT)
set(libssh_SRCS
diff --git a/src/pki_gcrypt.c b/src/pki_gcrypt.c
index 1e3f1eff..ded50384 100644
--- a/src/pki_gcrypt.c
+++ b/src/pki_gcrypt.c
@@ -31,22 +31,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-
-#ifdef _WIN32
-# if _MSC_VER >= 1400
-# include <io.h>
-# undef open
-# define open _open
-# undef close
-# define close _close
-# undef read
-# define read _read
-# undef unlink
-# define unlink _unlink
-# endif /* _MSC_VER */
-#else
-# include <arpa/inet.h>
-#endif
+#include <gcrypt.h>
#include "libssh/priv.h"
#include "libssh/buffer.h"
@@ -60,24 +45,12 @@
/*todo: remove this include */
#include "libssh/string.h"
-
-#ifdef HAVE_LIBGCRYPT
-#include <gcrypt.h>
-#elif defined HAVE_LIBCRYPTO
-#include <openssl/pem.h>
-#include <openssl/dsa.h>
-#include <openssl/err.h>
-#include <openssl/rsa.h>
-#endif /* HAVE_LIBCRYPTO */
-
#define MAXLINESIZE 80
#define RSA_HEADER_BEGIN "-----BEGIN RSA PRIVATE KEY-----"
#define RSA_HEADER_END "-----END RSA PRIVATE KEY-----"
#define DSA_HEADER_BEGIN "-----BEGIN DSA PRIVATE KEY-----"
#define DSA_HEADER_END "-----END DSA PRIVATE KEY-----"
-#ifdef HAVE_LIBGCRYPT
-
#define MAX_KEY_SIZE 32
#define MAX_PASSPHRASE_SIZE 1024
#define ASN1_INTEGER 2
@@ -1521,6 +1494,5 @@ ssh_signature pki_do_sign_sessionid(const ssh_key key,
return sig;
}
#endif /* WITH_SERVER */
-#endif /* HAVE_LIBGCRYPT */
/* vim: set ts=4 sw=4 et cindent: */