Home GnuPG

cipher: Avoid NULL-segv in GCM mode if a key has not been set.
e709d86fe596Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

cipher: Avoid NULL-segv in GCM mode if a key has not been set.

* cipher/cipher-gcm.c (_gcry_cipher_gcm_encrypt): Check that GHASH_FN
has been initialized.
(_gcry_cipher_gcm_decrypt): Ditto.
(_gcry_cipher_gcm_authenticate): Ditto.
(_gcry_cipher_gcm_initiv): Ditto.
(_gcry_cipher_gcm_tag): Ditto.

Avoid a crash if certain functions are used before setkey.

One crash is not fixed, that is the crash when setkey is not invoked
before using the GCM ciphers (introduced in the 1.7.0 cycle). Either
these functions should check that the key is present, or they should
initialize the ghash table earlier. Affected functions:

  _gcry_cipher_gcm_encrypt
  _gcry_cipher_gcm_decrypt
  _gcry_cipher_gcm_authenticate
  _gcry_cipher_gcm_initiv
  (via _gcry_cipher_gcm_setiv)
  _gcry_cipher_gcm_tag
  (via _gcry_cipher_gcm_get_tag, _gcry_cipher_gcm_check_tag)

Details

Provenance
wernerAuthored on Mar 23 2016, 2:13 PM
Parents
rC7c9c82feecf9: cipher: Check length of supplied tag in _gcry_cipher_poly1305_check_tag.
Branches
Unknown
Tags
Unknown

Event Timeline