That shouldn't be a problem since it gets either initialised by
a default config or by the config that you specify with
req -config. The initial assignment to NULL is never used.
Lennart B�ng schrieb:
>
> Hi,
>
> Writing to get your input on a problem I just ran into.
>
> I am in the process of porting all the apps/*.c to target
> in order to get the whole 'openssl' program running
> on OSE RTOS on a powerpc.
>
> The problem is that the programs use global variables
> and does not bother to clear them and the simple
> shell I am using on the RTOS does NOT clear
> the data before a program runs. Hence after one
> run of an openssl program, the variables have
> the same value as the last time the program ran... ack :(
>
> Pick 'req' as an example:
>
> static LHASH *req_conf=NULL; /* global */
>
> now in the 'req' function context:
> <<<snip>>
> req_conf=CONF_load(NULL,template,&errline);
> <<<snip>>>
> if ((req_conf != NULL) && (req_conf != config)) CONF_free(req_conf);
>
> Now lets say I run req to create a new key. The req_conf first gets
> loaded
> (hence non-NULL) and then in the end of the function it gets free'd. Now
>
> imagine the next time I type: 'openssl req ?' to see the params. This
> time
> req_conf does not get loaded but in the end of the function it gets
> free'd
> a second time since still non-NULL. Ouch :(
>
> So my question is. Do you want a huge patch for all the apps that
> properly
> restores statically initialized global data and clears global bss data
> after
> a run and/or will you enter that patch if you get it?
>
> Or alternatively, maybe I can play with the linker and see what I can
> do to cook up a function that clears only the openssl BSS. Will be
> trickier to restore the initializes openssl data though, mm.
>
> Any comments? And no, I can't make the rtos shell reinit programs
> when restarted :( It is a big lump of statically linked code that
> never exits...
>
> /Lennart Bang
> business: [EMAIL PROTECTED]
> private: [EMAIL PROTECTED]
>
>
>------------------------------------------------------------------------
>
> Lennart Bang <[EMAIL PROTECTED]>
> CEO | http://www.netstream.se
> NetStream AB
> Networking department
>
> Lennart Bang
> CEO | http://www.netstream.se <[EMAIL PROTECTED]>
> NetStream AB HTML-Mail
> Networking department
> Enhagsbacken 9 ;S-187 40 Taby;;;Sweden Mobiltel.: +46 70 733 14 70
> Fax: +46 8 446 34 64
> Gesch�ft: +46 8 446 34 67
> Weitere Informationen:
> Nachname Bang
> Vorname Lennart
> Version 2.1
--
Holger Reif Tel.: +49 361 74707-0
SmartRing GmbH Fax.: +49 361 7470720
Europaplatz 5 [EMAIL PROTECTED]
D-99091 Erfurt WWW.SmartRing.de
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]