diff options
author | Matt Caswell <matt@openssl.org> | 2015-06-04 10:35:08 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-06-10 10:40:50 +0100 |
commit | b8b12aadd8edfd3bd327157c8899b1cf3403177f (patch) | |
tree | 2b8e5fb28fffb6b9049cae0934ddb28c38520346 /include | |
parent | 54e3ad003bdf83f189b2bf17fb998c028d39c8eb (diff) | |
download | openssl-b8b12aadd8edfd3bd327157c8899b1cf3403177f.tar.gz |
Change BIO_number_read and BIO_number_written() to be 64 bit
The return type of BIO_number_read() and BIO_number_written() as well as
the corresponding num_read and num_write members in the BIO structure has
been changed from unsigned long to uint64_t. On platforms where an unsigned
long is 32 bits (e.g. Windows) these counters could overflow if >4Gb is
transferred.
With thanks to the Open Crypto Audit Project for reporting this issue.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/openssl/bio.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/openssl/bio.h b/include/openssl/bio.h index ab37c87810..e224dd9458 100644 --- a/include/openssl/bio.h +++ b/include/openssl/bio.h @@ -321,8 +321,8 @@ struct bio_st { struct bio_st *next_bio; /* used by filter BIOs */ struct bio_st *prev_bio; /* used by filter BIOs */ int references; - unsigned long num_read; - unsigned long num_write; + uint64_t num_read; + uint64_t num_write; CRYPTO_EX_DATA ex_data; }; @@ -618,8 +618,8 @@ int BIO_set_ex_data(BIO *bio, int idx, void *data); void *BIO_get_ex_data(BIO *bio, int idx); int BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); -unsigned long BIO_number_read(BIO *bio); -unsigned long BIO_number_written(BIO *bio); +uint64_t BIO_number_read(BIO *bio); +uint64_t BIO_number_written(BIO *bio); /* For BIO_f_asn1() */ int BIO_asn1_set_prefix(BIO *b, asn1_ps_func *prefix, |