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

Unified Diff: net/third_party/nss/ssl/ssl.h

Issue 8156001: net: rework the NPN patch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: net/third_party/nss/ssl/ssl.h
diff --git a/net/third_party/nss/ssl/ssl.h b/net/third_party/nss/ssl/ssl.h
index 03535f3c6a940af276bd75b18a6841955c60c47a..232277524c149ff58d8e364c88415c43672d477b 100644
--- a/net/third_party/nss/ssl/ssl.h
+++ b/net/third_party/nss/ssl/ssl.h
@@ -157,17 +157,27 @@ SSL_IMPORT SECStatus SSL_OptionSetDefault(PRInt32 option, PRBool on);
SSL_IMPORT SECStatus SSL_OptionGetDefault(PRInt32 option, PRBool *on);
SSL_IMPORT SECStatus SSL_CertDBHandleSet(PRFileDesc *fd, CERTCertDBHandle *dbHandle);
-SSL_IMPORT SECStatus SSL_SetNextProtoNego(PRFileDesc *fd,
- const unsigned char *data,
- unsigned short length);
-SSL_IMPORT SECStatus SSL_GetNextProto(PRFileDesc *fd,
- int *state,
- unsigned char *buf,
- unsigned *length,
- unsigned buf_len);
-#define SSL_NEXT_PROTO_NO_SUPPORT 0 /* No peer support */
-#define SSL_NEXT_PROTO_NEGOTIATED 1 /* Mutual agreement */
-#define SSL_NEXT_PROTO_NO_OVERLAP 2 /* No protocol overlap found */
+#define SSL_NEXT_PROTO_NEGOTIATION_SUPPORTED 1
+
+/* SSLNextProtoCallback is called, during the handshake, when the server has
+ * sent a Next Protocol Negotiation extension. |protos| and |protosLen| define
+ * a buffer which contains the server's advertisement. This data is guaranteed
+ * to be well formed per the NPN spec. |protoOut| is a buffer of length 255
+ * (the maximum allowed by the protocol) which, on successful return, must
+ * contain the protocol to be announced to the server. */
+typedef SECStatus (PR_CALLBACK *SSLNextProtoCallback)(
+ void *arg,
+ PRFileDesc *fd,
+ const unsigned char* protos,
+ unsigned short protosLen,
+ unsigned char* protoOut,
+ unsigned char* protoOutLen);
wtc 2011/10/11 23:43:04 On second thought, I think we should use unsig
agl 2011/10/17 17:37:24 Done.
+
+/* SSL_SetNextProtoCallback sets a callback function to handle Next Protocol
+ * Negotiation. It causes a client to advertise NPN. */
wtc 2011/10/11 23:43:04 If you take my suggestion of keeping SSL_SetNextPr
agl 2011/10/17 17:37:24 Done.
+SSL_IMPORT SECStatus SSL_SetNextProtoCallback(PRFileDesc *fd,
+ SSLNextProtoCallback callback,
+ void *arg);
/*
** Control ciphers that SSL uses. If on is non-zero then the named cipher

Powered by Google App Engine
This is Rietveld 408576698