OLD | NEW |
---|---|
1 /* | 1 /* |
2 * SSL3 Protocol | 2 * SSL3 Protocol |
3 * | 3 * |
4 * ***** BEGIN LICENSE BLOCK ***** | 4 * ***** BEGIN LICENSE BLOCK ***** |
5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
6 * | 6 * |
7 * The contents of this file are subject to the Mozilla Public License Version | 7 * The contents of this file are subject to the Mozilla Public License Version |
8 * 1.1 (the "License"); you may not use this file except in compliance with | 8 * 1.1 (the "License"); you may not use this file except in compliance with |
9 * the License. You may obtain a copy of the License at | 9 * the License. You may obtain a copy of the License at |
10 * http://www.mozilla.org/MPL/ | 10 * http://www.mozilla.org/MPL/ |
(...skipping 4825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4836 isTLS = (PRBool)(ss->ssl3.pwSpec->version > SSL_LIBRARY_VERSION_3_0); | 4836 isTLS = (PRBool)(ss->ssl3.pwSpec->version > SSL_LIBRARY_VERSION_3_0); |
4837 #ifdef NSS_PLATFORM_CLIENT_AUTH | 4837 #ifdef NSS_PLATFORM_CLIENT_AUTH |
4838 rv = ssl3_PlatformSignHashes(&hashes, ss->ssl3.platformClientKey, | 4838 rv = ssl3_PlatformSignHashes(&hashes, ss->ssl3.platformClientKey, |
4839 &buf, isTLS); | 4839 &buf, isTLS); |
4840 if (rv == SECSuccess) { | 4840 if (rv == SECSuccess) { |
4841 sslSessionID * sid = ss->sec.ci.sid; | 4841 sslSessionID * sid = ss->sec.ci.sid; |
4842 ssl_GetPlatformAuthInfoForKey(ss->ssl3.platformClientKey, | 4842 ssl_GetPlatformAuthInfoForKey(ss->ssl3.platformClientKey, |
4843 &sid->u.ssl3.clPlatformAuthInfo); | 4843 &sid->u.ssl3.clPlatformAuthInfo); |
4844 sid->u.ssl3.clPlatformAuthValid = PR_TRUE; | 4844 sid->u.ssl3.clPlatformAuthValid = PR_TRUE; |
4845 } | 4845 } |
4846 if (ss->ssl3.hs.kea_def->exchKeyType == kt_rsa) { | 4846 ssl_FreePlatformKey(ss->ssl3.platformClientKey); |
4847 ssl_FreePlatformKey(ss->ssl3.platformClientKey); | 4847 ss->ssl3.platformClientKey = (PlatformKey)NULL; |
4848 ss->ssl3.platformClientKey = (PlatformKey)NULL; | |
4849 } | |
4850 #else /* NSS_PLATFORM_CLIENT_AUTH */ | 4848 #else /* NSS_PLATFORM_CLIENT_AUTH */ |
4851 rv = ssl3_SignHashes(&hashes, ss->ssl3.clientPrivateKey, &buf, isTLS); | 4849 rv = ssl3_SignHashes(&hashes, ss->ssl3.clientPrivateKey, &buf, isTLS); |
4852 if (rv == SECSuccess) { | 4850 if (rv == SECSuccess) { |
4853 PK11SlotInfo * slot; | 4851 PK11SlotInfo * slot; |
4854 sslSessionID * sid = ss->sec.ci.sid; | 4852 sslSessionID * sid = ss->sec.ci.sid; |
4855 | 4853 |
4856 /* Remember the info about the slot that did the signing. | 4854 /* Remember the info about the slot that did the signing. |
4857 ** Later, when doing an SSL restart handshake, verify this. | 4855 ** Later, when doing an SSL restart handshake, verify this. |
4858 ** These calls are mere accessors, and can't fail. | 4856 ** These calls are mere accessors, and can't fail. |
4859 */ | 4857 */ |
4860 slot = PK11_GetSlotFromPrivateKey(ss->ssl3.clientPrivateKey); | 4858 slot = PK11_GetSlotFromPrivateKey(ss->ssl3.clientPrivateKey); |
4861 sid->u.ssl3.clAuthSeries = PK11_GetSlotSeries(slot); | 4859 sid->u.ssl3.clAuthSeries = PK11_GetSlotSeries(slot); |
4862 sid->u.ssl3.clAuthSlotID = PK11_GetSlotID(slot); | 4860 sid->u.ssl3.clAuthSlotID = PK11_GetSlotID(slot); |
4863 sid->u.ssl3.clAuthModuleID = PK11_GetModuleID(slot); | 4861 sid->u.ssl3.clAuthModuleID = PK11_GetModuleID(slot); |
4864 sid->u.ssl3.clAuthValid = PR_TRUE; | 4862 sid->u.ssl3.clAuthValid = PR_TRUE; |
4865 PK11_FreeSlot(slot); | 4863 PK11_FreeSlot(slot); |
4866 } | 4864 } |
4867 /* If we're doing RSA key exchange, we're all done with the private key | 4865 /* Fixed DH is not supported, so the private key is no longer needed. */ |
wtc
2010/12/08 03:04:14
I think we should still do something here.
It see
Ryan Sleevi
2010/12/08 07:19:35
Er, yes, agreed. I'm assuming you meant ssl3_SendC
wtc
2010/12/08 19:24:42
I didn't know that. Yes, in that case, we can der
|
wtc
2010/12/07 02:47:13
This comment should explain the consequences of no
|
4868 * here. Diffie-Hellman key exchanges need the client's | |
4869 * private key for the key exchange. | |
4870 */ | |
4871 if (ss->ssl3.hs.kea_def->exchKeyType == kt_rsa) { | |
4872 SECKEY_DestroyPrivateKey(ss->ssl3.clientPrivateKey); | 4866 SECKEY_DestroyPrivateKey(ss->ssl3.clientPrivateKey); |
4873 ss->ssl3.clientPrivateKey = NULL; | 4867 ss->ssl3.clientPrivateKey = NULL; |
4874 } | |
4875 #endif /* NSS_PLATFORM_CLIENT_AUTH */ | 4868 #endif /* NSS_PLATFORM_CLIENT_AUTH */ |
4876 if (rv != SECSuccess) { | 4869 if (rv != SECSuccess) { |
4877 goto done; /* err code was set by ssl3_SignHashes */ | 4870 goto done; /* err code was set by ssl3_SignHashes */ |
4878 } | 4871 } |
4879 | 4872 |
4880 rv = ssl3_AppendHandshakeHeader(ss, certificate_verify, buf.len + 2); | 4873 rv = ssl3_AppendHandshakeHeader(ss, certificate_verify, buf.len + 2); |
4881 if (rv != SECSuccess) { | 4874 if (rv != SECSuccess) { |
4882 goto done; /* error code set by AppendHandshake */ | 4875 goto done; /* error code set by AppendHandshake */ |
4883 } | 4876 } |
4884 rv = ssl3_AppendHandshakeVariable(ss, buf.data, buf.len, 2); | 4877 rv = ssl3_AppendHandshakeVariable(ss, buf.data, buf.len, 2); |
(...skipping 5003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9888 | 9881 |
9889 ss->ssl3.initialized = PR_FALSE; | 9882 ss->ssl3.initialized = PR_FALSE; |
9890 | 9883 |
9891 if (ss->ssl3.nextProto.data) { | 9884 if (ss->ssl3.nextProto.data) { |
9892 PORT_Free(ss->ssl3.nextProto.data); | 9885 PORT_Free(ss->ssl3.nextProto.data); |
9893 ss->ssl3.nextProto.data = NULL; | 9886 ss->ssl3.nextProto.data = NULL; |
9894 } | 9887 } |
9895 } | 9888 } |
9896 | 9889 |
9897 /* End of ssl3con.c */ | 9890 /* End of ssl3con.c */ |
OLD | NEW |