1Binary files usrsctplib/.DS_Store and overrides/usrsctplib/.DS_Store differ 2Only in usrsctplib: .cvsignore 3Only in usrsctplib: .git 4Only in usrsctplib: Makefile.am 5Only in usrsctplib: Makefile.nmake 6Only in usrsctplib/netinet: sctp.h 7Only in usrsctplib/netinet: sctp_asconf.c 8Only in usrsctplib/netinet: sctp_asconf.h 9Only in usrsctplib/netinet: sctp_auth.c 10diff -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 -0400 13*************** 14*** 38,43 **** 15--- 38,44 ---- 16 #ifndef _NETINET_SCTP_AUTH_H_ 17 #define _NETINET_SCTP_AUTH_H_ 18 19+ #include <netinet/sctp_sha1.h> 20 21 /* digest lengths */ 22 #define SCTP_AUTH_DIGEST_LEN_SHA1 20 23Only in usrsctplib/netinet: sctp_bsd_addr.c 24Only in usrsctplib/netinet: sctp_bsd_addr.h 25Only in usrsctplib/netinet: sctp_callout.c 26Only in usrsctplib/netinet: sctp_callout.h 27Only in usrsctplib/netinet: sctp_cc_functions.c 28Only in usrsctplib/netinet: sctp_constants.h 29Only in usrsctplib/netinet: sctp_crc32.c 30Only in usrsctplib/netinet: sctp_crc32.h 31Only in usrsctplib/netinet: sctp_dtrace_declare.h 32Only in usrsctplib/netinet: sctp_dtrace_define.h 33Only in usrsctplib/netinet: sctp_hashdriver.c 34Only in usrsctplib/netinet: sctp_hashdriver.h 35Only in usrsctplib/netinet: sctp_header.h 36Only in usrsctplib/netinet: sctp_indata.c 37Only in usrsctplib/netinet: sctp_indata.h 38Only in usrsctplib/netinet: sctp_input.c 39Only in usrsctplib/netinet: sctp_input.h 40Only in usrsctplib/netinet: sctp_lock_userspace.h 41diff -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.000000000 -0400 44*************** 45*** 0 **** 46--- 1,64 ---- 47+ /*- 48+ * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. 49+ * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. 50+ * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. 51+ * 52+ * Redistribution and use in source and binary forms, with or without 53+ * modification, are permitted provided that the following conditions are met: 54+ * 55+ * a) Redistributions of source code must retain the above copyright notice, 56+ * this list of conditions and the following disclaimer. 57+ * 58+ * b) Redistributions in binary form must reproduce the above copyright 59+ * notice, this list of conditions and the following disclaimer in 60+ * the documentation and/or other materials provided with the distribution. 61+ * 62+ * c) Neither the name of Cisco Systems, Inc. nor the names of its 63+ * contributors may be used to endorse or promote products derived 64+ * from this software without specific prior written permission. 65+ * 66+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 67+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 68+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 69+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 70+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 71+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 72+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 73+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 74+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 75+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 76+ * THE POSSIBILITY OF SUCH DAMAGE. 77+ */ 78+ 79+ #ifdef __FreeBSD__ 80+ #include <sys/cdefs.h> 81+ __FBSDID("$FreeBSD$"); 82+ #endif 83+ 84+ #ifdef SCTP_USE_NSS_SHA1 85+ #include <netinet/sctp_nss_sha1.h> 86+ 87+ /* A SHA-1 Digest is 160 bits, or 20 bytes */ 88+ #define SHA_DIGEST_LENGTH (20) 89+ 90+ void 91+ SCTP_NSS_SHA1_Init(struct sha1_context *ctx) 92+ { 93+ ctx->pk11_ctx = PK11_CreateDigestContext(SEC_OID_SHA1); 94+ PK11_DigestBegin(ctx->pk11_ctx); 95+ } 96+ 97+ void 98+ SCTP_NSS_SHA1_Update(struct sha1_context *ctx, const unsigned char *ptr, int siz) 99+ { 100+ PK11_DigestOp(ctx->pk11_ctx, ptr, siz); 101+ } 102+ 103+ void 104+ SCTP_NSS_SHA1_Final(unsigned char *digest, struct sha1_context *ctx) 105+ { 106+ unsigned int output_len = 0; 107+ PK11_DigestFinal(ctx->pk11_ctx, digest, &output_len, SHA_DIGEST_LENGTH); 108+ PK11_DestroyContext(ctx->pk11_ctx, PR_TRUE); 109+ } 110+ #endif 111diff -PcrB usrsctplib/netinet/sctp_nss_sha1.h overrides/usrsctplib/netinet/sctp_nss_sha1.h 112*** usrsctplib/netinet/sctp_nss_sha1.h 1969-12-31 19:00:00.000000000 -0500 113--- overrides/usrsctplib/netinet/sctp_nss_sha1.h 2013-07-26 03:58:48.000000000 -0400 114*************** 115*** 0 **** 116--- 1,64 ---- 117+ /*- 118+ * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. 119+ * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. 120+ * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. 121+ * 122+ * Redistribution and use in source and binary forms, with or without 123+ * modification, are permitted provided that the following conditions are met: 124+ * 125+ * a) Redistributions of source code must retain the above copyright notice, 126+ * this list of conditions and the following disclaimer. 127+ * 128+ * b) Redistributions in binary form must reproduce the above copyright 129+ * notice, this list of conditions and the following disclaimer in 130+ * the documentation and/or other materials provided with the distribution. 131+ * 132+ * c) Neither the name of Cisco Systems, Inc. nor the names of its 133+ * contributors may be used to endorse or promote products derived 134+ * from this software without specific prior written permission. 135+ * 136+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 137+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 138+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 139+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 140+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 141+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 142+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 143+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 144+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 145+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 146+ * THE POSSIBILITY OF SUCH DAMAGE. 147+ */ 148+ 149+ #ifdef __FreeBSD__ 150+ #include <sys/cdefs.h> 151+ __FBSDID("$FreeBSD$"); 152+ #endif 153+ 154+ #ifndef __SCTP_NSS_SHA1_h__ 155+ #define __SCTP_NSS_SHA1_h__ 156+ 157+ #ifdef __Userspace_os_Darwin 158+ #define __APPLE__ 159+ #endif 160+ 161+ #include <sys/types.h> 162+ #include <pk11pub.h> 163+ 164+ #ifdef __Userspace_os_Darwin 165+ #undef __APPLE__ 166+ #endif 167+ 168+ struct sha1_context { 169+ struct PK11Context *pk11_ctx; 170+ }; // Opaque structure. 171+ 172+ typedef struct sha1_context SHA1_CTX; 173+ 174+ #if defined(_KERNEL) || defined(__Userspace__) 175+ #define SHA1_Init SCTP_NSS_SHA1_Init 176+ #define SHA1_Update SCTP_NSS_SHA1_Update 177+ #define SHA1_Final SCTP_NSS_SHA1_Final 178+ 179+ #endif /* _KERNEL */ 180+ #endif /* __SCTP_NSS_SHA1_h__ */ 181diff -PcrB usrsctplib/netinet/sctp_openssl_sha1.h overrides/usrsctplib/netinet/sctp_openssl_sha1.h 182*** usrsctplib/netinet/sctp_openssl_sha1.h 1969-12-31 19:00:00.000000000 -0500 183--- overrides/usrsctplib/netinet/sctp_openssl_sha1.h 2013-06-18 11:40:34.000000000 -0400 184*************** 185*** 0 **** 186--- 1,48 ---- 187+ /*- 188+ * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. 189+ * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. 190+ * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. 191+ * 192+ * Redistribution and use in source and binary forms, with or without 193+ * modification, are permitted provided that the following conditions are met: 194+ * 195+ * a) Redistributions of source code must retain the above copyright notice, 196+ * this list of conditions and the following disclaimer. 197+ * 198+ * b) Redistributions in binary form must reproduce the above copyright 199+ * notice, this list of conditions and the following disclaimer in 200+ * the documentation and/or other materials provided with the distribution. 201+ * 202+ * c) Neither the name of Cisco Systems, Inc. nor the names of its 203+ * contributors may be used to endorse or promote products derived 204+ * from this software without specific prior written permission. 205+ * 206+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 207+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 208+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 209+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 210+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 211+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 212+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 213+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 214+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 215+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 216+ * THE POSSIBILITY OF SUCH DAMAGE. 217+ */ 218+ 219+ #ifdef __FreeBSD__ 220+ #include <sys/cdefs.h> 221+ __FBSDID("$FreeBSD$"); 222+ #endif 223+ 224+ #ifndef __SCTP_OPENSSL_SHA1_h__ 225+ #define __SCTP_OPENSSL_SHA1_h__ 226+ 227+ #include <openssl/md5.h> 228+ #include <openssl/sha.h> 229+ /* libssl-dev calls this SHA_CTX, but it's refered to as SHA1_CTX within the 230+ * SCTP stack code so here we typedef (or macro?) to equate the two. 231+ */ 232+ typedef SHA_CTX SHA1_CTX; 233+ 234+ #endif 235diff -PcrB usrsctplib/netinet/sctp_os.h overrides/usrsctplib/netinet/sctp_os.h 236*** usrsctplib/netinet/sctp_os.h 2013-07-26 05:00:15.000000000 -0400 237--- overrides/usrsctplib/netinet/sctp_os.h 2013-06-18 11:40:34.000000000 -0400 238*************** 239*** 73,79 **** 240 #endif 241 242 #if defined(__APPLE__) 243! #include <netinet/sctp_os_macosx.h> 244 #endif 245 246 #if defined(__Panda__) 247--- 73,80 ---- 248 #endif 249 250 #if defined(__APPLE__) 251! #undef __APPLE__ 252! // #include <netinet/sctp_os_macosx.h> 253 #endif 254 255 #if defined(__Panda__) 256diff -PcrB usrsctplib/netinet/sctp_os_userspace.h overrides/usrsctplib/netinet/sctp_os_userspace.h 257*** usrsctplib/netinet/sctp_os_userspace.h 2013-07-26 05:03:12.000000000 -0400 258--- overrides/usrsctplib/netinet/sctp_os_userspace.h 2013-07-26 04:46:41.000000000 -0400 259*************** 260*** 996,1012 **** 261 #define SCTP_READ_RANDOM(buf, len) read_random(buf, len) 262 263 264- #ifdef USE_SCTP_SHA1 265 #include <netinet/sctp_sha1.h> 266! #else 267! #if 0 /*this was old _KERNEL code... */ 268! #include <crypto/sha1.h> 269! /* map standard crypto API names */ 270! #define SHA1_Init SHA1Init 271! #define SHA1_Update SHA1Update 272! #define SHA1_Final(x,y) SHA1Final((caddr_t)x, y) 273! #endif 274! #endif 275 276 #if defined(HAVE_SHA2) 277 #include <crypto/sha2/sha2.h> 278--- 996,1003 ---- 279 #define SCTP_READ_RANDOM(buf, len) read_random(buf, len) 280 281 282 #include <netinet/sctp_sha1.h> 283! 284 285 #if defined(HAVE_SHA2) 286 #include <crypto/sha2/sha2.h> 287Only in usrsctplib/netinet: sctp_output.c 288Only in usrsctplib/netinet: sctp_output.h 289Only in usrsctplib/netinet: sctp_pcb.c 290Only in usrsctplib/netinet: sctp_pcb.h 291Only in usrsctplib/netinet: sctp_peeloff.c 292Only in usrsctplib/netinet: sctp_peeloff.h 293Only in usrsctplib/netinet: sctp_process_lock.h 294Only in usrsctplib/netinet: sctp_sha1.c 295diff -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 -0400 298*************** 299*** 36,46 **** 300 #endif 301 302 303! #ifndef __SCTP_SLA1_h__ 304! #define __SCTP_SLA1_h__ 305 306 #include <sys/types.h> 307 308 struct sha1_context { 309 unsigned int A; 310 unsigned int B; 311--- 36,69 ---- 312 #endif 313 314 315! #ifndef __SCTP_SHA1_h__ 316! #define __SCTP_SHA1_h__ 317 318 #include <sys/types.h> 319 320+ #if !defined(SSL_USE_OPENSSL) && !defined(SSL_USE_NSS) 321+ #if defined(WIN32) 322+ 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 343 struct sha1_context { 344 unsigned int A; 345 unsigned int B; 346*************** 347*** 95,98 **** 348 void SHA1_Final(unsigned char *, struct sha1_context *); 349 350 #endif /* _KERNEL */ 351! #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__ */ 358Only in usrsctplib/netinet: sctp_ss_functions.c 359Only in usrsctplib/netinet: sctp_structs.h 360Only in usrsctplib/netinet: sctp_sysctl.c 361Only in usrsctplib/netinet: sctp_sysctl.h 362Only in usrsctplib/netinet: sctp_timer.c 363Only in usrsctplib/netinet: sctp_timer.h 364Only in usrsctplib/netinet: sctp_uio.h 365Only in usrsctplib/netinet: sctp_userspace.c 366Only in usrsctplib/netinet: sctp_usrreq.c 367Only in usrsctplib/netinet: sctp_var.h 368Only in usrsctplib/netinet: sctputil.c 369Only in usrsctplib/netinet: sctputil.h 370Only in usrsctplib: netinet6 371Only in usrsctplib: user_atomic.h 372Only in usrsctplib: user_environment.c 373Only in usrsctplib: user_environment.h 374Only in usrsctplib: user_inpcb.h 375Only in usrsctplib: user_ip6_var.h 376Only in usrsctplib: user_ip_icmp.h 377Only in usrsctplib: user_malloc.h 378Only in usrsctplib: user_mbuf.c 379Only in usrsctplib: user_mbuf.h 380Only in usrsctplib: user_queue.h 381Only in usrsctplib: user_recv_thread.c 382Only in usrsctplib: user_recv_thread.h 383Only in usrsctplib: user_route.h 384Only in usrsctplib: user_sctp_timer_iterate.c 385Only in usrsctplib: user_socket.c 386Only in usrsctplib: user_socketvar.h 387Only in usrsctplib: user_uma.h 388Only in usrsctplib: usrsctp.h 389