Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: net/third_party/nss/ssl/ssl3con.c

Issue 8771031: Add NSS function to retrieve TLS client cert types requested by server. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 5533 matching lines...) Expand 10 before | Expand all | Expand 10 after
5544 PORT_Assert(ss->ssl3.clientCertChain == NULL); 5544 PORT_Assert(ss->ssl3.clientCertChain == NULL);
5545 PORT_Assert(ss->ssl3.clientCertificate == NULL); 5545 PORT_Assert(ss->ssl3.clientCertificate == NULL);
5546 PORT_Assert(ss->ssl3.clientPrivateKey == NULL); 5546 PORT_Assert(ss->ssl3.clientPrivateKey == NULL);
5547 PORT_Assert(ss->ssl3.platformClientKey == (PlatformKey)NULL); 5547 PORT_Assert(ss->ssl3.platformClientKey == (PlatformKey)NULL);
5548 5548
5549 isTLS = (PRBool)(ss->ssl3.prSpec->version > SSL_LIBRARY_VERSION_3_0); 5549 isTLS = (PRBool)(ss->ssl3.prSpec->version > SSL_LIBRARY_VERSION_3_0);
5550 rv = ssl3_ConsumeHandshakeVariable(ss, &cert_types, 1, &b, &length); 5550 rv = ssl3_ConsumeHandshakeVariable(ss, &cert_types, 1, &b, &length);
5551 if (rv != SECSuccess) 5551 if (rv != SECSuccess)
5552 goto loser; /* malformed, alert has been sent */ 5552 goto loser; /* malformed, alert has been sent */
5553 5553
5554 ss->requestedCertTypes = &cert_types;
wtc 2011/12/02 22:31:46 Add PORT_Assert(!ss->requestedCertTypes); befo
mattm 2011/12/06 00:32:01 Done.
5555
5554 arena = ca_list.arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); 5556 arena = ca_list.arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
5555 if (arena == NULL) 5557 if (arena == NULL)
5556 goto no_mem; 5558 goto no_mem;
5557 5559
5558 remaining = ssl3_ConsumeHandshakeNumber(ss, 2, &b, &length); 5560 remaining = ssl3_ConsumeHandshakeNumber(ss, 2, &b, &length);
5559 if (remaining < 0) 5561 if (remaining < 0)
5560 goto loser; /* malformed, alert has been sent */ 5562 goto loser; /* malformed, alert has been sent */
5561 5563
5562 if ((PRUint32)remaining > length) 5564 if ((PRUint32)remaining > length)
5563 goto alert_loser; 5565 goto alert_loser;
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
5733 goto done; 5735 goto done;
5734 5736
5735 alert_loser: 5737 alert_loser:
5736 if (isTLS && desc == illegal_parameter) 5738 if (isTLS && desc == illegal_parameter)
5737 desc = decode_error; 5739 desc = decode_error;
5738 (void)SSL3_SendAlert(ss, alert_fatal, desc); 5740 (void)SSL3_SendAlert(ss, alert_fatal, desc);
5739 loser: 5741 loser:
5740 PORT_SetError(errCode); 5742 PORT_SetError(errCode);
5741 rv = SECFailure; 5743 rv = SECFailure;
5742 done: 5744 done:
5745 ss->requestedCertTypes = NULL;
5743 if (arena != NULL) 5746 if (arena != NULL)
5744 PORT_FreeArena(arena, PR_FALSE); 5747 PORT_FreeArena(arena, PR_FALSE);
5745 #ifdef NSS_PLATFORM_CLIENT_AUTH 5748 #ifdef NSS_PLATFORM_CLIENT_AUTH
5746 if (platform_cert_list) 5749 if (platform_cert_list)
5747 CERT_DestroyCertList(platform_cert_list); 5750 CERT_DestroyCertList(platform_cert_list);
5748 #endif 5751 #endif
5749 return rv; 5752 return rv;
5750 } 5753 }
5751 5754
5752 /* 5755 /*
(...skipping 4273 matching lines...) Expand 10 before | Expand all | Expand 10 after
10026 10029
10027 ss->ssl3.initialized = PR_FALSE; 10030 ss->ssl3.initialized = PR_FALSE;
10028 10031
10029 if (ss->ssl3.nextProto.data) { 10032 if (ss->ssl3.nextProto.data) {
10030 PORT_Free(ss->ssl3.nextProto.data); 10033 PORT_Free(ss->ssl3.nextProto.data);
10031 ss->ssl3.nextProto.data = NULL; 10034 ss->ssl3.nextProto.data = NULL;
10032 } 10035 }
10033 } 10036 }
10034 10037
10035 /* End of ssl3con.c */ 10038 /* End of ssl3con.c */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698