summaryrefslogtreecommitdiffstats
path: root/crypto/bio/bio_lib.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-03-22 09:21:29 +0000
committerMatt Caswell <matt@openssl.org>2016-03-29 17:40:54 +0100
commita146ae55ba479a5c7aa2a6afba1b2b93102a152c (patch)
tree4c0803ebfed56f2a4ff59725a763cdc78bcf0379 /crypto/bio/bio_lib.c
parentf334461facc4078adbad6552563f77799c174cab (diff)
Make BIO opaque
Move the the BIO_METHOD and BIO structures into internal header files, provide appropriate accessor methods and update all internal code to use the new accessors where appropriate. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/bio/bio_lib.c')
-rw-r--r--crypto/bio/bio_lib.c42
1 files changed, 41 insertions, 1 deletions
diff --git a/crypto/bio/bio_lib.c b/crypto/bio/bio_lib.c
index 9357553d36..ac98cf2402 100644
--- a/crypto/bio/bio_lib.c
+++ b/crypto/bio/bio_lib.c
@@ -58,8 +58,8 @@
#include <stdio.h>
#include <errno.h>
#include <openssl/crypto.h>
+#include "bio_lcl.h"
#include "internal/cryptlib.h"
-#include <openssl/bio.h>
#include <openssl/stack.h>
BIO *BIO_new(const BIO_METHOD *method)
@@ -142,6 +142,36 @@ int BIO_free(BIO *a)
return 1;
}
+void BIO_set_data(BIO *a, void *ptr)
+{
+ a->ptr = ptr;
+}
+
+void *BIO_get_data(BIO *a)
+{
+ return a->ptr;
+}
+
+void BIO_set_init(BIO *a, int init)
+{
+ a->init = init;
+}
+
+int BIO_get_init(BIO *a)
+{
+ return a->init;
+}
+
+void BIO_set_shutdown(BIO *a, int shut)
+{
+ a->shutdown = shut;
+}
+
+int BIO_get_shutdown(BIO *a)
+{
+ return a->shutdown;
+}
+
void BIO_vfree(BIO *a)
{
BIO_free(a);
@@ -487,6 +517,11 @@ int BIO_get_retry_reason(BIO *bio)
return (bio->retry_reason);
}
+void BIO_set_retry_reason(BIO *bio, int reason)
+{
+ bio->retry_reason = reason;
+}
+
BIO *BIO_find_type(BIO *bio, int type)
{
int mt, mask;
@@ -516,6 +551,11 @@ BIO *BIO_next(BIO *b)
return b->next_bio;
}
+void BIO_set_next(BIO *b, BIO *next)
+{
+ b->next_bio = next;
+}
+
void BIO_free_all(BIO *bio)
{
BIO *b;