diff options
author | Adam Langley <agl@chromium.org> | 2014-07-18 20:28:40 +0400 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2014-07-18 21:22:05 +0400 |
commit | 37a623cf2932b8e7de6c6d58d1a6ce81c4b9f56e (patch) | |
tree | ac2d47055eda660506fea42862aa4b7ae1715db5 /include/openssl/bio.h | |
parent | b5d725df63695aa7298126ea9eb12320d7e25dfd (diff) |
Have BIO_get_mem_data return a size_t and uint8_t*
Change-Id: I883f9c3527b572a2140ae4899cf4409cdc25c6dc
Reviewed-on: https://boringssl-review.googlesource.com/1261
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'include/openssl/bio.h')
-rw-r--r-- | include/openssl/bio.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/openssl/bio.h b/include/openssl/bio.h index af3789ef..1e433d3a 100644 --- a/include/openssl/bio.h +++ b/include/openssl/bio.h @@ -358,8 +358,18 @@ const BIO_METHOD *BIO_s_mem(void); * don't depend on this in new code. */ BIO *BIO_new_mem_buf(void *buf, int len); +/* BIO_mem_contents sets |*out_contents| to point to the current contents of + * |bio| and |*out_len| to contain the length of that data. It returns one on + * success and zero otherwise. */ +int BIO_mem_contents(const BIO *bio, const uint8_t **out_contents, + size_t *out_len); + /* BIO_get_mem_data sets |*contents| to point to the current contents of |bio| - * and returns the length of the data. */ + * and returns the length of the data. + * + * WARNING: don't use this, use |BIO_mem_contents|. A return value of zero from + * this function can mean either that it failed or that the memory buffer is + * empty. */ long BIO_get_mem_data(BIO *bio, char **contents); /* BIO_get_mem_ptr sets |*out| to a BUF_MEM containing the current contents of |