[git] GPG-ERROR - branch, master, updated. libgpg-error-1.25-10-gc761c98

by Werner Koch cvs at cvs.gnupg.org
Fri Dec 2 22:54:33 CET 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Error codes used by GnuPG et al.".

The branch, master has been updated
       via  c761c981b38741421d13bb7102b1ea7625d2d639 (commit)
       via  b462d603f5110842489edce9e01e4ea40ac05cba (commit)
      from  f769450924367d4f495eda981025fed391cd68a8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c761c981b38741421d13bb7102b1ea7625d2d639
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Dec 2 22:49:54 2016 +0100

    New error code GPG_ERR_INV_FLAG

diff --git a/NEWS b/NEWS
index 46ecdc9..f1da8b0 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,12 @@
 Noteworthy changes in version 1.26 (unreleased) [C20/A20/R_]
 -----------------------------------------------
 
+ * New option --desc for gpg-error.
+
+ * Interface changes relative to the 1.25 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPG_ERR_UNKNOWN_FLAG             NEW.
+
 
 Noteworthy changes in version 1.25 (2016-11-14) [C20/A20/R0]
 -----------------------------------------------
diff --git a/doc/errorref.txt b/doc/errorref.txt
index 496a2a2..70d94da 100644
--- a/doc/errorref.txt
+++ b/doc/errorref.txt
@@ -1016,6 +1016,14 @@ GPG_ERR_TOO_OLD                         Objects is too old
     Used if an object is too old to be used.  This is a more generic
     code than GPG_ERR_ENGINE_TOO_OLD or GPG_ERR_CRL_TOO_OLD.
 
+GPG_ERR_UNKNOWN_FLAG            Unknown flag
+
+    The flag is not known.
+
+    GNUPG: - The flag part of the string given to the
+             option --default-new-key-algo value is not known.
+
+
 GPG_ERR_LDAP_GENERAL            LDAP General error
 
    Catch all error for LDAP.  Use if if can't map an erro rocde to an
diff --git a/src/err-codes.h.in b/src/err-codes.h.in
index de703d7..0669d35 100644
--- a/src/err-codes.h.in
+++ b/src/err-codes.h.in
@@ -328,6 +328,7 @@
 306	GPG_ERR_DUP_NAME		Duplicated name
 307	GPG_ERR_TOO_YOUNG		Object is too young
 308	GPG_ERR_TOO_OLD			Object is too old
+309	GPG_ERR_UNKNOWN_FLAG		Unknown flag
 # This range is free for use.
 
 #

commit b462d603f5110842489edce9e01e4ea40ac05cba
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Dec 2 22:46:07 2016 +0100

    New option --desc for gpg-error.
    
    * doc/errorref.txt: Remove all tabs.
    * doc/Makefile.am (install-data-local): New to install errorref.txt.
    (uninstall-local): New.
    (errorref.txt.x): New.
    * src/Makefile.am (gpg_error_CPPFLAGS): Define PKGDATADIR
    * src/gpg-error.c (print_desc): New.
    (show_usage): New.
    (main): Improve option parser.  Add new option --desc.  Call
    print_desc.
    --
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/doc/Makefile.am b/doc/Makefile.am
index 3d7b143..565bb09 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -21,7 +21,7 @@ EXTRA_DIST = HACKING errorref.txt \
 	     yat2m.c
 
 DISTCLEANFILES = gpgrt.cps yat2m-stamp.tmp yat2m-stamp $(myman_pages)
-CLEANFILES = yat2m
+CLEANFILES = yat2m errorref.txt.x
 
 info_TEXINFOS = gpgrt.texi
 gpgrt_TEXINFOS = lgpl.texi gpl.texi
@@ -66,3 +66,14 @@ $(myman_pages) : yat2m-stamp
 # updates the release date.
 gpgrt.texi : $(gpgrt_TEXINFOS)
 	touch $(srcdir)/gpgrt.texi
+
+errorref.txt.x : errorref.txt
+	sed '/^##/ d' $< >$@
+	echo "# Installed by $(PACKAGE_NAME) $(PACKAGE_VERSION)" >>$@
+
+install-data-local: errorref.txt.x
+	$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
+	$(INSTALL_DATA) errorref.txt.x $(DESTDIR)$(pkgdatadir)/errorref.txt
+
+uninstall-local:
+	- at rm $(DESTDIR)$(pkgdatadir)/errorref.txt
diff --git a/doc/errorref.txt b/doc/errorref.txt
index d389398..496a2a2 100644
--- a/doc/errorref.txt
+++ b/doc/errorref.txt
@@ -1,17 +1,38 @@
-# find ~/s/{gnupg,libgpg-error,libksba,libgcrypt,gpgme,gpa} -type f \
-#        -name '*.[ch]' -print0 | xargs -0 grep -n GPG_ERR_
-
-
-GPG_ERR_UNKNOWN_PACKET (1)	Unknown packet
+# errorref.txt - Description of error codes
+# Copyright (C) 2003-2004, 2010, 2013-2016 g10 Code GmbH
+#
+# This file is part of libgpg-error.
+#
+# libgpg-error is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1 of
+# the License, or (at your option) any later version.
+#
+# libgpg-error is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, see <https://www.gnu.org/licenses/>.
+##
+## Note that lines with a leading double hash will not installed.
+## Please do not put any tabs into this file.
+##
+## find ~/s/{gnupg,libgpg-error,libksba,libgcrypt,gpgme,gpa} -type f \
+##        -name '*.[ch]' -print0 | xargs -0 grep -n GPG_ERR_
+
+
+GPG_ERR_UNKNOWN_PACKET          Unknown packet
 
     GNUPG:  - Redefined to G10ERR_UNKNOWN_PACKET in gpg.
 
-GPG_ERR_UNKNOWN_VERSION (2)	Unknown version in packet
+GPG_ERR_UNKNOWN_VERSION         Unknown version in packet
 
     Used by GnuPG 2.1 to identify valid OpenPGP packets with an
     unknown version.
 
-GPG_ERR_PUBKEY_ALGO		Invalid public key algorithm
+GPG_ERR_PUBKEY_ALGO             Invalid public key algorithm
 
     GNUPG:  - Redefined to G10ERR_PUBKEY_ALGO in gpg.
             - Public key algorithm is not allowed by OpenPGP.
@@ -21,7 +42,7 @@ GPG_ERR_PUBKEY_ALGO		Invalid public key algorithm
             - [version < 1.5] Checking of the RSA secret key failed
                               (consistency check).
 
-GPG_ERR_DIGEST_ALGO		Invalid digest algorithm
+GPG_ERR_DIGEST_ALGO             Invalid digest algorithm
 
     GNUPG:  - Digest algorithm is not supported.
             - Redefined to G10ERR_PUBKEY_ALGO in gpg.
@@ -40,14 +61,14 @@ GPG_ERR_DIGEST_ALGO		Invalid digest algorithm
               message algorithm enabled for the hash context.
             - Bad digest algorithm given to public key function.
 
-GPG_ERR_BAD_PUBKEY		Bad public key
+GPG_ERR_BAD_PUBKEY              Bad public key
 
     GNUPG:  - Redefined to G10ERR_BAD_PUBKEY in gpg.
             - Missing public or domain parameter in an s-expression.
               If the curve name is mssing GPG_ERR_INV_CURVE may be
               used as well.
 
-GPG_ERR_BAD_SECKEY		Bad secret key
+GPG_ERR_BAD_SECKEY              Bad secret key
 
     GNUPG:  - Invalid format of a S-expression encoded private key in
               gpg-agent.
@@ -62,7 +83,7 @@ GPG_ERR_BAD_SECKEY		Bad secret key
     GCRYPT: - Checking the secret key failed (consistency check).
 
 
-GPG_ERR_BAD_SIGNATURE		Bad signature
+GPG_ERR_BAD_SIGNATURE           Bad signature
 
     GNUPG:  - Redefined to G10ERR_BAD_SIGN in gpg.
             - The MDC check of an OpenPGP encrypted message failed.
@@ -70,7 +91,7 @@ GPG_ERR_BAD_SIGNATURE		Bad signature
             - A signature with a key flagged as "never trust" was made.
     GCRYPT: - A public key signature did not verify.
 
-GPG_ERR_NO_PUBKEY		No public key
+GPG_ERR_NO_PUBKEY               No public key
 
     GNUPG:  - Redefined to G10ERR_NO_PUBKEY in gpg.
             - A key was requested from an OpenPGP card but the key is
@@ -93,31 +114,34 @@ GPG_ERR_NO_PUBKEY		No public key
     GPA:    - No key was given for encryption.
             - The selected encryption protocol is not available.
 
-GPG_ERR_CHECKSUM		Checksum error
+GPG_ERR_CHECKSUM                Checksum error
 
     GNUPG:  - The checksum of an unprotected OpenPGP secret key packet
               is wrong.
     GCRYPT: - Decryption in AESWRAP mode does not match the expected IV.
     [more to come]
 
-GPG_ERR_BAD_PASSPHRASE		Bad passphrase
+GPG_ERR_BAD_PASSPHRASE          Bad passphrase
 
     GNUPG: - The entered passphrase does not verify
 
+GPG_ERR_CIPHER_ALGO             Invalid cipher algorithm
+
+GPG_ERR_KEYRING_OPEN            Cannot open keyring
+
+GPG_ERR_INV_PACKET              Invalid packet
+
+GPG_ERR_INV_ARMOR               Invalid armor
 
-12	GPG_ERR_CIPHER_ALGO		Invalid cipher algorithm
-13	GPG_ERR_KEYRING_OPEN		Cannot open keyring
-14	GPG_ERR_INV_PACKET		Invalid packet
-15	GPG_ERR_INV_ARMOR		Invalid armor
-16	GPG_ERR_NO_USER_ID		No user ID
+GPG_ERR_NO_USER_ID              No user ID
 
-GPG_ERR_NO_SECKEY		No secret key
+GPG_ERR_NO_SECKEY               No secret key
 
    NTBTLS: - No private key or pre-shared key available.
 
-18	GPG_ERR_WRONG_SECKEY		Wrong secret key used
+GPG_ERR_WRONG_SECKEY            Wrong secret key used
 
-GPG_ERR_BAD_KEY			Bad session key
+GPG_ERR_BAD_KEY                         Bad session key
 
     GNUPG: - gpg-agent's command IMPORT_KEY or EXPORT_KEY is used
              without a prior KEYWRAP_KEY command.
@@ -125,15 +149,20 @@ GPG_ERR_BAD_KEY			Bad session key
     [more to come]
 
 
-20	GPG_ERR_COMPR_ALGO		Unknown compression algorithm
-21	GPG_ERR_NO_PRIME		Number is not prime
-22	GPG_ERR_NO_ENCODING_METHOD	Invalid encoding method
-23	GPG_ERR_NO_ENCRYPTION_SCHEME	Invalid encryption scheme
-24	GPG_ERR_NO_SIGNATURE_SCHEME	Invalid signature scheme
-25	GPG_ERR_INV_ATTR		Invalid attribute
+GPG_ERR_COMPR_ALGO              Unknown compression algorithm
+
+GPG_ERR_NO_PRIME                Number is not prime
+
+GPG_ERR_NO_ENCODING_METHOD      Invalid encoding method
+
+GPG_ERR_NO_ENCRYPTION_SCHEME    Invalid encryption scheme
+
+GPG_ERR_NO_SIGNATURE_SCHEME     Invalid signature scheme
 
+GPG_ERR_INV_ATTR                Invalid attribute
 
-GPG_ERR_NO_VALUE		No value
+
+GPG_ERR_NO_VALUE                No value
 
     GNUPG:  - A timestamp value is expect but there is none.
     KSBA:   - A timestamp value is expect but there is none.
@@ -142,45 +171,51 @@ GPG_ERR_NO_VALUE		No value
             - Converting a Distinguised Name to an RFC2253 string failed.
 
 
-GPG_ERR_NOT_FOUND		Not found
+GPG_ERR_NOT_FOUND               Not found
 
     A search operation did not return a matching value.
 
 
-GPG_ERR_VALUE_NOT_FOUND		Value not found
+GPG_ERR_VALUE_NOT_FOUND                 Value not found
 
     GNUPG:  - A keyblock or a cert object was requested but not
               found.  This might indicate an internal error here.
 
 
-29	GPG_ERR_SYNTAX			Syntax error
-30	GPG_ERR_BAD_MPI			Bad MPI value
+GPG_ERR_SYNTAX                  Syntax error
+
+GPG_ERR_BAD_MPI                         Bad MPI value
 
-GPG_ERR_INV_PASSPHRASE		Invalid passphrase
+GPG_ERR_INV_PASSPHRASE          Invalid passphrase
 
     GNUPG:  - Required constraints of the passphrase are not met.
 
-32	GPG_ERR_SIG_CLASS		Invalid signature class
-33	GPG_ERR_RESOURCE_LIMIT		Resources exhausted
-34	GPG_ERR_INV_KEYRING		Invalid keyring
-35	GPG_ERR_TRUSTDB			Trust DB error
+GPG_ERR_SIG_CLASS               Invalid signature class
+
+GPG_ERR_RESOURCE_LIMIT          Resources exhausted
+
+GPG_ERR_INV_KEYRING             Invalid keyring
+
+GPG_ERR_TRUSTDB                         Trust DB error
 
 
-GPG_ERR_BAD_CERT		Bad certificate
+GPG_ERR_BAD_CERT                Bad certificate
 
 
-GPG_ERR_INV_USER_ID		Invalid user ID
+GPG_ERR_INV_USER_ID             Invalid user ID
 
     GNUPG:  - Used to indicate a bad specification of a user id.
     [more to come]
 
 
-38	GPG_ERR_UNEXPECTED		Unexpected error
-39	GPG_ERR_TIME_CONFLICT		Time conflict
-40	GPG_ERR_KEYSERVER		Keyserver error
+GPG_ERR_UNEXPECTED              Unexpected error
 
+GPG_ERR_TIME_CONFLICT           Time conflict
 
-GPG_ERR_WRONG_PUBKEY_ALGO	Wrong public key algorithm
+GPG_ERR_KEYSERVER               Keyserver error
+
+
+GPG_ERR_WRONG_PUBKEY_ALGO       Wrong public key algorithm
 
     GNUPG: - The algorithm is not expected.  For example a DSA
              algorithm is used where a non-DSA algorithm is expected
@@ -189,11 +224,13 @@ GPG_ERR_WRONG_PUBKEY_ALGO	Wrong public key algorithm
               different key type than requested.
 
 
-42	GPG_ERR_TRIBUTE_TO_D_A		Tribute to D. A.
-43	GPG_ERR_WEAK_KEY		Weak encryption key
-44	GPG_ERR_INV_KEYLEN		Invalid key length
+GPG_ERR_TRIBUTE_TO_D_A          Tribute to D. A.
+
+GPG_ERR_WEAK_KEY                Weak encryption key
+
+GPG_ERR_INV_KEYLEN              Invalid key length
 
-GPG_ERR_INV_ARG			Invalid argument
+GPG_ERR_INV_ARG                         Invalid argument
 
     GCRYPT:  - Unsupported length of input data in encrypt or decrypt
                cipher functions.  For example not matching the block
@@ -203,30 +240,37 @@ GPG_ERR_INV_ARG			Invalid argument
     [more to come]
 
 
-46	GPG_ERR_BAD_URI			Syntax error in URI
-47	GPG_ERR_INV_URI			Invalid URI
-48	GPG_ERR_NETWORK			Network error
-49	GPG_ERR_UNKNOWN_HOST		Unknown host
+GPG_ERR_BAD_URI                         Syntax error in URI
+
+GPG_ERR_INV_URI                         Invalid URI
+
+GPG_ERR_NETWORK                         Network error
+
+GPG_ERR_UNKNOWN_HOST            Unknown host
 
         Used instead of the non-portbale EHOSTNOTFOUND which is
         returned by some systems as a mapping of h_errno's
         HOST_NOT_FOUND
 
 
-50	GPG_ERR_SELFTEST_FAILED		Selftest failed
-51	GPG_ERR_NOT_ENCRYPTED		Data not encrypted
-52	GPG_ERR_NOT_PROCESSED		Data not processed
-53	GPG_ERR_UNUSABLE_PUBKEY		Unusable public key
-54	GPG_ERR_UNUSABLE_SECKEY		Unusable secret key
+GPG_ERR_SELFTEST_FAILED                 Selftest failed
+
+GPG_ERR_NOT_ENCRYPTED           Data not encrypted
+
+GPG_ERR_NOT_PROCESSED           Data not processed
 
-GPG_ERR_INV_VALUE		Invalid value
+GPG_ERR_UNUSABLE_PUBKEY                 Unusable public key
+
+GPG_ERR_UNUSABLE_SECKEY                 Unusable secret key
+
+GPG_ERR_INV_VALUE               Invalid value
 
     NTBTLS: - A DH parameter is out of range
 
 
-56	GPG_ERR_BAD_CERT_CHAIN		Bad certificate chain
+GPG_ERR_BAD_CERT_CHAIN          Bad certificate chain
 
-GPG_ERR_MISSING_CERT		Missing certificate
+GPG_ERR_MISSING_CERT            Missing certificate
 
     NTBTLS: - The server needs to send a certifciate but none has been
               set.  See also GPG_ERR_MISSING_ISSUER_CERT and
@@ -234,10 +278,11 @@ GPG_ERR_MISSING_CERT		Missing certificate
 
 
 
-58	GPG_ERR_NO_DATA			No data
-59	GPG_ERR_BUG			Bug
+GPG_ERR_NO_DATA                         No data
 
-60	GPG_ERR_NOT_SUPPORTED		Not supported
+GPG_ERR_BUG                     Bug
+
+GPG_ERR_NOT_SUPPORTED           Not supported
 
         Used if a feature is currently not supported but may be
         enabled for example using a program option.  Commonly used if
@@ -246,20 +291,27 @@ GPG_ERR_MISSING_CERT		Missing certificate
         are not yet supported.
 
 
-61	GPG_ERR_INV_OP			Invalid operation code
-62	GPG_ERR_TIMEOUT			Timeout
-63	GPG_ERR_INTERNAL		Internal error
-64	GPG_ERR_EOF_GCRYPT		EOF (gcrypt)
-65	GPG_ERR_INV_OBJ			Invalid object
-66	GPG_ERR_TOO_SHORT		Provided object is too short
-67	GPG_ERR_TOO_LARGE		Provided object is too large
-68	GPG_ERR_NO_OBJ			Missing item in object
+GPG_ERR_INV_OP                  Invalid operation code
+
+GPG_ERR_TIMEOUT                         Timeout
 
-GPG_ERR_NOT_IMPLEMENTED		Not implemented
+GPG_ERR_INTERNAL                Internal error
+
+GPG_ERR_EOF_GCRYPT              EOF (gcrypt)
+
+GPG_ERR_INV_OBJ                         Invalid object
+
+GPG_ERR_TOO_SHORT               Provided object is too short
+
+GPG_ERR_TOO_LARGE               Provided object is too large
+
+GPG_ERR_NO_OBJ                  Missing item in object
+
+GPG_ERR_NOT_IMPLEMENTED                 Not implemented
 
     NTBTLS: - The requested feature is not implemented.
 
-GPG_ERR_CONFLICT		Conflicting use
+GPG_ERR_CONFLICT                Conflicting use
 
     NTBTLS: - Function has already been called and may not be called
               again at this protocol state.
@@ -267,42 +319,53 @@ GPG_ERR_CONFLICT		Conflicting use
               which seems to be in use.
 
 
-71	GPG_ERR_INV_CIPHER_MODE		Invalid cipher mode
-72	GPG_ERR_INV_FLAG		Invalid flag
+GPG_ERR_INV_CIPHER_MODE                 Invalid cipher mode
+
+GPG_ERR_INV_FLAG                Invalid flag
 
    GPGME: Used to indicate an invalid combination of flags.
 
 
-73	GPG_ERR_INV_HANDLE		Invalid handle
-74	GPG_ERR_TRUNCATED		Result truncated
-75	GPG_ERR_INCOMPLETE_LINE		Incomplete line
-76	GPG_ERR_INV_RESPONSE		Invalid response
-77	GPG_ERR_NO_AGENT		No agent running
-78	GPG_ERR_AGENT			agent error
+GPG_ERR_INV_HANDLE              Invalid handle
+
+GPG_ERR_TRUNCATED               Result truncated
+
+GPG_ERR_INCOMPLETE_LINE                 Incomplete line
 
-GPG_ERR_INV_DATA		Invalid data
+GPG_ERR_INV_RESPONSE            Invalid response
+
+GPG_ERR_NO_AGENT                No agent running
+
+GPG_ERR_AGENT                   agent error
+
+GPG_ERR_INV_DATA                Invalid data
 
     GNUPG:  - Used in app-openpgp.c for a badly formatted request.
     GCRYPT: - No passphrase given for gcry_kdf_derive.
             - An opaque MPI is given to a public key function but not
               expected.
 
-80	GPG_ERR_ASSUAN_SERVER_FAULT	Unspecific Assuan server fault
+GPG_ERR_ASSUAN_SERVER_FAULT     Unspecific Assuan server fault
 
-GPG_ERR_ASSUAN			General Assuan error
+GPG_ERR_ASSUAN                  General Assuan error
 
     GNUPG: - Used by Assuan command handler if they fail to do basic
              things like an es_fdopen or es_fopencookie.
 
 
-82	GPG_ERR_INV_SESSION_KEY		Invalid session key
-83	GPG_ERR_INV_SEXP		Invalid S-expression
-84	GPG_ERR_UNSUPPORTED_ALGORITHM	Unsupported algorithm
-85	GPG_ERR_NO_PIN_ENTRY		No pinentry
-86	GPG_ERR_PIN_ENTRY		pinentry error
-87	GPG_ERR_BAD_PIN			Bad PIN
+GPG_ERR_INV_SESSION_KEY                 Invalid session key
+
+GPG_ERR_INV_SEXP                Invalid S-expression
+
+GPG_ERR_UNSUPPORTED_ALGORITHM   Unsupported algorithm
 
-GPG_ERR_INV_NAME		Invalid name
+GPG_ERR_NO_PIN_ENTRY            No pinentry
+
+GPG_ERR_PIN_ENTRY               pinentry error
+
+GPG_ERR_BAD_PIN                         Bad PIN
+
+GPG_ERR_INV_NAME                Invalid name
 
     GNUPG:  - Formerly used in GPGSM to indicate an error in
               the specification of a user id.  Later replaced by
@@ -316,47 +379,76 @@ GPG_ERR_INV_NAME		Invalid name
 
     [more to come]
 
-GPG_ERR_BAD_DATA		Bad data
+GPG_ERR_BAD_DATA                Bad data
 
-GPG_ERR_INV_PARAMETER		Invalid parameter
+GPG_ERR_INV_PARAMETER           Invalid parameter
 
     GNUPG:  - Returned if gpg-agent sends a new generated key with
               unknown parameter names.
             - Invalid parameter in the parameter file for key
               generation by gpgsm.
 
-91	GPG_ERR_WRONG_CARD		Wrong card
-92	GPG_ERR_NO_DIRMNGR		No dirmngr
-93	GPG_ERR_DIRMNGR			dirmngr error
-94	GPG_ERR_CERT_REVOKED		Certificate revoked
-95	GPG_ERR_NO_CRL_KNOWN		No CRL known
-96	GPG_ERR_CRL_TOO_OLD		CRL too old
-97	GPG_ERR_LINE_TOO_LONG		Line too long
-98	GPG_ERR_NOT_TRUSTED		Not trusted
-99	GPG_ERR_CANCELED		Operation cancelled
-100	GPG_ERR_BAD_CA_CERT		Bad CA certificate
-101	GPG_ERR_CERT_EXPIRED		Certificate expired
-102	GPG_ERR_CERT_TOO_YOUNG		Certificate too young
-103	GPG_ERR_UNSUPPORTED_CERT	Unsupported certificate
-104	GPG_ERR_UNKNOWN_SEXP		Unknown S-expression
-105	GPG_ERR_UNSUPPORTED_PROTECTION	Unsupported protection
-106	GPG_ERR_CORRUPTED_PROTECTION	Corrupted protection
-107	GPG_ERR_AMBIGUOUS_NAME		Ambiguous name
-108	GPG_ERR_CARD			Card error
-109	GPG_ERR_CARD_RESET		Card reset required
-110	GPG_ERR_CARD_REMOVED		Card removed
-111	GPG_ERR_INV_CARD		Invalid card
-112	GPG_ERR_CARD_NOT_PRESENT	Card not present
-113	GPG_ERR_NO_PKCS15_APP		No PKCS15 application
-114	GPG_ERR_NOT_CONFIRMED		Not confirmed
-115	GPG_ERR_CONFIGURATION		Configuration error
-116	GPG_ERR_NO_POLICY_MATCH		No policy match
-117	GPG_ERR_INV_INDEX		Invalid index
-118	GPG_ERR_INV_ID			Invalid ID
-119	GPG_ERR_NO_SCDAEMON		No SmartCard daemon
-120	GPG_ERR_SCDAEMON		SmartCard daemon error
-
-GPG_ERR_UNSUPPORTED_PROTOCOL	Unsupported protocol
+GPG_ERR_WRONG_CARD              Wrong card
+
+GPG_ERR_NO_DIRMNGR              No dirmngr
+
+GPG_ERR_DIRMNGR                         dirmngr error
+
+GPG_ERR_CERT_REVOKED            Certificate revoked
+
+GPG_ERR_NO_CRL_KNOWN            No CRL known
+
+GPG_ERR_CRL_TOO_OLD             CRL too old
+
+GPG_ERR_LINE_TOO_LONG           Line too long
+
+GPG_ERR_NOT_TRUSTED             Not trusted
+
+GPG_ERR_CANCELED                Operation cancelled
+
+GPG_ERR_BAD_CA_CERT             Bad CA certificate
+
+GPG_ERR_CERT_EXPIRED            Certificate expired
+
+GPG_ERR_CERT_TOO_YOUNG          Certificate too young
+
+GPG_ERR_UNSUPPORTED_CERT        Unsupported certificate
+
+GPG_ERR_UNKNOWN_SEXP            Unknown S-expression
+
+GPG_ERR_UNSUPPORTED_PROTECTION  Unsupported protection
+
+GPG_ERR_CORRUPTED_PROTECTION    Corrupted protection
+
+GPG_ERR_AMBIGUOUS_NAME          Ambiguous name
+
+GPG_ERR_CARD                    Card error
+
+GPG_ERR_CARD_RESET              Card reset required
+
+GPG_ERR_CARD_REMOVED            Card removed
+
+GPG_ERR_INV_CARD                Invalid card
+
+GPG_ERR_CARD_NOT_PRESENT        Card not present
+
+GPG_ERR_NO_PKCS15_APP           No PKCS15 application
+
+GPG_ERR_NOT_CONFIRMED           Not confirmed
+
+GPG_ERR_CONFIGURATION           Configuration error
+
+GPG_ERR_NO_POLICY_MATCH                 No policy match
+
+GPG_ERR_INV_INDEX               Invalid index
+
+GPG_ERR_INV_ID                  Invalid ID
+
+GPG_ERR_NO_SCDAEMON             No SmartCard daemon
+
+GPG_ERR_SCDAEMON                SmartCard daemon error
+
+GPG_ERR_UNSUPPORTED_PROTOCOL    Unsupported protocol
 
     GPG:        - An unsupported keyserver protocol.
     GPG_AGENT:  - Invalid shadow_info protocol (not "t1-v1")
@@ -364,46 +456,55 @@ GPG_ERR_UNSUPPORTED_PROTOCOL	Unsupported protocol
     GPGME:      - GPGME_PROTOCOL_xxx not supported.
     NTBTLS:     - Handshake protocol version not supported.
 
-122	GPG_ERR_BAD_PIN_METHOD		Bad PIN method
+GPG_ERR_BAD_PIN_METHOD          Bad PIN method
 
-GPG_ERR_CARD_NOT_INITIALIZED	Card not initialized
+GPG_ERR_CARD_NOT_INITIALIZED    Card not initialized
 
     SCDAEMON: - A card function is called but the card has not yet
                 been initialized.  This may be due to a conflict with
                 another card using connection or due to a bug.
 
-124	GPG_ERR_UNSUPPORTED_OPERATION	Unsupported operation
-125	GPG_ERR_WRONG_KEY_USAGE		Wrong key usage
+GPG_ERR_UNSUPPORTED_OPERATION   Unsupported operation
+
+GPG_ERR_WRONG_KEY_USAGE                 Wrong key usage
 
     GNUPG: - Key usage not possible with selected algorithm.
 
-GPG_ERR_NOTHING_FOUND		Nothing found
+GPG_ERR_NOTHING_FOUND           Nothing found
 
   Indicates that the operation was not possible because nothing has
   been found.  For example an update request for non existent data.
 
+GPG_ERR_WRONG_BLOB_TYPE                 Wrong blob type
 
-127	GPG_ERR_WRONG_BLOB_TYPE		Wrong blob type
-
-GPG_ERR_MISSING_VALUE		Missing value
+GPG_ERR_MISSING_VALUE           Missing value
 
     GNUPG: - Not enough parameters for a secret key send to gpg-agent.
 
     GCRYPT: - A required parameter has not been given.
 
 
-129	GPG_ERR_HARDWARE		Hardware problem
-130	GPG_ERR_PIN_BLOCKED		PIN blocked
-131	GPG_ERR_USE_CONDITIONS		Conditions of use not satisfied
-132	GPG_ERR_PIN_NOT_SYNCED		PINs are not synced
-133	GPG_ERR_INV_CRL			Invalid CRL
-134	GPG_ERR_BAD_BER			BER error
-135	GPG_ERR_INV_BER			Invalid BER
-136	GPG_ERR_ELEMENT_NOT_FOUND	Element not found
-137	GPG_ERR_IDENTIFIER_NOT_FOUND	Identifier not found
-138	GPG_ERR_INV_TAG			Invalid tag
+GPG_ERR_HARDWARE                Hardware problem
+
+GPG_ERR_PIN_BLOCKED             PIN blocked
+
+GPG_ERR_USE_CONDITIONS          Conditions of use not satisfied
+
+GPG_ERR_PIN_NOT_SYNCED          PINs are not synced
+
+GPG_ERR_INV_CRL                         Invalid CRL
+
+GPG_ERR_BAD_BER                         BER error
 
-GPG_ERR_INV_LENGTH		Invalid length
+GPG_ERR_INV_BER                         Invalid BER
+
+GPG_ERR_ELEMENT_NOT_FOUND       Element not found
+
+GPG_ERR_IDENTIFIER_NOT_FOUND    Identifier not found
+
+GPG_ERR_INV_TAG                         Invalid tag
+
+GPG_ERR_INV_LENGTH              Invalid length
 
     GCRYPT: - Bad block length for certain cipher algorithms and
               modes.
@@ -417,41 +518,46 @@ GPG_ERR_INV_LENGTH		Invalid length
     GNUPG:  - Invalid hash length for a pubkey
     [more to come]
 
-GPG_ERR_INV_KEYINFO		Invalid key info
+GPG_ERR_INV_KEYINFO             Invalid key info
 
     KSBA: - Returned if the ASN.1 Keyinfo structure is not valid
 
-141	GPG_ERR_UNEXPECTED_TAG		Unexpected tag
-142	GPG_ERR_NOT_DER_ENCODED		Not DER encoded
-143	GPG_ERR_NO_CMS_OBJ		No CMS object
-144	GPG_ERR_INV_CMS_OBJ		Invalid CMS object
-145	GPG_ERR_UNKNOWN_CMS_OBJ		Unknown CMS object
-146	GPG_ERR_UNSUPPORTED_CMS_OBJ	Unsupported CMS object
+GPG_ERR_UNEXPECTED_TAG          Unexpected tag
+
+GPG_ERR_NOT_DER_ENCODED                 Not DER encoded
+
+GPG_ERR_NO_CMS_OBJ              No CMS object
+
+GPG_ERR_INV_CMS_OBJ             Invalid CMS object
+
+GPG_ERR_UNKNOWN_CMS_OBJ                 Unknown CMS object
+
+GPG_ERR_UNSUPPORTED_CMS_OBJ     Unsupported CMS object
 
-GPG_ERR_UNSUPPORTED_ENCODING	Unsupported encoding
+GPG_ERR_UNSUPPORTED_ENCODING    Unsupported encoding
 
     GNUPG: - Returned by Dirmngr if a keyserver returns a HTML document.
 
 
-148	GPG_ERR_UNSUPPORTED_CMS_VERSION	Unsupported CMS version
+GPG_ERR_UNSUPPORTED_CMS_VERSION         Unsupported CMS version
 
 
-149	GPG_ERR_UNKNOWN_ALGORITHM	Unknown algorithm
+GPG_ERR_UNKNOWN_ALGORITHM       Unknown algorithm
 
     GCRYPT:  gcry_kdf_proc for an unknown kdf algorithm
 
-150	GPG_ERR_INV_ENGINE		Invalid crypto engine
+GPG_ERR_INV_ENGINE              Invalid crypto engine
 
     GPGME: Several uses use cases.  For example:
            - Unexpected format of a status line.
 
-151	GPG_ERR_PUBKEY_NOT_TRUSTED	Public key not trusted
-152	GPG_ERR_DECRYPT_FAILED		Decryption failed
-153	GPG_ERR_KEY_EXPIRED		Key expired
-154	GPG_ERR_SIG_EXPIRED		Signature expired
-155	GPG_ERR_ENCODING_PROBLEM	Encoding problem
+GPG_ERR_PUBKEY_NOT_TRUSTED      Public key not trusted
+GPG_ERR_DECRYPT_FAILED          Decryption failed
+GPG_ERR_KEY_EXPIRED             Key expired
+GPG_ERR_SIG_EXPIRED             Signature expired
+GPG_ERR_ENCODING_PROBLEM        Encoding problem
 
-GPG_ERR_INV_STATE		Invalid state
+GPG_ERR_INV_STATE               Invalid state
 
     The state (of a protocol) is not possible or not defined at all.
 
@@ -459,9 +565,9 @@ GPG_ERR_INV_STATE		Invalid state
 
 
 
-157	GPG_ERR_DUP_VALUE		Duplicated value
+GPG_ERR_DUP_VALUE               Duplicated value
 
-GPG_ERR_MISSING_ACTION		Missing action
+GPG_ERR_MISSING_ACTION          Missing action
 
     GNUPG: - In G13 the server command "MOUNT" is used without prior
              use of the command "OPEN".
@@ -470,21 +576,25 @@ GPG_ERR_MISSING_ACTION		Missing action
               indicate that the client did not conncted to the server
               as requested.
 
-159	GPG_ERR_MODULE_NOT_FOUND	ASN.1 module not found
-160	GPG_ERR_INV_OID_STRING		Invalid OID string
-161	GPG_ERR_INV_TIME		Invalid time
-162	GPG_ERR_INV_CRL_OBJ		Invalid CRL object
-163	GPG_ERR_UNSUPPORTED_CRL_VERSION	Unsupported CRL version
+GPG_ERR_MODULE_NOT_FOUND        ASN.1 module not found
 
+GPG_ERR_INV_OID_STRING          Invalid OID string
 
-GPG_ERR_INV_CERT_OBJ		Invalid certificate object
+GPG_ERR_INV_TIME                Invalid time
+
+GPG_ERR_INV_CRL_OBJ             Invalid CRL object
+
+GPG_ERR_UNSUPPORTED_CRL_VERSION         Unsupported CRL version
+
+
+GPG_ERR_INV_CERT_OBJ            Invalid certificate object
 
     GPGME: - A bad certificate (gpgme_key_t) has been passed to a
              function.  For example it might be incomplete due to a
              missing fingerprint.
 
 
-165	GPG_ERR_UNKNOWN_NAME		Unknown name
+GPG_ERR_UNKNOWN_NAME            Unknown name
 
         Used by GPG to indicate an unknown ECC curve name (may also
         indicate missing ECC support).  It is also used to indicate an
@@ -492,39 +602,49 @@ GPG_ERR_INV_CERT_OBJ		Invalid certificate object
         value to update state.  Note that GPG_ERR_UNKNOWN_CURVE is
         used instead by newer code.
 
-166	GPG_ERR_LOCALE_PROBLEM		A locale function failed
-167	GPG_ERR_NOT_LOCKED		Not locked
+GPG_ERR_LOCALE_PROBLEM          A locale function failed
+
+GPG_ERR_NOT_LOCKED              Not locked
 
-GPG_ERR_PROTOCOL_VIOLATION	Protocol violation
+GPG_ERR_PROTOCOL_VIOLATION      Protocol violation
 
     GNUPG: - Used for invalid HTTP responses.
 
 
-GPG_ERR_INV_MAC			Invalid MAC
+GPG_ERR_INV_MAC                         Invalid MAC
 
         The length, algo, or other properties of a MAC are not met.
         See also GPG_ERR_BAD_MAC.
 
 
-170	GPG_ERR_INV_REQUEST		Invalid request
-171	GPG_ERR_UNKNOWN_EXTN		Unknown extension
-172	GPG_ERR_UNKNOWN_CRIT_EXTN	Unknown critical extension
-173	GPG_ERR_LOCKED			Locked
-174	GPG_ERR_UNKNOWN_OPTION		Unknown option
-175	GPG_ERR_UNKNOWN_COMMAND		Unknown command
-176	GPG_ERR_NOT_OPERATIONAL		Not operational
-177	GPG_ERR_NO_PASSPHRASE		No passphrase given
-178	GPG_ERR_NO_PIN			No PIN given
+GPG_ERR_INV_REQUEST             Invalid request
+
+GPG_ERR_UNKNOWN_EXTN            Unknown extension
+
+GPG_ERR_UNKNOWN_CRIT_EXTN       Unknown critical extension
+
+GPG_ERR_LOCKED                  Locked
+
+GPG_ERR_UNKNOWN_OPTION          Unknown option
 
-GPG_ERR_NOT_ENABLED		Not enabled
+GPG_ERR_UNKNOWN_COMMAND         Unknown command
+
+GPG_ERR_NOT_OPERATIONAL         Not operational
+
+GPG_ERR_NO_PASSPHRASE           No passphrase given
+
+GPG_ERR_NO_PIN                  No PIN given
+
+GPG_ERR_NOT_ENABLED             Not enabled
 
         Similar to GPG_ERR_NOT_SUPPORTED.  In general this error is
         used for disabled features which can be expected to be enabled
         by the user.
 
 
-180	GPG_ERR_NO_ENGINE		No crypto engine
-181	GPG_ERR_MISSING_KEY		Missing key
+GPG_ERR_NO_ENGINE               No crypto engine
+
+GPG_ERR_MISSING_KEY             Missing key
 
 GPG_ERR_TOO_MANY                Too many objects
 
@@ -540,27 +660,27 @@ GPG_ERR_LIMIT_REACHED           Limit reached
         GnuPG: gpgtar: Extract directory can't be created because too
         many of directories with a similar name are already existing.
 
-GPG_ERR_NOT_INITIALIZED		Not initialized
+GPG_ERR_NOT_INITIALIZED                 Not initialized
 
     An operation can't be performed because something has not been
     initialized.  This might be a missing initialization of an entire
     subsystems or a prerequisite for using a function is not
     fulfilled.
 
-185	GPG_ERR_MISSING_ISSUER_CERT	Missing issuer certificate
+GPG_ERR_MISSING_ISSUER_CERT     Missing issuer certificate
 
-GPG_ERR_NO_KEYSERVER		No keyserver available
+GPG_ERR_NO_KEYSERVER            No keyserver available
 
         No keyserver configured or no keyserver available due to
         missing support for the requested protocol.  Found in Dirmngr.
 
-GPG_ERR_INV_CURVE		Invalid elliptic curve
+GPG_ERR_INV_CURVE               Invalid elliptic curve
 
         The curve parameter is missing or the curve is invalid; for
         example it is not possible to get affine coordinates for the
         public key.
 
-GPG_ERR_UNKNOWN_CURVE		Unknown elliptic curve
+GPG_ERR_UNKNOWN_CURVE           Unknown elliptic curve
 
         The curve is not known or not supported by the protocol.
 
@@ -571,17 +691,17 @@ GPG_ERR_DUP_KEY                 Duplicated key
         database occurred more than once.  Also used if in a protocol
         an expected key was returned more than once.
 
-GPG_ERR_AMBIGUOUS		Ambiguous search
+GPG_ERR_AMBIGUOUS               Ambiguous search
 
         A search etc returned an ambigious result.  This usually means
         that the search string was not specific enough.
 
-GPG_ERR_NO_CRYPT_CTX		No crypto context
+GPG_ERR_NO_CRYPT_CTX            No crypto context
 
         A crypto context was expected but not given.  Commonly used by
         Libgcrypt.
 
-GPG_ERR_WRONG_CRYPT_CTX		Wrong crypto context
+GPG_ERR_WRONG_CRYPT_CTX                 Wrong crypto context
 
         The given crypto context does not match the requirements.  For
         example in Libgcrypt a crypto context has private data
@@ -589,18 +709,18 @@ GPG_ERR_WRONG_CRYPT_CTX		Wrong crypto context
         returned if a crypto context initialized for a different
         algorithm is used.
 
-GPG_ERR_BAD_CRYPT_CTX		Bad crypto context
+GPG_ERR_BAD_CRYPT_CTX           Bad crypto context
 
         The is a problem with the crypto context.  For example it has
         not been properly initialized.
 
-GPG_ERR_CRYPT_CTX_CONFLICT	Conflict in the crypto context
+GPG_ERR_CRYPT_CTX_CONFLICT      Conflict in the crypto context
 
         Conflicting use of a crypto context.  For example if a context
         is used with objects that don't match the state of the
         context.
 
-GPG_ERR_BROKEN_PUBKEY		Broken public key
+GPG_ERR_BROKEN_PUBKEY           Broken public key
 
         The public key was mathematically not correctly generated.
         (It would have been nicer if we would have used BAD_PUBKEY for
@@ -608,7 +728,7 @@ GPG_ERR_BROKEN_PUBKEY		Broken public key
         example policy and encoding problems with a key.  Using
         INV_PUBKEY would have been better for these purposes)
 
-GPG_ERR_BROKEN_SECKEY		Broken secret key
+GPG_ERR_BROKEN_SECKEY           Broken secret key
 
         The secret key was mathematically not correctly generated.
 
@@ -617,40 +737,53 @@ GPG_ERR_MAC_ALGO
     GCRYPT: - MAC key algorithm is not defined or not available.
 
 
-198     GPG_ERR_FULLY_CANCELED          Operation fully cancelled
-199	GPG_ERR_UNFINISHED		Operation not yet finished
-200	GPG_ERR_BUFFER_TOO_SHORT	Buffer too short
+GPG_ERR_FULLY_CANCELED        Operation fully cancelled
+
+GPG_ERR_UNFINISHED            Operation not yet finished
+
+GPG_ERR_BUFFER_TOO_SHORT      Buffer too short
+
+GPG_ERR_SEXP_INV_LEN_SPEC     Invalid length specifier in S-expression
+
+GPG_ERR_SEXP_STRING_TOO_LONG  String too long in S-expression
 
-201	GPG_ERR_SEXP_INV_LEN_SPEC	Invalid length specifier in S-expression
-202	GPG_ERR_SEXP_STRING_TOO_LONG	String too long in S-expression
-203	GPG_ERR_SEXP_UNMATCHED_PAREN	Unmatched parentheses in S-expression
-204	GPG_ERR_SEXP_NOT_CANONICAL	S-expression not canonical
-205	GPG_ERR_SEXP_BAD_CHARACTER	Bad character in S-expression
-206	GPG_ERR_SEXP_BAD_QUOTATION	Bad quotation in S-expression
-207	GPG_ERR_SEXP_ZERO_PREFIX	Zero prefix in S-expression
-208	GPG_ERR_SEXP_NESTED_DH		Nested display hints in S-expression
-209	GPG_ERR_SEXP_UNMATCHED_DH	Unmatched display hints
-210	GPG_ERR_SEXP_UNEXPECTED_PUNC	Unexpected reserved punctuation in S-expression
-211	GPG_ERR_SEXP_BAD_HEX_CHAR	Bad hexadecimal character in S-expression
-212	GPG_ERR_SEXP_ODD_HEX_NUMBERS	Odd hexadecimal numbers in S-expression
-213	GPG_ERR_SEXP_BAD_OCT_CHAR	Bad octal character in S-expression
+GPG_ERR_SEXP_UNMATCHED_PAREN  Unmatched parentheses in S-expression
 
+GPG_ERR_SEXP_NOT_CANONICAL    S-expression not canonical
 
-GPG_ERR_SUBKEYS_EXP_REV (217)           All subkeys are expired or revoked
+GPG_ERR_SEXP_BAD_CHARACTER    Bad character in S-expression
 
-GPG_ERR_DB_CORRUPTED (218)		Database is corrupted
+GPG_ERR_SEXP_BAD_QUOTATION    Bad quotation in S-expression
 
-GPG_ERR_SERVER_FAILED (219)		Server indicated a failure
+GPG_ERR_SEXP_ZERO_PREFIX      Zero prefix in S-expression
 
-GPG_ERR_NO_NAME	(220)		No name
+GPG_ERR_SEXP_NESTED_DH        Nested display hints in S-expression
+
+GPG_ERR_SEXP_UNMATCHED_DH     Unmatched display hints
+
+GPG_ERR_SEXP_UNEXPECTED_PUNC  Unexpected reserved punctuation in S-expression
+
+GPG_ERR_SEXP_BAD_HEX_CHAR     Bad hexadecimal character in S-expression
+
+GPG_ERR_SEXP_ODD_HEX_NUMBERS  Odd hexadecimal numbers in S-expression
+
+GPG_ERR_SEXP_BAD_OCT_CHAR     Bad octal character in S-expression
+
+GPG_ERR_SUBKEYS_EXP_REV           All subkeys are expired or revoked
+
+GPG_ERR_DB_CORRUPTED            Database is corrupted
+
+GPG_ERR_SERVER_FAILED           Server indicated a failure
+
+GPG_ERR_NO_NAME                         No name
 
     EAI_NONAME may be mapped to this code.
 
-GPG_ERR_NO_KEY (221)		No key
+GPG_ERR_NO_KEY          No key
 
     Some kind of key was not found.
 
-GPG_ERR_LEGACY_KEY (222)        Legacy key
+GPG_ERR_LEGACY_KEY        Legacy key
 
     Used by GnuPG to identify version 2 and 3 OpenPGP key packets.
 
@@ -664,16 +797,16 @@ GPG_ERR_REQUEST_TOO_LONG        Request too long
     be due to an internal limitation, a protocol violation, or due to
     the use of a newer version of a protocol.
 
-GPG_ERR_OBJ_TERM_STATE		Object is in termination state
+GPG_ERR_OBJ_TERM_STATE          Object is in termination state
 
     For cards this is the ISO status word 0x6285 (file is in
     termnation state).
 
-GPG_ERR_NO_CERT_CHAIN		No certificate chain
+GPG_ERR_NO_CERT_CHAIN           No certificate chain
 
     NTBTLS: - A CA chain has not been set but is required.
 
-GPG_ERR_CERT_TOO_LARGE		Certificate is too large
+GPG_ERR_CERT_TOO_LARGE          Certificate is too large
 
     NTBTLS: - A certificate is too large to be used by the protocol.
 
@@ -681,7 +814,7 @@ GPG_ERR_INV_RECORD              Invalid record
 
     NTBTLS: - An invalid record was received
 
-GPG_ERR_BAD_MAC			The MAC does not verify
+GPG_ERR_BAD_MAC                         The MAC does not verify
 
     NTBTLS: - MAC verification of the message failed.
 
@@ -776,7 +909,7 @@ GPG_ERR_BOGUS_STRING            Bogus string
     possible dangerous characters (e.g. control characters in a domain
     name).
 
-GPG_ERR_FORBIDDEN		Forbidden
+GPG_ERR_FORBIDDEN               Forbidden
 
     The use of a features is not allowed due to insufficient rights.
     Use by gpg-agent as an error codes for restricted commands.
@@ -785,104 +918,130 @@ GPG_ERR_KEY_DISABLED            Key disabled
 
     GNUPG: - The key has been disabled by the user.
 
-GPG_ERR_KEY_ON_CARD		Not possible with a card based key
+GPG_ERR_KEY_ON_CARD             Not possible with a card based key
 
     GNUPG: - The gpg-agent returns this if a DELETE_KEY commands is
              used for a smartcard based key.
 
-GPG_ERR_INV_LOCK_OBJ		Invalid lock object
+GPG_ERR_INV_LOCK_OBJ            Invalid lock object
 
     GPGRT: - The provided lock object is not valid.  This indicates an
              internal problem in libgpg-error or more likely a
              programming error.
 
-GPG_ERR_TRUE			True
+GPG_ERR_TRUE                    True
 
     Used to return the boolean value True.  Note that GPG_ERR_NO_ERROR
     (with the value 0) is also often used to indicate the value true.
 
-GPG_ERR_FALSE			False
+GPG_ERR_FALSE                   False
 
     Used to return the boolean value False.
 
 
-GPG_ERR_ASS_GENERAL (257)            General IPC error
-GPG_ERR_ASS_ACCEPT_FAILED (258)      IPC accept call failed
-GPG_ERR_ASS_CONNECT_FAILED (259)     IPC connect call failed
-GPG_ERR_ASS_INV_RESPONSE (260)       Invalid IPC response
-GPG_ERR_ASS_INV_VALUE (261)          Invalid value passed to IPC
-GPG_ERR_ASS_INCOMPLETE_LINE (262)    Incomplete line passed to IPC
-GPG_ERR_ASS_LINE_TOO_LONG (263)      Line passed to IPC too long
-GPG_ERR_ASS_NESTED_COMMANDS (264)    Nested IPC commands
-GPG_ERR_ASS_NO_DATA_CB (265)         No data callback in IPC
-GPG_ERR_ASS_NO_INQUIRE_CB (266)      No inquire callback in IPC
-GPG_ERR_ASS_NOT_A_SERVER (267)       Not an IPC server
-GPG_ERR_ASS_NOT_A_CLIENT (268)       Not an IPC client
-GPG_ERR_ASS_SERVER_START (269)       Problem starting IPC server
-GPG_ERR_ASS_READ_ERROR (270)         IPC read error
-GPG_ERR_ASS_WRITE_ERROR	(271)        IPC write error
-GPG_ERR_ASS_TOO_MUCH_DATA  (273)     Too much data for IPC layer
-GPG_ERR_ASS_UNEXPECTED_CMD (274)     Unexpected IPC command
-GPG_ERR_ASS_UNKNOWN_CMD	(275)        Unknown IPC command
-GPG_ERR_ASS_SYNTAX (276)             IPC syntax error
-GPG_ERR_ASS_CANCELED (277)           IPC call has been cancelled
-GPG_ERR_ASS_NO_INPUT (278)           No input source for IPC
-GPG_ERR_ASS_NO_OUTPUT (279)          No output source for IPC
-GPG_ERR_ASS_PARAMETER (280)          IPC parameter error
-GPG_ERR_ASS_UNKNOWN_INQUIRE (281)    Unknown IPC inquire
-
-
-GPG_ERR_ENGINE_TOO_OLD (300)	Crypto engine too old
-
-GPG_ERR_WINDOW_TOO_SMALL(301)	Screen or window too small
+GPG_ERR_ASS_GENERAL            General IPC error
+
+GPG_ERR_ASS_ACCEPT_FAILED      IPC accept call failed
+
+GPG_ERR_ASS_CONNECT_FAILED     IPC connect call failed
+
+GPG_ERR_ASS_INV_RESPONSE       Invalid IPC response
+
+GPG_ERR_ASS_INV_VALUE          Invalid value passed to IPC
+
+GPG_ERR_ASS_INCOMPLETE_LINE    Incomplete line passed to IPC
+
+GPG_ERR_ASS_LINE_TOO_LONG      Line passed to IPC too long
+
+GPG_ERR_ASS_NESTED_COMMANDS    Nested IPC commands
+
+GPG_ERR_ASS_NO_DATA_CB         No data callback in IPC
+
+GPG_ERR_ASS_NO_INQUIRE_CB      No inquire callback in IPC
+
+GPG_ERR_ASS_NOT_A_SERVER       Not an IPC server
+
+GPG_ERR_ASS_NOT_A_CLIENT       Not an IPC client
+
+GPG_ERR_ASS_SERVER_START       Problem starting IPC server
+
+GPG_ERR_ASS_READ_ERROR         IPC read error
+
+GPG_ERR_ASS_WRITE_ERROR         IPC write error
+
+GPG_ERR_ASS_TOO_MUCH_DATA      Too much data for IPC layer
+
+GPG_ERR_ASS_UNEXPECTED_CMD     Unexpected IPC command
+
+GPG_ERR_ASS_UNKNOWN_CMD         Unknown IPC command
+
+GPG_ERR_ASS_SYNTAX             IPC syntax error
+
+GPG_ERR_ASS_CANCELED           IPC call has been cancelled
+
+GPG_ERR_ASS_NO_INPUT           No input source for IPC
+
+GPG_ERR_ASS_NO_OUTPUT          No output source for IPC
+
+GPG_ERR_ASS_PARAMETER          IPC parameter error
+
+GPG_ERR_ASS_UNKNOWN_INQUIRE    Unknown IPC inquire
+
+GPG_ERR_ENGINE_TOO_OLD  Crypto engine too old
+
+GPG_ERR_WINDOW_TOO_SMALL        Screen or window too small
 
     Pinentry: - The size of the screen is too small.
 
-GPG_ERR_WINDOW_TOO_LARGE (302)	Screen or window too large
+GPG_ERR_WINDOW_TOO_LARGE        Screen or window too large
 
-GPG_ERR_MISSING_ENVVAR (303)	Required environment variable not set
+GPG_ERR_MISSING_ENVVAR  Required environment variable not set
 
     Pinentry: - The size of the screen can't be determined.
 
-GPG_ERR_USER_ID_EXISTS (304)	User ID already exists
+GPG_ERR_USER_ID_EXISTS  User ID already exists
 
     GNUPG: - Existing user ID in --quick-gen-key.
 
-GPG_ERR_NAME_EXISTS (305)	Name already exists
-GPG_ERR_DUP_NAME (306)		Duplicated name
+GPG_ERR_NAME_EXISTS     Name already exists
 
-GPG_ERR_TOO_YOUNG (307)		Objects is too young
+GPG_ERR_DUP_NAME                Duplicated name
+
+GPG_ERR_TOO_YOUNG               Objects is too young
 
     For example used if a file is younger than expected.
 
-GPG_ERR_TOO_OLD	(308		Objects is too old
+GPG_ERR_TOO_OLD                         Objects is too old
 
     Used if an object is too old to be used.  This is a more generic
     code than GPG_ERR_ENGINE_TOO_OLD or GPG_ERR_CRL_TOO_OLD.
 
-GPG_ERR_LDAP_GENERAL		LDAP General error
+GPG_ERR_LDAP_GENERAL            LDAP General error
 
    Catch all error for LDAP.  Use if if can't map an erro rocde to an
    gpg-error code.
 
-GPG_ERR_LDAP_ATTR_GENERAL	LDAP General attribute error
-GPG_ERR_LDAP_NAME_GENERAL	LDAP General name error
-GPG_ERR_LDAP_SECURITY_GENERAL	LDAP General security error
-GPG_ERR_LDAP_SERVICE_GENERAL	LDAP General service error
-GPG_ERR_LDAP_UPDATE_GENERAL	LDAP General update error
-GPG_ERR_LDAP_E_GENERAL		LDAP Experimental error code
-GPG_ERR_LDAP_X_GENERAL	        LDAP Private error code
-GPG_ERR_LDAP_OTHER_GENERAL	LDAP Other general error
-
-  All above may be used to map ranges of LDAP errors to one specific
-  code. OpenLDAP uses LDAP_xxx_RANGE(n) macros for tha mapping.
-  "Other general error" may be used similar to "General error" for
-  mapping of ranges.  Here are macros from OpenLDAP for reference
-
-  #define LDAP_ATTR_ERROR(n)	 LDAP_RANGE((n),0x10,0x15) /* 16-21 */
-  #define LDAP_NAME_ERROR(n)	 LDAP_RANGE((n),0x20,0x24) /* 32-34,36 */
+GPG_ERR_LDAP_ATTR_GENERAL       LDAP General attribute error
+GPG_ERR_LDAP_NAME_GENERAL       LDAP General name error
+GPG_ERR_LDAP_SECURITY_GENERAL   LDAP General security error
+GPG_ERR_LDAP_SERVICE_GENERAL    LDAP General service error
+GPG_ERR_LDAP_UPDATE_GENERAL     LDAP General update error
+GPG_ERR_LDAP_E_GENERAL          LDAP Experimental error code
+GPG_ERR_LDAP_X_GENERAL          LDAP Private error code
+GPG_ERR_LDAP_OTHER_GENERAL      LDAP Other general error
+
+  The 8 GPG_ERR_LDAP_*_GENERAL error codes may be used to map ranges
+  of LDAP errors to one specific code. OpenLDAP uses LDAP_xxx_RANGE(n)
+  macros for that mapping.  "Other general error" may be used similar
+  to "General error" for mapping of ranges.  Here are macros from
+  OpenLDAP for reference:
+
+  #define LDAP_ATTR_ERROR(n)     LDAP_RANGE((n),0x10,0x15) /* 16-21 */
+  #define LDAP_NAME_ERROR(n)     LDAP_RANGE((n),0x20,0x24) /* 32-34,36 */
   #define LDAP_SECURITY_ERROR(n) LDAP_RANGE((n),0x2F,0x32) /* 47-50 */
-  #define LDAP_SERVICE_ERROR(n)	 LDAP_RANGE((n),0x33,0x36) /* 51-54 */
-  #define LDAP_UPDATE_ERROR(n)	 LDAP_RANGE((n),0x40,0x47) /* 64-69,71 */
-  #define LDAP_E_ERROR(n)	 LDAP_RANGE((n),0x1000,0x3FFF)
-  #define LDAP_X_ERROR(n)	 LDAP_RANGE((n),0x4000,0xFFFF)
+  #define LDAP_SERVICE_ERROR(n)  LDAP_RANGE((n),0x33,0x36) /* 51-54 */
+  #define LDAP_UPDATE_ERROR(n)   LDAP_RANGE((n),0x40,0x47) /* 64-69,71 */
+  #define LDAP_E_ERROR(n)        LDAP_RANGE((n),0x1000,0x3FFF)
+  #define LDAP_X_ERROR(n)        LDAP_RANGE((n),0x4000,0xFFFF)
+
+## end of errorref.txt
diff --git a/src/Makefile.am b/src/Makefile.am
index e5e907d..1eb8287 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -192,8 +192,9 @@ libgpg_error_la_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" $(extra_cppflags)
 libgpg_error_la_LIBADD = $(gpg_error_res) $(intllibs) $(LIBTHREAD)
 
 gpg_error_SOURCES = strsource-sym.c strerror-sym.c gpg-error.c
-gpg_error_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" $(extra_cppflags)
-gpg_error_LDADD = ./libgpg-error.la @LTLIBINTL@
+gpg_error_CPPFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" \
+                     -DLOCALEDIR=\"$(localedir)\" $(extra_cppflags)
+gpg_error_LDADD = ./libgpg-error.la $(LTLIBINTL)
 
 # We build err-sources.h and err-codes.h in the source directory.
 # This is needed because gettext does only look into the source
diff --git a/src/gpg-error.c b/src/gpg-error.c
index 117b367..4a09e1d 100644
--- a/src/gpg-error.c
+++ b/src/gpg-error.c
@@ -1,5 +1,5 @@
 /* gpg-error.c - Determining gpg-error error codes.
-   Copyright (C) 2004 g10 Code GmbH
+   Copyright (C) 2004, 2016 g10 Code GmbH
 
    This file is part of libgpg-error.
 
@@ -370,12 +370,107 @@ get_err_from_str (char *str, gpg_error_t *err)
 }
 
 
+static void
+print_desc (const char *symbol)
+{
+  static int initialized;
+  static FILE *fp;
+  char line[512];
+  char *p;
+  int indesc = 0;
+  int blanklines = 0;
+  int last_was_keyword = 0;
+
+  if (!initialized)
+    {
+      initialized = 1;
+      fp = fopen (PKGDATADIR "/errorref.txt", "r");
+    }
+  if (!fp)
+    return;
+  rewind (fp);
+  while (fgets (line, sizeof line, fp))
+    {
+      if (*line == '#')
+        continue;
+      if (*line && line[strlen(line)-1] == '\n')
+        line[strlen(line)-1] = 0;
+
+      if (!strncmp (line, "GPG_ERR_", 8))
+        {
+          if (indesc == 1 && last_was_keyword)
+            continue; /* Skip keywords immediately following a matched
+                       * keyword.  */
+          last_was_keyword = 1;
+
+          indesc = 0;
+          p = strchr (line, ' ');
+          if (!p)
+            continue;
+          *p = 0;
+          if (!strcmp (line, symbol))
+            {
+              indesc = 1;
+              continue; /* Skip this line.  */
+            }
+        }
+      else
+        last_was_keyword = 0;
+      if (!indesc)
+        continue;
+      if (indesc == 1 && !*line)
+        continue; /* Skip leading empty lines in a description.  */
+      if (indesc == 1)
+        putchar ('\n'); /* One leading empty line.  */
+      indesc = 2;
+      if (!*line)
+        {
+          blanklines++;
+          continue;
+        }
+      for (; blanklines; blanklines--)
+        putchar ('\n');
+      printf ("%s\n", line);
+    }
+  putchar ('\n'); /* One trailing blank line.  */
+}
+
+
+
 

+
+static int
+show_usage (const char *name)
+{
+  if (name)
+    {
+      fprintf (stderr, _("Usage: %s GPG-ERROR [...]\n"),
+               strrchr (name,'/')? (strrchr (name, '/')+1): name);
+      exit (1);
+    }
+
+  fputs ("gpg-error (" PACKAGE_NAME ") " PACKAGE_VERSION "\n", stdout);
+  fputs ("Options:\n"
+         "  --version      Print version\n"
+         "  --lib-version  Print library version\n"
+         "  --help         Print this help\n"
+         "  --list         Print all error codes\n"
+         "  --defines      Print all error codes as #define lines\n"
+         "  --desc         Print with error description\n"
+         , stdout);
+  exit (0);
+}
+
+
+
 int
 main (int argc, char *argv[])
 {
-  int i = 1;
+  const char *pgmname = argv[0];
+  int last_argc = -1;
+  int i;
   int listmode = 0;
+  int desc = 0;
   const char *source_sym;
   const char *error_sym;
   gpg_error_t err;
@@ -383,46 +478,60 @@ main (int argc, char *argv[])
   gpgrt_init ();
   i18n_init ();
 
-  if (argc == 1)
-    {
-      fprintf (stderr, _("Usage: %s GPG-ERROR [...]\n"),
-               strrchr (argv[0],'/')? (strrchr (argv[0], '/')+1): argv[0]);
-      exit (1);
-    }
-  else if (argc == 2 && !strcmp (argv[1], "--version"))
-    {
-      fputs ("gpg-error (" PACKAGE_NAME ") " PACKAGE_VERSION "\n", stdout);
-      exit (0);
-    }
-  else if (argc == 2 && !strcmp (argv[1], "--help"))
-    {
-      fputs ("gpg-error (" PACKAGE_NAME ") " PACKAGE_VERSION "\n", stdout);
-      fputs ("Options:\n"
-             "  --version      Print version\n"
-             "  --lib-version  Print library version\n"
-             "  --help         Print this help\n"
-             "  --list         Print all error codes\n"
-             "  --defines      Print all error codes as #define lines\n"
-             , stdout);
-      exit (0);
-    }
-  else if (argc == 2 && !strcmp (argv[1], "--lib-version"))
-    {
-      printf ("Version from header: %s (0x%06x)\n",
-              GPG_ERROR_VERSION, GPG_ERROR_VERSION_NUMBER);
-      printf ("Version from binary: %s\n", gpg_error_check_version (NULL));
-      printf ("Copyright blurb ...:%s\n", gpg_error_check_version ("\x01\x01"));
-      exit (0);
-    }
-  else if (argc == 2 && !strcmp (argv[1], "--list"))
+
+  if (argc)
     {
-      listmode = 1;
+      argc--; argv++;
     }
-  else if (argc == 2 && !strcmp (argv[1], "--defines"))
+  while (argc && last_argc != argc )
     {
-      listmode = 2;
+      last_argc = argc;
+      if (!strcmp (*argv, "--"))
+        {
+          argc--; argv++;
+          break;
+        }
+      else if (!strcmp (*argv, "--version"))
+        {
+          fputs ("gpg-error (" PACKAGE_NAME ") " PACKAGE_VERSION "\n", stdout);
+          exit (0);
+        }
+      else if (!strcmp (*argv, "--help"))
+        {
+          show_usage (NULL);
+        }
+      else if (!strcmp (*argv, "--lib-version"))
+        {
+          argc--; argv++;
+          printf ("Version from header: %s (0x%06x)\n",
+                  GPG_ERROR_VERSION, GPG_ERROR_VERSION_NUMBER);
+          printf ("Version from binary: %s\n", gpg_error_check_version (NULL));
+          printf ("Copyright blurb ...:%s\n",
+                  gpg_error_check_version ("\x01\x01"));
+          exit (0);
+        }
+      else if (!strcmp (*argv, "--list"))
+        {
+          listmode = 1;
+          argc--; argv++;
+        }
+      else if (!strcmp (*argv, "--defines"))
+        {
+          listmode = 2;
+          argc--; argv++;
+        }
+      else if (!strcmp (*argv, "--desc"))
+        {
+          desc = 1;
+          argc--; argv++;
+        }
+      else if (!strncmp (*argv, "--", 2))
+        show_usage (pgmname);
     }
 
+  if ((argc && listmode) || (!argc && !listmode))
+    show_usage (pgmname);
+
 
   if (listmode == 1)
     {
@@ -434,18 +543,26 @@ main (int argc, char *argv[])
           err -= 1;
 	  source_sym = gpg_strsource_sym (err);
           if (source_sym)
-            printf ("%u = (%u, -) = (%s, -) = (%s, -)\n",
-                    err, gpg_err_source (err),
-                    source_sym, gpg_strsource (err));
+            {
+              printf ("%u = (%u, -) = (%s, -) = (%s, -)\n",
+                      err, gpg_err_source (err),
+                      source_sym, gpg_strsource (err));
+              if (desc)
+                print_desc (source_sym);
+            }
         }
       for (i=0; i <  GPG_ERR_CODE_DIM; i++)
         {
           err = gpg_err_make (GPG_ERR_SOURCE_UNKNOWN, i);
 	  error_sym = gpg_strerror_sym (err);
           if (error_sym)
-            printf ("%u = (-, %u) = (-, %s) = (-, %s)\n",
-                    err, gpg_err_code (err),
-                    error_sym, gpg_strerror (err));
+            {
+              printf ("%u = (-, %u) = (-, %s) = (-, %s)\n",
+                      err, gpg_err_code (err),
+                      error_sym, gpg_strerror (err));
+              if (desc)
+                print_desc (error_sym);
+            }
         }
     }
   else if (listmode == 2)
@@ -493,7 +610,7 @@ main (int argc, char *argv[])
     }
   else /* Standard mode.  */
     {
-      while (i < argc)
+      for (i=0; i < argc; i++)
         {
           if (get_err_from_number (argv[i], &err)
               || get_err_from_symbol (argv[i], &err)
@@ -506,11 +623,12 @@ main (int argc, char *argv[])
                       err, gpg_err_source (err), gpg_err_code (err),
                       source_sym ? source_sym : "-", error_sym ? error_sym:"-",
                       gpg_strsource (err), gpg_strerror (err));
+              if (desc)
+                print_desc (error_sym);
             }
           else
             fprintf (stderr, _("%s: warning: could not recognize %s\n"),
                      argv[0], argv[i]);
-          i++;
         }
     }
 

-----------------------------------------------------------------------

Summary of changes:
 NEWS               |   6 +
 doc/Makefile.am    |  13 +-
 doc/errorref.txt   | 739 ++++++++++++++++++++++++++++++++---------------------
 src/Makefile.am    |   5 +-
 src/err-codes.h.in |   1 +
 src/gpg-error.c    | 208 +++++++++++----
 6 files changed, 638 insertions(+), 334 deletions(-)


hooks/post-receive
-- 
Error codes used by GnuPG et al.
http://git.gnupg.org




More information about the Gnupg-commits mailing list