| OLD | NEW |
| 1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | 1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
| 2 /* | 2 /* |
| 3 * SSL3 Protocol | 3 * SSL3 Protocol |
| 4 * | 4 * |
| 5 * This Source Code Form is subject to the terms of the Mozilla Public | 5 * This Source Code Form is subject to the terms of the Mozilla Public |
| 6 * License, v. 2.0. If a copy of the MPL was not distributed with this | 6 * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 7 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 7 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 8 | 8 |
| 9 /* TODO(ekr): Implement HelloVerifyRequest on server side. OK for now. */ | 9 /* TODO(ekr): Implement HelloVerifyRequest on server side. OK for now. */ |
| 10 | 10 |
| (...skipping 5575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5586 PK11SymKey ** pSymWrapKey; | 5586 PK11SymKey ** pSymWrapKey; |
| 5587 pSymWrapKey = &symWrapKeys[i].symWrapKey[j]; | 5587 pSymWrapKey = &symWrapKeys[i].symWrapKey[j]; |
| 5588 if (*pSymWrapKey) { | 5588 if (*pSymWrapKey) { |
| 5589 PK11_FreeSymKey(*pSymWrapKey); | 5589 PK11_FreeSymKey(*pSymWrapKey); |
| 5590 *pSymWrapKey = NULL; | 5590 *pSymWrapKey = NULL; |
| 5591 } | 5591 } |
| 5592 } | 5592 } |
| 5593 } | 5593 } |
| 5594 | 5594 |
| 5595 PZ_Unlock(symWrapKeysLock); | 5595 PZ_Unlock(symWrapKeysLock); |
| 5596 ssl_FreeSessionCacheLocks(); | |
| 5597 return SECSuccess; | 5596 return SECSuccess; |
| 5598 } | 5597 } |
| 5599 | 5598 |
| 5600 SECStatus ssl_InitSymWrapKeysLock(void) | 5599 SECStatus ssl_InitSymWrapKeysLock(void) |
| 5601 { | 5600 { |
| 5602 symWrapKeysLock = PZ_NewLock(nssILockOther); | 5601 symWrapKeysLock = PZ_NewLock(nssILockOther); |
| 5603 return symWrapKeysLock ? SECSuccess : SECFailure; | 5602 return symWrapKeysLock ? SECSuccess : SECFailure; |
| 5604 } | 5603 } |
| 5605 | 5604 |
| 5606 /* Try to get wrapping key for mechanism from in-memory array. | 5605 /* Try to get wrapping key for mechanism from in-memory array. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5638 return NULL; /* why are we here?!? */ | 5637 return NULL; /* why are we here?!? */ |
| 5639 } | 5638 } |
| 5640 | 5639 |
| 5641 symWrapMechIndex = ssl_FindIndexByWrapMechanism(masterWrapMech); | 5640 symWrapMechIndex = ssl_FindIndexByWrapMechanism(masterWrapMech); |
| 5642 PORT_Assert(symWrapMechIndex >= 0); | 5641 PORT_Assert(symWrapMechIndex >= 0); |
| 5643 if (symWrapMechIndex < 0) | 5642 if (symWrapMechIndex < 0) |
| 5644 return NULL; /* invalid masterWrapMech. */ | 5643 return NULL; /* invalid masterWrapMech. */ |
| 5645 | 5644 |
| 5646 pSymWrapKey = &symWrapKeys[symWrapMechIndex].symWrapKey[exchKeyType]; | 5645 pSymWrapKey = &symWrapKeys[symWrapMechIndex].symWrapKey[exchKeyType]; |
| 5647 | 5646 |
| 5648 ssl_InitSessionCacheLocks(PR_TRUE); | 5647 ssl_InitSessionCacheLocks(); |
| 5649 | 5648 |
| 5650 PZ_Lock(symWrapKeysLock); | 5649 PZ_Lock(symWrapKeysLock); |
| 5651 | 5650 |
| 5652 unwrappedWrappingKey = *pSymWrapKey; | 5651 unwrappedWrappingKey = *pSymWrapKey; |
| 5653 if (unwrappedWrappingKey != NULL) { | 5652 if (unwrappedWrappingKey != NULL) { |
| 5654 if (PK11_VerifyKeyOK(unwrappedWrappingKey)) { | 5653 if (PK11_VerifyKeyOK(unwrappedWrappingKey)) { |
| 5655 unwrappedWrappingKey = PK11_ReferenceSymKey(unwrappedWrappingKey); | 5654 unwrappedWrappingKey = PK11_ReferenceSymKey(unwrappedWrappingKey); |
| 5656 goto done; | 5655 goto done; |
| 5657 } | 5656 } |
| 5658 /* slot series has changed, so this key is no good any more. */ | 5657 /* slot series has changed, so this key is no good any more. */ |
| (...skipping 6797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12456 PORT_Free(ss->ssl3.hs.recvdFragments.buf); | 12455 PORT_Free(ss->ssl3.hs.recvdFragments.buf); |
| 12457 } | 12456 } |
| 12458 } | 12457 } |
| 12459 | 12458 |
| 12460 ss->ssl3.initialized = PR_FALSE; | 12459 ss->ssl3.initialized = PR_FALSE; |
| 12461 | 12460 |
| 12462 SECITEM_FreeItem(&ss->ssl3.nextProto, PR_FALSE); | 12461 SECITEM_FreeItem(&ss->ssl3.nextProto, PR_FALSE); |
| 12463 } | 12462 } |
| 12464 | 12463 |
| 12465 /* End of ssl3con.c */ | 12464 /* End of ssl3con.c */ |
| OLD | NEW |