1. 09 Apr, 2012 1 commit
    • Ted Zlatanov's avatar
      Limit number of GnuTLS handshakes per connection. · a18ecafa
      Ted Zlatanov authored
      * gnutls.c (gnutls_log_function2i): Convenience log function.
      (emacs_gnutls_read): Use new log functions,
      `gnutls_handshakes_tried' process member, and
      `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
      attempts per process (connection).
      
      * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.  Add
      convenience `GNUTLS_LOG2i' macro.
      
      * process.c (make_process):
      * process.h: Add integer `gnutls_handshakes_tried' member to
      process struct.
      a18ecafa
  2. 13 Feb, 2012 2 commits
  3. 11 Feb, 2012 1 commit
  4. 29 Jan, 2012 1 commit
    • Glenn Morris's avatar
      Minor NEWS cleanup, mainly for "Installation Changes" section. · 31fd3586
      Glenn Morris authored
      * etc/NEWS: Reorder items.
      Standardize new --with-libfoo type configure options.
      Don't say precisely which library versions are needed - it tends to
      change and people who care can look at configure.
      Move new Hebrew tutorial entry to "Internationalization changes" section.
      Small tidy up for imagemagick and gnutls entries.
      
      * src/gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
      31fd3586
  5. 05 Jan, 2012 1 commit
  6. 01 Jan, 2012 1 commit
    • Eli Zaretskii's avatar
      Allow Emacs on w32 to build against and work with GnuTLS 3.x. · 651e947e
      Eli Zaretskii authored
       src/gnutls.c (init_gnutls_functions): Load gnutls_check_version.
       Load gnutls_transport_set_lowat only if GnuTLS version is below
       2.11.1.
       (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
       GnuTLS versions below 2.11.1.
       lisp/term/w32-win.el (dynamic-library-alist) <gnutls>: Load
       libgnutls-28.dll, from GnuTLS version 3.x, in preference to
       libgnutls-26.dll.
      651e947e
  7. 27 Oct, 2011 2 commits
    • Chong Yidong's avatar
      More gnutls memory fixes. · 435c1d67
      Chong Yidong authored
      * src/gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
      non-NULL, regardless of GNUTLS_INITSTAGE.
      (Fgnutls_boot): Cleanups.  Call emacs_gnutls_deinit if we signal
      an error.  Set process slots as soon as we allocate them.
      
      * src/gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
      
      * src/process.c (make_process): Set gnutls_state to NULL.
      435c1d67
    • Chong Yidong's avatar
      Fix a memory leak in the built-in GnuTLS support. · 9c6c6f49
      Chong Yidong authored
      * src/gnutls.c (emacs_gnutls_deinit): New function.  Deallocate
      credentials structures as well as calling gnutls_deinit.
      (Fgnutls_deinit, Fgnutls_boot): Use it.
      
      * src/process.c (make_process): Initialize GnuTLS credentials to NULL.
      (deactivate_process): Call emacs_gnutls_deinit.
      9c6c6f49
  8. 14 Aug, 2011 2 commits
    • Andreas Schwab's avatar
      Follow variable naming convention · a3720aa2
      Andreas Schwab authored
      * src/gnutls.c (QCgnutls_bootprop_priority)
      (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
      (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
      (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
      (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
      (QCgnutls_bootprop_verify_hostname_error)
      (QCgnutls_bootprop_callbacks_verify): Rename from
      Qgnutls_bootprop_..., all uses changed.
      
      * src/xfaces.c (QCignore_defface): Rename from Qignore_defface, all
      uses changed.
      a3720aa2
    • Andreas Schwab's avatar
      Whitespace cleanup · b5f03016
      Andreas Schwab authored
      b5f03016
  9. 27 Jul, 2011 1 commit
  10. 18 Jul, 2011 1 commit
  11. 16 Jul, 2011 1 commit
  12. 15 Jul, 2011 1 commit
  13. 13 Jul, 2011 1 commit
  14. 05 Jul, 2011 1 commit
  15. 04 Jul, 2011 1 commit
  16. 28 Jun, 2011 1 commit
  17. 24 Jun, 2011 2 commits
  18. 30 May, 2011 1 commit
    • Paul Eggert's avatar
      * gnutls.c: Use Emacs's memory allocators. · 9cf9f756
      Paul Eggert authored
      Without this change, the gnutls library would invoke malloc etc.
      directly, which causes problems on non-SYNC_INPUT hosts, and which
      runs afoul of improving memory_full behavior.
      (fn_gnutls_global_set_mem_functions): New macro or function pointer.
      (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
      xfree instead of the default malloc, realloc, free.
      (Fgnutls_boot): No need to check for memory allocation failure,
      since xmalloc does that for us.
      9cf9f756
  19. 23 May, 2011 1 commit
    • Paul Eggert's avatar
      * gnutls.c: Remove unused macros. · 7400048f
      Paul Eggert authored
      (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
      (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
      Remove macros that are defined and never used.
      Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
      7400048f
  20. 06 May, 2011 1 commit
  21. 05 May, 2011 2 commits
  22. 04 May, 2011 3 commits
    • Juanma Barranquero's avatar
      src/gnutls.c: Remove unused parameter `fildes'. · e968f4f3
      Juanma Barranquero authored
      * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
      * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
        Remove unused parameter `fildes'.
      * process.c (read_process_output, send_process): Don't pass it.
      e968f4f3
    • Juanma Barranquero's avatar
      Implement dynamic loading of GnuTLS on Windows. · 0898ca10
      Juanma Barranquero authored
      * lisp/term/w32-win.el (dynamic-library-alist): Add `gnutls'.
      
      * nt/INSTALL: Clarify GnuTLS support.
      
      * src/callproc.c, src/emacs.c: Include lisp.h before src/w32.h, not after.
      
      * src/gnutls.c (Qgnutls_dll): Define.
        (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
        (gnutls_*): Declare function pointers.
        (init_gnutls_functions): New function to initialize function pointers.
        (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
        (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
        (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
        Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
        (emacs_gnutls_write, emacs_gnutls_read)
        (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
        (Fgnutls_available_p): New function.
        (Fgnutls_boot): Call Fgnutls_available_p.  Use function pointers.
        (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
        (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
      
      * src/gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
        (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
        (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
        Declare.
      
      * src/w32.c (QCloaded_from, Vlibrary_cache): Define.
        (w32_delayed_load): Move from image.c.  When loading a library, record
        its filename in the :loaded-from property of the library id.
        (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
        Initialize and staticpro them.
        (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
      
      * src/image.c: Include w32.h.
        (Vimage_type_cache): Delete.
        (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
        (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
        (w32_delayed_load): Move to w32.c.
      
      * src/process.c: Include lisp.h before src/w32.h, not after.
        (wait_reading_process_output): Call emacs_gnutls_record_check_pending
        instead of gnutls_record_check_pending.
      
      * src/w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
      0898ca10
    • Ted Zlatanov's avatar
      Support :keylist and :crlfiles options to `gnutls-boot' and use them. · ff4de4aa
      Ted Zlatanov authored
      * src/gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
      instead of :keyfiles.  Give GnuTLS the keylist and the CRL lists
      as passed in.
      ff4de4aa
  23. 02 May, 2011 1 commit
  24. 26 Apr, 2011 6 commits
  25. 25 Apr, 2011 2 commits
    • Eli Zaretskii's avatar
      Avoid compilation warnings in gnutls.c on 64-bit hosts. · fb11d64d
      Eli Zaretskii authored
       src/gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
       "cast to pointer from integer of different size".
      fb11d64d
    • Ted Zlatanov's avatar
      Add GnuTLS support for W32 and certificate and hostname verification in GnuTLS. · e061a11b
      Ted Zlatanov authored
      * src/gnutls.c: Renamed global_initialized to
      gnutls_global_initialized.  Added internals for the
      :verify-hostname-error, :verify-error, and :verify-flags
      parameters of `gnutls-boot' and documented those parameters in the
      docstring.  Start callback support.
      (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
      unless a fatal error occured. Call gnutls_alert_send_appropriate
      on error. Return error code.
      (emacs_gnutls_write): Call emacs_gnutls_handle_error.
      (emacs_gnutls_read): Likewise.
      (Fgnutls_boot): Return handshake error code.
      (emacs_gnutls_handle_error): New function.
      (wsaerror_to_errno): Likewise.
      
      * src/gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
      callbacks stage.
      
      * src/w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
      (emacs_gnutls_push): Likewise.
      
      * src/w32.h (emacs_gnutls_pull): Add prototype.
      (emacs_gnutls_push): Likewise.
      e061a11b
  26. 19 Apr, 2011 1 commit
  27. 16 Apr, 2011 1 commit