diff options
author | toyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-02 07:11:24 +0000 |
---|---|---|
committer | toyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-02 07:11:24 +0000 |
commit | 3fbb3988c279e972aa1fbb148602ac41711c7c49 (patch) | |
tree | c623f4618baa7ff1352cfcfad0e7909d1c6db5af | |
parent | d0da8afeb5e88ee9a47ec5659e4c2d8ba9c1f380 (diff) | |
download | chromium_src-3fbb3988c279e972aa1fbb148602ac41711c7c49.zip chromium_src-3fbb3988c279e972aa1fbb148602ac41711c7c49.tar.gz chromium_src-3fbb3988c279e972aa1fbb148602ac41711c7c49.tar.bz2 |
Revert 215206 "This fixes bugs in windows that Lally got upstrea..."
As ckocagil@chromium.org suggested in IRC, I try reverting this to fix
the XP bots failures.
> This fixes bugs in windows that Lally got upstream in usrsctp. This now enables the HAVE_SCTP flag for windows.
>
> BUG=
>
> Review URL: https://chromiumcodereview.appspot.com/19522005
TBR=ldixon@google.com, ckocagil@chromium.org
Review URL: https://codereview.chromium.org/21743002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215239 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | DEPS | 2 | ||||
-rw-r--r-- | third_party/libjingle/libjingle.gyp | 8 | ||||
-rw-r--r-- | third_party/usrsctp/README.chromium | 20 | ||||
-rw-r--r-- | third_party/usrsctp/localchanges.patch | 197 | ||||
-rw-r--r-- | third_party/usrsctp/overrides/usrsctplib/netinet/sctp_nss_sha1.c | 5 | ||||
-rw-r--r-- | third_party/usrsctp/overrides/usrsctplib/netinet/sctp_nss_sha1.h | 4 | ||||
-rw-r--r-- | third_party/usrsctp/overrides/usrsctplib/netinet/sctp_os_userspace.h | 24 | ||||
-rw-r--r-- | third_party/usrsctp/overrides/usrsctplib/netinet/sctp_sha1.h | 29 | ||||
-rw-r--r-- | third_party/usrsctp/usrsctp.gyp | 43 |
9 files changed, 113 insertions, 219 deletions
@@ -176,7 +176,7 @@ deps = { "src/third_party/usrsctp/usrsctplib": (Var("googlecode_url") % "sctp-refimpl") + - "/trunk/KERN/usrsctp/usrsctplib@8554", + "/trunk/KERN/usrsctp/usrsctplib@8463", "src/third_party/libsrtp": "/trunk/deps/third_party/libsrtp@214783", diff --git a/third_party/libjingle/libjingle.gyp b/third_party/libjingle/libjingle.gyp index e350e62..59e523d 100644 --- a/third_party/libjingle/libjingle.gyp +++ b/third_party/libjingle/libjingle.gyp @@ -776,8 +776,12 @@ }], # TODO(mallinath) - Enable SCTP for Android and iOS platforms. ['OS!="android" and OS!="ios"', { - 'defines': [ - 'HAVE_SCTP', + 'conditions': [ + ['OS!="win"', { + 'defines': [ + 'HAVE_SCTP', + ], + }], ], 'sources': [ '<(libjingle_source)/talk/media/sctp/sctpdataengine.cc', diff --git a/third_party/usrsctp/README.chromium b/third_party/usrsctp/README.chromium index a3224ea..087a03fc 100644 --- a/third_party/usrsctp/README.chromium +++ b/third_party/usrsctp/README.chromium @@ -2,14 +2,13 @@ Name: usrsctp URL: http://sctp-refimpl.googlecode.com/svn/trunk/KERN/usrsctp Version: 0 Date: 16 March 2013 -Revision: 8554 +Revision: 8439 License: New BSD License License File: LICENSE Security Critical: yes Description: -The usrsctplib provides implementation of SCTP protocol which fully supports -RFC 2960 +The usrsctplib provides implementation of SCTP protocol which fully supports RFC 2960 as well as updates and enhancements from the following Internet Drafts: draft-ietf-tsvwg-sctpcsum-05.txt draft-ietf-tsvwg-sctpimpguide-05.txt @@ -20,13 +19,8 @@ as well as updates and enhancements from the following Internet Drafts: draft-iyengar-sctp-cacc-00.txt Local Modifications: -usrsctplib provides its own SHA1 implementations as part of the library. Since -chrome already has the support of both NSS and OPENSSL which already -implementats SHA1, Chromium will not include the SHA1 from usrsctplib. - -Overrides folder has the necessary changes to strip the existing SHA1 -implementation in usrsctplib and use OPENSSL or NSS implementation based on the -platform type. - -To re-create the patch file run: -diff -PcrB usrsctplib overrides/usrsctplib > localchanges.patch +usrsctplib provides its own SHA1 implementations as part of the library. Since chrome +already has the support of both NSS and OPENSSL which already has the implementation +of SHA1, Chromium will not include the SHA1 from usrsctplib. +Overrides folder has the necessary changes to strip existing SHA1 implementation in +usrsctplib and use OPENSSL or NSS implementation based on the platform type. diff --git a/third_party/usrsctp/localchanges.patch b/third_party/usrsctp/localchanges.patch index 83029a8..b784a42 100644 --- a/third_party/usrsctp/localchanges.patch +++ b/third_party/usrsctp/localchanges.patch @@ -1,15 +1,6 @@ -Binary files usrsctplib/.DS_Store and overrides/usrsctplib/.DS_Store differ -Only in usrsctplib: .cvsignore -Only in usrsctplib: .git -Only in usrsctplib: Makefile.am -Only in usrsctplib: Makefile.nmake -Only in usrsctplib/netinet: sctp.h -Only in usrsctplib/netinet: sctp_asconf.c -Only in usrsctplib/netinet: sctp_asconf.h -Only in usrsctplib/netinet: sctp_auth.c -diff -PcrB usrsctplib/netinet/sctp_auth.h overrides/usrsctplib/netinet/sctp_auth.h -*** usrsctplib/netinet/sctp_auth.h 2013-07-26 05:00:15.000000000 -0400 ---- overrides/usrsctplib/netinet/sctp_auth.h 2013-06-18 11:40:34.000000000 -0400 +diff -NcrB usrsctplib/netinet/sctp_auth.h overrides/usrsctplib/netinet/sctp_auth.h +*** usrsctplib/netinet/sctp_auth.h 2013-06-10 17:41:59.323347517 -0700 +--- overrides/usrsctplib/netinet/sctp_auth.h 2013-06-10 17:44:55.584797436 -0700 *************** *** 38,43 **** --- 38,44 ---- @@ -20,30 +11,12 @@ diff -PcrB usrsctplib/netinet/sctp_auth.h overrides/usrsctplib/netinet/sctp_auth /* digest lengths */ #define SCTP_AUTH_DIGEST_LEN_SHA1 20 -Only in usrsctplib/netinet: sctp_bsd_addr.c -Only in usrsctplib/netinet: sctp_bsd_addr.h -Only in usrsctplib/netinet: sctp_callout.c -Only in usrsctplib/netinet: sctp_callout.h -Only in usrsctplib/netinet: sctp_cc_functions.c -Only in usrsctplib/netinet: sctp_constants.h -Only in usrsctplib/netinet: sctp_crc32.c -Only in usrsctplib/netinet: sctp_crc32.h -Only in usrsctplib/netinet: sctp_dtrace_declare.h -Only in usrsctplib/netinet: sctp_dtrace_define.h -Only in usrsctplib/netinet: sctp_hashdriver.c -Only in usrsctplib/netinet: sctp_hashdriver.h -Only in usrsctplib/netinet: sctp_header.h -Only in usrsctplib/netinet: sctp_indata.c -Only in usrsctplib/netinet: sctp_indata.h -Only in usrsctplib/netinet: sctp_input.c -Only in usrsctplib/netinet: sctp_input.h -Only in usrsctplib/netinet: sctp_lock_userspace.h -diff -PcrB usrsctplib/netinet/sctp_nss_sha1.c overrides/usrsctplib/netinet/sctp_nss_sha1.c -*** usrsctplib/netinet/sctp_nss_sha1.c 1969-12-31 19:00:00.000000000 -0500 ---- overrides/usrsctplib/netinet/sctp_nss_sha1.c 2013-07-29 21:32:35.000000000 -0400 +diff -NcrB usrsctplib/netinet/sctp_nss_sha1.c overrides/usrsctplib/netinet/sctp_nss_sha1.c +*** usrsctplib/netinet/sctp_nss_sha1.c 1969-12-31 16:00:00.000000000 -0800 +--- overrides/usrsctplib/netinet/sctp_nss_sha1.c 2013-06-10 17:41:29.603102743 -0700 *************** *** 0 **** ---- 1,64 ---- +--- 1,61 ---- + /*- + * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. @@ -84,9 +57,6 @@ diff -PcrB usrsctplib/netinet/sctp_nss_sha1.c overrides/usrsctplib/netinet/sctp_ + #ifdef SCTP_USE_NSS_SHA1 + #include <netinet/sctp_nss_sha1.h> + -+ /* A SHA-1 Digest is 160 bits, or 20 bytes */ -+ #define SHA_DIGEST_LENGTH (20) -+ + void + SCTP_NSS_SHA1_Init(struct sha1_context *ctx) + { @@ -104,13 +74,13 @@ diff -PcrB usrsctplib/netinet/sctp_nss_sha1.c overrides/usrsctplib/netinet/sctp_ + SCTP_NSS_SHA1_Final(unsigned char *digest, struct sha1_context *ctx) + { + unsigned int output_len = 0; -+ PK11_DigestFinal(ctx->pk11_ctx, digest, &output_len, SHA_DIGEST_LENGTH); ++ PK11_DigestFinal(ctx->pk11_ctx, digest, &output_len, sizeof(digest)); + PK11_DestroyContext(ctx->pk11_ctx, PR_TRUE); + } + #endif -diff -PcrB usrsctplib/netinet/sctp_nss_sha1.h overrides/usrsctplib/netinet/sctp_nss_sha1.h -*** usrsctplib/netinet/sctp_nss_sha1.h 1969-12-31 19:00:00.000000000 -0500 ---- overrides/usrsctplib/netinet/sctp_nss_sha1.h 2013-07-26 03:58:48.000000000 -0400 +diff -NcrB usrsctplib/netinet/sctp_nss_sha1.h overrides/usrsctplib/netinet/sctp_nss_sha1.h +*** usrsctplib/netinet/sctp_nss_sha1.h 1969-12-31 16:00:00.000000000 -0800 +--- overrides/usrsctplib/netinet/sctp_nss_sha1.h 2013-06-10 17:41:29.603102743 -0700 *************** *** 0 **** --- 1,64 ---- @@ -176,11 +146,11 @@ diff -PcrB usrsctplib/netinet/sctp_nss_sha1.h overrides/usrsctplib/netinet/sctp_ + #define SHA1_Update SCTP_NSS_SHA1_Update + #define SHA1_Final SCTP_NSS_SHA1_Final + -+ #endif /* _KERNEL */ -+ #endif /* __SCTP_NSS_SHA1_h__ */ -diff -PcrB usrsctplib/netinet/sctp_openssl_sha1.h overrides/usrsctplib/netinet/sctp_openssl_sha1.h -*** usrsctplib/netinet/sctp_openssl_sha1.h 1969-12-31 19:00:00.000000000 -0500 ---- overrides/usrsctplib/netinet/sctp_openssl_sha1.h 2013-06-18 11:40:34.000000000 -0400 ++ #endif /* _KERNEL */ ++ #endif +diff -NcrB usrsctplib/netinet/sctp_openssl_sha1.h overrides/usrsctplib/netinet/sctp_openssl_sha1.h +*** usrsctplib/netinet/sctp_openssl_sha1.h 1969-12-31 16:00:00.000000000 -0800 +--- overrides/usrsctplib/netinet/sctp_openssl_sha1.h 2013-06-10 17:41:29.603102743 -0700 *************** *** 0 **** --- 1,48 ---- @@ -232,9 +202,9 @@ diff -PcrB usrsctplib/netinet/sctp_openssl_sha1.h overrides/usrsctplib/netinet/s + typedef SHA_CTX SHA1_CTX; + + #endif -diff -PcrB usrsctplib/netinet/sctp_os.h overrides/usrsctplib/netinet/sctp_os.h -*** usrsctplib/netinet/sctp_os.h 2013-07-26 05:00:15.000000000 -0400 ---- overrides/usrsctplib/netinet/sctp_os.h 2013-06-18 11:40:34.000000000 -0400 +diff -NcrB usrsctplib/netinet/sctp_os.h overrides/usrsctplib/netinet/sctp_os.h +*** usrsctplib/netinet/sctp_os.h 2013-06-10 17:42:10.643440747 -0700 +--- overrides/usrsctplib/netinet/sctp_os.h 2013-06-10 17:41:29.603102743 -0700 *************** *** 73,79 **** #endif @@ -253,48 +223,34 @@ diff -PcrB usrsctplib/netinet/sctp_os.h overrides/usrsctplib/netinet/sctp_os.h #endif #if defined(__Panda__) -diff -PcrB usrsctplib/netinet/sctp_os_userspace.h overrides/usrsctplib/netinet/sctp_os_userspace.h -*** usrsctplib/netinet/sctp_os_userspace.h 2013-07-26 05:03:12.000000000 -0400 ---- overrides/usrsctplib/netinet/sctp_os_userspace.h 2013-07-26 04:46:41.000000000 -0400 +diff -NcrB usrsctplib/netinet/sctp_os_userspace.h overrides/usrsctplib/netinet/sctp_os_userspace.h +*** usrsctplib/netinet/sctp_os_userspace.h 2013-06-10 17:42:23.763548800 -0700 +--- overrides/usrsctplib/netinet/sctp_os_userspace.h 2013-06-10 17:41:29.603102743 -0700 *************** -*** 996,1012 **** +*** 992,1000 **** #define SCTP_READ_RANDOM(buf, len) read_random(buf, len) - #ifdef USE_SCTP_SHA1 #include <netinet/sctp_sha1.h> -! #else -! #if 0 /*this was old _KERNEL code... */ -! #include <crypto/sha1.h> -! /* map standard crypto API names */ -! #define SHA1_Init SHA1Init -! #define SHA1_Update SHA1Update -! #define SHA1_Final(x,y) SHA1Final((caddr_t)x, y) -! #endif -! #endif - - #if defined(HAVE_SHA2) - #include <crypto/sha2/sha2.h> ---- 996,1003 ---- - #define SCTP_READ_RANDOM(buf, len) read_random(buf, len) - - - #include <netinet/sctp_sha1.h> -! +- #else + #if 0 /*this was old _KERNEL code... */ + #include <crypto/sha1.h> + /* map standard crypto API names */ +--- 992,998 ---- +*************** +*** 1002,1008 **** + #define SHA1_Update SHA1Update + #define SHA1_Final(x,y) SHA1Final((caddr_t)x, y) + #endif +- #endif #if defined(HAVE_SHA2) #include <crypto/sha2/sha2.h> -Only in usrsctplib/netinet: sctp_output.c -Only in usrsctplib/netinet: sctp_output.h -Only in usrsctplib/netinet: sctp_pcb.c -Only in usrsctplib/netinet: sctp_pcb.h -Only in usrsctplib/netinet: sctp_peeloff.c -Only in usrsctplib/netinet: sctp_peeloff.h -Only in usrsctplib/netinet: sctp_process_lock.h -Only in usrsctplib/netinet: sctp_sha1.c -diff -PcrB usrsctplib/netinet/sctp_sha1.h overrides/usrsctplib/netinet/sctp_sha1.h -*** usrsctplib/netinet/sctp_sha1.h 2013-07-26 05:00:15.000000000 -0400 ---- overrides/usrsctplib/netinet/sctp_sha1.h 2013-07-29 23:00:51.000000000 -0400 +--- 1000,1005 ---- +diff -NcrB usrsctplib/netinet/sctp_sha1.h overrides/usrsctplib/netinet/sctp_sha1.h +*** usrsctplib/netinet/sctp_sha1.h 2013-06-10 17:42:32.483620614 -0700 +--- overrides/usrsctplib/netinet/sctp_sha1.h 2013-06-10 17:41:29.603102743 -0700 *************** *** 36,46 **** #endif @@ -304,11 +260,11 @@ diff -PcrB usrsctplib/netinet/sctp_sha1.h overrides/usrsctplib/netinet/sctp_sha1 ! #define __SCTP_SLA1_h__ #include <sys/types.h> - +! struct sha1_context { unsigned int A; unsigned int B; ---- 36,69 ---- +--- 36,50 ---- #endif @@ -316,73 +272,18 @@ diff -PcrB usrsctplib/netinet/sctp_sha1.h overrides/usrsctplib/netinet/sctp_sha1 ! #define __SCTP_SHA1_h__ #include <sys/types.h> - -+ #if !defined(SSL_USE_OPENSSL) && !defined(SSL_USE_NSS) -+ #if defined(WIN32) -+ -+ #define SCTP_USE_SCTP_SHA1 1 -+ -+ #else // defined(WIN32) -+ -+ #if defined(HAVE_OPENSSL_SSL_H) -+ #define SSL_USE_OPENSSL 1 -+ #elif defined(HAVE_NSS_SSL_H) -+ #define SSL_USE_NSS 1 -+ #else -+ #define SCTP_USE_SCTP_SHA1 -+ #endif -+ -+ #endif // !defined(WIN32) -+ #endif -+ -+ #if defined(SSL_USE_NSS) -+ #include <netinet/sctp_nss_sha1.h> -+ #elif defined(SSL_USE_OPENSSL) -+ #include <netinet/sctp_openssl_sha1.h> -+ #else // SCTP_USE_SCTP_SHA1 +! #ifdef SCTP_USE_NSS_SHA1 +! #include <netinet/sctp_nss_sha1.h> +! #elif SCTP_USE_OPENSSL_SHA1 +! #include <netinet/sctp_openssl_sha1.h> +! #else // USE_SCTP_SHA1 struct sha1_context { unsigned int A; unsigned int B; *************** -*** 95,98 **** - void SHA1_Final(unsigned char *, struct sha1_context *); +*** 96,98 **** +--- 100,103 ---- #endif /* _KERNEL */ -! #endif ---- 118,122 ---- - void SHA1_Final(unsigned char *, struct sha1_context *); - - #endif /* _KERNEL */ -! #endif /* !defined(SSL_USE_OPENSSL) && !defined(SSL_USE_NSS) */ -! #endif /* __SCTP_SHA1_h__ */ -Only in usrsctplib/netinet: sctp_ss_functions.c -Only in usrsctplib/netinet: sctp_structs.h -Only in usrsctplib/netinet: sctp_sysctl.c -Only in usrsctplib/netinet: sctp_sysctl.h -Only in usrsctplib/netinet: sctp_timer.c -Only in usrsctplib/netinet: sctp_timer.h -Only in usrsctplib/netinet: sctp_uio.h -Only in usrsctplib/netinet: sctp_userspace.c -Only in usrsctplib/netinet: sctp_usrreq.c -Only in usrsctplib/netinet: sctp_var.h -Only in usrsctplib/netinet: sctputil.c -Only in usrsctplib/netinet: sctputil.h -Only in usrsctplib: netinet6 -Only in usrsctplib: user_atomic.h -Only in usrsctplib: user_environment.c -Only in usrsctplib: user_environment.h -Only in usrsctplib: user_inpcb.h -Only in usrsctplib: user_ip6_var.h -Only in usrsctplib: user_ip_icmp.h -Only in usrsctplib: user_malloc.h -Only in usrsctplib: user_mbuf.c -Only in usrsctplib: user_mbuf.h -Only in usrsctplib: user_queue.h -Only in usrsctplib: user_recv_thread.c -Only in usrsctplib: user_recv_thread.h -Only in usrsctplib: user_route.h -Only in usrsctplib: user_sctp_timer_iterate.c -Only in usrsctplib: user_socket.c -Only in usrsctplib: user_socketvar.h -Only in usrsctplib: user_uma.h -Only in usrsctplib: usrsctp.h + #endif ++ #endif diff --git a/third_party/usrsctp/overrides/usrsctplib/netinet/sctp_nss_sha1.c b/third_party/usrsctp/overrides/usrsctplib/netinet/sctp_nss_sha1.c index b87ff71..2274f8c 100644 --- a/third_party/usrsctp/overrides/usrsctplib/netinet/sctp_nss_sha1.c +++ b/third_party/usrsctp/overrides/usrsctplib/netinet/sctp_nss_sha1.c @@ -38,9 +38,6 @@ __FBSDID("$FreeBSD$"); #ifdef SCTP_USE_NSS_SHA1 #include <netinet/sctp_nss_sha1.h> -/* A SHA-1 Digest is 160 bits, or 20 bytes */ -#define SHA_DIGEST_LENGTH (20) - void SCTP_NSS_SHA1_Init(struct sha1_context *ctx) { @@ -58,7 +55,7 @@ void SCTP_NSS_SHA1_Final(unsigned char *digest, struct sha1_context *ctx) { unsigned int output_len = 0; - PK11_DigestFinal(ctx->pk11_ctx, digest, &output_len, SHA_DIGEST_LENGTH); + PK11_DigestFinal(ctx->pk11_ctx, digest, &output_len, sizeof(digest)); PK11_DestroyContext(ctx->pk11_ctx, PR_TRUE); } #endif diff --git a/third_party/usrsctp/overrides/usrsctplib/netinet/sctp_nss_sha1.h b/third_party/usrsctp/overrides/usrsctplib/netinet/sctp_nss_sha1.h index ba58440..85e721d 100644 --- a/third_party/usrsctp/overrides/usrsctplib/netinet/sctp_nss_sha1.h +++ b/third_party/usrsctp/overrides/usrsctplib/netinet/sctp_nss_sha1.h @@ -60,5 +60,5 @@ typedef struct sha1_context SHA1_CTX; #define SHA1_Update SCTP_NSS_SHA1_Update #define SHA1_Final SCTP_NSS_SHA1_Final -#endif /* _KERNEL */ -#endif /* __SCTP_NSS_SHA1_h__ */ +#endif /* _KERNEL */ +#endif diff --git a/third_party/usrsctp/overrides/usrsctplib/netinet/sctp_os_userspace.h b/third_party/usrsctp/overrides/usrsctplib/netinet/sctp_os_userspace.h index 709e44d..7e977f7 100644 --- a/third_party/usrsctp/overrides/usrsctplib/netinet/sctp_os_userspace.h +++ b/third_party/usrsctp/overrides/usrsctplib/netinet/sctp_os_userspace.h @@ -44,6 +44,8 @@ #if defined(__Userspace_os_Windows) #include <winsock2.h> #include <ws2tcpip.h> +#include <ws2ipdef.h> +#include <ws2def.h> #include <iphlpapi.h> #include <Mswsock.h> #include <Windows.h> @@ -61,10 +63,6 @@ typedef struct CRITICAL_SECTION waiters_count_lock; HANDLE events_[C_MAX_EVENTS]; } userland_cond_t; -void InitializeXPConditionVariable(userland_cond_t *); -void DeleteXPConditionVariable(userland_cond_t *); -int SleepXPConditionVariable(userland_cond_t *, userland_mutex_t *); -void WakeAllXPConditionVariable(userland_cond_t *); #define InitializeConditionVariable(cond) InitializeXPConditionVariable(cond) #define DeleteConditionVariable(cond) DeleteXPConditionVariable(cond) #define SleepConditionVariableCS(cond, mtx, time) SleepXPConditionVariable(cond, mtx) @@ -212,10 +210,8 @@ typedef HANDLE userland_thread_t; typedef char* caddr_t; -int Win_getifaddrs(struct ifaddrs**); #define getifaddrs(interfaces) (int)Win_getifaddrs(interfaces) -int win_if_nametoindex(const char *); -#define if_nametoindex(x) win_if_nametoindex(x) +#define if_nametoindex(x) (int)win_if_nametoindex(x) #define bzero(buf, len) memset(buf, 0, len) #define bcopy(srcKey, dstKey, len) memcpy(dstKey, srcKey, len) @@ -415,18 +411,18 @@ struct sx {int dummy;}; #else #include <sys/queue.h> #endif -#include <user_malloc.h> /* #include <sys/kernel.h> */ /* #include <sys/sysctl.h> */ /* #include <sys/protosw.h> */ /* on FreeBSD, this results in a redefintion of SOCK(BUF)_(UN)LOCK and * uknown type of struct mtx for sb_mtx in struct sockbuf */ -#include "user_socketvar.h" /* MALLOC_DECLARE's M_PCB. Replacement for sys/socketvar.h */ /* #include <sys/jail.h> */ /* #include <sys/sysctl.h> */ -#include <user_environment.h> #include <user_atomic.h> +#include <user_environment.h> +#include <user_malloc.h> #include <user_mbuf.h> +#include "user_socketvar.h" /* MALLOC_DECLARE's M_PCB. Replacement for sys/socketvar.h */ /* #include <sys/uio.h> */ /* #include <sys/lock.h> */ #if defined(__FreeBSD__) && __FreeBSD_version > 602000 @@ -997,7 +993,13 @@ int sctp_userspace_get_mtu_from_ifn(uint32_t if_index, int af); #include <netinet/sctp_sha1.h> - +#if 0 /*this was old _KERNEL code... */ +#include <crypto/sha1.h> +/* map standard crypto API names */ +#define SHA1_Init SHA1Init +#define SHA1_Update SHA1Update +#define SHA1_Final(x,y) SHA1Final((caddr_t)x, y) +#endif #if defined(HAVE_SHA2) #include <crypto/sha2/sha2.h> diff --git a/third_party/usrsctp/overrides/usrsctplib/netinet/sctp_sha1.h b/third_party/usrsctp/overrides/usrsctplib/netinet/sctp_sha1.h index 006e920..4000e41 100644 --- a/third_party/usrsctp/overrides/usrsctplib/netinet/sctp_sha1.h +++ b/third_party/usrsctp/overrides/usrsctplib/netinet/sctp_sha1.h @@ -40,30 +40,11 @@ __FBSDID("$FreeBSD$"); #define __SCTP_SHA1_h__ #include <sys/types.h> - -#if !defined(SSL_USE_OPENSSL) && !defined(SSL_USE_NSS) -#if defined(WIN32) - -#define SCTP_USE_SCTP_SHA1 1 - -#else // defined(WIN32) - -#if defined(HAVE_OPENSSL_SSL_H) -#define SSL_USE_OPENSSL 1 -#elif defined(HAVE_NSS_SSL_H) -#define SSL_USE_NSS 1 -#else -#define SCTP_USE_SCTP_SHA1 -#endif - -#endif // !defined(WIN32) -#endif - -#if defined(SSL_USE_NSS) +#ifdef SCTP_USE_NSS_SHA1 #include <netinet/sctp_nss_sha1.h> -#elif defined(SSL_USE_OPENSSL) +#elif SCTP_USE_OPENSSL_SHA1 #include <netinet/sctp_openssl_sha1.h> -#else // SCTP_USE_SCTP_SHA1 +#else // USE_SCTP_SHA1 struct sha1_context { unsigned int A; unsigned int B; @@ -118,5 +99,5 @@ void SHA1_Update(struct sha1_context *, const unsigned char *, int); void SHA1_Final(unsigned char *, struct sha1_context *); #endif /* _KERNEL */ -#endif /* !defined(SSL_USE_OPENSSL) && !defined(SSL_USE_NSS) */ -#endif /* __SCTP_SHA1_h__ */ +#endif +#endif diff --git a/third_party/usrsctp/usrsctp.gyp b/third_party/usrsctp/usrsctp.gyp index d273385..9285e21 100644 --- a/third_party/usrsctp/usrsctp.gyp +++ b/third_party/usrsctp/usrsctp.gyp @@ -7,6 +7,7 @@ }, 'target_defaults': { 'defines': [ + 'INET', 'SCTP_PROCESS_LEVEL_LOCKS', 'SCTP_SIMPLE_ALLOCATOR', '__Userspace__', @@ -31,27 +32,19 @@ 'conditions': [ ['use_openssl==1', { 'defines': [ - 'SSL_USE_OPENSSL', + 'SCTP_USE_OPENSSL_SHA1', ], 'dependencies': [ - '<(DEPTH)/third_party/openssl/openssl.gyp:openssl', - ], - 'sources': [ - 'overrides/usrsctplib/netinet/sctp_openssl_sha1.h', + '../../third_party/openssl/openssl.gyp:openssl', ], }, { # else use_openssl==0, use NSS. 'defines' : [ - 'SSL_USE_NSS', 'SCTP_USE_NSS_SHA1', ], - 'sources': [ - 'overrides/usrsctplib/netinet/sctp_nss_sha1.c', - 'overrides/usrsctplib/netinet/sctp_nss_sha1.h', - ], 'conditions': [ ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', { - 'dependencies': [ # The system.gyp:ssl dependency includes nss + 'dependencies': [ '<(DEPTH)/build/linux/system.gyp:ssl', ], }], @@ -73,7 +66,9 @@ 'overrides/usrsctplib/netinet/sctp_auth.h', 'overrides/usrsctplib/netinet/sctp_os.h', 'overrides/usrsctplib/netinet/sctp_os_userspace.h', - 'overrides/usrsctplib/netinet/sctp_sha1.h', + 'overrides/usrsctplib/netinet/sctp_nss_sha1.c', + 'overrides/usrsctplib/netinet/sctp_nss_sha1.h', + 'usrsctplib/usrsctp.h', 'usrsctplib/user_atomic.h', 'usrsctplib/user_environment.c', @@ -102,6 +97,8 @@ 'usrsctplib/netinet/sctp_constants.h', 'usrsctplib/netinet/sctp_crc32.c', 'usrsctplib/netinet/sctp_crc32.h', + 'usrsctplib/netinet/sctp_hashdriver.h', + 'usrsctplib/netinet/sctp_hashdriver.c', 'usrsctplib/netinet/sctp_header.h', 'usrsctplib/netinet/sctp_indata.c', 'usrsctplib/netinet/sctp_indata.h', @@ -126,10 +123,23 @@ 'usrsctplib/netinet/sctputil.c', 'usrsctplib/netinet/sctputil.h', 'usrsctplib/netinet/sctp_var.h', + 'usrsctplib/netinet6/sctp6_usrreq.c', + 'usrsctplib/netinet6/sctp6_var.h', ], # sources 'conditions': [ + ['use_openssl==1', { + 'sources!': [ + 'overrides/usrsctplib/netinet/sctp_nss_sha1.c', + 'overrides/usrsctplib/netinet/sctp_nss_sha1.h', + ], + 'sources': [ + 'overrides/usrsctplib/netinet/sctp_openssl_sha1.h', + ], + }], ['OS=="linux"', { 'defines': [ + 'HAVE_INET_ADDR', + 'HAVE_SOCKET', '__Userspace_os_Linux', ], 'cflags!': [ '-Werror', '-Wall' ], @@ -137,8 +147,13 @@ }], ['OS=="mac"', { 'defines': [ + 'HAVE_INET_ADDR', 'HAVE_SA_LEN', 'HAVE_SCONN_LEN', + 'HAVE_SIN6_LEN', + 'HAVE_SIN_LEN', + 'HAVE_SOCKET', + 'INET6', '__APPLE_USE_RFC_2292', '__Userspace_os_Darwin', ], @@ -150,12 +165,12 @@ }], ['OS=="win"', { 'defines': [ + 'INET6', '__Userspace_os_Windows', ], 'cflags!': [ '/W3', '/WX' ], 'cflags': [ '/w' ], - # TODO(ldixon) : Remove this disabling of warnings by pushing a - # fix upstream to usrsctp + # TODO(ldixon) : Remove this disable. 'msvs_disabled_warnings': [ 4700, 4013, 4018, 4133, 4267 ], }, { # OS != "win", 'defines': [ |