Deleted Added
full compact
pkey.c (1.1.1.2) pkey.c (1.1.1.3)
1/* apps/pkey.c */
2/*
3 * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
4 * 2006
5 */
6/* ====================================================================
7 * Copyright (c) 2006 The OpenSSL Project. All rights reserved.
8 *

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

74 char *passargin = NULL, *passargout = NULL;
75 BIO *in = NULL, *out = NULL;
76 const EVP_CIPHER *cipher = NULL;
77 int informat, outformat;
78 int pubin = 0, pubout = 0, pubtext = 0, text = 0, noout = 0;
79 EVP_PKEY *pkey = NULL;
80 char *passin = NULL, *passout = NULL;
81 int badarg = 0;
1/* apps/pkey.c */
2/*
3 * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
4 * 2006
5 */
6/* ====================================================================
7 * Copyright (c) 2006 The OpenSSL Project. All rights reserved.
8 *

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

74 char *passargin = NULL, *passargout = NULL;
75 BIO *in = NULL, *out = NULL;
76 const EVP_CIPHER *cipher = NULL;
77 int informat, outformat;
78 int pubin = 0, pubout = 0, pubtext = 0, text = 0, noout = 0;
79 EVP_PKEY *pkey = NULL;
80 char *passin = NULL, *passout = NULL;
81 int badarg = 0;
82#ifndef OPENSSL_NO_ENGINE
83 char *engine = NULL;
82 char *engine = NULL;
84#endif
85 int ret = 1;
86
87 if (bio_err == NULL)
88 bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
89
90 if (!load_config(bio_err, NULL))
91 goto end;
92

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

173 BIO_printf(bio_err,
174 "-passout arg output file pass phrase source\n");
175#ifndef OPENSSL_NO_ENGINE
176 BIO_printf(bio_err,
177 "-engine e use engine e, possibly a hardware device.\n");
178#endif
179 return 1;
180 }
83 int ret = 1;
84
85 if (bio_err == NULL)
86 bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
87
88 if (!load_config(bio_err, NULL))
89 goto end;
90

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

171 BIO_printf(bio_err,
172 "-passout arg output file pass phrase source\n");
173#ifndef OPENSSL_NO_ENGINE
174 BIO_printf(bio_err,
175 "-engine e use engine e, possibly a hardware device.\n");
176#endif
177 return 1;
178 }
181#ifndef OPENSSL_NO_ENGINE
182 e = setup_engine(bio_err, engine, 0);
179 e = setup_engine(bio_err, engine, 0);
183#endif
184
185 if (!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
186 BIO_printf(bio_err, "Error getting passwords\n");
187 goto end;
188 }
189
190 if (outfile) {
191 if (!(out = BIO_new_file(outfile, "wb"))) {

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

235 else
236 EVP_PKEY_print_private(out, pkey, 0, NULL);
237 }
238
239 ret = 0;
240
241 end:
242 EVP_PKEY_free(pkey);
180
181 if (!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
182 BIO_printf(bio_err, "Error getting passwords\n");
183 goto end;
184 }
185
186 if (outfile) {
187 if (!(out = BIO_new_file(outfile, "wb"))) {

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

231 else
232 EVP_PKEY_print_private(out, pkey, 0, NULL);
233 }
234
235 ret = 0;
236
237 end:
238 EVP_PKEY_free(pkey);
239 release_engine(e);
243 BIO_free_all(out);
244 BIO_free(in);
245 if (passin)
246 OPENSSL_free(passin);
247 if (passout)
248 OPENSSL_free(passout);
249
250 return ret;
251}
240 BIO_free_all(out);
241 BIO_free(in);
242 if (passin)
243 OPENSSL_free(passin);
244 if (passout)
245 OPENSSL_free(passout);
246
247 return ret;
248}