Hi,
we found a bug in libica 2.0.2.
This causes an illegal instruction error, when libica is in use while 
CPACF is disabled. 
The problem was fixed in s390_prng.c
 
Also attached a minor wording fix in icastats.c
This changes the output  from SHAXXX to SHA-XXX",   e.g.:  SHA256 to 
SHA-256.

below is the patch, pls have a look
Thanks

RCS file: /cvsroot/opencryptoki/libica/src/icastats.c,v
retrieving revision 1.1
diff -u -r1.1 icastats.c
--- src/icastats.c      5 Feb 2009 16:49:17 -0000       1.1
+++ src/icastats.c      15 Apr 2010 15:59:05 -0000
@@ -16,11 +16,11 @@
 #include "include/icastats.h"

 const char *const STATS_DESC[ICA_NUM_STATS] = {
-       "SHA1",
-       "SHA224",
-       "SHA256",
-       "SHA384",
-       "SHA512",
+       "SHA-1",
+       "SHA-224",
+       "SHA-256",
+       "SHA-384",
+       "SHA-512",
        "RANDOM",
        "MOD EXPO",
        "RSA CRT",
Index: src/s390_prng.c
===================================================================
RCS file: /cvsroot/opencryptoki/libica/src/s390_prng.c,v
retrieving revision 1.2
diff -u -r1.2 s390_prng.c
--- src/s390_prng.c     12 Aug 2009 08:46:45 -0000      1.2
+++ src/s390_prng.c     15 Apr 2010 15:59:05 -0000
@@ -96,19 +96,22 @@
        unsigned char entropy[4 * 8];
        unsigned int K;
        int rc = 0;
+       struct sigaction oldact;
+       sigset_t oldset;
+
+       if (begin_sigill_section(&oldact, &oldset) != 0)
+               return errno;

        for (K = 0; K < 16; K++) {
-               if ((rc = s390_stck(entropy + 0 * 8)))
-                       return EIO;
-               if ((rc = s390_stck(entropy + 1 * 8)))
-                       return EIO;
-               if ((rc = s390_stck(entropy + 2 * 8)))
-                       return EIO;
-               if ((rc = s390_stck(entropy + 3 * 8)))
-                       return EIO;
-               if ((rc =
-                    s390_kmc(0x43, zPRNG_PB, entropy, entropy, 
sizeof(entropy))) < 0)
-                       return EIO;
+               if ((s390_stck(entropy + 0 * 8)) ||
+                   (s390_stck(entropy + 1 * 8)) ||
+                   (s390_stck(entropy + 2 * 8)) ||
+                   (s390_stck(entropy + 3 * 8)) ||
+                   (s390_kmc(0x43, zPRNG_PB, entropy, entropy,
+                    sizeof(entropy)) < 0)) {
+                       rc = -1;
+                       goto out;
+               }
                memcpy(zPRNG_PB, entropy, sizeof(entropy));
        }
        int handle;
@@ -123,14 +126,15 @@
                        rc = s390_kmc(0x43, zPRNG_PB, seed, seed,
                                      sizeof(seed));
                close(handle);
-               if (rc < 0)
-                       return EIO;
-               else
+               if (rc >= 0)
                        memcpy(zPRNG_PB, seed, sizeof(seed));
        }
-       if (rc > 0)
-               return 0;
-
+out:
+       if (rc >= 0)
+               rc = 0;
+       else
+               rc = EIO;
+       end_sigill_section(&oldact, &oldset);
        return rc;
 }



Mit freundlichen Grüßen / Kind regards

 




Ruben Straus


































 
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Opencryptoki-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opencryptoki-tech

Reply via email to