PPC assembly pack: fix copy-paste error in CTR mode
authorDaniel Axtens <dja@axtens.net>
Sun, 17 Mar 2019 23:22:44 +0000 (10:22 +1100)
committerPauli <paul.dale@oracle.com>
Mon, 18 Mar 2019 10:07:57 +0000 (20:07 +1000)
commit5dcfd6c50a216f81bf43e1f21bc5f3fc517ba47a
tree46326114058dadf9f2c3c29f38f59435b0787ee8
parent87d9429c7e8b2fd4396e0ad9e60351be467b5c96
PPC assembly pack: fix copy-paste error in CTR mode

There are two copy-paste errors in handling CTR mode. When dealing
with a 2 or 3 block tail, the code branches to the CBC decryption exit
path, rather than to the CTR exit path.

This can lead to data corruption: in the Linux kernel we have a copy
of this file, and the bug leads to corruption of the IV, which leads
to data corruption when we call the encryption function again later to
encrypt subsequent blocks.

Originally reported to the Linux kernel by Ondrej Mosnáček <omosnacek@gmail.com>

CLA: trivial

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/8510)

(cherry picked from commit f643deac417a3ccb27f77670bb2b136de49079d9)
crypto/aes/asm/aesp8-ppc.pl