Fix invalid function type casts.
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 15 Dec 2017 18:33:48 +0000 (19:33 +0100)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 15 Dec 2017 18:33:48 +0000 (19:33 +0100)
Rename bio_info_cb to BIO_info_cb.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4493)

25 files changed:
crypto/asn1/bio_asn1.c
crypto/bio/bf_buff.c
crypto/bio/bf_lbuf.c
crypto/bio/bf_nbio.c
crypto/bio/bf_null.c
crypto/bio/bio_lib.c
crypto/bio/bio_meth.c
crypto/bio/bss_conn.c
crypto/comp/c_zlib.c
crypto/evp/bio_b64.c
crypto/evp/bio_enc.c
crypto/evp/bio_md.c
crypto/evp/bio_ok.c
doc/man3/BIO_ctrl.pod
doc/man3/BIO_meth_new.pod
include/internal/bio.h
include/openssl/bio.h
ssl/bio_ssl.c
ssl/s3_lib.c
ssl/ssl_lib.c
test/ossl_shim/async_bio.cc
test/ossl_shim/packeted_bio.cc
test/testutil/tap_bio.c
util/indent.pro
util/private.num

index a8cbb6a99df867cc82ec90d48adaff59fd3fe58e..3c7c12291bb48960be41abdf65ac3e04a2940908 100644 (file)
@@ -66,7 +66,7 @@ static int asn1_bio_gets(BIO *h, char *str, int size);
 static long asn1_bio_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int asn1_bio_new(BIO *h);
 static int asn1_bio_free(BIO *data);
 static long asn1_bio_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int asn1_bio_new(BIO *h);
 static int asn1_bio_free(BIO *data);
-static long asn1_bio_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
+static long asn1_bio_callback_ctrl(BIO *h, int cmd, BIO_info_cb *fp);
 
 static int asn1_bio_init(BIO_ASN1_BUF_CTX *ctx, int size);
 static int asn1_bio_flush_ex(BIO *b, BIO_ASN1_BUF_CTX *ctx,
 
 static int asn1_bio_init(BIO_ASN1_BUF_CTX *ctx, int size);
 static int asn1_bio_flush_ex(BIO *b, BIO_ASN1_BUF_CTX *ctx,
@@ -307,7 +307,7 @@ static int asn1_bio_gets(BIO *b, char *str, int size)
     return BIO_gets(next, str, size);
 }
 
     return BIO_gets(next, str, size);
 }
 
-static long asn1_bio_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
+static long asn1_bio_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
 {
     BIO *next = BIO_next(b);
     if (next == NULL)
 {
     BIO *next = BIO_next(b);
     if (next == NULL)
index b90023ae2f20aaefb7b1fa75e4ed445fe70e3de6..8e87a629b8b5422ee6a8de2975199e3208034057 100644 (file)
@@ -19,7 +19,7 @@ static int buffer_gets(BIO *h, char *str, int size);
 static long buffer_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int buffer_new(BIO *h);
 static int buffer_free(BIO *data);
 static long buffer_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int buffer_new(BIO *h);
 static int buffer_free(BIO *data);
-static long buffer_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
+static long buffer_callback_ctrl(BIO *h, int cmd, BIO_info_cb *fp);
 #define DEFAULT_BUFFER_SIZE     4096
 
 static const BIO_METHOD methods_buffer = {
 #define DEFAULT_BUFFER_SIZE     4096
 
 static const BIO_METHOD methods_buffer = {
@@ -408,7 +408,7 @@ static long buffer_ctrl(BIO *b, int cmd, long num, void *ptr)
     return 0;
 }
 
     return 0;
 }
 
-static long buffer_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
+static long buffer_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
 {
     long ret = 1;
 
 {
     long ret = 1;
 
index f3b91d96605dadf83ab036d2ccf53b4dbb6ba417..812ed3f4529dbbfa509e0b0600ec47b2e6e206ce 100644 (file)
@@ -20,7 +20,7 @@ static int linebuffer_gets(BIO *h, char *str, int size);
 static long linebuffer_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int linebuffer_new(BIO *h);
 static int linebuffer_free(BIO *data);
 static long linebuffer_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int linebuffer_new(BIO *h);
 static int linebuffer_free(BIO *data);
-static long linebuffer_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
+static long linebuffer_callback_ctrl(BIO *h, int cmd, BIO_info_cb *fp);
 
 /* A 10k maximum should be enough for most purposes */
 #define DEFAULT_LINEBUFFER_SIZE 1024*10
 
 /* A 10k maximum should be enough for most purposes */
 #define DEFAULT_LINEBUFFER_SIZE 1024*10
@@ -296,7 +296,7 @@ static long linebuffer_ctrl(BIO *b, int cmd, long num, void *ptr)
     return 0;
 }
 
     return 0;
 }
 
-static long linebuffer_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
+static long linebuffer_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
 {
     long ret = 1;
 
 {
     long ret = 1;
 
index 1853cb1049d078e1e31522f42e104ed53f611dec..c41b5d58dc5abd695125078265e039572ce65410 100644 (file)
@@ -24,7 +24,7 @@ static int nbiof_gets(BIO *h, char *str, int size);
 static long nbiof_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int nbiof_new(BIO *h);
 static int nbiof_free(BIO *data);
 static long nbiof_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int nbiof_new(BIO *h);
 static int nbiof_free(BIO *data);
-static long nbiof_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
+static long nbiof_callback_ctrl(BIO *h, int cmd, BIO_info_cb *fp);
 typedef struct nbio_test_st {
     /* only set if we sent a 'should retry' error */
     int lrn;
 typedef struct nbio_test_st {
     /* only set if we sent a 'should retry' error */
     int lrn;
@@ -169,7 +169,7 @@ static long nbiof_ctrl(BIO *b, int cmd, long num, void *ptr)
     return ret;
 }
 
     return ret;
 }
 
-static long nbiof_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
+static long nbiof_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
 {
     long ret = 1;
 
 {
     long ret = 1;
 
index 574fe22884adf24b2c09d1124b98aedd6555a853..df4e51133fcaf84af28ace89d3e9e815d006ace5 100644 (file)
@@ -23,7 +23,7 @@ static int nullf_gets(BIO *h, char *str, int size);
 static long nullf_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int nullf_new(BIO *h);
 static int nullf_free(BIO *data);
 static long nullf_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int nullf_new(BIO *h);
 static int nullf_free(BIO *data);
-static long nullf_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
+static long nullf_callback_ctrl(BIO *h, int cmd, BIO_info_cb *fp);
 static const BIO_METHOD methods_nullf = {
     BIO_TYPE_NULL_FILTER,
     "NULL filter",
 static const BIO_METHOD methods_nullf = {
     BIO_TYPE_NULL_FILTER,
     "NULL filter",
@@ -115,7 +115,7 @@ static long nullf_ctrl(BIO *b, int cmd, long num, void *ptr)
     return ret;
 }
 
     return ret;
 }
 
-static long nullf_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
+static long nullf_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
 {
     long ret = 1;
 
 {
     long ret = 1;
 
index 3e90f8cfcb9cbc014e7d53cd8f4713e65a6ee1d1..8a2ec0ee69a0a3485a82e74a36db9c7f3269c061 100644 (file)
@@ -533,9 +533,7 @@ long BIO_ctrl(BIO *b, int cmd, long larg, void *parg)
     return ret;
 }
 
     return ret;
 }
 
-long BIO_callback_ctrl(BIO *b, int cmd,
-                       void (*fp) (struct bio_st *, int, const char *, int,
-                                   long, long))
+long BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
 {
     long ret;
 
 {
     long ret;
 
index 99e81c7cadd6f28a528b78151bec13d23718cbb9..955be84e4105318df76280718a55d82607a219ff 100644 (file)
@@ -200,14 +200,14 @@ int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy) (BIO *))
     return 1;
 }
 
     return 1;
 }
 
-long (*BIO_meth_get_callback_ctrl(BIO_METHOD *biom)) (BIO *, int, bio_info_cb *)
+long (*BIO_meth_get_callback_ctrl(BIO_METHOD *biom)) (BIO *, int, BIO_info_cb *)
 {
     return biom->callback_ctrl;
 }
 
 int BIO_meth_set_callback_ctrl(BIO_METHOD *biom,
                                long (*callback_ctrl) (BIO *, int,
 {
     return biom->callback_ctrl;
 }
 
 int BIO_meth_set_callback_ctrl(BIO_METHOD *biom,
                                long (*callback_ctrl) (BIO *, int,
-                                                      bio_info_cb *))
+                                                      BIO_info_cb *))
 {
     biom->callback_ctrl = callback_ctrl;
     return 1;
 {
     biom->callback_ctrl = callback_ctrl;
     return 1;
index 0ead113cad3c2a7d89f242823344df01f55e247f..78e42d0525a2556cfce7433d4e2e5f4e546917cb 100644 (file)
@@ -32,7 +32,7 @@ typedef struct bio_connect_st {
      * The callback should return 'ret'.  state is for compatibility with the
      * ssl info_callback
      */
      * The callback should return 'ret'.  state is for compatibility with the
      * ssl info_callback
      */
-    int (*info_callback) (const BIO *bio, int state, int ret);
+    BIO_info_cb *info_callback;
 } BIO_CONNECT;
 
 static int conn_write(BIO *h, const char *buf, int num);
 } BIO_CONNECT;
 
 static int conn_write(BIO *h, const char *buf, int num);
@@ -41,7 +41,7 @@ static int conn_puts(BIO *h, const char *str);
 static long conn_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int conn_new(BIO *h);
 static int conn_free(BIO *data);
 static long conn_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int conn_new(BIO *h);
 static int conn_free(BIO *data);
-static long conn_callback_ctrl(BIO *h, int cmd, bio_info_cb *);
+static long conn_callback_ctrl(BIO *h, int cmd, BIO_info_cb *);
 
 static int conn_state(BIO *b, BIO_CONNECT *c);
 static void conn_close_socket(BIO *data);
 
 static int conn_state(BIO *b, BIO_CONNECT *c);
 static void conn_close_socket(BIO *data);
@@ -75,7 +75,7 @@ static const BIO_METHOD methods_connectp = {
 static int conn_state(BIO *b, BIO_CONNECT *c)
 {
     int ret = -1, i;
 static int conn_state(BIO *b, BIO_CONNECT *c)
 {
     int ret = -1, i;
-    int (*cb) (const BIO *, int, int) = NULL;
+    BIO_info_cb *cb = NULL;
 
     if (c->info_callback != NULL)
         cb = c->info_callback;
 
     if (c->info_callback != NULL)
         cb = c->info_callback;
@@ -473,8 +473,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr)
              * FIXME: the cast of the function seems unlikely to be a good
              * idea
              */
              * FIXME: the cast of the function seems unlikely to be a good
              * idea
              */
-            (void)BIO_set_info_callback(dbio,
-                                        (bio_info_cb *)data->info_callback);
+            (void)BIO_set_info_callback(dbio, data->info_callback);
         }
         break;
     case BIO_CTRL_SET_CALLBACK:
         }
         break;
     case BIO_CTRL_SET_CALLBACK:
@@ -482,9 +481,9 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr)
         break;
     case BIO_CTRL_GET_CALLBACK:
         {
         break;
     case BIO_CTRL_GET_CALLBACK:
         {
-            int (**fptr) (const BIO *bio, int state, int xret);
+            BIO_info_cb **fptr;
 
 
-            fptr = (int (**)(const BIO *bio, int state, int xret))ptr;
+            fptr = (BIO_info_cb **)ptr;
             *fptr = data->info_callback;
         }
         break;
             *fptr = data->info_callback;
         }
         break;
@@ -495,7 +494,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr)
     return ret;
 }
 
     return ret;
 }
 
-static long conn_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
+static long conn_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
 {
     long ret = 1;
     BIO_CONNECT *data;
 {
     long ret = 1;
     BIO_CONNECT *data;
@@ -505,8 +504,7 @@ static long conn_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
     switch (cmd) {
     case BIO_CTRL_SET_CALLBACK:
         {
     switch (cmd) {
     case BIO_CTRL_SET_CALLBACK:
         {
-            data->info_callback =
-                (int (*)(const struct bio_st *, int, int))fp;
+            data->info_callback = fp;
         }
         break;
     default:
         }
         break;
     default:
index 05787aa394d3fbcc71df6a265c029fb2bbc1521a..5d82e15979bdd8fa6348287a612b44b8b8b3555e 100644 (file)
@@ -291,7 +291,7 @@ static int bio_zlib_free(BIO *bi);
 static int bio_zlib_read(BIO *b, char *out, int outl);
 static int bio_zlib_write(BIO *b, const char *in, int inl);
 static long bio_zlib_ctrl(BIO *b, int cmd, long num, void *ptr);
 static int bio_zlib_read(BIO *b, char *out, int outl);
 static int bio_zlib_write(BIO *b, const char *in, int inl);
 static long bio_zlib_ctrl(BIO *b, int cmd, long num, void *ptr);
-static long bio_zlib_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp);
+static long bio_zlib_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp);
 
 static const BIO_METHOD bio_meth_zlib = {
     BIO_TYPE_COMP,
 
 static const BIO_METHOD bio_meth_zlib = {
     BIO_TYPE_COMP,
@@ -607,7 +607,7 @@ static long bio_zlib_ctrl(BIO *b, int cmd, long num, void *ptr)
     return ret;
 }
 
     return ret;
 }
 
-static long bio_zlib_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
+static long bio_zlib_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
 {
     BIO *next = BIO_next(b);
     if (next == NULL)
 {
     BIO *next = BIO_next(b);
     if (next == NULL)
index 87a0cce0f687f1d61d90316060dc16cb03aced57..cade6f8f95d88ff2e2564d0e8548a77b18fcf003 100644 (file)
@@ -20,7 +20,7 @@ static int b64_puts(BIO *h, const char *str);
 static long b64_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int b64_new(BIO *h);
 static int b64_free(BIO *data);
 static long b64_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int b64_new(BIO *h);
 static int b64_free(BIO *data);
-static long b64_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
+static long b64_callback_ctrl(BIO *h, int cmd, BIO_info_cb *fp);
 #define B64_BLOCK_SIZE  1024
 #define B64_BLOCK_SIZE2 768
 #define B64_NONE        0
 #define B64_BLOCK_SIZE  1024
 #define B64_BLOCK_SIZE2 768
 #define B64_NONE        0
@@ -523,7 +523,7 @@ static long b64_ctrl(BIO *b, int cmd, long num, void *ptr)
     return ret;
 }
 
     return ret;
 }
 
-static long b64_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
+static long b64_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
 {
     long ret = 1;
     BIO *next = BIO_next(b);
 {
     long ret = 1;
     BIO *next = BIO_next(b);
index 366e2e928b51e62058432bfe0bc2e347112ff633..30f09e6d5fdc559a98fcffde4935fdddf256923b 100644 (file)
@@ -19,7 +19,7 @@ static int enc_read(BIO *h, char *buf, int size);
 static long enc_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int enc_new(BIO *h);
 static int enc_free(BIO *data);
 static long enc_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int enc_new(BIO *h);
 static int enc_free(BIO *data);
-static long enc_callback_ctrl(BIO *h, int cmd, bio_info_cb *fps);
+static long enc_callback_ctrl(BIO *h, int cmd, BIO_info_cb *fps);
 #define ENC_BLOCK_SIZE  (1024*4)
 #define ENC_MIN_CHUNK   (256)
 #define BUF_OFFSET      (ENC_MIN_CHUNK + EVP_MAX_BLOCK_LENGTH)
 #define ENC_BLOCK_SIZE  (1024*4)
 #define ENC_MIN_CHUNK   (256)
 #define BUF_OFFSET      (ENC_MIN_CHUNK + EVP_MAX_BLOCK_LENGTH)
@@ -385,7 +385,7 @@ static long enc_ctrl(BIO *b, int cmd, long num, void *ptr)
     return ret;
 }
 
     return ret;
 }
 
-static long enc_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
+static long enc_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
 {
     long ret = 1;
     BIO *next = BIO_next(b);
 {
     long ret = 1;
     BIO *next = BIO_next(b);
index 50069f0b610a9f45808eb6638bf8393e7cc2d7d9..288dee01b2203ced5b328a729c4e467d32b0df3f 100644 (file)
@@ -26,7 +26,7 @@ static int md_gets(BIO *h, char *str, int size);
 static long md_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int md_new(BIO *h);
 static int md_free(BIO *data);
 static long md_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int md_new(BIO *h);
 static int md_free(BIO *data);
-static long md_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
+static long md_callback_ctrl(BIO *h, int cmd, BIO_info_cb *fp);
 
 static const BIO_METHOD methods_md = {
     BIO_TYPE_MD,
 
 static const BIO_METHOD methods_md = {
     BIO_TYPE_MD,
@@ -198,7 +198,7 @@ static long md_ctrl(BIO *b, int cmd, long num, void *ptr)
     return ret;
 }
 
     return ret;
 }
 
-static long md_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
+static long md_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
 {
     long ret = 1;
     BIO *next;
 {
     long ret = 1;
     BIO *next;
index 0f744fc72e08bfba42ad9cdd09fcf8432913aeab..5871e632b52eefa633e7133fbe19faf5880f44dd 100644 (file)
@@ -83,7 +83,7 @@ static int ok_read(BIO *h, char *buf, int size);
 static long ok_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int ok_new(BIO *h);
 static int ok_free(BIO *data);
 static long ok_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int ok_new(BIO *h);
 static int ok_free(BIO *data);
-static long ok_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
+static long ok_callback_ctrl(BIO *h, int cmd, BIO_info_cb *fp);
 
 static __owur int sig_out(BIO *b);
 static __owur int sig_in(BIO *b);
 
 static __owur int sig_out(BIO *b);
 static __owur int sig_in(BIO *b);
@@ -403,7 +403,7 @@ static long ok_ctrl(BIO *b, int cmd, long num, void *ptr)
     return ret;
 }
 
     return ret;
 }
 
-static long ok_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
+static long ok_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
 {
     long ret = 1;
     BIO *next;
 {
     long ret = 1;
     BIO *next;
index 5aef75a82bf6a738a7a29adf279e14caa7ad3f36..60cd10883b54316778cb7c3e266eaf9561aade8e 100644 (file)
@@ -5,18 +5,17 @@
 BIO_ctrl, BIO_callback_ctrl, BIO_ptr_ctrl, BIO_int_ctrl, BIO_reset,
 BIO_seek, BIO_tell, BIO_flush, BIO_eof, BIO_set_close, BIO_get_close,
 BIO_pending, BIO_wpending, BIO_ctrl_pending, BIO_ctrl_wpending,
 BIO_ctrl, BIO_callback_ctrl, BIO_ptr_ctrl, BIO_int_ctrl, BIO_reset,
 BIO_seek, BIO_tell, BIO_flush, BIO_eof, BIO_set_close, BIO_get_close,
 BIO_pending, BIO_wpending, BIO_ctrl_pending, BIO_ctrl_wpending,
-BIO_get_info_callback, BIO_set_info_callback, bio_info_cb
+BIO_get_info_callback, BIO_set_info_callback, BIO_info_cb
 - BIO control operations
 
 =head1 SYNOPSIS
 
  #include <openssl/bio.h>
 
 - BIO control operations
 
 =head1 SYNOPSIS
 
  #include <openssl/bio.h>
 
- typedef void bio_info_cb(BIO *b, int oper, const char *ptr,
-                          int arg1, long arg2, long arg3);
+ typedef int BIO_info_cb(BIO *b, int state, int res);
 
  long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg);
 
  long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg);
- long BIO_callback_ctrl(BIO *b, int cmd, bio_info_cb *cb);
+ long BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *cb);
  char *BIO_ptr_ctrl(BIO *bp, int cmd, long larg);
  long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg);
 
  char *BIO_ptr_ctrl(BIO *bp, int cmd, long larg);
  long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg);
 
@@ -32,8 +31,8 @@ BIO_get_info_callback, BIO_set_info_callback, bio_info_cb
  size_t BIO_ctrl_pending(BIO *b);
  size_t BIO_ctrl_wpending(BIO *b);
 
  size_t BIO_ctrl_pending(BIO *b);
  size_t BIO_ctrl_wpending(BIO *b);
 
- int BIO_get_info_callback(BIO *b, bio_info_cb **cbp);
- int BIO_set_info_callback(BIO *b, bio_info_cb *cb);
+ int BIO_get_info_callback(BIO *b, BIO_info_cb **cbp);
+ int BIO_set_info_callback(BIO *b, BIO_info_cb *cb);
 
 =head1 DESCRIPTION
 
 
 =head1 DESCRIPTION
 
index 5617d099f22ca24ca887a6738395a473b15e086d..c86568365ea6b7241a05b444f95da7fdf046af65 100644 (file)
@@ -52,9 +52,9 @@ BIO_meth_set_callback_ctrl - Routines to build up BIO methods
  int (*BIO_meth_get_destroy(BIO_METHOD *biom))(BIO *);
  int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy)(BIO *));
 
  int (*BIO_meth_get_destroy(BIO_METHOD *biom))(BIO *);
  int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy)(BIO *));
 
- long (*BIO_meth_get_callback_ctrl(BIO_METHOD *biom))(BIO *, int, bio_info_cb *);
+ long (*BIO_meth_get_callback_ctrl(BIO_METHOD *biom))(BIO *, int, BIO_info_cb *);
  int BIO_meth_set_callback_ctrl(BIO_METHOD *biom,
  int BIO_meth_set_callback_ctrl(BIO_METHOD *biom,
-                                long (*callback_ctrl)(BIO *, int, bio_info_cb *));
+                                long (*callback_ctrl)(BIO *, int, BIO_info_cb *));
 
 =head1 DESCRIPTION
 
 
 =head1 DESCRIPTION
 
index f02d74115f45c91ffceab5185e46a3651fb2efb3..4428947f2d1e2c0deeb0d6f1c22a61958114cf98 100644 (file)
@@ -21,7 +21,7 @@ struct bio_method_st {
     long (*ctrl) (BIO *, int, long, void *);
     int (*create) (BIO *);
     int (*destroy) (BIO *);
     long (*ctrl) (BIO *, int, long, void *);
     int (*create) (BIO *);
     int (*destroy) (BIO *);
-    long (*callback_ctrl) (BIO *, int, bio_info_cb *);
+    long (*callback_ctrl) (BIO *, int, BIO_info_cb *);
 };
 
 void bio_free_ex_data(BIO *bio);
 };
 
 void bio_free_ex_data(BIO *bio);
index 75aa88442c8c282d6a6c21bd89fc630ed05af5e1..54a833c275577af028cf2fed828daa395a0f97b1 100644 (file)
@@ -255,7 +255,8 @@ typedef struct bio_method_st BIO_METHOD;
 const char *BIO_method_name(const BIO *b);
 int BIO_method_type(const BIO *b);
 
 const char *BIO_method_name(const BIO *b);
 int BIO_method_type(const BIO *b);
 
-typedef void bio_info_cb(BIO *, int, const char *, int, long, long);
+typedef int BIO_info_cb(BIO *, int, int);
+typedef BIO_info_cb bio_info_cb;  /* backward compatibility */
 
 DEFINE_STACK_OF(BIO)
 
 
 DEFINE_STACK_OF(BIO)
 
@@ -566,8 +567,7 @@ int BIO_write_ex(BIO *b, const void *data, size_t dlen, size_t *written);
 int BIO_puts(BIO *bp, const char *buf);
 int BIO_indent(BIO *b, int indent, int max);
 long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg);
 int BIO_puts(BIO *bp, const char *buf);
 int BIO_indent(BIO *b, int indent, int max);
 long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg);
-long BIO_callback_ctrl(BIO *b, int cmd,
-                       void (*fp) (BIO *, int, const char *, int, long, long));
+long BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp);
 void *BIO_ptr_ctrl(BIO *bp, int cmd, long larg);
 long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg);
 BIO *BIO_push(BIO *b, BIO *append);
 void *BIO_ptr_ctrl(BIO *bp, int cmd, long larg);
 long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg);
 BIO *BIO_push(BIO *b, BIO *append);
@@ -785,10 +785,10 @@ int BIO_meth_set_create(BIO_METHOD *biom, int (*create) (BIO *));
 int (*BIO_meth_get_destroy(BIO_METHOD *biom)) (BIO *);
 int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy) (BIO *));
 long (*BIO_meth_get_callback_ctrl(BIO_METHOD *biom))
 int (*BIO_meth_get_destroy(BIO_METHOD *biom)) (BIO *);
 int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy) (BIO *));
 long (*BIO_meth_get_callback_ctrl(BIO_METHOD *biom))
-                                 (BIO *, int, bio_info_cb *);
+                                 (BIO *, int, BIO_info_cb *);
 int BIO_meth_set_callback_ctrl(BIO_METHOD *biom,
                                long (*callback_ctrl) (BIO *, int,
 int BIO_meth_set_callback_ctrl(BIO_METHOD *biom,
                                long (*callback_ctrl) (BIO *, int,
-                                                      bio_info_cb *));
+                                                      BIO_info_cb *));
 int ERR_load_BIO_strings(void);
 
 # ifdef  __cplusplus
 int ERR_load_BIO_strings(void);
 
 # ifdef  __cplusplus
index 5516260409fecc79666680a33856127f79df38b7..ccc0c769c5e0993b852a6f503e55a1d91b7121e7 100644 (file)
@@ -22,7 +22,7 @@ static int ssl_puts(BIO *h, const char *str);
 static long ssl_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int ssl_new(BIO *h);
 static int ssl_free(BIO *data);
 static long ssl_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int ssl_new(BIO *h);
 static int ssl_free(BIO *data);
-static long ssl_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
+static long ssl_callback_ctrl(BIO *h, int cmd, BIO_info_cb *fp);
 typedef struct bio_ssl_st {
     SSL *ssl;                   /* The ssl handle :-) */
     /* re-negotiate every time the total number of bytes is this size */
 typedef struct bio_ssl_st {
     SSL *ssl;                   /* The ssl handle :-) */
     /* re-negotiate every time the total number of bytes is this size */
@@ -383,14 +383,6 @@ static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr)
     case BIO_CTRL_SET_CALLBACK:
         ret = 0; /* use callback ctrl */
         break;
     case BIO_CTRL_SET_CALLBACK:
         ret = 0; /* use callback ctrl */
         break;
-    case BIO_CTRL_GET_CALLBACK:
-        {
-            void (**fptr) (const SSL *xssl, int type, int val);
-
-            fptr = (void (**)(const SSL *xssl, int type, int val))ptr;
-            *fptr = SSL_get_info_callback(ssl);
-        }
-        break;
     default:
         ret = BIO_ctrl(ssl->rbio, cmd, num, ptr);
         break;
     default:
         ret = BIO_ctrl(ssl->rbio, cmd, num, ptr);
         break;
@@ -398,7 +390,7 @@ static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr)
     return ret;
 }
 
     return ret;
 }
 
-static long ssl_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
+static long ssl_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
 {
     SSL *ssl;
     BIO_SSL *bs;
 {
     SSL *ssl;
     BIO_SSL *bs;
@@ -408,16 +400,10 @@ static long ssl_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
     ssl = bs->ssl;
     switch (cmd) {
     case BIO_CTRL_SET_CALLBACK:
     ssl = bs->ssl;
     switch (cmd) {
     case BIO_CTRL_SET_CALLBACK:
-        {
-            /*
-             * FIXME: setting this via a completely different prototype seems
-             * like a crap idea
-             */
-            SSL_set_info_callback(ssl, (void (*)(const SSL *, int, int))fp);
-        }
+        ret = BIO_callback_ctrl(ssl->rbio, cmd, fp);
         break;
     default:
         break;
     default:
-        ret = BIO_callback_ctrl(ssl->rbio, cmd, fp);
+        ret = 0;
         break;
     }
     return ret;
         break;
     }
     return ret;
index 8c74a759c571a63157a37e64558393b2a03b6b0e..6ddd1885ce11f04111b6c06cd340da6a0310d899 100644 (file)
@@ -3246,6 +3246,20 @@ void ssl_sort_cipher_list(void)
     qsort(ssl3_scsvs, SSL3_NUM_SCSVS, sizeof(ssl3_scsvs[0]), cipher_compare);
 }
 
     qsort(ssl3_scsvs, SSL3_NUM_SCSVS, sizeof(ssl3_scsvs[0]), cipher_compare);
 }
 
+static int ssl_undefined_function_1(SSL *ssl, unsigned char *r, size_t s,
+                                    const char * t, size_t u,
+                                    const unsigned char * v, size_t w, int x)
+{
+    (void)r;
+    (void)s;
+    (void)t;
+    (void)u;
+    (void)v;
+    (void)w;
+    (void)x;
+    return ssl_undefined_function(ssl);
+}
+
 const SSL3_ENC_METHOD SSLv3_enc_data = {
     ssl3_enc,
     n_ssl3_mac,
 const SSL3_ENC_METHOD SSLv3_enc_data = {
     ssl3_enc,
     n_ssl3_mac,
@@ -3256,9 +3270,7 @@ const SSL3_ENC_METHOD SSLv3_enc_data = {
     SSL3_MD_CLIENT_FINISHED_CONST, 4,
     SSL3_MD_SERVER_FINISHED_CONST, 4,
     ssl3_alert_code,
     SSL3_MD_CLIENT_FINISHED_CONST, 4,
     SSL3_MD_SERVER_FINISHED_CONST, 4,
     ssl3_alert_code,
-    (int (*)(SSL *, unsigned char *, size_t, const char *,
-             size_t, const unsigned char *, size_t,
-             int use_context))ssl_undefined_function,
+    ssl_undefined_function_1,
     0,
     ssl3_set_handshake_header,
     tls_close_construct_packet,
     0,
     ssl3_set_handshake_header,
     tls_close_construct_packet,
index bba0291421e03f0efe0ceabbd17e6323d1bd2f39..37e83bddaf7f0094fbab8e051b4a72903877e816 100644 (file)
 
 const char SSL_version_str[] = OPENSSL_VERSION_TEXT;
 
 
 const char SSL_version_str[] = OPENSSL_VERSION_TEXT;
 
+static int ssl_undefined_function_1(SSL *ssl, SSL3_RECORD *r, size_t s, int t)
+{
+    (void)r;
+    (void)s;
+    (void)t;
+    return ssl_undefined_function(ssl);
+}
+
+static int ssl_undefined_function_2(SSL *ssl, SSL3_RECORD *r, unsigned char *s,
+                                    int t)
+{
+    (void)r;
+    (void)s;
+    (void)t;
+    return ssl_undefined_function(ssl);
+}
+
+static int ssl_undefined_function_3(SSL *ssl, unsigned char *r,
+                                    unsigned char *s, size_t t, size_t *u)
+{
+    (void)r;
+    (void)s;
+    (void)t;
+    (void)u;
+    return ssl_undefined_function(ssl);
+}
+
+static int ssl_undefined_function_4(SSL *ssl, int r)
+{
+    (void)r;
+    return ssl_undefined_function(ssl);
+}
+
+static size_t ssl_undefined_function_5(SSL *ssl, const char *r, size_t s,
+                                       unsigned char *t)
+{
+    (void)r;
+    (void)s;
+    (void)t;
+    return ssl_undefined_function(ssl);
+}
+
+static int ssl_undefined_function_6(int r)
+{
+    (void)r;
+    return ssl_undefined_function(NULL);
+}
+
+static int ssl_undefined_function_7(SSL *ssl, unsigned char *r, size_t s,
+                                    const char *t, size_t u,
+                                    const unsigned char *v, size_t w, int x)
+{
+    (void)r;
+    (void)s;
+    (void)t;
+    (void)u;
+    (void)v;
+    (void)w;
+    (void)x;
+    return ssl_undefined_function(ssl);
+}
+
 SSL3_ENC_METHOD ssl3_undef_enc_method = {
 SSL3_ENC_METHOD ssl3_undef_enc_method = {
-    /*
-     * evil casts, but these functions are only called if there's a library
-     * bug
-     */
-    (int (*)(SSL *, SSL3_RECORD *, size_t, int))ssl_undefined_function,
-    (int (*)(SSL *, SSL3_RECORD *, unsigned char *, int))ssl_undefined_function,
+    ssl_undefined_function_1,
+    ssl_undefined_function_2,
     ssl_undefined_function,
     ssl_undefined_function,
-    (int (*)(SSL *, unsigned char *, unsigned char *, size_t, size_t *))
-        ssl_undefined_function,
-    (int (*)(SSL *, int))ssl_undefined_function,
-    (size_t (*)(SSL *, const char *, size_t, unsigned char *))
-        ssl_undefined_function,
+    ssl_undefined_function_3,
+    ssl_undefined_function_4,
+    ssl_undefined_function_5,
     NULL,                       /* client_finished_label */
     0,                          /* client_finished_label_len */
     NULL,                       /* server_finished_label */
     0,                          /* server_finished_label_len */
     NULL,                       /* client_finished_label */
     0,                          /* client_finished_label_len */
     NULL,                       /* server_finished_label */
     0,                          /* server_finished_label_len */
-    (int (*)(int))ssl_undefined_function,
-    (int (*)(SSL *, unsigned char *, size_t, const char *,
-             size_t, const unsigned char *, size_t,
-             int use_context))ssl_undefined_function,
+    ssl_undefined_function_6,
+    ssl_undefined_function_7,
 };
 
 struct ssl_async_args {
 };
 
 struct ssl_async_args {
index f0f6a38dbfb258bcb24abff356c3a03031dc0724..cbbabe01eab05571c97a12fcb590f738a0cbb36a 100644 (file)
@@ -118,10 +118,10 @@ static int AsyncFree(BIO *bio) {
   return 1;
 }
 
   return 1;
 }
 
-static long AsyncCallbackCtrl(BIO *bio, int cmd, bio_info_cb fp) {
-  if (BIO_next(bio) == NULL) {
+static long AsyncCallbackCtrl(BIO *bio, int cmd, BIO_info_cb fp)
+{
+  if (BIO_next(bio) == NULL)
     return 0;
     return 0;
-  }
   return BIO_callback_ctrl(BIO_next(bio), cmd, fp);
 }
 
   return BIO_callback_ctrl(BIO_next(bio), cmd, fp);
 }
 
index e1b3c6c678f4bfd019f37349d6b00482d4ff4a8c..450baeccdf22a9b86738cbe121c6e562fead1890 100644 (file)
@@ -240,10 +240,10 @@ static int PacketedFree(BIO *bio) {
   return 1;
 }
 
   return 1;
 }
 
-static long PacketedCallbackCtrl(BIO *bio, int cmd, bio_info_cb fp) {
-  if (BIO_next(bio) == NULL) {
+static long PacketedCallbackCtrl(BIO *bio, int cmd, BIO_info_cb fp)
+{
+  if (BIO_next(bio) == NULL)
     return 0;
     return 0;
-  }
   return BIO_callback_ctrl(BIO_next(bio), cmd, fp);
 }
 
   return BIO_callback_ctrl(BIO_next(bio), cmd, fp);
 }
 
index f78dfb81d9e602a00d8b9b933b88d1624d1dad96..a6c903b5ae9305289953fe5f3677612803b0c667 100644 (file)
@@ -18,7 +18,7 @@ static int tap_gets(BIO *b, char *str, int size);
 static long tap_ctrl(BIO *b, int cmd, long arg1, void *arg2);
 static int tap_new(BIO *b);
 static int tap_free(BIO *b);
 static long tap_ctrl(BIO *b, int cmd, long arg1, void *arg2);
 static int tap_new(BIO *b);
 static int tap_free(BIO *b);
-static long tap_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
+static long tap_callback_ctrl(BIO *h, int cmd, BIO_info_cb *fp);
 
 const BIO_METHOD *BIO_f_tap(void)
 {
 
 const BIO_METHOD *BIO_f_tap(void)
 {
@@ -134,7 +134,7 @@ static long tap_ctrl(BIO *b, int cmd, long num, void *ptr)
     return BIO_ctrl(next, cmd, num, ptr);
 }
 
     return BIO_ctrl(next, cmd, num, ptr);
 }
 
-static long tap_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
+static long tap_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
 {
     return BIO_callback_ctrl(BIO_next(b), cmd, fp);
 }
 {
     return BIO_callback_ctrl(BIO_next(b), cmd, fp);
 }
index c65088c6d741c71ea861f915238bd8eb421805de..7bb7bcdd6a9f986cf2b1347756673b8630a75bf3 100644 (file)
 -T asn1_ps_func
 -T bio_dgram_data
 -T bio_info_cb
 -T asn1_ps_func
 -T bio_dgram_data
 -T bio_info_cb
+-T BIO_info_cb
 -T BIO_callback_fn
 -T char_io
 -T conf_finish_func
 -T BIO_callback_fn
 -T char_io
 -T conf_finish_func
index a0403174b5779f2d477ca57bd415daf55623cc96..1644dcb2472a91923e9b5f9cd33619aceb525043 100644 (file)
@@ -62,6 +62,7 @@ X509_STORE_CTX_verify_cb                datatype
 X509_STORE_CTX_verify_fn                datatype
 X509_STORE_set_verify_cb_func           datatype
 bio_info_cb                             datatype
 X509_STORE_CTX_verify_fn                datatype
 X509_STORE_set_verify_cb_func           datatype
 bio_info_cb                             datatype
+BIO_info_cb                             datatype
 custom_ext_add_cb                       datatype
 custom_ext_free_cb                      datatype
 custom_ext_parse_cb                     datatype
 custom_ext_add_cb                       datatype
 custom_ext_free_cb                      datatype
 custom_ext_parse_cb                     datatype