Commit Graph

243 Commits

Author SHA1 Message Date
Sebastian Messmer 1f363fce62 Introduce Allocators to cpputils::Data 2018-09-11 18:49:13 -07:00
Sebastian Messmer 498c9da860 Fix CI for osx 2018-09-10 13:11:00 -07:00
Sebastian Messmer 9b990b4fd1 Fix CaptureStderrRAII for Windows 2018-09-07 19:13:16 -07:00
Sebastian Messmer 916632279b Test cases might set the top level handler multiple times, so we have to allow that 2018-09-07 08:54:45 -07:00
Sebastian Messmer fafbbb8e3a Portable way to ask for password 2018-09-03 16:51:59 -07:00
Sebastian Messmer 4778c28898 Some MSVC fixes 2018-09-03 16:06:54 -07:00
Sebastian Messmer cb96a5fc0a Portable setenv 2018-09-03 16:06:46 -07:00
Sebastian Messmer 873c51962f Make filetime test cases work on Windows 2018-09-03 02:33:03 -07:00
Sebastian Messmer 79ba320714 Fix logger for windows 2018-08-07 18:33:36 -07:00
Sebastian Messmer 76969171c7 Fix time::now() on windows and simplify implementation 2018-08-07 18:07:51 -07:00
Sebastian Messmer 355da63a1d Fix top level exception handler on Windows 2018-08-01 17:13:31 -07:00
Sebastian Messmer 1b577d000c Fixes for MSVC 2018-07-17 21:08:17 -07:00
Sebastian Messmer 30874135a2 Further windows fixes 2018-07-08 20:06:59 -07:00
Sebastian Messmer 1dd88f0a67 Windows compatibility fixes 2018-07-08 19:47:40 -07:00
Sebastian Messmer 312ac2ec31 Merge fixes from windows branch 2018-06-08 23:18:10 -07:00
Sebastian Messmer 07ba168107 Finish IdValueType 2018-05-27 21:03:44 -07:00
Sebastian Messmer e266fa5e98 Add test cases 2018-05-23 23:57:09 -07:00
Sebastian Messmer 0e697eb1f6 Continue implementing ValueType. New approach. 2018-05-23 00:03:32 -07:00
Sebastian Messmer df2f1d7a2f Start implementing ValueType 2018-05-22 00:04:00 -07:00
Sebastian Messmer 04e3f0f34f Start 2018-05-21 23:11:51 -07:00
Sebastian Messmer bacc95f2f2 cpputils::free_disk_space_in_bytes for Windows 2018-05-20 19:22:46 -07:00
Sebastian Messmer e7110afe25 WARN_UNUSED_RESULT for windows 2018-05-20 19:22:46 -07:00
Sebastian Messmer 76dc5cbba8 Fix exception safety in subprocess 2018-05-20 19:22:46 -07:00
Sebastian Messmer aa4e3c7c08 Fix subprocess for Windows 2018-05-20 19:22:46 -07:00
Sebastian Messmer 2ea77d4c26 Use boost::filesystem::path more portably 2018-05-20 19:22:46 -07:00
Sebastian Messmer dfd6a0414f Fix subprocess for osx 2018-05-20 19:21:59 -07:00
Sebastian Messmer ca68102a50 Prefer repository-cryptopp to system installed one 2018-05-20 19:21:59 -07:00
Sebastian Messmer ccdb091a84 Fix subprocess on osx 2018-05-20 19:21:58 -07:00
Sebastian Messmer d0fb8b8412 Make ThreadSystem work on windows 2018-05-20 19:21:58 -07:00
Sebastian Messmer 736052b0ee Make daemonize() work on windows 2018-05-20 19:21:58 -07:00
Sebastian Messmer f2831c0426 Rewrite subprocess and add test cases for it 2018-05-20 19:21:58 -07:00
Sebastian Messmer 3296ae92f7 Make subprocess work on windows 2018-05-20 19:21:58 -07:00
Sebastian Messmer d7e95606f6 Backtrace library is only needed on linux 2018-05-20 19:21:58 -07:00
Sebastian Messmer e5d8bf82c3 Make DontEchoStdinToStdoutRAII work on windows 2018-05-20 19:21:58 -07:00
Sebastian Messmer eb8682887f Increased scrypt hardness to (N=1048576, r=4, p=8) to make it harder to crack the key while allowing cryfs to take advantage of multicore machines. 2018-05-20 19:21:09 -07:00
Sebastian Messmer fede748ff4 Use cryptopp scrypt instead of vendor/scrypt one 2018-05-20 19:21:09 -07:00
Sebastian Messmer 6dbee297ce Use cryptopp from vendor/ instead of system 2018-05-20 19:20:45 -07:00
Sebastian Messmer b49435f405 Fix logging for older compilers 2018-05-18 22:29:52 -07:00
Sebastian Messmer b715e18a59 Fix non-windows backtrace implementation 2018-05-18 22:29:41 -07:00
Sebastian Messmer e4d1f44c2a Cleanup CMakeLists.txt 2018-05-18 22:29:04 -07:00
0x4D616E75 5db592bcc2 fix loading of CURL and Backtracing library with CMake (#215)
to build on FreeBSD with default compiler (Clang 4.0)
2018-05-17 09:55:15 -07:00
Sebastian Messmer a686129243 Make cpputils::time::now() work on windows 2018-05-17 06:37:47 -07:00
Sebastian Messmer 9d872ea00c - Fix clash of our ERROR log level with the ERROR macro defined in windows
- Fix definition of log levels so msvc accepts them
2018-05-16 23:03:03 -07:00
Sebastian Messmer 6a37f750f4 Fix c++ standard violation (msvc complains otherwise) 2018-05-16 22:56:50 -07:00
Sebastian Messmer aeb4f8e852 Remove unnecessary file 2018-05-16 22:52:22 -07:00
Sebastian Messmer ec9931e09e - Test showBacktraceOnSigsegv
- Test that failed assertions show a backtrace
2018-05-16 22:42:03 -07:00
Sebastian Messmer 3563f4687d Add testcases for backtrace 2018-05-16 22:31:43 -07:00
Sebastian Messmer 1126d7bd10 - Make get_total_memory work for windows
- Add test cases for it
2018-05-16 22:22:42 -07:00
Sebastian Messmer 61cad69671 - Fix nanoseconds in clock_gettime for Mac
- Hide clock_gettime in favor of cpputils::time::now()
- Add test cases to cpputils::time::now()
2018-05-16 22:18:45 -07:00
Sebastian Messmer 3ccb46c537 Make DontSwapMemoryRAII work on windows 2018-05-16 21:48:27 -07:00
Sebastian Messmer 2888ea6efd - Make homedir work on windows
- add test cases for homedir
2018-05-16 21:34:01 -07:00
Sebastian Messmer c1bb081861 Remove unnecessary includes 2018-05-17 02:56:06 -07:00
Sebastian Messmer efbe606961 Make backtrace work on windows 2018-05-16 19:47:51 -07:00
Sebastian Messmer b97da2c735 Use XDG instead of /home/heinzi/.cryfs to store integrity data 2018-05-01 23:54:30 -07:00
Sebastian Messmer f90b7ad778 Merge from develop 2018-02-02 00:21:51 +00:00
Sebastian Messmer 5948f63fc8 When CryFS fails to load a file system, the process stops with a helpful error code, which can be used by GUI tools to show detailed messages. 2018-02-02 00:08:01 +00:00
Sebastian Messmer a0fa433f51 Merge from develop 2018-01-12 22:18:36 +00:00
Sebastian Messmer f439bf9d0f Remove c style casts and unaligned memory accesses 2017-12-03 19:01:41 +00:00
Sebastian Messmer d90e27eb11 Fix FakeAuthenticatedCipher test flakyness 2017-12-01 23:55:41 +00:00
Sebastian Messmer cc7b38b3c1 - run-clang-tidy.sh also runs on test cases.
- fix clang-tidy warnings in test cases
2017-12-01 15:01:49 +00:00
Sebastian Messmer 006d8b541a Remove unused either class 2017-12-01 15:01:24 +00:00
Sebastian Messmer 5fe3cada4c Enable some more clang-tidy checks and fix warnings 2017-10-29 16:35:10 +00:00
Sebastian Messmer e38af1001d Remove unused using statements 2017-10-29 15:47:46 +00:00
Sebastian Messmer 5b0fa8c2f7 Workaround clang-tidy warning on newer clang-tidy versions 2017-10-27 15:29:38 +01:00
Sebastian Messmer 27fba3252e std::malloc has implementation defined behavior for size=0. Handle this correctly. 2017-10-27 03:58:44 +01:00
Sebastian Messmer 8eac0f055f Fix clang-tidy warnings 2017-10-08 18:29:45 +01:00
Sebastian Messmer 8eda3bfcd5 Fix std::move misuse 2017-10-08 13:15:11 +01:00
Sebastian Messmer 3787777967 Optimize std::move use 2017-10-01 09:04:29 +01:00
Sebastian Messmer 7a5b23db13 Remember hashed filesystem key in local state so attacker can't replace it 2017-09-30 08:49:24 +01:00
Gerrit Toehgiono a05e4733ef Fixes compilation on FreeBSD 11.1 (RELEASE branch) (#173)
* get_total_memory.cpp: include types.h before sysctl.h (fixes size_t unknown on FreeBSD

* Include fuse.h also in FreeBSD

* update 'defined'-style (src/spp/fuse/params.h)
2017-09-28 10:18:02 -07:00
David Steele 18788bc3f8 Patch get_total_memory() for freebsd compatibility (#172) 2017-09-25 13:55:15 -07:00
Sebastian Messmer 73aab31ade Make LoopThread noncopyable 2017-09-19 20:16:47 +01:00
Sebastian Messmer f7c089ba47 Fix clang 5.0 compiler warnings 2017-09-16 17:45:15 +01:00
Sebastian Messmer e4acf4e9a8 Merge from develop 2017-09-16 17:14:51 +01:00
Sebastian Messmer 82587ca185 Workaround bug in gcc 6/7 for building unit tests 2017-09-12 22:12:01 +01:00
Sebastian Messmer 9516d4facc Further compatibility fixes for GCC 4.8 2017-09-10 14:27:14 +01:00
Sebastian Messmer fe1383b4ff Fix build 2017-09-09 14:44:01 +01:00
Sebastian Messmer 51e9ac39d2 GCC bug workaround 2017-09-09 14:40:34 +01:00
Christoph Gysin d963424630 fix pessimizing move warnings (#170)
This fixes warnings emitted by clang:

src/cpp-utils/data/Data.cpp:37:10:
warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move]
        return std::move(result);
               ^
src/blockstore/implementations/ondisk/OnDiskBlockStore.cpp:61:17:
warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
        auto result = std::move(OnDiskBlock::CreateOnDisk(_rootdir, key, std::move(data)));
                      ^
src/blobstore/implementations/onblocks/datatreestore/DataTree.cpp:249:10:
warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move]
        return std::move(chain);
               ^

See also:
http://vmpstr.blogspot.ch/2015/12/redundant-stdmove.html
2017-09-06 17:26:27 +01:00
Sebastian Messmer 7e56c46bb0 CryFS tells the operating system to not swap the encryption key to the disk (note: this is best-effort and cannot be guaranteed. Hibernation, for example, will still write the encryption key to the disk) 2017-09-05 00:43:43 +01:00
Sebastian Messmer ff34049787 Merge branch 'next' into newblockstore 2017-08-19 11:54:01 +01:00
Sebastian Messmer ade23f9b86 Merge branch 'develop' into next 2017-08-19 11:53:22 +01:00
Mouse 7abed14d63 Make compatible with the current Crypto++ master (#163)
* Make compatible with the current Crypto++ master

* Add auto-config and build script. Not important, just a time-saver.

* Address compatibility with Crypto++ 6.0 release, while maintaining compatibility
with the older Crypto++ releases.

* Polish comments in cryptopp_byte.h. Forgot to include it to RandomGeneratorThread - fixed.

* Late at night - forgot to fix the .cpp files that used ::byte...

* Renamed auto-config-and-run script

* Added comments/description, and commented out "make check" that fails anyway

* Changed the include guard to match the rest of the .h files

* Delete build script

* Update ChangeLog.txt

* Update ChangeLog.txt
2017-08-16 03:00:46 +01:00
Sebastian Messmer f22a9b2f0a Merge branch 'next' into newblockstore 2017-07-07 15:48:24 +02:00
Sebastian Messmer ec3bec07ff Assert that unique_ref is always defined and not nullptr 2017-04-10 15:14:02 -07:00
Sebastian Messmer 317088e449 Rename unique_ref::isValid to is_valid to comply with naming scheme of other functions 2017-04-10 14:16:30 -07:00
Sebastian Messmer 3d56b97052 Make unique_ref constructor explicit 2017-04-05 21:02:03 +01:00
Sebastian Messmer 636ed437aa Improve unique_ref tests 2017-04-05 20:48:00 +01:00
Sebastian Messmer ed9f224f19 Further unique_ref improvements 2017-04-03 19:08:41 +01:00
Sebastian Messmer 2fb61e7c71 Further improve unique_ref 2017-04-03 15:43:27 +01:00
Sebastian Messmer 9ada10db4d Improve unique_ref 2017-04-03 14:43:32 +01:00
Sebastian Messmer dbf54b9563 Add test cases for BlockStore2 and fix existing BlockStore2 implementations 2017-02-21 22:27:46 +00:00
Sebastian Messmer cab1c71cac Merge from develop 2017-02-04 19:18:00 +00:00
Sebastian Messmer 59afd50c28 Fix clang build 2017-02-04 19:17:17 +00:00
Sebastian Messmer 54e0ffce2e Merge branch 'develop' of github.com:cryfs/cryfs into develop 2017-02-04 19:03:32 +00:00
Sebastian Messmer 9a304fc52b Upgrade spdlog to 0.11.0 2017-02-04 19:03:20 +00:00
Sebastian Messmer 596d9d0426 Merge from develop 2017-02-04 14:38:14 +00:00
Sebastian Messmer 7267bb5be4 Fix buid on Mac OS X 2017-02-04 14:21:00 +00:00
Sebastian Messmer 42765c6be6 Merge from develop 2017-01-21 20:24:09 +00:00
Sebastian Messmer 681f415272 Use curl_global_init/curl_global_cleanup for cleaner shutdown of executable 2016-10-26 13:50:20 -07:00
Sebastian Messmer abae027538 Fix compiler error on FreeBSD 2016-10-20 10:35:29 +02:00
Sebastian Messmer 9d05b8571c Merge from develop 2016-10-13 18:30:27 +02:00
Sebastian Messmer bd74a5b762 More detailed error reporting if key derivation fails 2016-10-02 11:01:14 +02:00
Sebastian Messmer e009040264 Merge from develop 2016-09-25 02:53:35 +02:00
Sebastian Messmer 443298844e Fix test cases 2016-09-25 02:50:28 +02:00
Sebastian Messmer b027f8c007 Merge from develop 2016-09-24 20:43:54 +02:00
Sebastian Messmer 1e9fdc9aa7 Refactor noninteractive mode. All yes/no questions are forced to define a default that will be used in noninteractive mode. 2016-09-24 20:28:56 +02:00
Sebastian Messmer 1cf52b307d Fix locking in LockPool 2016-09-24 17:02:23 +02:00
Sebastian Messmer 46a2251e9d Fix potential (although improbable) deadlock 2016-09-24 11:01:22 +02:00
Sebastian Messmer e30656797b Add compatibility with Crypto++ 5.6.4 2016-09-24 09:39:37 +02:00
Sebastian Messmer 0cbb13ffbe Compatibility with older libcurl versions 2016-08-27 13:23:25 +02:00
Sebastian Messmer b315154f08 Merge from develop 2016-07-23 10:17:42 +02:00
Sebastian Messmer 6360d452fe Make compatible with libcurl >= 7.50 2016-07-23 09:04:50 +02:00
Sebastian Messmer a4ce49aef4 Fix unique_ref test cases 2016-07-22 14:07:06 +02:00
Sebastian Messmer f069733650 Fix warning on older gcc versions 2016-07-22 02:57:03 +02:00
Sebastian Messmer 457ca52eb3 Add assertions to unique_ref 2016-07-14 16:29:02 +02:00
Sebastian Messmer 2bc3b641aa Allow Data::FillWithZeroes on rvalue 2016-07-10 22:43:07 +02:00
Sebastian Messmer 7348f7c64d Add checks to Data::LoadFromFile() and Data::StoreToFile() 2016-07-06 15:28:14 -07:00
Sebastian Messmer ea3de7360c * Block versions don't have to be globally nondecreasing, but only per client id. This solves potential synchronization conflicts in a multi-client setting.
* Use cpputils::Serializer and cpputils::Deserializer instead of std::ifstream for storing/loading the block version list
2016-06-26 22:15:52 -07:00
Sebastian Messmer 389273a24f Test cases use a fake home directory for their configuration, so they don't clutter the actual home directory. 2016-06-26 22:15:52 -07:00
Sebastian Messmer a5391a854d Use VersionCountingBlockStore 2016-06-26 22:15:52 -07:00
Sebastian Messmer 1402f54fec Factor out platform inconsistency between Mac and Linux (stat.st_atim vs stat.st_atimespec) 2016-06-02 20:08:51 -07:00
Sebastian Messmer 3b98fc0390 Offer timespec comparison operators 2016-05-27 16:35:45 -07:00
Sebastian Messmer f6545bbcc3 Move fsblobstore::now() to cpputils 2016-05-27 15:46:05 -07:00
Sebastian Messmer c403ec6b48 Fix a potential deadlock in the cache 2016-04-26 18:09:42 -07:00
Sebastian Messmer 35ae3b9c24 Make clock_gettime adapter work if used multiple time 2016-02-26 12:37:37 +01:00
Sebastian Messmer d5a0b725fe Refactor interface for key derivation functions. This allows easily adding new (password based) key derivation functions. 2016-02-22 02:38:06 +01:00
Sebastian Messmer b8fdd2e941 Fix includes on Mac 2016-02-17 08:51:48 +01:00
Sebastian Messmer 35f4723b65 Fix compiler error 2016-02-17 00:24:40 +01:00
Sebastian Messmer 74288c81e4 Replace sysctl on Mac with a syscall that is supported in all kernels 2016-02-16 23:24:11 +01:00
Sebastian Messmer 7f1493ab92 Increase scrypt KDF effort for generating the config file key from the password 2016-02-16 20:35:51 +01:00
Sebastian Messmer 63d0b2b29d Fix compiling test cases on Debian 2016-02-14 18:17:37 +01:00
Sebastian Messmer e44c44334f Fix compile on Debian 8 (link it to a library it wants) 2016-02-14 16:54:29 +01:00
Sebastian Messmer 1e975f64f7 Improve error messages when libraries aren't found 2016-02-14 15:55:54 +01:00
Sebastian Messmer 0286f36cf6 Allow setting library locations using CMake parameters 2016-02-14 03:13:50 +01:00
Sebastian Messmer 80b113f0f1 Fix some more fuse tests 2016-02-14 02:23:54 +01:00
Sebastian Messmer 098f16a4fe Since Mac OS X doesn't support clock_gettime, implement it if running on Mac. 2016-02-13 02:46:00 +01:00
Sebastian Messmer ff62ef1b88 Don't use libc getpass() for asking the password anymore. It is deprecated and doesn't play nice with tools that want to pass in the password on stdin. Now we just use stdin. 2016-02-12 23:18:13 +01:00
Sebastian Messmer 31672e086c Fix includes after merging repositories 2016-02-11 15:19:58 +01:00
Sebastian Messmer 59474b10b6 Handle vendor libraries better in cmake 2016-02-11 14:01:59 +01:00
Sebastian Messmer 9088a3d366 Use lowercase for cmake function definitions and rename add_boost/enable_style_warnings/activate_cpp14 to target_add_boost/target_enable_style_warnings/target_activate_cpp14 2016-02-11 12:57:50 +01:00
Sebastian Messmer 1dcf36d38c Move fspp to its own subdirectories 2016-02-11 12:53:42 +01:00
Sebastian Messmer 92cf6fa66d Refactor directory layout to allow other modules in same repository 2016-02-11 12:04:49 +01:00