aboutsummaryrefslogtreecommitdiffstats
path: root/src (unfollow)
Commit message (Collapse)AuthorFilesLines
2016-11-14Fix typo in two new error descriptions.Werner Koch2-3/+3
2016-11-12estream: Minor portability fix.Werner Koch2-4/+4
-- A trailing comma in an enum is not groked by all compilers. Binary operation should have their own parentheses to make it clear that a binary operator was meant. Signed-off-by: Werner Koch <[email protected]>
2016-11-12estream: Support 'es_poll' on Windows.Justus Winter4-74/+1175
* src/Makefile.am (arch_sources): Add new file. * src/estream.c (O_NONBLOCK): Move to 'gpgrt-int.h'. (BUFFER_BLOCK_SIZE): Likewise. (BUFFER_UNREAD_SIZE): Likewise. (struct notify_list_s, notify_list_t): Likewise. (struct _gpgrt_stream_internal, estream_internal_t): Likewise. (X_POLLABLE): New macro. (parse_mode): Parse keyword 'pollable', emulate O_NONBLOCK using the same mechanism on Windows. (_gpgrt_poll): Use the new '_gpgrt_w32_poll' on Windows. * src/gpgrt-int.h (_gpgrt_functions_w32_pollable): New declaration. (_gpgrt_w32_pollable_create): New prototype. (_gpgrt_w32_poll): Likewise. * src/w32-estream.c: New file. This code is adapted from GPGME. * tests/t-poll.c (create_pipe): Create pollable streams. GnuPG-bug-id: 2731 Signed-off-by: Justus Winter <[email protected]>
2016-11-12estream: Track the kind of backend used.Justus Winter2-17/+33
* src/estream.c (struct _gpgrt_stream_internal): Add 'kind'. (init_stream_obj): New parameter 'kind', initialize field. (es_create): New parameter 'kind'. Update all callers. * src/gpgrt-int.h (gpgrt_stream_backend_kind_t): New type. Signed-off-by: Justus Winter <[email protected]>
2016-11-12estream: Rework how the cookie functions are handled.Justus Winter2-49/+69
* src/estream.c (cookie_ioctl_function_t): Move to 'gpgrt-int.h', along with the macros for the IOCTL numbers. (estream_functions_mem): Use the new type and add the ioctl function. (estream_functions_fd): Likewise. (estream_functions_w32): Likewise. (estream_functions_fp): Likewise. (init_stream_object): Use the new type, and also initialize 'func_ioctl'. (es_create): Use the new type. (_gpgrt_fopen): Adapt. (_gpgrt_mopen): Likewise. (_gpgrt_fopenmem): Likewise. (_gpgrt_fopencookie): Likewise. (_gpgrt_fdopen): Likewise. (_gpgrt_fpopen): Likewise. (do_w32open): Likewise. * src/gpgrt-int.h (struct cookie_io_functions_s): New type. Signed-off-by: Justus Winter <[email protected]>
2016-11-12estream: Rework modestring handling.Justus Winter1-46/+44
* src/estream.c (X_SAMETHREAD, X_SYSOPEN): New macros. (parse_mode): Rework how information flows from here to 'es_create'. Instead of using an integer flag per mode, use flags. (init_stream_obj): Adapt accordingly. (es_create): Likewise. (_gpgrt_fopen): Likewise. (_gpgrt_mopen): Likewise. (_gpgrt_fopenmem): Likewise. (_gpgrt_fopencookie): Likewise. (_gpgrt_fdopen): Likewise. (_gpgrt_fpopen): Likewise. (do_w32open): Likewise. (_gpgrt_freopen): Likewise. Signed-off-by: Justus Winter <[email protected]>
2016-11-12Add new interface gpgrt_get_syscall_clamp.Werner Koch7-0/+26
* src/visibility.c (gpgrt_get_syscall_clamp): New. * src/gpg-error.vers, src/gpg-error.def.in: Add function. * src/gpg-error.h.in: Ditto. * src/estream.c (_gpgrt_get_syscall_clamp): New. -- This function can be used by other libraries to set their own system clamp functions. Signed-off-by: Werner Koch <[email protected]>
2016-11-11Use the syscall clamp functions also for lock functionsWerner Koch7-1/+104
* src/posix-lock.c (pre_lock_func, post_lock_func): New. (_gpgrt_lock_set_lock_clamp): New. (_gpgrt_lock_lock): Use clamp functions. * src/w32-lock.c (pre_lock_func, post_lock_func): New. (_gpgrt_lock_set_lock_clamp): New. (_gpgrt_lock_lock): Use clamp functions. * src/posix-lock.c (pre_syscall_func, post_syscall_func): New. (_gpgrt_thread_set_syscall_clamp): New. (_gpgrt_yield): Use clamp functions. * src/w32-lock.c (pre_syscall_func, post_syscall_func): New. (_gpgrt_thread_set_syscall_clamp): New. (_gpgrt_yield): Use clamp functions. * src/estream.c: Include lock.h and thread.h. (do_deinit): Call _gpgrt_lock_set_lock_clamp. (_gpgrt_set_syscall_clamp): Ditto. Signed-off-by: Werner Koch <[email protected]>
2016-11-11w32: Fix lock c++ narrowing conversion warningAndre Heinecke1-2/+2
* src/syscfg/lock-obj-pub.mingw32.h (gpgrt_lock_t): Declare priv as unsigned char. -- This fixes error: narrowing conversion of ‘255’ from ‘int’ to ‘volatile char’ inside { } [-Werror=narrowing]
2016-11-10Change description of GPG_ERR_OPEN_KEYRING.Werner Koch1-1/+1
Signed-off-by: Werner Koch <[email protected]>
2016-11-02Add error codes GPG_ERR_TOO_YOUNG and GPG_ERR_TOO_OLD.Werner Koch1-0/+2
Signed-off-by: Werner Koch <[email protected]>
2016-10-18estream: Fix modestring parsing.Justus Winter1-1/+1
* src/estream.c (parse_mode): Fix parsing the 'sysopen' flag. Signed-off-by: Justus Winter <[email protected]>
2016-10-07Add error code USER_ID_EXISTS, NAME_EXISTS, and DUP_NAME.Werner Koch1-1/+3
Signed-off-by: Werner Koch <[email protected]>
2016-10-07syscfg: Add support for {i686,x86_64}-apple-darwin.Werner Koch3-0/+56
-- Thanks to Chris Ballinger <[email protected]> for the files. Signed-off-by: Werner Koch <[email protected]>
2016-09-01Add error WINDOW_TOO_SMALL, WINDOW_TOO_LARGE, and MISSING_ENVVAR.Werner Koch1-1/+5
Signed-off-by: Werner Koch <[email protected]>
2016-08-16New error code GPG_ERR_ENGINE_TOO_OLDWerner Koch1-1/+2
2016-07-12Fix build without threadsYann E. MORIN1-1/+3
* src/gen-posix-lock-obj.c: properly guard inclusioin of pthread.h * tests/t-lock.c: likewise * tests/t-poll.c: likewise -- Although ./configure checks for thread support, gen-posix-lock-obj and two tests still include pthread.h unconditionally. Guard that inclusion using the same condition as all other uses of pthread-related code. Signed-off-by: "Yann E. MORIN" <[email protected]>
2016-07-05Define EWOULDBLOCK in case it is not definedAndre Heinecke1-0/+5
* src/estream.c (EWOULDBLOCK): Define fallback. -- Older mingw versions (2.0) do not define EWOULDBLOCK in errno.h
2016-06-27estream: Fix bug es_fclose_snatch if a seek has been used.Werner Koch1-1/+1
* src/estream.c (func_mem_ioctl): Set LEN from DATA_LEN. Signed-off-by: Werner Koch <[email protected]>
2016-06-25w32: Silence compiler warnings about redefined macros.Werner Koch1-6/+19
* src/estream.c (S_IRGRP) [W32]: Protect against redefinition. Signed-off-by: Werner Koch <[email protected]>
2016-06-24estream: Remove two compiler warning.Werner Koch1-40/+41
* src/estream.c (func_file_create): Remove dead assignment. (doreadline): Do not decrement SPACE_LEFT before breaking the loop. Add an extra block to limit the scope of that variable. -- Signed-off-by: Werner Koch <[email protected]>
2016-06-15estream: Fix assertion failure due to es_flush.NIIBE Yutaka1-3/+1
* src/estream.c (es_writen): Set writing flag even if no data was written. -- GnuPG-bug-id: 2371 Signed-off-by: Werner Koch <[email protected]> gniibe tracked the problem down to a fully valid change in GnuPG (gnupg commit 12af2630cf4d1a39179179925fac8f2cce7504ff). He wrote: This is the first instance for estream to do READ and WRITE (in the history of the code > 10 years :-). In the [gnupg] function agent_write_private_key, the pattern is: es_fopen es_fread es_fseek es_fwrite which should work well, but if results core dump by assertion failure in the function es_flush of libgpg-error.
2016-06-15Adjust memory limit of es_fopenmem to the block size.Werner Koch1-0/+8
* src/estream.c (func_mem_create): Round up memory limit. -- This is required so that giving a memory limit to es_fopenmem won't fail if it is below the block size. Signed-off-by: Werner Koch <[email protected]>
2016-05-17Add GPG_ERR_SUBKEYS_EXP_OR_REV.Werner Koch1-1/+2
2016-05-07syscfg: Add a powerpc and a tilgegx architecture.Werner Koch3-0/+50
* src/syscfg/lock-obj-pub.powerpc-unknown-linux-gnuspe.h: New. * src/syscfg/lock-obj-pub.tilegx-unknown-linux-gnu.h: New. * src/Makefile.am (lock_obj_pub): Add them. -- Debian-bug-id: 823630, 823631 Signed-off-by: Werner Koch <[email protected]>
2016-04-25Release 1.22.libgpg-error-1.22Werner Koch3-3/+3
* configure.ac: Set LT version to C18/A18/R0. Signed-off-by: Werner Koch <[email protected]>
2016-04-25Fix for HPPA.NIIBE Yutaka2-4/+11
* configure.ac (HAVE_GCC_ATTRIBUTE_ALIGNED): Revert. * src/gen-posix-lock-obj.c (USE_16BYTE_ALIGNMENT): Revert. * src/syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h: Revert. -- Signed-off-by: NIIBE Yutaka <[email protected]> This fixes commit 5168b97. I considered wrongly that long double were 128-bit in HPPA. Currently, all that we can do for HPPA is assuming GCC and use its extension of "aligned" attribute.
2016-04-22syscfg: Add powerpc-unknown-linux-gnuspeWerner Koch1-0/+1
--
2016-04-21w32: Add iconv functions.Werner Koch4-399/+130
* src/w32-add.h (gpgrt_w32_iconv_t): New. (gpgrt_w32_iconv_open, gpgrt_w32_iconv_close, gpgrt_w32_iconv): New. ( GPGRT_ENABLE_W32_ICONV_MACROS): New * src/w32-iconv.c: Change license to LGPLv2.1+. Dispable mlang feature. Remove external DLL loading. Simplify iconv functions. Use cleaner context struct pattern. Use gpgrt namespace. * src/gpg-error.def.in: Add new functions. Signed-off-by: Werner Koch <[email protected]>
2016-04-20Add file w32-iconv.cWerner Koch1-0/+2086
--
2016-04-05estream,w32: Temporary fix for gpgrt_poll.Werner Koch1-0/+4
* src/estream.c (_gpgrt_poll) [W32]: Do not use FD_ISSET. -- gpgrt_poll return an error on Windows anyway and thus it does not make sense to use a possible undefined macro here. Reported-by: Andre Heinecke Signed-off-by: Werner Koch <[email protected]>
2016-03-29estream: Prepare for new mode flag "sysopen".Werner Koch1-14/+47
* src/estream.c (parse_mode): Add arg "sysopen". Adjust all callers. Signed-off-by: Werner Koch <[email protected]>
2016-03-29estream: Use simpler names for static functions.Werner Koch1-44/+44
* src/estream.c: Replace all es_func_* to just func_*. Signed-off-by: Werner Koch <[email protected]>
2016-03-29doc: Re-format comments in estream.cWerner Koch1-150/+311
-- Signed-off-by: Werner Koch <[email protected]>
2016-03-29estream: Remove strange macro for better readability.Werner Koch1-15/+11
* src/estream.c (SET_UNLESS_NONZERO): Remove macro. (es_deinitialize): Replace that macro by direct code. Signed-off-by: Werner Koch <[email protected]>
2016-03-24Add function gpgrt_annotate_leaked_object.Peter Wu1-0/+30
* src/gpg-error.h.in: add gpgrt_annotate_leaked_object to support marking memory as non-leaked for Clang and GCC. -- This annotation can be used to mark objects as explicitly leaked such that it can be ignored in tools like LeakSanitizer. The GPGRT_HAVE_LEAK_SANITIZER macro is explicitly not undefined to support -fsanitize=leak, a user or configure script could then decide to add this macro when just -fsanitize=leak is given. Signed-off-by: Peter Wu <[email protected]> Additional changes by -wk: - But __GNUC__ guard around the entire GPGRT_HAVE_LEAK_SANITIZER detection. - Add NEWS entry. Signed-off-by: Werner Koch <[email protected]>
2016-03-14syscfg: Add lock-obj-pub files for {armv5, armv6, x86_64}-musl targetsKylie McClain4-0/+74
* src/syscfg/lock-obj-pub.armv5-unknown-linux-musleabi.h: New. * src/syscfg/lock-obj-pub.armv6-unknown-linux-musleabihf.h New. * src/syscfg/lock-obj-pub.x86_64-pc-linux-musl.h: New. * src/Makefile.am (lock_obj_pub): Add files. -- This patch adds three new precompiled lock-obj-pub files: - armv5-unknown-linux-musleabi - armv6-unknown-linux-musleabihf - x86_64-pc-linux-musl ChangeLog lines and Makefile patch by -wk
2016-03-03Fix detecting Solaris operating system.NIIBE Yutaka1-1/+2
* src/gen-posix-lock-obj.c (USE_DOUBLE_FOR_ALIGNMENT): Check for the macro __sun. -- Signed-off-by: NIIBE Yutaka <[email protected]> This fixes commit 5168b97 and 34b0714. Thanks to Ibraheem Saleh and Thomas Klausner for testing. Thanks to Tom G. Christensen for suggesting the fix with the useful link: https://sourceforge.net/p/predef/wiki/Home/ Thanks to Nelson H. F. Beebe to inform the tool: http://www.math.utah.edu/~beebe/cc-defs GnuPG-bug-id: 2144
2016-03-01Fix for Solaris.NIIBE Yutaka1-1/+1
* src/gen-posix-lock-obj.c (USE_DOUBLE_FOR_ALIGNMENT): Check LP64. -- Signed-off-by: NIIBE Yutaka <[email protected]> This fixes commit 5168b97.
2016-02-26Add support for Solaris, fixing HPPA.NIIBE Yutaka2-10/+12
* configure.ac (HAVE_GCC_ATTRIBUTE_ALIGNED): Remove. (LIB_SCHED_YIELD): New. Check sched_yield in -lrt. * src/gen-posix-lock-obj.c (USE_16BYTE_ALIGNMENT): Remove. (USE_DOUBLE_FOR_ALIGNMENT, USE_LONG_DOUBLE_FOR_ALIGNMENT): New. * src/syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h: Update. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2016-02-08w32: Confirm the 639-1 code for Venda is "ve"Daniel Kahn Gillmor1-5/+1
-- https://www.loc.gov/standards/iso639-2/php/code_changes.php says that ve is indeed the 2-character code for Venda: >> This alpha-2 ISO 639-1 code was approved in 1999 and included in >> ISO 639-1: 2002. It was mistakenly missing in earlier versions of >> the tables on the ISO639-2 web site. As of January 2003, it has >> been included.
2016-02-08Convert http links to https where possible in the source.Daniel Kahn Gillmor26-27/+27
-- * use https for bug reporting * in comments and docs, use https to refer to: - www.gnu.org - creativecommons.org - translationproject.org - mail.gnome.org - www.perl.org - www.ctan.org - www.cl.cam.ac.uk - www.ntg.nl - cygwin.com - www.ethnologue.com
2016-01-27Add syscfg alias for x86_64-pc-linux-gnuhardened1Werner Koch1-0/+1
--
2016-01-19Add GPG_ERR_DB_CORRUPTED.Werner Koch1-2/+2
Signed-off-by: Werner Koch <[email protected]>
2016-01-13Add new lock-obj-pub for NIOS2.Marek Vasut2-0/+24
src/syscfg/lock-obj-pub.nios2-unknown-linux-gnu.h: New.
2015-12-07Fix windows 8bit encoding conversionAndre Heinecke1-5/+13
* src/w32-gettext.c (wchar_to_native): Convert to ConsoleOutputCP. -- Just using CP_ACP did not neccessarily convert to the correct codepage as codepages might differ between ConsoleOutput and GUI output (which it usually does). This fixes encoding issues on the Windows commandline.
2015-11-19Fix typos found by codespell.Justus Winter3-6/+6
-- Signed-off-by: Justus Winter <[email protected]>
2015-11-19Avoid 'malloc' corner case.Justus Winter1-3/+3
* src/init.c (_gpgrt_realloc): Avoid calling 'malloc(0)'. -- Previously, if '_gpgrt_realloc' was called with both A and N being zero, malloc is invoked with a size of zero. This happens e.g. when calling '_gpgrt_free' with a NULL pointer, which is supposed to be a no-op. Found using the Clang Static Analyzer. Signed-off-by: Justus Winter <[email protected]>
2015-10-21Add error codes NO_NAME, NO_KEY, and SERVER_FAILURE.Werner Koch1-1/+4
2015-10-18estream: Avoid calling write(fd,NULL,n).Werner Koch1-20/+32
* src/estream.c (es_func_fd_write): Take care of a flush requests. (es_func_w32_write): Ditto. (es_func_fp_write): Ditto. -- The write handlers may be called with (BUFFER,SIZE) of (NULL,0) to propagate flush events to user supplied functions (es_fopencookie). However we need to take care to also do this with the internal handler. Might be a reason for system faults due to write or fwrite with a NULL buffer; on Linux this seems to be harmless. Signed-off-by: Werner Koch <[email protected]>