Home GnuPG

libgcrypt-1.5: rinjdael: Fix use of SSE2 outside USE_AESNI/ctx->use_aesni
e0139f73600eUnpublished

Unpublished Commit · Learn More

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

Description

libgcrypt-1.5: rinjdael: Fix use of SSE2 outside USE_AESNI/ctx->use_aesni

* cipher/rijndael.c (_gcry_aes_cbc_enc, _gcry_aes_cbc_dec): Check if
AES-NI is enabled before calling aesni_prepare() and aesni_cleanup().

aesni_cleanup() contains SSE2 instructions that are interpreted as MMX on CPUs
without SSE2 support (Pentium-III, etc). In above functions, aesni_cleanup()
was called outside use_aesni checks. This causes x87 register state to be
poisoned, causing crashes later on when program tries to use floating point
registers.

Add missing '#ifdef USE_AESNI' and 'if (ctx->use_aesni)' for aesni_cleanup()
and, while at it, for aesni_prepare() too.

  • Reported-by: Mitsutoshi NAKANO <bkbin005@rinku.zaq.ne.jp>
  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>

Details

Provenance
jukiviliAuthored on Jan 29 2013, 9:05 AM
wernerCommitted on Feb 19 2013, 11:30 AM
Parents
rCd30c86465fef: Fix segv with AES-NI on some platforms.
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rCe0139f73600e: libgcrypt-1.5: rinjdael: Fix use of SSE2 outside USE_AESNI/ctx->use_aesni (authored by Jussi Kivilinna <jussi.kivilinna@mbnet.fi>).Feb 19 2013, 11:30 AM