aboutsummaryrefslogtreecommitdiffstats
path: root/common (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix more spellingDaniel Kahn Gillmor2016-09-173-3/+3
| | | | | | | | | | | | | | | | | | | * NEWS, acinclude.m4, agent/command-ssh.c, agent/command.c, agent/gpg-agent.c, agent/keyformat.txt, agent/protect-tool.c, common/asshelp.c, common/b64enc.c, common/recsel.c, doc/DETAILS, doc/HACKING, doc/Notes, doc/TRANSLATE, doc/dirmngr.texi, doc/faq.org, doc/gpg-agent.texi, doc/gpg.texi, doc/gpgsm.texi, doc/instguide.texi, g10/armor.c, g10/gpg.c, g10/keyedit.c, g10/mainproc.c, g10/pkclist.c, g10/tofu.c, g13/sh-cmd.c, g13/sh-dmcrypt.c, kbx/keybox-init.c, m4/pkg.m4, sm/call-dirmngr.c, sm/gpgsm.c, tests/Makefile.am, tests/gpgscm/Manual.txt, tests/gpgscm/scheme.c, tests/openpgp/gpgv-forged-keyring.scm, tests/openpgp/multisig.test, tests/openpgp/verify.scm, tests/pkits/README, tools/applygnupgdefaults, tools/gpg-connect-agent.c, tools/mime-maker.c, tools/mime-parser.c: minor spelling cleanup. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* common: Restore a simpler variant of 'gnupg_wait_process'.Justus Winter2016-09-051-1/+53
| | | | | | | * common/exechelp-posix.c (gnupg_wait_process): Use the code prior to 5ba4f604. Signed-off-by: Justus Winter <[email protected]>
* common: Fix error handling.Justus Winter2016-09-051-2/+6
| | | | | | | * common/exechelp-posix.c (store_result): Use xtrymalloc. (gnupg_wait_processes): Likewise, and check result. Signed-off-by: Justus Winter <[email protected]>
* common: Improve waiting for processes on POSIX.Justus Winter2016-09-051-30/+112
| | | | | | | | | | | | | | | | * common/exechelp-posix.c (struct terminated_child): New definition. (terminated_children): New variable. (store_result): New function. (get_result): Likewise. (gnupg_wait_process): Store results that were not requested and consider previously stored results. waitpid(2) may return information about terminated children that we did not yet request, and there is no portable way to wait for a specific set of children. As a workaround, we store the results of children for later use. Signed-off-by: Justus Winter <[email protected]>
* common: Fix typo.Justus Winter2016-09-051-1/+1
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* common: Add an assuan logging monitor.Werner Koch2016-09-052-4/+19
| | | | | | | | | * common/asshelp.c (my_log_monitor): New var. (my_libassuan_log_handler): Run that monitor. (setup_libassuan_logging): Add arg to set a log monitor and change all callers. Signed-off-by: Werner Koch <[email protected]>
* common: Add string operator gt,ge,le,lt to recsel.Werner Koch2016-09-052-2/+88
| | | | | | | | * common/recsel.c (recsel_parse_expr): Add them. (recsel_dump): Print them. (recsel_select): Evaluate them. Signed-off-by: Werner Koch <[email protected]>
* common: Check read errors in name-value.cWerner Koch2016-09-021-1/+6
| | | | | | * common/name-value.c: Check for read errors. Signed-off-by: Werner Koch <[email protected]>
* w32: Fix build regression due to 2aa0701.Werner Koch2016-08-291-1/+1
| | | | | | | | * common/logging.c (fun_writer): Always declare 'name_for_err'. -- Regression-due-to: 2aa0701013f703ad93e17da3345c493c08aa04ee Signed-off-by: Werner Koch <[email protected]>
* common: Add a default socket name feature.Werner Koch2016-08-293-12/+45
| | | | | | | | | | | | | | | | | * common/logging.c (log_set_socket_dir_cb): New. (socket_dir_cb): New. (set_file_fd): Allow "socket://". (fun_writer): Implement default socket name. * common/init.c (_init_common_subsystems): Register default socket. -- This change allows the use of log-file socket:// in any configuration file. Signed-off-by: Werner Koch <[email protected]>
* common: Rename an odd named function.Werner Koch2016-08-252-5/+5
| | | | | | | | | | | | | * common/openpgp-oid.c (oid_crv25519): Rename to oid_cv25519. (openpgp_oid_is_crv25519): Rename to openpgp_oid_is_cv25519. Change callers. -- We use "cv25519" everywhere else and thus the test function should not have a surprising name. Signed-off-by: Werner Koch <[email protected]>
* common: Guarantee that gnupg_get_time does not return an error.Werner Koch2016-08-241-16/+10
| | | | | | | | | | | | | * common/gettime.c (gnupg_get_time): Abor if time() failed. (gnupg_get_isotime): Remove now useless check. (make_timestamp): Remove check becuase we already checked this modulo the faked time thing. -- In reality a call foo = time (NULL) can never fail because the only defined error is EFAULT, but we don't provide a buffer. Signed-off-by: Werner Koch <[email protected]>
* doc: Some additional source commentsWerner Koch2016-08-241-0/+4
| | | | --
* common: Change license of mbox-util to LGPLv2.1+.Werner Koch2016-08-222-28/+8
| | | | | | | | -- Noet that the code has entirely been written by me. Signed-off-by: Werner Koch <[email protected]>
* common: Remove unused vars in simple-pwquery.Werner Koch2016-08-221-16/+5
| | | | | | | | | * common/simple-pwquery.c (agent_send_option): Remove unused vars. (simple_query): Ditto. (agent_open): Ditto. Return RC on error. (simple_pwquery): Remove unused vars. Remove shadowing of 'p'. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Remove all system daemon features.Werner Koch2016-08-183-90/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/dirmngr.h (opts): Remove fields 'system_service' and 'system_daemon'. * common/homedir.c (dirmngr_sys_socket_name): Remove. (dirmngr_user_socket_name): Rename to ... (dirmngr_socket_name): this. Change call callers. * common/asshelp.c (start_new_dirmngr): Remove the system socket feature. * tools/gpgconf.c (list_dirs): Do not print "dirmngr-sys-socket". * sm/server.c (gpgsm_server): Adjust for removed system socket feature. * dirmngr/server.c (cmd_getinfo): Ditto. (cmd_killdirmngr): Remove check for system daemon. (cmd_reloaddirmngr): Ditto. * dirmngr/dirmngr.c (USE_W32_SERVICE): Remove macro. (aService): Remove. (opts): Remove --service. (w32_service_control): Remove. (real_main, call_real_main) [W32]: Remove wrapper. (main): Remove Windows system service feature. Remove system dameon feature. Use only the "~/.gnupg/dirmngr_ldapservers.conf" file. * dirmngr/certcache.c (load_certs_from_dir): Remove warning in the system dameon case. * dirmngr/crlcache.c (DBDIR_D): Always use "~/.gnupg/crls.d". * dirmngr/ocsp.c (validate_responder_cert): Do not call validate_cert_chain which was used only in system daemon mode. * dirmngr/validate.c (validate_cert_chain): Always use the code. -- We are now starting dirmngr as needed as a user daemon. The deprecated system daemon mode does not anymore make sense. In case a system wide daemon is required, it is better to setup a dedicated account to run dirmngr and tweak socket permissions accordingly. Signed-off-by: Werner Koch <[email protected]>
* g13: New command --find-device.Werner Koch2016-08-131-0/+1
| | | | | | | | | | | | | | | | * common/status.h (STATUS_BLOCKDEV: New. * g13/call-syshelp.c: Include "call-syshelp.h". (finddevice_status_cb, call_syshelp_find_device): New. * g13/g13.c (aFindDevice): New. (opts): Add "--find-device". (main): Implement --find-device. * g13/sh-cmd.c (cmd_finddevice): New. (register_commands): Register new command. -- This might be useful for scripting. Signed-off-by: Werner Koch <[email protected]>
* Avoid leading ": " in the log output when there are no prefixes.Daniel Kahn Gillmor2016-08-121-2/+3
| | | | | | | | * common/logging.c (do_logv): When no prefixes have been requested, omit the ": " separator, since there is nothing on the left-hand side of it. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* common: New function string_to_u64.Werner Koch2016-08-113-3/+23
| | | | | | | | | | | | | * common/stringhelp.c (string_to_u64): New. * dirmngr/http.c (longcounter_t): Remove. (struct cookie_s): Change content_length to uint64_t. (parse_response): Use string_to_u64. -- Meanwhile we allow some C99 features including stdint.h. Thus we can simplify things now. Signed-off-by: Werner Koch <[email protected]>
* common: Remove compatibility code.Justus Winter2016-08-113-212/+1
| | | | | | | | | * common/Makefile.am: Drop deleted files. * common/w32-afunix.c: Delete file. * common/w32-afunix.h: Likewise. GnuPG-bug-id: 2408 Signed-off-by: Justus Winter <[email protected]>
* common: Rework the simple password query module.Justus Winter2016-08-111-319/+101
| | | | | | | | | | | | | * common/simple-pwquery.c (writen, readline): Drop. (agent_send_option, agent_send_all_options, agent_open): Just use libassuan. (simple_pw_set_socket): Simplify. (default_inq_cb): New function. (simple_pwquery, simple_query): Just use libassuan. * agent/Makefile.am (gpg_preset_passphrase_LDADD): Add libassuan. * tools/Makefile.am (symcryptrun_LDADD): Likewise. Signed-off-by: Justus Winter <[email protected]>
* common: Remove simple password query error codes.Justus Winter2016-08-112-43/+9
| | | | | | | | | | | | * common/simple-pwquery.h: Remove mapping function. Move all definitions of status codes... * common/simple-pwquery.c: ... here, and define them to meaningful gpg error values. * agent/preset-passphrase.c (preset_passphrase): Use error code as-is. (forget_passphrase): Likewise. * tools/symcryptrun.c (confucius_get_pass): Likewise. Signed-off-by: Justus Winter <[email protected]>
* common: New function try_make_printable_string.Werner Koch2016-08-104-64/+67
| | | | | | | | * common/stringhelp.c (sanitize_buffer): Remove. Move code to ... * common/miscellaneous.c (try_make_printable_string): new. (make_printable_string): Call try_make_printable_string. Signed-off-by: Werner Koch <[email protected]>
* Cleanup initialization of libgcrypt.Ben Kibbey2016-08-091-0/+8
| | | | | | | | | | | | * common/init.c (init_common_subsystems): Initialize libgcrypt. * dirmngr/Makefile.am (dirmngr_ldap): Link with libgcrypt. -- Most other modules already call gcry_check_version() after init_common_subsystems() so may as well move initialization of libgcrypt to here. Also fixes a warning in the system log from gpgconf --homedir. Signed-off-by: Ben Kibbey <[email protected]>
* agent: More clean up of SSH support.NIIBE Yutaka2016-08-082-0/+51
| | | | | | | | | | | | | | | | | | | | | * common/util.h (get_pk_algo_from_key): New. * common/sexputil.c (get_pk_algo_from_key): The implementation. * agent/gpg-agent.c: Remove include of openpgpdefs.h. * agent/command-ssh.c (struct ssh_key_type_spec): Use integer ALGO. (ssh_key_types): Update with GCRY_PK_*. (make_cstring, sexp_extract_identifier): Remove. (sexp_key_construct): Use gcry_pk_algo_name to get ALGO string. (ssh_key_to_blob): Use cadr to get value list. (ssh_key_type_lookup): Lookup with integer ALGO. (ssh_receive_key): Follow the change of ssh_key_type_lookup. (ssh_send_key_public): Likewise. Use get_pk_algo_from_key to get ALGO. -- This fixes the regresson introduced by the commit 894789c3299dc47a8c1ccaaa7070382f0fae0262. Signed-off-by: NIIBE Yutaka <[email protected]>
* More cleanup of "allow to".Daniel Kahn Gillmor2016-08-033-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | * README, agent/command.c, agent/keyformat.txt, common/i18n.c, common/iobuf.c, common/keyserver.h, dirmngr/cdblib.c, dirmngr/ldap-wrapper.c, doc/DETAILS, doc/TRANSLATE, doc/announce-2.1.txt, doc/gpg.texi, doc/gpgsm.texi, doc/scdaemon.texi, doc/tools.texi, doc/whats-new-in-2.1.txt, g10/export.c, g10/getkey.c, g10/import.c, g10/keyedit.c, m4/ksba.m4, m4/libgcrypt.m4, m4/ntbtls.m4, po/ca.po, po/cs.po, po/da.po, po/de.po, po/el.po, po/eo.po, po/es.po, po/et.po, po/fi.po, po/fr.po, po/gl.po, po/hu.po, po/id.po, po/it.po, po/ja.po, po/nb.po, po/pl.po, po/pt.po, po/ro.po, po/ru.po, po/sk.po, po/sv.po, po/tr.po, po/uk.po, po/zh_CN.po, po/zh_TW.po, scd/app-p15.c, scd/ccid-driver.c, scd/command.c, sm/gpgsm.c, sm/sign.c, tools/gpgconf-comp.c, tools/gpgtar.h: replace "Allow to" with clearer text. In standard English, the normal construction is "${XXX} allows ${YYY} to" -- that is, the subject (${XXX}) of the sentence is allowing the object (${YYY}) to do something. When the object is missing, the phrasing sounds awkward, even if the object is implied by context. There's almost always a better construction that isn't as awkward. These changes should make the language a bit clearer. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* common: New file utilproto.cWerner Koch2016-08-034-7/+47
| | | | | | | | * common/util.h: Factor prototypes from signal.c out to ... * common/utilproto.h: new. * common/Makefile.am (common_sources): Add new file. Signed-off-by: Werner Koch <[email protected]>
* common: Fix iobuf_peek corner case.Justus Winter2016-07-261-3/+15
| | | | | | | | | | | | | | | Previously, iobuf_peek on a file smaller than 'buflen' would hang. * common/iobuf.c (underflow): Generalize by adding a target parameter. (iobuf_peek): Use this to prevent looping here. * tests/openpgp/Makefile.am (TESTS): Add new test. * tests/openpgp/setup.scm (dearmor): Move function... * tests/openpgp/defs.scm (dearmor): ... here. * tests/openpgp/issue2419.scm: New file. * tests/openpgp/samplemsgs/issue2419.asc: Likewise. GnuPG-bug-id: 2419 Signed-off-by: Justus Winter <[email protected]>
* common: Avoid excessive stack use.Justus Winter2016-07-261-14/+39
| | | | | | | * common/exectool.c (copy_buffer_shred): Make passing NULL a nop. (gnupg_exec_tool_stream): Allocate copy buffers from the heap. Signed-off-by: Justus Winter <[email protected]>
* common: Rework resource cleanup when handling errors.Justus Winter2016-07-261-9/+10
| | | | | | * common/exectool.c (gnupg_exec_tool_stream): Rework error handling. Signed-off-by: Justus Winter <[email protected]>
* common: Add unit test for exectool.Justus Winter2016-07-262-1/+225
| | | | | | | * common/Makefile.am: Build new test. * common/t-exectool.c: New file. Signed-off-by: Justus Winter <[email protected]>
* build: Require latest released librariesWerner Koch2016-07-141-5/+4
| | | | | | | | | | | | | | * agent/protect.c (OCB_MODE_SUPPORTED): Remove macro. (do_encryption): Always support OCB. (do_decryption): Ditto. (agent_unprotect): Ditto. * dirmngr/server.c (is_tor_running): Unconditionally build this. -- Although not technically required, it is easier to require them to avoid bug reports due to too old library versions. Signed-off-by: Werner Koch <[email protected]>
* tests: Add a gettime test for sizeof (time_t) > 4.Werner Koch2016-07-041-0/+6
| | | | | | * common/t-gettime.c (test_isotime2epoch): Add 4 more tests. Signed-off-by: Werner Koch <[email protected]>
* doc: Describe filter expressions.Werner Koch2016-07-021-3/+3
| | | | | | | * doc/gpg.texi: Remove some superfluous .E. (FILTER EXPRESSIONS): New. Signed-off-by: Werner Koch <[email protected]>
* common: Add function to select records etc.Werner Koch2016-07-014-2/+1023
| | | | | | | * common/recsel.c, common/recsel.h: New. * common/t-recsel.c: New. Signed-off-by: Werner Koch <[email protected]>
* common: Smart up register_mem_cleanup_func.Werner Koch2016-07-011-0/+4
| | | | | | * common/init.c (register_mem_cleanup_func): Avoid double registration. Signed-off-by: Werner Koch <[email protected]>
* common: Annotate semi-static allocation.Justus Winter2016-07-011-0/+2
| | | | | | * common/argparse.c (optfile_parse): Allow string arguments to leak. Signed-off-by: Justus Winter <[email protected]>
* common: Fix memory leak.Justus Winter2016-06-301-3/+2
| | | | | | | * common/iobuf.c (iobuf_set_partial_body_length_mode): Only create context if necessary. Signed-off-by: Justus Winter <[email protected]>
* common: Fix memory leak.Justus Winter2016-06-301-1/+5
| | | | | | * common/simple-pwquery.c (agent_open): Free socket path. Signed-off-by: Justus Winter <[email protected]>
* common: Fix memory leaks.Justus Winter2016-06-288-3/+32
| | | | | | | | | | | | | * common/ccparray.c (ccparray_put): Free old array. * common/stringhelp.c (do_make_filename): Free 'home'. * common/t-convert.c: Fix trivial memory leaks. * common/t-iobuf.c: Likewise. * common/t-mbox-util.c: Likewise. * common/t-name-value.c: Likewise. * common/t-stringhelp.c: Likewise. * common/t-strlist.c: Likewise. Signed-off-by: Justus Winter <[email protected]>
* common: New function rfctimestamp.Werner Koch2016-06-282-0/+34
| | | | | | | | | | | | | * common/gettime.c (rfctimestamp): New. -- It is surprisingly hard to create an RFC-2822 compliant Date value. The problem is that strftime uses the current locale but the RFC requires that the English names are used. This code is pretty simply and avoid the extra problem of figuring out the correct timezone; instead UTC is used. For the planned use case this is anyway better. Signed-off-by: Werner Koch <[email protected]>
* common: Add missing header file for clarity.Werner Koch2016-06-281-1/+1
| | | | | | * common/zb32.c: Include zb32.h. Signed-off-by: Werner Koch <[email protected]>
* common: Close input stream.Justus Winter2016-06-281-0/+1
| | | | | | | * common/exechelp-posix.c (gnupg_spawn_process): Also close the input stream in the child. Signed-off-by: Justus Winter <[email protected]>
* common: Fix copying data from the spawned child.Justus Winter2016-06-281-10/+15
| | | | | | | | | Fixes intermittent gpgtar failures. * common/exectool.c (copy_buffer_do_copy): Initialize 'nwritten'. (gnupg_exec_tool_stream): Loop until all data is copied. Signed-off-by: Justus Winter <[email protected]>
* common: Fix possible small memory leak in b64dec.c.Werner Koch2016-06-231-2/+3
| | | | | | * common/b64dec.c (b64dec_finish): Always release TITLE. Signed-off-by: Werner Koch <[email protected]>
* common: Add dedicated private key functions to name-value.c.Werner Koch2016-06-233-42/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/name-value.c (struct name_value_container): Add field 'private_key_mode'. (my_error): New. Use instead of gpg_error. (nvc_new_private_key): New. (nve_release): Add arg 'private_key_mode'. (nvc_release): Call nve_release with private_key_mode flag. (nvc_delete): Ditto. (_nvc_add): Do no special case "Key:" in non-private_key_mode. (nvc_get_private_key): Return error in non-private_key_mode. (nvc_set_private_key): Ditto. (nvc_parse): Factor all code out to ... (do_nvc_parse): new. Add arg 'for_private_key'. (nvc_parse_private_key): New. * agent/findkey.c (write_extended_private_key): Replace nvc_parse by nvc_parse_private_key. (read_key_file): Ditto. * common/t-name-value.c (private_key_mode): New variable. (my_nvc_new): New. Replace all callers. (test_key_extraction): Take mode in account. (run_tests): Ditto. (run_modification_tests): Ditto. (parse): Ditto. (main): Add option --parse and rename --parse to --parse-key. -- Signed-off-by: Werner Koch <[email protected]>
* common: Rename external symbols in name-value.c.Werner Koch2016-06-233-149/+149
| | | | | | | * common/name-value.c, common/name-value.h: Rename symbol prefixes from "pkc_" to "nvc_" and from "pke_" to "nve_". Change all callers. Signed-off-by: Werner Koch <[email protected]>
* common: Rename private-keys.c to name-value.cWerner Koch2016-06-234-11/+16
| | | | | | | | | | | | | * common/private-keys.c: Rename to name-value.c. * common/private-keys.h: Rename to name-value.h. Chage all users. * common/t-private-keys.c: Rename to t-name-value.c. * common/Makefile.am: Adjust accordingly. -- The module is cool enough to be used for other purposes as well. Thus we better change the name. Signed-off-by: Werner Koch <[email protected]>
* common: Change license of b64dec.c and b64enc.c to LGPLv2.1+Werner Koch2016-06-232-28/+11
| | | | | | | | -- The code as solely been written by employees of g10 Code. Signed-off-by: Werner Koch <[email protected]>
* common: Add PGP armor decoding to b64dec.Werner Koch2016-06-231-16/+39
| | | | | | | | * common/b64dec.c (decoder_states): Add new states. (b64dec_proc): Handle PGP armored format. -- Signed-off-by: Werner Koch <[email protected]>