aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gpgscm: Make it impossible to catch '*interpreter-exit*'.Justus Winter2017-07-131-2/+2
| | | | | | | | * tests/gpgscm/init.scm (throw'): Make it impossible to catch '*interpreter-exit*'. This fixes 'exit' (and with it 'fail') inside 'catch' statements. Signed-off-by: Justus Winter <[email protected]>
* dirmngr: Fix license note in server.cWerner Koch2017-07-121-15/+0
| | | | | | | | | | -- This double license note was accidentally added while only wanting to add another copyright line. Fixes-commit: 3419a339d9c4e800bf30e9021e05982d8c1021c1 Signed-off-by: Werner Koch <[email protected]>
* tofu: Compare squares instead of square roots.Marcus Brinkmann2017-07-104-269/+9
| | | | | | | | | | | | | * g10/Makefile.am (tofu_source) [USE_TOFU]: Remove sqrtu32.h and sqrtu32.c. * g10/sqrtu32.h, g10/sqrtu32.c: Removed files. * g10/tofu.c: Compare squares instead of square roots. -- The original code is a factor 11.5 slower than using libm's sqrt(), which in turn is a factor 3.5 slower than using one multiplication on the other side of the comparison. Also, it's much simpler now. Signed-off-by: Marcus Brinkmann <[email protected]>
* speedo: Provide a vagrantfile to test speedo in an isolated VM.Marcus Brinkmann2017-07-101-0/+36
| | | | | | * build-aux/Vagrantfile: New file. Signed-off-by: Marcus Brinkmann <[email protected]>
* doc: Improve TOFU documentation.Neal H. Walfield2017-07-061-4/+8
| | | | | | | * doc/gpg.texi: Improve TOFU documentation. Signed-off-by: Neal H. Walfield <[email protected]> Suggested-by: Teemu Likonen <[email protected]>
* doc: Fix typo.Justus Winter2017-07-061-1/+1
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* doc: minor clarificationDaniel Shahaf2017-07-051-1/+1
| | | | | --- Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* agent: Use MAX_PASSPHRASE_LEN (255) also for the loopback.Werner Koch2017-07-052-6/+6
| | | | | | | | | | | | | | | * agent/call-pinentry.c (agent_get_passphrase): Reduce maximum passphrase length as conveyed to the loopback to MAX_PASSPHRASE_LEN. * agent/genkey.c (agent_ask_new_passphrase): Extend the maximum passphrase as conveyed to the loopback to MAX_PASSPHRASE_LEN. -- Note that in genkey() max_length is set to MAX_PASSPHRASE_LEN + 1 because in agent_askpin() decrements that value before conveying it to the loopback. GnuPG-bug-id: 3254 Signed-off-by: Werner Koch <[email protected]>
* doc: Update yat2m to take care of SOURCE_DATE_EPOCH.Werner Koch2017-07-051-1/+13
| | | | | | * doc/yat2m.c (main): Set a default for OPT_DATE. Signed-off-by: Werner Koch <[email protected]>
* doc: Prefer an installed version of yat2mWerner Koch2017-07-052-2/+4
| | | | | | * configure.ac (YAT2M): Check for tool. * doc/Makefile.am (yat2m-stamp): Use installed tool if possible. --
* doc: Document obsolete option in gpgsm. Closes T2231.Marcus Brinkmann2017-07-011-4/+1
| | | | | | | * doc/gpgsm.texi: Mark --prefer-system-dirmngr as obsolete. Signed-off-by: Marcus Brinkmann <[email protected]> GnuPG-bug-id: 2231
* agent: Fix option --debug-waitWerner Koch2017-06-281-1/+1
| | | | | | | | | * agent/gpg-agent.c (opts): Typo fix. -- Regression-due-to: ccee34736b57a42ec4bdcb0d3181bdc6a08b0fff GnuPG-bug-id: 3225 Signed-off-by: Werner Koch <[email protected]>
* agent: Support unprotected ssh keys.Justus Winter2017-06-261-1/+12
| | | | | | | | * agent/command-ssh.c (ssh_key_to_protected_buffer): If the empty passphrase is supplied, do not protect the key. GnuPG-bug-id: 2856 Signed-off-by: Justus Winter <[email protected]>
* tests: Improve test.Justus Winter2017-06-261-2/+2
| | | | | | * tests/openpgp/ssh-export.scm: Split output at any whitespace. Signed-off-by: Justus Winter <[email protected]>
* agent: Shutdown on removal of the home directory.Werner Koch2017-06-233-16/+86
| | | | | | | | | | | | | | | * common/sysutils.c (gnupg_inotify_watch_delete_self): New. * agent/gpg-agent.c (handle_connections): Rename my_inotify_fd to sock_inotify_fd. (handle_connections): Add home_inotify_fd to watch the home directory. -- GnuPG-bug-id: 3218 Note that we should add this also to dirmngr. And for non-Linux systems a stat in ticker should be implemented. Signed-off-by: Werner Koch <[email protected]>
* build: Add missing LIBASSUAN_CFLAGS to dirmngr/.Werner Koch2017-06-231-3/+5
| | | | | | | | | | * dirmngr/Makefile.am (t_http_CFLAGS): Add LIBASSUAN_CFLAGS. (t_ldap_parse_uri_CFLAGS): Ditto. (t_dns_stuff_CFLAGS): Ditto. -- GnuPG-bug-id: 2424 Signed-off-by: Werner Koch <[email protected]>
* gpg,gpgsm: Emit status code ENCRYPTION_COMPLIANCE_MODE.Werner Koch2017-06-234-5/+44
| | | | | | | | | | | | * common/status.h (STATUS_ENCRYPTION_COMPLIANCE_MODE): New. * g10/encrypt.c (encrypt_crypt): Emit new status code. * sm/encrypt.c (gpgsm_encrypt): Ditto. -- This status code allows to report whether an encryption operation was compliant to de-vs. Signed-off-by: Werner Koch <[email protected]>
* indent,i18n: Make some new strings translatable. Wrap too long lines.Werner Koch2017-06-237-21/+33
| | | | --
* gpg: Close cached keydb handle in gpgv.Justus Winter2017-06-211-0/+1
| | | | | | | * g10/gpgv.c (main): Close cached handle. Fixes-commit: 5556eca5acd46983bff0b38a1ffbc2f07fbaba9f Signed-off-by: Justus Winter <[email protected]>
* tests: Add test for gpgv.Justus Winter2017-06-214-268/+359
| | | | | | | | | | * tests/openpgp/Makefile.am (XTESTS): Add the new test. * tests/openpgp/gpgv.scm: New file. * tests/openpgp/signed-messages.scm: Likewise. * tests/openpgp/verify.scm: Move the signed messages to the new file and load it. Signed-off-by: Justus Winter <[email protected]>
* gpg: Fix printing keyserver URLs and notation data.Justus Winter2017-06-211-2/+2
| | | | | | | | | | | | * g10/keylist.c (show_keyserver_url): Print to 'fp', not to 'stdout'. (show_notation): Likewise. -- Fixes the fact that if mode == -1, all text except for the labels is written to the tty, but the label is written to stdout, which is buffered. Signed-off-by: Justus Winter <[email protected]>
* dirmngr: Properly handle SRV records.Justus Winter2017-06-201-51/+72
| | | | | | | | | | | | | | | | | | | | | | | * dirmngr/ks-engine-hkp.c (enum ks_protocol): New type. (struct hostinfo_s): New flags indicating whether we already did a A lookup, or a SRV lookup per protocol. Turn 'port' into an array. (create_new_hostinfo): Initialize new fields. (add_host): Update the port for the given protocol. (map_host): Simplify hosttable lookup misses. Check the SRV records for both protocols on demand, do the A lookup just once. Return the correct port. -- Previously, if a host had both a SRV record for hkp and hkps, the wrong port was used for the protocol that was used second, because the hostinfo did not store a port per protocol, and the hosttable does not discriminate between hosts using the protocol. Fix this by querying the SRV records on demand, storing a port per protocol, and returning the right port. GnuPG-bug-id: 3033 Signed-off-by: Justus Winter <[email protected]>
* dirmngr: Refactor variable-sized array code.Justus Winter2017-06-201-55/+74
| | | | | | | | | | | | | | | | | | | | | * dirmngr/ks-engine-hkp.c (struct hostinfo_s): Add explicit length and size fields. (MAX_POOL_SIZE): New macro. (create_new_hostinfo): Initialize new fields. (host_in_pool_p): Adapt. (select_random_host): Likewise. (add_host): Likewise. Move the resizing logic here. (hostinfo_sort_pool): New function. (map_host): Simplify. Move the resizing logic away from here. (ks_hkp_mark_host): Adapt. (ks_hkp_print_hosttable): Likewise. -- The current code assumes that the pool array is only filled when the hostinfo object is created. This patch removes that limitation. GnuPG-bug-id: 3033 Signed-off-by: Justus Winter <[email protected]>
* dirmngr: Fix typo.Justus Winter2017-06-201-1/+1
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* gpg: Fix error handling.Justus Winter2017-06-201-0/+2
| | | | | | | | | | | | | | * g10/keygen.c (generate_subkeypair): Handle errors from pinentry. -- Previously, when generating a subkey, gpg would ask for the passphrase of the primary key. If that dialog is canceled, gpg would ask a second time for a passphrase to protect the new subkey. Fix this by handling the error. GnuPG-bug-id: 3212 Signed-off-by: Justus Winter <[email protected]>
* gpg,gpgsm: Fix compliance check for DSA and avoid an assert.Werner Koch2017-06-194-23/+30
| | | | | | | | | | | | | | | | | | | * common/compliance.c (gnupg_pk_is_compliant): Swap P and Q for DSA check. Explicitly check for allowed ECC algos. (gnupg_pk_is_allowed): Swap P and Q for DSA check. * g10/mainproc.c (proc_encrypted): Simplify SYMKEYS check. Replace assert by debug message. -- Note that in mainproc.c SYMKEYS is unsigned and thus a greater than 0 condition is surprising because it leads to the assumption SYMKEYS could be negative. Better use a boolean test. The assert could have lead to a regression for no good reason. Not being compliant is better than breaking existing users. Signed-off-by: Werner Koch <[email protected]>
* indent: Always use "_(" and not "_ (" to mark translatable strings.Werner Koch2017-06-1911-30/+31
| | | | | | | | -- This makes greping much easier and we have done that since ever. Signed-off-by: Werner Koch <[email protected]>
* gpgscm: Limit the number of parallel jobs.Justus Winter2017-06-192-15/+93
| | | | | | | | | | | | | | | | | | | | | | * ffi.c (do_wait_processes): Suppress the timeout error. * tests.scm (semaphore): New definition. (test-pool): Only run a bounded number of tests in parallel. (test::started?): New function. (run-tests-parallel): Do not report results, do not start the tests. (run-tests-sequential): Adapt. (run-tests): Parse the number of parallel jobs. -- This change limits the number of tests that are run in parallel. This way we do not overwhelm the operating systems' scheduler. As a side-effect, we also get more accurate runtime information, and it will be easy to implement timeouts on top of this. Use TESTFLAGS to limit the number of jobs: $ make check-all TESTFLAGS=--parallel=16 Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Improve option parsing.Justus Winter2017-06-191-1/+7
| | | | | | | * tests/gpgscm/tests.scm (flag): Accept arguments of the form '--foo=bar'. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Improve error handling of foreign functions.Justus Winter2017-06-191-2/+1
| | | | | | | * tests/gpgscm/ffi.scm (ffi-fail): Do not needlessly join the error message. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Improve error reporting.Justus Winter2017-06-192-25/+27
| | | | | | | | * tests/gpgscm/init.scm (throw'): Guard against 'args' being atomic. * tests/gpgscm/scheme.c (Eval_Cycle): Remove any superfluous colons in error messages. Signed-off-by: Justus Winter <[email protected]>
* tests: Run the OpenPGP tests using the new extended key format.Justus Winter2017-06-192-6/+18
| | | | | | | | | * tests/openpgp/all-tests.scm: Generalize a bit, and also add a variant that uses the new extended key format. * tests/openpgp/defs.scm (create-gpghome): Conditionally enable the new extended key format. Signed-off-by: Justus Winter <[email protected]>
* Change license of some files to LGPLv2.1.Werner Koch2017-06-1925-128/+1014
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * COPYING.LIB: Rename to COPYING.LGPL3. * COPYING.LGPL21: New. * COPYING.GPL2: New. * Makefile.am: Distribute them. * AUTHORS: Update license pointers. Add BSI as copyright holder. * common/compliance.c, common/compliance.h: Add BSI copyright notice. Break overlong lines. * dirmngr/loadswdb.c: Add BSI copyright notices. * dirmngr/server.c: Ditto. * tools/call-dirmngr.c: Change license to LGPLv2.1. Add BSI copyright notice. * tools/call-dirmngr.h: Ditto. * tools/gpg-wks-client.c: Ditto. * tools/gpg-wks-server.c: Ditto. * tools/gpg-wks.h: Ditto. * tools/mime-maker.c: Ditto. * tools/mime-maker.h: Ditto. * tools/mime-parser.c: Ditto. * tools/mime-parser.h: Ditto. * tools/send-mail.c: Ditto. * tools/send-mail.h: Ditto. * tools/wks-receive.c: Ditto. * tools/wks-util.c: Ditto. * tools/rfc822parse.c, tools/rfc822parse.h: Change license to LGPLv2.1. -- For better deployment it seems to be better to make the Web Key Directory code more easily available. Some code was been developed under contract of the BSI. Signed-off-by: Werner Koch <[email protected]>
* gpg: Disable compliance module for other GnuPG components.Justus Winter2017-06-191-9/+15
| | | | | | | | | | | | | | | | | | | | | * common/compliance.c (gnupg_{pk,cipher,digest}_is_compliant): Return false if the module is not initialized. (gnupg_{pk,cipher,digest}_is_allowed): Return true if the module is not initialized. (gnupg_status_compliance_flag): Do not assert that the module is initialized. (gnupg_parse_compliance_option): Likewise. (gnupg_compliance_option_string): Likewise. -- This implements a default policy for modules not explicitly using the compliance module. The default policy is to allow all algorithms, but mark none of them as compliant. Fixes gpgv. GnuPG-bug-id: 3210 Signed-off-by: Justus Winter <[email protected]>
* gpg: Check and fix keys on import.Justus Winter2017-06-144-2/+15
| | | | | | | | | | | * doc/gpg.texi: Document the new import option. * g10/gpg.c (main): Make the new option default to yes. * g10/import.c (parse_import_options): Parse the new option. (import_one): Act on the new option. * g10/options.h (IMPORT_REPAIR_KEYS): New macro. GnuPG-bug-id: 2236 Signed-off-by: Justus Winter <[email protected]>
* gpg: Refactor key checking and fixing.Justus Winter2017-06-145-614/+693
| | | | | | | | | | | | | | * g10/Makefile.am (gpg_sources): Add new files. * g10/gpgcompose.c (keyedit_print_one_sig): New stub. * g10/keyedit.c (sig_comparison): Move to new module. (check_all_keysigs): Likewise. (fix_keyblock): Adapt callsite. (keyedit_menu): Likewise. * g10/key-check.c: New file. * g10/key-check.h: Likewise. GnuPG-bug-id: 2236 Signed-off-by: Justus Winter <[email protected]>
* gpg: Refactor keyedit module.Justus Winter2017-06-134-39/+70
| | | | | | | | | | | | | * g10/Makefile.am (gpg_SOURCES): Add new file. * g10/keyedit.c (NODFLG_*): Move flags to the new header file. (print_one_sig): Export symbol and rename accordingly. (print_and_check_one_sig): Adapt accordingly. (check_all_keysigs): Likewise. * g10/keyedit.h: New file. * g10/main.h: Drop declarations, include new header. GnuPG-bug-id: 2236 Signed-off-by: Justus Winter <[email protected]>
* dirmngr: Implement querying nameservers over IPv6.Justus Winter2017-06-131-1/+179
| | | | | | | | | | | | | | | | * dirmngr/dns.c (dns_so_check): Reinitialize sockets on address family mismatch. (enum dns_res_state): New states for querying over IPv6. (dns_res_exec): Implement the new states by copying and modifying the IPv4 variants. Branch to their respective counterparts if the current list of resolvers using the current address family is exhausted. -- This allows dirmngr to resolve names on systems where the nameservers are only reachable via IPv6. GnuPG-bug-id: 2990 Signed-off-by: Justus Winter <[email protected]>
* gpg: Disable keydb handle caching only for W32Werner Koch2017-06-131-10/+17
| | | | | | | | | | | * g10/getkey.c (getkey_end) [!W32]: Re-enable caching. -- This change limits of the effects of commit d3d640b9cc98dd0d06b49a2e4d46eb67af96fe29 to W32 system. GnuPG-bug-id: 3097 Signed-off-by: Werner Koch <[email protected]>
* po: Make a string translatable.Werner Koch2017-06-131-3/+6
| | | | --
* common: Fix -Wswitch warning.Werner Koch2017-06-131-1/+0
| | | | | | | | | | * common/compliance.c (gnupg_digest_is_allowed): Don't include GCRY_MD_WHIRLPOOL because it is not a digest_algo_t. -- Note that Whirlpool is not used anywhere in gpg or gpgsm. Signed-off-by: Werner Koch <[email protected]>
* gpg: Send gpgcompose --help output to stdout, not stderr.Neal H. Walfield2017-06-111-7/+7
| | | | | | | * g10/gpgcompose.c (show_help): Send gpgcompose --help output to stdout, not stderr. Reported-by: Daniel Kahn Gillmor <[email protected]>
* gpg: Improve some output of gpgcompose.Neal H. Walfield2017-06-111-2/+5
|
* gpg: Support 'gpgcompose --encrypted-pop --help'Neal H. Walfield2017-06-111-3/+21
| | | | | | | * g10/gpgcompose.c (encrypted_pop_options): New variable. (encrypted_pop): Support the --help option. Reported-by: Daniel Kahn Gillmor <[email protected]>
* gpg: Remove dead code.Neal H. Walfield2017-06-111-7/+1
| | | | | | * g10/gpgcompose.c (filter_pop): F->PKTTYPE will never be PKT_ENCRYPTED_MDC. (encrypted_pop): Likewise and there is no option --encrypted-mdc-pop.
* artwork: Add new banner.Marcus Brinkmann2017-06-0810-0/+695
| | | | | | | | | | | | | | | * artwork/banner/banner-full.png: New file. * artwork/banner/banner-rectangle.png: New file. * artwork/banner/banner.svg: New file. * artwork/banner/Bungee-Regular.ttf: New file. * artwork/banner/Raleway-license.txt: New file. * artwork/banner/banner-half.png: New file. * artwork/banner/banner-skyscraper.png: New file. * artwork/banner/Bungee-license.txt: New file. * artwork/banner/Raleway-ExtraBold.ttf: New file. * artwork/banner/Raleway-SemiBold.ttf: New file. Signed-off-by: Marcus Brinkmann <[email protected]>
* common,gpg,sm: Restrict the use of algorithms according to CO_DE_VS.Justus Winter2017-06-0813-21/+504
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/compliance.c (gnupg_pk_is_allowed): New function. (gnupg_cipher_is_allowed): Likewise. (gnupg_digest_is_allowed): Likewise. * common/compliance.h (enum pk_use_case): New definition. (gnupg_pk_is_allowed): New prototype. (gnupg_cipher_is_allowed): Likewise. (gnupg_digest_is_allowed): Likewise. * g10/decrypt-data.c (decrypt_data): Restrict use of algorithms using the new predicates. * g10/encrypt.c (encrypt_crypt): Likewise. * g10/gpg.c (main): Likewise. * g10/pubkey-enc.c (get_session_key): Likewise. * g10/sig-check.c (check_signature2): Likewise. * g10/sign.c (do_sign): Likewise. * sm/decrypt.c (gpgsm_decrypt): Likewise. * sm/encrypt.c (gpgsm_encrypt): Likewise. * sm/gpgsm.c (main): Likewise. * sm/sign.c (gpgsm_sign): Likewise. * sm/verify.c (gpgsm_verify): Likewise. -- With this change, policies can effectively restrict what algorithms are used for different purposes. The algorithm policy for CO_DE_VS is implemented. GnuPG-bug-id: 3191 Signed-off-by: Justus Winter <[email protected]>
* gpg: Fix computation of compliance with CO_DE_VS.Justus Winter2017-06-081-3/+4
| | | | | | | | * g10/mainproc.c (proc_encrypted): Symmetric encryption is also in compliance with CO_DE_VS. GnuPG-bug-id: 3059 Signed-off-by: Justus Winter <[email protected]>
* dirmngr: Implement HTTP connect timeouts of 15 or 2 seconds.Werner Koch2017-06-087-8/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/dirmngr.c (oConnectTimeout, oConnectQuickTimeout): New enums. (opts): New options --connect-timeout and --connect-quick-timeout. (DEFAULT_CONNECT_TIMEOUT): New. (DEFAULT_CONNECT_QUICK_TIMEOUT): New. (parse_rereadable_options): Handle new options. (post_option_parsing): New. Use instead of direct calls to set_debug() and set_tor_mode (). (main): Setup default timeouts. (dirmngr_init_default_ctrl): Set standard connect timeout. * dirmngr/dirmngr.h (opt): New fields connect_timeout and connect_quick_timeout. (server_control_s): New field timeout. * dirmngr/ks-engine-finger.c (ks_finger_fetch): Pass timeout to http_raw_connect. * dirmngr/ks-engine-hkp.c (send_request): Call http_session_set_timeout. * dirmngr/ks-engine-http.c (ks_http_fetch): Ditto. * dirmngr/server.c (cmd_wkd_get, cmd_ks_search, cmd_ks_get) (cmd_ks_fetch): Implement --quick option. -- The standard connect timeouts are way to long so we add a timeout to the connect calls. Also implement the --quick option which is already used by gpg for non-important requests (e.g. looking up a key for verification). Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Allow a timeout for HTTP and other TCP connects.Werner Koch2017-06-083-17/+200
| | | | | | | | | | | | | | | | | | | | | | | * dirmngr/http.c: Include fcntl.h. (http_session_s): Add field 'connect_timeout'. (http_session_new): Clear that. (http_session_set_timeout): New function. (my_wsagetlasterror) [W32]: New. (connect_with_timeout): New function. (connect_server): Add arg 'timeout' and call connect_with_timeout. (send_request): Add arg 'timeout' and pass it to connect_server. (http_raw_connect): Add arg 'timeout'. (http_open): Pass TIMEOUT from the session to connect_server. -- Note that the non-blocking connect we implement is traditional a pretty non-portable thing due to slighly different semantics. The code uses the strategy W. Richard Stevens suggested in 1998. Hopefully current OS versions got it all right. The code has not been tested on Windows. Signed-off-by: Werner Koch <[email protected]>