#include "e_os.h"
#include "buffer.h"
+#include "comp.h"
#include "bio.h"
#include "crypto.h"
#include "evp.h"
#include "err.h"
#include "ssl.h"
+#define PKCS1_CHECK
#define c2l(c,l) (l = ((unsigned long)(*((c)++))) , \
l|=(((unsigned long)(*((c)++)))<< 8), \
} \
}
-#define n2s(c,s) (s =((unsigned int)(*((c)++)))<< 8, \
- s|=((unsigned int)(*((c)++))))
-#define s2n(s,c) (*((c)++)=(unsigned char)(((s)>> 8)&0xff), \
- *((c)++)=(unsigned char)(((s) )&0xff))
+#define n2s(c,s) ((s=(((unsigned int)(c[0]))<< 8)| \
+ (((unsigned int)(c[1])) )),c+=2)
+#define s2n(s,c) ((c[0]=(unsigned char)(((s)>> 8)&0xff), \
+ c[1]=(unsigned char)(((s) )&0xff)),c+=2)
-#define n2l3(c,l) (l =((unsigned long)(*((c)++)))<<16, \
- l|=((unsigned long)(*((c)++)))<< 8, \
- l|=((unsigned long)(*((c)++))))
+#define n2l3(c,l) ((l =(((unsigned long)(c[0]))<<16)| \
+ (((unsigned long)(c[1]))<< 8)| \
+ (((unsigned long)(c[2])) )),c+=3)
-#define l2n3(l,c) (*((c)++)=(unsigned char)(((l)>>16)&0xff), \
- *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
- *((c)++)=(unsigned char)(((l) )&0xff))
+#define l2n3(l,c) ((c[0]=(unsigned char)(((l)>>16)&0xff), \
+ c[1]=(unsigned char)(((l)>> 8)&0xff), \
+ c[2]=(unsigned char)(((l) )&0xff)),c+=3)
/* LOCAL STUFF */
int (*alert_value)();
} SSL3_ENC_METHOD;
+/* Used for holding the relevant compression methods loaded into SSL_CTX */
+typedef struct ssl3_comp_st
+ {
+ int comp_id; /* The identifer byte for this compression type */
+ char *name; /* Text name used for the compression type */
+ COMP_METHOD *method; /* The method :-) */
+ } SSL3_COMP;
+
extern SSL3_ENC_METHOD ssl3_undef_enc_method;
extern SSL_CIPHER ssl2_ciphers[];
extern SSL_CIPHER ssl3_ciphers[];
void ssl2_generate_key_material(SSL *s);
void ssl2_enc(SSL *s,int send_data);
void ssl2_mac(SSL *s,unsigned char *mac,int send_data);
-SSL_CIPHER *ssl2_get_cipher_by_char(unsigned char *p);
-int ssl2_put_cipher_by_char(SSL_CIPHER *c,unsigned char *p);
+SSL_CIPHER *ssl2_get_cipher_by_char(const unsigned char *p);
+int ssl2_put_cipher_by_char(const SSL_CIPHER *c,unsigned char *p);
int ssl2_part_read(SSL *s, unsigned long f, int i);
int ssl2_do_write(SSL *s);
int ssl2_set_certificate(SSL *s, int type, int len, unsigned char *data);
int ssl2_connect(SSL *s);
int ssl2_read(SSL *s, char *buf, int len);
int ssl2_peek(SSL *s, char *buf, int len);
-int ssl2_write(SSL *s, char *buf, int len);
+int ssl2_write(SSL *s, const char *buf, int len);
int ssl2_shutdown(SSL *s);
void ssl2_clear(SSL *s);
long ssl2_ctrl(SSL *s,int cmd, long larg, char *parg);
long ssl2_ctx_ctrl(SSL_CTX *s,int cmd, long larg, char *parg);
int ssl2_pending(SSL *s);
-SSL_CIPHER *ssl3_get_cipher_by_char(unsigned char *p);
-int ssl3_put_cipher_by_char(SSL_CIPHER *c,unsigned char *p);
+SSL_CIPHER *ssl3_get_cipher_by_char(const unsigned char *p);
+int ssl3_put_cipher_by_char(const SSL_CIPHER *c,unsigned char *p);
void ssl3_init_finished_mac(SSL *s);
int ssl3_send_server_certificate(SSL *s);
int ssl3_get_finished(SSL *s,int state_a,int state_b);
int ssl3_connect(SSL *s);
int ssl3_read(SSL *s, char *buf, int len);
int ssl3_peek(SSL *s,char *buf, int len);
-int ssl3_write(SSL *s, char *buf, int len);
+int ssl3_write(SSL *s, const char *buf, int len);
int ssl3_shutdown(SSL *s);
void ssl3_clear(SSL *s);
long ssl3_ctrl(SSL *s,int cmd, long larg, char *parg);
long tls1_ctrl(SSL *s,int cmd, long larg, char *parg);
SSL_METHOD *tlsv1_base_method(void );
-
int ssl_init_wbio_buffer(SSL *s, int push);
int tls1_change_cipher_state(SSL *s, int which);
unsigned char *p, int len);
int tls1_alert_code(int code);
int ssl3_alert_code(int code);
+int ssl_ok(SSL *s);
#else
#endif
#endif
+int ssl3_cert_verify_mac();
+int ssl3_alert_code();
+int tls1_new();
+void tls1_free();
+void tls1_clear();
+long tls1_ctrl();
+SSL_METHOD *tlsv1_base_method();
+int tls1_change_cipher_state();
+int tls1_setup_key_block();
+int tls1_enc();
+int tls1_final_finish_mac();
+int tls1_cert_verify_mac();
+int tls1_mac();
+int tls1_generate_master_secret();
+int tls1_alert_code();
+int ssl_ok();