Implement known-IV countermeasure.
[openssl.git] / apps / pkcs8.c
index cfc4851e00a6ddd3a8904cfc94bcdc40f3c6152c..ba91caee6bb2a3eee9c50ecf4c61f69919402ebe 100644 (file)
@@ -62,7 +62,6 @@
 #include <openssl/err.h>
 #include <openssl/evp.h>
 #include <openssl/pkcs12.h>
-#include <openssl/engine.h>
 
 #include "apps.h"
 #define PROG pkcs8_main
@@ -84,13 +83,16 @@ int MAIN(int argc, char **argv)
        int nocrypt = 0;
        X509_SIG *p8;
        PKCS8_PRIV_KEY_INFO *p8inf;
-       EVP_PKEY *pkey;
+       EVP_PKEY *pkey=NULL;
        char pass[50], *passin = NULL, *passout = NULL, *p8pass = NULL;
        int badarg = 0;
        char *engine=NULL;
 
        if (bio_err == NULL) bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
 
+       if (!load_config(bio_err, NULL))
+               goto end;
+
        informat=FORMAT_PEM;
        outformat=FORMAT_PEM;
 
@@ -348,6 +350,7 @@ int MAIN(int argc, char **argv)
                        return (1);
        }
 
+       end:
        EVP_PKEY_free(pkey);
        BIO_free_all(out);
        BIO_free(in);