Commit Graph

111 Commits

Author SHA1 Message Date
Jonathan White
61c4fe8992
Formatting and consistency fixes 2018-01-13 14:23:29 -05:00
Janek Bevendorff
4592de8fb6
Make benchmark() method non-virtual 2018-01-13 14:23:28 -05:00
Janek Bevendorff
15648991fc
Refactor Kdf class, remove fields concept 2018-01-13 14:23:28 -05:00
Janek Bevendorff
0d6ca0945b
Reformat code, fix minor style issues, make kdf() getter const 2018-01-13 14:23:27 -05:00
angelsl
e5ec585f98
Use GCRY_MD_FLAG_SECURE in CryptoHash 2018-01-13 14:23:26 -05:00
angelsl
6a0d05e1ef
Add support for various algorithms for kdbx4
* Add SHA512 support to CryptoHash
* Add ChaCha20 support
* Add HMAC support
* Add new HmacBlockStream, used in KDBX 4
* Add support for ChaCha20 protected stream
2018-01-13 14:23:26 -05:00
angelsl
33974d710a
Move constants in KeePass2.h to KeePass2.cpp and add a list of KDFs and ciphers 2018-01-13 14:23:25 -05:00
angelsl
663b8dcb08
Remove unused SymmetricCipherSalsa20 2018-01-13 14:23:24 -05:00
angelsl
2e19af5032
Pull out KDFs into their own class hierarchy
In preparation for multiple KDFs in KDBX 4
2018-01-13 14:23:20 -05:00
Jonathan White
28ad6ed552 Merge branch 'master' into develop 2017-12-11 21:10:25 -05:00
Michal Kaptur
0ff75e7a88 Fixed memory leaks in non-gui tests
Fixed 2 memory leaks in production code and a few in testcases. As a
result leak_check_at_exit ASAN option does not need to turned off for
non-gui tests.
Smart pointers should be used elsewhere for consistency, but the sooner
this fixes are delivered, the lesser memory leaks are introduced.
2017-11-27 23:36:09 +01:00
Toni Spets
248ae9d4ba SymmetricCipher: Add keySize(), don't rely on state for sizes
This additionally makes keySize() and blockSize() work before
setting the key and IV. Required for SSH agent decryption.
2017-11-19 14:38:59 +02:00
Toni Spets
a81a5fa31b SymmetricCipher: Support CTR mode
Includes AES-256-CTR non-stream tests
2017-11-19 14:38:59 +02:00
Peter Nirschl
a895729b9e 🐛 Fix result propagation in SymmetricCipherGcrypt::process
The boolean 'ok' has always been set to true, regardless of possible errors.
2017-10-21 20:00:28 +02:00
rockihack
e53754d202
Fix build on mac os with qt 5.9.1 2017-10-03 15:01:54 -04:00
Timothy Redaelli
a01607e869
Add support for Twofish in KeePass2 code 2017-01-28 17:53:11 +01:00
Josh Soref
ca8ddd5f39 spelling: decrypt 2017-01-14 17:31:38 +01:00
Felix Geyer
7c7014d951 Drop obsolete GCRYPT_HAS_SALSA20 ifdef. 2016-10-02 21:44:33 -04:00
Felix Geyer
dc7b6623a9 Merge branch '2.0' 2015-10-11 10:44:30 +02:00
Felix Geyer
316a7e6fb7 Expose version of used libraries in the About dialog. 2015-10-10 17:10:29 +02:00
Felix Geyer
7fa0eddc5f Make C++11 mandatory. 2015-09-12 13:55:50 +02:00
Felix Geyer
60daa2b41b Require libgcrypt >= 1.6.0.
Remove our own Salsa20 implementation as libgcrypt ships one
with that version.
2015-09-12 13:51:49 +02:00
Felix Geyer
7db9c78855 Ignore libgcrypt errors in CryptoHash::CryptoHash().
Postponed until after 2.0 when I'll use excpetions.

Should be safe as we check basic functioning in Crypto::testSha256().
2015-05-14 20:44:17 +02:00
Felix Geyer
ade684d501 Crypto::selfTest(): test AES in ECB mode. 2015-05-10 00:02:08 +02:00
Felix Geyer
e0d4b4b625 Adapt Salsa20 backend to the new interface. 2015-05-09 23:21:50 +02:00
Felix Geyer
f6243675c9 Warn if result of processInPlace() is unchecked.
Fix callers accordingly.
2015-05-09 23:21:50 +02:00
Felix Geyer
a762cef0a9 Catch and handle all errors from libgcrypt. 2015-05-09 23:21:44 +02:00
Felix Geyer
a7f4e2d0cd Add Twofish tests to Crypto::selfTest(). 2015-05-09 18:15:01 +02:00
Felix Geyer
e41bf008e9 Use Q_BYTE_ORDER for endianness detection.
A hardcoded list of architectures is always incomplete.
2015-05-03 20:00:23 +02:00
Felix Geyer
0d6117bf4c Do some basic self-checks when initializing the crypto backend. 2014-06-15 11:17:40 +02:00
Felix Geyer
b9370c6e79 More careful null checking and member initalization. 2014-03-22 12:10:49 +01:00
Felix Geyer
2190260a68 Small optimization in SymmetricCipherGcrypt::processInPlace(). 2014-01-18 20:47:45 +01:00
Felix Geyer
0b6b149351 Use the libgcrypt SALSA20 cipher if available. 2014-01-12 13:42:56 +01:00
Felix Geyer
8c7e655274 Add compatibility with libgcrypt 1.6.
Closes #129
2014-01-12 12:39:39 +01:00
Felix Geyer
5daf0853c9 Coding style fixes. 2013-10-13 18:08:50 +02:00
Felix Geyer
7dde8a771f Use QUINT32_MAX in tests instead of hardcoding the number. 2013-10-12 19:11:57 +02:00
Felix Geyer
9c788a6e84 Support custom backends in Random.
Useful for tests.
2013-10-09 22:06:32 +02:00
Felix Geyer
e087baeb48 Avoid modulo bias in Random::randomUInt(). 2013-10-09 21:59:24 +02:00
Felix Geyer
6504b6f2bd Drop Qt module name from include statements.
This is a preparation to be able to build KeePassX against Qt 5.
2013-10-03 15:18:16 +02:00
Felix Geyer
e99e3ae6ca Initalize SymmetricCipherGcrypt::m_blockSize. 2013-04-29 22:31:50 +02:00
Felix Geyer
ecea101962 Return Q_NULLPTR instead of 0 when the return type is a pointer. 2012-07-23 14:58:57 +02:00
Felix Geyer
68155e8f89 Make use of Q_NULLPTR. 2012-06-29 14:15:16 +02:00
Felix Geyer
587a647c11 New TODO comment style.
Qt Creator 2.5 is able to parse those.
2012-05-11 12:39:06 +02:00
Felix Geyer
cf4e574c50 Support Twofish encrypted KeePass 1 databases.
Refs #2
2012-05-10 21:06:33 +02:00
Felix Geyer
cc6f524168 Add Tools::readFromDevice() and make FileKey use it. 2012-05-10 19:00:36 +02:00
Felix Geyer
8122ab2b2c Use quint64 everywhere for the transform rounds number. 2012-05-08 22:31:09 +02:00
Felix Geyer
d5fc1bf0b4 Improve performance of the key transformation. 2012-05-07 14:31:18 +02:00
Felix Geyer
3df2ad35cb Constification and some style fixes. 2012-04-23 21:09:01 +02:00
Felix Geyer
2e011d5362 Improve code style. 2012-04-18 22:08:22 +02:00
Felix Geyer
afb521c6bf Silence some unused variable warnings when building in release mode. 2012-04-18 16:07:58 +02:00
Felix Geyer
279585fff4 Mark some constructor as explicit. 2012-01-11 19:18:35 +01:00
Felix Geyer
11ccdd4c9c Add more Crypto::initalized() assertions. 2011-11-20 11:46:09 +01:00
Felix Geyer
bc63d18f68 Make sure gcrypt is initalized when SymmetricCipherGcrypt objects are created. 2011-11-20 10:24:12 +01:00
Felix Geyer
d4f02a78a7 Coding style fixes. 2011-07-08 14:51:14 +02:00
Felix Geyer
8335db4db5 Add Random::randomUInt() and Random::randomUIntRange(). 2011-07-08 14:40:42 +02:00
Felix Geyer
2c8da57ce5 Make some methods static. 2010-11-21 23:11:16 +01:00
Felix Geyer
a428464573 Add Salsa20 cipher.
Restructure SymmetricCipher implementation to allow multiple backends.
2010-11-21 16:19:27 +01:00
Felix Geyer
1678351d11 Enable and fix more warnings. 2010-09-18 20:31:14 +02:00
Felix Geyer
bb6ae3a014 Add reset() and blockSize(). 2010-09-13 23:18:31 +02:00
Felix Geyer
26de957a98 Indentation and variable naming fixes. 2010-09-13 23:16:28 +02:00
Felix Geyer
6a2034fa24 Add crypto classes and tests. Link to libgcrypt. 2010-09-11 19:49:30 +02:00