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

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

Issue 16196007: Enable SCTP in libjingle. (Closed) Base URL: https://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 6 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
OLDNEW
(Empty)
1 diff -NcrB usrsctplib/netinet/sctp_auth.h overrides/usrsctplib/netinet/sctp_auth .h
2 *** usrsctplib/netinet/sctp_auth.h 2013-06-10 17:41:59.323347517 -0700
3 --- overrides/usrsctplib/netinet/sctp_auth.h 2013-06-10 17:44:55.584797436 -0 700
4 ***************
5 *** 38,43 ****
6 --- 38,44 ----
7 #ifndef _NETINET_SCTP_AUTH_H_
8 #define _NETINET_SCTP_AUTH_H_
9
10 + #include <netinet/sctp_sha1.h>
11
12 /* digest lengths */
13 #define SCTP_AUTH_DIGEST_LEN_SHA1 20
14 diff -NcrB usrsctplib/netinet/sctp_nss_sha1.c overrides/usrsctplib/netinet/sctp_ nss_sha1.c
15 *** usrsctplib/netinet/sctp_nss_sha1.c 1969-12-31 16:00:00.000000000 -0800
16 --- overrides/usrsctplib/netinet/sctp_nss_sha1.c 2013-06-10 17:41:29.6031 02743 -0700
17 ***************
18 *** 0 ****
19 --- 1,61 ----
20 + /*-
21 + * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
22 + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
23 + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved.
24 + *
25 + * Redistribution and use in source and binary forms, with or without
26 + * modification, are permitted provided that the following conditions are met:
27 + *
28 + * a) Redistributions of source code must retain the above copyright notice,
29 + * this list of conditions and the following disclaimer.
30 + *
31 + * b) Redistributions in binary form must reproduce the above copyright
32 + * notice, this list of conditions and the following disclaimer in
33 + * the documentation and/or other materials provided with the distribution.
34 + *
35 + * c) Neither the name of Cisco Systems, Inc. nor the names of its
36 + * contributors may be used to endorse or promote products derived
37 + * from this software without specific prior written permission.
38 + *
39 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
40 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED T O,
41 + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURP OSE
42 + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
43 + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
44 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
45 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
46 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
47 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
49 + * THE POSSIBILITY OF SUCH DAMAGE.
50 + */
51 +
52 + #ifdef __FreeBSD__
53 + #include <sys/cdefs.h>
54 + __FBSDID("$FreeBSD$");
55 + #endif
56 +
57 + #ifdef SCTP_USE_NSS_SHA1
58 + #include <netinet/sctp_nss_sha1.h>
59 +
60 + void
61 + SCTP_NSS_SHA1_Init(struct sha1_context *ctx)
62 + {
63 + ctx->pk11_ctx = PK11_CreateDigestContext(SEC_OID_SHA1);
64 + PK11_DigestBegin(ctx->pk11_ctx);
65 + }
66 +
67 + void
68 + SCTP_NSS_SHA1_Update(struct sha1_context *ctx, const unsigned char *ptr, int s iz)
69 + {
70 + PK11_DigestOp(ctx->pk11_ctx, ptr, siz);
71 + }
72 +
73 + void
74 + SCTP_NSS_SHA1_Final(unsigned char *digest, struct sha1_context *ctx)
75 + {
76 + unsigned int output_len = 0;
77 + PK11_DigestFinal(ctx->pk11_ctx, digest, &output_len, sizeof(digest));
78 + PK11_DestroyContext(ctx->pk11_ctx, PR_TRUE);
79 + }
80 + #endif
81 diff -NcrB 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
83 --- overrides/usrsctplib/netinet/sctp_nss_sha1.h 2013-06-10 17:41:29.6031 02743 -0700
84 ***************
85 *** 0 ****
86 --- 1,64 ----
87 + /*-
88 + * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
89 + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
90 + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved.
91 + *
92 + * Redistribution and use in source and binary forms, with or without
93 + * modification, are permitted provided that the following conditions are met:
94 + *
95 + * a) Redistributions of source code must retain the above copyright notice,
96 + * this list of conditions and the following disclaimer.
97 + *
98 + * b) Redistributions in binary form must reproduce the above copyright
99 + * notice, this list of conditions and the following disclaimer in
100 + * the documentation and/or other materials provided with the distribution.
101 + *
102 + * c) Neither the name of Cisco Systems, Inc. nor the names of its
103 + * contributors may be used to endorse or promote products derived
104 + * from this software without specific prior written permission.
105 + *
106 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
107 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED T O,
108 + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURP OSE
109 + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
110 + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
111 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
112 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
113 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
114 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
115 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
116 + * THE POSSIBILITY OF SUCH DAMAGE.
117 + */
118 +
119 + #ifdef __FreeBSD__
120 + #include <sys/cdefs.h>
121 + __FBSDID("$FreeBSD$");
122 + #endif
123 +
124 + #ifndef __SCTP_NSS_SHA1_h__
125 + #define __SCTP_NSS_SHA1_h__
126 +
127 + #ifdef __Userspace_os_Darwin
128 + #define __APPLE__
129 + #endif
130 +
131 + #include <sys/types.h>
132 + #include <pk11pub.h>
133 +
134 + #ifdef __Userspace_os_Darwin
135 + #undef __APPLE__
136 + #endif
137 +
138 + struct sha1_context {
139 + struct PK11Context *pk11_ctx;
140 + }; // Opaque structure.
141 +
142 + typedef struct sha1_context SHA1_CTX;
143 +
144 + #if defined(_KERNEL) || defined(__Userspace__)
145 + #define SHA1_Init SCTP_NSS_SHA1_Init
146 + #define SHA1_Update SCTP_NSS_SHA1_Update
147 + #define SHA1_Final SCTP_NSS_SHA1_Final
148 +
149 + #endif /* _KERNEL */
150 + #endif
151 diff -NcrB 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
153 --- overrides/usrsctplib/netinet/sctp_openssl_sha1.h 2013-06-10 17:41:29.6031 02743 -0700
154 ***************
155 *** 0 ****
156 --- 1,48 ----
157 + /*-
158 + * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
159 + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
160 + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved.
161 + *
162 + * Redistribution and use in source and binary forms, with or without
163 + * modification, are permitted provided that the following conditions are met:
164 + *
165 + * a) Redistributions of source code must retain the above copyright notice,
166 + * this list of conditions and the following disclaimer.
167 + *
168 + * b) Redistributions in binary form must reproduce the above copyright
169 + * notice, this list of conditions and the following disclaimer in
170 + * the documentation and/or other materials provided with the distribution.
171 + *
172 + * c) Neither the name of Cisco Systems, Inc. nor the names of its
173 + * contributors may be used to endorse or promote products derived
174 + * from this software without specific prior written permission.
175 + *
176 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
177 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED T O,
178 + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURP OSE
179 + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
180 + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
181 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
182 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
183 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
184 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
185 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
186 + * THE POSSIBILITY OF SUCH DAMAGE.
187 + */
188 +
189 + #ifdef __FreeBSD__
190 + #include <sys/cdefs.h>
191 + __FBSDID("$FreeBSD$");
192 + #endif
193 +
194 + #ifndef __SCTP_OPENSSL_SHA1_h__
195 + #define __SCTP_OPENSSL_SHA1_h__
196 +
197 + #include <openssl/md5.h>
198 + #include <openssl/sha.h>
199 + /* 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.
201 + */
202 + typedef SHA_CTX SHA1_CTX;
203 +
204 + #endif
205 diff -NcrB 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
207 --- overrides/usrsctplib/netinet/sctp_os.h 2013-06-10 17:41:29.603102743 -0 700
208 ***************
209 *** 73,79 ****
210 #endif
211
212 #if defined(__APPLE__)
213 ! #include <netinet/sctp_os_macosx.h>
214 #endif
215
216 #if defined(__Panda__)
217 --- 73,80 ----
218 #endif
219
220 #if defined(__APPLE__)
221 ! #undef __APPLE__
222 ! // #include <netinet/sctp_os_macosx.h>
223 #endif
224
225 #if defined(__Panda__)
226 diff -NcrB 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
228 --- overrides/usrsctplib/netinet/sctp_os_userspace.h 2013-06-10 17:41:29.6031 02743 -0700
229 ***************
230 *** 992,1000 ****
231 #define SCTP_READ_RANDOM(buf, len) read_random(buf, len)
232
233
234 - #ifdef USE_SCTP_SHA1
235 #include <netinet/sctp_sha1.h>
236 - #else
237 #if 0 /*this was old _KERNEL code... */
238 #include <crypto/sha1.h>
239 /* map standard crypto API names */
240 --- 992,998 ----
241 ***************
242 *** 1002,1008 ****
243 #define SHA1_Update SHA1Update
244 #define SHA1_Final(x,y) SHA1Final((caddr_t)x, y)
245 #endif
246 - #endif
247
248 #if defined(HAVE_SHA2)
249 #include <crypto/sha2/sha2.h>
250 --- 1000,1005 ----
251 diff -NcrB usrsctplib/netinet/sctp_sha1.h overrides/usrsctplib/netinet/sctp_sha1 .h
252 *** usrsctplib/netinet/sctp_sha1.h 2013-06-10 17:42:32.483620614 -0700
253 --- overrides/usrsctplib/netinet/sctp_sha1.h 2013-06-10 17:41:29.603102743 -0 700
254 ***************
255 *** 36,46 ****
256 #endif
257
258
259 ! #ifndef __SCTP_SLA1_h__
260 ! #define __SCTP_SLA1_h__
261
262 #include <sys/types.h>
263 !
264 struct sha1_context {
265 unsigned int A;
266 unsigned int B;
267 --- 36,50 ----
268 #endif
269
270
271 ! #ifndef __SCTP_SHA1_h__
272 ! #define __SCTP_SHA1_h__
273
274 #include <sys/types.h>
275 ! #ifdef SCTP_USE_NSS_SHA1
276 ! #include <netinet/sctp_nss_sha1.h>
277 ! #elif SCTP_USE_OPENSSL_SHA1
278 ! #include <netinet/sctp_openssl_sha1.h>
279 ! #else // USE_SCTP_SHA1
280 struct sha1_context {
281 unsigned int A;
282 unsigned int B;
283 ***************
284 *** 96,98 ****
285 --- 100,103 ----
286
287 #endif /* _KERNEL */
288 #endif
289 + #endif
OLDNEW
« no previous file with comments | « third_party/usrsctp/README.chromium ('k') | third_party/usrsctp/overrides/usrsctplib/netinet/sctp_auth.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698