Deleted Added
full compact
ssl.h (59191) ssl.h (68651)
1/* ssl/ssl.h */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *

--- 45 unchanged lines hidden (view full) ---

54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef HEADER_SSL_H
60#define HEADER_SSL_H
61
1/* ssl/ssl.h */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *

--- 45 unchanged lines hidden (view full) ---

54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef HEADER_SSL_H
60#define HEADER_SSL_H
61
62#ifndef NO_COMP
63#include <openssl/comp.h>
64#endif
65#ifndef NO_BIO
66#include <openssl/bio.h>
67#endif
68#ifndef NO_X509
69#include <openssl/x509.h>
70#endif
71#include <openssl/safestack.h>
72
62#ifdef __cplusplus
63extern "C" {
64#endif
65
73#ifdef __cplusplus
74extern "C" {
75#endif
76
66#include <openssl/safestack.h>
67
68/* SSLeay version number for ASN.1 encoding of the session information */
69/* Version 0 - initial version
70 * Version 1 - added the optional peer certificate
71 */
72#define SSL_SESSION_ASN1_VERSION 0x0001
73
74/* text strings for the ciphers */
75#define SSL_TXT_NULL_WITH_MD5 SSL2_TXT_NULL_WITH_MD5

--- 59 unchanged lines hidden (view full) ---

135/* 'DEFAULT' at the start of the cipher list insert the following string
136 * in addition to this being the default cipher string */
137#define SSL_DEFAULT_CIPHER_LIST "ALL:!ADH:RC4+RSA:+SSLv2:@STRENGTH"
138
139/* Used in SSL_set_shutdown()/SSL_get_shutdown(); */
140#define SSL_SENT_SHUTDOWN 1
141#define SSL_RECEIVED_SHUTDOWN 2
142
77/* SSLeay version number for ASN.1 encoding of the session information */
78/* Version 0 - initial version
79 * Version 1 - added the optional peer certificate
80 */
81#define SSL_SESSION_ASN1_VERSION 0x0001
82
83/* text strings for the ciphers */
84#define SSL_TXT_NULL_WITH_MD5 SSL2_TXT_NULL_WITH_MD5

--- 59 unchanged lines hidden (view full) ---

144/* 'DEFAULT' at the start of the cipher list insert the following string
145 * in addition to this being the default cipher string */
146#define SSL_DEFAULT_CIPHER_LIST "ALL:!ADH:RC4+RSA:+SSLv2:@STRENGTH"
147
148/* Used in SSL_set_shutdown()/SSL_get_shutdown(); */
149#define SSL_SENT_SHUTDOWN 1
150#define SSL_RECEIVED_SHUTDOWN 2
151
152#ifdef __cplusplus
153}
154#endif
155
143#include <openssl/crypto.h>
144#include <openssl/lhash.h>
145#include <openssl/buffer.h>
146#include <openssl/bio.h>
147#include <openssl/pem.h>
148#include <openssl/x509.h>
149
156#include <openssl/crypto.h>
157#include <openssl/lhash.h>
158#include <openssl/buffer.h>
159#include <openssl/bio.h>
160#include <openssl/pem.h>
161#include <openssl/x509.h>
162
163#ifdef __cplusplus
164extern "C" {
165#endif
166
150#if (defined(NO_RSA) || defined(NO_MD5)) && !defined(NO_SSL2)
151#define NO_SSL2
152#endif
153
154#define SSL_FILETYPE_ASN1 X509_FILETYPE_ASN1
155#define SSL_FILETYPE_PEM X509_FILETYPE_PEM
156
157/* This is needed to stop compilers complaining about the

--- 155 unchanged lines hidden (view full) ---

313/* Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success
314 * when just a single record has been written): */
315#define SSL_MODE_ENABLE_PARTIAL_WRITE 0x00000001L
316/* Make it possible to retry SSL_write() with changed buffer location
317 * (buffer contents must stay the same!); this is not the default to avoid
318 * the misconception that non-blocking SSL_write() behaves like
319 * non-blocking write(): */
320#define SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER 0x00000002L
167#if (defined(NO_RSA) || defined(NO_MD5)) && !defined(NO_SSL2)
168#define NO_SSL2
169#endif
170
171#define SSL_FILETYPE_ASN1 X509_FILETYPE_ASN1
172#define SSL_FILETYPE_PEM X509_FILETYPE_PEM
173
174/* This is needed to stop compilers complaining about the

--- 155 unchanged lines hidden (view full) ---

330/* Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success
331 * when just a single record has been written): */
332#define SSL_MODE_ENABLE_PARTIAL_WRITE 0x00000001L
333/* Make it possible to retry SSL_write() with changed buffer location
334 * (buffer contents must stay the same!); this is not the default to avoid
335 * the misconception that non-blocking SSL_write() behaves like
336 * non-blocking write(): */
337#define SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER 0x00000002L
338/* Never bother the application with retries if the transport
339 * is blocking: */
340#define SSL_MODE_AUTO_RETRY 0x00000004L
321
322/* Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value,
323 * they cannot be used to clear bits. */
324
325#define SSL_CTX_set_options(ctx,op) \
326 SSL_CTX_ctrl(ctx,SSL_CTRL_OPTIONS,op,NULL)
327#define SSL_CTX_get_options(ctx) \
328 SSL_CTX_ctrl(ctx,SSL_CTRL_OPTIONS,0,NULL)

--- 9 unchanged lines hidden (view full) ---

338#define SSL_set_mode(ssl,op) \
339 SSL_ctrl(ssl,SSL_CTRL_MODE,op,NULL)
340#define SSL_get_mode(ssl) \
341 SSL_ctrl(ssl,SSL_CTRL_MODE,0,NULL)
342
343#define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT (1024*20)
344
345typedef struct ssl_comp_st
341
342/* Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value,
343 * they cannot be used to clear bits. */
344
345#define SSL_CTX_set_options(ctx,op) \
346 SSL_CTX_ctrl(ctx,SSL_CTRL_OPTIONS,op,NULL)
347#define SSL_CTX_get_options(ctx) \
348 SSL_CTX_ctrl(ctx,SSL_CTRL_OPTIONS,0,NULL)

--- 9 unchanged lines hidden (view full) ---

358#define SSL_set_mode(ssl,op) \
359 SSL_ctrl(ssl,SSL_CTRL_MODE,op,NULL)
360#define SSL_get_mode(ssl) \
361 SSL_ctrl(ssl,SSL_CTRL_MODE,0,NULL)
362
363#define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT (1024*20)
364
365typedef struct ssl_comp_st
346{
347 int id;
348 char *name;
349#ifdef HEADER_COMP_H
350 COMP_METHOD *method;
366 {
367 int id;
368 char *name;
369#ifndef NO_COMP
370 COMP_METHOD *method;
351#else
371#else
352 char *method;
372 char *method;
353#endif
373#endif
354} SSL_COMP;
374 } SSL_COMP;
355
356DECLARE_STACK_OF(SSL_COMP)
357
358struct ssl_ctx_st
359 {
360 SSL_METHOD *method;
361 unsigned long options;
362 unsigned long mode;

--- 165 unchanged lines hidden (view full) ---

528 int type; /* SSL_ST_CONNECT or SSL_ST_ACCEPT */
529
530 SSL_METHOD *method; /* SSLv3 */
531
532 /* There are 2 BIO's even though they are normally both the
533 * same. This is so data can be read and written to different
534 * handlers */
535
375
376DECLARE_STACK_OF(SSL_COMP)
377
378struct ssl_ctx_st
379 {
380 SSL_METHOD *method;
381 unsigned long options;
382 unsigned long mode;

--- 165 unchanged lines hidden (view full) ---

548 int type; /* SSL_ST_CONNECT or SSL_ST_ACCEPT */
549
550 SSL_METHOD *method; /* SSLv3 */
551
552 /* There are 2 BIO's even though they are normally both the
553 * same. This is so data can be read and written to different
554 * handlers */
555
536#ifdef HEADER_BIO_H
556#ifndef NO_BIO
537 BIO *rbio; /* used by SSL_read */
538 BIO *wbio; /* used by SSL_write */
557 BIO *rbio; /* used by SSL_read */
558 BIO *wbio; /* used by SSL_write */
539 BIO *bbio; /* used during session-id reuse to concatinate
559 BIO *bbio; /* used during session-id reuse to concatenate
540 * messages */
541#else
542 char *rbio; /* used by SSL_read */
543 char *wbio; /* used by SSL_write */
544 char *bbio;
545#endif
546 /* This holds a variable that indicates what we were doing
547 * when a 0 or -1 is returned. This is needed for

--- 44 unchanged lines hidden (view full) ---

592 STACK_OF(SSL_CIPHER) *cipher_list;
593 STACK_OF(SSL_CIPHER) *cipher_list_by_id;
594
595 /* These are the ones being used, the ones in SSL_SESSION are
596 * the ones to be 'copied' into these ones */
597
598 EVP_CIPHER_CTX *enc_read_ctx; /* cryptographic state */
599 const EVP_MD *read_hash; /* used for mac generation */
560 * messages */
561#else
562 char *rbio; /* used by SSL_read */
563 char *wbio; /* used by SSL_write */
564 char *bbio;
565#endif
566 /* This holds a variable that indicates what we were doing
567 * when a 0 or -1 is returned. This is needed for

--- 44 unchanged lines hidden (view full) ---

612 STACK_OF(SSL_CIPHER) *cipher_list;
613 STACK_OF(SSL_CIPHER) *cipher_list_by_id;
614
615 /* These are the ones being used, the ones in SSL_SESSION are
616 * the ones to be 'copied' into these ones */
617
618 EVP_CIPHER_CTX *enc_read_ctx; /* cryptographic state */
619 const EVP_MD *read_hash; /* used for mac generation */
600#ifdef HEADER_COMP_H
620#ifndef NO_COMP
601 COMP_CTX *expand; /* uncompress */
602#else
603 char *expand;
604#endif
605
606 EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */
607 const EVP_MD *write_hash; /* used for mac generation */
621 COMP_CTX *expand; /* uncompress */
622#else
623 char *expand;
624#endif
625
626 EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */
627 const EVP_MD *write_hash; /* used for mac generation */
608#ifdef HEADER_COMP_H
628#ifndef NO_COMP
609 COMP_CTX *compress; /* compression */
610#else
611 char *compress;
612#endif
613
614 /* session info */
615
616 /* client cert? */

--- 33 unchanged lines hidden (view full) ---

650 int references;
651 unsigned long options; /* protocol behaviour */
652 unsigned long mode; /* API behaviour */
653 int first_packet;
654 int client_version; /* what was passed, used for
655 * SSLv3/TLS rollback check */
656 };
657
629 COMP_CTX *compress; /* compression */
630#else
631 char *compress;
632#endif
633
634 /* session info */
635
636 /* client cert? */

--- 33 unchanged lines hidden (view full) ---

670 int references;
671 unsigned long options; /* protocol behaviour */
672 unsigned long mode; /* API behaviour */
673 int first_packet;
674 int client_version; /* what was passed, used for
675 * SSLv3/TLS rollback check */
676 };
677
678#ifdef __cplusplus
679}
680#endif
681
658#include <openssl/ssl2.h>
659#include <openssl/ssl3.h>
660#include <openssl/tls1.h> /* This is mostly sslv3 with a few tweaks */
661#include <openssl/ssl23.h>
662
682#include <openssl/ssl2.h>
683#include <openssl/ssl3.h>
684#include <openssl/tls1.h> /* This is mostly sslv3 with a few tweaks */
685#include <openssl/ssl23.h>
686
687#ifdef __cplusplus
688extern "C" {
689#endif
690
663/* compatibility */
664#define SSL_set_app_data(s,arg) (SSL_set_ex_data(s,0,(char *)arg))
665#define SSL_get_app_data(s) (SSL_get_ex_data(s,0))
666#define SSL_SESSION_set_app_data(s,a) (SSL_SESSION_set_ex_data(s,0,(char *)a))
667#define SSL_SESSION_get_app_data(s) (SSL_SESSION_get_ex_data(s,0))
668#define SSL_CTX_get_app_data(ctx) (SSL_CTX_get_ex_data(ctx,0))
669#define SSL_CTX_set_app_data(ctx,arg) (SSL_CTX_set_ex_data(ctx,0,(char *)arg))
670

--- 207 unchanged lines hidden (view full) ---

878#undef SSL_get_ex_data_X509_STORE_CTX_idx
879#define SSL_get_ex_data_X509_STORE_CTX_idx SSL_get_ex_data_X509_STOR_CTX_i
880#undef SSL_add_file_cert_subjects_to_stack
881#define SSL_add_file_cert_subjects_to_stack SSL_add_file_cert_sub_to_stack
882#undef SSL_add_dir_cert_subjects_to_stack
883#define SSL_add_dir_cert_subjects_to_stack SSL_add_dir_cert_sub_to_stack
884#endif
885
691/* compatibility */
692#define SSL_set_app_data(s,arg) (SSL_set_ex_data(s,0,(char *)arg))
693#define SSL_get_app_data(s) (SSL_get_ex_data(s,0))
694#define SSL_SESSION_set_app_data(s,a) (SSL_SESSION_set_ex_data(s,0,(char *)a))
695#define SSL_SESSION_get_app_data(s) (SSL_SESSION_get_ex_data(s,0))
696#define SSL_CTX_get_app_data(ctx) (SSL_CTX_get_ex_data(ctx,0))
697#define SSL_CTX_set_app_data(ctx,arg) (SSL_CTX_set_ex_data(ctx,0,(char *)arg))
698

--- 207 unchanged lines hidden (view full) ---

906#undef SSL_get_ex_data_X509_STORE_CTX_idx
907#define SSL_get_ex_data_X509_STORE_CTX_idx SSL_get_ex_data_X509_STOR_CTX_i
908#undef SSL_add_file_cert_subjects_to_stack
909#define SSL_add_file_cert_subjects_to_stack SSL_add_file_cert_sub_to_stack
910#undef SSL_add_dir_cert_subjects_to_stack
911#define SSL_add_dir_cert_subjects_to_stack SSL_add_dir_cert_sub_to_stack
912#endif
913
886#ifdef HEADER_BIO_H
914#ifndef NO_BIO
887BIO_METHOD *BIO_f_ssl(void);
888BIO *BIO_new_ssl(SSL_CTX *ctx,int client);
889BIO *BIO_new_ssl_connect(SSL_CTX *ctx);
890BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx);
891int BIO_ssl_copy_session_id(BIO *to,BIO *from);
892void BIO_ssl_shutdown(BIO *ssl_bio);
893
894#endif

--- 20 unchanged lines hidden (view full) ---

915char * SSL_get_shared_ciphers(SSL *s, char *buf, int len);
916int SSL_get_read_ahead(SSL * s);
917int SSL_pending(SSL *s);
918#ifndef NO_SOCK
919int SSL_set_fd(SSL *s, int fd);
920int SSL_set_rfd(SSL *s, int fd);
921int SSL_set_wfd(SSL *s, int fd);
922#endif
915BIO_METHOD *BIO_f_ssl(void);
916BIO *BIO_new_ssl(SSL_CTX *ctx,int client);
917BIO *BIO_new_ssl_connect(SSL_CTX *ctx);
918BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx);
919int BIO_ssl_copy_session_id(BIO *to,BIO *from);
920void BIO_ssl_shutdown(BIO *ssl_bio);
921
922#endif

--- 20 unchanged lines hidden (view full) ---

943char * SSL_get_shared_ciphers(SSL *s, char *buf, int len);
944int SSL_get_read_ahead(SSL * s);
945int SSL_pending(SSL *s);
946#ifndef NO_SOCK
947int SSL_set_fd(SSL *s, int fd);
948int SSL_set_rfd(SSL *s, int fd);
949int SSL_set_wfd(SSL *s, int fd);
950#endif
923#ifdef HEADER_BIO_H
951#ifndef NO_BIO
924void SSL_set_bio(SSL *s, BIO *rbio,BIO *wbio);
925BIO * SSL_get_rbio(SSL *s);
926BIO * SSL_get_wbio(SSL *s);
927#endif
928int SSL_set_cipher_list(SSL *s, const char *str);
929void SSL_set_read_ahead(SSL *s, int yes);
930int SSL_get_verify_mode(SSL *s);
931int SSL_get_verify_depth(SSL *s);

--- 38 unchanged lines hidden (view full) ---

970void SSL_copy_session_id(SSL *to,SSL *from);
971
972SSL_SESSION *SSL_SESSION_new(void);
973unsigned long SSL_SESSION_hash(SSL_SESSION *a);
974int SSL_SESSION_cmp(SSL_SESSION *a,SSL_SESSION *b);
975#ifndef NO_FP_API
976int SSL_SESSION_print_fp(FILE *fp,SSL_SESSION *ses);
977#endif
952void SSL_set_bio(SSL *s, BIO *rbio,BIO *wbio);
953BIO * SSL_get_rbio(SSL *s);
954BIO * SSL_get_wbio(SSL *s);
955#endif
956int SSL_set_cipher_list(SSL *s, const char *str);
957void SSL_set_read_ahead(SSL *s, int yes);
958int SSL_get_verify_mode(SSL *s);
959int SSL_get_verify_depth(SSL *s);

--- 38 unchanged lines hidden (view full) ---

998void SSL_copy_session_id(SSL *to,SSL *from);
999
1000SSL_SESSION *SSL_SESSION_new(void);
1001unsigned long SSL_SESSION_hash(SSL_SESSION *a);
1002int SSL_SESSION_cmp(SSL_SESSION *a,SSL_SESSION *b);
1003#ifndef NO_FP_API
1004int SSL_SESSION_print_fp(FILE *fp,SSL_SESSION *ses);
1005#endif
978#ifdef HEADER_BIO_H
1006#ifndef NO_BIO
979int SSL_SESSION_print(BIO *fp,SSL_SESSION *ses);
980#endif
981void SSL_SESSION_free(SSL_SESSION *ses);
982int i2d_SSL_SESSION(SSL_SESSION *in,unsigned char **pp);
983int SSL_set_session(SSL *to, SSL_SESSION *session);
984int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c);
985int SSL_CTX_remove_session(SSL_CTX *,SSL_SESSION *c);
986SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a,unsigned char **pp,long length);

--- 179 unchanged lines hidden (view full) ---

1166void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx,
1167 DH *(*dh)(SSL *ssl,int is_export,
1168 int keylength));
1169void SSL_set_tmp_dh_callback(SSL *ssl,
1170 DH *(*dh)(SSL *ssl,int is_export,
1171 int keylength));
1172#endif
1173
1007int SSL_SESSION_print(BIO *fp,SSL_SESSION *ses);
1008#endif
1009void SSL_SESSION_free(SSL_SESSION *ses);
1010int i2d_SSL_SESSION(SSL_SESSION *in,unsigned char **pp);
1011int SSL_set_session(SSL *to, SSL_SESSION *session);
1012int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c);
1013int SSL_CTX_remove_session(SSL_CTX *,SSL_SESSION *c);
1014SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a,unsigned char **pp,long length);

--- 179 unchanged lines hidden (view full) ---

1194void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx,
1195 DH *(*dh)(SSL *ssl,int is_export,
1196 int keylength));
1197void SSL_set_tmp_dh_callback(SSL *ssl,
1198 DH *(*dh)(SSL *ssl,int is_export,
1199 int keylength));
1200#endif
1201
1174#ifdef HEADER_COMP_H
1202#ifndef NO_COMP
1175int SSL_COMP_add_compression_method(int id,COMP_METHOD *cm);
1176#else
1177int SSL_COMP_add_compression_method(int id,char *cm);
1178#endif
1179
1180/* BEGIN ERROR CODES */
1181/* The following lines are auto generated by the script mkerr.pl. Any changes
1182 * made after this point may be overwritten when the script is next run.

--- 255 unchanged lines hidden (view full) ---

1438#define SSL_R_PROTOCOL_IS_SHUTDOWN 207
1439#define SSL_R_PUBLIC_KEY_ENCRYPT_ERROR 208
1440#define SSL_R_PUBLIC_KEY_IS_NOT_RSA 209
1441#define SSL_R_PUBLIC_KEY_NOT_RSA 210
1442#define SSL_R_READ_BIO_NOT_SET 211
1443#define SSL_R_READ_WRONG_PACKET_TYPE 212
1444#define SSL_R_RECORD_LENGTH_MISMATCH 213
1445#define SSL_R_RECORD_TOO_LARGE 214
1203int SSL_COMP_add_compression_method(int id,COMP_METHOD *cm);
1204#else
1205int SSL_COMP_add_compression_method(int id,char *cm);
1206#endif
1207
1208/* BEGIN ERROR CODES */
1209/* The following lines are auto generated by the script mkerr.pl. Any changes
1210 * made after this point may be overwritten when the script is next run.

--- 255 unchanged lines hidden (view full) ---

1466#define SSL_R_PROTOCOL_IS_SHUTDOWN 207
1467#define SSL_R_PUBLIC_KEY_ENCRYPT_ERROR 208
1468#define SSL_R_PUBLIC_KEY_IS_NOT_RSA 209
1469#define SSL_R_PUBLIC_KEY_NOT_RSA 210
1470#define SSL_R_READ_BIO_NOT_SET 211
1471#define SSL_R_READ_WRONG_PACKET_TYPE 212
1472#define SSL_R_RECORD_LENGTH_MISMATCH 213
1473#define SSL_R_RECORD_TOO_LARGE 214
1474#define SSL_R_RECORD_TOO_SMALL 1093
1446#define SSL_R_REQUIRED_CIPHER_MISSING 215
1447#define SSL_R_REUSE_CERT_LENGTH_NOT_ZERO 216
1448#define SSL_R_REUSE_CERT_TYPE_NOT_ZERO 217
1449#define SSL_R_REUSE_CIPHER_LIST_NOT_ZERO 218
1450#define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277
1451#define SSL_R_SHORT_READ 219
1452#define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220
1453#define SSL_R_SSL23_DOING_SESSION_ID_REUSE 221

--- 80 unchanged lines hidden ---
1475#define SSL_R_REQUIRED_CIPHER_MISSING 215
1476#define SSL_R_REUSE_CERT_LENGTH_NOT_ZERO 216
1477#define SSL_R_REUSE_CERT_TYPE_NOT_ZERO 217
1478#define SSL_R_REUSE_CIPHER_LIST_NOT_ZERO 218
1479#define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277
1480#define SSL_R_SHORT_READ 219
1481#define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220
1482#define SSL_R_SSL23_DOING_SESSION_ID_REUSE 221

--- 80 unchanged lines hidden ---