Browse Source

Add functions for setting a BIO callback and arg.

These were omitted, but are needed by Chromium now.

Change-Id: I17e1672674311c8dc2ede21539c82b8e2e50f376
Reviewed-on: https://boringssl-review.googlesource.com/1201
Reviewed-by: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
Adam Langley 10 years ago
committed by Adam Langley
parent
commit
0cc81ff04f
2 changed files with 24 additions and 0 deletions
  1. +12
    -0
      crypto/bio/bio.c
  2. +12
    -0
      include/openssl/bio.h

+ 12
- 0
crypto/bio/bio.c View File

@@ -359,6 +359,18 @@ int BIO_set_close(BIO *bio, int close_flag) {
return BIO_ctrl(bio, BIO_CTRL_SET_CLOSE, close_flag, NULL);
}

void BIO_set_callback(BIO *bio, bio_info_cb callback_func) {
bio->callback = callback_func;
}

void BIO_set_callback_arg(BIO *bio, char *arg) {
bio->cb_arg = arg;
}

char *BIO_get_callback_arg(const BIO *bio) {
return bio->cb_arg;
}

BIO *BIO_push(BIO *bio, BIO *appended_bio) {
BIO *last_bio;



+ 12
- 0
include/openssl/bio.h View File

@@ -244,6 +244,18 @@ size_t BIO_wpending(const BIO *bio);
* otherwise. */
int BIO_set_close(BIO *bio, int close_flag);

/* BIO_set_callback sets a callback function that will be called before and
* after most operations. See the comment above |bio_info_cb|. */
void BIO_set_callback(BIO *bio, bio_info_cb callback_func);

/* BIO_set_callback_arg sets the opaque pointer value that can be read within a
* callback with |BIO_get_callback_arg|. */
void BIO_set_callback_arg(BIO *bio, char *arg);

/* BIO_get_callback_arg returns the last value of the opaque callback pointer
* set by |BIO_set_callback_arg|. */
char *BIO_get_callback_arg(const BIO *bio);


/* Managing chains of BIOs.
*


Loading…
Cancel
Save