• Ovidiu Panait's avatar
    crypto: sahara - remove FLAGS_NEW_KEY logic · 8fd18343
    Ovidiu Panait authored
    Remove the FLAGS_NEW_KEY logic as it has the following issues:
    - the wrong key may end up being used when there are multiple data streams:
           t1            t2
        setkey()
        encrypt()
                       setkey()
                       encrypt()
    
        encrypt() <--- key from t2 is used
    - switching between encryption and decryption with the same key is not
      possible, as the hdr flags are only updated when a new setkey() is
      performed
    
    With this change, the key is always sent along with the cryptdata when
    performing encryption/decryption operations.
    
    Fixes: 5de88752 ("crypto: sahara - Add driver for SAHARA2 accelerator.")
    Signed-off-by: default avatarOvidiu Panait <ovidiu.panait@windriver.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    8fd18343
sahara.c 39.5 KB