From 79813f3abca6cad2f925122889a740ad8d016c5b Mon Sep 17 00:00:00 2001 From: tb <> Date: Sat, 12 May 2018 18:51:59 +0000 Subject: const qualifiers for BIO_new_mem_buf(), BIO_new_connect() and BIO_new_accept(). The one for BIO_new_mem_buf() is a bit ugly since it needs to cast away the newly added const qualifier, as in OpenSSL commit 8ab31975bac. ok jsing --- src/lib/libcrypto/bio/bio.h | 8 ++++---- src/lib/libcrypto/bio/bss_acpt.c | 4 ++-- src/lib/libcrypto/bio/bss_conn.c | 4 ++-- src/lib/libcrypto/bio/bss_mem.c | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/lib/libcrypto/bio/bio.h b/src/lib/libcrypto/bio/bio.h index 678155c34e..105d3ff3af 100644 --- a/src/lib/libcrypto/bio/bio.h +++ b/src/lib/libcrypto/bio/bio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bio.h,v 1.42 2018/05/12 17:47:53 tb Exp $ */ +/* $OpenBSD: bio.h,v 1.43 2018/05/12 18:51:59 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -642,7 +642,7 @@ long BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi, long argl, long ret); const BIO_METHOD *BIO_s_mem(void); -BIO *BIO_new_mem_buf(void *buf, int len); +BIO *BIO_new_mem_buf(const void *buf, int len); const BIO_METHOD *BIO_s_socket(void); const BIO_METHOD *BIO_s_connect(void); const BIO_METHOD *BIO_s_accept(void); @@ -698,8 +698,8 @@ int BIO_set_tcp_ndelay(int sock, int turn_on); BIO *BIO_new_socket(int sock, int close_flag); BIO *BIO_new_dgram(int fd, int close_flag); BIO *BIO_new_fd(int fd, int close_flag); -BIO *BIO_new_connect(char *host_port); -BIO *BIO_new_accept(char *host_port); +BIO *BIO_new_connect(const char *host_port); +BIO *BIO_new_accept(const char *host_port); int BIO_new_bio_pair(BIO **bio1, size_t writebuf1, diff --git a/src/lib/libcrypto/bio/bss_acpt.c b/src/lib/libcrypto/bio/bss_acpt.c index b270199da1..c95ddde7bb 100644 --- a/src/lib/libcrypto/bio/bss_acpt.c +++ b/src/lib/libcrypto/bio/bss_acpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bss_acpt.c,v 1.28 2018/05/01 13:29:09 tb Exp $ */ +/* $OpenBSD: bss_acpt.c,v 1.29 2018/05/12 18:51:59 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -436,7 +436,7 @@ acpt_puts(BIO *bp, const char *str) } BIO * -BIO_new_accept(char *str) +BIO_new_accept(const char *str) { BIO *ret; diff --git a/src/lib/libcrypto/bio/bss_conn.c b/src/lib/libcrypto/bio/bss_conn.c index 575d163371..46a37b0608 100644 --- a/src/lib/libcrypto/bio/bss_conn.c +++ b/src/lib/libcrypto/bio/bss_conn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bss_conn.c,v 1.34 2018/05/01 13:29:09 tb Exp $ */ +/* $OpenBSD: bss_conn.c,v 1.35 2018/05/12 18:51:59 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -583,7 +583,7 @@ conn_puts(BIO *bp, const char *str) } BIO * -BIO_new_connect(char *str) +BIO_new_connect(const char *str) { BIO *ret; diff --git a/src/lib/libcrypto/bio/bss_mem.c b/src/lib/libcrypto/bio/bss_mem.c index a699dc51c3..e76e1ad2e7 100644 --- a/src/lib/libcrypto/bio/bss_mem.c +++ b/src/lib/libcrypto/bio/bss_mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bss_mem.c,v 1.16 2018/05/12 17:47:53 tb Exp $ */ +/* $OpenBSD: bss_mem.c,v 1.17 2018/05/12 18:51:59 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -94,7 +94,7 @@ BIO_s_mem(void) } BIO * -BIO_new_mem_buf(void *buf, int len) +BIO_new_mem_buf(const void *buf, int len) { BIO *ret; BUF_MEM *b; @@ -108,7 +108,7 @@ BIO_new_mem_buf(void *buf, int len) if (!(ret = BIO_new(BIO_s_mem()))) return NULL; b = (BUF_MEM *)ret->ptr; - b->data = buf; + b->data = (void *)buf; /* Trust in the BIO_FLAGS_MEM_RDONLY flag. */ b->length = sz; b->max = sz; ret->flags |= BIO_FLAGS_MEM_RDONLY; -- cgit v1.2.3-55-g6feb