• Dmitry Kasatkin's avatar
    crypto: omap-sham - hmac calculation bug fix for sha1 base hash · bf362759
    Dmitry Kasatkin authored
    This patch fixes 2 hmac inter-dependent bugs.
    
    1. "omap-sham: hash-in-progress is stored in hw format" commit introduced
    optimization where temporary hash had been stored in OMAP specific format
    (big endian).
    For SHA1 it is different to real hash format, which is little endian.
    Final HMAC value was calculated using incorrect hash.
    Because CONFIG_CRYPTO_MANAGER_TESTS was disabled this error remained
    unnoticed. After enabling this option, bug has been found.
    
    2. HMAC was calculated using temporrary hash value.
    For a single-request updates, temporary hash was the final one and
    HMAC result was correct. But in fact only the final hash had to be used.
    All crypto tests for HMAC produces only single request and
    could not catch the problem. This problem is fixed here.
    Signed-off-by: default avatarDmitry Kasatkin <dmitry.kasatkin@nokia.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    bf362759
omap-sham.c 30.7 KB