diff options
author | NIIBE Yutaka <[email protected]> | 2023-07-13 04:41:24 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2023-07-13 04:41:24 +0000 |
commit | c8044c76efd6d65fde61d2bbf58c41ca7f7cd2eb (patch) | |
tree | af92db6fe65861759919cf4ea9b76c290bc1f91e | |
parent | sm: Use estream_t for operations. (diff) | |
download | gnupg-c8044c76efd6d65fde61d2bbf58c41ca7f7cd2eb.tar.gz gnupg-c8044c76efd6d65fde61d2bbf58c41ca7f7cd2eb.zip |
sm: Fix the cases where input from stdin.
* sm/gpgsm.c (main): Fix calling gpgsm_sign with es_stdin.
Fix calling gpgsm_verify with es_stdin.
Fix calling gpgsm_decrypt with es_stdin.
* sm/import.c (gpgsm_import_files): Fix calling import_one
with es_stdin.
--
GnuPG-bug-id: 6592
Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r-- | sm/gpgsm.c | 7 | ||||
-rw-r--r-- | sm/import.c | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/sm/gpgsm.c b/sm/gpgsm.c index 6d16c0e4a..ca2765469 100644 --- a/sm/gpgsm.c +++ b/sm/gpgsm.c @@ -1947,7 +1947,7 @@ main ( int argc, char **argv) signing because that is what gpg does.*/ set_binary (stdin); if (!argc) /* Create from stdin. */ - err = gpgsm_sign (&ctrl, signerlist, 0, detached_sig, fp); + err = gpgsm_sign (&ctrl, signerlist, es_stdin, detached_sig, fp); else if (argc == 1) /* From file. */ { estream_t data_fp = es_fopen (*argv, "rb"); @@ -2001,7 +2001,8 @@ main ( int argc, char **argv) fp = open_es_fwrite (opt.outfile); if (!argc) - gpgsm_verify (&ctrl, 0, NULL, fp); /* normal signature from stdin */ + /* normal signature from stdin */ + gpgsm_verify (&ctrl, es_stdin, NULL, fp); else if (argc == 1) { estream_t in_fp = es_fopen (*argv, "rb"); @@ -2050,7 +2051,7 @@ main ( int argc, char **argv) set_binary (stdin); if (!argc) - err = gpgsm_decrypt (&ctrl, 0, fp); /* from stdin */ + err = gpgsm_decrypt (&ctrl, es_stdin, fp); /* from stdin */ else if (argc == 1) { estream_t data_fp = es_fopen (*argv, "rb"); diff --git a/sm/import.c b/sm/import.c index 64bfb2ec3..df5b95c3a 100644 --- a/sm/import.c +++ b/sm/import.c @@ -524,7 +524,7 @@ gpgsm_import_files (ctrl_t ctrl, int nfiles, char **files, memset (&stats, 0, sizeof stats); if (!nfiles) - rc = import_one (ctrl, &stats, 0); + rc = import_one (ctrl, &stats, es_stdin); else { for (; nfiles && !rc ; nfiles--, files++) |