OLD | NEW |
(Empty) | |
| 1 diff -NcrB usrsctplib/netinet/sctp_auth.h overrides/usrsctplib/netinet/sctp_auth
.h |
| 2 *** usrsctplib/netinet/sctp_auth.h 2013-06-10 15:17:59.452245360 -0700 |
| 3 --- overrides/usrsctplib/netinet/sctp_auth.h 2013-06-10 15:16:39.541591630 -0
700 |
| 4 *************** |
| 5 *** 38,43 **** |
| 6 --- 38,46 ---- |
| 7 #ifndef _NETINET_SCTP_AUTH_H_ |
| 8 #define _NETINET_SCTP_AUTH_H_ |
| 9 |
| 10 + #ifdef SCTP_USE_NSS_SHA1 |
| 11 + #include <netinet/sctp_sha1.h> |
| 12 + #endif |
| 13 |
| 14 /* digest lengths */ |
| 15 #define SCTP_AUTH_DIGEST_LEN_SHA1 20 |
| 16 diff -NcrB usrsctplib/netinet/sctp_nss_sha1.c overrides/usrsctplib/netinet/sctp_
nss_sha1.c |
| 17 *** usrsctplib/netinet/sctp_nss_sha1.c 1969-12-31 16:00:00.000000000 -0800 |
| 18 --- overrides/usrsctplib/netinet/sctp_nss_sha1.c 2013-06-10 15:16:39.5415
91630 -0700 |
| 19 *************** |
| 20 *** 0 **** |
| 21 --- 1,61 ---- |
| 22 + /*- |
| 23 + * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. |
| 24 + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. |
| 25 + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. |
| 26 + * |
| 27 + * Redistribution and use in source and binary forms, with or without |
| 28 + * modification, are permitted provided that the following conditions are met: |
| 29 + * |
| 30 + * a) Redistributions of source code must retain the above copyright notice, |
| 31 + * this list of conditions and the following disclaimer. |
| 32 + * |
| 33 + * b) Redistributions in binary form must reproduce the above copyright |
| 34 + * notice, this list of conditions and the following disclaimer in |
| 35 + * the documentation and/or other materials provided with the distribution. |
| 36 + * |
| 37 + * c) Neither the name of Cisco Systems, Inc. nor the names of its |
| 38 + * contributors may be used to endorse or promote products derived |
| 39 + * from this software without specific prior written permission. |
| 40 + * |
| 41 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 42 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED T
O, |
| 43 + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURP
OSE |
| 44 + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
| 45 + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 46 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 47 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 48 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 49 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 50 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
| 51 + * THE POSSIBILITY OF SUCH DAMAGE. |
| 52 + */ |
| 53 + |
| 54 + #ifdef __FreeBSD__ |
| 55 + #include <sys/cdefs.h> |
| 56 + __FBSDID("$FreeBSD$"); |
| 57 + #endif |
| 58 + |
| 59 + #ifdef SCTP_USE_NSS_SHA1 |
| 60 + #include <netinet/sctp_sha1.h> |
| 61 + |
| 62 + void |
| 63 + SCTP_NSS_SHA1_Init(struct sha1_context *ctx) |
| 64 + { |
| 65 + ctx->pk11_ctx = PK11_CreateDigestContext(SEC_OID_SHA1); |
| 66 + PK11_DigestBegin(ctx->pk11_ctx); |
| 67 + } |
| 68 + |
| 69 + void |
| 70 + SCTP_NSS_SHA1_Update(struct sha1_context *ctx, const unsigned char *ptr, int s
iz) |
| 71 + { |
| 72 + PK11_DigestOp(ctx->pk11_ctx, ptr, siz); |
| 73 + } |
| 74 + |
| 75 + void |
| 76 + SCTP_NSS_SHA1_Final(unsigned char *digest, struct sha1_context *ctx) |
| 77 + { |
| 78 + unsigned int output_len = 0; |
| 79 + PK11_DigestFinal(ctx->pk11_ctx, digest, &output_len, sizeof(digest)); |
| 80 + PK11_DestroyContext(ctx->pk11_ctx, PR_TRUE); |
| 81 + } |
| 82 + #endif |
| 83 diff -NcrB usrsctplib/netinet/sctp_nss_sha1.h overrides/usrsctplib/netinet/sctp_
nss_sha1.h |
| 84 *** usrsctplib/netinet/sctp_nss_sha1.h 1969-12-31 16:00:00.000000000 -0800 |
| 85 --- overrides/usrsctplib/netinet/sctp_nss_sha1.h 2013-06-10 15:16:39.5415
91630 -0700 |
| 86 *************** |
| 87 *** 0 **** |
| 88 --- 1,67 ---- |
| 89 + /*- |
| 90 + * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. |
| 91 + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. |
| 92 + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. |
| 93 + * |
| 94 + * Redistribution and use in source and binary forms, with or without |
| 95 + * modification, are permitted provided that the following conditions are met: |
| 96 + * |
| 97 + * a) Redistributions of source code must retain the above copyright notice, |
| 98 + * this list of conditions and the following disclaimer. |
| 99 + * |
| 100 + * b) Redistributions in binary form must reproduce the above copyright |
| 101 + * notice, this list of conditions and the following disclaimer in |
| 102 + * the documentation and/or other materials provided with the distribution. |
| 103 + * |
| 104 + * c) Neither the name of Cisco Systems, Inc. nor the names of its |
| 105 + * contributors may be used to endorse or promote products derived |
| 106 + * from this software without specific prior written permission. |
| 107 + * |
| 108 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 109 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED T
O, |
| 110 + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURP
OSE |
| 111 + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
| 112 + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 113 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 114 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 115 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 116 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 117 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
| 118 + * THE POSSIBILITY OF SUCH DAMAGE. |
| 119 + */ |
| 120 + |
| 121 + #ifdef __FreeBSD__ |
| 122 + #include <sys/cdefs.h> |
| 123 + __FBSDID("$FreeBSD$"); |
| 124 + #endif |
| 125 + |
| 126 + |
| 127 + #ifndef __SCTP_NSS_SHA1_h__ |
| 128 + #define __SCTP_NSS_SHA1_h__ |
| 129 + |
| 130 + #ifdef SCTP_USE_NSS_SHA1 |
| 131 + #ifdef __Userspace_os_Darwin |
| 132 + #define __APPLE__ |
| 133 + #endif |
| 134 + |
| 135 + #include <sys/types.h> |
| 136 + #include <pk11pub.h> |
| 137 + |
| 138 + #ifdef __Userspace_os_Darwin |
| 139 + #undef __APPLE__ |
| 140 + #endif |
| 141 + |
| 142 + struct sha1_context { |
| 143 + struct PK11Context *pk11_ctx; |
| 144 + }; // Opaque structure. |
| 145 + |
| 146 + typedef struct sha1_context SHA1_CTX; |
| 147 + |
| 148 + #if defined(_KERNEL) || defined(__Userspace__) |
| 149 + #define SHA1_Init SCTP_NSS_SHA1_Init |
| 150 + #define SHA1_Update SCTP_NSS_SHA1_Update |
| 151 + #define SHA1_Final SCTP_NSS_SHA1_Final |
| 152 + |
| 153 + #endif /* _KERNEL */ |
| 154 + #endif |
| 155 + #endif |
| 156 diff -NcrB usrsctplib/netinet/sctp_os.h overrides/usrsctplib/netinet/sctp_os.h |
| 157 *** usrsctplib/netinet/sctp_os.h 2013-06-10 15:18:09.922331015 -0700 |
| 158 --- overrides/usrsctplib/netinet/sctp_os.h 2013-06-10 15:16:39.541591630 -0
700 |
| 159 *************** |
| 160 *** 73,79 **** |
| 161 #endif |
| 162 |
| 163 #if defined(__APPLE__) |
| 164 ! #include <netinet/sctp_os_macosx.h> |
| 165 #endif |
| 166 |
| 167 #if defined(__Panda__) |
| 168 --- 73,80 ---- |
| 169 #endif |
| 170 |
| 171 #if defined(__APPLE__) |
| 172 ! #undef __APPLE__ |
| 173 ! // #include <netinet/sctp_os_macosx.h> |
| 174 #endif |
| 175 |
| 176 #if defined(__Panda__) |
| 177 diff -NcrB usrsctplib/netinet/sctp_os_userspace.h overrides/usrsctplib/netinet/s
ctp_os_userspace.h |
| 178 *** usrsctplib/netinet/sctp_os_userspace.h 2013-06-10 15:18:06.462302712 -0
700 |
| 179 --- overrides/usrsctplib/netinet/sctp_os_userspace.h 2013-06-10 15:24:33.1454
66427 -0700 |
| 180 *************** |
| 181 *** 992,998 **** |
| 182 #define SCTP_READ_RANDOM(buf, len) read_random(buf, len) |
| 183 |
| 184 |
| 185 ! #ifdef USE_SCTP_SHA1 |
| 186 #include <netinet/sctp_sha1.h> |
| 187 #else |
| 188 #if 0 /*this was old _KERNEL code... */ |
| 189 --- 992,998 ---- |
| 190 #define SCTP_READ_RANDOM(buf, len) read_random(buf, len) |
| 191 |
| 192 |
| 193 ! #if defined(USE_SCTP_SHA1) || defined(SCTP_USE_NSS_SHA1) |
| 194 #include <netinet/sctp_sha1.h> |
| 195 #else |
| 196 #if 0 /*this was old _KERNEL code... */ |
| 197 *************** |
| 198 *** 1007,1023 **** |
| 199 #if defined(HAVE_SHA2) |
| 200 #include <crypto/sha2/sha2.h> |
| 201 #endif |
| 202 ! #if 0 |
| 203 /* going to have to port so generic across OS's... */ |
| 204 ! #if 1 /* openssl header files on FreeBSD 6.3 on Emulab and libssl-dev for Ubun
tu */ |
| 205 #include <openssl/md5.h> |
| 206 #include <openssl/sha.h> |
| 207 /* libssl-dev calls this SHA_CTX, but it's refered to as SHA1_CTX within the |
| 208 * SCTP stack code so here we typedef (or macro?) to equate the two. |
| 209 */ |
| 210 typedef SHA_CTX SHA1_CTX; |
| 211 |
| 212 ! #else /* only _KERNEL? */ |
| 213 |
| 214 #include <sys/md5.h> |
| 215 /* map standard crypto API names */ |
| 216 --- 1007,1026 ---- |
| 217 #if defined(HAVE_SHA2) |
| 218 #include <crypto/sha2/sha2.h> |
| 219 #endif |
| 220 ! |
| 221 /* going to have to port so generic across OS's... */ |
| 222 ! //#if 1 /* openssl header files on FreeBSD 6.3 on Emulab and libssl-dev for Ub
untu */ |
| 223 ! #ifdef SCTP_USE_OPENSSL_SHA1 |
| 224 #include <openssl/md5.h> |
| 225 #include <openssl/sha.h> |
| 226 /* libssl-dev calls this SHA_CTX, but it's refered to as SHA1_CTX within the |
| 227 * SCTP stack code so here we typedef (or macro?) to equate the two. |
| 228 */ |
| 229 typedef SHA_CTX SHA1_CTX; |
| 230 + #endif |
| 231 |
| 232 ! #if 0 |
| 233 ! //#else /* only _KERNEL? */ |
| 234 |
| 235 #include <sys/md5.h> |
| 236 /* map standard crypto API names */ |
| 237 *************** |
| 238 *** 1025,1031 **** |
| 239 #define MD5_Update MD5Update |
| 240 #define MD5_Final MD5Final |
| 241 #endif |
| 242 - #endif |
| 243 |
| 244 |
| 245 /* start OOTB only stuff */ |
| 246 --- 1028,1033 ---- |
OLD | NEW |