This time, get it right.
[openssl.git] / ssl / s23_lib.c
index ff19adc1191dd0a4482c2dbe632310b393afe817..9222bf86fb041e56ea4795f8f47fd5ce19d3769a 100644 (file)
@@ -1,5 +1,5 @@
 /* ssl/s23_lib.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
  * This package is an SSL implementation written
 static int ssl23_num_ciphers(void );
 static SSL_CIPHER *ssl23_get_cipher(unsigned int u);
 static int ssl23_read(SSL *s, char *buf, int len);
-static int ssl23_write(SSL *s, char *buf, int len);
+static int ssl23_write(SSL *s, const char *buf, int len);
 static long ssl23_default_timeout(void );
-static int ssl23_put_cipher_by_char(SSL_CIPHER *c, unsigned char *p);
-static SSL_CIPHER *ssl23_get_cipher_by_char(unsigned char *p);
+static int ssl23_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p);
+static SSL_CIPHER *ssl23_get_cipher_by_char(const unsigned char *p);
 #else
 static int ssl23_num_ciphers();
 static SSL_CIPHER *ssl23_get_cipher();
@@ -78,20 +78,21 @@ static int ssl23_put_cipher_by_char();
 static SSL_CIPHER *ssl23_get_cipher_by_char();
 #endif
 
-char *SSL23_version_str="SSLv2/3 compatablity part of SSLeay 0.7.0 30-Jan-1997";
+char *SSL23_version_str="SSLv2/3 compatibility part of OpenSSL 0.9.2 31-Dec-1998";
 
 static SSL_METHOD SSLv23_data= {
-       3,
-       ssl3_new,
-       ssl3_clear,
-       ssl3_free,
+       TLS1_VERSION,
+       tls1_new,
+       tls1_clear,
+       tls1_free,
        ssl_undefined_function,
        ssl_undefined_function,
        ssl23_read,
-       ssl_undefined_function,
+       (int (*)())ssl_undefined_function,
        ssl23_write,
        ssl_undefined_function,
        ssl_undefined_function,
+       ssl_ok,
        ssl3_ctrl,
        ssl3_ctx_ctrl,
        ssl23_get_cipher_by_char,
@@ -101,6 +102,7 @@ static SSL_METHOD SSLv23_data= {
        ssl23_get_cipher,
        ssl_bad_method,
        ssl23_default_timeout,
+       &ssl3_undef_enc_method,
        };
 
 static long ssl23_default_timeout()
@@ -132,7 +134,7 @@ unsigned int u;
 /* This function needs to check if the ciphers required are actually
  * available */
 static SSL_CIPHER *ssl23_get_cipher_by_char(p)
-unsigned char *p;
+const unsigned char *p;
        {
        SSL_CIPHER c,*cp;
        unsigned long id;
@@ -149,7 +151,7 @@ unsigned char *p;
        }
 
 static int ssl23_put_cipher_by_char(c,p)
-SSL_CIPHER *c;
+const SSL_CIPHER *c;
 unsigned char *p;
        {
        long l;
@@ -179,7 +181,7 @@ int len;
                return(0);
                }
 #endif
-       errno=0;
+       clear_sys_error();
        if (SSL_in_init(s) && (!s->in_handshake))
                {
                n=s->handshake_func(s);
@@ -200,7 +202,7 @@ int len;
 
 static int ssl23_write(s,buf,len)
 SSL *s;
-char *buf;
+const char *buf;
 int len;
        {
        int n;
@@ -212,7 +214,7 @@ int len;
                return(0);
                }
 #endif
-       errno=0;
+       clear_sys_error();
        if (SSL_in_init(s) && (!s->in_handshake))
                {
                n=s->handshake_func(s);