| 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 provided by the |
| 164 * caller, of length 255 (the maximum allowed by the protocol). |
| 165 * On successful return, the protocol to be announced to the server will be in |
| 166 * |protoOut| and its length in |protoOutLen|. */ |
| 167 typedef SECStatus (PR_CALLBACK *SSLNextProtoCallback)( |
| 168 void *arg, |
| 169 PRFileDesc *fd, |
| 170 const unsigned char* protos, |
| 171 unsigned int protosLen, |
| 172 unsigned char* protoOut, |
| 173 unsigned int* protoOutLen); |
| 174 |
| 175 /* SSL_SetNextProtoCallback sets a callback function to handle Next Protocol |
| 176 * Negotiation. It causes a client to advertise NPN. */ |
| 177 SSL_IMPORT SECStatus SSL_SetNextProtoCallback(PRFileDesc *fd, |
| 178 SSLNextProtoCallback callback, |
| 179 void *arg); |
| 180 |
| 181 /* SSL_SetNextProtoNego can be used as an alternative to |
| 182 * SSL_SetNextProtoCallback. It also causes a client to advertise NPN and |
| 183 * installs a default callback function which selects the first supported |
| 184 * protocol in server-preference order. If no matching protocol is found it |
| 185 * selects the first supported protocol. |
| 186 * |
| 187 * The supported protocols are specified in |data| in wire-format (8-bit |
| 188 * length-prefixed). For example: "\010http/1.1\006spdy/2". */ |
| 160 SSL_IMPORT SECStatus SSL_SetNextProtoNego(PRFileDesc *fd, | 189 SSL_IMPORT SECStatus SSL_SetNextProtoNego(PRFileDesc *fd, |
| 161 const unsigned char *data, | 190 const unsigned char *data, |
| 162 » » » » » unsigned short length); | 191 » » » » » unsigned int length); |
| 192 /* SSL_GetNextProto can be used after a handshake on a socket where |
| 193 * SSL_SetNextProtoNego was called to retrieve the result of the Next Protocol |
| 194 * negotiation. |
| 195 * |
| 196 * state is set to one of the SSL_NEXT_PROTO_* constants. The negotiated |
| 197 * protocol, if any, is written into buf, which must be at least buf_len bytes |
| 198 * long. If the negotiated protocol is longer than this, it is truncated. The |
| 199 * number of bytes copied is written into *length. */ |
| 163 SSL_IMPORT SECStatus SSL_GetNextProto(PRFileDesc *fd, | 200 SSL_IMPORT SECStatus SSL_GetNextProto(PRFileDesc *fd, |
| 164 int *state, | 201 int *state, |
| 165 unsigned char *buf, | 202 unsigned char *buf, |
| 166 » » » » unsigned *length, | 203 » » » » unsigned int *length, |
| 167 » » » » unsigned buf_len); | 204 » » » » unsigned int buf_len); |
| 205 |
| 206 // TODO(wtc): it may be a good idea to define these as an enum type. |
| 168 #define SSL_NEXT_PROTO_NO_SUPPORT 0 /* No peer support */ | 207 #define SSL_NEXT_PROTO_NO_SUPPORT 0 /* No peer support */ |
| 169 #define SSL_NEXT_PROTO_NEGOTIATED 1 /* Mutual agreement */ | 208 #define SSL_NEXT_PROTO_NEGOTIATED 1 /* Mutual agreement */ |
| 170 #define SSL_NEXT_PROTO_NO_OVERLAP 2 /* No protocol overlap found */ | 209 #define SSL_NEXT_PROTO_NO_OVERLAP 2 /* No protocol overlap found */ |
| 171 | 210 |
| 172 /* | 211 /* |
| 173 ** Control ciphers that SSL uses. If on is non-zero then the named cipher | 212 ** Control ciphers that SSL uses. If on is non-zero then the named cipher |
| 174 ** is enabled, otherwise it is disabled. | 213 ** is enabled, otherwise it is disabled. |
| 175 ** The "cipher" values are defined in sslproto.h (the SSL_EN_* values). | 214 ** The "cipher" values are defined in sslproto.h (the SSL_EN_* values). |
| 176 ** EnableCipher records user preferences. | 215 ** EnableCipher records user preferences. |
| 177 ** SetPolicy sets the policy according to the policy module. | 216 ** SetPolicy sets the policy according to the policy module. |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 SSLExtensionType extId, | 794 SSLExtensionType extId, |
| 756 PRBool *yes); | 795 PRBool *yes); |
| 757 | 796 |
| 758 SSL_IMPORT SECStatus SSL_HandshakeResumedSession(PRFileDesc *fd, | 797 SSL_IMPORT SECStatus SSL_HandshakeResumedSession(PRFileDesc *fd, |
| 759 PRBool *last_handshake_resumed)
; | 798 PRBool *last_handshake_resumed)
; |
| 760 | 799 |
| 761 | 800 |
| 762 SEC_END_PROTOS | 801 SEC_END_PROTOS |
| 763 | 802 |
| 764 #endif /* __ssl_h_ */ | 803 #endif /* __ssl_h_ */ |
| OLD | NEW |