File ocki-3.1_10_0001-ica-sha-update-empty-msg.patch of Package openCryptoki.2417
commit 2094b476ab7c14caecc37add2da43bba11b71bf5
Author: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Date: Fri Aug 15 12:48:46 2014 +0200
Fixed ica token's SHA update function when passing zero message size
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
--- opencryptoki-opencryptoki.orig/usr/lib/pkcs11/ica_s390_stdll/ica_specific.c 2013-06-10 11:09:36.000000000 -0600
+++ opencryptoki-opencryptoki/usr/lib/pkcs11/ica_s390_stdll/ica_specific.c 2014-09-05 10:14:40.814300000 -0600
@@ -797,7 +797,7 @@ token_specific_sha_update( DIGEST_CONTEX
* we're not stuck with 0 bytes when the MSG_PART_FINAL
* comes in. - KEY
*/
- if (!(in_data_len % SHA1_BLOCK_SIZE)) {
+ if (!(in_data_len % SHA1_BLOCK_SIZE) && (in_data_len != 0)) {
oc_sha_ctx->tail_len = SHA1_BLOCK_SIZE;
memcpy(oc_sha_ctx->tail,
in_data + in_data_len - SHA1_BLOCK_SIZE,