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(); | 5596 ssl_FreeSessionCacheLocks(); |
wtc
2013/09/19 04:37:51
I think we should remove this ssl_FreeSessionCache
agl
2013/09/19 17:40:51
Done.
| |
5597 return SECSuccess; | 5597 return SECSuccess; |
5598 } | 5598 } |
5599 | 5599 |
5600 SECStatus ssl_InitSymWrapKeysLock(void) | 5600 SECStatus ssl_InitSymWrapKeysLock(void) |
5601 { | 5601 { |
5602 symWrapKeysLock = PZ_NewLock(nssILockOther); | 5602 symWrapKeysLock = PZ_NewLock(nssILockOther); |
5603 return symWrapKeysLock ? SECSuccess : SECFailure; | 5603 return symWrapKeysLock ? SECSuccess : SECFailure; |
5604 } | 5604 } |
5605 | 5605 |
5606 /* Try to get wrapping key for mechanism from in-memory array. | 5606 /* 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?!? */ | 5638 return NULL; /* why are we here?!? */ |
5639 } | 5639 } |
5640 | 5640 |
5641 symWrapMechIndex = ssl_FindIndexByWrapMechanism(masterWrapMech); | 5641 symWrapMechIndex = ssl_FindIndexByWrapMechanism(masterWrapMech); |
5642 PORT_Assert(symWrapMechIndex >= 0); | 5642 PORT_Assert(symWrapMechIndex >= 0); |
5643 if (symWrapMechIndex < 0) | 5643 if (symWrapMechIndex < 0) |
5644 return NULL; /* invalid masterWrapMech. */ | 5644 return NULL; /* invalid masterWrapMech. */ |
5645 | 5645 |
5646 pSymWrapKey = &symWrapKeys[symWrapMechIndex].symWrapKey[exchKeyType]; | 5646 pSymWrapKey = &symWrapKeys[symWrapMechIndex].symWrapKey[exchKeyType]; |
5647 | 5647 |
5648 ssl_InitSessionCacheLocks(PR_TRUE); | 5648 ssl_InitSessionCacheLocks(); |
5649 | 5649 |
5650 PZ_Lock(symWrapKeysLock); | 5650 PZ_Lock(symWrapKeysLock); |
5651 | 5651 |
5652 unwrappedWrappingKey = *pSymWrapKey; | 5652 unwrappedWrappingKey = *pSymWrapKey; |
5653 if (unwrappedWrappingKey != NULL) { | 5653 if (unwrappedWrappingKey != NULL) { |
5654 if (PK11_VerifyKeyOK(unwrappedWrappingKey)) { | 5654 if (PK11_VerifyKeyOK(unwrappedWrappingKey)) { |
5655 unwrappedWrappingKey = PK11_ReferenceSymKey(unwrappedWrappingKey); | 5655 unwrappedWrappingKey = PK11_ReferenceSymKey(unwrappedWrappingKey); |
5656 goto done; | 5656 goto done; |
5657 } | 5657 } |
5658 /* slot series has changed, so this key is no good any more. */ | 5658 /* 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); | 12456 PORT_Free(ss->ssl3.hs.recvdFragments.buf); |
12457 } | 12457 } |
12458 } | 12458 } |
12459 | 12459 |
12460 ss->ssl3.initialized = PR_FALSE; | 12460 ss->ssl3.initialized = PR_FALSE; |
12461 | 12461 |
12462 SECITEM_FreeItem(&ss->ssl3.nextProto, PR_FALSE); | 12462 SECITEM_FreeItem(&ss->ssl3.nextProto, PR_FALSE); |
12463 } | 12463 } |
12464 | 12464 |
12465 /* End of ssl3con.c */ | 12465 /* End of ssl3con.c */ |
OLD | NEW |