From bbfa7c42337bb619e6af20bf051fe0755ed5a9fd Mon Sep 17 00:00:00 2001 From: Tobias Mueller Date: Tue, 20 Feb 2018 17:34:14 +0100 Subject: python: Fix crash by leaving struct members intact * lang/python/setup.py.in: Copy gpgme.h instead of parsing it. -- The python bindings tried to parse deprecated functions out of gpgme.h. This fails for the current gpgme.h in that it removes an entire field in the key sig struct (_obsolete_class). Hence, the fields were off by an int and the bindings accessed struct members via the wrong offset. That caused python program to crash. At least on 32bit platforms, the crash can be easily triggered by accessing key.uids[0].signatures. On 64bit platforms the compiler probably aligns the struct so that the missing 4 bytes are not noticed. With this change, the python bindings will expose all functions that gpgme exposes, including the deprecated ones. Credits go to Justus Winter for debugging and identying the issue. Signed-off-by: Tobias Mueller GnuPG-bug-id: 3892 --- lang/python/setup.py.in | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'lang/python') diff --git a/lang/python/setup.py.in b/lang/python/setup.py.in index f9dda20f..2595073f 100755 --- a/lang/python/setup.py.in +++ b/lang/python/setup.py.in @@ -152,25 +152,8 @@ class BuildExtFirstHack(build): sink.write(content) def _generate_gpgme_h(self, source_name, sink_name): - if up_to_date(source_name, sink_name): - return - print("Using gpgme.h from {}".format(source_name)) - - deprec_func = re.compile(r'^(.*typedef.*|.*\(.*\)|[^#]+\s+.+)' - + r'\s*_GPGME_DEPRECATED(_OUTSIDE_GPGME)?\(.*\);\s*', - re.S) - line_break = re.compile(';|\\$|\\x0c|^\s*#|{') - - with open(sink_name, "w") as sink, open(source_name) as source: - text = '' - for line in source: - text += re.sub(' class ', ' _py_obsolete_class ', line) - if line_break.search(line): - if not deprec_func.search(text): - sink.write(text) - text = '' - sink.write(text) + shutil.copy2(source_name, sink_name) def _generate_errors_i(self): -- cgit From 67b4dafb6d3fe2b5ab889417126ca5d509c0e3ca Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 18 Apr 2018 19:30:50 +0200 Subject: doc: Update copyright years and change two URLs. -- Signed-off-by: Werner Koch --- AUTHORS | 4 ++-- README | 2 +- configure.ac | 2 +- lang/python/README | 12 ++++++------ lang/python/README.org | 9 ++++----- src/gpgme.h.in | 3 ++- src/versioninfo.rc.in | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) (limited to 'lang/python') diff --git a/AUTHORS b/AUTHORS index 6d2ce673..c989eff7 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,5 +1,5 @@ Package: gpgme -Homepage: https://gnupg.org/related_software/gpgme/ +Homepage: https://gnupg.org/software/gpgme/ Download: https://gnupg.org/ftp/gcrypt/gpgme/ Repository: git://git.gnupg.org/gpgme.git Maintainer: Werner Koch @@ -19,7 +19,7 @@ List of Copyright holders Copyright (C) 1991-2013 Free Software Foundation, Inc. Copyright (C) 2000-2001 Werner Koch - Copyright (C) 2001-2017 g10 Code GmbH + Copyright (C) 2001-2018 g10 Code GmbH Copyright (C) 2002 Klarälvdalens Datakonsult AB Copyright (C) 2004-2008 Igor Belyi Copyright (C) 2002 John Goerzen diff --git a/README b/README index f7b006f1..8e031ae6 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ GPGME - GnuPG Made Easy --------------------------- -Copyright 2001-2017 g10 Code GmbH +Copyright 2001-2018 g10 Code GmbH This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff --git a/configure.ac b/configure.ac index c6c6dc86..e42f178f 100644 --- a/configure.ac +++ b/configure.ac @@ -810,7 +810,7 @@ AH_BOTTOM([ #define GPG_ERR_ENABLE_ERRNO_MACROS 1 #define CRIGHTBLURB "Copyright (C) 2000 Werner Koch\n" \ - "Copyright (C) 2001--2017 g10 Code GmbH\n" + "Copyright (C) 2001--2018 g10 Code GmbH\n" ]) diff --git a/lang/python/README b/lang/python/README index 49e88205..99da4dd7 100644 --- a/lang/python/README +++ b/lang/python/README @@ -1,6 +1,6 @@ - ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - GPG - GPGME BINDINGS FOR PYTHON - ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + GPG - GPGME BINDINGS FOR PYTHON + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Table of Contents @@ -13,7 +13,7 @@ Table of Contents The "gpg" module is a python interface to the GPGME library: -[https://www.gnupg.org/related_software/gpgme/] +[https://www.gnupg.org/software/gpgme/] "gpg" offers two interfaces, one is a high-level, curated, and idiomatic interface that is implemented as a shim on top of the low-level @@ -36,8 +36,8 @@ functionality of the underlying library. 2 Bugs ══════ - Please report bugs using our bug tracker using the category 'gpgme', - and topic 'python': [https://bugs.gnupg.org/gnupg/] + Please report bugs using our bug tracker [https://bugs.gnupg.org] with + tag (aka project) 'gpgme'. 3 Authors diff --git a/lang/python/README.org b/lang/python/README.org index 22e7d1f8..cba99669 100644 --- a/lang/python/README.org +++ b/lang/python/README.org @@ -1,8 +1,8 @@ #+TITLE: gpg - GPGME bindings for Python - +#+OPTIONS: author:nil The "gpg" module is a python interface to the GPGME library: -https://www.gnupg.org/related_software/gpgme/ +[[https://www.gnupg.org/software/gpgme/]] "gpg" offers two interfaces, one is a high-level, curated, and idiomatic interface that is implemented as a shim on top of the @@ -21,9 +21,8 @@ https://lists.gnupg.org/mailman/listinfo/gnupg-devel * Bugs -Please report bugs using our bug tracker using the category 'gpgme', -and topic 'python': -https://bugs.gnupg.org/gnupg/ +Please report bugs using our bug tracker +[[https://bugs.gnupg.org]] with tag (aka project) 'gpgme'. * Authors diff --git a/src/gpgme.h.in b/src/gpgme.h.in index 84516f91..49fafb90 100644 --- a/src/gpgme.h.in +++ b/src/gpgme.h.in @@ -1,6 +1,6 @@ /* gpgme.h - Public interface to GnuPG Made Easy. -*- c -*- * Copyright (C) 2000 Werner Koch (dd9jn) - * Copyright (C) 2001-2017 g10 Code GmbH + * Copyright (C) 2001-2018 g10 Code GmbH * * This file is part of GPGME. * @@ -16,6 +16,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, see . + * SPDX-License-Identifier: LGPL-2.1+ * * Generated from gpgme.h.in for @GPGME_CONFIG_HOST@. */ diff --git a/src/versioninfo.rc.in b/src/versioninfo.rc.in index 2b1cc811..88b662ea 100644 --- a/src/versioninfo.rc.in +++ b/src/versioninfo.rc.in @@ -39,7 +39,7 @@ BEGIN VALUE "FileDescription", "GPGME - GnuPG Made Easy\0" VALUE "FileVersion", "@LIBGPGME_LT_CURRENT@.@LIBGPGME_LT_AGE@.@LIBGPGME_LT_REVISION@.@BUILD_REVISION@\0" VALUE "InternalName", "gpgme\0" - VALUE "LegalCopyright", "Copyright 2001-2017 g10 Code GmbH\0" + VALUE "LegalCopyright", "Copyright 2001-2018 g10 Code GmbH\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "gpgme.dll\0" VALUE "PrivateBuild", "\0" -- cgit