#ifndef HEADER_SSL_H
#define HEADER_SSL_H
+#ifndef NO_COMP
+#include <openssl/comp.h>
+#endif
+#ifndef NO_BIO
+#include <openssl/bio.h>
+#endif
+#ifndef NO_X509
+#include <openssl/x509.h>
+#endif
#include <openssl/safestack.h>
#ifdef __cplusplus
} SSL_CIPHER;
DECLARE_STACK_OF(SSL_CIPHER)
-/* This block of defines is updated by a perl script, please do not touch! */
-#ifndef DEBUG_SAFESTACK
- #define sk_SSL_CIPHER_new(a) sk_new((int (*) \
- (const char * const *, const char * const *))(a))
- #define sk_SSL_CIPHER_new_null() sk_new_null()
- #define sk_SSL_CIPHER_free(a) sk_free(a)
- #define sk_SSL_CIPHER_num(a) sk_num(a)
- #define sk_SSL_CIPHER_value(a,b) ((SSL_CIPHER *) \
- sk_value((a),(b)))
- #define sk_SSL_CIPHER_set(a,b,c) ((SSL_CIPHER *) \
- sk_set((a),(b),(char *)(c)))
- #define sk_SSL_CIPHER_zero(a) sk_zero(a)
- #define sk_SSL_CIPHER_push(a,b) sk_push((a),(char *)(b))
- #define sk_SSL_CIPHER_unshift(a,b) sk_unshift((a),(b))
- #define sk_SSL_CIPHER_find(a,b) sk_find((a), (char *)(b))
- #define sk_SSL_CIPHER_delete(a,b) ((SSL_CIPHER *) \
- sk_delete((a),(b)))
- #define sk_SSL_CIPHER_delete_ptr(a,b) ((SSL_CIPHER *) \
- sk_delete_ptr((a),(char *)(b)))
- #define sk_SSL_CIPHER_insert(a,b,c) sk_insert((a),(char *)(b),(c))
- #define sk_SSL_CIPHER_set_cmp_func(a,b) ((int (*) \
- (const SSL_CIPHER * const *,const SSL_CIPHER * const *)) \
- sk_set_cmp_func((a),(int (*) \
- (const char * const *, const char * const *))(b)))
- #define sk_SSL_CIPHER_dup(a) sk_dup(a)
- #define sk_SSL_CIPHER_pop_free(a,b) sk_pop_free((a),(void (*)(void *))(b))
- #define sk_SSL_CIPHER_shift(a) ((SSL_CIPHER *)sk_shift(a))
- #define sk_SSL_CIPHER_pop(a) ((SSL_CIPHER *)sk_pop(a))
- #define sk_SSL_CIPHER_sort(a) sk_sort(a)
-#endif /* !DEBUG_SAFESTACK */
-/* End of perl script block, you may now edit :-) */
typedef struct ssl_st SSL;
typedef struct ssl_ctx_st SSL_CTX;
int (*ssl_accept)(SSL *s);
int (*ssl_connect)(SSL *s);
int (*ssl_read)(SSL *s,void *buf,int len);
- int (*ssl_peek)(SSL *s,char *buf,int len);
+ int (*ssl_peek)(SSL *s,void *buf,int len);
int (*ssl_write)(SSL *s,const void *buf,int len);
int (*ssl_shutdown)(SSL *s);
int (*ssl_renegotiate)(SSL *s);
* the misconception that non-blocking SSL_write() behaves like
* non-blocking write(): */
#define SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER 0x00000002L
+/* Never bother the application with retries if the transport
+ * is blocking: */
+#define SSL_MODE_AUTO_RETRY 0x00000004L
/* Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value,
* they cannot be used to clear bits. */
#define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT (1024*20)
typedef struct ssl_comp_st
-{
- int id;
- char *name;
-#ifdef HEADER_COMP_H
- COMP_METHOD *method;
+ {
+ int id;
+ char *name;
+#ifndef NO_COMP
+ COMP_METHOD *method;
#else
- char *method;
+ char *method;
#endif
-} SSL_COMP;
+ } SSL_COMP;
DECLARE_STACK_OF(SSL_COMP)
-/* This block of defines is updated by a perl script, please do not touch! */
-#ifndef DEBUG_SAFESTACK
- #define sk_SSL_COMP_new(a) sk_new((int (*) \
- (const char * const *, const char * const *))(a))
- #define sk_SSL_COMP_new_null() sk_new_null()
- #define sk_SSL_COMP_free(a) sk_free(a)
- #define sk_SSL_COMP_num(a) sk_num(a)
- #define sk_SSL_COMP_value(a,b) ((SSL_COMP *) \
- sk_value((a),(b)))
- #define sk_SSL_COMP_set(a,b,c) ((SSL_COMP *) \
- sk_set((a),(b),(char *)(c)))
- #define sk_SSL_COMP_zero(a) sk_zero(a)
- #define sk_SSL_COMP_push(a,b) sk_push((a),(char *)(b))
- #define sk_SSL_COMP_unshift(a,b) sk_unshift((a),(b))
- #define sk_SSL_COMP_find(a,b) sk_find((a), (char *)(b))
- #define sk_SSL_COMP_delete(a,b) ((SSL_COMP *) \
- sk_delete((a),(b)))
- #define sk_SSL_COMP_delete_ptr(a,b) ((SSL_COMP *) \
- sk_delete_ptr((a),(char *)(b)))
- #define sk_SSL_COMP_insert(a,b,c) sk_insert((a),(char *)(b),(c))
- #define sk_SSL_COMP_set_cmp_func(a,b) ((int (*) \
- (const SSL_COMP * const *,const SSL_COMP * const *)) \
- sk_set_cmp_func((a),(int (*) \
- (const char * const *, const char * const *))(b)))
- #define sk_SSL_COMP_dup(a) sk_dup(a)
- #define sk_SSL_COMP_pop_free(a,b) sk_pop_free((a),(void (*)(void *))(b))
- #define sk_SSL_COMP_shift(a) ((SSL_COMP *)sk_shift(a))
- #define sk_SSL_COMP_pop(a) ((SSL_COMP *)sk_pop(a))
- #define sk_SSL_COMP_sort(a) sk_sort(a)
-#endif /* !DEBUG_SAFESTACK */
-/* End of perl script block, you may now edit :-) */
struct ssl_ctx_st
{
* same. This is so data can be read and written to different
* handlers */
-#ifdef HEADER_BIO_H
+#ifndef NO_BIO
BIO *rbio; /* used by SSL_read */
BIO *wbio; /* used by SSL_write */
- BIO *bbio; /* used during session-id reuse to concatinate
+ BIO *bbio; /* used during session-id reuse to concatenate
* messages */
#else
char *rbio; /* used by SSL_read */
EVP_CIPHER_CTX *enc_read_ctx; /* cryptographic state */
const EVP_MD *read_hash; /* used for mac generation */
-#ifdef HEADER_COMP_H
+#ifndef NO_COMP
COMP_CTX *expand; /* uncompress */
#else
char *expand;
EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */
const EVP_MD *write_hash; /* used for mac generation */
-#ifdef HEADER_COMP_H
+#ifndef NO_COMP
COMP_CTX *compress; /* compression */
#else
char *compress;
#define SSL_add_dir_cert_subjects_to_stack SSL_add_dir_cert_sub_to_stack
#endif
-#ifdef HEADER_BIO_H
+#ifndef NO_BIO
BIO_METHOD *BIO_f_ssl(void);
BIO *BIO_new_ssl(SSL_CTX *ctx,int client);
BIO *BIO_new_ssl_connect(SSL_CTX *ctx);
int SSL_set_rfd(SSL *s, int fd);
int SSL_set_wfd(SSL *s, int fd);
#endif
-#ifdef HEADER_BIO_H
+#ifndef NO_BIO
void SSL_set_bio(SSL *s, BIO *rbio,BIO *wbio);
BIO * SSL_get_rbio(SSL *s);
BIO * SSL_get_wbio(SSL *s);
#ifndef NO_FP_API
int SSL_SESSION_print_fp(FILE *fp,SSL_SESSION *ses);
#endif
-#ifdef HEADER_BIO_H
+#ifndef NO_BIO
int SSL_SESSION_print(BIO *fp,SSL_SESSION *ses);
#endif
void SSL_SESSION_free(SSL_SESSION *ses);
void SSL_free(SSL *ssl);
int SSL_accept(SSL *ssl);
int SSL_connect(SSL *ssl);
-int SSL_read(SSL *ssl,char *buf,int num);
-int SSL_peek(SSL *ssl,char *buf,int num);
-int SSL_write(SSL *ssl,const char *buf,int num);
+int SSL_read(SSL *ssl,void *buf,int num);
+int SSL_peek(SSL *ssl,void *buf,int num);
+int SSL_write(SSL *ssl,const void *buf,int num);
long SSL_ctrl(SSL *ssl,int cmd, long larg, char *parg);
long SSL_callback_ctrl(SSL *, int, void (*)());
long SSL_CTX_ctrl(SSL_CTX *ctx,int cmd, long larg, char *parg);
#define SSL_CTX_get_read_ahead(ctx) \
SSL_CTX_ctrl(ctx,SSL_CTRL_GET_READ_AHEAD,0,NULL)
#define SSL_CTX_set_read_ahead(ctx,m) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,0,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,m,NULL)
/* NB: the keylength is only applicable when is_export is true */
#ifndef NO_RSA
int keylength));
#endif
-#ifdef HEADER_COMP_H
+#ifndef NO_COMP
int SSL_COMP_add_compression_method(int id,COMP_METHOD *cm);
#else
int SSL_COMP_add_compression_method(int id,char *cm);
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
+void ERR_load_SSL_strings(void);
/* Error codes for the SSL functions. */
#define SSL_F_SSL23_CONNECT 117
#define SSL_F_SSL23_GET_CLIENT_HELLO 118
#define SSL_F_SSL23_GET_SERVER_HELLO 119
+#define SSL_F_SSL23_PEEK 237
#define SSL_F_SSL23_READ 120
#define SSL_F_SSL23_WRITE 121
#define SSL_F_SSL2_ACCEPT 122
#define SSL_F_SSL2_CONNECT 123
#define SSL_F_SSL2_ENC_INIT 124
+#define SSL_F_SSL2_PEEK 234
#define SSL_F_SSL2_READ 125
+#define SSL_F_SSL2_READ_INTERNAL 236
#define SSL_F_SSL2_SET_CERTIFICATE 126
#define SSL_F_SSL2_WRITE 127
#define SSL_F_SSL3_ACCEPT 128
#define SSL_F_SSL3_GET_SERVER_DONE 145
#define SSL_F_SSL3_GET_SERVER_HELLO 146
#define SSL_F_SSL3_OUTPUT_CERT_CHAIN 147
+#define SSL_F_SSL3_PEEK 235
#define SSL_F_SSL3_READ_BYTES 148
#define SSL_F_SSL3_READ_N 149
#define SSL_F_SSL3_SEND_CERTIFICATE_REQUEST 150
#define SSL_R_READ_WRONG_PACKET_TYPE 212
#define SSL_R_RECORD_LENGTH_MISMATCH 213
#define SSL_R_RECORD_TOO_LARGE 214
+#define SSL_R_RECORD_TOO_SMALL 1093
#define SSL_R_REQUIRED_CIPHER_MISSING 215
#define SSL_R_REUSE_CERT_LENGTH_NOT_ZERO 216
#define SSL_R_REUSE_CERT_TYPE_NOT_ZERO 217
}
#endif
#endif
-