diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2018-02-18 12:58:26 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2018-02-18 12:58:26 +0000 |
commit | 1f241aa880624876f1898f8efb40d3b9356e7024 (patch) | |
tree | c7fe543ed0a579dcd4a08fe009f3fb246fa43c8c /lib/libcrypto/bio | |
parent | cc6b41e9bdb7f8a28e4d406f0aed21a8a620382e (diff) |
Provide BIO_{g,s}et_data() and BIO_set_init().
ok jsing
Diffstat (limited to 'lib/libcrypto/bio')
-rw-r--r-- | lib/libcrypto/bio/bio.h | 5 | ||||
-rw-r--r-- | lib/libcrypto/bio/bio_lib.c | 20 |
2 files changed, 23 insertions, 2 deletions
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) { |