aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gpg: New option --default-new-key-algo.Werner Koch2016-12-029-138/+424
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/openpgp-oid.c (openpgp_is_curve_supported): Add optional arg R_ALGO and change all callers. * common/util.h (GPG_ERR_UNKNOWN_FLAG): New error code. * g10/options.h (struct opt): Add field DEF_NEW_KEY_ALGO. * g10/gpg.c (oDefaultNewKeyAlgo): New enum. (opts): New option "--default-new-key-algo". (main): Set the option. * g10/keygen.c: Remove DEFAULT_STD_ FUTURE_STD_ constants and replace them by ... (DEFAULT_STD_KEY_PARAM, FUTURE_STD_KEY_PARAM): new string constants. (get_keysize_range): Remove arg R_DEF and return that value instead. Change all callers. (gen_rsa): Use get_keysize_range instead of the removed DEFAULT_STD_KEYSIZE. (parse_key_parameter_part): New function. (parse_key_parameter_string): New function. (quick_generate_keypair): Refactor using parse_key_parameter_string. (generate_keypair): Ditto. (parse_algo_usage_expire): Ditto. -- This new option is intended to be used in the forthcoming --set-profile command of gpgconf. It allows to provide a gpg configuration with custom defaults for a new key using the simple commands which use the default algorithm set. Signed-off-by: Werner Koch <[email protected]>
* g10: Improve debugging output.Neal H. Walfield2016-12-021-6/+12
| | | | | | | * g10/tofu.c (string_to_long): Improve debugging output. (string_to_ulong): Likewise. Signed-off-by: Neal H. Walfield <[email protected]>
* g10: In the TOFU module, make strings easier to translate.Neal H. Walfield2016-12-011-187/+144
| | | | | | | | | | | * g10/tofu.c: Remove dead code. (time_ago_str): Simplify implementation since we only want the most significant unit. (format_conflict_msg_part1): Use ngettext. (ask_about_binding): Likewise and only emit full sentences. (show_statistics): Likewise. Signed-off-by: Neal H. Walfield <[email protected]>
* Register DCO for Tobias Mueller.Justus Winter2016-12-011-0/+3
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* dirmngr: Add option --standard-resolver.Werner Koch2016-12-019-391/+483
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/dirmngr.c (oStandardResolver): New constant. (opts): New option --standard-resolver. (parse_rereadable_options): Set option. * dirmngr/dns-stuff.c: Refactor all code to support the new option. (standard_resolver): New var. (enable_standard_resolver, standard_resolver_p): New func. * dirmngr/http.c (connect_server): Remove USE_DNS_SRV build conditional. * dirmngr/ks-engine-hkp.c (map_host): Ditto. * dirmngr/server.c (cmd_getinfo) <dnsinfo>: Take care of new option * configure.ac (HAVE_ADNS_IF_TORMODE): Remove var ADNSLIB. ac_define USE_ADNS in the adns checking code. Remove options --disable-dns-srv and --disable-dns-cert. Always look for the system resolver. Print warning if no system resolver was found. (USE_DNS_CERT, USE_DNS_SRV): Remove ac_defines. (HAVE_SYSTEM_RESOLVER): New ac_define. (USE_DNS_SRV): Remove am_conditional; not used anyway. -- This option allows for runtime switching to the system's standard resolver. This is mainly useful to work around possible bugs in the optional resolver libraries (as of now ADNS). Note that on Windows there is no code to use systems's resolver and thus for full functionality dirmngr must be build with a separate resolver. This patch also does way with configure options to disable the use of CERT and SRV records. Signed-off-by: Werner Koch <[email protected]>
* gpg: Let only Dirmngr decide whether CERT is supported.Werner Koch2016-12-012-6/+0
| | | | | | | | | | * g10/getkey.c (parse_auto_key_locate): Do not build parts depending on USE_DNS_CERT. -- This also removes USE_DNS_SRV from commented code. Signed-off-by: Werner Koch <[email protected]>
* tests,build: Fix distcheck.Justus Winter2016-12-011-1/+3
| | | | | | | | * tests/openpgp/Makefile.am (sample_msgs): Add messages required for the new test 'verify-multifile.scm'. Fixes-commit: 12af8e84a32df728462da09a00a8bec24a487720 Signed-off-by: Justus Winter <[email protected]>
* tests: Add test for '--verify --multifile'.Justus Winter2016-12-012-0/+42
| | | | | | | * tests/openpgp/Makefile.am (XTESTS): Add new test. * tests/openpgp/verify-multifile.scm: New file. Signed-off-by: Justus Winter <[email protected]>
* tests: Add test for '--encrypt --multifile'.Justus Winter2016-11-302-0/+40
| | | | | | | * tests/openpgp/Makefile.am (XTESTS): Add new test. * tests/openpgp/encrypt-multifile.scm: New file. Signed-off-by: Justus Winter <[email protected]>
* agent,dirmngr: Tiny restructuring.Werner Koch2016-11-292-5/+18
| | | | | | | | | | * agent/gpg-agent.c (handle_connections): Add a comment. * dirmngr/dirmngr.c (main): Move assuan_sock_close of the listening socket to ... (handle_connections): here. Add a comment why we keep the listening socket open during a shutdown. Signed-off-by: Werner Koch <[email protected]>
* agent,dirmngr: Handle corner case in shutdown mode.Werner Koch2016-11-292-5/+13
| | | | | | | | | | | | | * agent/gpg-agent.c (handle_connections): Keep on selecting on the inotify fd even when a shutdown is pending. * dirmngr/dirmngr.c (handle_connections): Ditto. Also simplifyy the use of the HAVE_INOTIFY_INIT cpp conditional. -- Without that patch we won't notice a removed socket when a shutdown is pending. This is somewhat related to bug report 2849. Signed-off-by: Werner Koch <[email protected]>
* gpgsm: Allow decryption with a card returning a PKCS#1 stripped key.Werner Koch2016-11-291-3/+5
| | | | | | | | * sm/decrypt.c (prepare_decryption): Handle a 16 byte session key. -- GnuPG-bug-id: 2230 Signed-off-by: Werner Koch <[email protected]>
* agent,w32: Initialize nPth in server mode.Werner Koch2016-11-291-0/+5
| | | | | | | | | * agent/gpg-agent.c (main) [W32]: Call initialize_modules in server mode. -- Fixes-commit: 9a707a223a3d45ccf245dee7989ca144e4e6bb49 Signed-off-by: Werner Koch <[email protected]>
* gpg: Make --decrypt with output '-&nnnn' work.Werner Koch2016-11-291-3/+19
| | | | | | | | | * g10/plaintext.c (get_output_file): Check and open special filename before falling back to stdout. -- GnuPG-bug-id: 2677 Signed-off-by: Werner Koch <[email protected]>
* gpg,sm: Merge the two versions of check_special_filename.Werner Koch2016-11-297-70/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * sm/gpgsm.c (check_special_filename): Move to .. * common/sysutils.c (check_special_filename): here. Add arg NOTRANSLATE. (allow_special_filenames): New local var. (enable_special_filenames): New public functions. * sm/gpgsm.c (allow_special_filenames): Remove var. (main): Call enable_special_filenames instead of setting the var. (open_read, open_es_fread, open_es_fwrite): Call check_special_filename with 0 for NOTRANSLATE. * common/iobuf.c (special_names_enabled): Remove var. (iobuf_enable_special_filenames): Remove func. (check_special_filename): Remove func. (iobuf_is_pipe_filename): Call new version of the function with NOTRANSLATE set. (do_open): Ditto. * g10/gpg.c (main): Call enable_special_filenames instead of iobuf_enable_special_filenames. * g10/gpgv.c (main): Ditto. -- Note that we keep the iobuf.c:translate_file_handle because it is a bit different (for whatever reasons) than the translate function from sysutils. Signed-off-by: Werner Koch <[email protected]>
* g10: Fix memory leak.Justus Winter2016-11-291-4/+5
| | | | | | | * g10/decrypt.c (decrypt_messages): Properly decrease the reference count of the armor filters after pushing them. Signed-off-by: Justus Winter <[email protected]>
* tools,build: Build WKS tools against libintl.Justus Winter2016-11-291-2/+2
| | | | | | | | * tools/Makefile.am (gpg_wks_server_LDADD): Link against libintl. (gpg_wks_client_LDADD): Likewise. GnuPG-bug-id: 2846 Signed-off-by: Justus Winter <[email protected]>
* Improve some comments.Neal H. Walfield2016-11-296-30/+51
|
* g10: Extend TOFU_STATS to always show the validityNeal H. Walfield2016-11-292-17/+31
| | | | | | | | | | | * doc/DETAILS (TOFU_STATS): Rename the VALIDITY field to SUMMARY. Add a new field called VALIDITY. * g10/tofu.c (write_stats_status): Update output accordingly. -- Signed-off-by: Neal H. Walfield <[email protected]> Change TOFU_STATS as discussed offline with Werner, Justus and Andre.
* tests: Add test for '--decrypt --multifile'.Justus Winter2016-11-292-0/+48
| | | | | | | * tests/openpgp/Makefile.am (XTESTS): Add new test. * tests/openpgp/decrypt-multifile.scm: New file. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Avoid truncating pointers.Justus Winter2016-11-291-2/+3
| | | | | | | * tests/gpgscm/scheme.c (_alloc_cellseg): Avoid truncating pointers on systems where sizeof(unsigned long) < sizeof(void *). Signed-off-by: Justus Winter <[email protected]>
* dirmngr: Lazily launch ldap reaper thread.Daniel Kahn Gillmor2016-11-292-20/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/dirmngr.c (main): Avoid calling ldap_wrapper_launch_thread() Before we need it. * dirmngr/ldap-wrapper.c (ldap_wrapper): Call ldap_wrapper_launch_thread() just in time (before any attempt to use an ldap subprocess). -- A dirmngr process that never looks anything up in LDAP has no need for a reaper thread, but one was started automatically. This thread wakes up every two seconds to look for ldap processes that might never have been running. We won't start more than one reaper thread for any given dirmngr due to the static int "done" in ldap_wrapper_launch_thread(), so it's safe to call this every time there is a use of ldap_wrapper. If someone wants to do further dirmngr optimizations for ldap users, the reaper thread itself could use dynamically-calculated timeouts (and probably needs to be alerted dynamically when a new ldap subprocess is available so it can re-calculate those timeouts). Note: It's not clear to me how to test ldap access effectively; i know of no public ldap services that i can verify against, and i do not run my own ldap servers. If someone has a publicly-available ldap server that developers can run tests against, i would be happy to hear about it. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* build: Remove more keywords from the generated ChangeLogWerner Koch2016-11-291-3/+2
| | | | | | | | | | | | | | | | | | | * build-aux/gitlog-to-changelog (parse_amend_file): Generalize keyword removal. -- This simplified rule does now match most special keywords like Signed-off-by: GnuPG-bug-id: Fixes-commit: However it does not match the sometimes used Fixes: which should be avoided anyway. This patch helps in cases where the "--" delimiter line was not used and only keywords were given. Signed-off-by: Werner Koch <[email protected]>
* tests: Add test for the ssh key export.Justus Winter2016-11-284-1/+147
| | | | | | | | | | | * tests/openpgp/Makefile.am (XTESTS): Add new test. (sample_keys): Add new files. * tests/openpgp/samplekeys/authenticate-only.pub.asc: New file. * tests/openpgp/samplekeys/authenticate-only.sec.asc: Likewise. * tests/openpgp/ssh-export.scm: Likewise. GnuPG-bug-id: 2848 Signed-off-by: Justus Winter <[email protected]>
* g10: Fix iteration over getkey results.Justus Winter2016-11-281-1/+1
| | | | | | | | | * g10/getkey.c (getkey_next): Only ask 'lookup' for the exact match if our caller requested the key. Fixes a crash in 'lookup'. GnuPG-bug-id: 2848 Fixes-commit: 1d03cc77e1706f7da653153ad4b58c61e4fd2573 Signed-off-by: Justus Winter <[email protected]>
* tests: Rename ssh test.Justus Winter2016-11-282-1/+1
| | | | | | | * tests/openpgp/ssh.scm: Rename to 'ssh-import.scm'. * tests/openpgp/Makefile (XTESTS): Likewise. Signed-off-by: Justus Winter <[email protected]>
* scd: Support OpenPGP card V3 for RSA.NIIBE Yutaka2016-11-251-23/+38
| | | | | | | | | | | | | | | | | | | | | | * scd/app-openpgp.c (struct app_local_s): Remove max_cmd_data and max_rsp_data fields as Extended Capabilities bits are different. (get_cached_data) Use extcap.max_certlen_3. (get_one_do): Don't use exmode=1. (determine_rsa_response): New. (get_public_key, do_genkey): Call determine_rsa_response. (do_sign): Use keyattr[0].rsa.n_bits / 8, instead of max_rsp_data. (do_auth): Use keyattr[2].rsa.n_bits / 8, instead of max_rsp_data. (do_decipher): Likewise with Use keyattr[1].rsa.n_bits / 8. (show_caps): Remove max_cmd_data and max_rsp_data. (app_select_openpgp): Likewise. -- OpenPGP card V3 had introduced incompatible change in Extended Capabilities bits. We can work around by this change by not using those bits. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpgscm: Make 'reverse' compatible with 'reverse_in_place'.Justus Winter2016-11-231-4/+4
| | | | | | | | * tests/gpgscm/scheme.c (reverse): Update prototype, add terminator argument. (opexe_4): Update callsite. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Clean sweeped cells.Justus Winter2016-11-231-2/+2
| | | | | | * tests/gpgscm/scheme.c (gc): Zero typeflag and car of free cells. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Fix initialization of 'sink'.Justus Winter2016-11-231-1/+1
| | | | | | | * tests/gpgscm/scheme.c (scheme_init_custom_alloc): Also initialize cdr. Signed-off-by: Justus Winter <[email protected]>
* g10: Avoid gratuitously loading a keyblock when it is already availableNeal H. Walfield2016-11-2311-50/+108
| | | | | | | | | | | * g10/trust.c (get_validity): Add new, optional parameter KB. Only load the keyblock if KB is NULL. Update callers. (get_validity): Likewise. * g10/trustdb.c (tdb_get_validity_core): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 2812
* g10: Use es_fopen instead of open.Neal H. Walfield2016-11-221-11/+10
| | | | | | | | | | | * g10/tofu.c: Don't include <utime.h>, <fcntl.h> or <unistd.h>. (busy_handler): Replace use of open with es_fopen. -- Signed-off-by: Neal H. Walfield <[email protected]> Thanks for Werner for pointing this out: es_fopen is more portable than open.
* g10: If the set of UTKs changes, invalidate any changed policies.Neal H. Walfield2016-11-224-0/+180
| | | | | | | | | | | | | | | | * g10/trustdb.c (tdb_utks): New function. * g10/tofu.c (check_utks): New function. (initdb): Call it. * tests/openpgp/tofu.scm: Modify test to check the effective policy of keys whose effective policy changes when we change the set of UTKs. -- Signed-off-by: Neal H. Walfield <[email protected]> If the set of ultimately trusted keys changes, then it is possible that a binding's effective policy changes. To deal with this, we detect when the set of ultimately trusted keys changes and invalidate all cached policies.
* scd: Fix receive buffer size.NIIBE Yutaka2016-11-221-2/+3
| | | | | | | | | | | | | * scd/apdu.c (send_le): Fix the size, adding two for status bytes to Le. -- This is long standing bug. So far, Le was not exact value. Since forthcoming change will introduce exact value of expected length of response data, this change is needed. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpgscm: Refactor.Justus Winter2016-11-221-6/+6
| | | | | | * tests/gpgscm/scheme.c (opexe_0): Reduce code duplication. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Fix property lists.Justus Winter2016-11-222-32/+56
| | | | | | | | | | | | * tests/gpgscm/opdefines.h (put, get): Check arguments. Also rename to 'set-symbol-property' and 'symbol-property', the names used by Guile, because put and get are too unspecific. * tests/gpgscm/scheme.c (hasprop): Only symbols have property lists. (get_property): New function. (set_property): Likewise. (opexe_4): Use the new functions. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Fix installation of error handler.Justus Winter2016-11-221-0/+1
| | | | | | | * tests/gpgscm/ffi.scm: Set '*error-hook*' again so that the interpreter will use our function. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Use a static pool of cells for small integers.Justus Winter2016-11-223-19/+108
| | | | | | | | | | | | | | | | | | * tests/gpgscm/scheme-private.h (struct scheme): New fields for the static integer cells. * tests/gpgscm/scheme.c (_alloc_cellseg): New function. (alloc_cellseg): Use the new function. (MAX_SMALL_INTEGER): New macro. (initialize_small_integers): New function. (mk_small_integer): Likewise. (mk_integer): Return a small integer if possible. (_s_return): Do not free 'op' if it is a small integer. (s_save): Use a small integer to box the opcode. (scheme_init_custom_alloc): Initialize small integers. (scheme_deinit): Free chunk of small integers. * tests/gpgscm/scheme.h (USE_SMALL_INTEGERS): New macro. Signed-off-by: Justus Winter <[email protected]>
* tests: Delay querying the avaliable algorithms.Justus Winter2016-11-227-16/+17
| | | | | | | | | | | | | * tests/openpgp/defs.scm: Set verbosity earlier, turn 'all-*-algos' into promises. * tests/openpgp/conventional-mdc.scm: Force the promises. * tests/openpgp/conventional.scm: Likewise. * tests/openpgp/encrypt-dsa.scm: Likewise. * tests/openpgp/encrypt.scm: Likewise. * tests/openpgp/gpgtar.scm: Likewise. * tests/openpgp/sigs.scm: Likewise. Signed-off-by: Justus Winter <[email protected]>
* g10: Fix memory leak.Justus Winter2016-11-221-2/+0
| | | | | | | | * g10/tofu.c (tofu_notice_key_changed): Remove spurious duplicate call to 'hexfingerprint'. Fixes-commit: 037f9de09298a31026ea2ab5fbd4a599b11cc34f Signed-off-by: Justus Winter <[email protected]>
* g10: Cache the effective policy. Recompute it when required.Neal H. Walfield2016-11-219-363/+543
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/tofu.c (initdb): Add column effective_policy to the bindings table. (record_binding): New parameters effective_policy and set_conflict. Save the effective policy. If SET_CONFLICT is set, then set conflict according to CONFLICT. Otherwise, preserve the current value of conflict. Update callers. (get_trust): Don't compute the effective policy here... (get_policy): ... do it here, if it was not cached. Take new parameters, PK, the public key, and NOW, the time that the operation started. Update callers. (show_statistics): New parameter PK. Pass it to get_policy. Update callers. (tofu_notice_key_changed): New function. * g10/gpgv.c (tofu_notice_key_changed): New stub. * g10/import.c (import_revoke_cert): Take additional argument CTRL. Pass it to keydb_update_keyblock. * g10/keydb.c (keydb_update_keyblock): Take additional argument CTRL. Update callers. [USE_TOFU]: Call tofu_notice_key_changed. * g10/test-stubs.c (tofu_notice_key_changed): New stub. * tests/openpgp/tofu.scm: Assume that manually setting a binding's policy to auto does not cause the tofu engine to forget about any conflict. -- Signed-off-by: Neal H. Walfield <[email protected]> We now store the computed policy in the tofu DB (in the effective_policy column of the bindings table) to avoid computing it every time, which is expensive. Further, policy is never overridden in case of a conflict. Instead, we detect a conflict if CONFLICT is not empty. This change is backwards compatible to existing DBs. The only minor incompatibility is that unresolved conflicts won't be automatically resolved in case we import a direct signature, or cross signatures.
* g10: Correctly parameterize ngettext.Neal H. Walfield2016-11-211-3/+6
| | | | | | * g10/tofu.c (ask_about_binding): Correctly parameterize ngettext. Signed-off-by: Neal H. Walfield <[email protected]>
* g10: Don't use the same variable for multiple SQL compiled statementsNeal H. Walfield2016-11-211-4/+4
| | | | | | | | | | | | * g10/tofu.c (struct tofu_dbs_s): Remove unused field record_binding_update2. Replace register_insert with register_signature and register_encryption. (tofu_register_signature): Don't use dbs->s.register_insert, but dbs->s.register_signature. (tofu_register_encryption): Don't use dbs->s.register_insert, but dbs->s.register_encryption. Signed-off-by: Neal H. Walfield <[email protected]>
* g10: Add a convenience function for checking if a key is a primary keyNeal H. Walfield2016-11-212-7/+13
| | | | | | | | | | | * g10/keydb.h (pk_is_primary): New function. * g10/tofu.c (get_trust): Use it. (tofu_register_signature): Likewise. (tofu_register_encryption): Likewise. (tofu_set_policy): Likewise. (tofu_get_policy): Likewise. Signed-off-by: Neal H. Walfield <[email protected]>
* build: Add repo-only maintainer script append-signature.sh.Werner Koch2016-11-211-0/+108
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* doc: Clarify dirmngr --homedir option.Daniel Kahn Gillmor2016-11-211-2/+2
| | | | | | -- Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* doc: Ship example gpg-agent-browser.socket in examples/systemd-user/.Daniel Kahn Gillmor2016-11-211-0/+1
| | | | | | | * doc/Makefile.am: Ship gpg-agent-browser.socket alongside the other systemd user service example files. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* agent: Fix npth + daemon mode problem.NIIBE Yutaka2016-11-211-2/+0
| | | | | | | | | | | | | * agent/gpg-agent.c (main): Remove duplicated initialization in daemon mode. -- The commit f57dc2b1e6f28d164f882373535dbcb0d632ca17 fixes a part of problem (for missing initialization of supervised mode). It was actually put in wrong place. Fixes-commit: 9f92b62a51d2d60f038fdbe01602865c5933fa95 Signed-off-by: NIIBE Yutaka <[email protected]>
* Post release updates.Werner Koch2016-11-182-1/+5
| | | | --
* Release 2.1.16gnupg-2.1.16Werner Koch2016-11-181-1/+69
|