Apply Lutz Behnke's 56 bit cipher patch with a few
[openssl.git] / ssl / bio_ssl.c
index ed08327228d8251fd64f00597f6bc0b75b4ad41f..aa296996e665254e5ce094367caf0e1897b812d2 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
-#include "crypto.h"
-#include "bio.h"
-#include "err.h"
-#include "ssl.h"
+#include <openssl/crypto.h>
+#include <openssl/bio.h>
+#include <openssl/err.h>
+#include <openssl/ssl.h>
 
 
-#ifndef NOPROTO
 static int ssl_write(BIO *h,char *buf,int num);
 static int ssl_read(BIO *h,char *buf,int size);
 static int ssl_puts(BIO *h,char *str);
 static long ssl_ctrl(BIO *h,int cmd,long arg1,char *arg2);
 static int ssl_new(BIO *h);
 static int ssl_free(BIO *data);
 static int ssl_write(BIO *h,char *buf,int num);
 static int ssl_read(BIO *h,char *buf,int size);
 static int ssl_puts(BIO *h,char *str);
 static long ssl_ctrl(BIO *h,int cmd,long arg1,char *arg2);
 static int ssl_new(BIO *h);
 static int ssl_free(BIO *data);
-#else
-static int ssl_write();
-static int ssl_read();
-static int ssl_puts();
-static long ssl_ctrl();
-static int ssl_new();
-static int ssl_free();
-#endif
-
 typedef struct bio_ssl_st
        {
        SSL *ssl; /* The ssl handle :-) */
 typedef struct bio_ssl_st
        {
        SSL *ssl; /* The ssl handle :-) */
@@ -104,6 +94,12 @@ static BIO_METHOD methods_sslp=
        ssl_free,
        };
 
        ssl_free,
        };
 
+union void_fn_to_char_u
+       {
+       char *char_p;
+       void (*fn_p)();
+       };
+
 BIO_METHOD *BIO_f_ssl(void)
        {
        return(&methods_sslp);
 BIO_METHOD *BIO_f_ssl(void)
        {
        return(&methods_sslp);
@@ -454,7 +450,12 @@ static long ssl_ctrl(BIO *b, int cmd, long num, char *ptr)
                ret=BIO_ctrl(ssl->rbio,cmd,num,ptr);
                break;
        case BIO_CTRL_SET_CALLBACK:
                ret=BIO_ctrl(ssl->rbio,cmd,num,ptr);
                break;
        case BIO_CTRL_SET_CALLBACK:
-               SSL_set_info_callback(ssl,(void (*)())ptr);
+               {
+               union void_fn_to_char_u tmp_cb;
+
+               tmp_cb.char_p = ptr;
+               SSL_set_info_callback(ssl,tmp_cb.fn_p);
+               }
                break;
        case BIO_CTRL_GET_CALLBACK:
                {
                break;
        case BIO_CTRL_GET_CALLBACK:
                {