Fix to the -revoke option in ca. It was leaking memory, crashing and just
[openssl.git] / apps / pkcs8.c
index 9779081734bf36b39e91af38636e70225bf8a9b7..a05388300ad6128b198be7763236f3f6f51a81f7 100644 (file)
@@ -56,6 +56,7 @@
  *
  */
 #include <stdio.h>
+#include <string.h>
 #include <openssl/pem.h>
 #include <openssl/err.h>
 #include <openssl/evp.h>
@@ -160,7 +161,7 @@ int MAIN(int argc, char **argv)
        } else out = BIO_new_fp (stdout, BIO_NOCLOSE);
 
        if (topk8) {
-               if (!(pkey = PEM_read_bio_PrivateKey(in, NULL, NULL))) {
+               if (!(pkey = PEM_read_bio_PrivateKey(in, NULL, NULL, NULL))) {
                        BIO_printf (bio_err, "Error reading key\n", outfile);
                        ERR_print_errors(bio_err);
                        return (1);
@@ -209,7 +210,7 @@ int MAIN(int argc, char **argv)
 
        if(nocrypt) {
                if(informat == FORMAT_PEM) 
-                       p8inf = PEM_read_bio_PKCS8_PRIV_KEY_INFO(in,NULL,NULL);
+                       p8inf = PEM_read_bio_PKCS8_PRIV_KEY_INFO(in,NULL,NULL, NULL);
                else if(informat == FORMAT_ASN1)
                        p8inf = d2i_PKCS8_PRIV_KEY_INFO_bio(in, NULL);
                else {
@@ -218,7 +219,7 @@ int MAIN(int argc, char **argv)
                }
        } else {
                if(informat == FORMAT_PEM) 
-                       p8 = PEM_read_bio_PKCS8(in, NULL, NULL);
+                       p8 = PEM_read_bio_PKCS8(in, NULL, NULL, NULL);
                else if(informat == FORMAT_ASN1)
                        p8 = d2i_PKCS8_bio(in, NULL);
                else {
@@ -263,7 +264,7 @@ int MAIN(int argc, char **argv)
        
        PKCS8_PRIV_KEY_INFO_free(p8inf);
 
-       PEM_write_bio_PrivateKey(out, pkey, NULL, NULL, 0, NULL);
+       PEM_write_bio_PrivateKey(out, pkey, NULL, NULL, 0, NULL, NULL);
 
        EVP_PKEY_free(pkey);
        BIO_free(out);