aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2024-02-10 11:20:30 -0500
committerBoringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com>2024-02-10 20:41:49 +0000
commitc39e6cd9ec5acebb6de2adffc03cfe03b07f08ab (patch)
treef61c31d4a7bdb2c2c748e90831eb66811440897c
parent71c589682f7d1dabc08b56ef7a0a28913e44110e (diff)
downloadboringssl-c39e6cd9ec5acebb6de2adffc03cfe03b07f08ab.zip
boringssl-c39e6cd9ec5acebb6de2adffc03cfe03b07f08ab.tar.gz
boringssl-c39e6cd9ec5acebb6de2adffc03cfe03b07f08ab.tar.bz2
Use uint64_t for num_read and num_write in BIO
This matches upstream OpenSSL. It's also counting a total number of bytes, not a single buffer. On a 32-bit platform, one may still transfor more than 4GiB of data through a single BIO. Change-Id: I1c668d84ee5ce13f7ab5c476cb168ae9c0e0109e Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/66167 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com> Auto-Submit: David Benjamin <davidben@google.com>
-rw-r--r--crypto/bio/bio.c4
-rw-r--r--include/openssl/bio.h6
2 files changed, 5 insertions, 5 deletions
diff --git a/crypto/bio/bio.c b/crypto/bio/bio.c
index abe753c..3206f6e 100644
--- a/crypto/bio/bio.c
+++ b/crypto/bio/bio.c
@@ -345,11 +345,11 @@ int BIO_set_close(BIO *bio, int close_flag) {
return (int)BIO_ctrl(bio, BIO_CTRL_SET_CLOSE, close_flag, NULL);
}
-OPENSSL_EXPORT size_t BIO_number_read(const BIO *bio) {
+OPENSSL_EXPORT uint64_t BIO_number_read(const BIO *bio) {
return bio->num_read;
}
-OPENSSL_EXPORT size_t BIO_number_written(const BIO *bio) {
+OPENSSL_EXPORT uint64_t BIO_number_written(const BIO *bio) {
return bio->num_write;
}
diff --git a/include/openssl/bio.h b/include/openssl/bio.h
index b28439a..4700799 100644
--- a/include/openssl/bio.h
+++ b/include/openssl/bio.h
@@ -269,11 +269,11 @@ OPENSSL_EXPORT int BIO_set_close(BIO *bio, int close_flag);
// BIO_number_read returns the number of bytes that have been read from
// |bio|.
-OPENSSL_EXPORT size_t BIO_number_read(const BIO *bio);
+OPENSSL_EXPORT uint64_t BIO_number_read(const BIO *bio);
// BIO_number_written returns the number of bytes that have been written to
// |bio|.
-OPENSSL_EXPORT size_t BIO_number_written(const BIO *bio);
+OPENSSL_EXPORT uint64_t BIO_number_written(const BIO *bio);
// Managing chains of BIOs.
@@ -894,7 +894,7 @@ struct bio_st {
// next_bio points to the next |BIO| in a chain. This |BIO| owns a reference
// to |next_bio|.
BIO *next_bio; // used by filter BIOs
- size_t num_read, num_write;
+ uint64_t num_read, num_write;
};
#define BIO_C_SET_CONNECT 100