Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: third_party/usrsctp/localchanges.patch

Issue 21968004: Updated usrsctp to fix various issues for windows (using changes pushed upstream) and unified SHA1 … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed indent Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 diff -NcrB usrsctplib/netinet/sctp_auth.h overrides/usrsctplib/netinet/sctp_auth .h 1 Binary files usrsctplib/.DS_Store and overrides/usrsctplib/.DS_Store differ
2 *** usrsctplib/netinet/sctp_auth.h» 2013-06-10 17:41:59.323347517 -0700 2 Only in usrsctplib: .cvsignore
3 --- overrides/usrsctplib/netinet/sctp_auth.h» 2013-06-10 17:44:55.584797436 -0 700 3 Only in usrsctplib: .git
4 Only in usrsctplib: Makefile.am
5 Only in usrsctplib: Makefile.nmake
6 Only in usrsctplib/netinet: sctp.h
7 Only in usrsctplib/netinet: sctp_asconf.c
8 Only in usrsctplib/netinet: sctp_asconf.h
9 Only in usrsctplib/netinet: sctp_auth.c
10 diff -PcrB usrsctplib/netinet/sctp_auth.h overrides/usrsctplib/netinet/sctp_auth .h
11 *** usrsctplib/netinet/sctp_auth.h» 2013-07-26 05:00:15.000000000 -0400
12 --- overrides/usrsctplib/netinet/sctp_auth.h» 2013-06-18 11:40:34.000000000 -0 400
4 *************** 13 ***************
5 *** 38,43 **** 14 *** 38,43 ****
6 --- 38,44 ---- 15 --- 38,44 ----
7 #ifndef _NETINET_SCTP_AUTH_H_ 16 #ifndef _NETINET_SCTP_AUTH_H_
8 #define _NETINET_SCTP_AUTH_H_ 17 #define _NETINET_SCTP_AUTH_H_
9 18
10 + #include <netinet/sctp_sha1.h> 19 + #include <netinet/sctp_sha1.h>
11 20
12 /* digest lengths */ 21 /* digest lengths */
13 #define SCTP_AUTH_DIGEST_LEN_SHA1 20 22 #define SCTP_AUTH_DIGEST_LEN_SHA1 20
14 diff -NcrB usrsctplib/netinet/sctp_nss_sha1.c overrides/usrsctplib/netinet/sctp_ nss_sha1.c 23 Only in usrsctplib/netinet: sctp_bsd_addr.c
15 *** usrsctplib/netinet/sctp_nss_sha1.c» 1969-12-31 16:00:00.000000000 -0800 24 Only in usrsctplib/netinet: sctp_bsd_addr.h
16 --- overrides/usrsctplib/netinet/sctp_nss_sha1.c» 2013-06-10 17:41:29.6031 02743 -0700 25 Only in usrsctplib/netinet: sctp_callout.c
26 Only in usrsctplib/netinet: sctp_callout.h
27 Only in usrsctplib/netinet: sctp_cc_functions.c
28 Only in usrsctplib/netinet: sctp_constants.h
29 Only in usrsctplib/netinet: sctp_crc32.c
30 Only in usrsctplib/netinet: sctp_crc32.h
31 Only in usrsctplib/netinet: sctp_dtrace_declare.h
32 Only in usrsctplib/netinet: sctp_dtrace_define.h
33 Only in usrsctplib/netinet: sctp_hashdriver.c
34 Only in usrsctplib/netinet: sctp_hashdriver.h
35 Only in usrsctplib/netinet: sctp_header.h
36 Only in usrsctplib/netinet: sctp_indata.c
37 Only in usrsctplib/netinet: sctp_indata.h
38 Only in usrsctplib/netinet: sctp_input.c
39 Only in usrsctplib/netinet: sctp_input.h
40 Only in usrsctplib/netinet: sctp_lock_userspace.h
41 diff -PcrB usrsctplib/netinet/sctp_nss_sha1.c overrides/usrsctplib/netinet/sctp_ nss_sha1.c
42 *** usrsctplib/netinet/sctp_nss_sha1.c» 1969-12-31 19:00:00.000000000 -0500
43 --- overrides/usrsctplib/netinet/sctp_nss_sha1.c» 2013-07-29 21:32:35.0000 00000 -0400
17 *************** 44 ***************
18 *** 0 **** 45 *** 0 ****
19 --- 1,61 ---- 46 --- 1,64 ----
20 + /*- 47 + /*-
21 + * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. 48 + * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
22 + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. 49 + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
23 + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. 50 + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved.
24 + * 51 + *
25 + * Redistribution and use in source and binary forms, with or without 52 + * Redistribution and use in source and binary forms, with or without
26 + * modification, are permitted provided that the following conditions are met: 53 + * modification, are permitted provided that the following conditions are met:
27 + * 54 + *
28 + * a) Redistributions of source code must retain the above copyright notice, 55 + * a) Redistributions of source code must retain the above copyright notice,
29 + * this list of conditions and the following disclaimer. 56 + * this list of conditions and the following disclaimer.
(...skipping 20 matching lines...) Expand all
50 + */ 77 + */
51 + 78 +
52 + #ifdef __FreeBSD__ 79 + #ifdef __FreeBSD__
53 + #include <sys/cdefs.h> 80 + #include <sys/cdefs.h>
54 + __FBSDID("$FreeBSD$"); 81 + __FBSDID("$FreeBSD$");
55 + #endif 82 + #endif
56 + 83 +
57 + #ifdef SCTP_USE_NSS_SHA1 84 + #ifdef SCTP_USE_NSS_SHA1
58 + #include <netinet/sctp_nss_sha1.h> 85 + #include <netinet/sctp_nss_sha1.h>
59 + 86 +
87 + /* A SHA-1 Digest is 160 bits, or 20 bytes */
88 + #define SHA_DIGEST_LENGTH (20)
89 +
60 + void 90 + void
61 + SCTP_NSS_SHA1_Init(struct sha1_context *ctx) 91 + SCTP_NSS_SHA1_Init(struct sha1_context *ctx)
62 + { 92 + {
63 + ctx->pk11_ctx = PK11_CreateDigestContext(SEC_OID_SHA1); 93 + ctx->pk11_ctx = PK11_CreateDigestContext(SEC_OID_SHA1);
64 + PK11_DigestBegin(ctx->pk11_ctx); 94 + PK11_DigestBegin(ctx->pk11_ctx);
65 + } 95 + }
66 + 96 +
67 + void 97 + void
68 + SCTP_NSS_SHA1_Update(struct sha1_context *ctx, const unsigned char *ptr, int s iz) 98 + SCTP_NSS_SHA1_Update(struct sha1_context *ctx, const unsigned char *ptr, int s iz)
69 + { 99 + {
70 + PK11_DigestOp(ctx->pk11_ctx, ptr, siz); 100 + PK11_DigestOp(ctx->pk11_ctx, ptr, siz);
71 + } 101 + }
72 + 102 +
73 + void 103 + void
74 + SCTP_NSS_SHA1_Final(unsigned char *digest, struct sha1_context *ctx) 104 + SCTP_NSS_SHA1_Final(unsigned char *digest, struct sha1_context *ctx)
75 + { 105 + {
76 + unsigned int output_len = 0; 106 + unsigned int output_len = 0;
77 + » PK11_DigestFinal(ctx->pk11_ctx, digest, &output_len, sizeof(digest)); 107 + » PK11_DigestFinal(ctx->pk11_ctx, digest, &output_len, SHA_DIGEST_LENGTH);
78 + PK11_DestroyContext(ctx->pk11_ctx, PR_TRUE); 108 + PK11_DestroyContext(ctx->pk11_ctx, PR_TRUE);
79 + } 109 + }
80 + #endif 110 + #endif
81 diff -NcrB usrsctplib/netinet/sctp_nss_sha1.h overrides/usrsctplib/netinet/sctp_ nss_sha1.h 111 diff -PcrB usrsctplib/netinet/sctp_nss_sha1.h overrides/usrsctplib/netinet/sctp_ nss_sha1.h
82 *** usrsctplib/netinet/sctp_nss_sha1.h» 1969-12-31 16:00:00.000000000 -0800 112 *** usrsctplib/netinet/sctp_nss_sha1.h» 1969-12-31 19:00:00.000000000 -0500
83 --- overrides/usrsctplib/netinet/sctp_nss_sha1.h» 2013-06-10 17:41:29.6031 02743 -0700 113 --- overrides/usrsctplib/netinet/sctp_nss_sha1.h» 2013-07-26 03:58:48.0000 00000 -0400
84 *************** 114 ***************
85 *** 0 **** 115 *** 0 ****
86 --- 1,64 ---- 116 --- 1,64 ----
87 + /*- 117 + /*-
88 + * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. 118 + * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
89 + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. 119 + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
90 + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. 120 + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved.
91 + * 121 + *
92 + * Redistribution and use in source and binary forms, with or without 122 + * Redistribution and use in source and binary forms, with or without
93 + * modification, are permitted provided that the following conditions are met: 123 + * modification, are permitted provided that the following conditions are met:
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 + struct PK11Context *pk11_ctx; 169 + struct PK11Context *pk11_ctx;
140 + }; // Opaque structure. 170 + }; // Opaque structure.
141 + 171 +
142 + typedef struct sha1_context SHA1_CTX; 172 + typedef struct sha1_context SHA1_CTX;
143 + 173 +
144 + #if defined(_KERNEL) || defined(__Userspace__) 174 + #if defined(_KERNEL) || defined(__Userspace__)
145 + #define SHA1_Init SCTP_NSS_SHA1_Init 175 + #define SHA1_Init SCTP_NSS_SHA1_Init
146 + #define SHA1_Update SCTP_NSS_SHA1_Update 176 + #define SHA1_Update SCTP_NSS_SHA1_Update
147 + #define SHA1_Final SCTP_NSS_SHA1_Final 177 + #define SHA1_Final SCTP_NSS_SHA1_Final
148 + 178 +
149 + #endif» » » » /* _KERNEL */ 179 + #endif /* _KERNEL */
150 + #endif 180 + #endif /* __SCTP_NSS_SHA1_h__ */
151 diff -NcrB usrsctplib/netinet/sctp_openssl_sha1.h overrides/usrsctplib/netinet/s ctp_openssl_sha1.h 181 diff -PcrB usrsctplib/netinet/sctp_openssl_sha1.h overrides/usrsctplib/netinet/s ctp_openssl_sha1.h
152 *** usrsctplib/netinet/sctp_openssl_sha1.h» 1969-12-31 16:00:00.000000000 -0 800 182 *** usrsctplib/netinet/sctp_openssl_sha1.h» 1969-12-31 19:00:00.000000000 -0 500
153 --- overrides/usrsctplib/netinet/sctp_openssl_sha1.h» 2013-06-10 17:41:29.6031 02743 -0700 183 --- overrides/usrsctplib/netinet/sctp_openssl_sha1.h» 2013-06-18 11:40:34.0000 00000 -0400
154 *************** 184 ***************
155 *** 0 **** 185 *** 0 ****
156 --- 1,48 ---- 186 --- 1,48 ----
157 + /*- 187 + /*-
158 + * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. 188 + * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
159 + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. 189 + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
160 + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. 190 + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved.
161 + * 191 + *
162 + * Redistribution and use in source and binary forms, with or without 192 + * Redistribution and use in source and binary forms, with or without
163 + * modification, are permitted provided that the following conditions are met: 193 + * modification, are permitted provided that the following conditions are met:
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 + #define __SCTP_OPENSSL_SHA1_h__ 225 + #define __SCTP_OPENSSL_SHA1_h__
196 + 226 +
197 + #include <openssl/md5.h> 227 + #include <openssl/md5.h>
198 + #include <openssl/sha.h> 228 + #include <openssl/sha.h>
199 + /* libssl-dev calls this SHA_CTX, but it's refered to as SHA1_CTX within the 229 + /* libssl-dev calls this SHA_CTX, but it's refered to as SHA1_CTX within the
200 + * SCTP stack code so here we typedef (or macro?) to equate the two. 230 + * SCTP stack code so here we typedef (or macro?) to equate the two.
201 + */ 231 + */
202 + typedef SHA_CTX SHA1_CTX; 232 + typedef SHA_CTX SHA1_CTX;
203 + 233 +
204 + #endif 234 + #endif
205 diff -NcrB usrsctplib/netinet/sctp_os.h overrides/usrsctplib/netinet/sctp_os.h 235 diff -PcrB usrsctplib/netinet/sctp_os.h overrides/usrsctplib/netinet/sctp_os.h
206 *** usrsctplib/netinet/sctp_os.h» 2013-06-10 17:42:10.643440747 -0700 236 *** usrsctplib/netinet/sctp_os.h» 2013-07-26 05:00:15.000000000 -0400
207 --- overrides/usrsctplib/netinet/sctp_os.h» 2013-06-10 17:41:29.603102743 -0 700 237 --- overrides/usrsctplib/netinet/sctp_os.h» 2013-06-18 11:40:34.000000000 -0 400
208 *************** 238 ***************
209 *** 73,79 **** 239 *** 73,79 ****
210 #endif 240 #endif
211 241
212 #if defined(__APPLE__) 242 #if defined(__APPLE__)
213 ! #include <netinet/sctp_os_macosx.h> 243 ! #include <netinet/sctp_os_macosx.h>
214 #endif 244 #endif
215 245
216 #if defined(__Panda__) 246 #if defined(__Panda__)
217 --- 73,80 ---- 247 --- 73,80 ----
218 #endif 248 #endif
219 249
220 #if defined(__APPLE__) 250 #if defined(__APPLE__)
221 ! #undef __APPLE__ 251 ! #undef __APPLE__
222 ! // #include <netinet/sctp_os_macosx.h> 252 ! // #include <netinet/sctp_os_macosx.h>
223 #endif 253 #endif
224 254
225 #if defined(__Panda__) 255 #if defined(__Panda__)
226 diff -NcrB usrsctplib/netinet/sctp_os_userspace.h overrides/usrsctplib/netinet/s ctp_os_userspace.h 256 diff -PcrB usrsctplib/netinet/sctp_os_userspace.h overrides/usrsctplib/netinet/s ctp_os_userspace.h
227 *** usrsctplib/netinet/sctp_os_userspace.h» 2013-06-10 17:42:23.763548800 -0 700 257 *** usrsctplib/netinet/sctp_os_userspace.h» 2013-07-26 05:03:12.000000000 -0 400
228 --- overrides/usrsctplib/netinet/sctp_os_userspace.h» 2013-06-10 17:41:29.6031 02743 -0700 258 --- overrides/usrsctplib/netinet/sctp_os_userspace.h» 2013-07-26 04:46:41.0000 00000 -0400
229 *************** 259 ***************
230 *** 992,1000 **** 260 *** 996,1012 ****
231 #define SCTP_READ_RANDOM(buf, len) read_random(buf, len) 261 #define SCTP_READ_RANDOM(buf, len) read_random(buf, len)
232 262
233 263
234 - #ifdef USE_SCTP_SHA1 264 - #ifdef USE_SCTP_SHA1
235 #include <netinet/sctp_sha1.h> 265 #include <netinet/sctp_sha1.h>
236 - #else 266 ! #else
237 #if 0 /*this was old _KERNEL code... */ 267 ! #if 0 /*this was old _KERNEL code... */
238 #include <crypto/sha1.h> 268 ! #include <crypto/sha1.h>
239 /* map standard crypto API names */ 269 ! /* map standard crypto API names */
240 --- 992,998 ---- 270 ! #define SHA1_Init» SHA1Init
241 *************** 271 ! #define SHA1_Update» SHA1Update
242 *** 1002,1008 **** 272 ! #define SHA1_Final(x,y)» SHA1Final((caddr_t)x, y)
243 #define SHA1_Update» SHA1Update 273 ! #endif
244 #define SHA1_Final(x,y)» SHA1Final((caddr_t)x, y) 274 ! #endif
245 #endif
246 - #endif
247 275
248 #if defined(HAVE_SHA2) 276 #if defined(HAVE_SHA2)
249 #include <crypto/sha2/sha2.h> 277 #include <crypto/sha2/sha2.h>
250 --- 1000,1005 ---- 278 --- 996,1003 ----
251 diff -NcrB usrsctplib/netinet/sctp_sha1.h overrides/usrsctplib/netinet/sctp_sha1 .h 279 #define SCTP_READ_RANDOM(buf, len)» read_random(buf, len)
252 *** usrsctplib/netinet/sctp_sha1.h» 2013-06-10 17:42:32.483620614 -0700 280
253 --- overrides/usrsctplib/netinet/sctp_sha1.h» 2013-06-10 17:41:29.603102743 -0 700 281
282 #include <netinet/sctp_sha1.h>
283 !
284
285 #if defined(HAVE_SHA2)
286 #include <crypto/sha2/sha2.h>
287 Only in usrsctplib/netinet: sctp_output.c
288 Only in usrsctplib/netinet: sctp_output.h
289 Only in usrsctplib/netinet: sctp_pcb.c
290 Only in usrsctplib/netinet: sctp_pcb.h
291 Only in usrsctplib/netinet: sctp_peeloff.c
292 Only in usrsctplib/netinet: sctp_peeloff.h
293 Only in usrsctplib/netinet: sctp_process_lock.h
294 Only in usrsctplib/netinet: sctp_sha1.c
295 diff -PcrB usrsctplib/netinet/sctp_sha1.h overrides/usrsctplib/netinet/sctp_sha1 .h
296 *** usrsctplib/netinet/sctp_sha1.h» 2013-07-26 05:00:15.000000000 -0400
297 --- overrides/usrsctplib/netinet/sctp_sha1.h» 2013-07-29 23:00:51.000000000 -0 400
254 *************** 298 ***************
255 *** 36,46 **** 299 *** 36,46 ****
256 #endif 300 #endif
257 301
258 302
259 ! #ifndef __SCTP_SLA1_h__ 303 ! #ifndef __SCTP_SLA1_h__
260 ! #define __SCTP_SLA1_h__ 304 ! #define __SCTP_SLA1_h__
261 305
262 #include <sys/types.h> 306 #include <sys/types.h>
263 ! 307
264 struct sha1_context { 308 struct sha1_context {
265 unsigned int A; 309 unsigned int A;
266 unsigned int B; 310 unsigned int B;
267 --- 36,50 ---- 311 --- 36,69 ----
268 #endif 312 #endif
269 313
270 314
271 ! #ifndef __SCTP_SHA1_h__ 315 ! #ifndef __SCTP_SHA1_h__
272 ! #define __SCTP_SHA1_h__ 316 ! #define __SCTP_SHA1_h__
273 317
274 #include <sys/types.h> 318 #include <sys/types.h>
275 ! #ifdef SCTP_USE_NSS_SHA1 319
276 ! #include <netinet/sctp_nss_sha1.h> 320 + #if !defined(SSL_USE_OPENSSL) && !defined(SSL_USE_NSS)
277 ! #elif SCTP_USE_OPENSSL_SHA1 321 + #if defined(WIN32)
278 ! #include <netinet/sctp_openssl_sha1.h> 322 +
279 ! #else // USE_SCTP_SHA1 323 + #define SCTP_USE_SCTP_SHA1 1
324 +
325 + #else // defined(WIN32)
326 +
327 + #if defined(HAVE_OPENSSL_SSL_H)
328 + #define SSL_USE_OPENSSL 1
329 + #elif defined(HAVE_NSS_SSL_H)
330 + #define SSL_USE_NSS 1
331 + #else
332 + #define SCTP_USE_SCTP_SHA1
333 + #endif
334 +
335 + #endif // !defined(WIN32)
336 + #endif
337 +
338 + #if defined(SSL_USE_NSS)
339 + #include <netinet/sctp_nss_sha1.h>
340 + #elif defined(SSL_USE_OPENSSL)
341 + #include <netinet/sctp_openssl_sha1.h>
342 + #else // SCTP_USE_SCTP_SHA1
280 struct sha1_context { 343 struct sha1_context {
281 unsigned int A; 344 unsigned int A;
282 unsigned int B; 345 unsigned int B;
283 *************** 346 ***************
284 *** 96,98 **** 347 *** 95,98 ****
285 --- 100,103 ---- 348 void SHA1_Final(unsigned char *, struct sha1_context *);
286 349
287 #endif /* _KERNEL */ 350 #endif /* _KERNEL */
288 #endif 351 ! #endif
289 + #endif 352 --- 118,122 ----
353 void SHA1_Final(unsigned char *, struct sha1_context *);
354
355 #endif» » » » /* _KERNEL */
356 ! #endif /* !defined(SSL_USE_OPENSSL) && !defined(SSL_USE_NSS) */
357 ! #endif /* __SCTP_SHA1_h__ */
358 Only in usrsctplib/netinet: sctp_ss_functions.c
359 Only in usrsctplib/netinet: sctp_structs.h
360 Only in usrsctplib/netinet: sctp_sysctl.c
361 Only in usrsctplib/netinet: sctp_sysctl.h
362 Only in usrsctplib/netinet: sctp_timer.c
363 Only in usrsctplib/netinet: sctp_timer.h
364 Only in usrsctplib/netinet: sctp_uio.h
365 Only in usrsctplib/netinet: sctp_userspace.c
366 Only in usrsctplib/netinet: sctp_usrreq.c
367 Only in usrsctplib/netinet: sctp_var.h
368 Only in usrsctplib/netinet: sctputil.c
369 Only in usrsctplib/netinet: sctputil.h
370 Only in usrsctplib: netinet6
371 Only in usrsctplib: user_atomic.h
372 Only in usrsctplib: user_environment.c
373 Only in usrsctplib: user_environment.h
374 Only in usrsctplib: user_inpcb.h
375 Only in usrsctplib: user_ip6_var.h
376 Only in usrsctplib: user_ip_icmp.h
377 Only in usrsctplib: user_malloc.h
378 Only in usrsctplib: user_mbuf.c
379 Only in usrsctplib: user_mbuf.h
380 Only in usrsctplib: user_queue.h
381 Only in usrsctplib: user_recv_thread.c
382 Only in usrsctplib: user_recv_thread.h
383 Only in usrsctplib: user_route.h
384 Only in usrsctplib: user_sctp_timer_iterate.c
385 Only in usrsctplib: user_socket.c
386 Only in usrsctplib: user_socketvar.h
387 Only in usrsctplib: user_uma.h
388 Only in usrsctplib: usrsctp.h
OLDNEW
« no previous file with comments | « third_party/usrsctp/README.chromium ('k') | third_party/usrsctp/overrides/usrsctplib/netinet/sctp_nss_sha1.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698