>+  *) Added inclusion of string.h in crypto/rsa/rsa_oaep_test.c so memcpy
>+     and memcmp would get correctly declared.
>+     [Richard Levitte <[EMAIL PROTECTED]>]

rsa_oaep_test should not return zero on error.

--- rsa_oaep_test.c~    Tue Mar  9 14:46:18 1999
+++ rsa_oaep_test.c     Tue Mar  9 14:56:35 1999
@@ -185,6 +185,7 @@
 
 int main() 
     {
+    int err = 0;
     int v;
     RSA *key;
     unsigned char ptext[256];
@@ -217,6 +218,7 @@
        if (num != clen)
            {
            printf("Encryption failed!\n");
+           err++;
            goto next;
            }
   
@@ -225,6 +227,7 @@
        if (num != plen || memcmp(ptext, ptext_ex, num) != 0)
            {
            printf("Decryption failed!\n");
+           err++;
            goto next;
            }
   
@@ -241,12 +244,15 @@
                                  RSA_PKCS1_OAEP_PADDING);
 
        if (num != plen || memcmp(ptext, ptext_ex, num) != 0)
+           {
+           err++;
            printf("Decryption failed!\n");
+           }
        else
-           printf("Encyption/decryption successful!\n");
+           printf("Encryption/decryption successful!\n");
 
     next:
        RSA_free(key);
        }
-    return (0);
+    return (err);
     }
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to