OLD | NEW |
---|---|
1 /* | 1 /* |
2 * vtables (and methods that call through them) for the 4 types of | 2 * vtables (and methods that call through them) for the 4 types of |
3 * SSLSockets supported. Only one type is still supported. | 3 * SSLSockets supported. Only one type is still supported. |
4 * Various other functions. | 4 * Various other functions. |
5 * | 5 * |
6 * This Source Code Form is subject to the terms of the Mozilla Public | 6 * This Source Code Form is subject to the terms of the Mozilla Public |
7 * License, v. 2.0. If a copy of the MPL was not distributed with this | 7 * License, v. 2.0. If a copy of the MPL was not distributed with this |
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 8 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
9 #include "seccomon.h" | 9 #include "seccomon.h" |
10 #include "cert.h" | 10 #include "cert.h" |
(...skipping 3038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3049 if (ss) { | 3049 if (ss) { |
3050 /* This should be of type SSLKEAType, but CC on IRIX | 3050 /* This should be of type SSLKEAType, but CC on IRIX |
3051 * complains during the for loop. | 3051 * complains during the for loop. |
3052 */ | 3052 */ |
3053 int i; | 3053 int i; |
3054 SECStatus status; | 3054 SECStatus status; |
3055 | 3055 |
3056 ss->opt = ssl_defaults; | 3056 ss->opt = ssl_defaults; |
3057 ss->opt.useSocks = PR_FALSE; | 3057 ss->opt.useSocks = PR_FALSE; |
3058 ss->opt.noLocks = !makeLocks; | 3058 ss->opt.noLocks = !makeLocks; |
3059 ss->vrange = *VERSIONS_DEFAULTS(protocolVariant); | 3059 ss->vrange = *VERSIONS_DEFAULTS(protocolVariant); |
wtc
2013/08/09 21:34:42
Please move the
ss->protocolVariant = protocol
| |
3060 | 3060 |
3061 ss->peerID = NULL; | 3061 ss->peerID = NULL; |
3062 ss->rTimeout = PR_INTERVAL_NO_TIMEOUT; | 3062 ss->rTimeout = PR_INTERVAL_NO_TIMEOUT; |
3063 ss->wTimeout = PR_INTERVAL_NO_TIMEOUT; | 3063 ss->wTimeout = PR_INTERVAL_NO_TIMEOUT; |
3064 ss->cTimeout = PR_INTERVAL_NO_TIMEOUT; | 3064 ss->cTimeout = PR_INTERVAL_NO_TIMEOUT; |
3065 ss->cipherSpecs = NULL; | 3065 ss->cipherSpecs = NULL; |
3066 ss->sizeCipherSpecs = 0; /* produced lazily */ | 3066 ss->sizeCipherSpecs = 0; /* produced lazily */ |
3067 ss->preferredCipher = NULL; | 3067 ss->preferredCipher = NULL; |
3068 ss->url = NULL; | 3068 ss->url = NULL; |
3069 | 3069 |
(...skipping 18 matching lines...) Expand all Loading... | |
3088 #ifdef NSS_PLATFORM_CLIENT_AUTH | 3088 #ifdef NSS_PLATFORM_CLIENT_AUTH |
3089 ss->getPlatformClientAuthData = NULL; | 3089 ss->getPlatformClientAuthData = NULL; |
3090 ss->getPlatformClientAuthDataArg = NULL; | 3090 ss->getPlatformClientAuthDataArg = NULL; |
3091 #endif /* NSS_PLATFORM_CLIENT_AUTH */ | 3091 #endif /* NSS_PLATFORM_CLIENT_AUTH */ |
3092 ss->handleBadCert = NULL; | 3092 ss->handleBadCert = NULL; |
3093 ss->badCertArg = NULL; | 3093 ss->badCertArg = NULL; |
3094 ss->pkcs11PinArg = NULL; | 3094 ss->pkcs11PinArg = NULL; |
3095 ss->ephemeralECDHKeyPair = NULL; | 3095 ss->ephemeralECDHKeyPair = NULL; |
3096 ss->getChannelID = NULL; | 3096 ss->getChannelID = NULL; |
3097 ss->getChannelIDArg = NULL; | 3097 ss->getChannelIDArg = NULL; |
3098 ss->protocolVariant = protocolVariant; | |
3098 | 3099 |
3099 ssl_ChooseOps(ss); | 3100 ssl_ChooseOps(ss); |
3100 ssl2_InitSocketPolicy(ss); | 3101 ssl2_InitSocketPolicy(ss); |
3101 ssl3_InitSocketPolicy(ss); | 3102 ssl3_InitSocketPolicy(ss); |
3102 PR_INIT_CLIST(&ss->ssl3.hs.lastMessageFlight); | 3103 PR_INIT_CLIST(&ss->ssl3.hs.lastMessageFlight); |
3103 | 3104 |
3104 if (makeLocks) { | 3105 if (makeLocks) { |
3105 status = ssl_MakeLocks(ss); | 3106 status = ssl_MakeLocks(ss); |
3106 if (status != SECSuccess) | 3107 if (status != SECSuccess) |
3107 goto loser; | 3108 goto loser; |
3108 } | 3109 } |
3109 status = ssl_CreateSecurityInfo(ss); | 3110 status = ssl_CreateSecurityInfo(ss); |
3110 if (status != SECSuccess) | 3111 if (status != SECSuccess) |
3111 goto loser; | 3112 goto loser; |
3112 status = ssl_InitGather(&ss->gs); | 3113 status = ssl_InitGather(&ss->gs); |
3113 if (status != SECSuccess) { | 3114 if (status != SECSuccess) { |
3114 loser: | 3115 loser: |
3115 ssl_DestroySocketContents(ss); | 3116 ssl_DestroySocketContents(ss); |
3116 ssl_DestroyLocks(ss); | 3117 ssl_DestroyLocks(ss); |
3117 PORT_Free(ss); | 3118 PORT_Free(ss); |
3118 ss = NULL; | 3119 ss = NULL; |
3119 } | 3120 } |
3120 ss->protocolVariant = protocolVariant; | |
3121 } | 3121 } |
3122 return ss; | 3122 return ss; |
3123 } | 3123 } |
3124 | 3124 |
OLD | NEW |