OLD | NEW |
---|---|
1 /* | 1 /* |
2 * This file is PRIVATE to SSL and should be the first thing included by | 2 * This file is PRIVATE to SSL and should be the first thing included by |
3 * any SSL implementation file. | 3 * any SSL implementation file. |
4 * | 4 * |
5 * ***** BEGIN LICENSE BLOCK ***** | 5 * ***** BEGIN LICENSE BLOCK ***** |
6 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 6 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
7 * | 7 * |
8 * The contents of this file are subject to the Mozilla Public License Version | 8 * The contents of this file are subject to the Mozilla Public License Version |
9 * 1.1 (the "License"); you may not use this file except in compliance with | 9 * 1.1 (the "License"); you may not use this file except in compliance with |
10 * the License. You may obtain a copy of the License at | 10 * the License. You may obtain a copy of the License at |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
315 #endif | 315 #endif |
316 } ssl3CipherSuiteCfg; | 316 } ssl3CipherSuiteCfg; |
317 | 317 |
318 #ifdef NSS_ENABLE_ECC | 318 #ifdef NSS_ENABLE_ECC |
319 #define ssl_V3_SUITES_IMPLEMENTED 50 | 319 #define ssl_V3_SUITES_IMPLEMENTED 50 |
320 #else | 320 #else |
321 #define ssl_V3_SUITES_IMPLEMENTED 30 | 321 #define ssl_V3_SUITES_IMPLEMENTED 30 |
322 #endif /* NSS_ENABLE_ECC */ | 322 #endif /* NSS_ENABLE_ECC */ |
323 | 323 |
324 typedef struct sslOptionsStr { | 324 typedef struct sslOptionsStr { |
325 /* For clients, this is a validated list of protocols in preference order | |
326 * and wire format. For servers, this is the list of support protocols, | |
327 * also in wire format. */ | |
328 SECItem nextProtoNego; | |
329 | |
330 unsigned int useSecurity : 1; /* 1 */ | 325 unsigned int useSecurity : 1; /* 1 */ |
331 unsigned int useSocks : 1; /* 2 */ | 326 unsigned int useSocks : 1; /* 2 */ |
332 unsigned int requestCertificate : 1; /* 3 */ | 327 unsigned int requestCertificate : 1; /* 3 */ |
333 unsigned int requireCertificate : 2; /* 4-5 */ | 328 unsigned int requireCertificate : 2; /* 4-5 */ |
334 unsigned int handshakeAsClient : 1; /* 6 */ | 329 unsigned int handshakeAsClient : 1; /* 6 */ |
335 unsigned int handshakeAsServer : 1; /* 7 */ | 330 unsigned int handshakeAsServer : 1; /* 7 */ |
336 unsigned int enableSSL2 : 1; /* 8 */ | 331 unsigned int enableSSL2 : 1; /* 8 */ |
337 unsigned int enableSSL3 : 1; /* 9 */ | 332 unsigned int enableSSL3 : 1; /* 9 */ |
338 unsigned int enableTLS : 1; /* 10 */ | 333 unsigned int enableTLS : 1; /* 10 */ |
339 unsigned int noCache : 1; /* 11 */ | 334 unsigned int noCache : 1; /* 11 */ |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
820 sslBuffer messages; /* Accumulated handshake messages */ | 815 sslBuffer messages; /* Accumulated handshake messages */ |
821 PRUint16 finishedBytes; /* size of single finished below */ | 816 PRUint16 finishedBytes; /* size of single finished below */ |
822 union { | 817 union { |
823 TLSFinished tFinished[2]; /* client, then server */ | 818 TLSFinished tFinished[2]; /* client, then server */ |
824 SSL3Hashes sFinished[2]; | 819 SSL3Hashes sFinished[2]; |
825 SSL3Opaque data[72]; | 820 SSL3Opaque data[72]; |
826 } finishedMsgs; | 821 } finishedMsgs; |
827 #ifdef NSS_ENABLE_ECC | 822 #ifdef NSS_ENABLE_ECC |
828 PRUint32 negotiatedECCurves; /* bit mask */ | 823 PRUint32 negotiatedECCurves; /* bit mask */ |
829 #endif /* NSS_ENABLE_ECC */ | 824 #endif /* NSS_ENABLE_ECC */ |
830 PRBool nextProtoNego;/* Our peer has sent this extension */ | |
831 } SSL3HandshakeState; | 825 } SSL3HandshakeState; |
832 | 826 |
833 | 827 |
834 | 828 |
835 /* | 829 /* |
836 ** This is the "ssl3" struct, as in "ss->ssl3". | 830 ** This is the "ssl3" struct, as in "ss->ssl3". |
837 ** note: | 831 ** note: |
838 ** usually, crSpec == cwSpec and prSpec == pwSpec. | 832 ** usually, crSpec == cwSpec and prSpec == pwSpec. |
839 ** Sometimes, crSpec == pwSpec and prSpec == cwSpec. | 833 ** Sometimes, crSpec == pwSpec and prSpec == cwSpec. |
840 ** But there are never more than 2 actual specs. | 834 ** But there are never more than 2 actual specs. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
879 * does not include the leaf cert. It is actually a | 873 * does not include the leaf cert. It is actually a |
880 * linked list of ssl3CertNode structs. | 874 * linked list of ssl3CertNode structs. |
881 */ | 875 */ |
882 CERTDistNames * ca_list; | 876 CERTDistNames * ca_list; |
883 /* used by server. trusted CAs for this socket. */ | 877 /* used by server. trusted CAs for this socket. */ |
884 PRBool initialized; | 878 PRBool initialized; |
885 SSL3HandshakeState hs; | 879 SSL3HandshakeState hs; |
886 ssl3CipherSpec specs[2]; /* one is current, one is pending. */ | 880 ssl3CipherSpec specs[2]; /* one is current, one is pending. */ |
887 | 881 |
888 /* In a client: if the server supports Next Protocol Negotiation, then | 882 /* In a client: if the server supports Next Protocol Negotiation, then |
889 * this is the protocol that was requested. | 883 * this is the protocol that was requested. |
wtc
2011/10/11 23:43:04
Nit: I think "that was negotiated" or "that the cl
agl
2011/10/17 17:37:24
Done.
| |
890 * In a server: this is the protocol that the client requested via Next | |
891 * Protocol Negotiation. | |
wtc
2011/10/11 23:43:04
Why do you delete this comment about servers?
Is i
agl
2011/10/17 17:37:24
Right, the server side hasn't been written and the
| |
892 * | 884 * |
893 * In either case, if the data pointer is non-NULL, then it is malloced | 885 * If the data pointer is non-NULL, then it is malloced data. */ |
894 * data. */ | |
895 SECItem nextProto; | 886 SECItem nextProto; |
896 int nextProtoState; /* See SSL_NEXT_PROTO_* defines */ | |
897 }; | 887 }; |
898 | 888 |
899 typedef struct { | 889 typedef struct { |
900 SSL3ContentType type; | 890 SSL3ContentType type; |
901 SSL3ProtocolVersion version; | 891 SSL3ProtocolVersion version; |
902 sslBuffer * buf; | 892 sslBuffer * buf; |
903 } SSL3Ciphertext; | 893 } SSL3Ciphertext; |
904 | 894 |
905 struct ssl3KeyPairStr { | 895 struct ssl3KeyPairStr { |
906 SECKEYPrivateKey * privKey; | 896 SECKEYPrivateKey * privKey; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1122 SSLGetPlatformClientAuthData getPlatformClientAuthData; | 1112 SSLGetPlatformClientAuthData getPlatformClientAuthData; |
1123 void *getPlatformClientAuthDataArg; | 1113 void *getPlatformClientAuthDataArg; |
1124 #endif /* NSS_PLATFORM_CLIENT_AUTH */ | 1114 #endif /* NSS_PLATFORM_CLIENT_AUTH */ |
1125 SSLSNISocketConfig sniSocketConfig; | 1115 SSLSNISocketConfig sniSocketConfig; |
1126 void *sniSocketConfigArg; | 1116 void *sniSocketConfigArg; |
1127 SSLBadCertHandler handleBadCert; | 1117 SSLBadCertHandler handleBadCert; |
1128 void *badCertArg; | 1118 void *badCertArg; |
1129 SSLHandshakeCallback handshakeCallback; | 1119 SSLHandshakeCallback handshakeCallback; |
1130 void *handshakeCallbackData; | 1120 void *handshakeCallbackData; |
1131 void *pkcs11PinArg; | 1121 void *pkcs11PinArg; |
1122 SSLNextProtoCallback nextProtoCallback; | |
1123 void *nextProtoArg; | |
1132 | 1124 |
1133 PRIntervalTime rTimeout; /* timeout for NSPR I/O */ | 1125 PRIntervalTime rTimeout; /* timeout for NSPR I/O */ |
1134 PRIntervalTime wTimeout; /* timeout for NSPR I/O */ | 1126 PRIntervalTime wTimeout; /* timeout for NSPR I/O */ |
1135 PRIntervalTime cTimeout; /* timeout for NSPR I/O */ | 1127 PRIntervalTime cTimeout; /* timeout for NSPR I/O */ |
1136 | 1128 |
1137 PZLock * recvLock; /* lock against multiple reader threads. */ | 1129 PZLock * recvLock; /* lock against multiple reader threads. */ |
1138 PZLock * sendLock; /* lock against multiple sender threads. */ | 1130 PZLock * sendLock; /* lock against multiple sender threads. */ |
1139 | 1131 |
1140 PZMonitor * recvBufLock; /* locks low level recv buffers. */ | 1132 PZMonitor * recvBufLock; /* locks low level recv buffers. */ |
1141 PZMonitor * xmitBufLock; /* locks low level xmit buffers. */ | 1133 PZMonitor * xmitBufLock; /* locks low level xmit buffers. */ |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1749 #elif defined(_WIN32_WCE) | 1741 #elif defined(_WIN32_WCE) |
1750 #define SSL_GETPID GetCurrentProcessId | 1742 #define SSL_GETPID GetCurrentProcessId |
1751 #elif defined(WIN32) | 1743 #elif defined(WIN32) |
1752 extern int __cdecl _getpid(void); | 1744 extern int __cdecl _getpid(void); |
1753 #define SSL_GETPID _getpid | 1745 #define SSL_GETPID _getpid |
1754 #else | 1746 #else |
1755 #define SSL_GETPID() 0 | 1747 #define SSL_GETPID() 0 |
1756 #endif | 1748 #endif |
1757 | 1749 |
1758 #endif /* __sslimpl_h_ */ | 1750 #endif /* __sslimpl_h_ */ |
OLD | NEW |