Call ENGINE_init() before trying to use keys from engine
[openssl.git] / apps / apps.c
index 6ca0f2b1bc5538f6f083ac3067f85a2a9854fc2d..9a58f17b671aa4963bd92b9ab00d3b726b906378 100644 (file)
@@ -188,7 +188,11 @@ static int ui_read(UI *ui, UI_STRING *uis)
                     return 1;
                 }
             }
-        default:
+            break;
+        case UIT_NONE:
+        case UIT_BOOLEAN:
+        case UIT_INFO:
+        case UIT_ERROR:
             break;
         }
     }
@@ -208,7 +212,11 @@ static int ui_write(UI *ui, UI_STRING *uis)
                 if (password && password[0] != '\0')
                     return 1;
             }
-        default:
+            break;
+        case UIT_NONE:
+        case UIT_BOOLEAN:
+        case UIT_INFO:
+        case UIT_ERROR:
             break;
         }
     }
@@ -1261,7 +1269,7 @@ ENGINE *setup_engine(const char *engine, int debug)
             ENGINE_ctrl(e, ENGINE_CTRL_SET_LOGSTREAM, 0, bio_err, 0);
         }
         ENGINE_ctrl_cmd(e, "SET_USER_INTERFACE", 0, ui_method, 0, 1);
-        if (!ENGINE_set_default(e, ENGINE_METHOD_ALL)) {
+        if (!ENGINE_init(e) || !ENGINE_set_default(e, ENGINE_METHOD_ALL)) {
             BIO_printf(bio_err, "can't use that engine\n");
             ERR_print_errors(bio_err);
             ENGINE_free(e);
@@ -2340,6 +2348,8 @@ int raw_read_stdin(void *buf, int siz)
         return (-1);
 }
 #elif defined(__VMS)
+#include <sys/socket.h>
+
 int raw_read_stdin(void *buf, int siz)
 {
     return recv(fileno_stdin(), buf, siz, 0);