Fix bug in copy_email() which would not
[openssl.git] / apps / pkcs12.c
index 365a8ada937d10a199894f350a8a425726d55533..17846cfba6e40b3ad4bb88bc50b598cf119119ee 100644 (file)
@@ -1,5 +1,5 @@
 /* pkcs12.c */
-#if !defined(NO_DES) && !defined(NO_SHA1)
+#if !defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_SHA1)
 
 /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
  * project 1999.
@@ -147,7 +147,7 @@ int MAIN(int argc, char **argv)
                        cert_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
                else if (!strcmp (*args, "-export")) export_cert = 1;
                else if (!strcmp (*args, "-des")) enc=EVP_des_cbc();
-#ifndef NO_IDEA
+#ifndef OPENSSL_NO_IDEA
                else if (!strcmp (*args, "-idea")) enc=EVP_idea_cbc();
 #endif
                else if (!strcmp (*args, "-des3")) enc = EVP_des_ede3_cbc();
@@ -272,7 +272,7 @@ int MAIN(int argc, char **argv)
        BIO_printf (bio_err, "-info         give info about PKCS#12 structure.\n");
        BIO_printf (bio_err, "-des          encrypt private keys with DES\n");
        BIO_printf (bio_err, "-des3         encrypt private keys with triple DES (default)\n");
-#ifndef NO_IDEA
+#ifndef OPENSSL_NO_IDEA
        BIO_printf (bio_err, "-idea         encrypt private keys with idea\n");
 #endif
        BIO_printf (bio_err, "-nodes        don't encrypt private keys\n");
@@ -375,7 +375,7 @@ int MAIN(int argc, char **argv)
 
     if (!outfile) {
        out = BIO_new_fp(stdout, BIO_NOCLOSE);
-#ifdef VMS
+#ifdef OPENSSL_SYS_VMS
        {
            BIO *tmpbio = BIO_new(BIO_f_linebuffer());
            out = BIO_push(tmpbio, out);
@@ -521,7 +521,7 @@ int MAIN(int argc, char **argv)
        for(i = 0; i < sk_X509_num(certs); i++) {
                X509 *cert = NULL;
                cert = sk_X509_value(certs, i);
-               bag = M_PKCS12_x5092certbag(cert);
+               bag = PKCS12_x5092certbag(cert);
                /* If it matches private key set id */
                if(cert == ucert) {
                        if(name) PKCS12_add_friendlyname(bag, name, -1);
@@ -592,9 +592,9 @@ int MAIN(int argc, char **argv)
        CRYPTO_push_info("building pkcs12");
 #endif
 
-       p12 = PKCS12_init (NID_pkcs7_data);
+       p12 = PKCS12_init(NID_pkcs7_data);
 
-       M_PKCS12_pack_authsafes (p12, safes);
+       PKCS12_pack_authsafes(p12, safes);
 
        sk_PKCS7_pop_free(safes, PKCS7_free);
        safes = NULL;
@@ -702,20 +702,20 @@ int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, char *pass,
        int i, bagnid;
        PKCS7 *p7;
 
-       if (!( asafes = M_PKCS12_unpack_authsafes (p12))) return 0;
+       if (!( asafes = PKCS12_unpack_authsafes(p12))) return 0;
        for (i = 0; i < sk_PKCS7_num (asafes); i++) {
                p7 = sk_PKCS7_value (asafes, i);
                bagnid = OBJ_obj2nid (p7->type);
                if (bagnid == NID_pkcs7_data) {
-                       bags = M_PKCS12_unpack_p7data (p7);
+                       bags = PKCS12_unpack_p7data(p7);
                        if (options & INFO) BIO_printf (bio_err, "PKCS7 Data\n");
                } else if (bagnid == NID_pkcs7_encrypted) {
                        if (options & INFO) {
-                               BIO_printf (bio_err, "PKCS7 Encrypted data: ");
-                               alg_print (bio_err, 
+                               BIO_printf(bio_err, "PKCS7 Encrypted data: ");
+                               alg_print(bio_err, 
                                        p7->d.encrypted->enc_data->algorithm);
                        }
-                       bags = M_PKCS12_unpack_p7encdata (p7, pass, passlen);
+                       bags = PKCS12_unpack_p7encdata(p7, pass, passlen);
                } else continue;
                if (!bags) return 0;
                if (!dump_certs_pkeys_bags (out, bags, pass, passlen, 
@@ -770,7 +770,7 @@ int dump_certs_pkeys_bag (BIO *out, PKCS12_SAFEBAG *bag, char *pass,
                }
                if (options & NOKEYS) return 1;
                print_attribs (out, bag->attrib, "Bag Attributes");
-               if (!(p8 = M_PKCS12_decrypt_skey (bag, pass, passlen)))
+               if (!(p8 = PKCS12_decrypt_skey(bag, pass, passlen)))
                                return 0;
                if (!(pkey = EVP_PKCS82PKEY (p8))) return 0;
                print_attribs (out, p8->attributes, "Key Attributes");
@@ -788,7 +788,7 @@ int dump_certs_pkeys_bag (BIO *out, PKCS12_SAFEBAG *bag, char *pass,
                print_attribs (out, bag->attrib, "Bag Attributes");
                if (M_PKCS12_cert_bag_type(bag) != NID_x509Certificate )
                                                                 return 1;
-               if (!(x509 = M_PKCS12_certbag2x509(bag))) return 0;
+               if (!(x509 = PKCS12_certbag2x509(bag))) return 0;
                dump_cert_text (out, x509);
                PEM_write_bio_X509 (out, x509);
                X509_free(x509);