Projects
openEuler:24.03:SP1:Everything
gnupg2
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 2
View file
_service:tar_scm:gnupg2.spec
Changed
@@ -1,6 +1,6 @@ Name: gnupg2 Version: 2.4.3 -Release: 2 +Release: 3 Summary: Utility for secure communication and data storage License: GPLv3+ @@ -18,6 +18,7 @@ Patch8: gnupg-2.2.21-coverity.patch Patch9: gnupg2-revert-rfc4880bis.patch Patch10: backport-dirmngr-Enable-the-call-of-ks_ldap_help_variables-wh.patch +Patch11: backport-gpg-Make-no-literal-work-again-for-c-and-store.patch BuildRequires: gcc BuildRequires: zlib-devel, npth-devel, texinfo @@ -119,6 +120,9 @@ %changelog +* Wed Sep 25 2024 yixiangzhike <yixiangzhike007@163.com> - 2.4.3-3 +- gpg Make --no-literal work again for -c and --store + * Tue Jan 2 2024 yixiangzhike <yixiangzhike007@163.com> - 2.4.3-2 - use gpgtar to replace gpg-zip
View file
_service:tar_scm:backport-gpg-Make-no-literal-work-again-for-c-and-store.patch
Added
@@ -0,0 +1,111 @@ +From 9a741aba3d9040d2bb367db79e9021ba6abc12dd Mon Sep 17 00:00:00 2001 +From: Werner Koch <wk@gnupg.org> +Date: Fri, 6 Sep 2024 15:46:41 +0200 +Subject: PATCH gpg: Make --no-literal work again for -c and --store. + +* g10/dearmor.c (dearmor_file): Check for errors of iobuf_copy. +(enarmor_file): Ditto. +* g10/encrypt.c (encrypt_simple): Fix error check of iobuf_copy +(encrypt_crypt): Use iobuf_copy. +-- + +Fixes-commit: 756c0bd5d89bd0a773f844fbc2ec508c1a36c63d +GnuPG-bug-id: 5852 +--- + g10/dearmor.c | 12 ++++++++++++ + g10/encrypt.c | 35 +++++++++++++++++------------------ + 2 files changed, 29 insertions(+), 18 deletions(-) + +diff --git a/g10/dearmor.c b/g10/dearmor.c +index f6bb59ef6..667888362 100644 +--- a/g10/dearmor.c ++++ b/g10/dearmor.c +@@ -67,6 +67,12 @@ dearmor_file( const char *fname ) + goto leave; + + iobuf_copy (out, inp); ++ if ((rc = iobuf_error (inp))) ++ log_error (_("error reading '%s': %s\n"), ++ iobuf_get_fname_nonnull (inp), gpg_strerror (rc)); ++ else if ((rc = iobuf_error (out))) ++ log_error (_("error writing '%s': %s\n"), ++ iobuf_get_fname_nonnull (out), gpg_strerror (rc)); + + leave: + if( rc ) +@@ -115,6 +121,12 @@ enarmor_file( const char *fname ) + push_armor_filter ( afx, out ); + + iobuf_copy (out, inp); ++ if ((rc = iobuf_error (inp))) ++ log_error (_("error reading '%s': %s\n"), ++ iobuf_get_fname_nonnull (inp), gpg_strerror (rc)); ++ else if ((rc = iobuf_error (out))) ++ log_error (_("error writing '%s': %s\n"), ++ iobuf_get_fname_nonnull (out), gpg_strerror (rc)); + + leave: + if( rc ) +diff --git a/g10/encrypt.c b/g10/encrypt.c +index 3fc10a7b8..cc8f37fe2 100644 +--- a/g10/encrypt.c ++++ b/g10/encrypt.c +@@ -633,9 +633,13 @@ encrypt_simple (const char *filename, int mode, int use_seskey) + { + /* User requested not to create a literal packet, so we copy the + plain data. */ +- rc = iobuf_copy (out, inp); +- if (rc) +- log_error ("copying input to output failed: %s\n", gpg_strerror (rc)); ++ iobuf_copy (out, inp); ++ if ((rc = iobuf_error (inp))) ++ log_error (_("error reading '%s': %s\n"), ++ iobuf_get_fname_nonnull (inp), gpg_strerror (rc)); ++ else if ((rc = iobuf_error (out))) ++ log_error (_("error writing '%s': %s\n"), ++ iobuf_get_fname_nonnull (out), gpg_strerror (rc)); + } + + /* Finish the stuff. */ +@@ -760,8 +764,8 @@ write_symkey_enc (STRING2KEY *symkey_s2k, aead_algo_t aead_algo, + * The caller may provide a checked list of public keys in + * PROVIDED_PKS; if not the function builds a list of keys on its own. + * +- * Note that FILEFD is currently only used by cmd_encrypt in the +- * not yet finished server.c. ++ * Note that FILEFD and OUTPUTFD are currently only used by ++ * cmd_encrypt in the not yet finished server.c. + */ + int + encrypt_crypt (ctrl_t ctrl, int filefd, const char *filename, +@@ -996,19 +1000,14 @@ encrypt_crypt (ctrl_t ctrl, int filefd, const char *filename, + { + /* User requested not to create a literal packet, so we copy the + plain data. */ +- byte copy_buffer4096; +- int bytes_copied; +- while ((bytes_copied = iobuf_read (inp, copy_buffer, 4096)) != -1) +- { +- rc = iobuf_write (out, copy_buffer, bytes_copied); +- if (rc) +- { +- log_error ("copying input to output failed: %s\n", +- gpg_strerror (rc)); +- break; +- } +- } +- wipememory (copy_buffer, 4096); /* Burn the buffer. */ ++ iobuf_copy (out, inp); ++ if ((rc = iobuf_error (inp))) ++ log_error (_("error reading '%s': %s\n"), ++ iobuf_get_fname_nonnull (inp), gpg_strerror (rc)); ++ else if ((rc = iobuf_error (out))) ++ log_error (_("error writing '%s': %s\n"), ++ iobuf_get_fname_nonnull (out), gpg_strerror (rc)); ++ + } + + /* Finish the stuff. */ +-- +2.33.0 +
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2