Ondrej Kozina
1e94425279
Remove unused parameter from crypto_backend_init.
2020-03-20 11:32:57 +01:00
Milan Broz
080566a1fd
Update copyright year.
2020-01-03 13:04:55 +01:00
Milan Broz
79019b1ced
Bitlk: Move crypt key handling to crypto backend.
2019-12-30 21:53:06 +01:00
Milan Broz
1192fd27c6
Add query for cipher implementation is used through kernel API.
2019-03-01 21:43:10 +01:00
Milan Broz
cd1cb40033
Use crypto library for ciphers if algorithms are available.
2019-03-01 21:34:22 +01:00
Milan Broz
fc37d81144
Move crypt_cipher to per-lib implementation.
...
For now, it calls kernel fallback only.
2019-03-01 21:14:13 +01:00
Milan Broz
a859455aad
Move block ciphers backend wrappers to per-library files.
...
For now it always fallbacks to kernel crypto API.
2019-03-01 21:10:50 +01:00
Milan Broz
93d596ace2
Introduce internal backend header.
...
And remove commented-out test vectors (moved to tests).
2019-03-01 20:39:33 +01:00
Milan Broz
91b74b6896
Fix some compiler warnings.
2019-02-07 17:14:47 +01:00
Milan Broz
a6f5ce8c7b
Update copyright year.
...
And unify name copyright format.
2019-01-25 09:45:57 +01:00
Milan Broz
5fcf430c81
Fix crypto backend for LibreSSL >= 2.7.0.
...
There are now OpenSSL 1.1.x API functions, no need for compatibility wrapper.
Fixes #393 .
2018-06-17 16:45:09 +02:00
Milan Broz
dee38e9c0b
Rename buffer to key in hmac_init in crypto backend.
...
It is key and naming was confusing.
2018-02-23 10:40:14 +01:00
Milan Broz
b4fc36ea62
Make all crypto backend destructors return void.
...
Nothing in the code actually checks the return values anyway.
2018-02-23 10:40:11 +01:00
Milan Broz
1fe014dbae
Update copyright year.
2018-01-20 17:55:21 +01:00
Milan Broz
86ef5475b9
Enable OpenSSL backend in FIPS mode.
...
Note that this is just for testing, primary FIPS backend is gcrypt.
2017-10-14 21:37:10 +02:00
Milan Broz
8dc35a7906
Enable to use system libargon2.
...
Rename --disable-argon2 to --disable-internal-argon2 option
and add --enable-libargon2 flag to allow system libarhgon2.
2017-10-04 15:24:26 +02:00
Milan Broz
677adc7adc
Add crypt_backend_destroy() function and cll it as library destructor.
2017-08-22 15:48:24 +02:00
Milan Broz
09d14a0b6c
Add Argon2 bundled library to crypto backend.
...
The Argon2i/id is a password hashing function that
won Password Hashing Competiton.
It will be (optionally) used in LUKS2 for passworrd-based
key derivation.
We have to bundle code for now (similar PBKDF2 years ago)
because there is yet no usable implementation in common
crypto libraries.
(Once there is native implementation, cryptsetup
will switch to the crypto library version.)
For now, we use reference (not optimized but portable) implementation.
This patch contains bundled Argon2 algorithm library copied from
https://github.com/P-H-C/phc-winner-argon2
For more info see Password Hashing Competition site:
https://password-hashing.net/
and draft of RFC document
https://datatracker.ietf.org/doc/draft-irtf-cfrg-argon2/
Signed-off-by: Milan Broz <gmazyland@gmail.com >
2017-08-06 21:13:12 +02:00
Milan Broz
98368c4770
Update copyright years.
2017-03-12 13:17:15 +01:00
Milan Broz
bca2bab560
Fix OpenSSL 1.1.0 compatibility
...
If backward-compatible API is not defined (-DOPENSSL_API_COMPAT=0x10100000L)
deprecated symbols cannot be used.
Also see https://bugs.gentoo.org/show_bug.cgi?id=604698
Thanks eroen for reporting this.
2017-01-05 09:06:31 +01:00
Aric Belsito
0e14147132
Fix use of LibreSSL.
2016-11-03 11:55:39 -07:00
Milan Broz
d4e8033fe0
Fix error path after conversion to OpenSSL 1.1.0.
2016-10-20 08:22:38 +02:00
Milan Broz
8f204b4e23
Support OpenSSL 1.1.0 in cryptsetup backend.
2016-10-19 15:27:01 +02:00
Per x Johansson
b181b0ef6e
Fix memory leak when using openssl backend
...
Fixes a memory leak when using openssl backend caused by mismatched
calls to EVP_DigestInit and EVP_DigestFinal_ex.
2016-10-18 14:05:49 +02:00
Milan Broz
f7b61b2617
Prevent compiler to optiize-out memset for on-stack variables.
...
Also see
https://cryptocoding.net/index.php/Coding_rules#Prevent_compiler_interference_with_security-critical_operations
The used code is inspired by the code in Blake2 implementation.
2015-01-11 20:26:45 +01:00
Milan Broz
9563aa33c8
Fix PBKDF2 for crypto backens which does not support long HMAC keys.
...
(Or it rehases key in every iteration.)
- Kernel backens seems not to support >20480 HMAC key
- NSS is slow (without proper key reset)
Add some test vectors (commented out by default).
2014-04-13 19:34:50 +02:00
Milan Broz
7eccb7ff50
Change License for sub-libraries from GPLv2 only to LGPLv2.1+ ("or any later")
...
This includes crypto, loopaes, tcrypt handling code I have written myself
and verity code written originally by Mikulas Patocka and modified by me,
copyright by Red Hat.
Other part of library have to stay GPLv2+ only for now
(no agreement from all authors).
2012-12-29 11:47:28 +01:00
Milan Broz
83f02e6682
Add copyright line for files I have written or modified.
2012-12-21 16:40:33 +01:00
Milan Broz
16ac703008
Move PBKDF2 into crypto backend wrapper.
...
Implement new KDF bechmark check.
Use internal openssl kdf (and prepare gcrypt one).
2012-11-19 21:17:55 +01:00
Milan Broz
11ee2876a6
Implement more RNG backend wrappers.
2012-05-27 01:09:40 +02:00
Milan Broz
20eea64334
Add version string to crypto backend.
...
Move fips check to libcryptsetup.
Clean up internal.h use.
2012-05-27 00:48:10 +02:00
Milan Broz
cf1e6fb847
Implement crypt RNG wrapper (for FIPS mode), use it for SALT and KEY RNG levels.
2012-05-21 14:32:39 +02:00
Milan Broz
ee8425b836
Version 1.4.2.
...
Add header and copyright for header files.
2012-04-02 22:03:05 +02:00
Milan Broz
7835b365a7
Fix FSF address in license text according to
...
http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@671 36d66b0a-2a48-0410-832c-cd162a569da5
2011-11-02 22:35:21 +00:00
Milan Broz
23e144daf4
* Remove hash/hmac restart from crypto backend and make it part of hash/hmac final.
...
Some backend implementation did reset context by default, so this
should create backend api consistent.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@578 36d66b0a-2a48-0410-832c-cd162a569da5
2011-07-25 15:24:04 +00:00
Milan Broz
5d2205a2f8
Fix verbose mode compiler warnings.
...
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@510 36d66b0a-2a48-0410-832c-cd162a569da5
2011-04-18 10:52:02 +00:00
Milan Broz
143603c471
Fix some minor compilation problems in crypto backends.
...
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@463 36d66b0a-2a48-0410-832c-cd162a569da5
2011-03-14 16:44:56 +00:00
Milan Broz
ddcdd76cc2
Specify copyright holders in source files.
...
Add README notes.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@461 36d66b0a-2a48-0410-832c-cd162a569da5
2011-03-14 14:17:38 +00:00
Milan Broz
af87ffbd37
Add context to crypto backend init (so it can print errors to callback).
...
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@415 36d66b0a-2a48-0410-832c-cd162a569da5
2011-01-16 10:40:57 +00:00
Milan Broz
f48c312fc7
Prevent to initialise backends twice.
...
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@414 36d66b0a-2a48-0410-832c-cd162a569da5
2011-01-16 10:38:55 +00:00
Milan Broz
7b6eda0d27
Add skeleton and implementation of various crypto backends
...
(gcrypt, OpenSSL, NSS and kernel crypto API supported for now).
There backends will be used for LUKS and plain passphrase hashing.
(Not yet used without following patches).
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@407 36d66b0a-2a48-0410-832c-cd162a569da5
2010-12-31 14:33:33 +00:00