[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: Tor on Android



Nice stuff!  A few comments.

On Sun, Dec 28, 2008 at 03:55:21PM -0800, Adam Langley wrote:
[...]
> 9) Build libevent
> 
> Download libevent
> 
> % export CC="agcc"
> % ./configure --host=arm-eabi
> 
> I had to manually disable select support in config.h and remove
> select.c (and everything else to do with select) from the Makefile
> because bionic seems to be missing fd_mask structures. I also didn't
> bother building anything in /test.
> 
> Hopefully you end up with libevent.a (probably in .libs). Copy it to
> mydroid/out/target/product/generic/obj/lib.

Hm.  Libevent should be made to detect this.  Ordinarily, fd_mask is
defined in sys/select.h or something it includes.  Can you grep around
a little in the Android headers to make sure it's not defined
anywhere?  If it isn't, we can probably define it to long without
hurting anything, so long as we define NFDBITS to match.

> 11) Build tor
> 
> I used 0.2.0.32
> 
> Firstly, Android doesn't include deprecated OpenSSL functions, so add
> a wrapper to src/common/crypto.c:

I've changed trunk to use RSA_generate_key_ex when we have it, and to
only use RSA_generate_key on OpenSSL 0.9.7, which doesn't have
RSA_generate_key_ex().

This way, we won't need to copy code from OpenSSL and make our license
even more complicated. ;)

(A reminder to folks: when you paste code that you didn't write,
please mention the fact?  Thanks!)

 [...]
> -#ifndef __LOG_H
> +#ifndef __TOR_LOG_H

I noticed in trunk that the header files didn't use a consistent macro
naming scheme, so I've switched them all to use the "_TOR_FILENAME_H"
convention, which seemed least likely to collide with anything.

> --- tor-0.2.0.32/src/or/buffers.c   2008-11-20 14:14:26.000000000 -0800
> +++ tor-0.2.0.32-agl/src/or/buffers.c  2008-12-28 12:03:08.000000000 -0800
> @@ -14,6 +14,7 @@
>   * memory, file descriptors, or TLS connections.
>   **/
>  #define BUFFERS_PRIVATE
> +#include "src/common/log.h"
>  #include "or.h"

Hm.  Usually if system headers are getting searched before our
headers, that's a sign that the C compiler is acting weird.  Can you
investigate this one a little more?  As you can tell, I'd like 0.2.1.x
to build out-of-the-box for Android, especially given how little code
changing seems to be required.


Yrs,
-- 
Nick Mathewson