Eric Biggers d45a90cb5d crypto: sm3 - fix undefined shift by >= width of value
sm3_compress() calls rol32() with shift >= 32, which causes undefined
behavior.  This is easily detected by enabling CONFIG_UBSAN.

Explicitly AND with 31 to make the behavior well defined.

Fixes: 4f0fc1600edb ("crypto: sm3 - add OSCCA SM3 secure hash")
Cc: <stable@vger.kernel.org> # v4.15+
Cc: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2019-01-10 21:37:32 +08:00
..
2018-06-18 20:17:38 +05:30
2018-10-23 10:57:06 -07:00
2018-12-07 14:15:00 +08:00
2018-09-04 11:35:03 +08:00
2018-05-26 09:16:44 +02:00
2018-09-04 11:35:03 +08:00
2018-04-21 00:58:34 +08:00
2018-04-21 00:58:34 +08:00
2018-07-20 13:51:21 +08:00
2018-12-29 13:03:29 -08:00
2018-09-28 12:46:26 +08:00
2018-05-16 07:23:35 +02:00
2018-09-04 11:35:03 +08:00
2018-04-21 00:58:30 +08:00