aboutsummaryrefslogtreecommitdiffstats
path: root/common (follow)
Commit message (Collapse)AuthorAgeFilesLines
* common/iobuf.h: Clarify semantics of nofast. Simplify implementation.Neal H. Walfield2015-08-202-5/+9
| | | | | | | | * common/iobuf.h (struct iobuf_struct): Clarify semantics of nofast. Simplify use of nofast to implement just these semantics. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/iobuf.c: Remove dead code (directfp).Neal H. Walfield2015-08-202-65/+1
| | | | | | | | * common/iobuf.h (struct iobuf_struct): Remove field directfp. Remove all uses of it. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/iobuf.c: Remove dead code (opaque).Neal H. Walfield2015-08-202-5/+1
| | | | | | | | * common/iobuf.h (struct iobuf_struct): Remove field opaque. Remove all uses of it. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/iobuf.h: Replace further use of literals with symbolic constants.Neal H. Walfield2015-08-202-40/+44
| | | | | | | | | | | * common/iobuf.c: Move BLOCK_FILTER_INPUT, BLOCK_FILTER_OUTPUT_BLOCK_FILTER_TEMP from here... * common/iobuf.h: ... to here and rename to IOBUF_INPUT, IOBUF_OUTPUT and IOBUF_TEMP, respectively. Where appropriate, use these macros instead of a literal. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* Inform a user about inquire length limit.Ben Kibbey2015-08-151-1/+3
| | | | | | | | | | * common/status.h (INQUIRE_MAXLEN): New. * g10/call-agent.c (default_inquire_cb): Send STATUS_INQUIRE_MAXLEN. client when inquiring a passphrase over pinentry-loopback. -- This is to inform a user about the maximum length of a passphrase. The limit is the same that gpg-agent uses.
* common/iobuf.c: Replace use of literals with symbolic constants.Neal H. Walfield2015-08-081-22/+38
| | | | | | | | | | * common/iobuf.c (BLOCK_FILTER_INPUT): Define. Where appropriate, use this instead of a literal. (BLOCK_FILTER_OUTPUT): Likewise. (BLOCK_FILTER_TEMP): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common: Change alias for Curve25519 to "cv25519".Werner Koch2015-08-071-1/+1
| | | | | | | | | | | | | | | | * common/openpgp-oid.c (oidtable): Change alias. -- This is a cosmetic change so that common and expected common algorithms line up nicely in a keylisting. For example: pub ed25519/C68CE6D1ED0319C8 2015-08-06 uid [ultimate] Curve25519 Test 150806.1 sub cv25519/49238B9F0712C9BF 2015-08-06 sub rsa2048/8AEAF74014699D2C 2015-08-06 sub cv25519/8EC3776830B08736 2015-08-06 Signed-off-by: Werner Koch <[email protected]>
* Curve25519 support.NIIBE Yutaka2015-08-062-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | * agent/cvt-openpgp.c (get_keygrip): Handle Curve25519. (convert_secret_key, convert_transfer_key): Ditto. * common/openpgp-oid.c (oidtable): Add Curve25519. (oid_crv25519, openpgp_oid_is_crv25519): New. * common/util.h (openpgp_oid_is_crv25519): New. * g10/ecdh.c (pk_ecdh_encrypt_with_shared_point): Handle the case with Montgomery curve which uses x-only coordinate. * g10/keygen.c (gen_ecc): Handle Curve25519. (ask_curve): Change the API and second arg is to return subkey algo. (generate_keypair, generate_subkeypair): Follow chage of ask_curve. * g10/keyid.c (keygrip_from_pk): Handle Curve25519. * g10/pkglue.c (pk_encrypt): Handle Curve25519. * g10/pubkey-enc.c (get_it): Handle the case with Montgomery curve. * scd/app-openpgp.c (ECC_FLAG_DJB_TWEAK): New. (send_key_attr): Work with general ECC, Ed25519, and Curve25519. (get_public_key): Likewise. (ecc_writekey): Handle flag_djb_tweak. -- When libgcrypt has Curve25519, GnuPG now supports Curve25519.
* common: extend API of openpgp_oid_to_curve for canonical name.NIIBE Yutaka2015-08-062-5/+5
| | | | | | | | | | | | | | | * common/openpgp-oid.c (openpgp_oid_to_curve): Add CANON argument. * common/util.h: Update. * g10/import.c (transfer_secret_keys): Follow the change. * g10/keyid.c (pubkey_string): Likewise. * g10/keylist.c (list_keyblock_print, list_keyblock_colon): Likewise. * parse-packet.c (parse_key): Likewise. * scd/app-openpgp.c (send_key_attr, get_public_key): Likewise. -- Change the function so that caller can select canonical name of curve or name for printing. Suggested by wk.
* common,w32: Avoid unused var warning about msgcache.Werner Koch2015-07-281-6/+16
| | | | | | | | * common/i18n.c (USE_MSGCACHE): New. (msgcache) [!USE_MSGCACHE]: Do not define. (i18n_localegettext): Repalce #if conditions by USE_MSGCACHE. Signed-off-by: Werner Koch <[email protected]>
* w32: Try more places to find an installed Pinentry.Werner Koch2015-07-281-8/+33
| | | | | | | * common/homedir.c (get_default_pinentry_name): Re-implement to support several choices for Windows. Signed-off-by: Werner Koch <[email protected]>
* Replace GNUPG_GCC_A_ macros by GPGRT_ATTR_ macros.Werner Koch2015-07-268-66/+76
| | | | | | | | | | | | | * common/util.h: Provide replacement for GPGRT_ATTR_ macros when using libgpg-error < 1.20. * common/mischelp.h: Ditto. * common/types.h: Ditto. -- Given that libgpg-error is a dependency of all GnuPG related libraries it is better to define such macros at only one place instead of having similar macros at a lot of places. For now we need repalcement macros, though.
* Avoid a leading double slash in make_filename.Werner Koch2015-07-221-2/+14
| | | | * common/stringhelp.c (do_make_filename): Special case leading '/'.
* g10: Use canonical name for curve.NIIBE Yutaka2015-07-081-3/+3
| | | | | | | | * g10/import.c (transfer_secret_keys): Use canonical name. * common/openpgp-oid.c (openpgp_curve_to_oid): Return NULL on error. * g10/keyid.c (pubkey_string): Follow change of openpgp_curve_to_oid. * g10/keylist.c (list_keyblock_print, list_keyblock_colon): Ditto. * g10/parse-packet.c (parse_key): Ditto.
* common: Implement i18n_localegettext.Werner Koch2015-07-011-4/+104
| | | | | | | | | | | | | | | | * common/i18n.c (msg_cache_s, msg_cache_head_s): New. (msgcache): New. (i18n_localegettext): Implement locale dependent lookup. -- This is the second and final part of the change to use the gpg provided locale for Pinentry strings. It does not yet work on Windows, though. This commit should resolve Debian-bug-id: 788983 Signed-off-by: Werner Koch <[email protected]>
* Pass DBUS_SESSION_BUS_ADDRESS for gnome3Daniel Kahn Gillmor2015-06-301-0/+2
| | | | | | | | * common/session-env.c (stdenvnames): Add DBUS_SESSION_BUS_ADDRESS. -- pinentry-gnome3 talks to the gcr prompter via dbus. Without this environment variable, it can't find the correct session to talk to.
* Flag the L_() function with attribute format_arg.Werner Koch2015-06-302-1/+19
| | | | | | | | | | | | * agent/agent.h (LunderscorePROTO): New. * common/util.h (GNUPG_GCC_ATTR_FORMAT_ARG): New. * common/i18n.h (GNUPG_GCC_ATTR_FORMAT_ARG): New. Use for i18n_localegettext. Expand LunderscorePROTO. * agent/genkey.c (check_passphrase_constraints): Use xtryasprintf again to keep the old translations. -- Signed-off-by: Werner Koch <[email protected]>
* agent: Use different translation func for Pinentry strings.Werner Koch2015-06-302-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * po/Makevars (XGETTEXT_OPTIONS): Add keyword "L_". * common/i18n.c (i18n_localegettext): New stub. * common/i18n.h: Expand the LunderscoreIMPL macro. * agent/agent.h (L_): New. (LunderscoreIMPL): New. * agent/call-pinentry.c (setup_qualitybar): Add arg ctrl anc change caller. * agent/findkey.c (try_unprotect_cb): Add local var ctrl. * agent/genkey.c (check_passphrase_constraints): Replace xtryasprintf by xtrystrdup to avoid gcc warning. Unfortinately this changes the string. (agent_ask_new_passphrase): Cleanup the use of initial_errtext. -- Static strings in gpg-agent need to be translated according to the locale set by the caller. This is required so that a gpg-agent can be started in one locale and a gpg can be run in another. If we don't do this the static strings (prompt, buttons) are not or in the wrong locale translated while dynamic strings (e.g. key description) uses the locale of gpg. This is only the first part of the change the actual local switching still needs to be implemented. Debian-bug-id: 788983 Signed-off-by: Werner Koch <[email protected]>
* common: Improve fucntion parse_debug_flag.Werner Koch2015-06-231-2/+13
| | | | | | | * common/miscellaneous.c (parse_debug_flag): Add hack not to call exit. Add "none" and "all" flags. Signed-off-by: Werner Koch <[email protected]>
* common: Add function parse_debug_flagWerner Koch2015-06-222-0/+89
| | | | | | | * common/miscellaneous.c (parse_debug_flag): New. * common/util.h (struct debug_flags_s): New. Signed-off-by: Werner Koch <[email protected]>
* common: Add function strtokenize.Werner Koch2015-06-223-0/+212
| | | | | | | | * common/stringhelp.c: Include assert.h. (strtokenize): New. * common/t-stringhelp.c (test_strtokenize): New. Signed-off-by: Werner Koch <[email protected]>
* agent: Print a warning for obsolete options.Werner Koch2015-06-172-0/+17
| | | | | | | | | | | * g10/misc.c (obsolete_scdaemon_option): Move to * common/miscellaneous.c (obsolete_option): ... here. * agent/gpg-agent.c (main): Use obsolete_option for the 3 obsolete options. -- GnuPG-bug-id: 2016 Signed-off-by: Werner Koch <[email protected]>
* Convey envvar INSIDE_EMACS to the pinentry.Werner Koch2015-06-081-1/+3
| | | | | | * common/session-env.c (stdenvnames): Add it. Signed-off-by: Werner Koch <[email protected]>
* common: Cope with AIX problem on number of open files.Werner Koch2015-05-111-0/+10
| | | | | | | | * common/exechelp-posix.c: Limit returned value for too hight values. -- GnuPG-bug-id: 1778 Signed-off-by: Werner Koch <[email protected]>
* common: Remove JNLIB from boiler plate (jnlib merge).Werner Koch2015-04-2431-220/+124
| | | | | | | * common/README.jnlib: Remove. -- This is the final part of merging jnlib into gnupg/common.
* common: Rename log and gcc attribute macros (jnlib merge).Werner Koch2015-04-2410-82/+82
| | | | | | | | | | | * common/logging.h: Rename JNLIB_LOG_* to GPGRT_LOG_*. * common/mischelp.h: Rename JNLIB_GCC_* to GPGRT_GCC_*. -- JNLIB has no more meaning. Thus we switch to a GPGRT_ prefix in anticipation that some code may eventually be moved to libgpg-error. Signed-off-by: Werner Koch <[email protected]>
* common: Remove two JNLIB_ macros (jnlib merge).Werner Koch2015-04-246-13/+5
| | | | | | | | | | * configure.ac: Merge seperate jnlib checks. (HAVE_JNLIB_LOGGING): Remove. * common/logging.c, common/simple-pwquery.c (JNLIB_NEED_AFLOCAL): Rename to GNUPG_COMMON_NEED_AFLOCAL. Change all tests. -- Signed-off-by: Werner Koch <[email protected]>
* common: Remove libjnlib-config.h (jnlib merge).Werner Koch2015-04-2415-324/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/libjnlib-config.h: Remove. * common/common-defs.h (getenv) [HAVE_GETENV]: New. From removed header. (getpid) [HAVE_W32CE_SYSTEM]: New. From removed header. * common/argparse.c: Include util.h and common-defs.h. Replace jnlib_ macro names for non-GNUPG builds by x* names. * common/dotlock.c: Ditto. * common/logging.c: Include util.h and common-defs.h. Replace jnlib_ symbol names by x* names. * common/strlist.c: Ditto. * common/utf8conv.c: Ditto. * common/w32-reg.c: Ditto. * common/mischelp.c: Ditto. Also remove _jnlib_free. * common/stringhelp.c: Ditto. (JNLIB_LOG_WITH_PREFIX): Do not depend on this macro. * common/logging.h (JNLIB_LOG_WITH_PREFIX): Do not depend on this macro. -- This is part 1 of the patches to merge the jnlib files into common/. It does not make much sense to keep jnlib/ files separate. They are not often use elsewhere and maintaining the complex marcos stuff is too troublesome for the future. Signed-off-by: Werner Koch <[email protected]>
* gpg: Move all DNS access to Dirmngr.Werner Koch2015-04-237-738/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/dns-cert.h: Move to ../dirmngr/. * common/dns-cert.c: Move to ../dirmngr/. Change args to return the key as a buffer. * common/t-dns-cert.c: Move to ../dirmngr/. * common/pka.c, common/pka.h, common/t-pka.c: Remove. * dirmngr/server.c (data_line_cookie_write): Factor code out to data_line_write and make it a wrapper for that. (data_line_write): New. (cmd_dns_cert): New. (register_commands): Register new command. * g10/Makefile.am (LDADD): Remove DNSLIBS. * g10/call-dirmngr.c (dns_cert_parm_s): New. (dns_cert_data_cb, dns_cert_status_cb): New. (gpg_dirmngr_dns_cert): New. (gpg_dirmngr_get_pka): New. * g10/gpgv.c (gpg_dirmngr_get_pka): New dummy function. * g10/keyserver.c (keyserver_import_cert): Replace get_dns_cert by gpg_dirmngr_dns_cert. (keyserver_import_pka): Replace get_pka_info by gpg_dirmngr_get_pka. * g10/mainproc.c: Include call-dirmngr.h. (pka_uri_from_sig): Add CTX arg. Replace get_pka_info by gpg_dirmngr_get_pka. -- With this patch gpg does not do any network access itself but uses dirmngr for that. Note that we need to keep linking to NETLIBS due to the logging code and because we need TCP for our socket emulation under Windows. Probably also required for Solaris etc. Signed-off-by: Werner Koch <[email protected]>
* common: Minor change of hex2str to allow for embedded nul.Werner Koch2015-04-232-46/+57
| | | | | | | | | | | | | | | | | | | | | | * common/convert.c (hex2str): Set ERRNO. Return adjusted COUNT. -- hex2str is only used at one place for in-place converting an hex encoded passphrase. This change does not affect this use. The change is however useful to use the function for in-place conversion of arbitrary hex encoded strings. Take care for in-place conversion of a hex string encoding binary data you need to use it this way: if (hex2str (string, string, strlen (string) + 1, &length) oops ("probably out of memory but see ERRNO"); for (i=0; i < length; i++) foo (string[i)); Note that strlen() + 1. Signed-off-by: Werner Koch <[email protected]>
* common: removal of t-support.c from t_jnlib_src.NIIBE Yutaka2015-04-231-1/+1
| | | | | | | | | | | * common/Makefile.am (t_jnlib_src): Remove t-support.c. -- Since test programs are linked to libgcrypt and libgpg-error, there is no need to include t-support.c. GnuPG-bug-id: 1862, 1915
* common: Make proper use of http proxy parameter.Werner Koch2015-04-211-3/+48
| | | | | | | | * common/http.c (is_hostname_port): New. (send_request): Fix proxy name parsing. -- Signed-off-by: Werner Koch <[email protected]>
* gpg: Update sub-options of --keyserver-optionsWerner Koch2015-04-211-1/+0
| | | | | | | | | | | | | | | | | | | | | * g10/options.h (KEYSERVER_HTTP_PROXY): New. (KEYSERVER_USE_TEMP_FILES, KEYSERVER_KEEP_TEMP_FILES): Remove. (KEYSERVER_TIMEOUT): New. * common/keyserver.h (KEYSERVER_TIMEOUT): Remove. * g10/keyserver.c (keyserver_opts): Remove obsolete "use-temp-files" and "keep-temp-files". Add "http-proxy" and "timeout". (parse_keyserver_options): Remove 1.2 compatibility option "honor-http_proxy". Remove "use-temp-files" and "keep-temp-files" code. -- Note that many of these options where implicitly used by passing any unknown option down to the former keyserver helpers. The don't exist anymore thus we need to make them explicit. Another patch will convey them to dirmngr. Temp files are not anymore used thus they can be removed and will be ignored when used. Signed-off-by: Werner Koch <[email protected]>
* common: Do without nested fucntions to support non-gcc.Werner Koch2015-04-131-52/+54
| | | | | | * common/t-stringhelp.c (test_strsplit): Remove nested function. Signed-off-by: Werner Koch <[email protected]>
* Remove obsolete directories from AM_CPPFLAGS.Werner Koch2015-04-101-1/+1
|
* common: Add new function gnupg_gmtime.Werner Koch2015-04-102-8/+31
| | | | | | | | | | | | | * common/gettime.c (gnupg_gmtime): New. (gnupg_get_isotime): Use it. Also take care of an gmtime_t returning an error. -- The fix in gnupg_get_isotime is only to cover up a theoretical broken time (e.g. a value of (time_t)(-2) which is not mapped beyond 2038 on 32 bit systems). Signed-off-by: Werner Koch <[email protected]>
* common: Add new function isodate_human_to_tmWerner Koch2015-04-103-4/+114
| | | | | | | | | | | | | | * common/gettime.c (isotime_human_p): Add arg date_only. (isodate_human_to_tm): New. * common/t-gettime.c (test_isodate_human_to_tm): New. (main): Call new test. -- This function in intended as replacement for strptime (foo, "%Y-%m-%d", &bar) which is not available under Windows.
* gpg: Remove gratuitous extern qualifier from declaration.Neal H. Walfield2015-03-311-1/+1
| | | | | | -- Signed-off-by: Neal H. Walfield <[email protected]>
* common: Add macro GNUPG_GCC_A_USED.Werner Koch2015-03-251-0/+6
| | | | | | * common/util.h (GNUPG_GCC_A_USED): New. Signed-off-by: Werner Koch <[email protected]>
* common:stringhelp.c: Replace use of jblib_malloc with xtrymalloc, etc.neal/dirmngr-ldapNeal H. Walfield2015-03-231-26/+26
| | | | | -- Signed-off-by: Neal H. Walfield <[email protected]>
* Improve spelling and grammar of some comments.Neal H. Walfield2015-03-231-1/+1
| | | | | -- Signed-off-by: Neal H. Walfield <[email protected]>
* Improve documenation of http_parse_uri.Neal H. Walfield2015-03-231-3/+4
| | | | | | | * common/http.c (http_parse_uri): Improve documentation. -- Signed-off-by: Neal H. Walfield <[email protected]>
* Import _gpgme_parse_timestamp from gpgme as parse_timestamp.Neal H. Walfield2015-03-232-0/+103
| | | | | | | | | | | * common/gettime.h (parse_timestamp): New declaration. * common/gettime.c (_win32_timegm): New function imported from gpgme/src/conversion.c:_gpgme_timegm. (parse_timestamp): New function imported from gpgme/src/conversion.c:_gpgme_parse_timestamp. -- Signed-off-by: Neal H. Walfield <[email protected]>
* Add new function uri_query_lookup.Neal H. Walfield2015-03-232-0/+18
| | | | | | | | * common/http.h (uri_query_lookup): New declaration. * common/http.c (uri_query_lookup): The corresponding implementation. -- Signed-off-by: Neal H. Walfield <[email protected]>
* Add new function strlist_find.Neal H. Walfield2015-03-232-0/+17
| | | | | | | | * common/strlist.h (strlist_find): New declaration. * common/strlist.c (strlist_find): New function. -- Signed-off-by: Neal H. Walfield <[email protected]>
* common: Add new helper function, strsplit.Neal H. Walfield2015-03-233-1/+98
| | | | | | | | | | * common/stringhelp.h (strsplit): New declaration. * common/stringhelp.c (strsplit): New function. * common/t-stringhelp.c (test_strsplit): New function. (main): Call it here. -- Signed-off-by: Neal H. Walfield <[email protected]>
* common: Add function is_valid_mailbox_mem.Werner Koch2015-03-202-26/+82
| | | | | | | | | | * common/mbox-util.c (mem_count_chr): New. (my_memstr): New. (has_invalid_email_chars): Change args to work on a buffer. (is_valid_mailbox_mem): New. (is_valid_mailbox): Rewrite to use is_valid_mailbox_mem. Signed-off-by: Werner Koch <[email protected]>
* common: Fix syntax error when building with gnutlsWerner Koch2015-03-201-1/+1
| | | | | | | | | * common/http.c (send_request): Add missing comma. -- This fixes commit dc10d46. Signed-off-by: Werner Koch <[email protected]>
* hkps: Fix host name verification when using pools.Werner Koch2015-03-191-2/+4
| | | | | | | | | | | | | * common/http.c (send_request): Set the requested for SNI. * dirmngr/ks-engine-hkp.c (map_host): Return the poolname and not the selecting a host. -- GnuPG-bug-id: 1792 Thanks to davidw for figuring out the problem. Signed-off-by: Werner Koch <[email protected]>
* Define replacement error codes from libgpg-error 1.19.Werner Koch2015-03-191-1/+83
| | | | * common/util.h: Add GPG_ERR_LDAP codes for libgpg-error < 1.19.