1. 28 Jan, 2019 1 commit
    • Werner Koch's avatar
      Release 1.35 · 2421afdd
      Werner Koch authored
      
      
      --
      
      Because gpgrt-config is not anymore generated from gpgrt-config.in and
      a stale (generated) gpgrt-config was hanging around in the build
      directory the make distcheck target didn't caught this situation and
      we accidently distributed the old gpgrt-config from the build
      directory.
      
      Signed-off-by: default avatarWerner Koch <wk@gnupg.org>
      2421afdd
  2. 23 Jan, 2019 1 commit
    • NIIBE Yutaka's avatar
      gpgscm: Build well even if NDEBUG defined. · 8a939789
      NIIBE Yutaka authored
      
      
      * gpgscm/scheme.c (gc_reservation_failure): Fix adding ";".
      [!NDEBUG] (scheme_init_custom_alloc): Don't init seserved_lineno.
      
      --
      
      In some build environment, NDEBUG is defined (although it's
      bad practice).  This change supports such a situation.
      
      GnuPG-bug-id: 3959
      Signed-off-by: NIIBE Yutaka's avatarNIIBE Yutaka <gniibe@fsij.org>
      8a939789
  3. 16 Jan, 2019 3 commits
  4. 15 Jan, 2019 1 commit
  5. 14 Jan, 2019 1 commit
  6. 10 Jan, 2019 2 commits
  7. 09 Jan, 2019 1 commit
  8. 04 Jan, 2019 1 commit
    • Werner Koch's avatar
      core: New functions gpgrt_abort and gpgrt_add_emergency_cleanup. · 933bfd7b
      Werner Koch authored
      
      
      * src/init.c (emergency_cleanup_list): New gloabl var.
      (_gpgrt_add_emergency_cleanup): New.
      (_gpgrt_abort): New. Repalce all calls to abort by this.  Also replace
      all assert by either log_assert or a stderr output followed by a
      _gpgrt_abort.
      (run_emergency_cleanup): New.
      * src/visibility.c (gpgrt_add_emergency_cleanup): New public API.
      (gpgrt_abort): New public API.
      --
      
      Libgcrypt uses its own assert function which makes sure to terminate
      the secure memory.  This is safe as log as an assert is triggered
      internally in Libgcrypt.  GnuPG runs emergency cleanup handlers right
      before log_fatal etc to tell Libgcrypt to terminate the secure memory.
      With the move of the logging function to gpgrt in gnupg 2.3 this did
      not anymore.  Thus we now provide a mechanism in gpgrt to do right
      that.  Eventually Libgcrypt can also make use of this.
      
      What this does not handle are calls to abort or failed asserts in
      external libraries or in libc.  We can't do anything about it in a
      library because a library may not setup signal handlers.
      
      Signed-off-by: default avatarWerner Koch <wk@gnupg.org>
      933bfd7b
  9. 12 Dec, 2018 1 commit
  10. 11 Dec, 2018 1 commit
  11. 09 Dec, 2018 1 commit
  12. 07 Dec, 2018 5 commits
  13. 06 Dec, 2018 1 commit
    • Werner Koch's avatar
      logging: Escape controls in string arguments of log_ functions. · b7fae45c
      Werner Koch authored
      
      
      * src/logging.c (struct fmt_string_filter_s): New.
      (fmt_string_filter): New.
      (_gpgrt_logv_internal): Use the filter.
      --
      
      This change has two advantages: a) There is no more need to first
      escape string arguments before passing them to a log function and b)
      you can't forget to do the escaping and thus attacks using diagnostic
      output to trick out users won't work.  The drawback is that you see \n
      instead of a real LF and under Windows the backslash in file names are
      doubled.
      
      Signed-off-by: default avatarWerner Koch <wk@gnupg.org>
      b7fae45c
  14. 05 Dec, 2018 3 commits
  15. 26 Nov, 2018 2 commits
    • Werner Koch's avatar
      core: New functions gpgrt_fprintf_sf anf gpgrt_fprintf_sf_unlocked. · bd8668c1
      Werner Koch authored
      
      
      * src/gpg-error.h.in (gpgrt_string_filter_t): New type.
      (gpgrt_fprintf_sf, gpgrt_fprintf_sf_unlocked): New.
      * src/gpg-error.vers, src/gpg-error.def.in: Add them.
      * src/visibility.c (gpgrt_fprintf_sf): New.
      (gpgrt_fprintf_sf_unlocked): New.
      * src/estream-printf.c (pr_string): Add and use args sf, sfvalue and
      string_no.
      (do_format): Add args sf and sfvalue.  Keep a string format counter.
      (_gpgrt_estream_format): Add args sf and sfvalue.  Change all callers
      to provide NULL for them.
      * src/estream.c (_gpgrt_vfprintf_unlocked, _gpgrt_vfprintf): Add sf
      and sfvalue and adjust all callers.
      (do_print_stream): Ditto.
      
      * tests/t-printf.c (stream_to_string): New.
      (struct sfstate_s): New.
      (string_filter): New.
      (check_fprintf_sf): New.
      (main): Call new test.
      --
      
      The actual reason to implement these functions is to enhance the
      internal logging function with a filter to sanitized strings so that
      control values or other things can be quoted.
      
      Signed-off-by: default avatarWerner Koch <wk@gnupg.org>
      bd8668c1
    • Werner Koch's avatar
      core: Add a limited version of gpgrt_ftruncate. · ffb49b72
      Werner Koch authored
      
      
      * src/gpg-error.h.in (gpgrt_ftruncate, es_ftruncate): New.
      * src/gpg-error.def.in, src/gpg-error.vers: Add gpgrt_ftruncate.
      * src/visibility.c (gpgrt_ftruncate): new.
      * src/gpgrt-int.h (COOKIE_IOCTL_TRUNCATE): New.
      * src/estream.c (func_mem_ioctl): Support new internal IOCTL.
      (_gpgrt_ftruncate): New.
      --
      
      Right now the ftruncate works only on memory streams.  Can easily be
      added to other stream times.
      
      Signed-off-by: default avatarWerner Koch <wk@gnupg.org>
      ffb49b72
  16. 15 Nov, 2018 1 commit
    • Werner Koch's avatar
      core: New API gpgrt_cmp_version · a5d4a4b3
      Werner Koch authored
      
      
      * src/gpg-error.h.in: New API gpgrt_cmp_version.
      * src/visibility.c (gpgrt_cmp_version): New wrapper.
      * src/version.c (parse_version_string): Revamped.
      (do_cmp_version): New.
      (_gpgrt_cmp_version): New.
      (_gpg_error_check_version): Re-implemented using the new func.
      * tests/t-version.c: Include t-common.h.
      (t_gpgrt_cmp_version): New test.
      (main): Run new test.  Change test for new version number to require a
      2 level number.
      --
      
      We have implementations of very similar functions in all out libs.
      Thus it makes sense to provide a generic version.  This version is
      actually derived from the ftp-indexer.c we use for the gnupg
      website (see the gnupg-doc repo).
      
      Signed-off-by: default avatarWerner Koch <wk@gnupg.org>
      a5d4a4b3
  17. 14 Nov, 2018 1 commit
  18. 13 Nov, 2018 2 commits
  19. 07 Nov, 2018 1 commit
  20. 02 Nov, 2018 3 commits
  21. 01 Nov, 2018 2 commits
  22. 31 Oct, 2018 2 commits
  23. 29 Oct, 2018 1 commit
    • NIIBE Yutaka's avatar
      gpgrt-config: Better architecture independent support. · 93d45f7e
      NIIBE Yutaka authored
      
      
      * configure.ac: Don't generate gpgrt-config.
      * src/gpgrt-config: Rename from gpgrt-config.in.
      (--prefix, --exec-prefix, --libdir): Use --libdir to determine
      PKG_CONFIG_LIBDIR.
      * src/Makefile.am (EXTRA_DIST): Remove gpgrt-config.in.
      * src/gpg-error-config-test.sh: Fix for path to gpgrt-config.
      * src/gpg-error.m4: Provide --prefix, --exec-prefix, --libdir
      option from configure.  Don't use CC because we have --libdir.
      Bump version date.
      * src/gpgrt.m4: Likewise.
      
      --
      
      Considering multilib support as well as multiarch support, it is
      better to provide the information for PKG_CONFIG_LIBDIR by --libdir
      directly, instead of CC.
      
      Difficulty is that configure allows variable reference like:
      
          --libdir='${exec_prefix}/i386-linux'
      
      So, it should also support --prefix and --exec_prefix options.
      
      Signed-off-by: NIIBE Yutaka's avatarNIIBE Yutaka <gniibe@fsij.org>
      93d45f7e
  24. 27 Oct, 2018 1 commit
  25. 26 Oct, 2018 1 commit