From 5e276bf69c698f15e9a293518697f3aaf9ecf3e9 Mon Sep 17 00:00:00 2001 From: Balint Kovacs Date: Thu, 28 Apr 2011 15:40:17 +0200 Subject: [PATCH] Added a bunch of TODO's to the appropriate files Signed-off-by: Balint Kovacs --- src/hu/blint/ssldroid/SSLDroid.java | 1 + src/hu/blint/ssldroid/SSLDroidTunnelDetails.java | 3 +++ src/hu/blint/ssldroid/TcpProxyServerThread.java | 10 +++++----- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/hu/blint/ssldroid/SSLDroid.java b/src/hu/blint/ssldroid/SSLDroid.java index 7c268a1..541e35a 100644 --- a/src/hu/blint/ssldroid/SSLDroid.java +++ b/src/hu/blint/ssldroid/SSLDroid.java @@ -76,6 +76,7 @@ public class SSLDroid extends Service { @Override public void onDestroy() { + super.onDestroy(); dbHelper.close(); try { for (TcpProxy proxy : tp) { diff --git a/src/hu/blint/ssldroid/SSLDroidTunnelDetails.java b/src/hu/blint/ssldroid/SSLDroidTunnelDetails.java index cabf843..3d91923 100644 --- a/src/hu/blint/ssldroid/SSLDroidTunnelDetails.java +++ b/src/hu/blint/ssldroid/SSLDroidTunnelDetails.java @@ -30,6 +30,9 @@ import android.widget.EditText; import android.widget.Toast; import hu.blint.ssldroid.db.SSLDroidDbAdapter; +//TODO: cacert + crl should be configurable for the tunnel +//TODO: test connection button + public class SSLDroidTunnelDetails extends Activity { private EditText name; private EditText localport; diff --git a/src/hu/blint/ssldroid/TcpProxyServerThread.java b/src/hu/blint/ssldroid/TcpProxyServerThread.java index b6e56ff..2a50041 100644 --- a/src/hu/blint/ssldroid/TcpProxyServerThread.java +++ b/src/hu/blint/ssldroid/TcpProxyServerThread.java @@ -47,6 +47,7 @@ public class TcpProxyServerThread extends Thread { // Create a trust manager that does not validate certificate chains // TODO: handle this somehow properly (popup if cert is untrusted?) + // TODO: cacert + crl should be configurable TrustManager[] trustAllCerts = new TrustManager[]{ new X509TrustManager() { public java.security.cert.X509Certificate[] getAcceptedIssuers() { @@ -154,7 +155,7 @@ public class TcpProxyServerThread extends Thread { public void run() { while (true) { try { - + //TODO: close client sockets if no data network is available Thread fromBrowserToServer = null; Thread fromServerToBrowser = null; @@ -177,7 +178,6 @@ public class TcpProxyServerThread extends Thread { } Socket st = null; - try { st = (SSLSocket) getSocketFactory(this.keyFile, this.keyPass, this.sessionid).createSocket(this.tunnelHost, this.tunnelPort); ((SSLSocket) st).startHandshake(); @@ -190,7 +190,7 @@ public class TcpProxyServerThread extends Thread { return; } - if (sc == null){ + if (sc == null || st == null){ Log.d("SSLDroid", tunnelName+"/"+sessionid+": Trying socket operation on a null socket, returning"); return; } @@ -208,8 +208,8 @@ public class TcpProxyServerThread extends Thread { fromBrowserToServer.start(); fromServerToBrowser.start(); - } catch (Exception ee) { - Log.d("SSLDroid", tunnelName+"/"+sessionid+": Ouch: " + ee.getMessage()); + } catch (IOException ee) { + Log.d("SSLDroid", tunnelName+"/"+sessionid+": Ouch: " + ee.toString()); } } }