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

Side by Side Diff: net/third_party/nss/ssl/ssl.h

Issue 18346010: net: support ALPN. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove the new error. Created 7 years, 5 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 * This file contains prototypes for the public SSL functions. 2 * This file contains prototypes for the public SSL functions.
3 * 3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public 4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /* $Id$ */ 7 /* $Id$ */
8 8
9 #ifndef __ssl_h_ 9 #ifndef __ssl_h_
10 #define __ssl_h_ 10 #define __ssl_h_
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 SSL_IMPORT SECStatus SSL_SetNextProtoCallback(PRFileDesc *fd, 197 SSL_IMPORT SECStatus SSL_SetNextProtoCallback(PRFileDesc *fd,
198 SSLNextProtoCallback callback, 198 SSLNextProtoCallback callback,
199 void *arg); 199 void *arg);
200 200
201 /* SSL_SetNextProtoNego can be used as an alternative to 201 /* SSL_SetNextProtoNego can be used as an alternative to
202 * SSL_SetNextProtoCallback. It also causes a client to advertise NPN and 202 * SSL_SetNextProtoCallback. It also causes a client to advertise NPN and
203 * installs a default callback function which selects the first supported 203 * installs a default callback function which selects the first supported
204 * protocol in server-preference order. If no matching protocol is found it 204 * protocol in server-preference order. If no matching protocol is found it
205 * selects the first supported protocol. 205 * selects the first supported protocol.
206 * 206 *
207 * Using this function also allows the client to transparently support ALPN.
208 * The same set of protocols will be advertised via ALPN and, if the server
209 * uses ALPN to select a protocol, SSL_GetNextProto will return
210 * SSL_NEXT_PROTO_SELECTED as the state.
211 *
207 * The supported protocols are specified in |data| in wire-format (8-bit 212 * The supported protocols are specified in |data| in wire-format (8-bit
208 * length-prefixed). For example: "\010http/1.1\006spdy/2". */ 213 * length-prefixed). For example: "\010http/1.1\006spdy/2". */
209 SSL_IMPORT SECStatus SSL_SetNextProtoNego(PRFileDesc *fd, 214 SSL_IMPORT SECStatus SSL_SetNextProtoNego(PRFileDesc *fd,
210 const unsigned char *data, 215 const unsigned char *data,
211 unsigned int length); 216 unsigned int length);
212 217
213 typedef enum SSLNextProtoState { 218 typedef enum SSLNextProtoState {
214 SSL_NEXT_PROTO_NO_SUPPORT = 0, /* No peer support */ 219 SSL_NEXT_PROTO_NO_SUPPORT = 0, /* No peer support */
215 SSL_NEXT_PROTO_NEGOTIATED = 1, /* Mutual agreement */ 220 SSL_NEXT_PROTO_NEGOTIATED = 1, /* Mutual agreement */
216 SSL_NEXT_PROTO_NO_OVERLAP = 2 /* No protocol overlap found */ 221 SSL_NEXT_PROTO_NO_OVERLAP = 2, /* No protocol overlap found */
222 SSL_NEXT_PROTO_SELECTED = 3, /* Server selected proto (ALPN) */
217 } SSLNextProtoState; 223 } SSLNextProtoState;
218 224
219 /* SSL_GetNextProto can be used in the HandshakeCallback or any time after 225 /* SSL_GetNextProto can be used in the HandshakeCallback or any time after
220 * a handshake to retrieve the result of the Next Protocol negotiation. 226 * a handshake to retrieve the result of the Next Protocol negotiation.
221 * 227 *
222 * The length of the negotiated protocol, if any, is written into *bufLen. 228 * The length of the negotiated protocol, if any, is written into *bufLen.
223 * If the negotiated protocol is longer than bufLenMax, then SECFailure is 229 * If the negotiated protocol is longer than bufLenMax, then SECFailure is
224 * returned. Otherwise, the negotiated protocol, if any, is written into buf, 230 * returned. Otherwise, the negotiated protocol, if any, is written into buf,
225 * and SECSuccess is returned. */ 231 * and SECSuccess is returned. */
226 SSL_IMPORT SECStatus SSL_GetNextProto(PRFileDesc *fd, 232 SSL_IMPORT SECStatus SSL_GetNextProto(PRFileDesc *fd,
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 * should continue using the connection. If the application passes a non-zero 1098 * should continue using the connection. If the application passes a non-zero
1093 * value for second argument (error), or if SSL_AuthCertificateComplete returns 1099 * value for second argument (error), or if SSL_AuthCertificateComplete returns
1094 * anything other than SECSuccess, then the application should close the 1100 * anything other than SECSuccess, then the application should close the
1095 * connection. 1101 * connection.
1096 */ 1102 */
1097 SSL_IMPORT SECStatus SSL_AuthCertificateComplete(PRFileDesc *fd, 1103 SSL_IMPORT SECStatus SSL_AuthCertificateComplete(PRFileDesc *fd,
1098 PRErrorCode error); 1104 PRErrorCode error);
1099 SEC_END_PROTOS 1105 SEC_END_PROTOS
1100 1106
1101 #endif /* __ssl_h_ */ 1107 #endif /* __ssl_h_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698