OLD | NEW |
1 /* This file implements the SERVER Session ID cache. | 1 /* This file implements the SERVER Session ID cache. |
2 * NOTE: The contents of this file are NOT used by the client. | 2 * NOTE: The contents of this file are NOT used by the client. |
3 * | 3 * |
4 * This Source Code Form is subject to the terms of the Mozilla Public | 4 * This Source Code Form is subject to the terms of the Mozilla Public |
5 * License, v. 2.0. If a copy of the MPL was not distributed with this | 5 * License, v. 2.0. If a copy of the MPL was not distributed with this |
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
7 /* $Id: sslsnce.c,v 1.63 2012/06/14 19:04:59 wtc%google.com Exp $ */ | 7 /* $Id$ */ |
8 | 8 |
9 /* Note: ssl_FreeSID() in sslnonce.c gets used for both client and server | 9 /* Note: ssl_FreeSID() in sslnonce.c gets used for both client and server |
10 * cache sids! | 10 * cache sids! |
11 * | 11 * |
12 * About record locking among different server processes: | 12 * About record locking among different server processes: |
13 * | 13 * |
14 * All processes that are part of the same conceptual server (serving on | 14 * All processes that are part of the same conceptual server (serving on |
15 * the same address and port) MUST share a common SSL session cache. | 15 * the same address and port) MUST share a common SSL session cache. |
16 * This code makes the content of the shared cache accessible to all | 16 * This code makes the content of the shared cache accessible to all |
17 * processes on the same "server". This code works on Unix and Win32 only. | 17 * processes on the same "server". This code works on Unix and Win32 only. |
(...skipping 2007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2025 return rv; | 2025 return rv; |
2026 } | 2026 } |
2027 | 2027 |
2028 PRBool | 2028 PRBool |
2029 ssl_GetSessionTicketKeys(unsigned char *keyName, unsigned char *encKey, | 2029 ssl_GetSessionTicketKeys(unsigned char *keyName, unsigned char *encKey, |
2030 unsigned char *macKey) | 2030 unsigned char *macKey) |
2031 { | 2031 { |
2032 PRBool rv = PR_FALSE; | 2032 PRBool rv = PR_FALSE; |
2033 PRUint32 now = 0; | 2033 PRUint32 now = 0; |
2034 cacheDesc *cache = &globalCache; | 2034 cacheDesc *cache = &globalCache; |
2035 uint8 ticketMacKey[AES_256_KEY_LENGTH], ticketEncKey[SHA256_LENGTH]; | 2035 uint8 ticketMacKey[SHA256_LENGTH], ticketEncKey[AES_256_KEY_LENGTH]; |
2036 uint8 ticketKeyNameSuffixLocal[SESS_TICKET_KEY_VAR_NAME_LEN]; | 2036 uint8 ticketKeyNameSuffixLocal[SESS_TICKET_KEY_VAR_NAME_LEN]; |
2037 uint8 *ticketMacKeyPtr, *ticketEncKeyPtr, *ticketKeyNameSuffix; | 2037 uint8 *ticketMacKeyPtr, *ticketEncKeyPtr, *ticketKeyNameSuffix; |
2038 PRBool cacheIsEnabled = PR_TRUE; | 2038 PRBool cacheIsEnabled = PR_TRUE; |
2039 | 2039 |
2040 if (!cache->cacheMem) { /* cache is uninitialized */ | 2040 if (!cache->cacheMem) { /* cache is uninitialized */ |
2041 cacheIsEnabled = PR_FALSE; | 2041 cacheIsEnabled = PR_FALSE; |
2042 ticketKeyNameSuffix = ticketKeyNameSuffixLocal; | 2042 ticketKeyNameSuffix = ticketKeyNameSuffixLocal; |
2043 ticketEncKeyPtr = ticketEncKey; | 2043 ticketEncKeyPtr = ticketEncKey; |
2044 ticketMacKeyPtr = ticketMacKey; | 2044 ticketMacKeyPtr = ticketMacKey; |
2045 } else { | 2045 } else { |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2210 } | 2210 } |
2211 | 2211 |
2212 SECStatus | 2212 SECStatus |
2213 SSL_SetMaxServerCacheLocks(PRUint32 maxLocks) | 2213 SSL_SetMaxServerCacheLocks(PRUint32 maxLocks) |
2214 { | 2214 { |
2215 PR_ASSERT(!"SSL servers are not supported on this platform. (SSL_SetMaxServe
rCacheLocks)"); | 2215 PR_ASSERT(!"SSL servers are not supported on this platform. (SSL_SetMaxServe
rCacheLocks)"); |
2216 return SECFailure; | 2216 return SECFailure; |
2217 } | 2217 } |
2218 | 2218 |
2219 #endif /* XP_UNIX || XP_WIN32 */ | 2219 #endif /* XP_UNIX || XP_WIN32 */ |
OLD | NEW |