Imported Upstream version 1.5.1 upstream/1.5.1
authorJinWang An <jinwang.an@samsung.com>
Wed, 1 Dec 2021 07:54:34 +0000 (16:54 +0900)
committerJinWang An <jinwang.an@samsung.com>
Wed, 1 Dec 2021 07:54:34 +0000 (16:54 +0900)
23 files changed:
ChangeLog
NEWS
VERSION
configure
configure.ac
doc/gpgme.info
doc/gpgme.info-1
doc/gpgme.info-2
doc/gpgme.texi
doc/stamp-vti
doc/version.texi
gpgme.spec
lang/cl/gpgme.asd
src/assuan-support.c
src/engine-gpg.c
src/engine-gpgsm.c
src/engine-uiserver.c
src/gpgme-tool.c
src/gpgme-w32spawn.c
src/gpgme.h.in
src/keylist.c
src/op-support.c
src/priv-io.h

index 0cff5d0..9910120 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,34 @@
+2014-07-30  Werner Koch  <wk@gnupg.org>
+
+       Release 1.5.1.
+       * configure.ac: Change LT version to C24/A13/R0.
+
+       Fix possible realloc overflow for gpgsm and uiserver engines.
+       * src/engine-gpgsm.c (status_handler):
+       * src/engine-uiserver.c (status_handler):
+
+2014-06-26  Werner Koch  <wk@gnupg.org>
+
+       w32: Get IOSPAWN flag back in sync with spawn helper.
+       * src/gpgme-w32spawn.c: Include priv-io.h.
+
+2014-06-10  Werner Koch  <wk@gnupg.org>
+
+       Add new reason codes to the INV_RECP status code.
+       * src/op-support.c (_gpgme_parse_inv_recp): Add codes 13 and 14.
+
+2014-06-04  Werner Koch  <wk@gnupg.org>
+
+       Add new keylist mode GPGME_KEYLIST_MODE_WITH_SECRET.
+       * src/gpgme.h.in (GPGME_KEYLIST_MODE_WITH_SECRET): New.
+       * src/engine-gpg.c (gpg_keylist_build_options): Handle new mode.
+       * src/engine-gpgsm.c (gpgsm_keylist, gpgsm_keylist_ext): Ditto.
+       * src/keylist.c (parse_sec_field15): Add arg key and take care of
+       --with-secret output.
+
+       * src/gpgme-tool.c (gt_get_keylist_mode, cmd_keylist_mode): Add
+       "with_secret".  Print card info and and secret flag for subkeys.
+
 2014-05-21  Werner Koch  <wk@gnupg.org>
 
        Release 1.5.0.
diff --git a/NEWS b/NEWS
index 82d4914..cffc209 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,16 @@
+Noteworthy changes in version 1.5.1 (2014-07-30) [C24/A13/R0]
+-------------------------------------------------------------
+
+ * Fixed possible overflow in gpgsm and uiserver engines.
+   [CVE-2014-3564]
+
+ * Added support for GnuPG 2.1's --with-secret option.
+
+ * Interface changes relative to the 1.5.0 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPGME_KEYLIST_MODE_WITH_SECRET NEW.
+
+
 Noteworthy changes in version 1.5.0 (2014-05-21) [C23/A12/R0]
 -------------------------------------------------------------
 
diff --git a/VERSION b/VERSION
index bc80560..26ca594 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.5.0
+1.5.1
index ae6986d..753e65b 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for gpgme 1.5.0.
+# Generated by GNU Autoconf 2.69 for gpgme 1.5.1.
 #
 # Report bugs to <http://bugs.gnupg.org>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='gpgme'
 PACKAGE_TARNAME='gpgme'
-PACKAGE_VERSION='1.5.0'
-PACKAGE_STRING='gpgme 1.5.0'
+PACKAGE_VERSION='1.5.1'
+PACKAGE_STRING='gpgme 1.5.1'
 PACKAGE_BUGREPORT='http://bugs.gnupg.org'
 PACKAGE_URL=''
 
@@ -1405,7 +1405,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures gpgme 1.5.0 to adapt to many kinds of systems.
+\`configure' configures gpgme 1.5.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1475,7 +1475,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of gpgme 1.5.0:";;
+     short | recursive ) echo "Configuration of gpgme 1.5.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1599,7 +1599,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-gpgme configure 1.5.0
+gpgme configure 1.5.1
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2429,7 +2429,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by gpgme $as_me 1.5.0, which was
+It was created by gpgme $as_me 1.5.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2792,10 +2792,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 #   (Interfaces added:                 AGE++)
 #   (Interfaces removed/changed:       AGE=0)
 #
-LIBGPGME_LT_CURRENT=23
+LIBGPGME_LT_CURRENT=24
 # Subtract 2 from this value if you want to make the LFS transition an
 # ABI break.  [Note to self: Remove this comment with the next regular break.]
-LIBGPGME_LT_AGE=12
+LIBGPGME_LT_AGE=13
 LIBGPGME_LT_REVISION=0
 
 # If the API is changed in an incompatible way: increment the next counter.
@@ -3283,7 +3283,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='gpgme'
- VERSION='1.5.0'
+ VERSION='1.5.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -6015,7 +6015,7 @@ cat >>confdefs.h <<_ACEOF
 #define VERSION "$VERSION"
 _ACEOF
 
-VERSION_NUMBER=0x010500
+VERSION_NUMBER=0x010501
 
 
 # Don't default to build static libs.
@@ -17359,7 +17359,7 @@ fi
 #
 # Provide information about the build.
 #
-BUILD_REVISION="0eca211"
+BUILD_REVISION="16835c3"
 
 
 cat >>confdefs.h <<_ACEOF
@@ -17368,7 +17368,7 @@ _ACEOF
 
 
 BUILD_FILEVERSION=`echo "$PACKAGE_VERSION"|sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
-BUILD_FILEVERSION="${BUILD_FILEVERSION}3786"
+BUILD_FILEVERSION="${BUILD_FILEVERSION}5763"
 
 
 BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`
@@ -19645,7 +19645,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by gpgme $as_me 1.5.0, which was
+This file was extended by gpgme $as_me 1.5.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -19711,7 +19711,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-gpgme config.status 1.5.0
+gpgme config.status 1.5.1
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -22005,7 +22005,7 @@ fi
 echo "
         GPGME v${VERSION} has been configured as follows:
 
-        Revision:        0eca211  (3786)
+        Revision:        16835c3  (5763)
         Platform:        $host
 
         UI Server:       $uiserver
index f3d3195..b3e17fa 100644 (file)
@@ -29,7 +29,7 @@ min_automake_version="1.11"
 # for the LT versions.
 m4_define(mym4_version_major, [1])
 m4_define(mym4_version_minor, [5])
-m4_define(mym4_version_micro, [0])
+m4_define(mym4_version_micro, [1])
 
 # Below is m4 magic to extract and compute the revision number, the
 # decimalized short revision number, a beta version string, and a flag
@@ -55,10 +55,10 @@ AC_INIT([gpgme],[mym4_full_version],[http://bugs.gnupg.org])
 #   (Interfaces added:                 AGE++)
 #   (Interfaces removed/changed:       AGE=0)
 #
-LIBGPGME_LT_CURRENT=23
+LIBGPGME_LT_CURRENT=24
 # Subtract 2 from this value if you want to make the LFS transition an
 # ABI break.  [Note to self: Remove this comment with the next regular break.]
-LIBGPGME_LT_AGE=12
+LIBGPGME_LT_AGE=13
 LIBGPGME_LT_REVISION=0
 
 # If the API is changed in an incompatible way: increment the next counter.
index 3465aa6..b7fc85b 100644 (file)
@@ -22,8 +22,8 @@ General Public License for more details.
 
    This file documents the GPGME library.
 
-   This is Edition 1.5.0, last updated 8 May 2014, of `The `GnuPG Made
-Easy' Reference Manual', for Version 1.5.0.
+   This is Edition 1.5.1, last updated 30 July 2014, of `The `GnuPG
+Made Easy' Reference Manual', for Version 1.5.1.
 
    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012,
 2013, 2014 g10 Code GmbH.
@@ -41,120 +41,120 @@ General Public License for more details.
 
 \1f
 Indirect:
-gpgme.info-1: 1767
-gpgme.info-2: 289212
+gpgme.info-1: 1769
+gpgme.info-2: 289901
 \1f
 Tag Table:
 (Indirect)
-Node: Top\7f1767
-Node: Introduction\7f8876
-Node: Getting Started\7f9663
-Node: Features\7f10788
-Node: Overview\7f11938
-Node: Preparation\7f13047
-Node: Header\7f14044
-Node: Building the Source\7f14743
-Node: Largefile Support (LFS)\7f16852
-Node: Using Automake\7f22163
-Node: Using Libtool\7f23799
-Node: Library Version Check\7f24149
-Node: Signal Handling\7f29167
-Node: Multi Threading\7f30383
-Ref: Multi Threading-Footnote-1\7f32565
-Node: Protocols and Engines\7f32979
-Node: Engine Version Check\7f35414
-Node: Engine Information\7f36981
-Node: Engine Configuration\7f40753
-Node: OpenPGP\7f42015
-Node: Cryptographic Message Syntax\7f42351
-Node: Algorithms\7f42645
-Ref: Algorithms-Footnote-1\7f43124
-Node: Public Key Algorithms\7f43252
-Node: Hash Algorithms\7f45173
-Node: Error Handling\7f46294
-Node: Error Values\7f48156
-Node: Error Sources\7f53234
-Node: Error Codes\7f55561
-Node: Error Strings\7f60200
-Node: Exchanging Data\7f61979
-Node: Creating Data Buffers\7f63808
-Node: Memory Based Data Buffers\7f64324
-Node: File Based Data Buffers\7f67678
-Node: Callback Based Data Buffers\7f69849
-Node: Destroying Data Buffers\7f75405
-Node: Manipulating Data Buffers\7f76764
-Node: Data Buffer I/O Operations\7f77256
-Node: Data Buffer Meta-Data\7f79959
-Node: Data Buffer Convenience\7f83341
-Node: Contexts\7f85277
-Node: Creating Contexts\7f86459
-Node: Destroying Contexts\7f87270
-Node: Result Management\7f87605
-Node: Context Attributes\7f89011
-Node: Protocol Selection\7f89791
-Node: Crypto Engine\7f90803
-Node: ASCII Armor\7f92624
-Node: Text Mode\7f93236
-Node: Included Certificates\7f94167
-Node: Key Listing Mode\7f95542
-Node: Passphrase Callback\7f98899
-Node: Progress Meter Callback\7f102037
-Node: Locale\7f103961
-Node: Key Management\7f105500
-Node: Listing Keys\7f115688
-Node: Information About Keys\7f122950
-Node: Key Signatures\7f130948
-Node: Manipulating Keys\7f134960
-Node: Generating Keys\7f135802
-Node: Exporting Keys\7f140409
-Node: Importing Keys\7f146308
-Ref: Importing Keys-Footnote-1\7f153471
-Node: Deleting Keys\7f153599
-Node: Changing Passphrases\7f154996
-Node: Advanced Key Editing\7f156257
-Node: Trust Item Management\7f159361
-Node: Listing Trust Items\7f160431
-Node: Information About Trust Items\7f162729
-Node: Manipulating Trust Items\7f164611
-Node: Crypto Operations\7f165572
-Node: Decrypt\7f166818
-Node: Verify\7f170564
-Node: Decrypt and Verify\7f188503
-Node: Sign\7f190507
-Node: Selecting Signers\7f191071
-Node: Creating a Signature\7f192223
-Node: Signature Notation Data\7f196834
-Node: Encrypt\7f199018
-Node: Encrypting a Plaintext\7f199374
-Node: Miscellaneous\7f205873
-Node: Running other Programs\7f206161
-Node: Run Control\7f208138
-Node: Waiting For Completion\7f208881
-Node: Using External Event Loops\7f210927
-Node: I/O Callback Interface\7f212894
-Node: Registering I/O Callbacks\7f218006
-Node: I/O Callback Example\7f219991
-Node: I/O Callback Example GTK+\7f226208
-Node: I/O Callback Example GDK\7f227997
-Node: I/O Callback Example Qt\7f229639
-Node: Cancellation\7f231927
-Node: UI Server Protocol\7f234180
-Ref: UI Server Protocol-Footnote-1\7f235611
-Node: UI Server Encrypt\7f235730
-Node: UI Server Sign\7f240990
-Node: UI Server Decrypt\7f243298
-Node: UI Server Verify\7f244736
-Node: UI Server Set Input Files\7f248238
-Node: UI Server Sign/Encrypt Files\7f249038
-Node: UI Server Verify/Decrypt Files\7f250807
-Node: UI Server Import/Export Keys\7f252653
-Node: UI Server Checksum Files\7f253686
-Node: Miscellaneous UI Server Commands\7f255852
-Ref: command SENDER\7f257764
-Node: Debugging\7f259440
-Node: Library Copying\7f261095
-Node: Copying\7f289212
-Node: Function and Data Index\7f326843
-Node: Concept Index\7f353007
+Node: Top\7f1769
+Node: Introduction\7f8880
+Node: Getting Started\7f9667
+Node: Features\7f10792
+Node: Overview\7f11942
+Node: Preparation\7f13051
+Node: Header\7f14048
+Node: Building the Source\7f14747
+Node: Largefile Support (LFS)\7f16856
+Node: Using Automake\7f22167
+Node: Using Libtool\7f23803
+Node: Library Version Check\7f24153
+Node: Signal Handling\7f29171
+Node: Multi Threading\7f30387
+Ref: Multi Threading-Footnote-1\7f32569
+Node: Protocols and Engines\7f32983
+Node: Engine Version Check\7f35418
+Node: Engine Information\7f36985
+Node: Engine Configuration\7f40757
+Node: OpenPGP\7f42019
+Node: Cryptographic Message Syntax\7f42355
+Node: Algorithms\7f42649
+Ref: Algorithms-Footnote-1\7f43128
+Node: Public Key Algorithms\7f43256
+Node: Hash Algorithms\7f45177
+Node: Error Handling\7f46298
+Node: Error Values\7f48160
+Node: Error Sources\7f53238
+Node: Error Codes\7f55565
+Node: Error Strings\7f60204
+Node: Exchanging Data\7f61983
+Node: Creating Data Buffers\7f63812
+Node: Memory Based Data Buffers\7f64328
+Node: File Based Data Buffers\7f67682
+Node: Callback Based Data Buffers\7f69853
+Node: Destroying Data Buffers\7f75409
+Node: Manipulating Data Buffers\7f76768
+Node: Data Buffer I/O Operations\7f77260
+Node: Data Buffer Meta-Data\7f79963
+Node: Data Buffer Convenience\7f83345
+Node: Contexts\7f85281
+Node: Creating Contexts\7f86463
+Node: Destroying Contexts\7f87274
+Node: Result Management\7f87609
+Node: Context Attributes\7f89015
+Node: Protocol Selection\7f89795
+Node: Crypto Engine\7f90807
+Node: ASCII Armor\7f92628
+Node: Text Mode\7f93240
+Node: Included Certificates\7f94171
+Node: Key Listing Mode\7f95546
+Node: Passphrase Callback\7f99319
+Node: Progress Meter Callback\7f102457
+Node: Locale\7f104381
+Node: Key Management\7f105920
+Node: Listing Keys\7f116377
+Node: Information About Keys\7f123639
+Node: Key Signatures\7f131637
+Node: Manipulating Keys\7f135649
+Node: Generating Keys\7f136491
+Node: Exporting Keys\7f141098
+Node: Importing Keys\7f146997
+Ref: Importing Keys-Footnote-1\7f154160
+Node: Deleting Keys\7f154288
+Node: Changing Passphrases\7f155685
+Node: Advanced Key Editing\7f156946
+Node: Trust Item Management\7f160050
+Node: Listing Trust Items\7f161120
+Node: Information About Trust Items\7f163418
+Node: Manipulating Trust Items\7f165300
+Node: Crypto Operations\7f166261
+Node: Decrypt\7f167507
+Node: Verify\7f171253
+Node: Decrypt and Verify\7f189192
+Node: Sign\7f191196
+Node: Selecting Signers\7f191760
+Node: Creating a Signature\7f192912
+Node: Signature Notation Data\7f197523
+Node: Encrypt\7f199707
+Node: Encrypting a Plaintext\7f200063
+Node: Miscellaneous\7f206562
+Node: Running other Programs\7f206850
+Node: Run Control\7f208827
+Node: Waiting For Completion\7f209570
+Node: Using External Event Loops\7f211616
+Node: I/O Callback Interface\7f213583
+Node: Registering I/O Callbacks\7f218695
+Node: I/O Callback Example\7f220680
+Node: I/O Callback Example GTK+\7f226897
+Node: I/O Callback Example GDK\7f228686
+Node: I/O Callback Example Qt\7f230328
+Node: Cancellation\7f232616
+Node: UI Server Protocol\7f234869
+Ref: UI Server Protocol-Footnote-1\7f236300
+Node: UI Server Encrypt\7f236419
+Node: UI Server Sign\7f241679
+Node: UI Server Decrypt\7f243987
+Node: UI Server Verify\7f245425
+Node: UI Server Set Input Files\7f248927
+Node: UI Server Sign/Encrypt Files\7f249727
+Node: UI Server Verify/Decrypt Files\7f251496
+Node: UI Server Import/Export Keys\7f253342
+Node: UI Server Checksum Files\7f254375
+Node: Miscellaneous UI Server Commands\7f256541
+Ref: command SENDER\7f258453
+Node: Debugging\7f260129
+Node: Library Copying\7f261784
+Node: Copying\7f289901
+Node: Function and Data Index\7f327532
+Node: Concept Index\7f353696
 \1f
 End Tag Table
index 9ce1bc9..bdfd347 100644 (file)
@@ -22,8 +22,8 @@ General Public License for more details.
 
    This file documents the GPGME library.
 
-   This is Edition 1.5.0, last updated 8 May 2014, of `The `GnuPG Made
-Easy' Reference Manual', for Version 1.5.0.
+   This is Edition 1.5.1, last updated 30 July 2014, of `The `GnuPG
+Made Easy' Reference Manual', for Version 1.5.1.
 
    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012,
 2013, 2014 g10 Code GmbH.
@@ -45,8 +45,8 @@ File: gpgme.info,  Node: Top,  Next: Introduction,  Up: (dir)
 Main Menu
 *********
 
-This is Edition 1.5.0, last updated 8 May 2014, of `The `GnuPG Made
-Easy' Reference Manual', for Version 1.5.0 of the GPGME library.
+This is Edition 1.5.1, last updated 30 July 2014, of `The `GnuPG Made
+Easy' Reference Manual', for Version 1.5.1 of the GPGME library.
 
 * Menu:
 
@@ -2348,6 +2348,14 @@ File: gpgme.info,  Node: Key Listing Mode,  Next: Passphrase Callback,  Prev: In
           in the listed keys.  This only works if
           `GPGME_KEYLIST_MODE_SIGS' is also enabled.
 
+    `GPGME_KEYLIST_MODE_WITH_SECRET'
+          The `GPGME_KEYLIST_MODE_WITH_SECRET' returns information about
+          the presence of a corresponding secret key in a public key
+          listing.  A public key listing with this mode is slower than
+          a standard listing but can be used instead of a second run to
+          list the secret keys.  This is only supported for GnuPG
+          versions >= 2.1.
+
     `GPGME_KEYLIST_MODE_EPHEMERAL'
           The `GPGME_KEYLIST_MODE_EPHEMERAL' symbol specifies that keys
           flagged as ephemeral are included in the listing.
@@ -2586,6 +2594,8 @@ how such keys can be selected and manipulated.
           This is true if the subkey is a secret key.  Note that it
           will be false if the key is actually a stub key; i.e. a
           secret key operation is currently not possible (offline-key).
+          This is only set if a listing of secret keys has been
+          requested or if `GPGME_KEYLIST_MODE_WITH_SECRET' is active.
 
     `gpgme_pubkey_algo_t pubkey_algo'
           This is the public key algorithm supported by this subkey.
@@ -2771,7 +2781,9 @@ how such keys can be selected and manipulated.
     `unsigned int secret : 1'
           This is true if the key is a secret key.  Note, that this
           will always be true even if the corresponding subkey flag may
-          be false (offline/stub keys).
+          be false (offline/stub keys).  This is only set if a listing
+          of secret keys has been requested or if
+          `GPGME_KEYLIST_MODE_WITH_SECRET' is active.
 
     `gpgme_protocol_t protocol'
           This is the protocol supported by this key.
index bb166e3..68be411 100644 (file)
@@ -22,8 +22,8 @@ General Public License for more details.
 
    This file documents the GPGME library.
 
-   This is Edition 1.5.0, last updated 8 May 2014, of `The `GnuPG Made
-Easy' Reference Manual', for Version 1.5.0.
+   This is Edition 1.5.1, last updated 30 July 2014, of `The `GnuPG
+Made Easy' Reference Manual', for Version 1.5.1.
 
    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012,
 2013, 2014 g10 Code GmbH.
@@ -905,7 +905,7 @@ Function and Data Index
 * gpgme_get_io_cbs:                      Registering I/O Callbacks.
                                                               (line  46)
 * gpgme_get_key:                         Listing Keys.        (line 149)
-* gpgme_get_keylist_mode:                Key Listing Mode.    (line  64)
+* gpgme_get_keylist_mode:                Key Listing Mode.    (line  72)
 * gpgme_get_passphrase_cb:               Passphrase Callback. (line  55)
 * gpgme_get_progress_cb:                 Progress Meter Callback.
                                                               (line  33)
@@ -932,8 +932,8 @@ Function and Data Index
 * gpgme_key_release:                     Manipulating Keys.   (line  20)
 * gpgme_key_sig_get_string_attr:         Key Signatures.      (line  78)
 * gpgme_key_sig_get_ulong_attr:          Key Signatures.      (line  92)
-* gpgme_key_sig_t:                       Key Management.      (line  92)
-* gpgme_key_t:                           Key Management.      (line 200)
+* gpgme_key_sig_t:                       Key Management.      (line  94)
+* gpgme_key_t:                           Key Management.      (line 202)
 * gpgme_key_unref:                       Manipulating Keys.   (line  11)
 * gpgme_keylist_result_t:                Listing Keys.        (line 125)
 * gpgme_new:                             Creating Contexts.   (line   7)
@@ -1070,7 +1070,7 @@ Function and Data Index
                                                               (line   9)
 * gpgme_trust_item_unref:                Manipulating Trust Items.
                                                               (line  11)
-* gpgme_user_id_t:                       Key Management.      (line 165)
+* gpgme_user_id_t:                       Key Management.      (line 167)
 * gpgme_validity_t:                      Information About Keys.
                                                               (line  10)
 * gpgme_verify_result_t:                 Verify.              (line 248)
index e326574..1f4a9e1 100644 (file)
@@ -2472,6 +2472,13 @@ signature notations on key signatures should be included in the listed
 keys.  This only works if @code{GPGME_KEYLIST_MODE_SIGS} is also
 enabled.
 
+@item GPGME_KEYLIST_MODE_WITH_SECRET
+The @code{GPGME_KEYLIST_MODE_WITH_SECRET} returns information about
+the presence of a corresponding secret key in a public key listing.  A
+public key listing with this mode is slower than a standard listing
+but can be used instead of a second run to list the secret keys.  This
+is only supported for GnuPG versions >= 2.1.
+
 @item GPGME_KEYLIST_MODE_EPHEMERAL
 The @code{GPGME_KEYLIST_MODE_EPHEMERAL} symbol specifies that keys
 flagged as ephemeral are included in the listing.
@@ -2712,9 +2719,11 @@ This is true if the subkey can be used for qualified signatures
 according to local government regulations.
 
 @item unsigned int secret : 1
-This is true if the subkey is a secret key.  Note that it will be false
-if the key is actually a stub key; i.e. a secret key operation is
-currently not possible (offline-key).
+This is true if the subkey is a secret key.  Note that it will be
+false if the key is actually a stub key; i.e. a secret key operation
+is currently not possible (offline-key).  This is only set if a
+listing of secret keys has been requested or if
+@code{GPGME_KEYLIST_MODE_WITH_SECRET} is active.
 
 @item gpgme_pubkey_algo_t pubkey_algo
 This is the public key algorithm supported by this subkey.
@@ -2905,9 +2914,10 @@ This is true if the key can be used for qualified signatures according
 to local government regulations.
 
 @item unsigned int secret : 1
-This is true if the key is a secret key.  Note, that this will always be
-true even if the corresponding subkey flag may be false (offline/stub
-keys).
+This is true if the key is a secret key.  Note, that this will always
+be true even if the corresponding subkey flag may be false
+(offline/stub keys).  This is only set if a listing of secret keys has
+been requested or if @code{GPGME_KEYLIST_MODE_WITH_SECRET} is active.
 
 @item gpgme_protocol_t protocol
 This is the protocol supported by this key.
index 66f8204..c3a4de7 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 8 May 2014
-@set UPDATED-MONTH May 2014
-@set EDITION 1.5.0
-@set VERSION 1.5.0
+@set UPDATED 30 July 2014
+@set UPDATED-MONTH July 2014
+@set EDITION 1.5.1
+@set VERSION 1.5.1
index 66f8204..c3a4de7 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 8 May 2014
-@set UPDATED-MONTH May 2014
-@set EDITION 1.5.0
-@set VERSION 1.5.0
+@set UPDATED 30 July 2014
+@set UPDATED-MONTH July 2014
+@set EDITION 1.5.1
+@set VERSION 1.5.1
index 335ba14..a594f83 100644 (file)
@@ -1,7 +1,7 @@
 # This is a template.  The dist target uses it to create the real file.
 Summary: GPGME - GnuPG Made Easy
 Name: gpgme
-Version: 1.5.0
+Version: 1.5.1
 Release: 1
 URL: http://www.gnupg.org/gpgme.html
 Source: ftp://ftp.gnupg.org/gcrypt/alpha/gpgme/%{name}-%{version}.tar.gz
index 53bd37b..47a486a 100644 (file)
@@ -27,7 +27,7 @@
 (defsystem gpgme
     :description "GnuPG Made Easy."
     :author "g10 Code GmbH"
-    :version "1.5.0"
+    :version "1.5.1"
     :licence "GPL"
     :depends-on ("cffi" "gpg-error")
     :components ((:file "gpgme-package")
index 0a11d9f..745d2aa 100644 (file)
@@ -238,6 +238,12 @@ my_connect (assuan_context_t ctx, int sock, struct sockaddr *addr,
 }
 
 
+/* Note for Windows: Ignore the incompatible pointer type warning for
+   my_read and my_write.  Mingw has been changed to use int for
+   ssize_t on 32 bit systems while we use long.  For 64 bit we use
+   int64_t while mingw uses __int64_t.  It doe not matter at all
+   because under Windows long and int are both 32 bit even on 64
+   bit.  */
 struct assuan_system_hooks _gpgme_assuan_system_hooks =
   {
     ASSUAN_SYSTEM_HOOKS_VERSION,
index ede098e..4df0f3e 100644 (file)
@@ -2194,6 +2194,8 @@ gpg_keylist_build_options (engine_gpg_t gpg, int secret_only,
     err = add_arg (gpg, "--with-fingerprint");
   if (!err)
     err = add_arg (gpg, "--with-fingerprint");
+  if (!err && (mode & GPGME_KEYLIST_MODE_WITH_SECRET))
+    err = add_arg (gpg, "--with-secret");
   if (!err
       && (mode & GPGME_KEYLIST_MODE_SIGS)
       && (mode & GPGME_KEYLIST_MODE_SIG_NOTATIONS))
index 710bf14..3a83757 100644 (file)
@@ -836,7 +836,7 @@ status_handler (void *opaque, int fd)
              else
                {
                  *aline = newline;
-                 gpgsm->colon.attic.linesize += linelen + 1;
+                 gpgsm->colon.attic.linesize = *alinelen + linelen + 1;
                }
            }
          if (!err)
@@ -1551,7 +1551,7 @@ gpgsm_keylist (void *engine, const char *pattern, int secret_only,
      the agent.  However on a fresh installation no public keys are
      available and thus there is no need for gpgsm to ask the agent
      whether a secret key exists for the public key.  */
-  if (secret_only)
+  if (secret_only || (mode & GPGME_KEYLIST_MODE_WITH_SECRET))
     gpgsm_assuan_simple_command (gpgsm->assuan_ctx, "GETINFO agent-check",
                                  NULL, NULL);
 
@@ -1580,6 +1580,11 @@ gpgsm_keylist (void *engine, const char *pattern, int secret_only,
                                "OPTION with-ephemeral-keys=1":
                                "OPTION with-ephemeral-keys=0" ,
                                NULL, NULL);
+  gpgsm_assuan_simple_command (gpgsm->assuan_ctx,
+                               (mode & GPGME_KEYLIST_MODE_WITH_SECRET)?
+                               "OPTION with-secret=1":
+                               "OPTION with-secret=0" ,
+                               NULL, NULL);
 
 
   /* Length is "LISTSECRETKEYS " + p + '\0'.  */
@@ -1645,6 +1650,11 @@ gpgsm_keylist_ext (void *engine, const char *pattern[], int secret_only,
                                "OPTION with-validation=1":
                                "OPTION with-validation=0" ,
                                NULL, NULL);
+  gpgsm_assuan_simple_command (gpgsm->assuan_ctx,
+                               (mode & GPGME_KEYLIST_MODE_WITH_SECRET)?
+                               "OPTION with-secret=1":
+                               "OPTION with-secret=0" ,
+                               NULL, NULL);
 
 
   if (pattern && *pattern)
index 2738c36..a7184b7 100644 (file)
@@ -698,7 +698,7 @@ status_handler (void *opaque, int fd)
              else
                {
                  *aline = newline;
-                 uiserver->colon.attic.linesize += linelen + 1;
+                 uiserver->colon.attic.linesize = *alinelen + linelen + 1;
                }
            }
          if (!err)
index be8ed07..f02fffa 100644 (file)
@@ -1861,6 +1861,8 @@ gt_get_keylist_mode (gpgme_tool_t gt)
     modes[idx++] = "sigs";
   if (mode & GPGME_KEYLIST_MODE_SIG_NOTATIONS)
     modes[idx++] = "sig_notations";
+  if (mode & GPGME_KEYLIST_MODE_WITH_SECRET)
+    modes[idx++] = "with_secret";
   if (mode & GPGME_KEYLIST_MODE_EPHEMERAL)
     modes[idx++] = "ephemeral";
   if (mode & GPGME_KEYLIST_MODE_VALIDATE)
@@ -2591,6 +2593,8 @@ cmd_keylist_mode (assuan_context_t ctx, char *line)
        mode |= GPGME_KEYLIST_MODE_SIGS;
       if (strstr (line, "sig_notations"))
        mode |= GPGME_KEYLIST_MODE_SIG_NOTATIONS;
+      if (strstr (line, "with_secret"))
+       mode |= GPGME_KEYLIST_MODE_WITH_SECRET;
       if (strstr (line, "ephemeral"))
        mode |= GPGME_KEYLIST_MODE_EPHEMERAL;
       if (strstr (line, "validate"))
@@ -3299,6 +3303,12 @@ cmd_keylist (assuan_context_t ctx, char *line)
            result_xml_tag_start (&state, "subkey", NULL);
            /* FIXME: more data */
            result_add_fpr (&state, "fpr", subkey->fpr);
+            result_add_value (&state, "secret", subkey->secret);
+            result_add_value (&state, "is_cardkey", subkey->is_cardkey);
+            if (subkey->card_number)
+              result_add_string (&state, "card_number", subkey->card_number);
+            if (subkey->curve)
+              result_add_string (&state, "curve", subkey->curve);
            result_xml_tag_end (&state);  /* subkey */
            subkey = subkey->next;
          }
index 8a4ab54..b510ba3 100644 (file)
 #endif
 #include <stdint.h>
 #include <process.h>
-#include <windows.h>
 
-/* Flag values as used by gpgme.  */
-#define IOSPAWN_FLAG_ALLOW_SET_FG 1
+#include "priv-io.h"
 
 
 /* Name of this program.  */
 
 
 \f
-struct spawn_fd_item_s
-{
-  int handle;
-  int dup_to;
-  int peer_name;
-  int arg_loc;
-};
-
-
 static char *
 build_commandline (char **argv)
 {
@@ -160,7 +149,7 @@ my_spawn (char **argv, struct spawn_fd_item_s *fd_list, unsigned int flags)
 
   fprintf (stderr, PGM": spawning: %s\n", arg_string);
 
-  for (i = 0; fd_list[i].handle != -1; i++)
+  for (i = 0; fd_list[i].fd != -1; i++)
     {
       /* The handle already is inheritable.  */
       if (fd_list[i].dup_to == 0)
@@ -240,8 +229,8 @@ my_spawn (char **argv, struct spawn_fd_item_s *fd_list, unsigned int flags)
   if (hnul != INVALID_HANDLE_VALUE)
     CloseHandle (hnul);
 
-  for (i = 0; fd_list[i].handle != -1; i++)
-    CloseHandle ((HANDLE) fd_list[i].handle);
+  for (i = 0; fd_list[i].fd != -1; i++)
+    CloseHandle ((HANDLE) fd_list[i].fd);
 
   if (flags & IOSPAWN_FLAG_ALLOW_SET_FG)
     {
@@ -379,12 +368,12 @@ translate_get_from_file (const char *trans_file,
        break;
       linep = tail;
 
-      fd_list[idx].handle = from;
+      fd_list[idx].fd = from;
       fd_list[idx].dup_to = dup_to;
       fd_list[idx].peer_name = to;
       fd_list[idx].arg_loc = loc;
     }
-  fd_list[idx].handle = -1;
+  fd_list[idx].fd = -1;
   fd_list[idx].dup_to = -1;
   fd_list[idx].peer_name = -1;
   fd_list[idx].arg_loc = 0;
@@ -420,7 +409,7 @@ translate_handles (const char *trans_file, const char * const *argv,
   args[idx] = NULL;
   n_args = idx;
 
-  for (idx = 0; fd_list[idx].handle != -1; idx++)
+  for (idx = 0; fd_list[idx].fd != -1; idx++)
     {
       char buf[25];
       int aidx;
index d47f4ba..15ed803 100644 (file)
@@ -370,6 +370,7 @@ gpgme_protocol_t;
 #define GPGME_KEYLIST_MODE_EXTERN              2
 #define GPGME_KEYLIST_MODE_SIGS                        4
 #define GPGME_KEYLIST_MODE_SIG_NOTATIONS       8
+#define GPGME_KEYLIST_MODE_WITH_SECRET         16
 #define GPGME_KEYLIST_MODE_EPHEMERAL            128
 #define GPGME_KEYLIST_MODE_VALIDATE            256
 
index 582b241..36ee3ea 100644 (file)
@@ -367,7 +367,7 @@ set_ownertrust (gpgme_key_t key, const char *src)
    reference to smartcards.  FIELD is the content of the field and we
    are allowed to modify it.  */
 static gpg_error_t
-parse_sec_field15 (gpgme_subkey_t subkey, char *field)
+parse_sec_field15 (gpgme_key_t key, gpgme_subkey_t subkey, char *field)
 {
   if (!*field)
     ; /* Empty.  */
@@ -375,17 +375,25 @@ parse_sec_field15 (gpgme_subkey_t subkey, char *field)
     {
       /* This is a stub for an offline key.  We reset the SECRET flag
          of the subkey here.  Note that the secret flag of the entire
-         key will be true even then.  */
+         key will be true even then.  We even explicitly set
+         key->secret to make it works for GPGME_KEYLIST_MODE_WITH_SECRET. */
       subkey->secret = 0;
+      key->secret = 1;
     }
   else if (strchr ("01234567890ABCDEFabcdef", *field))
     {
       /* Fields starts with a hex digit; thus it is a serial number.  */
+      key->secret = 1;
       subkey->is_cardkey = 1;
       subkey->card_number = strdup (field);
       if (!subkey->card_number)
         return gpg_error_from_syserror ();
     }
+  else if (*field == '+')
+    {
+      key->secret = 1;
+      subkey->secret = 1;
+    }
   else
     {
       /* RFU.  */
@@ -578,9 +586,11 @@ keylist_colon_handler (void *priv, char *line)
        set_mainkey_capability (key, field[11]);
 
       /* Field 15 carries special flags of a secret key.  */
-      if (fields >= 15 && key->secret)
+      if (fields >= 15
+          && (key->secret
+              || (ctx->keylist_mode & GPGME_KEYLIST_MODE_WITH_SECRET)))
         {
-          err = parse_sec_field15 (subkey, field[14]);
+          err = parse_sec_field15 (key, subkey, field[14]);
           if (err)
             return err;
         }
@@ -649,9 +659,11 @@ keylist_colon_handler (void *priv, char *line)
        set_subkey_capability (subkey, field[11]);
 
       /* Field 15 carries special flags of a secret key. */
-      if (fields >= 15 && key->secret)
+      if (fields >= 15
+          && (key->secret
+              || (ctx->keylist_mode & GPGME_KEYLIST_MODE_WITH_SECRET)))
         {
-          err = parse_sec_field15 (subkey, field[14]);
+          err = parse_sec_field15 (key, subkey, field[14]);
           if (err)
             return err;
         }
index edd317d..2bcb3a3 100644 (file)
@@ -266,6 +266,14 @@ _gpgme_parse_inv_recp (char *args, gpgme_invalid_key_t *key)
     case 12:
       inv_key->reason = gpg_error (GPG_ERR_MISSING_ISSUER_CERT);
       break;
+
+    case 13:
+      inv_key->reason = gpg_error (252); /*GPG_ERR_KEY_DISABLED*/
+      break;
+
+    case 14:
+      inv_key->reason = gpg_error (GPG_ERR_INV_USER_ID);
+      break;
     }
 
   while (*tail && *tail == ' ')
index 583f06a..2306175 100644 (file)
@@ -26,6 +26,7 @@
 # ifdef HAVE_W32CE_SYSTEM
 #  include "w32-ce.h"
 # endif
+# include <winsock2.h>
 # include <windows.h>
 #else
 # include <sys/socket.h>