crypto: s390 - fix aes,des ctr mode concurrency finding.
commit 3901c1124e upstream.
An additional testcase found an issue with the last
series of patches applied: the fallback solution may
not save the iv value after operation. This very small
fix just makes sure the iv is copied back to the
walk/desc struct.
Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d1ae1920b5
commit
c99612d30f
2 changed files with 6 additions and 0 deletions
|
|
@ -818,6 +818,9 @@ static int ctr_aes_crypt(struct blkcipher_desc *desc, long func,
|
|||
else
|
||||
memcpy(walk->iv, ctrptr, AES_BLOCK_SIZE);
|
||||
spin_unlock(&ctrblk_lock);
|
||||
} else {
|
||||
if (!nbytes)
|
||||
memcpy(walk->iv, ctrptr, AES_BLOCK_SIZE);
|
||||
}
|
||||
/*
|
||||
* final block may be < AES_BLOCK_SIZE, copy only nbytes
|
||||
|
|
|
|||
|
|
@ -429,6 +429,9 @@ static int ctr_desall_crypt(struct blkcipher_desc *desc, long func,
|
|||
else
|
||||
memcpy(walk->iv, ctrptr, DES_BLOCK_SIZE);
|
||||
spin_unlock(&ctrblk_lock);
|
||||
} else {
|
||||
if (!nbytes)
|
||||
memcpy(walk->iv, ctrptr, DES_BLOCK_SIZE);
|
||||
}
|
||||
/* final block may be < DES_BLOCK_SIZE, copy only nbytes */
|
||||
if (nbytes) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue