+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.
+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]
-------------------------------------------------------------
#! /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>.
#
# 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=''
# 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]...
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
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.
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 $@
# (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.
# Define the identity of the package.
PACKAGE='gpgme'
- VERSION='1.5.0'
+ VERSION='1.5.1'
cat >>confdefs.h <<_ACEOF
#define VERSION "$VERSION"
_ACEOF
-VERSION_NUMBER=0x010500
+VERSION_NUMBER=0x010501
# Don't default to build static libs.
#
# Provide information about the build.
#
-BUILD_REVISION="0eca211"
+BUILD_REVISION="16835c3"
cat >>confdefs.h <<_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`
# 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
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\\"
echo "
GPGME v${VERSION} has been configured as follows:
- Revision: 0eca211 (3786)
+ Revision: 16835c3 (5763)
Platform: $host
UI Server: $uiserver
# 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
# (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.
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.
\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
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.
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:
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.
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.
`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.
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.
* 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)
* 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)
(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)
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.
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.
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.
-@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
-@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
# 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
(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")
}
+/* 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,
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))
else
{
*aline = newline;
- gpgsm->colon.attic.linesize += linelen + 1;
+ gpgsm->colon.attic.linesize = *alinelen + linelen + 1;
}
}
if (!err)
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);
"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'. */
"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)
else
{
*aline = newline;
- uiserver->colon.attic.linesize += linelen + 1;
+ uiserver->colon.attic.linesize = *alinelen + linelen + 1;
}
}
if (!err)
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)
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"))
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;
}
#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)
{
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)
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)
{
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;
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;
#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
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. */
{
/* 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. */
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;
}
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;
}
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 == ' ')
# ifdef HAVE_W32CE_SYSTEM
# include "w32-ce.h"
# endif
+# include <winsock2.h>
# include <windows.h>
#else
# include <sys/socket.h>