Home GnuPG

cipher: Add an API to retrieve unwrapped key length for KWP.

Description

cipher: Add an API to retrieve unwrapped key length for KWP.

* cipher/cipher-aeswrap.c (_gcry_cipher_keywrap_decrypt)
(_gcry_cipher_keywrap_decrypt_padding): Merged into...
(_gcry_cipher_keywrap_decrypt_auto): ... this.
Write length information to struct gcry_cipher_handle.
* cipher/cipher-internal.h (struct gcry_cipher_handle): Add
u_mode.wrap.
* cipher/cipher.c (_gcry_cipher_setup_mode_ops): Use
_gcry_cipher_keywrap_decrypt_auto.
(_gcry_cipher_info): Support GCRYCTL_GET_KEYLEN for
GCRY_CIPHER_MODE_AESWRAP.  Not that it's not length of KEK,
but length of unwrapped key.
* tests/aeswrap.c (check_one_with_padding): Add check
for length of unwrapped key.

Details

Provenance
gniibeAuthored on Jan 5 2022, 4:05 AM
Parents
rCf9ba07942b10: cipher: Use const for *_spec_t, if possible.
Branches
Unknown
Tags
Unknown
Tasks
T5752: libgcrypt: Adding aes-wrap-pad (RFC5649) support