OLD | NEW |
1 /*- | 1 /*- |
2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. | 2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. |
3 * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. | 3 * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. |
4 * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. | 4 * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions are met: | 7 * modification, are permitted provided that the following conditions are met: |
8 * | 8 * |
9 * a) Redistributions of source code must retain the above copyright notice, | 9 * a) Redistributions of source code must retain the above copyright notice, |
10 * this list of conditions and the following disclaimer. | 10 * this list of conditions and the following disclaimer. |
(...skipping 22 matching lines...) Expand all Loading... |
33 #ifdef __FreeBSD__ | 33 #ifdef __FreeBSD__ |
34 #include <sys/cdefs.h> | 34 #include <sys/cdefs.h> |
35 __FBSDID("$FreeBSD$"); | 35 __FBSDID("$FreeBSD$"); |
36 #endif | 36 #endif |
37 | 37 |
38 | 38 |
39 #ifndef __SCTP_SHA1_h__ | 39 #ifndef __SCTP_SHA1_h__ |
40 #define __SCTP_SHA1_h__ | 40 #define __SCTP_SHA1_h__ |
41 | 41 |
42 #include <sys/types.h> | 42 #include <sys/types.h> |
43 #ifdef SCTP_USE_NSS_SHA1 | 43 |
| 44 #if !defined(SSL_USE_OPENSSL) && !defined(SSL_USE_NSS) |
| 45 #if defined(WIN32) |
| 46 |
| 47 #define SCTP_USE_SCTP_SHA1 1 |
| 48 |
| 49 #else // defined(WIN32) |
| 50 |
| 51 #if defined(HAVE_OPENSSL_SSL_H) |
| 52 #define SSL_USE_OPENSSL 1 |
| 53 #elif defined(HAVE_NSS_SSL_H) |
| 54 #define SSL_USE_NSS 1 |
| 55 #else |
| 56 #define SCTP_USE_SCTP_SHA1 |
| 57 #endif |
| 58 |
| 59 #endif // !defined(WIN32) |
| 60 #endif |
| 61 |
| 62 #if defined(SSL_USE_NSS) |
44 #include <netinet/sctp_nss_sha1.h> | 63 #include <netinet/sctp_nss_sha1.h> |
45 #elif SCTP_USE_OPENSSL_SHA1 | 64 #elif defined(SSL_USE_OPENSSL) |
46 #include <netinet/sctp_openssl_sha1.h> | 65 #include <netinet/sctp_openssl_sha1.h> |
47 #else // USE_SCTP_SHA1 | 66 #else // SCTP_USE_SCTP_SHA1 |
48 struct sha1_context { | 67 struct sha1_context { |
49 unsigned int A; | 68 unsigned int A; |
50 unsigned int B; | 69 unsigned int B; |
51 unsigned int C; | 70 unsigned int C; |
52 unsigned int D; | 71 unsigned int D; |
53 unsigned int E; | 72 unsigned int E; |
54 unsigned int H0; | 73 unsigned int H0; |
55 unsigned int H1; | 74 unsigned int H1; |
56 unsigned int H2; | 75 unsigned int H2; |
57 unsigned int H3; | 76 unsigned int H3; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 #endif | 111 #endif |
93 #endif | 112 #endif |
94 | 113 |
95 #if defined(_KERNEL) || defined(__Userspace__) | 114 #if defined(_KERNEL) || defined(__Userspace__) |
96 | 115 |
97 void SHA1_Init(struct sha1_context *); | 116 void SHA1_Init(struct sha1_context *); |
98 void SHA1_Update(struct sha1_context *, const unsigned char *, int); | 117 void SHA1_Update(struct sha1_context *, const unsigned char *, int); |
99 void SHA1_Final(unsigned char *, struct sha1_context *); | 118 void SHA1_Final(unsigned char *, struct sha1_context *); |
100 | 119 |
101 #endif /* _KERNEL */ | 120 #endif /* _KERNEL */ |
102 #endif | 121 #endif /* !defined(SSL_USE_OPENSSL) && !defined(SSL_USE_NSS) */ |
103 #endif | 122 #endif /* __SCTP_SHA1_h__ */ |
OLD | NEW |