diff options
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r-- | src/common/crypto.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c index e37b282757..8feac95acf 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -13,11 +13,8 @@ #include "orconfig.h" #ifdef _WIN32 -#ifndef WIN32_WINNT -#define WIN32_WINNT 0x400 -#endif #ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x400 +#define _WIN32_WINNT 0x0501 #endif #define WIN32_LEAN_AND_MEAN #include <windows.h> @@ -1809,7 +1806,6 @@ crypto_get_stored_dynamic_dh_modulus(const char *fname) char *contents = NULL; const char *contents_tmp = NULL; int dh_codes; - char *fname_new = NULL; DH *stored_dh = NULL; BIGNUM *dynamic_dh_modulus = NULL; int length = 0; @@ -1884,12 +1880,10 @@ crypto_get_stored_dynamic_dh_modulus(const char *fname) err: - { /* move broken prime to $filename.broken */ - fname_new = tor_malloc(strlen(fname) + 8); - - /* no can do if these functions return error */ - strlcpy(fname_new, fname, strlen(fname) + 8); - strlcat(fname_new, ".broken", strlen(fname) + 8); + { + /* move broken prime to $filename.broken */ + char *fname_new=NULL; + tor_asprintf(&fname_new, "%s.broken", fname); log_warn(LD_CRYPTO, "Moving broken dynamic DH prime to '%s'.", fname_new); |