aboutsummaryrefslogtreecommitdiffstats
path: root/common (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-12-21common: Remove superfluous debug output from dotlock.c.Werner Koch1-2/+0
* common/dotlock.c (dotlock_create_unix): Remove debug output. -- This was left over from developement about 10 years ago. Exhibits itself when using sshfs. GnuPG-bug-id: 5193
2020-12-21common: Fix the "ignore" meta command in argparse.cWerner Koch3-36/+122
* src/argparse.c (gnupg_argparse): Factor some code out to ... (prepare_arg_return): new. (gnupg_argparse): No missing arg error in ignore sections. * common/sysutils.c: Include pwd.h. (gnupg_getusername): New. -- Options in an [ignore] section do not anymore lead to an error if an argument is missing. However, if the option is also in a force section the error is thrown. This is a port of the fix from libgpg-error. Also fixes the username fixme.
2020-12-04Backport of the new option parser from 2.3Werner Koch3-693/+1841
* configure.ac (GPGRT_ENABLE_ARGPARSE_MACROS): Define. * common/argparse.c, common/argparse.h: Rewrite. * tests/gpgscm/main.c: Switch to the new option parser. * g10/gpg.c: Switch to the new option parser and enable a global conf file. * g10/gpgv.c: Ditto. * agent/gpg-agent.c: Ditto. * agent/preset-passphrase.c: Ditto. * agent/protect-tool.c: Ditto. * scd/scdaemon.c: Ditto. * dirmngr/dirmngr.c: Ditto. * dirmngr/dirmngr_ldap.c: Ditto * dirmngr/dirmngr-client.c: Ditto. * kbx/kbxutil.c: Ditto. * tools/gpg-card.c: Ditto. * tools/gpg-check-pattern.c: Ditto. * tools/gpg-connect-agent.c: Ditto. * tools/gpg-pair-tool.c: Ditto. * tools/gpg-wks-client.c: Ditto. * tools/gpg-wks-server.c: Ditto. * tools/gpgconf.c: Ditto. * tools/gpgsplit.c: Ditto. * tools/gpgtar.c: Ditto. * g13/g13.c: Ditto. * g13/g13-syshelp.c: Ditto. Do not force verbose mode. * sm/gpgsm.c: Ditto. Add option --no-options. -- This is backport from master commit cdbe10b762f38449b86da69076209324b0c99982 commit ba463128ce65a0f347643f7246a8e097c5be19f1 commit 3bc004decd289810bc1b6ad6fb8f47e45c770ce6 commit 2c823bd878fcdbcc4f6c34993e1d0539d9a6b237 commit 0e8f6e2aa98c212442001036fb5178cd6cd8af59 but without changing all functions names to gpgrt. Instead we use wrapper functions which, when building against old Libgpg-error versions, are implemented in argparse.c using code from the current libgpg-error. This allows to keep the dependency requirement at libgpg-error 1.27 to support older distributions. Tested builds against 1.27 and 1.40-beta. Note that g13-syshelp does not anymore default to --verbose because that can now be enabled in /etc/gnupg/g13-syshelp.conf. GnuPG-bug-id: 4788 Signed-off-by: Werner Koch <[email protected]>
2020-11-27common: Fix fallback handling to utf-8.NIIBE Yutaka1-1/+1
* common/utf8conv.c (handle_iconv_error): Set NO_TRANSLATION. -- GnuPG-bug-id: 5038 Fixes-commit: 99c9bf7defd6c1ac9cc49c84e6c78eeb886a6952 Signed-off-by: NIIBE Yutaka <[email protected]> (cherry picked from commit 393dcdd61c3b2da00a97176c647d9bd1c908ceba)
2020-11-10w32: Support Unicode also for config files etc.Werner Koch2-1/+52
* common/sysutils.c (gnupg_fopen) [W32]: Use _wfopen if needed. Use new function in most places where fopen is used. -- The config files in 2.2 are still read using fopen - we need to change this to allow Unicode directory names. There is also one case where files are written using the old fopen. The new option parser in 2.3 does not have this problem but at some places fopen is also still used. GnuPG-bug-id: 5098 Signed-off-by: Werner Koch <[email protected]>
2020-11-10w32: Support utf8 for getcwd even if build with gpgrt < 1.40.Werner Koch1-8/+28
* common/sysutils.c (gnupg_getcwd) [W32]: Use Unicode version. -- gpgrt 1.40 has not yet been released, so to make getcwd work properly on Windows we need to have the code here as well. GnuPG-bug-id: 5098 Signed-off-by: Werner Koch <[email protected]>
2020-11-09Require Libgpg-error 1.27Werner Koch1-20/+0
* configure.ac (NEED_GPG_ERROR_VERSION): Require 1.27 * common/util.h: Remove compatibility macros. -- This is just a minor change to align with the need for Libgcrypt 1.8. The latter was first released in summer 2017 while Libgpg-error 1.27 was released earlier in spring that year. Signed-off-by: Werner Koch <[email protected]>
2020-11-09Require Libgcrypt 1.8Werner Koch1-4/+0
* configure.ac (NEED_LIBGCRYPT_VERSION): Require 1.8. * tools/gpgconf.c (show_version_libgcrypt): Remove conditional case for Libgcrypt < 1.8. * common/compliance.c (gnupg_rng_is_compliant): Ditto. * agent/pksign.c: Ditto. * agent/gpg-agent.c (thread_init_once): Ditto. (agent_libgcrypt_progress_cb): Ditto. * agent/command.c (cmd_getinfo): Ditto. -- Libgcrypt 1.7 reached end-of-life more than a year ago. Thus there is no reason to keep backward support for it. Signed-off-by: Werner Koch <[email protected]>
2020-11-09gpg: Add canceled status message.Ben Kibbey1-0/+1
* common/status.h (STATUS_CANCELED_BY_USER): New. * g10/passphrase.c (passphrase_to_dek): Send STATUS_CANCELED_BY_USER instead of STATUS_MISSING_PASSPHRASE when canceled is set. -- This is to prevent further pinentry tries when the pinentry is canceled by the user during symmetric decryption. Signed-off-by: Ben Kibbey <[email protected]> (cherry picked from commit 31e47dfad0f40e31e8b3113b933696e8e4105136)
2020-11-04common: Fix duplicate implementation of try_make_homedir.Werner Koch2-0/+34
* g10/openfile.c (try_make_homedir): Move core of the code to ... * common/homedir.c (gnupg_maybe_make_homedir): new. * sm/keydb.c (try_make_homedir): Implement using new function. * common/homedir.c: Include i18n.h. * po/POTFILES.in: Add common/homedir.c. Signed-off-by: Werner Koch <[email protected]>
2020-11-04w32: Add another pinentry search pathAndre Heinecke1-0/+2
* common/homedir.c (get_default_pinentry_name): Try ../bin/pinentry.exe -- In an installation layout where GnuPG is installed as a component of another software it might be useful to have pinentry placed in a different bin directory without the forced folder name of Gpg4win.
2020-11-03w32: Fix strftime problem on Windows.Werner Koch1-2/+31
* common/gettime.c: Include locale.h. (asctimestamp): Increase buffer. On Windows use setlocale. -- GnuPG-bug-id: 5073 Signed-off-by: Werner Koch <[email protected]>
2020-10-26common: Fix gnupg_access for older libgpg-error.Werner Koch1-1/+3
-- Fixes-commit: dd5fd4a760b8cf6ae05ff878bcf36cf2465e744c
2020-10-23common: New functions gnupg_opendir et al.Werner Koch2-0/+178
* common/sysutils.h (struct gnupg_dirent_s): New. * common/sysutils.c: Include dirent.h. (struct gnupg_dir_s): New. (gnupg_opendir, gnupg_readdir, gnupg_closedir): New. Change all callers of opendir, readdir, and closedir to use these functions. -- GnuPG-bug-id: 5098 Backported-from-master: 7e22e08e2ab09cd3c2317f5e80e8ee47d46eff4b
2020-10-23w32: Make gnupg_remove and gnupg_rename_file Unicode awareWerner Koch1-3/+33
* common/sysutils.c (w32_rename): New. (gnupg_rename_file) [W32]: Support Unicode. (gnupg_remove) [W32]: Support Unicode. Drop Windows-CE support. -- GnuPG-bug-id: 5098 (cherry picked from commit 9a0197b6fe412cfc66b0cece521267180e454416)
2020-10-23Replace all calls to stat by gnupg_stat.Werner Koch3-1/+50
* common/sysutils.c (gnupg_stat): New. * common/sysutils.h: Include sys/stat.h. -- Yet another wrapper for Unicode support on Windows. GnuPG-bug-id: 5098 Signed-off-by: Werner Koch <[email protected]> Backported-from-master: 18e5dd7b03ced51611c9ba1345cf498a0aaf14a6)
2020-10-23Replace most calls to open by a new wrapper.Werner Koch3-15/+67
* common/sysutils.c (any8bitchar) [W32]: New. (gnupg_open): New. Replace most calls to open by this. * common/iobuf.c (any8bitchar) [W32]: New. (direct_open) [W32]: Use CreateFileW if needed. -- This is yet another step for full Unicode support on Windows. GnuPG-bug-id: 5098 (cherry picked from commit 4dcef0e17836e8725c31a3b76f2bf7144345c808)
2020-10-21w32: Allow Unicode filenames for dotlockWerner Koch2-27/+192
* common/dotlock.c (any8bitchar) [W32]: New. (dotlock_create_w32): Use strconcat and CreateFileW. * common/t-dotlock.c: Source include dotlock.c and modify to allow manual testing on Windows. -- GnuPG-bug-id: 5098 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit b47c355b18d9537ccc3dd3e80cc1825b018ecff7)
2020-10-21Replace most of the remaining stdio calls by estream calls.Werner Koch1-6/+6
-- We need to use es_fopen on Windows to cope with non-ascii file names. This is quite a large but fortunately straightforward change. At a very few places we keep using stdio (for example due to the use of popen). GnuPG-bug-id: 5098 Signed-off-by: Werner Koch <[email protected]> Backported-from-master: 390497ea115e1aca93feec297a5bd6ae7b1ba6dd
2020-10-21Replace all calls to access by gnupg_accessWerner Koch6-50/+81
* common/sysutils.c (gnupg_access): New. Replace all calls to access by this wrapper. * common/homedir.c (w32_shgetfolderpath): Change to return UTF-8 directory name. (standard_homedir): Adjust for change. (w32_commondir, gnupg_cachedir): Ditto. -- Also use SHGetFolderPathW instead of SHGetFolderPathA on Windows. This is required to correctly handle non-ascii filenames on Windows. GnuPG-bug-id: 5098 (cherry picked from commit c94ee1386e0d5cdac51086c4d5b92de59c09c9b5)
2020-10-02common,w32: Change copyright holder notice.Werner Koch1-0/+14
--
2020-10-02gpgconf,w32: Add manifest so we get the correct windows version.Werner Koch1-2/+2
* common/w32info-rc.h.in: Update copyright info. * tools/gpg-connect-agent-w32info.rc: Tweak file info. * tools/gpgconf-w32info.rc: New. * tools/gpgconf.w32-manifest.in: New. * configure.ac: Add new .in file. * tools/Makefile.am (EXTRA_DIST): Add them. (gpg_connect_agent_robjs, gpgconf_robjs): New. (gpgconf_LDADD): Add resource file. (gpg_connect_agent_LDADD): Change name of resource macro. Signed-off-by: Werner Koch <[email protected]>
2020-09-10agent: Keep some permissions of private-keys-v1.d.Werner Koch1-24/+42
* common/sysutils.c (modestr_to_mode): Re-implement. (gnupg_chmod): Support keeping of permissions. -- GnuPG-bug-id: 2312 Signed-off-by: Werner Koch <[email protected]>
2020-08-22common: Use gpgrt functions for mkdir and chdir if availableWerner Koch1-3/+15
* common/sysutils.c (gnupg_mkdir): Divert to gpgrt_mkdir. (gnupg_chdir): Divert to gpgrt_chdir -- To avoid bumping up the build dependency on libgpg-error 1.28 we use the gpgrt version only if at least this libgpg-error version was used at build time. This won't fix any bugs though and it is in general advisable to use the latest libgpg-error. There are actually a couple of very useful bug fixes for Windows in the upcoming libgpg-error 1.39 but on Unix you can live without them. Signed-off-by: Werner Koch <[email protected]>
2020-08-22common,w32: Do not assume the ANSI codepage during string conversion.Werner Koch1-2/+21
* common/utf8conv.c (get_w32_codepage): New. (wchar_to_native): Use instead oc CP_ACP. (native_to_wchar): Ditto. -- This should fix quite some issue; we fixed it when using the iconv based machinery about 14 years ago. At some point we introduced the new conversion functions because Windows started to support UTF-8 natively. The fix comes late but well, it is done. Signed-off-by: Werner Koch <[email protected]>
2020-08-22common: Strip trailing CR,LF from w32_strerror.Werner Koch2-1/+7
* common/stringhelp.c (w32_strerror): Strip trailing CR,LF. * common/iobuf.c (iobuf_get_filelength): Use -1 and not 0 for the arg to w32_strerror. -- This is in particular annoying since we started to use a string argument sanitizer in the logging code. Before that we just add an extra blank line. The second patch corrects a never yet seen error message. Signed-off-by: Werner Koch <[email protected]>
2020-08-20gpgtar: Make --files-from and --null work as described.Werner Koch3-1/+32
* tools/gpgtar-create.c (gpgtar_create): Add args files_from and null_names. Improve reading from a file. * tools/gpgtar.c: Make global vars static. (main): Remove tests for --files-from and --null option combinations. Pass option variables to gpgtar_create. -- GnuPG-bug-id: 5027 Signed-off-by: Werner Koch <[email protected]>
2020-08-20build: New configure option --disable-testsWerner Koch1-0/+4
* configure.ac: Add option --disable-tests. Print warnings in the summary. (DISABLE_TESTS): New am_conditional. -- GnuPG-bug-id: 4960
2020-08-12common: Pass the WAYLAND_DISPLAY envvar alongWerner Koch1-0/+1
* common/session-env.c (stdenvnames): Add WAYLAND_DISPLAY. -- GnuPG-bug-id: 5016 Signed-off-by: Werner Koch <[email protected]>
2020-07-30w32: More adding NETLIBS.NIIBE Yutaka1-1/+1
* common/Makefile.am (t_common_ldadd): Add $(NETLIBS). -- Cherry-picked master commit of: 5fa4427419c875e46d051ae6ed376d5ad6037401 GnuPG-bug-id: 4994 Signed-off-by: NIIBE Yutaka <[email protected]>
2020-07-14gpgsm: Make rsaPSS a compliant scheme in de-vs mode.Werner Koch1-8/+4
-- GnuPG-bug-id: 4538 Signed-off-by: Werner Koch <[email protected]> Backported-from-master: 5fe3cdfc7646c2c88beb168ba34fc64f9dd2c156
2020-07-03sm: Exclude rsaPSS from de-vs compliance mode.Werner Koch4-2/+36
* common/compliance.h (PK_ALGO_FLAG_RSAPSS): New. * common/compliance.c (gnupg_pk_is_compliant): Add arg alog_flags and test rsaPSS. Adjust all callers. * common/util.c (pubkey_algo_to_string): New. (gnupg_pk_is_allowed): Ditto. * sm/misc.c (gpgsm_ksba_cms_get_sig_val): New wrapper function. (gpgsm_get_hash_algo_from_sigval): New. * sm/certcheck.c (gpgsm_check_cms_signature): Change type of sigval arg. Add arg pkalgoflags. Use the PK_ALGO_FLAG_RSAPSS. * sm/verify.c (gpgsm_verify): Use the new wrapper and new fucntion to also get the algo flags. Pass algo flags along. Change some of the info output to be more like current master. -- Signed-off-by: Werner Koch <[email protected]> This backport from master commit 969abcf40cdfc65f3ee859c5e62889e1a8ccde91 also includes some changes taken from commit a759fa963a42e0652134130029217270b6d5d00b (sm: Improve readability of the data verification output.) Signed-off-by: Werner Koch <[email protected]>
2020-06-03common: Add missing error code GPG_ERR_WRONG_NAME.Werner Koch1-1/+10
* configure.ac: Require libgpg-error 1.25. * common/util.h: Define some extra error codes. -- This actually defines a few more error ocdes in case they are used by backported code. The requirement chnaged to 1.25 because erro codes from there are also required. GnuPG-bug-id: 4965 Signed-off-by: Werner Koch <[email protected]>
2020-05-12common: Change argument order of log_printhex.Werner Koch2-9/+17
* common/logging.c (log_printhex): Chnage order of args. Make it printf alike. Change all callers. * configure.ac: Add -Wno-format-zero-length -- This makes it consistent with modern libgpgrt logging and thus eases back porting from newer GnuPG versions which use libgpgrt logging. Signed-off-by: Werner Koch <[email protected]>
2020-04-16gpg: Support decryption of the new AEAD packetWerner Koch1-0/+11
* common/openpgpdefs.h (aead_algo_t): New. (pkttype_t): Add PKT_ENCRYPTED_AEAD. * g10/decrypt-data.c (struct decode_filter_context_s): Add fields for AEAD. (aead_set_nonce_and_ad): New. (aead_checktag): New. (decrypt_data): Support AEAD. (aead_underflow): New. (aead_decode_filter): New. * g10/dek.h (DEK): Add field use_aead. Turn use_mdc, algo_info_printed, and symmetric into bit flags. * g10/mainproc.c (struct mainproc_context): Add field seen_pkt_encrypted_aead. (release_list): Clear it. (have_seen_pkt_encrypted_aead): New. (symkey_decrypt_seskey): Support AEAD. (proc_symkey_enc): Ditto. (proc_encrypted): Ditto. (proc_plaintext): Ditto. * g10/misc.c (MY_GCRY_CIPHER_MODE_EAX): New. (openpgp_aead_test_algo): New. (openpgp_aead_algo_name): New. (openpgp_aead_algo_info): New. * g10/packet.h (PKT_symkey_enc): Add field use_aead. (PKT_user_id): Add field flags.aead (PKT_public_key): Ditto. (PKT_encrypted): Add fields for AEAD. * g10/parse-packet.c (parse): Handle PKT_ENCRYPTED_AEAD. (parse_symkeyenc): Support AEAD. (parse_encrypted): Ditto. (dump_sig_subpkt): Dump AEAD preference packet. (parse_encrypted_aead): New. -- This patch allows to decrypt data encrypted using the new AEAD mechanism as specified in rfc4880bis. Although preferences are used to enable this new mode, it is useful to have at least a decryption option in case a user switches between GnuPG 2.2 and newer versions. The new AEAD mechanism is much faster than the current CFB+MDC and thus 2.2 will allow faster decryption of symmetric only decryption. This patch is based on the current master (2.3) code base and includes a few other patches. In particular commit 44be675b759d27bac310c2de8bae1b7882a26b65 (gpg: More check for symmetric key encryption.) is included. Signed-off-by: Werner Koch <[email protected]>
2020-04-15common: New function to map hash algo names.Werner Koch2-0/+42
* common/sexputil.c (hash_algo_to_string): New. -- Libgcrypt expects lowercase names and it is cumbersome to downcase those retrieved via gcry_md_algo_name. It is easier and also faster to use a dedicated map function.
2020-04-15scd:p15: Fix decrypt followed by sign problem for D-Trust cards.Werner Koch2-0/+85
* scd/iso7816.c (iso7816_select_mf): New. * scd/app-p15.c (card_product_t): New. (struct app_local_s): Add field 'card_product'. (read_ef_tokeninfo): Detect D-Trust card. (prepare_verify_pin): Switch to D-Trust AID. (do_decipher): Restore a SE for D-TRust cards. Change the padding indicator to 0x81. * common/percent.c (percent_data_escape): new. Taken from master. -- Using what I learned from a USB trace running the Governikus Signer Software on Windows this fixes the left over problem with the new D-Trust card support. Signed-off-by: Werner Koch <[email protected]> Backported from master. This required to add the percent_data_escape function we introduced in master on 2018-07-02: commit 58baf40af641f8cbf597e508a292e85ae94688f1 common: New function percent_data_escape. Signed-off-by: Werner Koch <[email protected]>
2020-04-01scd:p15: Support signing with CardOS 5 cards.Werner Koch1-0/+5
* scd/app-help.c (app_help_get_keygrip_string_pk): Add optional arg r_pkey and change all callers. (app_help_get_keygrip_string): Ditto. * scd/app-p15.c (struct cdf_object_s): Use bit flags (struct aodf_object_s): Ditto. Add field 'fid'. (struct prkdf_object_s): Ditto. Add fields keygrip, keyalgo, and keynbits. (parse_certid): Allow a keygrip instead of a certid aka keyref. (read_ef_aodf): Store the FID. (keygripstr_from_prkdf): Rename to ... (keygrip_from_prkdf): this. Remove arg r_gripstr and implement cache. Change callers to directly use the values from the object. Also store the algo and length of the key ion the object. (keyref_from_keyinfo): New. Factored out code. (do_sign): Support SHA-256 and >2048 bit RSA keys. common/scd:p15: Support signing with CardOS 5 cards. * common/util.h (KEYGRIP_LEN): New. -- This has been tested with a D-Trust card featuring 3072 bit keys. Note that non-repudiation key for a qualified signature does not yet work because we do not yet support rsaPSS padding. Thus a gpgsm --learn shows a couple of Bad Signature errors for this key. Signed-off-by: Werner Koch <[email protected]> Back ported from master: - Removed do_with_keygrip - Added KEYGRIP_LEN - app_help_get_keygrip_string_pk actually added. - Move keygrip_from_prkdf in do_sign before the verification. It used to work in master only because there it is implictly called prior to signing by do_with_keygrip Signed-off-by: Werner Koch <[email protected]>
2020-03-27sm: Consider certificates w/o CRL DP as valid.Werner Koch1-0/+1
* sm/certchain.c (is_cert_still_valid): Shortcut if tehre is no DP. * common/audit.c (proc_type_verify): Print "n/a" if a cert has no distribution point. * sm/gpgsm.h (opt): Add field enable_issuer_based_crl_check. * sm/gpgsm.c (oEnableIssuerBasedCRLCheck): New. (opts): Add option --enable-issuer-based-crl-check. (main): Set option. -- If the issuer does not provide a DP and the user wants such an issuer, we expect that a certificate does not need revocation checks. The new option --enable-issuer-based-crl-check can be used to revert to the old behaviour which requires that a suitable LDAP server has been configured to lookup a CRL by issuer. Signed-off-by: Werner Koch <[email protected]> (cherry picked from master)
2020-03-19Copyright notice updates et al.Werner Koch1-1/+1
--
2020-03-14gpg: New option --include-key-block.Werner Koch1-1/+4
* common/openpgpdefs.h (SIGSUBPKT_KEY_BLOCK): New. * g10/gpg.c (oIncludeKeyBlock): New. (opts): New option --include-key-block. (main): Implement. * g10/options.h (opt): New flag include_key_block. * g10/parse-packet.c (dump_sig_subpkt): Support SIGSUBPKT_KEY_BLOCK. (parse_one_sig_subpkt): Ditto. (can_handle_critical): Ditto. * g10/sign.c (mk_sig_subpkt_key_block): New. (write_signature_packets): Call it for data signatures. -- This patch adds support for a to be proposed OpenPGP ferature: Introduce the Key Block subpacket to align OpenPGP with CMS. This new subpacket may be used similar to the CertificateSet of CMS (RFC-5652) and thus allows to start encrypted communication after having received a signed message. In practice a stripped down version of the key should be including having only the key material and the self-signatures which are really useful and shall be used by the recipient to reply encrypted. #### Key Block (1 octet with value 0, N octets of key data) This subpacket MAY be used to convey key data along with a signature of class 0x00, 0x01, or 0x02. It MUST contain the key used to create the signature; either as the primary key or as a subkey. The key SHOULD contain a primary or subkey capable of encryption and the entire key must be a valid OpenPGP key including at least one User ID packet and the corresponding self-signatures. Implementations MUST ignore this subpacket if the first octet does not have a value of zero or if the key data does not represent a valid transferable public key. GnuPG-bug-id: 4856 Signed-off-by: Werner Koch <[email protected]> Backported from master. Signed-off-by: Werner Koch <[email protected]>
2020-02-17sm: Remove left over debug output.Werner Koch1-1/+0
--
2020-02-15gpgsm: Fix import of some CR,LF ternminated certificatesWerner Koch1-8/+18
* common/ksba-io-support.c (base64_reader_cb): Detect the END tag and don't just rely on the padding chars. This could happen only with CR+LF termnmated PEM files. Also move the detection into the invalid character detection branch for a minor parser speedup. -- GnuPG-bug-id: 4847 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 6248739799fd4a877529089375e2a4103d33e6f4)
2020-02-10build: Always use EXTERN_UNLESS_MAIN_MODULE pattern.Werner Koch3-8/+9
* common/util.h (EXTERN_UNLESS_MAIN_MODULE): Add the definion only here but now without the Norcroft-C. Change all other places where it gets defined. * common/iobuf.h (iobuf_debug_mode): Declare unconditionally as extern. * common/iobuf.c (iobuf_debug_mode): Define it here. * agent/gpg-agent.c (INCLUDED_BY_MAIN_MODULE): Define here and also in all main modules of all other programs. * g10/main.h: Put util.h before the local header files. -- This change is required for use with gcc/ld's LTO feature which does not allow common blocks. Further gcc 10 will make -fno-common the default and thus this chnage is always needed. What a pitty. Co-authored-by: Tomáš Mráz GnuPG-bug-id: 4831 Signed-off-by: Werner Koch <[email protected]>
2020-02-10common: Also protect log_inc_errorcount against counter overflow.Werner Koch1-4/+4
* common/logging.c (log_inc_errorcount): Also protect against overflow. (log_error): Call log_inc_errorcount instead of directly bumping the counter. -- We already had an overflow checking for log_error but not for the silent increment function. This is basically the same fix we have in libgpg-error (libgpg-error commit d72c1ddfde09ffa69745ec2439c5a16d15e2202f) Signed-off-by: Werner Koch <[email protected]>
2020-01-17gpgconf,w32: Print a warning for a suspicious homedir.Werner Koch1-0/+3
* tools/gpgconf.c (list_dirs): Check whether the homedir has been taken from the registry. -- Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 7f12fb55f9757cd68147eca8f162c85378538405)
2019-08-21common: Extend function pubkey_algo_string.Werner Koch2-3/+8
* common/sexputil.c (pubkey_algo_string): Add arg R_ALGOID. * sm/certreqgen-ui.c (gpgsm_gencertreq_tty): Adjust. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit f952226043824cbbeb8517126b5266926121c4e8) Removed the changes in gpg-card which is not part of 2.2 Signed-off-by: Werner Koch <[email protected]>
2019-08-12common: Fix line break handling, finding a space.NIIBE Yutaka1-3/+3
* common/name-value.c (assert_raw_value): Correctly find a space. -- Cherry-pick master commit of: f588dd8d1766de48c90a5501cf2d537f256d003e Signed-off-by: NIIBE Yutaka <[email protected]>
2019-05-27gpg: Allow deletion of subkeys with --delete-[secret-]key.Werner Koch1-3/+4
* common/userids.c (classify_user_id): Do not set the EXACT flag in the default case. * g10/export.c (exact_subkey_match_p): Make static, * g10/delkey.c (do_delete_key): Implement subkey only deleting. -- GnuPG-bug-id: 4457
2019-04-16common: Fix AWK portability.NIIBE Yutaka2-7/+7
* common/Makefile.am: Use pkg_namespace. * common/mkstrtable.awk: Use pkg_namespace. Regexp fix. -- Cherry-picked from master commit: b6f0b0efa19e0434024bc16e246032b613fd448a GnuPG-bug-Bug: 4459 Signed-off-by: NIIBE Yutaka <[email protected]>