Loading cmds/keystore/netkeystore.c +8 −5 Original line number Original line Diff line number Diff line Loading @@ -116,10 +116,13 @@ static int parse_strings(char *data, int data_len, int ntokens, ...) static int is_alnum_string(char *s) static int is_alnum_string(char *s) { { char *s0 = s; while (*s != 0) { while (*s != 0) { if (!isalnum(*s++)) return 0; if (!isalnum(*s++)) { LOGE("The string '%s' is not an alphanumeric string\n", s0); return 0; } } } LOGE("The string %s is not an alphanumeric string\n", s); return 1; return 1; } } Loading Loading @@ -159,7 +162,9 @@ static void do_unlock(LPC_MARSHAL *cmd, LPC_MARSHAL *reply) // no argument // no argument static void do_get_state(LPC_MARSHAL *cmd, LPC_MARSHAL *reply) static void do_get_state(LPC_MARSHAL *cmd, LPC_MARSHAL *reply) { { reply->retcode = get_state(); int s = get_state(); if (DBG) LOGD("keystore state = %d\n", s); reply->retcode = s; } } // args of listkeys(): // args of listkeys(): Loading Loading @@ -413,12 +418,10 @@ int server_main(const int argc, const char *argv[]) // read the command, execute and send the result back. // read the command, execute and send the result back. if(read_marshal(s, &cmd)) goto err; if(read_marshal(s, &cmd)) goto err; if (DBG) LOGD("new connection\n"); execute(&cmd, &reply); execute(&cmd, &reply); write_marshal(s, &reply); write_marshal(s, &reply); err: err: memset(&reply, 0, sizeof(LPC_MARSHAL)); memset(&reply, 0, sizeof(LPC_MARSHAL)); if (DBG) LOGD("closing connection\n"); close(s); close(s); } } Loading keystore/java/android/security/ServiceCommand.java +0 −4 Original line number Original line Diff line number Diff line Loading @@ -49,8 +49,6 @@ public class ServiceCommand { public static final int BUFFER_LENGTH = 4096; public static final int BUFFER_LENGTH = 4096; private static final boolean DBG = true; private String mServiceName; private String mServiceName; private String mTag; private String mTag; private InputStream mIn; private InputStream mIn; Loading @@ -61,7 +59,6 @@ public class ServiceCommand { if (mSocket != null) { if (mSocket != null) { return true; return true; } } if (DBG) Log.d(mTag, "connecting..."); try { try { mSocket = new LocalSocket(); mSocket = new LocalSocket(); Loading @@ -80,7 +77,6 @@ public class ServiceCommand { } } private void disconnect() { private void disconnect() { if (DBG) Log.d(mTag,"disconnecting..."); try { try { if (mSocket != null) mSocket.close(); if (mSocket != null) mSocket.close(); } catch (IOException ex) { } } catch (IOException ex) { } Loading Loading
cmds/keystore/netkeystore.c +8 −5 Original line number Original line Diff line number Diff line Loading @@ -116,10 +116,13 @@ static int parse_strings(char *data, int data_len, int ntokens, ...) static int is_alnum_string(char *s) static int is_alnum_string(char *s) { { char *s0 = s; while (*s != 0) { while (*s != 0) { if (!isalnum(*s++)) return 0; if (!isalnum(*s++)) { LOGE("The string '%s' is not an alphanumeric string\n", s0); return 0; } } } LOGE("The string %s is not an alphanumeric string\n", s); return 1; return 1; } } Loading Loading @@ -159,7 +162,9 @@ static void do_unlock(LPC_MARSHAL *cmd, LPC_MARSHAL *reply) // no argument // no argument static void do_get_state(LPC_MARSHAL *cmd, LPC_MARSHAL *reply) static void do_get_state(LPC_MARSHAL *cmd, LPC_MARSHAL *reply) { { reply->retcode = get_state(); int s = get_state(); if (DBG) LOGD("keystore state = %d\n", s); reply->retcode = s; } } // args of listkeys(): // args of listkeys(): Loading Loading @@ -413,12 +418,10 @@ int server_main(const int argc, const char *argv[]) // read the command, execute and send the result back. // read the command, execute and send the result back. if(read_marshal(s, &cmd)) goto err; if(read_marshal(s, &cmd)) goto err; if (DBG) LOGD("new connection\n"); execute(&cmd, &reply); execute(&cmd, &reply); write_marshal(s, &reply); write_marshal(s, &reply); err: err: memset(&reply, 0, sizeof(LPC_MARSHAL)); memset(&reply, 0, sizeof(LPC_MARSHAL)); if (DBG) LOGD("closing connection\n"); close(s); close(s); } } Loading
keystore/java/android/security/ServiceCommand.java +0 −4 Original line number Original line Diff line number Diff line Loading @@ -49,8 +49,6 @@ public class ServiceCommand { public static final int BUFFER_LENGTH = 4096; public static final int BUFFER_LENGTH = 4096; private static final boolean DBG = true; private String mServiceName; private String mServiceName; private String mTag; private String mTag; private InputStream mIn; private InputStream mIn; Loading @@ -61,7 +59,6 @@ public class ServiceCommand { if (mSocket != null) { if (mSocket != null) { return true; return true; } } if (DBG) Log.d(mTag, "connecting..."); try { try { mSocket = new LocalSocket(); mSocket = new LocalSocket(); Loading @@ -80,7 +77,6 @@ public class ServiceCommand { } } private void disconnect() { private void disconnect() { if (DBG) Log.d(mTag,"disconnecting..."); try { try { if (mSocket != null) mSocket.close(); if (mSocket != null) mSocket.close(); } catch (IOException ex) { } } catch (IOException ex) { } Loading