Hi,
I was exaggerating the size of the patch. It is in fact quite small, sorry:(
Here is the openssl apps patch though to fix the problems I
have found with the apps only capable of running once
(when running and never exiting) due to global variables.
The patch could maybe also fix probs with running apps
repeatedly from the openssl prompt 'OpenSSL>' since it
is almost the same situation.
Thanks,
/Lennart
[EMAIL PROTECTED]
diff -ur3 /usr/local/src/openssl-0.9.4/apps/apps.c latest/apps/apps.c
--- /usr/local/src/openssl-0.9.4/apps/apps.c Mon Jun 7 19:26:39 1999
+++ latest/apps/apps.c Fri Sep 3 14:11:31 1999
@@ -91,7 +91,7 @@
*argv=NULL;
len=(unsigned int)stbuf.st_size;
- if (buf != NULL) Free(buf);
+ if (buf != NULL) { Free(buf); buf = NULL; }
buf=(char *)Malloc(len+1);
if (buf == NULL) return(0);
@@ -102,7 +102,7 @@
i=0;
for (p=buf; *p; p++)
if (*p == '\n') i++;
- if (arg != NULL) Free(arg);
+ if (arg != NULL) { Free(arg); arg = NULL; }
arg=(char **)Malloc(sizeof(char *)*(i*2));
*argv=arg;
diff -ur3 /usr/local/src/openssl-0.9.4/apps/ca.c latest/apps/ca.c
--- /usr/local/src/openssl-0.9.4/apps/ca.c Fri Aug 6 20:47:09 1999
+++ latest/apps/ca.c Fri Sep 3 14:16:48 1999
@@ -1221,6 +1221,7 @@
X509_free(x509);
X509_CRL_free(crl);
CONF_free(conf);
+ conf = NULL;
X509V3_EXT_cleanup();
OBJ_cleanup();
EXIT(ret);
diff -ur3 /usr/local/src/openssl-0.9.4/apps/crl.c latest/apps/crl.c
--- /usr/local/src/openssl-0.9.4/apps/crl.c Wed Jul 21 19:56:57 1999
+++ latest/apps/crl.c Fri Sep 3 14:22:16 1999
@@ -250,6 +250,7 @@
end:
BIO_free(out);
BIO_free(bio_out);
+ bio_out = NULL;
X509_CRL_free(x);
X509V3_EXT_cleanup();
EXIT(ret);
diff -ur3 /usr/local/src/openssl-0.9.4/apps/req.c latest/apps/req.c
--- /usr/local/src/openssl-0.9.4/apps/req.c Wed Jul 21 19:56:58 1999
+++ latest/apps/req.c Fri Sep 3 14:33:43 1999
@@ -801,7 +801,7 @@
{
ERR_print_errors(bio_err);
}
- if ((req_conf != NULL) && (req_conf != config)) CONF_free(req_conf);
+ if ((req_conf != NULL) && (req_conf != config)) { CONF_free(req_conf);
req_conf = NULL; }
BIO_free(in);
BIO_free(out);
EVP_PKEY_free(pkey);
diff -ur3 /usr/local/src/openssl-0.9.4/apps/s_server.c latest/apps/s_server.c
--- /usr/local/src/openssl-0.9.4/apps/s_server.c Sun Aug 8 13:21:04 1999
+++ latest/apps/s_server.c Fri Sep 3 14:38:00 1999
@@ -109,7 +109,7 @@
static DH *load_dh_param(void );
static DH *get_dh512(void);
#endif
-/* static void s_server_init(void);*/
+static void s_server_init(void);
#ifndef S_ISDIR
# if defined(_S_IFMT) && defined(_S_IFDIR)
@@ -179,7 +179,6 @@
static int s_debug=0;
static int s_quiet=0;
-#if 0
static void s_server_init(void)
{
cipher=NULL;
@@ -199,7 +198,6 @@
s_debug=0;
s_quiet=0;
}
-#endif
static void sv_usage(void)
{
@@ -425,6 +423,7 @@
local_argv=argv;
apps_startup();
+ s_server_init();
s_quiet=0;
s_debug=0;
begin:vcard
n:Bang;Lennart
tel;cell:+46 70 733 14 70
tel;fax:+46 8 446 34 64
tel;work:+46 8 446 34 67
x-mozilla-html:TRUE
url:www.netstream.se
org:NetStream AB;Networking department
version:2.1
email;internet:[EMAIL PROTECTED]
title:CEO | http://www.netstream.se
adr;quoted-printable:;;Enhagsbacken 9=0D=0A;S-187 40 Taby;;;Sweden
fn:Lennart Bang
end:vcard