Commit Graph

40 Commits

Author SHA1 Message Date
Andrew Gaul 4845831f93
Convert some const to constexpr (#2342)
This guarantees that the function or value will resolve at compile-time.
2023-11-14 22:15:17 +09:00
Andrew Gaul 87b8bafaea
Address unknown pragma warning with GCC (#2324) 2023-09-26 01:16:14 +09:00
Andrew Gaul 7e94b64ae7
Use unique_ptr in SSL functions (#2282)
References #2261.
2023-08-19 23:29:00 +09:00
Andrew Gaul c65ce8a42c
Add clang-tidy to CI (#2270) 2023-08-17 22:42:11 +09:00
Andrew Gaul 3790a0f8b4
Calculate MD5 without using a temporary file (#2252)
This mirrors the SHA256 code.
2023-08-07 00:17:15 +09:00
Andrew Gaul b5c3fc0a08
Convert fixed-size allocations to C++11 std::array (#2242)
This is safer and more efficient.
2023-08-05 09:36:22 +09:00
Andrew Gaul a4a2841c05
Use C++11 nullptr instead of 0 or NULL (#2234)
This improves type-safety.
2023-07-27 21:56:58 +09:00
Andrew Gaul 0ece204393 Fix -Wshorten-64-to-32 warnings 2023-07-27 12:23:26 +09:00
Takeshi Nakatani faec0d9d15 Refixed for cppcheck 2.1x 2023-07-26 07:55:33 +09:00
Takeshi Nakatani 23a8124c51 Compatible with OpenSSL 3.0 2022-11-27 21:46:08 +09:00
Andrew Gaul 48e9e51f4f
Remove more unneeded headers identified by IWYU (#2011) 2022-07-30 12:06:47 +09:00
Andrew Gaul 600cee118d
Fix implicit narrowing conversions (#1672)
These do not appear to be problematic but rather just clean up warnings.
Found via clang -Wshorten-64-to-32.
2021-06-13 12:50:07 +09:00
Andrew Gaul 4b53d4bf6b
Suppress spurious SHA256 error message (#1544) 2021-02-04 07:28:51 +09:00
Andrew Gaul b0e8758b63
Use result instead of res for consistency (#1530) 2021-01-25 07:56:10 +09:00
Takeshi Nakatani 93cf67c65d
Merge pull request #1399 from gaul/md5-sha256
Use more descriptive names for digest functions
2020-09-17 17:11:19 +09:00
Andrew Gaul b7187352e1 Use more descriptive names for digest functions
Previously they used hex to refer to binary data which is confusing
since other std::string return types are actually hex.  Also remove
unused s3fs_md5sum.
2020-09-15 21:18:58 +09:00
Andrew Gaul 5121c73ed1 Remove unneeded memset calls
Also use constant for array lengths.
2020-09-14 19:51:36 +09:00
Andrew Gaul 1043e08dfa Remove uses of implicit namespace std
Fixed via:

sed -i '/using namespace std/{N;d}' src/*.cpp
sed -i 's/ string/ std::string/g' src/*.cpp
sed -i 's/(string/(std::string/g' src/*.cpp
sed -i 's/\[string/\[std::string/g' src/*.cpp
sed -i 's/^string/std::string/g' src/*.cpp
sed -i 's/ ifstream/ std::ifstream/g' src/*.cpp
sed -i 's/ istringstream/ std::istringstream/g' src/*.cpp
sed -i 's/ ostringstream/ std::ostringstream/g' src/*.cpp
sed -i 's/ max(/ std::max(/g' src/*.cpp
sed -i 's/ min(/ std::min(/g' src/*.cpp
sed -i 's/ endl/ std::endl/g' src/*.cpp
2020-09-13 11:57:20 +09:00
Andrew Gaul ffc33a447f Use 64-bit off_t when computing digests
This allows 32-bit platforms like Raspberry Pi to upload single-part
objects larger than 2 GB.
2020-09-12 15:00:23 +09:00
Takeshi Nakatani b5ffd419d8 Source file division and set 4 spaces and cleanup 2020-08-26 17:43:50 +09:00
Andrew Gaul 958ad83a4b Correct vim modeline to 2-space indentation 2020-08-19 21:03:46 +09:00
Andrew Gaul 40f7007263 Check results from pthread mutex calls
Also remove some unnecessary exception handling.
2020-05-30 16:37:55 +09:00
Andrew Gaul 461a346bf4 Sign request immediately before sending
Previously s3fs could create a long list of pre-signed requests which
could take longer than the default S3 clock skew limit of 15 minutes.
This also changes SHA-256 computation from single- to multi-threaded
since this is now computed in the worker threads.  Regression from
88cd8feb05.  Fixes #1019.
2019-08-29 15:35:27 -07:00
Andrew Gaul 43ec064fb9 Expand error checking to all pthread_mutex_t 2019-07-14 18:21:23 -07:00
Andrew Gaul 6fd42d9fe4 Prefer modern C headers
Found and fixed via clang-tidy.
2019-07-12 03:50:59 -07:00
Andrew Gaul 4893174652 Annotate OpenSSL locking functions as unused
OpenSSL 1.1.0 removed these and generates warnings with newer
versions.
2019-07-05 10:45:57 -07:00
Andrew Gaul 6f6a67807b Prefer new over malloc
The former cannot return NULL and will allow use of scoped pointers.
2019-04-07 16:54:24 +09:00
Andrew Gaul 35d55ee513 Remove unneeded void parameter
This is implicit in C++.  Found and fixed via clang-tidy.
2019-01-28 23:22:27 -08:00
Takeshi Nakatani 9d10a5aa70 Changed copyright year format for debian pkg 2017-05-07 11:24:17 +00:00
Andrew Gaul 03217baa99 Address cppcheck 1.77 warnings 2017-03-06 12:41:08 -08:00
Takeshi Nakatani 92e52dadd4 Changed and cleaned the logic for debug message. 2015-09-30 19:41:27 +00:00
Robb Kistler fcb55c2109 Fix mem leaks in openssl_auth.cpp, nss_auth.cpp
Fix memory leaks in openssl_auth.cpp:s3fs_sha256hexsum and
nss_auth.cpp:s3fs_sha256hexsum.  Leaks occur every time a file
is created.
2015-08-06 12:45:40 -07:00
Takeshi Nakatani 4f953f9bd7 Clean codes for signature v4 and added new sigv2 option 2015-01-28 17:13:11 +00:00
Takeshi Nakatani bb1f1d3faa Merged manually from caxapniy/s3fs-fuse/tree/1.77v4merge for signature v4 - #102 2015-01-20 16:31:36 +00:00
Takeshi Nakatani 28d82c9ccd Fixed #68(FreeBSD issue) 2014-10-22 14:21:01 +00:00
Andriy Senkovych 6633366218 Fix spelling errors 2014-10-01 13:42:39 +03:00
Takeshi Nakatani 7a7c7572ea Cleaned up codes for next packaging. 2014-09-07 15:08:27 +00:00
YAMASAKI Masahide f1ca5d0340 :set nobomb 2014-08-25 19:18:34 +09:00
Takeshi Nakatani 160196798b Changed initializing logic for nss lib/openssl lib/s3fs own. 2014-06-01 03:54:02 +00:00
Takeshi Nakatani cd27f0aa54 Supported another crypt libraries as GnuTLS and NSS, and added configure options 2014-05-06 14:23:05 +00:00