Recent changes from 0.9.6-stable
authorRichard Levitte <levitte@openssl.org>
Tue, 3 Dec 2002 23:23:11 +0000 (23:23 +0000)
committerRichard Levitte <levitte@openssl.org>
Tue, 3 Dec 2002 23:23:11 +0000 (23:23 +0000)
34 files changed:
apps/asn1pars.c
apps/ca.c
apps/ciphers.c
apps/crl.c
apps/crl2p7.c
apps/dgst.c
apps/dh.c
apps/dhparam.c
apps/dsa.c
apps/dsaparam.c
apps/enc.c
apps/errstr.c
apps/gendh.c
apps/gendsa.c
apps/genrsa.c
apps/nseq.c
apps/openssl.c
apps/passwd.c
apps/pkcs12.c
apps/pkcs7.c
apps/rand.c
apps/req.c
apps/rsa.c
apps/s_client.c
apps/s_server.c
apps/s_time.c
apps/sess_id.c
apps/speed.c
apps/spkac.c
apps/verify.c
apps/version.c
apps/x509.c
crypto/mem_clr.c
e_os.h

index 5339166e088569ffdd9753eebe5a7cdb65444bda..8cc13ee2d1130a0fca9108932a574c06dfc7857b 100644 (file)
@@ -328,6 +328,6 @@ end:
        if (at != NULL) ASN1_TYPE_free(at);
        if (osk != NULL) sk_free(osk);
        OBJ_cleanup();
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 
index 71dd6756fc6e86bdaa25d20395642c03e694251c..b315f3f346c8f4bae0d8415649931c01d8791a85 100644 (file)
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -1307,7 +1307,7 @@ err:
        X509_CRL_free(crl);
        CONF_free(conf);
        OBJ_cleanup();
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 
 static void lookup_fail(char *name, char *tag)
index b6e2f966d86e78d7b01c097ea655fc4932920156..0dc30d65e4015b009b5970dbf7a90aecbed9a3d6 100644 (file)
@@ -202,6 +202,6 @@ end:
        if (ctx != NULL) SSL_CTX_free(ctx);
        if (ssl != NULL) SSL_free(ssl);
        if (STDout != NULL) BIO_free_all(STDout);
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 
index 3b5725f23f2c4335aed373140bd8ed991009e4f4..648a32ee4cf96a72d77a9a96ce17fd4d451e091f 100644 (file)
@@ -364,7 +364,7 @@ end:
                X509_STORE_CTX_cleanup(&ctx);
                X509_STORE_free(store);
        }
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 
 static X509_CRL *load_crl(char *infile, int format)
index 7f853b65ab2b13bb2cba055bbce53503965970ef..3ef55dd2bb4ecaa6874912da40ef498e60f6736a 100644 (file)
@@ -166,7 +166,7 @@ bad:
                BIO_printf(bio_err," -certfile arg  certificates file of chain to a trusted CA\n");
                BIO_printf(bio_err,"                (can be used more than once)\n");
                BIO_printf(bio_err," -nocrl         no crl to load, just certs from '-certfile'\n");
-               EXIT(1);
+               OPENSSL_EXIT(1);
                }
 
        ERR_load_crypto_strings();
@@ -278,7 +278,7 @@ end:
        if (p7 != NULL) PKCS7_free(p7);
        if (crl != NULL) X509_CRL_free(crl);
 
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 
 /*
index 05eeb8848570bd4275ea3d14a426cea60181f913..2086d8539d624a0941e704a36a434fb60c9e2972 100644 (file)
@@ -362,7 +362,7 @@ end:
        EVP_PKEY_free(sigkey);
        if(sigbuf) OPENSSL_free(sigbuf);
        if (bmd != NULL) BIO_free(bmd);
-       EXIT(err);
+       OPENSSL_EXIT(err);
        }
 
 void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
index 229ba2f63a2d5797ea37d595de32655c1423a47c..1198d155398df9797d823b90a0b958def2531cb9 100644 (file)
--- a/apps/dh.c
+++ b/apps/dh.c
@@ -346,6 +346,6 @@ end:
        if (in != NULL) BIO_free(in);
        if (out != NULL) BIO_free_all(out);
        if (dh != NULL) DH_free(dh);
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 #endif
index 9d5705f8bfb27a93fd32d1a19807bd805cedee5b..d946957f1623b7627247ef37d216471415fb0711 100644 (file)
@@ -532,7 +532,7 @@ end:
        if (in != NULL) BIO_free(in);
        if (out != NULL) BIO_free_all(out);
        if (dh != NULL) DH_free(dh);
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 
 /* dh_cb is identical to dsa_cb in apps/dsaparam.c */
index 49ca9003acff3246d6c4afd797a506d229f0677e..4dbd5d5c39a50778fc69106c2c7fafe9e57f84b7 100644 (file)
@@ -320,6 +320,6 @@ end:
        if(dsa != NULL) DSA_free(dsa);
        if(passin) OPENSSL_free(passin);
        if(passout) OPENSSL_free(passout);
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 #endif
index 0c2529e2859a0c8eec6c6350c759bdfd9f6682b1..ea29b0cf65af11944b97b4763a048fddfdebb4f2 100644 (file)
@@ -357,7 +357,7 @@ end:
        if (in != NULL) BIO_free(in);
        if (out != NULL) BIO_free_all(out);
        if (dsa != NULL) DSA_free(dsa);
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 
 static void MS_CALLBACK dsa_cb(int p, int n, void *arg)
index 418cb879c06a3610a12eeb637361bd41a364e257..6f3a879612643d21d7f7860d890419b3a5f7c1cc 100644 (file)
@@ -631,7 +631,7 @@ end:
        if (benc != NULL) BIO_free(benc);
        if (b64 != NULL) BIO_free(b64);
        if(pass) OPENSSL_free(pass);
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 
 int set_hex(char *in, unsigned char *out, int size)
index e392328f93d2656f84653e53c68de5f37495538f..de7d5fd6501ad7e5e5fd47178115d707ce9b146d 100644 (file)
@@ -121,5 +121,5 @@ int MAIN(int argc, char **argv)
                        ret++;
                        }
                }
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
index e81109eaac2780de64478f6892a0e6dd3969d0f2..d906b0441e37df66de6d5721cb799b7cc1496885 100644 (file)
@@ -211,7 +211,7 @@ end:
                ERR_print_errors(bio_err);
        if (out != NULL) BIO_free_all(out);
        if (dh != NULL) DH_free(dh);
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 
 static void MS_CALLBACK dh_cb(int p, int n, void *arg)
index 1c0ec371d272941d03ea8ab3c046f8f4d8fa4b6f..e7ec294031dc78ccd7d9812ed76c5cb38a6427a5 100644 (file)
@@ -247,6 +247,6 @@ end:
        if (out != NULL) BIO_free_all(out);
        if (dsa != NULL) DSA_free(dsa);
        if(passout) OPENSSL_free(passout);
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 #endif
index e7445e6a499bd55ebaf102d73022bed79ff6d72e..5ad2958ea65136d9243293f3723c28d93aefea65 100644 (file)
@@ -252,7 +252,7 @@ err:
        if(passout) OPENSSL_free(passout);
        if (ret != 0)
                ERR_print_errors(bio_err);
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 
 static void MS_CALLBACK genrsa_cb(int p, int n, void *arg)
index 1d73d1ad5231e2e6cdfa5e0a991e0bd019c4276c..da5277d4c4411a37ddbf8ba3025af7b010a59f78 100644 (file)
@@ -102,7 +102,7 @@ int MAIN(int argc, char **argv)
                BIO_printf (bio_err, "-in file  input file\n");
                BIO_printf (bio_err, "-out file output file\n");
                BIO_printf (bio_err, "-toseq    output NS Sequence file\n");
-               EXIT(1);
+               OPENSSL_EXIT(1);
        }
 
        if (infile) {
@@ -162,6 +162,6 @@ end:
        BIO_free_all(out);
        NETSCAPE_CERT_SEQUENCE_free(seq);
 
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
 }
 
index 55af53f3e2b52e0e6b759d7309e0b1f933a4b72d..95e1e00a8d04aa63f0781b9f1a4f48da16e031f8 100644 (file)
@@ -215,7 +215,7 @@ end:
                BIO_free(bio_err);
                bio_err=NULL;
                }
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 
 #define LIST_STANDARD_COMMANDS "list-standard-commands"
index ea2b089e24a73762fd027f997f5a34b5ef9e9487..eaa90312fc83446a7a8256d46236eecf475576a6 100644 (file)
@@ -284,7 +284,7 @@ err:
                BIO_free(in);
        if (out)
                BIO_free_all(out);
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 
 
@@ -498,6 +498,6 @@ err:
 int MAIN(int argc, char **argv)
        {
        fputs("Program not available.\n", stderr)
-       EXIT(1);
+       OPENSSL_EXIT(1);
        }
 #endif
index 196770fc041d38a3343b70490031d0c2cafc06ab..816f7c635f7927984f531369c5a4ffbaf8e417ed 100644 (file)
@@ -689,7 +689,7 @@ int MAIN(int argc, char **argv)
     if (canames) sk_free(canames);
     if(passin) OPENSSL_free(passin);
     if(passout) OPENSSL_free(passout);
-    EXIT(ret);
+    OPENSSL_EXIT(ret);
 }
 
 int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, char *pass,
index 68590c07847f84aae2c70df316ad89be25d3a65f..54afc8b14cd46efdbe5cc8efdaf8fdcc0a25e1cb 100644 (file)
@@ -163,7 +163,7 @@ bad:
                BIO_printf(bio_err," -text         print full details of certificates\n");
                BIO_printf(bio_err," -noout        don't output encoded data\n");
                BIO_printf(bio_err," -engine e     use engine e, possibly a hardware device.\n");
-               EXIT(1);
+               OPENSSL_EXIT(1);
                }
 
        ERR_load_crypto_strings();
@@ -316,5 +316,5 @@ end:
        if (p7 != NULL) PKCS7_free(p7);
        if (in != NULL) BIO_free(in);
        if (out != NULL) BIO_free_all(out);
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
index 8d95a52151bb773da47b09752d8b7f0d66a1fa41..b06057f7c88e290cd5ee8c01f0b728fff235d7da 100644 (file)
@@ -173,5 +173,5 @@ err:
        ERR_print_errors(bio_err);
        if (out)
                BIO_free_all(out);
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
index 9d80dd3b231285c75bb4938d3ce5a27e2d8d77e1..8a36e4ae1db77c91c20e37c27040b91753eb0b07 100644 (file)
@@ -949,7 +949,7 @@ end:
 #ifndef NO_DSA
        if (dsa_params != NULL) DSA_free(dsa_params);
 #endif
-       EXIT(ex);
+       OPENSSL_EXIT(ex);
        }
 
 static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, int attribs)
index 45ffaaa2825f46c34e6db5fae29c725c684720f4..89cb5c46c465f2332f3c9201f100b7b47d3d7404 100644 (file)
@@ -416,7 +416,7 @@ end:
        if(rsa != NULL) RSA_free(rsa);
        if(passin) OPENSSL_free(passin);
        if(passout) OPENSSL_free(passout);
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 #else /* !NO_RSA */
 
index 90bfda91e51a1c40163d1bab0bb7d67413650c4b..0b63a395e51d43a0a201f68b124aedd86298b6d2 100644 (file)
@@ -807,7 +807,7 @@ end:
                BIO_free(bio_c_out);
                bio_c_out=NULL;
                }
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 
 
index 85f530ecc9ce178575b43dbc328874122890e2e6..f81a206245f982827902adf97b4df633ccbdc850 100644 (file)
@@ -775,7 +775,7 @@ end:
                BIO_free(bio_s_out);
                bio_s_out=NULL;
                }
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 
 static void print_stats(BIO *bio, SSL_CTX *ssl_ctx)
index 2d8e2b24d228187517541b2658d86e6d432258c8..c8719a6a2200fcbce411cac6dc0d9781d2e143f5 100644 (file)
@@ -461,7 +461,7 @@ int MAIN(int argc, char **argv)
 
        if (tm_cipher == NULL ) {
                fprintf( stderr, "No CIPHER specified\n" );
-/*             EXIT(1); */
+/*             OPENSSL_EXIT(1); */
        }
 
        if (!(perform & 1)) goto next;
@@ -628,7 +628,7 @@ end:
                SSL_CTX_free(tm_ctx);
                tm_ctx=NULL;
                }
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 
 /***********************************************************************
index 60cc3f1e496a3d524e9c408f7c9aa99251e76473..cf15006ca72a846fd4281b17e3f4599757d860be 100644 (file)
@@ -272,7 +272,7 @@ bad:
 end:
        if (out != NULL) BIO_free_all(out);
        if (x != NULL) SSL_SESSION_free(x);
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 
 static SSL_SESSION *load_sess_id(char *infile, int format)
index 643a9a6df9c8f798a2b1b2505fa6da899e068185..67c0300be7f9e749b1788747b9d54360465ef199 100644 (file)
@@ -1447,7 +1447,7 @@ end:
                if (dsa_key[i] != NULL)
                        DSA_free(dsa_key[i]);
 #endif
-       EXIT(mret);
+       OPENSSL_EXIT(mret);
        }
 
 static void print_message(char *s, long num, int length)
index d7e46782f79e238365af53d12f22be53a66f5508..26a1d759f073734e0fb24c2dc0059c8c4e213cd3 100644 (file)
@@ -315,5 +315,5 @@ end:
        BIO_free(key);
        EVP_PKEY_free(pkey);
        if(passin) OPENSSL_free(passin);
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
index f384de6d296311bf718b83e72d1573c54d45192c..2f814314a81270d5cb6a6c0109ffc6300d5fdd04 100644 (file)
@@ -239,7 +239,7 @@ end:
        if (cert_ctx != NULL) X509_STORE_free(cert_ctx);
        sk_X509_pop_free(untrusted, X509_free);
        sk_X509_pop_free(trusted, X509_free);
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 
 static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, int purpose)
index f5c9adc25471c17e8f05ae54822c28ad15fb70e4..b67f2d18126cd22db004cf3139d3f2cf7054b0f9 100644 (file)
@@ -128,5 +128,5 @@ int MAIN(int argc, char **argv)
                }
        if (cflags)  printf("%s\n",SSLeay_version(SSLEAY_CFLAGS));
 end:
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
index a0e4e3564c85bc12cb3f48be4cdeaec6b7c44251..a9bc6835c9488bdd4cac50106425e7d514490deb 100644 (file)
@@ -988,7 +988,7 @@ end:
        sk_ASN1_OBJECT_pop_free(trust, ASN1_OBJECT_free);
        sk_ASN1_OBJECT_pop_free(reject, ASN1_OBJECT_free);
        if (passin) OPENSSL_free(passin);
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }
 
 static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
index 0b72966cfa1b480edb675d095e7458b17b887423..e4b7f540b0bd12dd03608b52e8214332cb1a8b72 100644 (file)
@@ -68,7 +68,7 @@ void OPENSSL_cleanse(void *ptr, size_t len)
        while(loop--)
                {
                *(p++) = cleanse_ctr;
-               cleanse_ctr += (17 + (((unsigned char *)&p)[sizeof(unsigned char *)-1] & 0xF));
+               cleanse_ctr += (17 + (unsigned char)((int)p & 0xF));
                }
        if(memchr(ptr, cleanse_ctr, len))
                cleanse_ctr += 63;
diff --git a/e_os.h b/e_os.h
index 30008fa781ad63d21fe1b50c3a8da68d5b335bb9..58df717722c466763e5382f8667269abb8f076b6 100644 (file)
--- a/e_os.h
+++ b/e_os.h
@@ -219,10 +219,11 @@ extern "C" {
 #    define _kbhit kbhit
 #  endif
 
-#  if defined(WIN16) && !defined(MONOLITH) && defined(SSLEAY) && defined(_WINEXITNOPERSIST)
-#    define EXIT(n) do { if (n == 0) _wsetexit(_WINEXITNOPERSIST); return(n); } while(0)
+#  if defined(WIN16) && defined(SSLEAY) && defined(_WINEXITNOPERSIST)
+#    define EXIT(n) _wsetexit(_WINEXITNOPERSIST)
+#    define OPENSSL_EXIT(n) do { if (n == 0) EXIT(n); return(n); } while(0)
 #  else
-#    define EXIT(n)            return(n)
+#    define EXIT(n) return(n)
 #  endif
 #  define LIST_SEPARATOR_CHAR ';'
 #  ifndef X_OK
@@ -275,18 +276,13 @@ extern "C" {
      the status is tagged as an error, which I believe is what is wanted here.
      -- Richard Levitte
   */
-#    if !defined(MONOLITH) || defined(OPENSSL_C)
-#      define EXIT(n)          do { int __VMS_EXIT = n; \
+#    define EXIT(n)            do { int __VMS_EXIT = n; \
                                      if (__VMS_EXIT == 0) \
                                       __VMS_EXIT = 1; \
                                     else \
                                       __VMS_EXIT = (n << 3) | 2; \
                                      __VMS_EXIT |= 0x10000000; \
-                                    exit(__VMS_EXIT); \
-                                    return(__VMS_EXIT); } while(0)
-#    else
-#      define EXIT(n)          return(n)
-#    endif
+                                    exit(__VMS_EXIT); } while(0)
 #    define NO_SYS_PARAM_H
 #  else
      /* !defined VMS */
@@ -317,11 +313,7 @@ extern "C" {
 #    define RFILE              ".rnd"
 #    define LIST_SEPARATOR_CHAR ':'
 #    define NUL_DEV            "/dev/null"
-#    ifndef MONOLITH
-#      define EXIT(n)          do { exit(n); return(n); } while(0)
-#    else
-#      define EXIT(n)          return(n)
-#    endif
+#    define EXIT(n)            exit(n)
 #  endif
 
 #  define SSLeay_getpid()      getpid()
@@ -441,6 +433,14 @@ extern char *sys_errlist[]; extern int sys_nerr;
        (((errnum)<0 || (errnum)>=sys_nerr) ? NULL : sys_errlist[errnum])
 #endif
 
+#ifndef OPENSSL_EXIT
+# if defined(MONOLITH) && !defined(OPENSSL_C)
+#  define OPENSSL_EXIT(n) return(n)
+# else
+#  define OPENSSL_EXIT(n) do { EXIT(n); return(n); } while(0)
+# endif
+#endif
+
 /***********************************************/
 
 /* do we need to do this for getenv.