On Mon, Apr 30, 2018 at 09:39:18PM +0200, Theo Buehler wrote:
> Here is a straightforward diff that converts BIO_new(), BIO_set() and the
> BIO_{f,s}_*() functions to match OpenSSL wrt const. This was part of a
> larger diff that was run through a bulk by sthen and produced no fallout.
> 

There were a few more of these in sthen's bulk:

Index: evp/bio_b64.c
===================================================================
RCS file: /var/cvs/src/lib/libcrypto/evp/bio_b64.c,v
retrieving revision 1.20
diff -u -p -r1.20 bio_b64.c
--- evp/bio_b64.c       7 Feb 2015 13:19:15 -0000       1.20
+++ evp/bio_b64.c       1 May 2018 15:52:07 -0000
@@ -91,7 +91,7 @@ typedef struct b64_struct {
        char tmp[B64_BLOCK_SIZE];
 } BIO_B64_CTX;
 
-static BIO_METHOD methods_b64 = {
+static const BIO_METHOD methods_b64 = {
        .type = BIO_TYPE_BASE64,
        .name = "base64 encoding",
        .bwrite = b64_write,
@@ -103,7 +103,7 @@ static BIO_METHOD methods_b64 = {
        .callback_ctrl = b64_callback_ctrl
 };
 
-BIO_METHOD *
+const BIO_METHOD *
 BIO_f_base64(void)
 {
        return (&methods_b64);
Index: evp/bio_enc.c
===================================================================
RCS file: /var/cvs/src/lib/libcrypto/evp/bio_enc.c,v
retrieving revision 1.20
diff -u -p -r1.20 bio_enc.c
--- evp/bio_enc.c       2 May 2017 03:59:44 -0000       1.20
+++ evp/bio_enc.c       1 May 2018 15:52:07 -0000
@@ -87,7 +87,7 @@ typedef struct enc_struct {
        char buf[ENC_BLOCK_SIZE + BUF_OFFSET + 2];
 } BIO_ENC_CTX;
 
-static BIO_METHOD methods_enc = {
+static const BIO_METHOD methods_enc = {
        .type = BIO_TYPE_CIPHER,
        .name = "cipher",
        .bwrite = enc_write,
@@ -98,7 +98,7 @@ static BIO_METHOD methods_enc = {
        .callback_ctrl = enc_callback_ctrl
 };
 
-BIO_METHOD *
+const BIO_METHOD *
 BIO_f_cipher(void)
 {
        return (&methods_enc);
Index: evp/bio_md.c
===================================================================
RCS file: /var/cvs/src/lib/libcrypto/evp/bio_md.c,v
retrieving revision 1.14
diff -u -p -r1.14 bio_md.c
--- evp/bio_md.c        11 Jul 2014 08:44:48 -0000      1.14
+++ evp/bio_md.c        1 May 2018 15:52:07 -0000
@@ -74,7 +74,7 @@ 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 BIO_METHOD methods_md = {
+static const BIO_METHOD methods_md = {
        .type = BIO_TYPE_MD,
        .name = "message digest",
        .bwrite = md_write,
@@ -86,7 +86,7 @@ static BIO_METHOD methods_md = {
        .callback_ctrl = md_callback_ctrl
 };
 
-BIO_METHOD *
+const BIO_METHOD *
 BIO_f_md(void)
 {
        return (&methods_md);
Index: evp/evp.h
===================================================================
RCS file: /var/cvs/src/lib/libcrypto/evp/evp.h,v
retrieving revision 1.58
diff -u -p -r1.58 evp.h
--- evp/evp.h   20 Feb 2018 18:05:28 -0000      1.58
+++ evp/evp.h   1 May 2018 15:52:07 -0000
@@ -651,9 +651,9 @@ int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *
 int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key);
 
 #ifndef OPENSSL_NO_BIO
-BIO_METHOD *BIO_f_md(void);
-BIO_METHOD *BIO_f_base64(void);
-BIO_METHOD *BIO_f_cipher(void);
+const BIO_METHOD *BIO_f_md(void);
+const BIO_METHOD *BIO_f_base64(void);
+const BIO_METHOD *BIO_f_cipher(void);
 void BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k,
     const unsigned char *i, int enc);
 #endif

Reply via email to