diff options
author | Jordan Bayles <jophba@chromium.org> | 2020-09-29 12:01:35 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-09-29 19:42:12 +0000 |
commit | a528cef8c93efde2f2f62ec461b835bc8e8434b8 (patch) | |
tree | f9b7ce88935fdd5495492d3e1a7f8bbe79efa9db /util | |
parent | 9b07ca0111b39ce7e57925f7a7baa2df20e0b067 (diff) | |
download | openscreen-a528cef8c93efde2f2f62ec461b835bc8e8434b8.tar.gz |
Fix PEM_read calls
This patch moves PEM_read calls to using long types plus NOLINT
directives.
Change-Id: Ib8196599ac8b51deba623f48b252ab8a229b2563
Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2438680
Reviewed-by: Jordan Bayles <jophba@chromium.org>
Reviewed-by: Yuri Wiitala <miu@chromium.org>
Commit-Queue: Jordan Bayles <jophba@chromium.org>
Diffstat (limited to 'util')
-rw-r--r-- | util/crypto/pem_helpers.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/util/crypto/pem_helpers.cc b/util/crypto/pem_helpers.cc index 471ddc6d..a9dcf124 100644 --- a/util/crypto/pem_helpers.cc +++ b/util/crypto/pem_helpers.cc @@ -25,9 +25,8 @@ std::vector<std::string> ReadCertificatesFromPemFile( char* name; char* header; unsigned char* data; - int64_t length; - while (PEM_read(fp, &name, &header, &data, - reinterpret_cast<long*>(&length)) == 1) { + long length; // NOLINT + while (PEM_read(fp, &name, &header, &data, &length) == 1) { if (absl::StartsWith(name, "CERTIFICATE")) { certs.emplace_back(reinterpret_cast<char*>(data), length); } @@ -48,9 +47,8 @@ bssl::UniquePtr<EVP_PKEY> ReadKeyFromPemFile(absl::string_view filename) { char* name; char* header; unsigned char* data; - int64_t length; - while (PEM_read(fp, &name, &header, &data, - reinterpret_cast<long*>(&length)) == 1) { + long length; // NOLINT + while (PEM_read(fp, &name, &header, &data, &length) == 1) { if (absl::StartsWith(name, "RSA PRIVATE KEY")) { OSP_DCHECK(!pkey); CBS cbs; |