From ee3a1ec0d84eec6804fa188c0de292e06a49d7ec Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 20 May 2008 08:00:40 +0000 Subject: [PATCH] Fix --output option used when with --export-secret-kety-p12. --- sm/ChangeLog | 5 +++++ sm/export.c | 2 +- sm/gpgsm.c | 2 +- sm/import.c | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sm/ChangeLog b/sm/ChangeLog index 09e249dd2..fa6f0b791 100644 --- a/sm/ChangeLog +++ b/sm/ChangeLog @@ -1,3 +1,8 @@ +2008-05-20 Werner Koch + + * gpgsm.c (main) : Pass FP and not stdout to + the export function. Reported by Marc Mutz. + 2008-05-06 Werner Koch * keylist.c (list_external_keys): Ignore NOT FOUND error code. diff --git a/sm/export.c b/sm/export.c index 1e8e95a2c..c1b9eaaf0 100644 --- a/sm/export.c +++ b/sm/export.c @@ -369,7 +369,7 @@ gpgsm_p12_export (ctrl_t ctrl, const char *name, FILE *fp) goto leave; } - /* Lookup the certificate an make sure that it is unique. */ + /* Lookup the certificate and make sure that it is unique. */ rc = keydb_search (hd, desc, 1); if (!rc) { diff --git a/sm/gpgsm.c b/sm/gpgsm.c index 64629bfaf..a26775a58 100644 --- a/sm/gpgsm.c +++ b/sm/gpgsm.c @@ -1808,7 +1808,7 @@ main ( int argc, char **argv) FILE *fp = open_fwrite (opt.outfile?opt.outfile:"-"); if (argc == 1) - gpgsm_p12_export (&ctrl, *argv, stdout); + gpgsm_p12_export (&ctrl, *argv, fp); else wrong_args ("--export-secret-key-p12 KEY-ID"); if (fp != stdout) diff --git a/sm/import.c b/sm/import.c index ba49da5dd..3045c89d5 100644 --- a/sm/import.c +++ b/sm/import.c @@ -652,7 +652,7 @@ parse_p12 (ctrl_t ctrl, ksba_reader_t reader, { /* We only write a plain error code and not direct BAD_PASSPHRASE because the pkcs12 parser might issue this - message multiple times, BAd_PASSPHRASE in general requires a + message multiple times, BAD_PASSPHRASE in general requires a keyID and parts of the import might actually succeed so that IMPORT_PROBLEM is also not appropriate. */ gpgsm_status_with_err_code (ctrl, STATUS_ERROR,