summaryrefslogtreecommitdiffstats
path: root/apps/pkcs12.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2008-06-26 23:27:31 +0000
committerDr. Stephen Henson <steve@openssl.org>2008-06-26 23:27:31 +0000
commit8528128b2a740d34d3ae1d43c525d7e6ea6d7f37 (patch)
tree88ae9095ddcb99290be423fcf45112de7e9d3418 /apps/pkcs12.c
parenta0f3679b52a803447acfd91d009df3fb3fbc1bb4 (diff)
Update from stable branch.
Diffstat (limited to 'apps/pkcs12.c')
-rw-r--r--apps/pkcs12.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/pkcs12.c b/apps/pkcs12.c
index 4b7a99540f..06f8931c5e 100644
--- a/apps/pkcs12.c
+++ b/apps/pkcs12.c
@@ -101,6 +101,7 @@ int MAIN(int argc, char **argv)
char **args;
char *name = NULL;
char *csp_name = NULL;
+ int add_lmk = 0;
PKCS12 *p12 = NULL;
char pass[50], macpass[50];
int export_cert = 0;
@@ -211,7 +212,9 @@ int MAIN(int argc, char **argv)
args++;
name = *args;
} else badarg = 1;
- } else if (!strcmp (*args, "-CSP")) {
+ } else if (!strcmp (*args, "-LMK"))
+ add_lmk = 1;
+ else if (!strcmp (*args, "-CSP")) {
if (args[1]) {
args++;
csp_name = *args;
@@ -329,6 +332,7 @@ int MAIN(int argc, char **argv)
BIO_printf(bio_err, " load the file (or the files in the directory) into\n");
BIO_printf(bio_err, " the random number generator\n");
BIO_printf(bio_err, "-CSP name Microsoft CSP name\n");
+ BIO_printf(bio_err, "-LMK Add local machine keyset attribute to private key\n");
goto end;
}
@@ -554,7 +558,9 @@ int MAIN(int argc, char **argv)
if (csp_name && key)
EVP_PKEY_add1_attr_by_NID(key, NID_ms_csp_name,
MBSTRING_ASC, (unsigned char *)csp_name, -1);
-
+
+ if (add_lmk && key)
+ EVP_PKEY_add1_attr_by_NID(key, NID_LocalKeySet, 0, NULL, -1);
#ifdef CRYPTO_MDEBUG
CRYPTO_pop_info();