Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 * ***** 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 SSL_IMPORT SECStatus SSL_EnableDefault(int option, PRBool on); | 150 SSL_IMPORT SECStatus SSL_EnableDefault(int option, PRBool on); |
| 151 #endif | 151 #endif |
| 152 | 152 |
| 153 /* New function names */ | 153 /* New function names */ |
| 154 SSL_IMPORT SECStatus SSL_OptionSet(PRFileDesc *fd, PRInt32 option, PRBool on); | 154 SSL_IMPORT SECStatus SSL_OptionSet(PRFileDesc *fd, PRInt32 option, PRBool on); |
| 155 SSL_IMPORT SECStatus SSL_OptionGet(PRFileDesc *fd, PRInt32 option, PRBool *on); | 155 SSL_IMPORT SECStatus SSL_OptionGet(PRFileDesc *fd, PRInt32 option, PRBool *on); |
| 156 SSL_IMPORT SECStatus SSL_OptionSetDefault(PRInt32 option, PRBool on); | 156 SSL_IMPORT SECStatus SSL_OptionSetDefault(PRInt32 option, PRBool on); |
| 157 SSL_IMPORT SECStatus SSL_OptionGetDefault(PRInt32 option, PRBool *on); | 157 SSL_IMPORT SECStatus SSL_OptionGetDefault(PRInt32 option, PRBool *on); |
| 158 SSL_IMPORT SECStatus SSL_CertDBHandleSet(PRFileDesc *fd, CERTCertDBHandle *dbHan dle); | 158 SSL_IMPORT SECStatus SSL_CertDBHandleSet(PRFileDesc *fd, CERTCertDBHandle *dbHan dle); |
| 159 | 159 |
| 160 /* SSLNextProtoCallback is called, during the handshake, when the server has | |
| 161 * sent a Next Protocol Negotiation extension. |protos| and |protosLen| define | |
| 162 * a buffer which contains the server's advertisement. This data is guaranteed | |
| 163 * to be well formed per the NPN spec. |protoOut| is a buffer of length 255 | |
| 164 * (the maximum allowed by the protocol) which, on successful return, must | |
|
wtc
2011/10/18 00:58:08
Nit: I think "will" or "shall" sounds better than
agl
2011/10/18 16:44:43
Done.
| |
| 165 * contain the protocol to be announced to the server. */ | |
| 166 typedef SECStatus (PR_CALLBACK *SSLNextProtoCallback)( | |
| 167 void *arg, | |
| 168 PRFileDesc *fd, | |
| 169 const unsigned char* protos, | |
| 170 unsigned int protosLen, | |
| 171 unsigned char* protoOut, | |
| 172 unsigned int* protoOutLen); | |
| 173 | |
| 174 /* SSL_SetNextProtoCallback sets a callback function to handle Next Protocol | |
| 175 * Negotiation. It causes a client to advertise NPN. */ | |
| 176 SSL_IMPORT SECStatus SSL_SetNextProtoCallback(PRFileDesc *fd, | |
| 177 SSLNextProtoCallback callback, | |
| 178 void *arg); | |
| 179 | |
| 180 /* SSL_SetNextProtoNego can be used as an alternative to | |
| 181 * SSL_SetNextProtoCallback. It also causes a client to advertise NPN and | |
| 182 * installs a default callback function which selects the first supported | |
| 183 * protocol in server-preference order. Otherwise it selects the first | |
|
wtc
2011/10/18 00:58:08
Nit: it's not clear what "Otherwise" means here.
agl
2011/10/18 16:44:43
Done.
| |
| 184 * supported protocol. | |
| 185 * | |
| 186 * The supported protocols are specified in |data| in wire-format (8-bit | |
| 187 * length-prefixed). For example: "\010http/1.1\006spdy/2". */ | |
| 160 SSL_IMPORT SECStatus SSL_SetNextProtoNego(PRFileDesc *fd, | 188 SSL_IMPORT SECStatus SSL_SetNextProtoNego(PRFileDesc *fd, |
| 161 const unsigned char *data, | 189 const unsigned char *data, |
| 162 » » » » » unsigned short length); | 190 » » » » » unsigned int length); |
| 191 /* SSL_GetNextProto can be used after a handshake on a socket where | |
| 192 * SSL_SetNextProtoNego was called to retrieve the result of the Next Protocol | |
| 193 * negotiation. | |
| 194 * | |
| 195 * state is set to one of the SSL_NEXT_PROTO_* constants. The negotiated | |
| 196 * protocol, if any, is written into buf, which must be at least buf_len bytes | |
| 197 * long. If the negotiated protocol is longer than this, it is truncated. The | |
| 198 * number of bytes copied is written into length. */ | |
|
wtc
2011/10/18 00:58:08
Nit: length => *length
agl
2011/10/18 16:44:43
Done.
| |
| 163 SSL_IMPORT SECStatus SSL_GetNextProto(PRFileDesc *fd, | 199 SSL_IMPORT SECStatus SSL_GetNextProto(PRFileDesc *fd, |
| 164 int *state, | 200 int *state, |
| 165 unsigned char *buf, | 201 unsigned char *buf, |
| 166 unsigned *length, | 202 unsigned *length, |
| 167 unsigned buf_len); | 203 unsigned buf_len); |
|
wtc
2011/10/18 00:58:08
Nit: use "unsigned int" instead of just "unsigned"
agl
2011/10/18 16:44:43
Done.
| |
| 204 | |
| 168 #define SSL_NEXT_PROTO_NO_SUPPORT 0 /* No peer support */ | 205 #define SSL_NEXT_PROTO_NO_SUPPORT 0 /* No peer support */ |
| 169 #define SSL_NEXT_PROTO_NEGOTIATED 1 /* Mutual agreement */ | 206 #define SSL_NEXT_PROTO_NEGOTIATED 1 /* Mutual agreement */ |
| 170 #define SSL_NEXT_PROTO_NO_OVERLAP 2 /* No protocol overlap found */ | 207 #define SSL_NEXT_PROTO_NO_OVERLAP 2 /* No protocol overlap found */ |
|
wtc
2011/10/18 00:58:08
It may be a good idea to define these as an enum t
agl
2011/10/18 16:44:43
I've added a TODO because, at the moment, we use o
| |
| 171 | 208 |
| 172 /* | 209 /* |
| 173 ** Control ciphers that SSL uses. If on is non-zero then the named cipher | 210 ** Control ciphers that SSL uses. If on is non-zero then the named cipher |
| 174 ** is enabled, otherwise it is disabled. | 211 ** is enabled, otherwise it is disabled. |
| 175 ** The "cipher" values are defined in sslproto.h (the SSL_EN_* values). | 212 ** The "cipher" values are defined in sslproto.h (the SSL_EN_* values). |
| 176 ** EnableCipher records user preferences. | 213 ** EnableCipher records user preferences. |
| 177 ** SetPolicy sets the policy according to the policy module. | 214 ** SetPolicy sets the policy according to the policy module. |
| 178 */ | 215 */ |
| 179 #ifdef SSL_DEPRECATED_FUNCTION | 216 #ifdef SSL_DEPRECATED_FUNCTION |
| 180 /* Old deprecated function names */ | 217 /* Old deprecated function names */ |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 755 SSLExtensionType extId, | 792 SSLExtensionType extId, |
| 756 PRBool *yes); | 793 PRBool *yes); |
| 757 | 794 |
| 758 SSL_IMPORT SECStatus SSL_HandshakeResumedSession(PRFileDesc *fd, | 795 SSL_IMPORT SECStatus SSL_HandshakeResumedSession(PRFileDesc *fd, |
| 759 PRBool *last_handshake_resumed) ; | 796 PRBool *last_handshake_resumed) ; |
| 760 | 797 |
| 761 | 798 |
| 762 SEC_END_PROTOS | 799 SEC_END_PROTOS |
| 763 | 800 |
| 764 #endif /* __ssl_h_ */ | 801 #endif /* __ssl_h_ */ |
| OLD | NEW |