Avoid warnings: add missing prototype, don't shadow.
[openssl.git] / apps / version.c
index 656b96278b046490d79efe2341c57c3133655f05..041da37e99afb4f3300849434297a13eecf0ba11 100644 (file)
 #include "apps.h"
 #include <openssl/evp.h>
 #include <openssl/crypto.h>
-#include <openssl/md2.h>
-#include <openssl/rc4.h>
-#include <openssl/des_old.h>
-#include <openssl/idea.h>
-#include <openssl/blowfish.h>
+#ifndef OPENSSL_NO_MD2
+# include <openssl/md2.h>
+#endif
+#ifndef OPENSSL_NO_RC4
+# include <openssl/rc4.h>
+#endif
+#ifndef OPENSSL_NO_DES
+# include <openssl/des.h>
+#endif
+#ifndef OPENSSL_NO_IDEA
+# include <openssl/idea.h>
+#endif
+#ifndef OPENSSL_NO_BF
+# include <openssl/blowfish.h>
+#endif
 
 #undef PROG
 #define PROG   version_main
@@ -162,7 +172,19 @@ int MAIN(int argc, char **argv)
                        }
                }
 
-       if (version) printf("%s\n",SSLeay_version(SSLEAY_VERSION));
+       if (version)
+               {
+               if (SSLeay() == SSLEAY_VERSION_NUMBER)
+                       {
+                       printf("%s\n",SSLeay_version(SSLEAY_VERSION));
+                       }
+               else
+                       {
+                       printf("%s (Library: %s)\n",
+                               OPENSSL_VERSION_TEXT,
+                               SSLeay_version(SSLEAY_VERSION));
+                       }
+               }
        if (date)    printf("%s\n",SSLeay_version(SSLEAY_BUILT_ON));
        if (platform) printf("%s\n",SSLeay_version(SSLEAY_PLATFORM));
        if (options) 
@@ -176,7 +198,7 @@ int MAIN(int argc, char **argv)
                printf("%s ",RC4_options());
 #endif
 #ifndef OPENSSL_NO_DES
-               printf("%s ",des_options());
+               printf("%s ",DES_options());
 #endif
 #ifndef OPENSSL_NO_IDEA
                printf("%s ",idea_options());
@@ -190,5 +212,5 @@ int MAIN(int argc, char **argv)
        if (dir)  printf("%s\n",SSLeay_version(SSLEAY_DIR));
 end:
        apps_shutdown();
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
        }