diff options
author | Eric Rossman <edrossma@us.ibm.com> | 2006-03-24 03:15:30 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-24 07:33:18 -0800 |
commit | 96641ee1e4a5154943774639478eb997f4ffb97e (patch) | |
tree | 2c63ffe5c068900c47f743c2d2e41107d153ddba /drivers/s390/crypto/z90hardware.c | |
parent | b6cba4ee31e7376fa363c4b89ca502ac5e17eac1 (diff) |
[PATCH] s390: CEX2A crt message length
Undetected edge case for CRT messages to CEX2A caused length to be too short,
thus truncating the message. The solution was to check a different variable
which actually determines which key type is being used.
Increment version number in z90main.c to correct level of 1.3.3, fix copyright
year and add comment about bitlength limit of CEX2A.
Signed-off-by: Eric Rossman <edrossma@us.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/s390/crypto/z90hardware.c')
-rw-r--r-- | drivers/s390/crypto/z90hardware.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/s390/crypto/z90hardware.c b/drivers/s390/crypto/z90hardware.c index 4141919da80..be60795f4a7 100644 --- a/drivers/s390/crypto/z90hardware.c +++ b/drivers/s390/crypto/z90hardware.c @@ -2214,7 +2214,7 @@ ICACRT_msg_to_type50CRT_msg(struct ica_rsa_modexpo_crt *icaMsg_p, long_len = 128; } - tmp_size = ((mod_len <= 128) ? TYPE50_CRB1_LEN : TYPE50_CRB2_LEN) + + tmp_size = ((long_len <= 64) ? TYPE50_CRB1_LEN : TYPE50_CRB2_LEN) + CALLER_HEADER; memset(z90cMsg_p, 0, tmp_size); @@ -2479,8 +2479,16 @@ convert_response(unsigned char *response, unsigned char *buffer, if (reply_code) switch (reply_code) { + case REP82_ERROR_MACHINE_FAILURE: + if (errh_p->type == TYPE82_RSP_CODE) + PRINTKW("Machine check failure\n"); + else + PRINTKW("Module failure\n"); + return REC_HARDWAR_ERR; case REP82_ERROR_OPERAND_INVALID: + return REC_OPERAND_INV; case REP88_ERROR_MESSAGE_MALFORMD: + PRINTKW("Message malformed\n"); return REC_OPERAND_INV; case REP82_ERROR_OPERAND_SIZE: return REC_OPERAND_SIZE; |