Deleted Added
full compact
pkcs8.c (1.1.1.5) pkcs8.c (1.1.1.6)
1/* pkcs8.c */
2/*
3 * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
4 * 1999-2004.
5 */
6/* ====================================================================
7 * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
8 *

--- 73 unchanged lines hidden (view full) ---

82 int p8_broken = PKCS8_OK;
83 int nocrypt = 0;
84 X509_SIG *p8 = NULL;
85 PKCS8_PRIV_KEY_INFO *p8inf = NULL;
86 EVP_PKEY *pkey = NULL;
87 char pass[50], *passin = NULL, *passout = NULL, *p8pass = NULL;
88 int badarg = 0;
89 int ret = 1;
1/* pkcs8.c */
2/*
3 * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
4 * 1999-2004.
5 */
6/* ====================================================================
7 * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
8 *

--- 73 unchanged lines hidden (view full) ---

82 int p8_broken = PKCS8_OK;
83 int nocrypt = 0;
84 X509_SIG *p8 = NULL;
85 PKCS8_PRIV_KEY_INFO *p8inf = NULL;
86 EVP_PKEY *pkey = NULL;
87 char pass[50], *passin = NULL, *passout = NULL, *p8pass = NULL;
88 int badarg = 0;
89 int ret = 1;
90#ifndef OPENSSL_NO_ENGINE
91 char *engine = NULL;
90 char *engine = NULL;
92#endif
93
94 if (bio_err == NULL)
95 bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
96
97 if (!load_config(bio_err, NULL))
98 goto end;
99
100 informat = FORMAT_PEM;

--- 117 unchanged lines hidden (view full) ---

218 BIO_printf(bio_err,
219 "-v1 obj use PKCS#5 v1.5 and cipher \"alg\"\n");
220#ifndef OPENSSL_NO_ENGINE
221 BIO_printf(bio_err,
222 " -engine e use engine e, possibly a hardware device.\n");
223#endif
224 goto end;
225 }
91
92 if (bio_err == NULL)
93 bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
94
95 if (!load_config(bio_err, NULL))
96 goto end;
97
98 informat = FORMAT_PEM;

--- 117 unchanged lines hidden (view full) ---

216 BIO_printf(bio_err,
217 "-v1 obj use PKCS#5 v1.5 and cipher \"alg\"\n");
218#ifndef OPENSSL_NO_ENGINE
219 BIO_printf(bio_err,
220 " -engine e use engine e, possibly a hardware device.\n");
221#endif
222 goto end;
223 }
226#ifndef OPENSSL_NO_ENGINE
227 e = setup_engine(bio_err, engine, 0);
224 e = setup_engine(bio_err, engine, 0);
228#endif
229
230 if (!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
231 BIO_printf(bio_err, "Error getting passwords\n");
232 goto end;
233 }
234
235 if ((pbe_nid == -1) && !cipher)
236 pbe_nid = NID_pbeWithMD5AndDES_CBC;

--- 149 unchanged lines hidden (view full) ---

386 goto end;
387 }
388 ret = 0;
389
390 end:
391 X509_SIG_free(p8);
392 PKCS8_PRIV_KEY_INFO_free(p8inf);
393 EVP_PKEY_free(pkey);
225
226 if (!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
227 BIO_printf(bio_err, "Error getting passwords\n");
228 goto end;
229 }
230
231 if ((pbe_nid == -1) && !cipher)
232 pbe_nid = NID_pbeWithMD5AndDES_CBC;

--- 149 unchanged lines hidden (view full) ---

382 goto end;
383 }
384 ret = 0;
385
386 end:
387 X509_SIG_free(p8);
388 PKCS8_PRIV_KEY_INFO_free(p8inf);
389 EVP_PKEY_free(pkey);
390 release_engine(e);
394 BIO_free_all(out);
395 BIO_free(in);
396 if (passin)
397 OPENSSL_free(passin);
398 if (passout)
399 OPENSSL_free(passout);
400
401 return ret;
402}
391 BIO_free_all(out);
392 BIO_free(in);
393 if (passin)
394 OPENSSL_free(passin);
395 if (passout)
396 OPENSSL_free(passout);
397
398 return ret;
399}