forked from xbmc/vfs.sftp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
07-windowsstore.patch
127 lines (110 loc) · 3.01 KB
/
07-windowsstore.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
--- a/cmake/Modules/DefineCompilerFlags.cmake
+++ b/cmake/Modules/DefineCompilerFlags.cmake
@@ -73,7 +73,7 @@
#"deprecated" functions
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_NONSTDC_NO_WARNINGS=1 /D _CRT_SECURE_NO_WARNINGS=1")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_NONSTDC_NO_WARNINGS=1 /D _CRT_SECURE_NO_WARNINGS=1 /D _WINSOCK_DEPRECATED_NO_WARNINGS=1")
endif (MSVC)
# This removes this annoying warning
--- a/src/external/curve25519_ref.c
+++ b/src/external/curve25519_ref.c
@@ -61,7 +61,14 @@
for (j = 0;j < 32;++j) aorig[j] = a[j];
add(a,a,minusp);
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable: 4146)
+#endif
negative = -((a[31] >> 7) & 1);
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
for (j = 0;j < 32;++j) a[j] ^= negative & (aorig[j] ^ a[j]);
}
--- a/src/external/fe25519.c
+++ b/src/external/fe25519.c
@@ -87,7 +87,14 @@
}
m &= ge(r->v[0],237);
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable: 4146)
+#endif
m = -m;
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
r->v[31] -= m&127;
for (i = 30; i > 0; i--) {
@@ -159,7 +166,14 @@
int i;
uint32_t mask = b;
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable: 4146)
+#endif
mask = -mask;
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
for (i = 0; i < 32; i++) {
r->v[i] ^= mask & (x->v[i] ^ r->v[i]);
--- a/src/misc.c
+++ b/src/misc.c
@@ -50,6 +50,10 @@
#ifdef _WIN32
+#if !defined(WIN32_LEAN_AND_MEAN)
+#define WIN32_LEAN_AND_MEAN
+#endif
+#include <windows.h>
#ifndef _WIN32_IE
# define _WIN32_IE 0x0501 // SHGetSpecialFolderPath
@@ -105,6 +109,7 @@
#ifdef _WIN32
char *ssh_get_user_home_dir(void) {
+#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_APP)
char tmp[MAX_PATH] = {0};
char *szPath = NULL;
@@ -117,6 +122,7 @@
strcpy(szPath, tmp);
return szPath;
}
+#endif
return NULL;
}
@@ -147,6 +153,7 @@
}
char *ssh_get_local_username(void) {
+#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_APP)
DWORD size = 0;
char *user;
@@ -161,6 +168,7 @@
if (GetUserName(user, &size)) {
return user;
}
+#endif
return NULL;
}
--- a/src/options.c
+++ b/src/options.c
@@ -1455,7 +1455,7 @@
int key_type;
ssh_key key;
ssh_key *bind_key_loc = NULL;
- char **bind_key_path_loc;
+ char **bind_key_path_loc = NULL;
rc = ssh_pki_import_privkey_file(value, NULL, NULL, NULL, &key);
if (rc != SSH_OK) {
--- a/src/pki_container_openssh.c
+++ b/src/pki_container_openssh.c
@@ -160,7 +160,7 @@
char passphrase_buffer[128];
size_t key_material_len;
ssh_buffer buffer;
- ssh_string salt;
+ ssh_string salt = NULL;
uint32_t rounds;
int cmp;
int rc;