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

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

Issue 10424013: Support TLS Channel IDs in NSS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 months 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 * vtables (and methods that call through them) for the 4 types of 2 * vtables (and methods that call through them) for the 4 types of
3 * SSLSockets supported. Only one type is still supported. 3 * SSLSockets supported. Only one type is still supported.
4 * Various other functions. 4 * Various other functions.
5 * 5 *
6 * ***** BEGIN LICENSE BLOCK ***** 6 * ***** BEGIN LICENSE BLOCK *****
7 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 7 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
8 * 8 *
9 * The contents of this file are subject to the Mozilla Public License Version 9 * The contents of this file are subject to the Mozilla Public License Version
10 * 1.1 (the "License"); you may not use this file except in compliance with 10 * 1.1 (the "License"); you may not use this file except in compliance with
(...skipping 1860 matching lines...) Expand 10 before | Expand all | Expand 10 after
1871 if (!ss) { 1871 if (!ss) {
1872 SSL_DBG(("%d: SSL[%d]: bad socket in SSL_HandshakeResumedSession", 1872 SSL_DBG(("%d: SSL[%d]: bad socket in SSL_HandshakeResumedSession",
1873 SSL_GETPID(), fd)); 1873 SSL_GETPID(), fd));
1874 return SECFailure; 1874 return SECFailure;
1875 } 1875 }
1876 1876
1877 *handshake_resumed = ss->ssl3.hs.isResuming; 1877 *handshake_resumed = ss->ssl3.hs.isResuming;
1878 return SECSuccess; 1878 return SECSuccess;
1879 } 1879 }
1880 1880
1881 SECStatus
1882 SSL_SetChannelID(PRFileDesc *fd, SECKEYPrivateKey *id,
1883 SECKEYPublicKey *pub) {
1884 sslSocket *ss = ssl_FindSocket(fd);
1885
1886 if (!ss) {
1887 SSL_DBG(("%d: SSL[%d]: bad socket in SSL_SetChannelID",
1888 SSL_GETPID(), fd));
1889 return SECFailure;
1890 }
1891
1892 if (SECKEY_GetPrivateKeyType(id) != ecKey) {
1893 PORT_SetError(SSL_ERROR_INVALID_CHANNEL_ID_KEY);
1894 return SECFailure;
1895 }
1896
1897 if (ss->ssl3.channelID)
1898 SECKEY_DestroyPrivateKey(ss->ssl3.channelID);
1899 if (ss->ssl3.channelIDPub)
1900 SECKEY_DestroyPublicKey(ss->ssl3.channelIDPub);
1901
1902 ss->ssl3.channelID = id;
1903 ss->ssl3.channelIDPub = pub;
1904
1905 return SECSuccess;
1906 }
1907
1881 const SECItem * 1908 const SECItem *
1882 SSL_GetRequestedClientCertificateTypes(PRFileDesc *fd) 1909 SSL_GetRequestedClientCertificateTypes(PRFileDesc *fd)
1883 { 1910 {
1884 sslSocket *ss = ssl_FindSocket(fd); 1911 sslSocket *ss = ssl_FindSocket(fd);
1885 1912
1886 if (!ss) { 1913 if (!ss) {
1887 SSL_DBG(("%d: SSL[%d]: bad socket in " 1914 SSL_DBG(("%d: SSL[%d]: bad socket in "
1888 "SSL_GetRequestedClientCertificateTypes", SSL_GETPID(), fd)); 1915 "SSL_GetRequestedClientCertificateTypes", SSL_GETPID(), fd));
1889 return NULL; 1916 return NULL;
1890 } 1917 }
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after
2957 ssl_DestroySocketContents(ss); 2984 ssl_DestroySocketContents(ss);
2958 ssl_DestroyLocks(ss); 2985 ssl_DestroyLocks(ss);
2959 PORT_Free(ss); 2986 PORT_Free(ss);
2960 ss = NULL; 2987 ss = NULL;
2961 } 2988 }
2962 ss->protocolVariant = protocolVariant; 2989 ss->protocolVariant = protocolVariant;
2963 } 2990 }
2964 return ss; 2991 return ss;
2965 } 2992 }
2966 2993
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698