| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
--
We already have _tag which is used for ASN.1, _MSG which is used by
protocols like WKS and TLS, and the GPG_ERR_UNEXPECTED which is
unrelated the former one and means just that an error was not
expected. OpenPGP also has some cases where a packet is not expected.
A dedicated error code thus makes sense.
|
|
|
|
| |
--
|
| |
|
|
|
|
| |
--
|
| |
|
|
|
|
| |
--
|
| |
|
|
|
|
| |
--
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* src/argparse.c (_gpgrt_argparse_internal_s): Add fields no_registry
and registry.
(initialize): Init them.
(emulated_registry_lookup): New.
(handle_meta_getenv): Use it.
* tests/etc/t-argparse.conf: Add a getreg meta command.
* tests/t-argparse.c (opt): Add a disable-akr command.
* tests/etc/Registry: New.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/name-value.c (_gpgrt_name_value_entry): Add field namelen.
(ascii_memcasecmp): New.
(same_name_p): New.
(valid_name): Strip the colon and return the length.
(do_nvc_add): Set namelen.
(_gpgrt_nvc_lookup): Simplify.
* tests/t-name-value.c (test_getting_values): Add some extra tests.
--
The requirement for a colon after the name is too cumbersome.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/name-value.c: New.
* tests/t-name-value.c: New.
* src/gpg-error.def.in: Add new functions.
* src/gpg-error.h.in: Ditto.
* src/gpg-error.vers: Ditto.
* src/visibility.c: Ditto.
* src/visibility.h: Ditto.
--
These new functions were originally added to GnuPG taken from current
GnuPG master. The license has been changed from (LGPL-3.0-or-later OR
GPL-2.0-or-later) to LGPL-2.1-or-later: Everything was written by me
or employees/contractors of g10 Code GmbH. The private key handling
has been removed because that would require Libgcrypt functions. Some
functions are changed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/strlist.c: Rename all functions to have a _gpgrt_strlist prefix.
(append_to_strlist2, strlist_length): Remove.
(_gpgrt_strlist_free): rtake care of the wipe flag.
(_gpgrt_strlist_add): Add a flags arg to use it for prepend and
append. Return an error on failure.
(_gpgrt_strlist_tokenize): Ditto.
(_gpgrt_strlist_copy): Chnage to return an error on failure.
(_gpgrt_strlist_pop): Ditto.
* src/Makefile.am (libgpg_error_la_SOURCES): Add strlist.c.
* src/argparse.c (trim_spaces): Move to ...
* src/stringutils.c (_gpgrt_trim_spaces): here and rename.
* src/visibility.c: Add wrappers for all exported functions.
* src/visibility.h: MArk exported functions as visisble.
* src/gpg-error.def.in: Export new functions
* src/gpg-error.vers: Ditto.
* src/gpg-error.h.in (GPGRT_STRLIST_APPEND): New.
(GPGRT_STRLIST_WIPE): New.
(gpgrt_strlist_free): New.
(gpgrt_strlist_add): New.
(gpgrt_strlist_tokenize): New.
(gpgrt_strlist_copy): New.
(gpgrt_strlist_rev): New.
(gpgrt_strlist_prev): New.
(gpgrt_strlist_last): New.
(gpgrt_strlist_pop): New.
(gpgrt_strlist_find): New.
(gpgrt_strlist_count): New inline function.
--
This is a modified set of function as used by gpg for ages. These are
quite useful functions and will be needed internally for some other
planned features. The idea is to make their counterparts in gnupg
wrapper around those new functions.
After we have moved the secure memory stuff from Libgcrypt to here we
can also implement a GPGRT_STRLICT_SECMEM flag to allow allocating
strings here ion secure memory. For now we only have the WIPE flag
which wipes the memory on free.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/w32-reg.c (_gpgrt_w32_reg_query_string): Implement a prefix for
root and consider an empty string for root also HKCU.
* src/visibility.c (gpgrt_w32_reg_get_string): New.
* src/gpg-error.def.in: Add new function.
* src/gpg-error.c (my_strusage): Print the Windows version (32 or 64
bit) of the binary.
(main): New command --getreg.
--
This function is already used internally and we have a similar
function in GnuPG. It is much more convenient to work with this
function.
Also we can now pass the KEY_WOW64_32KEY andKEY_WOW64_64KEY flags to
the registry read functions. For example
!32key!HKLM\software\gnu\gnupg:ntdskeyserver
returns the value using the KEY_WOW64_32KEY flag; likewise for
!64key!. If !cross! is used the reversed flag of the binary type is
used.
|
|
|
|
| |
--
|
| |
|
|
|
|
| |
--
|
| |
|
|
|
|
| |
--
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/gpg-error.h.in (gpgrt_logv_domain): New. Also add printf
attributes to the other logv functions.
* src/visibility.c (gpgrt_logv_domain): New.
--
This function can be used instead of gpgrt_logv to provide a somain
string. As of now this has no effect but we may later add an API to
allow selection of diagnostics depending on the domain. There is also
a new (buffer,length) argument which will eventually be used to
provide a domain based gpgrt_log_printhex.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/gpg-error.h.in (gpgrt_add_post_log_func): New.
* src/gpg-error.vers: Add new function
* src/gpg-error.def.in: Ditto.
* src/visibility.c (gpgrt_add_post_log_func): New.
* src/logging.c (struct post_log_func_item_s): New.
(post_log_func_list): New.
(_gpgrt_add_post_log_func): new.
(run_post_log_funcs): New.
(_gpgrt_logv_internal): Call for fatal and bug log levels.
--
This is required in case an application or library needs to do do some
quick cleanups after a log_fatal.
|
|
|
|
| |
--
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/gpgrt-int.h (struct _gpgrt_stream_internal): Add field "wipe".
* src/estream.c (mem_free2): New.
(struct estream_cookie_mem): Add flag "wipe".
(func_mem_create): Add arg wipe.
(func_mem_destroy): Wipe.
(X_WIPE): New.
(parse_mode): Parse "wipe" mode flag.
(init_stream_obj): Set it.
(do_close): Wipe internal struct with its static buffers.
(doreadline): Pass wipe mode along to help buffer.
(_gpgrt_mopen): Pass wipe mode.
(_gpgrt_fopenmem): Ditto.
--
GnuPG-bug-id: 6954
This is likely not complete but should wipe out buffers allocated by
fopenmem.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/gpg-error.h.in (ARGPARSE_FLAG_COMMAND): New.
* src/argparse.c (struct _gpgrt_argparse_internal_s): Add flags
explicit_cmd_mode, cmd_mode, and command_seen.
(initialize): Init them. Mark default commands as commands.
(handle_meta_command): New.
(handle_metacmd): Add "command-mode" and "-command-mode".
(find_long_option): Add arg only_commands.
(arg_parse): Factor some code out to ...
(handle_special_commands): new.
(arg_parse): Implement the command-mode.
* tests/t-argparse.c (main): Add some testing code.
--
GnuPG-bug-id: 6978
|
|
|
|
|
|
| |
* Makefile.am (EXTRA_DIST): build-aux/libtool.patch.
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
|
|
| |
--
|
| |
|
|
|
|
|
| |
* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Add
with --install-gpg-error-config.
|
|
|
|
|
|
|
|
| |
* src/err-sources.h.in (GPG_ERR_SOURCE_TKD): New.
--
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
|
|
| |
--
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac (INSTALL_GPG_ERROR_CONFIG): New.
* src/Makefile.am (bin_SCRIPTS, noinst_SCRIPTS): Conditionalize.
--
GnuPG-bug-id: 5683
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
|
|
| |
--
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/sysutils.c (any8bitchar): Remove.
(_gpgrt_fname_to_wchar): New.
(_gpgrt_mkdir): Use instead of plain utf8 conversion.
(_gpgrt_access): Reimplement using GetFileAttributesW so that long
files names are supported.
* src/estream.c (_gpgrt_w32_get_last_err_code): New.
(func_file_create_w32): New.
(_gpgrt_fopen): Handle the "sysopen" mode flag. Support mapping of
/dev/null.
(_gpgrt_freopen): Support mapping of /dev/null.
* src/w32-gettext.c (load_domain): Allow long file names.
* src/visibility.c (gpgrt_free_wchar): Make function public.
(gpgrt_fname_to_wchar): Ditto.
(gpgrt_utf8_to_wchar): Ditto.
(gpgrt_wchar_to_utf8): Ditto.
* src/w32-add.h (gpgrt_free_wchar): New prototype.
(gpgrt_fname_to_wchar): Ditto.
(gpgrt_utf8_to_wchar): Ditto.
(gpgrt_wchar_to_utf8): Ditto.
* src/gpg-error.def.in: Add them here too.
|
|
|
|
| |
--
|
|
|
|
| |
* configure.ac: Bump LT version to C32/A32/R2.
|
|
|
|
| |
--
|
| |
|
|
|
|
| |
--
|
| |
|
|
|
|
| |
* src/err-sources.h.in (GPG_ERR_SOURCE_TPM2D): New.
|
|
|
|
|
|
|
| |
--
The new inline function gpg_err_code_from_sqlite was missing in the
NEWS file.
|
|
|
|
| |
--
|
| |
|
|
|
|
| |
--
|
|
|
|
| |
* configure.ac: Bump LT version to C31/A31/R0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/gpg-error.h.in (gpgrt_access): New.
* src/gpg-error.vers. src/gpg-error.def.in: Add new function.
* src/sysutils.c (any8bitchar): New.
(_gpgrt_access): New.
* src/visibility.c (gpgrt_access): New.
* src/spawn-w32.c (_gpgrt_spawn_process_detached): Use it.
* src/argparse.c (try_versioned_conffile): Use it.
* tests/t-stringutils.c (check_access): New simple test.
--
This is basically a wrapper to allow handling of utf8 encoded file
names on Windows. This also fixes the case for versioned config files
in directories with non-ascii characters.
The new test needs to be run manually on Windows using a directory
with Unicode characters.
GnuPG-bug-id: 5098
|