aboutsummaryrefslogtreecommitdiffstats
path: root/common/miscellaneous.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove the deprecated gcry_set_log_handler.Werner Koch2024-04-231-22/+0
| | | | | | | | * common/miscellaneous.c (my_gcry_logger): Remove. (setup_libgcrypt_logging): Do not call the deprecated gcry_set_log_handler. * kbx/kbxutil.c (my_gcry_logger): Remove. * tools/no-libgcrypt.c (gcry_set_log_handler): Remove stub.
* Merge branch 'STABLE-BRANCH-2-4'Werner Koch2023-11-071-0/+50
|\ | | | | | | | | | | | | * common/b64dec.c (b64decode): Move to ... * common/miscellaneous.c: here. * common/t-b64.c: Re-inroduce and keep only the b64decode test code.
* | gpg: Report BEGIN_* status before examining the input.NIIBE Yutaka2023-05-241-106/+0
|/ | | | | | | | | | | | | | | | | | | | | | | | | | * common/miscellaneous.c (is_openpgp_compressed_packet) (is_file_compressed): Moved to ... * common/iobuf.c: ... in this file. (is_file_compressed): Change the argument to INP, the iobuf. * common/util.h (is_file_compressed): Remove. * common/iobuf.h (is_file_compressed): Add. * g10/cipher-aead.c (write_header): Don't call write_status_printf here. (cipher_filter_aead): Call write_status_printf when called with IOBUFCTRL_INIT. * g10/cipher-cfb.c (write_header): Don't call write_status_printf here. (cipher_filter_cfb): Call write_status_printf when called with IOBUFCTRL_INIT. * g10/encrypt.c (encrypt_simple): Use new is_file_compressed function, after call of iobuf_push_filter. (encrypt_crypt): Likewise. * g10/sign.c (sign_file): Likewise. -- GnuPG-bug-id: 6481 Signed-off-by: NIIBE Yutaka <[email protected]>
* common: Detect PNG and JPEG file formats.Werner Koch2023-01-191-6/+24
| | | | | | | * common/miscellaneous.c (is_file_compressed): Add detect code. -- GnuPG-bug-id: 6332
* gpg: Detect already compressed data also when using a pipe.Werner Koch2023-01-191-47/+30
| | | | | | | | | | | | | | | | | | | | | * common/iobuf.c (file_filter_ctx_t): Add fields for the peek feature. (file_filter): Implement peeking. (iobuf_ioctl): Add new IOBUF_IOCTL_PEEK. * common/iobuf.h (IOBUF_IOCTL_PEEK, IOBUFCTRL_PEEK): New. * common/miscellaneous.c (is_file_compressed): Rewrite. Detect PDF. * g10/encrypt.c (encrypt_simple): Peek before detecting compression. (encrypt_crypt): Ditto. * g10/sign.c (sign_file): Also detect already compressed data. * g10/options.h (opt): Add explicit_compress_option. * g10/gpg.c (main): Set opt.explicit_compress_option for -z. -- Note that this patch also introduces a compression check for signing which was never done in the past. GnuPG-bug-id: 6332
* common: New function parse_compatibility_flags.Werner Koch2022-06-131-0/+80
| | | | | | | | | | * common/miscellaneous.c (parse_compatibility_flags): New. * common/util.h (struct compatibility_flags_s): New. -- This is similar to parse_debug_flags but does not support specifying a value. This way we can more easily change the internal values or re-use them for other purposes.
* common: Add xreallocarray function.Werner Koch2020-03-041-0/+11
| | | | | | | | | | * common/miscellaneous.c (xreallocarray): New func. * common/util.h (xtryreallocarray): New macro. -- Very useful to match calloc behaviour. Signed-off-by: Werner Koch <[email protected]>
* common: New function decode_c_string.Werner Koch2019-01-301-0/+76
| | | | | | | | | * common/miscellaneous.c (decode_c_string): New. -- This is basically a copy from the code we use in gpgme and gpa. Signed-off-by: Werner Koch <[email protected]>
* Merge branch 'STABLE-BRANCH-2-2' into masterWerner Koch2018-05-131-0/+1
|\ | | | | | | | | | | | | | | | | | | -- Resolved Conflicts: NEWS - removed configure.ac - removed Signed-off-by: Werner Koch <[email protected]>
| * gpg: Fix "Too many open files" when using --multifile.Werner Koch2018-05-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | * common/miscellaneous.c (is_file_compressed): Don't cache the file. -- This seems to be a pretty old bug. The fix is easy and also reveals that -z0 can be used as a workaround. GnuPG-bug-id: 3951 Signed-off-by: Werner Koch <[email protected]>
* | Adjust for changed macro names in libgpg-error master.Werner Koch2017-12-111-8/+8
|/ | | | | | | | | | * common/logging.h (GPGRT_LOGLVL_): New replacement macros for older libgpg-error versions. -- Updates-commit: b56dfdfc1865ceb7c3c025d79996e049faee7fdf Signed-off-by: Werner Koch <[email protected]>
* common: New function print_utf9_string.Werner Koch2017-07-201-0/+10
| | | | | | | | | * common/miscellaneous.c (print_utf8_string): New. -- This is a simple convenience function. Signed-off-by: Werner Koch <[email protected]>
* gpg: Improve check for already compressed packets.Werner Koch2017-03-241-6/+57
| | | | | | | | | | | | | | * common/miscellaneous.c (is_openpgp_compressed_packet): New. (is_file_compressed): Rerad 2 more bytes and call new function. -- Note that this does not yet allow to detect compressed data piped to gpg. This requires a proper read-ahead in iobuf.c which is complicated due to the auto-removal of filter functions. Thus such an read-ahead needs to be done in the I/O backend of iobuf. Signed-off-by: Werner Koch <[email protected]>
* Remove unused debug flags and add "dns" and "network".Werner Koch2016-12-191-0/+2
| | | | | | | | | | | | | | | | | | * g10/options.h (DBG_CARD_IO_VALUE, DBG_CARD_IO): Remove. * g10/gpg.c (debug_flags): Remove "cardio". * agent/agent.h (DBG_COMMAND_VALUE, DBG_COMMAND): Remove. * agent/gpg-agent.c (debug_flags): Remove "command". * scd/scdaemon.h (DBG_COMMAND_VALUE, DBG_COMMAND): Remove. * scd/scdaemon.c (debug_flags): Remove "command". * dirmngr/dirmngr.h (DBG_DNS_VALUE, DBG_DNS): New. (DBG_NETWORK_VALUE, DNG_NETWORK): New. * dirmngr/dirmngr.c (debug_flags): Add "dns" and "network". -- Note that "dns" and "network" are not yet used but will soon be added to dirmngr. Signed-off-by: Werner Koch <[email protected]>
* Change all http://www.gnu.org in license notices to https://Werner Koch2016-11-051-1/+1
| | | | --
* common: New function try_make_printable_string.Werner Koch2016-08-101-2/+66
| | | | | | | | * common/stringhelp.c (sanitize_buffer): Remove. Move code to ... * common/miscellaneous.c (try_make_printable_string): new. (make_printable_string): Call try_make_printable_string. Signed-off-by: Werner Koch <[email protected]>
* common: Use new function to print a failure of xtrymalloc.Werner Koch2016-04-251-0/+11
| | | | | | | | * common/miscellaneous.c (xoutofcore): New. * common/strlist.c (append_to_strlist): Use instead of abort. (append_to_strlist_try): Use xtrymalloc instead of xmalloc. Signed-off-by: Werner Koch <[email protected]>
* common: Improve fucntion parse_debug_flag.Werner Koch2015-06-231-2/+13
| | | | | | | * common/miscellaneous.c (parse_debug_flag): Add hack not to call exit. Add "none" and "all" flags. Signed-off-by: Werner Koch <[email protected]>
* common: Add function parse_debug_flagWerner Koch2015-06-221-0/+81
| | | | | | | * common/miscellaneous.c (parse_debug_flag): New. * common/util.h (struct debug_flags_s): New. Signed-off-by: Werner Koch <[email protected]>
* agent: Print a warning for obsolete options.Werner Koch2015-06-171-0/+14
| | | | | | | | | | | * g10/misc.c (obsolete_scdaemon_option): Move to * common/miscellaneous.c (obsolete_option): ... here. * agent/gpg-agent.c (main): Use obsolete_option for the 3 obsolete options. -- GnuPG-bug-id: 2016 Signed-off-by: Werner Koch <[email protected]>
* common: Rename log and gcc attribute macros (jnlib merge).Werner Koch2015-04-241-8/+8
| | | | | | | | | | | * common/logging.h: Rename JNLIB_LOG_* to GPGRT_LOG_*. * common/mischelp.h: Rename JNLIB_GCC_* to GPGRT_GCC_*. -- JNLIB has no more meaning. Thus we switch to a GPGRT_ prefix in anticipation that some code may eventually be moved to libgpg-error. Signed-off-by: Werner Koch <[email protected]>
* common: Remove two JNLIB_ macros (jnlib merge).Werner Koch2015-04-241-1/+0
| | | | | | | | | | * configure.ac: Merge seperate jnlib checks. (HAVE_JNLIB_LOGGING): Remove. * common/logging.c, common/simple-pwquery.c (JNLIB_NEED_AFLOCAL): Rename to GNUPG_COMMON_NEED_AFLOCAL. Change all tests. -- Signed-off-by: Werner Koch <[email protected]>
* Switch to the libgpg-error provided estream.Werner Koch2014-08-261-2/+43
| | | | | | | | | | * configure.ac (NEED_GPG_ERROR_VERSION): Reguire 1.14. (GPGRT_ENABLE_ES_MACROS): Define. (estream_INIT): Remove. * m4/estream.m4: Remove. * common/estream-printf.c, common/estream-printf.h: Remove. * common/estream.c, common/estream.h: Remove. * common/init.c (_init_common_subsystems): Call gpgrt initialization.
* Change license for some files in common to LGPLv3+/GPLv2+.Werner Koch2012-04-201-5/+15
| | | | | | | | | | | | | | | | | | | | | | | Having the LGPL on the common GnuPG code helps to share code between GnuPG and related projects (like GPGME and Libassuan). This is good for interoperability and to reduces bugs. * common/asshelp.c, common/asshelp.h, common/asshelp2.c, common/b64dec.c * common/b64enc.c, common/convert.c, common/dns-cert.c * common/dns-cert.h common/exechelp-posix.c, common/exechelp-w32.c * common/exechelp-w32ce.c, common/exechelp.h, common/get-passphrase.c * common/get-passphrase.h, common/gettime.c, common/gpgrlhelp.c * common/helpfile.c, common/homedir.c, common/http.c, common/http.h * common/i18n.c, common/init.c, common/init.h, common/iobuf.c * common/iobuf.h, common/localename.c, common/membuf.c, common/membuf.h * common/miscellaneous.c, common/openpgp-oid.c, common/openpgpdefs.h * common/percent.c, common/pka.c, common/pka.h, common/session-env.c * common/session-env.h, common/sexp-parse.h, common/sexputil.c * common/signal.c, common/srv.c, common/srv.h, common/ssh-utils.c * common/ssh-utils.h, common/sysutils.c, common/sysutils.h * common/tlv.c, common/tlv.h, common/ttyio.c, common/ttyio.h * common/userids.c, common/userids.h, common/xasprintf.c: Change license to LGPLv3+/GPLv2+/
* Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch2011-02-041-8/+7
| | | | | | | | We better do this once and for all instead of cluttering all future commits with diffs of trailing white spaces. In the majority of cases blank or single lines are affected and thus this change won't disturb a git blame too much. For future commits the pre-commit scripts checks that this won't happen again.
* s/AES/AES128/ in diagnostics and --list-configWerner Koch2010-12-021-0/+17
|
* More agent support for gpg.Werner Koch2010-10-131-0/+78
|
* Finished the bulk of changes to use estream in most places instead ofWerner Koch2010-03-151-10/+9
| | | | | stdio.
* Use a custom log handler for libassuan.Werner Koch2010-03-111-2/+0
|
* Use more warning options with modern GCCs.Werner Koch2008-10-171-0/+8
| | | | | Other minor changes.
* Changed to GPLv3.Werner Koch2007-07-041-4/+2
| | | | | Removed intl/.
* Improved logging for error orginating from libgcrypt.Werner Koch2007-04-201-0/+67
|
* Allow export to work on systems without funopen/fopencookie.Werner Koch2007-03-191-0/+16
|
* Changes to let the key listing use estream to help systems withoutWerner Koch2007-03-191-0/+1
| | | | | funopen.
* Take advantage of newer gpg-error features.Werner Koch2006-09-141-1/+1
|
* Updated FSF's address.Werner Koch2006-06-201-1/+2
|
* g10/ does build again.Werner Koch2006-05-231-1/+23
|
* Still merging 1.4.3 code backWerner Koch2006-04-211-2/+3
|
* gcc-4 defaults forced me to edit many many files to get rid of theWerner Koch2005-06-161-1/+1
| | | | | | | char * vs. unsigned char * warnings. The GNU coding standards used to say that these mismatches are okay and better than a bunch of casts. Obviously this has changed now.
* 2004-01-30 Marcus Brinkmann <[email protected]>Marcus Brinkmann2004-01-301-19/+0
| | | | | | | | * Makefile.am (libcommon_a_SOURCES): Add xasprintf.c. * miscellaneous.c (xasprintf): Moved to ... * xasprintf (xasprintf): ... here. New file. This allows to use xasprintf without sucking in gpg-error.
* * gettime.c (asctimestamp): Add a note on a non-avoidable gcc warning.Werner Koch2003-12-171-0/+20
| | | | | | | | * util.h [!HAVE_VASPRINTF]: Add printf format attribute to the replacement function. * miscellaneous.c (xasprintf): New.
* This commit was manufactured by cvs2svn to create branchRepo Admin2003-08-051-0/+126
'GNUPG-1-9-BRANCH'.