e20e14d2 | 01-Jun-2023 |
Richard Henderson <richard.henderson@linaro.org> |
crypto/aes: Add AES_SH, AES_ISH macros
These macros will constant fold and avoid the indirection through memory when fully unrolling some new primitives.
Acked-by: Daniel P. Berrangé <berrange@redh
crypto/aes: Add AES_SH, AES_ISH macros
These macros will constant fold and avoid the indirection through memory when fully unrolling some new primitives.
Acked-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
58660863 | 08-Oct-2022 |
Lei He <helei.sig11@bytedance.com> |
crypto: Support export akcipher to pkcs8
crypto: support export RSA private keys with PKCS#8 standard. So that users can upload this private key to linux kernel.
Signed-off-by: lei he <helei.sig11@
crypto: Support export akcipher to pkcs8
crypto: support export RSA private keys with PKCS#8 standard. So that users can upload this private key to linux kernel.
Signed-off-by: lei he <helei.sig11@bytedance.com> Message-Id: <20221008085030.70212-4-helei.sig11@bytedance.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
6c198932 | 05-Sep-2022 |
Daniel P. Berrangé <berrange@redhat.com> |
crypto: quote algorithm names in error messages
If given a malformed LUKS header, it is possible that the algorithm names end up being an empty string. This leads to confusing error messages unless
crypto: quote algorithm names in error messages
If given a malformed LUKS header, it is possible that the algorithm names end up being an empty string. This leads to confusing error messages unless quoting is used to highlight where the empty string is subsituted in the error message.
Reviewed-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
98c72dfb | 10-May-2022 |
Daniel P. Berrangé <berrange@redhat.com> |
crypto: split off helpers for converting LUKS header endianess
The unit test suite is shortly going to want to convert header endianness separately from the main I/O functions.
Reviewed-by: Richard
crypto: split off helpers for converting LUKS header endianess
The unit test suite is shortly going to want to convert header endianness separately from the main I/O functions.
Reviewed-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
36445ace | 10-May-2022 |
Daniel P. Berrangé <berrange@redhat.com> |
crypto: split LUKS header definitions off into file
This will allow unit testing code to use the structs.
Reviewed-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Daniel P. Berrangé <berr
crypto: split LUKS header definitions off into file
This will allow unit testing code to use the structs.
Reviewed-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
b57151ac | 05-Sep-2022 |
Daniel P. Berrangé <berrange@redhat.com> |
crypto: check that LUKS PBKDF2 iterations count is non-zero
Both the master key and key slot passphrases are run through the PBKDF2 algorithm. The iterations count is expected to be generally very l
crypto: check that LUKS PBKDF2 iterations count is non-zero
Both the master key and key slot passphrases are run through the PBKDF2 algorithm. The iterations count is expected to be generally very large (many 10's or 100's of 1000s). It is hard to define a low level cutoff, but we can certainly say that iterations count should be non-zero. A zero count likely indicates an initialization mistake so reject it.
Reviewed-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
c5f69628 | 05-Sep-2022 |
Daniel P. Berrangé <berrange@redhat.com> |
crypto: strengthen the check for key slots overlapping with LUKS header
The LUKS header data on disk is a fixed size, however, there's expected to be a gap between the end of the header and the firs
crypto: strengthen the check for key slots overlapping with LUKS header
The LUKS header data on disk is a fixed size, however, there's expected to be a gap between the end of the header and the first key slot to get alignment with the 2nd sector on 4k drives. This wasn't originally part of the LUKS spec, but was always part of the reference implementation, so it is worth validating this.
Reviewed-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
d233fbc3 | 05-Sep-2022 |
Daniel P. Berrangé <berrange@redhat.com> |
crypto: validate that LUKS payload doesn't overlap with header
We already validate that LUKS keyslots don't overlap with the header, or with each other. This closes the remaining hole in validation
crypto: validate that LUKS payload doesn't overlap with header
We already validate that LUKS keyslots don't overlap with the header, or with each other. This closes the remaining hole in validation of LUKS file regions.
Reviewed-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
93569c37 | 10-May-2022 |
Daniel P. Berrangé <berrange@redhat.com> |
crypto: enforce that key material doesn't overlap with LUKS header
We already check that key material doesn't overlap between key slots, and that it doesn't overlap with the payload. We didn't check
crypto: enforce that key material doesn't overlap with LUKS header
We already check that key material doesn't overlap between key slots, and that it doesn't overlap with the payload. We didn't check for overlap with the LUKS header.
Reviewed-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
f1195961 | 10-May-2022 |
Daniel P. Berrangé <berrange@redhat.com> |
crypto: enforce that LUKS stripes is always a fixed value
Although the LUKS stripes are encoded in the keyslot header and so potentially configurable, in pratice the cryptsetup impl mandates this ha
crypto: enforce that LUKS stripes is always a fixed value
Although the LUKS stripes are encoded in the keyslot header and so potentially configurable, in pratice the cryptsetup impl mandates this has the fixed value 4000. To avoid incompatibility apply the same enforcement in QEMU too. This also caps the memory usage for key material when QEMU tries to open a LUKS volume.
Reviewed-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
c1d8634c | 10-May-2022 |
Daniel P. Berrangé <berrange@redhat.com> |
crypto: sanity check that LUKS header strings are NUL-terminated
The LUKS spec requires that header strings are NUL-terminated, and our code relies on that. Protect against maliciously crafted heade
crypto: sanity check that LUKS header strings are NUL-terminated
The LUKS spec requires that header strings are NUL-terminated, and our code relies on that. Protect against maliciously crafted headers by adding validation.
Reviewed-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
3983bf1b | 28-Sep-2022 |
Daniel P. Berrangé <berrange@redhat.com> |
crypto: check for and report errors setting PSK credentials
If setting credentials fails, the handshake will later fail to complete with an obscure error message which is hard to diagnose.
Reviewed
crypto: check for and report errors setting PSK credentials
If setting credentials fails, the handshake will later fail to complete with an obscure error message which is hard to diagnose.
Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
e09d1c27 | 25-May-2022 |
Lei He <helei.sig11@bytedance.com> |
crypto: Implement RSA algorithm by gcrypt
Added gcryt implementation of RSA algorithm, RSA algorithm implemented by gcrypt has a higher priority than nettle because it supports raw padding.
Signed-
crypto: Implement RSA algorithm by gcrypt
Added gcryt implementation of RSA algorithm, RSA algorithm implemented by gcrypt has a higher priority than nettle because it supports raw padding.
Signed-off-by: lei he <helei.sig11@bytedance.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|