update references to new RI RFC
[openssl.git] / apps / openssl.c
index 5d61d171cab3be8d4147a382450a7ef6447f240d..851e63973581fc191c42ad418154769dae01ecc5 100644 (file)
@@ -330,7 +330,8 @@ int main(int Argc, char *Argv[])
                        else    prompt="OpenSSL> ";
                        fputs(prompt,stdout);
                        fflush(stdout);
-                       fgets(p,n,stdin);
+                       if (!fgets(p,n,stdin))
+                               goto end;
                        if (p[0] == '\0') goto end;
                        i=strlen(p);
                        if (i <= 1) break;
@@ -392,6 +393,21 @@ static int do_cmd(LHASH_OF(FUNCTION) *prog, int argc, char *argv[])
                { ret=0; goto end; }
        f.name=argv[0];
        fp=lh_FUNCTION_retrieve(prog,&f);
+       if (fp == NULL)
+               {
+               if (EVP_get_digestbyname(argv[0]))
+                       {
+                       f.type = FUNC_TYPE_MD;
+                       f.func = dgst_main;
+                       fp = &f;
+                       }
+               else if (EVP_get_cipherbyname(argv[0]))
+                       {
+                       f.type = FUNC_TYPE_CIPHER;
+                       f.func = enc_main;
+                       fp = &f;
+                       }
+               }
        if (fp != NULL)
                {
                ret=fp->func(argc,argv);