From 9670eb99379b4293f8eb4039e65d6633aa495650 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 7 Jan 2010 15:05:50 +0000 Subject: added visual studio build targets with gcrypt --- src/anytun.sln | 24 ++ src/anytun.suo | Bin 68608 -> 0 bytes src/anytun.vcproj | 680 +++++++++++++++++++++++++++++++++++++++++++++++++- src/cryptinit.hpp | 6 - src/keyDerivation.cpp | 4 +- 5 files changed, 697 insertions(+), 17 deletions(-) delete mode 100644 src/anytun.suo diff --git a/src/anytun.sln b/src/anytun.sln index 0e5c04c..99da3b0 100644 --- a/src/anytun.sln +++ b/src/anytun.sln @@ -5,28 +5,52 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "anytun", "anytun.vcproj", " EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug with gcrypt|Win32 = Debug with gcrypt|Win32 + Debug with gcrypt|x64 = Debug with gcrypt|x64 Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 + Release with gcrypt|Win32 = Release with gcrypt|Win32 + Release with gcrypt|x64 = Release with gcrypt|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 + Service Debug with gcrypt|Win32 = Service Debug with gcrypt|Win32 + Service Debug with gcrypt|x64 = Service Debug with gcrypt|x64 Service Debug|Win32 = Service Debug|Win32 Service Debug|x64 = Service Debug|x64 + Service Release with gcrypt|Win32 = Service Release with gcrypt|Win32 + Service Release with gcrypt|x64 = Service Release with gcrypt|x64 Service Release|Win32 = Service Release|Win32 Service Release|x64 = Service Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Debug with gcrypt|Win32.ActiveCfg = Debug with gcrypt|Win32 + {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Debug with gcrypt|Win32.Build.0 = Debug with gcrypt|Win32 + {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Debug with gcrypt|x64.ActiveCfg = Debug with gcrypt|x64 + {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Debug with gcrypt|x64.Build.0 = Debug with gcrypt|x64 {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Debug|Win32.ActiveCfg = Debug|Win32 {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Debug|Win32.Build.0 = Debug|Win32 {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Debug|x64.ActiveCfg = Debug|x64 {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Debug|x64.Build.0 = Debug|x64 + {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Release with gcrypt|Win32.ActiveCfg = Release with gcrypt|Win32 + {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Release with gcrypt|Win32.Build.0 = Release with gcrypt|Win32 + {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Release with gcrypt|x64.ActiveCfg = Release with gcrypt|x64 + {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Release with gcrypt|x64.Build.0 = Release with gcrypt|x64 {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Release|Win32.ActiveCfg = Release|Win32 {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Release|Win32.Build.0 = Release|Win32 {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Release|x64.ActiveCfg = Release|x64 {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Release|x64.Build.0 = Release|x64 + {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Debug with gcrypt|Win32.ActiveCfg = Service Debug with gcrypt|Win32 + {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Debug with gcrypt|Win32.Build.0 = Service Debug with gcrypt|Win32 + {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Debug with gcrypt|x64.ActiveCfg = Service Debug with gcrypt|x64 + {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Debug with gcrypt|x64.Build.0 = Service Debug with gcrypt|x64 {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Debug|Win32.ActiveCfg = Service Debug|Win32 {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Debug|Win32.Build.0 = Service Debug|Win32 {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Debug|x64.ActiveCfg = Service Debug|x64 {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Debug|x64.Build.0 = Service Debug|x64 + {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Release with gcrypt|Win32.ActiveCfg = Service Release with gcrypt|Win32 + {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Release with gcrypt|Win32.Build.0 = Service Release with gcrypt|Win32 + {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Release with gcrypt|x64.ActiveCfg = Service Release with gcrypt|x64 + {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Release with gcrypt|x64.Build.0 = Service Release with gcrypt|x64 {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Release|Win32.ActiveCfg = Service Release|Win32 {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Release|Win32.Build.0 = Service Release|Win32 {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Release|x64.ActiveCfg = Service Release|x64 diff --git a/src/anytun.suo b/src/anytun.suo deleted file mode 100644 index 436969a..0000000 Binary files a/src/anytun.suo and /dev/null differ diff --git a/src/anytun.vcproj b/src/anytun.vcproj index c64c5da..519c5cf 100644 --- a/src/anytun.vcproj +++ b/src/anytun.vcproj @@ -317,6 +317,303 @@ Name="VCPostBuildEventTool" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -364,6 +811,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -938,6 +1568,38 @@ PreprocessorDefinitions="ANYTUN_OPTIONS" /> + + + + + + + + + + + + // boost thread callbacks for libgcrypt -#if defined(BOOST_HAS_PTHREADS) - static int boost_mutex_init(void **priv) { boost::mutex *lock = new boost::mutex(); @@ -71,10 +69,6 @@ static struct gcry_thread_cbs gcry_threads_boost = { GCRY_THREAD_OPTION_USER, NULL, boost_mutex_init, boost_mutex_destroy, boost_mutex_lock, boost_mutex_unlock }; -#else -#error this libgcrypt thread callbacks only work with pthreads -#endif - #define MIN_GCRYPT_VERSION "1.2.0" diff --git a/src/keyDerivation.cpp b/src/keyDerivation.cpp index 6b102b9..25b7cf0 100644 --- a/src/keyDerivation.cpp +++ b/src/keyDerivation.cpp @@ -79,7 +79,7 @@ void KeyDerivation::calcMasterKey(std::string passphrase, u_int16_t length) } #ifndef USE_SSL_CRYPTO - Buffer digest(gcry_md_get_algo_dlen(GCRY_MD_SHA256)); + Buffer digest(static_cast(gcry_md_get_algo_dlen(GCRY_MD_SHA256))); gcry_md_hash_buffer(GCRY_MD_SHA256, digest.getBuf(), passphrase.c_str(), passphrase.length()); #else Buffer digest(u_int32_t(SHA256_DIGEST_LENGTH)); @@ -108,7 +108,7 @@ void KeyDerivation::calcMasterSalt(std::string passphrase, u_int16_t length) } #ifndef USE_SSL_CRYPTO - Buffer digest(gcry_md_get_algo_dlen(GCRY_MD_SHA1)); + Buffer digest(static_cast(gcry_md_get_algo_dlen(GCRY_MD_SHA1))); gcry_md_hash_buffer(GCRY_MD_SHA1, digest.getBuf(), passphrase.c_str(), passphrase.length()); #else Buffer digest(u_int32_t(SHA_DIGEST_LENGTH)); -- cgit v1.2.3