[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] svnserve-ssl : Use svn_stream_t for connections, plus reorganizing SSL

From: Sigfred Håversen <bsdlist_at_mumak.com>
Date: 2004-11-09 18:08:02 CET

This is a patch to branches/svnserve-ssl. Please review and comment.

There are two big changes in this patch. The svn_ra_svn_conn_t now
has svn_stream_t members that replaces the apr_socket_t, apr_file_t
and SSL related members. Various functions in subversion/libsvn_ra_svn
has been changed to use those streams.

The other change is that OpenSSL code in libsvn_ra_svn
has been moved to it's own private files : libsvn_ra_svn/ra_svn_ssl.h
and libsvn_ra_svn/ssl.c.

The patch passes the "make check", "make svnsshcheck" and "make svncheck".
For the svncheck, svnserve was run as a stand-alone daemon (with and
without SSL capability) and started from inetd.

/Sigfred

* subversion/include/svn_ra_svn.h
  (svn_ra_svn_ssl_accept): Removed declaration and corresponding comment.

* subversion/include/svn_io.h
  (typedef svn_timeout_fn_t, typedef svn_data_pending_fn_t): New pointer
   function prototypes.
  (svn_stream_set_timeout, svn_stream_set_data_pending, svn_stream_timeout,
   svn_stream_data_pending): New function prototypes.
  
* subversion/libsvn_subr/stream.c
  (struct svn_stream_t): Add "timeout_fn" and "data_pending_fn" members.
  (svn_stream_create): Initialize new svn_stream_t members to NULL;
  (svn_stream_set_timeout, svn_stream_set_data_pending, svn_stream_timeout,
   svn_stream_data_pending): New functions.

* subversion/libsvn_ra_svn/client.c
  Remove #include "ra_svn.h"
  Remove #include <openssl/x509v3.h>
  Add #include "ra_svn_ssl.h"
  (struct ra_svn_session_baton_t): Change type of member "ssl_ctx" to void*.
  (asn1time_to_string, match_hostname, verify_hostname, fill_server_cert_info,
   init_ssl_ctx, destroy_ssl_ctx): Removed functions.
  (do_ssl_auth): Call the new svn_ra_svn__fill_server_cert_info function
   instead of the removed one.
  (make_tunnel): Do not set removed member "proc" in conn.
  (ra_svn_open): Do not register cleanup function for SSL_CTX. Call the
   new SSL functions instead of the removed ones.

* subversion/libsvn_ra_svn/
  (ra_svn_ssl.h, ssl.c): New files.

* subversion/libsvn_ra_svn/ra_svn_ssl.h
  Add #include "svn_auth.h"
  Add #include "ra_svn.h"
  (svn_ra_svn__fill_server_cert_info, svn_ra_svn__setup_ssl_conn,
   svn_ra_svn__ssl_accept, svn_ra_svn__ssl_connect,
   svn_ra_svn__init_ssl_ctx): New functions that originally was in
   other files, or adapted from such functions.

* subversion/libsvn_ra_svn/ssl.c
  (struct ssl_conn_t): New struct containing a connection's SSL setup.
  (apps_ssl_info_callback): New function.
  (network_biopair_interop, do_ssl_operation, asn1time_to_string,
   match_hostname, verify_hostname, svn_ra_svn__fill_server_cert_info,
   cleanup_ssl, svn_ra_svn__setup_ssl_conn, svn_ra_svn__ssl_accept,
   svn_ra_svn__ssl_connect, destroy_ssl_ctx, svn_ra_svn__init_ssl_ctx): New
   functions adapted from functions that was removed in other files. Changed
   to use the new stream members in connection where needed.
  (ssl_timeout_cb, ssl_data_pending_cb, ssl_read_cb, ssl_write_cb): New
   functions.
  
* subversion/libsvn_ra_svn/marshal.c
  Add #include "svn_io.h"
  Add #include "ra_svn_ssl.h"
  Remove #include "ra_svn.h"
  (do_ssl_operation): Removed forward declaration, and the function.
  (struct file_conn_t): New struct.
  (sock_timeout_cb, file_timeout_cb, sock_data_pending_cb, sock_read_cb,
   file_read_cb, sock_write_cb, file_write_cb, setup_sock_conn,
   setup_file_conn): New functions.
  (svn_ra_svn_create_conn): Don't initialize removed members from conn.
   Initialize new stream members in conn by calling setup_sock_conn or
   calling setup_file_conn.
  (svn_ra_svn__set_block_handler, svn_ra_svn__input_waiting, writebuf_output,
   readbuf_input): Use stream functions instead of apr_socket_t/apr_file_t
   calls.
  (writebuf_output_ssl, readbuf_input_ssl, network_biopair_interop,
   do_ssl_operation, cleanup_ssl, svn_ra_svn_ssl_connect): Removed functions.
  (svn_ra_svn_ssl_init): Call svn_ra_svn__setup_ssl_conn.
  (svn_ra_svn_ssl_accept): Call svn_ra_svn__ssl_accept.

* subversion/libsvn_ra_svn/ra_svn.h
  Remove #include <openssl/ssl.h>
  Remove #include <openssl/bio.h>
  (struct svn_ra_svn_conn_st): Removed "sock", "in_file", "out_file", "proc",
   "use_ssl", "ssl", "inernal_bio", "network_bio" members. Added "in_stream",
   "out"stream", "user_data_baton" members.
  (struct svn_ra_svn__sock_conn_t): New struct.
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Tue Nov 9 18:08:31 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.