[PATCH] Use u64 for CCM data lengths

Dmitry Eremin-Solenikov dbaryshkov at gmail.com
Sun Dec 15 22:02:40 CET 2013


Hello,


On Sun, Dec 15, 2013 at 6:04 PM, Jussi Kivilinna <jussi.kivilinna at iki.fi> wrote:
>
> * cipher/cipher-ccm.c: Move code inside [HAVE_U64_TYPEDEF].
> [!HAVE_U64_TYPEDEF] (_gcry_cipher_ccm_encrypt)
> (_gcry_cipher_ccm_decrypt, _gcry_cipher_ccm_set_nonce)
> (_gcry_cipher_ccm_authenticate, _gcry_cipher_ccm_get_tag)
> (_gcry_cipher_ccm_check_tag): Dummy functions returning
> GPG_ERROR_NOT_SUPPORTED.
> * cipher/cipher-internal.h (gcry_cipher_handle.u_mode.ccm)
> (_gcry_cipher_ccm_set_lengths): Move inside [HAVE_U64_TYPEDEF] and use
> u64 instead of size_t for CCM data lengths.
> * cipher/cipher.c (_gcry_cipher_open_internal, cipher_reset)
> (_gcry_cipher_ctl) [!HAVE_U64_TYPEDEF]: Return GPG_ERR_NOT_SUPPORTED
> for CCM.
> (_gcry_cipher_ctl) [HAVE_U64_TYPEDEF]: Use u64 for
> GCRYCTL_SET_CCM_LENGTHS length parameters.
> --
>

It's probably a little bit too late, but I'd also suggest to add a
testcase with really long
data, so that in future it can catch possible u64 vs. u32 length issues.


-- 
With best wishes
Dmitry



More information about the Gcrypt-devel mailing list