summaryrefslogtreecommitdiff
path: root/googlepatches/vidyo-1-srtp-win.patch
blob: cb6da566d670ba7f2dc692eaa62ea55bdae7b313 (plain)
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
diff -purN -x CVS -x '*~' -x '.*' -x 'obj-*' srtp-pristine/config.hw srtp/config.hw
--- srtp-pristine/config.hw	2007-05-23 13:40:21.000000000 -0400
+++ srtp/config.hw	2009-04-22 17:58:01.000000000 -0400
@@ -1,7 +1,7 @@
 /* crypto/include/config.h.  Generated by configure.  */
 /* config_in.h.  Generated from configure.in by autoheader.  */
 
-#ifdef (_MSC_VER >= 1400)
+#if (_MSC_VER >= 1400)
 # define HAVE_RAND_S	1
 #endif
 
diff -purN -x CVS -x '*~' -x '.*' -x 'obj-*' srtp-pristine/crypto/cipher/aes_icm.c srtp/crypto/cipher/aes_icm.c
--- srtp-pristine/crypto/cipher/aes_icm.c	2006-07-18 15:45:46.000000000 -0400
+++ srtp/crypto/cipher/aes_icm.c	2009-04-22 17:58:01.000000000 -0400
@@ -210,7 +210,7 @@ aes_icm_set_octet(aes_icm_ctx_t *c,
 							  ((high32(octet_num) & 0x0f)<<(32-4)) |
 							   (low32(octet_num) >> 4));
 #else
-  int tail_num       = octet_num % 16;
+  int tail_num       = (int)(octet_num % 16);
   uint64_t block_num = octet_num / 16;
 #endif
   
diff -purN -x CVS -x '*~' -x '.*' -x 'obj-*' srtp-pristine/install-win.bat srtp/install-win.bat
--- srtp-pristine/install-win.bat	1969-12-31 19:00:00.000000000 -0500
+++ srtp/install-win.bat	2009-04-22 17:58:01.000000000 -0400
@@ -0,0 +1,31 @@
+:: Installs from srtp windows build directory to directory specified on
+:: command line
+
+
+@if "%1"=="" (
+	echo "Usage: %~nx0 destdir"
+	exit /b 1
+) else (
+	set destdir=%1
+)
+
+@if not exist %destdir% (
+   echo %destdir% not found
+   exit /b 1
+)
+
+@for %%d in (include\srtp.h crypto\include\crypto.h Debug\srtp.lib Release\srtp.lib) do (
+	if not exist "%%d" (
+	   echo "%%d not found: are you in the right directory?"
+	   exit /b 1
+	)
+)
+
+mkdir %destdir%\include
+mkdir %destdir%\include\srtp
+mkdir %destdir%\lib
+
+copy include\*.h %destdir%\include\srtp
+copy crypto\include\*.h %destdir%\include\srtp
+copy Release\srtp.lib %destdir%\lib\srtp.lib
+copy Debug\srtp.lib %destdir%\lib\srtpd.lib
diff -purN -x CVS -x '*~' -x '.*' -x 'obj-*' srtp-pristine/srtp/ekt.c srtp/srtp/ekt.c
--- srtp-pristine/srtp/ekt.c	2007-06-15 14:36:09.000000000 -0400
+++ srtp/srtp/ekt.c	2009-04-22 18:47:06.000000000 -0400
@@ -91,27 +91,27 @@ ekt_octets_after_base_tag(ekt_stream_t e
 }
 
 inline ekt_spi_t
-srtcp_packet_get_ekt_spi(const void *packet_start, unsigned pkt_octet_len) {
-  void *spi_location;
+srtcp_packet_get_ekt_spi(const uint8_t *packet_start, unsigned pkt_octet_len) {
+  const uint8_t *spi_location;
   
   spi_location = packet_start + (pkt_octet_len - EKT_SPI_LEN);
   
-  return *((ekt_spi_t *)spi_location);
+  return *((const ekt_spi_t *)spi_location);
 }
 
 inline uint32_t
-srtcp_packet_get_ekt_roc(const void *packet_start, unsigned pkt_octet_len) {
-  void *roc_location;
+srtcp_packet_get_ekt_roc(const uint8_t *packet_start, unsigned pkt_octet_len) {
+  const uint8_t *roc_location;
   
   roc_location = packet_start + (pkt_octet_len - EKT_OCTETS_AFTER_ROC);
   
-  return *((uint32_t *)roc_location);
+  return *((const uint32_t *)roc_location);
 }
 
-inline void *
-srtcp_packet_get_emk_location(const void *packet_start, 
+inline const uint8_t *
+srtcp_packet_get_emk_location(const uint8_t *packet_start, 
 			      unsigned pkt_octet_len) {
-  void *location;
+  const uint8_t *location;
   
   location = packet_start + (pkt_octet_len - EKT_OCTETS_AFTER_BASE_TAG);
 
@@ -161,7 +161,7 @@ srtp_stream_init_from_ekt(srtp_stream_t 
 			  const void *srtcp_hdr,
 			  unsigned pkt_octet_len) {
   err_status_t err;
-  uint8_t *master_key;
+  const uint8_t *master_key;
   srtp_policy_t srtp_policy;
   unsigned master_key_len;
   uint32_t roc;
@@ -179,7 +179,7 @@ srtp_stream_init_from_ekt(srtp_stream_t 
 
   /* decrypt the Encrypted Master Key field */
   master_key = srtcp_packet_get_emk_location(srtcp_hdr, pkt_octet_len);
-  aes_decrypt_with_raw_key(master_key, stream->ekt->data->ekt_dec_key);
+  aes_decrypt_with_raw_key((void*)master_key, stream->ekt->data->ekt_dec_key);
 
   /* set the SRTP ROC */
   roc = srtcp_packet_get_ekt_roc(srtcp_hdr, pkt_octet_len);
@@ -201,7 +201,7 @@ ekt_write_data(ekt_stream_t ekt,
   uint32_t roc;
   uint16_t isn;
   unsigned emk_len;
-  void *packet;
+  uint8_t *packet;
 
   /* if the pointer ekt is NULL, then EKT is not in effect */
   if (!ekt) {
@@ -211,7 +211,7 @@ ekt_write_data(ekt_stream_t ekt,
 
   /* write zeros into the location of the base tag */
   octet_string_set_to_zero(base_tag, base_tag_len);
-  packet = base_tag + base_tag_len;
+  packet = (uint8_t*)base_tag + base_tag_len;
 
   /* copy encrypted master key into packet */
   emk_len = ekt_octets_after_base_tag(ekt);
@@ -221,14 +221,14 @@ ekt_write_data(ekt_stream_t ekt,
   packet += emk_len;
 
   /* copy ROC into packet */
-  roc = pkt_index >> 16;
+  roc = (uint32_t)(pkt_index >> 16);
   *((uint32_t *)packet) = be32_to_cpu(roc);
   debug_print(mod_srtp, "writing EKT ROC: %s,", 
 	      octet_string_hex_string(packet, sizeof(roc)));
   packet += sizeof(roc);
 
   /* copy ISN into packet */
-  isn = pkt_index;
+  isn = (uint16_t)pkt_index;
   *((uint16_t *)packet) = htons(isn);
   debug_print(mod_srtp, "writing EKT ISN: %s,", 
 	      octet_string_hex_string(packet, sizeof(isn)));
diff -purN -x CVS -x '*~' -x '.*' -x 'obj-*' srtp-pristine/srtp.def srtp/srtp.def
--- srtp-pristine/srtp.def	2006-05-22 16:46:21.000000000 -0400
+++ srtp/srtp.def	2009-04-22 17:58:01.000000000 -0400
@@ -89,4 +89,3 @@ aes_icm_encrypt_ismacryp
 aes_icm_alloc_ismacryp
 crypto_alloc
 crypto_free
-\ No newline at end of file
\ No newline at end of file
diff -purN -x CVS -x '*~' -x '.*' -x 'obj-*' srtp-pristine/srtp.sln srtp/srtp.sln
--- srtp-pristine/srtp.sln	1969-12-31 19:00:00.000000000 -0500
+++ srtp/srtp.sln	2009-04-22 17:58:01.000000000 -0400
@@ -0,0 +1,26 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "srtp", "srtp.vcproj", "{EEF031CB-FED8-451E-A471-91EC8D4F6750}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug Dll|Win32 = Debug Dll|Win32
+		Debug|Win32 = Debug|Win32
+		Release Dll|Win32 = Release Dll|Win32
+		Release|Win32 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug Dll|Win32.ActiveCfg = Debug Dll|Win32
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug Dll|Win32.Build.0 = Debug Dll|Win32
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Win32.ActiveCfg = Debug|Win32
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Win32.Build.0 = Debug|Win32
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release Dll|Win32.ActiveCfg = Release Dll|Win32
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release Dll|Win32.Build.0 = Release Dll|Win32
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Win32.ActiveCfg = Release|Win32
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Win32.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff -purN -x CVS -x '*~' -x '.*' -x 'obj-*' srtp-pristine/srtp.vcproj srtp/srtp.vcproj
--- srtp-pristine/srtp.vcproj	2006-05-22 16:46:21.000000000 -0400
+++ srtp/srtp.vcproj	2009-04-22 17:58:01.000000000 -0400
@@ -49,7 +49,7 @@
 				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;HAVE_CONFIG_H"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
+				RuntimeLibrary="1"
 				StructMemberAlignment="0"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
@@ -116,7 +116,7 @@
 				Name="VCCLCompilerTool"
 				AdditionalIncludeDirectories="crypto/include;include"
 				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;HAVE_CONFIG_H"
-				RuntimeLibrary="2"
+				RuntimeLibrary="0"
 				StructMemberAlignment="0"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
@@ -324,6 +324,10 @@
 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
 			>
 			<File
+				RelativePath=".\srtp\ekt.c"
+				>
+			</File>
+			<File
 				RelativePath=".\srtp\srtp.c"
 				>
 			</File>
@@ -484,10 +488,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\crypto\include\crypto_math.h"
-				>
-			</File>
-			<File
 				RelativePath=".\crypto\include\crypto_types.h"
 				>
 			</File>
@@ -500,6 +500,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\include\ekt.h"
+				>
+			</File>
+			<File
 				RelativePath=".\crypto\include\err.h"
 				>
 			</File>
@@ -516,10 +520,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\crypto\include\kernel_compat.h"
-				>
-			</File>
-			<File
 				RelativePath=".\crypto\include\key.h"
 				>
 			</File>
@@ -548,10 +548,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\include\rtp.h"
-				>
-			</File>
-			<File
 				RelativePath=".\crypto\include\sha1.h"
 				>
 			</File>
@@ -560,15 +556,15 @@
 				>
 			</File>
 			<File
-				RelativePath=".\crypto\include\stat.h"
+				RelativePath=".\include\srtp_priv.h"
 				>
 			</File>
 			<File
-				RelativePath=".\include\ut_sim.h"
+				RelativePath=".\crypto\include\stat.h"
 				>
 			</File>
 			<File
-				RelativePath=".\crypto\include\xfm.h"
+				RelativePath=".\include\ut_sim.h"
 				>
 			</File>
 		</Filter>
@@ -579,6 +575,10 @@
 			>
 		</Filter>
 		<File
+			RelativePath=".\config.hw"
+			>
+		</File>
+		<File
 			RelativePath=".\srtp.def"
 			>
 		</File>