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 * ***** 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 4521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4532 PK11SymKey ** pSymWrapKey; | 4532 PK11SymKey ** pSymWrapKey; |
4533 pSymWrapKey = &symWrapKeys[i].symWrapKey[j]; | 4533 pSymWrapKey = &symWrapKeys[i].symWrapKey[j]; |
4534 if (*pSymWrapKey) { | 4534 if (*pSymWrapKey) { |
4535 PK11_FreeSymKey(*pSymWrapKey); | 4535 PK11_FreeSymKey(*pSymWrapKey); |
4536 *pSymWrapKey = NULL; | 4536 *pSymWrapKey = NULL; |
4537 } | 4537 } |
4538 } | 4538 } |
4539 } | 4539 } |
4540 | 4540 |
4541 PZ_Unlock(symWrapKeysLock); | 4541 PZ_Unlock(symWrapKeysLock); |
4542 ssl_FreeSessionCacheLocks(); | |
4543 return SECSuccess; | 4542 return SECSuccess; |
4544 } | 4543 } |
4545 | 4544 |
4546 SECStatus ssl_InitSymWrapKeysLock(void) | 4545 SECStatus ssl_InitSymWrapKeysLock(void) |
4547 { | 4546 { |
4548 symWrapKeysLock = PZ_NewLock(nssILockOther); | 4547 symWrapKeysLock = PZ_NewLock(nssILockOther); |
4549 return symWrapKeysLock ? SECSuccess : SECFailure; | 4548 return symWrapKeysLock ? SECSuccess : SECFailure; |
4550 } | 4549 } |
4551 | 4550 |
4552 /* Try to get wrapping key for mechanism from in-memory array. | 4551 /* Try to get wrapping key for mechanism from in-memory array. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4584 return NULL; /* why are we here?!? */ | 4583 return NULL; /* why are we here?!? */ |
4585 } | 4584 } |
4586 | 4585 |
4587 symWrapMechIndex = ssl_FindIndexByWrapMechanism(masterWrapMech); | 4586 symWrapMechIndex = ssl_FindIndexByWrapMechanism(masterWrapMech); |
4588 PORT_Assert(symWrapMechIndex >= 0); | 4587 PORT_Assert(symWrapMechIndex >= 0); |
4589 if (symWrapMechIndex < 0) | 4588 if (symWrapMechIndex < 0) |
4590 return NULL; /* invalid masterWrapMech. */ | 4589 return NULL; /* invalid masterWrapMech. */ |
4591 | 4590 |
4592 pSymWrapKey = &symWrapKeys[symWrapMechIndex].symWrapKey[exchKeyType]; | 4591 pSymWrapKey = &symWrapKeys[symWrapMechIndex].symWrapKey[exchKeyType]; |
4593 | 4592 |
4594 ssl_InitSessionCacheLocks(PR_TRUE); | |
4595 | |
4596 PZ_Lock(symWrapKeysLock); | 4593 PZ_Lock(symWrapKeysLock); |
4597 | 4594 |
4598 unwrappedWrappingKey = *pSymWrapKey; | 4595 unwrappedWrappingKey = *pSymWrapKey; |
4599 if (unwrappedWrappingKey != NULL) { | 4596 if (unwrappedWrappingKey != NULL) { |
4600 if (PK11_VerifyKeyOK(unwrappedWrappingKey)) { | 4597 if (PK11_VerifyKeyOK(unwrappedWrappingKey)) { |
4601 unwrappedWrappingKey = PK11_ReferenceSymKey(unwrappedWrappingKey); | 4598 unwrappedWrappingKey = PK11_ReferenceSymKey(unwrappedWrappingKey); |
4602 goto done; | 4599 goto done; |
4603 } | 4600 } |
4604 /* slot series has changed, so this key is no good any more. */ | 4601 /* slot series has changed, so this key is no good any more. */ |
4605 PK11_FreeSymKey(unwrappedWrappingKey); | 4602 PK11_FreeSymKey(unwrappedWrappingKey); |
(...skipping 6087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10693 PORT_Free(ss->ssl3.hs.recvdFragments.buf); | 10690 PORT_Free(ss->ssl3.hs.recvdFragments.buf); |
10694 } | 10691 } |
10695 } | 10692 } |
10696 | 10693 |
10697 ss->ssl3.initialized = PR_FALSE; | 10694 ss->ssl3.initialized = PR_FALSE; |
10698 | 10695 |
10699 SECITEM_FreeItem(&ss->ssl3.nextProto, PR_FALSE); | 10696 SECITEM_FreeItem(&ss->ssl3.nextProto, PR_FALSE); |
10700 } | 10697 } |
10701 | 10698 |
10702 /* End of ssl3con.c */ | 10699 /* End of ssl3con.c */ |
OLD | NEW |