Re: [tor-bugs] #27801 [Core Tor/Tor]: tor_api: CreateConnection() interface

2019-06-17 Thread Tor Bug Tracker & Wiki
#27801: tor_api: CreateConnection() interface
-+--
 Reporter:  sysrqb   |  Owner:  (none)
 Type:  enhancement  | Status:  new
 Priority:  Medium   |  Milestone:  Tor: unspecified
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  040-deferred-201915  |  Actual Points:
Parent ID:  #25510   | Points:
 Reviewer:   |Sponsor:
-+--

Comment (by nickm):

 (sorry for delay, I'll try to review this API this week)

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #27801 [Core Tor/Tor]: tor_api: CreateConnection() interface

2019-06-13 Thread Tor Bug Tracker & Wiki
#27801: tor_api: CreateConnection() interface
-+--
 Reporter:  sysrqb   |  Owner:  (none)
 Type:  enhancement  | Status:  new
 Priority:  Medium   |  Milestone:  Tor: unspecified
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  040-deferred-201915  |  Actual Points:
Parent ID:  #25510   | Points:
 Reviewer:   |Sponsor:
-+--

Comment (by DCNick3):

 I would propose these changes in embedding API:
 {{{

 /* The actual type depends on backend */
 typedef void tor_main_token_t;

 typedef void (*tor_ready_callback_t)(tor_main_token_t*, void*);
 typedef void (*tor_stop_callback_t)(tor_main_token_t*, void*);

 /** Requests resource allocation for tor_api_create_connection() to work
 */
 int tor_main_configuration_enable_create_connection(
 tor_main_configuration_t *cfg, int enable);

 int tor_main_configuration_register_callbacks(
 tor_main_configuration_t *cfg, tor_ready_callback_t ready,
 tor_stop_callback_t stop, void* userdata);

 tor_embedded_socket_t tor_api_create_connection(tor_main_token_t *tok,
 const char *hostname,
 uint16_t port);

 tor_embedded_socket_t tor_main_configuration_setup_control_socket(
   tor_main_configuration_t *cfg);
 }}}

 (`tor_control_socket_t` renamed to `tor_embedded_socket_t`. This breaks
 API, but we can allow usage of `tor_control_socket_t` as deprecated
 behavior or introduce another type of socket for the connection).

 It is safe to run functions taking token only between calling of
 `tor_ready_callback_t` and `tor_stop_callback_t` for this token (Not
 inside stop callback, but possibly inside ready callback). Token would
 implements locking inside, so it would be safe to call token-related
 functions from multiple threads. Stop callback won't be called during
 API's method execution, so there should not be races.

 Internally, `tor_runner` would request socks unix socket allocation and
 use it for connections. When embedding tor directly, call to
 `tor_api_create_connection()` would allocate a new socket pair, add one of
 them to the connection list inside tor in the way similar to transparent
 proxy handling and return another one.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #27801 [Core Tor/Tor]: tor_api: CreateConnection() interface

2019-06-12 Thread Tor Bug Tracker & Wiki
#27801: tor_api: CreateConnection() interface
-+--
 Reporter:  sysrqb   |  Owner:  (none)
 Type:  enhancement  | Status:  new
 Priority:  Medium   |  Milestone:  Tor: unspecified
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  040-deferred-201915  |  Actual Points:
Parent ID:  #25510   | Points:
 Reviewer:   |Sponsor:
-+--

Comment (by nickm):

 The API proposed above should get tweaked some: we don't want to have it
 take a tor_main_configuration_t object, since that is only used for
 setting up the main() function. Instead it should take some kind of token
 or handle to a running Tor instance.

 We'd need to extent the current API to return such a token or handle in a
 way that another thread could use.

 Remember that new APIs need to be implemented both by embedded Tor and
 libtorrunner.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #27801 [Core Tor/Tor]: tor_api: CreateConnection() interface

2019-06-12 Thread Tor Bug Tracker & Wiki
#27801: tor_api: CreateConnection() interface
-+--
 Reporter:  sysrqb   |  Owner:  (none)
 Type:  enhancement  | Status:  new
 Priority:  Medium   |  Milestone:  Tor: unspecified
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  040-deferred-201915  |  Actual Points:
Parent ID:  #25510   | Points:
 Reviewer:   |Sponsor:
-+--

Comment (by DCNick3):

 Internally this can be done even without SOCKS client (the same way as tor
 handles transparent connections, setting address and port in
 `socks_request_t`), but it would not work with `libtorrunner`. Socks
 client may work there, but if we consider wrapping around socks client, it
 would require to know the port to connect to, which may be troublesome.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #27801 [Core Tor/Tor]: tor_api: CreateConnection() interface

2019-01-14 Thread Tor Bug Tracker & Wiki
#27801: tor_api: CreateConnection() interface
--+
 Reporter:  sysrqb|  Owner:  (none)
 Type:  enhancement   | Status:  new
 Priority:  Medium|  Milestone:  Tor: 0.4.0.x-final
Component:  Core Tor/Tor  |Version:
 Severity:  Normal| Resolution:
 Keywords:|  Actual Points:
Parent ID:  #25510| Points:
 Reviewer:|Sponsor:
--+
Changes (by gaba):

 * sponsor:  Sponsor8-can =>


--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #27801 [Core Tor/Tor]: tor_api: CreateConnection() interface

2018-09-20 Thread Tor Bug Tracker & Wiki
#27801: tor_api: CreateConnection() interface
--+
 Reporter:  sysrqb|  Owner:  (none)
 Type:  enhancement   | Status:  new
 Priority:  Medium|  Milestone:  Tor: 0.3.6.x-final
Component:  Core Tor/Tor  |Version:
 Severity:  Normal| Resolution:
 Keywords:|  Actual Points:
Parent ID:  #25510| Points:
 Reviewer:|Sponsor:
--+
Changes (by nickm):

 * milestone:  Tor: unspecified => Tor: 0.3.6.x-final


Comment:

 adding for consideration to 0.3.6

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

[tor-bugs] #27801 [Core Tor/Tor]: tor_api: CreateConnection() interface

2018-09-20 Thread Tor Bug Tracker & Wiki
#27801: tor_api: CreateConnection() interface
--+--
 Reporter:  sysrqb|  Owner:  (none)
 Type:  enhancement   | Status:  new
 Priority:  Medium|  Milestone:  Tor: unspecified
Component:  Core Tor/Tor  |Version:
 Severity:  Normal|   Keywords:
Actual Points:|  Parent ID:  #25510
   Points:|   Reviewer:
  Sponsor:|
--+--
 In ticket:26653#comment:8 I mentioned it may be nice if there was an
 easier way of requesting a new connection other than via a SOCKS
 connection. Adding an interface for creating a connection when roughly the
 same parameters Tor receives from the SOCKS handshake. In fact, I wonder
 if providing this as a wrapper around a default SOCKS client
 implementation may be an easy way of doing this.

 Something like:

 {{{
 /**
  * Tells Tor to open a socket for a client connection to the requested
  * destination.  Return the socket.
  */
 SOCKS_SOCKET tor_main_create_connection(tor_main_configuration_t *cfg,
 const char * hostname,
 uint16_t port,
 const char * stream_isolation);
 }}}

 Note, we don't need this for Tor Browser for Android. This is simply a
 more general idea.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs