diff --git a/NEWS b/NEWS
index a2b63f851..d2bb1c65e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5206 +1,5209 @@
 Noteworthy changes in version 2.4.1 (unreleased)
 ------------------------------------------------
 
+  * gpg: Make "--list-options show-sig-subpackets" work again.
+    Fixes regression in 2.4.0.
+
 
 Noteworthy changes in version 2.4.0 (2022-12-16)
 ------------------------------------------------
 
   * gpg: New command --quick-update-pref.  [rGd40d23b233]
 
   * gpg: New list-options show-pref and show-pref-verbose.
     [rG811cfa34cb]
 
   * gpg: New option --list-filter to restrict key listings like
       gpg -k --list-filter 'select=revoked-f && sub/algostr=ed25519'
     [rG1324dc3490]
 
   * gpg: New --export-filter export-revocs.  [rGc985b52e71]
 
   * gpg: Also import stray revocation certificates.  [rG7aaedfb107]
 
   * gpg: Add a notation to encryption subkeys in de-vs mode.  [T6279]
 
   * gpg: Improve signature verification speed by a factor of more than
     four.  Double detached signing speed.  [T5826]
 
   * gpg: Allow only OCB for AEAD encryption.  [rG5a2cef801d]
 
   * gpg: Fix trusted introducer for mbox only user-ids.  [T6238]
 
   * gpg: Report an error via status-fd for receiving a key from the
     agent.  [T5151]
 
   * gpg: Make --require-compliance work without the --status-fd
     option.  [rG2aacd843ad]
 
   * gpg: Fix verification of cleartext signatures with overlong lines.
     [T6272]
 
   * agent: Fix import of protected OpenPGP v5 keys.  [T6294]
 
   * gpgsm: Change the default cipher algorithm from AES128 to AES256.
     Also announce support for this in signatures.  [rG2d8ac55d26]
 
   * gpgsm: Always use the chain validation model if the root-CA
     requests this.  [rG7fa1d3cc82]
 
   * gpgsm: Print OCSP revocation date and reason in cert listings.
     [rGb6abaed2b5]
 
   * agent: Support Win32-OpenSSH emulation by gpg-agent.  [T3883]
 
   * scd: Support the Telesec Signature Card v2.0.  [T6252]
 
   * scd: Redact --debug cardio output of a VERIFY APDU.  [T5085]
 
   * scd: Skip deleted pkcs#15 records in CARDOS 5.  [rG061efac03f]
 
   * dirmngr: Fix build with no LDAP support.  [T6239]
 
   * dirmngr: Fix verification of ECDSA signed CRLs.  [rG868dabb402]
 
   * wkd: New option --add-revocs for gpg-wks-client.  [rGc3f9f2d497]
 
   * wkd: Ignore expired user-ids in gpg-wks-client.  [T6292]
 
   * card: New commands "gpg" and "gpgsm".  [rG9c4691c73e]
 
   See-also: gnupg-announce/2022q4/000477.html
   Release-info: https://dev.gnupg.org/T6303
 
 
 Noteworthy changes in version 2.3.8 (2022-10-13)
 ------------------------------------------------
 
   * gpg: Do not consider unknown public keys as non-compliant while
     decrypting.  [T6205]
 
   * gpg: Avoid to emit a compliance mode line if Libgcrypt is
     non-compliant.  [T6221]
 
   * gpg: Improve --edit-key setpref command to ease c+p.  [rG1908fa8b83]
 
   * gpg: Emit an ERROR status if --quick-set-primary-uid fails and
     allow to pass the user ID by hash.  [T6126]
 
   * gpg: Actually show symmetric+pubkey encrypted data as de-vs
     compliant.  Add extra compliance checks for symkey_enc packets.
     [T6119]
 
   * gpg: In de-vs mode use SHA-256 instead of SHA-1 as implicit
     preference.  [T6043]
 
   * gpgsm: Fix reporting of bad passphrase error during PKCS#11
     import.  [T5713,T6037]
 
   * agent: Fix a regression in "READKEY --format=ssh".  [T6012]
 
   * agent: New option --need-attr for KEYINFO.  [rG989eae648c]
 
   * agent: New attribute "Remote-list" for use by KEYINFO.
     [r1383aa4750]
 
   * scd: Fix problem with Yubikey 5.4 firmware.  [T6070]
 
   * dirmngr: Fix CRL Distribution Point fallback to other schemes.
     [rG0c8299e2b5]
 
   * dirmngr: New LDAP server flag "areconly" (A-record-only).
     [rGd65a0335e5]
 
   * dirmngr: Fix upload of multiple keys for an LDAP server specified
     using the colon format.  [rG536b5cd663]
 
   * dirmngr: Use LDAP schema v2 when a Base DN is specified.  [T6047]
 
   * dirmngr: Avoid caching expired certificates.  [T6142]
 
   * wkd: Fix path traversal attack in gpg-wks-server.  Add the mail
     address to the pending request data.  [rG8a63a8c825,T6098]
 
   * wkd: New command --mirror for gpg-wks-client.  [T6224]
 
   * gpg-auth: New tool for authentication.  [T5862]
 
   * New common.conf option no-autostart.  [rG203dcc19eb]
 
   * Silence warnings from AllowSetForegroundWindow unless
     GNUPG_EXEC_DEBUG_FLAGS is used.  [rG4ef8516a79]
 
   Release-info: https://dev.gnupg.org/T6106
   See-also: gnupg-announce/2022q4/000476.html
 
 
 Noteworthy changes in version 2.3.7 (2022-07-11)
 ------------------------------------------------
 
   * gpg: Fix possibly garbled status messages in NOTATION_DATA.  This
     bug could trick GPGME and other parsers to accept faked status
     lines.  [T6027, CVE-2022-34903]
 
   * gpg: Look up user ID to revoke by UID hash.  [T5936]
 
   * gpg: Setup the 'usage' filter property for export.  [rG7aabd94b81]
 
   * gpg,w32: Allow Unicode filenames for iobuf_cancel.  [rG4ee2009083]
 
   * gpg: Fix reading AEAD preference.  [T6019]
 
   * gpgsm: New option --compatibility-flags.  [rGf0b373cec9]
 
   * gpgsm: Rework the PKCS#12 parser to support DFN issued keys.
     [T6037]
 
   * agent: New option --no-user-trustlist and --sys-trustlist-name.
     [T5990]
 
   * agent: Pop up dialog window for confirmation, when specified so.
     [T5099]
 
   * agent: Show "Label:" field of private key when prompt the
     insertion.  [T5986]
 
   * agent: Handle USAGE information in KEYINFO.  [rG295a6a7591]
 
   * agent,ssh: Make not-inserted OpenPGP.3 keys available for SSH.
     [T5996]
 
   * agent,ssh: Support "Use-for-ssh" flag in private key.  [T5985]
 
   * agent: New field "Prompt" to prevent asking card key insertion.
     [T5987]
 
   * agent: Support --format=ssh option for READKEY.  [T6012]
 
   * agent: Add KEYATTR command.  [T5988]
 
   * agent: Flush before calling ftruncate.  [T6035]
 
   * agent: Do not consider --min-passphrase-len for the magic wand.
     [rGae2f1f0785]
 
   * kbx: Fix a race condition which results no status report.  [T5948]
 
   * scd:openpgp: Fix a segv for cards supporting unknown curves.
     [T5963]
 
   * scd:p15: Fix reading certificates without length info.
 
   * scd:p15: Improve the displayed S/N for Technology Nexus cards.
 
   * scd:openpgp: Add workaround for ECC attribute on Yubikey.  [T5963]
 
   * scd,piv: Fix status report of KEYPAIRINFO.  [rG64c8786105]
 
   * scd:nks: Support the Telesec ESIGN application.  [T5219, T4938]
 
   * scd: Fix use of SCardListReaders for PC/SC.  [T5979]
 
   * scd: Support automatic card selection for READCERT with keygrip.
     [T6003]
 
   * scd: Support specifying keygrip for learn command.  [T6002]
 
   * dirmngr: Fix for Windows when build against GNUTLS.  [T5899]
 
   * gpg-connect-agent: Add --unbuffered option.
 
   * gpg-connect-agent: Add a way to cancel an INQUIRE.  [T6010]
 
   * gpgconf: New short options -V and -X
 
   Release-info: https://dev.gnupg.org/T5947
   See-also: gnupg-announce/2022q3/000474.html
 
 
 Noteworthy changes in version 2.3.6 (2022-04-25)
 ------------------------------------------------
 
   * gpg: Fix regression in 2.3.5 importing longer keys.  [T5941]
 
   * gpg: Emit an ERROR status as hint for a bad passphrase.  [T5943]
 
   * gpg: Avoid NULL-ptr access due to corrupted packets.  [T5940]
 
   * gpgsm: Improve the "Certificate not found" error message.  [T5821]
 
   * agent: Pass pattern directly to gpg-check-pattern.  [rGe529c54fe3]
 
   * scd: Fix hard-coded constant for RSA authentication key OpenPGP.3.
     [rG2848fe4c84]
 
   Release-info: https://dev.gnupg.org/T5937
   See-also: gnupg-announce/2022q2/000473.html
 
 
 Noteworthy changes in version 2.3.5 (2022-04-21)
 ------------------------------------------------
 
   * gpg: Up to five times faster verification of detached signatures.
     Doubled detached signing speed.  [T5826,rG4e27b9defc,rGf8943ce098]
 
   * gpg: Threefold decryption speedup for large files.
     [T5820,rGab177eed51]
 
   * gpg: Nearly double the AES256.OCB encryption speed.  [rG99e2c178c7]
 
   * gpg: Removed EAX from the preference list.  [rG253fcb9777]
 
   * gpg: Allow --dearmor to decode all kinds of armor files.
     [rG34ea19aff9]
 
   * gpg: Remove restrictions for the name part of a user-id.
     [rG8945f1aedf]
 
   * gpg: Allow decryption of symmetric encrypted data even for
     non-compliant cipher.  [rG8631d4cfe2]
 
   * gpg,gpgsm: New option --require-compliance.  [rGee013c5350]
 
   * gpgsm: New option --ignore-cert-with-oid.  [rGe23dc755fa]
 
   * gpgtar: Create and handle extended headers to support long file
     names.  [T5754]
 
   * gpgtar: Support file names longer than MAX_PATH on Windows.
     [rG70b738f93f]
 
   * gpgtar: Use a pipe for decryption and thus avoid memory
     exhaustion.  [rGe5ef5e3b91]
 
   * gpgtar: New option --with-log.  [rGed53d41b4c]
 
   * agent: New flag "qual" for the trustlist.txt.  [rG7c8c606061]
 
   * scdaemon: Add support for GeNUA cards.  [rG0dcc249852]
 
   * scdaemon: Add --challenge-response option to PK_AUTH for OpenPGP
     cards.  [T5862]
 
   * dirmngr: Support the use of ECDSA for CRLs and OCSP.
     [rGde87c8e1ea,rG890e9849b5]
 
   * dirmngr: Map all gnupg.net addresses to the Ubuntu keyserver.
     [T5751]
 
   * ssh: Return a faked response for the new session-bind extension.
     [T5931]
 
   * gpgconf: Add command aliases -L -K -R.  [rGec4a1cffb8]
 
   * gpg: Request keygrip of key to add via command interface.  [T5771]
 
   * gpg: Print Yubikey version correctly.  [T5787]
 
   * gpg: Always use version >= 4 to generate key signature.  [T5809]
 
   * gpg: Fix generating AEAD packet.  [T5853]
 
   * gpg: Fix version on symmetric encrypted AEAD files if the force
     option is used.  [T5856]
 
   * gpg: Fix adding the list of ultimate trusted keys.  [T5742]
 
   * gpgsm: Fix parsing of certain PKCS#12 files.  [T5793]
 
   * gpgsm: Print diagnostic about CRL problems due to Tor mode.
     [rG137e59a6a5]
 
   * agent: Use "Created:" field for creation time.  [T5538]
 
   * scdaemon Fix error handling for a PC/SC reader selected with
     reader-port.  [T5758]
 
   * scdaemon: Fix DEVINFO with no --watch.  [rGc6dd9ff929]
 
   * scdaemon: Fix socket resource leak on Windwos.  [T5029]
 
   * scdaemon: Use extended mode for pkcs#15 already for rsa2048.
     [rG597253ca17]
 
   * scdaemon: Enhance PASSWD command to accept KEYGRIP optionally.
     [T5862]
 
   * scdaemon: Fix memory leak in ccid-driver.  [rG8ac92f0e80]
 
   * tpm: Always use hexgrip when storing a key password.
     [rGaf2fbd9b01]
 
   * dirmngr: Make WKD lookups work for resolvers not handling SRV
     records.  [T4729]
 
   * dirmngr: Avoid initial delay on the first keyserver access in
     presence of --no-use-tor.  [rG57d546674d]
 
   * dirmngr: Workaround for a certain broken LDAP URL.  [rG90caa7ad59]
 
   * dirmngr: Escape more characters in WKD requests.  [T5902]
 
   * dirmngr: Suppress error message on trial reading as PEM format.
     [T5531]
 
   * gpgconf: Fix component table when not building without TPM
     support.  [T5701]
 
   * gpgconf: Silence warnings from parsing the option files.  [T5874]
 
   * gpgconf: Do not list ignored options and mark forced options as
     read-only.  [rG42785d7c8a]
 
   * gpgconf: Tweak the use of the ldapserver option.  [T5801]
 
   * ssh: Fix adding an ed25519 key with a zero length comment.  [T5794]
 
   * kbx: Fix searching for FPR20 in version 2 blob.  [T5888]
 
   * Fix early homedir creation.  [T5895]
 
   * Improve removing of stale lockfiles under Unix.  [T5884]
 
   Release-info: https://dev.gnupg.org/T5743
   See-also: gnupg-announce/2022q2/000472.html
 
 
 Noteworthy changes in version 2.3.4 (2021-12-20)
 ------------------------------------------------
 
   * gpg: New option --min-rsa-length.  [rG5f39db70c0]
 
   * gpg: New option --forbid-gen-key.  [rGc397ba3ac0]
 
   * gpg: New option --override-compliance-check.  [T5655]
 
   * gpgconf: New command --show-configs.  [rGa0fb78ee0f]
 
   * agent,dirmngr,keyboxd: New option --steal-socket.
     [rGb0079ab39d,rGdd708f60d5]
 
   * gpg: Fix printing of binary notations.  [T5667]
 
   * gpg: Remove stale ultimately trusted keys from the trustdb.
     [T5685,T5742]
 
   * gpg: Fix indentation of --print-mds and --print-md sha512.  [T5679]
 
   * gpg: Emit gpg 2.2 compatible Ed25519 signature.  [T5331]
 
   * gpgsm: Detect circular chains in --list-chain.  [rG74c5b35062]
 
   * dirmngr: Make reading resolv.conf more robust.  [T5657]
 
   * dirmngr: Ask keyservers to provide the key fingerprints.  [T5741]
 
   * gpgconf: Allow changing gpg's deprecated keyserver option.  [T5462]
 
   * gpg-wks-server: Fix created file permissions.  [rG60be00b033]
 
   * scd: Support longer data for ssh-agent authentication with openpgp
     cards.  [T5682]
 
   * scd: Modify DEVINFO behavior to support looping forever.  [T5359]
 
   * Support gpgconf.ctl for NetBSD and Solaris.  [T5656,T5671]
 
   * Silence "Garbled console data" warning under Windows in most
     cases.  [rGe293da3b21]
 
   * Silence warning about the rootdir under Unices w/o a mounted /proc
     file system.  [T5656]
 
   * Fix possible build problems about missing include files.  [T5592]
 
   Release-info: https://dev.gnupg.org/T5654
   See-also: gnupg-announce/2021q4/000468.html
 
 
 Noteworthy changes in version 2.3.3 (2021-10-12)
 ------------------------------------------------
 
   * agent: Fix segv in GET_PASSPHRASE (regression).  [#5577]
 
   * dirmngr: Fix Let's Encrypt certificate chain validation.  [#5639]
 
   * gpg: Change default and maximum AEAD chunk size to 4 MiB.
     [ad3dabc9fb]
 
   * gpg: Print a warning when importing a bad cv25519 secret key.
     [#5464]
 
   * gpg: Fix --list-packets for undecryptable AEAD packets.  [#5584]
 
   * gpg: Verify backsigs for v5 keys correctly.  [#5628]
 
   * keyboxd: Fix checksum computation for no UBID entry on disk.
     [#5573]
 
   * keyboxd: Fix "invalid object" error with cv448 keys.  [#5609]
 
   * dirmngr: New option --ignore-cert.  [4b3e9a44b5]
 
   * agent: Fix calibrate_get_time use of clock_gettime.  [#5623]
 
   * Silence process spawning diagnostics on Windows. [f2b01025c3]
 
   * Support a gpgconf.ctl file under Unix and use this for the
     regression tests.  [#5999]
 
   Release-info: https://dev.gnupg.org/T5565
   See-also: gnupg-announce/2021q4/000466.html
 
 
 Noteworthy changes in version 2.3.2 (2021-08-24)
 ------------------------------------------------
 
   * gpg: Allow fingerprint based lookup with --locate-external-key.
     [ec36eca08c]
 
   * gpg: Allow decryption w/o public key but with correct card
     inserted.  [50293ec2eb]
 
   * gpg: Auto import keys specified with --trusted-keys.  [100037ac0f]
 
   * gpg: Do not use import-clean for LDAP keyserver imports.  [#5387]
 
   * gpg: Fix mailbox based search via AKL keyserver method.  [4fcfac6feb]
 
   * gpg: Fix memory corruption with --clearsign introduced with 2.3.1.
     [#5430]
 
   * gpg: Use a more descriptive prompt for symmetric decryption.
     [6dfae2f402]
 
   * gpg: Improve speed of secret key listing.  [40da61b89b]
 
   * gpg: Support keygrip search with traditional keyring.  [#5469]
 
   * gpg: Let --fetch-key return an exit code on failure.  [#5376]
 
   * gpg: Emit the NO_SECKEY status again for decryption.  [#5562]
 
   * gpgsm: Support decryption of password based encryption (pwri).
     [eeb65d3bbd]
 
   * gpgsm: Support AES-GCM decryption.  [4980fb3c6d]
 
   * gpgsm: Let --dump-cert --show-cert also print an OpenPGP
     fingerprint.  [52bbdc731f]
 
   * gpgsm: Fix finding of issuer in use-keyboxd mode.  [6b76693ff5]
 
   * gpgsm: New option --ldapserver as an alias for --keyserver.
     [89df86157e]
 
   * agent: Use SHA-256 for SSH fingerprint by default.  [#5434]
 
   * agent: Fix calling handle_pincache_put.  [#5436]
 
   * agent: Fix importing protected secret key.  [#5122]
 
   * agent: Fix a regression in agent_get_shadow_info_type.  [#5393]
 
   * agent: Add translatable text for Caps Lock hint.  [#4950]
 
   * agent: New option --pinentry-formatted-passphrase.  [#5517]
 
   * agent: Add checkpin inquiry for pinentry.  [#5517,#5532]
 
   * agent: New option --check-sym-passphrase-pattern.  [#5517]
 
   * agent: Use the sysconfdir for a pattern file.
 
   * agent: Make QT_QPA_PLATFORMTHEME=qt5ct work for the pinentry.
     [1305baf099]
 
   * dirmngr: LDAP search by a mailbox now ignores revoked keys.
     [1406f551f1]
 
   * dirmngr: For KS_SEARCH return the fingerprint also with LDAP.
     [#5441]
 
   * dirmngr: Allow for non-URL specified ldap keyservers.  [#5405,#5452]
 
   * dirmngr: New option --ldapserver.  [52cf32ce2f]
 
   * dirmngr: Fix regression in KS_GET for mail address pattern.
     [#5497]
 
   * card: New option --shadow for the list command.  [2fce99d73a]
 
   * tests: Make sure the built keyboxd is used.  [#5406]
 
   * scd: Fix computing shared secrets for 512 bit curves.
     [9e24f2a45c]
 
   * scd: Fix unblock PIN by a Reset Code with KDF.  [#5413]
 
   * scd: Fix PC/SC removed card problem.  [8d81fd7c01]
 
   * scd: Recover the partial match for PORTSTR for PC/SC.
    [53bdc6288f]
 
   * scd: Make sure to release the PC/SC context.  [#5416]
 
   * scd: Fix zero-byte handling in ECC.  [#5163]
 
   * scd: Fix serial number detection for Yubikey 5.  [#5442]
 
   * scd: Add basic support for AET JCOP cards.  [544ec7872a]
 
   * scd: Detect external interference when --pcsc-shared is in use.
     [#5484]
 
   * scd: Fix access to the list of cards.  [#5524]
 
   * gpgconf: Do not list a disabled tpm2d.  [#5408]
 
   * gpgconf: Make runtime changes with different homedir work.
     [31c0aa2ff3]
 
   * keyboxd: Fix searching for exact mail adddress.  [f79e9540ca]
 
   * keyboxd: Fix searching with multiple patterns.  [101ba4f18a]
 
   * gpgtar: Fix file size computation under Windows.  [14e36bdbe1]
 
   * tools: Extend gpg-check-pattern.  [73c03e0232]
 
   * wkd: Fix client issue with leading or trailing spaces in
     user-ids.  [b4345f7521]
 
   * Under Windows add a fallback in case the console can't cope with
     Unicode.  [#5491]
 
   * Under Windows use LOCAL_APPDATA for the socket directory.  [#5537]
 
   * Pass XDG_SESSION_TYPE and QT_QPA_PLATFORM envvars to Pinentry.
     [#3659]
 
   * Change the default keyserver to keyserver.ubuntu.com.  This is a
     temporary change due to the shutdown of the SKS keyserver pools.
     [55b5928099]
 
   Release-info: https://dev.gnupg.org/T5405
   See-also: gnupg-announce/2021q3/000462.html
 
 
 Noteworthy changes in version 2.3.1 (2021-04-20)
 ------------------------------------------------
 
   * The new configuration file common.conf is now used to enable the
     use of the key database daemon with "use-keyboxd".  Using this
     option in gpg.conf and gpgsm.conf is supported for a transitional
     period.  See doc/example/common.conf for more.
 
   * gpg: Force version 5 key creation for ed448 and cv448 algorithms.
 
   * gpg: By default do not use the self-sigs-only option when
     importing from an LDAP keyserver.  [#5387]
 
   * gpg: Lookup a missing public key of the active card via LDAP.
     [d7e707170f]
 
   * gpgsm: New command --show-certs.  [51419d6341]
 
   * scd: Fix CCID driver for SCM SPR332/SPR532.  [#5297]
 
   * scd: Further improvements for PKCS#15 cards.
 
   * Fix build problems on Fedora.  [#5389]
 
   * Fix build problems on macOS.  [#5400]
 
   * New configure option --with-tss to allow the selection of the TSS
     library.  [93c88d0af3]
 
   Release-info: https://dev.gnupg.org/T5386
   See-also: gnupg-announce/2021q2/000459.html
 
 
 Noteworthy changes in version 2.3.0 (2021-04-07)
 ------------------------------------------------
 
   * A new experimental key database daemon is provided.  To enable it
     put "use-keyboxd" into gpg.conf and gpgsm.conf.  Keys are stored
     in a SQLite database and make key lookup much faster.
 
   * New tool gpg-card as a flexible frontend for all types of
     supported smartcards.
 
   * New option --chuid for gpg, gpgsm, gpgconf, gpg-card, and
     gpg-connect-agent.
 
   * The gpg-wks-client tool is now installed under bin; a wrapper for
     its old location at libexec is also installed.
 
   * tpm2d: New daemon to physically bind keys to the local machine.
 
   * gpg: Switch to ed25519/cv25519 as default public key algorithms.
 
   * gpg: Verification results now depend on the --sender option and
     the signer's UID subpacket.  [T4735]
 
   * gpg: Do not use any 64-bit block size cipher algorithm for
     encryption.  Use AES as last resort cipher preference instead of
     3DES.  This can be reverted using --allow-old-cipher-algos.
 
   * gpg: Support AEAD encryption mode using OCB or EAX.
 
   * gpg: Support v5 keys and signatures.
 
   * gpg: Support curve X448 (ed448, cv448).
 
   * gpg: Allow use of group names in key listings.  [e825aea2ba]
 
   * gpg: New option --full-timestrings to print date and time.
 
   * gpg: New option --force-sign-key.  [#4584]
 
   * gpg: New option --no-auto-trust-new-key.
 
   * gpg: The legacy key discovery method PKA is no longer supported.
     The command --print-pka-records and the PKA related import and
     export options have been removed.
 
   * gpg: Support export of Ed448 Secure Shell keys.
 
   * gpgsm: Add basic ECC support.
 
   * gpgsm: Support creation of EdDSA certificates.  [#4888]
 
   * agent: Allow the use of "Label:" in a key file to customize the
     pinentry prompt.  [5388537806]
 
   * agent: Support ssh-agent extensions for environment variables.
     With a patched version of OpenSSH this avoids the need for the
     "updatestartuptty" kludge.  [224e26cf7b]
 
   * scd: Improve support for multiple card readers and tokens.
 
   * scd: Support PIV cards.
 
   * scd: Support for Rohde&Schwarz Cybersecurity cards.
 
   * scd: Support Telesec Signature Cards v2.0
 
   * scd: Support multiple application on certain smartcard.
 
   * scd: New option --application-priority.
 
   * scd: New option --pcsc-shared; see man page for important notes.
 
   * dirmngr: Support a gpgNtds parameter in LDAP keyserver URLs.
 
   * The symcryptrun tool, a wrapper for the now obsolete external
     Chiasmus tool, has been removed.
 
   * Full Unicode support for the command line.  [#4398]
 
   Changes also found in 2.2.27:
 
   * gpg: Fix regression in 2.2.24 for gnupg_remove function under
     Windows.  [#5230]
 
   * gpgconf: Fix case with neither local nor global gpg.conf.  [9f37d3e6f3]
 
   * gpgconf: Fix description of two new options.  [#5221]
 
   * Build Windows installer without timestamps.  Note that the
     Authenticode signatures still carry a timestamp.
 
   Changes also found in 2.2.26:
 
   * gpg: New AKL method "ntds".  [559efd23e9]
 
   * gpg: Fix --trusted-key with fingerprint arg.  [8a2e5025eb]
 
   * scd: Fix writing of ECC keys to an OpenPGP card.  [#5163]
 
   * scd: Make an USB error fix specific to SPR532 readers.  [#5167]
 
   * dirmngr: With new LDAP keyservers store the new attributes.  Never
     store the useless pgpSignerID.  Fix a long standing bug storing
     some keys on an ldap server.  [0e88c73bc9,e47de85382]
 
   * dirmngr: Support the new Active Direcory LDAP schema for
     keyservers.  [ac8ece9266]
 
   * dirmngr: Allow LDAP OpenPGP searches via fingerprint.
     [c75fd75532]
 
   * dirmngr: Do not block other threads during keyserver LDAP calls.
     [15bfd189c0]
 
   * Support global configuration files.  [#4788,a028f24136]
 
   * Fix the iconv fallback handling to UTF-8.  [#5038]
 
   Changes also found in 2.2.25:
 
   * scd: Fix regression in 2.2.24 requiring gpg --card-status before
     signing or decrypting.  [#5065]
 
   * gpgsm: Using Libksba 1.5.0 signatures with a rarely used
     combination of attributes can now be verified.  [#5146]
 
   Changes also found in 2.2.24:
 
   * Allow Unicode file names on Windows almost everywhere.  Note that
     it is still not possible to use Unicode strings on the command
     line.  This change also fixes a regression in 2.2.22 related to
     non-ascii file names.  [#5098]
 
   * Fix localized time printing on Windows.  [#5073]
 
   * gpg: New command --quick-revoke-sig.  [#5093]
 
   * gpg: Do not use weak digest algos if selected by recipient
     preference during sign+encrypt.  [4c181d51a6]
 
   * gpg: Switch to AES256 for symmetric encryption in de-vs mode.
     [166e779634]
 
   * gpg: Silence weak digest warnings with --quiet.  [#4893]
 
   * gpg: Print new status line CANCELED_BY_USER for a cancel during
     symmetric encryption.  [f05d1772c4]
 
   * gpg: Fix the encrypt+sign hash algo preference selection for
     ECDSA.  This is in particular needed for keys created from
     existing smartcard based keys.  [aeed0b93ff]
 
   * agent: Keep some permissions of private-keys-v1.d.  [#2312]
 
   * dirmngr: Align sks-keyservers.netCA.pem use between ntbtls and
     gnutls builds.  [e4f3b74c91]
 
   * dirmngr: Fix the pool keyserver case for a single host in the
     pool.  [72e04b03b1a7]
 
   * scd: Fix the use case of verify_chv2 by CHECKPIN.  [61aea64b3c]
 
   * scd: Various improvements to the ccid-driver.  [#4616,#5065]
 
   * scd: Minor fixes for Yubikey [25bec16d0b]
 
   * gpgconf: New option --show-versions.
 
   * w32: Install gpg-check-pattern and example profiles.  Install
     Windows subsystem variant of gpgconf (gpgconf-w32).
 
   Changes also found in 2.2.23:
 
   * gpg: Fix a possible segv in the key cleaning code.
 
   * gpgsm: Fix a minor RFC2253 parser bug.  [#5037]
 
   * scdaemon: Fix a PIN verify failure on certain OpenPGP card
     implementations.  Regression in 2.2.22.  [#5039]
 
   Changes also found in 2.2.22:
 
   * gpg: Change the default key algorithm to rsa3072.
 
   * gpg: Add regular expression support for Trust Signatures on all
     platforms.  [#4843]
 
   * gpg: Fix regression in 2.2.21 with non-default --passphrase-repeat
     option.  [#4991]
 
   * gpg: Ignore --personal-digest-prefs for ECDSA keys.  [#5021]
 
   * gpgsm: Make rsaPSS a de-vs compliant scheme.
 
   * gpgsm: Show also the SHA256 fingerprint in key listings.
 
   * gpgsm: Do not require a default keyring for --gpgconf-list.  [#4867]
 
   * gpg-agent: Default to extended key format and record the creation
     time of keys.  Add new option --disable-extended-key-format.
 
   * gpg-agent: Support the WAYLAND_DISPLAY envvar.  [#5016]
 
   * gpg-agent: Allow using --gpgconf-list even if HOME does not
     exist.  [#4866]
 
   * gpg-agent: Make the Pinentry work even if the envvar TERM is set
     to the empty string.  [#4137]
 
   * scdaemon: Add a workaround for Gnuk tokens <= 2.15 which wrongly
     incremented the error counter when using the "verify" command of
     "gpg --edit-key" with only the signature key being present.
 
   * dirmngr: Better handle systems with disabled IPv6.  [#4977]
 
   * gpgpslit: Install tool.  It was not installed in the past to avoid
     conflicts with the version installed by GnuPG 1.4.  [#5023]
 
   * gpgtar: Handle Unicode file names on Windows correctly. [#4083]
 
   * gpgtar: Make --files-from and --null work as documented.  [#5027]
 
   * Build the Windows installer with the new Ntbtls 0.2.0 so that TLS
     connections succeed for servers demanding GCM.
 
   Changes also found in 2.2.21:
 
   * gpg: Add option --no-include-key-block. [#4856]
 
   * gpg: Allow for extra padding in ECDH.  [#4908]
 
   * gpg: Only a single pinentry is shown for symmetric encryption if
     the pinentry supports this.  [#4971]
 
   * gpg: Print a note if no keys are given to --delete-key.  [#4959]
 
   * gpg,gpgsm: The ridiculous passphrase quality bar is not anymore
     shown.  [#2103]
 
   * gpgsm: Certificates without a CRL distribution point are now
     considered valid without looking up a CRL.  The new option
     --enable-issuer-based-crl-check can be used to revert to the
     former behaviour.
 
   * gpgsm: Support rsaPSS signature verification.  [#4538]
 
   * gpgsm: Unless CRL checking is disabled lookup a missing issuer
     certificate using the certificate's authorityInfoAccess.  [#4898]
 
   * gpgsm: Print the certificate's serial number also in decimal
     notation.
 
   * gpgsm: Fix possible NULL-deref in messages of --gen-key.  [#4895]
 
   * scd: Support the CardOS 5 based D-Trust Card 3.1.
 
   * dirmngr: Allow http URLs with "LOOKUP --url".
 
   * wkd: Take name of sendmail from configure.  Fixes an OpenBSD
     specific bug.  [#4886]
 
   * Support a command history file in gpg-card and gpg-connect-agent.
 
   Changes also found in 2.2.20:
 
   * In constrast to 2.2 no explicit protection against overflow of the
     error counter is needed because libgpg-error takes care of this.
 
   * gpg: Make really sure that --verify-files always returns an error.
 
   * gpg: Fix key listing --with-secret if a pattern is given.  [#4061]
 
   * gpg: Fix detection of certain keys used as default-key.  [#4810]
 
   * gpg: Fix default-key selection when a card is available.  [#4850]
 
   * gpg: Fix key expiration and key usage for keys created with a
     creation date of zero.  [4670]
 
   * gpgsm: Fix import of some CR,LF terminated certificates.  [#4847]
 
   * gpg: New options --include-key-block and --auto-key-import to
     allow encrypted replies after an initial signed message.  [#4856]
 
   * gpg: Allow the use of a fingerprint with --trusted-key. [#4855]
 
   * gpg: New property "fpr" for use by --export-filter.
 
   * scdaemon: Disable the pinpad if a KDF DO is used.  [#4832]
 
   * dirmngr: Improve finding OCSP certificates.  [#4536]
 
   * Avoid build problems with LTO or gcc-10. [#4831]
 
   Changes also found in 2.2.19:
 
   * gpg: Only in 2.2.19; not requird in master: Fix double free when
     decrypting for hidden recipients.  Regression in 2.2.18.  [#4762].
 
   * gpg: Use auto-key-locate for encryption even for mail addresses
     given with angle brackets.  [#4726]
 
   * gpgsm: Add special case for certain expired intermediate
     certificates.  [#4696]
 
   Changes also found in 2.2.18:
 
   * gpg: Changed the way keys are detected on a smartcards; this
     allows the use of non-OpenPGP cards.  In the case of a not very
     likely regression the new option --use-only-openpgp-card is
     available.  [#4681]
 
   * gpg: The commands --full-gen-key and --quick-gen-key now allow
     direct key generation from supported cards.  [#4681]
 
   * gpg: Prepare against chosen-prefix SHA-1 collisions in key
     signatures.  This change removes all SHA-1 based key signature
     from the web-of-trust.  Note that this includes all key signature
     created with dsa1024 keys.  (Version 2.2.18 limits this to key
     signatures newer than 2019-01-19.)  The new option
     --allow-weak-key-signatues can be used to override the new and
     safer behaviour.  [#4755,CVE-2019-14855]
 
   * gpg: Improve performance for import of large keyblocks.  [#4592]
 
   * gpg: Implement a keybox compression run.  [#4644]
 
   * gpg: Show warnings from dirmngr about redirect and certificate
     problems (details require --verbose as usual).
 
   * gpg: Allow to pass the empty string for the passphrase if the
     '--passphase=' syntax is used.  [#4633]
 
   * gpg: Fix printing of the KDF object attributes.
 
   * gpg: Avoid surprises with --locate-external-key and certain
     --auto-key-locate settings.  [#4662]
 
   * gpg: Improve selection of best matching key.  [#4713]
 
   * gpg: Delete key binding signature when deleting a subkey.
     [#4665,#4457]
 
   * gpg: Fix a potential loss of key signatures during import with
     self-sigs-only active.  [#4628]
 
   * gpg: Silence "marked as ultimately trusted" diagnostics if
     option --quiet is used.  [#4634]
 
   * gpg: Silence some diagnostics during in key listsing even with
     option --verbose.  [#4627]
 
   * gpg, gpgsm: Change parsing of agent's pkdecrypt results.  [#4652]
 
   * gpgsm: Support AES-256 keys.
 
   * gpgsm: Fix a bug in triggering a keybox compression run if
     --faked-system-time is used.
 
   * dirmngr: System CA certificates are no longer used for the SKS
     pool if GNUTLS instead of NTBTLS is used as TLS library.  [#4594]
 
   * dirmngr: On Windows detect usability of IPv4 and IPv6 interfaces
     to avoid long timeouts.  [#4165]
 
   * scd: Fix BWI value for APDU level transfers to make Gemalto Ezio
     Shield and Trustica Cryptoucan work.  [#4654,#4566]
 
   * wkd: gpg-wks-client --install-key now installs the required policy
     file.
 
   Changes also found in 2.2.17:
 
   * gpg: Ignore all key-signatures received from keyservers.  This
     change is required to mitigate a DoS due to keys flooded with
     faked key-signatures.  The old behaviour can be achieved by adding
       keyserver-options no-self-sigs-only,no-import-clean
     to your gpg.conf.  [#4607]
 
   * gpg: If an imported keyblocks is too large to be stored in the
     keybox (pubring.kbx) do not error out but fallback to an import
     using the options "self-sigs-only,import-clean".  [#4591]
 
   * gpg: New command --locate-external-key which can be used to
     refresh keys from the Web Key Directory or via other methods
     configured with --auto-key-locate.
 
   * gpg: New import option "self-sigs-only".
 
   * gpg: In --auto-key-retrieve prefer WKD over keyservers.  [#4595]
 
   * dirmngr: Support the "openpgpkey" subdomain feature from
     draft-koch-openpgp-webkey-service-07. [#4590].
 
   * dirmngr: Add an exception for the "openpgpkey" subdomain to the
     CSRF protection.  [#4603]
 
   * dirmngr: Fix endless loop due to http errors 503 and 504.  [#4600]
 
   * dirmngr: Fix TLS bug during redirection of HKP requests.  [#4566]
 
   * gpgconf: Fix a race condition when killing components.  [#4577]
 
   Changes also found in 2.2.16:
 
   * gpg,gpgsm: Fix deadlock on Windows due to a keybox sharing
     violation.  [#4505]
 
   * gpg: Allow deletion of subkeys with --delete-key.  This finally
     makes the bang-suffix work as expected for that command.  [#4457]
 
   * gpg: Replace SHA-1 by SHA-256 in self-signatures when updating
     them with --quick-set-expire or --quick-set-primary-uid. [#4508]
 
   * gpg: Improve the photo image viewer selection.  [#4334]
 
   * gpg: Fix decryption with --use-embedded-filename.  [#4500]
 
   * gpg: Remove hints on using the --keyserver option.  [#4512]
 
   * gpg: Fix export of certain secret keys with comments.  [#4490]
 
   * gpg: Reject too long user-ids in --quick-gen-key.  [#4532]
 
   * gpg: Fix a double free in the best key selection code.  [#4462]
 
   * gpg: Fix the key generation dialog for switching back from EdDSA
     to ECDSA.
 
   * gpg: Use AES-192 with SHA-384 to comply with RFC-6637.
 
   * gpg: Use only the addrspec from the Signer's UID subpacket to
     mitigate a problem with another implementation.
 
   * gpg: Skip invalid packets during a keyring listing and sync
     diagnostics with the output.
 
   * gpgsm: Avoid confusing diagnostic when signing with the default
     key.  [#4535]
 
   * agent: Do not delete any secret key in --dry-run mode.
 
   * agent: Fix failures on 64 bit big-endian boxes related to URIs in
     a keyfile.  [#4501]
 
   * agent: Stop scdaemon after a reload with disable-scdaemon newly
     configured.  [#4326]
 
   * dirmngr: Improve caching algorithm for WKD domains.
 
   * dirmngr: Support other hash algorithms than SHA-1 for OCSP.  [#3966]
 
   * gpgconf: Make --homedir work for --launch.  [#4496]
 
   * gpgconf: Before --launch check for a valid config file.  [#4497]
 
   * wkd: Do not import more than 5 keys from one WKD address.
 
   * wkd: Accept keys which are stored in armored format in the
     directory.
 
   * The installer for Windows now comes with signed binaries.
 
   Changes also found in 2.2.15:
 
   * sm: Fix --logger-fd and --status-fd on Windows for non-standard
     file descriptors.
 
   * sm: Allow decryption even if expired keys are configured.  [#4431]
 
   * agent: Change command KEYINFO to print ssh fingerprints with other
     hash algos.
 
   * dirmngr: Fix build problems on Solaris due to the use of reserved
     symbol names.  [#4420]
 
   * wkd: New commands --print-wkd-hash and --print-wkd-url for
     gpg-wks-client.
 
   Changes also found in 2.2.14:
 
   * gpg: Allow import of PGP desktop exported secret keys.  Also avoid
    importing secret keys if the secret keyblock is not valid.  [#4392]
 
   * gpg: Make invalid primary key algo obvious in key listings.
 
   * sm: Do not mark a certificate in a key listing as de-vs compliant
     if its use for a signature will not be possible.
 
   * sm: Fix certificate creation with key on card.
 
   * sm: Create rsa3072 bit certificates by default.
 
   * sm: Print Yubikey attestation extensions with --dump-cert.
 
   * agent: Fix cancellation handling for scdaemon.
 
   * agent: Support --mode=ssh option for CLEAR_PASSPHRASE.  [#4340]
 
   * scd: Fix flushing of the CA-FPR DOs in app-openpgp.
 
   * scd: Avoid a conflict error with the "undefined" app.
 
   * dirmngr: Add CSRF protection exception for protonmail.
 
   * dirmngr: Fix build problems with gcc 9 in libdns.
 
   * gpgconf: New option --show-socket for use with --launch.
 
   * gpgtar: Make option -C work for archive creation.
 
   Changes also found in 2.2.13:
 
   * gpg: Implement key lookup via keygrip (using the & prefix).
 
   * gpg: Allow generating Ed25519 key from existing key.
 
   * gpg: Emit an ERROR status line if no key was found with -k.
 
   * gpg: Stop early when trying to create a primary Elgamal key.  [#4329]
 
   * gpgsm: Print the card's key algorithms along with their keygrips
     in interactive key generation.
 
   * agent: Clear bogus pinentry cache in the error case.  [#4348]
 
   * scd: Support "acknowledge button" feature.
 
   * scd: Fix for USB INTERRUPT transfer.  [#4308]
 
   * wks: Do no use compression for the the encrypted challenge and
     response.
 
   Changes also found in 2.2.12:
 
   * tools: New commands --install-key and --remove-key for
     gpg-wks-client.  This allows to prepare a Web Key Directory on a
     local file system for later upload to a web server.
 
   * gpg: New --list-option "show-only-fpr-mbox".  This makes the use
     of the new gpg-wks-client --install-key command easier on Windows.
 
   * gpg: Improve processing speed when --skip-verify is used.
 
   * gpg: Fix a bug where a LF was accidentally written to the console.
 
   * gpg: --card-status now shows whether a card has the new KDF
     feature enabled.
 
   * agent: New runtime option --s2k-calibration=MSEC.  New configure
     option --with-agent-s2k-calibration=MSEC.  [#3399]
 
   * dirmngr: Try another keyserver from the pool on receiving a 502,
     503, or 504 error.  [#4175]
 
   * dirmngr: Avoid possible CSRF attacks via http redirects.  A HTTP
     query will not anymore follow a 3xx redirect unless the Location
     header gives the same host.  If the host is different only the
     host and port is taken from the Location header and the original
     path and query parts are kept.
 
   * dirmngr: New command FLUSHCRL to flush all CRLS from disk and
     memory.  [#3967]
 
   * New simplified Chinese translation (zh_CN).
 
   Changes also found in 2.2.11:
 
   * gpgsm: Fix CRL loading when intermediate certificates are not yet
     trusted.
 
   * gpgsm: Fix an error message about the digest algo.  [#4219]
 
   * gpg: Fix a wrong warning due to new sign usage check introduced
     with 2.2.9.  [#4014]
 
   * gpg: Print the "data source" even for an unsuccessful keyserver
     query.
 
   * gpg: Do not store the TOFU trust model in the trustdb.  This
     allows to enable or disable a TOFO model without triggering a
     trustdb rebuild.  [#4134]
 
   * scd: Fix cases of "Bad PIN" after using "forcesig".  [#4177]
 
   * agent: Fix possible hang in the ssh handler.  [#4221]
 
   * dirmngr: Tack the unmodified mail address to a WKD request.  See
     commit a2bd4a64e5b057f291a60a9499f881dd47745e2f for details.
 
   * dirmngr: Tweak diagnostic about missing LDAP server file.
 
   * dirmngr: In verbose mode print the OCSP responder id.
 
   * dirmngr: Fix parsing of the LDAP port.  [#4230]
 
   * wks: Add option --directory/-C to the server.  Always build the
     server on Unix systems.
 
   * wks: Add option --with-colons to the client.  Support sites which
     use the policy file instead of the submission-address file.
 
   * Fix EBADF when gpg et al. are called by broken CGI scripts.
 
   * Fix some minor memory leaks and bugs.
 
   Changes also found in 2.2.10:
 
   * gpg: Refresh expired keys originating from the WKD.  [#2917]
 
   * gpg: Use a 256 KiB limit for a WKD imported key.
 
   * gpg: New option --known-notation.  [#4060]
 
   * scd: Add support for the Trustica Cryptoucan reader.
 
   * agent: Speed up starting during on-demand launching.  [#3490]
 
   * dirmngr: Validate SRV records in WKD queries.
 
   Changes also found in 2.2.9:
 
   * dirmngr: Fix recursive resolver mode and other bugs in the libdns
     code.  [#3374,#3803,#3610]
 
   * dirmngr: When using libgpg-error 1.32 or later a GnuPG build with
     NTBTLS support (e.g. the standard Windows installer) does not
     anymore block for dozens of seconds before returning data.
 
   * gpg: Fix bug in --show-keys which actually imported revocation
     certificates.  [#4017]
 
   * gpg: Ignore too long user-ID and comment packets.  [#4022]
 
   * gpg: Fix crash due to bad German translation.  Improved printf
     format compile time check.
 
   * gpg: Handle missing ISSUER sub packet gracefully in the presence of
     the new ISSUER_FPR.  [#4046]
 
   * gpg: Allow decryption using several passphrases in most cases.
     [#3795,#4050]
 
   * gpg: Command --show-keys now enables the list options
     show-unusable-uids, show-unusable-subkeys, show-notations and
     show-policy-urls by default.
 
   * gpg: Command --show-keys now prints revocation certificates. [#4018]
 
   * gpg: Add revocation reason to the "rev" and "rvs" records of the
     option --with-colons.  [#1173]
 
   * gpg: Export option export-clean does now remove certain expired
     subkeys; export-minimal removes all expired subkeys.  [#3622]
 
   * gpg: New "usage" property for the drop-subkey filters.  [#4019]
 
   Changes also found in 2.2.8:
 
   * gpg: Decryption of messages not using the MDC mode will now lead
     to a hard failure even if a legacy cipher algorithm was used.  The
     option --ignore-mdc-error can be used to turn this failure into a
     warning.  Take care: Never use that option unconditionally or
     without a prior warning.
 
   * gpg: The MDC encryption mode is now always used regardless of the
     cipher algorithm or any preferences.  For testing --rfc2440 can be
     used to create a message without an MDC.
 
   * gpg: Sanitize the diagnostic output of the original file name in
     verbose mode.  [#4012,CVE-2018-12020]
 
   * gpg: Detect suspicious multiple plaintext packets in a more
     reliable way.  [#4000]
 
   * gpg: Fix the duplicate key signature detection code.  [#3994]
 
   * gpg: The options --no-mdc-warn, --force-mdc, --no-force-mdc,
     --disable-mdc and --no-disable-mdc have no more effect.
 
   * gpg: New command --show-keys.
 
   * agent: Add DBUS_SESSION_BUS_ADDRESS and a few other envvars to the
     list of startup environment variables.  [#3947]
 
   Changes also found in 2.2.7:
 
   * gpg: New option --no-symkey-cache to disable the passphrase cache
     for symmetrical en- and decryption.
 
   * gpg: The ERRSIG status now prints the fingerprint if that is part
     of the signature.
 
   * gpg: Relax emitting of FAILURE status lines
 
   * gpg: Add a status flag to "sig" lines printed with --list-sigs.
 
   * gpg: Fix "Too many open files" when using --multifile.  [#3951]
 
   * ssh: Return an error for unknown ssh-agent flags.  [#3880]
 
   * dirmngr: Fix a regression since 2.1.16 which caused corrupted CRL
     caches under Windows.  [#2448,#3923]
 
   * dirmngr: Fix a CNAME problem with pools and TLS.  Also use a fixed
     mapping of keys.gnupg.net to sks-keyservers.net.  [#3755]
 
   * dirmngr: Try resurrecting dead hosts earlier (from 3 to 1.5 hours).
 
   * dirmngr: Fallback to CRL if no default OCSP responder is configured.
 
   * dirmngr: Implement CRL fetching via https.  Here a redirection to
     http is explicitly allowed.
 
   * dirmngr: Make LDAP searching and CRL fetching work under Windows.
     This stopped working with 2.1.  [#3937]
 
   * agent,dirmngr: New sub-command "getenv" for "getinfo" to ease
     debugging.
 
   Changes also found in 2.2.6:
 
   * gpg,gpgsm: New option --request-origin to pretend requests coming
     from a browser or a remote site.
 
   * gpg: Fix race condition on trustdb.gpg updates due to too early
     released lock.  [#3839]
 
   * gpg: Emit FAILURE status lines in almost all cases.  [#3872]
 
   * gpg: Implement --dry-run for --passwd to make checking a key's
     passphrase straightforward.
 
   * gpg: Make sure to only accept a certification capable key for key
     signatures.  [#3844]
 
   * gpg: Better user interaction in --card-edit for the factory-reset
     sub-command.
 
   * gpg: Improve changing key attributes in --card-edit by adding an
     explicit "key-attr" sub-command.  [#3781]
 
   * gpg: Print the keygrips in the --card-status.
 
   * scd: Support KDF DO setup.  [#3823]
 
   * scd: Fix some issues with PC/SC on Windows.  [#3825]
 
   * scd: Fix suspend/resume handling in the CCID driver.
 
   * agent: Evict cached passphrases also via a timer.  [#3829]
 
   * agent: Use separate passphrase caches depending on the request
     origin.  [#3858]
 
   * ssh: Support signature flags.  [#3880]
 
   * dirmngr: Handle failures related to missing IPv6 support
     gracefully.  [#3331]
 
   * Fix corner cases related to specified home directory with
     drive letter on Windows.  [#3720]
 
   * Allow the use of UNC directory names as homedir.  [#3818]
 
   Changes also found in 2.2.5:
 
   * gpg: Allow the use of the "cv25519" and "ed25519" short names in
     addition to the canonical curve names in --batch --gen-key.
 
   * gpg: Make sure to print all secret keys with option --list-only
     and --decrypt.  [#3718]
 
   * gpg: Fix the use of future-default with --quick-add-key for
     signing keys.  [#3747]
 
   * gpg: Select a secret key by checking availability under gpg-agent.
     [#1967]
 
   * gpg: Fix reversed prompt texts for --only-sign-text-ids.  [#3787]
 
   * gpg,gpgsm: Fix detection of bogus keybox blobs on 32 bit systems.
     [#3770]
 
   * gpgsm: Fix regression since 2.1 in --export-secret-key-raw which
     got $d mod (q-1)$ wrong.  Note that most tools automatically fixup
     that parameter anyway.
 
   * ssh: Fix a regression in getting the client'd PID on *BSD and
     macOS.
 
   * scd: Support the KDF Data Object of the OpenPGP card 3.3.  [#3152]
 
   * scd: Fix a regression in the internal CCID driver for certain card
     readers.  [#3508]
 
   * scd: Fix a problem on NetBSD killing scdaemon on gpg-agent
     shutdown.  [#3778]
 
   * dirmngr: Improve returned error description on failure of DNS
     resolving.  [#3756]
 
   * wks: Implement command --install-key for gpg-wks-server.
 
   * Add option STATIC=1 to the Speedo build system to allow a build
     with statically linked versions of the core GnuPG libraries.  Also
     use --enable-wks-tools by default by Speedo builds for Unix.
 
   Changes also found in 2.2.4:
 
   * gpg: Change default preferences to prefer SHA512.
 
   * gpg: Print a warning when more than 150 MiB are encrypted using a
     cipher with 64 bit block size.
 
   * gpg: Print a warning if the MDC feature has not been used for a
     message.
 
   * gpg: Fix regular expression of domain addresses in trust
     signatures. [#2923]
 
   * agent: New option --auto-expand-secmem to help with high numbers
     of concurrent connections.  Requires libgcrypt 1.8.2 for having
     an effect.  [#3530]
 
   * dirmngr: Cache responses of WKD queries.
 
   * gpgconf: Add option --status-fd.
 
   * wks: Add commands --check and --remove-key to gpg-wks-server.
 
   * Increase the backlog parameter of the daemons to 64 and add
     option --listen-backlog.
 
   * New configure option --enable-run-gnupg-user-socket to first try a
     socket directory which is not removed by systemd at session end.
 
   Changes also found in 2.2.3:
 
   * gpgsm: Fix initial keybox creation on Windows. [#3507]
 
   * dirmngr: Fix crash in case of a CRL loading error. [#3510]
 
   * Fix the name of the Windows registry key. [Git#4f5afaf1fd]
 
   * gpgtar: Fix wrong behaviour of --set-filename. [#3500]
 
   * gpg: Silence AKL retrieval messages. [#3504]
 
   * agent: Use clock or clock_gettime for calibration. [#3056]
 
   * agent: Improve robustness of the shutdown pending
     state. [Git#7ffedfab89]
 
   Changes also found in 2.2.2:
 
   * gpg: Avoid duplicate key imports by concurrently running gpg
     processes. [#3446]
 
   * gpg: Fix creating on-disk subkey with on-card primary key. [#3280]
 
   * gpg: Fix validity retrieval for multiple keyrings. [Debian#878812]
 
   * gpg: Fix --dry-run and import option show-only for secret keys.
 
   * gpg: Print "sec" or "sbb" for secret keys with import option
     import-show. [#3431]
 
   * gpg: Make import less verbose. [#3397]
 
   * gpg: Add alias "Key-Grip" for parameter "Keygrip" and new
     parameter "Subkey-Grip" to unattended key generation.  [#3478]
 
   * gpg: Improve "factory-reset" command for OpenPGP cards.  [#3286]
 
   * gpg: Ease switching Gnuk tokens into ECC mode by using the magic
     keysize value 25519.
 
   * gpgsm: Fix --with-colon listing in crt records for fields > 12.
 
   * gpgsm: Do not expect X.509 keyids to be unique.  [#1644]
 
   * agent: Fix stuck Pinentry when using --max-passphrase-days. [#3190]
 
   * agent: New option --s2k-count.  [#3276 (workaround)]
 
   * dirmngr: Do not follow https-to-http redirects. [#3436]
 
   * dirmngr: Reduce default LDAP timeout from 100 to 15 seconds. [#3487]
 
   * gpgconf: Ignore non-installed components for commands
     --apply-profile and --apply-defaults. [#3313]
 
   * Add configure option --enable-werror.  [#2423]
 
   Changes also found in 2.2.1:
 
   * gpg: Fix formatting of the user id in batch mode key generation
     if only "name-email" is given.
 
   * gpgv: Fix annoying "not suitable for" warnings.
 
   * wks: Convey only the newest user id to the provider.  This is the
     case if different names are used with the same addr-spec.
 
   * wks: Create a complying user id for provider policy mailbox-only.
 
   * wks: Add workaround for posteo.de.
 
   * scd: Fix the use of large ECC keys with an OpenPGP card.
 
   * dirmngr: Use system provided root certificates if no specific HKP
     certificates are configured.  If build with GNUTLS, this was
     already the case.
 
   Release-info: https://dev.gnupg.org/T5343
   See-also: gnupg-announce/2021q2/000458.html
 
 
 Release dates of 2.2 versions
 -----------------------------
 
 Version 2.2.40 (2022-10-10) https://dev.gnupg.org/T6181
 Version 2.2.39 (2022-09-02) https://dev.gnupg.org/T6175
 Version 2.2.38 (2022-09-01) https://dev.gnupg.org/T6159
 Version 2.2.37 (2022-08-24) https://dev.gnupg.org/T6105
 Version 2.2.36 (2022-07-06) https://dev.gnupg.org/T5949
 Version 2.2.35 (2022-04-25) https://dev.gnupg.org/T5928
 Version 2.2.34 (2022-02-07) https://dev.gnupg.org/T5703
 Version 2.2.33 (2021-11-23) https://dev.gnupg.org/T5641
 Version 2.2.32 (2021-10-06) https://dev.gnupg.org/T5601
 Version 2.2.31 (2021-09-15) https://dev.gnupg.org/T5571
 Version 2.2.30 (2021-08-26) https://dev.gnupg.org/T5519
 Version 2.2.29 (2021-07-04) https://dev.gnupg.org/T5498
 Version 2.2.28 (2021-06-10) https://dev.gnupg.org/T5482
 Version 2.2.27 (2021-01-11) https://dev.gnupg.org/T5234
 Version 2.2.26 (2020-12-21) https://dev.gnupg.org/T5153
 Version 2.2.25 (2020-11-23) https://dev.gnupg.org/T5140
 Version 2.2.24 (2020-11-17) https://dev.gnupg.org/T5052
 Version 2.2.23 (2020-09-03) https://dev.gnupg.org/T5045
 Version 2.2.22 (2020-08-27) https://dev.gnupg.org/T5030
 Version 2.2.21 (2020-07-09) https://dev.gnupg.org/T4897
 Version 2.2.20 (2020-03-20) https://dev.gnupg.org/T4860
 Version 2.2.19 (2019-12-07) https://dev.gnupg.org/T4768
 Version 2.2.18 (2019-11-25) https://dev.gnupg.org/T4684
 Version 2.2.17 (2019-07-09) https://dev.gnupg.org/T4606
 Version 2.2.16 (2019-05-28) https://dev.gnupg.org/T4509
 Version 2.2.15 (2019-03-26) https://dev.gnupg.org/T4434
 Version 2.2.14 (2019-03-19) https://dev.gnupg.org/T4412
 Version 2.2.13 (2019-02-12) https://dev.gnupg.org/T4290
 Version 2.2.12 (2018-12-14) https://dev.gnupg.org/T4289
 Version 2.2.11 (2018-11-06) https://dev.gnupg.org/T4233
 Version 2.2.10 (2018-08-30) https://dev.gnupg.org/T4112
 Version 2.2.9  (2018-07-12) https://dev.gnupg.org/T4036
 Version 2.2.8  (2018-06-08)
 Version 2.2.7  (2018-05-02)
 Version 2.2.6  (2018-04-09)
 Version 2.2.5  (2018-02-22)
 Version 2.2.4  (2017-12-20)
 Version 2.2.3  (2017-11-20)
 Version 2.2.2  (2017-11-07)
 Version 2.2.1  (2017-09-19)
 
 
 Noteworthy changes in version 2.2.0 (2017-08-28)
 ------------------------------------------------
 
   This is the new long term stable branch.  This branch will only see
   bug fixes and no new features.
 
   * gpg: Reverted change in 2.1.23 so that --no-auto-key-retrieve is
     again the default.
 
   * Fixed a few minor bugs.
 
   See-also: gnupg-announce/2017q3/000413.html
 
 
 Noteworthy changes in version 2.1.23 (2017-08-09)
 -------------------------------------------------
 
   * gpg: "gpg" is now installed as "gpg" and not anymore as "gpg2".
     If needed, the new configure option --enable-gpg-is-gpg2 can be
     used to revert this.
 
   * gpg: Options --auto-key-retrieve and --auto-key-locate "local,wkd"
     are now used by default.  Note: this enables keyserver and Web Key
     Directory operators to notice when a signature from a locally
     non-available key is being verified for the first time or when
     you intend to encrypt to a mail address without having the key
     locally.  This new behaviour will eventually make key discovery
     much easier and mostly automatic.  Disable this by adding
       no-auto-key-retrieve
       auto-key-locate local
     to your gpg.conf.
 
   * agent: Option --no-grab is now the default.  The new option --grab
     allows to revert this.
 
   * gpg: New import option "show-only".
 
   * gpg: New option --disable-dirmngr to entirely disable network
     access for gpg.
 
   * gpg,gpgsm: Tweaked DE-VS compliance behaviour.
 
   * New configure flag --enable-all-tests to run more extensive tests
     during "make check".
 
   * gpgsm: The keygrip is now always printed in colon mode as
     documented in the man page.
 
   * Fixed connection timeout problem under Windows.
 
   See-also: gnupg-announce/2017q3/000412.html
 
 
 Noteworthy changes in version 2.1.22 (2017-07-28)
 -------------------------------------------------
 
   * gpg: Extend command --quick-set-expire to allow for setting the
     expiration time of subkeys.
 
   * gpg: By default try to repair keys during import.  New sub-option
     no-repair-keys for --import-options.
 
   * gpg,gpgsm: Improved checking and reporting of DE-VS compliance.
 
   * gpg: New options --key-origin and --with-key-origin.  Store the
     time of the last key update from keyservers, WKD, or DANE.
 
   * agent: New option --ssh-fingerprint-digest.
 
   * dimngr: Lower timeouts on keyserver connection attempts and made
     it configurable.
 
   * dirmngr: Tor will now automatically be detected and used.  The
     option --no-use-tor disables Tor detection.
 
   * dirmngr: Now detects a changed /etc/resolv.conf.
 
   * agent,dirmngr: Initiate shutdown on removal of the GnuPG home
     directory.
 
   * gpg: Avoid caching passphrase for failed symmetric encryption.
 
   * agent: Support for unprotected ssh keys.
 
   * dirmngr: Fixed name resolving on systems using only v6
     nameservers.
 
   * dirmngr: Allow the use of TLS over http proxies.
 
   * w32: Change directory of the daemons after startup.
 
   * wks: New man pages for client and server.
 
   * Many other bug fixes.
 
   See-also: gnupg-announce/2017q3/000411.html
 
 
 Noteworthy changes in version 2.1.21 (2017-05-15)
 -------------------------------------------------
 
   * gpg,gpgsm: Fix corruption of old style keyring.gpg files.  This
     bug was introduced with version 2.1.20.  Note that the default
     pubring.kbx format was not affected.
 
   * gpg,dirmngr: Removed the skeleton config file support.  The
     system's standard methods for providing default configuration
     files should be used instead.
 
   * w32: The Windows installer now allows installation of GnuPG
     without Administrator permissions.
 
   * gpg: Fixed import filter property match bug.
 
   * scd: Removed Linux support for Cardman 4040 PCMCIA reader.
 
   * scd: Fixed some corner case bugs in resume/suspend handling.
 
   * Many minor bug fixes and code cleanup.
 
   See-also: gnupg-announce/2017q2/000405.html
 
 
 Noteworthy changes in version 2.1.20 (2017-04-03)
 -------------------------------------------------
 
   * gpg: New properties 'expired', 'revoked', and 'disabled' for the
     import and export filters.
 
   * gpg: New command --quick-set-primary-uid.
 
   * gpg: New compliance field for the --with-colon key listing.
 
   * gpg: Changed the key parser to generalize the processing of local
     meta data packets.
 
   * gpg: Fixed assertion failure in the TOFU trust model.
 
   * gpg: Fixed exporting of zero length user ID packets.
 
   * scd: Improved support for multiple readers.
 
   * scd: Fixed timeout handling for key generation.
 
   * agent: New option --enable-extended-key-format.
 
   * dirmngr: Do not add a keyserver to a new dirmngr.conf.  Dirmngr
     uses a default keyserver.
 
   * dimngr: Do not treat TLS warning alerts as severe error when
     building with GNUTLS.
 
   * dirmngr: Actually take /etc/hosts in account.
 
   * wks: Fixed client problems on Windows.  Published keys are now set
     to world-readable.
 
   * tests: Fixed creation of temporary directories.
 
   * A socket directory for a non standard GNUGHOME is now created on
     the fly under /run/user.  Thus "gpgconf --create-socketdir" is now
     optional.  The use of "gpgconf --remove-socketdir" to clean up
     obsolete socket directories is however recommended to avoid
     cluttering /run/user with useless directories.
 
   * Fixed build problems on some platforms.
 
   See-also: gnupg-announce/2017q2/000404.html
 
 
 Noteworthy changes in version 2.1.19 (2017-03-01)
 -------------------------------------------------
 
   * gpg: Print a warning if Tor mode is requested but the Tor daemon
     is not running.
 
   * gpg: New status code DECRYPTION_KEY to print the actual private
     key used for decryption.
 
   * gpgv: New options --log-file and --debug.
 
   * gpg-agent: Revamp the prompts to ask for card PINs.
 
   * scd: Support for multiple card readers.
 
   * scd: Removed option --debug-disable-ticker.  Ticker is used
     only when it is required to watch removal of device/card.
 
   * scd: Improved detection of card inserting and removal.
 
   * dirmngr: New option --disable-ipv4.
 
   * dirmngr: New option --no-use-tor to explicitly disable the use of
     Tor.
 
   * dirmngr: The option --allow-version-check is now required even if
     the option --use-tor is also used.
 
   * dirmngr: Handle a missing nsswitch.conf gracefully.
 
   * dirmngr: Avoid PTR lookups for keyserver pools.  The are only done
     for the debug command "keyserver --hosttable".
 
   * dirmngr: Rework the internal certificate cache to support classes
     of certificates.  Load system provided certificates on startup.
     Add options --tls, --no-crl, and --systrust to the "VALIDATE"
     command.
 
   * dirmngr: Add support for the ntbtls library.
 
   * wks: Create mails with a "WKS-Phase" header.  Fix detection of
     Draft-2 mode.
 
   * The Windows installer is now build with limited TLS support.
 
   * Many other bug fixes and new regression tests.
 
   See-also: gnupg-announce/2017q1/000402.html
 
 
 Noteworthy changes in version 2.1.18 (2017-01-23)
 -------------------------------------------------
 
   * gpg: Remove bogus subkey signature while cleaning a key (with
     export-clean, import-clean, or --edit-key's sub-command clean)
 
   * gpg: Allow freezing the clock with --faked-system-time.
 
   * gpg: New --export-option flag "backup", new --import-option flag
     "restore".
 
   * gpg-agent: Fixed long delay due to a regression in the progress
     callback code.
 
   * scd: Lots of code cleanup and internal changes.
 
   * scd: Improved the internal CCID driver.
 
   * dirmngr: Fixed problem with the DNS glue code (removal of the
     trailing dot in domain names).
 
   * dirmngr: Make sure that Tor is actually enabled after changing the
     conf file and sending SIGHUP or "gpgconf --reload dirmngr".
 
   * dirmngr: Fixed Tor access to IPv6 addresses.  Note that current
     versions of Tor may require that the flag "IPv6Traffic" is used
     with the option "SocksPort" in torrc to actually allow IPv6
     traffic.
 
   * dirmngr: Fixed HKP for literally given IPv6 addresses.
 
   * dirmngr: Enabled reverse DNS lookups via Tor.
 
   * dirmngr: Added experimental SRV record lookup for WKD.
     See commit 88dc3af3d4ae1afe1d5e136bc4c38bc4e7d4cd10 for details.
 
   * dirmngr: For HKP use "pgpkey-hkps" and "pgpkey-hkp" in SRV record
     lookups.  Avoid SRV record lookup when a port is explicitly
     specified.  This fixes a regression from the 1.4 and 2.0 behavior.
 
   * dirmngr: Gracefully handle a missing /etc/nsswitch.conf.  Ignore
     negation terms (e.g. "[!UNAVAIL=return]" instead of bailing out.
 
   * dirmngr: Better debug output for flags "dns" and "network".
 
   * dirmngr: On reload mark all known HKP servers alive.
 
   * gpgconf: Allow keyword "all" for --launch, --kill, and --reload.
 
   * tools: gpg-wks-client now ignores a missing policy file on the
     server.
 
   * Avoid unnecessary ambiguity error message in the option parsing.
 
   * Further improvements of the regression test suite.
 
   * Fixed building with --disable-libdns configure option.
 
   * Fixed a crash running the tests on 32 bit architectures.
 
   * Fixed spurious failures on BSD system in the spawn functions.
     This affected for example gpg-wks-client and gpgconf.
 
   See-also: gnupg-announce/2017q1/000401.html
 
 
 Noteworthy changes in version 2.1.17 (2016-12-20)
 -------------------------------------------------
 
  * gpg: By default new keys expire after 2 years.
 
  * gpg: New command --quick-set-expire to conveniently change the
    expiration date of keys.
 
  * gpg: Option and command names have been changed for easier
    comprehension.  The old names are still available as aliases.
 
  * gpg: Improved the TOFU trust model.
 
  * gpg: New option --default-new-key-algo.
 
  * scd: Support OpenPGP card V3 for RSA.
 
  * dirmngr: Support for the ADNS library has been removed.  Instead
    William Ahern's Libdns is now source included and used on all
    platforms.  This enables Tor support on all platforms.  The new
    option --standard-resolver can be used to disable this code at
    runtime.  In case of build problems the new configure option
    --disable-libdns can be used to build without Libdns.
 
  * dirmngr: Lazily launch ldap reaper thread.
 
  * tools: New options --check and --status-fd for gpg-wks-client.
 
  * The UTF-8 byte order mark is now skipped when reading conf files.
 
  * Fixed many bugs and regressions.
 
  * Major improvements to the test suite.  For example it is possible
    to run the external test suite of GPGME.
 
  See-also: gnupg-announce/2016q4/000400.html
 
 
 Noteworthy changes in version 2.1.16 (2016-11-18)
 -------------------------------------------------
 
  * gpg: New algorithm for selecting the best ranked public key when
    using a mail address with -r, -R, or --locate-key.
 
  * gpg: New option --with-tofu-info to print a new "tfs" record in
    colon formatted key listings.
 
  * gpg: New option --compliance as an alternative way to specify
    options like --rfc2440, --rfc4880, et al.
 
  * gpg: Many changes to the TOFU implementation.
 
  * gpg: Improve usability of --quick-gen-key.
 
  * gpg: In --verbose mode print a diagnostic when a pinentry is
    launched.
 
  * gpg: Remove code which warns for old versions of gnome-keyring.
 
  * gpg: New option --override-session-key-fd.
 
  * gpg: Option --output does now work with --verify.
 
  * gpgv: New option --output to allow saving the verified data.
 
  * gpgv: New option --enable-special-filenames.
 
  * agent, dirmngr: New --supervised mode for use by systemd and alike.
 
  * agent: By default listen on all available sockets using standard
    names.
 
  * agent: Invoke scdaemon with --homedir.
 
  * dirmngr: On Linux now detects the removal of its own socket and
    terminates.
 
  * scd: Support ECC key generation.
 
  * scd: Support more card readers.
 
  * dirmngr: New option --allow-version-check to download a software
    version database in the background.
 
  * dirmngr: Use system provided CAs if no --hkp-cacert is given.
 
  * dirmngr: Use a default keyserver if none is explicitly set
 
  * gpgconf: New command --query-swdb to check software versions
    against an copy of an online database.
 
  * gpgconf: Print the socket directory with --list-dirs.
 
  * tools: The WKS tools now support draft version -02.
 
  * tools: Always build gpg-wks-client and install under libexec.
 
  * tools: New option --supported for gpg-wks-client.
 
  * The log-file option now accepts a value "socket://" to log to the
    socket named "S.log" in the standard socket directory.
 
  * Provide fake pinentries for use by tests cases of downstream
    developers.
 
  * Fixed many bugs and regressions.
 
  * Many changes and improvements for the test suite.
 
  See-also: gnupg-announce/2016q4/000398.html
 
 
 Noteworthy changes in version 2.1.15 (2016-08-18)
 -------------------------------------------------
 
  * gpg: Remove the --tofu-db-format option and support for the split
    TOFU database.
 
  * gpg: Add option --sender to prepare for coming features.
 
  * gpg: Add option --input-size-hint to help progress indicators.
 
  * gpg: Extend the PROGRESS status line with the counted unit.
 
  * gpg: Avoid publishing the GnuPG version by default with --armor.
 
  * gpg: Properly ignore legacy keys in the keyring cache.
 
  * gpg: Always print fingerprint records in --with-colons mode.
 
  * gpg: Make sure that keygrips are printed for each subkey in
    --with-colons mode.
 
  * gpg: New import filter "drop-sig".
 
  * gpgsm: Fix a bug in the machine-readable key listing.
 
  * gpg,gpgsm: Block signals during keyring updates to limits the
    effects of a Ctrl-C at the wrong time.
 
  * g13: Add command --umount and other fixes for dm-crypt.
 
  * agent: Fix regression in SIGTERM handling.
 
  * agent: Cleanup of the ssh-agent code.
 
  * agent: Allow import of overly long keys.
 
  * scd: Fix problems with card removal.
 
  * dirmngr: Remove all code for running as a system service.
 
  * tools: Make gpg-wks-client conforming to the specs.
 
  * tests: Improve the output of the new regression test tool.
 
  * tests: Distribute the standalone test runner.
 
  * tests: Run each test in a clean environment.
 
  * Spelling and grammar fixes.
 
  See-also: gnupg-announce/2016q3/000396.html
 
 
 Noteworthy changes in version 2.1.14 (2016-07-14)
 -------------------------------------------------
 
  * gpg: Removed options --print-dane-records and --print-pka-records.
    The new export options "export-pka" and "export-dane" can instead
    be used with the export command.
 
  * gpg: New options --import-filter and --export-filter.
 
  * gpg: New import options "import-show" and "import-export".
 
  * gpg: New option --no-keyring.
 
  * gpg: New command --quick-revuid.
 
  * gpg: New options -f/--recipient-file and -F/--hidden-recipient-file
    to directly specify encryption keys.
 
  * gpg: New option --mimemode to indicate that the content is a MIME
    part.  Does only enable --textmode right now.
 
  * gpg: New option --rfc4880bis to allow experiments with proposed
    changes to the current OpenPGP specs.
 
  * gpg: Fix regression in the "fetch" sub-command of --card-edit.
 
  * gpg: Fix regression since 2.1 in option --try-all-secrets.
 
  * gpgv: Change default options for extra security.
 
  * gpgsm: No more root certificates are installed by default.
 
  * agent: "updatestartuptty" does now affect more environment
    variables.
 
  * scd: The option --homedir does now work with scdaemon.
 
  * scd: Support some more GEMPlus card readers.
 
  * gpgtar: Fix handling of '-' as file name.
 
  * gpgtar: New commands --create and --extract.
 
  * gpgconf: Tweak for --list-dirs to better support shell scripts.
 
  * tools: Add programs gpg-wks-client and gpg-wks-server to implement
    a Web Key Service.  The configure option --enable-wks-tools is
    required to build them; they should be considered Beta software.
 
  * tests: Complete rework of the openpgp part of the test suite.  The
    test scripts have been changed from Bourne shell scripts to Scheme
    programs.  A customized scheme interpreter (gpgscm) is included.
    This change was triggered by the need to run the test suite on
    non-Unix platforms.
 
  * The rendering of the man pages has been improved.
 
  See-also: gnupg-announce/2016q3/000393.html
 
 
 Noteworthy changes in version 2.1.13 (2016-06-16)
 -------------------------------------------------
 
  * gpg: New command --quick-addkey.  Extend the --quick-gen-key
    command.
 
  * gpg: New --keyid-format "none" which is now also the default.
 
  * gpg: New option --with-subkey-fingerprint.
 
  * gpg: Include Signer's UID subpacket in signatures if the secret key
    has been specified using a mail address and the new option
    --disable-signer-uid is not used.
 
  * gpg: Allow unattended deletion of a secret key.
 
  * gpg: Allow export of non-passphrase protected secret keys.
 
  * gpg: New status lines KEY_CONSIDERED and NOTATION_FLAGS.
 
  * gpg: Change status line TOFU_STATS_LONG to use '~' as
    a non-breaking-space character.
 
  * gpg: Speedup key listings in Tofu mode.
 
  * gpg: Make sure that the current and total values of a PROGRESS
    status line are small enough.
 
  * gpgsm: Allow the use of AES192 and SERPENT ciphers.
 
  * dirmngr: Adjust WKD lookup to current specs.
 
  * dirmngr: Fallback to LDAP v3 if v2 is is not supported.
 
  * gpgconf: New commands --create-socketdir and --remove-socketdir,
    new option --homedir.
 
  * If a /run/user/$UID directory exists, that directory is now used
    for IPC sockets instead of the GNUPGHOME directory.  This fixes
    problems with NFS and too long socket names and thus avoids the
    need for redirection files.
 
  * The Speedo build systems now uses the new versions.gnupg.org server
    to retrieve the default package versions.
 
  * Fix detection of libusb on FreeBSD.
 
  * Speedup fd closing after a fork.
 
  See-also: gnupg-announce/2016q2/000390.html
 
 
 Noteworthy changes in version 2.1.12 (2016-05-04)
 -------------------------------------------------
 
  * gpg: New --edit-key sub-command "change-usage" for testing
    purposes.
 
  * gpg: Out of order key-signatures are now systematically detected
    and fixed by --edit-key.
 
  * gpg: Improved detection of non-armored messages.
 
  * gpg: Removed the extra prompt needed to create Curve25519 keys.
 
  * gpg: Improved user ID selection for --quick-sign-key.
 
  * gpg: Use the root CAs provided by the system with --fetch-key.
 
  * gpg: Add support for the experimental Web Key Directory key
    location service.
 
  * gpg: Improve formatting of Tofu messages and emit new Tofu specific
    status lines.
 
  * gpgsm: Add option --pinentry-mode to support a loopback pinentry.
 
  * gpgsm: A new pubring.kbx is now created with the header blob so
    that gpg can detect that the keybox format needs to be used.
 
  * agent: Add read support for the new private key protection format
    openpgp-s2k-ocb-aes.
 
  * agent: Add read support for the new extended private key format.
 
  * agent: Default to --allow-loopback-pinentry and add option
    --no-allow-loopback-pinentry.
 
  * scd: Changed to use the new libusb 1.0 API for the internal CCID
    driver.
 
  * dirmngr: The dirmngr-client does now auto-detect the PEM format.
 
  * g13: Add experimental support for dm-crypt.
 
  * w32: Tofu support is now available with the Speedo build method.
 
  * w32: Removed the need for libiconv.dll.
 
  * The man pages for gpg and gpgv are now installed under the correct
    name (gpg2 or gpg - depending on a configure option).
 
  * Lots of internal cleanups and bug fixes.
 
  See-also: gnupg-announce/2016q2/000387.html
 
 
 Noteworthy changes in version 2.1.11 (2016-01-26)
 -------------------------------------------------
 
  * gpg: New command --export-ssh-key to replace the gpgkey2ssh tool.
 
  * gpg: Allow to generate mail address only keys with --gen-key.
 
  * gpg: "--list-options show-usage" is now the default.
 
  * gpg: Make lookup of DNS CERT records holding an URL work.
 
  * gpg: Emit PROGRESS status lines during key generation.
 
  * gpg: Don't check for ambiguous or non-matching key specification in
    the config file or given to --encrypt-to.  This feature will return
    in 2.3.x.
 
  * gpg: Lock keybox files while updating them.
 
  * gpg: Solve rare error on Windows during keyring and Keybox updates.
 
  * gpg: Fix possible keyring corruption. (bug#2193)
 
  * gpg: Fix regression of "bkuptocard" sub-command in --edit-key and
    remove "checkbkupkey" sub-command introduced with 2.1.  (bug#2169)
 
  * gpg: Fix internal error in gpgv when using default keyid-format.
 
  * gpg: Fix --auto-key-retrieve to work with dirmngr.conf configured
    keyservers. (bug#2147).
 
  * agent: New option --pinentry-timeout.
 
  * scd: Improve unplugging of USB readers under Windows.
 
  * scd: Fix regression for generating RSA keys on card.
 
  * dirmmgr: All configured keyservers are now searched.
 
  * dirmngr: Install CA certificate for hkps.pool.sks-keyservers.net.
    Use this certificate even if --hkp-cacert is not used.
 
  * gpgtar: Add actual encryption code.  gpgtar does now fully replace
    gpg-zip.
 
  * gpgtar: Fix filename encoding problem on Windows.
 
  * Print a warning if a GnuPG component is using an older version of
    gpg-agent, dirmngr, or scdaemon.
 
  See-also: gnupg-announce/2016q1/000383.html
 
 
 Noteworthy changes in version 2.1.10 (2015-12-04)
 -------------------------------------------------
 
  * gpg: New trust models "tofu" and "tofu+pgp".
 
  * gpg: New command --tofu-policy.  New options --tofu-default-policy
    and --tofu-db-format.
 
  * gpg: New option --weak-digest to specify hash algorithms which
    should be considered weak.
 
  * gpg: Allow the use of multiple --default-key options; take the last
    available key.
 
  * gpg: New option --encrypt-to-default-key.
 
  * gpg: New option --unwrap to only strip the encryption layer.
 
  * gpg: New option --only-sign-text-ids to exclude photo IDs from key
    signing.
 
  * gpg: Check for ambiguous or non-matching key specification in the
    config file or given to --encrypt-to.
 
  * gpg: Show the used card reader with --card-status.
 
  * gpg: Print export statistics and an EXPORTED status line.
 
  * gpg: Allow selecting subkeys by keyid in --edit-key.
 
  * gpg: Allow updating the expiration time of multiple subkeys at
    once.
 
  * dirmngr: New option --use-tor.  For full support this requires
    libassuan version 2.4.2 and a patched version of libadns
    (e.g. adns-1.4-g10-7 as used by the standard Windows installer).
 
  * dirmngr: New option --nameserver to specify the nameserver used in
    Tor mode.
 
  * dirmngr: Keyservers may again be specified by IP address.
 
  * dirmngr: Fixed problems in resolving keyserver pools.
 
  * dirmngr: Fixed handling of premature termination of TLS streams so
    that large numbers of keys can be refreshed via hkps.
 
  * gpg: Fixed a regression in --locate-key [since 2.1.9].
 
  * gpg: Fixed another bug for keyrings with legacy keys.
 
  * gpgsm: Allow combinations of usage flags in --gen-key.
 
  * Make tilde expansion work with most options.
 
  * Many other cleanups and bug fixes.
 
  See-also: gnupg-announce/2015q4/000381.html
 
 
 Noteworthy changes in version 2.1.9 (2015-10-09)
 ------------------------------------------------
 
  * gpg: Allow fetching keys via OpenPGP DANE (--auto-key-locate).  New
    option --print-dane-records.  [Update: --print-dane-records replaced
    in 2.1.4.]
 
  * gpg: Fix for a problem with PGP-2 keys in a keyring.
 
  * gpg: Fail with an error instead of a warning if a modern cipher
    algorithm is used without a MDC.
 
  * agent: New option --pinentry-invisible-char.
 
  * agent: Always do a RSA signature verification after creation.
 
  * agent: Fix a regression in ssh-add-ing Ed25519 keys.
 
  * agent: Fix ssh fingerprint computation for nistp384 and EdDSA.
 
  * agent: Fix crash during passphrase entry on some platforms.
 
  * scd: Change timeout to fix problems with some 2.1 cards.
 
  * dirmngr: Displayed name is now Key Acquirer.
 
  * dirmngr: Add option --keyserver.  Deprecate that option for gpg.
    Install a dirmngr.conf file from a skeleton for new installations.
 
  See-also: gnupg-announce/2015q4/000380.html
 
 
 Noteworthy changes in version 2.1.8 (2015-09-10)
 ------------------------------------------------
 
  * gpg: Sending very large keys to the keyservers works again.
 
  * gpg: Validity strings in key listings are now again translatable.
 
  * gpg: Emit FAILURE status lines to help GPGME.
 
  * gpg: Does not anymore link to Libksba to reduce dependencies.
 
  * gpgsm: Export of secret keys via Assuan is now possible.
 
  * agent: Raise the maximum passphrase length from 100 to 255 bytes.
 
  * agent: Fix regression using EdDSA keys with ssh.
 
  * Does not anymore use a build timestamp by default.
 
  * The fallback encoding for broken locale settings changed
    from Latin-1 to UTF-8.
 
  * Many code cleanups and improved internal documentation.
 
  * Various minor bug fixes.
 
  See-also: gnupg-announce/2015q3/000379.html
 
 
 Noteworthy changes in version 2.1.7 (2015-08-11)
 ------------------------------------------------
 
  * gpg: Support encryption with Curve25519 if Libgcrypt 1.7 is used.
 
  * gpg: In the --edit-key menu: Removed the need for "toggle", changed
    how secret keys are indicated, new commands "fpr *" and "grip".
 
  * gpg: More fixes related to legacy keys in a keyring.
 
  * gpgv: Does now also work with a "trustedkeys.kbx" file.
 
  * scd: Support some feature from the OpenPGP card 3.0 specs.
 
  * scd: Improved ECC support
 
  * agent: New option --force for the DELETE_KEY command.
 
  * w32: Look for the Pinentry at more places.
 
  * Dropped deprecated gpgsm-gencert.sh
 
  * Various other bug fixes.
 
  See-also: gnupg-announce/2015q3/000371.html
 
 
 Noteworthy changes in version 2.1.6 (2015-07-01)
 ------------------------------------------------
 
  * agent: New option --verify for the PASSWD command.
 
  * gpgsm: Add command option "offline" as an alternative to
    --disable-dirmngr.
 
  * gpg: Do not prompt multiple times for a password in pinentry
    loopback mode.
 
  * Allow the use of debug category names with --debug.
 
  * Using gpg-agent and gpg/gpgsm with different locales will now show
    the correct translations in Pinentry.
 
  * gpg: Improve speed of --list-sigs and --check-sigs.
 
  * gpg: Make --list-options show-sig-subpackets work again.
 
  * gpg: Fix an export problem for old keyrings with PGP-2 keys.
 
  * scd: Support PIN-pads on more readers.
 
  * dirmngr: Properly cleanup zombie LDAP helper processes and avoid
    hangs on dirmngr shutdown.
 
  * Various other bug fixes.
 
  See-also: gnupg-announce/2015q3/000370.html
 
 
 Noteworthy changes in version 2.1.5 (2015-06-11)
 ------------------------------------------------
 
  * Support for an external passphrase cache.
 
  * Support for the forthcoming version 3 OpenPGP smartcard.
 
  * Manuals now show the actual used file names.
 
  * Prepared for improved integration with Emacs.
 
  * Code cleanups and minor bug fixes.
 
  See-also: gnupg-announce/2015q2/000369.html
 
 
 Noteworthy changes in version 2.1.4 (2015-05-12)
 ------------------------------------------------
 
  * gpg: Add command --quick-adduid to non-interactively add a new user
    id to an existing key.
 
  * gpg: Do no enable honor-keyserver-url by default.  Make it work if
    enabled.
 
  * gpg: Display the serial number in the --card-status output again.
 
  * agent: Support for external password managers.
    Add option --no-allow-external-cache.
 
  * scdaemon: Improved handling of extended APDUs.
 
  * Make HTTP proxies work again.
 
  * All network access including DNS as been moved to Dirmngr.
 
  * Allow building without LDAP support.
 
  * Fixed lots of smaller bugs.
 
  See-also: gnupg-announce/2015q2/000366.html
 
 
 Noteworthy changes in version 2.1.3 (2015-04-11)
 ------------------------------------------------
 
  * gpg: LDAP keyservers are now supported by 2.1.
 
  * gpg: New option --with-icao-spelling.
 
  * gpg: New option --print-pka-records.  Changed the PKA method to use
    CERT records and hashed names.  [Update: --print-pka-records
    replaced in 2.1.14.]
 
  * gpg: New command --list-gcrypt-config.  New parameter "curve"
    for --list-config.
 
  * gpg: Print a NEWSIG status line like gpgsm always did.
 
  * gpg: Print MPI values with --list-packets and --verbose.
 
  * gpg: Write correct MPI lengths with ECC keys.
 
  * gpg: Skip legacy PGP-2 keys while searching.
 
  * gpg: Improved searching for mail addresses when using a keybox.
 
  * gpgsm: Changed default algos to AES-128 and SHA-256.
 
  * gpgtar: Fixed extracting files with sizes of a multiple of 512.
 
  * dirmngr: Fixed SNI handling for hkps pools.
 
  * dirmngr: extra-certs and trusted-certs are now always loaded from
    the sysconfig dir instead of the homedir.
 
  * Fixed possible problems due to compiler optimization, two minor
    regressions, and other bugs.
 
  See-also: gnupg-announce/2015q2/000365.html
 
 
 Noteworthy changes in version 2.1.2 (2015-02-11)
 ------------------------------------------------
 
  * gpg: The parameter 'Passphrase' for batch key generation works
    again.
 
  * gpg: Using a passphrase option in batch mode now has the expected
    effect on --quick-gen-key.
 
  * gpg: Improved reporting of unsupported PGP-2 keys.
 
  * gpg: Added support for algo names when generating keys using
    --command-fd.
 
  * gpg: Fixed DoS based on bogus and overlong key packets.
 
  * agent: When setting --default-cache-ttl the value
    for --max-cache-ttl is adjusted to be not lower than the former.
 
  * agent: Fixed problems with the new --extra-socket.
 
  * agent: Made --allow-loopback-pinentry changeable with gpgconf.
 
  * agent: Fixed importing of unprotected openpgp keys.
 
  * agent: Now tries to use a fallback pinentry if the standard
    pinentry is not installed.
 
  * scd: Added support for ECDH.
 
  * Fixed several bugs related to bogus keyrings and improved some
    other code.
 
  See-also: gnupg-announce/2015q1/000361.html
 
 
 Noteworthy changes in version 2.1.1 (2014-12-16)
 ------------------------------------------------
 
  * gpg: Detect faulty use of --verify on detached signatures.
 
  * gpg: New import option "keep-ownertrust".
 
  * gpg: New sub-command "factory-reset" for --card-edit.
 
  * gpg: A stub key for smartcards is now created by --card-status.
 
  * gpg: Fixed regression in --refresh-keys.
 
  * gpg: Fixed regression in %g and %p codes for --sig-notation.
 
  * gpg: Fixed best matching hash algo detection for ECDSA and EdDSA.
 
  * gpg: Improved perceived speed of secret key listisngs.
 
  * gpg: Print number of skipped PGP-2 keys on import.
 
  * gpg: Removed the option aliases --throw-keyid and --notation-data;
    use --throw-keyids and --set-notation instead.
 
  * gpg: New import option "keep-ownertrust".
 
  * gpg: Skip too large keys during import.
 
  * gpg,gpgsm: New option --no-autostart to avoid starting gpg-agent or
    dirmngr.
 
  * gpg-agent: New option --extra-socket to provide a restricted
    command set for use with remote clients.
 
  * gpgconf --kill does not anymore start a service only to kill it.
 
  * gpg-pconnect-agent: Add convenience option --uiserver.
 
  * Fixed keyserver access for Windows.
 
  * Fixed build problems on Mac OS X
 
  * The Windows installer does now install development files
 
  * More translations (but most of them are not complete).
 
  * To support remotely mounted home directories, the IPC sockets may
    now be redirected.  This feature requires Libassuan 2.2.0.
 
  * Improved portability and the usual bunch of bug fixes.
 
  See-also: gnupg-announce/2014q4/000360.html
 
 
 Noteworthy changes in version 2.1.0 (2014-11-06)
 ------------------------------------------------
 
  This release introduces a lot of changes.  Most of them are internal
  and thus not user visible.  However, some long standing behavior has
  slightly changed and it is strongly suggested that an existing
  "~/.gnupg" directory is backed up before this version is used.
 
  A verbose description of the major new features and changes can be
  found in the file doc/whats-new-in-2.1.txt.
 
  * gpg: All support for v3 (PGP 2) keys has been dropped.  All
    signatures are now created as v4 signatures.  v3 keys will be
    removed from the keyring.
 
  * gpg: With pinentry-0.9.0 the passphrase "enter again" prompt shows
    up in the same window as the "new passphrase" prompt.
 
  * gpg: Allow importing keys with duplicated long key ids.
 
  * dirmngr: May now be build without support for LDAP.
 
  * For a complete list of changes see the lists of changes for the
    2.1.0 beta versions below.  Note that all relevant fixes from
    versions 2.0.14 to 2.0.26 are also applied to this version.
 
 
  [Noteworthy changes in version 2.1.0-beta864 (2014-10-03)]
 
  * gpg: Removed the GPG_AGENT_INFO related code.  GnuPG does now
    always use a fixed socket name in its home directory.
 
  * gpg: Renamed --gen-key to --full-gen-key and re-added a --gen-key
    command with less choices.
 
  * gpg: Use SHA-256 for all signature types also on RSA keys.
 
  * gpg: Default keyring is now created with a .kbx suffix.
 
  * gpg: Add a shortcut to the key capabilities menu (e.g. "=e" sets the
    encryption capabilities).
 
  * gpg: Fixed obsolete options parsing.
 
  * Further improvements for the alternative speedo build system.
 
 
  [Noteworthy changes in version 2.1.0-beta834 (2014-09-18)]
 
  * gpg: Improved passphrase caching.
 
  * gpg: Switched to algorithm number 22 for EdDSA.
 
  * gpg: Removed CAST5 from the default preferences.
 
  * gpg: Order SHA-1 last in the hash preferences.
 
  * gpg: Changed default cipher for --symmetric to AES-128.
 
  * gpg: Fixed export of ECC keys and import of EdDSA keys.
 
  * dirmngr: Fixed the KS_FETCH command.
 
  * The speedo build system now downloads related packages and works
    for non-Windows platforms.
 
 
  [Noteworthy changes in version 2.1.0-beta783 (2014-08-14)]
 
  * gpg: Add command --quick-gen-key.
 
  * gpg: Make --quick-sign-key promote local key signatures.
 
  * gpg: Added "show-usage" sub-option to --list-options.
 
  * gpg: Screen keyserver responses to avoid importing unwanted keys
    from rogue servers.
 
  * gpg: Removed the option --pgp2 and --rfc1991 and the ability to
    create PGP-2 compatible messages.
 
  * gpg: Removed options --compress-keys and --compress-sigs.
 
  * gpg: Cap attribute packets at 16MB.
 
  * gpg: Improved output of --list-packets.
 
  * gpg: Make with-colons output of --search-keys work again.
 
  * gpgsm: Auto-create the ".gnupg" directory like gpg does.
 
  * agent: Fold new passphrase warning prompts into one.
 
  * scdaemon: Add support for the Smartcard-HSM card.
 
  * scdaemon: Remove the use of the pcsc-wrapper.
 
 
  [Noteworthy changes in version 2.1.0-beta751 (2014-07-03)]
 
  * gpg: Create revocation certificates during key generation.
 
  * gpg: Create exported secret keys and revocation certifciates with
    mode 0700
 
  * gpg: The validity of user ids is now shown by default.  To revert
    this add "list-options no-show-uid-validity" to gpg.conf.
 
  * gpg: Make export of secret keys work again.
 
  * gpg: The output of --list-packets does now print the offset of the
    packet and information about the packet header.
 
  * gpg: Avoid DoS due to garbled compressed data packets. [CVE-2014-4617]
 
  * gpg: Print more specific reason codes with the INV_RECP status.
 
  * gpg: Cap RSA and Elgamal keysize at 4096 bit also for unattended
    key generation.
 
  * scdaemon: Support reader Gemalto IDBridge CT30 and pinpad of SCT
    cyberJack go.
 
  * The speedo build system has been improved.  It is now also possible
    to build a partly working installer for Windows.
 
 
  [Noteworthy changes in version 2.1.0-beta442 (2014-06-05)]
 
  * gpg: Changed the format of key listings.  To revert to the old
    format the option --legacy-list-mode is available.
 
  * gpg: Add experimental signature support using curve Ed25519 and
    with a patched Libgcrypt also encryption support with Curve25519.
    [Update: this encryption support has been removed from 2.1.0 until
    we have agreed on a suitable format.]
 
  * gpg: Allow use of Brainpool curves.
 
  * gpg: Accepts a space separated fingerprint as user ID.  This
    allows to copy and paste the fingerprint from the key listing.
 
  * gpg: The hash algorithm is now printed for signature records in key
    listings.
 
  * gpg: Reject signatures made using the MD5 hash algorithm unless the
    new option --allow-weak-digest-algos or --pgp2 are given.
 
  * gpg: Print a warning if the Gnome-Keyring-Daemon intercepts the
    communication with the gpg-agent.
 
  * gpg: New option --pinentry-mode.
 
  * gpg: Fixed decryption using an OpenPGP card.
 
  * gpg: Fixed bug with deeply nested compressed packets.
 
  * gpg: Only the major version number is by default included in the
    armored output.
 
  * gpg: Do not create a trustdb file if --trust-model=always is used.
 
  * gpg: Protect against rogue keyservers sending secret keys.
 
  * gpg: The format of the fallback key listing ("gpg KEYFILE") is now
    more aligned to the regular key listing ("gpg -k").
 
  * gpg: The option--show-session-key prints its output now before the
    decryption of the bulk message starts.
 
  * gpg: New %U expando for the photo viewer.
 
  * gpg,gpgsm: New option --with-secret.
 
  * gpgsm: By default the users are now asked via the Pinentry whether
    they trust an X.509 root key.  To prohibit interactive marking of
    such keys, the new option --no-allow-mark-trusted may be used.
 
  * gpgsm: New commands to export a secret RSA key in PKCS#1 or PKCS#8
    format.
 
  * gpgsm: Improved handling of re-issued CA certificates.
 
  * agent: The included ssh agent does now support ECDSA keys.
 
  * agent: New option --enable-putty-support to allow gpg-agent on
    Windows to act as a Pageant replacement with full smartcard support.
 
  * scdaemon: New option --enable-pinpad-varlen.
 
  * scdaemon: Various fixes for pinpad equipped card readers.
 
  * scdaemon: Rename option --disable-pinpad (was --disable-keypad).
 
  * scdaemon: Better support for CCID readers.  Now, internal CCID
    driver supports readers with no auto configuration feature.
 
  * dirmngr: Removed support for the original HKP keyserver which is
    not anymore used by any site.
 
  * dirmngr: Improved support for keyserver pools.
 
  * tools: New option --dirmngr for gpg-connect-agent.
 
  * The GNU Pth library has been replaced by the new nPth library.
 
  * Support installation as portable application under Windows.
 
  * All kind of other improvements - see the git log.
 
 
  [Noteworthy changes in version 2.1.0beta3 (2011-12-20)]
 
  * gpg: Fixed regression in the secret key export function.
 
  * gpg: Allow generation of card keys up to 4096 bit.
 
  * gpgsm: Preliminary support for the validation model "steed".
 
  * gpgsm: Improved certificate creation.
 
  * agent: Support the SSH confirm flag.
 
  * agent: New option to select a passphrase mode.  The loopback
    mode may be used to bypass Pinentry.
 
  * agent: The Assuan commands KILLAGENT and KILLSCD are working again.
 
  * scdaemon: Does not anymore block after changing a card (regression
    fix).
 
  * tools: gpg-connect-agent does now properly display the help output
    for "SCD HELP" commands.
 
 
  [Noteworthy changes in version 2.1.0beta2 (2011-03-08)]
 
  * gpg: ECC support as described by draft-jivsov-openpgp-ecc-06.txt
    [Update: now known as RFC-6637].
 
  * gpg: Print "AES128" instead of "AES".  This change introduces a
    little incompatibility for tools using "gpg --list-config".  We
    hope that these tools are written robust enough to accept this new
    algorithm name as well.
 
  * gpgsm: New feature to create certificates from a parameter file.
    Add prompt to the --gen-key UI to create self-signed certificates.
 
  * agent: TMPDIR is now also honored when creating a socket using
    the --no-standard-socket option and with symcryptrun's temp files.
 
  * scdaemon: Fixed a bug where scdaemon sends a signal to gpg-agent
    running in non-daemon mode.
 
  * dirmngr: Fixed CRL loading under W32 (bug#1010).
 
  * Dirmngr has taken over the function of the keyserver helpers.  Thus
    we now have a specified direct interface to keyservers via Dirmngr.
    LDAP, DNS and mail backends are not yet implemented.
 
  * Fixed TTY management for pinentries and session variable update
    problem.
 
 
  [Noteworthy changes in version 2.1.0beta1 (2010-10-26)]
 
  * gpg: secring.gpg is not anymore used but all secret key operations
    are delegated to gpg-agent.  The import command moves secret keys
    to the agent.
 
  * gpg: The OpenPGP import command is now able to merge secret keys.
 
  * gpg: Encrypted OpenPGP messages with trailing data (e.g. other
    OpenPGP packets) are now correctly parsed.
 
  * gpg: Given sufficient permissions Dirmngr is started automagically.
 
  * gpg: Fixed output of "gpgconf --check-options".
 
  * gpg: Removed options --export-options(export-secret-subkey-passwd)
    and --simple-sk-checksum.
 
  * gpg: New options --try-secret-key.
 
  * gpg: Support DNS lookups for SRV, PKA and CERT on W32.
 
  * gpgsm: The --audit-log feature is now more complete.
 
  * gpgsm: The default for --include-cert is now to include all
    certificates in the chain except for the root certificate.
 
  * gpgsm: New option --ignore-cert-extension.
 
  * g13: The G13 tool for disk encryption key management has been
    added.
 
  * agent: If the agent's --use-standard-socket option is active, all
    tools try to start and daemonize the agent on the fly.  In the past
    this was only supported on W32; on non-W32 systems the new
    configure option --disable-standard-socket may now be used to
    disable this new default.
 
  * agent: New and changed passphrases are now created with an
    iteration count requiring about 100ms of CPU work.
 
  * dirmngr: Dirmngr is now a part of this package.  It is now also
    expected to run as a system service and the configuration
    directories are changed to the GnuPG name space. [Update: 2.1.0
    starts dirmngr on demand as user daemon.]
 
  * Support for Windows CE. [Update: This has not been tested for the
    2.1.0 release]
 
  * Numerical values may now be used as an alternative to the
    debug-level keywords.
 
  See-also: gnupg-announce/2014q4/000358.html
 
 
 Version 2.0.28 (2015-06-02)
 Version 2.0.27 (2015-02-18)
 Version 2.0.26 (2014-08-12)
 Version 2.0.25 (2014-06-30)
 Version 2.0.24 (2014-06-24)
 Version 2.0.23 (2014-06-03)
 Version 2.0.22 (2013-10-04)
 Version 2.0.21 (2013-08-19)
 Version 2.0.20 (2013-05-10)
 Version 2.0.19 (2012-03-27)
 Version 2.0.18 (2011-08-04)
 Version 2.0.17 (2011-01-13)
 Version 2.0.16 (2010-07-19)
 Version 2.0.15 (2010-03-09)
 Version 2.0.14 (2009-12-21)
 
 
 Noteworthy changes in version 2.0.13 (2009-09-04)
 -------------------------------------------------
 
  * GPG now generates 2048 bit RSA keys by default.  The default hash
    algorithm preferences has changed to prefer SHA-256 over SHA-1.
    2048 bit DSA keys are now generated to use a 256 bit hash algorithm
 
  * The envvars XMODIFIERS, GTK_IM_MODULE and QT_IM_MODULE are now
    passed to the Pinentry to make SCIM work.
 
  * The GPGSM command --gen-key features a --batch mode and implements
    all features of gpgsm-gencert.sh in standard mode.
 
  * New option --re-import for GPGSM's IMPORT server command.
 
  * Enhanced writing of existing keys to OpenPGP v2 cards.
 
  * Add hack to the internal CCID driver to allow the use of some
    Omnikey based card readers with 2048 bit keys.
 
  * GPG now repeatedly asks the user to insert the requested OpenPGP
    card.  This can be disabled with --limit-card-insert-tries=1.
 
  * Minor bug fixes.
 
  See-also: gnupg-announce/2009q3/000294.html
 
 
 Noteworthy changes in version 2.0.12 (2009-06-17)
 -------------------------------------------------
 
  * GPGSM now always lists ephemeral certificates if specified by
    fingerprint or keygrip.
 
  * New command "KEYINFO" for GPG_AGENT.  GPGSM now also returns
    information about smartcards.
 
  * Made sure not to leak file descriptors if running gpg-agent with a
    command.  Restore the signal mask to solve a problem in Mono.
 
  * Changed order of the confirmation questions for root certificates
    and store negative answers in trustlist.txt.
 
  * Better synchronization of concurrent smartcard sessions.
 
  * Support 2048 bit OpenPGP cards.
 
  * Support Telesec Netkey 3 cards.
 
  * The gpg-protect-tool now uses gpg-agent via libassuan.  Under
    Windows the Pinentry will now be put into the foreground.
 
  * Changed code to avoid a possible Mac OS X system freeze.
 
  See-also: gnupg-announce/2009q2/000288.html
 
 
 Noteworthy changes in version 2.0.11 (2009-03-03)
 -------------------------------------------------
 
  * Fixed a problem in SCDAEMON which caused unexpected card resets.
 
  * SCDAEMON is now aware of the Geldkarte.
 
  * The SCDAEMON option --allow-admin is now used by default.
 
  * GPGCONF now restarts SCdaemon if necessary.
 
  * The default cipher algorithm in GPGSM is now again 3DES.  This is
    due to interoperability problems with Outlook 2003 which still
    can't cope with AES.
 
  See-also: gnupg-announce/2009q1/000287.html
 
 
 Noteworthy changes in version 2.0.10 (2009-01-12)
 -------------------------------------------------
 
  * [gpg] New keyserver helper gpg2keys_kdns as generic DNS CERT
    lookup.  Run with --help for a short description.  Requires the
    ADNS library.
 
  * [gpg] New mechanisms "local" and "nodefault" for --auto-key-locate.
    Fixed a few problems with this option.
 
  * [gpg] New command --locate-keys.
 
  * [gpg] New options --with-sig-list and --with-sig-check.
 
  * [gpg] The option "-sat" is no longer an alias for --clearsign.
 
  * [gpg] The option --fixed-list-mode is now implicitly used and obsolete.
 
  * [gpg] New control statement %ask-passphrase for the unattended key
    generation.
 
  * [gpg] The algorithm to compute the SIG_ID status has been changed.
 
  * [gpgsm] Now uses AES by default.
 
  * [gpgsm] Made --output option work with --export-secret-key-p12.
 
  * [gpg-agent] Terminate process if the own listening socket is not
    anymore served by ourself.
 
  * [scdaemon] Made it more robust on W32.
 
  * [gpg-connect-agent] Accept commands given as command line arguments.
 
  * [w32] Initialized the socket subsystem for all keyserver helpers.
 
  * [w32] The sysconf directory has been moved from a subdirectory of
    the installation directory to %CSIDL_COMMON_APPDATA%/GNU/etc/gnupg.
 
  * [w32] The gnupg2.nls directory is not anymore used.  The standard
    locale directory is now used.
 
  * [w32] Fixed a race condition between gpg and gpgsm in the use of
    temporary file names.
 
  * The gpg-preset-passphrase mechanism works again.  An arbitrary
    string may now be used for a custom cache ID.
 
  * Admin PINs are cached again (bug in 2.0.9).
 
  * Support for version 2 OpenPGP cards.
 
  * Libgcrypt 1.4 is now required.
 
  See-also: gnupg-announce/2009q1/000284.html
 
 
 Noteworthy changes in version 2.0.9 (2008-03-26)
 ------------------------------------------------
 
  * Gpgsm always tries to locate missing certificates from a running
    Dirmngr's cache.
 
  * Tweaks for Windows.
 
  * The Admin PIN for OpenPGP cards may now be entered with the pinpad.
 
  * Improved certificate chain construction.
 
  * Extended the PKITS framework.
 
  * Fixed a bug in the ambiguous name detection.
 
  * Fixed possible memory corruption while importing OpenPGP keys (bug
    introduced with 2.0.8). [CVE-2008-1530]
 
  * Minor bug fixes.
 
 
 
 Noteworthy changes in version 2.0.8 (2007-12-20)
 ------------------------------------------------
 
  * Enhanced gpg-connect-agent with a small scripting language.
 
  * New option --list-config for gpgconf.
 
  * Fixed a crash in gpgconf.
 
  * Gpg-agent now supports the passphrase quality bar of the latest
    Pinentry.
 
  * The envvars XAUTHORITY and PINENTRY_USER_DATA are now passed to the
    Pinentry.
 
  * Fixed the auto creation of the key stub for smartcards.
 
  * Fixed a rare bug in decryption using the OpenPGP card.
 
  * Creating DSA2 keys is now possible.
 
  * New option --extra-digest-algo for gpgsm to allow verification of
    broken signatures.
 
  * Allow encryption with legacy Elgamal sign+encrypt keys with option
    --rfc2440.
 
  * Windows is now a supported platform.
 
  * Made sure that under Windows the file permissions of the socket are
    taken into account.  This required a change of our socket emulation
    code and changed the IPC protocol under Windows.
 
  See-also: gnupg-announce/2007q4/000267.html
 
 
 Noteworthy changes in version 2.0.7 (2007-09-10)
 ------------------------------------------------
 
  * Fixed encryption problem if duplicate certificates are in the
    keybox.
 
  * Made it work on Windows Vista.  Note that the entire Windows port
    is still considered Beta.
 
  * Add new options min-passphrase-nonalpha, check-passphrase-pattern,
    enforce-passphrase-constraints and max-passphrase-days to
    gpg-agent.
 
  * Add command --check-components to gpgconf.  Gpgconf now uses the
    installed versions of the programs and does not anymore search via
    PATH for them.
 
  See-also: gnupg-announce/2007q3/000259.html
 
 
 Noteworthy changes in version 2.0.6 (2007-08-16)
 ------------------------------------------------
 
  * GPGSM does now grok --default-key.
 
  * GPGCONF is now aware of --default-key and --encrypt-to.
 
  * GPGSM does again correctly print the serial number as well the the
    various keyids.  This was broken since 2.0.4.
 
  * New option --validation-model and support for the chain-model.
 
  * Improved Windows support.
 
  See-also: gnupg-announce/2007q3/000258.html
 
 
 Noteworthy changes in version 2.0.5 (2007-07-05)
 ------------------------------------------------
 
  * Switched license to GPLv3.
 
  * Basic support for Windows.  Run "./autogen.sh --build-w32" to build
    it.  As usual the mingw cross compiling toolchain is required.
 
  * Fixed bug when using the --p12-charset without --armor.
 
  * The command --gen-key may now be used instead of the
    gpgsm-gencert.sh script.
 
  * Changed key generation to reveal less information about the
    machine.  Bug fixes for gpg2's card key generation.
 
  See-also: gnupg-announce/2007q3/000255.html
 
 
 Noteworthy changes in version 2.0.4 (2007-05-09)
 ------------------------------------------------
 
  * The server mode key listing commands are now also working for
    systems without the funopen/fopencookie API.
 
  * PKCS#12 import now tries several encodings in case the passphrase
    was not utf-8 encoded.  New option --p12-charset for gpgsm.
 
  * Improved the libgcrypt logging support in all modules.
 
  See-also: gnupg-announce/2007q2/000254.html
 
 
 Noteworthy changes in version 2.0.3 (2007-03-08)
 ------------------------------------------------
 
  * By default, do not allow processing multiple plaintexts in a single
    stream.  Many programs that called GnuPG were assuming that GnuPG
    did not permit this, and were thus not using the plaintext boundary
    status tags that GnuPG provides.  This change makes GnuPG reject
    such messages by default which makes those programs safe again.
    --allow-multiple-messages returns to the old behavior. [CVE-2007-1263].
 
  * New --verify-option show-primary-uid-only.
 
  * gpgconf may now reads a global configuration file to select which
    options are changeable by a frontend.  The new applygnupgdefaults
    tool may be used by an admin to set default options for all users.
 
  * The PIN pad of the Cherry XX44 keyboard is now supported.  The
    DINSIG and the NKS applications are now also aware of PIN pads.
 
  See-also: gnupg-announce/2007q1/000252.html
 
 
 Noteworthy changes in version 2.0.2 (2007-01-31)
 ------------------------------------------------
 
  * Fixed a serious and exploitable bug in processing encrypted
    packages. [CVE-2006-6235].
 
  * Added --passphrase-repeat to set the number of times GPG will
    prompt for a new passphrase to be repeated.  This is useful to help
    memorize a new passphrase.  The default is 1 repetition.
 
  * Using a PIN pad does now also work for the signing key.
 
  * A warning is displayed by gpg-agent if a new passphrase is too
    short.  New option --min-passphrase-len defaults to 8.
 
  * The status code BEGIN_SIGNING now shows the used hash algorithms.
 
  See-also: gnupg-announce/2007q1/000249.html
 
 
 Noteworthy changes in version 2.0.1 (2006-11-28)
 ------------------------------------------------
 
  * Experimental support for the PIN pads of the SPR 532 and the Kaan
    Advanced card readers.  Add "disable-keypad" scdaemon.conf if you
    don't want it.  Does currently only work for the OpenPGP card and
    its authentication and decrypt keys.
 
  * Fixed build problems on some some platforms and crashes on amd64.
 
  * Fixed a buffer overflow in gpg2. [bug#728,CVE-2006-6169]
 
  See-also: gnupg-announce/2006q4/000242.html
 
 
 Noteworthy changes in version 2.0.0 (2006-11-11)
 ------------------------------------------------
 
  * First stable version of a GnuPG integrating OpenPGP and S/MIME.
 
  See-also: gnupg-announce/2006q4/000239.html
 
 
 Noteworthy changes in version 1.9.95 (2006-11-06)
 -------------------------------------------------
 
  * Minor bug fixes.
 
 
 Noteworthy changes in version 1.9.94 (2006-10-24)
 -------------------------------------------------
 
  * Keys for gpgsm may now be specified using a keygrip.  A keygrip is
    indicated by a prefixing it with an ampersand.
 
  * gpgconf now supports switching the CMS cipher algo (e.g. to AES).
 
  * New command --gpgconf-test for all major tools. This may be used to
    check whether the configuration file is sane.
 
 
 Noteworthy changes in version 1.9.93 (2006-10-18)
 -------------------------------------------------
 
  * In --with-validation mode gpgsm will now also ask whether a root
    certificate should be trusted.
 
  * Link to Pth only if really necessary.
 
  * Fixed a pubring corruption bug in gpg2 occurring when importing
    signatures or keys with insane lengths.
 
  * Fixed v3 keyID calculation bug in gpg2.
 
  * More tweaks for certificates without extensions.
 
 
 Noteworthy changes in version 1.9.92 (2006-10-11)
 -------------------------------------------------
 
  * Bug fixes.
 
  See-also: gnupg-announce/2006q4/000236.html
 
 
 Noteworthy changes in version 1.9.91 (2006-10-04)
 -------------------------------------------------
 
  * New "relax" flag for trustlist.txt to allow root CA certificates
    without BasicContraints.
 
  * [gpg2] Removed the -k PGP 2 compatibility hack.  -k is now an
    alias for --list-keys.
 
  * [gpg2] Print a warning if "-sat" is used instead of "--clearsign".
 
 
 Noteworthy changes in version 1.9.90 (2006-09-25)
 -------------------------------------------------
 
  * Made readline work for gpg.
 
  * Cleanups und minor bug fixes.
 
  * Included translations from gnupg 1.4.5.
 
 
 Noteworthy changes in version 1.9.23 (2006-09-18)
 -------------------------------------------------
 
  * Regular man pages for most tools are now build directly from the
    Texinfo source.
 
  * The gpg code from 1.4.5 has been fully merged into this release.
    The configure option --enable-gpg is still required to build this
    gpg part.  For production use of OpenPGP the gpg version 1.4.5 is
    still recommended.  Note, that gpg will be installed under the name
    gpg2 to allow coexisting with an 1.4.x gpg.
 
  * API change in gpg-agent's pkdecrypt command.  Thus an older gpgsm
    may not be used with the current gpg-agent.
 
  * The scdaemon will now call a script on reader status changes.
 
  * gpgsm now allows file descriptor passing for "INPUT", "OUTPUT" and
    "MESSAGE".
 
  * The gpgsm server may now output a key listing to the output file
    handle. This needs to be enabled using "OPTION list-to-output=1".
 
  * The --output option of gpgsm has now an effect on list-keys.
 
  * New gpgsm commands --dump-chain and list-chain.
 
  * gpg-connect-agent has new options to utilize descriptor passing.
 
  * A global trustlist may now be used.  See doc/examples/trustlist.txt.
 
  * When creating a new pubring.kbx keybox common certificates are
    imported.
 
 
 Noteworthy changes in version 1.9.22 (2006-07-27)
 -------------------------------------------------
 
  * Enhanced pkcs#12 support to allow import from simple keyBags.
 
  * Exporting to pkcs#12 now create bag attributes so that Mozilla is
    able to import the files.
 
  * Fixed uploading of certain keys to the smart card.
 
 
 Noteworthy changes in version 1.9.21 (2006-06-20)
 -------------------------------------------------
 
  * New command APDU for scdaemon to allow using it for general card
    access.  Might be used through gpg-connect-agent by using the SCD
    prefix command.
 
  * Support for the CardMan 4040 PCMCIA reader (Linux 2.6.15 required).
 
  * Scdaemon does not anymore reset cards at the end of a connection.
 
  * Kludge to allow use of Bundesnetzagentur issued X.509 certificates.
 
  * Added --hash=xxx option to scdaemon's PKSIGN command.
 
  * Pkcs#12 files are now created with a MAC.  This is for better
    interoperability.
 
  * Collected bug fixes and minor other changes.
 
 
 Noteworthy changes in version 1.9.20 (2005-12-20)
 -------------------------------------------------
 
  * Importing pkcs#12 files created be recent versions of Mozilla works
    again.
 
  * Basic support for qualified signatures.
 
  * New debug tool gpgparsemail.
 
 
 Noteworthy changes in version 1.9.19 (2005-09-12)
 -------------------------------------------------
 
  * The Belgian eID card is now supported for signatures and ssh.
    Other pkcs#15 cards should work as well.
 
  * Fixed bug in --export-secret-key-p12 so that certificates are again
    included.
 
 
 Noteworthy changes in version 1.9.18 (2005-08-01)
 -------------------------------------------------
 
  * [gpgsm] Now allows for more than one email address as well as URIs
    and dnsNames in certificate request generation.  A keygrip may be
    given to create a request from an existing key.
 
  * A couple of minor bug fixes.
 
 
 Noteworthy changes in version 1.9.17 (2005-06-20)
 -------------------------------------------------
 
  * gpg-connect-agent has now features to handle Assuan INQUIRE
    commands.
 
  * Internal changes for OpenPGP cards. New Assuan command WRITEKEY.
 
  * GNU Pth is now a hard requirement.
 
  * [scdaemon] Support for OpenSC has been removed.  Instead a new and
    straightforward pkcs#15 modules has been written.  As of now it
    does allows only signing using TCOS cards but we are going to
    enhance it to match all the old capabilities.
 
  * [gpg-agent] New option --write-env-file and Assuan command
    UPDATESTARTUPTTY.
 
  * [gpg-agent] New option --default-cache-ttl-ssh to set the TTL for
    SSH passphrase caching independent from the other passphrases.
 
 
 Noteworthy changes in version 1.9.16 (2005-04-21)
 -------------------------------------------------
 
  * gpg-agent does now support the ssh-agent protocol and thus allows
    to use the pinentry as well as the OpenPGP smartcard with ssh.
 
  * New tool gpg-connect-agent as a general client for the gpg-agent.
 
  * New tool symcryptrun as a wrapper for certain encryption tools.
 
  * The gpg tool is not anymore build by default because those gpg
    versions available in the gnupg 1.4 series are far more matured.
 
 
 Noteworthy changes in version 1.9.15 (2005-01-13)
 -------------------------------------------------
 
  * Fixed passphrase caching bug.
 
  * Better support for CCID readers; the reader from Cherry RS 6700 USB
    does now work.
 
 
 Noteworthy changes in version 1.9.14 (2004-12-22)
 -------------------------------------------------
 
  * [gpg-agent] New option --use-standard-socket to allow the use of a
    fixed socket.  gpgsm falls back to this socket if GPG_AGENT_INFO
    has not been set.
 
  * Ported to MS Windows with some functional limitations.
 
  * New tool gpg-preset-passphrase.
 
 
 Noteworthy changes in version 1.9.13 (2004-12-03)
 -------------------------------------------------
 
  * [gpgsm] New option --prefer-system-dirmngr.
 
  * Minor cleanups and debugging aids.
 
 
 Noteworthy changes in version 1.9.12 (2004-10-22)
 -------------------------------------------------
 
  * [scdaemon] Partly rewrote the PC/SC code.
 
  * Removed the sc-investigate tool.  It is now in a separate package
    available at ftp://ftp.g10code.com/g10code/gscutils/ .
 
  * [gpg-agent] Fixed logging problem.
 
 
 Noteworthy changes in version 1.9.11 (2004-10-01)
 -------------------------------------------------
 
  * When using --import along with --with-validation, the imported
    certificates are validated and only imported if they are fully
    valid.
 
  * [gpg-agent] New option --max-cache-ttl.
 
  * [gpg-agent] When used without --daemon or --server, gpg-agent now
    check whether a agent is already running and usable.
 
  * Fixed some i18n problems.
 
 
 Noteworthy changes in version 1.9.10 (2004-07-22)
 -------------------------------------------------
 
  * Fixed a serious bug in the checking of trusted root certificates.
 
  * New configure option --enable-agent-pnly allows to build and
    install just the agent.
 
  * Fixed a problem with the log file handling.
 
 
 Noteworthy changes in version 1.9.9 (2004-06-08)
 ------------------------------------------------
 
  * [gpg-agent] The new option --allow-mark-trusted is now required to
    allow gpg-agent to add a key to the trustlist.txt after user
    confirmation.
 
  * Creating PKCS#10 requests does now honor the key usage.
 
 
 Noteworthy changes in version 1.9.8 (2004-04-29)
 ------------------------------------------------
 
  * [scdaemon] Overhauled the internal CCID driver.
 
  * [scdaemon] Status files named ~/.gnupg/reader_<n>.status are now
    written when using the internal CCID driver.
 
  * [gpgsm] New commands --dump-{,secret,external}-keys to show a very
    detailed view of the certificates.
 
  * The keybox gets now compressed after 3 hours and ephemeral
    stored certificates are deleted after about a day.
 
  * [gpg] Usability fixes for --card-edit.  Note, that this has already
    been ported back to gnupg-1.3
 
 
 Noteworthy changes in version 1.9.7 (2004-04-06)
 ------------------------------------------------
 
  * Instrumented the modules for gpgconf.
 
  * Added support for DINSIG card applications.
 
  * Include the smimeCapabilities attribute with signed messages.
 
  * Now uses the gettext domain "gnupg2" to avoid conflicts with gnupg
    versions < 1.9.
 
 
 Noteworthy changes in version 1.9.6 (2004-03-06)
 ------------------------------------------------
 
  * Code cleanups and bug fixes.
 
 
 Noteworthy changes in version 1.9.5 (2004-02-21)
 ------------------------------------------------
 
  * gpg-protect-tool gets now installed into libexec as it ought to be.
    Cleaned up the build system to better comply with the coding
    standards.
 
  * [gpgsm] The --import command is now able to autodetect pkcs#12
    files and import secret and private keys from this file format.
    A new command --export-secret-key-p12 is provided to allow
    exporting of secret keys in PKCS\#12 format.
 
  * [gpgsm] The pinentry will now present a description of the key for
    whom the passphrase is requested.
 
  * [gpgsm] New option --with-validation to check the validity of key
    while listing it.
 
  * New option --debug-level={none,basic,advanced,expert,guru} to map
    the debug flags to sensitive levels on a per program base.
 
 
 Noteworthy changes in version 1.9.4 (2004-01-30)
 ------------------------------------------------
 
  * Added support for the Telesec NKS 2.0 card application.
 
  * Added simple tool addgnupghome to create .gnupg directories from
    /etc/skel/.gnupg.
 
  * Various minor bug fixes and cleanups; mainly gpgsm and gpg-agent
    related.
 
 
 Noteworthy changes in version 1.9.3 (2003-12-23)
 ------------------------------------------------
 
  * New gpgsm options --{enable,disable}-ocsp to validate keys using
    OCSP. This option requires a not yet released DirMngr version.
    Default is disabled.
 
  * The --log-file option may now be used to print logs to a socket.
    Prefix the socket name with "socket://" to enable this.  This does
    not work on all systems and falls back to stderr if there is a
    problem with the socket.
 
  * The options --encrypt-to and --no-encrypt-to now work the same in
    gpgsm as in gpg.  Note, they are also used in server mode.
 
  * Duplicated recipients are now silently removed in gpgsm.
 
 
 Noteworthy changes in version 1.9.2 (2003-11-17)
 ------------------------------------------------
 
  * On card key generation is no longer done using the --gen-key
    command but from the menu provided by the new --card-edit command.
 
  * PINs are now properly cached and there are only 2 PINs visible.
    The 3rd PIN (CHV2) is internally synchronized with the regular PIN.
 
  * All kind of other internal stuff.
 
 
 Noteworthy changes in version 1.9.1 (2003-09-06)
 ------------------------------------------------
 
  * Support for OpenSC is back. scdaemon supports a --disable-opensc to
    disable OpenSC use at runtime, so that PC/SC or ct-API can still be
    used directly.
 
  * Rudimentary support for the SCR335 smartcard reader using an
    internal driver.  Requires current libusb from CVS.
 
  * Bug fixes.
 
 
 Noteworthy changes in version 1.9.0 (2003-08-05)
 ------------------------------------------------
 
       ====== PLEASE SEE README-alpha =======
 
  * gpg has been renamed to gpg2 and gpgv to gpgv2.  This is a
    temporary change to allow co-existing with stable gpg versions.
 
  * ~/.gnupg/gpg.conf-1.9.0 is fist tried as config file before the
    usual gpg.conf.
 
  * Removed the -k, -kv and -kvv commands.  -k is now an alias to
    --list-keys.  New command -K as alias for --list-secret-keys.
 
  * Removed --run-as-shm-coprocess feature.
 
  * gpg does now also use libgcrypt, libgpg-error is required.
 
  * New gpgsm commands --call-dirmngr and --call-protect-tool.
 
  * Changing a passphrase is now possible using "gpgsm --passwd"
 
  * The content-type attribute is now recognized and created.
 
  * The agent does now reread certain options on receiving a HUP.
 
  * The pinentry is now forked for each request so that clients with
    different environments are supported.  When running in daemon mode
    and --keep-display is not used the DISPLAY variable is ignored.
 
  * Merged stuff from the newpg branch and started this new
    development branch.
 
 
 Version 1.4.19 (2015-02-27)
 Version 1.4.18 (2014-06-30)
 Version 1.4.17 (2014-06-23)
 Version 1.4.16 (2013-12-18)
 Version 1.4.15 (2013-10-04)
 Version 1.4.14 (2013-07-25)
 Version 1.4.13 (2012-12-20)
 Version 1.4.12 (2012-01-30)
 Version 1.4.11 (2010-10-18)
 Version 1.4.10 (2009-09-02)
 Version 1.4.9 (2008-03-26)
 Version 1.4.8 (2007-12-20)
 Version 1.4.7 (2007-03-05)
 Version 1.4.6 (2006-12-06)
 Version 1.4.5 (2006-08-01)
 Version 1.4.4 (2006-06-25)
 Version 1.4.3 (2006-04-03)
 Version 1.4.2 (2005-07-26)
 Version 1.4.1 (2005-03-15)
 Version 1.4.0 (2004-12-16)
 
 
 Noteworthy changes in version 1.3.2 (2003-05-27)
 ------------------------------------------------
 
     * New "--gnupg" option (set by default) that disables --openpgp,
       and the various --pgpX emulation options.  This replaces
       --no-openpgp, and --no-pgpX, and also means that GnuPG has
       finally grown a --gnupg option to make GnuPG act like GnuPG.
 
     * A bug in key validation has been fixed.  This bug only affects
       keys with more than one user ID (photo IDs do not count here),
       and results in all user IDs on a given key being treated with
       the validity of the most-valid user ID on that key.
 
     * Notation names that do not contain a '@' are no longer allowed
       unless --expert is set.  This is to help prevent pollution of
       the (as yet unused) IETF notation namespace.
 
     * Multiple trust models are now supported via the --trust-model
       option.  The options are "pgp" (web-of-trust plus trust
       signatures), "classic" (web-of-trust only), and "always"
       (identical to the --always-trust option).
 
     * The --personal-{cipher|digest|compression}-preferences are now
       consulted to get default algorithms before resorting to the
       last-ditch defaults of --s2k-cipher-algo, SHA1, and ZIP
       respectively.  This allows a user to set algorithms to use in a
       safe manner so they are used when legal to do so, without
       forcing them on for all messages.
 
     * New --primary-keyring option to designate the keyring that the
       user wants new keys imported into.
 
     * --s2k-digest-algo is now used for all password mangling.
       Earlier versions used both --s2k-digest-algo and --digest-algo
       for passphrase mangling.
 
     * Handling of --hidden-recipient or --throw-keyid messages is now
       easier - the user only needs to give their passphrase once, and
       GnuPG will try it against all of the available secret keys.
 
     * Care is taken to prevent compiler optimization from removing
       memory wiping code.
 
     * New option --no-mangle-dos-filenames so that filenames are not
       truncated in the W32 version.
 
     * A "convert-from-106" script has been added.  This is a simple
       script that automates the conversion from a 1.0.6 or earlier
       version of GnuPG to a 1.0.7 or later version.
 
     * Disabled keys are now skipped when selecting keys for
       encryption.  If you are using the --with-colons key listings to
       detect disabled keys, please see doc/DETAILS for a minor format
       change in this release.
 
     * Minor trustdb changes to make the trust calculations match
       common usage.
 
     * New command "revuid" in the --edit-key menu to revoke a user ID.
       This is a simpler interface to the old method (which still
       works) of revoking the user ID self-signature.
 
     * Status VALIDSIG does now also print the primary key's
       fingerprint, as well as the signature version, pubkey algorithm,
       hash algorithm, and signature class.
 
     * Add read-only support for the SHA-256 hash, and optional
       read-only support for the SHA-384 and SHA-512 hashes.
 
     * New option --enable-progress-filter for use with frontends.
 
     * DNS SRV records are used in HKP keyserver lookups to allow
       administrators to load balance and select keyserver ports
       automatically.  This is as specified in
       draft-shaw-openpgp-hkp-00.txt.
 
     * When using the "keyid!" syntax during a key export, only that
       specified key is exported.  If the key in question is a subkey,
       the primary key plus only that subkey is exported.
 
     * configure --disable-xxx options to disable individual algorithms
       at build time.  This can be used to build a smaller gpg binary
       for embedded uses where space is tight.  See the README file for
       the algorithms that can be used with this option, or use
       --enable-minimal to build the smallest gpg possible (disables
       all optional algorithms, disables keyserver access, and disables
       photo IDs).
 
     * The keyserver no-modify flag on a key can now be displayed and
       modified.
 
     * Note that the TIGER/192 digest algorithm is in the process of
       being dropped from the OpenPGP standard.  While this release of
       GnuPG still contains it, it is disabled by default.  To ensure
       you will still be able to use your messages with future versions
       of GnuPG and other OpenPGP programs, please do not use this
       algorithm.
 
     See-also: gnupg-announce/2003q2/000153.html
 
 
 Noteworthy changes in version 1.3.1 (2002-11-12)
 ------------------------------------------------
 
     * Trust signature support.  This is based on the Maurer trust
       model where a user can specify the trust level along with the
       signature with multiple levels so users can delegate
       certification ability to other users, possibly restricted by a
       regular expression on the user ID.  Note that full trust
       signature support requires a regular expression parsing library.
       The regexp code from glibc 2.3.1 is included for those platforms
       that don't have working regexp functions available.  The
       configure option --disable-regex may be used to disable any
       regular expression code, which will make GnuPG ignore any trust
       signature with a regular expression included.
 
     * Two new commands --hidden-recipient (-R) and --hidden-encrypt-to
       encrypt to a user, but hide the identity of that user.  This is
       the same functionality as --throw-keyid, but can be used on a
       per-user basis.
 
     * Full algorithm names (e.g. "3DES", "SHA1", "ZIP") can now be
       used interchangeably with the short algorithm names (e.g. "S2",
       "H2", "Z1") anywhere algorithm names are used in GnuPG.
 
 
 Noteworthy changes in version 1.3.0 (2002-10-18)
 ------------------------------------------------
 
     * The last piece of internal keyserver support has been removed,
       and now all keyserver access is done via the keyserver plugins.
       There is also a newer keyserver protocol used between GnuPG and
       the plugins, so plugins from earlier versions of GnuPG may not
       work properly.
 
     * The HKP keyserver plugin supports the new machine-readable key
       listing format for those keyservers that provide it.
 
     * When using a HKP keyserver with multiple DNS records (such as
       wwwkeys.pgp.net which has the addresses of multiple servers
       around the world), try all records until one succeeds.  Note
       that it depends on the LDAP library used whether the LDAP
       keyserver plugin does this as well.
 
     * The library dependencies for OpenLDAP seem to change fairly
       frequently, and GnuPG's configure script cannot guess all the
       combinations.  Use ./configure LDAPLIBS="-L libdir -l libs" to
       override the script and use the libraries selected.
 
     * Secret keys generated with --export-secret-subkeys are now
       indicated in key listings with a '#' after the "sec", and in
       --with-colons listings by showing no capabilities (no lowercase
       characters).
 
     * --trusted-key has been un-obsoleted, as it is useful for adding
       ultimately trusted keys from the config file.  It is identical
       to using --edit and "trust" to change a key to ultimately
       trusted.
 
     * Translations other than de are no longer distributed with the
       development branch.  This is due to the frequent text changes
       during development, which cause the translations to rapidly go
       out of date.
 
 
 Version 1.2.8 (2006-12-07)
 Version 1.2.7 (2004-12-27)
 Version 1.2.6 (2004-08-25)
 Version 1.2.5 (2004-07-26)
 Version 1.2.4 (2003-12-23)
 Version 1.2.3 (2003-08-21)
 Version 1.2.2 (2003-05-01)
 Version 1.2.1 (2002-10-25)
 Version 1.2.0 (2002-09-21)
 
 
 Noteworthy changes in version 1.1.92 (2002-09-11)
 -------------------------------------------------
 
     * [IMPORTANT] The default configuration file is now
       ~/.gnupg/gpg.conf.  If an old ~/.gnupg/options is found it will
       still be used.  This change is required to have a more
       consistent naming scheme with forthcoming tools.
 
     * The use of MDCs have increased.  A MDC will be used if the
       recipients directly request it, if the recipients have AES,
       AES192, AES256, or TWOFISH in their cipher preferences, or if
       the chosen cipher has a blocksize not equal to 64 bits
       (currently this is also AES, AES192, AES256, and TWOFISH).
 
     * GnuPG will no longer automatically disable compression when
       processing an already-compressed file unless a MDC is being
       used.  This is to give the message a certain amount of
       resistance to the chosen-ciphertext attack while communicating
       with other programs (most commonly PGP earlier than version 7.x)
       that do not support MDCs.
 
     * The option --interactive now has the desired effect when
       importing keys.
 
     * The file permission and ownership checks on files have been
       clarified.  Specifically, the homedir (usually ~/.gnupg) is
       checked to protect everything within it.  If the user specifies
       keyrings outside this homedir, they are presumed to be shared
       keyrings and therefore *not* checked.  Configuration files
       specified with the --options option and the IDEA cipher
       extension specified with --load-extension are checked, along
       with their enclosing directories.
 
     * The configure option --with-static-rnd=auto allows to build gpg
       with all available entropy gathering modules included.  At
       runtime the best usable one will be selected from the list
       linux, egd, unix.  This is also the default for systems lacking
       a /dev/random device.
 
     * The default character set is now taken from the current locale;
       it can still be overridden by the --charset option.  Using the
       option -vvv shows the used character set.
 
     * [REMOVED] --emulate-checksum-bug and --emulate-3des-s2k-bug have
       been removed.
 
 
 Noteworthy changes in version 1.1.91 (2002-08-04)
 -------------------------------------------------
 
     * All modules are now linked statically; the --load-extension
       option is in general not useful anymore.  The only exception is
       to specify the deprecated idea cipher.
 
     * The IDEA plugin has changed.  Previous versions of the IDEA
       plugin will no longer work with GnuPG.  However, the current
       version of the plugin will work with earlier GnuPG versions.
 
     * When using --batch with one of the --delete-key commands, the
       key must be specified by fingerprint.  See the man page for
       details.
 
     * There are now various ways to restrict the ability GnuPG has to
       exec external programs (for the keyserver helpers or photo ID
       viewers).  Read the README file for the complete list.
 
     * New export option to leave off attribute packets (photo IDs)
       during export.  This is useful when exporting to HKP keyservers
       which do not understand attribute packets.
 
     * New import option to repair during import the HKP keyserver
       mangling multiple subkeys bug.  Note that this cannot completely
       repair the damaged key as some crucial data is removed by the
       keyserver, but it does at least give you back one subkey.  This
       is on by default for keyserver --recv-keys, and off by default
       for regular --import.
 
     * The keyserver helper programs now live in
       /usr/[local/]libexec/gnupg by default.  If you are upgrading
       from 1.0.7, you might want to delete your old copies in
       /usr/[local/]bin.  If you use an OS that does not use libexec
       for whatever reason, use configure --libexecdir=/usr/local/lib
       to place the keyserver helpers there.
 
     * The LDAP keyserver handler now works properly with very old
       (version 1) LDAP keyservers.
 
 
 Noteworthy changes in version 1.1.90 (2002-07-01)
 -------------------------------------------------
 
     * New commands: --personal-cipher-preferences,
       --personal-digest-preferences, and
       --personal-compress-preferences allow the user to specify which
       algorithms are to be preferred.  Note that this does not permit
       using an algorithm that is not present in the recipient's
       preferences (which would violate the OpenPGP standard).  This
       just allows sorting the preferences differently.
 
     * New "group" command to refer to several keys with one name.
 
     * A warning is issued if the user forces the use of an algorithm
       that is not listed in the recipient's preferences.
 
     * Full revocation key (aka "designated revoker") support.
 
     * The preferred hash algorithms on a key are consulted when
       encrypting a signed message to that key.  Note that this is
       disabled by default by a SHA1 preference in
       --personal-digest-preferences.
 
     * --cert-digest-algo allows the user to specify the hash algorithm
       to use when signing a key rather than the default SHA1 (or MD5
       for PGP2 keys).  Do not use this feature unless you fully
       understand the implications of this.
 
     * --pgp7 mode automatically sets all necessary options to ensure
       that the resulting message will be usable by a user of PGP 7.x.
 
     * New --attribute-fd command for frontends and scripts to get the
       contents of attribute packets (i.e. photos)
 
     * In expert mode, the user can now re-sign a v3 key with a v4
       self-signature.  This does not change the v3 key into a v4 key,
       but it does allow the user to use preferences, primary ID flags,
       etc.
 
     * Significantly improved photo ID support on non-unixlike
       platforms.
 
     * The version number has jumped ahead to 1.1.90 to skip over the
       old version 1.1 and to get ready for the upcoming 1.2.
 
     * ElGamal sign and encrypt is not anymore allowed in the key
       generation dialog unless in expert mode.  RSA sign and encrypt
       has been added with the same restrictions.
 
     * [W32] Keyserver access does work with Windows NT.
 
 
 Noteworthy changes in version 1.0.7 (2002-04-29)
 ------------------------------------------------
 
     * Secret keys are now stored and exported in a new format which
       uses SHA-1 for integrity checks.  This format renders the
       Rosa/Klima attack useless.  Other OpenPGP implementations might
       not yet support this, so the option --simple-sk-checksum creates
       the old vulnerable format.
 
     * The default cipher algorithm for encryption is now CAST5,
       default hash algorithm is SHA-1.  This will give us better
       interoperability with other OpenPGP implementations.
 
     * Symmetric encrypted messages now use a fixed file size if
       possible.  This is a tradeoff: it breaks PGP 5, but fixes PGP 2,
       6, and 7.  Note this was only an issue with RFC-1991 style
       symmetric messages.
 
     * Photographic user ID support.  This uses an external program to
       view the images.
 
     * Enhanced keyserver support via keyserver "plugins".  GnuPG comes
       with plugins for the NAI LDAP keyserver as well as the HKP email
       keyserver.  It retains internal support for the HKP HTTP
       keyserver.
 
     * Nonrevocable signatures are now supported.  If a user signs a
       key nonrevocably, this signature cannot be taken back so be
       careful!
 
     * Multiple signature classes are usable when signing a key to
       specify how carefully the key information (fingerprint, photo
       ID, etc) was checked.
 
     * --pgp2 mode automatically sets all necessary options to ensure
       that the resulting message will be usable by a user of PGP 2.x.
 
     * --pgp6 mode automatically sets all necessary options to ensure
       that the resulting message will be usable by a user of PGP 6.x.
 
     * Signatures may now be given an expiration date.  When signing a
       key with an expiration date, the user is prompted whether they
       want their signature to expire at the same time.
 
     * Revocation keys (designated revokers) are now supported if
       present.  There is currently no way to designate new keys as
       designated revokers.
 
     * Permissions on the .gnupg directory and its files are checked
       for safety.
 
     * --expert mode enables certain silly things such as signing a
       revoked user id, expired key, or revoked key.
 
     * Some fixes to build cleanly under Cygwin32.
 
     * New tool gpgsplit to split OpenPGP data formats into packets.
 
     * New option --preserve-permissions.
 
     * Subkeys created in the future are not used for encryption or
       signing unless the new option --ignore-valid-from is used.
 
     * Revoked user-IDs are not listed unless signatures are listed too
       or we are in verbose mode.
 
     * There is no default comment string with ascii armors anymore
       except for revocation certificates and --enarmor mode.
 
     * The command "primary" in the edit menu can be used to change the
       primary UID, "setpref" and "updpref" can be used to change the
       preferences.
 
     * Fixed the preference handling; since 1.0.5 they were erroneously
       matched against against the latest user ID and not the given one.
 
     * RSA key generation.
 
     * Merged Stefan's patches for RISC OS in.  See comments in
       scripts/build-riscos.
 
     * It is now possible to sign and conventional encrypt a message (-cs).
 
     * The MDC feature flag is supported and can be set by using
       the "updpref" edit command.
 
     * The status messages GOODSIG and BADSIG are now returning the primary
       UID, encoded using %XX escaping (but with spaces left as spaces,
       so that it should not break too much)
 
     * Support for GDBM based keyrings has been removed.
 
     * The entire keyring management has been revamped.
 
     * The way signature stati are store has changed so that v3
       signatures can be supported. To increase the speed of many
       operations for existing keyrings you can use the new
       --rebuild-keydb-caches command.
 
     * The entire key validation process (trustdb) has been revamped.
       See the man page entries for --update-trustdb, --check-trustdb
       and --no-auto-check-trustdb.
 
     * --trusted-keys is again obsolete, --edit can be used to set the
       ownertrust of any key to ultimately trusted.
 
     * A subkey is never used to sign keys.
 
     * Read only keyrings are now handled as expected.
 
     See-also: gnupg-announce/2002q2/000135.html
 
 
 Noteworthy changes in version 1.0.6 (2001-05-29)
 ------------------------------------------------
 
     * Security fix for a format string bug in the tty code.
 
     * Fixed format string bugs in all PO files.
 
     * Removed Russian translation due to too many bugs.  The FTP
       server has an unofficial but better translation in the contrib
       directory.
 
     * Fixed expire time calculation and keyserver access.
 
     * The usual set of minor bug fixes and enhancements.
 
     * non-writable keyrings are now correctly handled.
 
     See-also: gnupg-announce/2001q2/000123.html
 
 
 Noteworthy changes in version 1.0.5 (2001-04-29)
 ------------------------------------------------
 
     * WARNING: The semantics of --verify have changed to address a
       problem with detached signature detection. --verify now ignores
       signed material given on stdin unless this is requested by using
       a "-" as the name for the file with the signed material.  Please
       check all your detached signature handling applications and make
       sure that they don't pipe the signed material to stdin without
       using a filename together with "-" on the the command line.
 
     * WARNING: Corrected hash calculation for input data larger than
       512M - it was just wrong, so you might notice bad signature in
       some very big files.  It may be wise to keep an old copy of
       GnuPG around.
 
     * Secret keys are no longer imported unless you use the new option
       --allow-secret-key-import.  This is a kludge and future versions will
       handle it in another way.
 
     * New command "showpref" in the --edit-key menu to show an easier
       to understand preference listing.
 
     * There is now the notation of a primary user ID.  For example, it
       is printed with a signature verification as the first user ID;
       revoked user IDs are not printed there anymore.  In general the
       primary user ID is the one with the latest self-signature.
 
     * New --charset=utf-8 to bypass all internal conversions.
 
     * Large File Support (LFS) is now working.
 
     * New options: --ignore-crc-error, --no-sig-create-check,
       --no-sig-cache, --fixed-list-mode, --no-expensive-trust-checks,
       --enable-special-filenames and --use-agent.  See man page.
 
     * New command --pipemode, which can be used to run gpg as a
       co-process.  Currently only the verification of detached
       signatures are working.  See doc/DETAILS.
 
     * Keyserver support for the W32 version.
 
     * Rewritten key selection code so that GnuPG can better cope with
       multiple subkeys, expire dates and so.  The drawback is that it
       is slower.
 
     * A whole lot of bug fixes.
 
     * The verification status of self-signatures are now cached. To
       increase the speed of key list operations for existing keys you
       can do the following in your GnuPG homedir (~/.gnupg):
          cp pubring.gpg pubring.gpg.save && gpg --export-all >x && \
          rm pubring.gpg && gpg --import x
       Only v4 keys (i.e not the old RSA keys) benefit from this caching.
 
     * New translations: Estonian, Turkish.
 
     See-also: gnupg-announce/2001q2/000122.html
 
 
 Noteworthy changes in version 1.0.4 (2000-10-17)
 ------------------------------------------------
 
     * Fixed a serious bug which could lead to false signature verification
       results when more than one signature is fed to gpg.  This is the
       primary reason for releasing this version.
 
     * New utility gpgv which is a stripped down version of gpg to
       be used to verify signatures against a list of trusted keys.
 
     * Rijndael (AES) is now supported and listed with top preference.
 
     * --with-colons now works with --print-md[s].
 
     See-also: gnupg-announce/2000q4/000082.html
 
 
 Noteworthy changes in version 1.0.3 (2000-09-18)
 ------------------------------------------------
 
     * Fixed problems with piping to/from other MS-Windows software
 
     * Expiration time of the primary key can be changed again.
 
     * Revoked user IDs are now marked in the output of --list-key
 
     * New options --show-session-key and --override-session-key
       to help the British folks to somewhat minimize the danger
       of this Orwellian RIP bill.
 
     * New options --merge-only and --try-all-secrets.
 
     * New configuration option --with-egd-socket.
 
     * The --trusted-key option is back after it left us with 0.9.5
 
     * RSA is supported. Key generation does not yet work but will come
       soon.
 
     * CAST5 and SHA-1 are now the default algorithms to protect the key
       and for symmetric-only encryption. This should solve a couple
       of compatibility problems because the old algorithms are optional
       according to RFC2440
 
     * Twofish and MDC enhanced encryption is now used.  PGP 7 supports
       this.  Older versions of GnuPG don't support it, so they should be
       upgraded to at least 1.0.2
 
     See-also: gnupg-announce/2000q3/000075.html
 
 
 Noteworthy changes in version 1.0.2 (2000-07-12)
 ----------------------------------------------
 
     * Fixed expiration handling of encryption keys.
 
     * Add an experimental feature to do unattended key generation.
 
     * The user is now asked for the reason of revocation as required
       by the new OpenPGP draft.
 
     * There is a ~/.gnupg/random_seed file now which saves the
       state of the internal RNG and increases system performance
       somewhat.  This way the full entropy source is only used in
       cases were it is really required.
       Use the option --no-random-seed-file to disable this feature.
 
     * New options --ignore-time-conflict and --lock-never.
 
     * Some fixes for the W32 version.
 
     * The entropy.dll is not anymore used by the W32 version but replaced
       by code derived from Cryptlib.
 
     * Encryption is now much faster: About 2 times for 1k bit keys
       and 8 times for 4k keys.
 
     * New encryption keys are generated in a way which allows a much
       faster decryption.
 
     * New command --export-secret-subkeys which outputs the
       the _primary_ key with it's secret parts deleted.  This is
       useful for automated decryption/signature creation as it
       allows to keep the real secret primary key offline and
       thereby protecting the key certificates and allowing to
       create revocations for the subkeys.  See the FAQ for a
       procedure to install such secret keys.
 
     * Keygeneration now writes to the first writeable keyring or
       as default to the one in the homedirectory.  Prior versions
       ignored all --keyring options.
 
     * New option --command-fd to take user input from a file descriptor;
       to be used with --status-fd by software which uses GnuPG as a backend.
 
     * There is a new status PROGRESS which is used to show progress during
       key generation.
 
     * Support for the new MDC encryption packets.  To create them either
       --force-mdc must be use or cipher algorithm with a blocksize other
       than 64 bits is to be used.  --openpgp currently disables MDC packets
       entirely.  This option should not yet be used.
 
     * New option --no-auto-key-retrieve to disable retrieving of
       a missing public key from a keyserver, when a keyserver has been set.
 
     * Danish translation
 
     See-also: gnupg-announce/2000q3/000069.html
 
 
 Noteworthy changes in version 1.0.1 (1999-12-16)
 -----------------------------------
 
     * New command --verify-files.  New option --fast-list-mode.
 
     * $http_proxy is now used when --honor-http-proxy is set.
 
     * Fixed some minor bugs and the problem with conventional encrypted
       packets which did use the gpg v3 partial length headers.
 
     * Add Indonesian and Portuguese translations.
 
     * Fixed a bug with symmetric-only encryption using the non-default 3DES.
       The option --emulate-3des-s2k-bug may be used to decrypt documents
       which have been encrypted this way; this should be done immediately
       as this workaround will be remove in 1.1
 
     * Can now handle (but not display) PGP's photo IDs. I don't know the
       format of that packet but after stripping a few bytes from the start
       it looks like a JPEG (at least my test data).  Handling of this
       package is required because otherwise it would mix up the
       self signatures and you can't import those keys.
 
     * Passing non-ascii user IDs on the commandline should now work in all
       cases.
 
     * New keys are now generated with an additional preference to Blowfish.
 
     * Removed the GNU Privacy Handbook from the distribution as it will go
       into a separate one.
 
     See-also: gnupg-announce/1999q4/000050.html
 
 
 Noteworthy changes in version 1.0.0 (1999-09-07)
 -----------------------------------
 
     * Add a very preliminary version of the GNU Privacy Handbook to
       the distribution (lynx doc/gph/index.html).
 
     * Changed the version number to GnuPG 2001 ;-)
 
     See-also: gnupg-announce/1999q3/000037.html
 
 
 Noteworthy changes in version 0.9.11 (1999-09-03)
 ------------------------------------
 
     * UTF-8 strings are now correctly printed (if --charset is set correctly).
       Output of --with-colons remains C-style escaped UTF-8.
 
     * Workaround for a problem with PGP 5 detached signature in textmode.
 
     * Fixed a problem when importing new subkeys (duplicated signatures).
 
     See-also: gnupg-announce/1999q3/000036.html
 
 
 Noteworthy changes in version 0.9.10 (1999-07-23)
 ------------------------------------
 
     * Some strange new options to help pgpgpg
 
     * Cleaned up the dox a bit.
 
     See-also: gnupg-announce/1999q3/000034.html
 
 
 Noteworthy changes in version 0.9.9
 -----------------------------------
 
     * New options --[no-]utf8-strings.
 
     * New edit-menu commands "enable" and "disable" for entire keys.
 
     * You will be asked for a filename if gpg cannot deduce one.
 
     * Changes to support libtool which is needed for the development
       of libgcrypt.
 
     * New script tools/lspgpot to help transferring assigned
       trustvalues from PGP to GnuPG.
 
     * New commands --lsign-key and made --sign-key a shortcut for --edit
       and sign.
 
     * New options (#122--126 ;-) --[no-]default-recipient[-self],
       --disable-{cipher,pubkey}-algo. See the man page.
 
     * Enhanced info output in case of multiple recipients and fixed exit code.
 
     * New option --allow-non-selfsigned-uid to work around a problem with
       the German IN way of separating signing and encryption keys.
 
     See-also: gnupg-announce/1999q3/000028.html
 
 
 Noteworthy changes in version 0.9.8 (1999-06-26)
 -----------------------------------
 
     * New subcommand "delsig" in the edit menu.
 
     * The name of the output file is not anymore the one which is
       embedded in the processed message, but the used filename with
       the extension stripped.  To revert to the old behaviour you can
       use the option --use-embedded-filename.
 
     * Another hack to cope with pgp2 generated detached signatures.
 
     * latin-2 character set works (--charset=iso-8859-2).
 
     * New option --with-key-data to list the public key parameters.
       New option -N to insert notations and a --set-policy-url.
       A couple of other options to allow resetting of options.
 
     * Better support for HPUX.
 
     See-also: gnupg-announce/1999q2/000016.html
 
 
 Noteworthy changes in version 0.9.7 (1999-05-23)
 -----------------------------------
 
     * Add some work arounds for a bugs in pgp 2 which led to bad signatures
       when used with canonical texts in some cases.
 
     * Enhanced some status outputs.
 
     See-also: gnupg-announce/1999q2/000000.html
 
 
 Noteworthy changes in version 0.9.6 (1999-05-06)
 -----------------------------------
 
     * Twofish is now statically linked by default. The experimental 128 bit
       version is now disabled.	Full support will be available as soon as
       the OpenPGP WG has decided on an interpretation of rfc2440.
 
     * Dropped support for the ancient Blowfish160 which is not OpenPGP.
 
     * Merged gpgm and gpg into one binary.
 
     * Add "revsig" and "revkey" commands to the edit menu.  It is now
       possible to revoke signature and subkeys.
 
 
 Noteworthy changes in version 0.9.5 (1999-03-20)
 -----------------------------------
 
     * New command "lsign" in the keyedit menu to create non-exportable
       signatures.  Removed --trusted-keys option.
 
     * A bunch of changes to the key validation code.
 
     * --list-trust-path now has an optional --with-colons format.
 
     * New command --recv-keys to import keys from an keyserver.
 
 
 Noteworthy changes in version 0.9.4 (1999-03-08)
 -----------------------------------
 
     * New configure option --enable-static-rnd=[egd|linux|unix|none]
       to select a random gathering module for static linking.
 
     * The original text is now verbatim copied to a cleartext signed message.
 
     * Bugfixes but there are still a couple of bugs.
 
 
 Noteworthy changes in version 0.9.3 (1999-02-19)
 -----------------------------------
 
     * Changed the internal design of getkey which now allows a
       efficient lookup of multiple keys and add a word match mode.
 
     * New options --[no-]encrypt-to.
 
     * Some changes to the configure stuff.  Switched to automake 1.4.
       Removed intl/ from CVS, autogen.sh now uses gettextize.
 
     * Preferences now include Twofish. Removed preference to Blowfish with
       a special hack to suppress the "not listed in preferences" warning;
       this is to allow us to switch completely to Twofish in the near future.
 
     * Changed the locking stuff.
 
     * Print all user ids of a good signature.
 
 
 Noteworthy changes in version 0.9.2 (1999-01-01)
 -----------------------------------
 
     * add some additional time warp checks.
 
     * Option --keyserver and command --send-keys to utilize HKP servers.
 
     * Upgraded to zlib 1.1.3 and fixed an inflate bug
 
     * More cleanup on the cleartext signatures.
 
 
 Noteworthy changes in version 0.9.1 (1999-01-01)
 -----------------------------------
 
     * Polish language support.
 
     * When querying the passphrase, the key ID of the primary key is
       displayed along with the one of the used secondary key.
 
     * Fixed a bug occurring when decrypting pgp 5 encrypted messages,
       fixed an infinite loop bug in the 3DES code and in the code
       which looks for trusted signatures.
 
     * Fixed a bug in the mpi library which caused signatures not to
       compare okay.
 
     * Rewrote the handling of cleartext signatures; the code is now
       better maintainable (I hope so).
 
     * New status output VALIDSIG only for valid signatures together
       with the fingerprint of the signer's key.
 
 
 Noteworthy changes in version 0.9.0 (1998-12-23)
 -----------------------------------
 
     * --export does now only exports rfc2440 compatible keys; the
       old behaviour is available with --export-all.
       Generation of v3 ElGamal (sign and encrypt) keys is not longer
       supported.
 
     * Fixed the uncompress bug.
 
     * Rewrote the rndunix module. There are two environment variables
       used for debugging now: GNUPG_RNDUNIX_DBG give the file to write
       debugging information (use "-" for stdout) and if GNUPG_RNDUNIX_DBGALL
       is set, all programs which are only tried are also printed.
 
     * New option --escape-from-lines to "dash-escape" "From " lines to
       prevent mailers to change them to ">From ".  This is not enabled by
       default because it is not in compliance with rfc2440 - however, you
       should turn it on.
 
 
 Noteworthy changes in version 0.4.5 (1998-12-08)
 -----------------------------------
 
     * The keyrings and the trustdb is now locked, so that
       other GnuPG processes won't damage these files.  You
       may want to put the option --lock-once into your options file.
 
     * The latest self-signatures are now used; this enables --import
       to see updated preferences etc.
 
     * Import of subkeys should now work.
 
     * Random gathering modules may now be loaded as extensions. Add
       such a module for most Unices but it is very experimental!
 
     * Brazilian language support.
 
 
 Noteworthy changes in version 0.4.4 (1998-11-20)
 -----------------------------------
 
     * Fixed the way the key expiration time is stored. If you have
       an expiration time on your key you should fix it with --edit-key
       and the command "expire".  I apologize for this inconvenience.
 
     * Add option --charset to support "koi8-r" encoding of user ids.
       (Not yet tested).
 
     * Preferences should now work again. You should run
       "gpgm --check-trustdb \*" to rebuild all preferences.
 
     * Checking of certificates should now work but this needs a lot
       of testing.  Key validation values are now cached in the
       trustdb; they should be recalculated as needed, but you may
       use --check-trustdb or --update-trustdb to do this.
 
     * Spanish translation by Urko Lusa.
 
     * Patch files are from now on signed.  See the man page
       for the new option --not-dash-escaped.
 
     * New syntax: --edit-key <userID> [<commands>]
       If you run it without --batch the commands are executed and then
       you are put into normal mode unless you use "quit" or "save" as
       one of the commands.  When in batch mode, the program quits after
       the last command, so you have to use "save" if you did some changes.
       It does not yet work completely, but may be used to list so the
       keys etc.
 
 
 Noteworthy changes in version 0.4.3 (1998-11-08)
 -----------------------------------
 
     * Fixed the gettext configure bug.
 
     * Kludge for RSA keys: keyid and length of a RSA key are
       correctly reported, but you get an error if you try to use
       this key (If you do not have the non-US version).
 
     * Experimental support for keyrings stored in a GDBM database.
       This is *much* faster than a standard keyring.  You will notice
       that the import gets slower with time; the reason is that all
       new keys are used to verify signatures of previous inserted
       keys.  Use "--keyring gnupg-gdbm:<name-of-gdbm-file>".  This is
       not (yet) supported for secret keys.
 
     * A Russian language file in the distribution (alternatives are in
       the contrib directory of the FTP servers)
 
     * commandline option processing now works as expected for GNU programs
       with the exception that you can't mix options and normal arguments.
 
     * Now --list-key lists all matching keys.  This is needed in some
       other places too.
 
 
 Noteworthy changes in version 0.4.2 (1998-10-18)
 -----------------------------------
 
     * This is only a snapshot: There are still a few bugs.
 
     * Fixed this huge memory leak.
 
     * Redesigned the trust database:  You should run "gpgm --check-trustdb".
       New command --update-trustdb, which adds new key from the public
       keyring into your trustdb
 
     * Fixed a bug in the armor code, leading to invalid packet errors.
       (a workaround for this was to use --no-armor).  The shorten line
       length (64 instead of 72) fixes a problem with pgp5 and keyservers.
 
     * comment packets are not anymore generated. "--export" filters
       them out.  One Exception:  The comment packets in a secret keyring
       are still used because they carry the factorization of the public
       prime product.
 
     * --import now only looks for KEYBLOCK headers, so you can now simply
       remove the "- " in front of such a header if someone accidentally signed
       such a message or the keyblock is part of a cleartext signed message.
 
     * --with-colons now lists the key expiration time and not anymore
       the valid period.
 
     * Some keyblocks created with old releases have a wrong sequence
       of packets, so that the keyservers don't accept these keys.
       Simply using "--edit-key" fixes the problem.
 
     * New option --force-v3-sigs to generate signed messages which are
       compatible to PGP 5.
 
     * Add some code to support DLD (for non ELF systems) - but this is
       not tested because my BSD box is currently broken.
 
     * New command "expire" in the edit-key menu.
 
 
 
 Noteworthy changes in version 0.4.1 (1998-10-07)
 -----------------------------------
 
     * A secondary key is used when the primary key is specified but cannot
       be used for the operation (if it is a sign-only key).
 
     * GNUPG can now handle concatenated armored messages:  There is still a
       bug if different kinds of messages are mixed.
 
     * Iterated+Salted passphrases now work.  If want to be sure that PGP5
       is able to handle them you may want to use the options
 	"--s2k-mode 3 --s2k-cipher-algo cast5 --s2k-digest-algo sha1"
       when changing a passphrase.
 
     * doc/OpenPGP talks about OpenPGP compliance, doc/HACKING gives
       a few hints about the internal structure.
 
     * Checked gnupg against the August 1998 draft (07) and I believe
       it is in compliance with this document (except for one point).
 
     * Fixed some bugs in the import merging code and rewrote some
       code for the trustdb.
 
 
 Noteworthy changes in version 0.4.0 (1998-09-18)
 -----------------------------------
 
     * Triple DES is now supported.  Michael Roth did this piece of
       needed work.  We have now all the coded needed to be OpenPGP
       compliant.
 
     * Added a simple rpm spec file (see INSTALL).
 
     * detached and armored signatures are now using "PGP SIGNATURE",
       except when --rfc1991 is used.
 
     * All times which are not in the yyyy-mm-dd format are now printed
       in local time.
 
 
 Noteworthy changes in version 0.3.5 (1998-09-14)
 -----------------------------------
 
     * New option --throw-keyid to create anonymous enciphered messages.
       If gpg detects such a message it tires all available secret keys
       in turn so decode it.  This is a gnupg extension and not in OpenPGP
       but it has been discussed there and afaik some products use this
       scheme too (Suggested by Nimrod Zimmerman).
 
     * Fixed a bug with 5 byte length headers.
 
     * --delete-[secret-]key is now also available in gpgm.
 
     * cleartext signatures are not anymore converted to LF only.
 
     * Fixed a trustdb problem.	Run "gpgm --check-trustdb" to fix old
       trust dbs.
 
     * Building in another directory should now work.
 
     * Weak key detection mechanism (Niklas Hernaeus).
 
 
 Noteworthy changes in version 0.3.4 (1998-08-11)
 -----------------------------------
 
     * New options --comment and --set-filename; see g10/OPTIONS
 
     * yes/no, y/n localized.
 
     * Fixed some bugs.
 
 
 Noteworthy changes in version 0.3.3 (1998-08-08)
 -----------------------------------
 
     * IMPORTANT: I found yet another bug in the way the secret keys
       are encrypted - I did it the way pgp 2.x did it, but OpenPGP
       and pgp 5.x specify another (in some aspects simpler) method.
       To convert your secret keys you have to do this:
 	1. Build the new release but don't install it and keep
 	   a copy of the old program.
 	2. Disable the network, make sure that you are the only
 	   user, be sure that there are no Trojan horses etc ....
 	3. Use your old gpg (version 0.3.1 or 0.3.2) and set the
 	   passphrases of ALL your secret keys to empty!
 	   (gpg --change-passphrase your-user-id).
 	4. Save your ownertrusts (see the next point)
 	5. rm ~/.gnupg/trustdb.gpg
 	6. install the new version of gpg (0.3.3)
 	7. For every secret key call "gpg --edit-key your-user-id",
 	   enter "passwd" at the prompt, follow the instructions and
 	   change your password back, enter "save" to store it.
 	8. Restore the ownertrust (see next point).
 
     * The format of the trust database has changed; you must delete
       the old one, so gnupg can create a new one.
       IMPORTANT: Use version 0.3.1 or .2 to save your assigned ownertrusts
       ("gpgm --list-ownertrust >saved-trust"); then build this new version
       and restore the ownertrust with this new version
       ("gpgm --import-ownertrust saved-trust").  Please note that
       --list-ownertrust has been renamed to --export-ownertrust in this
       release and it does now only export defined ownertrusts.
 
     * The command --edit-key now provides a commandline driven menu
       which can be used for various tasks.  --sign-key is only an
       an alias to --edit-key and maybe removed in future: use the
       command "sign" of this new menu - you can select which user ids
       you want to sign.
 
     * Alternate user ids can now be created an signed.
 
     * Owner trust values can now be changed with --edit-key (trust)
 
     * GNUPG can now run as a coprocess; this enables sophisticated
       frontends.  tools/shmtest.c is a simple sample implementation.
       This needs some more work: all tty_xxx() are to be replaced
       by cpr_xxx() and some changes in the display logics is needed.
 
     * Removed options --gen-prime and --gen-random.
 
     * Removed option --add-key; use --edit-key instead.
 
     * Removed option --change-passphrase; use --edit-key instead.
 
     * Signatures are now checked even if the output file could not
       be created. Command "--verify" tries to find the detached data.
 
     * gpg now disables core dumps.
 
     * compress and symmetric cipher preferences are now used.
       Because there is no 3DES yet, this is replaced by Blowfish.
 
     * We have added the Twofish as an experimental cipher algorithm.
       Many thanks to Matthew Skala for doing this work.
       Twofish is the AES submission from Schneier et al.; see
       "www.counterpane.com/twofish.html" for more information.
 
     * Started with a help system: If you enter a question mark at some
       prompt; you should get a specific help for this prompt.
 
     * There is no more backup copy of the secret keyring.
 
     * A lot of new bugs. I think this release is not as stable as
       the previous one.
 
 
 Noteworthy changes in version 0.3.2 (1998-07-09)
 -----------------------------------
 
     * Fixed some bugs when using --textmode (-seat)
 
     * Now displays the trust status of a positive verified message.
 
     * Keyrings are now scanned in the sequence they are added with
       --[secret-]keyring.  Note that the default keyring is implicitly
       added as the very first one unless --no-default-keyring is used.
 
     * Fixed setuid and dlopen bug.
 
 
 Noteworthy changes in version 0.3.1 (1998-07-06)
 -----------------------------------
 
     * Partial headers are now written in the OpenPGP format if
       a key in a v4 packet is used.
 
     * Removed some unused options, removed the gnupg.sig stuff.
 
     * Key lookup by name now returns a key which can be used for
       the desired action.
 
     * New options --list-ownertrust (gpgm) to make a backup copy
       of the ownertrust values you assigned.
 
     * clear signature headers are now in compliance with OpenPGP.
 
 
 Noteworthy changes in version 0.3.0 (1998-06-25)
 -----------------------------------
 
     * New option --emulate-checksum-bug.  If your passphrase does not
       work anymore, use this option and --change-passphrase to rewrite
       your passphrase.
 
     * More complete v4 key support: Preferences and expiration time
       is set into the self signature.
 
     * Key generation defaults to DSA/ElGamal keys, so that new keys are
       interoperable with pgp5
 
     * DSA key generation is faster and key generation does not anymore
       remove entropy from the random generator (the primes are public
       parameters, so there is really no need for a cryptographic secure
       prime number generator which we had used).
 
     * A complete new structure for representing the key parameters.
 
     * Removed most public key knowledge into the cipher library.
 
     * Support for dynamic loading of new algorithms.
 
     * Moved tiger to an extension module.
 
 
 Noteworthy changes in version 0.2.19 (1998-05-29)
 ------------------------------------
 
     * Replaced /dev/urandom in checks with new tool mk-tdata.
 
     * Some assembler file cleanups; some more functions for the Alpha.
 
     * Tiger has now the OpenPGP assigned number 6.  Because the OID has
       changed, old signatures using this algorithm can't be verified.
 
     * gnupg now encrypts the compressed packed and not any longer in the
       reverse order; anyway it can decrypt both versions. Thanks to Tom
       for telling me this (not security related) bug.
 
     * --add-key works and you are now able to generate subkeys.
 
     * It is now possible to generate ElGamal keys in v4 packets to create
       valid OpenPGP keys.
 
     * Some new features for better integration into MUAs.
 
 
 Noteworthy changes in version 0.2.18 (1998-05-15)
 ------------------------------------
 
     * Split cipher/random.c, add new option "--disable-dev-random"
       to configure to support the development of a random source for
       other systems. Prepared sourcefiles rand-unix.c, rand-w32.c
       and rand-dummy.c (which is used to allow compilation on systems
       without a random source).
 
     * Fixed a small bug in the key generation (it was possible that 48 bits
       of a key were not taken from the random pool)
 
     * Add key generation for DSA and v4 signatures.
 
     * Add a function trap_unaligned(), so that a SIGBUS is issued on
       Alphas and not the slow emulation code is used. And success: rmd160
       raised a SIGBUS.
 
     * Enhanced the formatting facility of argparse and changed the use of
       \r,\v to @ because gettext does not like it.
 
     * New option "--compress-algo 1" to allow the creation of compressed
       messages which are readable by PGP and "--print-md" (gpgm) to make
       speed measurement easier.
 
 
 Noteworthy changes in version 0.2.17 (1998-05-04)
 ------------------------------------
 
     * Comment packets are now of private type 61.
 
     * Passphrase code still used a 160 bit blowfish key, added a
       silly workaround. Please change your passphrase again - sorry.
 
     * Conventional encryption now uses a type 3 packet to describe the
       used algorithms.
 
     * The new algorithm number for Blowfish is 20, 16 is still used for
       encryption only; for signing it is only used when it is in a v3 packet,
       so that GNUPG keys are still valid.
 
 
 Noteworthy changes in version 0.2.16 (1998-04-28)
 ------------------------------------
 
     * Add experimental support for the TIGER/192 message digest algorithm.
       (But there is only a dummy ASN OID).
 
     * Standard cipher is now Blowfish with 128 bit key in OpenPGP's CFB
       mode. I renamed the old cipher to Blowfish160. Because the OpenPGP
       group refused to assign me a number for Blowfish160, I have to
       drop support for this in the future. You should use
       "--change-passphrase" to recode your current passphrase with 128
       bit Blowfish.
 
 
 Noteworthy changes in version 0.2.15 (1998-04-09)
 ------------------------------------
 
     * Fixed a bug with the old checksum calculation for secret keys.
       If you run the program without --batch, a warning does inform
       you if your secret key needs to be converted; simply use
       --change-passphrase to recalculate the checksum. Please do this
       soon, as the compatible mode will be removed sometime in the future.
 
     * CAST5 works (using the PGP's special CFB mode).
 
     * Again somewhat more PGP 5 compatible.
 
     * Some new test cases
 
 Noteworthy changes in version 0.2.14 (1998-04-02)
 ------------------------------------
 
     * Changed the internal handling of keyrings.
 
     * Add support to list PGP 5 keyrings with subkeys
 
     * Timestamps of signatures are now verified.
 
     * A expiration time can now be specified during key generation.
 
     * Some speedups for Blowfish and SHA-1, rewrote SHA-1 transform.
       Reduced the amount of random bytes needed for key generation in
       some cases.
 
 
 Noteworthy changes in version 0.2.13 (1998-03-10)
 ------------------------------------
 
     * Verify of DSA signatures works.
 
     * Re-implemented the slower random number generator.
 
 
 Noteworthy changes in version 0.2.12 (1998-03-07)
 ------------------------------------
 
     * --delete-key checks that there is no secret key. The new
       option --delete-secret-key maybe used to delete a secret key.
 
     * "-kv" now works as expected. Options "--list-{keys,sigs]"
       and "--check-sigs" are now working.
 
     * New options "--verify" and "--decrypt" to better support integration
       into MUAs (partly done for Mutt).
 
     * New option "--with-colons" to make parsing of key lists easier.
 
 Noteworthy changes in version 0.2.11 (1998-03-02)
 ------------------------------------
 
     * GPG now asks for a recipient's name if option "-r" is not used.
 
     * If there is no good trust path, the program asks whether to use
       the public keys anyway.
 
     * "--delete-key" works for public keys. What semantics shall I use
       when there is a secret key too? Delete the secret key or leave him
       and auto-regenerate the public key, next time the secret key is used?
 
 Noteworthy changes in version 0.2.10 (1998-02-27)
 ------------------------------------
 
     * Code for the alpha is much faster (about 20 times); the data
       was misaligned and the kernel traps this, so nearly all time
       was used by system to trap the misalignments and to write
       syslog messages. Shame on me and thanks to Ralph for
       pointing me at this while drinking some beer yesterday.
 
     * Changed some configure options and add an option
       --disable-m-guard to remove the memory checking code
       and to compile everything with optimization on.
 
     * New environment variable GNUPGHOME, which can be used to set
       another homedir than ~/.gnupg.  Changed default homedir for
       Windoze version to c:/gnupg.
 
     * Fixed detached signatures; detached PGP signatures caused a SEGV.
 
     * The Windoze version works (as usual w/o a strong RNG).
 
 
 Noteworthy changes in version 0.2.9 (1998-02-26)
 -----------------------------------
 
     * Fixed FreeBSD bug.
 
     * Added a simple man page.
 
     * Switched to automake1.2f and a newer gettext.
 
 Noteworthy changes in version 0.2.8 (1998-02-24)
 -----------------------------------
 
     * Changed the name to GNUPG, the binaries are called gpg and gpgm.
       You must rename rename the directory "~/.g10" to ~/.gnupg/, rename
       {pub,sec}ring.g10 to {pub,sec}ring.gpg, trustdb.g10 to trustdb.gpg
       and g10.sig to gnupg.sig.
 
     * New or changed passphrases are now salted.
 
 
 Noteworthy changes in version 0.2.7 (1998-02-18)
 -----------------------------------
 
     * New command "gen-revoke" to create a key revocation certificate.
 
     * New option "homedir" to set the homedir (which defaults to "~/.g10").
       This directory is created if it does not exists (only the last
       part of the name and not the complete hierarchy)
 
     * Command "import" works. (Try: "finger gcrypt@ftp.guug.de|g10 --import")
 
     * New commands "dearmor/enarmor" for g10maint.  These are mainly
       used for internal test purposes.
 
     * Option --version now conforming to the GNU standards and lists
       the available ciphers, message digests and public key algorithms.
 
     * Assembler code for m68k (not tested).
 
     * "make check" works.
 
 Noteworthy changes in version 0.2.6 (1998-02-13)
 -----------------------------------
 
     * Option "--export" works.
 
 
 Noteworthy changes in version 0.2.5 (1998-02-12)
 -----------------------------------
 
     * Added zlib for systems which don't have it.
       Use "./configure --with-zlib" to link with the static version.
 
     * Generalized some more functions and rewrote the encoding of
       message digests into MPIs.
 
     * Enhanced the checkit script
 
 
 Noteworthy changes in version 0.2.4 (1998-02-11)
 -----------------------------------
 
     * nearly doubled the speed of the ElGamal signature verification.
 
     * backup copies of keyrings are created.
 
     * assembler stuff for Pentium; gives about 15% better performance.
 
     * fixed a lot of bugs.
 
 
 Noteworthy changes in version 0.2.3 (1998-02-09)
 -----------------------------------
 
     * Found a bug in the calculation of ELG fingerprints. This is now
       fixed, but all existing fingerprints and keyids for ELG keys
       are not any more valid.
 
     * armor should now work; including clear signed text.
 
     * moved some options to the new program g10maint
 
     * It's now 64 bit clean and runs fine on an alpha--linux.
 
     * Key generation is much faster now.  I fixed this by using not
       so strong random number for the primes (this was a bug because the
       ElGamal primes are public parameters and it does not make sense
       to generate them from strong random).  The real secret is the x value
       which is still generated from strong (okay: /dev/random) random bits.
 
     * added option "--status-fd": see g10/OPTIONS
 
     * We have secure memory on systems which support mlock().
       It is not complete yet, because we do not have signal handler
       which does a cleanup in very case.
       We should also check the ulimit for the user in the case
       that the admin does not have set a limit on locked pages.
 
     * started with internationalization support.
 
     * The logic to handle the web of trust is now implemented. It is
       has some bugs; but I'm going to change the algorithm anyway.
       It works by calculating the trustlevel on the fly.  It may ask
       you to provide trust parameters if the calculated trust probability
       is too low.  I will write a paper which discusses this new approach.
 
     * a couple of changes to the configure script.
 
     * New option "--quick-random" which uses a much quicker random
       number generator.  Keys generated while this option is in effect
       are flags with "INSECURE!" in the user-id.  This is a development
       only option.
 
     * Read support for new version packets (OpenPGP).
 
     * Comment packets are now of correct OpenPGP type 16. Old comment
       packets written by G10 are detected because they always start with
       a hash which is an invalid version byte.
 
     * The string "(INSECURE!)" is appended to a new user-id if this
       is generated on a system without a good random number generator.
 
 
 Version 0.2.2 (1998-02-09)
 Version 0.2.1 (1998-01-28)
 Version 0.2.0 (1998-01-25)
 Version 0.1.3 (1998-01-12)
 Version 0.1.2 (1998-01-07)
 Version 0.1.1 (1998-01-07)
 Version 0.1.0 (1998-01-05)
 Version 0.0.0 (1997-12-20)
 
 
  Copyright (C) 1998-2017 Free Software Foundation, Inc.
  Copyright (C) 1997-2017 Werner Koch
 
  This file is free software; as a special exception the author gives
  unlimited permission to copy and/or distribute it, with or without
  modifications, as long as this notice is preserved.
 
  This file is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/g10/gpg.c b/g10/gpg.c
index dd0bf0167..b9a81510f 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -1,5746 +1,5753 @@
 /* gpg.c - The GnuPG OpenPGP tool
  * Copyright (C) 1998-2020 Free Software Foundation, Inc.
  * Copyright (C) 1997-2019 Werner Koch
  * Copyright (C) 2015-2022 g10 Code GmbH
  *
  * This file is part of GnuPG.
  *
  * GnuPG is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * GnuPG 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 General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, see <https://www.gnu.org/licenses/>.
  * SPDX-License-Identifier: GPL-3.0-or-later
  */
 
 #include <config.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
 #include <unistd.h>
 #ifdef HAVE_STAT
 #include <sys/stat.h> /* for stat() */
 #endif
 #include <fcntl.h>
 #ifdef HAVE_W32_SYSTEM
 # ifdef HAVE_WINSOCK2_H
 #  include <winsock2.h>
 # endif
 # include <windows.h>
 #endif
 #include <npth.h>
 
 #define INCLUDED_BY_MAIN_MODULE 1
 #include "gpg.h"
 #include <assuan.h>
 #include "../common/iobuf.h"
 #include "../common/util.h"
 #include "packet.h"
 #include "../common/membuf.h"
 #include "main.h"
 #include "options.h"
 #include "keydb.h"
 #include "trustdb.h"
 #include "filter.h"
 #include "../common/ttyio.h"
 #include "../common/i18n.h"
 #include "../common/sysutils.h"
 #include "../common/status.h"
 #include "keyserver-internal.h"
 #include "exec.h"
 #include "../common/gc-opt-flags.h"
 #include "../common/asshelp.h"
 #include "call-dirmngr.h"
 #include "tofu.h"
 #include "objcache.h"
 #include "../common/init.h"
 #include "../common/mbox-util.h"
 #include "../common/zb32.h"
 #include "../common/shareddefs.h"
 #include "../common/compliance.h"
 #include "../common/comopt.h"
 
 #if defined(HAVE_DOSISH_SYSTEM) || defined(__CYGWIN__)
 #define MY_O_BINARY  O_BINARY
 #ifndef S_IRGRP
 # define S_IRGRP 0
 # define S_IWGRP 0
 #endif
 #else
 #define MY_O_BINARY  0
 #endif
 
 enum cmd_and_opt_values
   {
     aNull = 0,
     oArmor	  = 'a',
     aDetachedSign = 'b',
     aSym	  = 'c',
     aDecrypt	  = 'd',
     aEncr	  = 'e',
     oRecipientFile       = 'f',
     oHiddenRecipientFile = 'F',
     oInteractive  = 'i',
     aListKeys	  = 'k',
     oDryRun	  = 'n',
     oOutput	  = 'o',
     oQuiet	  = 'q',
     oRecipient	  = 'r',
     oHiddenRecipient = 'R',
     aSign	  = 's',
     oTextmodeShort= 't',
     oLocalUser	  = 'u',
     oVerbose	  = 'v',
     oCompress	  = 'z',
     oSetNotation  = 'N',
     aListSecretKeys = 'K',
     oBatch	  = 500,
     oMaxOutput,
     oInputSizeHint,
     oChunkSize,
     oSigNotation,
     oCertNotation,
     oShowNotation,
     oNoShowNotation,
     oKnownNotation,
     aEncrFiles,
     aEncrSym,
     aDecryptFiles,
     aClearsign,
     aStore,
     aQuickKeygen,
     aFullKeygen,
     aKeygen,
     aSignEncr,
     aSignEncrSym,
     aSignSym,
     aSignKey,
     aLSignKey,
     aQuickSignKey,
     aQuickLSignKey,
     aQuickRevSig,
     aQuickAddUid,
     aQuickAddKey,
     aQuickRevUid,
     aQuickSetExpire,
     aQuickSetPrimaryUid,
     aQuickUpdatePref,
     aListConfig,
     aListGcryptConfig,
     aGPGConfList,
     aGPGConfTest,
     aListPackets,
     aEditKey,
     aDeleteKeys,
     aDeleteSecretKeys,
     aDeleteSecretAndPublicKeys,
     aImport,
     aFastImport,
     aVerify,
     aVerifyFiles,
     aListSigs,
     aSendKeys,
     aRecvKeys,
     aLocateKeys,
     aLocateExtKeys,
     aSearchKeys,
     aRefreshKeys,
     aFetchKeys,
     aShowKeys,
     aExport,
     aExportSecret,
     aExportSecretSub,
     aExportSshKey,
     aExportSecretSshKey,
     aCheckKeys,
     aGenRevoke,
     aDesigRevoke,
     aPrimegen,
     aPrintMD,
     aPrintMDs,
     aCheckTrustDB,
     aUpdateTrustDB,
     aFixTrustDB,
     aListTrustDB,
     aListTrustPath,
     aExportOwnerTrust,
     aImportOwnerTrust,
     aDeArmor,
     aEnArmor,
     aGenRandom,
     aRebuildKeydbCaches,
     aCardStatus,
     aCardEdit,
     aChangePIN,
     aPasswd,
     aServer,
     aTOFUPolicy,
 
     oMimemode,
     oTextmode,
     oNoTextmode,
     oExpert,
     oNoExpert,
     oDefSigExpire,
     oAskSigExpire,
     oNoAskSigExpire,
     oDefCertExpire,
     oAskCertExpire,
     oNoAskCertExpire,
     oDefCertLevel,
     oMinCertLevel,
     oAskCertLevel,
     oNoAskCertLevel,
     oFingerprint,
     oWithFingerprint,
     oWithSubkeyFingerprint,
     oWithICAOSpelling,
     oWithKeygrip,
     oWithKeyScreening,
     oWithSecret,
     oWithWKDHash,
     oWithColons,
     oWithKeyData,
     oWithKeyOrigin,
     oWithTofuInfo,
     oWithSigList,
     oWithSigCheck,
     oAnswerYes,
     oAnswerNo,
     oKeyring,
     oPrimaryKeyring,
     oSecretKeyring,
     oShowKeyring,
     oDefaultKey,
     oDefRecipient,
     oDefRecipientSelf,
     oNoDefRecipient,
     oTrySecretKey,
     oOptions,
     oDebug,
     oDebugLevel,
     oDebugAll,
     oDebugIOLBF,
     oDebugSetIobufSize,
     oDebugAllowLargeChunks,
     oStatusFD,
     oStatusFile,
     oAttributeFD,
     oAttributeFile,
     oEmitVersion,
     oNoEmitVersion,
     oCompletesNeeded,
     oMarginalsNeeded,
     oMaxCertDepth,
     oLoadExtension,
     oCompliance,
     oGnuPG,
     oRFC2440,
     oRFC4880,
     oOpenPGP,
     oPGP7,
     oPGP8,
     oDE_VS,
     oMinRSALength,
     oRFC2440Text,
     oNoRFC2440Text,
     oCipherAlgo,
     oDigestAlgo,
     oCertDigestAlgo,
     oCompressAlgo,
     oCompressLevel,
     oBZ2CompressLevel,
     oBZ2DecompressLowmem,
     oPassphrase,
     oPassphraseFD,
     oPassphraseFile,
     oPassphraseRepeat,
     oPinentryMode,
     oCommandFD,
     oCommandFile,
     oQuickRandom,
     oNoVerbose,
     oTrustDBName,
     oNoSecmemWarn,
     oRequireSecmem,
     oNoRequireSecmem,
     oNoPermissionWarn,
     oNoArmor,
     oNoDefKeyring,
     oNoKeyring,
     oNoGreeting,
     oNoTTY,
     oNoOptions,
     oNoBatch,
     oHomedir,
     oSkipVerify,
     oSkipHiddenRecipients,
     oNoSkipHiddenRecipients,
     oAlwaysTrust,
     oTrustModel,
     oForceOwnertrust,
     oNoAutoTrustNewKey,
     oSetFilename,
     oForYourEyesOnly,
     oNoForYourEyesOnly,
     oSetPolicyURL,
     oSigPolicyURL,
     oCertPolicyURL,
     oShowPolicyURL,
     oNoShowPolicyURL,
     oSigKeyserverURL,
     oUseEmbeddedFilename,
     oNoUseEmbeddedFilename,
     oComment,
     oDefaultComment,
     oNoComments,
     oThrowKeyids,
     oNoThrowKeyids,
     oShowPhotos,
     oNoShowPhotos,
     oPhotoViewer,
     oForceAEAD,
     oS2KMode,
     oS2KDigest,
     oS2KCipher,
     oS2KCount,
     oDisplayCharset,
     oNotDashEscaped,
     oEscapeFrom,
     oNoEscapeFrom,
     oLockOnce,
     oLockMultiple,
     oLockNever,
     oKeyServer,
     oKeyServerOptions,
     oImportOptions,
     oImportFilter,
     oExportOptions,
     oExportFilter,
     oListOptions,
     oListFilter,
     oVerifyOptions,
     oTempDir,
     oExecPath,
     oEncryptTo,
     oHiddenEncryptTo,
     oNoEncryptTo,
     oEncryptToDefaultKey,
     oLoggerFD,
     oLoggerFile,
     oUtf8Strings,
     oNoUtf8Strings,
     oDisableCipherAlgo,
     oDisablePubkeyAlgo,
     oAllowNonSelfsignedUID,
     oNoAllowNonSelfsignedUID,
     oAllowFreeformUID,
     oNoAllowFreeformUID,
     oAllowSecretKeyImport,
     oAllowOldCipherAlgos,
     oEnableSpecialFilenames,
     oNoLiteral,
     oSetFilesize,
     oHonorHttpProxy,
     oFastListMode,
     oListOnly,
     oIgnoreTimeConflict,
     oIgnoreValidFrom,
     oIgnoreCrcError,
     oIgnoreMDCError,
     oShowSessionKey,
     oOverrideSessionKey,
     oOverrideSessionKeyFD,
     oNoRandomSeedFile,
     oAutoKeyRetrieve,
     oNoAutoKeyRetrieve,
     oAutoKeyImport,
     oNoAutoKeyImport,
     oUseAgent,
     oNoUseAgent,
     oGpgAgentInfo,
     oUseKeyboxd,
     oMergeOnly,
     oTryAllSecrets,
     oTrustedKey,
     oNoExpensiveTrustChecks,
     oFixedListMode,
     oLegacyListMode,
     oNoSigCache,
     oAutoCheckTrustDB,
     oNoAutoCheckTrustDB,
     oPreservePermissions,
     oDefaultPreferenceList,
     oDefaultKeyserverURL,
     oPersonalCipherPreferences,
     oPersonalDigestPreferences,
     oPersonalCompressPreferences,
     oAgentProgram,
     oKeyboxdProgram,
     oDirmngrProgram,
     oDisableDirmngr,
     oDisplay,
     oTTYname,
     oTTYtype,
     oLCctype,
     oLCmessages,
     oXauthority,
     oGroup,
     oUnGroup,
     oNoGroups,
     oStrict,
     oNoStrict,
     oMangleDosFilenames,
     oNoMangleDosFilenames,
     oEnableProgressFilter,
     oMultifile,
     oKeyidFormat,
     oExitOnStatusWriteError,
     oLimitCardInsertTries,
     oReaderPort,
     octapiDriver,
     opcscDriver,
     oDisableCCID,
     oRequireCrossCert,
     oNoRequireCrossCert,
     oAutoKeyLocate,
     oNoAutoKeyLocate,
     oEnableLargeRSA,
     oDisableLargeRSA,
     oEnableDSA2,
     oDisableDSA2,
     oAllowWeakDigestAlgos,
     oAllowWeakKeySignatures,
     oFakedSystemTime,
     oNoAutostart,
     oPrintDANERecords,
     oTOFUDefaultPolicy,
     oTOFUDBFormat,
     oDefaultNewKeyAlgo,
     oWeakDigest,
     oUnwrap,
     oOnlySignTextIDs,
     oDisableSignerUID,
     oSender,
     oKeyOrigin,
     oRequestOrigin,
     oNoSymkeyCache,
     oUseOnlyOpenPGPCard,
     oFullTimestrings,
     oIncludeKeyBlock,
     oNoIncludeKeyBlock,
     oChUid,
     oForceSignKey,
     oForbidGenKey,
     oRequireCompliance,
     oCompatibilityFlags,
 
     oNoop
   };
 
 
 static gpgrt_opt_t opts[] = {
 
   ARGPARSE_group (300, N_("@Commands:\n ")),
 
   ARGPARSE_c (aSign, "sign", N_("make a signature")),
   ARGPARSE_c (aClearsign, "clear-sign", N_("make a clear text signature")),
   ARGPARSE_c (aClearsign, "clearsign", "@"),
   ARGPARSE_c (aDetachedSign, "detach-sign", N_("make a detached signature")),
   ARGPARSE_c (aEncr, "encrypt",   N_("encrypt data")),
   ARGPARSE_c (aEncrFiles, "encrypt-files", "@"),
   ARGPARSE_c (aSym, "symmetric", N_("encryption only with symmetric cipher")),
   ARGPARSE_c (aStore, "store",     "@"),
   ARGPARSE_c (aDecrypt, "decrypt",   N_("decrypt data (default)")),
   ARGPARSE_c (aDecryptFiles, "decrypt-files", "@"),
   ARGPARSE_c (aVerify, "verify"   , N_("verify a signature")),
   ARGPARSE_c (aVerifyFiles, "verify-files" , "@" ),
   ARGPARSE_c (aListKeys, "list-keys", N_("list keys")),
   ARGPARSE_c (aListKeys, "list-public-keys", "@" ),
   ARGPARSE_c (aListSigs, "list-signatures", N_("list keys and signatures")),
   ARGPARSE_c (aListSigs, "list-sigs", "@"),
   ARGPARSE_c (aCheckKeys, "check-signatures",
 	      N_("list and check key signatures")),
   ARGPARSE_c (aCheckKeys, "check-sigs", "@"),
   ARGPARSE_c (oFingerprint, "fingerprint", N_("list keys and fingerprints")),
   ARGPARSE_c (aListSecretKeys, "list-secret-keys", N_("list secret keys")),
   ARGPARSE_c (aKeygen,	    "generate-key",
               N_("generate a new key pair")),
   ARGPARSE_c (aKeygen,	    "gen-key", "@"),
   ARGPARSE_c (aQuickKeygen, "quick-generate-key" ,
               N_("quickly generate a new key pair")),
   ARGPARSE_c (aQuickKeygen, "quick-gen-key", "@"),
   ARGPARSE_c (aQuickAddUid,  "quick-add-uid",
               N_("quickly add a new user-id")),
   ARGPARSE_c (aQuickAddUid,  "quick-adduid", "@"),
   ARGPARSE_c (aQuickAddKey,  "quick-add-key", "@"),
   ARGPARSE_c (aQuickAddKey,  "quick-addkey", "@"),
   ARGPARSE_c (aQuickRevUid,  "quick-revoke-uid",
               N_("quickly revoke a user-id")),
   ARGPARSE_c (aQuickRevUid,  "quick-revuid", "@"),
   ARGPARSE_c (aQuickSetExpire,  "quick-set-expire",
               N_("quickly set a new expiration date")),
   ARGPARSE_c (aQuickSetPrimaryUid,  "quick-set-primary-uid", "@"),
   ARGPARSE_c (aQuickUpdatePref,  "quick-update-pref", "@"),
   ARGPARSE_c (aFullKeygen,  "full-generate-key" ,
               N_("full featured key pair generation")),
   ARGPARSE_c (aFullKeygen,  "full-gen-key", "@"),
   ARGPARSE_c (aGenRevoke, "generate-revocation",
 	      N_("generate a revocation certificate")),
   ARGPARSE_c (aGenRevoke, "gen-revoke", "@"),
   ARGPARSE_c (aDeleteKeys,"delete-keys",
               N_("remove keys from the public keyring")),
   ARGPARSE_c (aDeleteSecretKeys, "delete-secret-keys",
               N_("remove keys from the secret keyring")),
   ARGPARSE_c (aQuickSignKey,  "quick-sign-key" ,
               N_("quickly sign a key")),
   ARGPARSE_c (aQuickLSignKey, "quick-lsign-key",
               N_("quickly sign a key locally")),
   ARGPARSE_c (aQuickRevSig,   "quick-revoke-sig" ,
               N_("quickly revoke a key signature")),
   ARGPARSE_c (aSignKey,  "sign-key"   ,N_("sign a key")),
   ARGPARSE_c (aLSignKey, "lsign-key"  ,N_("sign a key locally")),
   ARGPARSE_c (aEditKey,  "edit-key"   ,N_("sign or edit a key")),
   ARGPARSE_c (aEditKey,  "key-edit"   ,"@"),
   ARGPARSE_c (aPasswd,   "change-passphrase", N_("change a passphrase")),
   ARGPARSE_c (aPasswd,   "passwd", "@"),
   ARGPARSE_c (aDesigRevoke, "generate-designated-revocation", "@"),
   ARGPARSE_c (aDesigRevoke, "desig-revoke","@" ),
   ARGPARSE_c (aExport, "export"           , N_("export keys") ),
   ARGPARSE_c (aSendKeys, "send-keys"     , N_("export keys to a keyserver") ),
   ARGPARSE_c (aRecvKeys, "receive-keys" , N_("import keys from a keyserver") ),
   ARGPARSE_c (aRecvKeys, "recv-keys"     , "@"),
   ARGPARSE_c (aSearchKeys, "search-keys" ,
               N_("search for keys on a keyserver") ),
   ARGPARSE_c (aRefreshKeys, "refresh-keys",
               N_("update all keys from a keyserver")),
   ARGPARSE_c (aLocateKeys, "locate-keys", "@"),
   ARGPARSE_c (aLocateExtKeys, "locate-external-keys", "@"),
   ARGPARSE_c (aFetchKeys, "fetch-keys" , "@" ),
   ARGPARSE_c (aShowKeys, "show-keys" , "@" ),
   ARGPARSE_c (aExportSecret, "export-secret-keys" , "@" ),
   ARGPARSE_c (aExportSecretSub, "export-secret-subkeys" , "@" ),
   ARGPARSE_c (aExportSshKey, "export-ssh-key", "@" ),
   ARGPARSE_c (aExportSecretSshKey, "export-secret-ssh-key", "@" ),
   ARGPARSE_c (aImport, "import", N_("import/merge keys")),
   ARGPARSE_c (aFastImport, "fast-import", "@"),
 #ifdef ENABLE_CARD_SUPPORT
   ARGPARSE_c (aCardStatus,  "card-status", N_("print the card status")),
   ARGPARSE_c (aCardEdit,   "edit-card",  N_("change data on a card")),
   ARGPARSE_c (aCardEdit,   "card-edit", "@"),
   ARGPARSE_c (aChangePIN,  "change-pin", N_("change a card's PIN")),
 #endif
   ARGPARSE_c (aListConfig, "list-config", "@"),
   ARGPARSE_c (aListGcryptConfig, "list-gcrypt-config", "@"),
   ARGPARSE_c (aGPGConfList, "gpgconf-list", "@" ),
   ARGPARSE_c (aGPGConfTest, "gpgconf-test", "@" ),
   ARGPARSE_c (aListPackets, "list-packets","@"),
 
 #ifndef NO_TRUST_MODELS
   ARGPARSE_c (aExportOwnerTrust, "export-ownertrust", "@"),
   ARGPARSE_c (aImportOwnerTrust, "import-ownertrust", "@"),
   ARGPARSE_c (aUpdateTrustDB,"update-trustdb",
               N_("update the trust database")),
   ARGPARSE_c (aCheckTrustDB, "check-trustdb", "@"),
   ARGPARSE_c (aFixTrustDB, "fix-trustdb", "@"),
   ARGPARSE_c (aListTrustDB, "list-trustdb", "@"),
 #endif
 
   ARGPARSE_c (aDeArmor, "dearmor", "@"),
   ARGPARSE_c (aDeArmor, "dearmour", "@"),
   ARGPARSE_c (aEnArmor, "enarmor", "@"),
   ARGPARSE_c (aEnArmor, "enarmour", "@"),
   ARGPARSE_c (aPrintMD, "print-md", N_("print message digests")),
   ARGPARSE_c (aPrintMDs, "print-mds", "@"), /* old */
   ARGPARSE_c (aPrimegen, "gen-prime", "@" ),
   ARGPARSE_c (aGenRandom,"gen-random", "@" ),
   ARGPARSE_c (aServer,   "server",  N_("run in server mode")),
   ARGPARSE_c (aTOFUPolicy, "tofu-policy",
 	      N_("|VALUE|set the TOFU policy for a key")),
   /* Not yet used:
      ARGPARSE_c (aListTrustPath, "list-trust-path", "@"), */
   ARGPARSE_c (aDeleteSecretAndPublicKeys,
               "delete-secret-and-public-keys", "@"),
   ARGPARSE_c (aRebuildKeydbCaches, "rebuild-keydb-caches", "@"),
   ARGPARSE_c (aListKeys, "list-key", "@"),   /* alias */
   ARGPARSE_c (aListSigs, "list-sig", "@"),   /* alias */
   ARGPARSE_c (aCheckKeys, "check-sig", "@"), /* alias */
   ARGPARSE_c (aShowKeys,  "show-key", "@"), /* alias */
 
 
 
   ARGPARSE_header ("Monitor", N_("Options controlling the diagnostic output")),
 
   ARGPARSE_s_n (oVerbose, "verbose", N_("verbose")),
   ARGPARSE_s_n (oNoVerbose, "no-verbose", "@"),
   ARGPARSE_s_n (oQuiet,	  "quiet",   N_("be somewhat more quiet")),
   ARGPARSE_s_n (oNoTTY,   "no-tty",  "@"),
   ARGPARSE_s_n (oNoGreeting, "no-greeting", "@"),
   ARGPARSE_s_s (oDebug, "debug", "@"),
   ARGPARSE_s_s (oDebugLevel, "debug-level", "@"),
   ARGPARSE_s_n (oDebugAll, "debug-all", "@"),
   ARGPARSE_s_n (oDebugIOLBF, "debug-iolbf", "@"),
   ARGPARSE_s_u (oDebugSetIobufSize, "debug-set-iobuf-size", "@"),
   ARGPARSE_s_u (oDebugAllowLargeChunks, "debug-allow-large-chunks", "@"),
   ARGPARSE_s_s (oDisplayCharset, "display-charset", "@"),
   ARGPARSE_s_s (oDisplayCharset, "charset", "@"),
   ARGPARSE_conffile (oOptions, "options", N_("|FILE|read options from FILE")),
   ARGPARSE_noconffile (oNoOptions, "no-options", "@"),
   ARGPARSE_s_i (oLoggerFD,   "logger-fd", "@"),
   ARGPARSE_s_s (oLoggerFile, "log-file",
                 N_("|FILE|write server mode logs to FILE")),
   ARGPARSE_s_s (oLoggerFile, "logger-file", "@"),  /* 1.4 compatibility.  */
   ARGPARSE_s_n (oQuickRandom, "debug-quick-random", "@"),
 
 
   ARGPARSE_header ("Configuration",
                    N_("Options controlling the configuration")),
 
   ARGPARSE_s_s (oHomedir, "homedir", "@"),
   ARGPARSE_s_s (oFakedSystemTime, "faked-system-time", "@"),
   ARGPARSE_s_s (oDefaultKey, "default-key",
                 N_("|NAME|use NAME as default secret key")),
   ARGPARSE_s_s (oEncryptTo,      "encrypt-to",
                 N_("|NAME|encrypt to user ID NAME as well")),
   ARGPARSE_s_n (oNoEncryptTo, "no-encrypt-to", "@"),
   ARGPARSE_s_s (oHiddenEncryptTo, "hidden-encrypt-to", "@"),
   ARGPARSE_s_n (oEncryptToDefaultKey, "encrypt-to-default-key", "@"),
   ARGPARSE_s_s (oDefRecipient, "default-recipient", "@"),
   ARGPARSE_s_n (oDefRecipientSelf,  "default-recipient-self", "@"),
   ARGPARSE_s_n (oNoDefRecipient, "no-default-recipient", "@"),
   ARGPARSE_s_s (oGroup,      "group",
                 N_("|SPEC|set up email aliases")),
   ARGPARSE_s_s (oUnGroup,    "ungroup",    "@"),
   ARGPARSE_s_n (oNoGroups,   "no-groups",  "@"),
   ARGPARSE_s_s (oCompliance, "compliance",   "@"),
   ARGPARSE_s_n (oGnuPG, "gnupg",   "@"),
   ARGPARSE_s_n (oGnuPG, "no-pgp2", "@"),
   ARGPARSE_s_n (oGnuPG, "no-pgp6", "@"),
   ARGPARSE_s_n (oGnuPG, "no-pgp7", "@"),
   ARGPARSE_s_n (oGnuPG, "no-pgp8", "@"),
   ARGPARSE_s_n (oRFC2440, "rfc2440", "@"),
   ARGPARSE_s_n (oRFC4880, "rfc4880", "@"),
   ARGPARSE_s_n (oOpenPGP, "openpgp", N_("use strict OpenPGP behavior")),
   ARGPARSE_s_n (oPGP7, "pgp6", "@"),
   ARGPARSE_s_n (oPGP7, "pgp7", "@"),
   ARGPARSE_s_n (oPGP8, "pgp8", "@"),
   ARGPARSE_s_s (oDefaultNewKeyAlgo, "default-new-key-algo", "@"),
   ARGPARSE_p_u (oMinRSALength, "min-rsa-length", "@"),
 #ifndef NO_TRUST_MODELS
   ARGPARSE_s_n (oAlwaysTrust, "always-trust", "@"),
 #endif
   ARGPARSE_s_s (oTrustModel, "trust-model", "@"),
   ARGPARSE_s_s (oPhotoViewer,  "photo-viewer", "@"),
   ARGPARSE_s_s (oKnownNotation, "known-notation", "@"),
   ARGPARSE_s_s (oAgentProgram, "agent-program", "@"),
   ARGPARSE_s_s (oKeyboxdProgram, "keyboxd-program", "@"),
   ARGPARSE_s_s (oDirmngrProgram, "dirmngr-program", "@"),
   ARGPARSE_s_n (oExitOnStatusWriteError, "exit-on-status-write-error", "@"),
   ARGPARSE_s_i (oLimitCardInsertTries, "limit-card-insert-tries", "@"),
   ARGPARSE_s_n (oEnableProgressFilter, "enable-progress-filter", "@"),
   ARGPARSE_s_s (oTempDir,  "temp-directory", "@"),
   ARGPARSE_s_s (oExecPath, "exec-path", "@"),
   ARGPARSE_s_n (oExpert,      "expert", "@"),
   ARGPARSE_s_n (oNoExpert, "no-expert", "@"),
   ARGPARSE_s_n (oNoSecmemWarn, "no-secmem-warning", "@"),
   ARGPARSE_s_n (oRequireSecmem, "require-secmem", "@"),
   ARGPARSE_s_n (oNoRequireSecmem, "no-require-secmem", "@"),
   ARGPARSE_s_n (oNoPermissionWarn, "no-permission-warning", "@"),
   ARGPARSE_s_n (oDryRun, "dry-run", N_("do not make any changes")),
   ARGPARSE_s_n (oInteractive, "interactive", N_("prompt before overwriting")),
   ARGPARSE_s_s (oDefSigExpire, "default-sig-expire", "@"),
   ARGPARSE_s_n (oAskSigExpire,      "ask-sig-expire", "@"),
   ARGPARSE_s_n (oNoAskSigExpire, "no-ask-sig-expire", "@"),
   ARGPARSE_s_s (oDefCertExpire, "default-cert-expire", "@"),
   ARGPARSE_s_n (oAskCertExpire,      "ask-cert-expire", "@"),
   ARGPARSE_s_n (oNoAskCertExpire, "no-ask-cert-expire", "@"),
   ARGPARSE_s_i (oDefCertLevel, "default-cert-level", "@"),
   ARGPARSE_s_i (oMinCertLevel, "min-cert-level", "@"),
   ARGPARSE_s_n (oAskCertLevel,      "ask-cert-level", "@"),
   ARGPARSE_s_n (oNoAskCertLevel, "no-ask-cert-level", "@"),
   ARGPARSE_s_n (oOnlySignTextIDs, "only-sign-text-ids", "@"),
   ARGPARSE_s_n (oEnableLargeRSA, "enable-large-rsa", "@"),
   ARGPARSE_s_n (oDisableLargeRSA, "disable-large-rsa", "@"),
   ARGPARSE_s_n (oEnableDSA2, "enable-dsa2", "@"),
   ARGPARSE_s_n (oDisableDSA2, "disable-dsa2", "@"),
   ARGPARSE_s_s (oPersonalCipherPreferences, "personal-cipher-preferences","@"),
   ARGPARSE_s_s (oPersonalDigestPreferences, "personal-digest-preferences","@"),
   ARGPARSE_s_s (oPersonalCompressPreferences,
                                          "personal-compress-preferences", "@"),
   ARGPARSE_s_s (oDefaultPreferenceList,  "default-preference-list", "@"),
   ARGPARSE_s_s (oDefaultKeyserverURL,  "default-keyserver-url", "@"),
   ARGPARSE_s_n (oNoExpensiveTrustChecks, "no-expensive-trust-checks", "@"),
   ARGPARSE_s_n (oAllowNonSelfsignedUID,      "allow-non-selfsigned-uid", "@"),
   ARGPARSE_s_n (oNoAllowNonSelfsignedUID, "no-allow-non-selfsigned-uid", "@"),
   ARGPARSE_s_n (oAllowFreeformUID,      "allow-freeform-uid", "@"),
   ARGPARSE_s_n (oNoAllowFreeformUID, "no-allow-freeform-uid", "@"),
   ARGPARSE_s_n (oPreservePermissions, "preserve-permissions", "@"),
   ARGPARSE_s_i (oDefCertLevel, "default-cert-check-level", "@"), /* old */
   ARGPARSE_s_s (oTOFUDefaultPolicy, "tofu-default-policy", "@"),
   ARGPARSE_s_n (oLockOnce,     "lock-once", "@"),
   ARGPARSE_s_n (oLockMultiple, "lock-multiple", "@"),
   ARGPARSE_s_n (oLockNever,    "lock-never", "@"),
   ARGPARSE_s_s (oCompressAlgo,"compress-algo", "@"),
   ARGPARSE_s_s (oCompressAlgo, "compression-algo", "@"), /* Alias */
   ARGPARSE_s_n (oBZ2DecompressLowmem, "bzip2-decompress-lowmem", "@"),
   ARGPARSE_s_i (oCompletesNeeded, "completes-needed", "@"),
   ARGPARSE_s_i (oMarginalsNeeded, "marginals-needed", "@"),
   ARGPARSE_s_i (oMaxCertDepth,	"max-cert-depth", "@" ),
 #ifndef NO_TRUST_MODELS
   ARGPARSE_s_s (oTrustDBName, "trustdb-name", "@"),
   ARGPARSE_s_n (oAutoCheckTrustDB, "auto-check-trustdb", "@"),
   ARGPARSE_s_n (oNoAutoCheckTrustDB, "no-auto-check-trustdb", "@"),
   ARGPARSE_s_s (oForceOwnertrust, "force-ownertrust", "@"),
   ARGPARSE_s_n (oNoAutoTrustNewKey, "no-auto-trust-new-key", "@"),
 #endif
 
 
   ARGPARSE_header ("Input", N_("Options controlling the input")),
 
   ARGPARSE_s_n (oMultifile, "multifile", "@"),
   ARGPARSE_s_s (oInputSizeHint, "input-size-hint", "@"),
   ARGPARSE_s_n (oUtf8Strings,      "utf8-strings", "@"),
   ARGPARSE_s_n (oNoUtf8Strings, "no-utf8-strings", "@"),
   ARGPARSE_p_u (oSetFilesize, "set-filesize", "@"),
   ARGPARSE_s_n (oNoLiteral, "no-literal", "@"),
   ARGPARSE_s_s (oSetNotation,  "set-notation", "@"),
   ARGPARSE_s_s (oSigNotation,  "sig-notation", "@"),
   ARGPARSE_s_s (oCertNotation, "cert-notation", "@"),
   ARGPARSE_s_s (oSetPolicyURL,  "set-policy-url", "@"),
   ARGPARSE_s_s (oSigPolicyURL,  "sig-policy-url", "@"),
   ARGPARSE_s_s (oCertPolicyURL, "cert-policy-url", "@"),
   ARGPARSE_s_s (oSigKeyserverURL, "sig-keyserver-url", "@"),
 
 
 
   ARGPARSE_header ("Output", N_("Options controlling the output")),
 
   ARGPARSE_s_n (oArmor, "armor", N_("create ascii armored output")),
   ARGPARSE_s_n (oArmor, "armour", "@"),
   ARGPARSE_s_n (oNoArmor, "no-armor", "@"),
   ARGPARSE_s_n (oNoArmor, "no-armour", "@"),
   ARGPARSE_s_s (oOutput, "output", N_("|FILE|write output to FILE")),
   ARGPARSE_p_u (oMaxOutput, "max-output", "@"),
   ARGPARSE_s_s (oComment, "comment", "@"),
   ARGPARSE_s_n (oDefaultComment, "default-comment", "@"),
   ARGPARSE_s_n (oNoComments, "no-comments", "@"),
   ARGPARSE_s_n (oEmitVersion,      "emit-version", "@"),
   ARGPARSE_s_n (oNoEmitVersion, "no-emit-version", "@"),
   ARGPARSE_s_n (oNoEmitVersion, "no-version", "@"), /* alias */
   ARGPARSE_s_n (oNotDashEscaped, "not-dash-escaped", "@"),
   ARGPARSE_s_n (oEscapeFrom,      "escape-from-lines", "@"),
   ARGPARSE_s_n (oNoEscapeFrom, "no-escape-from-lines", "@"),
   ARGPARSE_s_n (oMimemode, "mimemode", "@"),
   ARGPARSE_s_n (oTextmodeShort, NULL, "@"),
   ARGPARSE_s_n (oTextmode,   "textmode", N_("use canonical text mode")),
   ARGPARSE_s_n (oNoTextmode, "no-textmode", "@"),
   ARGPARSE_s_s (oSetFilename, "set-filename", "@"),
   ARGPARSE_s_n (oForYourEyesOnly, "for-your-eyes-only", "@"),
   ARGPARSE_s_n (oNoForYourEyesOnly, "no-for-your-eyes-only", "@"),
   ARGPARSE_s_n (oShowNotation,      "show-notation", "@"),
   ARGPARSE_s_n (oNoShowNotation, "no-show-notation", "@"),
   ARGPARSE_s_n (oShowSessionKey, "show-session-key", "@"),
   ARGPARSE_s_n (oUseEmbeddedFilename,      "use-embedded-filename", "@"),
   ARGPARSE_s_n (oNoUseEmbeddedFilename, "no-use-embedded-filename", "@"),
   ARGPARSE_s_n (oUnwrap, "unwrap", "@"),
   ARGPARSE_s_n (oMangleDosFilenames,      "mangle-dos-filenames", "@"),
   ARGPARSE_s_n (oNoMangleDosFilenames, "no-mangle-dos-filenames", "@"),
   ARGPARSE_s_i (oChunkSize, "chunk-size", "@"),
   ARGPARSE_s_n (oNoSymkeyCache, "no-symkey-cache", "@"),
   ARGPARSE_s_n (oSkipVerify, "skip-verify", "@"),
   ARGPARSE_s_n (oListOnly, "list-only", "@"),
   ARGPARSE_s_i (oCompress, NULL,
                 N_("|N|set compress level to N (0 disables)")),
   ARGPARSE_s_i (oCompressLevel, "compress-level", "@"),
   ARGPARSE_s_i (oBZ2CompressLevel, "bzip2-compress-level", "@"),
   ARGPARSE_s_n (oDisableSignerUID, "disable-signer-uid", "@"),
 
   ARGPARSE_header ("ImportExport",
                    N_("Options controlling key import and export")),
 
   ARGPARSE_s_s (oAutoKeyLocate, "auto-key-locate",
               N_("|MECHANISMS|use MECHANISMS to locate keys by mail address")),
   ARGPARSE_s_n (oNoAutoKeyLocate, "no-auto-key-locate", "@"),
   ARGPARSE_s_n (oAutoKeyImport,   "auto-key-import",
                 N_("import missing key from a signature")),
   ARGPARSE_s_n (oNoAutoKeyImport, "no-auto-key-import", "@"),
   ARGPARSE_s_n (oAutoKeyRetrieve, "auto-key-retrieve", "@"),
   ARGPARSE_s_n (oNoAutoKeyRetrieve, "no-auto-key-retrieve", "@"),
   ARGPARSE_s_n (oIncludeKeyBlock, "include-key-block",
                 N_("include the public key in signatures")),
   ARGPARSE_s_n (oNoIncludeKeyBlock, "no-include-key-block", "@"),
   ARGPARSE_s_n (oDisableDirmngr, "disable-dirmngr",
                 N_("disable all access to the dirmngr")),
   ARGPARSE_s_s (oKeyServer, "keyserver", "@"), /* Deprecated.  */
   ARGPARSE_s_s (oKeyServerOptions, "keyserver-options", "@"),
   ARGPARSE_s_s (oKeyOrigin, "key-origin", "@"),
   ARGPARSE_s_s (oImportOptions, "import-options", "@"),
   ARGPARSE_s_s (oImportFilter,  "import-filter", "@"),
   ARGPARSE_s_s (oExportOptions, "export-options", "@"),
   ARGPARSE_s_s (oExportFilter,  "export-filter", "@"),
   ARGPARSE_s_n (oMergeOnly,	  "merge-only", "@" ),
   ARGPARSE_s_n (oAllowSecretKeyImport, "allow-secret-key-import", "@"),
 
 
   ARGPARSE_header ("Keylist", N_("Options controlling key listings")),
 
   ARGPARSE_s_s (oListOptions,   "list-options", "@"),
   ARGPARSE_s_s (oListFilter,    "list-filter", "@"),
   ARGPARSE_s_n (oFullTimestrings, "full-timestrings", "@"),
   ARGPARSE_s_n (oShowPhotos,   "show-photos", "@"),
   ARGPARSE_s_n (oNoShowPhotos, "no-show-photos", "@"),
   ARGPARSE_s_n (oShowPolicyURL,      "show-policy-url", "@"),
   ARGPARSE_s_n (oNoShowPolicyURL, "no-show-policy-url", "@"),
   ARGPARSE_s_n (oWithColons, "with-colons", "@"),
   ARGPARSE_s_n (oWithTofuInfo,"with-tofu-info", "@"),
   ARGPARSE_s_n (oWithKeyData,"with-key-data", "@"),
   ARGPARSE_s_n (oWithSigList,"with-sig-list", "@"),
   ARGPARSE_s_n (oWithSigCheck,"with-sig-check", "@"),
   ARGPARSE_s_n (oWithFingerprint, "with-fingerprint", "@"),
   ARGPARSE_s_n (oWithSubkeyFingerprint, "with-subkey-fingerprint", "@"),
   ARGPARSE_s_n (oWithSubkeyFingerprint, "with-subkey-fingerprints", "@"),
   ARGPARSE_s_n (oWithICAOSpelling, "with-icao-spelling", "@"),
   ARGPARSE_s_n (oWithKeygrip,     "with-keygrip", "@"),
   ARGPARSE_s_n (oWithKeyScreening,"with-key-screening", "@"),
   ARGPARSE_s_n (oWithSecret,      "with-secret", "@"),
   ARGPARSE_s_n (oWithWKDHash,     "with-wkd-hash", "@"),
   ARGPARSE_s_n (oWithKeyOrigin,   "with-key-origin", "@"),
   ARGPARSE_s_n (oFastListMode, "fast-list-mode", "@"),
   ARGPARSE_s_n (oFixedListMode, "fixed-list-mode", "@"),
   ARGPARSE_s_n (oLegacyListMode, "legacy-list-mode", "@"),
   ARGPARSE_s_n (oPrintDANERecords, "print-dane-records", "@"),
   ARGPARSE_s_s (oKeyidFormat, "keyid-format", "@"),
   ARGPARSE_s_n (oShowKeyring, "show-keyring", "@"),
 
 
   ARGPARSE_header (NULL, N_("Options to specify keys")),
 
   ARGPARSE_s_s (oRecipient, "recipient", N_("|USER-ID|encrypt for USER-ID")),
   ARGPARSE_s_s (oHiddenRecipient, "hidden-recipient", "@"),
   ARGPARSE_s_s (oRecipientFile, "recipient-file", "@"),
   ARGPARSE_s_s (oHiddenRecipientFile, "hidden-recipient-file", "@"),
   ARGPARSE_s_s (oRecipient, "remote-user", "@"),  /* (old option name) */
   ARGPARSE_s_n (oThrowKeyids, "throw-keyids", "@"),
   ARGPARSE_s_n (oNoThrowKeyids, "no-throw-keyids", "@"),
   ARGPARSE_s_s (oLocalUser, "local-user",
                 N_("|USER-ID|use USER-ID to sign or decrypt")),
   ARGPARSE_s_s (oTrustedKey, "trusted-key", "@"),
   ARGPARSE_s_s (oSender, "sender", "@"),
   ARGPARSE_s_s (oTrySecretKey, "try-secret-key", "@"),
   ARGPARSE_s_n (oTryAllSecrets,  "try-all-secrets", "@"),
   ARGPARSE_s_n (oNoDefKeyring, "no-default-keyring", "@"),
   ARGPARSE_s_n (oNoKeyring, "no-keyring", "@"),
   ARGPARSE_s_s (oKeyring, "keyring", "@"),
   ARGPARSE_s_s (oPrimaryKeyring, "primary-keyring", "@"),
   ARGPARSE_s_s (oSecretKeyring, "secret-keyring", "@"),
   ARGPARSE_s_n (oSkipHiddenRecipients, "skip-hidden-recipients", "@"),
   ARGPARSE_s_n (oNoSkipHiddenRecipients, "no-skip-hidden-recipients", "@"),
   ARGPARSE_s_s (oOverrideSessionKey, "override-session-key", "@"),
   ARGPARSE_s_i (oOverrideSessionKeyFD, "override-session-key-fd", "@"),
 
   ARGPARSE_header ("Security", N_("Options controlling the security")),
 
   ARGPARSE_s_i (oS2KMode, "s2k-mode", "@"),
   ARGPARSE_s_s (oS2KDigest, "s2k-digest-algo", "@"),
   ARGPARSE_s_s (oS2KCipher, "s2k-cipher-algo", "@"),
   ARGPARSE_s_i (oS2KCount, "s2k-count", "@"),
   ARGPARSE_s_n (oForceAEAD, "force-ocb", "@"),
   ARGPARSE_s_n (oForceAEAD, "force-aead", "@"),  /*(old name)*/
   ARGPARSE_s_n (oRequireCrossCert, "require-backsigs", "@"),
   ARGPARSE_s_n (oRequireCrossCert, "require-cross-certification", "@"),
   ARGPARSE_s_n (oNoRequireCrossCert, "no-require-backsigs", "@"),
   ARGPARSE_s_n (oNoRequireCrossCert, "no-require-cross-certification", "@"),
   /* Options to override new security defaults.  */
   ARGPARSE_s_n (oAllowWeakKeySignatures, "allow-weak-key-signatures", "@"),
   ARGPARSE_s_n (oAllowWeakDigestAlgos, "allow-weak-digest-algos", "@"),
   ARGPARSE_s_n (oAllowOldCipherAlgos, "allow-old-cipher-algos", "@"),
   ARGPARSE_s_s (oWeakDigest, "weak-digest","@"),
   ARGPARSE_s_s (oVerifyOptions, "verify-options", "@"),
   ARGPARSE_s_n (oEnableSpecialFilenames, "enable-special-filenames", "@"),
   ARGPARSE_s_n (oNoRandomSeedFile,  "no-random-seed-file", "@"),
   ARGPARSE_s_n (oNoSigCache,         "no-sig-cache", "@"),
   ARGPARSE_s_n (oIgnoreTimeConflict, "ignore-time-conflict", "@"),
   ARGPARSE_s_n (oIgnoreValidFrom,    "ignore-valid-from", "@"),
   ARGPARSE_s_n (oIgnoreCrcError, "ignore-crc-error", "@"),
   ARGPARSE_s_n (oIgnoreMDCError, "ignore-mdc-error", "@"),
   ARGPARSE_s_s (oDisableCipherAlgo,  "disable-cipher-algo", "@"),
   ARGPARSE_s_s (oDisablePubkeyAlgo,  "disable-pubkey-algo", "@"),
   ARGPARSE_s_s (oCipherAlgo, "cipher-algo", "@"),
   ARGPARSE_s_s (oDigestAlgo, "digest-algo", "@"),
   ARGPARSE_s_s (oCertDigestAlgo, "cert-digest-algo", "@"),
 
 
   ARGPARSE_header (NULL, N_("Options for unattended use")),
 
   ARGPARSE_s_n (oBatch, "batch", "@"),
   ARGPARSE_s_n (oNoBatch, "no-batch", "@"),
   ARGPARSE_s_n (oAnswerYes, "yes", "@"),
   ARGPARSE_s_n (oAnswerNo, "no", "@"),
   ARGPARSE_s_i (oStatusFD, "status-fd", "@"),
   ARGPARSE_s_s (oStatusFile, "status-file", "@"),
   ARGPARSE_s_i (oAttributeFD, "attribute-fd", "@"),
   ARGPARSE_s_s (oAttributeFile, "attribute-file", "@"),
   ARGPARSE_s_i (oCommandFD, "command-fd", "@"),
   ARGPARSE_s_s (oCommandFile, "command-file", "@"),
   ARGPARSE_o_s (oPassphrase,      "passphrase", "@"),
   ARGPARSE_s_i (oPassphraseFD,    "passphrase-fd", "@"),
   ARGPARSE_s_s (oPassphraseFile,  "passphrase-file", "@"),
   ARGPARSE_s_i (oPassphraseRepeat,"passphrase-repeat", "@"),
   ARGPARSE_s_s (oPinentryMode,    "pinentry-mode", "@"),
   ARGPARSE_s_n (oForceSignKey,    "force-sign-key", "@"),
 
   ARGPARSE_header (NULL, N_("Other options")),
 
   ARGPARSE_s_s (oRequestOrigin,   "request-origin", "@"),
   ARGPARSE_s_s (oDisplay,    "display",    "@"),
   ARGPARSE_s_s (oTTYname,    "ttyname",    "@"),
   ARGPARSE_s_s (oTTYtype,    "ttytype",    "@"),
   ARGPARSE_s_s (oLCctype,    "lc-ctype",   "@"),
   ARGPARSE_s_s (oLCmessages, "lc-messages","@"),
   ARGPARSE_s_s (oXauthority, "xauthority", "@"),
   ARGPARSE_s_s (oChUid,      "chuid",      "@"),
   ARGPARSE_s_n (oNoAutostart, "no-autostart", "@"),
   ARGPARSE_s_n (oUseKeyboxd,    "use-keyboxd", "@"),
   ARGPARSE_s_n (oForbidGenKey,  "forbid-gen-key", "@"),
   ARGPARSE_s_n (oRequireCompliance, "require-compliance", "@"),
   ARGPARSE_s_s (oCompatibilityFlags, "compatibility-flags", "@"),
   /* Options which can be used in special circumstances. They are not
    * published and we hope they are never required.  */
   ARGPARSE_s_n (oUseOnlyOpenPGPCard, "use-only-openpgp-card", "@"),
   /* Esoteric compatibility options.  */
   ARGPARSE_s_n (oRFC2440Text,      "rfc2440-text", "@"),
   ARGPARSE_s_n (oNoRFC2440Text, "no-rfc2440-text", "@"),
 
   ARGPARSE_header (NULL, ""),  /* Stop the header group.  */
 
   /* Aliases.  I constantly mistype these, and assume other people do
      as well. */
   ARGPARSE_s_s (oPersonalCipherPreferences, "personal-cipher-prefs", "@"),
   ARGPARSE_s_s (oPersonalCompressPreferences, "personal-compress-prefs", "@"),
 
   /* These two are aliases to help users of the PGP command line
      product use gpg with minimal pain.  Many commands are common
      already as they seem to have borrowed commands from us.  Now I'm
      returning the favor. */
   ARGPARSE_s_s (oLocalUser, "sign-with", "@"),
   ARGPARSE_s_s (oRecipient, "user", "@"),
 
 
   /* Dummy options with warnings.  */
   ARGPARSE_s_n (oUseAgent,      "use-agent", "@"),
   ARGPARSE_s_n (oNoUseAgent, "no-use-agent", "@"),
   ARGPARSE_s_s (oGpgAgentInfo, "gpg-agent-info", "@"),
   ARGPARSE_s_s (oReaderPort, "reader-port", "@"),
   ARGPARSE_s_s (octapiDriver, "ctapi-driver", "@"),
   ARGPARSE_s_s (opcscDriver, "pcsc-driver", "@"),
   ARGPARSE_s_n (oDisableCCID, "disable-ccid", "@"),
   ARGPARSE_s_n (oHonorHttpProxy, "honor-http-proxy", "@"),
   ARGPARSE_s_s (oTOFUDBFormat, "tofu-db-format", "@"),
 
   /* Dummy options.  */
   ARGPARSE_ignore (oStrict,     "strict"),
   ARGPARSE_ignore (oNoStrict,   "no-strict"),
   ARGPARSE_ignore (oLoadExtension, "load-extension"),  /* from 1.4. */
 
   ARGPARSE_s_n (oNoop, "sk-comments", "@"),
   ARGPARSE_s_n (oNoop, "no-sk-comments", "@"),
   ARGPARSE_s_n (oNoop, "compress-keys", "@"),
   ARGPARSE_s_n (oNoop, "compress-sigs", "@"),
   ARGPARSE_s_n (oNoop, "force-v3-sigs", "@"),
   ARGPARSE_s_n (oNoop, "no-force-v3-sigs", "@"),
   ARGPARSE_s_n (oNoop, "force-v4-certs", "@"),
   ARGPARSE_s_n (oNoop, "no-force-v4-certs", "@"),
   ARGPARSE_s_n (oNoop, "no-mdc-warning", "@"),
   ARGPARSE_s_n (oNoop, "force-mdc", "@"),
   ARGPARSE_s_n (oNoop, "no-force-mdc", "@"),
   ARGPARSE_s_n (oNoop, "disable-mdc", "@"),
   ARGPARSE_s_n (oNoop, "no-disable-mdc", "@"),
   ARGPARSE_s_n (oNoop, "allow-multisig-verification", "@"),
   ARGPARSE_s_n (oNoop, "allow-multiple-messages", "@"),
   ARGPARSE_s_n (oNoop, "no-allow-multiple-messages", "@"),
   ARGPARSE_s_s (oNoop, "aead-algo", "@"),
   ARGPARSE_s_s (oNoop, "personal-aead-preferences","@"),
   ARGPARSE_s_n (oNoop, "rfc4880bis", "@"),
   ARGPARSE_s_n (oNoop, "override-compliance-check", "@"),
 
 
   ARGPARSE_group (302, N_(
   "@\n(See the man page for a complete listing of all commands and options)\n"
 		      )),
 
   ARGPARSE_group (303, N_("@\nExamples:\n\n"
     " -se -r Bob [file]          sign and encrypt for user Bob\n"
     " --clear-sign [file]        make a clear text signature\n"
     " --detach-sign [file]       make a detached signature\n"
     " --list-keys [names]        show keys\n"
     " --fingerprint [names]      show fingerprints\n")),
 
 
   ARGPARSE_end ()
 };
 
 
 /* The list of supported debug flags.  */
 static struct debug_flags_s debug_flags [] =
   {
     { DBG_PACKET_VALUE , "packet"  },
     { DBG_MPI_VALUE    , "mpi"     },
     { DBG_CRYPTO_VALUE , "crypto"  },
     { DBG_FILTER_VALUE , "filter"  },
     { DBG_IOBUF_VALUE  , "iobuf"   },
     { DBG_MEMORY_VALUE , "memory"  },
     { DBG_CACHE_VALUE  , "cache"   },
     { DBG_MEMSTAT_VALUE, "memstat" },
     { DBG_TRUST_VALUE  , "trust"   },
     { DBG_HASHING_VALUE, "hashing" },
     { DBG_IPC_VALUE    , "ipc"     },
     { DBG_CLOCK_VALUE  , "clock"   },
     { DBG_LOOKUP_VALUE , "lookup"  },
     { DBG_EXTPROG_VALUE, "extprog" },
     { 0, NULL }
   };
 
 
 /* The list of compatibility flags.  */
 static struct compatibility_flags_s compatibility_flags [] =
   {
     { 0, NULL }
   };
 
 
 #ifdef ENABLE_SELINUX_HACKS
 #define ALWAYS_ADD_KEYRINGS 1
 #else
 #define ALWAYS_ADD_KEYRINGS 0
 #endif
 
 /* The list of the default AKL methods.  */
 #define DEFAULT_AKL_LIST "local,wkd"
 
 
 int g10_errors_seen = 0;
 
 static int utf8_strings =
 #ifdef HAVE_W32_SYSTEM
   1
 #else
   0
 #endif
   ;
 static int maybe_setuid = 1;
 static unsigned int opt_set_iobuf_size;
 static unsigned int opt_set_iobuf_size_used;
 
 /* Collection of options used only in this module.  */
 static struct {
   unsigned int forbid_gen_key;
 } mopt;
 
 
 static char *build_list( const char *text, char letter,
 			 const char *(*mapf)(int), int (*chkf)(int) );
 static void set_cmd( enum cmd_and_opt_values *ret_cmd,
 			enum cmd_and_opt_values new_cmd );
 static void print_mds( const char *fname, int algo );
 static void add_notation_data( const char *string, int which );
 static void add_policy_url( const char *string, int which );
 static void add_keyserver_url( const char *string, int which );
 static void emergency_cleanup (void);
 static void read_sessionkey_from_fd (int fd);
 
 
 
 /* NPth wrapper function definitions. */
 ASSUAN_SYSTEM_NPTH_IMPL;
 
 
 static char *
 make_libversion (const char *libname, const char *(*getfnc)(const char*))
 {
   const char *s;
   char *result;
 
   if (maybe_setuid)
     {
       gcry_control (GCRYCTL_INIT_SECMEM, 0, 0);  /* Drop setuid. */
       maybe_setuid = 0;
     }
   s = getfnc (NULL);
   result = xmalloc (strlen (libname) + 1 + strlen (s) + 1);
   strcpy (stpcpy (stpcpy (result, libname), " "), s);
   return result;
 }
 
 
 static int
 build_list_pk_test_algo (int algo)
 {
   /* Show only one "RSA" string.  If RSA_E or RSA_S is available RSA
      is also available.  */
   if (algo == PUBKEY_ALGO_RSA_E
       || algo == PUBKEY_ALGO_RSA_S)
     return GPG_ERR_DIGEST_ALGO;
 
   return openpgp_pk_test_algo (algo);
 }
 
 static const char *
 build_list_pk_algo_name (int algo)
 {
   return openpgp_pk_algo_name (algo);
 }
 
 static int
 build_list_cipher_test_algo (int algo)
 {
   return openpgp_cipher_test_algo (algo);
 }
 
 static const char *
 build_list_cipher_algo_name (int algo)
 {
   return openpgp_cipher_algo_name (algo);
 }
 
 static int
 build_list_md_test_algo (int algo)
 {
   /* By default we do not accept MD5 based signatures.  To avoid
      confusion we do not announce support for it either.  */
   if (algo == DIGEST_ALGO_MD5)
     return GPG_ERR_DIGEST_ALGO;
 
   return openpgp_md_test_algo (algo);
 }
 
 static const char *
 build_list_md_algo_name (int algo)
 {
   return openpgp_md_algo_name (algo);
 }
 
 
 static const char *
 my_strusage( int level )
 {
   static char *digests, *pubkeys, *ciphers, *zips, *ver_gcry;
   const char *p;
 
   switch( level ) {
       case  9: p = "GPL-3.0-or-later"; break;
       case 11: p = "@GPG@ (@GNUPG@)";
 	break;
       case 13: p = VERSION; break;
       case 14: p = GNUPG_DEF_COPYRIGHT_LINE; break;
 
       case 17: p = PRINTABLE_OS_NAME; break;
       case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
 
     case 20:
       if (!ver_gcry)
         ver_gcry = make_libversion ("libgcrypt", gcry_check_version);
       p = ver_gcry;
       break;
 
 #ifdef IS_DEVELOPMENT_VERSION
       case 25:
 	p="NOTE: THIS IS A DEVELOPMENT VERSION!";
 	break;
       case 26:
 	p="It is only intended for test purposes and should NOT be";
 	break;
       case 27:
 	p="used in a production environment or with production keys!";
 	break;
 #endif
 
       case 1:
       case 40:	p =
 	    _("Usage: @GPG@ [options] [files] (-h for help)");
 	break;
       case 41:	p =
 	    _("Syntax: @GPG@ [options] [files]\n"
 	      "Sign, check, encrypt or decrypt\n"
 	      "Default operation depends on the input data\n");
 	break;
 
       case 31: p = "\nHome: "; break;
 #ifndef __riscos__
       case 32: p = gnupg_homedir (); break;
 #else /* __riscos__ */
       case 32: p = make_filename(gnupg_homedir (), NULL); break;
 #endif /* __riscos__ */
       case 33: p = _("\nSupported algorithms:\n"); break;
       case 34:
 	if (!pubkeys)
             pubkeys = build_list (_("Pubkey: "), 1,
                                   build_list_pk_algo_name,
                                   build_list_pk_test_algo );
 	p = pubkeys;
 	break;
       case 35:
 	if( !ciphers )
 	    ciphers = build_list(_("Cipher: "), 'S',
                                  build_list_cipher_algo_name,
                                  build_list_cipher_test_algo );
 	p = ciphers;
 	break;
       case 37:
 	if( !digests )
 	    digests = build_list(_("Hash: "), 'H',
                                  build_list_md_algo_name,
                                  build_list_md_test_algo );
 	p = digests;
 	break;
       case 38:
 	if( !zips )
 	    zips = build_list(_("Compression: "),'Z',
                               compress_algo_to_string,
                               check_compress_algo);
 	p = zips;
 	break;
 
       case 95:
         p = "1"; /* <-- Enable globbing under Windows (see init.c) */
         break;
 
       default:	p = NULL;
     }
     return p;
 }
 
 
 static char *
 build_list (const char *text, char letter,
 	    const char * (*mapf)(int), int (*chkf)(int))
 {
   membuf_t mb;
   int indent;
   int i, j, len;
   int limit;
   const char *s;
   char *string;
 
   if (maybe_setuid)
     gcry_control (GCRYCTL_INIT_SECMEM, 0, 0);  /* Drop setuid. */
 
   indent = utf8_charcount (text, -1);
   len = 0;
   init_membuf (&mb, 512);
 
   limit = (letter == 'A')? 4 : 110;
   for (i=0; i <= limit; i++ )
     {
       if (!chkf (i) && (s = mapf (i)))
         {
           if (mb.len - len > 60)
             {
               put_membuf_str (&mb, ",\n");
               len = mb.len;
               for (j=0; j < indent; j++)
                 put_membuf_str (&mb, " ");
 	    }
           else if (mb.len)
             put_membuf_str (&mb, ", ");
           else
             put_membuf_str (&mb, text);
 
           put_membuf_str (&mb, s);
           if (opt.verbose && letter)
             {
               char num[20];
               if (letter == 1)
                 snprintf (num, sizeof num, " (%d)", i);
               else
                 snprintf (num, sizeof num, " (%c%d)", letter, i);
               put_membuf_str (&mb, num);
             }
 	}
     }
   if (mb.len)
     put_membuf_str (&mb, "\n");
   put_membuf (&mb, "", 1);
 
   string = get_membuf (&mb, NULL);
   return xrealloc (string, strlen (string)+1);
 }
 
 
 static void
 wrong_args( const char *text)
 {
   es_fprintf (es_stderr, _("usage: %s [options] %s\n"), GPG_NAME, text);
   log_inc_errorcount ();
   g10_exit(2);
 }
 
 
 static char *
 make_username( const char *string )
 {
     char *p;
     if( utf8_strings )
 	p = xstrdup(string);
     else
 	p = native_to_utf8( string );
     return p;
 }
 
 
 static void
 set_opt_session_env (const char *name, const char *value)
 {
   gpg_error_t err;
 
   err = session_env_setenv (opt.session_env, name, value);
   if (err)
     log_fatal ("error setting session environment: %s\n",
                gpg_strerror (err));
 }
 
 
 /* Setup the debugging.  With a LEVEL of NULL only the active debug
    flags are propagated to the subsystems.  With LEVEL set, a specific
    set of debug flags is set; thus overriding all flags already
    set. */
 static void
 set_debug (const char *level)
 {
   int numok = (level && digitp (level));
   int numlvl = numok? atoi (level) : 0;
 
   if (!level)
     ;
   else if (!strcmp (level, "none") || (numok && numlvl < 1))
     opt.debug = 0;
   else if (!strcmp (level, "basic") || (numok && numlvl <= 2))
     opt.debug = DBG_MEMSTAT_VALUE;
   else if (!strcmp (level, "advanced") || (numok && numlvl <= 5))
     opt.debug = DBG_MEMSTAT_VALUE|DBG_TRUST_VALUE|DBG_EXTPROG_VALUE;
   else if (!strcmp (level, "expert")  || (numok && numlvl <= 8))
     opt.debug = (DBG_MEMSTAT_VALUE|DBG_TRUST_VALUE|DBG_EXTPROG_VALUE
                  |DBG_CACHE_VALUE|DBG_LOOKUP|DBG_FILTER_VALUE|DBG_PACKET_VALUE);
   else if (!strcmp (level, "guru") || numok)
     {
       opt.debug = ~0;
       /* Unless the "guru" string has been used we don't want to allow
          hashing debugging.  The rationale is that people tend to
          select the highest debug value and would then clutter their
          disk with debug files which may reveal confidential data.  */
       if (numok)
         opt.debug &= ~(DBG_HASHING_VALUE);
     }
   else
     {
       log_error (_("invalid debug-level '%s' given\n"), level);
       g10_exit (2);
     }
 
   if ((opt.debug & DBG_MEMORY_VALUE))
     memory_debug_mode = 1;
   if ((opt.debug & DBG_MEMSTAT_VALUE))
     memory_stat_debug_mode = 1;
   if (DBG_MPI)
     gcry_control (GCRYCTL_SET_DEBUG_FLAGS, 2);
   if (DBG_CRYPTO)
     gcry_control (GCRYCTL_SET_DEBUG_FLAGS, 1);
   if ((opt.debug & DBG_IOBUF_VALUE))
     iobuf_debug_mode = 1;
   gcry_control (GCRYCTL_SET_VERBOSITY, (int)opt.verbose);
 
   if (opt.debug)
     parse_debug_flag (NULL, &opt.debug, debug_flags);
 
   /* Make sure that we are --verbose in debug mode.  */
   if (opt.debug && !opt.verbose)
     opt.verbose = 1;
   if (opt.debug && opt.quiet)
     opt.quiet = 0;
 
   if (opt_set_iobuf_size || opt_set_iobuf_size_used)
     log_debug ("iobuf buffer size is %uk\n",
                iobuf_set_buffer_size (opt_set_iobuf_size));
 }
 
 
 /* We set the screen dimensions for UI purposes.  Do not allow screens
    smaller than 80x24 for the sake of simplicity. */
 static void
 set_screen_dimensions(void)
 {
 #ifndef HAVE_W32_SYSTEM
   char *str;
 
   str=getenv("COLUMNS");
   if(str)
     opt.screen_columns=atoi(str);
 
   str=getenv("LINES");
   if(str)
     opt.screen_lines=atoi(str);
 #endif
 
   if(opt.screen_columns<80 || opt.screen_columns>255)
     opt.screen_columns=80;
 
   if(opt.screen_lines<24 || opt.screen_lines>255)
     opt.screen_lines=24;
 }
 
 
 /* Helper to open a file FNAME either for reading or writing to be
    used with --status-file etc functions.  Not generally useful but it
    avoids the riscos specific functions and well some Windows people
    might like it too.  Prints an error message and returns -1 on
    error.  On success the file descriptor is returned.  */
 static int
 open_info_file (const char *fname, int for_write, int binary)
 {
 #ifdef __riscos__
   return riscos_fdopenfile (fname, for_write);
 #elif defined (ENABLE_SELINUX_HACKS)
   /* We can't allow these even when testing for a secured filename
      because files to be secured might not yet been secured.  This is
      similar to the option file but in that case it is unlikely that
      sensitive information may be retrieved by means of error
      messages.  */
   (void)fname;
   (void)for_write;
   (void)binary;
   return -1;
 #else
   int fd;
 
   if (binary)
     binary = MY_O_BINARY;
 
 /*   if (is_secured_filename (fname)) */
 /*     { */
 /*       fd = -1; */
 /*       gpg_err_set_errno (EPERM); */
 /*     } */
 /*   else */
 /*     { */
       do
         {
           if (for_write)
             fd = gnupg_open (fname, O_CREAT | O_TRUNC | O_WRONLY | binary,
                              S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
           else
             fd = gnupg_open (fname, O_RDONLY | binary, 0);
         }
       while (fd == -1 && errno == EINTR);
 /*     } */
   if ( fd == -1)
     log_error ( for_write? _("can't create '%s': %s\n")
                          : _("can't open '%s': %s\n"), fname, strerror(errno));
 
   return fd;
 #endif
 }
 
 static void
 set_cmd( enum cmd_and_opt_values *ret_cmd, enum cmd_and_opt_values new_cmd )
 {
     enum cmd_and_opt_values cmd = *ret_cmd;
 
     if( !cmd || cmd == new_cmd )
 	cmd = new_cmd;
     else if( cmd == aSign && new_cmd == aEncr )
 	cmd = aSignEncr;
     else if( cmd == aEncr && new_cmd == aSign )
 	cmd = aSignEncr;
     else if( cmd == aSign && new_cmd == aSym )
 	cmd = aSignSym;
     else if( cmd == aSym && new_cmd == aSign )
 	cmd = aSignSym;
     else if( cmd == aSym && new_cmd == aEncr )
 	cmd = aEncrSym;
     else if( cmd == aEncr && new_cmd == aSym )
 	cmd = aEncrSym;
     else if (cmd == aSignEncr && new_cmd == aSym)
         cmd = aSignEncrSym;
     else if (cmd == aSignSym && new_cmd == aEncr)
         cmd = aSignEncrSym;
     else if (cmd == aEncrSym && new_cmd == aSign)
         cmd = aSignEncrSym;
     else if(	( cmd == aSign	   && new_cmd == aClearsign )
 	     || ( cmd == aClearsign && new_cmd == aSign )  )
 	cmd = aClearsign;
     else {
 	log_error(_("conflicting commands\n"));
 	g10_exit(2);
     }
 
     *ret_cmd = cmd;
 }
 
 
 static void
 add_group(char *string)
 {
   char *name,*value;
   struct groupitem *item;
 
   /* Break off the group name */
   name=strsep(&string,"=");
   if(string==NULL)
     {
       log_error(_("no = sign found in group definition '%s'\n"),name);
       return;
     }
 
   trim_trailing_ws(name,strlen(name));
 
   /* Does this group already exist? */
   for(item=opt.grouplist;item;item=item->next)
     if(strcasecmp(item->name,name)==0)
       break;
 
   if(!item)
     {
       item=xmalloc(sizeof(struct groupitem));
       item->name=name;
       item->next=opt.grouplist;
       item->values=NULL;
       opt.grouplist=item;
     }
 
   /* Break apart the values */
   while ((value= strsep(&string," \t")))
     {
       if (*value)
         add_to_strlist2(&item->values,value,utf8_strings);
     }
 }
 
 
 static void
 rm_group(char *name)
 {
   struct groupitem *item,*last=NULL;
 
   trim_trailing_ws(name,strlen(name));
 
   for(item=opt.grouplist;item;last=item,item=item->next)
     {
       if(strcasecmp(item->name,name)==0)
 	{
 	  if(last)
 	    last->next=item->next;
 	  else
 	    opt.grouplist=item->next;
 
 	  free_strlist(item->values);
 	  xfree(item);
 	  break;
 	}
     }
 }
 
 
 /* We need to check three things.
 
    0) The homedir.  It must be x00, a directory, and owned by the
    user.
 
    1) The options/gpg.conf file.  Okay unless it or its containing
    directory is group or other writable or not owned by us.  Disable
    exec in this case.
 
    2) Extensions.  Same as #1.
 
    Returns true if the item is unsafe. */
 static int
 check_permissions (const char *path, int item)
 {
 #if defined(HAVE_STAT) && !defined(HAVE_DOSISH_SYSTEM)
   static int homedir_cache=-1;
   char *tmppath,*dir;
   struct stat statbuf,dirbuf;
   int homedir=0,ret=0,checkonly=0;
   int perm=0,own=0,enc_dir_perm=0,enc_dir_own=0;
 
   if(opt.no_perm_warn)
     return 0;
 
   log_assert(item==0 || item==1 || item==2);
 
   /* extensions may attach a path */
   if(item==2 && path[0]!=DIRSEP_C)
     {
       if(strchr(path,DIRSEP_C))
 	tmppath=make_filename(path,NULL);
       else
 	tmppath=make_filename(gnupg_libdir (),path,NULL);
     }
   else
     tmppath=xstrdup(path);
 
   /* If the item is located in the homedir, but isn't the homedir,
      don't continue if we already checked the homedir itself.  This is
      to avoid user confusion with an extra options file warning which
      could be rectified if the homedir itself had proper
      permissions. */
   if(item!=0 && homedir_cache>-1
      && !ascii_strncasecmp (gnupg_homedir (), tmppath,
                             strlen (gnupg_homedir ())))
     {
       ret=homedir_cache;
       goto end;
     }
 
   /* It's okay if the file or directory doesn't exist */
   if (gnupg_stat (tmppath,&statbuf))
     {
       ret=0;
       goto end;
     }
 
   /* Now check the enclosing directory.  Theoretically, we could walk
      this test up to the root directory /, but for the sake of sanity,
      I'm stopping at one level down. */
   dir=make_dirname(tmppath);
 
   if (gnupg_stat (dir,&dirbuf) || !S_ISDIR (dirbuf.st_mode))
     {
       /* Weird error */
       xfree(dir);
       ret=1;
       goto end;
     }
 
   xfree(dir);
 
   /* Assume failure */
   ret=1;
 
   if(item==0)
     {
       /* The homedir must be x00, a directory, and owned by the user. */
 
       if(S_ISDIR(statbuf.st_mode))
 	{
 	  if(statbuf.st_uid==getuid())
 	    {
 	      if((statbuf.st_mode & (S_IRWXG|S_IRWXO))==0)
 		ret=0;
 	      else
 		perm=1;
 	    }
 	  else
 	    own=1;
 
 	  homedir_cache=ret;
 	}
     }
   else if(item==1 || item==2)
     {
       /* The options or extension file.  Okay unless it or its
 	 containing directory is group or other writable or not owned
 	 by us or root. */
 
       if(S_ISREG(statbuf.st_mode))
 	{
 	  if(statbuf.st_uid==getuid() || statbuf.st_uid==0)
 	    {
 	      if((statbuf.st_mode & (S_IWGRP|S_IWOTH))==0)
 		{
 		  /* it's not writable, so make sure the enclosing
                      directory is also not writable */
 		  if(dirbuf.st_uid==getuid() || dirbuf.st_uid==0)
 		    {
 		      if((dirbuf.st_mode & (S_IWGRP|S_IWOTH))==0)
 			ret=0;
 		      else
 			enc_dir_perm=1;
 		    }
 		  else
 		    enc_dir_own=1;
 		}
 	      else
 		{
 		  /* it's writable, so the enclosing directory had
                      better not let people get to it. */
 		  if(dirbuf.st_uid==getuid() || dirbuf.st_uid==0)
 		    {
 		      if((dirbuf.st_mode & (S_IRWXG|S_IRWXO))==0)
 			ret=0;
 		      else
 			perm=enc_dir_perm=1; /* unclear which one to fix! */
 		    }
 		  else
 		    enc_dir_own=1;
 		}
 	    }
 	  else
 	    own=1;
 	}
     }
   else
     BUG();
 
   if(!checkonly)
     {
       if(own)
 	{
 	  if(item==0)
 	    log_info(_("WARNING: unsafe ownership on"
 		       " homedir '%s'\n"),tmppath);
 	  else if(item==1)
 	    log_info(_("WARNING: unsafe ownership on"
 		       " configuration file '%s'\n"),tmppath);
 	  else
 	    log_info(_("WARNING: unsafe ownership on"
 		       " extension '%s'\n"),tmppath);
 	}
       if(perm)
 	{
 	  if(item==0)
 	    log_info(_("WARNING: unsafe permissions on"
 		       " homedir '%s'\n"),tmppath);
 	  else if(item==1)
 	    log_info(_("WARNING: unsafe permissions on"
 		       " configuration file '%s'\n"),tmppath);
 	  else
 	    log_info(_("WARNING: unsafe permissions on"
 		       " extension '%s'\n"),tmppath);
 	}
       if(enc_dir_own)
 	{
 	  if(item==0)
 	    log_info(_("WARNING: unsafe enclosing directory ownership on"
 		       " homedir '%s'\n"),tmppath);
 	  else if(item==1)
 	    log_info(_("WARNING: unsafe enclosing directory ownership on"
 		       " configuration file '%s'\n"),tmppath);
 	  else
 	    log_info(_("WARNING: unsafe enclosing directory ownership on"
 		       " extension '%s'\n"),tmppath);
 	}
       if(enc_dir_perm)
 	{
 	  if(item==0)
 	    log_info(_("WARNING: unsafe enclosing directory permissions on"
 		       " homedir '%s'\n"),tmppath);
 	  else if(item==1)
 	    log_info(_("WARNING: unsafe enclosing directory permissions on"
 		       " configuration file '%s'\n"),tmppath);
 	  else
 	    log_info(_("WARNING: unsafe enclosing directory permissions on"
 		       " extension '%s'\n"),tmppath);
 	}
     }
 
  end:
   xfree(tmppath);
 
   if(homedir)
     homedir_cache=ret;
 
   return ret;
 
 #else /*!(HAVE_STAT && !HAVE_DOSISH_SYSTEM)*/
   (void)path;
   (void)item;
   return 0;
 #endif /*!(HAVE_STAT && !HAVE_DOSISH_SYSTEM)*/
 }
 
 
 /* Print the OpenPGP defined algo numbers.  */
 static void
 print_algo_numbers(int (*checker)(int))
 {
   int i,first=1;
 
   for(i=0;i<=110;i++)
     {
       if(!checker(i))
 	{
 	  if(first)
 	    first=0;
 	  else
 	    es_printf (";");
 	  es_printf ("%d",i);
 	}
     }
 }
 
 
 static void
 print_algo_names(int (*checker)(int),const char *(*mapper)(int))
 {
   int i,first=1;
 
   for(i=0;i<=110;i++)
     {
       if(!checker(i))
 	{
 	  if(first)
 	    first=0;
 	  else
 	    es_printf (";");
 	  es_printf ("%s",mapper(i));
 	}
     }
 }
 
 /* In the future, we can do all sorts of interesting configuration
    output here.  For now, just give "group" as the Enigmail folks need
    it, and pubkey, cipher, hash, and compress as they may be useful
    for frontends. */
 static void
 list_config(char *items)
 {
   int show_all = !items;
   char *name = NULL;
   const char *s;
   struct groupitem *giter;
   int first, iter;
 
   if(!opt.with_colons)
     return;
 
   while(show_all || (name=strsep(&items," ")))
     {
       int any=0;
 
       if(show_all || ascii_strcasecmp(name,"group")==0)
 	{
 	  for (giter = opt.grouplist; giter; giter = giter->next)
 	    {
 	      strlist_t sl;
 
 	      es_fprintf (es_stdout, "cfg:group:");
 	      es_write_sanitized (es_stdout, giter->name, strlen(giter->name),
                                   ":", NULL);
 	      es_putc (':', es_stdout);
 
 	      for(sl=giter->values; sl; sl=sl->next)
 		{
 		  es_write_sanitized (es_stdout, sl->d, strlen (sl->d),
                                       ":;", NULL);
 		  if(sl->next)
                     es_printf(";");
 		}
 
               es_printf("\n");
 	    }
 
 	  any=1;
 	}
 
       if(show_all || ascii_strcasecmp(name,"version")==0)
 	{
 	  es_printf("cfg:version:");
 	  es_write_sanitized (es_stdout, VERSION, strlen(VERSION), ":", NULL);
           es_printf ("\n");
 	  any=1;
 	}
 
       if(show_all || ascii_strcasecmp(name,"pubkey")==0)
 	{
 	  es_printf ("cfg:pubkey:");
 	  print_algo_numbers (build_list_pk_test_algo);
 	  es_printf ("\n");
 	  any=1;
 	}
 
       if(show_all || ascii_strcasecmp(name,"pubkeyname")==0)
 	{
 	  es_printf ("cfg:pubkeyname:");
 	  print_algo_names (build_list_pk_test_algo,
                             build_list_pk_algo_name);
 	  es_printf ("\n");
 	  any=1;
 	}
 
       if(show_all || ascii_strcasecmp(name,"cipher")==0)
 	{
 	  es_printf ("cfg:cipher:");
 	  print_algo_numbers (build_list_cipher_test_algo);
 	  es_printf ("\n");
 	  any=1;
 	}
 
       if (show_all || !ascii_strcasecmp (name,"ciphername"))
 	{
 	  es_printf ("cfg:ciphername:");
 	  print_algo_names (build_list_cipher_test_algo,
                             build_list_cipher_algo_name);
 	  es_printf ("\n");
 	  any = 1;
 	}
 
       if(show_all
 	 || ascii_strcasecmp(name,"digest")==0
 	 || ascii_strcasecmp(name,"hash")==0)
 	{
 	  es_printf ("cfg:digest:");
 	  print_algo_numbers (build_list_md_test_algo);
 	  es_printf ("\n");
 	  any=1;
 	}
 
       if (show_all
           || !ascii_strcasecmp(name,"digestname")
           || !ascii_strcasecmp(name,"hashname"))
 	{
 	  es_printf ("cfg:digestname:");
 	  print_algo_names (build_list_md_test_algo,
                             build_list_md_algo_name);
 	  es_printf ("\n");
 	  any=1;
 	}
 
       if(show_all || ascii_strcasecmp(name,"compress")==0)
 	{
 	  es_printf ("cfg:compress:");
 	  print_algo_numbers(check_compress_algo);
 	  es_printf ("\n");
 	  any=1;
 	}
 
       if(show_all || ascii_strcasecmp (name, "compressname") == 0)
 	{
 	  es_printf ("cfg:compressname:");
 	  print_algo_names (check_compress_algo,
 			    compress_algo_to_string);
 	  es_printf ("\n");
 	  any=1;
 	}
 
       if (show_all || !ascii_strcasecmp(name,"ccid-reader-id"))
 	{
           /* We ignore this for GnuPG 1.4 backward compatibility.  */
 	  any=1;
 	}
 
       if (show_all || !ascii_strcasecmp (name,"curve"))
 	{
 	  es_printf ("cfg:curve:");
           for (iter=0, first=1; (s = openpgp_enum_curves (&iter)); first=0)
             es_printf ("%s%s", first?"":";", s);
 	  es_printf ("\n");
 	  any=1;
 	}
 
       /* Curve OIDs are rarely useful and thus only printed if requested.  */
       if (name && !ascii_strcasecmp (name,"curveoid"))
 	{
 	  es_printf ("cfg:curveoid:");
           for (iter=0, first=1; (s = openpgp_enum_curves (&iter)); first = 0)
             {
               s = openpgp_curve_to_oid (s, NULL, NULL);
               es_printf ("%s%s", first?"":";", s? s:"[?]");
             }
 	  es_printf ("\n");
 	  any=1;
 	}
 
       if(show_all)
 	break;
 
       if(!any)
 	log_error(_("unknown configuration item '%s'\n"),name);
     }
 }
 
 
 /* List default values for use by gpgconf.  */
 static void
 gpgconf_list (void)
 {
   es_printf ("debug-level:%lu:\"none:\n", GC_OPT_FLAG_DEFAULT);
   es_printf ("compliance:%lu:\"%s:\n", GC_OPT_FLAG_DEFAULT, "gnupg");
 
   /* The next one is an info only item and should match the macros at
      the top of keygen.c  */
   es_printf ("default_pubkey_algo:%lu:\"%s:\n", GC_OPT_FLAG_DEFAULT,
              get_default_pubkey_algo ());
   /* This info only mode tells whether the we are running in de-vs
    * compliance mode.  This does not test all parameters but the basic
    * conditions like a proper RNG and Libgcrypt.  AS of now we always
    * return 0 because this version of gnupg has not yet received an
    * appoval. */
   es_printf ("compliance_de_vs:%lu:%d:\n", GC_OPT_FLAG_DEFAULT,
              0 /*gnupg_rng_is_compliant (CO_DE_VS)*/);
 
   es_printf ("use_keyboxd:%lu:%d:\n", GC_OPT_FLAG_DEFAULT, opt.use_keyboxd);
 
 }
 
 
 static int
 parse_subpacket_list(char *list)
 {
   char *tok;
   byte subpackets[128],i;
   int count=0;
 
   if(!list)
     {
       /* No arguments means all subpackets */
       memset(subpackets+1,1,sizeof(subpackets)-1);
       count=127;
     }
   else
     {
       memset(subpackets,0,sizeof(subpackets));
 
       /* Merge with earlier copy */
       if(opt.show_subpackets)
 	{
 	  byte *in;
 
 	  for(in=opt.show_subpackets;*in;in++)
 	    {
 	      if(*in>127 || *in<1)
 		BUG();
 
 	      if(!subpackets[*in])
 		count++;
 	      subpackets[*in]=1;
 	    }
 	}
 
       while((tok=strsep(&list," ,")))
 	{
 	  if(!*tok)
 	    continue;
 
 	  i=atoi(tok);
 	  if(i>127 || i<1)
 	    return 0;
 
 	  if(!subpackets[i])
 	    count++;
 	  subpackets[i]=1;
 	}
     }
 
   xfree(opt.show_subpackets);
   opt.show_subpackets=xmalloc(count+1);
   opt.show_subpackets[count--]=0;
 
   for(i=1;i<128 && count>=0;i++)
     if(subpackets[i])
       opt.show_subpackets[count--]=i;
 
   return 1;
 }
 
 
 static int
 parse_list_options(char *str)
 {
   char *subpackets=""; /* something that isn't NULL */
   struct parse_options lopts[]=
     {
+      {"show-sig-subpackets",LIST_SHOW_SIG_SUBPACKETS,NULL,
+       NULL},
       {"show-photos",LIST_SHOW_PHOTOS,NULL,
        N_("display photo IDs during key listings")},
       {"show-usage",LIST_SHOW_USAGE,NULL,
        N_("show key usage information during key listings")},
       {"show-policy-urls",LIST_SHOW_POLICY_URLS,NULL,
        N_("show policy URLs during signature listings")},
       {"show-notations",LIST_SHOW_NOTATIONS,NULL,
        N_("show all notations during signature listings")},
       {"show-std-notations",LIST_SHOW_STD_NOTATIONS,NULL,
        N_("show IETF standard notations during signature listings")},
       {"show-standard-notations",LIST_SHOW_STD_NOTATIONS,NULL,
        NULL},
       {"show-user-notations",LIST_SHOW_USER_NOTATIONS,NULL,
        N_("show user-supplied notations during signature listings")},
       {"show-keyserver-urls",LIST_SHOW_KEYSERVER_URLS,NULL,
        N_("show preferred keyserver URLs during signature listings")},
       {"show-uid-validity",LIST_SHOW_UID_VALIDITY,NULL,
        N_("show user ID validity during key listings")},
       {"show-unusable-uids",LIST_SHOW_UNUSABLE_UIDS,NULL,
        N_("show revoked and expired user IDs in key listings")},
       {"show-unusable-subkeys",LIST_SHOW_UNUSABLE_SUBKEYS,NULL,
        N_("show revoked and expired subkeys in key listings")},
       {"show-keyring",LIST_SHOW_KEYRING,NULL,
        N_("show the keyring name in key listings")},
       {"show-sig-expire",LIST_SHOW_SIG_EXPIRE,NULL,
        N_("show expiration dates during signature listings")},
       {"show-pref", LIST_SHOW_PREF, NULL,
        N_("show preferences")},
       {"show-pref-verbose", LIST_SHOW_PREF_VERBOSE, NULL,
        N_("show preferences")},
-      {"show-sig-subpackets",LIST_SHOW_SIG_SUBPACKETS,NULL,
-       NULL},
       {"show-only-fpr-mbox",LIST_SHOW_ONLY_FPR_MBOX, NULL,
        NULL},
       {"sort-sigs", LIST_SORT_SIGS, NULL,
        NULL},
       {NULL,0,NULL,NULL}
     };
+  int i;
 
   /* C99 allows for non-constant initializers, but we'd like to
      compile everywhere, so fill in the show-sig-subpackets argument
      here.  Note that if the parse_options array changes, we'll have
-     to change the subscript here. */
-  lopts[13].value=&subpackets;
+     to change the subscript here.  We use a loop here in case the
+     list above is reordered.  */
+  for (i=0; lopts[i].name; i++)
+    if (lopts[i].bit == LIST_SHOW_SIG_SUBPACKETS)
+      {
+        lopts[i].value = &subpackets;
+        break;
+      }
 
   if(parse_options(str,&opt.list_options,lopts,1))
     {
       if(opt.list_options&LIST_SHOW_SIG_SUBPACKETS)
 	{
 	  /* Unset so users can pass multiple lists in. */
 	  opt.list_options&=~LIST_SHOW_SIG_SUBPACKETS;
 	  if(!parse_subpacket_list(subpackets))
 	    return 0;
 	}
       else if(subpackets==NULL && opt.show_subpackets)
 	{
 	  /* User did 'no-show-subpackets' */
 	  xfree(opt.show_subpackets);
 	  opt.show_subpackets=NULL;
 	}
 
       return 1;
     }
   else
     return 0;
 }
 
 
 /* Collapses argc/argv into a single string that must be freed */
 static char *
 collapse_args(int argc,char *argv[])
 {
   char *str=NULL;
   int i,first=1,len=0;
 
   for(i=0;i<argc;i++)
     {
       len+=strlen(argv[i])+2;
       str=xrealloc(str,len);
       if(first)
 	{
 	  str[0]='\0';
 	  first=0;
 	}
       else
 	strcat(str," ");
 
       strcat(str,argv[i]);
     }
 
   return str;
 }
 
 
 #ifndef NO_TRUST_MODELS
 static void
 parse_trust_model(const char *model)
 {
   if(ascii_strcasecmp(model,"pgp")==0)
     opt.trust_model=TM_PGP;
   else if(ascii_strcasecmp(model,"classic")==0)
     opt.trust_model=TM_CLASSIC;
   else if(ascii_strcasecmp(model,"always")==0)
     opt.trust_model=TM_ALWAYS;
   else if(ascii_strcasecmp(model,"direct")==0)
     opt.trust_model=TM_DIRECT;
 #ifdef USE_TOFU
   else if(ascii_strcasecmp(model,"tofu")==0)
     opt.trust_model=TM_TOFU;
   else if(ascii_strcasecmp(model,"tofu+pgp")==0)
     opt.trust_model=TM_TOFU_PGP;
 #endif /*USE_TOFU*/
   else if(ascii_strcasecmp(model,"auto")==0)
     opt.trust_model=TM_AUTO;
   else
     log_error("unknown trust model '%s'\n",model);
 }
 #endif /*NO_TRUST_MODELS*/
 
 
 static int
 parse_tofu_policy (const char *policystr)
 {
 #ifdef USE_TOFU
   struct { const char *keyword; int policy; } list[] = {
     { "auto",    TOFU_POLICY_AUTO },
     { "good",    TOFU_POLICY_GOOD },
     { "unknown", TOFU_POLICY_UNKNOWN },
     { "bad",     TOFU_POLICY_BAD },
     { "ask",     TOFU_POLICY_ASK }
   };
   int i;
 
   if (!ascii_strcasecmp (policystr, "help"))
     {
       log_info (_("valid values for option '%s':\n"), "--tofu-policy");
       for (i=0; i < DIM (list); i++)
         log_info ("  %s\n", list[i].keyword);
       g10_exit (1);
     }
 
   for (i=0; i < DIM (list); i++)
     if (!ascii_strcasecmp (policystr, list[i].keyword))
       return list[i].policy;
 #endif /*USE_TOFU*/
 
   log_error (_("unknown TOFU policy '%s'\n"), policystr);
   if (!opt.quiet)
     log_info (_("(use \"help\" to list choices)\n"));
   g10_exit (1);
 }
 
 
 static struct gnupg_compliance_option compliance_options[] =
   {
     { "gnupg",      oGnuPG },
     { "openpgp",    oOpenPGP },
     { "rfc4880bis", oGnuPG },
     { "rfc4880",    oRFC4880 },
     { "rfc2440",    oRFC2440 },
     { "pgp6",       oPGP7 },
     { "pgp7",       oPGP7 },
     { "pgp8",       oPGP8 },
     { "de-vs",      oDE_VS }
   };
 
 
 /* Helper to set compliance related options.  This is a separate
  * function so that it can also be used by the --compliance option
  * parser.  */
 static void
 set_compliance_option (enum cmd_and_opt_values option)
 {
   switch (option)
     {
     case oOpenPGP:
     case oRFC4880:
       /* This is effectively the same as RFC2440, but with
          "--enable-dsa2 --no-rfc2440-text --escape-from-lines
          --require-cross-certification". */
       opt.compliance = CO_RFC4880;
       opt.flags.dsa2 = 1;
       opt.flags.require_cross_cert = 1;
       opt.rfc2440_text = 0;
       opt.allow_non_selfsigned_uid = 1;
       opt.allow_freeform_uid = 1;
       opt.escape_from = 1;
       opt.not_dash_escaped = 0;
       opt.def_cipher_algo = 0;
       opt.def_digest_algo = 0;
       opt.cert_digest_algo = 0;
       opt.compress_algo = -1;
       opt.s2k_mode = 3; /* iterated+salted */
       opt.s2k_digest_algo = DIGEST_ALGO_SHA1;
       opt.s2k_cipher_algo = CIPHER_ALGO_3DES;
       opt.flags.allow_old_cipher_algos = 1;
       break;
     case oRFC2440:
       opt.compliance = CO_RFC2440;
       opt.flags.dsa2 = 0;
       opt.rfc2440_text = 1;
       opt.allow_non_selfsigned_uid = 1;
       opt.allow_freeform_uid = 1;
       opt.escape_from = 0;
       opt.not_dash_escaped = 0;
       opt.def_cipher_algo = 0;
       opt.def_digest_algo = 0;
       opt.cert_digest_algo = 0;
       opt.compress_algo = -1;
       opt.s2k_mode = 3; /* iterated+salted */
       opt.s2k_digest_algo = DIGEST_ALGO_SHA1;
       opt.s2k_cipher_algo = CIPHER_ALGO_3DES;
       opt.flags.allow_old_cipher_algos = 1;
       break;
     case oPGP7:  opt.compliance = CO_PGP7;  break;
     case oPGP8:  opt.compliance = CO_PGP8;  break;
     case oGnuPG:
       opt.compliance = CO_GNUPG;
       break;
 
     case oDE_VS:
       set_compliance_option (oOpenPGP);
       opt.compliance = CO_DE_VS;
       /* We divert here from the backward compatible rfc4880 algos.  */
       opt.s2k_digest_algo = DIGEST_ALGO_SHA256;
       opt.s2k_cipher_algo = CIPHER_ALGO_AES256;
       break;
 
     default:
       BUG ();
     }
 }
 
 
 static void
 gen_key_forbidden (void)
 {
   write_status_failure ("gen-key", gpg_error (GPG_ERR_NOT_ENABLED));
   log_error (_("This command is not allowed while in %s mode.\n"),
              "forbid-gen-key");
 }
 
 
 /* This function called to initialized a new control object.  It is
    assumed that this object has been zeroed out before calling this
    function. */
 static void
 gpg_init_default_ctrl (ctrl_t ctrl)
 {
   ctrl->magic = SERVER_CONTROL_MAGIC;
 }
 
 
 /* This function is called to deinitialize a control object.  It is
    not deallocated. */
 static void
 gpg_deinit_default_ctrl (ctrl_t ctrl)
 {
 #ifdef USE_TOFU
   tofu_closedbs (ctrl);
 #endif
   gpg_dirmngr_deinit_session_data (ctrl);
 
   keydb_release (ctrl->cached_getkey_kdb);
   gpg_keyboxd_deinit_session_data (ctrl);
   xfree (ctrl->secret_keygrips);
   ctrl->secret_keygrips = NULL;
 }
 
 
 int
 main (int argc, char **argv)
 {
     gpgrt_argparse_t pargs;
     IOBUF a;
     int rc=0;
     int orig_argc;
     char **orig_argv;
     const char *fname;
     char *username;
     int may_coredump;
     strlist_t sl;
     strlist_t remusr = NULL;
     strlist_t locusr = NULL;
     strlist_t nrings = NULL;
     armor_filter_context_t *afx = NULL;
     int detached_sig = 0;
     char *last_configname = NULL;
     const char *configname = NULL; /* NULL or points to last_configname.
                                     * NULL also indicates that we are
                                     * processing options from the cmdline.  */
     int debug_argparser = 0;
     int default_keyring = 1;
     int greeting = 0;
     int nogreeting = 0;
     char *logfile = NULL;
     int use_random_seed = 1;
     enum cmd_and_opt_values cmd = 0;
     const char *debug_level = NULL;
 #ifndef NO_TRUST_MODELS
     const char *trustdb_name = NULL;
 #endif /*!NO_TRUST_MODELS*/
     char *def_cipher_string = NULL;
     char *def_digest_string = NULL;
     char *compress_algo_string = NULL;
     char *cert_digest_string = NULL;
     char *s2k_cipher_string = NULL;
     char *s2k_digest_string = NULL;
     char *pers_cipher_list = NULL;
     char *pers_digest_list = NULL;
     char *pers_compress_list = NULL;
     int eyes_only=0;
     int multifile=0;
     int pwfd = -1;
     int ovrseskeyfd = -1;
     int fpr_maybe_cmd = 0; /* --fingerprint maybe a command.  */
     int any_explicit_recipient = 0;
     int default_akl = 1;
     int require_secmem = 0;
     int got_secmem = 0;
     struct assuan_malloc_hooks malloc_hooks;
     ctrl_t ctrl;
 
     static int print_dane_records;
     static int allow_large_chunks;
     static const char *homedirvalue;
     static const char *changeuser;
 
 
 #ifdef __riscos__
     opt.lock_once = 1;
 #endif /* __riscos__ */
 
     /* Please note that we may running SUID(ROOT), so be very CAREFUL
        when adding any stuff between here and the call to
        secmem_init() somewhere after the option parsing. */
     early_system_init ();
     gnupg_reopen_std (GPG_NAME);
     trap_unaligned ();
     gnupg_rl_initialize ();
     gpgrt_set_strusage (my_strusage);
     gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
     log_set_prefix (GPG_NAME, GPGRT_LOG_WITH_PREFIX|GPGRT_LOG_NO_REGISTRY);
 
     /* Make sure that our subsystems are ready.  */
     i18n_init();
     init_common_subsystems (&argc, &argv);
 
     /* Use our own logging handler for Libcgrypt.  */
     setup_libgcrypt_logging ();
 
     /* Put random number into secure memory */
     gcry_control (GCRYCTL_USE_SECURE_RNDPOOL);
 
     may_coredump = disable_core_dumps();
 
     gnupg_init_signals (0, emergency_cleanup);
 
     dotlock_create (NULL, 0); /* Register lock file cleanup. */
 
     /* Tell the compliance module who we are.  */
     gnupg_initialize_compliance (GNUPG_MODULE_NAME_GPG);
 
     opt.autostart = 1;
     opt.session_env = session_env_new ();
     if (!opt.session_env)
       log_fatal ("error allocating session environment block: %s\n",
                  strerror (errno));
 
     opt.command_fd = -1; /* no command fd */
     opt.compress_level = -1; /* defaults to standard compress level */
     opt.bz2_compress_level = -1; /* defaults to standard compress level */
     /* note: if you change these lines, look at oOpenPGP */
     opt.def_cipher_algo = 0;
     opt.def_digest_algo = 0;
     opt.cert_digest_algo = 0;
     opt.compress_algo = -1; /* defaults to DEFAULT_COMPRESS_ALGO */
     opt.s2k_mode = 3; /* iterated+salted */
     opt.s2k_count = 0; /* Auto-calibrate when needed.  */
     opt.s2k_cipher_algo = DEFAULT_CIPHER_ALGO;
     opt.completes_needed = 1;
     opt.marginals_needed = 3;
     opt.max_cert_depth = 5;
     opt.escape_from = 1;
     opt.flags.require_cross_cert = 1;
     opt.import_options = (IMPORT_REPAIR_KEYS
                           | IMPORT_COLLAPSE_UIDS
                           | IMPORT_COLLAPSE_SUBKEYS);
     opt.export_options = EXPORT_ATTRIBUTES;
     opt.keyserver_options.import_options = (IMPORT_REPAIR_KEYS
 					    | IMPORT_REPAIR_PKS_SUBKEY_BUG
                                             | IMPORT_SELF_SIGS_ONLY
                                             | IMPORT_COLLAPSE_UIDS
                                             | IMPORT_COLLAPSE_SUBKEYS
                                             | IMPORT_CLEAN);
     opt.keyserver_options.export_options = EXPORT_ATTRIBUTES;
     opt.keyserver_options.options = 0;
     opt.verify_options = (LIST_SHOW_UID_VALIDITY
                           | VERIFY_SHOW_POLICY_URLS
                           | VERIFY_SHOW_STD_NOTATIONS
                           | VERIFY_SHOW_KEYSERVER_URLS);
     opt.list_options   = (LIST_SHOW_UID_VALIDITY
                           | LIST_SORT_SIGS
                           | LIST_SHOW_USAGE);
 #ifdef NO_TRUST_MODELS
     opt.trust_model = TM_ALWAYS;
 #else
     opt.trust_model = TM_AUTO;
 #endif
     opt.tofu_default_policy = TOFU_POLICY_AUTO;
     opt.mangle_dos_filenames = 0;
     opt.min_cert_level = 2;
     set_screen_dimensions ();
     opt.keyid_format = KF_NONE;
     opt.def_sig_expire = "0";
     opt.def_cert_expire = "0";
     opt.passphrase_repeat = 1;
     opt.emit_version = 0;
     opt.weak_digests = NULL;
     opt.compliance = CO_GNUPG;
 
     /* Check special options given on the command line.  */
     orig_argc = argc;
     orig_argv = argv;
     pargs.argc = &argc;
     pargs.argv = &argv;
     pargs.flags= (ARGPARSE_FLAG_KEEP | ARGPARSE_FLAG_NOVERSION);
     while (gpgrt_argparse (NULL, &pargs, opts))
       {
 	switch (pargs.r_opt)
           {
           case oDebug:
           case oDebugAll:
             debug_argparser++;
             break;
 
           case oDebugIOLBF:
             es_setvbuf (es_stdout, NULL, _IOLBF, 0);
             break;
 
           case oNoOptions:
             /* Set here here because the homedir would otherwise be
              * created before main option parsing starts.  */
             opt.no_homedir_creation = 1;
             break;
 
           case oHomedir:
             homedirvalue = pargs.r.ret_str;
             break;
 
           case oChUid:
             changeuser = pargs.r.ret_str;
             break;
 
           case oNoPermissionWarn:
             opt.no_perm_warn = 1;
             break;
           }
       }
     /* Reset the flags.  */
     pargs.flags &= ~(ARGPARSE_FLAG_KEEP | ARGPARSE_FLAG_NOVERSION);
 
 #ifdef HAVE_DOSISH_SYSTEM
     /* FIXME: Do we still need this?  No: gnupg_homedir calls
      * make_filename which changes the slashed anyway.  IsDBCSLeadByte still
      * needed?  See bug #561.  */
     if ( strchr (gnupg_homedir (), '\\') ) {
       char *d, *buf = xmalloc (strlen (gnupg_homedir ())+1);
       const char *s;
       for (d=buf, s = gnupg_homedir (); *s; s++)
           {
             *d++ = *s == '\\'? '/': *s;
 #ifdef HAVE_W32_SYSTEM
             if (s[1] && IsDBCSLeadByte (*s))
               *d++ = *++s;
 #endif
           }
         *d = 0;
         gnupg_set_homedir (buf);
     }
 #endif
 
     /* Initialize the secure memory. */
     if (!gcry_control (GCRYCTL_INIT_SECMEM, SECMEM_BUFFER_SIZE, 0))
       got_secmem = 1;
 #if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
     /* There should be no way to get to this spot while still carrying
        setuid privs.  Just in case, bomb out if we are. */
     if ( getuid () != geteuid () )
       BUG ();
 #endif
     maybe_setuid = 0;
 
     /* Okay, we are now working under our real uid */
 
     /* malloc hooks go here ... */
     malloc_hooks.malloc = gcry_malloc;
     malloc_hooks.realloc = gcry_realloc;
     malloc_hooks.free = gcry_free;
     assuan_set_malloc_hooks (&malloc_hooks);
     assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT);
     setup_libassuan_logging (&opt.debug, NULL);
 
     /* Change UID and then set the homedir.  */
     if (changeuser && gnupg_chuid (changeuser, 0))
       log_inc_errorcount (); /* Force later termination.  */
     gnupg_set_homedir (homedirvalue);
 
     /* Set default options which require that malloc stuff is ready.  */
     additional_weak_digest ("MD5");
     parse_auto_key_locate (DEFAULT_AKL_LIST);
 
     argc = orig_argc;
     argv = orig_argv;
     pargs.argc = &argc;
     pargs.argv = &argv;
     /* We are re-using the struct, thus the reset flag.  We OR the
      * flags so that the internal intialized flag won't be cleared. */
     pargs.flags |= (ARGPARSE_FLAG_RESET
                     | ARGPARSE_FLAG_KEEP
                     | ARGPARSE_FLAG_SYS
                     | ARGPARSE_FLAG_USER
                     | ARGPARSE_FLAG_USERVERS);
 
     /* By this point we have a homedir, and cannot change it. */
     check_permissions (gnupg_homedir (), 0);
 
     /* The configuraton directories for use by gpgrt_argparser.  */
     gpgrt_set_confdir (GPGRT_CONFDIR_SYS, gnupg_sysconfdir ());
     gpgrt_set_confdir (GPGRT_CONFDIR_USER, gnupg_homedir ());
 
     while (gpgrt_argparser (&pargs, opts, GPG_NAME EXTSEP_S "conf" ))
       {
 	switch (pargs.r_opt)
 	  {
           case ARGPARSE_CONFFILE:
             if (debug_argparser)
               log_info (_("reading options from '%s'\n"),
                          pargs.r_type? pargs.r.ret_str: "[cmdline]");
             if (pargs.r_type)
               {
                 xfree (last_configname);
                 last_configname = xstrdup (pargs.r.ret_str);
                 configname = last_configname;
                 if (is_secured_filename (configname))
                   {
                     pargs.r_opt = ARGPARSE_PERMISSION_ERROR;
                     pargs.err = ARGPARSE_PRINT_ERROR;
                   }
                 else if (strncmp (configname, gnupg_sysconfdir (),
                                   strlen (gnupg_sysconfdir ())))
                   {
                     /* This is not the global config file and thus we
                      * need to check the permissions: If the file is
                      * unsafe, then disable any external programs for
                      * keyserver calls or photo IDs.  Since the
                      * external program to call is set in the options
                      * file, a unsafe options file can lead to an
                      * arbitrary program being run. */
                     if (check_permissions (configname, 1))
                       opt.exec_disable=1;
                   }
               }
             else
               configname = NULL;
             break;
 
             /* case oOptions: */
             /* case oNoOptions: */
             /* We will never see these options here because
              * gpgrt_argparse handles them for us.  */
             /* break */
 
 	  case aListConfig:
 	  case aListGcryptConfig:
           case aGPGConfList:
           case aGPGConfTest:
             set_cmd (&cmd, pargs.r_opt);
             /* Do not register a keyring for these commands.  */
             default_keyring = -1;
             break;
 
 	  case aCheckKeys:
 	  case aListPackets:
 	  case aImport:
 	  case aFastImport:
 	  case aSendKeys:
 	  case aRecvKeys:
 	  case aSearchKeys:
 	  case aRefreshKeys:
 	  case aFetchKeys:
 	  case aExport:
 #ifdef ENABLE_CARD_SUPPORT
           case aCardStatus:
           case aCardEdit:
           case aChangePIN:
 #endif /* ENABLE_CARD_SUPPORT*/
 	  case aListKeys:
 	  case aLocateKeys:
 	  case aLocateExtKeys:
 	  case aListSigs:
 	  case aExportSecret:
 	  case aExportSecretSub:
 	  case aExportSshKey:
 	  case aExportSecretSshKey:
 	  case aSym:
 	  case aClearsign:
 	  case aGenRevoke:
 	  case aDesigRevoke:
 	  case aPrimegen:
 	  case aGenRandom:
 	  case aPrintMD:
 	  case aPrintMDs:
 	  case aListTrustDB:
 	  case aCheckTrustDB:
 	  case aUpdateTrustDB:
 	  case aFixTrustDB:
 	  case aListTrustPath:
 	  case aDeArmor:
 	  case aEnArmor:
 	  case aSign:
 	  case aQuickSignKey:
 	  case aQuickLSignKey:
 	  case aQuickRevSig:
 	  case aSignKey:
 	  case aLSignKey:
 	  case aStore:
 	  case aQuickKeygen:
 	  case aQuickAddUid:
 	  case aQuickAddKey:
 	  case aQuickRevUid:
 	  case aQuickSetExpire:
 	  case aQuickSetPrimaryUid:
 	  case aQuickUpdatePref:
 	  case aExportOwnerTrust:
 	  case aImportOwnerTrust:
           case aRebuildKeydbCaches:
             set_cmd (&cmd, pargs.r_opt);
             break;
 
 	  case aKeygen:
 	  case aFullKeygen:
 	  case aEditKey:
 	  case aDeleteSecretKeys:
 	  case aDeleteSecretAndPublicKeys:
 	  case aDeleteKeys:
           case aPasswd:
             set_cmd (&cmd, pargs.r_opt);
             greeting=1;
             break;
 
 	  case aShowKeys:
             set_cmd (&cmd, pargs.r_opt);
             opt.import_options |= IMPORT_SHOW;
             opt.import_options |= IMPORT_DRY_RUN;
             opt.import_options &= ~IMPORT_REPAIR_KEYS;
             opt.list_options |= LIST_SHOW_UNUSABLE_UIDS;
             opt.list_options |= LIST_SHOW_UNUSABLE_SUBKEYS;
             opt.list_options |= LIST_SHOW_NOTATIONS;
             opt.list_options |= LIST_SHOW_POLICY_URLS;
             break;
 
 	  case aDetachedSign: detached_sig = 1; set_cmd( &cmd, aSign ); break;
 
 	  case aDecryptFiles: multifile=1; /* fall through */
 	  case aDecrypt: set_cmd( &cmd, aDecrypt); break;
 
 	  case aEncrFiles: multifile=1; /* fall through */
 	  case aEncr: set_cmd( &cmd, aEncr); break;
 
 	  case aVerifyFiles: multifile=1; /* fall through */
 	  case aVerify: set_cmd( &cmd, aVerify); break;
 
           case aServer:
             set_cmd (&cmd, pargs.r_opt);
             opt.batch = 1;
             break;
 
           case aTOFUPolicy:
             set_cmd (&cmd, pargs.r_opt);
             break;
 
 	  case oArmor: opt.armor = 1; opt.no_armor=0; break;
 	  case oOutput: opt.outfile = pargs.r.ret_str; break;
 
 	  case oMaxOutput: opt.max_output = pargs.r.ret_ulong; break;
 
           case oInputSizeHint:
             opt.input_size_hint = string_to_u64 (pargs.r.ret_str);
             break;
 
           case oChunkSize:
             opt.chunk_size = pargs.r.ret_int;
             break;
 
 	  case oQuiet: opt.quiet = 1; break;
 	  case oNoTTY: tty_no_terminal(1); break;
 	  case oDryRun: opt.dry_run = 1; break;
 	  case oInteractive: opt.interactive = 1; break;
 	  case oVerbose:
 	    opt.verbose++;
             gcry_control (GCRYCTL_SET_VERBOSITY, (int)opt.verbose);
 	    opt.list_options|=LIST_SHOW_UNUSABLE_UIDS;
 	    opt.list_options|=LIST_SHOW_UNUSABLE_SUBKEYS;
 	    break;
 
 	  case oBatch:
             opt.batch = 1;
             nogreeting = 1;
             break;
 
           case oUseAgent: /* Dummy. */
             break;
 
           case oNoUseAgent:
 	    obsolete_option (configname, pargs.lineno, "no-use-agent");
             break;
 	  case oGpgAgentInfo:
 	    obsolete_option (configname, pargs.lineno, "gpg-agent-info");
             break;
 
           case oUseKeyboxd:
             opt.use_keyboxd = 1;
             break;
 
           case oReaderPort:
 	    obsolete_scdaemon_option (configname, pargs.lineno, "reader-port");
             break;
           case octapiDriver:
 	    obsolete_scdaemon_option (configname, pargs.lineno, "ctapi-driver");
             break;
           case opcscDriver:
 	    obsolete_scdaemon_option (configname, pargs.lineno, "pcsc-driver");
             break;
           case oDisableCCID:
 	    obsolete_scdaemon_option (configname, pargs.lineno, "disable-ccid");
             break;
           case oHonorHttpProxy:
 	    obsolete_option (configname, pargs.lineno, "honor-http-proxy");
             break;
 
 	  case oAnswerYes: opt.answer_yes = 1; break;
 	  case oAnswerNo: opt.answer_no = 1; break;
 
           case oForceSignKey: opt.flags.force_sign_key = 1; break;
 
 	  case oKeyring: append_to_strlist( &nrings, pargs.r.ret_str); break;
 	  case oPrimaryKeyring:
 	    sl = append_to_strlist (&nrings, pargs.r.ret_str);
 	    sl->flags = KEYDB_RESOURCE_FLAG_PRIMARY;
 	    break;
 	  case oShowKeyring:
 	    deprecated_warning(configname,pargs.lineno,"--show-keyring",
 			       "--list-options ","show-keyring");
 	    opt.list_options|=LIST_SHOW_KEYRING;
 	    break;
 
 	  case oDebug:
             if (parse_debug_flag (pargs.r.ret_str, &opt.debug, debug_flags))
               {
                 pargs.r_opt = ARGPARSE_INVALID_ARG;
                 pargs.err = ARGPARSE_PRINT_ERROR;
               }
             break;
 
 	  case oDebugAll: opt.debug = ~0; break;
           case oDebugLevel: debug_level = pargs.r.ret_str; break;
 
           case oDebugIOLBF: break; /* Already set in pre-parse step.  */
 
           case oDebugSetIobufSize:
             opt_set_iobuf_size = pargs.r.ret_ulong;
             opt_set_iobuf_size_used = 1;
             break;
 
           case oDebugAllowLargeChunks:
             allow_large_chunks = 1;
             break;
 
           case oCompatibilityFlags:
             if (parse_compatibility_flags (pargs.r.ret_str, &opt.compat_flags,
                                            compatibility_flags))
               {
                 pargs.r_opt = ARGPARSE_INVALID_ARG;
                 pargs.err = ARGPARSE_PRINT_ERROR;
               }
             break;
 
 	  case oStatusFD:
             set_status_fd ( translate_sys2libc_fd_int (pargs.r.ret_int, 1) );
             break;
 	  case oStatusFile:
             set_status_fd ( open_info_file (pargs.r.ret_str, 1, 0) );
             break;
 	  case oAttributeFD:
             set_attrib_fd ( translate_sys2libc_fd_int (pargs.r.ret_int, 1) );
             break;
 	  case oAttributeFile:
             set_attrib_fd ( open_info_file (pargs.r.ret_str, 1, 1) );
             break;
 	  case oLoggerFD:
             log_set_fd (translate_sys2libc_fd_int (pargs.r.ret_int, 1));
             break;
           case oLoggerFile:
             logfile = pargs.r.ret_str;
             break;
 
 	  case oWithFingerprint:
             opt.with_fingerprint = 1;
             opt.fingerprint++;
             break;
 	  case oWithSubkeyFingerprint:
             opt.with_subkey_fingerprint = 1;
             break;
 	  case oWithICAOSpelling:
             opt.with_icao_spelling = 1;
             break;
 	  case oFingerprint:
             opt.fingerprint++;
             fpr_maybe_cmd = 1;
             break;
 
 	  case oWithKeygrip:
             opt.with_keygrip = 1;
             break;
 
 	  case oWithKeyScreening:
             opt.with_key_screening = 1;
             break;
 
 	  case oWithSecret:
             opt.with_secret = 1;
             break;
 
 	  case oWithWKDHash:
             opt.with_wkd_hash = 1;
             break;
 
 	  case oWithKeyOrigin:
             opt.with_key_origin = 1;
             break;
 
 	  case oSecretKeyring:
 	    obsolete_option (configname, pargs.lineno, "secret-keyring");
             break;
 
 	  case oNoArmor: opt.no_armor=1; opt.armor=0; break;
 
 	  case oNoDefKeyring:
             if (default_keyring > 0)
               default_keyring = 0;
             break;
 	  case oNoKeyring:
             default_keyring = -1;
             break;
 
 	  case oNoGreeting: nogreeting = 1; break;
 	  case oNoVerbose:
             opt.verbose = 0;
             gcry_control (GCRYCTL_SET_VERBOSITY, (int)opt.verbose);
             opt.list_sigs=0;
             break;
           case oQuickRandom:
             gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
             break;
 	  case oEmitVersion: opt.emit_version++; break;
 	  case oNoEmitVersion: opt.emit_version=0; break;
 	  case oCompletesNeeded: opt.completes_needed = pargs.r.ret_int; break;
 	  case oMarginalsNeeded: opt.marginals_needed = pargs.r.ret_int; break;
 	  case oMaxCertDepth: opt.max_cert_depth = pargs.r.ret_int; break;
 
 #ifndef NO_TRUST_MODELS
 	  case oTrustDBName: trustdb_name = pargs.r.ret_str; break;
 
 #endif /*!NO_TRUST_MODELS*/
 	  case oDefaultKey:
             sl = add_to_strlist (&opt.def_secret_key, pargs.r.ret_str);
             sl->flags = (pargs.r_opt << PK_LIST_SHIFT);
             if (configname)
               sl->flags |= PK_LIST_CONFIG;
             break;
 	  case oDefRecipient:
             if( *pargs.r.ret_str )
 	      {
 		xfree (opt.def_recipient);
 		opt.def_recipient = make_username(pargs.r.ret_str);
 	      }
             break;
 	  case oDefRecipientSelf:
             xfree(opt.def_recipient); opt.def_recipient = NULL;
             opt.def_recipient_self = 1;
             break;
 	  case oNoDefRecipient:
             xfree(opt.def_recipient); opt.def_recipient = NULL;
             opt.def_recipient_self = 0;
             break;
 	  case oHomedir: break;
           case oChUid: break;  /* Command line only (see above).  */
 	  case oNoBatch: opt.batch = 0; break;
 
           case oWithTofuInfo: opt.with_tofu_info = 1; break;
 
 	  case oWithKeyData: opt.with_key_data=1; /*FALLTHRU*/
 	  case oWithColons: opt.with_colons=':'; break;
 
           case oWithSigCheck: opt.check_sigs = 1; /*FALLTHRU*/
           case oWithSigList: opt.list_sigs = 1; break;
 
 	  case oSkipVerify: opt.skip_verify=1; break;
 
 	  case oSkipHiddenRecipients: opt.skip_hidden_recipients = 1; break;
 	  case oNoSkipHiddenRecipients: opt.skip_hidden_recipients = 0; break;
 
 	  case aListSecretKeys: set_cmd( &cmd, aListSecretKeys); break;
 
 #ifndef NO_TRUST_MODELS
 	    /* There are many programs (like mutt) that call gpg with
 	       --always-trust so keep this option around for a long
 	       time. */
 	  case oAlwaysTrust: opt.trust_model=TM_ALWAYS; break;
 	  case oTrustModel:
 	    parse_trust_model(pargs.r.ret_str);
 	    break;
 #endif /*!NO_TRUST_MODELS*/
 	  case oTOFUDefaultPolicy:
 	    opt.tofu_default_policy = parse_tofu_policy (pargs.r.ret_str);
 	    break;
 	  case oTOFUDBFormat:
 	    obsolete_option (configname, pargs.lineno, "tofu-db-format");
 	    break;
 
 	  case oForceOwnertrust:
 	    log_info(_("Note: %s is not for normal use!\n"),
 		     "--force-ownertrust");
 	    opt.force_ownertrust=string_to_trust_value(pargs.r.ret_str);
 	    if(opt.force_ownertrust==-1)
 	      {
 		log_error("invalid ownertrust '%s'\n",pargs.r.ret_str);
 		opt.force_ownertrust=0;
 	      }
 	    break;
 
           case oNoAutoTrustNewKey: opt.flags.no_auto_trust_new_key = 1; break;
 
           case oCompliance:
 	    {
 	      int compliance = gnupg_parse_compliance_option
                 (pargs.r.ret_str,
                  compliance_options, DIM (compliance_options),
                  opt.quiet);
 	      if (compliance < 0)
 		g10_exit (1);
 	      set_compliance_option (compliance);
 	    }
             break;
           case oOpenPGP:
           case oRFC2440:
           case oRFC4880:
           case oPGP7:
           case oPGP8:
           case oGnuPG:
             set_compliance_option (pargs.r_opt);
             break;
 
 	  case oMinRSALength: opt.min_rsa_length = pargs.r.ret_ulong; break;
 
           case oRFC2440Text: opt.rfc2440_text=1; break;
           case oNoRFC2440Text: opt.rfc2440_text=0; break;
 
  	  case oSetFilename:
             if(utf8_strings)
               opt.set_filename = pargs.r.ret_str;
             else
               opt.set_filename = native_to_utf8(pargs.r.ret_str);
  	    break;
 	  case oForYourEyesOnly: eyes_only = 1; break;
 	  case oNoForYourEyesOnly: eyes_only = 0; break;
 	  case oSetPolicyURL:
 	    add_policy_url(pargs.r.ret_str,0);
 	    add_policy_url(pargs.r.ret_str,1);
 	    break;
 	  case oSigPolicyURL: add_policy_url(pargs.r.ret_str,0); break;
 	  case oCertPolicyURL: add_policy_url(pargs.r.ret_str,1); break;
           case oShowPolicyURL:
 	    deprecated_warning(configname,pargs.lineno,"--show-policy-url",
 			       "--list-options ","show-policy-urls");
 	    deprecated_warning(configname,pargs.lineno,"--show-policy-url",
 			       "--verify-options ","show-policy-urls");
 	    opt.list_options|=LIST_SHOW_POLICY_URLS;
 	    opt.verify_options|=VERIFY_SHOW_POLICY_URLS;
 	    break;
 	  case oNoShowPolicyURL:
 	    deprecated_warning(configname,pargs.lineno,"--no-show-policy-url",
 			       "--list-options ","no-show-policy-urls");
 	    deprecated_warning(configname,pargs.lineno,"--no-show-policy-url",
 			       "--verify-options ","no-show-policy-urls");
 	    opt.list_options&=~LIST_SHOW_POLICY_URLS;
 	    opt.verify_options&=~VERIFY_SHOW_POLICY_URLS;
 	    break;
 	  case oSigKeyserverURL: add_keyserver_url(pargs.r.ret_str,0); break;
 	  case oUseEmbeddedFilename:
 	    opt.flags.use_embedded_filename=1;
 	    break;
 	  case oNoUseEmbeddedFilename:
 	    opt.flags.use_embedded_filename=0;
 	    break;
 	  case oComment:
 	    if(pargs.r.ret_str[0])
 	      append_to_strlist(&opt.comments,pargs.r.ret_str);
 	    break;
 	  case oDefaultComment:
 	    deprecated_warning(configname,pargs.lineno,
 			       "--default-comment","--no-comments","");
 	    /* fall through */
 	  case oNoComments:
 	    free_strlist(opt.comments);
 	    opt.comments=NULL;
 	    break;
 	  case oThrowKeyids: opt.throw_keyids = 1; break;
 	  case oNoThrowKeyids: opt.throw_keyids = 0; break;
 	  case oShowPhotos:
 	    deprecated_warning(configname,pargs.lineno,"--show-photos",
 			       "--list-options ","show-photos");
 	    deprecated_warning(configname,pargs.lineno,"--show-photos",
 			       "--verify-options ","show-photos");
 	    opt.list_options|=LIST_SHOW_PHOTOS;
 	    opt.verify_options|=VERIFY_SHOW_PHOTOS;
 	    break;
 	  case oNoShowPhotos:
 	    deprecated_warning(configname,pargs.lineno,"--no-show-photos",
 			       "--list-options ","no-show-photos");
 	    deprecated_warning(configname,pargs.lineno,"--no-show-photos",
 			       "--verify-options ","no-show-photos");
 	    opt.list_options&=~LIST_SHOW_PHOTOS;
 	    opt.verify_options&=~VERIFY_SHOW_PHOTOS;
 	    break;
 	  case oPhotoViewer: opt.photo_viewer = pargs.r.ret_str; break;
 
 	  case oForceAEAD: opt.force_aead = 1; break;
 
           case oDisableSignerUID: opt.flags.disable_signer_uid = 1; break;
           case oIncludeKeyBlock:  opt.flags.include_key_block = 1; break;
           case oNoIncludeKeyBlock: opt.flags.include_key_block = 0; break;
 
 	  case oS2KMode:   opt.s2k_mode = pargs.r.ret_int; break;
 	  case oS2KDigest: s2k_digest_string = xstrdup(pargs.r.ret_str); break;
 	  case oS2KCipher: s2k_cipher_string = xstrdup(pargs.r.ret_str); break;
 	  case oS2KCount:
 	    if (pargs.r.ret_int)
               opt.s2k_count = encode_s2k_iterations (pargs.r.ret_int);
             else
               opt.s2k_count = 0;  /* Auto-calibrate when needed.  */
 	    break;
 
 	  case oRecipient:
 	  case oHiddenRecipient:
 	  case oRecipientFile:
 	  case oHiddenRecipientFile:
             /* Store the recipient.  Note that we also store the
              * option as private data in the flags.  This is achieved
              * by shifting the option value to the left so to keep
              * enough space for the flags.  */
 	    sl = add_to_strlist2( &remusr, pargs.r.ret_str, utf8_strings );
 	    sl->flags = (pargs.r_opt << PK_LIST_SHIFT);
             if (configname)
               sl->flags |= PK_LIST_CONFIG;
             if (pargs.r_opt == oHiddenRecipient
                 || pargs.r_opt == oHiddenRecipientFile)
               sl->flags |= PK_LIST_HIDDEN;
             if (pargs.r_opt == oRecipientFile
                 || pargs.r_opt == oHiddenRecipientFile)
               sl->flags |= PK_LIST_FROM_FILE;
             any_explicit_recipient = 1;
 	    break;
 
 	  case oEncryptTo:
 	  case oHiddenEncryptTo:
             /* Store an additional recipient.  */
 	    sl = add_to_strlist2( &remusr, pargs.r.ret_str, utf8_strings );
 	    sl->flags = ((pargs.r_opt << PK_LIST_SHIFT) | PK_LIST_ENCRYPT_TO);
             if (configname)
               sl->flags |= PK_LIST_CONFIG;
             if (pargs.r_opt == oHiddenEncryptTo)
               sl->flags |= PK_LIST_HIDDEN;
 	    break;
 
 	  case oNoEncryptTo:
             opt.no_encrypt_to = 1;
             break;
           case oEncryptToDefaultKey:
             opt.encrypt_to_default_key = configname ? 2 : 1;
             break;
 
 	  case oTrySecretKey:
 	    add_to_strlist2 (&opt.secret_keys_to_try,
                              pargs.r.ret_str, utf8_strings);
 	    break;
 
           case oMimemode: opt.mimemode = opt.textmode = 1; break;
 	  case oTextmodeShort: opt.textmode = 2; break;
 	  case oTextmode: opt.textmode=1;  break;
 	  case oNoTextmode: opt.textmode=opt.mimemode=0;  break;
 
 	  case oExpert: opt.expert = 1; break;
 	  case oNoExpert: opt.expert = 0; break;
 	  case oDefSigExpire:
 	    if(*pargs.r.ret_str!='\0')
 	      {
 		if(parse_expire_string(pargs.r.ret_str)==(u32)-1)
 		  log_error(_("'%s' is not a valid signature expiration\n"),
 			    pargs.r.ret_str);
 		else
 		  opt.def_sig_expire=pargs.r.ret_str;
 	      }
 	    break;
 	  case oAskSigExpire: opt.ask_sig_expire = 1; break;
 	  case oNoAskSigExpire: opt.ask_sig_expire = 0; break;
 	  case oDefCertExpire:
 	    if(*pargs.r.ret_str!='\0')
 	      {
 		if(parse_expire_string(pargs.r.ret_str)==(u32)-1)
 		  log_error(_("'%s' is not a valid signature expiration\n"),
 			    pargs.r.ret_str);
 		else
 		  opt.def_cert_expire=pargs.r.ret_str;
 	      }
 	    break;
 	  case oAskCertExpire: opt.ask_cert_expire = 1; break;
 	  case oNoAskCertExpire: opt.ask_cert_expire = 0; break;
           case oDefCertLevel: opt.def_cert_level=pargs.r.ret_int; break;
           case oMinCertLevel: opt.min_cert_level=pargs.r.ret_int; break;
 	  case oAskCertLevel: opt.ask_cert_level = 1; break;
 	  case oNoAskCertLevel: opt.ask_cert_level = 0; break;
 	  case oLocalUser: /* store the local users */
 	    sl = add_to_strlist2( &locusr, pargs.r.ret_str, utf8_strings );
             sl->flags = (pargs.r_opt << PK_LIST_SHIFT);
             if (configname)
               sl->flags |= PK_LIST_CONFIG;
 	    break;
 	  case oSender:
             {
               char *mbox = mailbox_from_userid (pargs.r.ret_str, 0);
               if (!mbox)
                 log_error (_("\"%s\" is not a proper mail address\n"),
                            pargs.r.ret_str);
               else
                 {
                   add_to_strlist (&opt.sender_list, mbox);
                   xfree (mbox);
                 }
             }
 	    break;
 	  case oCompress:
 	    /* this is the -z command line option */
 	    opt.compress_level = opt.bz2_compress_level = pargs.r.ret_int;
             opt.explicit_compress_option = 1;
 	    break;
 	  case oCompressLevel: opt.compress_level = pargs.r.ret_int; break;
 	  case oBZ2CompressLevel: opt.bz2_compress_level = pargs.r.ret_int; break;
 	  case oBZ2DecompressLowmem: opt.bz2_decompress_lowmem=1; break;
 	  case oPassphrase:
             set_passphrase_from_string (pargs.r_type ? pargs.r.ret_str : "");
 	    break;
 	  case oPassphraseFD:
             pwfd = translate_sys2libc_fd_int (pargs.r.ret_int, 0);
             break;
 	  case oPassphraseFile:
             pwfd = open_info_file (pargs.r.ret_str, 0, 1);
             break;
 	  case oPassphraseRepeat:
             opt.passphrase_repeat = pargs.r.ret_int;
             break;
 
           case oPinentryMode:
 	    opt.pinentry_mode = parse_pinentry_mode (pargs.r.ret_str);
 	    if (opt.pinentry_mode == -1)
               log_error (_("invalid pinentry mode '%s'\n"), pargs.r.ret_str);
 	    break;
 
           case oRequestOrigin:
 	    opt.request_origin = parse_request_origin (pargs.r.ret_str);
 	    if (opt.request_origin == -1)
               log_error (_("invalid request origin '%s'\n"), pargs.r.ret_str);
 	    break;
 
 	  case oCommandFD:
             opt.command_fd = translate_sys2libc_fd_int (pargs.r.ret_int, 0);
 	    if (! gnupg_fd_valid (opt.command_fd))
 	      log_error ("command-fd is invalid: %s\n", strerror (errno));
             break;
 	  case oCommandFile:
             opt.command_fd = open_info_file (pargs.r.ret_str, 0, 1);
             break;
 	  case oCipherAlgo:
             def_cipher_string = xstrdup(pargs.r.ret_str);
             break;
 	  case oDigestAlgo:
             def_digest_string = xstrdup(pargs.r.ret_str);
             break;
 	  case oCompressAlgo:
 	    /* If it is all digits, stick a Z in front of it for
 	       later.  This is for backwards compatibility with
 	       versions that took the compress algorithm number. */
 	    {
 	      char *pt=pargs.r.ret_str;
 	      while(*pt)
 		{
 		  if (!isascii (*pt) || !isdigit (*pt))
 		    break;
 
 		  pt++;
 		}
 
 	      if(*pt=='\0')
 		{
 		  compress_algo_string=xmalloc(strlen(pargs.r.ret_str)+2);
 		  strcpy(compress_algo_string,"Z");
 		  strcat(compress_algo_string,pargs.r.ret_str);
 		}
 	      else
 		compress_algo_string = xstrdup(pargs.r.ret_str);
 	    }
 	    break;
 	  case oCertDigestAlgo:
             cert_digest_string = xstrdup(pargs.r.ret_str);
             break;
 
 	  case oNoSecmemWarn:
             gcry_control (GCRYCTL_DISABLE_SECMEM_WARN);
             break;
 
 	  case oRequireSecmem: require_secmem=1; break;
 	  case oNoRequireSecmem: require_secmem=0; break;
 	  case oNoPermissionWarn: opt.no_perm_warn=1; break;
           case oDisplayCharset:
 	    if( set_native_charset( pargs.r.ret_str ) )
 		log_error(_("'%s' is not a valid character set\n"),
 			  pargs.r.ret_str);
 	    break;
 	  case oNotDashEscaped: opt.not_dash_escaped = 1; break;
 	  case oEscapeFrom: opt.escape_from = 1; break;
 	  case oNoEscapeFrom: opt.escape_from = 0; break;
 	  case oLockOnce: opt.lock_once = 1; break;
 	  case oLockNever:
             dotlock_disable ();
             break;
 	  case oLockMultiple:
 #ifndef __riscos__
 	    opt.lock_once = 0;
 #else /* __riscos__ */
             riscos_not_implemented("lock-multiple");
 #endif /* __riscos__ */
             break;
 	  case oKeyServer:
 	    {
 	      keyserver_spec_t keyserver;
 	      keyserver = parse_keyserver_uri (pargs.r.ret_str, 0);
 	      if (!keyserver)
 		log_error (_("could not parse keyserver URL\n"));
 	      else
 		{
 		  /* We only support a single keyserver.  Later ones
 		     override earlier ones.  (Since we parse the
 		     config file first and then the command line
 		     arguments, the command line takes
 		     precedence.)  */
 		  if (opt.keyserver)
 		    free_keyserver_spec (opt.keyserver);
 		  opt.keyserver = keyserver;
 		}
 	    }
 	    break;
 	  case oKeyServerOptions:
 	    if(!parse_keyserver_options(pargs.r.ret_str))
 	      {
 		if(configname)
 		  log_error(_("%s:%d: invalid keyserver options\n"),
 			    configname,pargs.lineno);
 		else
 		  log_error(_("invalid keyserver options\n"));
 	      }
 	    break;
 	  case oImportOptions:
 	    if(!parse_import_options(pargs.r.ret_str,&opt.import_options,1))
 	      {
 		if(configname)
 		  log_error(_("%s:%d: invalid import options\n"),
 			    configname,pargs.lineno);
 		else
 		  log_error(_("invalid import options\n"));
 	      }
 	    break;
 	  case oImportFilter:
 	    rc = parse_and_set_import_filter (pargs.r.ret_str);
 	    if (rc)
               log_error (_("invalid filter option: %s\n"), gpg_strerror (rc));
 	    break;
 	  case oExportOptions:
 	    if(!parse_export_options(pargs.r.ret_str,&opt.export_options,1))
 	      {
 		if(configname)
 		  log_error(_("%s:%d: invalid export options\n"),
 			    configname,pargs.lineno);
 		else
 		  log_error(_("invalid export options\n"));
 	      }
 	    break;
 	  case oExportFilter:
 	    rc = parse_and_set_export_filter (pargs.r.ret_str);
 	    if (rc)
               log_error (_("invalid filter option: %s\n"), gpg_strerror (rc));
 	    break;
 	  case oListFilter:
 	    rc = parse_and_set_list_filter (pargs.r.ret_str);
 	    if (rc)
               log_error (_("invalid filter option: %s\n"), gpg_strerror (rc));
 	    break;
 	  case oListOptions:
 	    if(!parse_list_options(pargs.r.ret_str))
 	      {
 		if(configname)
 		  log_error(_("%s:%d: invalid list options\n"),
 			    configname,pargs.lineno);
 		else
 		  log_error(_("invalid list options\n"));
 	      }
 	    break;
 	  case oVerifyOptions:
 	    {
 	      struct parse_options vopts[]=
 		{
 		  {"show-photos",VERIFY_SHOW_PHOTOS,NULL,
 		   N_("display photo IDs during signature verification")},
 		  {"show-policy-urls",VERIFY_SHOW_POLICY_URLS,NULL,
 		   N_("show policy URLs during signature verification")},
 		  {"show-notations",VERIFY_SHOW_NOTATIONS,NULL,
 		   N_("show all notations during signature verification")},
 		  {"show-std-notations",VERIFY_SHOW_STD_NOTATIONS,NULL,
 		   N_("show IETF standard notations during signature verification")},
 		  {"show-standard-notations",VERIFY_SHOW_STD_NOTATIONS,NULL,
 		   NULL},
 		  {"show-user-notations",VERIFY_SHOW_USER_NOTATIONS,NULL,
 		   N_("show user-supplied notations during signature verification")},
 		  {"show-keyserver-urls",VERIFY_SHOW_KEYSERVER_URLS,NULL,
 		   N_("show preferred keyserver URLs during signature verification")},
 		  {"show-uid-validity",VERIFY_SHOW_UID_VALIDITY,NULL,
 		   N_("show user ID validity during signature verification")},
 		  {"show-unusable-uids",VERIFY_SHOW_UNUSABLE_UIDS,NULL,
 		   N_("show revoked and expired user IDs in signature verification")},
 		  {"show-primary-uid-only",VERIFY_SHOW_PRIMARY_UID_ONLY,NULL,
 		   N_("show only the primary user ID in signature verification")},
 		  {NULL,0,NULL,NULL}
 		};
 
 	      if(!parse_options(pargs.r.ret_str,&opt.verify_options,vopts,1))
 		{
 		  if(configname)
 		    log_error(_("%s:%d: invalid verify options\n"),
 			      configname,pargs.lineno);
 		  else
 		    log_error(_("invalid verify options\n"));
 		}
 	    }
 	    break;
 	  case oTempDir: opt.temp_dir=pargs.r.ret_str; break;
 	  case oExecPath:
 	    if(set_exec_path(pargs.r.ret_str))
 	      log_error(_("unable to set exec-path to %s\n"),pargs.r.ret_str);
 	    else
 	      opt.exec_path_set=1;
 	    break;
 	  case oSetNotation:
 	    add_notation_data( pargs.r.ret_str, 0 );
 	    add_notation_data( pargs.r.ret_str, 1 );
 	    break;
 	  case oSigNotation: add_notation_data( pargs.r.ret_str, 0 ); break;
 	  case oCertNotation: add_notation_data( pargs.r.ret_str, 1 ); break;
           case oKnownNotation: register_known_notation (pargs.r.ret_str); break;
 	  case oShowNotation:
 	    deprecated_warning(configname,pargs.lineno,"--show-notation",
 			       "--list-options ","show-notations");
 	    deprecated_warning(configname,pargs.lineno,"--show-notation",
 			       "--verify-options ","show-notations");
 	    opt.list_options|=LIST_SHOW_NOTATIONS;
 	    opt.verify_options|=VERIFY_SHOW_NOTATIONS;
 	    break;
 	  case oNoShowNotation:
 	    deprecated_warning(configname,pargs.lineno,"--no-show-notation",
 			       "--list-options ","no-show-notations");
 	    deprecated_warning(configname,pargs.lineno,"--no-show-notation",
 			       "--verify-options ","no-show-notations");
 	    opt.list_options&=~LIST_SHOW_NOTATIONS;
 	    opt.verify_options&=~VERIFY_SHOW_NOTATIONS;
 	    break;
 	  case oUtf8Strings: utf8_strings = 1; break;
 	  case oNoUtf8Strings:
 #ifdef HAVE_W32_SYSTEM
             utf8_strings = 0;
 #endif
             break;
 	  case oDisableCipherAlgo:
             {
               int algo = string_to_cipher_algo (pargs.r.ret_str);
               gcry_cipher_ctl (NULL, GCRYCTL_DISABLE_ALGO, &algo, sizeof algo);
             }
             break;
 	  case oDisablePubkeyAlgo:
             {
               int algo = gcry_pk_map_name (pargs.r.ret_str);
               gcry_pk_ctl (GCRYCTL_DISABLE_ALGO, &algo, sizeof algo);
             }
             break;
           case oNoSigCache: opt.no_sig_cache = 1; break;
 	  case oAllowNonSelfsignedUID: opt.allow_non_selfsigned_uid = 1; break;
 	  case oNoAllowNonSelfsignedUID: opt.allow_non_selfsigned_uid=0; break;
 	  case oAllowFreeformUID: opt.allow_freeform_uid = 1; break;
 	  case oNoAllowFreeformUID: opt.allow_freeform_uid = 0; break;
 	  case oNoLiteral: opt.no_literal = 1; break;
 	  case oSetFilesize: opt.set_filesize = pargs.r.ret_ulong; break;
 	  case oFastListMode: opt.fast_list_mode = 1; break;
 	  case oFixedListMode: /* Dummy */ break;
           case oLegacyListMode: opt.legacy_list_mode = 1; break;
 	  case oPrintDANERecords: print_dane_records = 1; break;
 	  case oListOnly: opt.list_only=1; break;
 	  case oIgnoreTimeConflict: opt.ignore_time_conflict = 1; break;
 	  case oIgnoreValidFrom: opt.ignore_valid_from = 1; break;
 	  case oIgnoreCrcError: opt.ignore_crc_error = 1; break;
 	  case oIgnoreMDCError: opt.ignore_mdc_error = 1; break;
 	  case oNoRandomSeedFile: use_random_seed = 0; break;
 
           case oAutoKeyImport: opt.flags.auto_key_import = 1; break;
           case oNoAutoKeyImport: opt.flags.auto_key_import = 0; break;
 
 	  case oAutoKeyRetrieve:
             opt.keyserver_options.options |= KEYSERVER_AUTO_KEY_RETRIEVE;
             break;
 	  case oNoAutoKeyRetrieve:
             opt.keyserver_options.options &= ~KEYSERVER_AUTO_KEY_RETRIEVE;
             break;
 
 	  case oShowSessionKey: opt.show_session_key = 1; break;
 	  case oOverrideSessionKey:
 		opt.override_session_key = pargs.r.ret_str;
 		break;
 	  case oOverrideSessionKeyFD:
                 ovrseskeyfd = translate_sys2libc_fd_int (pargs.r.ret_int, 0);
 		break;
 	  case oMergeOnly:
 	        deprecated_warning(configname,pargs.lineno,"--merge-only",
 				   "--import-options ","merge-only");
 		opt.import_options|=IMPORT_MERGE_ONLY;
 	    break;
           case oAllowSecretKeyImport: /* obsolete */ break;
 	  case oTryAllSecrets: opt.try_all_secrets = 1; break;
           case oTrustedKey: register_trusted_key( pargs.r.ret_str ); break;
 
           case oEnableSpecialFilenames:
             enable_special_filenames ();
             break;
 
           case oNoExpensiveTrustChecks: opt.no_expensive_trust_checks=1; break;
           case oAutoCheckTrustDB: opt.no_auto_check_trustdb=0; break;
           case oNoAutoCheckTrustDB: opt.no_auto_check_trustdb=1; break;
           case oPreservePermissions: opt.preserve_permissions=1; break;
           case oDefaultPreferenceList:
 	    opt.def_preference_list = pargs.r.ret_str;
 	    break;
 	  case oDefaultKeyserverURL:
 	    {
 	      keyserver_spec_t keyserver;
 	      keyserver = parse_keyserver_uri (pargs.r.ret_str,1 );
 	      if (!keyserver)
 		log_error (_("could not parse keyserver URL\n"));
 	      else
 		free_keyserver_spec (keyserver);
 
 	      opt.def_keyserver_url = pargs.r.ret_str;
 	    }
 	    break;
           case oPersonalCipherPreferences:
 	    pers_cipher_list=pargs.r.ret_str;
 	    break;
           case oPersonalDigestPreferences:
 	    pers_digest_list=pargs.r.ret_str;
 	    break;
           case oPersonalCompressPreferences:
 	    pers_compress_list=pargs.r.ret_str;
 	    break;
           case oAgentProgram: opt.agent_program = pargs.r.ret_str;  break;
           case oKeyboxdProgram: opt.keyboxd_program = pargs.r.ret_str;  break;
           case oDirmngrProgram: opt.dirmngr_program = pargs.r.ret_str; break;
 	  case oDisableDirmngr: opt.disable_dirmngr = 1;  break;
           case oWeakDigest:
 	    additional_weak_digest(pargs.r.ret_str);
 	    break;
           case oUnwrap:
             opt.unwrap_encryption = 1;
             break;
           case oOnlySignTextIDs:
             opt.only_sign_text_ids = 1;
             break;
 
           case oDisplay:
             set_opt_session_env ("DISPLAY", pargs.r.ret_str);
             break;
           case oTTYname:
             set_opt_session_env ("GPG_TTY", pargs.r.ret_str);
             break;
           case oTTYtype:
             set_opt_session_env ("TERM", pargs.r.ret_str);
             break;
           case oXauthority:
             set_opt_session_env ("XAUTHORITY", pargs.r.ret_str);
             break;
 
           case oLCctype: opt.lc_ctype = pargs.r.ret_str; break;
           case oLCmessages: opt.lc_messages = pargs.r.ret_str; break;
 
 	  case oGroup: add_group(pargs.r.ret_str); break;
 	  case oUnGroup: rm_group(pargs.r.ret_str); break;
 	  case oNoGroups:
 	    while(opt.grouplist)
 	      {
 		struct groupitem *iter=opt.grouplist;
 		free_strlist(iter->values);
 		opt.grouplist=opt.grouplist->next;
 		xfree(iter);
 	      }
 	    break;
 
           case oMangleDosFilenames: opt.mangle_dos_filenames = 1; break;
           case oNoMangleDosFilenames: opt.mangle_dos_filenames = 0; break;
           case oEnableProgressFilter: opt.enable_progress_filter = 1; break;
 	  case oMultifile: multifile=1; break;
 	  case oKeyidFormat:
 	    if(ascii_strcasecmp(pargs.r.ret_str,"short")==0)
 	      opt.keyid_format=KF_SHORT;
 	    else if(ascii_strcasecmp(pargs.r.ret_str,"long")==0)
 	      opt.keyid_format=KF_LONG;
 	    else if(ascii_strcasecmp(pargs.r.ret_str,"0xshort")==0)
 	      opt.keyid_format=KF_0xSHORT;
 	    else if(ascii_strcasecmp(pargs.r.ret_str,"0xlong")==0)
 	      opt.keyid_format=KF_0xLONG;
 	    else if(ascii_strcasecmp(pargs.r.ret_str,"none")==0)
 	      opt.keyid_format = KF_NONE;
 	    else
 	      log_error("unknown keyid-format '%s'\n",pargs.r.ret_str);
 	    break;
 
           case oExitOnStatusWriteError:
             opt.exit_on_status_write_error = 1;
             break;
 
 	  case oLimitCardInsertTries:
             opt.limit_card_insert_tries = pargs.r.ret_int;
             break;
 
 	  case oRequireCrossCert: opt.flags.require_cross_cert=1; break;
 	  case oNoRequireCrossCert: opt.flags.require_cross_cert=0; break;
 
 	  case oAutoKeyLocate:
             if (default_akl)
               {
                 /* This is the first time --auto-key-locate is seen.
                  * We need to reset the default akl.  */
                 default_akl = 0;
                 release_akl();
               }
 	    if(!parse_auto_key_locate(pargs.r.ret_str))
 	      {
 		if(configname)
 		  log_error(_("%s:%d: invalid auto-key-locate list\n"),
 			    configname,pargs.lineno);
 		else
 		  log_error(_("invalid auto-key-locate list\n"));
 	      }
 	    break;
 	  case oNoAutoKeyLocate:
 	    release_akl();
 	    break;
 
 	  case oKeyOrigin:
 	    if(!parse_key_origin (pargs.r.ret_str))
               log_error (_("invalid argument for option \"%.50s\"\n"),
                          "--key-origin");
 	    break;
 
 	  case oEnableLargeRSA:
 #if SECMEM_BUFFER_SIZE >= 65536
             opt.flags.large_rsa=1;
 #else
             if (configname)
               log_info("%s:%d: WARNING: gpg not built with large secure "
                          "memory buffer.  Ignoring enable-large-rsa\n",
                         configname,pargs.lineno);
             else
               log_info("WARNING: gpg not built with large secure "
                          "memory buffer.  Ignoring --enable-large-rsa\n");
 #endif /* SECMEM_BUFFER_SIZE >= 65536 */
             break;
 	  case oDisableLargeRSA: opt.flags.large_rsa=0;
             break;
 
 	  case oEnableDSA2: opt.flags.dsa2=1; break;
 	  case oDisableDSA2: opt.flags.dsa2=0; break;
 
           case oAllowWeakDigestAlgos:
             opt.flags.allow_weak_digest_algos = 1;
             break;
 
           case oAllowWeakKeySignatures:
             opt.flags.allow_weak_key_signatures = 1;
             break;
 
           case oAllowOldCipherAlgos:
             opt.flags.allow_old_cipher_algos = 1;
             break;
 
           case oFakedSystemTime:
             {
               size_t len = strlen (pargs.r.ret_str);
               int freeze = 0;
               time_t faked_time;
 
               if (len > 0 && pargs.r.ret_str[len-1] == '!')
                 {
                   freeze = 1;
                   pargs.r.ret_str[len-1] = '\0';
                 }
 
               faked_time = isotime2epoch (pargs.r.ret_str);
               if (faked_time == (time_t)(-1))
                 faked_time = (time_t)strtoul (pargs.r.ret_str, NULL, 10);
               gnupg_set_time (faked_time, freeze);
             }
             break;
 
           case oNoAutostart: opt.autostart = 0; break;
           case oNoSymkeyCache: opt.no_symkey_cache = 1; break;
 
 	  case oDefaultNewKeyAlgo:
             opt.def_new_key_algo = pargs.r.ret_str;
             break;
 
           case oUseOnlyOpenPGPCard:
             opt.flags.use_only_openpgp_card = 1;
             break;
 
           case oFullTimestrings:
             opt.flags.full_timestrings = 1;
             break;
 
           case oForbidGenKey:
             mopt.forbid_gen_key = 1;
             break;
 
           case oRequireCompliance:
             opt.flags.require_compliance = 1;
             break;
 
 	  case oNoop: break;
 
 	  default:
             if (configname)
               pargs.err = ARGPARSE_PRINT_WARNING;
             else
               {
                 pargs.err = ARGPARSE_PRINT_ERROR;
                 /* The argparse function calls a plain exit and thus
                  * we need to print a status here.  */
                 write_status_failure ("option-parser",
                                       gpg_error(GPG_ERR_GENERAL));
               }
             break;
 	  }
       }
 
     gpgrt_argparse (NULL, &pargs, NULL);  /* Release internal state.  */
 
     if (log_get_errorcount (0))
       {
         write_status_failure ("option-parser", gpg_error(GPG_ERR_GENERAL));
         g10_exit(2);
       }
 
     /* Process common component options.  */
     if (parse_comopt (GNUPG_MODULE_NAME_GPG, debug_argparser))
       {
         write_status_failure ("option-parser", gpg_error(GPG_ERR_GENERAL));
         g10_exit(2);
       }
 
     if (opt.use_keyboxd)
       log_info ("Note: Please move option \"%s\" to \"common.conf\"\n",
                 "use-keyboxd");
     opt.use_keyboxd = comopt.use_keyboxd;  /* Override.  */
 
     if (opt.keyboxd_program)
       log_info ("Note: Please move option \"%s\" to \"common.conf\"\n",
                 "keyboxd-program");
     if (!opt.keyboxd_program && comopt.keyboxd_program)
       {
         opt.keyboxd_program = comopt.keyboxd_program;
         comopt.keyboxd_program = NULL;
       }
 
     if (comopt.no_autostart)
       opt.autostart = 0;
 
     /* The command --gpgconf-list is pretty simple and may be called
        directly after the option parsing. */
     if (cmd == aGPGConfList)
       {
         gpgconf_list ();
         g10_exit (0);
       }
     xfree (last_configname);
 
     if (print_dane_records)
       log_error ("invalid option \"%s\"; use \"%s\" instead\n",
                  "--print-dane-records",
                  "--export-options export-dane");
     if (log_get_errorcount (0))
       {
         write_status_failure ("option-checking", gpg_error(GPG_ERR_GENERAL));
         g10_exit(2);
       }
 
 
     if( nogreeting )
 	greeting = 0;
 
     if( greeting )
       {
 	es_fprintf (es_stderr, "%s %s; %s\n",
                     gpgrt_strusage(11), gpgrt_strusage(13), gpgrt_strusage(14));
 	es_fprintf (es_stderr, "%s\n", gpgrt_strusage(15) );
       }
 #ifdef IS_DEVELOPMENT_VERSION
     if (!opt.batch)
       {
 	const char *s;
 
 	if((s=gpgrt_strusage(25)))
 	  log_info("%s\n",s);
 	if((s=gpgrt_strusage(26)))
 	  log_info("%s\n",s);
 	if((s=gpgrt_strusage(27)))
 	  log_info("%s\n",s);
       }
 #endif
 
     /* Init threading which is used by some helper functions.  */
     npth_init ();
     assuan_set_system_hooks (ASSUAN_SYSTEM_NPTH);
     gpgrt_set_syscall_clamp (npth_unprotect, npth_protect);
 
     if (logfile)
       {
         log_set_file (logfile);
         log_set_prefix (NULL, (GPGRT_LOG_WITH_PREFIX
                                | GPGRT_LOG_WITH_TIME
                                | GPGRT_LOG_WITH_PID ));
       }
 
     if (opt.verbose > 2)
         log_info ("using character set '%s'\n", get_native_charset ());
 
     if( may_coredump && !opt.quiet )
 	log_info(_("WARNING: program may create a core file!\n"));
 
     if (eyes_only) {
       if (opt.set_filename)
 	  log_info(_("WARNING: %s overrides %s\n"),
 		   "--for-your-eyes-only","--set-filename");
 
       opt.set_filename="_CONSOLE";
     }
 
     if (opt.no_literal) {
 	log_info(_("Note: %s is not for normal use!\n"), "--no-literal");
 	if (opt.textmode)
 	    log_error(_("%s not allowed with %s!\n"),
 		       "--textmode", "--no-literal" );
 	if (opt.set_filename)
 	    log_error(_("%s makes no sense with %s!\n"),
 			eyes_only?"--for-your-eyes-only":"--set-filename",
 		        "--no-literal" );
     }
 
 
     if (opt.set_filesize)
 	log_info(_("Note: %s is not for normal use!\n"), "--set-filesize");
     if( opt.batch )
 	tty_batchmode( 1 );
 
     if (gnupg_faked_time_p ())
       {
         gnupg_isotime_t tbuf;
 
         log_info (_("WARNING: running with faked system time: "));
         gnupg_get_isotime (tbuf);
         dump_isotime (tbuf);
         log_printf ("\n");
       }
 
     /* Print a warning if an argument looks like an option.  */
     if (!opt.quiet && !(pargs.flags & ARGPARSE_FLAG_STOP_SEEN))
       {
         int i;
 
         for (i=0; i < argc; i++)
           if (argv[i][0] == '-' && argv[i][1] == '-')
             log_info (_("Note: '%s' is not considered an option\n"), argv[i]);
       }
 
 
     gcry_control (GCRYCTL_RESUME_SECMEM_WARN);
 
     if(require_secmem && !got_secmem)
       {
 	log_info(_("will not run with insecure memory due to %s\n"),
 		 "--require-secmem");
         write_status_failure ("option-checking", gpg_error(GPG_ERR_GENERAL));
 	g10_exit(2);
       }
 
     set_debug (debug_level);
     if (opt.verbose) /* Print the compatibility flags.  */
       parse_compatibility_flags (NULL, &opt.compat_flags, compatibility_flags);
     gnupg_set_compliance_extra_info (opt.min_rsa_length);
     if (DBG_CLOCK)
       log_clock ("start");
 
     /* Do these after the switch(), so they can override settings. */
     if (PGP7)
       {
         /* That does not anymore work because we have no more support
            for v3 signatures.  */
 	opt.escape_from=1;
 	opt.ask_sig_expire=0;
       }
     else if(PGP8)
       {
 	opt.escape_from=1;
       }
 
 
     if( def_cipher_string ) {
 	opt.def_cipher_algo = string_to_cipher_algo (def_cipher_string);
 	xfree(def_cipher_string); def_cipher_string = NULL;
 	if ( openpgp_cipher_test_algo (opt.def_cipher_algo) )
 	    log_error(_("selected cipher algorithm is invalid\n"));
     }
     if( def_digest_string ) {
 	opt.def_digest_algo = string_to_digest_algo (def_digest_string);
 	xfree(def_digest_string); def_digest_string = NULL;
 	if ( openpgp_md_test_algo (opt.def_digest_algo) )
 	    log_error(_("selected digest algorithm is invalid\n"));
     }
     if( compress_algo_string ) {
 	opt.compress_algo = string_to_compress_algo(compress_algo_string);
 	xfree(compress_algo_string); compress_algo_string = NULL;
 	if( check_compress_algo(opt.compress_algo) )
           log_error(_("selected compression algorithm is invalid\n"));
     }
     if( cert_digest_string ) {
 	opt.cert_digest_algo = string_to_digest_algo (cert_digest_string);
 	xfree(cert_digest_string); cert_digest_string = NULL;
 	if (openpgp_md_test_algo(opt.cert_digest_algo))
           log_error(_("selected certification digest algorithm is invalid\n"));
     }
     if( s2k_cipher_string ) {
 	opt.s2k_cipher_algo = string_to_cipher_algo (s2k_cipher_string);
 	xfree(s2k_cipher_string); s2k_cipher_string = NULL;
 	if (openpgp_cipher_test_algo (opt.s2k_cipher_algo))
           log_error(_("selected cipher algorithm is invalid\n"));
     }
     if( s2k_digest_string ) {
 	opt.s2k_digest_algo = string_to_digest_algo (s2k_digest_string);
 	xfree(s2k_digest_string); s2k_digest_string = NULL;
 	if (openpgp_md_test_algo(opt.s2k_digest_algo))
           log_error(_("selected digest algorithm is invalid\n"));
     }
     if( opt.completes_needed < 1 )
       log_error(_("completes-needed must be greater than 0\n"));
     if( opt.marginals_needed < 2 )
       log_error(_("marginals-needed must be greater than 1\n"));
     if( opt.max_cert_depth < 1 || opt.max_cert_depth > 255 )
       log_error(_("max-cert-depth must be in the range from 1 to 255\n"));
     if(opt.def_cert_level<0 || opt.def_cert_level>3)
       log_error(_("invalid default-cert-level; must be 0, 1, 2, or 3\n"));
     if( opt.min_cert_level < 1 || opt.min_cert_level > 3 )
       log_error(_("invalid min-cert-level; must be 1, 2, or 3\n"));
     switch( opt.s2k_mode ) {
       case 0:
         if (!opt.quiet)
           log_info(_("Note: simple S2K mode (0) is strongly discouraged\n"));
 	break;
       case 1: case 3: break;
       default:
 	log_error(_("invalid S2K mode; must be 0, 1 or 3\n"));
     }
 
     /* This isn't actually needed, but does serve to error out if the
        string is invalid. */
     if(opt.def_preference_list &&
 	keygen_set_std_prefs(opt.def_preference_list,0))
       log_error(_("invalid default preferences\n"));
 
     if(pers_cipher_list &&
        keygen_set_std_prefs(pers_cipher_list,PREFTYPE_SYM))
       log_error(_("invalid personal cipher preferences\n"));
 
     if(pers_digest_list &&
        keygen_set_std_prefs(pers_digest_list,PREFTYPE_HASH))
       log_error(_("invalid personal digest preferences\n"));
 
     if(pers_compress_list &&
        keygen_set_std_prefs(pers_compress_list,PREFTYPE_ZIP))
       log_error(_("invalid personal compress preferences\n"));
 
     /* Check chunk size.  Please fix also the man page if you change
      * the default.  The limits are given by the specs.  */
     if (!opt.chunk_size)
       opt.chunk_size = 22; /* Default to the suggested max of 4 MiB.  */
     else if (opt.chunk_size < 6)
       {
         opt.chunk_size = 6;
         log_info (_("chunk size invalid - using %d\n"), opt.chunk_size);
       }
     else if (opt.chunk_size > (allow_large_chunks? 62 : 22))
       {
         opt.chunk_size = (allow_large_chunks? 62 : 22);
         log_info (_("chunk size invalid - using %d\n"), opt.chunk_size);
       }
 
     /* We don't support all possible commands with multifile yet */
     if(multifile)
       {
 	char *cmdname;
 
 	switch(cmd)
 	  {
 	  case aSign:
 	    cmdname="--sign";
 	    break;
 	  case aSignEncr:
 	    cmdname="--sign --encrypt";
 	    break;
 	  case aClearsign:
 	    cmdname="--clear-sign";
 	    break;
 	  case aDetachedSign:
 	    cmdname="--detach-sign";
 	    break;
 	  case aSym:
 	    cmdname="--symmetric";
 	    break;
 	  case aEncrSym:
 	    cmdname="--symmetric --encrypt";
 	    break;
 	  case aStore:
 	    cmdname="--store";
 	    break;
 	  default:
 	    cmdname=NULL;
 	    break;
 	  }
 
 	if(cmdname)
 	  log_error(_("%s does not yet work with %s\n"),cmdname,"--multifile");
       }
 
     if( log_get_errorcount(0) )
       {
         write_status_failure ("option-postprocessing",
                               gpg_error(GPG_ERR_GENERAL));
 	g10_exit (2);
       }
 
     if(opt.compress_level==0)
       opt.compress_algo=COMPRESS_ALGO_NONE;
 
     /* Check our chosen algorithms against the list of legal
        algorithms. */
 
     if(!GNUPG)
       {
 	const char *badalg=NULL;
 	preftype_t badtype=PREFTYPE_NONE;
 
 	if(opt.def_cipher_algo
 	   && !algo_available(PREFTYPE_SYM,opt.def_cipher_algo,NULL))
 	  {
 	    badalg = openpgp_cipher_algo_name (opt.def_cipher_algo);
 	    badtype = PREFTYPE_SYM;
 	  }
 	else if(opt.def_digest_algo
 		&& !algo_available(PREFTYPE_HASH,opt.def_digest_algo,NULL))
 	  {
 	    badalg = gcry_md_algo_name (opt.def_digest_algo);
 	    badtype = PREFTYPE_HASH;
 	  }
 	else if(opt.cert_digest_algo
 		&& !algo_available(PREFTYPE_HASH,opt.cert_digest_algo,NULL))
 	  {
 	    badalg = gcry_md_algo_name (opt.cert_digest_algo);
 	    badtype = PREFTYPE_HASH;
 	  }
 	else if(opt.compress_algo!=-1
 		&& !algo_available(PREFTYPE_ZIP,opt.compress_algo,NULL))
 	  {
 	    badalg = compress_algo_to_string(opt.compress_algo);
 	    badtype = PREFTYPE_ZIP;
 	  }
 
 	if(badalg)
 	  {
 	    switch(badtype)
 	      {
 	      case PREFTYPE_SYM:
 		log_info (_("cipher algorithm '%s'"
                             " may not be used in %s mode\n"),
 			 badalg,
                           gnupg_compliance_option_string (opt.compliance));
 		break;
 	      case PREFTYPE_HASH:
 		log_info (_("digest algorithm '%s'"
                             " may not be used in %s mode\n"),
                           badalg,
                           gnupg_compliance_option_string (opt.compliance));
 		break;
 	      case PREFTYPE_ZIP:
 		log_info (_("compression algorithm '%s'"
                             " may not be used in %s mode\n"),
                           badalg,
                           gnupg_compliance_option_string (opt.compliance));
 		break;
 	      default:
 		BUG();
 	      }
 
 	    compliance_failure();
 	  }
       }
 
     /* Check our chosen algorithms against the list of allowed
      * algorithms in the current compliance mode, and fail hard if it
      * is not.  This is us being nice to the user informing her early
      * that the chosen algorithms are not available.  We also check
      * and enforce this right before the actual operation.  */
     if (opt.def_cipher_algo
 	&& ! gnupg_cipher_is_allowed (opt.compliance,
 				      cmd == aEncr
 				      || cmd == aSignEncr
 				      || cmd == aEncrSym
 				      || cmd == aSym
 				      || cmd == aSignSym
 				      || cmd == aSignEncrSym,
 				      opt.def_cipher_algo,
 				      GCRY_CIPHER_MODE_NONE))
       log_error (_("cipher algorithm '%s' may not be used in %s mode\n"),
 		 openpgp_cipher_algo_name (opt.def_cipher_algo),
 		 gnupg_compliance_option_string (opt.compliance));
 
     if (opt.def_digest_algo
 	&& ! gnupg_digest_is_allowed (opt.compliance,
 				      cmd == aSign
 				      || cmd == aSignEncr
 				      || cmd == aSignEncrSym
 				      || cmd == aSignSym
 				      || cmd == aClearsign,
 				      opt.def_digest_algo))
       log_error (_("digest algorithm '%s' may not be used in %s mode\n"),
 		 gcry_md_algo_name (opt.def_digest_algo),
 		 gnupg_compliance_option_string (opt.compliance));
 
     /* Fail hard.  */
     if (log_get_errorcount (0))
       {
         write_status_failure ("option-checking", gpg_error(GPG_ERR_GENERAL));
 	g10_exit (2);
       }
 
     /* Set the random seed file. */
     if (use_random_seed)
       {
         char *p = make_filename (gnupg_homedir (), "random_seed", NULL );
         gcry_control (GCRYCTL_SET_RANDOM_SEED_FILE, p);
         if (!gnupg_access (p, F_OK))
           register_secured_file (p);
 	xfree(p);
       }
 
     /* If there is no command but the --fingerprint is given, default
        to the --list-keys command.  */
     if (!cmd && fpr_maybe_cmd)
       {
 	set_cmd (&cmd, aListKeys);
       }
 
 
     if( opt.verbose > 1 )
 	set_packet_list_mode(1);
 
     /* Add the keyrings, but not for some special commands.  We always
      * need to add the keyrings if we are running under SELinux, this
      * is so that the rings are added to the list of secured files.
      * We do not add any keyring if --no-keyring or --use-keyboxd has
      * been used.  */
     if (!opt.use_keyboxd
         && default_keyring >= 0
         && (ALWAYS_ADD_KEYRINGS
             || (cmd != aDeArmor && cmd != aEnArmor && cmd != aGPGConfTest)))
       {
 	if (!nrings || default_keyring > 0)  /* Add default ring. */
 	    keydb_add_resource ("pubring" EXTSEP_S GPGEXT_GPG,
                                 KEYDB_RESOURCE_FLAG_DEFAULT);
 	for (sl = nrings; sl; sl = sl->next )
           keydb_add_resource (sl->d, sl->flags);
       }
     FREE_STRLIST(nrings);
 
     /* In loopback mode, never ask for the password multiple times.  */
     if (opt.pinentry_mode == PINENTRY_MODE_LOOPBACK)
       {
 	opt.passphrase_repeat = 0;
       }
 
     /* If no pinentry is expected shunt
      * gnupg_allow_set_foregound_window to avoid useless error
      * messages on Windows.  */
     if (opt.pinentry_mode != PINENTRY_MODE_ASK)
       {
         gnupg_inhibit_set_foregound_window (1);
       }
 
 
     if (cmd == aGPGConfTest)
       g10_exit(0);
 
 
     if (pwfd != -1)  /* Read the passphrase now. */
       read_passphrase_from_fd (pwfd);
 
     if (ovrseskeyfd != -1 )  /* Read the sessionkey now. */
       read_sessionkey_from_fd (ovrseskeyfd);
 
     fname = argc? *argv : NULL;
 
     if(fname && utf8_strings)
       opt.flags.utf8_filename=1;
 
     ctrl = xcalloc (1, sizeof *ctrl);
     gpg_init_default_ctrl (ctrl);
 
 #ifndef NO_TRUST_MODELS
     switch (cmd)
       {
       case aPrimegen:
       case aPrintMD:
       case aPrintMDs:
       case aGenRandom:
       case aDeArmor:
       case aEnArmor:
       case aListConfig:
       case aListGcryptConfig:
 	break;
       case aFixTrustDB:
       case aExportOwnerTrust:
         rc = setup_trustdb (0, trustdb_name);
         break;
       case aListTrustDB:
         rc = setup_trustdb (argc? 1:0, trustdb_name);
         break;
       case aKeygen:
       case aFullKeygen:
       case aQuickKeygen:
         rc = setup_trustdb (1, trustdb_name);
         break;
       default:
         /* If we are using TM_ALWAYS, we do not need to create the
            trustdb.  */
         rc = setup_trustdb (opt.trust_model != TM_ALWAYS, trustdb_name);
         break;
       }
     if (rc)
       log_error (_("failed to initialize the TrustDB: %s\n"),
                  gpg_strerror (rc));
 #endif /*!NO_TRUST_MODELS*/
 
     switch (cmd)
       {
       case aStore:
       case aSym:
       case aSign:
       case aSignSym:
       case aClearsign:
         if (!opt.quiet && any_explicit_recipient)
           log_info (_("WARNING: recipients (-r) given "
                       "without using public key encryption\n"));
 	break;
       default:
         break;
       }
 
 
     /* Check for certain command whether we need to migrate a
        secring.gpg to the gpg-agent. */
     switch (cmd)
       {
       case aListSecretKeys:
       case aSign:
       case aSignEncr:
       case aSignEncrSym:
       case aSignSym:
       case aClearsign:
       case aDecrypt:
       case aSignKey:
       case aLSignKey:
       case aEditKey:
       case aPasswd:
       case aDeleteSecretKeys:
       case aDeleteSecretAndPublicKeys:
       case aQuickKeygen:
       case aQuickAddUid:
       case aQuickAddKey:
       case aQuickRevUid:
       case aQuickSetPrimaryUid:
       case aQuickUpdatePref:
       case aFullKeygen:
       case aKeygen:
       case aImport:
       case aExportSecret:
       case aExportSecretSub:
       case aGenRevoke:
       case aDesigRevoke:
       case aCardEdit:
       case aChangePIN:
         migrate_secring (ctrl);
 	break;
       case aListKeys:
         if (opt.with_secret)
           migrate_secring (ctrl);
         break;
       default:
         break;
       }
 
     /* The command dispatcher.  */
     switch( cmd )
       {
       case aServer:
         gpg_server (ctrl);
         break;
 
       case aStore: /* only store the file */
 	if( argc > 1 )
 	    wrong_args("--store [filename]");
 	if( (rc = encrypt_store(fname)) )
           {
             write_status_failure ("store", rc);
 	    log_error ("storing '%s' failed: %s\n",
                        print_fname_stdin(fname),gpg_strerror (rc) );
           }
 	break;
       case aSym: /* encrypt the given file only with the symmetric cipher */
 	if( argc > 1 )
 	    wrong_args("--symmetric [filename]");
 	if( (rc = encrypt_symmetric(fname)) )
           {
             write_status_failure ("symencrypt", rc);
             log_error (_("symmetric encryption of '%s' failed: %s\n"),
                         print_fname_stdin(fname),gpg_strerror (rc) );
           }
 	break;
 
       case aEncr: /* encrypt the given file */
 	if(multifile)
 	  encrypt_crypt_files (ctrl, argc, argv, remusr);
 	else
 	  {
 	    if( argc > 1 )
 	      wrong_args("--encrypt [filename]");
 	    if( (rc = encrypt_crypt (ctrl, -1, fname, remusr, 0, NULL, -1)) )
               {
                 write_status_failure ("encrypt", rc);
                 log_error("%s: encryption failed: %s\n",
                           print_fname_stdin(fname), gpg_strerror (rc) );
               }
 	  }
 	break;
 
       case aEncrSym:
 	/* This works with PGP 8 in the sense that it acts just like a
 	   symmetric message.  It doesn't work at all with 2 or 6.  It
 	   might work with 7, but alas, I don't have a copy to test
 	   with right now. */
 	if( argc > 1 )
 	  wrong_args("--symmetric --encrypt [filename]");
 	else if(opt.s2k_mode==0)
 	  log_error(_("you cannot use --symmetric --encrypt"
 		      " with --s2k-mode 0\n"));
 	else if (PGP7)
 	  log_error(_("you cannot use --symmetric --encrypt"
 		      " in %s mode\n"),
 		    gnupg_compliance_option_string (opt.compliance));
 	else
 	  {
 	    if( (rc = encrypt_crypt (ctrl, -1, fname, remusr, 1, NULL, -1)) )
               {
                 write_status_failure ("encrypt", rc);
                 log_error ("%s: encryption failed: %s\n",
                            print_fname_stdin(fname), gpg_strerror (rc) );
               }
 	  }
 	break;
 
       case aSign: /* sign the given file */
 	sl = NULL;
 	if( detached_sig ) { /* sign all files */
 	    for( ; argc; argc--, argv++ )
 		add_to_strlist( &sl, *argv );
 	}
 	else {
 	    if( argc > 1 )
 		wrong_args("--sign [filename]");
 	    if( argc ) {
 		sl = xmalloc_clear( sizeof *sl + strlen(fname));
 		strcpy(sl->d, fname);
 	    }
 	}
 	if ((rc = sign_file (ctrl, sl, detached_sig, locusr, 0, NULL, NULL)))
           {
             write_status_failure ("sign", rc);
 	    log_error ("signing failed: %s\n", gpg_strerror (rc) );
           }
 	free_strlist(sl);
 	break;
 
       case aSignEncr: /* sign and encrypt the given file */
 	if( argc > 1 )
 	    wrong_args("--sign --encrypt [filename]");
 	if( argc ) {
 	    sl = xmalloc_clear( sizeof *sl + strlen(fname));
 	    strcpy(sl->d, fname);
 	}
 	else
 	    sl = NULL;
 	if ((rc = sign_file (ctrl, sl, detached_sig, locusr, 1, remusr, NULL)))
           {
             write_status_failure ("sign-encrypt", rc);
 	    log_error("%s: sign+encrypt failed: %s\n",
 		      print_fname_stdin(fname), gpg_strerror (rc) );
           }
 	free_strlist(sl);
 	break;
 
       case aSignEncrSym: /* sign and encrypt the given file */
 	if( argc > 1 )
 	    wrong_args("--symmetric --sign --encrypt [filename]");
 	else if(opt.s2k_mode==0)
 	  log_error(_("you cannot use --symmetric --sign --encrypt"
 		      " with --s2k-mode 0\n"));
 	else if (PGP7)
 	  log_error(_("you cannot use --symmetric --sign --encrypt"
 		      " in %s mode\n"),
 		    gnupg_compliance_option_string (opt.compliance));
 	else
 	  {
 	    if( argc )
 	      {
 		sl = xmalloc_clear( sizeof *sl + strlen(fname));
 		strcpy(sl->d, fname);
 	      }
 	    else
 	      sl = NULL;
 	    if ((rc = sign_file (ctrl, sl, detached_sig, locusr,
                                  2, remusr, NULL)))
               {
                 write_status_failure ("sign-encrypt", rc);
                 log_error("%s: symmetric+sign+encrypt failed: %s\n",
                           print_fname_stdin(fname), gpg_strerror (rc) );
               }
 	    free_strlist(sl);
 	  }
 	break;
 
       case aSignSym: /* sign and conventionally encrypt the given file */
 	if (argc > 1)
 	    wrong_args("--sign --symmetric [filename]");
 	rc = sign_symencrypt_file (ctrl, fname, locusr);
         if (rc)
           {
             write_status_failure ("sign-symencrypt", rc);
 	    log_error("%s: sign+symmetric failed: %s\n",
                       print_fname_stdin(fname), gpg_strerror (rc) );
           }
 	break;
 
       case aClearsign: /* make a clearsig */
 	if( argc > 1 )
 	    wrong_args("--clear-sign [filename]");
 	if( (rc = clearsign_file (ctrl, fname, locusr, NULL)) )
           {
             write_status_failure ("sign", rc);
 	    log_error("%s: clear-sign failed: %s\n",
                       print_fname_stdin(fname), gpg_strerror (rc) );
           }
 	break;
 
       case aVerify:
 	if (multifile)
 	  {
 	    if ((rc = verify_files (ctrl, argc, argv)))
 	      log_error("verify files failed: %s\n", gpg_strerror (rc) );
 	  }
 	else
 	  {
 	    if ((rc = verify_signatures (ctrl, argc, argv)))
 	      log_error("verify signatures failed: %s\n", gpg_strerror (rc) );
 	  }
         if (rc)
           write_status_failure ("verify", rc);
 	break;
 
       case aDecrypt:
         if (multifile)
 	  decrypt_messages (ctrl, argc, argv);
 	else
 	  {
 	    if( argc > 1 )
 	      wrong_args("--decrypt [filename]");
 	    if( (rc = decrypt_message (ctrl, fname) ))
               {
                 write_status_failure ("decrypt", rc);
                 log_error("decrypt_message failed: %s\n", gpg_strerror (rc) );
               }
 	  }
 	break;
 
       case aQuickSignKey:
       case aQuickLSignKey:
         {
           const char *fpr;
 
           if (argc < 1)
             wrong_args ("--quick-[l]sign-key fingerprint [userids]");
           fpr = *argv++; argc--;
           sl = NULL;
           for( ; argc; argc--, argv++)
 	    append_to_strlist2 (&sl, *argv, utf8_strings);
           keyedit_quick_sign (ctrl, fpr, sl, locusr, (cmd == aQuickLSignKey));
           free_strlist (sl);
         }
 	break;
 
       case aQuickRevSig:
         {
           const char *userid, *siguserid;
 
           if (argc < 2)
             wrong_args ("--quick-revoke-sig USER-ID SIG-USER-ID [userids]");
           userid = *argv++; argc--;
           siguserid = *argv++; argc--;
           sl = NULL;
           for( ; argc; argc--, argv++)
 	    append_to_strlist2 (&sl, *argv, utf8_strings);
           keyedit_quick_revsig (ctrl, userid, siguserid, sl);
           free_strlist (sl);
         }
 	break;
 
       case aSignKey:
 	if( argc != 1 )
 	  wrong_args("--sign-key user-id");
 	/* fall through */
       case aLSignKey:
 	if( argc != 1 )
 	  wrong_args("--lsign-key user-id");
 	/* fall through */
 
 	sl=NULL;
 
 	if(cmd==aSignKey)
 	  append_to_strlist(&sl,"sign");
 	else if(cmd==aLSignKey)
 	  append_to_strlist(&sl,"lsign");
 	else
 	  BUG();
 
 	append_to_strlist( &sl, "save" );
 	username = make_username( fname );
 	keyedit_menu (ctrl, username, locusr, sl, 0, 0 );
 	xfree(username);
 	free_strlist(sl);
 	break;
 
       case aEditKey: /* Edit a key signature */
 	if( !argc )
 	    wrong_args("--edit-key user-id [commands]");
 	username = make_username( fname );
 	if( argc > 1 ) {
 	    sl = NULL;
 	    for( argc--, argv++ ; argc; argc--, argv++ )
 		append_to_strlist( &sl, *argv );
 	    keyedit_menu (ctrl, username, locusr, sl, 0, 1 );
 	    free_strlist(sl);
 	}
 	else
             keyedit_menu (ctrl, username, locusr, NULL, 0, 1 );
 	xfree(username);
 	break;
 
       case aPasswd:
         if (argc != 1)
           wrong_args("--change-passphrase <user-id>");
         else
           {
             username = make_username (fname);
             keyedit_passwd (ctrl, username);
             xfree (username);
           }
         break;
 
       case aDeleteKeys:
       case aDeleteSecretKeys:
       case aDeleteSecretAndPublicKeys:
 	sl = NULL;
         /* Print a note if the user did not specify any key.  */
         if (!argc && !opt.quiet)
           log_info (_("Note: %s\n"), gpg_strerror (GPG_ERR_NO_KEY));
         /* I'm adding these in reverse order as add_to_strlist2
            reverses them again, and it's easier to understand in the
            proper order :) */
 	for( ; argc; argc-- )
 	  add_to_strlist2( &sl, argv[argc-1], utf8_strings );
 	delete_keys (ctrl, sl,
                      cmd==aDeleteSecretKeys, cmd==aDeleteSecretAndPublicKeys);
 	free_strlist(sl);
 	break;
 
       case aCheckKeys:
 	opt.check_sigs = 1; /* fall through */
       case aListSigs:
 	opt.list_sigs = 1; /* fall through */
       case aListKeys:
 	sl = NULL;
 	for( ; argc; argc--, argv++ )
 	    add_to_strlist2( &sl, *argv, utf8_strings );
 	public_key_list (ctrl, sl, 0, 0);
 	free_strlist(sl);
 	break;
       case aListSecretKeys:
 	sl = NULL;
 	for( ; argc; argc--, argv++ )
 	    add_to_strlist2( &sl, *argv, utf8_strings );
 	secret_key_list (ctrl, sl);
 	free_strlist(sl);
 	break;
       case aLocateKeys:
       case aLocateExtKeys:
 	sl = NULL;
 	for (; argc; argc--, argv++)
           add_to_strlist2( &sl, *argv, utf8_strings );
         if (cmd == aLocateExtKeys && akl_empty_or_only_local ())
           {
             /* This is a kludge to let --locate-external-keys even
              * work if the config file has --no-auto-key-locate.  This
              * better matches the expectations of the user.  */
             release_akl ();
             parse_auto_key_locate (DEFAULT_AKL_LIST);
           }
 	public_key_list (ctrl, sl, 1, cmd == aLocateExtKeys);
 
 
 	free_strlist (sl);
 	break;
 
       case aQuickKeygen:
         {
           const char *x_algo, *x_usage, *x_expire;
 
           if (argc < 1 || argc > 4)
             wrong_args("--quick-generate-key USER-ID [ALGO [USAGE [EXPIRE]]]");
           username = make_username (fname);
           argv++, argc--;
           x_algo = "";
           x_usage = "";
           x_expire = "";
           if (argc)
             {
               x_algo = *argv++; argc--;
               if (argc)
                 {
                   x_usage = *argv++; argc--;
                   if (argc)
                     {
                       x_expire = *argv++; argc--;
                     }
                 }
             }
           if (mopt.forbid_gen_key)
             gen_key_forbidden ();
           else
             quick_generate_keypair (ctrl, username, x_algo, x_usage, x_expire);
           xfree (username);
         }
         break;
 
       case aKeygen: /* generate a key */
         if (mopt.forbid_gen_key)
           gen_key_forbidden ();
 	else if( opt.batch )
           {
 	    if( argc > 1 )
 		wrong_args("--generate-key [parameterfile]");
 	    generate_keypair (ctrl, 0, argc? *argv : NULL, NULL, 0);
           }
 	else
           {
             if (opt.command_fd != -1 && argc)
               {
                 if( argc > 1 )
                   wrong_args("--generate-key [parameterfile]");
 
                 opt.batch = 1;
                 generate_keypair (ctrl, 0, argc? *argv : NULL, NULL, 0);
               }
             else if (argc)
               wrong_args ("--generate-key");
             else
               generate_keypair (ctrl, 0, NULL, NULL, 0);
           }
 	break;
 
       case aFullKeygen: /* Generate a key with all options. */
         if (mopt.forbid_gen_key)
           gen_key_forbidden ();
 	else if (opt.batch)
           {
 	    if (argc > 1)
               wrong_args ("--full-generate-key [parameterfile]");
 	    generate_keypair (ctrl, 1, argc? *argv : NULL, NULL, 0);
           }
 	else
           {
 	    if (argc)
               wrong_args("--full-generate-key");
 	    generate_keypair (ctrl, 1, NULL, NULL, 0);
 	}
 	break;
 
       case aQuickAddUid:
         {
           const char *uid, *newuid;
 
           if (argc != 2)
             wrong_args ("--quick-add-uid USER-ID NEW-USER-ID");
           uid = *argv++; argc--;
           newuid = *argv++; argc--;
           keyedit_quick_adduid (ctrl, uid, newuid);
         }
 	break;
 
       case aQuickAddKey:
         {
           const char *x_fpr, *x_algo, *x_usage, *x_expire;
 
           if (argc < 1 || argc > 4)
             wrong_args ("--quick-add-key FINGERPRINT [ALGO [USAGE [EXPIRE]]]");
           x_fpr = *argv++; argc--;
           x_algo = "";
           x_usage = "";
           x_expire = "";
           if (argc)
             {
               x_algo = *argv++; argc--;
               if (argc)
                 {
                   x_usage = *argv++; argc--;
                   if (argc)
                    {
                      x_expire = *argv++; argc--;
                    }
                 }
             }
           if (mopt.forbid_gen_key)
             gen_key_forbidden ();
           else
             keyedit_quick_addkey (ctrl, x_fpr, x_algo, x_usage, x_expire);
         }
 	break;
 
       case aQuickRevUid:
         {
           const char *uid, *uidtorev;
 
           if (argc != 2)
             wrong_args ("--quick-revoke-uid USER-ID USER-ID-TO-REVOKE");
           uid = *argv++; argc--;
           uidtorev = *argv++; argc--;
           keyedit_quick_revuid (ctrl, uid, uidtorev);
         }
 	break;
 
       case aQuickSetExpire:
         {
           const char *x_fpr, *x_expire;
 
           if (argc < 2)
             wrong_args ("--quick-set-exipre FINGERPRINT EXPIRE [SUBKEY-FPRS]");
           x_fpr = *argv++; argc--;
           x_expire = *argv++; argc--;
           keyedit_quick_set_expire (ctrl, x_fpr, x_expire, argv);
         }
 	break;
 
       case aQuickSetPrimaryUid:
         {
           const char *uid, *primaryuid;
 
           if (argc != 2)
             wrong_args ("--quick-set-primary-uid USER-ID PRIMARY-USER-ID");
           uid = *argv++; argc--;
           primaryuid = *argv++; argc--;
           keyedit_quick_set_primary (ctrl, uid, primaryuid);
         }
 	break;
 
       case aQuickUpdatePref:
         {
           if (argc != 1)
             wrong_args ("--quick-update-pref USER-ID");
           keyedit_quick_update_pref (ctrl, *argv);
         }
 	break;
 
       case aFastImport:
         opt.import_options |= IMPORT_FAST; /* fall through */
       case aImport:
       case aShowKeys:
 	import_keys (ctrl, argc? argv:NULL, argc, NULL,
                      opt.import_options, opt.key_origin, opt.key_origin_url);
 	break;
 
 	/* TODO: There are a number of command that use this same
 	   "make strlist, call function, report error, free strlist"
 	   pattern.  Join them together here and avoid all that
 	   duplicated code. */
 
       case aExport:
       case aSendKeys:
       case aRecvKeys:
 	sl = NULL;
 	for( ; argc; argc--, argv++ )
 	    append_to_strlist2( &sl, *argv, utf8_strings );
 	if( cmd == aSendKeys )
             rc = keyserver_export (ctrl, sl );
 	else if( cmd == aRecvKeys )
             rc = keyserver_import (ctrl, sl );
 	else
           {
             export_stats_t stats = export_new_stats ();
             rc = export_pubkeys (ctrl, sl, opt.export_options, stats);
             export_print_stats (stats);
             export_release_stats (stats);
           }
 	if(rc)
 	  {
 	    if(cmd==aSendKeys)
               {
                 write_status_failure ("send-keys", rc);
                 log_error(_("keyserver send failed: %s\n"),gpg_strerror (rc));
               }
 	    else if(cmd==aRecvKeys)
               {
                 write_status_failure ("recv-keys", rc);
                 log_error (_("keyserver receive failed: %s\n"),
                            gpg_strerror (rc));
               }
 	    else
               {
                 write_status_failure ("export", rc);
                 log_error (_("key export failed: %s\n"), gpg_strerror (rc));
               }
 	  }
 	free_strlist(sl);
 	break;
 
       case aExportSshKey:
         if (argc != 1)
           wrong_args ("--export-ssh-key <user-id>");
         rc = export_ssh_key (ctrl, argv[0]);
         if (rc)
           {
             write_status_failure ("export-ssh-key", rc);
             log_error (_("export as ssh key failed: %s\n"), gpg_strerror (rc));
           }
 	break;
 
       case aExportSecretSshKey:
         if (argc != 1)
           wrong_args ("--export-secret-ssh-key <user-id>");
         rc = export_secret_ssh_key (ctrl, argv[0]);
         if (rc)
           {
             write_status_failure ("export-ssh-key", rc);
             log_error (_("export as ssh key failed: %s\n"), gpg_strerror (rc));
           }
 	break;
 
      case aSearchKeys:
 	sl = NULL;
 	for (; argc; argc--, argv++)
 	  append_to_strlist2 (&sl, *argv, utf8_strings);
 	rc = keyserver_search (ctrl, sl);
 	if (rc)
           {
             write_status_failure ("search-keys", rc);
             log_error (_("keyserver search failed: %s\n"), gpg_strerror (rc));
           }
 	free_strlist (sl);
 	break;
 
       case aRefreshKeys:
 	sl = NULL;
 	for( ; argc; argc--, argv++ )
 	    append_to_strlist2( &sl, *argv, utf8_strings );
 	rc = keyserver_refresh (ctrl, sl);
 	if(rc)
           {
             write_status_failure ("refresh-keys", rc);
             log_error (_("keyserver refresh failed: %s\n"),gpg_strerror (rc));
           }
 	free_strlist(sl);
 	break;
 
       case aFetchKeys:
 	sl = NULL;
 	for( ; argc; argc--, argv++ )
 	    append_to_strlist2( &sl, *argv, utf8_strings );
 	rc = keyserver_fetch (ctrl, sl, opt.key_origin);
 	free_strlist (sl);
 	if(rc)
           {
             write_status_failure ("fetch-keys", rc);
             log_error ("key fetch failed: %s\n",gpg_strerror (rc));
             if (gpg_err_code (rc) == GPG_ERR_NO_DATA)
               g10_exit (1); /* In this case return 1 and not 2.  */
           }
 	break;
 
       case aExportSecret:
 	sl = NULL;
 	for( ; argc; argc--, argv++ )
 	    add_to_strlist2( &sl, *argv, utf8_strings );
         {
           export_stats_t stats = export_new_stats ();
           export_seckeys (ctrl, sl, opt.export_options, stats);
           export_print_stats (stats);
           export_release_stats (stats);
         }
 	free_strlist(sl);
 	break;
 
       case aExportSecretSub:
 	sl = NULL;
 	for( ; argc; argc--, argv++ )
 	    add_to_strlist2( &sl, *argv, utf8_strings );
         {
           export_stats_t stats = export_new_stats ();
           export_secsubkeys (ctrl, sl, opt.export_options, stats);
           export_print_stats (stats);
           export_release_stats (stats);
         }
 	free_strlist(sl);
 	break;
 
       case aGenRevoke:
 	if( argc != 1 )
 	    wrong_args("--generate-revocation user-id");
 	username =  make_username(*argv);
 	gen_revoke (ctrl, username );
 	xfree( username );
 	break;
 
       case aDesigRevoke:
 	if (argc != 1)
 	    wrong_args ("--generate-designated-revocation user-id");
 	username = make_username (*argv);
 	gen_desig_revoke (ctrl, username, locusr);
 	xfree (username);
 	break;
 
       case aDeArmor:
 	if( argc > 1 )
 	    wrong_args("--dearmor [file]");
 	rc = dearmor_file( argc? *argv: NULL );
 	if( rc )
           {
             write_status_failure ("dearmor", rc);
             log_error (_("dearmoring failed: %s\n"), gpg_strerror (rc));
           }
 	break;
 
       case aEnArmor:
 	if( argc > 1 )
 	    wrong_args("--enarmor [file]");
 	rc = enarmor_file( argc? *argv: NULL );
 	if( rc )
           {
             write_status_failure ("enarmor", rc);
 	    log_error (_("enarmoring failed: %s\n"), gpg_strerror (rc));
           }
 	break;
 
 
       case aPrimegen:
 #if 0 /*FIXME*/
 	{   int mode = argc < 2 ? 0 : atoi(*argv);
 
 	    if( mode == 1 && argc == 2 ) {
 		mpi_print (es_stdout,
                            generate_public_prime( atoi(argv[1]) ), 1);
 	    }
 	    else if( mode == 2 && argc == 3 ) {
 		mpi_print (es_stdout, generate_elg_prime(
 					     0, atoi(argv[1]),
 					     atoi(argv[2]), NULL,NULL ), 1);
 	    }
 	    else if( mode == 3 && argc == 3 ) {
 		MPI *factors;
 		mpi_print (es_stdout, generate_elg_prime(
 					     1, atoi(argv[1]),
 					     atoi(argv[2]), NULL,&factors ), 1);
 		es_putc ('\n', es_stdout);
 		mpi_print (es_stdout, factors[0], 1 ); /* print q */
 	    }
 	    else if( mode == 4 && argc == 3 ) {
 		MPI g = mpi_alloc(1);
 		mpi_print (es_stdout, generate_elg_prime(
 						 0, atoi(argv[1]),
 						 atoi(argv[2]), g, NULL ), 1);
 		es_putc ('\n', es_stdout);
 		mpi_print (es_stdout, g, 1 );
 		mpi_free (g);
 	    }
 	    else
 		wrong_args("--gen-prime mode bits [qbits] ");
 	    es_putc ('\n', es_stdout);
 	}
 #endif
         wrong_args("--gen-prime not yet supported ");
 	break;
 
       case aGenRandom:
 	{
           int level = argc ? atoi(*argv):0;
           int count = argc > 1 ? atoi(argv[1]): 0;
           int endless = !count;
           int hexhack = (level == 16);
 
           if (hexhack)
             level = 1;
 
           /* Level 30 uses the same algorithm as our magic wand in
            * pinentry/gpg-agent.  */
           if (level == 30)
             {
               unsigned int nbits = 150;
               size_t nbytes = (nbits + 7) / 8;
               void *rand;
               char *generated;
 
               rand = gcry_random_bytes_secure (nbytes, GCRY_STRONG_RANDOM);
               if (!rand)
                 log_fatal ("failed to generate random password\n");
 
               generated = zb32_encode (rand, nbits);
               gcry_free (rand);
               es_fputs (generated, es_stdout);
               es_putc ('\n', es_stdout);
               xfree (generated);
               break;
             }
 
           if (argc < 1 || argc > 2 || level < 0 || level > 2 || count < 0)
             wrong_args ("--gen-random 0|1|2|16|30 [count]");
 
           while (endless || count)
             {
               byte *p;
               /* We need a multiple of 3, so that in case of armored
                * output we get a correct string.  No linefolding is
                * done, as it is best to leave this to other tools */
               size_t n = !endless && count < 99? count : 99;
               size_t nn;
 
               p = gcry_random_bytes (n, level);
 #ifdef HAVE_DOSISH_SYSTEM
               setmode ( fileno(stdout), O_BINARY );
 #endif
               if (hexhack)
                 {
                   for (nn = 0; nn < n; nn++)
                     es_fprintf (es_stdout, "%02x", p[nn]);
                 }
               else if (opt.armor)
                 {
                   char *tmp = make_radix64_string (p, n);
                   es_fputs (tmp, es_stdout);
                   xfree (tmp);
                   if (n%3 == 1)
                     es_putc ('=', es_stdout);
                   if (n%3)
                     es_putc ('=', es_stdout);
                 }
               else
                 {
                   es_fwrite( p, n, 1, es_stdout );
                 }
               xfree(p);
               if (!endless)
                 count -= n;
 	    }
           if (opt.armor || hexhack)
             es_putc ('\n', es_stdout);
 	}
 	break;
 
       case aPrintMD:
 	if( argc < 1)
 	    wrong_args("--print-md algo [files]");
 	{
 	    int all_algos = (**argv=='*' && !(*argv)[1]);
 	    int algo = all_algos? 0 : gcry_md_map_name (*argv);
 
 	    if( !algo && !all_algos )
 		log_error(_("invalid hash algorithm '%s'\n"), *argv );
 	    else {
 		argc--; argv++;
 		if( !argc )
 		    print_mds(NULL, algo);
 		else {
 		    for(; argc; argc--, argv++ )
 			print_mds(*argv, algo);
 		}
 	    }
 	}
 	break;
 
       case aPrintMDs: /* old option */
 	if( !argc )
 	    print_mds(NULL,0);
 	else {
 	    for(; argc; argc--, argv++ )
 		print_mds(*argv,0);
 	}
 	break;
 
 #ifndef NO_TRUST_MODELS
       case aListTrustDB:
 	if( !argc )
           list_trustdb (ctrl, es_stdout, NULL);
 	else {
 	    for( ; argc; argc--, argv++ )
               list_trustdb (ctrl, es_stdout, *argv );
 	}
 	break;
 
       case aUpdateTrustDB:
 	if( argc )
 	    wrong_args("--update-trustdb");
 	update_trustdb (ctrl);
 	break;
 
       case aCheckTrustDB:
         /* Old versions allowed for arguments - ignore them */
         check_trustdb (ctrl);
 	break;
 
       case aFixTrustDB:
         how_to_fix_the_trustdb ();
 	break;
 
       case aListTrustPath:
 	if( !argc )
 	    wrong_args("--list-trust-path <user-ids>");
 	for( ; argc; argc--, argv++ ) {
 	    username = make_username( *argv );
 	    list_trust_path( username );
 	    xfree(username);
 	}
 	break;
 
       case aExportOwnerTrust:
 	if( argc )
 	    wrong_args("--export-ownertrust");
 	export_ownertrust (ctrl);
 	break;
 
       case aImportOwnerTrust:
 	if( argc > 1 )
 	    wrong_args("--import-ownertrust [file]");
 	import_ownertrust (ctrl, argc? *argv:NULL );
 	break;
 #endif /*!NO_TRUST_MODELS*/
 
       case aRebuildKeydbCaches:
         if (argc)
             wrong_args ("--rebuild-keydb-caches");
         keydb_rebuild_caches (ctrl, 1);
         break;
 
 #ifdef ENABLE_CARD_SUPPORT
       case aCardStatus:
         if (argc == 0)
             card_status (ctrl, es_stdout, NULL);
         else if (argc == 1)
             card_status (ctrl, es_stdout, *argv);
         else
             wrong_args ("--card-status [serialno]");
         break;
 
       case aCardEdit:
         if (argc) {
             sl = NULL;
             for (argc--, argv++ ; argc; argc--, argv++)
                 append_to_strlist (&sl, *argv);
             card_edit (ctrl, sl);
             free_strlist (sl);
 	}
         else
           card_edit (ctrl, NULL);
         break;
 
       case aChangePIN:
         if (!argc)
             change_pin (0,1);
         else if (argc == 1)
             change_pin (atoi (*argv),1);
         else
             wrong_args ("--change-pin [no]");
         break;
 #endif /* ENABLE_CARD_SUPPORT*/
 
       case aListConfig:
 	{
 	  char *str=collapse_args(argc,argv);
 	  list_config(str);
 	  xfree(str);
 	}
 	break;
 
       case aListGcryptConfig:
         /* Fixme: It would be nice to integrate that with
            --list-config but unfortunately there is no way yet to have
            libgcrypt print it to an estream for further parsing.  */
         gcry_control (GCRYCTL_PRINT_CONFIG, stdout);
         break;
 
       case aTOFUPolicy:
 #ifdef USE_TOFU
 	{
 	  int policy;
 	  int i;
 	  KEYDB_HANDLE hd;
 
 	  if (argc < 2)
 	    wrong_args ("--tofu-policy POLICY KEYID [KEYID...]");
 
 	  policy = parse_tofu_policy (argv[0]);
 
 	  hd = keydb_new (ctrl);
 	  if (! hd)
             {
               write_status_failure ("tofu-driver", gpg_error(GPG_ERR_GENERAL));
               g10_exit (1);
             }
 
           tofu_begin_batch_update (ctrl);
 
 	  for (i = 1; i < argc; i ++)
 	    {
 	      KEYDB_SEARCH_DESC desc;
 	      kbnode_t kb;
 
 	      rc = classify_user_id (argv[i], &desc, 0);
 	      if (rc)
 		{
 		  log_error (_("error parsing key specification '%s': %s\n"),
                              argv[i], gpg_strerror (rc));
                   write_status_failure ("tofu-driver", rc);
 		  g10_exit (1);
 		}
 
 	      if (! (desc.mode == KEYDB_SEARCH_MODE_SHORT_KID
 		     || desc.mode == KEYDB_SEARCH_MODE_LONG_KID
 		     || desc.mode == KEYDB_SEARCH_MODE_FPR
 		     || desc.mode == KEYDB_SEARCH_MODE_KEYGRIP))
 		{
 		  log_error (_("'%s' does not appear to be a valid"
 			       " key ID, fingerprint or keygrip\n"),
 			     argv[i]);
                   write_status_failure ("tofu-driver",
                                         gpg_error(GPG_ERR_GENERAL));
 		  g10_exit (1);
 		}
 
 	      rc = keydb_search_reset (hd);
 	      if (rc)
 		{
                   /* This should not happen, thus no need to tranalate
                      the string.  */
                   log_error ("keydb_search_reset failed: %s\n",
                              gpg_strerror (rc));
                   write_status_failure ("tofu-driver", rc);
 		  g10_exit (1);
 		}
 
 	      rc = keydb_search (hd, &desc, 1, NULL);
 	      if (rc)
 		{
 		  log_error (_("key \"%s\" not found: %s\n"), argv[i],
                              gpg_strerror (rc));
                   write_status_failure ("tofu-driver", rc);
 		  g10_exit (1);
 		}
 
 	      rc = keydb_get_keyblock (hd, &kb);
 	      if (rc)
 		{
 		  log_error (_("error reading keyblock: %s\n"),
                              gpg_strerror (rc));
                   write_status_failure ("tofu-driver", rc);
 		  g10_exit (1);
 		}
 
 	      merge_keys_and_selfsig (ctrl, kb);
 	      if (tofu_set_policy (ctrl, kb, policy))
                 {
                   write_status_failure ("tofu-driver", rc);
                   g10_exit (1);
                 }
 
               release_kbnode (kb);
 	    }
 
           tofu_end_batch_update (ctrl);
 
 	  keydb_release (hd);
 	}
 #endif /*USE_TOFU*/
 	break;
 
       default:
         if (!opt.quiet)
           log_info (_("WARNING: no command supplied."
                       "  Trying to guess what you mean ...\n"));
         /*FALLTHRU*/
       case aListPackets:
 	if( argc > 1 )
 	    wrong_args("[filename]");
 	/* Issue some output for the unix newbie */
 	if (!fname && !opt.outfile
             && gnupg_isatty (fileno (stdin))
             && gnupg_isatty (fileno (stdout))
             && gnupg_isatty (fileno (stderr)))
 	    log_info(_("Go ahead and type your message ...\n"));
 
 	a = iobuf_open(fname);
         if (a && is_secured_file (iobuf_get_fd (a)))
           {
             iobuf_close (a);
             a = NULL;
             gpg_err_set_errno (EPERM);
           }
 	if( !a )
 	    log_error(_("can't open '%s'\n"), print_fname_stdin(fname));
 	else {
 
 	    if( !opt.no_armor ) {
 		if( use_armor_filter( a ) ) {
 		    afx = new_armor_context ();
 		    push_armor_filter (afx, a);
 		}
 	    }
 	    if( cmd == aListPackets ) {
 		opt.list_packets=1;
 		set_packet_list_mode(1);
 	    }
 	    rc = proc_packets (ctrl, NULL, a );
 	    if( rc )
               {
                 write_status_failure ("-", rc);
                 log_error ("processing message failed: %s\n",
                            gpg_strerror (rc));
               }
 	    iobuf_close(a);
 	}
 	break;
       }
 
     /* cleanup */
     gpg_deinit_default_ctrl (ctrl);
     xfree (ctrl);
     release_armor_context (afx);
     FREE_STRLIST(remusr);
     FREE_STRLIST(locusr);
     g10_exit(0);
     return 8; /*NEVER REACHED*/
 }
 
 
 /* Note: This function is used by signal handlers!. */
 static void
 emergency_cleanup (void)
 {
   gcry_control (GCRYCTL_TERM_SECMEM );
 }
 
 
 void
 g10_exit( int rc )
 {
   /* If we had an error but not printed an error message, do it now.
    * Note that write_status_failure will never print a second failure
    * status line. */
   if (rc)
     write_status_failure ("gpg-exit", gpg_error (GPG_ERR_GENERAL));
 
   gcry_control (GCRYCTL_UPDATE_RANDOM_SEED_FILE);
   if (DBG_CLOCK)
     log_clock ("stop");
 
   if ( (opt.debug & DBG_MEMSTAT_VALUE) )
     {
       keydb_dump_stats ();
       sig_check_dump_stats ();
       objcache_dump_stats ();
       gcry_control (GCRYCTL_DUMP_MEMORY_STATS);
       gcry_control (GCRYCTL_DUMP_RANDOM_STATS);
     }
   if (opt.debug)
     gcry_control (GCRYCTL_DUMP_SECMEM_STATS );
 
   gnupg_block_all_signals ();
   emergency_cleanup ();
 
   rc = rc? rc : log_get_errorcount(0)? 2 : g10_errors_seen? 1 : 0;
   exit (rc);
 }
 
 
 /* Pretty-print hex hashes.  This assumes at least an 80-character
    display, but there are a few other similar assumptions in the
    display code. */
 static void
 print_hex (gcry_md_hd_t md, int algo, const char *fname)
 {
   int i,n,count,indent=0;
   const byte *p;
 
   if (fname)
     indent = es_printf("%s: ",fname);
 
   if (indent>40)
     {
       es_printf ("\n");
       indent=0;
     }
 
   if (algo==DIGEST_ALGO_RMD160)
     indent += es_printf("RMD160 = ");
   else if (algo>0)
     indent += es_printf("%6s = ", gcry_md_algo_name (algo));
   else
     algo = abs(algo);
 
   count = indent;
 
   p = gcry_md_read (md, algo);
   n = gcry_md_get_algo_dlen (algo);
 
   count += es_printf ("%02X",*p++);
 
   for(i=1;i<n;i++,p++)
     {
       if(n==16)
 	{
 	  if(count+2>79)
 	    {
 	      es_printf ("\n%*s",indent,indent?" ":"");
 	      count = indent;
 	    }
 	  else
 	    count += es_printf(" ");
 
 	  if (!(i%8))
 	    count += es_printf(" ");
 	}
       else if (n==20)
 	{
 	  if(!(i%2))
 	    {
 	      if(count+4>79)
 		{
 		  es_printf ("\n%*s",indent,indent?" ":"");
 		  count=indent;
 		}
 	      else
 		count += es_printf(" ");
 	    }
 
 	  if (!(i%10))
 	    count += es_printf(" ");
 	}
       else
 	{
 	  if(!(i%4))
 	    {
 	      if (count+8>=79)
 		{
 		  es_printf ("\n%*s",indent, indent?" ":"");
 		  count=indent;
 		}
 	      else
 		count += es_printf(" ");
 	    }
 	}
 
       count += es_printf("%02X",*p);
     }
 
   es_printf ("\n");
 }
 
 static void
 print_hashline( gcry_md_hd_t md, int algo, const char *fname )
 {
   int i, n;
   const byte *p;
 
   if ( fname )
     {
       for (p = fname; *p; p++ )
         {
           if ( *p <= 32 || *p > 127 || *p == ':' || *p == '%' )
             es_printf ("%%%02X", *p );
           else
             es_putc (*p, es_stdout);
         }
     }
   es_putc (':', es_stdout);
   es_printf ("%d:", algo);
   p = gcry_md_read (md, algo);
   n = gcry_md_get_algo_dlen (algo);
   for(i=0; i < n ; i++, p++ )
     es_printf ("%02X", *p);
   es_fputs (":\n", es_stdout);
 }
 
 
 static void
 print_mds( const char *fname, int algo )
 {
   estream_t fp;
   char buf[1024];
   size_t n;
   gcry_md_hd_t md;
 
   if (!fname)
     {
       fp = es_stdin;
       es_set_binary (fp);
     }
   else
     {
       fp = es_fopen (fname, "rb" );
       if (fp && is_secured_file (es_fileno (fp)))
         {
           es_fclose (fp);
           fp = NULL;
           gpg_err_set_errno (EPERM);
         }
     }
   if (!fp)
     {
       log_error("%s: %s\n", fname?fname:"[stdin]", strerror(errno) );
       return;
     }
 
   gcry_md_open (&md, 0, 0);
   if (algo)
     gcry_md_enable (md, algo);
   else
     {
       if (!gcry_md_test_algo (GCRY_MD_MD5))
         gcry_md_enable (md, GCRY_MD_MD5);
       gcry_md_enable (md, GCRY_MD_SHA1);
       if (!gcry_md_test_algo (GCRY_MD_RMD160))
         gcry_md_enable (md, GCRY_MD_RMD160);
       if (!gcry_md_test_algo (GCRY_MD_SHA224))
         gcry_md_enable (md, GCRY_MD_SHA224);
       if (!gcry_md_test_algo (GCRY_MD_SHA256))
         gcry_md_enable (md, GCRY_MD_SHA256);
       if (!gcry_md_test_algo (GCRY_MD_SHA384))
         gcry_md_enable (md, GCRY_MD_SHA384);
       if (!gcry_md_test_algo (GCRY_MD_SHA512))
         gcry_md_enable (md, GCRY_MD_SHA512);
     }
 
   while ((n=es_fread (buf, 1, DIM(buf), fp)))
     gcry_md_write (md, buf, n);
 
   if (es_ferror(fp))
     log_error ("%s: %s\n", fname?fname:"[stdin]", strerror(errno));
   else
     {
       gcry_md_final (md);
       if (opt.with_colons)
         {
           if ( algo )
             print_hashline (md, algo, fname);
           else
             {
               if (!gcry_md_test_algo (GCRY_MD_MD5))
                 print_hashline( md, GCRY_MD_MD5, fname );
               print_hashline( md, GCRY_MD_SHA1, fname );
               if (!gcry_md_test_algo (GCRY_MD_RMD160))
                 print_hashline( md, GCRY_MD_RMD160, fname );
               if (!gcry_md_test_algo (GCRY_MD_SHA224))
                 print_hashline (md, GCRY_MD_SHA224, fname);
               if (!gcry_md_test_algo (GCRY_MD_SHA256))
                 print_hashline( md, GCRY_MD_SHA256, fname );
               if (!gcry_md_test_algo (GCRY_MD_SHA384))
                 print_hashline ( md, GCRY_MD_SHA384, fname );
               if (!gcry_md_test_algo (GCRY_MD_SHA512))
                 print_hashline ( md, GCRY_MD_SHA512, fname );
             }
         }
       else
         {
           if (algo)
             print_hex (md, -algo, fname);
           else
             {
               if (!gcry_md_test_algo (GCRY_MD_MD5))
                 print_hex (md, GCRY_MD_MD5, fname);
               print_hex (md, GCRY_MD_SHA1, fname );
               if (!gcry_md_test_algo (GCRY_MD_RMD160))
                 print_hex (md, GCRY_MD_RMD160, fname );
               if (!gcry_md_test_algo (GCRY_MD_SHA224))
                 print_hex (md, GCRY_MD_SHA224, fname);
               if (!gcry_md_test_algo (GCRY_MD_SHA256))
                 print_hex (md, GCRY_MD_SHA256, fname );
               if (!gcry_md_test_algo (GCRY_MD_SHA384))
                 print_hex (md, GCRY_MD_SHA384, fname );
               if (!gcry_md_test_algo (GCRY_MD_SHA512))
                 print_hex (md, GCRY_MD_SHA512, fname );
             }
         }
     }
   gcry_md_close (md);
 
   if (fp != es_stdin)
     es_fclose (fp);
 }
 
 
 /****************
  * Check the supplied name,value string and add it to the notation
  * data to be used for signatures.  which==0 for sig notations, and 1
  * for cert notations.
 */
 static void
 add_notation_data( const char *string, int which )
 {
   struct notation *notation;
 
   notation=string_to_notation(string,utf8_strings);
   if(notation)
     {
       if(which)
 	{
 	  notation->next=opt.cert_notations;
 	  opt.cert_notations=notation;
 	}
       else
 	{
 	  notation->next=opt.sig_notations;
 	  opt.sig_notations=notation;
 	}
     }
 }
 
 static void
 add_policy_url( const char *string, int which )
 {
   unsigned int i,critical=0;
   strlist_t sl;
 
   if(*string=='!')
     {
       string++;
       critical=1;
     }
 
   for(i=0;i<strlen(string);i++)
     if( !isascii (string[i]) || iscntrl(string[i]))
       break;
 
   if(i==0 || i<strlen(string))
     {
       if(which)
 	log_error(_("the given certification policy URL is invalid\n"));
       else
 	log_error(_("the given signature policy URL is invalid\n"));
     }
 
   if(which)
     sl=add_to_strlist( &opt.cert_policy_url, string );
   else
     sl=add_to_strlist( &opt.sig_policy_url, string );
 
   if(critical)
     sl->flags |= 1;
 }
 
 static void
 add_keyserver_url( const char *string, int which )
 {
   unsigned int i,critical=0;
   strlist_t sl;
 
   if(*string=='!')
     {
       string++;
       critical=1;
     }
 
   for(i=0;i<strlen(string);i++)
     if( !isascii (string[i]) || iscntrl(string[i]))
       break;
 
   if(i==0 || i<strlen(string))
     {
       if(which)
 	BUG();
       else
 	log_error(_("the given preferred keyserver URL is invalid\n"));
     }
 
   if(which)
     BUG();
   else
     sl=add_to_strlist( &opt.sig_keyserver_url, string );
 
   if(critical)
     sl->flags |= 1;
 }
 
 
 static void
 read_sessionkey_from_fd (int fd)
 {
   int i, len;
   char *line;
 
   if (! gnupg_fd_valid (fd))
     log_fatal ("override-session-key-fd is invalid: %s\n", strerror (errno));
 
   for (line = NULL, i = len = 100; ; i++ )
     {
       if (i >= len-1 )
         {
           char *tmp = line;
           len += 100;
           line = xmalloc_secure (len);
           if (tmp)
             {
               memcpy (line, tmp, i);
               xfree (tmp);
             }
           else
             i=0;
 	}
       if (read (fd, line + i, 1) != 1 || line[i] == '\n')
         break;
     }
   line[i] = 0;
   log_debug ("seskey: %s\n", line);
   gpgrt_annotate_leaked_object (line);
   opt.override_session_key = line;
 }