aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gpg: Return an error from hexfingerprint on malloc error.Werner Koch2017-12-135-33/+92
| | | | | | | * g10/keyid.c (hexfingerprint): Return NULL on malloc failure. Chnage all callers. Signed-off-by: Werner Koch <[email protected]>
* gpg: Remove some xmallocs.Werner Koch2017-12-131-7/+26
| | | | | | | | | | * g10/getkey.c (get_pubkeys): Do not use xmalloc. -- We eventually need to get rid of all xmallocs so that gpg won't fail easily when we make more use of the s server mode. Signed-off-by: Werner Koch <[email protected]>
* indent: Re-indent get_pubkeys.Werner Koch2017-12-131-59/+48
| | | | --
* gpg: default-preference-list: prefer SHA512.Daniel Kahn Gillmor2017-12-121-10/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/keygen.c (keygen_set_std_prefs): when producing default internal personal-digest-preferences, keep the same order. When publishing external preferences, state preference for SHA512 first. -- SHA-512 has a wider security margin than SHA-256. It is also slightly faster on most of the architectures on which GnuPG runs today. New keys should publish defaults that indicate we prefer the stronger, more performant digest. Specifically, this changes --default-preference-list from: SHA256 SHA384 SHA512 SHA224 to: SHA512 SHA384 SHA256 SHA224 This patch deliberately avoids touching --personal-digest-preferences (which itself would affect the default of --digest-algo and --cert-digest-algo), so that public-facing cleartext signatures and identity certifications will continue to be made with SHA256 by default. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* Change backlog from 5 to 64 and provide option --listen-backlog.Werner Koch2017-12-126-7/+53
| | | | | | | | | | | | | | * agent/gpg-agent.c (oListenBacklog): New const. (opts): New option --listen-backlog. (listen_backlog): New var. (main): Parse new options. (create_server_socket): Use var instead of 5. * dirmngr/dirmngr.c: Likewise. * scd/scdaemon.c: Likewise. -- GnuPG-bug-id: 3473 Signed-off-by: Werner Koch <[email protected]>
* build: New configure option --enable-run-gnupg-user-socket.Werner Koch2017-12-122-2/+28
| | | | | | | | | | | | | * configure.ac: (USE_RUN_GNUPG_USER_SOCKET): New ac_define. * common/homedir.c (_gnupg_socketdir_internal): Add extra directories. -- This allows to build GnuPG with an extra socketdir below /run. See https://lists.gnupg.org/pipermail/gnupg-devel/2017-November/033250.html for a longer explanation why this is sometimes useful. Suggested-by: Rainer Perske Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Check for WKD support at session endWerner Koch2017-12-114-27/+63
| | | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/domaininfo.c (insert_or_update): Copy the name. * dirmngr/misc.c (copy_stream): Allow arg OUT to be NULL. * dirmngr/server.c (set_error): Protect CTX. (dirmngr_status): Protect against missing ASSUAN_CTX. (dirmngr_status_help): Ditto. (dirmngr_status_printf): Ditto. (cmd_wkd_get): Factor code out to ... (proc_wkd_get): new func. Support silent operation with no CTX. (task_check_wkd_support): New. -- This finalizes the feature to efficiently cache WKD checks. If a standard WKD query returns no data, we queue a test to be run after the end of the session (so that we do not delay the calling client). This check tests whether the server responsible for the queried address has WKD at all enabled. The test is done by checking whether the "policy" file exists. We do not check the "submission-address" file because that is not necessary for the web key operation. The policy file is now required. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit d4e2302d8f4a1ff52d56da4f8e3a5d1c6303822d)
* dirmngr: Add a background task framework.Werner Koch2017-12-115-12/+305
| | | | | | | | | | | | | | | | | | | | | | * dirmngr/workqueue.c: New. * dirmngr/Makefile.am (dirmngr_SOURCES): Add new file. * dirmngr/server.c (server_local_s): New field session_id. (cmd_wkd_get): Add a task. (task_check_wkd_support): New stub function. (cmd_getinfo): New sub-commands "session_id" and "workqueue". (start_command_handler): Add arg session_id and store it in SERVER_LOCAL. (dirmngr_status_helpf): New. * dirmngr/dirmngr.h (wqtask_t): New type. * dirmngr/dirmngr.c (main): Pass 0 as session_id to start_command_handler. (start_connection_thread): Introduce a session_id and pass it to start_command_handler. Run post session tasks. (housekeeping_thread): Run global workqueue tasks. -- Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 96a4fbecd1acf946dcde20bef4752c539dae196b)
* dirmngr: Limit the number of cached domains for WKD.Werner Koch2017-12-111-8/+54
| | | | | | | | | * dirmngr/domaininfo.c (MAX_DOMAINBUCKET_LEN): New. (insert_or_update): Limit the length of a bucket chain. (domaininfo_print_stats): Print just one summary line. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 26f08343fbccdbaa177c3507a3c5e24a5cf94a2d)
* dirmngr: Keep track of domains used for WKD queriesWerner Koch2017-12-115-0/+302
| | | | | | | | | | | | | | | | * dirmngr/domaininfo.c: New file. * dirmngr/Makefile.am (dirmngr_SOURCES): Add file. * dirmngr/server.c (cmd_wkd_get): Check whether the domain is already known and tell domaininfo about the results. -- This adds a registry for domain information to eventually avoid useless queries for domains which do not support WKD. The missing part is a background task to check whether a queried domain supports WKD at all and to expire old entries. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 65038e6852185c20413d8f6602218ee636413b77)
* doc: Typo fixWerner Koch2017-12-111-1/+1
| | | | --
* Revert: build: Do not define logging.h constants for ...Werner Koch2017-12-081-17/+9
| | | | | | | | | | --- This reverts commit 2fedf8583bcc493f587c90bc9632d25dfd10bd10. We better solve this on the libgpg-error side. Signed-off-by: Werner Koch <[email protected]>
* doc: Fix DijkstraWerner Koch2017-12-082-2/+3
| | | | | | | -- Edsger Wybe Dijkstra (1930 --2002) - Dutch computer scientist
* agent: Fix description of shadow format.NIIBE Yutaka2017-12-083-3/+3
| | | | | | | | | | * agent/keyformat.txt, agent/protect.c, agent/t-protect.c: Fix. -- https://lists.gnupg.org/pipermail/gnupg-devel/2015-April/029680.html Signed-off-by: NIIBE Yutaka <[email protected]>
* speedo,w32: Disable FLTK pinentry.Werner Koch2017-12-071-1/+4
| | | | --
* build: Do not define logging.h constants for libgpg-error dev versions.Werner Koch2017-12-071-9/+17
| | | | | | | | | | | | | | | | | * common/logging.h [GPGRT_LOG_WITH_PREFIX]: Do not define the log constants. -- logging.h uses constants we plan to use for future versions of libgpg-error. My dev version already has the logging functions and thus I run into a conflict. This patch protects against this and make the GnuPG work with later libgpg-error versions. It was not the best idea to use constants from a planned libgpg-error in the first place. The actual problem are the enums, the macros won't harm. Signed-off-by: Werner Koch <[email protected]>
* agent: Change intialization of assuan socket system hooks.NIIBE Yutaka2017-12-071-1/+2
| | | | | | | | | | | | | | | | * agent/gpg-agent.c (initialize_modules): Add hook again. (main): Remove setting of the system houk but add scoket system hook setting after assuan initialization. -- Thread initialization is better to be deferred after fork (in case of UNIX). assuan_sock_init should be earlier. Thus, we need to change system hooks for assuan_sock_* interface. Or else, on Windows, it may cause hang on server. Updates-commit: 1524ba9656f0205d8c6ef504f773b832a7a12ab9 GnuPG-bug-id: 3378 Signed-off-by: Werner Koch <[email protected]>
* agent: Set assuan system hooks before call of assuan_sock_init.NIIBE Yutaka2017-12-061-1/+1
| | | | | | | | | | | | | | | * agent/gpg-agent.c (initialize_modules): Move assuan_set_system_hooks. (main): ... here, just before assuan_sock_init. -- In Assuan, global variable SOCK_CTX is used internally, which is initialized by assuan_sock_init. When initialized, system hooks are copied into SOCK_CTX structure. Thus, system hooks should be set, before the call of assuan_sock_init. GnuPG-bug-id: 3378 Signed-off-by: NIIBE Yutaka <[email protected]>
* g10: Fix regexp sanitization.NIIBE Yutaka2017-12-041-1/+5
| | | | | | | | | | | | | | | | | | | | | | * g10/trustdb.c (sanitize_regexp): Only escape operators. -- Backport from master commit: ccf3ba92087e79abdeaa0208795829b431c6f201 To sanitize a regular expression, quoting by backslash should be only done for defined characters. POSIX defines 12 characters including dot and backslash. Quoting other characters is wrong, in two ways; It may build an operator like: \b, \s, \w when using GNU library. Case ignored match doesn't work, because quoting lower letter means literally and no much to upper letter. GnuPG-bug-id: 2923 Co-authored-by: Damien Goutte-Gattat <[email protected]> Signed-off-by: NIIBE Yutaka <[email protected]>
* doc: clarify that --encrypt refers to public key encryptionDaniel Kahn Gillmor2017-11-301-5/+7
| | | | | | | | | | | -- A simple read of gpg(1) is ambiguous about whether --encrypt could be for either symmetric or pubkey encryption. Closer inference suggests that --encrypt is about pubkey encryption only. Make that clearer on a first read. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* gpg: Do not read from uninitialized memory with --list-packets.Werner Koch2017-11-261-0/+6
| | | | | | | | | | | | | | | | | | * g10/parse-packet.c (parse_plaintext): Fill up the allocated NAME. -- This actually does not harm because we merely display a buffer allocated by ourselves. However, we better tell Valgrind about it so that we don't need to track this thing down ever again. Test using a corrupted literal data packet: echo cb 0a 75 ff 59 ae 90 d5 74 65 73 74 | \ undump |\ valgrind gpg --list-packets >/dev/null Reported-by: Sebastian Schinzel Signed-off-by: Werner Koch <[email protected]>
* agent: New option --auto-expand-secmem.Werner Koch2017-11-242-0/+22
| | | | | | | | | | | | * agent/gpg-agent.c (oAutoExpandSecmem): New enum value. (opts): New option --auto-expand-secmem. (main): Implement that option. -- Note that this option has an effect only if Libgcrypt >= 1.8.2 is used. GnuPG-bug-id: 3530
* build: Update distsigkey.gpgWerner Koch2017-11-221-0/+0
| | | | --
* gpg: Fix memory leaking for long inputs via --command-fd.Werner Koch2017-11-221-1/+7
| | | | | | | | | | | * g10/cpr.c (do_get_from_fd): Free the old buffer. -- If the received input is longer than 200 characters we used to leak the previous allocated buffer. GnuPG-bug-id: 3528 Signed-off-by: Werner Koch <[email protected]>
* scd: Enable card removal check after select_application.NIIBE Yutaka2017-11-214-12/+18
| | | | | | | | | | | | | | | | | | | | | | * scd/apdu.c (open_ccid_reader): Fix error handling of ccid_get_atr. * scd/app.c (select_application): Always kick the loop if new APP. * scd/ccid-driver.c (ccid_open_usb_reader): Don't setup at open. (ccid_slot_status): Setup interrupt transfer when !ON_WIRE. -- We can use the interrupt transfer to be notified about card status change. In this case, we don't need to issue PC_to_RDR_GetSlotStatus command. This change improve the setup the notification; it should be done after registration of APP. When the setup is done just after opening the USB connection (before issuing PC_to_RDR_IccPowerOn), a reader might notifies about no card availability (because of not yet powered on), even though the card is ready to be powered on. GnuPG-bug-id: 3508 Signed-off-by: NIIBE Yutaka <[email protected]>
* Post release updatesWerner Koch2017-11-202-1/+5
| | | | --
* Release 2.2.3gnupg-2.2.3Werner Koch2017-11-202-9/+26
|
* build: Use -Werror only for the check.Werner Koch2017-11-201-1/+1
| | | | | | | | | | | | * configure.ac: Do not add -Werror to mycflags. -- On Windows and possible also on other platforms we expect to a get a few errors or warnins. Thus we can't use -Werror by default. This is why we have a separate configure options --enable-werror ;-). Fixes-commit: 3ecd1a41be7c880976987d13e88342c98f37e064 Signed-off-by: Werner Koch <[email protected]>
* gpg-agent: Avoid getting stuck in shutdown pending state.Werner Koch2017-11-201-15/+22
| | | | | | | | | | | | | | | | | | | | | | | | * agent/gpg-agent.c (handle_connections): Always check inotify fds. -- I noticed a gpg-agent processed, probably in shutdown_pending state, which was selecting on only these two inotify fds. The select returned immediately but because we did not handle the fds in shutdown_pending state they were not read and the next select call returned one of them immediately again. Actually that should not hanppen because the if (active_connections == 0) break; /* ready */ should have terminated the loop. For unknown reasons (maybe be just a connection thread terminated in a gdb session) that did not happen. By moving the check outside of the shutdown_pending condition and closing the fd after they have been triggered the code should be more robust. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 5d83eb9226c0ce608ec284d8c9bc22ce84a00c25)
* agent: Use clock or clock_gettime for calibration.NIIBE Yutaka2017-11-202-6/+10
| | | | | | | | | | | | | | | | | | * agent/protect.c (calibrate_get_time): Use clock or clock_gettime. -- For calibration, clock(3) is better than times(3) among UNIXen. Tested on NetBSD 7.1 and FreeBSD 11.1, using QEMU. Thanks to Damien Goutte-Gattat for the information of use of CLOCKS_PER_SEC; The old code with times(3) is not 100% correct, in terms of POSIX. It should have used sysconf (_SC_CLK_TCK) instead of CLOCKS_PER_SEC. CLOCKS_PER_SEC is specifically for clock(3). GnuPG-bug-id: 3056, 3276, 3472 Signed-off-by: NIIBE Yutaka <[email protected]> (cherry picked from commit 380bce13d94ff03c96e39ac1d834f382c5c730a1)
* build: Check -Wlogical-op flag availability with -Werror.NIIBE Yutaka2017-11-201-3/+11
| | | | | | | | | | * configure.ac: Use -Werror. -- Using clang, -Wlogical-op doesn't fail but generates warning. Signed-off-by: NIIBE Yutaka <[email protected]>
* build: BSD make support for yat2m.NIIBE Yutaka2017-11-202-3/+12
| | | | | | | | | | | | * configure.ac (YAT2M): Only define when found. * doc/Makefile.am: Portability fix. -- This is not intended to apply to master, but 2.2 branch only. When new libgpg-error is required, installation of yat2m can be assumed. Signed-off-by: NIIBE Yutaka <[email protected]>
* dirmngr: Fix double free of a hash context in the error case.Werner Koch2017-11-171-6/+6
| | | | | | | | | | | | * dirmngr/crlcache.c: Clearly document that this fucntions takes ownership of MD. (abort_sig_check): Allow NULL for MD. (crl_parse_insert): Immediately set MD to NULL. Remove check for md before a calling abort_sig_check. -- GnuPG-bug-id: 3510 Signed-off-by: Werner Koch <[email protected]>
* w32: Fix default registry pathAndre Heinecke2017-11-151-1/+1
| | | | | | | | | | | | | * configure.ac (GNUPG_REGISTRY_DIR): Remove leading backslash. -- Windows does not like the leading backslash and won't read the key. Problem reported in the Gpg4win Message boards. This bug was introduced by rev. 75ba215e Signed-off-by: Andre Heinecke <[email protected]>
* doc: Add man page for gpgtarWerner Koch2017-11-152-38/+102
| | | | | | | | | -- This also removes the documentation for gpg-zip which is not distributed anymore. Signed-off-by: Werner Koch <[email protected]>
* gpgtar: Prefer --set-filename over implicit nameAndre Heinecke2017-11-151-6/+6
| | | | | | | | | | | | | * tools/gpgtar-extract.c: Prefer opt.filename over filename for the directory prefix. -- If you would extract from stdin (filename -) and use set-filename to provide a real filename the "-" would be used for the directory name. With this change an explicit filename is prefered. GnuPG-Bug-Id: T3500 Signed-off-by: Andre Heinecke <[email protected]>
* doc: fix NEWSIG documentationWill Thompson2017-11-151-3/+2
| | | | | | | | | -- 08c82b1 introduced one optional argument for this status message. Due to an apparent editing error, the sentence fragment "arguments are currently defined." was left in the documentation. Signed-off-by: Will Thompson <[email protected]>
* doc: expand documentation of PROGRESS messageWill Thompson2017-11-151-4/+7
| | | | | | | | -- This answers two questions that I was only able to answer by examining each site where PROGRESS messages are emitted, and fixes a typo. Signed-off-by: Will Thompson <[email protected]>
* gpg: Print AKL info only in verbose mode.Werner Koch2017-11-151-2/+3
| | | | | | | | * g10/getkey.c (get_pubkey_byname): Print info only in verbose mode. -- GnuPG-bug-id: 3504 Signed-off-by: Werner Koch <[email protected]>
* sm, w32: Fix initial keybox creationAndre Heinecke2017-11-141-1/+1
| | | | | | | | | | * sm/keydb.c (maybe_create_keybox): Open new keybox in bin mode. -- As the header contains a timestamp we will have the conversion problems if the keybox is not opened in binary mode. Signed-off-by: Andre Heinecke <[email protected]>
* po/da: Fix Danish confusion between "compressed" and "compromised"Daniel Kahn Gillmor2017-11-111-1/+1
| | | | | | | | | | | | | -- In https://bugs.debian.org/881393 , Jonas Smedegaard reports: > In option number 1, the word "komprimeret" means "compressed". > > I am pretty sure it should say "kompromitteret" instead, which means > "compromised". Debian-Bug-Id: 881393 Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* Post release updates.Werner Koch2017-11-072-1/+5
| | | | --
* Release 2.2.2gnupg-2.2.2Werner Koch2017-11-073-174/+47
| | | | Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Reduce default LDAP timeout to 15 seconds.Werner Koch2017-11-073-3/+3
| | | | | | | | | * dirmngr/dirmngr.c (DEFAULT_LDAP_TIMEOUT): Change to 15. * dirmngr/dirmngr_ldap.c (DEFAULT_LDAP_TIMEOUT): Ditto. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit ab7ac827041b5cd97bbca7a75b0930072dd6611f) GnuPG-bug-id: 3487
* speedo: Include software versions in the W32 READMEWerner Koch2017-11-073-39/+295
| | | | | Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit f9f72ffbfa9fd7d1a7a1823697d116d76155b407)
* po: Update Russian translationIneiev2017-11-071-11/+11
|
* po: Update Japanese translationNIIBE Yutaka2017-11-071-5/+3
|
* agent: New GETINFO sub-commands "s2k_count_cal" and "s2k_time".Werner Koch2017-11-064-24/+69
| | | | | | | | | | * agent/command.c (cmd_getinfo): New sub-commands. * agent/protect.c (get_standard_s2k_count): Factor some code out to ... (get_calibrated_s2k_count): new. (get_standard_s2k_time): New. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 52d41c8b0f4af6278d18d8935399ddad16a26856)
* agent: New option --s2k-count.Werner Koch2017-11-064-0/+30
| | | | | | | | | | | | | | | * agent/agent.h (opt): New field 's2k_count'. * agent/gpg-agent.c (oS2KCount): New enum value. (opts): New option --s2k-count. (parse_rereadable_options): Set opt.s2k_count. -- This option is useful to speed up the starting of gpg-agent and in cases where the auto-calibration runs into problems due to a broken time measurement facility. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit f7212f1d11aad5d910d2c77b2e5c6ab31a0e786e)
* g10: Unattended key generation "Key-Grip" and "Subkey-Grip".NIIBE Yutaka2017-11-061-9/+16
| | | | | | | | | | | | | | | * g10/keygen.c (pSUBKEYGRIP): New. (read_parameter_file): Add "Key-Grip" and "Subkey-Grip". (do_generate_keypair): Support pSUBKEYGRIP. -- In the manual, it says "Key-Grip". gpgsm also supports "Key-Grip". Adding "Subkey-Grip" now, adding "Key-Grip" makes sense. GnuPG-bug-id: 3478 Signed-off-by: NIIBE Yutaka <[email protected]> (cherry picked from commit 6c63a04569c07c9c2817c7c530a92ccfa58155cc)