1. 05 May, 2011 1 commit
  2. 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
  3. 02 May, 2011 1 commit
  4. 26 Apr, 2011 6 commits
  5. 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
  6. 19 Apr, 2011 1 commit
  7. 16 Apr, 2011 1 commit
  8. 15 Apr, 2011 1 commit
  9. 13 Apr, 2011 1 commit
    • Paul Eggert's avatar
      emacs_write: Return size_t, not ssize_t, to avoid overflow issues. · 273a5f82
      Paul Eggert authored
      * gnutls.c, gnutls.h (emacs_gnutls_write): Return size_t, not ssize_t.
      * sysdep.c, lisp.h (emacs_write): Likewise.
      Without the above change, emacs_gnutls_write and emacs_write had
      undefined behavior and would typically mistakenly report an error
      when writing a buffer whose size exceeds SSIZE_MAX.
      (emacs_read, emacs_write): Remove check for negative size, as the
      Emacs source code has been audited now.
      (emacs_write): Adjust to new signature, making the code look more
      like that of emacs_gnutls_write.
      * process.c (send_process): Adjust to the new signatures of
      emacs_write and emacs_gnutls_write.  Do not attempt to store
      a byte offset into an 'int'; it might overflow.
      273a5f82
  10. 10 Apr, 2011 1 commit
    • Jim Meyering's avatar
      use ssize_t and size_t for read- and write-like emacs_gnutls_* functions · 368f4090
      Jim Meyering authored
      * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
      return ssize_t not "int", and use size_t as the buffer length.
      (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
      * gnutls.h: Update declarations.
      * process.c (read_process_output): Use ssize_t, to match.
      (send_process): Likewise.
      368f4090
  11. 25 Jan, 2011 1 commit
  12. 23 Jan, 2011 1 commit
  13. 15 Jan, 2011 1 commit
  14. 18 Oct, 2010 1 commit
  15. 10 Oct, 2010 1 commit
  16. 09 Oct, 2010 2 commits
  17. 03 Oct, 2010 3 commits
  18. 29 Sep, 2010 3 commits
  19. 28 Sep, 2010 1 commit
  20. 27 Sep, 2010 3 commits
  21. 26 Sep, 2010 1 commit
    • Ted Zlatanov's avatar
      Set up GnuTLS support. · 8af55556
      Ted Zlatanov authored
      * configure.in: Set up GnuTLS.
      
      * lisp/net/gnutls.el: GnuTLS glue code to set up a connection.
      
      * src/Makefile.in (LIBGNUTLS_LIBS, LIBGNUTLS_CFLAGS, ALL_CFLAGS)
      (obj, LIBES): Set up GnuTLS support.
      
      * src/config.in: Set up GnuTLS support.
      
      * src/emacs.c: Set up GnuTLS support and call syms_of_gnutls.
      
      * src/gnutls.c: The source code for GnuTLS support in Emacs.
      
      * src/gnutls.h: The GnuTLS glue for Emacs, macros and enums.
      
      * src/process.c (make_process, Fstart_process)
      (read_process_output, send_process): Set up GnuTLS support for
      process input/output file descriptors.
      
      * src/process.h: Set up GnuTLS support.
      8af55556