summaryrefslogtreecommitdiffstats
path: root/common (follow)
Commit message (Collapse)AuthorAgeFilesLines
* http: Revamp TLS API.Werner Koch2014-05-025-217/+739
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (NEED_GNUTLS_VERSION): New. (HTTP_USE_GNUTLS, LIBGNUTLS_CFLAGS, LIBGNUTLS_LIBS): New ac_subst. * common/http.h (http_session_t): New. * common/http.c: Remove compatibility for gnutls < 3.0. (http_session_s): New. (cookie_s): Replace gnutls_session_t by http_session_t. (tls_callback, tls_ca_certlist): New variables. (my_socket_unref): Add preclose args. (my_npth_read, my_npth_write): New. (make_header_line): Fix bug using int* instead of char*. (http_register_tls_callback): New. (http_register_tls_ca): New. (http_session_new): New. (http_session_release): New. (http_get_header_names): New. (escape_data): Add hack to escape in forms mode. (send_request) [HTTP_USE_GNUTLS]: Support SNI. (send_request) [HTTP_USE_GNUTLS]: Fix use of make_header_line. (send_gnutls_bye): New. (cookie_close): Make use of preclose feature. (http_verify_server_credentials): New. (main) [TEST]: Remove test code. * common/t-http.c: New. * common/tls-ca.pem: New. * common/Makefile.am (tls_sources): New. Move http code to here. (libcommontls_a_SOURCES): New. (libcommontlsnpth_a_SOURCES): New. (EXTRA_DIST): Add tls-ca.pem (module_maint_tests): Add t-http. (t_http_SOURCES, t_http_CFLAGS, t_http_LDADD): New. * dirmngr/Makefile.am (dirmngr_LDADD): Add libcommontlsnpth. -- This new TLS API for http.c is much more flexible than the crude old hack.
* common: Cleanup the use of USE_NPTH and HAVE_NPTH macros.Werner Koch2014-05-027-54/+37
| | | | | | | | | | | | | | | | | * configure.ac (HAVE_NPTH): New ac_define. * common/estream.c: Use USE_NPTH instead of HAVE_NPTH. * common/http.c: Ditto. Replace remaining calls to pth by npth calls. (connect_server): Remove useless _(). * common/exechelp-posix.c, common/exechelp-w32.c * common/exechelp-w32ce.c: Use HAVE_PTH to include npth.h. * common/init.c (_init_common_subsystems): Remove call to pth_init. * common/sysutils.c (gnupg_sleep): Use npth_sleep. * scd/ccid-driver.c (my_sleep): Ditto. -- USE_NPTH is used in case were we may build with and without nPth. The missing definition HAVE_NPTH didn't allowed us to build outher sources with nPTh support.
* estream: Implement "samethread" mode keyword.Werner Koch2014-04-301-54/+107
| | | | | | | | | | | | | | | | | | | * src/estream.c (estream_internal): Add field SAMETHREAD. (init_stream_lock, lock_stream, trylock_stream, unlock_stream): Use it. (parse_mode): Add arg SAMETHREAD and parse that keyword. (es_initialize): Rename to ... (init_stream_obj): this. Add arg SAMETHREAD. (es_create): Add arg SAMETHREAD. Call init_stream_lock after init_stream_obj. (doreadline): Call es_create with samethread flag. (es_fopen, es_mopen, es_fopenmem, es_fopencookie, do_fdopen) (do_fpopen, do_w32open): Implement "samethread" keyword. (es_freopen): Take samthread flag from old stream. (es_tmpfile): Call es)_create w/o samethread. -- Note: Unfortunately es_tmpfile has no mode arg so that we can't use samethread.
* estream: Fix deadlock in es_fileno.Werner Koch2014-04-301-1/+1
| | | | * src/estream.c (es_fileno_unlocked): Call the unlocked functions.
* estream: Add debug code to the lock functions.Werner Koch2014-04-301-3/+39
| | | | * common/estream.c (dbg_lock_0, dbg_lock_1, dbg_lock_1): New.
* estream: Replace locking macros by functions.Werner Koch2014-04-301-148/+186
| | | | | | | * common/estream.c: Replace most macros. -- The macros were too hard to read and actually blew up the source.
* estream: Migrate from Pth to nPth.Werner Koch2014-04-301-23/+22
| | | | | | -- Actually the mutex stuff was never used since we switched to nPth.
* gpg: Pass --homedir to gpg-agent.Werner Koch2014-04-222-14/+46
| | | | | | | | | | | | | | | * agent/gpg-agent.c (main): Make sure homedir is absolute. * common/asshelp.c (lock_spawning): Create lock file with an absolute name. (start_new_gpg_agent): Use an absolute name for the socket and pass option --homedir to the agent. (start_new_dirmngr): Use an absolute name for the --homedir. -- This patch makes gpg's --homedir option behave again like in older versions. This is done by starting a new agent for each different home directory. Note that this assumes --use-standard-socket is used which is the default for 2.1.
* common: Add functions make_absfilename and make_absfilename_try.Werner Koch2014-04-223-2/+174
| | | | | | * common/stringhelp.c (do_make_filename): Add modes 2 and 3. (make_absfilename): New. (make_absfilename_try): New.
* common: Add function gnupg_getcwd.Werner Koch2014-04-222-0/+31
| | | | | | * tools/gpg-connect-agent.c (gnu_getcwd): Move to ... * common/sysutils.c (gnupg_getcwd): .. here. * tools/gpg-connect-agent.c (get_var_ext): Use gnupg_getcwd.
* common: Add z-base-32 encoder.Werner Koch2014-04-174-2/+235
| | | | | | | * common/zb32.c: New. * common/t-zb32.c: New. * common/Makefile.am (common_sources): Add zb82.c (module_tests): Add t-zb32.
* Two minor code cleanups and one NULL deref on error fix.Werner Koch2014-04-161-1/+1
| | | | | | | | | | * common/estream.c (es_freopen): Remove useless check for STREAM. * kbx/keybox-blob.c (_keybox_create_x509_blob): Remove useless check for BLOB. * tools/sockprox.c (run_proxy): Do not fclose(NULL). -- Found by Hans-Christoph Steiner with cppcheck.
* dirmngr: Fix compiler warning.Werner Koch2014-04-081-0/+2
| | | | | | | | | | * common/mischelp.h (JNLIB_GCC_HAVE_PUSH_PRAGMA): New. * dirmngr/dirmngr.c (handle_tick): Factor time check out to ... (time_for_housekeeping_p): new. -- I am not sure whether that y2038 hack is really useful but it might make me smile in my retirement.
* g10: EdDSA support.NIIBE Yutaka2014-04-081-1/+1
| | | | | | * g10/keyid.c (keygrip_from_pk): Compute keygrip of EdDSA key. * g10/keygen.c (generate_subkeypair): Ed25519 is for EdDSA. * common/openpgp-oid.c (oid_ed25519): Update.
* Change some keyedit functions to allow printing to arbitrary streams.Werner Koch2014-03-272-35/+85
| | | | | | | | | | | * common/ttyio.c (tty_print_string): Add optional arg FP. Change all callers. (tty_print_utf8_string2): Ditto. * g10/keyedit.c (show_prefs): Ditto. (show_key_with_all_names_colon): Ditto. (show_names): Ditto. * g10/keylist.c (print_revokers): Ditto. (print_fingerprint): Ditto.
* agent: Cleanups to prepare implementation of Ed25519.Werner Koch2014-03-221-38/+103
| | | | | | | | | | | | * agent/cvt-openpgp.c: Remove. (convert_to_openpgp): Use gcry_sexp_extract_param. * agent/findkey.c (is_eddsa): New. (agent_is_dsa_key, agent_is_eddsa_key): Check whether ecc means EdDSA. * agent/pksign.c (agent_pksign_do): Add args OVERRIDEDATA and OVERRIDEDATALEN. * common/ssh-utils.c (is_eddsa): New. (get_fingerprint): Take care or EdDSA.
* common: New function elapsed_time_string.Werner Koch2014-03-182-0/+41
| | | | * common/gettime.c (elapsed_time_string): New.
* dirmngr: Make use of IPv4 and IPV6 more explicit.Werner Koch2014-03-142-6/+12
| | | | | | | | | * common/http.c (connect_server): Handle the new flags. * common/http.h (HTTP_FLAG_IGNORE_IPv4, HTTP_FLAG_IGNORE_IPv4): New. * dirmngr/ks-engine-hkp.c (map_host): Add arg r_httpflags. (make_host_part): Ditto. (send_request): Add arg httpflags. (ks_hkp_search, ks_hkp_get, ks_hkp_put): Handle httpflags.
* gpg: Print the actual used keyserver address.Werner Koch2014-03-141-1/+1
| | | | | | | | | | | | | | | | | | | | * dirmngr/ks-engine-hkp.c (ks_hkp_search, ks_hkp_get): Print SOURCE status lines. * g10/call-dirmngr.c (ks_status_parm_s): New. (ks_search_parm_s): Add field stparm. (ks_status_cb): New. (ks_search_data_cb): Send source to the data callback. (gpg_dirmngr_ks_search): Change callback prototope to include the SPECIAL arg. Adjust all users. Use ks_status_cb. (gpg_dirmngr_ks_get): Add arg r_source and use ks_status_cb. * g10/keyserver.c (search_line_handler): Adjust callback and print "data source" disgnostic. (keyserver_get): Print data source diagnostic. -- It has often been requested that the actually used IP of a keyservers is shown in with gpg --recv-key and --search-key. This is helpful if the keyserver is actually a pool of keyservers. This patch does this.
* dirmngr: Default to a user socket name and enable autostart.Werner Koch2014-03-143-12/+67
| | | | | | | | | | | | | | | * common/homedir.c (dirmngr_socket_name): Rename to dirmngr_sys_socket_name. (dirmngr_user_socket_name): New. * common/asshelp.c (start_new_dirmngr): Handle sys and user dirmngr socket. * dirmngr/dirmngr.c (main): Ditto. * dirmngr/server.c (cmd_getinfo): Ditto. * sm/server.c (gpgsm_server): Ditto. * dirmngr/dirmngr-client.c (start_dirmngr): Likewise. * tools/gpgconf.c (main): Print "dirmngr-sys-socket" with --list-dirs. * configure.ac (USE_DIRMNGR_AUTO_START): Set by default.
* gpg: Add option --dirmngr-program.Werner Koch2014-03-121-0/+6
| | | | | | | | | | | * g10/gpg.c: Add option --dirmngr-program. * g10/options.h (struct opt): Add field dirmngr_program. * g10/call-dirmngr.c (create_context): Use new var. * dirmngr/dirmngr.c: Include gc-opt-flags.h. (main): Remove GC_OPT_FLAG_*. * tools/gpgconf-comp.c (GC_OPT_FLAG_NO_CHANGE): Move macro to ... * common/gc-opt-flags.h: here.
* http: Add a flag to the URL parser indicating a literal v6 address.Werner Koch2014-03-122-0/+3
| | | | | * common/http.h (struct parsed_uri_t): Add field v6lit. * common/http.c (do_parse_uri): Set v6lit.
* Use attribute __gnu_printf__ also in estream header files.Werner Koch2014-03-072-10/+18
| | | | | * common/estream-printf.h: Use attribute gnu_printf. * common/estream.h: Ditto.
* Use attribute __gnu_printf__ with our estream-printf functions.Werner Koch2014-03-071-2/+9
| | | | | | | | | * common/mischelp.h (JNLIB_GCC_A_PRINTF): Use __gnu_printf__ (JNLIB_GCC_A_NR_PRINTF): Ditto. -- Our printf supports most of the GNU features and thus we can silence the warnings from mingw.
* Silence several warnings when building under Windows.Werner Koch2014-03-073-2/+9
| | | | | | | | | | | | | | | | | | | | | | | * agent/call-scd.c (start_scd): Replace int by assuan_fd_t. (start_pinentry): Ditto. * common/asshelp.c (start_new_gpg_agent): Replace int by assuan_fd_t. * common/dotlock.c (GNUPG_MAJOR_VERSION): Include stringhelp.h for prototypes on Windows and some other platforms. * common/logging.c (fun_writer): Declare addrbuf only if needed. * g10/decrypt.c (decrypt_message_fd) [W32]: Return not_implemented. * g10/encrypt.c (encrypt_crypt) [W32]: Return error if used in server mode. * g10/dearmor.c (dearmor_file, enarmor_file): Replace GNUPG_INVALID_FD by -1 as temporary hack for Windows. * g10/export.c (do_export): Ditto. * g10/revoke.c (gen_desig_revoke, gen_revoke): Ditto. * g10/sign.c (sign_file, clearsign_file, sign_symencrypt_file): Ditto. * g10/server.c (cmd_verify, gpg_server) [W32]: Return an error. -- The gpg server mode is not actual working and thus we can avoid the warnings by explicitly disabling the mode. We keep it working under Unix, though.
* w32: Include winsock2.h to silence warnings.Werner Koch2014-03-0714-4/+46
|
* common: Fix build problem with Sun Studio compiler.Werner Koch2014-03-071-4/+6
| | | | | | | | | | | | | | | | | * common/estream.c (ESTREAM_MUTEX_UNLOCK): Use int dummy dummy functions. (ESTREAM_MUTEX_INITIALIZE): Ditto. -- GnuPG-bug-id: 1566 Signed-off-by: Werner Koch <wk@gnupg.org> (cherry picked from commit 571bcd4662a351cfa55bbf1a79ed1bc26da5780f) Reolved conflicts: common/estream.c Warning: estream.c still uses pth_mutex_* which is definitely wrong. Needs to be investigated.
* w32: Define WINVER only if needed.Werner Koch2014-03-071-1/+3
| | | | * common/sysutils.c (WINVER): Define only if less that 5.0.
* w32: Remove unused code.Werner Koch2014-03-071-98/+0
| | | | * jnlib/w32-reg.c (write_w32_registry_string): Remove.
* ssh: Add support for Putty.Werner Koch2014-03-072-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * agent/gpg-agent.c [W32]: Include Several Windows header. (opts): Change help text for enable-ssh-support. (opts, main): Add option --enable-putty-support (putty_support, PUTTY_IPC_MAGIC, PUTTY_IPC_MAXLEN): New for W32. (agent_init_default_ctrl): Add and asssert call. (putty_message_proc, putty_message_thread): New. (handle_connections) [W32]: Start putty message thread. * common/sysutils.c (w32_get_user_sid): New for W32 only * tools/gpgconf-comp.c (gc_options_gpg_agent): Add --enable-ssh-support and --enable-putty-support. Make the configuration group visible at basic level. * agent/command-ssh.c (serve_mmapped_ssh_request): New for W32 only. -- This patch enables support for Putty. It has been tested with Putty 0.62 using an Unix created ssh key copied to the private-keys-v1.d directory on Windows and with a manually crafted sshcontrol file. It also works with a smartcard key. May thanks to gniibe who implemented a proxy in Python to test the putty/gpg-agent communication. Signed-off-by: Werner Koch <wk@gnupg.org> (cherry picked from commit 9f32499f99a0817f63f7a73b09bdcebe60d4775d) Resolved conflicts: NEWS agent/agent.h agent/gpg-agent.c: Convert from pth to npth. common/sysutils.c common/sysutils.h
* Allow marking options as ignored.Werner Koch2014-03-072-14/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * jnlib/argparse.h (ARGPARSE_OPT_IGNORE): New. (ARGPARSE_TYPE_MASK): New, for internal use. (ARGPARSE_ignore): New. * jnlib/argparse.c (optfile_parse, arg_parse): Replace remaining constants by macros. (optfile_parse): Implement ARGPARSE_OPT_IGNORE. (arg_parse): Exclide ignore options from --dump-options. -- In addition to the ignore-invalid-option (commit 41d56433) it is often useful to mark options in a configuration which as NOP. For example options which have no more function at all but can be expected to be found in existing conf files. Such an option (or command) may now be given as ARGPARSE_ignore (300, "obsolete-option") The 300 is merely used as a non-valid single option name much like group names or the 500+n values used for long options. Signed-off-by: Werner Koch <wk@gnupg.org> (cherry picked from commit 54c54e2824aab5716a187bbbf6dff8860d6a6056) Resolved conflicts: common/argparse.c: Fixed.
* common: Fix recent commit 55656208.Werner Koch2014-03-061-3/+3
| | | | | | | * common/membuf.c (get_membuf_shrink): Fix use of LEN. -- Oops, what a stupid bug.
* common: Replace all macros in strusage() returned strings.Werner Koch2014-02-261-71/+5
| | | | | | * common/argparse.c (writechar): Remove. (writestrings): Simplify. (strusage): Use map_static_macro_string.
* common: New function map_static_macro_string.Werner Koch2014-02-265-2/+281
| | | | | | | * common/mapstrings.c: New. * common/t-mapstrings.c: New. * common/t-support.h (DIM, DIMof): Define if not defined. * common/Makefile.am: Add new files.
* common: New function get_membuf_shrink.Werner Koch2014-02-262-0/+26
| | | | * common/membuf.c (get_membuf_shrink): New.
* common: Require an installed libiconv.Werner Koch2014-02-261-89/+4
| | | | | | | | | | | | | | * common/utf8conv.c: Remove dynload.h. (load_libiconv): Remove. Remove all calls to it. -- The iconv functions are standard feature on most systems and in any case libiconv can be used to provide the functions. The old code used to dlopen iconv.dll on Windows. This goes back to GnuPG-1 which was designed as a one-binary program without any hard dependencies. GnuPG2 however demands a lot of libraries anyway and thus there is no more need for the fragile code to load a possible wrong version of iconv.dll at runtime.
* tests: Avoid segv if dns cert lookup is not configured.Werner Koch2014-02-101-4/+4
| | | | * common/dns-cert.c (get_dns_cert) [!USE_DNS_CERT]: Reset return args.
* gpg: Change format for the key size in --list-key and --edit-key.Werner Koch2014-02-051-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/gpg.c (oLegacyListMode, opts, main): Add --legacy-list-mode. * g10/options.h (struct opt): Add field legacy_list_mode. * g10/keydb.h (PUBKEY_STRING_SIZE): New. * g10/keyid.c (pubkey_string): New. * g10/import.c (import_one, import_secret_one): Use pubkey_string. * g10/keylist.c (print_seckey_info): Ditto. (print_pubkey_info, print_card_key_info): Ditto. (list_keyblock_print): Ditto. * g10/mainproc.c (list_node): Ditto. * g10/pkclist.c (do_edit_ownertrust, build_pk_list): Ditto. * g10/keyedit.c (show_key_with_all_names): Ditto. Also change the format. (show_basic_key_info): Ditto. * common/openpgp-oid.c (openpgp_curve_to_oid): Also allow "ed25519". (openpgp_oid_to_curve): Downcase "ed25519" -- For ECC it seems to be better to show the name of the curve and not just the size of the prime field. The curve name does not anymore fit into the "<size><letter>" descriptor (e.g. "2048R") and a fixed length format does not work either. Thus the new format uses "rsa2048" - RSA with 2048 bit "elg1024" - Elgamal with 1024 bit "ed25519" - ECC using the curve Ed25519. "E_1.2.3.4" - ECC using the unsupported curve with OID "1.2.3.4". unless --legacy-list-mode is given. In does not anymore line up nicely in columns thus I expect further changes to this new format. Signed-off-by: Werner Koch <wk@gnupg.org>
* gpg: Use only OpenPGP cipher algo ids.Werner Koch2014-01-311-3/+1
| | | | | | | | | | | | | | | | | | * g10/misc.c (map_cipher_openpgp_to_gcry): Use explicit mapping and use enums for the arg and return value. (map_cipher_gcry_to_openpgp): Ditto. (openpgp_cipher_blocklen): Use constant macros. (openpgp_cipher_test_algo): Use mapping function and prepare to disable algorithms. (openpgp_cipher_algo_name): Do not use Libgcrypt. * g10/ecdh.c (pk_ecdh_encrypt_with_shared_point): Replace CGRY_CIPHER_* by CIPHER_ALGO_*. * common/openpgpdefs.h (cipher_algo_t): Remove unused CIPHER_ALGO_DUMMY. Signed-off-by: Werner Koch <wk@gnupg.org>
* gpg: Use only OpenPGP public key algo ids and add the EdDSA algo id.Werner Koch2014-01-302-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/sexputil.c (get_pk_algo_from_canon_sexp): Change to return a string. * g10/keygen.c (check_keygrip): Adjust for change. * sm/certreqgen-ui.c (check_keygrip): Likewise. * agent/pksign.c (do_encode_dsa): Remove bogus map_pk_openpgp_to_gcry. * g10/misc.c (map_pk_openpgp_to_gcry): Remove. (openpgp_pk_test_algo): Change to a wrapper for openpgp_pk_test_algo2. (openpgp_pk_test_algo2): Rewrite. (openpgp_pk_algo_usage, pubkey_nbits): Add support for EdDSA. (openpgp_pk_algo_name): Rewrite to remove need for gcry calls. (pubkey_get_npkey, pubkey_get_nskey): Ditto. (pubkey_get_nsig, pubkey_get_nenc): Ditto. * g10/keygen.c(do_create_from_keygrip): Support EdDSA. (common_gen, gen_ecc, ask_keysize, generate_keypair): Ditto. * g10/build-packet.c (do_key): Ditto. * g10/export.c (transfer_format_to_openpgp): Ditto. * g10/getkey.c (cache_public_key): Ditto. * g10/import.c (transfer_secret_keys): Ditto. * g10/keylist.c (list_keyblock_print, list_keyblock_colon): Ditto. * g10/mainproc.c (proc_pubkey_enc): Ditto. * g10/parse-packet.c (parse_key): Ditto, * g10/sign.c (hash_for, sign_file, make_keysig_packet): Ditto. * g10/keyserver.c (print_keyrec): Use openpgp_pk_algo_name. * g10/pkglue.c (pk_verify, pk_encrypt, pk_check_secret_key): Use only OpenPGP algo ids and support EdDSA. * g10/pubkey-enc.c (get_it): Use only OpenPGP algo ids. * g10/seskey.c (encode_md_value): Ditto. -- This patch separates Libgcrypt and OpenPGP public key algorithms ids and in most cases completely removes the Libgcrypt ones. This is useful because for Libgcrypt we specify the algorithm in the S-expressions and the public key ids are not anymore needed. This patch also adds some support for PUBKEY_ALGO_EDDSA which will eventually be used instead of merging EdDSA with ECDSA. As of now an experimental algorithm id is used but the plan is to write an I-D so that we can get a new id from the IETF. Note that EdDSA (Ed25519) does not yet work and that more changes are required. The ECC support is still broken right now. Needs to be fixed. Signed-off-by: Werner Koch <wk@gnupg.org>
* gpg: Remove cipher.h and put algo ids into a common file.Werner Koch2014-01-291-0/+62
| | | | | | | | | | | | | | | | | | * common/openpgpdefs.h (cipher_algo_t, pubkey_algo_t, digest_algo_t) (compress_algo_t): New. * agent/gpg-agent.c: Remove ../g10/cipher.h. Add openpgpdefs.h. * g10/cipher.h (DEK): Move to ... * g10/dek.h: new file. * g10/cipher.h (is_RSA, is_ELGAMAL, is_DSA) (PUBKEY_MAX_NPKEY, PUBKEY_MAX_NSKEY, PUBKEY_MAX_NSIG, PUBKEY_MAX_NENC) (PUBKEY_USAGE_SIG, PUBKEY_USAGE_ENC, PUBKEY_USAGE_CERT) (PUBKEY_USAGE_AUTH, PUBKEY_USAGE_NONE): Move to * g10/packet.h: here. * g10/cipher.h: Remove. Remove from all files. * g10/filter.h, g10/packet.h: Include dek.h. * g10/Makefile.am (common_source): Remove cipher.h. Add dek.h. Signed-off-by: Werner Koch <wk@gnupg.org>
* include: Remove this directory.Werner Koch2014-01-295-11/+536
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * include/cipher.h: Move to ... * g10/cipher.h: here. * agent/gpg-agent.c: Adjust header file name. * include/host2net.h: Move to ... * common/host2net.h: here. Change license to LGPLv3/GPLv2. Adjust notices to reflect that only me worked on that file. * include/types.h: Remove. * common/types.h: Include inttypes.h. Add byte typedef and comments for __riscos__. * common/iobuf.h: Adjust header file name. * include/_regex.h: Remove this unused file. * include/Makefile.am: Remove. * Makefile.am (SUBDIRS): Remove "include". * configure.ac (AC_CONFIG_FILES): Remove include/Makefile. * include/ChangeLog-2011: Move to ... * common/ChangeLog-2011.include: here. * common/Makefile.am (EXTRA_DIST): Add file. * include/zlib-riscos.h: Move this repo only file to ... * g10/zlib-riscos.h: here. * include/: Remove. -- include/ was a leftover from GnuPG 1.x times. Signed-off-by: Werner Koch <wk@gnupg.org>
* Remove unused u64 type definitions.Werner Koch2014-01-171-14/+0
| | | | | | | | | | | * configure.ac: Remove check for uint64 and UINT64_C. * include/types.h: Remove u64 stuff. * common/types.h: Ditto. -- There have been relicts from GnuPG-1. Signed-off-by: Werner Koch <wk@gnupg.org>
* Add secp256k1.NIIBE Yutaka2014-01-151-0/+7
| | | | | | | | | * common/openpgp-oid.c (openpgp_curve_to_oid): Add secp256k1. (openpgp_oid_to_curve): Likewise. * g10/keygen.c (ask_curve): Add secp256k1. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* w32: Add macro for the registry key.Werner Koch2014-01-082-2/+2
| | | | | | * configure.ac (GNUPG_REGISTRY_DIR) [W32]: New ac-define. * common/homedir.c (default_homedir): Use it. * common/logging.c (do_logv): Use it.
* gpg: Change OID of Ed25519 and add Brainpool oids.Werner Koch2013-12-051-6/+27
| | | | | | | | | | | | | * common/openpgp-oid.c (openpgp_curve_to_oid): Change OID for Ed25519. Add brainpool OIDs. (openpgp_oid_to_curve): Ditto. -- This change is required to the change in Libgcrypt. Note that we will likely use a different OpenPGP algorithm ID for EdDSA and thus the current Ed25519 implementation will not stay with us. Signed-off-by: Werner Koch <wk@gnupg.org>
* common: Add put_membuf_printf.Werner Koch2013-11-292-0/+26
| | | | | | | | | * common/membuf.c (put_membuf_printf): New. -- This is just a convenience function for easier code readability. Signed-off-by: Werner Koch <wk@gnupg.org>
* Make use of the *_NAME etc macros.Werner Koch2013-11-186-16/+18
| | | | | | | | | Replace hardwired strings at many places with new macros from config.h and use the new strusage macro replacement feature. * common/asshelp.c (lock_spawning) [W32]: Change the names of the spawn sentinels. * agent/command.c (cmd_import_key): Use asprintf to create the prompt.
* Add strusage macro replacement feature.Werner Koch2013-11-181-32/+71
| | | | | | | | | | | | | * common/argparse.c (writechar): New. (writestrings): Add macro replacement feature. (show_help): Remove specialized @EMAIL@ replacement. * configure.ac (GNUPG_NAME, GPG_NAME, GPGSM_NAME): Define. (GPG_AGENT_NAME, DIRMNGR_NAME, G13_NAME, GPGCONF_NAME): Define. (GPGTAR_NAME, GPG_AGENT_INFO_NAME, GPG_AGENT_SOCK_NAME): Define. (GPG_AGENT_SSH_SOCK_NAME, DIRMNGR_INFO_NAME): Define. (DIRMNGR_SOCK_NAME): Define. Signed-off-by: Werner Koch <wk@gnupg.org>
* gpg: Rework ECC support and add experimental support for Ed25519.Werner Koch2013-11-153-1/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * agent/findkey.c (key_parms_from_sexp): Add algo name "ecc". (agent_is_dsa_key): Ditto. (agent_is_eddsa_key): New. Not finished, though. * agent/pksign.c (do_encode_eddsa): New. (agent_pksign_do): Use gcry_log_debug functions. * agent/protect.c (agent_protect): Parse a flags parameter. * g10/keygen.c (gpg_curve_to_oid): Move to ... * common/openpgp-oid.c (openpgp_curve_to_oid): here and rename. (oid_ed25519): New. (openpgp_oid_is_ed25519): New. (openpgp_oid_to_curve): New. * common/t-openpgp-oid.c (test_openpgp_oid_is_ed25519): New. * g10/build-packet.c (gpg_mpi_write): Write the length header also for opaque MPIs. (gpg_mpi_write_nohdr): New. (do_key): Use gpg_mpi_write_nohdr depending on algorithm. (do_pubkey_enc): Ditto. * g10/ecdh.c (pk_ecdh_encrypt_with_shared_point): Use gpg_mpi_write_nohdr. * g10/export.c (transfer_format_to_openpgp): * g10/keygen.c (ecckey_from_sexp): Return the error. (gen_ecc): Repalce arg NBITS by CURVE. (read_parameter_file): Add keywords "Key-Curve" and "Subkey-Curve". (ask_curve): New. (generate_keypair, generate_subkeypair): Use ask_curve. (do_generate_keypair): Also pass curve name. * g10/keylist.c (list_keyblock_print, list_keyblock_colon): Print curve name. * g10/parse-packet.c (mpi_read): Remove workaround for Libcgrypt < 1.5. (parse_key): Fix ECC case. Print the curve name. * g10/pkglue.c (mpi_from_sexp): Rename to get_mpi_from_sexp. (pk_verify, pk_check_secret_key): Add special case for Ed25519. * g10/seskey.c (encode_md_value): Ditto. * g10/sign.c (do_sign, hash_for, sign_file): Ditto. -- Be warned that this code is subject to further changes and that the format will very likely change before a release. There are also known bugs and missing code. Signed-off-by: Werner Koch <wk@gnupg.org>