23 Jan, 2019

1 commit

  • commit d45a90cb5d061fa7d411b974b950fe0b8bc5f265 upstream.

    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: # v4.15+
    Cc: Gilad Ben-Yossef
    Signed-off-by: Eric Biggers
    Signed-off-by: Herbert Xu
    Signed-off-by: Greg Kroah-Hartman

    Eric Biggers
     

09 Jul, 2018

1 commit

  • Many shash algorithms set .cra_flags = CRYPTO_ALG_TYPE_SHASH. But this
    is redundant with the C structure type ('struct shash_alg'), and
    crypto_register_shash() already sets the type flag automatically,
    clearing any type flag that was already there. Apparently the useless
    assignment has just been copy+pasted around.

    So, remove the useless assignment from all the shash algorithms.

    This patch shouldn't change any actual behavior.

    Signed-off-by: Eric Biggers
    Signed-off-by: Herbert Xu

    Eric Biggers
     

22 Sep, 2017

1 commit