EXIT() needs to be in a function that returns int.
authorRichard Levitte <levitte@openssl.org>
Sun, 1 Dec 2002 01:23:35 +0000 (01:23 +0000)
committerRichard Levitte <levitte@openssl.org>
Sun, 1 Dec 2002 01:23:35 +0000 (01:23 +0000)
crypto/dsa/dsatest.c
crypto/evp/evp_test.c

index 4c411f2c8c2786176cef1190877ea8eef8530c96..3fb434d7926c98cf84af100a113543c68f9363e7 100644 (file)
@@ -219,6 +219,11 @@ end:
        return(0);
        }
 
+static int cb_exit(int ec)
+       {
+       EXIT(ec);
+       }
+
 static void MS_CALLBACK dsa_cb(int p, int n, void *arg)
        {
        char c='*';
@@ -234,7 +239,7 @@ static void MS_CALLBACK dsa_cb(int p, int n, void *arg)
        if (!ok && (p == 0) && (num > 1))
                {
                BIO_printf((BIO *)arg,"error in dsatest\n");
-               EXIT(1);
+               cb_exit(1);
                }
        }
 #endif
index 447a431a04383f896cc4fd0e2522193091b8de5b..22006d90926530772844263596b279603ab26011 100644 (file)
@@ -123,6 +123,11 @@ static char *sstrsep(char **string, const char *delim)
 static unsigned char *ustrsep(char **p,const char *sep)
     { return (unsigned char *)sstrsep(p,sep); }
 
+static int test1_exit(int ec)
+       {
+       EXIT(ec);
+       }
+
 static void test1(const EVP_CIPHER *c,const unsigned char *key,int kn,
                  const unsigned char *iv,int in,
                  const unsigned char *plaintext,int pn,
@@ -145,7 +150,7 @@ static void test1(const EVP_CIPHER *c,const unsigned char *key,int kn,
        {
        fprintf(stderr,"Key length doesn't match, got %d expected %d\n",kn,
                c->key_len);
-       EXIT(5);
+       test1_exit(5);
        }
     EVP_CIPHER_CTX_init(&ctx);
     if (encdec != 0)
@@ -153,26 +158,26 @@ static void test1(const EVP_CIPHER *c,const unsigned char *key,int kn,
        if(!EVP_EncryptInit_ex(&ctx,c,NULL,key,iv))
            {
            fprintf(stderr,"EncryptInit failed\n");
-           EXIT(10);
+           test1_exit(10);
            }
        EVP_CIPHER_CTX_set_padding(&ctx,0);
 
        if(!EVP_EncryptUpdate(&ctx,out,&outl,plaintext,pn))
            {
            fprintf(stderr,"Encrypt failed\n");
-           EXIT(6);
+           test1_exit(6);
            }
        if(!EVP_EncryptFinal_ex(&ctx,out+outl,&outl2))
            {
            fprintf(stderr,"EncryptFinal failed\n");
-           EXIT(7);
+           test1_exit(7);
            }
 
        if(outl+outl2 != cn)
            {
            fprintf(stderr,"Ciphertext length mismatch got %d expected %d\n",
                    outl+outl2,cn);
-           EXIT(8);
+           test1_exit(8);
            }
 
        if(memcmp(out,ciphertext,cn))
@@ -180,7 +185,7 @@ static void test1(const EVP_CIPHER *c,const unsigned char *key,int kn,
            fprintf(stderr,"Ciphertext mismatch\n");
            hexdump(stderr,"Got",out,cn);
            hexdump(stderr,"Expected",ciphertext,cn);
-           EXIT(9);
+           test1_exit(9);
            }
        }
 
@@ -189,26 +194,26 @@ static void test1(const EVP_CIPHER *c,const unsigned char *key,int kn,
        if(!EVP_DecryptInit_ex(&ctx,c,NULL,key,iv))
            {
            fprintf(stderr,"DecryptInit failed\n");
-           EXIT(11);
+           test1_exit(11);
            }
        EVP_CIPHER_CTX_set_padding(&ctx,0);
 
        if(!EVP_DecryptUpdate(&ctx,out,&outl,ciphertext,cn))
            {
            fprintf(stderr,"Decrypt failed\n");
-           EXIT(6);
+           test1_exit(6);
            }
        if(!EVP_DecryptFinal_ex(&ctx,out+outl,&outl2))
            {
            fprintf(stderr,"DecryptFinal failed\n");
-           EXIT(7);
+           test1_exit(7);
            }
 
        if(outl+outl2 != cn)
            {
            fprintf(stderr,"Plaintext length mismatch got %d expected %d\n",
                    outl+outl2,cn);
-           EXIT(8);
+           test1_exit(8);
            }
 
        if(memcmp(out,plaintext,cn))
@@ -216,7 +221,7 @@ static void test1(const EVP_CIPHER *c,const unsigned char *key,int kn,
            fprintf(stderr,"Plaintext mismatch\n");
            hexdump(stderr,"Got",out,cn);
            hexdump(stderr,"Expected",plaintext,cn);
-           EXIT(9);
+           test1_exit(9);
            }
        }