Dr Stephen Henson <[EMAIL PROTECTED]>:
> [EMAIL PROTECTED] wrote:

>> That seems very complicated.  How about doing this
>> in the Makefile
>> test: cipherlist
>> cipherlist: cipherlist.c
>>         ..usual CC rules.
>> And cipherlist is
>>         main()
>>         {
>> #ifndef NO_DES
>>         printf("des_cfb\ndes_ede_cfb\ndes_ede3_cfb\n...")
>> 
>> and so on.
>> Then the test is
>>         for I in `cipherlist` ; do

> Hmmm thats not portable to single Makefile stuff like Win32 which would
> need a special case of course.

> How about a 'test' application that works similar to the openssl
> application which has all the tests linked into it [...]

I don't think that this should be done -- enctest is just about using
openssl from shellscripts.  But if we combine these ideas, we get the
following:

Create, as a part of enc.c, a new application "cipherlist" or
"list-ciphers" or whatever that prints the list of all availabe
encryption applications (this is basically an extract of the error
message that openssl produces when you give an incorrect application
name):

     $ openssl list-ciphers
     base64
     bf
     bf-cbc
     bf-cfb
     bf-ecb
     [...]

The proper #ifdefs exist in progs.h (which really should be split up
into progs.h, which defines prototypes, and progs.c, which defines the
data object "functions"[1] and thus does not belong in a header file)

 [1]   FUNCTION functions[] = {
          {FUNC_TYPE_GENERAL,"verify",verify_main},
          {FUNC_TYPE_GENERAL,"asn1parse",asn1parse_main},
       etc. etc. etc.

Then, "testenc" would do the following:

for i in `$cmd list-ciphers`
do
        echo $i
        $cmd $i -bufsize 113 -e -k test < $test > $test.$i.cipher
        $cmd $i -bufsize 157 -d -k test < $test.$i.cipher >$test.$i.clear


Votes, please, on

 -  adding a "list-ciphers" application (or, to make things more
    coherent, "standard-commands", "message-digest-commands",
    "cipher-commands" applications that emit the respective lists from
    apps/openssl.c's standard error message)

and

 -  splitting prog.h in prog.c and prog.h.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to