summaryrefslogtreecommitdiff
path: root/openvpn
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-05-05 19:54:55 +0200
committerArne Schwabe <arne@rfc2549.org>2012-05-05 19:54:55 +0200
commitec7e6b920257e52a24f9fc56150c05f3bbc6da7d (patch)
tree64908b1dcbf6c1515d73cbd4302faf0c6eb18572 /openvpn
parent4a7488e0b5dc2a0069d2a4c9b461631016a95d45 (diff)
working protect fd through management
Diffstat (limited to 'openvpn')
-rw-r--r--openvpn/src/openvpn/manage.c2
-rw-r--r--openvpn/src/openvpn/misc.c2
-rw-r--r--openvpn/src/openvpn/socket.c26
3 files changed, 8 insertions, 22 deletions
diff --git a/openvpn/src/openvpn/manage.c b/openvpn/src/openvpn/manage.c
index b980755..f28278f 100644
--- a/openvpn/src/openvpn/manage.c
+++ b/openvpn/src/openvpn/manage.c
@@ -2894,7 +2894,7 @@ management_event_loop_n_seconds (struct management *man, int sec)
* Get a username/password from management channel in standalone mode.
*/
bool
-management_query_user_pass (struct management *man,
+ management_query_user_pass (struct management *man,
struct user_pass *up,
const char *type,
const unsigned int flags,
diff --git a/openvpn/src/openvpn/misc.c b/openvpn/src/openvpn/misc.c
index 2ded9bf..3658c34 100644
--- a/openvpn/src/openvpn/misc.c
+++ b/openvpn/src/openvpn/misc.c
@@ -1176,7 +1176,7 @@ get_user_pass_cr (struct user_pass *up,
if (ac)
{
char *response = (char *) gc_malloc (USER_PASS_LEN, false, &gc);
- struct buffer packed_resp;
+ struct buffer packed_resp;
buf_set_write (&packed_resp, (uint8_t*)up->password, USER_PASS_LEN);
msg (M_INFO|M_NOPREFIX, "CHALLENGE: %s", ac->challenge_text);
diff --git a/openvpn/src/openvpn/socket.c b/openvpn/src/openvpn/socket.c
index e794c11..524343b 100644
--- a/openvpn/src/openvpn/socket.c
+++ b/openvpn/src/openvpn/socket.c
@@ -865,12 +865,7 @@ create_socket_tcp (void)
}
#endif
-#ifdef TARGET_ANDROID
- /* Protects the socket from being routed via VPN */
- android_protect_socket(sd);
-#endif
-
- return sd;
+ return sd;
}
static socket_descriptor_t
@@ -898,11 +893,6 @@ create_socket_udp (const unsigned int flags)
}
#endif
-#ifdef TARGET_ANDROID
- /* Protects the socket from being routed via VPN */
- android_protect_socket(sd);
-#endif
-
return sd;
}
@@ -922,10 +912,6 @@ create_socket_udp6 (const unsigned int flags)
msg(M_SOCKERR, "UDP: failed setsockopt for IPV6_RECVPKTINFO");
}
#endif
-#ifdef TARGET_ANDROID
- /* Protects the socket from being routed via VPN */
- android_protect_socket(sd);
-#endif
return sd;
}
@@ -945,10 +931,6 @@ create_socket_tcp6 (void)
(void *) &on, sizeof (on)) < 0)
msg (M_SOCKERR, "TCP: Cannot setsockopt SO_REUSEADDR on TCP6 socket");
}
-#ifdef TARGET_ANDROID
- /* Protects the socket from being routed via VPN */
- android_protect_socket(sd);
-#endif
return sd;
}
@@ -987,8 +969,12 @@ create_socket (struct link_socket *sock)
ASSERT (0);
}
#ifdef TARGET_ANDROID
+ struct user_pass up;
+ strcpy(up.username ,__func__);
management->connection.fdtosend = sock->sd;
- management_auth_token (management,"'PROTECT-FD'");
+ management_query_user_pass(management, &up , "PROTECTFD", GET_USER_PASS_NEED_OK,(void*) 0);
+
+
#endif
}