From b47f35fc0fdadbb7bcc45988f3e8c8ca81f55ff3 Mon Sep 17 00:00:00 2001 From: tb Date: Sun, 18 Feb 2018 12:58:25 +0000 Subject: [PATCH] Provide BIO_{g,s}et_data() and BIO_set_init(). ok jsing --- lib/libcrypto/Symbols.list | 3 +++ lib/libcrypto/bio/bio.h | 5 ++++- lib/libcrypto/bio/bio_lib.c | 20 +++++++++++++++++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index e5997cc76d9..f8125ad9f7b 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -276,6 +276,7 @@ BIO_free_all BIO_get_accept_socket BIO_get_callback BIO_get_callback_arg +BIO_get_data BIO_get_ex_data BIO_get_ex_new_index BIO_get_host_ip @@ -334,9 +335,11 @@ BIO_s_socket BIO_set BIO_set_callback BIO_set_callback_arg +BIO_set_data BIO_set_cipher BIO_set_ex_data BIO_set_flags +BIO_set_init BIO_set_tcp_ndelay BIO_snprintf BIO_sock_cleanup diff --git a/lib/libcrypto/bio/bio.h b/lib/libcrypto/bio/bio.h index 3a1577ab37c..c60ab389a04 100644 --- a/lib/libcrypto/bio/bio.h +++ b/lib/libcrypto/bio/bio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bio.h,v 1.31 2018/02/17 13:57:14 tb Exp $ */ +/* $OpenBSD: bio.h,v 1.32 2018/02/18 12:58:25 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -586,6 +586,9 @@ BIO *BIO_new_fp(FILE *stream, int close_flag); BIO * BIO_new(BIO_METHOD *type); int BIO_set(BIO *a, BIO_METHOD *type); int BIO_free(BIO *a); +void *BIO_get_data(BIO *a); +void BIO_set_data(BIO *a, void *ptr); +void BIO_set_init(BIO *a, int init); void BIO_vfree(BIO *a); int BIO_read(BIO *b, void *data, int len) __attribute__((__bounded__(__buffer__,2,3))); diff --git a/lib/libcrypto/bio/bio_lib.c b/lib/libcrypto/bio/bio_lib.c index 86ccbdc202a..4e5405d6afb 100644 --- a/lib/libcrypto/bio/bio_lib.c +++ b/lib/libcrypto/bio/bio_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bio_lib.c,v 1.23 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: bio_lib.c,v 1.24 2018/02/18 12:58:25 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -137,6 +137,24 @@ BIO_vfree(BIO *a) BIO_free(a); } +void * +BIO_get_data(BIO *a) +{ + return (a->ptr); +} + +void +BIO_set_data(BIO *a, void *ptr) +{ + a->ptr = ptr; +} + +void +BIO_set_init(BIO *a, int init) +{ + a->init = init; +} + void BIO_clear_flags(BIO *b, int flags) { -- 2.20.1