diff --git a/NEWS b/NEWS index ef29558..56f7a8c 100644 --- a/NEWS +++ b/NEWS @@ -1,945 +1,947 @@ Noteworthy changes in version 1.37 (unreleased) [C27/A27/R_] ----------------------------------------------- + * A new set of codes to map SQLite primary error codes. + Noteworthy changes in version 1.36 (2019-03-19) [C27/A27/R0] ----------------------------------------------- * Two new error codes to better support PIV cards. * Support armv7a-unknown-linux-gnueabihf. * Increased estream buffer sizes for Windows. * Interface changes relative to the 1.34 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GPG_ERR_NO_AUTH NEW. GPG_ERR_BAD_AUTH NEW. Release-info: https://dev.gnupg.org/T4413 Noteworthy changes in version 1.35 (2019-01-28) [C26/A26/R1] ----------------------------------------------- * Distribute the correct gpgrt-config. Noteworthy changes in version 1.34 (2019-01-16) [C26/A26/R0] ----------------------------------------------- * Support for riscv32. * New API to allow emergency cleanup after internal fatal errors. * Minor bug and portability fixes. [#4286,#4298 * Interface changes relative to the 1.33 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gpgrt_abort NEW. gpgrt_add_emergency_cleanup NEW. Release-info: https://dev.gnupg.org/T4296 Noteworthy changes in version 1.33 (2018-12-07) [C25/A25/R0] ----------------------------------------------- * New unified config script gpgrt-config which can now be used by all GnuPG related packages. * Support for ARC and arm64ilp32. * The log functions now sanitize strings printed with the "%s" format specifier. All control characters are C-escaped in the output. Users of that function may want to remove their own escaping to avoid doubling of backslashes. * New fprintf style function to apply a custom filter for string arguments. * New function to compare version strings. * Interface changes relative to the 1.28 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gpgrt_cmp_version New. gpgrt_string_filter_t New. gpgrt_fprintf_sf New. gpgrt_fprintf_sf_unlocked New. gpgrt_ftruncate New but limited functionality. gpgrt_w32_override_locale New. Release-info: https://dev.gnupg.org/T4205 Noteworthy changes in version 1.32 (2018-07-12) [C24/A24/R3] ----------------------------------------------- * Fixes a problem with gpgrt_fflush and gpgrt_fopencookie. [#4069] * Fixes a problem with the C11 header stdnoreturn.h. [#4002] * The yat2m tool can now also be build on Windows. * Updates translations for Spanish, Russian and Ukrainian. Noteworthy changes in version 1.31 (2018-05-02) [C24/A24/R2] ----------------------------------------------- * Fixes another problem with gpgrt_poll under Windows. [#3937] * New translation for Spanish. Noteworthy changes in version 1.30 (2018-04-30) [C24/A24/R1] ----------------------------------------------- * Fixes a hang on Windows when using gpgrt_poll under nPth. * Build fix for Solaris. [#3869] Noteworthy changes in version 1.29 (2018-04-11) [C24/A24/R0] ----------------------------------------------- * The yat2m tool is during cross-compile now also installed on the host platform. * New option parser and associated functions similar to the one used by GnuPG. * New Base-64 encoder. * Fixes regression in 1.28 for arm64 and w64 builds. * Interface changes relative to the 1.28 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gpgrt_argparse New. gpgrt_usage New. gpgrt_strusage New. gpgrt_set_strusage New. gpgrt_set_usage_outfnc New. gpgrt_set_fixed_string_mapper New. GPGRT_ENABLE_ARGPARSE_MACROS New macro. gpgrt_b64enc_start New. gpgrt_b64enc_write New. gpgrt_b64enc_finish New. Noteworthy changes in version 1.28 (2018-03-13) [C23/A23/R0] ----------------------------------------------- * The formerly internal yat2m tool is now installed for a native build. * The new files gpgrt.m4 and gpgrt-config are now installed. They can be used instead of gpg-error.m4 and gpg-error-config. * New logging functions similar to those used by GnuPG. * New helper functions for platform abstraction. * Interface changes relative to the 1.27 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gpgrt_get_errorcount New API. gpgrt_inc_errorcount New API. gpgrt_log_set_sink New API. gpgrt_log_set_socket_dir_cb New API. gpgrt_log_set_pid_suffix_cb New API. gpgrt_log_set_prefix New API. gpgrt_log_get_prefix New API. gpgrt_log_test_fd New API. gpgrt_log_get_fd New API. gpgrt_log_get_stream New API. gpgrt_log New API. gpgrt_logv New API. gpgrt_logv_prefix New API. gpgrt_log_string New API. gpgrt_log_info New API. gpgrt_log_error New API. gpgrt_log_fatal New API. gpgrt_log_bug New API. gpgrt_log_debug New API. gpgrt_log_debug_string New API. gpgrt_log_printf New API. gpgrt_log_flush New API. gpgrt_log_printhex New API. gpgrt_log_clock New API. gpgrt_assert New macro. _gpgrt_log_assert New internal API. GPGRT_LOGLVL_BEGIN New const. GPGRT_LOGLVL_CONT New const. GPGRT_LOGLVL_INFO New const. GPGRT_LOGLVL_WARN New const. GPGRT_LOGLVL_ERROR New const. GPGRT_LOGLVL_FATAL New const. GPGRT_LOGLVL_BUG New const. GPGRT_LOGLVL_DEBUG New const. gpgrt_realloc New API. gpgrt_malloc New API. gpgrt_calloc New API. gpgrt_strdup New API. gpgrt_strconcat New API. gpgrt_w32_reg_query_string New API. gpgrt_getenv New API. gpgrt_setenv New API. gpgrt_mkdir New API. gpgrt_chdir New API. gpgrt_getcwd New API. Noteworthy changes in version 1.27 (2017-02-28) [C22/A22/R0] ----------------------------------------------- * Added a Base64 decoder. * Added support for the sh3 architecture. * Added header gpgrt.h as an alias for gpg-error.h. * Fixed macro GPGRT_GCC_VERSION. * Fixed a race in non-blocking I/O on Windows. * Interface changes relative to the 1.26 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gpgrt_b64state_t NEW type. gpgrt_b64dec_start NEW. gpgrt_b64dec_proc NEW. gpgrt_b64dec_finish NEW. GPG_ERR_WRONG_NAME NEW. gpgrt.h NEW header. Noteworthy changes in version 1.26 (2016-12-21) [C21/A21/R0] ----------------------------------------------- * New option --desc for gpg-error. * Interface changes relative to the 1.25 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GPG_ERR_UNKNOWN_FLAG NEW. GPG_ERR_INV_ORDER NEW. GPG_ERR_ALREADY_FETCHED NEW. GPG_ERR_TRY_LATER NEW. GPG_ERR_SYSTEM_BUG NEW. GPG_ERR_DNS_UNKNOWN NEW. GPG_ERR_DNS_SECTION NEW. GPG_ERR_DNS_ADDRESS NEW. GPG_ERR_DNS_NO_QUERY NEW. GPG_ERR_DNS_NO_ANSWER NEW. GPG_ERR_DNS_CLOSED NEW. GPG_ERR_DNS_VERIFY NEW. GPG_ERR_DNS_TIMEOUT NEW. Noteworthy changes in version 1.25 (2016-11-14) [C20/A20/R0] ----------------------------------------------- * New interface gpgrt_get_syscall_clamp to allow libaries to make use of Libgpg-error's system call wrapper functions. * gpgrt_poll does now work under Windows. * Fixed bug in the locking code when used with the nPth threading library. * Added support for {i686,x86_64}-apple-darwin. * Added new error codes. * Interface changes relative to the 1.23 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gpgrt_get_syscall_clamp NEW. GPG_ERR_ENGINE_TOO_OLD NEW. GPG_ERR_WINDOW_TOO_SMALL NEW. GPG_ERR_WINDOW_TOO_LARGE NEW. GPG_ERR_MISSING_ENVVAR NEW. GPG_ERR_USER_ID_EXISTS NEW. GPG_ERR_NAME_EXISTS NEW. GPG_ERR_DUP_NAME NEW. GPG_ERR_TOO_OLD NEW. GPG_ERR_TOO_YOUNG NEW. Noteworthy changes in version 1.24 (2016-07-14) [C19/A19/R1] ----------------------------------------------- * Fixes a bug in es_fclose_snatch when used used after es_fseek. * Fixes building without thread support. * New configure option --disable-tests. Noteworthy changes in version 1.23 (2016-06-15) [C19/A19/R0] ----------------------------------------------- * Fixes an assertion failure due to es_flush on read/write streams. * Fixes a bug with a too short memory limit is es_fopenmen. * Cross-build support for powerpc-unknown-linux-gnuspe and tilegx-unknown-linux-gnu architectures. * Interface changes relative to the 1.22 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GPG_ERR_SUBKEYS_EXP_OR_REV NEW. Noteworthy changes in version 1.22 (2016-04-25) [C18/A18/R0] ----------------------------------------------- * New functions and macros to to provide iconv(3) on Windows. * Support for LeakSanitizer with the gpgrt_annotate_leaked_object inline function. * Interface changes relative to the 1.21 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GPG_ERR_DB_CORRUPTED NEW. gpgrt_annotate_leaked_object NEW inline func. GPGRT_ENABLE_W32_ICONV_MACROS NEW. gpgrt_w32_iconv_open NEW. gpgrt_w32_iconv_close NEW. gpgrt_w32_iconv NEW. Noteworthy changes in version 1.21 (2015-12-12) [C17/A17/R0] ----------------------------------------------- * New functions gpgrt_poll and gpgrt_set_nonblock. For now only pipes and sockets on Unix are supported. * Fixes gettext output encoding problems on Windows. * Interface changes relative to the 1.20 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gpgrt_set_nonblock NEW. gpgrt_get_nonblock NEW. gpgrt_poll NEW. gpgrt_poll_t NEW type. es_poll_t NEW type. es_set_nonblock NEW macro. es_get_nonblock NEW macro. es_poll NEW macro. GPG_ERR_TRUE NEW. GPG_ERR_FALSE NEW. GPG_ERR_NO_NAME NEW. GPG_ERR_NO_KEY NEW. GPG_ERR_SERVER_FAILED NEW. Noteworthy changes in version 1.20 (2015-08-26) [C16/A16/R0] ----------------------------------------------- * New macros for GCC attributes. * Make es_set_binary actually work for Windows. * Allow building without thread support. * Build without a build timestamp by default. * Interface changes relative to the 1.19 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GPGRT_VERSION NEW macro. GPGRT_VERSION_NUMBER NEW macro. GPGRT_INLINE NEW macro. GPGRT_GCC_VERSION NEW macro. GPGRT_ATTR_NORETURN NEW macro. GPGRT_ATTR_PRINTF NEW macro. GPGRT_ATTR_NR_PRINTF NEW macro. GPGRT_ATTR_FORMAT_ARG NEW macro. GPGRT_ATTR_SENTINEL NEW macro. GPGRT_ATTR_USED NEW macro. GPGRT_ATTR_UNUSED NEW macro. GPGRT_ATTR_DEPRECATED NEW macro. GPGRT_ATTR_PURE NEW macro. GPGRT_ATTR_MALLOC NEW macro. GPGRT_HAVE_MACRO_FUNCTION NEW macro. GPGRT_HAVE_PRAGMA_GCC_PUSH NEW macro. Noteworthy changes in version 1.19 (2015-04-10) [C15/A15/R0] ----------------------------------------------- * New set of error codes for use with LDAP. * New options --help and --defines for gpg-error. * Allow building with gcc 5. * Interface changes relative to the 1.18 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GPG_ERR_LDAP_* NEW. Noteworthy changes in version 1.18 (2015-01-26) [C14/A14/R0] ----------------------------------------------- * New translations for Hungarian, Portuguese, Russian, and traditional Chinese. Updated other translations. * New error codes. * Interface changes relative to the 1.17 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GPG_ERR_FORBIDDEN NEW. GPG_ERR_OBJ_TERM_STATE NEW. GPG_ERR_REQUEST_TOO_SHORT NEW. GPG_ERR_REQUEST_TOO_LONG NEW. GPG_ERR_LEGACY_KEY NEW. Noteworthy changes in version 1.17 (2014-10-15) [C13/A13/R0] ----------------------------------------------- * New error codes for TLS protocol libraries. * New configure option --enable-build-timestamp. * New man page for gpg-error-config. * Interface changes relative to the 1.16 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GPG_ERR_SOURCE_TLS NEW. GPG_ERR_NO_CERT_CHAIN NEW. GPG_ERR_CERT_TOO_LARGE NEW. GPG_ERR_INV_RECORD NEW. GPG_ERR_BAD_MAC NEW. GPG_ERR_UNEXPECTED_MSG NEW. GPG_ERR_COMPR_FAILED NEW. GPG_ERR_WOULD_WRAP NEW. GPG_ERR_FATAL_ALERT NEW. GPG_ERR_NO_CIPHER NEW. GPG_ERR_MISSING_CLIENT_CERT NEW. GPG_ERR_CLOSE_NOTIFY NEW. GPG_ERR_TICKET_EXPIRED NEW. GPG_ERR_BAD_TICKET NEW. GPG_ERR_UNKNOWN_IDENTITY NEW. GPG_ERR_BAD_HS_CERT NEW. GPG_ERR_BAD_HS_CERT_REQ NEW. GPG_ERR_BAD_HS_CERT_VER NEW. GPG_ERR_BAD_HS_CHANGE_CIPHER NEW. GPG_ERR_BAD_HS_CLIENT_HELLO NEW. GPG_ERR_BAD_HS_SERVER_HELLO NEW. GPG_ERR_BAD_HS_SERVER_HELLO_DONE NEW. GPG_ERR_BAD_HS_FINISHED NEW. GPG_ERR_BAD_HS_SERVER_KEX NEW. GPG_ERR_BAD_HS_CLIENT_KEX NEW. GPG_ERR_BOGUS_STRING NEW. gpgrt_pending NEW. gpgrt_pending_unlocked NEW. Noteworthy changes in version 1.16 (2014-09-18) [C12/A12/R2] ----------------------------------------------- * Support building for iOS. * Fixed a prototype mismatch. * Fix es_fclose for streams opened with "samethread". Noteworthy changes in version 1.15 (2014-09-11) [C12/A12/R1] ----------------------------------------------- * This releases fixes problems with the use of off_t and ssize_t by the estream functions introduced with 1.14. Although this is technically an ABI break on some platforms, we take this as a simple bug fix for 1.14. The new functions are very unlikely in use by any code and thus no breakage should happen. The 1.14 tarball will be removed from the archive. * Add type gpgrt_off_t which is guaranteed to be 64 bit. * Add type gpgrt_ssize_t to make use on Windows easier. On Unix platforms this is an alias for ssize_t. Noteworthy changes in version 1.14 (2014-09-08) [C12/A12/R0] ----------------------------------------------- * Added gpgrt_lock_trylock. * Added the estream library under the name gpgrt and a set of macros to use them with their "es_" names. * Interface changes relative to the 1.13 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GPG_ERR_KEY_DISABLED NEW. gpgrt_init NEW macro. gpgrt_check_version NEW. gpgrt_lock_trylock NEW. gpgrt_set_syscall_clamp NEW. gpgrt_set_alloc_func NEW. gpgrt_stream_t NEW. gpgrt_cookie_io_functions_t NEW. gpgrt_syshd_t NEW. GPGRT_SYSHD_NONE NEW. GPGRT_SYSHD_FD NEW. GPGRT_SYSHD_SOCK NEW. GPGRT_SYSHD_RVID NEW. GPGRT_SYSHD_HANDLE NEW. gpgrt_stdin NEW macro. gpgrt_stdout NEW macro. gpgrt_stderr NEW macro. gpgrt_fopen NEW. gpgrt_mopen NEW. gpgrt_fopenmem NEW. gpgrt_fopenmem_init NEW. gpgrt_fdopen NEW. gpgrt_fdopen_nc NEW. gpgrt_sysopen NEW. gpgrt_sysopen_nc NEW. gpgrt_fpopen NEW. gpgrt_fpopen_nc NEW. gpgrt_freopen NEW. gpgrt_fopencookie NEW. gpgrt_fclose NEW. gpgrt_fclose_snatch NEW. gpgrt_onclose NEW. gpgrt_fileno NEW. gpgrt_fileno_unlocked NEW. gpgrt_syshd NEW. gpgrt_syshd_unlocked NEW. gpgrt_flockfile NEW. gpgrt_ftrylockfile NEW. gpgrt_funlockfile NEW. gpgrt_feof NEW. gpgrt_feof_unlocked NEW. gpgrt_ferror NEW. gpgrt_ferror_unlocked NEW. gpgrt_clearerr NEW. gpgrt_clearerr_unlocked NEW. gpgrt_fflush NEW. gpgrt_fseek NEW. gpgrt_fseeko NEW. gpgrt_ftell NEW. gpgrt_ftello NEW. gpgrt_rewind NEW. gpgrt_getc NEW macro. gpgrt_getc_unlocked NEW macro. gpgrt_fgetc NEW. gpgrt_fputc NEW. gpgrt_ungetc NEW. gpgrt_read NEW. gpgrt_write NEW. gpgrt_write_sanitized NEW. gpgrt_write_hexstring NEW. gpgrt_fread NEW. gpgrt_fwrite NEW. gpgrt_fgets NEW. gpgrt_putc NEW macro. gpgrt_putc_unlocked NEW macro. gpgrt_fputs NEW. gpgrt_fputs_unlocked NEW. gpgrt_getline NEW. gpgrt_read_line NEW. gpgrt_free NEW. gpgrt_fprintf NEW. gpgrt_fprintf_unlocked NEW. gpgrt_printf NEW. gpgrt_printf_unlocked NEW. gpgrt_vfprintf NEW. gpgrt_vfprintf_unlocked NEW. gpgrt_setvbuf NEW. gpgrt_setbuf NEW. gpgrt_set_binary NEW. gpgrt_tmpfile NEW. gpgrt_opaque_set NEW. gpgrt_opaque_get NEW. gpgrt_fname_set NEW. gpgrt_fname_get NEW. gpgrt_asprintf NEW. gpgrt_vasprintf NEW. gpgrt_bsprintf NEW. gpgrt_vbsprintf NEW. gpgrt_snprintf NEW. gpgrt_vsnprintf NEW. Noteworthy changes in version 1.13 (2014-04-15) [C11/A11/R0] ----------------------------------------------- * Added a portable mutex API. * The AM_PATH_GPG_ERROR macro now defines GPG_ERROR_MT_CFLAGS and GPG_ERROR_MT_LIBS autoconf output variables for use by programs which need gpgrt based thread support. gpg-error-config has a new option --mt. * Interface changes relative to the 1.12 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GPG_ERR_KEY_ON_CARD NEW. GPG_ERR_MAC_ALGO NEW. GPG_ERR_INV_LOCK_OBJ NEW. gpgrt_lock_t NEW. GPGRT_LOCK_INITIALIZER NEW. GPGRT_LOCK_DEFINE NEW. gpgrt_lock_init NEW. gpgrt_lock_lock NEW. gpgrt_lock_unlock NEW. gpgrt_lock_destroy NEW. gpgrt_yield NEW. Noteworthy changes in version 1.12 (2013-06-24) ----------------------------------------------- * Add support for 64 bit Windows (use ./autogen.sh --build-w64). * Fixed parsing and installing of the Windows .def file. * Interface changes relative to the 1.11 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GPG_ERR_NO_CRYPT_CTX NEW. GPG_ERR_WRONG_CRYPT_CTX NEW. GPG_ERR_BAD_CRYPT_CTX NEW. GPG_ERR_CRYPT_CTX_CONFLICT NEW. GPG_ERR_BROKEN_PUBKEY NEW. GPG_ERR_BROKEN_SECKEY NEW. Noteworthy changes in version 1.11 (2013-02-25) ----------------------------------------------- * New error source GPG_ERR_SOURCE_ASSUAN for Libassuan related errors. * New macros GPG_ERROR_VERSION and GPG_ERROR_VERSION_NUMBER. New function gpg_error_check_version. * Interface changes relative to the 1.10 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GPG_ERR_NO_KEYSERVER NEW. GPG_ERR_INV_CURVE NEW. GPG_ERR_UNKNOWN_CURVE NEW. GPG_ERR_DUP_KEY NEW. GPG_ERR_AMBIGUOUS NEW. GPG_ERR_SOURCE_ASSUAN NEW. gpg_error_check_version NEW. GPG_ERROR_VERSION NEW. GPG_ERROR_VERSION_NUMBER NEW. Noteworthy changes in version 1.10 (2010-10-26) ----------------------------------------------- * Using a static library on W32 does now work. * Interface changes relative to the 1.9 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GPG_ERR_NOT_INITIALIZED NEW. GPG_ERR_MISSING_ISSUER_CERT NEW. GPG_ERR_FULLY_CANCELED NEW. Noteworthy changes in version 1.9 (2010-07-21) ---------------------------------------------- * New function gpg_err_deinit. * Fix building of static lib under W32. * Interface changes relative to the 1.8 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GPG_ERR_MISSING_KEY NEW. GPG_ERR_TOO_MANY NEW. GPG_ERR_LIMIT_REACHED NEW. gpg_err_deinit NEW. Noteworthy changes in version 1.8 (2010-05-06) ---------------------------------------------- * Support for WindowsCE. * New option --list for gpg-error. * Interface changes relative to the 1.7 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GPG_ERR_NOT_ENABLED NEW. GPG_ERR_SOURCE_G13 NEW. GPG_ERR_NO_ENGINE NEW. gpg_err_set_errno NEW. Noteworthy changes in version 1.7 (2008-11-26) ---------------------------------------------- * Minor fixes and a few new error codes. * Interface changes relative to the 1.6 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GPG_ERR_NOT_OPERATIONAL NEW GPG_ERR_NO_PASSPHRASE NEW GPG_ERR_NO_PIN NEW Noteworthy changes in version 1.6 (2007-10-29) ---------------------------------------------- * Fixed a build problem under Windows. * Interface changes relative to the 1.4 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GPG_ERR_UNFINISHED NEW GPG_ERR_SOURCE_GPA NEW GPG_ERR_SOURCE_KLEO NEW Noteworthy changes in version 1.5 (2006-11-30) ---------------------------------------------- * Minor build system fixes. * Updated gettext. Removed included gettext copy. * gpg-error has a new option --version. Noteworthy changes in version 1.4 (2006-09-14) ---------------------------------------------- * Support for Common Lisp is included. * New error codes for the Assuan IPC library. * New error code GPG_ERR_MISSING_ERRNO to be used in cases when a system accidentally does not set errno but a system error definitely occurred. * New error source GPG_ERR_SOURCE_ANY to allow proper use of libgpg-error even if a specific source is not available. * New convenience functions gpg_err_code_from_syserror and gpg_error_from_syserror which make sure never to return 0. * Interface changes relative to the 1.2 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gpg_err_code_from_syserror NEW gpg_error_from_syserror NEW GPG_ERR_SOURCE_ANY NEW GPG_ERR_MISSING_ERRNO NEW GPG_ERR_UNKNOWN_OPTION NEW GPG_ERR_UNKNOWN_COMMAND NEW GPG_ERR_ASS_GENERAL NEW GPG_ERR_ASS_ACCEPT_FAILED NEW GPG_ERR_ASS_CONNECT_FAILED NEW GPG_ERR_ASS_INV_RESPONSE NEW GPG_ERR_ASS_INV_VALUE NEW GPG_ERR_ASS_INCOMPLETE_LINE NEW GPG_ERR_ASS_LINE_TOO_LONG NEW GPG_ERR_ASS_NESTED_COMMANDS NEW GPG_ERR_ASS_NO_DATA_CB NEW GPG_ERR_ASS_NO_INQUIRE_CB NEW GPG_ERR_ASS_NOT_A_SERVER NEW GPG_ERR_ASS_NOT_A_CLIENT NEW GPG_ERR_ASS_SERVER_START NEW GPG_ERR_ASS_READ_ERROR NEW GPG_ERR_ASS_WRITE_ERROR NEW GPG_ERR_ASS_TOO_MUCH_DATA NEW GPG_ERR_ASS_UNEXPECTED_CMD NEW GPG_ERR_ASS_UNKNOWN_CMD NEW GPG_ERR_ASS_SYNTAX NEW GPG_ERR_ASS_CANCELED NEW GPG_ERR_ASS_NO_INPUT NEW GPG_ERR_ASS_NO_OUTPUT NEW GPG_ERR_ASS_PARAMETER NEW GPG_ERR_ASS_UNKNOWN_INQUIRE NEW ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Noteworthy changes in version 1.3 (2006-03-14) ---------------------------------------------- * GNU gettext is included for systems that do not provide it. Noteworthy changes in version 1.2 (2006-03-03) ---------------------------------------------- * New function gpg_err_init, which binds the locale directory to the text domain. This function is a constructor on GCC targets, so it does not need to be called explicitely. The header file defines GPG_ERR_INITIALIZED in this case. This is experimental for now. * "./autogen.sh --build-w32" does now also build a DLL for W32. Translations are not yet provided for this platform. * New error codes GPG_ERR_UNKNOWN_EXTN and GPG_ERR_UNKNOWN_CRIT_EXTN. * New error code GPG_ERR_LOCKED. * New translations included for France, Romania, and Vietnamese. * Interface changes relative to the 1.1 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GPG_ERR_UNKNOWN_EXTN NEW GPG_ERR_UNKNOWN_CRIT_EXTN NEW GPG_ERR_LOCKED NEW gpg_err_init NEW GPG_ERR_INITIALIZED NEW ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Noteworthy changes in version 1.1 (2005-06-20) ---------------------------------------------- * Bug fixes. Noteworthy changes in version 1.0 (2004-07-30) ---------------------------------------------- * Ported to Solaris 2.8. * Added a new error source GPG_ERR_SOURCE_GSTI, and new error codes GPG_ERR_PROTOCOL_VIOLATION and GPG_ERR_INV_MAC for this source. * Interface changes relative to the 0.7 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GPG_ERR_SOURCE_GSTI NEW GPG_ERR_PROTOCOL_VIOLATION NEW GPG_ERR_INV_MAC NEW GPG_ERR_INV_REQUEST NEW ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Noteworthy changes in version 0.7 (2004-03-07) ---------------------------------------------- * libgpg-error can be built on systems where the errno macros do not evaluate to plain numbers, but expressions. If you want to cross-compile, you might have to set CC_FOR_BUILD, though. * A new tool gpg-error to convert error numbers into symbols into strings is provided. * Interface changes relative to the 0.6 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GPG_ERR_LOCALE_PROBLEM NEW GPG_ERR_NOT_LOCKED NEW ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Noteworthy changes in version 0.6 (2003-11-14) ---------------------------------------------- * German translation included. * It is now possible to use the inline functions even for non C99 compliant compilers by given e.g. -DGPG_ERR_INLINE=inline when compiling an application using this library. Note, that gcc will use inline anyway. * Interface changes relative to the 0.5 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GPG_ERR_SOURCE_KSBA NEW GPG_ERR_SOURCE_DIRMNGR NEW GPG_ERR_TRUNCATED NEW GPG_ERR_NO_ENCODING_METHOD NEW GPG_ERR_NO_ENCRYPTION_SCHEME NEW GPG_ERR_NO_SIGNATURE_SCHEME NEW GPG_ERR_INV_ATTR NEW GPG_ERR_NO_VALUE NEW GPG_ERR_NOT_FOUND NEW GPG_ERR_VALUE_NOT_FOUND NEW GPG_ERR_SYNTAX NEW GPG_ERR_INV_CRL NEW GPG_ERR_BAD_BER NEW GPG_ERR_INV_BER NEW GPG_ERR_ELEMENT_NOT_FOUND NEW GPG_ERR_IDENTIFIER_NOT_FOUND NEW GPG_ERR_INV_TAG NEW GPG_ERR_INV_LENGTH NEW GPG_ERR_INV_KEYINFO NEW GPG_ERR_UNEXPECTED_TAG NEW GPG_ERR_NOT_DER_ENCODED, NEW GPG_ERR_NO_CMS_OBJ NEW GPG_ERR_INV_CMS_OBJ NEW GPG_ERR_UNKNOWN_CMS_OBJ, NEW GPG_ERR_UNSUPPORTED_CMS_OBJ NEW GPG_ERR_UNSUPPORTED_ENCODING, NEW GPG_ERR_UNSUPPORTED_CMS_VERSION NEW GPG_ERR_UNKNOWN_ALGORITHM NEW GPG_ERR_ENCODING_PROBLEM NEW GPG_ERR_INV_STATE NEW GPG_ERR_DUP_VALUE, NEW GPG_ERR_MISSING_ACTION NEW GPG_ERR_MODULE_NOT_FOUND NEW GPG_ERR_INV_OID_STRING NEW GPG_ERR_INV_TIME NEW GPG_ERR_INV_CRL_OBJ NEW GPG_ERR_UNSUPPORTED_CRL_VERSION NEW GPG_ERR_INV_CERT_OBJ NEW GPG_ERR_UNKNOWN_NAME NEW GPG_ERR_BUFFER_TOO_SHORT. NEW ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Noteworthy changes in version 0.5 (2003-10-06) ---------------------------------------------- * New thread safe interface gpg_strerror_r. * New error code GPG_ERR_PIN_NOT_SYNCED has been added. * Interface changes relative to the 0.4 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gpg_strerror_r NEW GPG_ERR_PIN_NOT_SYNCED NEW ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Noteworthy changes in version 0.4 (2003-09-03) ---------------------------------------------- * Fixed another bug that prevented that system errors were created correctly in the first place. * Use inline in public header file only on C99 compilers. Noteworthy changes in version 0.3 (2003-07-31) ---------------------------------------------- * Fixed bug that prevented that system errors were mapped to error strings correctly. Noteworthy changes in version 0.2 (2003-07-30) ---------------------------------------------- * Value of the error code GPG_ERR_CANCELED was fixed. * New error codes GPG_ERR_WRONG_CARD, GPG_ERR_HARDWARE, GPG_ERR_PIN_BLOCKED and GPG_ERR_USE_CONDITIONS have been added. * The header file has been made C++ clean. * AM_PATH_GPG_ERR has been fixed to work without explicit version number. * The header file now uses inline instead __inline__ for non-GNU compilers. Noteworthy changes in version 0.1 (2003-06-06) ---------------------------------------------- * Initial release. Copyright 2003, 2004, 2005, 2010 g10 Code GmbH This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without modifications, as long as this notice is preserved. This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/doc/errorref.txt b/doc/errorref.txt index d6c06aa..f35a35f 100644 --- a/doc/errorref.txt +++ b/doc/errorref.txt @@ -1,1155 +1,1224 @@ # errorref.txt - Description of error codes # Copyright (C) 2003-2004, 2010, 2013-2016 g10 Code GmbH # # This file is part of libgpg-error. # # libgpg-error is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation; either version 2.1 of # the License, or (at your option) any later version. # # libgpg-error is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, see . ## ## Note that lines with a leading double hash will not installed. ## Please do not put any tabs into this file. ## ## find ~/s/{gnupg,libgpg-error,libksba,libgcrypt,gpgme,gpa} -type f \ ## -name '*.[ch]' -print0 | xargs -0 grep -n GPG_ERR_ GPG_ERR_UNKNOWN_PACKET Unknown packet GNUPG: - Redefined to G10ERR_UNKNOWN_PACKET in gpg. GPG_ERR_UNKNOWN_VERSION Unknown version in packet Used by GnuPG 2.1 to identify valid OpenPGP packets with an unknown version. GPG_ERR_PUBKEY_ALGO Invalid public key algorithm GNUPG: - Redefined to G10ERR_PUBKEY_ALGO in gpg. - Public key algorithm is not allowed by OpenPGP. GCRYPT: - Public key algorithm is not defined or not available. Note that this is also the case if the algorithm has been disabled. - [version < 1.5] Checking of the RSA secret key failed (consistency check). GPG_ERR_DIGEST_ALGO Invalid digest algorithm GNUPG: - Digest algorithm is not supported. - Redefined to G10ERR_PUBKEY_ALGO in gpg. - Digest algorithm is not allowed by OpenPGP. - Unsupported algorithm given to "--hash=" option of certain Assuan server commands. - Signature creation or verification failed due to an unsupported hash algorithm. GCRYPT: - Digest key algorithm is not defined or not available. Note that this is also the case if the algorithm has been disabled. - Unsupported digest algorithm in a selftest. - Invalid digest algorithm used in FIPS mode. Note that in enforced-FIPS mode there is no such error return. - Message digested or HMAC computation finished with no message algorithm enabled for the hash context. - Bad digest algorithm given to public key function. GPG_ERR_BAD_PUBKEY Bad public key GNUPG: - Redefined to G10ERR_BAD_PUBKEY in gpg. - Missing public or domain parameter in an s-expression. If the curve name is mssing GPG_ERR_INV_CURVE may be used as well. GPG_ERR_BAD_SECKEY Bad secret key GNUPG: - Invalid format of a S-expression encoded private key in gpg-agent. - Missing secret parameter in an s-expression. - A protected or shadowed private key was passed to the OpenPGP card application for storing it on the card. - A private key passed to the OpenPGP card application does not match the requirements of the card or misses required parameters. - Gpg'agents import key command is not able to convert the key to the internal format. GCRYPT: - Checking the secret key failed (consistency check). GPG_ERR_BAD_SIGNATURE Bad signature GNUPG: - Redefined to G10ERR_BAD_SIGN in gpg. - The MDC check of an OpenPGP encrypted message failed. - A OpenPGP key signature did not verify. - A signature with a key flagged as "never trust" was made. GCRYPT: - A public key signature did not verify. GPG_ERR_NO_PUBKEY No public key GNUPG: - Redefined to G10ERR_NO_PUBKEY in gpg. - A key was requested from an OpenPGP card but the key is not stored on the card. - The public key could not be retrieved from a corresponding certificate on a card (command READKEY in scd). - A requested certificate was not found or an unspecified error occurred while selecting a X.509 certificate in gpgsm. - The specified certificate or key was not found. This does not necessary mean that the certifciate is not available but the specification method may not be usable for the given certificate. May also happen for certificates somewhere in the chain while validaiting a certificate chain. - The requested encryption certificate was not found. - A certificate specified in a CMS message is not available and thus the signature could not be verified or details of the certificate be shown. GPA: - No key was given for encryption. - The selected encryption protocol is not available. GPG_ERR_CHECKSUM Checksum error GNUPG: - The checksum of an unprotected OpenPGP secret key packet is wrong. GCRYPT: - Decryption in AESWRAP mode does not match the expected IV. [more to come] GPG_ERR_BAD_PASSPHRASE Bad passphrase GNUPG: - The entered passphrase does not verify GPG_ERR_CIPHER_ALGO Invalid cipher algorithm GPG_ERR_KEYRING_OPEN Cannot open keyring GPG_ERR_INV_PACKET Invalid packet GPG_ERR_INV_ARMOR Invalid armor GPG_ERR_NO_USER_ID No user ID GPG_ERR_NO_SECKEY No secret key NTBTLS: - No private key or pre-shared key available. GPG_ERR_WRONG_SECKEY Wrong secret key used GPG_ERR_BAD_KEY Bad session key GNUPG: - gpg-agent's command IMPORT_KEY or EXPORT_KEY is used without a prior KEYWRAP_KEY command. [more to come] GPG_ERR_COMPR_ALGO Unknown compression algorithm GPG_ERR_NO_PRIME Number is not prime GPG_ERR_NO_ENCODING_METHOD Invalid encoding method GPG_ERR_NO_ENCRYPTION_SCHEME Invalid encryption scheme GPG_ERR_NO_SIGNATURE_SCHEME Invalid signature scheme GPG_ERR_INV_ATTR Invalid attribute GPG_ERR_NO_VALUE No value GNUPG: - A timestamp value is expect but there is none. KSBA: - A timestamp value is expect but there is none. - A certificate is missing a required property. - A CMS object is missing a required property. - Converting a Distinguised Name to an RFC2253 string failed. GPG_ERR_NOT_FOUND Not found A search operation did not return a matching value. GPG_ERR_VALUE_NOT_FOUND Value not found GNUPG: - A keyblock or a cert object was requested but not found. This might indicate an internal error here. GPG_ERR_SYNTAX Syntax error GPG_ERR_BAD_MPI Bad MPI value GPG_ERR_INV_PASSPHRASE Invalid passphrase GNUPG: - Required constraints of the passphrase are not met. GPG_ERR_SIG_CLASS Invalid signature class GPG_ERR_RESOURCE_LIMIT Resources exhausted GPG_ERR_INV_KEYRING Invalid keyring GPG_ERR_TRUSTDB Trust DB error GPG_ERR_BAD_CERT Bad certificate NTBTLS: - No subject found in the certifciate. GPG_ERR_INV_USER_ID Invalid user ID GNUPG: - Used to indicate a bad specification of a user id. [more to come] GPG_ERR_UNEXPECTED Unexpected error GPG_ERR_TIME_CONFLICT Time conflict GPG_ERR_KEYSERVER Keyserver error GPG_ERR_WRONG_PUBKEY_ALGO Wrong public key algorithm GNUPG: - The algorithm is not expected. For example a DSA algorithm is used where a non-DSA algorithm is expected or vice versa. May indicate an internal error. NTBTLS: - Public key type mismatch. The peer presented a different key type than requested. GPG_ERR_TRIBUTE_TO_D_A Tribute to D. A. GPG_ERR_WEAK_KEY Weak encryption key GPG_ERR_INV_KEYLEN Invalid key length GPG_ERR_INV_ARG Invalid argument GCRYPT: - Unsupported length of input data in encrypt or decrypt cipher functions. For example not matching the block lengths of the algorithm. - Incompatible args given; e.g. two or none if exactly one is required. [more to come] GPG_ERR_BAD_URI Syntax error in URI GPG_ERR_INV_URI Invalid URI GPG_ERR_NETWORK Network error GPG_ERR_UNKNOWN_HOST Unknown host Used instead of the non-portable EHOSTNOTFOUND which is returned by some systems as a mapping of h_errno's HOST_NOT_FOUND GPG_ERR_SELFTEST_FAILED Selftest failed GPG_ERR_NOT_ENCRYPTED Data not encrypted GPG_ERR_NOT_PROCESSED Data not processed GPG_ERR_UNUSABLE_PUBKEY Unusable public key GPG_ERR_UNUSABLE_SECKEY Unusable secret key GPG_ERR_INV_VALUE Invalid value NTBTLS: - A DH parameter is out of range - + GnuPG: - An Assuan server returns a status line with + unexpected values. GPG_ERR_BAD_CERT_CHAIN Bad certificate chain GPG_ERR_MISSING_CERT Missing certificate NTBTLS: - The server needs to send a certifciate but none has been set. See also GPG_ERR_MISSING_ISSUER_CERT and GPG_ERR_MISSING_CLIENT_CERT. GPG_ERR_NO_DATA No data GPG_ERR_BUG Bug GPG_ERR_NOT_SUPPORTED Not supported Used if a feature is currently not supported but may be enabled for example using a program option. Commonly used if a feature has been disabled by an administrator. See also GPG_ERR_NOT_ENABLED. Sometimes also used for features which are not yet supported. GPG_ERR_INV_OP Invalid operation code GPG_ERR_TIMEOUT Timeout Some function or network access timed out. GPG_ERR_INTERNAL Internal error GPG_ERR_EOF_GCRYPT EOF (gcrypt) GPG_ERR_INV_OBJ Invalid object GPG_ERR_TOO_SHORT Provided object is too short GPG_ERR_TOO_LARGE Provided object is too large GPG_ERR_NO_OBJ Missing item in object GPG_ERR_NOT_IMPLEMENTED Not implemented NTBTLS: - The requested feature is not implemented. GPG_ERR_CONFLICT Conflicting use NTBTLS: - Function has already been called and may not be called again at this protocol state. GNUPG: - Returned by g13 when creating a new container on a device which seems to be in use. GPG_ERR_INV_CIPHER_MODE Invalid cipher mode GPG_ERR_INV_FLAG Invalid flag GPGME: Used to indicate an invalid combination of flags. GPG_ERR_INV_HANDLE Invalid handle GPG_ERR_TRUNCATED Result truncated GPG_ERR_INCOMPLETE_LINE Incomplete line GPG_ERR_INV_RESPONSE Invalid response GPG_ERR_NO_AGENT No agent running GPG_ERR_AGENT agent error GPG_ERR_INV_DATA Invalid data GNUPG: - Used in app-openpgp.c for a badly formatted request. GCRYPT: - No passphrase given for gcry_kdf_derive. - An opaque MPI is given to a public key function but not expected. GPG_ERR_ASSUAN_SERVER_FAULT Unspecific Assuan server fault GPG_ERR_ASSUAN General Assuan error GNUPG: - Used by Assuan command handler if they fail to do basic things like an es_fdopen or es_fopencookie. GPG_ERR_INV_SESSION_KEY Invalid session key GPG_ERR_INV_SEXP Invalid S-expression GPG_ERR_UNSUPPORTED_ALGORITHM Unsupported algorithm GPG_ERR_NO_PIN_ENTRY No pinentry GPG_ERR_PIN_ENTRY pinentry error GPG_ERR_BAD_PIN Bad PIN GPG_ERR_INV_NAME Invalid name GNUPG: - Formerly used in GPGSM to indicate an error in the specification of a user id. Later replaced by GPG_ERR_INV_USER_ID. - In G13 to indicate a bad file name (e.g. one with an embedded Nul byte when given as escaped string. - In SCDAEMON for an unknown attribute name. Also used for URLs which have non-acceptable characters for the specific application. [more to come] GPG_ERR_BAD_DATA Bad data GPG_ERR_INV_PARAMETER Invalid parameter GNUPG: - Returned if gpg-agent sends a new generated key with unknown parameter names. - Invalid parameter in the parameter file for key generation by gpgsm. GPG_ERR_WRONG_CARD Wrong card GPG_ERR_NO_DIRMNGR No dirmngr GPG_ERR_DIRMNGR dirmngr error GPG_ERR_CERT_REVOKED Certificate revoked GPG_ERR_NO_CRL_KNOWN No CRL known GPG_ERR_CRL_TOO_OLD CRL too old GPG_ERR_LINE_TOO_LONG Line too long GPG_ERR_NOT_TRUSTED Not trusted GPG_ERR_CANCELED Operation cancelled GPG_ERR_BAD_CA_CERT Bad CA certificate GPG_ERR_CERT_EXPIRED Certificate expired GPG_ERR_CERT_TOO_YOUNG Certificate too young GPG_ERR_UNSUPPORTED_CERT Unsupported certificate GPG_ERR_UNKNOWN_SEXP Unknown S-expression GPG_ERR_UNSUPPORTED_PROTECTION Unsupported protection GPG_ERR_CORRUPTED_PROTECTION Corrupted protection GPG_ERR_AMBIGUOUS_NAME Ambiguous name GPG_ERR_CARD Card error GPG_ERR_CARD_RESET Card reset required GPG_ERR_CARD_REMOVED Card removed GPG_ERR_INV_CARD Invalid card GPG_ERR_CARD_NOT_PRESENT Card not present GPG_ERR_NO_PKCS15_APP No PKCS15 application GPG_ERR_NOT_CONFIRMED Not confirmed GPG_ERR_CONFIGURATION Configuration error GPG_ERR_NO_POLICY_MATCH No policy match GPG_ERR_INV_INDEX Invalid index GPG_ERR_INV_ID Invalid ID GPG_ERR_NO_SCDAEMON No SmartCard daemon GPG_ERR_SCDAEMON SmartCard daemon error GPG_ERR_UNSUPPORTED_PROTOCOL Unsupported protocol GPG: - An unsupported keyserver protocol. GPG_AGENT: - Invalid shadow_info protocol (not "t1-v1") LIBKSBA: - Unknown OID of the OCSP response bytes GPGME: - GPGME_PROTOCOL_xxx not supported. NTBTLS: - Handshake protocol version not supported. GPG_ERR_BAD_PIN_METHOD Bad PIN method GPG_ERR_CARD_NOT_INITIALIZED Card not initialized SCDAEMON: - A card function is called but the card has not yet been initialized. This may be due to a conflict with another card using connection or due to a bug. GPG_ERR_UNSUPPORTED_OPERATION Unsupported operation GPG_ERR_WRONG_KEY_USAGE Wrong key usage GNUPG: - Key usage not possible with selected algorithm. GPG_ERR_NOTHING_FOUND Nothing found Indicates that the operation was not possible because nothing has been found. For example an update request for non existent data. GPG_ERR_WRONG_BLOB_TYPE Wrong blob type + GNUPG: - The keyboxd returns an unexpected blob + (e.g. OpenPGP was requested but X.509 returned). + GPG_ERR_MISSING_VALUE Missing value GNUPG: - Not enough parameters for a secret key send to gpg-agent. GCRYPT: - A required parameter has not been given. GPG_ERR_HARDWARE Hardware problem GPG_ERR_PIN_BLOCKED PIN blocked GPG_ERR_USE_CONDITIONS Conditions of use not satisfied GPG_ERR_PIN_NOT_SYNCED PINs are not synced GPG_ERR_INV_CRL Invalid CRL GPG_ERR_BAD_BER BER error GPG_ERR_INV_BER Invalid BER GPG_ERR_ELEMENT_NOT_FOUND Element not found GPG_ERR_IDENTIFIER_NOT_FOUND Identifier not found GPG_ERR_INV_TAG Invalid tag GPG_ERR_INV_LENGTH Invalid length GCRYPT: - Bad block length for certain cipher algorithms and modes. - Bad length of input data; e.g. not a multiple of the block length. - A length does not match the size of the digest algorithm. - Length of signature or public key is not as expected (e.g. in EdDSA). [more to come] GNUPG: - Invalid hash length for a pubkey [more to come] GPG_ERR_INV_KEYINFO Invalid key info KSBA: - Returned if the ASN.1 Keyinfo structure is not valid GPG_ERR_UNEXPECTED_TAG Unexpected tag GPG_ERR_NOT_DER_ENCODED Not DER encoded GPG_ERR_NO_CMS_OBJ No CMS object GPG_ERR_INV_CMS_OBJ Invalid CMS object GPG_ERR_UNKNOWN_CMS_OBJ Unknown CMS object GPG_ERR_UNSUPPORTED_CMS_OBJ Unsupported CMS object GPG_ERR_UNSUPPORTED_ENCODING Unsupported encoding GNUPG: - Returned by Dirmngr if a keyserver returns a HTML document. GPG_ERR_UNSUPPORTED_CMS_VERSION Unsupported CMS version GPG_ERR_UNKNOWN_ALGORITHM Unknown algorithm GCRYPT: gcry_kdf_proc for an unknown kdf algorithm GPG_ERR_INV_ENGINE Invalid crypto engine GPGME: Several uses use cases. For example: - Unexpected format of a status line. GPG_ERR_PUBKEY_NOT_TRUSTED Public key not trusted GPG_ERR_DECRYPT_FAILED Decryption failed GPG_ERR_KEY_EXPIRED Key expired GPG_ERR_SIG_EXPIRED Signature expired GPG_ERR_ENCODING_PROBLEM Encoding problem GPG_ERR_INV_STATE Invalid state The state (of a protocol) is not possible or not defined at all. NTBTLS: - Data received in an unexpected state. - A function is called while not being in the right state. GPG_ERR_DUP_VALUE Duplicated value GPG_ERR_MISSING_ACTION Missing action GNUPG: - In G13 the server command "MOUNT" is used without prior use of the command "OPEN". others: - The libassuan ce-server test program uses this to indicate that the client did not connect to the server as requested. GPG_ERR_MODULE_NOT_FOUND ASN.1 module not found GPG_ERR_INV_OID_STRING Invalid OID string GPG_ERR_INV_TIME Invalid time GPG_ERR_INV_CRL_OBJ Invalid CRL object GPG_ERR_UNSUPPORTED_CRL_VERSION Unsupported CRL version GPG_ERR_INV_CERT_OBJ Invalid certificate object GPGME: - A bad certificate (gpgme_key_t) has been passed to a function. For example it might be incomplete due to a missing fingerprint. GNUPG: - A certificate has a length of zero. GPG_ERR_UNKNOWN_NAME Unknown name Used by GPG to indicate an unknown ECC curve name (may also indicate missing ECC support). It is also used to indicate an unsuported parameter name in functions which take a name and value to update state. Note that GPG_ERR_UNKNOWN_CURVE is used instead by newer code. GPG_ERR_LOCALE_PROBLEM A locale function failed GPG_ERR_NOT_LOCKED Not locked GPG_ERR_PROTOCOL_VIOLATION Protocol violation GNUPG: - Used for invalid HTTP responses. GPG_ERR_INV_MAC Invalid MAC The length, algo, or other properties of a MAC are not met. See also GPG_ERR_BAD_MAC. GPG_ERR_INV_REQUEST Invalid request GPG_ERR_UNKNOWN_EXTN Unknown extension GPG_ERR_UNKNOWN_CRIT_EXTN Unknown critical extension GPG_ERR_LOCKED Locked GPG_ERR_UNKNOWN_OPTION Unknown option GPG_ERR_UNKNOWN_COMMAND Unknown command GPG_ERR_NOT_OPERATIONAL Not operational GPG_ERR_NO_PASSPHRASE No passphrase given GPG_ERR_NO_PIN No PIN given GPG_ERR_NOT_ENABLED Not enabled Similar to GPG_ERR_NOT_SUPPORTED. In general this error is used for disabled features which can be expected to be enabled by the user. GPG_ERR_NO_ENGINE No crypto engine GPG_ERR_MISSING_KEY Missing key GNUPG: - gpg-agent returns this error on import or export if a key wrapping transport key has not been specified. - It is used when the name "Key" is not found while looking up name value pairs of the extended private key format GCRYPT: - A key has not been set when calling a symmetric encryption function. GPG_ERR_TOO_MANY Too many objects GPG: - Dirmngr KS_GET called with too many pattern so that the maximum Assuan line length would overflow. - gpgsm's command export --secret called with too man keys. GPGME: - To many patterns in gpgme-tools's KEYLIST command. GPG_ERR_LIMIT_REACHED Limit reached A programmed limit has been reached. GnuPG: gpgtar: Extract directory can't be created because too many of directories with a similar name are already existing. GPG_ERR_NOT_INITIALIZED Not initialized An operation can't be performed because something has not been initialized. This might be a missing initialization of an entire subsystems or a prerequisite for using a function is not fulfilled. GPG_ERR_MISSING_ISSUER_CERT Missing issuer certificate GPG_ERR_NO_KEYSERVER No keyserver available No keyserver configured or no keyserver available due to missing support for the requested protocol. Found in Dirmngr. GPG_ERR_INV_CURVE Invalid elliptic curve The curve parameter is missing or the curve is invalid; for example it is not possible to get affine coordinates for the public key. GPG_ERR_UNKNOWN_CURVE Unknown elliptic curve The curve is not known or not supported by the protocol. GPG_ERR_DUP_KEY Duplicated key A duplicated key was detected. For example a unique key in a database occurred more than once. Also used if in a protocol an expected key was returned more than once. GPG_ERR_AMBIGUOUS Ambiguous search A search etc returned an ambigious result. This usually means that the search string was not specific enough. GPG_ERR_NO_CRYPT_CTX No crypto context A crypto context was expected but not given. Commonly used by Libgcrypt. GPG_ERR_WRONG_CRYPT_CTX Wrong crypto context The given crypto context does not match the requirements. For example in Libgcrypt a crypto context has private data pertaining to certain algorithms. This error is for example returned if a crypto context initialized for a different algorithm is used. GPG_ERR_BAD_CRYPT_CTX Bad crypto context The is a problem with the crypto context. For example it has not been properly initialized. GPG_ERR_CRYPT_CTX_CONFLICT Conflict in the crypto context Conflicting use of a crypto context. For example if a context is used with objects that don't match the state of the context. GPG_ERR_BROKEN_PUBKEY Broken public key The public key was mathematically not correctly generated. (It would have been nicer if we would have used BAD_PUBKEY for this, but that error code is in long time use to describe for example policy and encoding problems with a key. Using INV_PUBKEY would have been better for these purposes) GPG_ERR_BROKEN_SECKEY Broken secret key The secret key was mathematically not correctly generated. GPG_ERR_MAC_ALGO GCRYPT: - MAC key algorithm is not defined or not available. GPG_ERR_FULLY_CANCELED Operation fully cancelled GPG_ERR_UNFINISHED Operation not yet finished GPG_ERR_BUFFER_TOO_SHORT Buffer too short GPG_ERR_SEXP_INV_LEN_SPEC Invalid length specifier in S-expression GPG_ERR_SEXP_STRING_TOO_LONG String too long in S-expression GPG_ERR_SEXP_UNMATCHED_PAREN Unmatched parentheses in S-expression GPG_ERR_SEXP_NOT_CANONICAL S-expression not canonical GPG_ERR_SEXP_BAD_CHARACTER Bad character in S-expression GPG_ERR_SEXP_BAD_QUOTATION Bad quotation in S-expression GPG_ERR_SEXP_ZERO_PREFIX Zero prefix in S-expression GPG_ERR_SEXP_NESTED_DH Nested display hints in S-expression GPG_ERR_SEXP_UNMATCHED_DH Unmatched display hints GPG_ERR_SEXP_UNEXPECTED_PUNC Unexpected reserved punctuation in S-expression GPG_ERR_SEXP_BAD_HEX_CHAR Bad hexadecimal character in S-expression GPG_ERR_SEXP_ODD_HEX_NUMBERS Odd hexadecimal numbers in S-expression GPG_ERR_SEXP_BAD_OCT_CHAR Bad octal character in S-expression GPG_ERR_SUBKEYS_EXP_REV All subkeys are expired or revoked GPG_ERR_DB_CORRUPTED Database is corrupted GPG_ERR_SERVER_FAILED Server indicated a failure GPG_ERR_NO_NAME No name GNUPG: - No component given in gpgconf runs. - A field name is missing in an import/export filter. - "Domain not found". - "Host not found". - Host or service name not found (EAI_NONAME). - No or erroneous SRV record. GPG_ERR_NO_KEY No key Some kind of key was not found. GPG_ERR_LEGACY_KEY Legacy key Used by GnuPG to identify version 2 and 3 OpenPGP key packets. GPG_ERR_REQUEST_TOO_SHORT Request too short A received request is too short to continue processing. GPG_ERR_REQUEST_TOO_LONG Request too long A received request is too long to continue processing. This may be due to an internal limitation, a protocol violation, or due to the use of a newer version of a protocol. GPG_ERR_OBJ_TERM_STATE Object is in termination state For cards this is the ISO status word 0x6285 (file is in termination state). GPG_ERR_NO_CERT_CHAIN No certificate chain NTBTLS: - A CA chain has not been set but is required. GPG_ERR_CERT_TOO_LARGE Certificate is too large NTBTLS: - A certificate is too large to be used by the protocol. GPG_ERR_INV_RECORD Invalid record NTBTLS: - An invalid record was received GPG_ERR_BAD_MAC The MAC does not verify NTBTLS: - MAC verification of the message failed. GPG_ERR_UNEXPECTED_MSG Unexpected message GNUPG: - An unexpected WKS message was received. NTBTLS: - Unexpected message received. GPG_ERR_COMPR_FAILED Compression or decompression failed NTBTLS: - As the description says. GPG_ERR_WOULD_WRAP A counter would wrap NTBTLS: - Too many messages exchanged Other: - A counter would wrap. GPG_ERR_FATAL_ALERT Fatal alert message received NTBTLS: - Fatal alert message received from the peer. GPG_ERR_NO_CIPHER No cipher algorithm NTBTLS: - Server and client have no algo in common GPG_ERR_MISSING_CLIENT_CERT Missing client certificate NTBTLS: - No certificate received from client. GPG_ERR_CLOSE_NOTIFY Close notification received NTBTLS: - Alert with a close notification received GPG_ERR_TICKET_EXPIRED Ticket expired NTBTLS: - Session ticket has expired. GPG_ERR_BAD_TICKET Bad ticket NTBTLS: - Bad new session ticket message. GPG_ERR_UNKNOWN_IDENTITY Unknown identity NTBTLS: - Unknown PSK identify received GPG_ERR_BAD_HS_CERT Bad certificate message in handshake NTBTLS: - As the description says. GPG_ERR_BAD_HS_CERT_REQ Bad certificate request message in handshake NTBTLS: - As the description says. GPG_ERR_BAD_HS_CERT_VER Bad certificate verify message in handshake NTBTLS: - As the description says. GPG_ERR_BAD_HS_CHANGE_CIPHER Bad change cipher message in handshake NTBTLS: - As the description says. GPG_ERR_BAD_HS_CLIENT_HELLO Bad client hello message in handshake NTBTLS: - As the description says. GPG_ERR_BAD_HS_SERVER_HELLO Bad server hello message in handshake NTBTLS: - As the description says. GPG_ERR_BAD_HS_SERVER_HELLO_DONE Bad server hello done message in handshake NTBTLS: - As the description says. GPG_ERR_BAD_HS_FINISHED Bad finished message in handshake NTBTLS: - As the description says. GPG_ERR_BAD_HS_SERVER_KEX Bad server key exchange message in handshake NTBTLS: - As the description says. GPG_ERR_BAD_HS_CLIENT_KEX Bad client key exchange message in handshake NTBTLS: - As the description says. GPG_ERR_BOGUS_STRING Bogus string Used if a protocol sends length prefixed strings which contain a Nul byte and further processing would discard the rest of the string. May also be used if a string contains unexpected and possible dangerous characters (e.g. control characters in a domain name). GPG_ERR_FORBIDDEN Forbidden The use of a features is not allowed due to insufficient rights. Use by gpg-agent as an error codes for restricted commands. GPG_ERR_KEY_DISABLED Key disabled GNUPG: - The key has been disabled by the user. GPG_ERR_KEY_ON_CARD Not possible with a card based key GNUPG: - The gpg-agent returns this if a DELETE_KEY commands is used for a smartcard based key. GPG_ERR_INV_LOCK_OBJ Invalid lock object GPGRT: - The provided lock object is not valid. This indicates an internal problem in libgpg-error or more likely a programming error. GPG_ERR_TRUE True Used to return the boolean value True. Note that GPG_ERR_NO_ERROR (with the value 0) is also often used to indicate the value true. GPG_ERR_FALSE False Used to return the boolean value False. GPG_ERR_ASS_GENERAL General IPC error GPG_ERR_ASS_ACCEPT_FAILED IPC accept call failed GPG_ERR_ASS_CONNECT_FAILED IPC connect call failed GPG_ERR_ASS_INV_RESPONSE Invalid IPC response GPG_ERR_ASS_INV_VALUE Invalid value passed to IPC GPG_ERR_ASS_INCOMPLETE_LINE Incomplete line passed to IPC GPG_ERR_ASS_LINE_TOO_LONG Line passed to IPC too long GPG_ERR_ASS_NESTED_COMMANDS Nested IPC commands GPG_ERR_ASS_NO_DATA_CB No data callback in IPC GPG_ERR_ASS_NO_INQUIRE_CB No inquire callback in IPC GPG_ERR_ASS_NOT_A_SERVER Not an IPC server GPG_ERR_ASS_NOT_A_CLIENT Not an IPC client GPG_ERR_ASS_SERVER_START Problem starting IPC server GPG_ERR_ASS_READ_ERROR IPC read error GPG_ERR_ASS_WRITE_ERROR IPC write error GPG_ERR_ASS_TOO_MUCH_DATA Too much data for IPC layer GPG_ERR_ASS_UNEXPECTED_CMD Unexpected IPC command GPG_ERR_ASS_UNKNOWN_CMD Unknown IPC command GPG_ERR_ASS_SYNTAX IPC syntax error GPG_ERR_ASS_CANCELED IPC call has been cancelled GPG_ERR_ASS_NO_INPUT No input source for IPC GPG_ERR_ASS_NO_OUTPUT No output source for IPC GPG_ERR_ASS_PARAMETER IPC parameter error GPG_ERR_ASS_UNKNOWN_INQUIRE Unknown IPC inquire GPG_ERR_ENGINE_TOO_OLD Crypto engine too old GPG_ERR_WINDOW_TOO_SMALL Screen or window too small Pinentry: - The size of the screen is too small. GPG_ERR_WINDOW_TOO_LARGE Screen or window too large GPG_ERR_MISSING_ENVVAR Required environment variable not set Pinentry: - The size of the screen can't be determined. GPG_ERR_USER_ID_EXISTS User ID already exists GNUPG: - Existing user ID in --quick-gen-key. GPG_ERR_NAME_EXISTS Name already exists GPG_ERR_DUP_NAME Duplicated name GPG_ERR_TOO_YOUNG Objects is too young For example used if a file is younger than expected. GPG_ERR_TOO_OLD Objects is too old Used if an object is too old to be used. This is a more generic code than GPG_ERR_ENGINE_TOO_OLD or GPG_ERR_CRL_TOO_OLD. GPG_ERR_UNKNOWN_FLAG Unknown flag The flag is not known. GNUPG: - The flag part of the string given to the option --default-new-key-algo value is not known. GPG_ERR_INV_ORDER Invalid execution order GNUPG: - In Dirmngr used for the libdns error code DNS_EORDER. GPG_ERR_ALREADY_FETCHED Already fetched GNUPG: - In Dirmngr used for the libdns error code DNS_EFETCHED. GPG_ERR_TRY_LATER Try again later This indicates that a server asked to try again later; thus it is different from EAGAIN which is used by the local system. This code is for example used instead of h_error's TRY_AGAIN. GPG_ERR_WRONG_NAME Wrong name NTBTLS: - Hostname does not match the certificate GPG_ERR_NO_AUTH Not authenticated GnuPG: - A smartcard requires authentication GPG_ERR_BAD_AUTH Bad authentication GnuPG: - A smartcard could not be authenticated. For example a wrong authentication key was used with a PIV card. GPG_ERR_NO_KEYBOXD No Keyboxd running GnuPG: - The keyboxd component is not running GPG_ERR_KEYBOXD Keyboxd error GnuPG: - Malfunction in the keyboxd GPG_ERR_NO_SERVICE Service is not running A component is not running. Tnis is a generic version of GPG_ERR_NO_AGENT et al. GPG_ERR_SERVICE Service error An error occured in a service component. This is a generic version of GPG_ERR_AGENT et al. GPG_ERR_SYSTEM_BUG System bug detected The underlying operating system misbehaved. For example it wrote more to a buffer than the told maximum size. GPG_ERR_DNS_UNKNOWN Unknown DNS error Used by Dirmngr for DNS errors from libdns (DNS_EUNKNOWN); GPG_ERR_DNS_SECTION Invalid DNS section Used by Dirmngr for DNS errors from libdns (DNS_ESECTION); GPG_ERR_DNS_ADDRESS Invalid textual address form Used by Dirmngr for DNS errors from libdns (DNS_EADDRESS); GPG_ERR_DNS_NO_QUERY Missing DNS query packet Used by Dirmngr for DNS errors from libdns (DNS_ENOQUERY); GPG_ERR_DNS_NO_ANSWER Missing DNS answer packet Used by Dirmngr for DNS errors from libdns (DNS_ENOANSWER); GPG_ERR_DNS_CLOSED Connection closed in DNS Used by Dirmngr for DNS errors from libdns (DNS_ECONNFIN); GPG_ERR_DNS_VERIFY Verification failed in DNS Used by Dirmngr for DNS errors from libdns (DNS_EVERIFY); GPG_ERR_DNS_TIMEOUT DNS Timeout A DNS query timed out GPG_ERR_LDAP_GENERAL LDAP General error Catch all error for LDAP. Use when an error code could not be mapped to a gpg-error code. GPG_ERR_LDAP_ATTR_GENERAL LDAP General attribute error GPG_ERR_LDAP_NAME_GENERAL LDAP General name error GPG_ERR_LDAP_SECURITY_GENERAL LDAP General security error GPG_ERR_LDAP_SERVICE_GENERAL LDAP General service error GPG_ERR_LDAP_UPDATE_GENERAL LDAP General update error GPG_ERR_LDAP_E_GENERAL LDAP Experimental error code GPG_ERR_LDAP_X_GENERAL LDAP Private error code GPG_ERR_LDAP_OTHER_GENERAL LDAP Other general error The 8 GPG_ERR_LDAP_*_GENERAL error codes may be used to map ranges of LDAP errors to one specific code. OpenLDAP uses LDAP_xxx_RANGE(n) macros for that mapping. "Other general error" may be used similar to "General error" for mapping of ranges. Here are macros from OpenLDAP for reference: #define LDAP_ATTR_ERROR(n) LDAP_RANGE((n),0x10,0x15) /* 16-21 */ #define LDAP_NAME_ERROR(n) LDAP_RANGE((n),0x20,0x24) /* 32-34,36 */ #define LDAP_SECURITY_ERROR(n) LDAP_RANGE((n),0x2F,0x32) /* 47-50 */ #define LDAP_SERVICE_ERROR(n) LDAP_RANGE((n),0x33,0x36) /* 51-54 */ #define LDAP_UPDATE_ERROR(n) LDAP_RANGE((n),0x40,0x47) /* 64-69,71 */ #define LDAP_E_ERROR(n) LDAP_RANGE((n),0x1000,0x3FFF) #define LDAP_X_ERROR(n) LDAP_RANGE((n),0x4000,0xFFFF) +GPG_ERR_SQL_OK SQL success + + This code is normally not used because it it mapped to GPG_ERR_NO_ERROR. + +GPG_ERR_SQL_ERROR SQL error + +GPG_ERR_SQL_INTERNAL Internal logic error in SQL library + +GPG_ERR_SQL_PERM Access permission denied (SQL) + +GPG_ERR_SQL_ABORT SQL abort was requested + +GPG_ERR_SQL_BUSY SQL database file is locked + +GPG_ERR_SQL_LOCKED An SQL table in the database is locked + +GPG_ERR_SQL_NOMEM SQL library ran out of core + +GPG_ERR_SQL_READONLY Attempt to write a readonly SQL database + +GPG_ERR_SQL_INTERRUPT SQL operation terminated by interrupt + +GPG_ERR_SQL_IOERR I/O error during SQL operation + +GPG_ERR_SQL_CORRUPT SQL database disk image is malformed + +GPG_ERR_SQL_NOTFOUND Unknown opcode in SQL file control + +GPG_ERR_SQL_FULL Insertion failed because SQL database is full + +GPG_ERR_SQL_CANTOPEN Unable to open the SQL database file + +GPG_ERR_SQL_PROTOCOL SQL database lock protocol error + +GPG_ERR_SQL_EMPTY (internal SQL code: empty) + +GPG_ERR_SQL_SCHEMA SQL database schema changed + +GPG_ERR_SQL_TOOBIG String or blob exceeds size limit (SQL) + +GPG_ERR_SQL_CONSTRAINT SQL abort due to constraint violation + +GPG_ERR_SQL_MISMATCH Data type mismatch (SQL) + +GPG_ERR_SQL_MISUSE SQL library used incorrectly + +GPG_ERR_SQL_NOLFS SQL library uses unsupported OS features + +GPG_ERR_SQL_AUTH Authorization denied (SQL) + +GPG_ERR_SQL_FORMAT (unused SQL code: format) + +GPG_ERR_SQL_RANGE SQL bind parameter out of range + +GPG_ERR_SQL_NOTADB File opened that is not an SQL database file + +GPG_ERR_SQL_NOTICE Notifications from SQL logger + +GPG_ERR_SQL_WARNING Warnings from SQL logger + +GPG_ERR_SQL_ROW SQL has another row ready + +GPG_ERR SQL_DONE SQL has finished executing + + ## end of errorref.txt diff --git a/src/err-codes.h.in b/src/err-codes.h.in index 3178b58..c65775f 100644 --- a/src/err-codes.h.in +++ b/src/err-codes.h.in @@ -1,487 +1,527 @@ # err-codes.h.in - List of error codes and their description input file. /* err-codes.h - List of error codes and their description. Copyright (C) 2003, 2004 g10 Code GmbH This file is part of libgpg-error. libgpg-error is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. libgpg-error is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with libgpg-error; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ # Everything up to the first line that starts with a number in the # first column is copied into the output verbatim. Then, empty lines # are ignored. Other lines must have an error code number, followed # by one or more characters, followed by the error code symbol, # followed by one or more characters, followed by the error # message. Trailing whitespace is removed. The error codes should be # sorted. The last line should not have a number, but only a , # followed by a dummy field, followed by a , followed by a # description for error codes that are not in the list. 0 GPG_ERR_NO_ERROR Success 1 GPG_ERR_GENERAL General error 2 GPG_ERR_UNKNOWN_PACKET Unknown packet 3 GPG_ERR_UNKNOWN_VERSION Unknown version in packet 4 GPG_ERR_PUBKEY_ALGO Invalid public key algorithm 5 GPG_ERR_DIGEST_ALGO Invalid digest algorithm 6 GPG_ERR_BAD_PUBKEY Bad public key 7 GPG_ERR_BAD_SECKEY Bad secret key 8 GPG_ERR_BAD_SIGNATURE Bad signature 9 GPG_ERR_NO_PUBKEY No public key 10 GPG_ERR_CHECKSUM Checksum error 11 GPG_ERR_BAD_PASSPHRASE Bad passphrase 12 GPG_ERR_CIPHER_ALGO Invalid cipher algorithm 13 GPG_ERR_KEYRING_OPEN Cannot open keyring 14 GPG_ERR_INV_PACKET Invalid packet 15 GPG_ERR_INV_ARMOR Invalid armor 16 GPG_ERR_NO_USER_ID No user ID 17 GPG_ERR_NO_SECKEY No secret key 18 GPG_ERR_WRONG_SECKEY Wrong secret key used 19 GPG_ERR_BAD_KEY Bad session key 20 GPG_ERR_COMPR_ALGO Unknown compression algorithm 21 GPG_ERR_NO_PRIME Number is not prime 22 GPG_ERR_NO_ENCODING_METHOD Invalid encoding method 23 GPG_ERR_NO_ENCRYPTION_SCHEME Invalid encryption scheme 24 GPG_ERR_NO_SIGNATURE_SCHEME Invalid signature scheme 25 GPG_ERR_INV_ATTR Invalid attribute 26 GPG_ERR_NO_VALUE No value 27 GPG_ERR_NOT_FOUND Not found 28 GPG_ERR_VALUE_NOT_FOUND Value not found 29 GPG_ERR_SYNTAX Syntax error 30 GPG_ERR_BAD_MPI Bad MPI value 31 GPG_ERR_INV_PASSPHRASE Invalid passphrase 32 GPG_ERR_SIG_CLASS Invalid signature class 33 GPG_ERR_RESOURCE_LIMIT Resources exhausted 34 GPG_ERR_INV_KEYRING Invalid keyring 35 GPG_ERR_TRUSTDB Trust DB error 36 GPG_ERR_BAD_CERT Bad certificate 37 GPG_ERR_INV_USER_ID Invalid user ID 38 GPG_ERR_UNEXPECTED Unexpected error 39 GPG_ERR_TIME_CONFLICT Time conflict 40 GPG_ERR_KEYSERVER Keyserver error 41 GPG_ERR_WRONG_PUBKEY_ALGO Wrong public key algorithm 42 GPG_ERR_TRIBUTE_TO_D_A Tribute to D. A. 43 GPG_ERR_WEAK_KEY Weak encryption key 44 GPG_ERR_INV_KEYLEN Invalid key length 45 GPG_ERR_INV_ARG Invalid argument 46 GPG_ERR_BAD_URI Syntax error in URI 47 GPG_ERR_INV_URI Invalid URI 48 GPG_ERR_NETWORK Network error 49 GPG_ERR_UNKNOWN_HOST Unknown host 50 GPG_ERR_SELFTEST_FAILED Selftest failed 51 GPG_ERR_NOT_ENCRYPTED Data not encrypted 52 GPG_ERR_NOT_PROCESSED Data not processed 53 GPG_ERR_UNUSABLE_PUBKEY Unusable public key 54 GPG_ERR_UNUSABLE_SECKEY Unusable secret key 55 GPG_ERR_INV_VALUE Invalid value 56 GPG_ERR_BAD_CERT_CHAIN Bad certificate chain 57 GPG_ERR_MISSING_CERT Missing certificate 58 GPG_ERR_NO_DATA No data 59 GPG_ERR_BUG Bug 60 GPG_ERR_NOT_SUPPORTED Not supported 61 GPG_ERR_INV_OP Invalid operation code 62 GPG_ERR_TIMEOUT Timeout 63 GPG_ERR_INTERNAL Internal error 64 GPG_ERR_EOF_GCRYPT EOF (gcrypt) 65 GPG_ERR_INV_OBJ Invalid object 66 GPG_ERR_TOO_SHORT Provided object is too short 67 GPG_ERR_TOO_LARGE Provided object is too large 68 GPG_ERR_NO_OBJ Missing item in object 69 GPG_ERR_NOT_IMPLEMENTED Not implemented 70 GPG_ERR_CONFLICT Conflicting use 71 GPG_ERR_INV_CIPHER_MODE Invalid cipher mode 72 GPG_ERR_INV_FLAG Invalid flag 73 GPG_ERR_INV_HANDLE Invalid handle 74 GPG_ERR_TRUNCATED Result truncated 75 GPG_ERR_INCOMPLETE_LINE Incomplete line 76 GPG_ERR_INV_RESPONSE Invalid response 77 GPG_ERR_NO_AGENT No agent running 78 GPG_ERR_AGENT Agent error 79 GPG_ERR_INV_DATA Invalid data 80 GPG_ERR_ASSUAN_SERVER_FAULT Unspecific Assuan server fault 81 GPG_ERR_ASSUAN General Assuan error 82 GPG_ERR_INV_SESSION_KEY Invalid session key 83 GPG_ERR_INV_SEXP Invalid S-expression 84 GPG_ERR_UNSUPPORTED_ALGORITHM Unsupported algorithm 85 GPG_ERR_NO_PIN_ENTRY No pinentry 86 GPG_ERR_PIN_ENTRY pinentry error 87 GPG_ERR_BAD_PIN Bad PIN 88 GPG_ERR_INV_NAME Invalid name 89 GPG_ERR_BAD_DATA Bad data 90 GPG_ERR_INV_PARAMETER Invalid parameter 91 GPG_ERR_WRONG_CARD Wrong card 92 GPG_ERR_NO_DIRMNGR No dirmngr 93 GPG_ERR_DIRMNGR dirmngr error 94 GPG_ERR_CERT_REVOKED Certificate revoked 95 GPG_ERR_NO_CRL_KNOWN No CRL known 96 GPG_ERR_CRL_TOO_OLD CRL too old 97 GPG_ERR_LINE_TOO_LONG Line too long 98 GPG_ERR_NOT_TRUSTED Not trusted 99 GPG_ERR_CANCELED Operation cancelled 100 GPG_ERR_BAD_CA_CERT Bad CA certificate 101 GPG_ERR_CERT_EXPIRED Certificate expired 102 GPG_ERR_CERT_TOO_YOUNG Certificate too young 103 GPG_ERR_UNSUPPORTED_CERT Unsupported certificate 104 GPG_ERR_UNKNOWN_SEXP Unknown S-expression 105 GPG_ERR_UNSUPPORTED_PROTECTION Unsupported protection 106 GPG_ERR_CORRUPTED_PROTECTION Corrupted protection 107 GPG_ERR_AMBIGUOUS_NAME Ambiguous name 108 GPG_ERR_CARD Card error 109 GPG_ERR_CARD_RESET Card reset required 110 GPG_ERR_CARD_REMOVED Card removed 111 GPG_ERR_INV_CARD Invalid card 112 GPG_ERR_CARD_NOT_PRESENT Card not present 113 GPG_ERR_NO_PKCS15_APP No PKCS15 application 114 GPG_ERR_NOT_CONFIRMED Not confirmed 115 GPG_ERR_CONFIGURATION Configuration error 116 GPG_ERR_NO_POLICY_MATCH No policy match 117 GPG_ERR_INV_INDEX Invalid index 118 GPG_ERR_INV_ID Invalid ID 119 GPG_ERR_NO_SCDAEMON No SmartCard daemon 120 GPG_ERR_SCDAEMON SmartCard daemon error 121 GPG_ERR_UNSUPPORTED_PROTOCOL Unsupported protocol 122 GPG_ERR_BAD_PIN_METHOD Bad PIN method 123 GPG_ERR_CARD_NOT_INITIALIZED Card not initialized 124 GPG_ERR_UNSUPPORTED_OPERATION Unsupported operation 125 GPG_ERR_WRONG_KEY_USAGE Wrong key usage 126 GPG_ERR_NOTHING_FOUND Nothing found 127 GPG_ERR_WRONG_BLOB_TYPE Wrong blob type 128 GPG_ERR_MISSING_VALUE Missing value 129 GPG_ERR_HARDWARE Hardware problem 130 GPG_ERR_PIN_BLOCKED PIN blocked 131 GPG_ERR_USE_CONDITIONS Conditions of use not satisfied 132 GPG_ERR_PIN_NOT_SYNCED PINs are not synced 133 GPG_ERR_INV_CRL Invalid CRL 134 GPG_ERR_BAD_BER BER error 135 GPG_ERR_INV_BER Invalid BER 136 GPG_ERR_ELEMENT_NOT_FOUND Element not found 137 GPG_ERR_IDENTIFIER_NOT_FOUND Identifier not found 138 GPG_ERR_INV_TAG Invalid tag 139 GPG_ERR_INV_LENGTH Invalid length 140 GPG_ERR_INV_KEYINFO Invalid key info 141 GPG_ERR_UNEXPECTED_TAG Unexpected tag 142 GPG_ERR_NOT_DER_ENCODED Not DER encoded 143 GPG_ERR_NO_CMS_OBJ No CMS object 144 GPG_ERR_INV_CMS_OBJ Invalid CMS object 145 GPG_ERR_UNKNOWN_CMS_OBJ Unknown CMS object 146 GPG_ERR_UNSUPPORTED_CMS_OBJ Unsupported CMS object 147 GPG_ERR_UNSUPPORTED_ENCODING Unsupported encoding 148 GPG_ERR_UNSUPPORTED_CMS_VERSION Unsupported CMS version 149 GPG_ERR_UNKNOWN_ALGORITHM Unknown algorithm 150 GPG_ERR_INV_ENGINE Invalid crypto engine 151 GPG_ERR_PUBKEY_NOT_TRUSTED Public key not trusted 152 GPG_ERR_DECRYPT_FAILED Decryption failed 153 GPG_ERR_KEY_EXPIRED Key expired 154 GPG_ERR_SIG_EXPIRED Signature expired 155 GPG_ERR_ENCODING_PROBLEM Encoding problem 156 GPG_ERR_INV_STATE Invalid state 157 GPG_ERR_DUP_VALUE Duplicated value 158 GPG_ERR_MISSING_ACTION Missing action 159 GPG_ERR_MODULE_NOT_FOUND ASN.1 module not found 160 GPG_ERR_INV_OID_STRING Invalid OID string 161 GPG_ERR_INV_TIME Invalid time 162 GPG_ERR_INV_CRL_OBJ Invalid CRL object 163 GPG_ERR_UNSUPPORTED_CRL_VERSION Unsupported CRL version 164 GPG_ERR_INV_CERT_OBJ Invalid certificate object 165 GPG_ERR_UNKNOWN_NAME Unknown name 166 GPG_ERR_LOCALE_PROBLEM A locale function failed 167 GPG_ERR_NOT_LOCKED Not locked 168 GPG_ERR_PROTOCOL_VIOLATION Protocol violation 169 GPG_ERR_INV_MAC Invalid MAC 170 GPG_ERR_INV_REQUEST Invalid request 171 GPG_ERR_UNKNOWN_EXTN Unknown extension 172 GPG_ERR_UNKNOWN_CRIT_EXTN Unknown critical extension 173 GPG_ERR_LOCKED Locked 174 GPG_ERR_UNKNOWN_OPTION Unknown option 175 GPG_ERR_UNKNOWN_COMMAND Unknown command 176 GPG_ERR_NOT_OPERATIONAL Not operational 177 GPG_ERR_NO_PASSPHRASE No passphrase given 178 GPG_ERR_NO_PIN No PIN given 179 GPG_ERR_NOT_ENABLED Not enabled 180 GPG_ERR_NO_ENGINE No crypto engine 181 GPG_ERR_MISSING_KEY Missing key 182 GPG_ERR_TOO_MANY Too many objects 183 GPG_ERR_LIMIT_REACHED Limit reached 184 GPG_ERR_NOT_INITIALIZED Not initialized 185 GPG_ERR_MISSING_ISSUER_CERT Missing issuer certificate 186 GPG_ERR_NO_KEYSERVER No keyserver available 187 GPG_ERR_INV_CURVE Invalid elliptic curve 188 GPG_ERR_UNKNOWN_CURVE Unknown elliptic curve 189 GPG_ERR_DUP_KEY Duplicated key 190 GPG_ERR_AMBIGUOUS Ambiguous result 191 GPG_ERR_NO_CRYPT_CTX No crypto context 192 GPG_ERR_WRONG_CRYPT_CTX Wrong crypto context 193 GPG_ERR_BAD_CRYPT_CTX Bad crypto context 194 GPG_ERR_CRYPT_CTX_CONFLICT Conflict in the crypto context 195 GPG_ERR_BROKEN_PUBKEY Broken public key 196 GPG_ERR_BROKEN_SECKEY Broken secret key 197 GPG_ERR_MAC_ALGO Invalid MAC algorithm 198 GPG_ERR_FULLY_CANCELED Operation fully cancelled 199 GPG_ERR_UNFINISHED Operation not yet finished 200 GPG_ERR_BUFFER_TOO_SHORT Buffer too short # Error codes pertaining to S-expressions. 201 GPG_ERR_SEXP_INV_LEN_SPEC Invalid length specifier in S-expression 202 GPG_ERR_SEXP_STRING_TOO_LONG String too long in S-expression 203 GPG_ERR_SEXP_UNMATCHED_PAREN Unmatched parentheses in S-expression 204 GPG_ERR_SEXP_NOT_CANONICAL S-expression not canonical 205 GPG_ERR_SEXP_BAD_CHARACTER Bad character in S-expression 206 GPG_ERR_SEXP_BAD_QUOTATION Bad quotation in S-expression 207 GPG_ERR_SEXP_ZERO_PREFIX Zero prefix in S-expression 208 GPG_ERR_SEXP_NESTED_DH Nested display hints in S-expression 209 GPG_ERR_SEXP_UNMATCHED_DH Unmatched display hints 210 GPG_ERR_SEXP_UNEXPECTED_PUNC Unexpected reserved punctuation in S-expression 211 GPG_ERR_SEXP_BAD_HEX_CHAR Bad hexadecimal character in S-expression 212 GPG_ERR_SEXP_ODD_HEX_NUMBERS Odd hexadecimal numbers in S-expression 213 GPG_ERR_SEXP_BAD_OCT_CHAR Bad octal character in S-expression # 214 to 216 are free to be used. 217 GPG_ERR_SUBKEYS_EXP_OR_REV All subkeys are expired or revoked 218 GPG_ERR_DB_CORRUPTED Database is corrupted 219 GPG_ERR_SERVER_FAILED Server indicated a failure 220 GPG_ERR_NO_NAME No name 221 GPG_ERR_NO_KEY No key 222 GPG_ERR_LEGACY_KEY Legacy key 223 GPG_ERR_REQUEST_TOO_SHORT Request too short 224 GPG_ERR_REQUEST_TOO_LONG Request too long 225 GPG_ERR_OBJ_TERM_STATE Object is in termination state 226 GPG_ERR_NO_CERT_CHAIN No certificate chain 227 GPG_ERR_CERT_TOO_LARGE Certificate is too large 228 GPG_ERR_INV_RECORD Invalid record 229 GPG_ERR_BAD_MAC The MAC does not verify 230 GPG_ERR_UNEXPECTED_MSG Unexpected message 231 GPG_ERR_COMPR_FAILED Compression or decompression failed 232 GPG_ERR_WOULD_WRAP A counter would wrap 233 GPG_ERR_FATAL_ALERT Fatal alert message received 234 GPG_ERR_NO_CIPHER No cipher algorithm 235 GPG_ERR_MISSING_CLIENT_CERT Missing client certificate 236 GPG_ERR_CLOSE_NOTIFY Close notification received 237 GPG_ERR_TICKET_EXPIRED Ticket expired 238 GPG_ERR_BAD_TICKET Bad ticket 239 GPG_ERR_UNKNOWN_IDENTITY Unknown identity 240 GPG_ERR_BAD_HS_CERT Bad certificate message in handshake 241 GPG_ERR_BAD_HS_CERT_REQ Bad certificate request message in handshake 242 GPG_ERR_BAD_HS_CERT_VER Bad certificate verify message in handshake 243 GPG_ERR_BAD_HS_CHANGE_CIPHER Bad change cipher message in handshake 244 GPG_ERR_BAD_HS_CLIENT_HELLO Bad client hello message in handshake 245 GPG_ERR_BAD_HS_SERVER_HELLO Bad server hello message in handshake 246 GPG_ERR_BAD_HS_SERVER_HELLO_DONE Bad server hello done message in handshake 247 GPG_ERR_BAD_HS_FINISHED Bad finished message in handshake 248 GPG_ERR_BAD_HS_SERVER_KEX Bad server key exchange message in handshake 249 GPG_ERR_BAD_HS_CLIENT_KEX Bad client key exchange message in handshake 250 GPG_ERR_BOGUS_STRING Bogus string 251 GPG_ERR_FORBIDDEN Forbidden 252 GPG_ERR_KEY_DISABLED Key disabled 253 GPG_ERR_KEY_ON_CARD Not possible with a card based key 254 GPG_ERR_INV_LOCK_OBJ Invalid lock object 255 GPG_ERR_TRUE True 256 GPG_ERR_FALSE False # Error codes pertaining to the Assuan IPC interface 257 GPG_ERR_ASS_GENERAL General IPC error 258 GPG_ERR_ASS_ACCEPT_FAILED IPC accept call failed 259 GPG_ERR_ASS_CONNECT_FAILED IPC connect call failed 260 GPG_ERR_ASS_INV_RESPONSE Invalid IPC response 261 GPG_ERR_ASS_INV_VALUE Invalid value passed to IPC 262 GPG_ERR_ASS_INCOMPLETE_LINE Incomplete line passed to IPC 263 GPG_ERR_ASS_LINE_TOO_LONG Line passed to IPC too long 264 GPG_ERR_ASS_NESTED_COMMANDS Nested IPC commands 265 GPG_ERR_ASS_NO_DATA_CB No data callback in IPC 266 GPG_ERR_ASS_NO_INQUIRE_CB No inquire callback in IPC 267 GPG_ERR_ASS_NOT_A_SERVER Not an IPC server 268 GPG_ERR_ASS_NOT_A_CLIENT Not an IPC client 269 GPG_ERR_ASS_SERVER_START Problem starting IPC server 270 GPG_ERR_ASS_READ_ERROR IPC read error 271 GPG_ERR_ASS_WRITE_ERROR IPC write error # reserved 273 GPG_ERR_ASS_TOO_MUCH_DATA Too much data for IPC layer 274 GPG_ERR_ASS_UNEXPECTED_CMD Unexpected IPC command 275 GPG_ERR_ASS_UNKNOWN_CMD Unknown IPC command 276 GPG_ERR_ASS_SYNTAX IPC syntax error 277 GPG_ERR_ASS_CANCELED IPC call has been cancelled 278 GPG_ERR_ASS_NO_INPUT No input source for IPC 279 GPG_ERR_ASS_NO_OUTPUT No output source for IPC 280 GPG_ERR_ASS_PARAMETER IPC parameter error 281 GPG_ERR_ASS_UNKNOWN_INQUIRE Unknown IPC inquire # 282 to 299 are reserved for future assuan codes. 300 GPG_ERR_ENGINE_TOO_OLD Crypto engine too old 301 GPG_ERR_WINDOW_TOO_SMALL Screen or window too small 302 GPG_ERR_WINDOW_TOO_LARGE Screen or window too large 303 GPG_ERR_MISSING_ENVVAR Required environment variable not set 304 GPG_ERR_USER_ID_EXISTS User ID already exists 305 GPG_ERR_NAME_EXISTS Name already exists 306 GPG_ERR_DUP_NAME Duplicated name 307 GPG_ERR_TOO_YOUNG Object is too young 308 GPG_ERR_TOO_OLD Object is too old 309 GPG_ERR_UNKNOWN_FLAG Unknown flag 310 GPG_ERR_INV_ORDER Invalid execution order 311 GPG_ERR_ALREADY_FETCHED Already fetched 312 GPG_ERR_TRY_LATER Try again later 313 GPG_ERR_WRONG_NAME Wrong name 314 GPG_ERR_NO_AUTH Not authenticated 315 GPG_ERR_BAD_AUTH Bad authentication 316 GPG_ERR_NO_KEYBOXD No Keybox daemon running 317 GPG_ERR_KEYBOXD Keybox daemon error 318 GPG_ERR_NO_SERVICE Service is not running 319 GPG_ERR_SERVICE Service error # This range is free for use. 666 GPG_ERR_SYSTEM_BUG System bug detected # # Mapping of some error codes from libdns and other DNS specific error codes # 711 GPG_ERR_DNS_UNKNOWN Unknown DNS error 712 GPG_ERR_DNS_SECTION Invalid DNS section 713 GPG_ERR_DNS_ADDRESS Invalid textual address form 714 GPG_ERR_DNS_NO_QUERY Missing DNS query packet 715 GPG_ERR_DNS_NO_ANSWER Missing DNS answer packet 716 GPG_ERR_DNS_CLOSED Connection closed in DNS 717 GPG_ERR_DNS_VERIFY Verification failed in DNS 718 GPG_ERR_DNS_TIMEOUT DNS Timeout # # Mapping of LDAP error codes # # The numbers reflect the OpenLDAP code with an offset of 768. # Some error names are shortened # 721 GPG_ERR_LDAP_GENERAL General LDAP error 722 GPG_ERR_LDAP_ATTR_GENERAL General LDAP attribute error 723 GPG_ERR_LDAP_NAME_GENERAL General LDAP name error 724 GPG_ERR_LDAP_SECURITY_GENERAL General LDAP security error 725 GPG_ERR_LDAP_SERVICE_GENERAL General LDAP service error 726 GPG_ERR_LDAP_UPDATE_GENERAL General LDAP update error 727 GPG_ERR_LDAP_E_GENERAL Experimental LDAP error code 728 GPG_ERR_LDAP_X_GENERAL Private LDAP error code 729 GPG_ERR_LDAP_OTHER_GENERAL Other general LDAP error # 730 to 749 not used 750 GPG_ERR_LDAP_X_CONNECTING LDAP connecting failed (X) 751 GPG_ERR_LDAP_REFERRAL_LIMIT LDAP referral limit exceeded 752 GPG_ERR_LDAP_CLIENT_LOOP LDAP client loop # 753 is an obsolete error code 754 GPG_ERR_LDAP_NO_RESULTS No LDAP results returned 755 GPG_ERR_LDAP_CONTROL_NOT_FOUND LDAP control not found 756 GPG_ERR_LDAP_NOT_SUPPORTED Not supported by LDAP 757 GPG_ERR_LDAP_CONNECT LDAP connect error 758 GPG_ERR_LDAP_NO_MEMORY Out of memory in LDAP 759 GPG_ERR_LDAP_PARAM Bad parameter to an LDAP routine 760 GPG_ERR_LDAP_USER_CANCELLED User cancelled LDAP operation 761 GPG_ERR_LDAP_FILTER Bad LDAP search filter 762 GPG_ERR_LDAP_AUTH_UNKNOWN Unknown LDAP authentication method 763 GPG_ERR_LDAP_TIMEOUT Timeout in LDAP 764 GPG_ERR_LDAP_DECODING LDAP decoding error 765 GPG_ERR_LDAP_ENCODING LDAP encoding error 766 GPG_ERR_LDAP_LOCAL LDAP local error 767 GPG_ERR_LDAP_SERVER_DOWN Cannot contact LDAP server 768 GPG_ERR_LDAP_SUCCESS LDAP success 769 GPG_ERR_LDAP_OPERATIONS LDAP operations error 770 GPG_ERR_LDAP_PROTOCOL LDAP protocol error 771 GPG_ERR_LDAP_TIMELIMIT Time limit exceeded in LDAP 772 GPG_ERR_LDAP_SIZELIMIT Size limit exceeded in LDAP 773 GPG_ERR_LDAP_COMPARE_FALSE LDAP compare false 774 GPG_ERR_LDAP_COMPARE_TRUE LDAP compare true 775 GPG_ERR_LDAP_UNSUPPORTED_AUTH LDAP authentication method not supported 776 GPG_ERR_LDAP_STRONG_AUTH_RQRD Strong(er) LDAP authentication required 777 GPG_ERR_LDAP_PARTIAL_RESULTS Partial LDAP results+referral received 778 GPG_ERR_LDAP_REFERRAL LDAP referral 779 GPG_ERR_LDAP_ADMINLIMIT Administrative LDAP limit exceeded 780 GPG_ERR_LDAP_UNAVAIL_CRIT_EXTN Critical LDAP extension is unavailable 781 GPG_ERR_LDAP_CONFIDENT_RQRD Confidentiality required by LDAP 782 GPG_ERR_LDAP_SASL_BIND_INPROG LDAP SASL bind in progress # 783 not used 784 GPG_ERR_LDAP_NO_SUCH_ATTRIBUTE No such LDAP attribute 785 GPG_ERR_LDAP_UNDEFINED_TYPE Undefined LDAP attribute type 786 GPG_ERR_LDAP_BAD_MATCHING Inappropriate matching in LDAP 787 GPG_ERR_LDAP_CONST_VIOLATION Constraint violation in LDAP 788 GPG_ERR_LDAP_TYPE_VALUE_EXISTS LDAP type or value exists 789 GPG_ERR_LDAP_INV_SYNTAX Invalid syntax in LDAP # 790 to 799 not used 800 GPG_ERR_LDAP_NO_SUCH_OBJ No such LDAP object 801 GPG_ERR_LDAP_ALIAS_PROBLEM LDAP alias problem 802 GPG_ERR_LDAP_INV_DN_SYNTAX Invalid DN syntax in LDAP 803 GPG_ERR_LDAP_IS_LEAF LDAP entry is a leaf 804 GPG_ERR_LDAP_ALIAS_DEREF LDAP alias dereferencing problem # 805 to 814 not used 815 GPG_ERR_LDAP_X_PROXY_AUTH_FAIL LDAP proxy authorization failure (X) 816 GPG_ERR_LDAP_BAD_AUTH Inappropriate LDAP authentication 817 GPG_ERR_LDAP_INV_CREDENTIALS Invalid LDAP credentials 818 GPG_ERR_LDAP_INSUFFICIENT_ACC Insufficient access for LDAP 819 GPG_ERR_LDAP_BUSY LDAP server is busy 820 GPG_ERR_LDAP_UNAVAILABLE LDAP server is unavailable 821 GPG_ERR_LDAP_UNWILL_TO_PERFORM LDAP server is unwilling to perform 822 GPG_ERR_LDAP_LOOP_DETECT Loop detected by LDAP # 823 to 831 not used 832 GPG_ERR_LDAP_NAMING_VIOLATION LDAP naming violation 833 GPG_ERR_LDAP_OBJ_CLS_VIOLATION LDAP object class violation 834 GPG_ERR_LDAP_NOT_ALLOW_NONLEAF LDAP operation not allowed on non-leaf 835 GPG_ERR_LDAP_NOT_ALLOW_ON_RDN LDAP operation not allowed on RDN 836 GPG_ERR_LDAP_ALREADY_EXISTS Already exists (LDAP) 837 GPG_ERR_LDAP_NO_OBJ_CLASS_MODS Cannot modify LDAP object class 838 GPG_ERR_LDAP_RESULTS_TOO_LARGE LDAP results too large 839 GPG_ERR_LDAP_AFFECTS_MULT_DSAS LDAP operation affects multiple DSAs # 840 to 843 not used 844 GPG_ERR_LDAP_VLV Virtual LDAP list view error # 845 to 847 not used 848 GPG_ERR_LDAP_OTHER Other LDAP error # 849 to 880 not used 881 GPG_ERR_LDAP_CUP_RESOURCE_LIMIT Resources exhausted in LCUP 882 GPG_ERR_LDAP_CUP_SEC_VIOLATION Security violation in LCUP 883 GPG_ERR_LDAP_CUP_INV_DATA Invalid data in LCUP 884 GPG_ERR_LDAP_CUP_UNSUP_SCHEME Unsupported scheme in LCUP 885 GPG_ERR_LDAP_CUP_RELOAD Reload required in LCUP 886 GPG_ERR_LDAP_CANCELLED LDAP cancelled 887 GPG_ERR_LDAP_NO_SUCH_OPERATION No LDAP operation to cancel 888 GPG_ERR_LDAP_TOO_LATE Too late to cancel LDAP 889 GPG_ERR_LDAP_CANNOT_CANCEL Cannot cancel LDAP 890 GPG_ERR_LDAP_ASSERTION_FAILED LDAP assertion failed 891 GPG_ERR_LDAP_PROX_AUTH_DENIED Proxied authorization denied by LDAP # 892 to 950 are reserved for future LDAP codes. # 951 to 1023 are free to be used. # For free use by non-GnuPG components: 1024 GPG_ERR_USER_1 User defined error code 1 1025 GPG_ERR_USER_2 User defined error code 2 1026 GPG_ERR_USER_3 User defined error code 3 1027 GPG_ERR_USER_4 User defined error code 4 1028 GPG_ERR_USER_5 User defined error code 5 1029 GPG_ERR_USER_6 User defined error code 6 1030 GPG_ERR_USER_7 User defined error code 7 1031 GPG_ERR_USER_8 User defined error code 8 1032 GPG_ERR_USER_9 User defined error code 9 1033 GPG_ERR_USER_10 User defined error code 10 1034 GPG_ERR_USER_11 User defined error code 11 1035 GPG_ERR_USER_12 User defined error code 12 1036 GPG_ERR_USER_13 User defined error code 13 1037 GPG_ERR_USER_14 User defined error code 14 1038 GPG_ERR_USER_15 User defined error code 15 1039 GPG_ERR_USER_16 User defined error code 16 -# 1040 to 16380 are free to be used. +# 1040 to 1499 are free to be used. + +# 1500 to 1755 are mapped SQLite primary error codes. +1500 GPG_ERR_SQL_OK SQL success +1501 GPG_ERR_SQL_ERROR SQL error +1502 GPG_ERR_SQL_INTERNAL Internal logic error in SQL library +1503 GPG_ERR_SQL_PERM Access permission denied (SQL) +1504 GPG_ERR_SQL_ABORT SQL abort was requested +1505 GPG_ERR_SQL_BUSY SQL database file is locked +1506 GPG_ERR_SQL_LOCKED An SQL table in the database is locked +1507 GPG_ERR_SQL_NOMEM SQL library ran out of core +1508 GPG_ERR_SQL_READONLY Attempt to write a readonly SQL database +1509 GPG_ERR_SQL_INTERRUPT SQL operation terminated by interrupt +1510 GPG_ERR_SQL_IOERR I/O error during SQL operation +1511 GPG_ERR_SQL_CORRUPT SQL database disk image is malformed +1512 GPG_ERR_SQL_NOTFOUND Unknown opcode in SQL file control +1513 GPG_ERR_SQL_FULL Insertion failed because SQL database is full +1514 GPG_ERR_SQL_CANTOPEN Unable to open the SQL database file +1515 GPG_ERR_SQL_PROTOCOL SQL database lock protocol error +1516 GPG_ERR_SQL_EMPTY (internal SQL code: empty) +1517 GPG_ERR_SQL_SCHEMA SQL database schema changed +1518 GPG_ERR_SQL_TOOBIG String or blob exceeds size limit (SQL) +1519 GPG_ERR_SQL_CONSTRAINT SQL abort due to constraint violation +1520 GPG_ERR_SQL_MISMATCH Data type mismatch (SQL) +1521 GPG_ERR_SQL_MISUSE SQL library used incorrectly +1522 GPG_ERR_SQL_NOLFS SQL library uses unsupported OS features +1523 GPG_ERR_SQL_AUTH Authorization denied (SQL) +1524 GPG_ERR_SQL_FORMAT (unused SQL code: format) +1525 GPG_ERR_SQL_RANGE SQL bind parameter out of range +1526 GPG_ERR_SQL_NOTADB File opened that is not an SQL database file +1527 GPG_ERR_SQL_NOTICE Notifications from SQL logger +1528 GPG_ERR_SQL_WARNING Warnings from SQL logger + +# 1529 to 1599 are reserved for newer SQLite primary error codes. + +1600 GPG_ERR_SQL_ROW SQL has another row ready +1601 GPG_ERR_SQL_DONE SQL has finished executing + +# 1602 to 1755 are reserved for newer SQLite primary error codes. + +# 1756 to 16380 are free to be used. 16381 GPG_ERR_MISSING_ERRNO System error w/o errno 16382 GPG_ERR_UNKNOWN_ERRNO Unknown system error 16383 GPG_ERR_EOF End of file # 16384 - 32767 are reserved for future extensions. # GPG_SYSTEM_ERROR | (141 to 32767) are to be used for system errors. GPG_ERR_CODE_DIM Unknown error code diff --git a/src/gpg-error.h.in b/src/gpg-error.h.in index 1b9be09..d118e90 100644 --- a/src/gpg-error.h.in +++ b/src/gpg-error.h.in @@ -1,1311 +1,1318 @@ /* gpg-error.h or gpgrt.h - Common code for GnuPG and others. -*- c -*- * Copyright (C) 2001-2019 g10 Code GmbH * * This file is part of libgpg-error (aka libgpgrt). * * libgpg-error is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * libgpg-error is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, see . * SPDX-License-Identifier: LGPL-2.1+ * * @configure_input@ */ /* The GnuPG project consists of many components. Error codes are * exchanged between all components. The common error codes and their * user-presentable descriptions are kept into a shared library to * allow adding new error codes and components without recompiling any * of the other components. In addition to error codes this library * also features several other groups of functions which are common to * all GnuPG components. They may be used by independet project as * well. The interfaces will not change in a backward incompatible way. * * An error code together with an error source build up an error * value. As the error value is been passed from one component to * another, it preserves the information about the source and nature * of the error. * * A component of the GnuPG project can define the following macros to * tune the behaviour of the library: * * GPG_ERR_SOURCE_DEFAULT: Define to an error source of type * gpg_err_source_t to make that source the default for gpg_error(). * Otherwise GPG_ERR_SOURCE_UNKNOWN is used as default. * * GPG_ERR_ENABLE_GETTEXT_MACROS: Define to provide macros to map the * internal gettext API to standard names. This has only an effect on * Windows platforms. * * GPGRT_ENABLE_ES_MACROS: Define to provide "es_" macros for the * estream functions. * * GPGRT_ENABLE_LOG_MACROS: Define to provide short versions of the * log functions. * * GPGRT_ENABLE_ARGPARSE_MACROS: Needs to be defined to provide the * mandatory macros of the argparse interface. */ #ifndef GPG_ERROR_H #define GPG_ERROR_H 1 #ifndef GPGRT_H #define GPGRT_H 1 #include #include #include /* The version string of this header. */ #define GPG_ERROR_VERSION @version@ #define GPGRT_VERSION @version@ /* The version number of this header. */ #define GPG_ERROR_VERSION_NUMBER @version-number@ #define GPGRT_VERSION_NUMBER @version-number@ #ifdef __GNUC__ # define GPG_ERR_INLINE __inline__ #elif defined(_MSC_VER) && _MSC_VER >= 1300 # define GPG_ERR_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L # define GPG_ERR_INLINE inline #else # ifndef GPG_ERR_INLINE # define GPG_ERR_INLINE # endif #endif #ifdef __cplusplus extern "C" { #if 0 /* just to make Emacs auto-indent happy */ } #endif #endif /* __cplusplus */ /* The error source type gpg_err_source_t. * * Where as the Poo out of a welle small * Taketh his firste springing and his sours. * --Chaucer. */ /* Only use free slots, never change or reorder the existing * entries. */ typedef enum { @include:err-sources@ /* This is one more than the largest allowed entry. */ GPG_ERR_SOURCE_DIM = 128 } gpg_err_source_t; /* The error code type gpg_err_code_t. */ /* Only use free slots, never change or reorder the existing * entries. */ typedef enum { @include:err-codes@ /* The following error codes are used to map system errors. */ #define GPG_ERR_SYSTEM_ERROR (1 << 15) @include:errnos@ /* This is one more than the largest allowed entry. */ GPG_ERR_CODE_DIM = 65536 } gpg_err_code_t; /* The error value type gpg_error_t. */ /* We would really like to use bit-fields in a struct, but using * structs as return values can cause binary compatibility issues, in * particular if you want to do it efficiently (also see * -freg-struct-return option to GCC). */ typedef unsigned int gpg_error_t; /* We use the lowest 16 bits of gpg_error_t for error codes. The 16th * bit indicates system errors. */ #define GPG_ERR_CODE_MASK (GPG_ERR_CODE_DIM - 1) /* Bits 17 to 24 are reserved. */ /* We use the upper 7 bits of gpg_error_t for error sources. */ #define GPG_ERR_SOURCE_MASK (GPG_ERR_SOURCE_DIM - 1) #define GPG_ERR_SOURCE_SHIFT 24 /* The highest bit is reserved. It shouldn't be used to prevent * potential negative numbers when transmitting error values as * text. */ /* * GCC feature test. */ #if __GNUC__ # define _GPG_ERR_GCC_VERSION (__GNUC__ * 10000 \ + __GNUC_MINOR__ * 100 \ + __GNUC_PATCHLEVEL__) #else # define _GPG_ERR_GCC_VERSION 0 #endif #undef _GPG_ERR_HAVE_CONSTRUCTOR #if _GPG_ERR_GCC_VERSION > 30100 # define _GPG_ERR_CONSTRUCTOR __attribute__ ((__constructor__)) # define _GPG_ERR_HAVE_CONSTRUCTOR #else # define _GPG_ERR_CONSTRUCTOR #endif #define GPGRT_GCC_VERSION _GPG_ERR_GCC_VERSION #if _GPG_ERR_GCC_VERSION >= 29200 # define _GPGRT__RESTRICT __restrict__ #else # define _GPGRT__RESTRICT #endif /* The noreturn attribute. */ #if _GPG_ERR_GCC_VERSION >= 20500 # define GPGRT_ATTR_NORETURN __attribute__ ((__noreturn__)) #else # define GPGRT_ATTR_NORETURN #endif /* The printf attributes. */ #if _GPG_ERR_GCC_VERSION >= 40400 # define GPGRT_ATTR_PRINTF(f, a) \ __attribute__ ((format(__gnu_printf__,f,a))) # define GPGRT_ATTR_NR_PRINTF(f, a) \ __attribute__ ((__noreturn__, format(__gnu_printf__,f,a))) #elif _GPG_ERR_GCC_VERSION >= 20500 # define GPGRT_ATTR_PRINTF(f, a) \ __attribute__ ((format(printf,f,a))) # define GPGRT_ATTR_NR_PRINTF(f, a) \ __attribute__ ((__noreturn__, format(printf,f,a))) #else # define GPGRT_ATTR_PRINTF(f, a) # define GPGRT_ATTR_NR_PRINTF(f, a) #endif #if _GPG_ERR_GCC_VERSION >= 20800 # define GPGRT_ATTR_FORMAT_ARG(a) __attribute__ ((__format_arg__ (a))) #else # define GPGRT_ATTR_FORMAT_ARG(a) #endif /* The sentinel attribute. */ #if _GPG_ERR_GCC_VERSION >= 40000 # define GPGRT_ATTR_SENTINEL(a) __attribute__ ((sentinel(a))) #else # define GPGRT_ATTR_SENTINEL(a) #endif /* The used and unused attributes. * I am not sure since when the unused attribute is really supported. * In any case it it only needed for gcc versions which print a * warning. Thus let us require gcc >= 3.5. */ #if _GPG_ERR_GCC_VERSION >= 40000 # define GPGRT_ATTR_USED __attribute__ ((used)) #else # define GPGRT_ATTR_USED #endif #if _GPG_ERR_GCC_VERSION >= 30500 # define GPGRT_ATTR_UNUSED __attribute__ ((unused)) #else # define GPGRT_ATTR_UNUSED #endif /* The deprecated attribute. */ #if _GPG_ERR_GCC_VERSION >= 30100 # define GPGRT_ATTR_DEPRECATED __attribute__ ((__deprecated__)) #else # define GPGRT_ATTR_DEPRECATED #endif /* The pure attribute. */ #if _GPG_ERR_GCC_VERSION >= 29600 # define GPGRT_ATTR_PURE __attribute__ ((__pure__)) #else # define GPGRT_ATTR_PURE #endif /* The malloc attribute. */ #if _GPG_ERR_GCC_VERSION >= 30200 # define GPGRT_ATTR_MALLOC __attribute__ ((__malloc__)) #else # define GPGRT_ATTR_MALLOC #endif /* A macro defined if a GCC style __FUNCTION__ macro is available. */ #undef GPGRT_HAVE_MACRO_FUNCTION #if _GPG_ERR_GCC_VERSION >= 20500 # define GPGRT_HAVE_MACRO_FUNCTION 1 #endif /* A macro defined if the pragma GCC push_options is available. */ #undef GPGRT_HAVE_PRAGMA_GCC_PUSH #if _GPG_ERR_GCC_VERSION >= 40400 # define GPGRT_HAVE_PRAGMA_GCC_PUSH 1 #endif /* Detect LeakSanitizer (LSan) support for GCC and Clang based on * whether AddressSanitizer (ASAN) is enabled via -fsanitize=address). * Note that -fsanitize=leak just affect the linker options which * cannot be detected here. In that case you have to define the * GPGRT_HAVE_LEAK_SANITIZER macro manually. */ #ifdef __GNUC__ # ifdef __SANITIZE_ADDRESS__ # define GPGRT_HAVE_LEAK_SANITIZER # elif defined(__has_feature) # if __has_feature(address_sanitizer) # define GPGRT_HAVE_LEAK_SANITIZER # endif # endif #endif /* The new name for the inline macro. */ #define GPGRT_INLINE GPG_ERR_INLINE #ifdef GPGRT_HAVE_LEAK_SANITIZER # include #endif /* Mark heap objects as non-leaked memory. */ static GPGRT_INLINE void gpgrt_annotate_leaked_object (const void *p) { #ifdef GPGRT_HAVE_LEAK_SANITIZER __lsan_ignore_object(p); #else (void)p; #endif } /* * Initialization function. */ /* Initialize the library. This function should be run early. */ gpg_error_t gpg_err_init (void) _GPG_ERR_CONSTRUCTOR; /* If this is defined, the library is already initialized by the constructor and does not need to be initialized explicitely. */ #undef GPG_ERR_INITIALIZED #ifdef _GPG_ERR_HAVE_CONSTRUCTOR # define GPG_ERR_INITIALIZED 1 # define gpgrt_init() do { gpg_err_init (); } while (0) #else # define gpgrt_init() do { ; } while (0) #endif /* See the source on how to use the deinit function; it is usually not required. */ void gpg_err_deinit (int mode); /* Register blocking system I/O clamping functions. */ void gpgrt_set_syscall_clamp (void (*pre)(void), void (*post)(void)); /* Get current I/O clamping functions. */ void gpgrt_get_syscall_clamp (void (**r_pre)(void), void (**r_post)(void)); /* Register a custom malloc/realloc/free function. */ void gpgrt_set_alloc_func (void *(*f)(void *a, size_t n)); /* Register an emergency cleanup handler. */ void gpgrt_add_emergency_cleanup (void (*f)(void)); /* Wrapper around abort to make sure emergency cleanups are run. */ void gpgrt_abort (void) GPGRT_ATTR_NORETURN; /* * Constructor and accessor functions. */ /* Construct an error value from an error code and source. Within a * subsystem, use gpg_error. */ static GPG_ERR_INLINE gpg_error_t gpg_err_make (gpg_err_source_t source, gpg_err_code_t code) { return code == GPG_ERR_NO_ERROR ? GPG_ERR_NO_ERROR : (((source & GPG_ERR_SOURCE_MASK) << GPG_ERR_SOURCE_SHIFT) | (code & GPG_ERR_CODE_MASK)); } /* The user should define GPG_ERR_SOURCE_DEFAULT before including this * file to specify a default source for gpg_error. */ #ifndef GPG_ERR_SOURCE_DEFAULT #define GPG_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_UNKNOWN #endif static GPG_ERR_INLINE gpg_error_t gpg_error (gpg_err_code_t code) { return gpg_err_make (GPG_ERR_SOURCE_DEFAULT, code); } /* Retrieve the error code from an error value. */ static GPG_ERR_INLINE gpg_err_code_t gpg_err_code (gpg_error_t err) { return (gpg_err_code_t) (err & GPG_ERR_CODE_MASK); } /* Retrieve the error source from an error value. */ static GPG_ERR_INLINE gpg_err_source_t gpg_err_source (gpg_error_t err) { return (gpg_err_source_t) ((err >> GPG_ERR_SOURCE_SHIFT) & GPG_ERR_SOURCE_MASK); } /* String functions. */ /* Return a pointer to a string containing a description of the error * code in the error value ERR. This function is not thread-safe. */ const char *gpg_strerror (gpg_error_t err); /* Return the error string for ERR in the user-supplied buffer BUF of * size BUFLEN. This function is, in contrast to gpg_strerror, * thread-safe if a thread-safe strerror_r() function is provided by * the system. If the function succeeds, 0 is returned and BUF * contains the string describing the error. If the buffer was not * large enough, ERANGE is returned and BUF contains as much of the * beginning of the error string as fits into the buffer. */ int gpg_strerror_r (gpg_error_t err, char *buf, size_t buflen); /* Return a pointer to a string containing a description of the error * source in the error value ERR. */ const char *gpg_strsource (gpg_error_t err); /* * Mapping of system errors (errno). */ /* Retrieve the error code for the system error ERR. This returns * GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report * this). */ gpg_err_code_t gpg_err_code_from_errno (int err); /* Retrieve the system error for the error code CODE. This returns 0 * if CODE is not a system error code. */ int gpg_err_code_to_errno (gpg_err_code_t code); /* Retrieve the error code directly from the ERRNO variable. This * returns GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped * (report this) and GPG_ERR_MISSING_ERRNO if ERRNO has the value 0. */ gpg_err_code_t gpg_err_code_from_syserror (void); +/* Mapper for SQLite primary error codes. */ +static GPG_ERR_INLINE gpg_error_t +gpg_err_code_from_sqlite (int sqlres) +{ + return sqlres? GPG_ERR_SQL_OK + (sqlres & 0xff) : 0; +} + /* Set the ERRNO variable. This function is the preferred way to set * ERRNO due to peculiarities on WindowsCE. */ void gpg_err_set_errno (int err); /* Return or check the version. Both functions are identical. */ const char *gpgrt_check_version (const char *req_version); const char *gpg_error_check_version (const char *req_version); /* System specific type definitions. */ @define:pid_t@ @define:gpgrt_ssize_t@ @define:gpgrt_off_t@ @include:os-add@ /* Self-documenting convenience functions. */ static GPG_ERR_INLINE gpg_error_t gpg_err_make_from_errno (gpg_err_source_t source, int err) { return gpg_err_make (source, gpg_err_code_from_errno (err)); } static GPG_ERR_INLINE gpg_error_t gpg_error_from_errno (int err) { return gpg_error (gpg_err_code_from_errno (err)); } static GPG_ERR_INLINE gpg_error_t gpg_error_from_syserror (void) { return gpg_error (gpg_err_code_from_syserror ()); } /* * Malloc and friends */ void *gpgrt_realloc (void *a, size_t n); void *gpgrt_malloc (size_t n); void *gpgrt_calloc (size_t n, size_t m); char *gpgrt_strdup (const char *string); char *gpgrt_strconcat (const char *s1, ...) GPGRT_ATTR_SENTINEL(0); void gpgrt_free (void *a); /* * System specific function wrappers. */ /* A getenv replacement which mallocs the returned string. */ char *gpgrt_getenv (const char *name); /* A setenv and a unsetenv replacement.*/ gpg_err_code_t gpgrt_setenv (const char *name, const char *value, int overwrite); #define gpgrt_unsetenv(n) gpgrt_setenv ((n), NULL, 1) /* A wrapper around mkdir using a string for the mode. */ gpg_err_code_t gpgrt_mkdir (const char *name, const char *modestr); /* A simple wrapper around chdir. */ gpg_err_code_t gpgrt_chdir (const char *name); /* Return the current WD as a malloced string. */ char *gpgrt_getcwd (void); /* * Lock functions. */ @include:lock-obj@ #define GPGRT_LOCK_DEFINE(name) \ static gpgrt_lock_t name = GPGRT_LOCK_INITIALIZER /* NB: If GPGRT_LOCK_DEFINE is not used, zero out the lock variable before passing it to gpgrt_lock_init. */ gpg_err_code_t gpgrt_lock_init (gpgrt_lock_t *lockhd); gpg_err_code_t gpgrt_lock_lock (gpgrt_lock_t *lockhd); gpg_err_code_t gpgrt_lock_trylock (gpgrt_lock_t *lockhd); gpg_err_code_t gpgrt_lock_unlock (gpgrt_lock_t *lockhd); gpg_err_code_t gpgrt_lock_destroy (gpgrt_lock_t *lockhd); /* * Thread functions. */ gpg_err_code_t gpgrt_yield (void); /* * Estream */ /* The definition of this struct is entirely private. You must not use it for anything. It is only here so some functions can be implemented as macros. */ struct _gpgrt_stream_internal; struct _gpgrt__stream { /* The layout of this struct must never change. It may be grown, but only if all functions which access the new members are versioned. */ /* Various flags. */ struct { unsigned int magic: 16; unsigned int writing: 1; unsigned int reserved: 15; } flags; /* A pointer to the stream buffer. */ unsigned char *buffer; /* The size of the buffer in bytes. */ size_t buffer_size; /* The length of the usable data in the buffer, only valid when in read mode (see flags). */ size_t data_len; /* The current position of the offset pointer, valid in read and write mode. */ size_t data_offset; size_t data_flushed; unsigned char *unread_buffer; size_t unread_buffer_size; /* The number of unread bytes. */ size_t unread_data_len; /* A pointer to our internal data for this stream. */ struct _gpgrt_stream_internal *intern; }; /* The opaque type for an estream. */ typedef struct _gpgrt__stream *gpgrt_stream_t; #ifdef GPGRT_ENABLE_ES_MACROS typedef struct _gpgrt__stream *estream_t; #endif typedef @api_ssize_t@ (*gpgrt_cookie_read_function_t) (void *cookie, void *buffer, size_t size); typedef @api_ssize_t@ (*gpgrt_cookie_write_function_t) (void *cookie, const void *buffer, size_t size); typedef int (*gpgrt_cookie_seek_function_t) (void *cookie, gpgrt_off_t *pos, int whence); typedef int (*gpgrt_cookie_close_function_t) (void *cookie); struct _gpgrt_cookie_io_functions { gpgrt_cookie_read_function_t func_read; gpgrt_cookie_write_function_t func_write; gpgrt_cookie_seek_function_t func_seek; gpgrt_cookie_close_function_t func_close; }; typedef struct _gpgrt_cookie_io_functions gpgrt_cookie_io_functions_t; #ifdef GPGRT_ENABLE_ES_MACROS typedef struct _gpgrt_cookie_io_functions es_cookie_io_functions_t; #define es_cookie_read_function_t gpgrt_cookie_read_function_t #define es_cookie_write_function_t gpgrt_cookie_read_function_t #define es_cookie_seek_function_t gpgrt_cookie_read_function_t #define es_cookie_close_function_t gpgrt_cookie_read_function_t #endif enum gpgrt_syshd_types { GPGRT_SYSHD_NONE = 0, /* No system handle available. */ GPGRT_SYSHD_FD = 1, /* A file descriptor as returned by open(). */ GPGRT_SYSHD_SOCK = 2, /* A socket as returned by socket(). */ GPGRT_SYSHD_RVID = 3, /* A rendezvous id (see libassuan's gpgcedev.c). */ GPGRT_SYSHD_HANDLE = 4 /* A HANDLE object (Windows). */ }; struct _gpgrt_syshd { enum gpgrt_syshd_types type; union { int fd; int sock; int rvid; void *handle; } u; }; typedef struct _gpgrt_syshd gpgrt_syshd_t; #ifdef GPGRT_ENABLE_ES_MACROS typedef struct _gpgrt_syshd es_syshd_t; #define ES_SYSHD_NONE GPGRT_SYSHD_NONE #define ES_SYSHD_FD GPGRT_SYSHD_FD #define ES_SYSHD_SOCK GPGRT_SYSHD_SOCK #define ES_SYSHD_RVID GPGRT_SYSHD_RVID #define ES_SYSHD_HANDLE GPGRT_SYSHD_HANDLE #endif /* The object used with gpgrt_poll. */ struct _gpgrt_poll_s { gpgrt_stream_t stream; unsigned int want_read:1; unsigned int want_write:1; unsigned int want_oob:1; unsigned int want_rdhup:1; unsigned int _reserv1:4; unsigned int got_read:1; unsigned int got_write:1; unsigned int got_oob:1; unsigned int got_rdhup:1; unsigned int _reserv2:4; unsigned int got_err:1; unsigned int got_hup:1; unsigned int got_nval:1; unsigned int _reserv3:4; unsigned int ignore:1; unsigned int user:8; /* For application use. */ }; typedef struct _gpgrt_poll_s gpgrt_poll_t; #ifdef GPGRT_ENABLE_ES_MACROS typedef struct _gpgrt_poll_s es_poll_t; #endif /* The type of the string filter function as used by fprintf_sf et al. */ typedef char *(*gpgrt_string_filter_t) (const char *s, int n, void *opaque); gpgrt_stream_t gpgrt_fopen (const char *_GPGRT__RESTRICT path, const char *_GPGRT__RESTRICT mode); gpgrt_stream_t gpgrt_mopen (void *_GPGRT__RESTRICT data, size_t data_n, size_t data_len, unsigned int grow, void *(*func_realloc) (void *mem, size_t size), void (*func_free) (void *mem), const char *_GPGRT__RESTRICT mode); gpgrt_stream_t gpgrt_fopenmem (size_t memlimit, const char *_GPGRT__RESTRICT mode); gpgrt_stream_t gpgrt_fopenmem_init (size_t memlimit, const char *_GPGRT__RESTRICT mode, const void *data, size_t datalen); gpgrt_stream_t gpgrt_fdopen (int filedes, const char *mode); gpgrt_stream_t gpgrt_fdopen_nc (int filedes, const char *mode); gpgrt_stream_t gpgrt_sysopen (gpgrt_syshd_t *syshd, const char *mode); gpgrt_stream_t gpgrt_sysopen_nc (gpgrt_syshd_t *syshd, const char *mode); gpgrt_stream_t gpgrt_fpopen (FILE *fp, const char *mode); gpgrt_stream_t gpgrt_fpopen_nc (FILE *fp, const char *mode); gpgrt_stream_t gpgrt_freopen (const char *_GPGRT__RESTRICT path, const char *_GPGRT__RESTRICT mode, gpgrt_stream_t _GPGRT__RESTRICT stream); gpgrt_stream_t gpgrt_fopencookie (void *_GPGRT__RESTRICT cookie, const char *_GPGRT__RESTRICT mode, gpgrt_cookie_io_functions_t functions); int gpgrt_fclose (gpgrt_stream_t stream); int gpgrt_fclose_snatch (gpgrt_stream_t stream, void **r_buffer, size_t *r_buflen); int gpgrt_onclose (gpgrt_stream_t stream, int mode, void (*fnc) (gpgrt_stream_t, void*), void *fnc_value); int gpgrt_fileno (gpgrt_stream_t stream); int gpgrt_fileno_unlocked (gpgrt_stream_t stream); int gpgrt_syshd (gpgrt_stream_t stream, gpgrt_syshd_t *syshd); int gpgrt_syshd_unlocked (gpgrt_stream_t stream, gpgrt_syshd_t *syshd); void _gpgrt_set_std_fd (int no, int fd); gpgrt_stream_t _gpgrt_get_std_stream (int fd); #define gpgrt_stdin _gpgrt_get_std_stream (0) #define gpgrt_stdout _gpgrt_get_std_stream (1) #define gpgrt_stderr _gpgrt_get_std_stream (2) void gpgrt_flockfile (gpgrt_stream_t stream); int gpgrt_ftrylockfile (gpgrt_stream_t stream); void gpgrt_funlockfile (gpgrt_stream_t stream); int gpgrt_feof (gpgrt_stream_t stream); int gpgrt_feof_unlocked (gpgrt_stream_t stream); int gpgrt_ferror (gpgrt_stream_t stream); int gpgrt_ferror_unlocked (gpgrt_stream_t stream); void gpgrt_clearerr (gpgrt_stream_t stream); void gpgrt_clearerr_unlocked (gpgrt_stream_t stream); int _gpgrt_pending (gpgrt_stream_t stream); /* (private) */ int _gpgrt_pending_unlocked (gpgrt_stream_t stream); /* (private) */ #define gpgrt_pending(stream) _gpgrt_pending (stream) #define gpgrt_pending_unlocked(stream) \ (((!(stream)->flags.writing) \ && (((stream)->data_offset < (stream)->data_len) \ || ((stream)->unread_data_len))) \ ? 1 : _gpgrt_pending_unlocked ((stream))) int gpgrt_fflush (gpgrt_stream_t stream); int gpgrt_fseek (gpgrt_stream_t stream, long int offset, int whence); int gpgrt_fseeko (gpgrt_stream_t stream, gpgrt_off_t offset, int whence); int gpgrt_ftruncate (gpgrt_stream_t stream, gpgrt_off_t length); long int gpgrt_ftell (gpgrt_stream_t stream); gpgrt_off_t gpgrt_ftello (gpgrt_stream_t stream); void gpgrt_rewind (gpgrt_stream_t stream); int gpgrt_fgetc (gpgrt_stream_t stream); int gpgrt_fputc (int c, gpgrt_stream_t stream); int _gpgrt_getc_underflow (gpgrt_stream_t stream); /* (private) */ int _gpgrt_putc_overflow (int c, gpgrt_stream_t stream); /* (private) */ #define gpgrt_getc_unlocked(stream) \ (((!(stream)->flags.writing) \ && ((stream)->data_offset < (stream)->data_len) \ && (! (stream)->unread_data_len)) \ ? ((int) (stream)->buffer[((stream)->data_offset)++]) \ : _gpgrt_getc_underflow ((stream))) #define gpgrt_putc_unlocked(c, stream) \ (((stream)->flags.writing \ && ((stream)->data_offset < (stream)->buffer_size) \ && (c != '\n')) \ ? ((int) ((stream)->buffer[((stream)->data_offset)++] = (c))) \ : _gpgrt_putc_overflow ((c), (stream))) #define gpgrt_getc(stream) gpgrt_fgetc (stream) #define gpgrt_putc(c, stream) gpgrt_fputc (c, stream) int gpgrt_ungetc (int c, gpgrt_stream_t stream); int gpgrt_read (gpgrt_stream_t _GPGRT__RESTRICT stream, void *_GPGRT__RESTRICT buffer, size_t bytes_to_read, size_t *_GPGRT__RESTRICT bytes_read); int gpgrt_write (gpgrt_stream_t _GPGRT__RESTRICT stream, const void *_GPGRT__RESTRICT buffer, size_t bytes_to_write, size_t *_GPGRT__RESTRICT bytes_written); int gpgrt_write_sanitized (gpgrt_stream_t _GPGRT__RESTRICT stream, const void *_GPGRT__RESTRICT buffer, size_t length, const char *delimiters, size_t *_GPGRT__RESTRICT bytes_written); int gpgrt_write_hexstring (gpgrt_stream_t _GPGRT__RESTRICT stream, const void *_GPGRT__RESTRICT buffer, size_t length, int reserved, size_t *_GPGRT__RESTRICT bytes_written); size_t gpgrt_fread (void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems, gpgrt_stream_t _GPGRT__RESTRICT stream); size_t gpgrt_fwrite (const void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems, gpgrt_stream_t _GPGRT__RESTRICT stream); char *gpgrt_fgets (char *_GPGRT__RESTRICT s, int n, gpgrt_stream_t _GPGRT__RESTRICT stream); int gpgrt_fputs (const char *_GPGRT__RESTRICT s, gpgrt_stream_t _GPGRT__RESTRICT stream); int gpgrt_fputs_unlocked (const char *_GPGRT__RESTRICT s, gpgrt_stream_t _GPGRT__RESTRICT stream); @api_ssize_t@ gpgrt_getline (char *_GPGRT__RESTRICT *_GPGRT__RESTRICT lineptr, size_t *_GPGRT__RESTRICT n, gpgrt_stream_t stream); @api_ssize_t@ gpgrt_read_line (gpgrt_stream_t stream, char **addr_of_buffer, size_t *length_of_buffer, size_t *max_length); int gpgrt_fprintf (gpgrt_stream_t _GPGRT__RESTRICT stream, const char *_GPGRT__RESTRICT format, ...) GPGRT_ATTR_PRINTF(2,3); int gpgrt_fprintf_unlocked (gpgrt_stream_t _GPGRT__RESTRICT stream, const char *_GPGRT__RESTRICT format, ...) GPGRT_ATTR_PRINTF(2,3); int gpgrt_fprintf_sf (gpgrt_stream_t _GPGRT__RESTRICT stream, gpgrt_string_filter_t sf, void *sfvalue, const char *_GPGRT__RESTRICT format, ...) GPGRT_ATTR_PRINTF(4,5); int gpgrt_fprintf_sf_unlocked (gpgrt_stream_t _GPGRT__RESTRICT stream, gpgrt_string_filter_t sf, void *sfvalue, const char *_GPGRT__RESTRICT format, ...) GPGRT_ATTR_PRINTF(4,5); int gpgrt_printf (const char *_GPGRT__RESTRICT format, ...) GPGRT_ATTR_PRINTF(1,2); int gpgrt_printf_unlocked (const char *_GPGRT__RESTRICT format, ...) GPGRT_ATTR_PRINTF(1,2); int gpgrt_vfprintf (gpgrt_stream_t _GPGRT__RESTRICT stream, const char *_GPGRT__RESTRICT format, va_list ap) GPGRT_ATTR_PRINTF(2,0); int gpgrt_vfprintf_unlocked (gpgrt_stream_t _GPGRT__RESTRICT stream, const char *_GPGRT__RESTRICT format, va_list ap) GPGRT_ATTR_PRINTF(2,0); int gpgrt_setvbuf (gpgrt_stream_t _GPGRT__RESTRICT stream, char *_GPGRT__RESTRICT buf, int mode, size_t size); void gpgrt_setbuf (gpgrt_stream_t _GPGRT__RESTRICT stream, char *_GPGRT__RESTRICT buf); void gpgrt_set_binary (gpgrt_stream_t stream); int gpgrt_set_nonblock (gpgrt_stream_t stream, int onoff); int gpgrt_get_nonblock (gpgrt_stream_t stream); int gpgrt_poll (gpgrt_poll_t *fdlist, unsigned int nfds, int timeout); gpgrt_stream_t gpgrt_tmpfile (void); void gpgrt_opaque_set (gpgrt_stream_t _GPGRT__RESTRICT stream, void *_GPGRT__RESTRICT opaque); void *gpgrt_opaque_get (gpgrt_stream_t stream); void gpgrt_fname_set (gpgrt_stream_t stream, const char *fname); const char *gpgrt_fname_get (gpgrt_stream_t stream); int gpgrt_asprintf (char **r_buf, const char * _GPGRT__RESTRICT format, ...) GPGRT_ATTR_PRINTF(2,3); int gpgrt_vasprintf (char **r_buf, const char * _GPGRT__RESTRICT format, va_list ap) GPGRT_ATTR_PRINTF(2,0); char *gpgrt_bsprintf (const char * _GPGRT__RESTRICT format, ...) GPGRT_ATTR_PRINTF(1,2); char *gpgrt_vbsprintf (const char * _GPGRT__RESTRICT format, va_list ap) GPGRT_ATTR_PRINTF(1,0); int gpgrt_snprintf (char *buf, size_t bufsize, const char * _GPGRT__RESTRICT format, ...) GPGRT_ATTR_PRINTF(3,4); int gpgrt_vsnprintf (char *buf,size_t bufsize, const char * _GPGRT__RESTRICT format, va_list arg_ptr) GPGRT_ATTR_PRINTF(3,0); #ifdef GPGRT_ENABLE_ES_MACROS # define es_fopen gpgrt_fopen # define es_mopen gpgrt_mopen # define es_fopenmem gpgrt_fopenmem # define es_fopenmem_init gpgrt_fopenmem_init # define es_fdopen gpgrt_fdopen # define es_fdopen_nc gpgrt_fdopen_nc # define es_sysopen gpgrt_sysopen # define es_sysopen_nc gpgrt_sysopen_nc # define es_fpopen gpgrt_fpopen # define es_fpopen_nc gpgrt_fpopen_nc # define es_freopen gpgrt_freopen # define es_fopencookie gpgrt_fopencookie # define es_fclose gpgrt_fclose # define es_fclose_snatch gpgrt_fclose_snatch # define es_onclose gpgrt_onclose # define es_fileno gpgrt_fileno # define es_fileno_unlocked gpgrt_fileno_unlocked # define es_syshd gpgrt_syshd # define es_syshd_unlocked gpgrt_syshd_unlocked # define es_stdin _gpgrt_get_std_stream (0) # define es_stdout _gpgrt_get_std_stream (1) # define es_stderr _gpgrt_get_std_stream (2) # define es_flockfile gpgrt_flockfile # define es_ftrylockfile gpgrt_ftrylockfile # define es_funlockfile gpgrt_funlockfile # define es_feof gpgrt_feof # define es_feof_unlocked gpgrt_feof_unlocked # define es_ferror gpgrt_ferror # define es_ferror_unlocked gpgrt_ferror_unlocked # define es_clearerr gpgrt_clearerr # define es_clearerr_unlocked gpgrt_clearerr_unlocked # define es_pending gpgrt_pending # define es_pending_unlocked gpgrt_pending_unlocked # define es_fflush gpgrt_fflush # define es_fseek gpgrt_fseek # define es_fseeko gpgrt_fseeko # define es_ftruncate gpgrt_ftruncate # define es_ftell gpgrt_ftell # define es_ftello gpgrt_ftello # define es_rewind gpgrt_rewind # define es_fgetc gpgrt_fgetc # define es_fputc gpgrt_fputc # define es_getc_unlocked gpgrt_getc_unlocked # define es_putc_unlocked gpgrt_putc_unlocked # define es_getc gpgrt_getc # define es_putc gpgrt_putc # define es_ungetc gpgrt_ungetc # define es_read gpgrt_read # define es_write gpgrt_write # define es_write_sanitized gpgrt_write_sanitized # define es_write_hexstring gpgrt_write_hexstring # define es_fread gpgrt_fread # define es_fwrite gpgrt_fwrite # define es_fgets gpgrt_fgets # define es_fputs gpgrt_fputs # define es_fputs_unlocked gpgrt_fputs_unlocked # define es_getline gpgrt_getline # define es_read_line gpgrt_read_line # define es_free gpgrt_free # define es_fprintf gpgrt_fprintf # define es_fprintf_unlocked gpgrt_fprintf_unlocked # define es_printf gpgrt_printf # define es_printf_unlocked gpgrt_printf_unlocked # define es_vfprintf gpgrt_vfprintf # define es_vfprintf_unlocked gpgrt_vfprintf_unlocked # define es_setvbuf gpgrt_setvbuf # define es_setbuf gpgrt_setbuf # define es_set_binary gpgrt_set_binary # define es_set_nonblock gpgrt_set_nonblock # define es_get_nonblock gpgrt_get_nonblock # define es_poll gpgrt_poll # define es_tmpfile gpgrt_tmpfile # define es_opaque_set gpgrt_opaque_set # define es_opaque_get gpgrt_opaque_get # define es_fname_set gpgrt_fname_set # define es_fname_get gpgrt_fname_get # define es_asprintf gpgrt_asprintf # define es_vasprintf gpgrt_vasprintf # define es_bsprintf gpgrt_bsprintf # define es_vbsprintf gpgrt_vbsprintf #endif /*GPGRT_ENABLE_ES_MACROS*/ /* * Base64 encode and decode functions. */ struct _gpgrt_b64state; typedef struct _gpgrt_b64state *gpgrt_b64state_t; gpgrt_b64state_t gpgrt_b64enc_start (gpgrt_stream_t stream, const char *title); gpg_err_code_t gpgrt_b64enc_write (gpgrt_b64state_t state, const void *buffer, size_t nbytes); gpg_err_code_t gpgrt_b64enc_finish (gpgrt_b64state_t state); gpgrt_b64state_t gpgrt_b64dec_start (const char *title); gpg_error_t gpgrt_b64dec_proc (gpgrt_b64state_t state, void *buffer, size_t length, size_t *r_nbytes); gpg_error_t gpgrt_b64dec_finish (gpgrt_b64state_t state); /* * Logging functions */ /* Flag values for gpgrt_log_set_prefix. */ #define GPGRT_LOG_WITH_PREFIX 1 #define GPGRT_LOG_WITH_TIME 2 #define GPGRT_LOG_WITH_PID 4 #define GPGRT_LOG_RUN_DETACHED 256 #define GPGRT_LOG_NO_REGISTRY 512 /* Log levels as used by gpgrt_log. */ enum gpgrt_log_levels { GPGRT_LOGLVL_BEGIN, GPGRT_LOGLVL_CONT, GPGRT_LOGLVL_INFO, GPGRT_LOGLVL_WARN, GPGRT_LOGLVL_ERROR, GPGRT_LOGLVL_FATAL, GPGRT_LOGLVL_BUG, GPGRT_LOGLVL_DEBUG }; /* The next 4 functions are not thread-safe - call them early. */ void gpgrt_log_set_sink (const char *name, gpgrt_stream_t stream, int fd); void gpgrt_log_set_socket_dir_cb (const char *(*fnc)(void)); void gpgrt_log_set_pid_suffix_cb (int (*cb)(unsigned long *r_value)); void gpgrt_log_set_prefix (const char *text, unsigned int flags); int gpgrt_get_errorcount (int clear); void gpgrt_inc_errorcount (void); const char *gpgrt_log_get_prefix (unsigned int *flags); int gpgrt_log_test_fd (int fd); int gpgrt_log_get_fd (void); gpgrt_stream_t gpgrt_log_get_stream (void); void gpgrt_log (int level, const char *fmt, ...) GPGRT_ATTR_PRINTF(2,3); void gpgrt_logv (int level, const char *fmt, va_list arg_ptr); void gpgrt_logv_prefix (int level, const char *prefix, const char *fmt, va_list arg_ptr); void gpgrt_log_string (int level, const char *string); void gpgrt_log_bug (const char *fmt, ...) GPGRT_ATTR_NR_PRINTF(1,2); void gpgrt_log_fatal (const char *fmt, ...) GPGRT_ATTR_NR_PRINTF(1,2); void gpgrt_log_error (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2); void gpgrt_log_info (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2); void gpgrt_log_debug (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2); void gpgrt_log_debug_string (const char *string, const char *fmt, ...) GPGRT_ATTR_PRINTF(2,3); void gpgrt_log_printf (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2); void gpgrt_log_printhex (const void *buffer, size_t length, const char *fmt, ...) GPGRT_ATTR_PRINTF(3,4); void gpgrt_log_clock (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2); void gpgrt_log_flush (void); void _gpgrt_log_assert (const char *expr, const char *file, int line, const char *func) GPGRT_ATTR_NORETURN; #ifdef GPGRT_HAVE_MACRO_FUNCTION # define gpgrt_assert(expr) \ ((expr) \ ? (void) 0 \ : _gpgrt_log_assert (#expr, __FILE__, __LINE__, __FUNCTION__)) #else /*!GPGRT_HAVE_MACRO_FUNCTION*/ # define gpgrt_assert(expr) \ ((expr) \ ? (void) 0 \ : _gpgrt_log_assert (#expr, __FILE__, __LINE__, NULL)) #endif /*!GPGRT_HAVE_MACRO_FUNCTION*/ #ifdef GPGRT_ENABLE_LOG_MACROS # define log_get_errorcount gpgrt_get_errorcount # define log_inc_errorcount gpgrt_inc_errorcount # define log_set_file(a) gpgrt_log_set_sink ((a), NULL, -1) # define log_set_fd(a) gpgrt_log_set_sink (NULL, NULL, (a)) # define log_set_stream(a) gpgrt_log_set_sink (NULL, (a), -1) # define log_set_socket_dir_cb gpgrt_log_set_socket_dir_cb # define log_set_pid_suffix_cb gpgrt_log_set_pid_suffix_cb # define log_set_prefix gpgrt_log_set_prefix # define log_get_prefix gpgrt_log_get_prefix # define log_test_fd gpgrt_log_test_fd # define log_get_fd gpgrt_log_get_fd # define log_get_stream gpgrt_log_get_stream # define log_log gpgrt_log # define log_logv gpgrt_logv # define log_logv_prefix gpgrt_logv_prefix # define log_string gpgrt_log_string # define log_bug gpgrt_log_bug # define log_fatal gpgrt_log_fatal # define log_error gpgrt_log_error # define log_info gpgrt_log_info # define log_debug gpgrt_log_debug # define log_debug_string gpgrt_log_debug_string # define log_printf gpgrt_log_printf # define log_printhex gpgrt_log_printhex # define log_clock gpgrt_log_clock # define log_flush gpgrt_log_flush # ifdef GPGRT_HAVE_MACRO_FUNCTION # define log_assert(expr) \ ((expr) \ ? (void) 0 \ : _gpgrt_log_assert (#expr, __FILE__, __LINE__, __FUNCTION__)) # else /*!GPGRT_HAVE_MACRO_FUNCTION*/ # define log_assert(expr) \ ((expr) \ ? (void) 0 \ : _gpgrt_log_assert (#expr, __FILE__, __LINE__, NULL)) # endif /*!GPGRT_HAVE_MACRO_FUNCTION*/ #endif /*GPGRT_ENABLE_LOG_MACROS*/ /* * Spawn functions (Not yet available) */ #define GPGRT_SPAWN_NONBLOCK 16 /* Set the streams to non-blocking. */ #define GPGRT_SPAWN_RUN_ASFW 64 /* Use AllowSetForegroundWindow on W32. */ #define GPGRT_SPAWN_DETACHED 128 /* Start the process in the background. */ #if 0 /* Function and convenience macros to create pipes. */ gpg_err_code_t gpgrt_make_pipe (int filedes[2], gpgrt_stream_t *r_fp, int direction, int nonblock); #define gpgrt_create_pipe(a) gpgrt_make_pipe ((a),NULL, 0, 0); #define gpgrt_create_inbound_pipe(a,b,c) gpgrt_make_pipe ((a), (b), -1,(c)); #define gpgrt_create_outbound_pipe(a,b,c) gpgrt_make_pipe ((a), (b), 1,(c)); /* Fork and exec PGMNAME. */ gpg_err_code_t gpgrt_spawn_process (const char *pgmname, const char *argv[], int *execpt, void (*preexec)(void), unsigned int flags, gpgrt_stream_t *r_infp, gpgrt_stream_t *r_outfp, gpgrt_stream_t *r_errfp, pid_t *pid); /* Fork and exec PGNNAME and connect the process to the given FDs. */ gpg_err_code_t gpgrt_spawn_process_fd (const char *pgmname, const char *argv[], int infd, int outfd, int errfd, pid_t *pid); /* Fork and exec PGMNAME as a detached process. */ gpg_err_code_t gpgrt_spawn_process_detached (const char *pgmname, const char *argv[], const char *envp[] ); /* Wait for a single process. */ gpg_err_code_t gpgrt_wait_process (const char *pgmname, pid_t pid, int hang, int *r_exitcode); /* Wait for a multiple processes. */ gpg_err_code_t gpgrt_wait_processes (const char **pgmnames, pid_t *pids, size_t count, int hang, int *r_exitcodes); /* Kill the process identified by PID. */ void gpgrt_kill_process (pid_t pid); /* Release process resources identified by PID. */ void gpgrt_release_process (pid_t pid); #endif /*0*/ /* * Option parsing. */ struct _gpgrt_argparse_internal_s; typedef struct { int *argc; /* Pointer to ARGC (value subject to change). */ char ***argv; /* Pointer to ARGV (value subject to change). */ unsigned int flags; /* Global flags. May be set prior to calling the parser. The parser may change the value. */ int err; /* Print error description for last option. Either 0, ARGPARSE_PRINT_WARNING or ARGPARSE_PRINT_ERROR. */ unsigned int lineno;/* The current line number. */ int r_opt; /* Returns option code. */ int r_type; /* Returns type of option value. */ union { int ret_int; long ret_long; unsigned long ret_ulong; char *ret_str; } r; /* Return values */ struct _gpgrt_argparse_internal_s *internal; } gpgrt_argparse_t; typedef struct { int short_opt; const char *long_opt; unsigned int flags; const char *description; /* Optional description. */ } gpgrt_opt_t; #ifdef GPGRT_ENABLE_ARGPARSE_MACROS /* Global flags for (gpgrt_argparse_t).flags. */ #define ARGPARSE_FLAG_KEEP 1 /* Do not remove options form argv. */ #define ARGPARSE_FLAG_ALL 2 /* Do not stop at last option but return remaining args with R_OPT set to -1. */ #define ARGPARSE_FLAG_MIXED 4 /* Assume options and args are mixed. */ #define ARGPARSE_FLAG_NOSTOP 8 /* Do not stop processing at "--". */ #define ARGPARSE_FLAG_ARG0 16 /* Do not skip the first arg. */ #define ARGPARSE_FLAG_ONEDASH 32 /* Allow long options with one dash. */ #define ARGPARSE_FLAG_NOVERSION 64 /* No output for "--version". */ #define ARGPARSE_FLAG_RESET 128 /* Request to reset the internal state. */ #define ARGPARSE_FLAG_STOP_SEEN 256 /* Set to true if a "--" has been seen. */ #define ARGPARSE_FLAG_NOLINENO 512 /* Do not zero the lineno field. */ /* Constants for (gpgrt_argparse_t).err. */ #define ARGPARSE_PRINT_WARNING 1 /* Print a diagnostic. */ #define ARGPARSE_PRINT_ERROR 2 /* Print a diagnostic and call exit. */ /* Special return values of gpgrt_argparse. */ #define ARGPARSE_IS_ARG (-1) #define ARGPARSE_INVALID_OPTION (-2) #define ARGPARSE_MISSING_ARG (-3) #define ARGPARSE_KEYWORD_TOO_LONG (-4) #define ARGPARSE_READ_ERROR (-5) #define ARGPARSE_UNEXPECTED_ARG (-6) #define ARGPARSE_INVALID_COMMAND (-7) #define ARGPARSE_AMBIGUOUS_OPTION (-8) #define ARGPARSE_AMBIGUOUS_COMMAND (-9) #define ARGPARSE_INVALID_ALIAS (-10) #define ARGPARSE_OUT_OF_CORE (-11) #define ARGPARSE_INVALID_ARG (-12) /* Flags for the option descriptor (gpgrt_opt_t)->flags. Note that * a TYPE constant may be or-ed with the OPT constants. */ #define ARGPARSE_TYPE_NONE 0 /* Does not take an argument. */ #define ARGPARSE_TYPE_INT 1 /* Takes an int argument. */ #define ARGPARSE_TYPE_STRING 2 /* Takes a string argument. */ #define ARGPARSE_TYPE_LONG 3 /* Takes a long argument. */ #define ARGPARSE_TYPE_ULONG 4 /* Takes an unsigned long argument. */ #define ARGPARSE_OPT_OPTIONAL (1<<3) /* Argument is optional. */ #define ARGPARSE_OPT_PREFIX (1<<4) /* Allow 0x etc. prefixed values. */ #define ARGPARSE_OPT_IGNORE (1<<6) /* Ignore command or option. */ #define ARGPARSE_OPT_COMMAND (1<<7) /* The argument is a command. */ /* A set of macros to make option definitions easier to read. */ #define ARGPARSE_x(s,l,t,f,d) \ { (s), (l), ARGPARSE_TYPE_ ## t | (f), (d) } #define ARGPARSE_s(s,l,t,d) \ { (s), (l), ARGPARSE_TYPE_ ## t, (d) } #define ARGPARSE_s_n(s,l,d) \ { (s), (l), ARGPARSE_TYPE_NONE, (d) } #define ARGPARSE_s_i(s,l,d) \ { (s), (l), ARGPARSE_TYPE_INT, (d) } #define ARGPARSE_s_s(s,l,d) \ { (s), (l), ARGPARSE_TYPE_STRING, (d) } #define ARGPARSE_s_l(s,l,d) \ { (s), (l), ARGPARSE_TYPE_LONG, (d) } #define ARGPARSE_s_u(s,l,d) \ { (s), (l), ARGPARSE_TYPE_ULONG, (d) } #define ARGPARSE_o(s,l,t,d) \ { (s), (l), (ARGPARSE_TYPE_ ## t | ARGPARSE_OPT_OPTIONAL), (d) } #define ARGPARSE_o_n(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_NONE | ARGPARSE_OPT_OPTIONAL), (d) } #define ARGPARSE_o_i(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_INT | ARGPARSE_OPT_OPTIONAL), (d) } #define ARGPARSE_o_s(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_STRING | ARGPARSE_OPT_OPTIONAL), (d) } #define ARGPARSE_o_l(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_LONG | ARGPARSE_OPT_OPTIONAL), (d) } #define ARGPARSE_o_u(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_ULONG | ARGPARSE_OPT_OPTIONAL), (d) } #define ARGPARSE_p(s,l,t,d) \ { (s), (l), (ARGPARSE_TYPE_ ## t | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_p_n(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_NONE | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_p_i(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_INT | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_p_s(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_STRING | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_p_l(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_LONG | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_p_u(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_ULONG | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_op(s,l,t,d) \ { (s), (l), (ARGPARSE_TYPE_ ## t \ | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_op_n(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_NONE \ | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_op_i(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_INT \ | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_op_s(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_STRING \ | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_op_l(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_LONG \ | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_op_u(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_ULONG \ | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_c(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_NONE | ARGPARSE_OPT_COMMAND), (d) } #define ARGPARSE_ignore(s,l) \ { (s), (l), (ARGPARSE_OPT_IGNORE), "@" } #define ARGPARSE_group(s,d) \ { (s), NULL, 0, (d) } /* Mark the end of the list (mandatory). */ #define ARGPARSE_end() \ { 0, NULL, 0, NULL } #endif /* GPGRT_ENABLE_ARGPARSE_MACROS */ /* Take care: gpgrt_argparse keeps state in ARG and requires that * either ARGPARSE_FLAG_RESET is used after OPTS has been changed or * gpgrt_argparse (NULL, ARG, NULL) is called first. */ int gpgrt_argparse (gpgrt_stream_t fp, gpgrt_argparse_t *arg, gpgrt_opt_t *opts); void gpgrt_usage (int level); const char *gpgrt_strusage (int level); void gpgrt_set_strusage (const char *(*f)(int)); void gpgrt_set_usage_outfnc (int (*f)(int, const char *)); void gpgrt_set_fixed_string_mapper (const char *(*f)(const char*)); /* * Various helper functions */ /* Compare arbitrary version strings. For the standard m.n.o version * numbering scheme a LEVEL of 3 is suitable; see the manual. */ int gpgrt_cmp_version (const char *a, const char *b, int level); #ifdef __cplusplus } #endif #endif /* GPGRT_H */ #endif /* GPG_ERROR_H */