aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2021-03-04common: Rename w32-misc.c to w32-cmdline.cHEADmasterWerner Koch3-4/+4
* common/w32-misc.c: Rename to .... * common/w32-cmdline.c: this. * common/Makefile.am: Adjust. --
2021-03-04common,w32: Implement globing of command line args.Werner Koch4-18/+325
* common/w32-misc.c [W32]: Include windows.h (struct add_arg_s): New. (add_arg): New. (glob_arg): New. (parse_cmdstring): Add arg argvflags and set it. (w32_parse_commandline): Add arg r_itemsalloced. Add globing. * common/init.c (prepare_w32_commandline): Mark glob created items as leaked. * common/t-w32-cmdline.c : Include windows.h (test_all): Add simple glob test for Unix. (main): Add manual test mode for Windows. -- GnuPG-bug-id: 4398
2021-03-04common,w32: Refine the command line parsing for \ in quotes.Werner Koch2-6/+33
* common/t-w32-cmdline.c (test_all): Add new test cases. * common/w32-misc.c (strip_one_arg): Add arg endquote. (parse_cmdstring): Take care of backslashes in quotes. -- I found some new test vectors from Microsoft.
2021-03-04gpg: Prepare for globing with UTF-8.Werner Koch1-4/+4
* g10/gpg.c (_dowildcard): Remove. (my_strusage): Enable wildcards using our new system. -- This patch actually removes the current globing using a mingw feature. We are not able to use this because it does not handle Unicode filenames. The plan is to implement this in init.c. This patch merely configures gpg to request globing. GnuPG-bug-id: 4398
2021-03-04common: First take on handling Unicode command line args.Werner Koch5-6/+459
* common/w32-misc.c: New. * common/t-w32-cmdline.c: New. * common/init.c: Include w32help.h. (prepare_w32_commandline): New. (_init_common_subsystems) [W32]: Call prepare_w32_commandline. * common/Makefile.am (common_sources) [W32]: Add w32-misc.c (module_tests): Add t-w32-cmdline (t_w32_cmdline_LDADD): New. -- The rules for the command line parser are not cleary specified - if at all. See the comment in t-w32-cmdline.c. We can't use the mingw version because that would require to change all argv handling to be wchar_t and that only for Windows. That would be too ugly. Parsing the command line into argv by us is much easier and we can do that only if needed - i.e. if globing is required (we are prepared for this) or a non-ASCII character has been encountered. This way we keep things stable and only fix the currently not working Unicode problem. GnuPG-bug-id: 4398
2021-03-01gpg: Keep temp files when opening images via xdg-openNicolas Fella via Gnupg-devel1-1/+5
* g10/photoid.c (get_default_photo_command): Change parameter for xdg-open. -- xdg-open spawns the user's preferred image viewer and then exits. Therefore we must not remove the temp file when it exits, otherwise by the time the actual image viewer is started the file doesn't exist any more. Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2021-02-26po: Make agent/commands.c translatable and update German translation.Werner Koch2-8/+30
-- GnuPG-bug-id: 4777 This also fixes a bad fuzzy translation which accidently had been commited without realizing that there was indeed a change (from "... GnuPG" to "... %s").
2021-02-26po: Update Simplified Chinese Translation.bobwxc1-273/+161
-- Signed-off-by: bobwxc <bobwxc@yeah.net>
2021-02-25doc: Typo fixes for dirmngr.texiWerner Koch1-3/+3
--
2021-02-25kbx: Log debug fixesWerner Koch2-3/+5
--
2021-02-25scd:p15: Read out the access flags.Werner Koch1-68/+141
* scd/app-p15.c (struct keyaccess_flags_s): New. (struct prkdf_object_s): Add field accessflags. (dump_keyusage_flags): New. (dump_keyaccess_flags): New. (parse_keyaccess_flags): New. (parse_common_key_attr): Return access flags. (read_ef_prkdf): Parse the access flags. Allow for ECkeys. (read_ef_pukdf): Ditto. Use new functions for printing. (read_p15_info): Use new fucntion for printing.
2021-02-25build: Require sqlite 3.27Werner Koch1-1/+1
-- Requiring 3.28 had the problem that for example Debin distributes a 3.27 with backported fixes. There is no 3.28. So we relax this again. Fixes-commit: d763548f2e00726a40ec886c8179c07bf4e6e664
2021-02-25sm: Do not print certain issuer not found diags in quiet mode.Werner Koch2-21/+28
* sm/certchain.c (find_up_dirmngr): Print one diagnostic only in verbose mode. Do not print issuer not found diags in quiet mode. * sm/minip12.c (parse_bag_data): Add missing verbose condition. -- GnuPG-bug-id: 4757
2021-02-25sm: Fix issuer certificate look error due to legacy error code.Werner Koch1-65/+69
* sm/certchain.c (find_up): Get rid of the legacy return code -1 and chnage var name rc to err. (gpgsm_walk_cert_chain): Change var name rc to err. (do_validate_chain): Get rid of the legacy return code -1. -- This was detected while fixing GnuPG-bug-id: 4757
2021-02-24build: Require a fixed SQlite version.Werner Koch1-1/+1
-- We are actually not vulnerable but it seems to be a good idea to force installation of a good copy of SQlite GnuPG-bug-id: 4510
2021-02-24scd:p15: Get the label value of all objects for better diagnostics.Werner Koch1-78/+180
* scd/app-p15.c (struct cdf_object_s): Add fields authid, authidlen, and label. (struct prkdf_object_s): Add field label. (struct aodf_object_s): Ditto. (release_cdflist): Free new fields. (release_prkdflist): Free new field. (release_aodf_object): Ditto. (parse_common_obj_attr): Return the label. (read_ef_prkdf): Store the label. (read_ef_pukdf): Ditto. (read_ef_cdf): Use parse_common_obj_attr and store authid and label. Print them im verbose mode. (read_ef_aodf): Store the label and print it.
2021-02-24doc: Explain how Tor is detected.Werner Koch1-1/+4
--
2021-02-24sm: Silence some output on --quietWerner Koch5-7/+29
* sm/encrypt.c (gpgsm_encrypt): Take care of --quiet. * sm/gpgsm.c: Include minip12.h. (set_debug): Call p12_set_verbosity. * sm/import.c (parse_p12): Dump keygrip only in debug mode. * sm/minip12.c (opt_verbose, p12_set_verbosity): New. (parse_bag_encrypted_data): Print info messages only in verbose mode. -- GnuPG-bug-id: 4757
2021-02-23scd:p15: Make it code work again for D-Trust cards.Werner Koch4-29/+67
* scd/app-p15.c (select_and_read_binary): Allow to skip the select. (select_and_read_record): Return the statusword. Silence error message for SW_FILE_STRUCT. (select_ef_by_path): Fix selection with a home_DF. (read_first_record): Fallback to read_binary for CardOS and return info about this. (read_ef_prkdf): Use info from read_first_record to decide whether to use record or binary mode. (read_ef_pukdf): Ditto. (read_ef_aodf): Ditto. (read_ef_cdf): Ditto. New arg cdftype for diagnostics. (read_p15_info): Pass cdftype. * scd/apdu.h (SW_FILE_STRUCT): New. * scd/apdu.c (apdu_strerror): Map that one to a string. * scd/iso7816.c (map_sw): and to a gpg-error.
2021-02-22scd: Fix readkey --info in case a readkey command is available.Werner Koch2-41/+35
* scd/command.c (do_readkey): Make --info also work if a readkey command is available. * scd/app-p15.c (cdf_object_from_certid): Fix a but introduced with the previous commit.
2021-02-22scd:p15: Extract extended usage flagsand act upon them.Werner Koch2-82/+239
* scd/app-p15.c: Add a couple of oid constants. (struct cdf_object_s): Replace fields image and imagelen by cert. (struct prkdf_object_s): Add extusage flags (send_keypairinfo): Use them. (cdf_object_from_certid): Factor parts out to ... (cdf_object_from_objid): new function. (read_ef_prkdf): Move info printing to ... (read_p15_info): here. Fill the extusage flags. (readcert_by_cdf): Cache the ksba cert object instead of the binary cert. * scd/app.c (select_additional_application): Fix a log_debug call. (scd_update_reader_status_file): Ditto. -- This allows us to return only KEYPAIRINFO lines for keys we can actually use.
2021-02-22sm: Extend the list of known OIDs.Werner Koch1-4/+16
* sm/keylist.c (oidtranstbl): Add a couple of OIDs and mark them for key usage.
2021-02-21tools,w32: Add resource and manifest files to all binaries.Werner Koch17-21/+378
--
2021-02-19doc: Update NEWSWerner Koch1-4/+56
--
2021-02-19wkd: Install gpg-wks-client under bin and add wrapper for libexecWerner Koch4-14/+22
-- gpg-wks-client is a pretty useful command on the command line. Thus we now install it at bin and provide a compatibility wrapper.
2021-02-19build: Remove now obsolete HAVE_NEWER_LIBGCRYPT AM conditional.Werner Koch2-24/+25
* configure.ac (HAVE_NEWER_LIBGCRYPT): Remove conditional. * tools/Makefile.am (gpg_pair_tool_SOURCES): We build it always. -- This is because we require libgcrypt 1.9 anyway.
2021-02-19scd: Minor tweak for easier backportingWerner Koch3-23/+30
* scd/app-common.h (APP_CARD): New. Use it in app-*.c to access app->card. -- This should help to make backporting to 2.2 easier.
2021-02-19po: Update Japanese Translation.NIIBE Yutaka1-288/+173
-- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2021-02-18po: Unified the term "message" in the German translationWerner Koch1-43/+43
-- Using "Botschaft" as we used to do is better than "Nachricht" as used in tofu and some other places.
2021-02-18po: Update German translationWerner Koch1-285/+169
--
2021-02-18po: update-poWerner Koch26-14768/+23383
--
2021-02-18scd:piv: Fix a typo in a string.Werner Koch1-2/+2
--
2021-02-18po: Change translatability of a fallback string.Werner Koch1-4/+4
* agent/call-pinentry.c (setup_genpin): Do not make the fallback translatable.
2021-02-18po: Update all po files from 2.2.27Werner Koch26-21535/+26838
--
2021-02-18po: Update POTFILESWerner Koch1-0/+2
--
2021-02-18speedo: Update w32 stuff from 2.2Werner Koch5-37/+81
* build-aux/speedo.mk: Update from 2.2. Add target w32-msi-release. * build-aux/speedo/w32/inst.nsi: Fix location of doc files. * build-aux/speedo/w32/wixlib.wxs: Add gpg-card and fix a wrong name. * Makefile.am (release): Support a WITH_MSI variable. (wixlibfile): Improve copying to archive. (release): Use AMTAR instead of TAR. -- Signed-off-by: Werner Koch <wk@gnupg.org>
2021-02-17dirmngr: Support new gpgNtds parameter in LDAP keyserver URLs.Werner Koch5-22/+40
* dirmngr/ldap-parse-uri.c (ldap_parse_uri): Support a new gpgNtds extension. * dirmngr/ks-engine-ldap.c (my_ldap_connect): Do ldap_init always with hostname - which is NULL and thus the same if not given. Fix minor error in error code handling. -- Note that "gpgNtds" is per RFC-4512 case insensitive and has not yet been officially regisetered. Thus for correctness the OID can be used: 1.3.6.1.4.1.11591.2.5 LDAP URL extensions 1.3.6.1.4.1.11591.2.5.1 gpgNtds=1 (auth. with current user) Note that the value must be 1; all other values won't enable AD authentication and are resevered for future use. This has been cherry-picked from the 2.2 branch, commit 55f46b33df08e8e0ea520ade5f73b321bc01d705 Signed-off-by: Werner Koch <wk@gnupg.org>
2021-02-16build: Update gpg-error.m4 again.NIIBE Yutaka1-11/+33
* m4/gpg-error.m4: Update from libgpg-error. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2021-02-15build: Update gpg-error.m4.NIIBE Yutaka1-6/+6
* m4/gpg-error.m4: Update from libgpg-error. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2021-02-12agent: Comment spell fix.NIIBE Yutaka1-2/+2
-- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2021-02-12build: Update gpg-error.m4.NIIBE Yutaka1-46/+42
* m4/gpg-error.m4: Update from libgpg-error. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2021-02-12build: Fix library dependency of g13 test program.NIIBE Yutaka1-1/+1
* g13/Makefile.am (t_common_ldadd): Add GPG_ERROR_LIBS. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2021-02-11doc: Add NEWS with news from the 2.2 series.Werner Koch2-45/+188
--
2021-02-11doc: Improve the gpg-card man page.Werner Koch2-6/+200
--
2021-02-10gpg: Do not allow old cipher algorithms for encryption.Werner Koch7-16/+92
* g10/gpg.c: New option --allow-old-cipher-algos. (set_compliance_option): Set --rfc4880bis explictly to SHA256 and AES256. Allow old cipher algos for OpenPGP, rfc4880, and rfc2440. * g10/options.h (opt): Add flags.allow_old_cipher_algos. * g10/misc.c (print_sha1_keysig_rejected_note): Always print the note unless in --quiet mode. * g10/encrypt.c (setup_symkey): Disallow by default algos with a blocklengt < 128. (encrypt_crypt): Ditto. Fallback by default to AES instead of 3DES. * g10/pkclist.c (algo_available): Take care of old cipher also. (select_algo_from_prefs): Use AES as implicit algorithm by default. * tests/openpgp/defs.scm (create-gpghome): Set allow-old-cipher-algos. -- GnuPG-bug-id: 3415
2021-02-10Remove obsolete M4 macros.Werner Koch3-361/+1
* m4/gnupg-pth.m4: Remove. * m4/libcurl.m4: Remove. -- Both macros are not used for ages.
2021-02-10Require GpgRT version 1.41.Werner Koch4-46/+6
* configure.ac (NEED_GPG_ERROR_VERSION): Rename to NEED_GPGRT_VERSION and set to 1.41. * common/sysutils.c (gnupg_access): Remove code for older gpgrt versions. * kbx/backend-sqlite.c: Ditto. * sm/gpgsm.c (main): Ditto. -- We already have a requirement for a newer Libgcrypt and thus we can also require a more recent libgpgrt (aka libgpg-error) which was released before Libgcrypt.
2021-02-09build: Make make distcheck work again.Werner Koch1-1/+1
* m4/Makefile.am (EXTRA_DIST): Remove isc-posix.m4 -- Fixes-commit: d66fb3aa53a6c4a815fe35a15e3c61886c5df628
2021-02-09tools: Remove the symcryptrun tool.Werner Koch7-1179/+3
* tools/symcryptrun.c: Remove. * tools/Makefile.am: Ditto. * doc/tools.texi: Remove man page. * configure.ac: Remove build option and tests used only by this tool. * Makefile.am (AM_DISTCHECK_CONFIGURE_FLAGS): Do not build symcryptrun. -- symcryptrun is too ancient to be of any use and has not been tested in many years. Thus we should not distribute it anymore.
2021-02-05gpg: Fix selection of key.NIIBE Yutaka1-1/+3
* g10/getkey.c (pubkey_cmp): Handle the case of TRUST_EXPIRED. -- GnuPG-bug-id: 4713 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2021-02-02gpg: Remove support for PKA.Werner Koch17-464/+35
* g10/gpg.c (oPrintPKARecords): Remove. (opts): Remove --print-pka-records. (main): Remove "pka-lookups","pka-trust-increase" and other PKA stuff. * g10/options.h (EXPORT_DANE_FORMAT): Remove. (VERIFY_PKA_LOOKUPS, VERIFY_PKA_TRUST_INCREASE): Remove. (KEYSERVER_HONOR_PKA_RECORD): Remove. * g10/packet.h (pka_info_t): Remove. (PKT_signature): Remove flags.pka_tried and pka_info. * g10/parse-packet.c (register_known_notation): Remove "pka-address@gnupg.org". * g10/pkclist.c (check_signatures_trust): Remove PKA stuff. * g10/call-dirmngr.c (gpg_dirmngr_get_pka): Remove. * g10/export.c (parse_export_options): Remove "export-pka". (do_export): Adjust for this. (write_keyblock_to_output): Ditto. (do_export_stream): Ditto. (print_pka_or_dane_records): Rename to ... (print_dane_records): this and remove two args. Remove PKA printing. * g10/free-packet.c (free_seckey_enc, cp_pka_info): Adjust for removed pka_info field. * g10/getkey.c (get_pubkey_byname): Make AKL_PKA a dummy. * g10/keyserver.c: Remove "honor-pka-record". (keyserver_import_pka): Remove. * g10/mainproc.c (get_pka_address): Remove. (pka_uri_from_sig): Remove. (check_sig_and_print): Remove code for PKA. -- PKA (Public Key Association) was a DNS based key discovery method which looked up fingerprint by mail addresses in the DNS. This goes back to the conference where DKIM was suggested to show that we already had a better method for this available with PGP/MIME. PKA was was later superseded by an experimental DANE method and is today not anymore relevant. It is anyway doubtful whether PKA was ever widely used. Signed-off-by: Werner Koch <wk@gnupg.org>
2021-02-02gpg: Remove more or less useless tool gpgcompose.Werner Koch2-3128/+0
* g10/gpgcompose.c: Remove -- This tool duplicated a lot of code and was hard to maintain. IIRC, it was part of some Univerity assignment and of no real use anymore.
2021-02-02gpg: Remove experimental feature to export w/o user-ids.Werner Koch4-84/+7
* g10/options.h (IMPORT_DROP_UIDS, EXPORT_DROP_UIDS): Remove. * g10/import.c (parse_import_options): Remove option import-drop-uids. (import_one_real): Remove drop uids code. (remove_all_uids): Remove function. * g10/export.c (parse_export_options): Remove option export-drop-uids. (do_export_one_keyblock): Remove drop uids code.
2021-02-02card: List keys of pkcs#15 cards.Werner Koch1-0/+19
* tools/gpg-card.c (list_p15): New. (list_card): Call it.
2021-02-02scd:p15: Read PuKDF and minor refactoring.Werner Koch1-85/+447
* scd/app-p15.c (pukdf_object_t): New. (struct app_local_s): Add field public_key_info. (release_pukdflist): New. (select_and_read_record): No diagnostic in case of not_found. (read_first_record): New. Factored out from the read_ef_ fucntions. (read_ef_pukdf): New. Basically a copy of read_ef_prkdf for now. (read_p15_info): Also read the public keys. (cardtype2str): New. (read_ef_tokeninfo): Print a string with the cardtype.
2021-02-01sm: Add a few OIDs and merge OID tables.Werner Koch1-52/+44
* sm/keylist.c (OID_FLAG_KP): New. (key_purpose_map): Merge into ... (oidtranstbl): this. (get_oid_desc): New arg 'matchflag'. Use function in place of direct access to key_purpose_map. Signed-off-by: Werner Koch <wk@gnupg.org>
2021-01-28Include the library version in the compliance checks.Werner Koch6-17/+69
* common/compliance.c (gnupg_gcrypt_is_compliant): New. (gnupg_rng_is_compliant): Also check library version. * g10/mainproc.c (proc_encrypted): Use new function. (check_sig_and_print): Ditto. * sm/decrypt.c (gpgsm_decrypt): Ditto. * sm/encrypt.c (gpgsm_encrypt): Ditto. * sm/verify.c (gpgsm_verify): Ditto -- This will eventually allow us to declare Libgcrypt 1.9 to be de-vs compliant. GnuPG can use this information then for its own checks. As of now GnuPG tests the version of the used library but that is a bit cumbersome to maintain. Signed-off-by: Werner Koch <wk@gnupg.org>
2021-01-27scd:p15: Make file selection more robust.Werner Koch1-37/+60
* scd/app-p15.c: Include host2net.h. (DEFAULT_HOME_DF): New. (select_and_read_binary): Replace slot by app. Change callers. Use select_ef_by_path. (select_and_read_record): ditto. (select_ef_by_path): Make use use the home_df. (parse_certid): Adjust for always set home_df. (print_tokeninfo_tokenflags): Ditto. (app_select_p15): Take the home_df from the FCI returned by select. -- This uses modern APDUs and always selectd starting at the PCKS-15 home DF. We could have made this much simpler but the goal is to keep support for older cards although we can't test that easily. Signed-off-by: Werner Koch <wk@gnupg.org>
2021-01-27scd: Define new status wordWerner Koch4-9/+17
* scd/apdu.h (SW_NO_CURRENT_EF): New. -- This merely to show better diagnostics. Used for example by CardOS 5.3.
2021-01-27scd:p15: Factor the commonKeyAttributes parser out.Werner Koch1-134/+206
* scd/app-p15.c (read_ef_prkdf): Fix detection of unsupported key objects. Factor some code out to ... (parse_common_key_attr): new. --
2021-01-27gpg: Fix ugly error message for an unknown symkey algorithm.Werner Koch1-1/+4
* g10/mainproc.c (proc_symkey_enc): Do not continue with an unknown algorithm. -- Trying to encrypt data created with printf "\x8c\x49\x05\x0e\x0a\x03\x01" fails in version 2.2.19 with gpg: packet(3) with unknown version 5 but with later versions with gpg: encrypted with unknown algorithm 14 gpg: Ohhhh jeeee: ... this is a bug \ ([...]/passphrase.c:433:passphrase_to_dek) so we better catch this case earlier. Reported-by: Tavis Ormandy Signed-off-by: Werner Koch <wk@gnupg.org>
2021-01-26scd:p15: Factor the commonObjectAttributes parser out.Werner Koch1-139/+112
* scd/app-p15.c (parse_common_obj_attr): New. (read_ef_prkdf): Use new function. (read_ef_aodf): Ditto.
2021-01-26scd:p15: First step towards real CardOS 5 support.Werner Koch4-76/+218
* scd/iso7816.c (iso7816_select_path): Add arg from_cdf. * scd/app-nks.c (do_readkey): Adjust for this change. * scd/app-p15.c (CARD_TYPE_CARDOS_53): New. (IS_CARDOS_5): New. (card_atr_list): Add standard ATR for CardOS 5.3. (select_and_read_binary): Remove the fallback to record read hack. (select_and_read_record): New. (select_ef_by_path): Rework and support CardOS feature. (read_ef_prkdf): Use read record for CardOS. (read_ef_cdf): Ditto. (read_ef_aodf): Ditto. Also fix bug in the detection of other unsupported attribute types. (verify_pin): Use IS_CARDOS_5 macro. (app_select_p15): Force direct method for CardOS. Signed-off-by: Werner Koch <wk@gnupg.org>
2021-01-25agent: Support ssh-agent extensions for environment variables.Werner Koch2-4/+120
* common/session-env.c (session_env_list_stdenvnames): Extend to allow return all names as one string. * agent/command-ssh.c (SSH_REQUEST_EXTENSION): New. (SSH_RESPONSE_EXTENSION_FAILURE): New. (request_specs): Add handler for the extension command. (ssh_handler_extension): New. -- The extension mechanism is specified in https://tools.ietf.org/html/draft-miller-ssh-agent-04 Signed-off-by: Werner Koch <wk@gnupg.org>
2021-01-21scd:p15: Show the ATR as part of the TokenInfo diagnostics.Werner Koch1-0/+12
* scd/app-p15.c (read_ef_tokeninfo): Print the ATR in verbose mode. -- It is convenient to see the ATR close to the other info, Signed-off-by: Werner Koch <wk@gnupg.org>
2021-01-19Require Libgcrypt 1.9Werner Koch11-63/+24
* configure.ac: Require at least Libgcrypt 1.9.0. Remove all GCRYPT_VERSION_NUMBER dependent code. -- Only Libgcrypt 1.9 implements EAX which is a mandatory algorithm in RFC4880bis. Signed-off-by: Werner Koch <wk@gnupg.org>
2021-01-12tools: Add option --clock to watchgnupgWerner Koch1-1/+28
* tools/watchgnupg.c (print_fd_and_time) [ENABLE_LOG_CLOCK]: Use clock_gettime. (print_version): New option --clock.
2021-01-12po: Update Simplified Chinese Translation.bobwxc1-49/+47
-- GnuPG-bug-id: 5189 Signed-off-by: bobwxc <bobwxc@yeah.net>
2021-01-11gpg,w32: Fix gnupg_remove.Werner Koch3-1/+132
* common/sysutils.c (map_w32_to_errno): New. (gnupg_w32_set_errno): New. (gnupg_remove) [w32]: Set ERRNO -- To support Unicode gnupg_remove was changed to use DeleteFileW and not properly tested because the code was alreadt used in Windows CE. However, ERRNO was not set and thus Dirmngr failed due to if (!gnupg_remove (fname)) log_info (_("removed stale te[...] file '%s'\n"), fname); else if (errno != ENOENT) { err = gpg_error_from_syserror (); log_error (_("problem remov[...] file '%s': %s\n"), fname, gpg_strerror (err)); goto leave; } GnuPG-bug-id: 5230
2021-01-06I meant "SHA-2 digests" in the previous commit.Ingo Klöcker0-0/+0
GnuPG-bug-id: 5184
2021-01-06scd:nks: Add support for signing plain SHA-3 digests.Ingo Klöcker1-17/+67
* scd/app-nks.c (do_sign): Handle plain SHA-3 digests and verify encoding of ASN.1 encoded hashes. -- This makes it possible to create CSRs for NetKey card keys which are signed with SHA256 by default. GnuPG-bug-id: 5184
2021-01-05po: Fix Simplified Chinese Translation.NIIBE Yutaka1-2/+2
-- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2021-01-05po: Fix Simplified Chinese Translation.NIIBE Yutaka1-2/+2
-- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2021-01-05po: Update Simplified Chinese Translation.bobwxc1-2616/+1963
-- GnuPG-bug-id: 5189 Signed-off-by: bobwxc <bobwxc@yeah.net>
2020-12-30wkd: Minor permission fix for created files.Werner Koch1-2/+2
* tools/wks-util.c (wks_cmd_install_key): Don't set u+x on the file. (ensure_policy_file): No need to make the policy file group writable. -- The policy file is rarely changed thus no need to g+w. Setting +x on a plain file does not make sense at all. GnuPG-bug-id: 5214
2020-12-28Update Traditional Chinese doc/help.zh_TW.txtYao Wei1-102/+224
-- Signed-off-by: Yao Wei <mwei@debian.org>
2020-12-23doc: Add instructions on how to setup an Active Directory.Werner Koch2-9/+89
--
2020-12-23doc: Update Simplified Chinese doc/help.zh_CN.txt.bobwxc1-57/+206
-- GnuPG-bug-id: 5189 Signed-off-by: bobwxc <bobwxc@yeah.net>
2020-12-23doc: Update Japanese doc/help.ja.txt.NIIBE Yutaka1-10/+43
-- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
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-21doc: Explain LDAP keyserver parametersWerner Koch1-1/+20
2020-12-18dirmngr: Do not block threads in LDAP keyserver calls.Werner Koch1-6/+38
* dirmngr/ks-engine-ldap.c: Wrap some ldap calls. -- The former gpgkeys_ldap module has once been ported to dirmngr but unfortunately the dirmngr_ldap wrapper has not been used so that we have internal LDAP calls with these problems: - No usable timeouts. - On non-Windows platforms a lot of extra libs and possibly even a second copy of Libgcrypt is pulled in. - Only one threads runs at a time. This patch mitigates the last point. Signed-off-by: Werner Koch <wk@gnupg.org>
2020-12-17gpg: New AKL method "ntds"Werner Koch8-6/+90
* dirmngr/ks-engine-ldap.c (keyspec_to_ldap_filter): Change the new support for KEYDB_SEARCH_MODE_MAIL. (ks_ldap_get): Add a debug. * g10/options.h (AKL_NTDS): New. * g10/keyserver.c (keyserver_import_ntds): New. (keyserver_get_chunk): Allow KEYDB_SEARCH_MODE_MAIL. * g10/getkey.c (parse_auto_key_locate): Support "ntds". (get_pubkey_byname): Ditto.
2020-12-17dirmngr: Support "ldap:///" for the current AD user.Werner Koch3-15/+54
* dirmngr/http.h (struct parsed_uri_s): Add field ad_current. * dirmngr/ldap-parse-uri.c (ldap_parse_uri): Set it. * dirmngr/ks-engine-ldap.c (my_ldap_connect): Take care of ad_current. -- Ported from 2.2. Signed-off-by: Werner Koch <wk@gnupg.org>
2020-12-17dirmngr: Allow LDAP searches via fingerprint.Werner Koch1-23/+41
* dirmngr/ks-engine-ldap.c (keyspec_to_ldap_filter): Add arg serverinfo and allow searching by fingerprint. (ks_ldap_get, ks_ldap_search): First connect then create teh filter. -- With the new schema we can finally search by fingerprint.
2020-12-17dirmngr: Finalize Active Directory LDAP SchemaWerner Koch3-5/+7
-- With these modifications it is now possible to store and retrieve keys from an AD without manually tweaking the schema. Permissions need to be set manuallay, though.
2020-12-15dirmngr: Store all version 2 schema attributes.Werner Koch2-45/+88
* g10/call-dirmngr.c (ks_put_inq_cb): Emit "fpr" records. * dirmngr/ks-engine-ldap.c (extract_attributes): Add args extract-state and schemav2. Add data for the new schema version. remove the legacy code to handle UIDs in the "pub" line. (ks_ldap_put): Set new attributes for NTDS use the fingerprint as CN. Signed-off-by: Werner Koch <wk@gnupg.org>
2020-12-15dirmngr: Remove superfluous attribute from the LDAP schema.Werner Koch2-27/+10
-- I accidently added a gpgSubCertID attribute not realizing that the pgpSubKeyID already carries the long keyid. Remove that. Note that the pgpkeyID has the short keyid and the long keyid has the name pgpCertID. Signed-off-by: Werner Koch <wk@gnupg.org>
2020-12-14dirmngr: Support the new Active Directory schemaWerner Koch4-110/+523
* dirmngr/ks-engine-ldap.c (SERVERINFO_): New constants. (my_ldap_connect): Relace args pgpkeyattrp and real_ldapp by a new serverinfo arg. Set the new info flags. (ks_ldap_get): Adjust for change. (ks_ldap_search): Ditto. (ks_ldap_put): Ditto. Replace xmalloc by xtrymalloc. Change the DN for use with NTDS (aka Active Directory). * doc/ldap/gnupg-ldap-init.ldif (pgpSoftware): Update definition of pgpVersion. * doc/ldap/gnupg-ldap-ad-init.ldif: New. * doc/ldap/gnupg-ldap-ad-schema.ldif: New. -- This is a first take on better Active Directory support. The main change for NTDS in the code is that the an top-RDN of CN is used instead of the old pgpCertID. More changes to come; for example using and storing the fingerprint. Signed-off-by: Werner Koch <wk@gnupg.org>
2020-12-14dirmngr: Do not store the useless pgpSignerID in the LDAP.Werner Koch4-25/+5
* dirmngr/ks-engine-ldap.c (extract_attributes): Do not store the pgpSignerID. * g10/call-dirmngr.c (ks_put_inq_cb): Do not emit sig records. -- The pgpSignerID has no use in the LDAP and thus don't store it. David's idea back in 2004 was /* This bit is really for the benefit of people who store their keys in LDAP servers. It makes it easy to do queries for things like "all keys signed by Isabella". */ See-commit: 3ddd4410aef928827e1c8d4fb02c1ccd3f8eaea5 I consider this dangerous because such a query is not able to validate the signature, does not get revocation signatures, and also has no information about the validity of the signatures. Further many keys are spammed tehse days with faked signatures and it does not make sense to blow up the LDAP with such garbage. Signed-off-by: Werner Koch <wk@gnupg.org>
2020-12-14dirmngr: Fix adding keys to an LDAP server.Werner Koch1-2/+2
* dirmngr/ks-engine-ldap.c (ks_ldap_put): Extract attribites into addlist. -- The code used the wrong list which resulting in adding attributes marked for deletion. In particular Active Directory does not accept such an data and rejects them. The bug was introduced into 2.1 while porting the code from the old keyserver helpers to dirmngr. Fixes-commit: 51341badb623927f2a358588c725a356fc77dbe7 Signed-off-by: Werner Koch <wk@gnupg.org>
2020-12-11scd:nks: Support READKEY with keygrip and for "NKS-IDLM" keyref.NIIBE Yutaka1-0/+22
* scd/app-nks.c (do_readkey): Allow KEYGRIP access. Support NKS-IDLM.XXXX keyref. -- GnuPG-bug-id: 5150 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-12-11scd:nks: Factor out pubkey retrieval from keygrip handling.NIIBE Yutaka1-84/+72
* scd/app-nks.c (pubkey_from_pk_file): New. (keygripstr_from_pk_file): Use pubkey_from_pk_file. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-12-10scd:nks: Add support of KEYGRIP for do_readcert.NIIBE Yutaka1-0/+18
* scd/app-nks.c (do_readcert): Support KEYGRIP. -- GnuPG-bug-id: 5150 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-12-10scd:nks: Factor out iteration over filelist.NIIBE Yutaka1-78/+114
* scd/app-nks.c (iterate_over_filelist): New. (do_with_keygrip): Use iterate_over_filelist. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-12-09wks-client: Improve an error messageWerner Koch1-1/+1
* tools/gpg-wks-client.c (read_confirmation_request): Print trust letter. -- The trust letter gives a hint on what's wrong with the key. Signed-off-by: Werner Koch <wk@gnupg.org>
2020-12-09scd:ccid:spr532: Extend abort_cmd for initialization time.NIIBE Yutaka1-11/+18
* scd/ccid-driver.c (abort_cmd): Add INIT argument to support synchronize until success, even ignoring timeout. (bulk_in): Normal use case of abort_cmd. (ccid_vendor_specific_init): Initial use case of abort_cmd. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-12-09scd:ccid: Call libusb_clear_halt in ccid_vendor_specific_setup.NIIBE Yutaka1-0/+1
* scd/ccid-driver.c (ccid_vendor_specific_setup): Only for SPR532, call libusb_clear_halt. -- GnuPG-bug-id: 5167 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-12-09scd:ccid: Revert the addition of libusb_clear_halt for EP_INTR.NIIBE Yutaka1-1/+0
* scd/ccid-driver.c (ccid_setup_intr): Don't call libusb_clear_halt. -- GnuPG-bug-id: 5167 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-12-08scd:yubikey: Fix support of Yubikey NEO.NIIBE Yutaka1-0/+3
* scd/app-openpgp.c (get_public_key): Yubikey NEO also has this issue. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-12-08agent: Allow decryption with card but no file.NIIBE Yutaka1-2/+5
* agent/pkdecrypt.c (agent_pkdecrypt): Support decryption with card but without a stub key. -- GnuPG-bug-id: 5170 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-12-08agent: Clean up the API of agent_pkdecrypt.NIIBE Yutaka2-24/+24
* agent/agent.h (agent_pkdecrypt): Use gpg_error_t type. * agent/pkdecrypt.c (agent_pkdecrypt): Use gpg_error_t type. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-12-08agent: Allow pksign operation with card but no file.NIIBE Yutaka1-2/+4
* agent/pksign.c (agent_pksign_do): Add support with no file. -- GnuPG-bug-id: 5166 Signed-off-by: Ingo Klöcker <dev@ingo-kloecker.de>
2020-12-07gpg: Make quick-gen-key with algo "card" work for keys without keytimeIngo Klöcker1-6/+4
* g10/keygen.c (quick_generate_keypair): Set pCARDKEY flag if algostr is "card" or "card/...". -- For keys stored on NetKey cards or PIV cards we do not necessarily know the creation time. Therefore set the cardkey flag if the generation of a key from the keys available on the currently inserted smartcard is requested with the special algo "card" or, in case of the extended unattended mode, with an algo like "card/sign". GnuPG-bug-id: 5141 Signed-off-by: Ingo Klöcker <dev@ingo-kloecker.de>
2020-12-07gpg,card: Allow no version information of Yubikey.NIIBE Yutaka2-2/+4
* g10/call-agent.c (learn_status_cb): Assume >= 2 when no version. * tools/card-call-scd.c (learn_status_cb): Likewise. -- GnuPG-bug-id: 5100 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-12-03scd:nks: Fix caching keygrip (more).NIIBE Yutaka1-5/+7
* scd/app-nks.c (keygripstr_from_pk_file): Distinguish by APP_ID. -- GnuPG-bug-id: 5150, 5161 Fixes-commit: 920154370834ad8d947aed19c9d914a27dde6baa Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-12-03scd: Fix KEYINFO command with --data option.NIIBE Yutaka1-4/+3
* scd/command.c (cmd_keyinfo): Handle --data option correctly. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-12-03scd:openpgp: Fix writing ECC key to card.NIIBE Yutaka1-6/+27
* scd/app-openpgp.c (build_privkey_template): Adding another argument of ecc_d_fixed_len to handle variable-size MPI. -- GnuPG-bug-id: 5163 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-12-02kbx: Better error message in case of a crippled Libgcrypt.Werner Koch1-2/+10
* kbx/keybox-openpgp.c (keygrip_from_keyparm): Detect missing curve.
2020-12-01doc: Add parameters for batch generation of ECC keys.Jens Meißner1-0/+8
* doc/gpg.texi: Add parameters for batch generation of ECC keys. -- There are parameters required for batch generation of ECC keys which weren't mentioned in the documentation. Signed-off-by: Jens Meißner <meissner@b1-systems.de>
2020-11-30scd:nks: Minor additions to the basic IDLM application support.Werner Koch1-15/+25
* scd/app-nks.c (filelist): Use special value -1 for IDLM pubkeys. (keygripstr_from_pk_file): Handle special value. (do_readcert): Ditto. (do_writecert): Ditto. -- This allows to get information about the keys from the card. However the do_readkey still requires a fallback to readcert. This does not work because there are no certificates yet on the card. The fix is to fully implement do_readkey.
2020-11-27card: Let the APDU command prints a description of the status word.Werner Koch3-1/+43
* tools/card-call-scd.c (scd_apdu_strerror): New. * tools/gpg-card.c (cmd_apdu): Print a description. -- Pretty convenient to explore smartcards.
2020-11-27scd: New getinfo sub-command apdu_strerror.Werner Koch2-15/+28
* scd/apdu.c (apdu_strerror): Add missing status codes. * scd/command.c (cmd_getinfo): New sub-command apdu_strerror. -- This is quite handy for gpg-card's APDU command and avoids that we need to duplicate the mapping table or put it into a shared file.
2020-11-27card: Netkey improvement for passwd.Werner Koch1-13/+22
* tools/gpg-card.c (cmd_passwd) [Netkey]: No Standard/QES menu if the card does not support it. Print no error in cases the user canceled.
2020-11-27scd:ccid-driver: Fix pinpad error handling for cancel/timeout.NIIBE Yutaka4-2/+17
* scd/apdu.h (SW_HOST_UI_CANCELLED, SW_HOST_UI_TIMEOUT): New. * scd/ccid-driver.h (CCID_DRIVER_ERR_UI_CANCELLED): New. (CCID_DRIVER_ERR_UI_TIMEOUT): New. * scd/ccid-driver.c (bulk_in): Handle PIN input cancel/timeout error. * scd/iso7816.c (map_sw): Support SW_HOST_UI_CANCELLED and SW_HOST_UI_TIMEOUT. -- GnuPG-bug-id: 4614 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-26agent: Fix YK s/n and prettify the request card prompt for YubikeysWerner Koch3-38/+39
* agent/divert-scd.c (ask_for_card): Detect and re-format the Yubikey prompt. * scd/app.c (app_munge_serialno): Fix Yubikey s/n munging. (card_get_dispserialno): Ditto. * scd/app-openpgp.c (get_disp_serialno): Remove. (get_prompt_info): Use app_get_dispserialno.-- --
2020-11-26scd: Do not try to use a non-enabled app after card switching.Werner Koch1-2/+19
* scd/app.c (app_dump_state): Also print the refcount. (maybe_switch_app): Make sure the app exists on the card. -- When switching the current card and the card does not support the same apps as the former, we now reset the app to the first one. Testcase is to use a standard OpenPGP card and a P15 card. Signed-off-by: Werner Koch <wk@gnupg.org>
2020-11-26scd: Add special serialno compare for OpenPGP cards.Werner Koch3-10/+45
* scd/app.c (is_same_serialno): New. (check_application_conflict): Use this. (select_application): Ditto. (app_switch_current_card): Ditto. * scd/app-openpgp.c (check_keyidstr): Ignore the card version and also compare case insensitive. -- This is required because we change what we emit as serialno of OpenPGP cards but existing keys still use the old form of the serial number (i.e. with a firmware version). See-commit: 3a8250c02031080c6c8eebd5dea03f5f87f9ddd7 Signed-off-by: Werner Koch <wk@gnupg.org>
2020-11-26gpg: Report an error for receiving key from agent.NIIBE Yutaka1-0/+1
* g10/export.c (do_export_one_keyblock): Report an error. -- GnuPG-bug-id: 5151 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-26scd,nks: Fix caching keygrip.NIIBE Yutaka1-3/+4
* scd/app-nks.c (keygripstr_from_pk_file): Identify by cfid if available. -- GnuPG-bug-id: 5150 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-25scd:p15: Print the internal card type.Werner Koch1-0/+8
* scd/app-p15.c (read_ef_tokeninfo): Print the internal card type.
2020-11-25scd:p15: Improve support for some CardOS based cards.Werner Koch3-14/+68
* scd/iso7816.c (iso7816_read_binary_ext): Add optional arg r_sw and change callers. (iso7816_read_record): Factor all code out to ... (iso7816_read_record_ext): new. * scd/app-p15.c (select_and_read_binary): Fallback to record reading. (read_ef_aodf): Clear EOF error.
2020-11-25g13: Add missing headerWerner Koch1-0/+1
--
2020-11-25scd: Rework the handling of the displayed serial number.Werner Koch5-119/+178
* scd/app.c (app_new_register): Call app_munge_serialno for Yubikeys. (app_munge_serialno): Handle Yubikey serial numbers. (card_get_serialno): Remove special Yubikey treatment. Drop arg is_canonical. (app_get_serialno): Clear ERRNO on error. (card_get_dispserialno): New. Also change formatting of Yubikey and OpenPGP numbers to match those printed on the card. (app_get_dispserialno): New. * scd/app-openpgp.c (do_getattr): Use app_get_dispserialno. (yubikey_get_serialno): Remove. * scd/app-piv.c (get_dispserialno): Remove. (do_getattr): Use app_get_dispserialno. -- This patch gets us back to a unique serial number for cards and provides a stable serial number as printed for Yubikeys. Because we use a slightly different serial number now for Yubikeys and cards only supporting OpenPGP card we need to come up with another change so that the version number of OpenPGP serial numbers are ignored when comparing card serial numbers. This is so that existing stub keys of gpg-agent will continue to work. GnuPG-bug-id: 5100 Signed-off-by: Werner Koch <wk@gnupg.org>
2020-11-25scd: Fix an error return for READKEY.NIIBE Yutaka1-0/+3
* scd/command.c (cmd_readkey): Return when error. -- GnuPG-bug-id: 5150 Suggested-by: Ingo Klöcker Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-25scd,nks: Fix SEGV for learn for older card.NIIBE Yutaka1-0/+1
* scd/app-nks.c (keygripstr_from_pk_file): Set algostr. -- GnuPG-bug-id: 5144 Fixes-commit: 26da47ae53d51e16ae6867cd419ddbf124a94933 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-23doc: Fix typosGavin L. Rebeiro4-7/+7
-- GnuPG-bug-id: 5071 Also fixed one in keyformat.txt [wk].
2020-11-20gpg: Change API of agent_scd_serialno.NIIBE Yutaka3-21/+13
* g10/call-agent.c (agent_scd_serialno): Extend API to allow with R_SERIALNO == NULL. * g10/card-util.c (card_status): Use NULL for agent_scd_serialno. (factory_reset): Likewise. * g10/skclist.c (build_sk_list): Likewise. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-20Fix the previous comment changes help doc string.NIIBE Yutaka3-3/+3
* scd/command.c (hlp_learn): Fix the doc string. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-20gpg,agent: Fix comments for KEYPAIRINFO status report.NIIBE Yutaka2-2/+2
-- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-19gpgconf: Also print revision of libksba.Werner Koch1-3/+4
* dirmngr/dirmngr.c (get_revision_from_blurb): Fix detection of empty string. (gpgconf_versions): Print ksba revision. -- The latest Libksba version support retrieving of the revision (commit) id. We now use that or print a question mark. Signed-off-by: Werner Koch <wk@gnupg.org>
2020-11-19agent: Fix creating shadow key on card key generation.NIIBE Yutaka1-3/+3
* agent/command.c (cmd_readkey): Fix handling --card option. -- Fixes-commit: 9c719c9c1ff34cc06a0fef2bfe29cfd7182753eb Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-19gpg: Fix --card-edit command.NIIBE Yutaka1-1/+2
* g10/card-util.c (get_info_for_key_operation): Revert the change. -- Fixes-commit: 157f1de64e437cecd75335e9f4077ba9835e3da0 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-18build: Update to newer autoconf constructs.NIIBE Yutaka16-242/+264
* acinclude.m4 (GNUPG_CHECK_ENDIAN): Use AC_COMPILE_IFELSE instead of AC_TRY_COMPILE. Use AC_RUN_IFELSE instead of AC_TRY_RUN. (GNUPG_BUILD_PROGRAM): Use AS_HELP_STRING instead of AC_HELP_STRING. * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS instead of AC_GNU_SOURCE. Use AS_HELP_STRING instead of AC_HELP_STRING. (AC_ISC_POSIX): Replace by AC_SEARCH_LIBS. (AC_TYPE_SIGNAL): Remove. * m4/isc-posix.m4: Remove. * m4/codeset.m4: Update from gnulib. * m4/gettext.m4: Update from gnulib. * m4/lcmessage.m4: Update from gnulib. * m4/socklen.m4: Update from gnulib. * m4/ldap.m4: Use AS_HELP_STRING instead of AC_HELP_STRING. Use AC_LINK_IFELSE instead of AC_TRY_LINK. Use AC_RUN_IFELSE instead of AC_TRY_RUN. * m4/gpg-error.m4: Update from libgpg-error. * m4/readline.m4: Update from libgpg-error. * m4/npth.m4: Update from npth. * m4/libassuan.m4: Update from libassuan. * m4/libgcrypt.m4: Update from libgcrypt. * m4/ksba.m4: Update from libksba. * m4/ntbtls.m4: Update from ntbtls. * common/signal.c [!HAVE_DOSISH_SYSTEM] (init_one_signal): Replace RETSIGTYPE to void. [!HAVE_DOSISH_SYSTEM] (got_fatal_signal, got_usr_signal): Likewise. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-18build: Use modern Autoconf check for types.NIIBE Yutaka2-17/+12
* common/types.h: Use HAVE_TYPE_BYTE, HAVE_USHORT_TYPEDEF, HAVE_ULONG_TYPEDEF, HAVE_U16_TYPEDEF, and HAVE_TYPE_U32. * configure.ac (byte, ushort, ulong, u16, u32): Use AC_CHECK_TYPES. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-13gpg: Fix the encrypt+sign hash algo preference selection for ECDSA.Werner Koch4-36/+59
* g10/keydb.h (pref_hint): Change from union to struct and add field 'exact'. Adjust callers. * g10/pkclist.c (algo_available): Take care of the exact hint. * g10/sign.c (sign_file): Rework the hash detection from recipient prefs. -- This fixes a encrypt+sign case like: One recipient key has SHA512 as highest ranked hash preference but the the signing key is a 256 bit curve. Because we don't want to use a truncated hash with ECDSA, we need to have an exact match - this is in particular important for smartcard which check that the hash matches the curves. Signed-off-by: Werner Koch <wk@gnupg.org> Ported-from-stable: aeed0b93ff660fe271d8f98f8d5ce60aa5bf3ebe
2020-11-12gpgconf: Yet another fix for --apply-profile.Werner Koch1-4/+4
* tools/gpgconf.c (main): Use gnupg_homedir instead of default_homedir. Check for existance of the directory. -- Fixes-commit: 7d95f2e7e7a09e3d433d449b117e3470f9dd38c7 Signed-off-by: Werner Koch <wk@gnupg.org>
2020-11-11scd: Do not print reader status change with --debug cardio.Werner Koch1-1/+1
-- ... but use --debug reader for this. Signed-off-by: Werner Koch <wk@gnupg.org> (cherry picked from commit bd3b698d8ec427a02f2fa793777f2a88bc356f25)
2020-11-11w32: Replace some fopen by es_fopen.Werner Koch5-84/+43
* agent/protect-tool.c (read_file): Replace fopen by es_fopen. * dirmngr/dirmngr-client.c (read_pem_certificate): Ditto. (read_certificate): Ditto. * g10/keydb.c (rt_from_file): Ditto. * kbx/kbxutil.c (read_file): Ditto. * g10/plaintext.c (get_output_file) [__riscos__]: Remove code. Signed-off-by: Werner Koch <wk@gnupg.org>
2020-11-11gpg: Fix the previous commit.NIIBE Yutaka1-1/+3
* g10/delkey.c (do_delete_key): Fix the condition for the error. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-10gpg: In batch mode, delete-secret-key is not okay without --yes.NIIBE Yutaka1-1/+6
* g10/delkey.c (do_delete_key): Emit an error when not --yes. -- GnuPG-bug-id: 4667 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-10gpg: Fix agent_delete_key interaction.NIIBE Yutaka1-0/+1
* g10/call-agent.c (agent_delete_key): Set up CTX. -- Fixes-commit: 20acc7c0226550530085a674ef1bb41ebfa39408 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-09card: Run factory-reset in locked stated also in gpg-card.Werner Koch4-12/+57
* tools/card-call-scd.c (scd_apdu): Add more pseudo APDUs. * tools/card-misc.c (send_apdu): Handle them. * tools/gpg-card.c (cmd_factoryreset): Use lock commands. -- This is port of the code used with gpg-card-edit. Note that the command "apdu" now also understands some extra keywords. Signed-off-by: Werner Koch <wk@gnupg.org>
2020-11-09card: Run factory-reset in locked stated.Werner Koch4-17/+58
* scd/command.c (reset_notify): Add option --keep-lock. (do_reset): Add arg keep_lock. (cmd_lock): Send progress status. * g10/call-agent.c (agent_scd_apdu): Add more pseudo APDUs. * g10/card-util.c (send_apdu): Ditto. (factory_reset): Use lock commands. -- This is required so that for example Kleopatra does not detect the RESET and issues a SERIALNO of its own, thus conflicting with our SERIALNO undefined. Signed-off-by: Werner Koch <wk@gnupg.org>
2020-11-09gpg: Do not print rejected digest algo notes with --quiet.Werner Koch1-1/+5
* g10/misc.c (print_digest_rejected_note): Do not print in quiet mode. (print_sha1_keysig_rejected_note): Ditto. -- GnuPG-bug-id: 4893 Signed-off-by: Werner Koch <wk@gnupg.org>
2020-11-09gpg: Fix SOS handling when exporting SSH key with libgcrypt 1.8.NIIBE Yutaka1-10/+35
* g10/export.c (key_to_sshblob): Fix SOS correctly. -- GnuPG-bug-id: 5116 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-09agent: Fix SOS handling with libgcrypt 1.8.NIIBE Yutaka1-2/+19
* agent/cvt-openpgp.c (apply_protection): Handle opaque MPI. -- GnuPG-bug-id: 5116 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-06agent: Minor tweaks to the new genpin inquiry.Werner Koch1-43/+53
* agent/call-pinentry.c (generate_pin): Use STRING random which is sufficient for a passphrase. (inq_cb): s/rc/err/. Do not print two errors in case generate_pin fails. Lowercase strings as per GNU standards. (setup_genpin): Fix translation test. (setup_qualitybar): Ditto. -- Our policy is to use VERY_STRONG for a long term public key but not for symmetric keys. The GNU standards to demand that strings start with a lowercase because that seems to be needed if it follows a prefix of for example "gpg:". I don't actually like this becuase we need different strings in interactive and standard mode but the majory of strings in GnuPGare written this way. If a translation is necessary it can be done with an en_GB or so locale. Signed-off-by: Werner Koch <wk@gnupg.org>
2020-11-06agent: Add genpin inquiry for pinentryAndre Heinecke1-8/+116
* agent/call-pinentry.c (agent_get_passphrase): Setup genpin. (do_getpin): Update with new name for inquire callback. (inq_quality): Rename to inq_cb and add genpin support. (inq_cb): Renamed form inq_quality. (generate_pin): New helper to generate a pin. (agent_askpin): Fix some typos. (setup_genpin): Provide new strings for pinentry. -- This implements the gpg-agent side for generating a pin especially for symmetric encryption using libgcrypt randomness and checking it against the gpg-agent constraints.
2020-11-05gpg: Add canceled status message.Ben Kibbey2-1/+2
* 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 <bjk@luxsci.net>
2020-11-05scd: Use lock_slot for apdu_send_direct.NIIBE Yutaka1-1/+1
* scd/apdu.c (apdu_send_direct): Use lock_slot. -- With trylock_slot, it may return SW_HOST_BUSY. This may occur when apdu_get_status is called by scd_update_reader_status_file. Simply using lock_slot is much easier for user of apdu_send_direct. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-05scd: Internal CCID driver: Fix a race condition on close.NIIBE Yutaka1-12/+25
* scd/ccid-driver.c (ccid_require_get_status): For VENDOR_SCM reader, return 0 only at the initial call. (bulk_in): Don't detect an error for VENDOR_SCM reader, just kicking the loop, to invoke scd_update_reader_status_file, which calls ccid_slot_status again. (ccid_slot_status): Move the call of ccid_vendor_specific_setup to... (ccid_get_atr): ... here. -- For readers with interrupt transfer support, it is only intr_cb which sets handle->powered_off to 1. Keeping this condition makes no race. The function ccid_slot_status can also detect a communication error, which causes apdu_close_reader (but not setting ->powered_off). GnuPG-bug-id: 5121 Fixes-commit: 920f258eb6018ecec1d63bad6a0fb0772f72affa Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-04speedo,w32: Install gpg-check-pattern and example profiles.Werner Koch5-3/+40
* doc/examples/vsnfd.prf: Rename to VS-NfD.prf. * doc/examples/Automatic.prf: New. * doc/Makefile.am (examples): Adjust. * build-aux/speedo/w32/inst.nsi: Install gpg-check-pattern.exe and 3 example files. * build-aux/speedo/w32/wixlib.wxs: Add new files. -- Note that we renamed the existing example profile so that kleopatra shows a nicer name. In fact the gpg4win installer just copies of theses file but it is better to maintain them here. gpg-check-pattern.exe can no be installed because we meanwhile have a regex lib which works also on Windows. Signed-off-by: Werner Koch <wk@gnupg.org>
2020-11-04g13: Include a now missing header file.Werner Koch1-0/+1
* g13/create.c: Include sysutuls.h -- This is needed due to the recent switch from stat to gnupg_stat. Signed-off-by: Werner Koch <wk@gnupg.org>
2020-11-04gpgconf: Make sure the homedir exists for --apply-profile.Werner Koch1-0/+4
* tools/gpgconf.c (main) <aApplyDefaults, aApplyProfile>: Create the standard home directory. -- This fixes a regression due to the fix for GnuPG-bug-id: 4867 Before that change gpgsm implictly created the homedir while options were collected. It is important to have this so that a login script can create config files for new users. Signed-off-by: Werner Koch <wk@gnupg.org>
2020-11-04common: Fix duplicate implementation of try_make_homedir.Werner Koch5-48/+42
* 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 <wk@gnupg.org>
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. (cherry picked from commit b4cb91d5fbe2b8917d76d12eb72aaac0d97ed596)
2020-11-04w32: Add windows subsystem variant of gpgconfAndre Heinecke2-0/+9
* tools/Makefile.am (gpgconf-w32): New target. Builds gpgconf with subsystem windows. * build-aux/speedo/w32/wixlib.wxs: Package it. -- This allows us to create scripts that call gpgconf without opening a console. Using subsystem windows is better then to just close the console after start as it avoids the console flashing up. (cherry picked from commit c366e04958481382c3f7b50f169120053186069b)
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 <wk@gnupg.org>
2020-11-03gpg: Switch to AES256 for symmetric encryption in de-vs mode.Werner Koch2-4/+31
* g10/gpg.c (set_compliance_option): For AES256 and SHA256 in de-vs mode. * g10/encrypt.c (setup_symkey): Add extra compliance check. (encrypt_simple): Avoid printing a second error oncplinace failure. -- Because we used the RFC4880 mode as base for the de-vs mode we got 3DES as symmetric encryption algorithm. With the default gnupg mode that was already used. The new extra compliance checks are added to detect whether a --personal-cipher-preference or --cipher-algo option tried to override the algorithms. They are still possible but now non-compliant algorithms will throw an error. Manual testing can be done with commands like this: gpg --no-options --compliance=de-vs \ --personal-cipher-preferences "S1 S7" \ --pinentry-mode loopback -v --passphrase abc -ac </etc/motd Here the command fails due to IDEA (S1) being the preferred cipher algorithm. Using "--s2k-digest-algo SHA1" instead of --personal-cipher-preferences will also fail. Signed-off-by: Werner Koch <wk@gnupg.org>
2020-11-02gpg: Allow setting notations with the empty string as value.Werner Koch2-0/+10
* g10/misc.c (pct_expando): Catch special case of the empty string. Also map a NULL to the empty string. * g10/photoid.c (show_photos): Make an empty string used as command fail. -- This patch also fixes a segv when calling gpg wrongly like gpg -N \-foo@example.org GnuPG-bug-id: 5117 Signed-off-by: Werner Koch <wk@gnupg.org>
2020-11-02build: Remove m4 macro defs which are not anymore used.Werner Koch2-166/+0
* configure.ac (GNUPG_FUNC_MKDIR_TAKES_ONE_ARG): Do not use. * acinclude.m4 (GNUPG_FUNC_MKDIR_TAKES_ONE_ARG): Remove unused macro defs. (GNUPG_CHECK_FAQPROG): Ditto. (GNUPG_CHECK_DOCBOOK_TO_TEXI): Ditto. (GNUPG_CHECK_MLOCK): Ditto. Signed-off-by: Werner Koch <wk@gnupg.org>
2020-11-02gpg: Do not use weak digest algos if selected by recipient prefs.Werner Koch4-19/+31
* g10/misc.c (is_weak_digest): New. (print_digest_algo_note): Use it here. * g10/sig-check.c (check_signature_end_simple): Use it. * g10/sign.c (hash_for): Do not use recipient_digest_algo if it is in the least of weak digest algorithm. -- If a message is signed and encrypted to several recipients, the to be used digest algorithm is deduced from the preferences of the recipient. This is so that all recipients are able to check the the signature. However, if the sender has a declared an algorithm as week, that algorithm shall not be used - in this case we fallback to the standard way of selecting an algorithm. Note that a smarter way of selecting the algo is to check this while figuring out the algorithm - this needs more testing and thus we do it the simple way. Reported-by: Phil Pennock Signed-off-by: Werner Koch <wk@gnupg.org>
2020-11-02gpg: Fix iteration over signaturesIngo Klöcker1-1/+1
* g10/keyedit.c (keyedit_quick_revsig): Take signature of correct node -- GnuPG-bug-id: 5093
2020-11-02kbx: Don't put zero-byte for ECC.NIIBE Yutaka1-17/+18
* kbx/keybox-openpgp.c (parse_key): Only put zero for non-ECC. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-02gpg: Fix debug output for key_check_all_keysigs with opaque MPI.NIIBE Yutaka1-3/+13
* g10/key-check.c (key_check_all_keysigs): Handle opaque MPI. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-02gpg: Fix check_signature2 for opaque MPI.NIIBE Yutaka1-2/+21
* g10/sig-check.c (check_signature2): Handle the case of opaque MPI. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-02gpg: Change the API for checksum to use const qualifier.NIIBE Yutaka2-2/+2
* g10/main.h (checksum): Use const. * g10/misc.c (checksum): Use const. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-02gpg: Fix counting buffer size in check_signature2.NIIBE Yutaka1-1/+1
* g10/sig-check.c (check_signature2): Use GCRYMPI_FMT_PGP. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-10-30gpg: Fix SOS handling with libgcrypt version <= 1.8.NIIBE Yutaka1-0/+19
* g10/misc.c (checksum_mpi): Don't depend new feature of gcry_mpi_print which supports opaque MPI. -- GnuPG-bug-id: 5116 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-10-30gpg: Fix first zero-byte case for SOS handling.NIIBE Yutaka2-2/+2
* g10/export.c (transfer_format_to_openpgp): Check the first byte. * g10/pkglue.c (sexp_extract_param_sos): Likewise. -- GnuPG-bug-id: 5116 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-10-28gpg: New command --quick-revoke-sigWerner Koch7-9/+288
* g10/gpg.c (enum cmd_and_opt_values): Add aQuickRevSig. (opts): Add --quick-revoke-sig. (main): Implement. * g10/keyedit.c (quick_find_keyblock): Add arg 'want_secret' and adjust all callers. (keyedit_quick_revsig): new. * g10/revoke.c (get_default_sig_revocation_reason): New. * g10/keylist.c (cmp_signodes): Make global. -- GnuPG-bug-id: 5093
2020-10-27gpg: Sort the signatures in standard key listings.Werner Koch7-142/+247
* g10/gpg.c (parse_list_options): Add "sort-sigs". (main): Make it the default. * g10/options.h (LIST_SORT_SIGS): New. * g10/keylist.c (cmp_signodes): New. (list_keyblock_print): Sort signatures and factor signature printing code out to ... (list_signature_print): new. -- In particular together with --full-timestamps this makes it easier to see the history of key signatures and their revocations. The self-signatures are also printed first. To disable this --list-options no-sort-sigs can be used. Also don't print the annoying "no recocation reason specified" message. Signed-off-by: Werner Koch <wk@gnupg.org>
2020-10-27scd: Handle canonical serialno and app specific serialno differently.NIIBE Yutaka3-8/+9
* scd/app-common.h (card_get_serialno): Add IS_CANONICAL arg. * scd/app.c (app_send_devinfo): Use app specific serialno. (card_get_serialno): Support two different cases. (app_get_serialno): Return app specific serialno. (send_serialno_and_app_status): Return canonical serialno. * scd/command.c (cmd_serialno): Return app specific serialno. (cmd_learn): Return canonical serialno. -- GnuPG-bug-id: 5100 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-10-26g10: Make call to agent_scd_serialno more robust.Werner Koch2-5/+6
* g10/call-agent.c (agent_scd_serialno): Make sure that NULL is stored on error at r_serialno. * g10/card-util.c (card_status): Simplify freeing of seriaono. (factory_reset): Ditto. -- This pattern is what we use with other functions returning an allocated string and thus less surprising.
2020-10-26g10,sm: Use gnupg_access at two more placesWerner Koch2-2/+2
--
2020-10-26scd: Flush the cache when writing cert data object.NIIBE Yutaka1-0/+1
* scd/app-piv.c (do_writecert): Flush the cache of the data object. -- Suggested-by: Ingo Klöcker GnuPG-bug-id: 5102 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-10-26gpg: Fix double free on error.NIIBE Yutaka1-1/+2
* g10/card-util.c (card_status): Check an error return. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-10-26gpg,tools: Fix detecting OpenPGP card by serialno.NIIBE Yutaka2-7/+6
* tools/gpg-card.c (list_openpgp): Use ->apptype to determine card's APP. * g10/card-util.c (get_info_for_key_operation): Likewise. (current_card_status): Even if its SERIALNO is not like OpenPGP card, it's OpenPGP card when app says so. -- GnuPG-bug-id: 5100 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-10-26scd: Internal CCID driver thing only for SPR532.NIIBE Yutaka1-6/+14
* scd/ccid-driver.c (ccid_vendor_specific_setup): New. Limit only for SPR532, excluding other readers by SCM. (ccid_slot_status): Use ccid_vendor_specific_setup. -- We follow the setup procedure of libccid implementation, which sends the escape command for SPR532 only. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-10-24scd: Internal CCID driver limiting only for SPR532.NIIBE Yutaka1-1/+1
* scd/ccid-driver.c (ccid_vendor_specific_init): Only do that for SPR532. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-10-23common: Allow building with released libgpg-error.Werner Koch3-8/+12
* common/sysutils.c (gnupg_access) [W32]: Fix for older libgpgrt. -- Fixes-commit: c94ee1386e0d5cdac51086c4d5b92de59c09c9b5 Signed-off-by: Werner Koch <wk@gnupg.org>
2020-10-23scd: Handle Yubikey's multiple apps and serialno.NIIBE Yutaka3-7/+72
* scd/app-common.h (yubikey_get_serialno): New. * scd/app-openpgp.c (yubikey_get_serialno): New. * scd/app.c (card_get_serialno): Use OpenPGP app's serialno, when it's enabled for Yubikey. (send_serialno_and_app_status): Use card_get_serialno, not directly accessing ->serialno. -- GnuPG-bug-id: 5100 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-10-23scd: Use app_get_serialno for app_getattr.NIIBE Yutaka1-1/+1
* scd/app.c (app_getattr): Use app_get_serialno. -- GnuPG-bug-id: 5100 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-10-23scd: Don't overwrite serialno for Yubikey.NIIBE Yutaka1-3/+10
* scd/app-openpgp.c (app_select_openpgp): Keep ->serialno. -- GnuPG-bug-id: 5100 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-10-23scd,openpgp: Use app_get_serialno function to get SERIALNO.NIIBE Yutaka1-16/+17
* scd/app-openpgp.c (check_keyidstr): Don't directly access app->serialno, but use app_get_serialno. (do_with_keygrip): Likewise. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-10-21common: New functions gnupg_opendir et al.Werner Koch9-43/+217
* 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
2020-10-21w32: 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
2020-10-20Replace all calls to stat by gnupg_stat.Werner Koch22-33/+82
* 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 <wk@gnupg.org>
2020-10-20Replace most calls to open by a new wrapper.Werner Koch8-26/+79
* 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
2020-10-20w32: 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 <wk@gnupg.org>
2020-10-20Replace most of the remaining stdio calls by estream calls.Werner Koch23-216/+220
-- 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 <wk@gnupg.org>
2020-10-20Replace all calls to access by gnupg_accessWerner Koch28-128/+151
* 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
2020-10-09gpg,ecc: Fix SOS handling when receiving from agent.NIIBE Yutaka1-1/+16
* g10/export.c (transfer_format_to_openpgp): It's not simple opaque MPI, but SOS. -- Fixes-commit: f5bc94555458123f93d8b07816a68fb7485421e1 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-10-09agent: Fix SEGV when debuging for cache enabled.NIIBE Yutaka1-1/+1
* agent/cache.c (agent_get_cache): Avoid dereferencing NULL. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-10-07doc: Add notes on how to setup LDAPWerner Koch4-0/+684
--
2020-10-05gpgsm: Fix detection of too old keyboxd.Werner Koch1-3/+4
* sm/keydb.c (warn_version_mismatch): Add arg ctrl and pass on. (create_new_context): Pass ctrl to warn function.
2020-10-05dirmngr: Minor cleanup for better readability.Werner Koch3-29/+29
* dirmngr/ldap.c (start_default_fetch_ldap): Rename to start_cacert_fetch_ldap and remove arg attr. Instead use "cACertificate" directly. * dirmngr/crlfetch.c (ca_cert_fetch): Change the only caller. (start_cert_fetch_ldap): Rename arg for clarity. Signed-off-by: Werner Koch <wk@gnupg.org>
2020-10-05dirmngr: Add warning on the use of --add-servers.Werner Koch3-13/+23
* tools/gpgconf-comp.c (known_options_dirmngr): Degrade add-servers to expert mode.
2020-10-05gpg: Switch to ed25519+cv25519 as default algo.Werner Koch1-28/+29
* g10/keygen.c (DEFAULT_STD_KEY_PARAM): Change to former future default ago. (ask_algo): Change default and also the way we indicate the default algo in the list of algos. (ask_curve): Indicate the default curve. Signed-off-by: Werner Koch <wk@gnupg.org>