sthen has kindly put a huge diff with const changes through a bulk which
I will send out in small bits. Here's a first trivial piece of it that
finishes the BIO_s_* story.
This diff breaks the build of the www/phantomjs port which I'll fix at
the same time as committing this.
Index: lib/libcrypto/bio/bio.h
===================================================================
RCS file: /var/cvs/src/lib/libcrypto/bio/bio.h,v
retrieving revision 1.41
diff -u -p -r1.41 bio.h
--- lib/libcrypto/bio/bio.h 1 May 2018 13:29:09 -0000 1.41
+++ lib/libcrypto/bio/bio.h 12 May 2018 16:34:43 -0000
@@ -641,7 +641,7 @@ int BIO_nwrite(BIO *bio, char **buf, int
long BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi,
long argl, long ret);
-BIO_METHOD *BIO_s_mem(void);
+const BIO_METHOD *BIO_s_mem(void);
BIO *BIO_new_mem_buf(void *buf, int len);
const BIO_METHOD *BIO_s_socket(void);
const BIO_METHOD *BIO_s_connect(void);
@@ -654,7 +654,7 @@ const BIO_METHOD *BIO_f_null(void);
const BIO_METHOD *BIO_f_buffer(void);
const BIO_METHOD *BIO_f_nbio_test(void);
#ifndef OPENSSL_NO_DGRAM
-BIO_METHOD *BIO_s_datagram(void);
+const BIO_METHOD *BIO_s_datagram(void);
#endif
/* BIO_METHOD *BIO_f_ber(void); */
Index: lib/libcrypto/bio/bss_dgram.c
===================================================================
RCS file: /var/cvs/src/lib/libcrypto/bio/bss_dgram.c,v
retrieving revision 1.41
diff -u -p -r1.41 bss_dgram.c
--- lib/libcrypto/bio/bss_dgram.c 20 Jul 2015 23:15:28 -0000 1.41
+++ lib/libcrypto/bio/bss_dgram.c 12 May 2018 16:34:43 -0000
@@ -86,7 +86,7 @@ static int dgram_clear(BIO *bio);
static int BIO_dgram_should_retry(int s);
-static BIO_METHOD methods_dgramp = {
+static const BIO_METHOD methods_dgramp = {
.type = BIO_TYPE_DGRAM,
.name = "datagram socket",
.bwrite = dgram_write,
@@ -112,7 +112,7 @@ typedef struct bio_dgram_data_st {
} bio_dgram_data;
-BIO_METHOD *
+const BIO_METHOD *
BIO_s_datagram(void)
{
return (&methods_dgramp);
Index: lib/libcrypto/bio/bss_mem.c
===================================================================
RCS file: /var/cvs/src/lib/libcrypto/bio/bss_mem.c,v
retrieving revision 1.15
diff -u -p -r1.15 bss_mem.c
--- lib/libcrypto/bio/bss_mem.c 29 Jan 2017 17:49:22 -0000 1.15
+++ lib/libcrypto/bio/bss_mem.c 12 May 2018 16:34:43 -0000
@@ -72,7 +72,7 @@ static long mem_ctrl(BIO *h, int cmd, lo
static int mem_new(BIO *h);
static int mem_free(BIO *data);
-static BIO_METHOD mem_method = {
+static const BIO_METHOD mem_method = {
.type = BIO_TYPE_MEM,
.name = "memory buffer",
.bwrite = mem_write,
@@ -87,7 +87,7 @@ static BIO_METHOD mem_method = {
/* bio->num is used to hold the value to return on 'empty', if it is
* 0, should_retry is not set */
-BIO_METHOD *
+const BIO_METHOD *
BIO_s_mem(void)
{
return (&mem_method);