Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 227260
b: refs/heads/master
c: 078f8ec
h: refs/heads/master
v: v3
  • Loading branch information
Felix Beck authored and Martin Schwidefsky committed Jan 5, 2011
1 parent 06f1293 commit ec0cff1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c2567f8ffa2704f6f2f81013e9a590deca5a865f
refs/heads/master: 078f8ecaa30718694d1e13d9f415b7ce75b3c968
12 changes: 10 additions & 2 deletions trunk/drivers/s390/crypto/zcrypt_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,15 +396,23 @@ static long zcrypt_rsa_crt(struct ica_rsa_modexpo_crt *crt)
if (copied == 0) {
unsigned int len;
spin_unlock_bh(&zcrypt_device_lock);
/* len is max 256 / 2 - 120 = 8 */
len = crt->inputdatalength / 2 - 120;
/* len is max 256 / 2 - 120 = 8
* For bigger device just assume len of leading
* 0s is 8 as stated in the requirements for
* ica_rsa_modexpo_crt struct in zcrypt.h.
*/
if (crt->inputdatalength <= 256)
len = crt->inputdatalength / 2 - 120;
else
len = 8;
if (len > sizeof(z1))
return -EFAULT;
z1 = z2 = z3 = 0;
if (copy_from_user(&z1, crt->np_prime, len) ||
copy_from_user(&z2, crt->bp_key, len) ||
copy_from_user(&z3, crt->u_mult_inv, len))
return -EFAULT;
z1 = z2 = z3 = 0;
copied = 1;
/*
* We have to restart device lookup -
Expand Down

0 comments on commit ec0cff1

Please sign in to comment.