X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=apps%2Fopenssl.c;h=dfa23d674e4ed157f5ab0bb578f06958b4ef6884;hp=739a0e8f31c0f260793de5a824037d604ddc55f6;hb=90a52cecafb0f3280905df9121491fba6cbf30a6;hpb=dfeab0689f69c0b4bd3480ffd37a9cacc2f17d9c diff --git a/apps/openssl.c b/apps/openssl.c index 739a0e8f31..dfa23d674e 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -1,4 +1,4 @@ -/* apps/ssleay.c */ +/* apps/openssl.c */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -152,12 +152,14 @@ char *Argv[]; ERR_load_crypto_strings(); /* Lets load up our environment a little */ - p=getenv("SSLEAY_CONF"); + p=getenv("OPENSSL_CONF"); + if (p == NULL) + p=getenv("SSLEAY_CONF"); if (p == NULL) { strcpy(config_name,X509_get_default_cert_area()); strcat(config_name,"/lib/"); - strcat(config_name,SSLEAY_CONF); + strcat(config_name,OPENSSL_CONF); p=config_name; } @@ -191,7 +193,7 @@ char *Argv[]; goto end; } - /* ok, lets enter the old 'SSLeay>' mode */ + /* ok, lets enter the old 'OpenSSL>' mode */ for (;;) { @@ -204,7 +206,7 @@ char *Argv[]; p[0]='\0'; if (i++) prompt=">"; - else prompt="SSLeay>"; + else prompt="OpenSSL> "; fputs(prompt,stdout); fflush(stdout); fgets(p,n,stdin); @@ -278,10 +280,10 @@ char *argv[]; } else { - BIO_printf(bio_err,"'%s' is a bad command, valid commands are", + BIO_printf(bio_err,"openssl:Error: '%s' is an invalid command.\n", argv[0]); + BIO_printf(bio_err, "\nStandard commands"); i=0; - fp=functions; tp=0; for (fp=functions; fp->name != NULL; fp++) { @@ -299,27 +301,43 @@ char *argv[]; { i=1; BIO_printf(bio_err, - "Message Digest commands - see the dgst command for more details\n"); + "\nMessage Digest commands (see the `dgst' command for more details)\n"); } else if (tp == FUNC_TYPE_CIPHER) { i=1; - BIO_printf(bio_err,"Cipher commands - see the enc command for more details\n"); + BIO_printf(bio_err,"\nCipher commands (see the `enc' command for more details)\n"); } } BIO_printf(bio_err,"%-15s",fp->name); } - BIO_printf(bio_err,"\nquit\n"); + BIO_printf(bio_err,"\n\n"); ret=0; } end: return(ret); } +static int SortFnByName(const void *_f1,const void *_f2) + { + const FUNCTION *f1=_f1; + const FUNCTION *f2=_f2; + + if(f1->type != f2->type) + return f1->type-f2->type; + return strcmp(f1->name,f2->name); + } + static LHASH *prog_init() { LHASH *ret; FUNCTION *f; + int i; + + /* Purely so it looks nice when the user hits ? */ + for(i=0,f=functions ; f->name != NULL ; ++f,++i) + ; + qsort(functions,i,sizeof *functions,SortFnByName); if ((ret=lh_new(hash,cmp)) == NULL) return(NULL);