summaryrefslogtreecommitdiffstats
path: root/g10/keydb.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2017-04-28Spelling fixes in docs and comments.NIIBE Yutaka82-123/+123
-- In addition, fix trailing spaces in tests/inittests. GnuPG-bug-id: 3121 Reported-by: ka7 (klemens) Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-27g10: For signing, prefer available card key when no -u option.NIIBE Yutaka1-2/+28
* g10/skclist.c (build_sk_list): Ask gpg-agent if card is available. Then, use the card key if any. -- GnuPG-bug-id: 1983 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-26g10: Minor clean up.NIIBE Yutaka2-3/+1
* g10/main.h (complete_sig): Remove declaration. * g10/sign.c (complete_sig): Make it static. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-25dirmngr: Fix aliasing problem in dns.c.NIIBE Yutaka1-16/+18
* dirmngr/dns.c (dns_ai_setent): Care about aliasing. -- Co-authored-by: Tomas Mraz GnuPG-bug-id: 3105 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-25tests: Remove *.conf.tmpl from Makefile.NIIBE Yutaka1-1/+0
* tests/openpgp/Makefile.am (TEST_FILES): Remove gpg.conf.tmpl and gpg-agent.conf.tmpl. -- Fixes-commit: 06a177ceea529269a7404740c60416bd6a4567b1 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-25g10: invalidate the fd cache for keyring.NIIBE Yutaka1-1/+6
* g10/keyring.c (keyring_search_reset): Don't keep the FD cache. -- GnuPG-bug-id: 3096 Fixes-commit: 5556eca5acd46983bff0b38a1ffbc2f07fbaba9f Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-24w32: Enable wildcard expansion with mingw-w64Andre Heinecke1-0/+3
* g10/gpg.c: Define _dowildcard = -1; -- If this value is defined wildcard support in the c runtime is enabled again. This fixes a regression caused by switching to mingw 3.0 Signed-off-by: Andre Heinecke <aheinecke@intevation.de>
2017-04-24tests: Fix Python detection.Justus Winter1-9/+11
* tests/gpgme/gpgme-defs.scm (python): Fix Python detection. -- In 25e6444b3f4601c7821beab06bc4520deacb007b we changed the way GPGME creates the build directory for the Python bindings. We now use the basename of the interpreter as an identifier, that means we have to get the base name right, a link to the same binary is not sufficient. Signed-off-by: Justus Winter <justus@g10code.com>
2017-04-24gpgscm: Refactor cell finalization.Justus Winter1-24/+41
* tests/gpgscm/scheme.c (finalize_cell): Use switch, return whether the cell may be freed. (gc): Update callsite. Signed-off-by: Justus Winter <justus@g10code.com>
2017-04-24gpgscm: Tweak error message display.Justus Winter1-2/+7
* tests/gpgscm/init.scm (throw'): If the first argument to the error is a string, display it as such. Signed-off-by: Justus Winter <justus@g10code.com>
2017-04-24tests: Deduplicate and simplify code.Justus Winter5-33/+24
* tests/gpgme/gpgme-defs.scm (create-file): Move... * tests/gpgsm/gpgsm-defs.scm (create-file): ... likewise... * tests/openpgp/defs.scm (create-file): Here. (create-gpghome): Use 'create-file'. * tests/openpgp/gpg-agent.conf.tmpl: Delete file. * tests/openpgp/gpg.conf.tmpl: Likewise. Signed-off-by: Justus Winter <justus@g10code.com>
2017-04-24gpgscm: Fix test.Justus Winter1-2/+2
* tests/gpgscm/t-child.scm: Use 'string-length' on the string. Signed-off-by: Justus Winter <justus@g10code.com>
2017-04-24gpgscm: Improve syntax checking.Justus Winter1-2/+5
* tests/gpgscm/scheme.c (opexe_0): Make sure closure arguments are symbols. Signed-off-by: Justus Winter <justus@g10code.com>
2017-04-24gpgscm: Emit JUnit-style XML reports.Justus Winter9-14/+256
* tests/gpgscm/Makefile.am (EXTRA_DIST): Add new file. * tests/gpgscm/lib.scm (string-translate): New function. * tests/gpgscm/main.c (main): Load new file. * tests/gpgscm/tests.scm (dirname): New function. (test-pool): Record execution times, emit XML report. (test): Record execution times, record log file name, emit XML report. (run-tests-parallel): Write XML report. (run-tests-sequential): Likewise. * tests/gpgscm/xml.scm: New file. * tests/gpgme/Makefile.am (CLEANFILES): Add 'report.xml'. * tests/gpgsm/Makefile.am: Likewise. * tests/migrations/Makefile.am: Likewise. * tests/openpgp/Makefile.am: Likewise. Signed-off-by: Justus Winter <justus@g10code.com>
2017-04-24gpgscm: Make logging less verbose and more useful.Justus Winter1-4/+5
* tests/gpgscm/tests.scm (call-with-io): When being verbose, include the pid in the output, and avoid duplicating the command arguments. Signed-off-by: Justus Winter <justus@g10code.com>
2017-04-24gpgscm: Make test framework less functional.Justus Winter1-40/+35
* tests/gpgscm/tests.scm (test-pool, tests): Previously, these methods updated objects by creating new updated copies of the object being manipulated. This made the code awkward without any benefit, therefore I change it to just update the object. Signed-off-by: Justus Winter <justus@g10code.com>
2017-04-24tests: Locate resources and scripts relative to top source dir.Justus Winter87-182/+208
-- Locate every resource and every script used in the tests using a path relative to the top of the source tree. This is a purely mechanical change, mostly done using regular expressions, with a few manual fixups here and there. Signed-off-by: Justus Winter <justus@g10code.com>
2017-04-24gpgscm: Move 'trace' and 'stringify'.Justus Winter2-12/+12
* tests/gpgscm/tests.scm (trace, stringify): Move... * tests/gpgscm/lib.scm: ... here. Signed-off-by: Justus Winter <justus@g10code.com>
2017-04-24gpgscm: Avoid fruitless garbage collection cycles.Justus Winter2-8/+15
* tests/gpgscm/scheme-private.h (CELL_MINRECOVER): New macro. * tests/gpgscm/scheme.c (_get_cell): Move the heuristic to get more cells... (gc): ... here where every caller benefits from the optimization. Signed-off-by: Justus Winter <justus@g10code.com>
2017-04-20g13: Fix for Solaris.NIIBE Yutaka2-1/+4
* configure.ac: Check sys/mkdev.h. * g13/sh-dmcrypt.c: Include sys/mkdev.h. -- GnuPG-bug-id: 3098 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-18dirmngr: Fix final close of LISTEN_FD.NIIBE Yutaka1-3/+3
* dirmngr/dirmngr.c (handle_connections): Close LISTEN_FD. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-18dirmngr: Fix API difference for Windows.NIIBE Yutaka1-9/+10
* dirmngr/http.c (read_server, write_server): Use assuan_fd_t. (http_wait_response): Use FD2INT to get unsigned integer fd. (read_server, write_server): Likewise. (simple_cookie_read, simple_cookie_write): Use assuan_fd_t. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-17agent: More minor change.NIIBE Yutaka1-1/+0
* agent/command.c (cmd_pksign): Remove redundant assignment. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-17agent: Minor cleanup.NIIBE Yutaka2-3/+0
* agent/command-ssh.c (ssh_key_to_protected_buffer): Not touch ERR. * agent/command.c (cmd_genkey, cmd_import_key): Clean up. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-17tests: Minor memory fix.NIIBE Yutaka1-0/+2
* tests/openpgp/fake-pinentry.c (get_passphrase): Free the memory. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-17g10: Fix parse_ring_trust.NIIBE Yutaka1-1/+1
* g10/parse-packet.c (parse_ring_trust): Fix condition. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-17g10: Minor fixes.NIIBE Yutaka3-4/+5
* g10/export.c (cleartext_secret_key_to_openpgp): No initialization. (do_export_one_keyblock): Initialize with GPG_ERR_NOT_FOUND. * g10/getkey.c (get_best_pubkey_byname): Add non-null check. * g10/tofu.c (tofu_set_policy): ERR initialize to 0. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-17g10: Fix import/export filter property match.NIIBE Yutaka1-1/+1
* g10/import.c (impex_filter_getval): Fix to "else if". Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-14agent: Clean up error initialize/return.NIIBE Yutaka4-6/+2
* agent/call-pinentry.c (start_pinentry): Return RC. * agent/command-ssh.c (ssh_handler_request_identities): Don't set ERR. * agent/findkey.c (try_unprotect_cb): Return ERR. (unprotect): Don't set RC. * agent/gpg-agent.c (handle_connections): Don't set fd. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-14dirmngr: More fix for test program.NIIBE Yutaka1-0/+4
* dirmngr/t-http.c (main): Care about no TLS. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-14dirmngr: More fix for Windows.NIIBE Yutaka1-6/+6
* dirmngr/http.c (simple_cookie_read, simple_cookie_write): Only valid with HTTP_USE_NTBTLS. (_my_socket_new): Simply cast to int since it's for debug. (_my_socket_ref, _my_socket_unref): Likewise. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-13dirmngr: Fix http.c for sockaddr_storage.NIIBE Yutaka1-6/+7
dirmngr/http.c (use_socks): Use sockaddr_storage. (my_sock_new_for_addr, connect_server): Likewise. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-13dirmngr: Fix alignment of ADDR.NIIBE Yutaka2-16/+19
* dirmngr/dns-stuff.h (dns_addrinfo_s): Use struct sockaddr_storage for size and alignment. * dirmngr/dns-stuff.c (resolve_name_libdns): Follow the change. (resolve_dns_name): Use struct sockaddr_storage. (resolve_addr_standard, resolve_dns_addr): Likewise. (resolve_dns_addr): Likewise. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-13dirmngr: Fix thread key type.NIIBE Yutaka1-1/+1
* dirmngr/dirmngr.c (my_tlskey_current_fd): Use npth_key_t. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-13common, g10: Fix enumeration types.NIIBE Yutaka2-14/+21
* common/openpgpdefs.h (CIPHER_ALGO_PRIVATE10, PUBKEY_ALGO_PRIVATE10) (DIGEST_ALGO_PRIVATE10, COMPRESS_ALGO_PRIVATE10): New. * g10/misc.c (map_pk_gcry_to_openpgp): Add type conversion. (map_cipher_openpgp_to_gcry, openpgp_cipher_algo_name) (openpgp_pk_test_algo2, map_md_openpgp_to_gcry) (pubkey_get_npkey): Add default handling. -- Compilers may emit code assuming the maximum value of enum type. According to OpenPGP specification, there are cases for private uses. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-13dirmngr: More fix for Windows.NIIBE Yutaka1-1/+5
* dirmngr/dns.c (socket_fd_t, STDCALL): New. (dns_te_initname): Use. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-12dirmngr: Fix type of sock.NIIBE Yutaka1-1/+1
* dirmngr/http.c (send_request): Use assuan_fd_t for SOCK. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-12tools: Fix condition for gpg-connect-agent.NIIBE Yutaka1-1/+1
* tools/gpg-connect-agent.c (start_agent): Add paren. -- The intention is comparing the error code depending opt.use_dirmngr. Considering C Operator Precedence, we should have paren here. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-12dirmngr: Fix possible null reference.NIIBE Yutaka1-2/+3
* dirmngr/dns.c (dns_error_t dns_trace_fput): Check NULL. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-12common: Simplify format_text.NIIBE Yutaka5-13/+12
* common/stringhelp.c (format_text): Don't allow IN_PLACE formatting. * common/stringhelp.h: Change the API with no IN_PLACE. * common/t-stringhelp.c (test_format_text): Follow the change. * g10/gpgcompose.c (show_help): Likewise. * g10/tofu.c (format_conflict_msg_part1, ask_about_binding) (show_statistics, show_warning): Likewise. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-12gpgscm: Fix test program.NIIBE Yutaka1-2/+2
* tests/gpgscm/t-child.c (main): Fix for setmode. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-12dirmngr: Fix plus1_ns.NIIBE Yutaka1-1/+4
* dirmngr/dns.c (plus1_ns): Fix the initial implementation. -- Fixes-commit: 64904ce627b6b0661acf15b5b70103c4842bb0f3 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-12scd: Handle unexpected suspend/resume by CCID driver.NIIBE Yutaka1-4/+16
* scd/ccid-driver.c (bulk_in): Handle unexpected failure. -- GnuPG-bug-id: 3083 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-12dirmngr: Fix dns-stuff.c in another way.NIIBE Yutaka1-3/+2
* dirmngr/dns-stuff.c (T_CERT): Define our own. -- T_CERT may be defined by another enum type even if the value is same. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-12Revert "dirmngr: Fix dns-stuff.c."NIIBE Yutaka1-0/+1
This reverts commit 1538523156be568046f632d1775eae30ea8bd556.
2017-04-12dirmngr: Fix dns-stuff.c.NIIBE Yutaka1-1/+0
* dirmngr/dns-stuff.c: Don't include arpa/nameser.h. -- It is not needed at all. T_CERT may be defined by different type of ns_type. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-12agent: Simplify stream_read_cstring.NIIBE Yutaka1-7/+1
* agent/command-ssh.c (stream_read_cstring): Just call stream_read_string. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-12dirmngr: Use a function to increment network short.NIIBE Yutaka1-4/+13
* dirmngr/dns.c (plus1_ns): New. (dns_p_push): Use it. -- On OpenBSD, htons and ntohs are expanded to GCC's statement expressions where local variable is allowed. Consecutive use of htons and ntohs causes problem of variable name. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-12g10: Minor clean up for export.c.NIIBE Yutaka1-19/+16
* g10/export.c (export_ssh_key): Check IDENTIFIER for error. Release base64 thing on error of get_membuf. -- Compiler (older) may misunderstand the variable IDENTIFIER is not initialized, while good one can do better analysys on the value for ERR (and thus, IDENTIFIER). On the error of get_membuf, still, b64enc_finish should be called, even if it lost the ERR value. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-04-11g13: Include sys/sysmacros.h if available.NIIBE Yutaka2-1/+4
* configure.ac: Add test for sys/sysmacros.h. * g13/sh-dmcrypt.c: Include sys/sysmacros.h. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>