summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/ssl.h')
-rw-r--r--src/lib/libssl/ssl.h1161
1 files changed, 596 insertions, 565 deletions
diff --git a/src/lib/libssl/ssl.h b/src/lib/libssl/ssl.h
index cf8f9651b2..fbe4f667fa 100644
--- a/src/lib/libssl/ssl.h
+++ b/src/lib/libssl/ssl.h
@@ -63,6 +63,8 @@
63extern "C" { 63extern "C" {
64#endif 64#endif
65 65
66#include <openssl/safestack.h>
67
66/* SSLeay version number for ASN.1 encoding of the session information */ 68/* SSLeay version number for ASN.1 encoding of the session information */
67/* Version 0 - initial version 69/* Version 0 - initial version
68 * Version 1 - added the optional peer certificate 70 * Version 1 - added the optional peer certificate
@@ -82,6 +84,7 @@ extern "C" {
82#define SSL_TXT_DES_192_EDE3_CBC_WITH_SHA SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA 84#define SSL_TXT_DES_192_EDE3_CBC_WITH_SHA SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA
83 85
84#define SSL_MAX_SSL_SESSION_ID_LENGTH 32 86#define SSL_MAX_SSL_SESSION_ID_LENGTH 32
87#define SSL_MAX_SID_CTX_LENGTH 32
85 88
86#define SSL_MIN_RSA_MODULUS_LENGTH_IN_BYTES (512/8) 89#define SSL_MIN_RSA_MODULUS_LENGTH_IN_BYTES (512/8)
87#define SSL_MAX_KEY_ARG_LENGTH 8 90#define SSL_MAX_KEY_ARG_LENGTH 8
@@ -120,10 +123,12 @@ extern "C" {
120#define SSL_TXT_MD5 "MD5" 123#define SSL_TXT_MD5 "MD5"
121#define SSL_TXT_SHA1 "SHA1" 124#define SSL_TXT_SHA1 "SHA1"
122#define SSL_TXT_SHA "SHA" 125#define SSL_TXT_SHA "SHA"
123#define SSL_TXT_EXP "EXP" 126#define SSL_TXT_EXP40 "EXP"
124#define SSL_TXT_EXPORT "EXPORT" 127#define SSL_TXT_EXPORT "EXPORT"
128#define SSL_TXT_EXP56 "EXPORT56"
125#define SSL_TXT_SSLV2 "SSLv2" 129#define SSL_TXT_SSLV2 "SSLv2"
126#define SSL_TXT_SSLV3 "SSLv3" 130#define SSL_TXT_SSLV3 "SSLv3"
131#define SSL_TXT_TLSV1 "TLSv1"
127#define SSL_TXT_ALL "ALL" 132#define SSL_TXT_ALL "ALL"
128 133
129/* 'DEFAULT' at the start of the cipher list insert the following string 134/* 'DEFAULT' at the start of the cipher list insert the following string
@@ -139,11 +144,12 @@ extern "C" {
139#define SSL_SENT_SHUTDOWN 1 144#define SSL_SENT_SHUTDOWN 1
140#define SSL_RECEIVED_SHUTDOWN 2 145#define SSL_RECEIVED_SHUTDOWN 2
141 146
142#include "crypto.h" 147#include <openssl/crypto.h>
143#include "lhash.h" 148#include <openssl/lhash.h>
144#include "buffer.h" 149#include <openssl/buffer.h>
145#include "bio.h" 150#include <openssl/bio.h>
146#include "x509.h" 151#include <openssl/pem.h>
152#include <openssl/x509.h>
147 153
148#define SSL_FILETYPE_ASN1 X509_FILETYPE_ASN1 154#define SSL_FILETYPE_ASN1 X509_FILETYPE_ASN1
149#define SSL_FILETYPE_PEM X509_FILETYPE_PEM 155#define SSL_FILETYPE_PEM X509_FILETYPE_PEM
@@ -157,44 +163,46 @@ typedef struct ssl_st *ssl_crock_st;
157typedef struct ssl_cipher_st 163typedef struct ssl_cipher_st
158 { 164 {
159 int valid; 165 int valid;
160 char *name; /* text name */ 166 const char *name; /* text name */
161 unsigned long id; /* id, 4 bytes, first is version */ 167 unsigned long id; /* id, 4 bytes, first is version */
162 unsigned long algorithms; /* what ciphers are used */ 168 unsigned long algorithms; /* what ciphers are used */
163 unsigned long algorithm2; /* Extra flags */ 169 unsigned long algorithm2; /* Extra flags */
164 unsigned long mask; /* used for matching */ 170 unsigned long mask; /* used for matching */
165 } SSL_CIPHER; 171 } SSL_CIPHER;
166 172
173DECLARE_STACK_OF(SSL_CIPHER)
174
175typedef struct ssl_st SSL;
176typedef struct ssl_ctx_st SSL_CTX;
177
167/* Used to hold functions for SSLv2 or SSLv3/TLSv1 functions */ 178/* Used to hold functions for SSLv2 or SSLv3/TLSv1 functions */
168typedef struct ssl_method_st 179typedef struct ssl_method_st
169 { 180 {
170 int version; 181 int version;
171 int (*ssl_new)(); 182 int (*ssl_new)(SSL *s);
172 void (*ssl_clear)(); 183 void (*ssl_clear)(SSL *s);
173 void (*ssl_free)(); 184 void (*ssl_free)(SSL *s);
174 int (*ssl_accept)(); 185 int (*ssl_accept)(SSL *s);
175 int (*ssl_connect)(); 186 int (*ssl_connect)(SSL *s);
176 int (*ssl_read)(); 187 int (*ssl_read)(SSL *s,void *buf,int len);
177 int (*ssl_peek)(); 188 int (*ssl_peek)(SSL *s,char *buf,int len);
178 int (*ssl_write)(); 189 int (*ssl_write)(SSL *s,const void *buf,int len);
179 int (*ssl_shutdown)(); 190 int (*ssl_shutdown)(SSL *s);
180 int (*ssl_renegotiate)(); 191 int (*ssl_renegotiate)(SSL *s);
181 long (*ssl_ctrl)(); 192 int (*ssl_renegotiate_check)(SSL *s);
182 long (*ssl_ctx_ctrl)(); 193 long (*ssl_ctrl)(SSL *s,int cmd,long larg,char *parg);
183 SSL_CIPHER *(*get_cipher_by_char)(); 194 long (*ssl_ctx_ctrl)(SSL_CTX *ctx,int cmd,long larg,char *parg);
184 int (*put_cipher_by_char)(); 195 SSL_CIPHER *(*get_cipher_by_char)(const unsigned char *ptr);
185 int (*ssl_pending)(); 196 int (*put_cipher_by_char)(const SSL_CIPHER *cipher,unsigned char *ptr);
186 int (*num_ciphers)(); 197 int (*ssl_pending)(SSL *s);
187 SSL_CIPHER *(*get_cipher)(); 198 int (*num_ciphers)(void);
188 struct ssl_method_st *(*get_ssl_method)(); 199 SSL_CIPHER *(*get_cipher)(unsigned ncipher);
189 long (*get_timeout)(); 200 struct ssl_method_st *(*get_ssl_method)(int version);
201 long (*get_timeout)(void);
190 struct ssl3_enc_method *ssl3_enc; /* Extra SSLv3/TLS stuff */ 202 struct ssl3_enc_method *ssl3_enc; /* Extra SSLv3/TLS stuff */
203 int (*ssl_version)();
191 } SSL_METHOD; 204 } SSL_METHOD;
192 205
193typedef struct ssl_compression_st
194 {
195 char *stuff;
196 } SSL_COMPRESSION;
197
198/* Lets make this into an ASN.1 type structure as follows 206/* Lets make this into an ASN.1 type structure as follows
199 * SSL_SESSION_ID ::= SEQUENCE { 207 * SSL_SESSION_ID ::= SEQUENCE {
200 * version INTEGER, -- structure version number 208 * version INTEGER, -- structure version number
@@ -206,6 +214,8 @@ typedef struct ssl_compression_st
206 * Time [ 1 ] EXPLICIT INTEGER, -- optional Start Time 214 * Time [ 1 ] EXPLICIT INTEGER, -- optional Start Time
207 * Timeout [ 2 ] EXPLICIT INTEGER, -- optional Timeout ins seconds 215 * Timeout [ 2 ] EXPLICIT INTEGER, -- optional Timeout ins seconds
208 * Peer [ 3 ] EXPLICIT X509, -- optional Peer Certificate 216 * Peer [ 3 ] EXPLICIT X509, -- optional Peer Certificate
217 * Session_ID_context [ 4 ] EXPLICIT OCTET_STRING, -- the Session ID context
218 * Compression [5] IMPLICIT ASN1_OBJECT -- compression OID XXXXX
209 * } 219 * }
210 * Look in ssl/ssl_asn1.c for more details 220 * Look in ssl/ssl_asn1.c for more details
211 * I'm using EXPLICIT tags so I can read the damn things using asn1parse :-). 221 * I'm using EXPLICIT tags so I can read the damn things using asn1parse :-).
@@ -223,29 +233,35 @@ typedef struct ssl_session_st
223 /* session_id - valid? */ 233 /* session_id - valid? */
224 unsigned int session_id_length; 234 unsigned int session_id_length;
225 unsigned char session_id[SSL_MAX_SSL_SESSION_ID_LENGTH]; 235 unsigned char session_id[SSL_MAX_SSL_SESSION_ID_LENGTH];
236 /* this is used to determine whether the session is being reused in
237 * the appropriate context. It is up to the application to set this,
238 * via SSL_new */
239 unsigned int sid_ctx_length;
240 unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
226 241
227 int not_resumable; 242 int not_resumable;
228 243
229 /* The cert is the certificate used to establish this connection */ 244 /* The cert is the certificate used to establish this connection */
230 struct cert_st /* CERT */ *cert; 245 struct sess_cert_st /* SESS_CERT */ *sess_cert;
231 246
232 /* This is the cert for the other end. On servers, it will be 247 /* This is the cert for the other end.
233 * the same as cert->x509 */ 248 * On clients, it will be the same as sess_cert->peer_key->x509
249 * (the latter is not enough as sess_cert is not retained
250 * in the external representation of sessions, see ssl_asn1.c). */
234 X509 *peer; 251 X509 *peer;
235 252
236 int references; 253 int references;
237 long timeout; 254 long timeout;
238 long time; 255 long time;
239 256
240 SSL_COMPRESSION *read_compression; 257 int compress_meth; /* Need to lookup the method */
241 SSL_COMPRESSION *write_compression;
242 258
243 SSL_CIPHER *cipher; 259 SSL_CIPHER *cipher;
244 unsigned long cipher_id; /* when ASN.1 loaded, this 260 unsigned long cipher_id; /* when ASN.1 loaded, this
245 * needs to be used to load 261 * needs to be used to load
246 * the 'cipher' structure */ 262 * the 'cipher' structure */
247 263
248 STACK /* SSL_CIPHER */ *ciphers; /* shared ciphers? */ 264 STACK_OF(SSL_CIPHER) *ciphers; /* shared ciphers? */
249 265
250 CRYPTO_EX_DATA ex_data; /* application specific data */ 266 CRYPTO_EX_DATA ex_data; /* application specific data */
251 267
@@ -262,42 +278,81 @@ typedef struct ssl_session_st
262#define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x00000040L 278#define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x00000040L
263#define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x00000080L 279#define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x00000080L
264#define SSL_OP_TLS_D5_BUG 0x00000100L 280#define SSL_OP_TLS_D5_BUG 0x00000100L
265#define SSL_OP_TLS_BLOCK_PADDING_BUG 0x00000200L 281#define SSL_OP_TLS_BLOCK_PADDING_BUG 0x00000200L
282#define SSL_OP_TLS_ROLLBACK_BUG 0x00000400L
266 283
267/* If set, only use tmp_dh parameters once */ 284/* If set, always create a new key when using tmp_dh parameters */
268#define SSL_OP_SINGLE_DH_USE 0x00100000L 285#define SSL_OP_SINGLE_DH_USE 0x00100000L
269/* Set to also use the tmp_rsa key when doing RSA operations. */ 286/* Set to also use the tmp_rsa key when doing RSA operations. */
270#define SSL_OP_EPHEMERAL_RSA 0x00200000L 287#define SSL_OP_EPHEMERAL_RSA 0x00200000L
271 288
289/* The next flag deliberately changes the ciphertest, this is a check
290 * for the PKCS#1 attack */
291#define SSL_OP_PKCS1_CHECK_1 0x08000000L
292#define SSL_OP_PKCS1_CHECK_2 0x10000000L
272#define SSL_OP_NETSCAPE_CA_DN_BUG 0x20000000L 293#define SSL_OP_NETSCAPE_CA_DN_BUG 0x20000000L
273#define SSL_OP_NON_EXPORT_FIRST 0x40000000L 294#define SSL_OP_NON_EXPORT_FIRST 0x40000000L
274#define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x80000000L 295#define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x80000000L
275#define SSL_OP_ALL 0x000FFFFFL 296#define SSL_OP_ALL 0x000FFFFFL
276 297
277#define SSL_CTX_set_options(ctx,op) ((ctx)->options|=(op))
278#define SSL_set_options(ssl,op) ((ssl)->options|=(op))
279
280#define SSL_OP_NO_SSLv2 0x01000000L 298#define SSL_OP_NO_SSLv2 0x01000000L
281#define SSL_OP_NO_SSLv3 0x02000000L 299#define SSL_OP_NO_SSLv3 0x02000000L
282#define SSL_OP_NO_TLSv1 0x04000000L 300#define SSL_OP_NO_TLSv1 0x04000000L
283 301
284/* Normally you will only use these if your application wants to use 302/* Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success
285 * the certificate store in other places, perhaps PKCS7 */ 303 * when just a single record has been written): */
286#define SSL_CTX_get_cert_store(ctx) ((ctx)->cert_store) 304#define SSL_MODE_ENABLE_PARTIAL_WRITE 0x00000001L
287#define SSL_CTX_set_cert_store(ctx,cs) \ 305/* Make it possible to retry SSL_write() with changed buffer location
288 (X509_STORE_free((ctx)->cert_store),(ctx)->cert_store=(cs)) 306 * (buffer contents must stay the same!); this is not the default to avoid
289 307 * the misconception that non-blocking SSL_write() behaves like
308 * non-blocking write(): */
309#define SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER 0x00000002L
310
311/* Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value,
312 * they cannot be used to clear bits. */
313
314#define SSL_CTX_set_options(ctx,op) \
315 SSL_CTX_ctrl(ctx,SSL_CTRL_OPTIONS,op,NULL)
316#define SSL_CTX_get_options(ctx) \
317 SSL_CTX_ctrl(ctx,SSL_CTRL_OPTIONS,0,NULL)
318#define SSL_set_options(ssl,op) \
319 SSL_ctrl(ssl,SSL_CTRL_OPTIONS,op,NULL)
320#define SSL_get_options(ssl) \
321 SSL_ctrl(ssl,SSL_CTRL_OPTIONS,0,NULL)
322
323#define SSL_CTX_set_mode(ctx,op) \
324 SSL_CTX_ctrl(ctx,SSL_CTRL_MODE,op,NULL)
325#define SSL_CTX_get_mode(ctx) \
326 SSL_CTX_ctrl(ctx,SSL_CTRL_MODE,0,NULL)
327#define SSL_set_mode(ssl,op) \
328 SSL_ctrl(ssl,SSL_CTRL_MODE,op,NULL)
329#define SSL_get_mode(ssl) \
330 SSL_ctrl(ssl,SSL_CTRL_MODE,0,NULL)
290 331
291#define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT (1024*20) 332#define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT (1024*20)
292 333
293typedef struct ssl_ctx_st 334typedef struct ssl_comp_st
335{
336 int id;
337 char *name;
338#ifdef HEADER_COMP_H
339 COMP_METHOD *method;
340#else
341 char *method;
342#endif
343} SSL_COMP;
344
345DECLARE_STACK_OF(SSL_COMP)
346
347struct ssl_ctx_st
294 { 348 {
295 SSL_METHOD *method; 349 SSL_METHOD *method;
296 unsigned long options; 350 unsigned long options;
351 unsigned long mode;
297 352
298 STACK /* SSL_CIPHER */ *cipher_list; 353 STACK_OF(SSL_CIPHER) *cipher_list;
299 /* same as above but sorted for lookup */ 354 /* same as above but sorted for lookup */
300 STACK /* SSL_CIPHER */ *cipher_list_by_id; 355 STACK_OF(SSL_CIPHER) *cipher_list_by_id;
301 356
302 struct x509_store_st /* X509_STORE */ *cert_store; 357 struct x509_store_st /* X509_STORE */ *cert_store;
303 struct lhash_st /* LHASH */ *sessions; /* a set of SSL_SESSION's */ 358 struct lhash_st /* LHASH */ *sessions; /* a set of SSL_SESSION's */
@@ -328,64 +383,70 @@ typedef struct ssl_ctx_st
328 * a session-id is removed from the cache. Again, a return 383 * a session-id is removed from the cache. Again, a return
329 * of 0 mens that SSLeay should not SSL_SESSION_free() since 384 * of 0 mens that SSLeay should not SSL_SESSION_free() since
330 * the application is doing something with it. */ 385 * the application is doing something with it. */
331#ifndef NOPROTO
332 int (*new_session_cb)(struct ssl_st *ssl,SSL_SESSION *sess); 386 int (*new_session_cb)(struct ssl_st *ssl,SSL_SESSION *sess);
333 void (*remove_session_cb)(struct ssl_ctx_st *ctx,SSL_SESSION *sess); 387 void (*remove_session_cb)(struct ssl_ctx_st *ctx,SSL_SESSION *sess);
334 SSL_SESSION *(*get_session_cb)(struct ssl_st *ssl, 388 SSL_SESSION *(*get_session_cb)(struct ssl_st *ssl,
335 unsigned char *data,int len,int *copy); 389 unsigned char *data,int len,int *copy);
336#else 390 struct
337 int (*new_session_cb)(); 391 {
338 void (*remove_session_cb)(); 392 int sess_connect; /* SSL new conn - started */
339 SSL_SESSION *(*get_session_cb)(); 393 int sess_connect_renegotiate;/* SSL reneg - requested */
340#endif 394 int sess_connect_good; /* SSL new conne/reneg - finished */
341 395 int sess_accept; /* SSL new accept - started */
342 int sess_connect; /* SSL new connection - started */ 396 int sess_accept_renegotiate;/* SSL reneg - requested */
343 int sess_connect_renegotiate;/* SSL renegotiatene - requested */ 397 int sess_accept_good; /* SSL accept/reneg - finished */
344 int sess_connect_good; /* SSL new connection/renegotiate - finished */ 398 int sess_miss; /* session lookup misses */
345 int sess_accept; /* SSL new accept - started */ 399 int sess_timeout; /* reuse attempt on timeouted session */
346 int sess_accept_renegotiate;/* SSL renegotiatene - requested */ 400 int sess_cache_full; /* session removed due to full cache */
347 int sess_accept_good; /* SSL accept/renegotiate - finished */ 401 int sess_hit; /* session reuse actually done */
348 int sess_miss; /* session lookup misses */ 402 int sess_cb_hit; /* session-id that was not
349 int sess_timeout; /* session reuse attempt on timeouted session */ 403 * in the cache was
350 int sess_cache_full; /* session removed due to full cache */ 404 * passed back via the callback. This
351 int sess_hit; /* session reuse actually done */ 405 * indicates that the application is
352 int sess_cb_hit; /* session-id that was not in the cache was 406 * supplying session-id's from other
353 * passed back via the callback. This 407 * processes - spooky :-) */
354 * indicates that the application is supplying 408 } stats;
355 * session-id's from other processes -
356 * spooky :-) */
357 409
358 int references; 410 int references;
359 411
360 void (*info_callback)(); 412/**/ void (*info_callback)();
361 413
362 /* if defined, these override the X509_verify_cert() calls */ 414 /* if defined, these override the X509_verify_cert() calls */
363 int (*app_verify_callback)(); 415/**/ int (*app_verify_callback)();
364 char *app_verify_arg; 416/**/ char *app_verify_arg; /* never used; should be void * */
365 417
366 /* default values to use in SSL structures */ 418 /* default values to use in SSL structures */
367 struct cert_st /* CERT */ *default_cert; 419/**/ struct cert_st /* CERT */ *cert;
368 int default_read_ahead; 420/**/ int read_ahead;
369 int default_verify_mode; 421/**/ int verify_mode;
370 int (*default_verify_callback)(); 422/**/ int verify_depth;
423/**/ unsigned int sid_ctx_length;
424/**/ unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
425/**/ int (*default_verify_callback)(int ok,X509_STORE_CTX *ctx);
371 426
372 /* Default password callback. */ 427 /* Default password callback. */
373 int (*default_passwd_callback)(); 428/**/ pem_password_cb *default_passwd_callback;
429
430 /* Default password callback user data. */
431/**/ void *default_passwd_callback_userdata;
374 432
375 /* get client cert callback */ 433 /* get client cert callback */
376 int (*client_cert_cb)(/* SSL *ssl, X509 **x509, EVP_PKEY **pkey */); 434/**/ int (*client_cert_cb)(/* SSL *ssl, X509 **x509, EVP_PKEY **pkey */);
377 435
378 /* what we put in client requests */ 436 /* what we put in client requests */
379 STACK *client_CA; 437 STACK_OF(X509_NAME) *client_CA;
380 438
381 int quiet_shutdown; 439/**/ int quiet_shutdown;
382 440
383 CRYPTO_EX_DATA ex_data; 441 CRYPTO_EX_DATA ex_data;
384 442
385 EVP_MD *rsa_md5;/* For SSLv2 - name is 'ssl2-md5' */ 443 const EVP_MD *rsa_md5;/* For SSLv2 - name is 'ssl2-md5' */
386 EVP_MD *md5; /* For SSLv3/TLSv1 'ssl3-md5' */ 444 const EVP_MD *md5; /* For SSLv3/TLSv1 'ssl3-md5' */
387 EVP_MD *sha1; /* For SSLv3/TLSv1 'ssl3->sha1' */ 445 const EVP_MD *sha1; /* For SSLv3/TLSv1 'ssl3->sha1' */
388 } SSL_CTX; 446
447 STACK_OF(X509) *extra_certs;
448 STACK_OF(SSL_COMP) *comp_methods; /* stack of SSL_COMP, SSLv3/TLSv1 */
449 };
389 450
390#define SSL_SESS_CACHE_OFF 0x0000 451#define SSL_SESS_CACHE_OFF 0x0000
391#define SSL_SESS_CACHE_CLIENT 0x0001 452#define SSL_SESS_CACHE_CLIENT 0x0001
@@ -397,23 +458,30 @@ typedef struct ssl_ctx_st
397 * defined, this will still get called. */ 458 * defined, this will still get called. */
398#define SSL_SESS_CACHE_NO_INTERNAL_LOOKUP 0x0100 459#define SSL_SESS_CACHE_NO_INTERNAL_LOOKUP 0x0100
399 460
400#define SSL_CTX_sessions(ctx) ((ctx)->sessions) 461#define SSL_CTX_sess_number(ctx) \
401/* You will need to include lhash.h to access the following #define */ 462 SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_NUMBER,0,NULL)
402#define SSL_CTX_sess_number(ctx) ((ctx)->sessions->num_items) 463#define SSL_CTX_sess_connect(ctx) \
403#define SSL_CTX_sess_connect(ctx) ((ctx)->sess_connect) 464 SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT,0,NULL)
404#define SSL_CTX_sess_connect_good(ctx) ((ctx)->sess_connect_good) 465#define SSL_CTX_sess_connect_good(ctx) \
405#define SSL_CTX_sess_accept(ctx) ((ctx)->sess_accept) 466 SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_GOOD,0,NULL)
406#define SSL_CTX_sess_accept_renegotiate(ctx) ((ctx)->sess_accept_renegotiate) 467#define SSL_CTX_sess_connect_renegotiate(ctx) \
407#define SSL_CTX_sess_connect_renegotiate(ctx) ((ctx)->sess_connect_renegotiate) 468 SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_RENEGOTIATE,0,NULL)
408#define SSL_CTX_sess_accept_good(ctx) ((ctx)->sess_accept_good) 469#define SSL_CTX_sess_accept(ctx) \
409#define SSL_CTX_sess_hits(ctx) ((ctx)->sess_hit) 470 SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT,0,NULL)
410#define SSL_CTX_sess_cb_hits(ctx) ((ctx)->sess_cb_hit) 471#define SSL_CTX_sess_accept_renegotiate(ctx) \
411#define SSL_CTX_sess_misses(ctx) ((ctx)->sess_miss) 472 SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_RENEGOTIATE,0,NULL)
412#define SSL_CTX_sess_timeouts(ctx) ((ctx)->sess_timeout) 473#define SSL_CTX_sess_accept_good(ctx) \
413#define SSL_CTX_sess_cache_full(ctx) ((ctx)->sess_cache_full) 474 SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_GOOD,0,NULL)
414 475#define SSL_CTX_sess_hits(ctx) \
415#define SSL_CTX_sess_set_cache_size(ctx,t) ((ctx)->session_cache_size=(t)) 476 SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_HIT,0,NULL)
416#define SSL_CTX_sess_get_cache_size(ctx) ((ctx)->session_cache_size) 477#define SSL_CTX_sess_cb_hits(ctx) \
478 SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CB_HIT,0,NULL)
479#define SSL_CTX_sess_misses(ctx) \
480 SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_MISSES,0,NULL)
481#define SSL_CTX_sess_timeouts(ctx) \
482 SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_TIMEOUTS,0,NULL)
483#define SSL_CTX_sess_cache_full(ctx) \
484 SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CACHE_FULL,0,NULL)
417 485
418#define SSL_CTX_sess_set_new_cb(ctx,cb) ((ctx)->new_session_cb=(cb)) 486#define SSL_CTX_sess_set_new_cb(ctx,cb) ((ctx)->new_session_cb=(cb))
419#define SSL_CTX_sess_get_new_cb(ctx) ((ctx)->new_session_cb) 487#define SSL_CTX_sess_get_new_cb(ctx) ((ctx)->new_session_cb)
@@ -421,15 +489,8 @@ typedef struct ssl_ctx_st
421#define SSL_CTX_sess_get_remove_cb(ctx) ((ctx)->remove_session_cb) 489#define SSL_CTX_sess_get_remove_cb(ctx) ((ctx)->remove_session_cb)
422#define SSL_CTX_sess_set_get_cb(ctx,cb) ((ctx)->get_session_cb=(cb)) 490#define SSL_CTX_sess_set_get_cb(ctx,cb) ((ctx)->get_session_cb=(cb))
423#define SSL_CTX_sess_get_get_cb(ctx) ((ctx)->get_session_cb) 491#define SSL_CTX_sess_get_get_cb(ctx) ((ctx)->get_session_cb)
424#define SSL_CTX_set_session_cache_mode(ctx,m) ((ctx)->session_cache_mode=(m))
425#define SSL_CTX_get_session_cache_mode(ctx) ((ctx)->session_cache_mode)
426#define SSL_CTX_set_timeout(ctx,t) ((ctx)->session_timeout=(t))
427#define SSL_CTX_get_timeout(ctx) ((ctx)->session_timeout)
428
429#define SSL_CTX_set_info_callback(ctx,cb) ((ctx)->info_callback=(cb)) 492#define SSL_CTX_set_info_callback(ctx,cb) ((ctx)->info_callback=(cb))
430#define SSL_CTX_get_info_callback(ctx) ((ctx)->info_callback) 493#define SSL_CTX_get_info_callback(ctx) ((ctx)->info_callback)
431#define SSL_CTX_set_default_read_ahead(ctx,m) (((ctx)->default_read_ahead)=(m))
432
433#define SSL_CTX_set_client_cert_cb(ctx,cb) ((ctx)->client_cert_cb=(cb)) 494#define SSL_CTX_set_client_cert_cb(ctx,cb) ((ctx)->client_cert_cb=(cb))
434#define SSL_CTX_get_client_cert_cb(ctx) ((ctx)->client_cert_cb) 495#define SSL_CTX_get_client_cert_cb(ctx) ((ctx)->client_cert_cb)
435 496
@@ -439,18 +500,16 @@ typedef struct ssl_ctx_st
439#define SSL_X509_LOOKUP 4 500#define SSL_X509_LOOKUP 4
440 501
441/* These will only be used when doing non-blocking IO */ 502/* These will only be used when doing non-blocking IO */
442#define SSL_want(s) ((s)->rwstate) 503#define SSL_want_nothing(s) (SSL_want(s) == SSL_NOTHING)
443#define SSL_want_nothing(s) ((s)->rwstate == SSL_NOTHING) 504#define SSL_want_read(s) (SSL_want(s) == SSL_READING)
444#define SSL_want_read(s) ((s)->rwstate == SSL_READING) 505#define SSL_want_write(s) (SSL_want(s) == SSL_WRITING)
445#define SSL_want_write(s) ((s)->rwstate == SSL_WRITING) 506#define SSL_want_x509_lookup(s) (SSL_want(s) == SSL_X509_LOOKUP)
446#define SSL_want_x509_lookup(s) ((s)->rwstate == SSL_X509_LOOKUP)
447 507
448typedef struct ssl_st 508struct ssl_st
449 { 509 {
450 /* procol version 510 /* protocol version
451 * 2 for SSLv2 511 * (one of SSL2_VERSION, SSL3_VERSION, TLS1_VERSION)
452 * 3 for SSLv3 512 */
453 * -3 for SSLv3 but accept SSLv2 */
454 int version; 513 int version;
455 int type; /* SSL_ST_CONNECT or SSL_ST_ACCEPT */ 514 int type; /* SSL_ST_CONNECT or SSL_ST_ACCEPT */
456 515
@@ -480,7 +539,15 @@ typedef struct ssl_st
480 int in_handshake; 539 int in_handshake;
481 int (*handshake_func)(); 540 int (*handshake_func)();
482 541
483/* int server;*/ /* are we the server side? */ 542 /* Imagine that here's a boolean member "init" that is
543 * switched as soon as SSL_set_{accept/connect}_state
544 * is called for the first time, so that "state" and
545 * "handshake_func" are properly initialized. But as
546 * handshake_func is == 0 until then, we use this
547 * test instead of an "init" member.
548 */
549
550 int server; /* are we the server side? - mostly used by SSL_clear*/
484 551
485 int new_session;/* 1 if we are to use a new session */ 552 int new_session;/* 1 if we are to use a new session */
486 int quiet_shutdown;/* don't send shutdown packets */ 553 int quiet_shutdown;/* don't send shutdown packets */
@@ -504,19 +571,27 @@ typedef struct ssl_st
504 int hit; /* reusing a previous session */ 571 int hit; /* reusing a previous session */
505 572
506 /* crypto */ 573 /* crypto */
507 STACK /* SSL_CIPHER */ *cipher_list; 574 STACK_OF(SSL_CIPHER) *cipher_list;
508 STACK /* SSL_CIPHER */ *cipher_list_by_id; 575 STACK_OF(SSL_CIPHER) *cipher_list_by_id;
509 576
510 /* These are the ones being used, the ones is SSL_SESSION are 577 /* These are the ones being used, the ones is SSL_SESSION are
511 * the ones to be 'copied' into these ones */ 578 * the ones to be 'copied' into these ones */
512 579
513 EVP_CIPHER_CTX *enc_read_ctx; /* cryptographic state */ 580 EVP_CIPHER_CTX *enc_read_ctx; /* cryptographic state */
514 EVP_MD *read_hash; /* used for mac generation */ 581 const EVP_MD *read_hash; /* used for mac generation */
515 SSL_COMPRESSION *read_compression; /* compression */ 582#ifdef HEADER_COMP_H
583 COMP_CTX *expand; /* uncompress */
584#else
585 char *expand;
586#endif
516 587
517 EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */ 588 EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */
518 EVP_MD *write_hash; /* used for mac generation */ 589 const EVP_MD *write_hash; /* used for mac generation */
519 SSL_COMPRESSION *write_compression; /* compression */ 590#ifdef HEADER_COMP_H
591 COMP_CTX *compress; /* compression */
592#else
593 char *compress;
594#endif
520 595
521 /* session info */ 596 /* session info */
522 597
@@ -524,13 +599,19 @@ typedef struct ssl_st
524 /* This is used to hold the server certificate used */ 599 /* This is used to hold the server certificate used */
525 struct cert_st /* CERT */ *cert; 600 struct cert_st /* CERT */ *cert;
526 601
602 /* the session_id_context is used to ensure sessions are only reused
603 * in the appropriate context */
604 unsigned int sid_ctx_length;
605 unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
606
527 /* This can also be in the session once a session is established */ 607 /* This can also be in the session once a session is established */
528 SSL_SESSION *session; 608 SSL_SESSION *session;
529 609
530 /* Used in SSL2 and SSL3 */ 610 /* Used in SSL2 and SSL3 */
531 int verify_mode; /* 0 don't care about verify failure. 611 int verify_mode; /* 0 don't care about verify failure.
532 * 1 fail if verify fails */ 612 * 1 fail if verify fails */
533 int (*verify_callback)(); /* fail if callback returns 0 */ 613 int verify_depth;
614 int (*verify_callback)(int ok,X509_STORE_CTX *ctx); /* fail if callback returns 0 */
534 void (*info_callback)(); /* optional informational callback */ 615 void (*info_callback)(); /* optional informational callback */
535 616
536 int error; /* error bytes to be written */ 617 int error; /* error bytes to be written */
@@ -546,17 +627,20 @@ typedef struct ssl_st
546 CRYPTO_EX_DATA ex_data; 627 CRYPTO_EX_DATA ex_data;
547 628
548 /* for server side, keep the list of CA_dn we can use */ 629 /* for server side, keep the list of CA_dn we can use */
549 STACK /* X509_NAME */ *client_CA; 630 STACK_OF(X509_NAME) *client_CA;
550 631
551 int references; 632 int references;
552 unsigned long options; 633 unsigned long options; /* protocol behaviour */
634 unsigned long mode; /* API behaviour */
553 int first_packet; 635 int first_packet;
554 } SSL; 636 int client_version; /* what was passed, used for
637 * SSLv3/TLS rolback check */
638 };
555 639
556#include "ssl2.h" 640#include <openssl/ssl2.h>
557#include "ssl3.h" 641#include <openssl/ssl3.h>
558#include "tls1.h" /* This is mostly sslv3 with a few tweaks */ 642#include <openssl/tls1.h> /* This is mostly sslv3 with a few tweaks */
559#include "ssl23.h" 643#include <openssl/ssl23.h>
560 644
561/* compatablity */ 645/* compatablity */
562#define SSL_set_app_data(s,arg) (SSL_set_ex_data(s,0,(char *)arg)) 646#define SSL_set_app_data(s,arg) (SSL_set_ex_data(s,0,(char *)arg))
@@ -616,6 +700,8 @@ typedef struct ssl_st
616#define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02 700#define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02
617#define SSL_VERIFY_CLIENT_ONCE 0x04 701#define SSL_VERIFY_CLIENT_ONCE 0x04
618 702
703#define SSLeay_add_ssl_algorithms() SSL_library_init()
704
619/* this is for backward compatablility */ 705/* this is for backward compatablility */
620#if 0 /* NEW_SSLEAY */ 706#if 0 /* NEW_SSLEAY */
621#define SSL_CTX_set_default_verify(a,b,c) SSL_CTX_set_verify(a,b,c) 707#define SSL_CTX_set_default_verify(a,b,c) SSL_CTX_set_verify(a,b,c)
@@ -638,28 +724,25 @@ typedef struct ssl_st
638#define SSL_get_timeout(a) SSL_SESSION_get_timeout(a) 724#define SSL_get_timeout(a) SSL_SESSION_get_timeout(a)
639#define SSL_set_timeout(a,b) SSL_SESSION_set_timeout((a),(b)) 725#define SSL_set_timeout(a,b) SSL_SESSION_set_timeout((a),(b))
640 726
641/* VMS linker has a 31 char name limit */
642#define SSL_CTX_set_cert_verify_callback(a,b,c) \
643 SSL_CTX_set_cert_verify_cb((a),(b),(c))
644
645#if 1 /*SSLEAY_MACROS*/ 727#if 1 /*SSLEAY_MACROS*/
646#define d2i_SSL_SESSION_bio(bp,s_id) (SSL_SESSION *)ASN1_d2i_bio( \ 728#define d2i_SSL_SESSION_bio(bp,s_id) (SSL_SESSION *)ASN1_d2i_bio( \
647 (char *(*)())SSL_SESSION_new,(char *(*)())d2i_SSL_SESSION, \ 729 (char *(*)())SSL_SESSION_new,(char *(*)())d2i_SSL_SESSION, \
648 (bp),(unsigned char **)(s_id)) 730 (bp),(unsigned char **)(s_id))
649#define i2d_SSL_SESSION_bio(bp,s_id) ASN1_i2d_bio(i2d_SSL_SESSION, \ 731#define i2d_SSL_SESSION_bio(bp,s_id) ASN1_i2d_bio(i2d_SSL_SESSION, \
650 bp,(unsigned char *)s_id) 732 bp,(unsigned char *)s_id)
651#define PEM_read_SSL_SESSION(fp,x,cb) (SSL_SESSION *)PEM_ASN1_read( \ 733#define PEM_read_SSL_SESSION(fp,x,cb,u) (SSL_SESSION *)PEM_ASN1_read( \
652 (char *(*)())d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,fp,(char **)x,cb) 734 (char *(*)())d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,fp,(char **)x,cb,u)
653#define PEM_read_bio_SSL_SESSION(bp,x,cb) (SSL_SESSION *)PEM_ASN1_read_bio( \ 735#define PEM_read_bio_SSL_SESSION(bp,x,cb,u) (SSL_SESSION *)PEM_ASN1_read_bio( \
654 (char *(*)())d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,bp,(char **)x,cb) 736 (char *(*)())d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,bp,(char **)x,cb,u)
655#define PEM_write_SSL_SESSION(fp,x) \ 737#define PEM_write_SSL_SESSION(fp,x) \
656 PEM_ASN1_write((int (*)())i2d_SSL_SESSION, \ 738 PEM_ASN1_write((int (*)())i2d_SSL_SESSION, \
657 PEM_STRING_SSL_SESSION,fp, (char *)x, NULL,NULL,0,NULL) 739 PEM_STRING_SSL_SESSION,fp, (char *)x, NULL,NULL,0,NULL,NULL)
658#define PEM_write_bio_SSL_SESSION(bp,x) \ 740#define PEM_write_bio_SSL_SESSION(bp,x) \
659 PEM_ASN1_write_bio((int (*)())i2d_SSL_SESSION, \ 741 PEM_ASN1_write_bio((int (*)())i2d_SSL_SESSION, \
660 PEM_STRING_SSL_SESSION,bp, (char *)x, NULL,NULL,0,NULL) 742 PEM_STRING_SSL_SESSION,bp, (char *)x, NULL,NULL,0,NULL,NULL)
661#endif 743#endif
662 744
745#define SSL_AD_REASON_OFFSET 1000
663/* These alert types are for SSLv3 and TLSv1 */ 746/* These alert types are for SSLv3 and TLSv1 */
664#define SSL_AD_CLOSE_NOTIFY SSL3_AD_CLOSE_NOTIFY 747#define SSL_AD_CLOSE_NOTIFY SSL3_AD_CLOSE_NOTIFY
665#define SSL_AD_UNEXPECTED_MESSAGE SSL3_AD_UNEXPECTED_MESSAGE /* fatal */ 748#define SSL_AD_UNEXPECTED_MESSAGE SSL3_AD_UNEXPECTED_MESSAGE /* fatal */
@@ -691,7 +774,7 @@ typedef struct ssl_st
691#define SSL_ERROR_WANT_READ 2 774#define SSL_ERROR_WANT_READ 2
692#define SSL_ERROR_WANT_WRITE 3 775#define SSL_ERROR_WANT_WRITE 3
693#define SSL_ERROR_WANT_X509_LOOKUP 4 776#define SSL_ERROR_WANT_X509_LOOKUP 4
694#define SSL_ERROR_SYSCALL 5 /* look at errno */ 777#define SSL_ERROR_SYSCALL 5 /* look at error stack/return value/errno */
695#define SSL_ERROR_ZERO_RETURN 6 778#define SSL_ERROR_ZERO_RETURN 6
696#define SSL_ERROR_WANT_CONNECT 7 779#define SSL_ERROR_WANT_CONNECT 7
697 780
@@ -706,6 +789,31 @@ typedef struct ssl_st
706#define SSL_CTRL_GET_NUM_RENEGOTIATIONS 8 789#define SSL_CTRL_GET_NUM_RENEGOTIATIONS 8
707#define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 9 790#define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 9
708#define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 10 791#define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 10
792#define SSL_CTRL_GET_FLAGS 11
793#define SSL_CTRL_EXTRA_CHAIN_CERT 12
794
795/* Stats */
796#define SSL_CTRL_SESS_NUMBER 20
797#define SSL_CTRL_SESS_CONNECT 21
798#define SSL_CTRL_SESS_CONNECT_GOOD 22
799#define SSL_CTRL_SESS_CONNECT_RENEGOTIATE 23
800#define SSL_CTRL_SESS_ACCEPT 24
801#define SSL_CTRL_SESS_ACCEPT_GOOD 25
802#define SSL_CTRL_SESS_ACCEPT_RENEGOTIATE 26
803#define SSL_CTRL_SESS_HIT 27
804#define SSL_CTRL_SESS_CB_HIT 28
805#define SSL_CTRL_SESS_MISSES 29
806#define SSL_CTRL_SESS_TIMEOUTS 30
807#define SSL_CTRL_SESS_CACHE_FULL 31
808#define SSL_CTRL_OPTIONS 32
809#define SSL_CTRL_MODE 33
810
811#define SSL_CTRL_GET_READ_AHEAD 40
812#define SSL_CTRL_SET_READ_AHEAD 41
813#define SSL_CTRL_SET_SESS_CACHE_SIZE 42
814#define SSL_CTRL_GET_SESS_CACHE_SIZE 43
815#define SSL_CTRL_SET_SESS_CACHE_MODE 44
816#define SSL_CTRL_GET_SESS_CACHE_MODE 45
709 817
710#define SSL_session_reused(ssl) \ 818#define SSL_session_reused(ssl) \
711 SSL_ctrl((ssl),SSL_CTRL_GET_SESSION_REUSED,0,NULL) 819 SSL_ctrl((ssl),SSL_CTRL_GET_SESSION_REUSED,0,NULL)
@@ -723,16 +831,31 @@ typedef struct ssl_st
723#define SSL_CTX_set_tmp_dh(ctx,dh) \ 831#define SSL_CTX_set_tmp_dh(ctx,dh) \
724 SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_DH,0,(char *)dh) 832 SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_DH,0,(char *)dh)
725 833
726/* For the next 2, the callbacks are 834#define SSL_need_tmp_RSA(ssl) \
727 * RSA *tmp_rsa_cb(int export) 835 SSL_ctrl(ssl,SSL_CTRL_NEED_TMP_RSA,0,NULL)
728 * DH *tmp_dh_cb(int export) 836#define SSL_set_tmp_rsa(ssl,rsa) \
729 */ 837 SSL_ctrl(ssl,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa)
730#define SSL_CTX_set_tmp_rsa_callback(ctx,cb) \ 838#define SSL_set_tmp_dh(ssl,dh) \
731 SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_RSA_CB,0,(char *)cb) 839 SSL_ctrl(ssl,SSL_CTRL_SET_TMP_DH,0,(char *)dh)
732#define SSL_CTX_set_tmp_dh_callback(ctx,dh) \ 840
733 SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_DH_CB,0,(char *)dh) 841#define SSL_CTX_add_extra_chain_cert(ctx,x509) \
734 842 SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509)
735#ifndef NOPROTO 843
844/* VMS uses only 31 characters for symbols. */
845#ifdef VMS
846#undef SSL_CTX_set_cert_verify_callback
847#define SSL_CTX_set_cert_verify_callback SSL_CTX_set_cert_verify_cb
848#undef SSL_CTX_use_certificate_chain_file
849#define SSL_CTX_use_certificate_chain_file SSL_CTX_use_cert_chain_file
850#undef SSL_CTX_set_default_verify_paths
851#define SSL_CTX_set_default_verify_paths SSL_CTX_set_def_verify_paths
852#undef SSL_get_ex_data_X509_STORE_CTX_idx
853#define SSL_get_ex_data_X509_STORE_CTX_idx SSL_get_ex_data_X509_STOR_CTX_i
854#undef SSL_add_file_cert_subjects_to_stack
855#define SSL_add_file_cert_subjects_to_stack SSL_add_file_cert_sub_to_stack
856#undef SSL_add_dir_cert_subjects_to_stack
857#define SSL_add_dir_cert_subjects_to_stack SSL_add_dir_cert_sub_to_stack
858#endif
736 859
737#ifdef HEADER_BIO_H 860#ifdef HEADER_BIO_H
738BIO_METHOD *BIO_f_ssl(void); 861BIO_METHOD *BIO_f_ssl(void);
@@ -747,16 +870,22 @@ void BIO_ssl_shutdown(BIO *ssl_bio);
747int SSL_CTX_set_cipher_list(SSL_CTX *,char *str); 870int SSL_CTX_set_cipher_list(SSL_CTX *,char *str);
748SSL_CTX *SSL_CTX_new(SSL_METHOD *meth); 871SSL_CTX *SSL_CTX_new(SSL_METHOD *meth);
749void SSL_CTX_free(SSL_CTX *); 872void SSL_CTX_free(SSL_CTX *);
750void SSL_clear(SSL *s); 873long SSL_CTX_set_timeout(SSL_CTX *ctx,long t);
874long SSL_CTX_get_timeout(SSL_CTX *ctx);
875X509_STORE *SSL_CTX_get_cert_store(SSL_CTX *);
876void SSL_CTX_set_cert_store(SSL_CTX *,X509_STORE *);
877int SSL_want(SSL *s);
878int SSL_clear(SSL *s);
879
751void SSL_CTX_flush_sessions(SSL_CTX *ctx,long tm); 880void SSL_CTX_flush_sessions(SSL_CTX *ctx,long tm);
752 881
753SSL_CIPHER *SSL_get_current_cipher(SSL *s); 882SSL_CIPHER *SSL_get_current_cipher(SSL *s);
754int SSL_CIPHER_get_bits(SSL_CIPHER *c,int *alg_bits); 883int SSL_CIPHER_get_bits(SSL_CIPHER *c,int *alg_bits);
755char * SSL_CIPHER_get_version(SSL_CIPHER *c); 884char * SSL_CIPHER_get_version(SSL_CIPHER *c);
756char * SSL_CIPHER_get_name(SSL_CIPHER *c); 885const char * SSL_CIPHER_get_name(SSL_CIPHER *c);
757 886
758int SSL_get_fd(SSL *s); 887int SSL_get_fd(SSL *s);
759char * SSL_get_cipher_list(SSL *s,int n); 888const char * SSL_get_cipher_list(SSL *s,int n);
760char * SSL_get_shared_ciphers(SSL *s, char *buf, int len); 889char * SSL_get_shared_ciphers(SSL *s, char *buf, int len);
761int SSL_get_read_ahead(SSL * s); 890int SSL_get_read_ahead(SSL * s);
762int SSL_pending(SSL *s); 891int SSL_pending(SSL *s);
@@ -773,23 +902,33 @@ BIO * SSL_get_wbio(SSL *s);
773int SSL_set_cipher_list(SSL *s, char *str); 902int SSL_set_cipher_list(SSL *s, char *str);
774void SSL_set_read_ahead(SSL *s, int yes); 903void SSL_set_read_ahead(SSL *s, int yes);
775int SSL_get_verify_mode(SSL *s); 904int SSL_get_verify_mode(SSL *s);
776int (*SSL_get_verify_callback(SSL *s))(); 905int SSL_get_verify_depth(SSL *s);
777void SSL_set_verify(SSL *s, int mode, int (*callback) ()); 906int (*SSL_get_verify_callback(SSL *s))(int,X509_STORE_CTX *);
907void SSL_set_verify(SSL *s, int mode,
908 int (*callback)(int ok,X509_STORE_CTX *ctx));
909void SSL_set_verify_depth(SSL *s, int depth);
910#ifndef NO_RSA
778int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa); 911int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa);
912#endif
779int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, unsigned char *d, long len); 913int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, unsigned char *d, long len);
780int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey); 914int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey);
781int SSL_use_PrivateKey_ASN1(int pk,SSL *ssl, unsigned char *d, long len); 915int SSL_use_PrivateKey_ASN1(int pk,SSL *ssl, unsigned char *d, long len);
782int SSL_use_certificate(SSL *ssl, X509 *x); 916int SSL_use_certificate(SSL *ssl, X509 *x);
783int SSL_use_certificate_ASN1(SSL *ssl, int len, unsigned char *d); 917int SSL_use_certificate_ASN1(SSL *ssl, unsigned char *d, int len);
784 918
785#ifndef NO_STDIO 919#ifndef NO_STDIO
786int SSL_use_RSAPrivateKey_file(SSL *ssl, char *file, int type); 920int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type);
787int SSL_use_PrivateKey_file(SSL *ssl, char *file, int type); 921int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type);
788int SSL_use_certificate_file(SSL *ssl, char *file, int type); 922int SSL_use_certificate_file(SSL *ssl, const char *file, int type);
789int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, char *file, int type); 923int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, const char *file, int type);
790int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, char *file, int type); 924int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type);
791int SSL_CTX_use_certificate_file(SSL_CTX *ctx, char *file, int type); 925int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type);
792STACK * SSL_load_client_CA_file(char *file); 926int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file); /* PEM type */
927STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file);
928int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs,
929 const char *file);
930int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs,
931 const char *dir);
793#endif 932#endif
794 933
795void ERR_load_SSL_strings(void ); 934void ERR_load_SSL_strings(void );
@@ -824,13 +963,22 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a,unsigned char **pp,long length);
824X509 * SSL_get_peer_certificate(SSL *s); 963X509 * SSL_get_peer_certificate(SSL *s);
825#endif 964#endif
826 965
827STACK * SSL_get_peer_cert_chain(SSL *s); 966STACK_OF(X509) *SSL_get_peer_cert_chain(SSL *s);
967
968#ifdef VMS
969#define SSL_CTX_set_default_passwd_cb_userdata SSL_CTX_set_def_passwd_cb_ud
970#endif
828 971
829int SSL_CTX_get_verify_mode(SSL_CTX *ctx); 972int SSL_CTX_get_verify_mode(SSL_CTX *ctx);
830int (*SSL_CTX_get_verify_callback(SSL_CTX *ctx))(); 973int SSL_CTX_get_verify_depth(SSL_CTX *ctx);
831void SSL_CTX_set_verify(SSL_CTX *ctx,int mode,int (*callback)()); 974int (*SSL_CTX_get_verify_callback(SSL_CTX *ctx))(int,X509_STORE_CTX *);
832void SSL_CTX_set_cert_verify_cb(SSL_CTX *ctx, int (*cb)(),char *arg); 975void SSL_CTX_set_verify(SSL_CTX *ctx,int mode,
976 int (*callback)(int, X509_STORE_CTX *));
977void SSL_CTX_set_verify_depth(SSL_CTX *ctx,int depth);
978void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, int (*cb)(),char *arg);
979#ifndef NO_RSA
833int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa); 980int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa);
981#endif
834int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, unsigned char *d, long len); 982int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, unsigned char *d, long len);
835int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey); 983int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey);
836int SSL_CTX_use_PrivateKey_ASN1(int pk,SSL_CTX *ctx, 984int SSL_CTX_use_PrivateKey_ASN1(int pk,SSL_CTX *ctx,
@@ -838,19 +986,24 @@ int SSL_CTX_use_PrivateKey_ASN1(int pk,SSL_CTX *ctx,
838int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x); 986int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x);
839int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len, unsigned char *d); 987int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len, unsigned char *d);
840 988
841void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx,int (*cb)()); 989void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb);
990void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, void *u);
842 991
843int SSL_CTX_check_private_key(SSL_CTX *ctx); 992int SSL_CTX_check_private_key(SSL_CTX *ctx);
844int SSL_check_private_key(SSL *ctx); 993int SSL_check_private_key(SSL *ctx);
845 994
995int SSL_CTX_set_session_id_context(SSL_CTX *ctx,const unsigned char *sid_ctx,
996 unsigned int sid_ctx_len);
997
846SSL * SSL_new(SSL_CTX *ctx); 998SSL * SSL_new(SSL_CTX *ctx);
847void SSL_clear(SSL *s); 999int SSL_set_session_id_context(SSL *ssl,const unsigned char *sid_ctx,
1000 unsigned int sid_ctx_len);
848void SSL_free(SSL *ssl); 1001void SSL_free(SSL *ssl);
849int SSL_accept(SSL *ssl); 1002int SSL_accept(SSL *ssl);
850int SSL_connect(SSL *ssl); 1003int SSL_connect(SSL *ssl);
851int SSL_read(SSL *ssl,char *buf,int num); 1004int SSL_read(SSL *ssl,char *buf,int num);
852int SSL_peek(SSL *ssl,char *buf,int num); 1005int SSL_peek(SSL *ssl,char *buf,int num);
853int SSL_write(SSL *ssl,char *buf,int num); 1006int SSL_write(SSL *ssl,const char *buf,int num);
854long SSL_ctrl(SSL *ssl,int cmd, long larg, char *parg); 1007long SSL_ctrl(SSL *ssl,int cmd, long larg, char *parg);
855long SSL_CTX_ctrl(SSL_CTX *ctx,int cmd, long larg, char *parg); 1008long SSL_CTX_ctrl(SSL_CTX *ctx,int cmd, long larg, char *parg);
856 1009
@@ -876,7 +1029,7 @@ SSL_METHOD *TLSv1_method(void); /* TLSv1.0 */
876SSL_METHOD *TLSv1_server_method(void); /* TLSv1.0 */ 1029SSL_METHOD *TLSv1_server_method(void); /* TLSv1.0 */
877SSL_METHOD *TLSv1_client_method(void); /* TLSv1.0 */ 1030SSL_METHOD *TLSv1_client_method(void); /* TLSv1.0 */
878 1031
879STACK *SSL_get_ciphers(SSL *s); 1032STACK_OF(SSL_CIPHER) *SSL_get_ciphers(SSL *s);
880 1033
881int SSL_do_handshake(SSL *s); 1034int SSL_do_handshake(SSL *s);
882int SSL_renegotiate(SSL *s); 1035int SSL_renegotiate(SSL *s);
@@ -889,10 +1042,10 @@ char *SSL_alert_type_string(int value);
889char *SSL_alert_desc_string_long(int value); 1042char *SSL_alert_desc_string_long(int value);
890char *SSL_alert_desc_string(int value); 1043char *SSL_alert_desc_string(int value);
891 1044
892void SSL_set_client_CA_list(SSL *s, STACK *list); 1045void SSL_set_client_CA_list(SSL *s, STACK_OF(X509_NAME) *list);
893void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK *list); 1046void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *list);
894STACK *SSL_get_client_CA_list(SSL *s); 1047STACK_OF(X509_NAME) *SSL_get_client_CA_list(SSL *s);
895STACK *SSL_CTX_get_client_CA_list(SSL_CTX *s); 1048STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(SSL_CTX *s);
896int SSL_add_client_CA(SSL *ssl,X509 *x); 1049int SSL_add_client_CA(SSL *ssl,X509 *x);
897int SSL_CTX_add_client_CA(SSL_CTX *ctx,X509 *x); 1050int SSL_CTX_add_client_CA(SSL_CTX *ctx,X509 *x);
898 1051
@@ -901,10 +1054,10 @@ void SSL_set_accept_state(SSL *s);
901 1054
902long SSL_get_default_timeout(SSL *s); 1055long SSL_get_default_timeout(SSL *s);
903 1056
904void SSLeay_add_ssl_algorithms(void ); 1057int SSL_library_init(void );
905 1058
906char *SSL_CIPHER_description(SSL_CIPHER *,char *buf,int size); 1059char *SSL_CIPHER_description(SSL_CIPHER *,char *buf,int size);
907STACK *SSL_dup_CA_list(STACK *sk); 1060STACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *sk);
908 1061
909SSL *SSL_dup(SSL *ssl); 1062SSL *SSL_dup(SSL *ssl);
910 1063
@@ -919,7 +1072,8 @@ void SSL_set_shutdown(SSL *ssl,int mode);
919int SSL_get_shutdown(SSL *ssl); 1072int SSL_get_shutdown(SSL *ssl);
920int SSL_version(SSL *ssl); 1073int SSL_version(SSL *ssl);
921int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx); 1074int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx);
922int SSL_CTX_load_verify_locations(SSL_CTX *ctx,char *CAfile,char *CApath); 1075int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile,
1076 const char *CApath);
923SSL_SESSION *SSL_get_session(SSL *ssl); 1077SSL_SESSION *SSL_get_session(SSL *ssl);
924SSL_CTX *SSL_get_SSL_CTX(SSL *ssl); 1078SSL_CTX *SSL_get_SSL_CTX(SSL *ssl);
925void SSL_set_info_callback(SSL *ssl,void (*cb)()); 1079void SSL_set_info_callback(SSL *ssl,void (*cb)());
@@ -929,232 +1083,69 @@ int SSL_state(SSL *ssl);
929void SSL_set_verify_result(SSL *ssl,long v); 1083void SSL_set_verify_result(SSL *ssl,long v);
930long SSL_get_verify_result(SSL *ssl); 1084long SSL_get_verify_result(SSL *ssl);
931 1085
932int SSL_set_ex_data(SSL *ssl,int idx,char *data); 1086int SSL_set_ex_data(SSL *ssl,int idx,void *data);
933char *SSL_get_ex_data(SSL *ssl,int idx); 1087void *SSL_get_ex_data(SSL *ssl,int idx);
934int SSL_get_ex_new_index(long argl, char *argp, int (*new_func)(), 1088int SSL_get_ex_new_index(long argl, char *argp, int (*new_func)(),
935 int (*dup_func)(), void (*free_func)()); 1089 int (*dup_func)(), void (*free_func)());
936 1090
937int SSL_SESSION_set_ex_data(SSL_SESSION *ss,int idx,char *data); 1091int SSL_SESSION_set_ex_data(SSL_SESSION *ss,int idx,void *data);
938char *SSL_SESSION_get_ex_data(SSL_SESSION *ss,int idx); 1092void *SSL_SESSION_get_ex_data(SSL_SESSION *ss,int idx);
939int SSL_SESSION_get_ex_new_index(long argl, char *argp, int (*new_func)(), 1093int SSL_SESSION_get_ex_new_index(long argl, char *argp, int (*new_func)(),
940 int (*dup_func)(), void (*free_func)()); 1094 int (*dup_func)(), void (*free_func)());
941 1095
942int SSL_CTX_set_ex_data(SSL_CTX *ssl,int idx,char *data); 1096int SSL_CTX_set_ex_data(SSL_CTX *ssl,int idx,void *data);
943char *SSL_CTX_get_ex_data(SSL_CTX *ssl,int idx); 1097void *SSL_CTX_get_ex_data(SSL_CTX *ssl,int idx);
944int SSL_CTX_get_ex_new_index(long argl, char *argp, int (*new_func)(), 1098int SSL_CTX_get_ex_new_index(long argl, char *argp, int (*new_func)(),
945 int (*dup_func)(), void (*free_func)()); 1099 int (*dup_func)(), void (*free_func)());
946 1100
947#else 1101int SSL_get_ex_data_X509_STORE_CTX_idx(void );
948 1102
949BIO_METHOD *BIO_f_ssl(); 1103#define SSL_CTX_sess_set_cache_size(ctx,t) \
950BIO *BIO_new_ssl(); 1104 SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_SIZE,t,NULL)
951BIO *BIO_new_ssl_connect(); 1105#define SSL_CTX_sess_get_cache_size(ctx) \
952BIO *BIO_new_buffer_ssl_connect(); 1106 SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_SIZE,0,NULL)
953int BIO_ssl_copy_session_id(); 1107#define SSL_CTX_set_session_cache_mode(ctx,m) \
954void BIO_ssl_shutdown(); 1108 SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_MODE,m,NULL)
955 1109#define SSL_CTX_get_session_cache_mode(ctx) \
956int SSL_CTX_set_cipher_list(); 1110 SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_MODE,0,NULL)
957SSL_CTX *SSL_CTX_new(); 1111
958void SSL_CTX_free(); 1112#define SSL_CTX_get_default_read_ahead(ctx) SSL_CTX_get_read_ahead(ctx)
959void SSL_clear(); 1113#define SSL_CTX_set_default_read_ahead(ctx,m) SSL_CTX_set_read_ahead(ctx,m)
960void SSL_CTX_flush_sessions(); 1114#define SSL_CTX_get_read_ahead(ctx) \
961 1115 SSL_CTX_ctrl(ctx,SSL_CTRL_GET_READ_AHEAD,0,NULL)
962SSL_CIPHER *SSL_get_current_cipher(); 1116#define SSL_CTX_set_read_ahead(ctx,m) \
963int SSL_CIPHER_get_bits(); 1117 SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,0,NULL)
964char * SSL_CIPHER_get_version(); 1118
965char * SSL_CIPHER_get_name(); 1119 /* NB: the keylength is only applicable when is_export is true */
966 1120#ifndef NO_RSA
967int SSL_get_fd(); 1121void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx,
968char * SSL_get_cipher_list(); 1122 RSA *(*cb)(SSL *ssl,int is_export,
969char * SSL_get_shared_ciphers(); 1123 int keylength));
970int SSL_get_read_ahead();
971int SSL_pending();
972#ifndef NO_SOCK
973int SSL_set_fd();
974int SSL_set_rfd();
975int SSL_set_wfd();
976#endif
977#ifdef HEADER_BIO_H
978void SSL_set_bio();
979BIO * SSL_get_rbio();
980BIO * SSL_get_wbio();
981#endif
982int SSL_set_cipher_list();
983void SSL_set_read_ahead();
984int SSL_get_verify_mode();
985
986void SSL_set_verify();
987int SSL_use_RSAPrivateKey();
988int SSL_use_RSAPrivateKey_ASN1();
989int SSL_use_PrivateKey();
990int SSL_use_PrivateKey_ASN1();
991int SSL_use_certificate();
992int SSL_use_certificate_ASN1();
993
994#ifndef NO_STDIO
995int SSL_use_RSAPrivateKey_file();
996int SSL_use_PrivateKey_file();
997int SSL_use_certificate_file();
998int SSL_CTX_use_RSAPrivateKey_file();
999int SSL_CTX_use_PrivateKey_file();
1000int SSL_CTX_use_certificate_file();
1001STACK * SSL_load_client_CA_file();
1002#endif
1003 1124
1004void ERR_load_SSL_strings(); 1125void SSL_set_tmp_rsa_callback(SSL *ssl,
1005void SSL_load_error_strings(); 1126 RSA *(*cb)(SSL *ssl,int is_export,
1006char * SSL_state_string(); 1127 int keylength));
1007char * SSL_rstate_string();
1008char * SSL_state_string_long();
1009char * SSL_rstate_string_long();
1010long SSL_SESSION_get_time();
1011long SSL_SESSION_set_time();
1012long SSL_SESSION_get_timeout();
1013long SSL_SESSION_set_timeout();
1014void SSL_copy_session_id();
1015
1016SSL_SESSION *SSL_SESSION_new();
1017unsigned long SSL_SESSION_hash();
1018int SSL_SESSION_cmp();
1019#ifndef NO_FP_API
1020int SSL_SESSION_print_fp();
1021#endif 1128#endif
1022#ifdef HEADER_BIO_H 1129#ifndef NO_DH
1023int SSL_SESSION_print(); 1130void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx,
1024#endif 1131 DH *(*dh)(SSL *ssl,int is_export,
1025void SSL_SESSION_free(); 1132 int keylength));
1026int i2d_SSL_SESSION(); 1133void SSL_set_tmp_dh_callback(SSL *ssl,
1027int SSL_set_session(); 1134 DH *(*dh)(SSL *ssl,int is_export,
1028int SSL_CTX_add_session(); 1135 int keylength));
1029int SSL_CTX_remove_session();
1030SSL_SESSION *d2i_SSL_SESSION();
1031
1032#ifdef HEADER_X509_H
1033X509 * SSL_get_peer_certificate();
1034#endif
1035
1036STACK * SSL_get_peer_cert_chain();
1037
1038int SSL_CTX_get_verify_mode();
1039int (*SSL_CTX_get_verify_callback())();
1040void SSL_CTX_set_verify();
1041void SSL_CTX_set_cert_verify_cb();
1042int SSL_CTX_use_RSAPrivateKey();
1043int SSL_CTX_use_RSAPrivateKey_ASN1();
1044int SSL_CTX_use_PrivateKey();
1045int SSL_CTX_use_PrivateKey_ASN1();
1046int SSL_CTX_use_certificate();
1047int SSL_CTX_use_certificate_ASN1();
1048
1049void SSL_CTX_set_default_passwd_cb();
1050
1051int SSL_CTX_check_private_key();
1052int SSL_check_private_key();
1053
1054SSL * SSL_new();
1055void SSL_clear();
1056void SSL_free();
1057int SSL_accept();
1058int SSL_connect();
1059int SSL_read();
1060int SSL_peek();
1061int SSL_write();
1062long SSL_ctrl();
1063long SSL_CTX_ctrl();
1064
1065int SSL_get_error();
1066char * SSL_get_version();
1067
1068int SSL_CTX_set_ssl_version();
1069
1070SSL_METHOD *SSLv2_method();
1071SSL_METHOD *SSLv2_server_method();
1072SSL_METHOD *SSLv2_client_method();
1073
1074SSL_METHOD *SSLv3_method();
1075SSL_METHOD *SSLv3_server_method();
1076SSL_METHOD *SSLv3_client_method();
1077
1078SSL_METHOD *SSLv23_method();
1079SSL_METHOD *SSLv23_server_method();
1080SSL_METHOD *SSLv23_client_method();
1081
1082SSL_METHOD *TLSv1_method();
1083SSL_METHOD *TLSv1_server_method();
1084SSL_METHOD *TLSv1_client_method();
1085
1086STACK *SSL_get_ciphers();
1087
1088int SSL_do_handshake();
1089int SSL_renegotiate();
1090int SSL_shutdown();
1091
1092SSL_METHOD *SSL_get_ssl_method();
1093int SSL_set_ssl_method();
1094char *SSL_alert_type_string_long();
1095char *SSL_alert_type_string();
1096char *SSL_alert_desc_string_long();
1097char *SSL_alert_desc_string();
1098
1099void SSL_set_client_CA_list();
1100void SSL_CTX_set_client_CA_list();
1101STACK *SSL_get_client_CA_list();
1102STACK *SSL_CTX_get_client_CA_list();
1103int SSL_add_client_CA();
1104int SSL_CTX_add_client_CA();
1105
1106void SSL_set_connect_state();
1107void SSL_set_accept_state();
1108
1109long SSL_get_default_timeout();
1110
1111void SSLeay_add_ssl_algorithms();
1112
1113char *SSL_CIPHER_description();
1114STACK *SSL_dup_CA_list();
1115
1116SSL *SSL_dup();
1117
1118X509 *SSL_get_certificate();
1119/* EVP * */ struct evp_pkey_st *SSL_get_privatekey();
1120
1121#ifdef this_is_for_mk1mf_pl
1122EVP *SSL_get_privatekey();
1123
1124void SSL_CTX_set_quiet_shutdown();
1125int SSL_CTX_get_quiet_shutdown();
1126void SSL_set_quiet_shutdown();
1127int SSL_get_quiet_shutdown();
1128void SSL_set_shutdown();
1129int SSL_get_shutdown();
1130int SSL_version();
1131int SSL_CTX_set_default_verify_paths();
1132int SSL_CTX_load_verify_locations();
1133SSL_SESSION *SSL_get_session();
1134SSL_CTX *SSL_get_SSL_CTX();
1135void SSL_set_info_callback();
1136int (*SSL_get_info_callback())();
1137int SSL_state();
1138void SSL_set_verify_result();
1139long SSL_get_verify_result();
1140
1141int SSL_set_ex_data();
1142char *SSL_get_ex_data();
1143int SSL_get_ex_new_index();
1144
1145int SSL_SESSION_set_ex_data();
1146char *SSL_SESSION_get_ex_data();
1147int SSL_SESSION_get_ex_new_index();
1148
1149int SSL_CTX_set_ex_data();
1150char *SSL_CTX_get_ex_data();
1151int SSL_CTX_get_ex_new_index();
1152
1153#endif 1136#endif
1154 1137
1138#ifdef HEADER_COMP_H
1139int SSL_COMP_add_compression_method(int id,COMP_METHOD *cm);
1140#else
1141int SSL_COMP_add_compression_method(int id,char *cm);
1155#endif 1142#endif
1156 1143
1157/* BEGIN ERROR CODES */ 1144/* BEGIN ERROR CODES */
1145/* The following lines are auto generated by the script mkerr.pl. Any changes
1146 * made after this point may be overwritten when the script is next run.
1147 */
1148
1158/* Error codes for the SSL functions. */ 1149/* Error codes for the SSL functions. */
1159 1150
1160/* Function codes. */ 1151/* Function codes. */
@@ -1191,6 +1182,7 @@ int SSL_CTX_get_ex_new_index();
1191#define SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM 130 1182#define SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM 130
1192#define SSL_F_SSL3_CLIENT_HELLO 131 1183#define SSL_F_SSL3_CLIENT_HELLO 131
1193#define SSL_F_SSL3_CONNECT 132 1184#define SSL_F_SSL3_CONNECT 132
1185#define SSL_F_SSL3_CTRL 213
1194#define SSL_F_SSL3_CTX_CTRL 133 1186#define SSL_F_SSL3_CTX_CTRL 133
1195#define SSL_F_SSL3_ENC 134 1187#define SSL_F_SSL3_ENC 134
1196#define SSL_F_SSL3_GET_CERTIFICATE_REQUEST 135 1188#define SSL_F_SSL3_GET_CERTIFICATE_REQUEST 135
@@ -1218,58 +1210,74 @@ int SSL_CTX_get_ex_new_index();
1218#define SSL_F_SSL3_SETUP_KEY_BLOCK 157 1210#define SSL_F_SSL3_SETUP_KEY_BLOCK 157
1219#define SSL_F_SSL3_WRITE_BYTES 158 1211#define SSL_F_SSL3_WRITE_BYTES 158
1220#define SSL_F_SSL3_WRITE_PENDING 159 1212#define SSL_F_SSL3_WRITE_PENDING 159
1213#define SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK 215
1214#define SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK 216
1221#define SSL_F_SSL_BAD_METHOD 160 1215#define SSL_F_SSL_BAD_METHOD 160
1222#define SSL_F_SSL_BYTES_TO_CIPHER_LIST 161 1216#define SSL_F_SSL_BYTES_TO_CIPHER_LIST 161
1217#define SSL_F_SSL_CERT_DUP 221
1218#define SSL_F_SSL_CERT_INST 222
1219#define SSL_F_SSL_CERT_INSTANTIATE 214
1223#define SSL_F_SSL_CERT_NEW 162 1220#define SSL_F_SSL_CERT_NEW 162
1224#define SSL_F_SSL_CHECK_PRIVATE_KEY 163 1221#define SSL_F_SSL_CHECK_PRIVATE_KEY 163
1225#define SSL_F_SSL_CREATE_CIPHER_LIST 164 1222#define SSL_F_SSL_CLEAR 164
1226#define SSL_F_SSL_CTX_CHECK_PRIVATE_KEY 165 1223#define SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD 165
1227#define SSL_F_SSL_CTX_NEW 166 1224#define SSL_F_SSL_CREATE_CIPHER_LIST 166
1228#define SSL_F_SSL_CTX_SET_SSL_VERSION 167 1225#define SSL_F_SSL_CTX_CHECK_PRIVATE_KEY 168
1229#define SSL_F_SSL_CTX_USE_CERTIFICATE 168 1226#define SSL_F_SSL_CTX_NEW 169
1230#define SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1 169 1227#define SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT 219
1231#define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE 170 1228#define SSL_F_SSL_CTX_SET_SSL_VERSION 170
1232#define SSL_F_SSL_CTX_USE_PRIVATEKEY 171 1229#define SSL_F_SSL_CTX_USE_CERTIFICATE 171
1233#define SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1 172 1230#define SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1 172
1234#define SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE 173 1231#define SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE 220
1235#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY 174 1232#define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE 173
1236#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1 175 1233#define SSL_F_SSL_CTX_USE_PRIVATEKEY 174
1237#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE 176 1234#define SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1 175
1238#define SSL_F_SSL_DO_HANDSHAKE 177 1235#define SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE 176
1239#define SSL_F_SSL_GET_NEW_SESSION 178 1236#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY 177
1240#define SSL_F_SSL_GET_SERVER_SEND_CERT 179 1237#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1 178
1241#define SSL_F_SSL_GET_SIGN_PKEY 180 1238#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE 179
1242#define SSL_F_SSL_INIT_WBIO_BUFFER 181 1239#define SSL_F_SSL_DO_HANDSHAKE 180
1243#define SSL_F_SSL_LOAD_CLIENT_CA_FILE 182 1240#define SSL_F_SSL_GET_NEW_SESSION 181
1244#define SSL_F_SSL_NEW 183 1241#define SSL_F_SSL_GET_PREV_SESSION 217
1245#define SSL_F_SSL_RSA_PRIVATE_DECRYPT 184 1242#define SSL_F_SSL_GET_SERVER_SEND_CERT 182
1246#define SSL_F_SSL_RSA_PUBLIC_ENCRYPT 185 1243#define SSL_F_SSL_GET_SIGN_PKEY 183
1247#define SSL_F_SSL_SESSION_NEW 186 1244#define SSL_F_SSL_INIT_WBIO_BUFFER 184
1248#define SSL_F_SSL_SESSION_PRINT_FP 187 1245#define SSL_F_SSL_LOAD_CLIENT_CA_FILE 185
1249#define SSL_F_SSL_SET_CERT 188 1246#define SSL_F_SSL_NEW 186
1250#define SSL_F_SSL_SET_FD 189 1247#define SSL_F_SSL_READ 223
1251#define SSL_F_SSL_SET_PKEY 190 1248#define SSL_F_SSL_RSA_PRIVATE_DECRYPT 187
1252#define SSL_F_SSL_SET_RFD 191 1249#define SSL_F_SSL_RSA_PUBLIC_ENCRYPT 188
1253#define SSL_F_SSL_SET_SESSION 192 1250#define SSL_F_SSL_SESSION_NEW 189
1254#define SSL_F_SSL_SET_WFD 193 1251#define SSL_F_SSL_SESSION_PRINT_FP 190
1255#define SSL_F_SSL_UNDEFINED_FUNCTION 194 1252#define SSL_F_SSL_SESS_CERT_NEW 225
1256#define SSL_F_SSL_USE_CERTIFICATE 195 1253#define SSL_F_SSL_SET_CERT 191
1257#define SSL_F_SSL_USE_CERTIFICATE_ASN1 196 1254#define SSL_F_SSL_SET_FD 192
1258#define SSL_F_SSL_USE_CERTIFICATE_FILE 197 1255#define SSL_F_SSL_SET_PKEY 193
1259#define SSL_F_SSL_USE_PRIVATEKEY 198 1256#define SSL_F_SSL_SET_RFD 194
1260#define SSL_F_SSL_USE_PRIVATEKEY_ASN1 199 1257#define SSL_F_SSL_SET_SESSION 195
1261#define SSL_F_SSL_USE_PRIVATEKEY_FILE 200 1258#define SSL_F_SSL_SET_SESSION_ID_CONTEXT 218
1262#define SSL_F_SSL_USE_RSAPRIVATEKEY 201 1259#define SSL_F_SSL_SET_WFD 196
1263#define SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1 202 1260#define SSL_F_SSL_SHUTDOWN 224
1264#define SSL_F_SSL_USE_RSAPRIVATEKEY_FILE 203 1261#define SSL_F_SSL_UNDEFINED_FUNCTION 197
1265#define SSL_F_SSL_WRITE 204 1262#define SSL_F_SSL_USE_CERTIFICATE 198
1266#define SSL_F_TLS1_CHANGE_CIPHER_STATE 205 1263#define SSL_F_SSL_USE_CERTIFICATE_ASN1 199
1267#define SSL_F_TLS1_ENC 206 1264#define SSL_F_SSL_USE_CERTIFICATE_FILE 200
1268#define SSL_F_TLS1_SETUP_KEY_BLOCK 207 1265#define SSL_F_SSL_USE_PRIVATEKEY 201
1269#define SSL_F_WRITE_PENDING 208 1266#define SSL_F_SSL_USE_PRIVATEKEY_ASN1 202
1267#define SSL_F_SSL_USE_PRIVATEKEY_FILE 203
1268#define SSL_F_SSL_USE_RSAPRIVATEKEY 204
1269#define SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1 205
1270#define SSL_F_SSL_USE_RSAPRIVATEKEY_FILE 206
1271#define SSL_F_SSL_VERIFY_CERT_CHAIN 207
1272#define SSL_F_SSL_WRITE 208
1273#define SSL_F_TLS1_CHANGE_CIPHER_STATE 209
1274#define SSL_F_TLS1_ENC 210
1275#define SSL_F_TLS1_SETUP_KEY_BLOCK 211
1276#define SSL_F_WRITE_PENDING 212
1270 1277
1271/* Reason codes. */ 1278/* Reason codes. */
1272#define SSL_R_APP_DATA_IN_HANDSHAKE 100 1279#define SSL_R_APP_DATA_IN_HANDSHAKE 100
1280#define SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT 272
1273#define SSL_R_BAD_ALERT_RECORD 101 1281#define SSL_R_BAD_ALERT_RECORD 101
1274#define SSL_R_BAD_AUTHENTICATION_TYPE 102 1282#define SSL_R_BAD_AUTHENTICATION_TYPE 102
1275#define SSL_R_BAD_CHANGE_CIPHER_SPEC 103 1283#define SSL_R_BAD_CHANGE_CIPHER_SPEC 103
@@ -1282,6 +1290,7 @@ int SSL_CTX_get_ex_new_index();
1282#define SSL_R_BAD_DH_P_LENGTH 110 1290#define SSL_R_BAD_DH_P_LENGTH 110
1283#define SSL_R_BAD_DIGEST_LENGTH 111 1291#define SSL_R_BAD_DIGEST_LENGTH 111
1284#define SSL_R_BAD_DSA_SIGNATURE 112 1292#define SSL_R_BAD_DSA_SIGNATURE 112
1293#define SSL_R_BAD_LENGTH 271
1285#define SSL_R_BAD_MAC_DECODE 113 1294#define SSL_R_BAD_MAC_DECODE 113
1286#define SSL_R_BAD_MESSAGE_TYPE 114 1295#define SSL_R_BAD_MESSAGE_TYPE 114
1287#define SSL_R_BAD_PACKET_LENGTH 115 1296#define SSL_R_BAD_PACKET_LENGTH 115
@@ -1311,83 +1320,90 @@ int SSL_CTX_get_ex_new_index();
1311#define SSL_R_CIPHER_TABLE_SRC_ERROR 139 1320#define SSL_R_CIPHER_TABLE_SRC_ERROR 139
1312#define SSL_R_COMPRESSED_LENGTH_TOO_LONG 140 1321#define SSL_R_COMPRESSED_LENGTH_TOO_LONG 140
1313#define SSL_R_COMPRESSION_FAILURE 141 1322#define SSL_R_COMPRESSION_FAILURE 141
1314#define SSL_R_CONNECTION_ID_IS_DIFFERENT 142 1323#define SSL_R_COMPRESSION_LIBRARY_ERROR 142
1315#define SSL_R_CONNECTION_TYPE_NOT_SET 143 1324#define SSL_R_CONNECTION_ID_IS_DIFFERENT 143
1316#define SSL_R_DATA_BETWEEN_CCS_AND_FINISHED 144 1325#define SSL_R_CONNECTION_TYPE_NOT_SET 144
1317#define SSL_R_DATA_LENGTH_TOO_LONG 145 1326#define SSL_R_DATA_BETWEEN_CCS_AND_FINISHED 145
1318#define SSL_R_DECRYPTION_FAILED 146 1327#define SSL_R_DATA_LENGTH_TOO_LONG 146
1319#define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG 147 1328#define SSL_R_DECRYPTION_FAILED 147
1320#define SSL_R_DIGEST_CHECK_FAILED 148 1329#define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG 148
1321#define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 149 1330#define SSL_R_DIGEST_CHECK_FAILED 149
1322#define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 150 1331#define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150
1323#define SSL_R_EXCESSIVE_MESSAGE_SIZE 151 1332#define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151
1324#define SSL_R_EXTRA_DATA_IN_MESSAGE 152 1333#define SSL_R_EXCESSIVE_MESSAGE_SIZE 152
1325#define SSL_R_GOT_A_FIN_BEFORE_A_CCS 153 1334#define SSL_R_EXTRA_DATA_IN_MESSAGE 153
1326#define SSL_R_HTTPS_PROXY_REQUEST 154 1335#define SSL_R_GOT_A_FIN_BEFORE_A_CCS 154
1327#define SSL_R_HTTP_REQUEST 155 1336#define SSL_R_HTTPS_PROXY_REQUEST 155
1328#define SSL_R_INTERNAL_ERROR 156 1337#define SSL_R_HTTP_REQUEST 156
1329#define SSL_R_INVALID_CHALLENGE_LENGTH 157 1338#define SSL_R_INTERNAL_ERROR 157
1330#define SSL_R_LENGTH_MISMATCH 158 1339#define SSL_R_INVALID_CHALLENGE_LENGTH 158
1331#define SSL_R_LENGTH_TOO_SHORT 159 1340#define SSL_R_LENGTH_MISMATCH 159
1332#define SSL_R_LIBRARY_HAS_NO_CIPHERS 160 1341#define SSL_R_LENGTH_TOO_SHORT 160
1333#define SSL_R_MISSING_DH_DSA_CERT 161 1342#define SSL_R_LIBRARY_BUG 274
1334#define SSL_R_MISSING_DH_KEY 162 1343#define SSL_R_LIBRARY_HAS_NO_CIPHERS 161
1335#define SSL_R_MISSING_DH_RSA_CERT 163 1344#define SSL_R_MISSING_DH_DSA_CERT 162
1336#define SSL_R_MISSING_DSA_SIGNING_CERT 164 1345#define SSL_R_MISSING_DH_KEY 163
1337#define SSL_R_MISSING_EXPORT_TMP_DH_KEY 165 1346#define SSL_R_MISSING_DH_RSA_CERT 164
1338#define SSL_R_MISSING_EXPORT_TMP_RSA_KEY 166 1347#define SSL_R_MISSING_DSA_SIGNING_CERT 165
1339#define SSL_R_MISSING_RSA_CERTIFICATE 167 1348#define SSL_R_MISSING_EXPORT_TMP_DH_KEY 166
1340#define SSL_R_MISSING_RSA_ENCRYPTING_CERT 168 1349#define SSL_R_MISSING_EXPORT_TMP_RSA_KEY 167
1341#define SSL_R_MISSING_RSA_SIGNING_CERT 169 1350#define SSL_R_MISSING_RSA_CERTIFICATE 168
1342#define SSL_R_MISSING_TMP_DH_KEY 170 1351#define SSL_R_MISSING_RSA_ENCRYPTING_CERT 169
1343#define SSL_R_MISSING_TMP_RSA_KEY 171 1352#define SSL_R_MISSING_RSA_SIGNING_CERT 170
1344#define SSL_R_MISSING_TMP_RSA_PKEY 172 1353#define SSL_R_MISSING_TMP_DH_KEY 171
1345#define SSL_R_MISSING_VERIFY_MESSAGE 173 1354#define SSL_R_MISSING_TMP_RSA_KEY 172
1346#define SSL_R_NON_SSLV2_INITIAL_PACKET 174 1355#define SSL_R_MISSING_TMP_RSA_PKEY 173
1347#define SSL_R_NO_CERTIFICATES_RETURNED 175 1356#define SSL_R_MISSING_VERIFY_MESSAGE 174
1348#define SSL_R_NO_CERTIFICATE_ASSIGNED 176 1357#define SSL_R_NON_SSLV2_INITIAL_PACKET 175
1349#define SSL_R_NO_CERTIFICATE_RETURNED 177 1358#define SSL_R_NO_CERTIFICATES_RETURNED 176
1350#define SSL_R_NO_CERTIFICATE_SET 178 1359#define SSL_R_NO_CERTIFICATE_ASSIGNED 177
1351#define SSL_R_NO_CERTIFICATE_SPECIFIED 179 1360#define SSL_R_NO_CERTIFICATE_RETURNED 178
1352#define SSL_R_NO_CIPHERS_AVAILABLE 180 1361#define SSL_R_NO_CERTIFICATE_SET 179
1353#define SSL_R_NO_CIPHERS_PASSED 181 1362#define SSL_R_NO_CERTIFICATE_SPECIFIED 180
1354#define SSL_R_NO_CIPHERS_SPECIFIED 182 1363#define SSL_R_NO_CIPHERS_AVAILABLE 181
1355#define SSL_R_NO_CIPHER_LIST 183 1364#define SSL_R_NO_CIPHERS_PASSED 182
1356#define SSL_R_NO_CIPHER_MATCH 184 1365#define SSL_R_NO_CIPHERS_SPECIFIED 183
1357#define SSL_R_NO_CLIENT_CERT_RECEIVED 185 1366#define SSL_R_NO_CIPHER_LIST 184
1358#define SSL_R_NO_COMPRESSION_SPECIFIED 186 1367#define SSL_R_NO_CIPHER_MATCH 185
1359#define SSL_R_NO_PRIVATEKEY 187 1368#define SSL_R_NO_CLIENT_CERT_RECEIVED 186
1360#define SSL_R_NO_PRIVATE_KEY_ASSIGNED 188 1369#define SSL_R_NO_COMPRESSION_SPECIFIED 187
1361#define SSL_R_NO_PROTOCOLS_AVAILABLE 189 1370#define SSL_R_NO_METHOD_SPECIFIED 188
1362#define SSL_R_NO_PUBLICKEY 190 1371#define SSL_R_NO_PRIVATEKEY 189
1363#define SSL_R_NO_SHARED_CIPHER 191 1372#define SSL_R_NO_PRIVATE_KEY_ASSIGNED 190
1364#define SSL_R_NULL_SSL_CTX 192 1373#define SSL_R_NO_PROTOCOLS_AVAILABLE 191
1365#define SSL_R_NULL_SSL_METHOD_PASSED 193 1374#define SSL_R_NO_PUBLICKEY 192
1366#define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED 194 1375#define SSL_R_NO_SHARED_CIPHER 193
1367#define SSL_R_PACKET_LENGTH_TOO_LONG 195 1376#define SSL_R_NO_VERIFY_CALLBACK 194
1368#define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE 196 1377#define SSL_R_NULL_SSL_CTX 195
1369#define SSL_R_PEER_ERROR 197 1378#define SSL_R_NULL_SSL_METHOD_PASSED 196
1370#define SSL_R_PEER_ERROR_CERTIFICATE 198 1379#define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED 197
1371#define SSL_R_PEER_ERROR_NO_CERTIFICATE 199 1380#define SSL_R_PACKET_LENGTH_TOO_LONG 198
1372#define SSL_R_PEER_ERROR_NO_CIPHER 200 1381#define SSL_R_PATH_TOO_LONG 270
1373#define SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE 201 1382#define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE 199
1374#define SSL_R_PRE_MAC_LENGTH_TOO_LONG 202 1383#define SSL_R_PEER_ERROR 200
1375#define SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS 203 1384#define SSL_R_PEER_ERROR_CERTIFICATE 201
1376#define SSL_R_PROTOCOL_IS_SHUTDOWN 204 1385#define SSL_R_PEER_ERROR_NO_CERTIFICATE 202
1377#define SSL_R_PUBLIC_KEY_ENCRYPT_ERROR 205 1386#define SSL_R_PEER_ERROR_NO_CIPHER 203
1378#define SSL_R_PUBLIC_KEY_IS_NOT_RSA 206 1387#define SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE 204
1379#define SSL_R_PUBLIC_KEY_NOT_RSA 207 1388#define SSL_R_PRE_MAC_LENGTH_TOO_LONG 205
1380#define SSL_R_READ_BIO_NOT_SET 208 1389#define SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS 206
1381#define SSL_R_READ_WRONG_PACKET_TYPE 209 1390#define SSL_R_PROTOCOL_IS_SHUTDOWN 207
1382#define SSL_R_RECORD_LENGTH_MISMATCH 210 1391#define SSL_R_PUBLIC_KEY_ENCRYPT_ERROR 208
1383#define SSL_R_RECORD_TOO_LARGE 211 1392#define SSL_R_PUBLIC_KEY_IS_NOT_RSA 209
1384#define SSL_R_REQUIRED_CIPHER_MISSING 212 1393#define SSL_R_PUBLIC_KEY_NOT_RSA 210
1385#define SSL_R_REUSE_CERT_LENGTH_NOT_ZERO 213 1394#define SSL_R_READ_BIO_NOT_SET 211
1386#define SSL_R_REUSE_CERT_TYPE_NOT_ZERO 214 1395#define SSL_R_READ_WRONG_PACKET_TYPE 212
1387#define SSL_R_REUSE_CIPHER_LIST_NOT_ZERO 215 1396#define SSL_R_RECORD_LENGTH_MISMATCH 213
1388#define SSL_R_SHORT_READ 216 1397#define SSL_R_RECORD_TOO_LARGE 214
1389#define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 217 1398#define SSL_R_REQUIRED_CIPHER_MISSING 215
1390#define SSL_R_SSL3_SESSION_ID_TOO_SHORT 218 1399#define SSL_R_REUSE_CERT_LENGTH_NOT_ZERO 216
1400#define SSL_R_REUSE_CERT_TYPE_NOT_ZERO 217
1401#define SSL_R_REUSE_CIPHER_LIST_NOT_ZERO 218
1402#define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277
1403#define SSL_R_SHORT_READ 219
1404#define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220
1405#define SSL_R_SSL23_DOING_SESSION_ID_REUSE 221
1406#define SSL_R_SSL3_SESSION_ID_TOO_SHORT 222
1391#define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042 1407#define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042
1392#define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020 1408#define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020
1393#define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045 1409#define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045
@@ -1397,55 +1413,70 @@ int SSL_CTX_get_ex_new_index();
1397#define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040 1413#define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040
1398#define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047 1414#define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047
1399#define SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041 1415#define SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041
1400#define SSL_R_SSLV3_ALERT_PEER_ERROR_CERTIFICATE 219 1416#define SSL_R_SSLV3_ALERT_PEER_ERROR_CERTIFICATE 223
1401#define SSL_R_SSLV3_ALERT_PEER_ERROR_NO_CERTIFICATE 220 1417#define SSL_R_SSLV3_ALERT_PEER_ERROR_NO_CERTIFICATE 224
1402#define SSL_R_SSLV3_ALERT_PEER_ERROR_NO_CIPHER 221 1418#define SSL_R_SSLV3_ALERT_PEER_ERROR_NO_CIPHER 225
1403#define SSL_R_SSLV3_ALERT_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE 222 1419#define SSL_R_SSLV3_ALERT_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE 226
1404#define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010 1420#define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010
1405#define SSL_R_SSLV3_ALERT_UNKNOWN_REMOTE_ERROR_TYPE 223 1421#define SSL_R_SSLV3_ALERT_UNKNOWN_REMOTE_ERROR_TYPE 227
1406#define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043 1422#define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043
1407#define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION 224 1423#define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION 228
1408#define SSL_R_SSL_HANDSHAKE_FAILURE 225 1424#define SSL_R_SSL_HANDSHAKE_FAILURE 229
1409#define SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS 226 1425#define SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS 230
1410#define SSL_R_SSL_SESSION_ID_IS_DIFFERENT 227 1426#define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG 273
1411#define SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER 228 1427#define SSL_R_SSL_SESSION_ID_IS_DIFFERENT 231
1412#define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 229 1428#define SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049
1413#define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG 230 1429#define SSL_R_TLSV1_ALERT_DECODE_ERROR 1050
1414#define SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER 231 1430#define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021
1415#define SSL_R_UNABLE_TO_DECODE_DH_CERTS 232 1431#define SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051
1416#define SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY 233 1432#define SSL_R_TLSV1_ALERT_EXPORT_RESTRICION 1060
1417#define SSL_R_UNABLE_TO_FIND_DH_PARAMETERS 234 1433#define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071
1418#define SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS 235 1434#define SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080
1419#define SSL_R_UNABLE_TO_FIND_SSL_METHOD 236 1435#define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100
1420#define SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES 237 1436#define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070
1421#define SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES 238 1437#define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022
1422#define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES 239 1438#define SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048
1423#define SSL_R_UNEXPECTED_MESSAGE 240 1439#define SSL_R_TLSV1_ALERT_USER_CANCLED 1090
1424#define SSL_R_UNEXPECTED_RECORD 241 1440#define SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER 232
1425#define SSL_R_UNKNOWN_ALERT_TYPE 242 1441#define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 233
1426#define SSL_R_UNKNOWN_CERTIFICATE_TYPE 243 1442#define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG 234
1427#define SSL_R_UNKNOWN_CIPHER_RETURNED 244 1443#define SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER 235
1428#define SSL_R_UNKNOWN_CIPHER_TYPE 245 1444#define SSL_R_UNABLE_TO_DECODE_DH_CERTS 236
1429#define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 246 1445#define SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY 237
1430#define SSL_R_UNKNOWN_PKEY_TYPE 247 1446#define SSL_R_UNABLE_TO_FIND_DH_PARAMETERS 238
1431#define SSL_R_UNKNOWN_PROTOCOL 248 1447#define SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS 239
1432#define SSL_R_UNKNOWN_REMOTE_ERROR_TYPE 249 1448#define SSL_R_UNABLE_TO_FIND_SSL_METHOD 240
1433#define SSL_R_UNKNOWN_SSL_VERSION 250 1449#define SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES 241
1434#define SSL_R_UNKNOWN_STATE 251 1450#define SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES 242
1435#define SSL_R_UNSUPPORTED_CIPHER 252 1451#define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES 243
1436#define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM 253 1452#define SSL_R_UNEXPECTED_MESSAGE 244
1437#define SSL_R_UNSUPPORTED_PROTOCOL 254 1453#define SSL_R_UNEXPECTED_RECORD 245
1438#define SSL_R_UNSUPPORTED_SSL_VERSION 255 1454#define SSL_R_UNINITIALIZED 276
1439#define SSL_R_WRITE_BIO_NOT_SET 256 1455#define SSL_R_UNKNOWN_ALERT_TYPE 246
1440#define SSL_R_WRONG_CIPHER_RETURNED 257 1456#define SSL_R_UNKNOWN_CERTIFICATE_TYPE 247
1441#define SSL_R_WRONG_MESSAGE_TYPE 258 1457#define SSL_R_UNKNOWN_CIPHER_RETURNED 248
1442#define SSL_R_WRONG_NUMBER_OF_KEY_BITS 259 1458#define SSL_R_UNKNOWN_CIPHER_TYPE 249
1443#define SSL_R_WRONG_SIGNATURE_LENGTH 260 1459#define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 250
1444#define SSL_R_WRONG_SIGNATURE_SIZE 261 1460#define SSL_R_UNKNOWN_PKEY_TYPE 251
1445#define SSL_R_WRONG_SSL_VERSION 262 1461#define SSL_R_UNKNOWN_PROTOCOL 252
1446#define SSL_R_WRONG_VERSION_NUMBER 263 1462#define SSL_R_UNKNOWN_REMOTE_ERROR_TYPE 253
1447#define SSL_R_X509_LIB 264 1463#define SSL_R_UNKNOWN_SSL_VERSION 254
1448 1464#define SSL_R_UNKNOWN_STATE 255
1465#define SSL_R_UNSUPPORTED_CIPHER 256
1466#define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM 257
1467#define SSL_R_UNSUPPORTED_PROTOCOL 258
1468#define SSL_R_UNSUPPORTED_SSL_VERSION 259
1469#define SSL_R_WRITE_BIO_NOT_SET 260
1470#define SSL_R_WRONG_CIPHER_RETURNED 261
1471#define SSL_R_WRONG_MESSAGE_TYPE 262
1472#define SSL_R_WRONG_NUMBER_OF_KEY_BITS 263
1473#define SSL_R_WRONG_SIGNATURE_LENGTH 264
1474#define SSL_R_WRONG_SIGNATURE_SIZE 265
1475#define SSL_R_WRONG_SSL_VERSION 266
1476#define SSL_R_WRONG_VERSION_NUMBER 267
1477#define SSL_R_X509_LIB 268
1478#define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 269
1479
1449#ifdef __cplusplus 1480#ifdef __cplusplus
1450} 1481}
1451#endif 1482#endif