From 0b0cdf291b0cb331614e751970b0d152ed311d857cb7efef73abd09d6f255475 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Tue, 11 Sep 2007 16:18:39 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gpg2?expand=0&rev=12 --- gnupg-2.0.4-default-tty.diff | 22 ++++++++++++++++++++ gnupg-2.0.4-sig-check.diff | 40 ++++++++++++++++++++++++++++++++++++ gpg2.changes | 6 ++++++ gpg2.spec | 9 +++++++- 4 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 gnupg-2.0.4-default-tty.diff create mode 100644 gnupg-2.0.4-sig-check.diff diff --git a/gnupg-2.0.4-default-tty.diff b/gnupg-2.0.4-default-tty.diff new file mode 100644 index 0000000..e4191f7 --- /dev/null +++ b/gnupg-2.0.4-default-tty.diff @@ -0,0 +1,22 @@ +--- common/asshelp.c ++++ common/asshelp.c +@@ -90,6 +90,8 @@ + dft_ttyname = getenv ("GPG_TTY"); + if ((!dft_ttyname || !*dft_ttyname) && ttyname (0)) + dft_ttyname = ttyname (0); ++ if (!dft_ttyname) ++ dft_ttyname = "/dev/tty"; + } + if (opt_ttyname || dft_ttyname) + { +--- common/simple-pwquery.c ++++ common/simple-pwquery.c +@@ -217,6 +217,8 @@ + #ifndef HAVE_W32_SYSTEM + if ((!dft_ttyname || !*dft_ttyname) && ttyname (0)) + dft_ttyname = ttyname (0); ++ if (!dft_ttyname) ++ dft_ttyname = "/dev/tty"; + #endif + if (dft_ttyname && *dft_ttyname) + { diff --git a/gnupg-2.0.4-sig-check.diff b/gnupg-2.0.4-sig-check.diff new file mode 100644 index 0000000..b198f65 --- /dev/null +++ b/gnupg-2.0.4-sig-check.diff @@ -0,0 +1,40 @@ +--- g10/sig-check.c 2006/08/01 12:23:34 4216 ++++ g10/sig-check.c 2007/05/16 11:10:07 4504 +@@ -438,22 +438,25 @@ + gcry_md_hd_t md; + int rc; + ++ /* Always check whether the algorithm is available. Although ++ gcry_md_open woyuld throw an error, some libgcrypt versions will ++ print a debug message in that case too. */ ++ if ((rc=openpgp_md_test_algo (backsig->digest_algo))) ++ return rc; ++ + if(!opt.no_sig_cache && backsig->flags.checked) +- { +- if((rc=openpgp_md_test_algo (backsig->digest_algo))) +- return rc; ++ return backsig->flags.valid? 0 : gpg_error (GPG_ERR_BAD_SIGNATURE); + +- return backsig->flags.valid? 0 : gpg_error (GPG_ERR_BAD_SIGNATURE); ++ rc = gcry_md_open (&md, backsig->digest_algo,0); ++ if (!rc) ++ { ++ hash_public_key(md,main_pk); ++ hash_public_key(md,sub_pk); ++ rc=do_check(sub_pk,backsig,md,NULL,NULL,NULL); ++ cache_sig_result(backsig,rc); ++ gcry_md_close(md); + } + +- if (gcry_md_open (&md, backsig->digest_algo,0)) +- BUG (); +- hash_public_key(md,main_pk); +- hash_public_key(md,sub_pk); +- rc=do_check(sub_pk,backsig,md,NULL,NULL,NULL); +- cache_sig_result(backsig,rc); +- gcry_md_close(md); +- + return rc; + } + diff --git a/gpg2.changes b/gpg2.changes index f434619..b5f9e2f 100644 --- a/gpg2.changes +++ b/gpg2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Sep 10 20:13:07 CEST 2007 - ltinkl@suse.cz + +- fix gpg2 crash on accessing key (#307666) +- fix gpg doesn't work on the console (#302323) + ------------------------------------------------------------------- Thu Jul 26 13:16:22 CEST 2007 - sbrabec@suse.cz diff --git a/gpg2.spec b/gpg2.spec index e16015f..0bc22be 100644 --- a/gpg2.spec +++ b/gpg2.spec @@ -24,13 +24,15 @@ Provides: newpg gpg = 1.4.7 gnupg = %{version} Obsoletes: newpg gpg <= 1.4.7 Summary: GnuPG 2 Version: 2.0.4 -Release: 25 +Release: 42 Source: gnupg-%{version}-svn4472.tar.bz2 %define nld_build 0 Patch2: nld-build.diff Patch5: gnupg-1.9.22-ccid-driver-fix.diff Patch6: gnupg-1.9.18-tmpdir.diff Patch7: gnupg-2.0.4-install_tools.diff +Patch8: gnupg-2.0.4-sig-check.diff +Patch9: gnupg-2.0.4-default-tty.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -52,6 +54,8 @@ Authors: %patch5 %patch6 %patch7 +%patch8 +%patch9 %build gcc_version=`gcc -dumpversion 2>&1 | sed 's/^\([0-9]\+\)\..*/\1/'` @@ -110,6 +114,9 @@ ln -sf gpgv2.1 $RPM_BUILD_ROOT/usr/share/man/man1/gpgv.1 /usr/share/gnupg %changelog +* Mon Sep 10 2007 - ltinkl@suse.cz +- fix gpg2 crash on accessing key (#307666) +- fix gpg doesn't work on the console (#302323) * Thu Jul 26 2007 - sbrabec@suse.cz - Build with libassuan-devel. * Thu Jun 21 2007 - ro@suse.de