diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-05-05 19:54:55 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2012-05-05 19:54:55 +0200 |
commit | 581062c8b9629a5d52b555d13b573b12394fafda (patch) | |
tree | 64908b1dcbf6c1515d73cbd4302faf0c6eb18572 /openvpn/src | |
parent | dba28ea4eacf852a245fc36fb5171d7702f78cc1 (diff) |
working protect fd through management
Diffstat (limited to 'openvpn/src')
-rw-r--r-- | openvpn/src/openvpn/manage.c | 2 | ||||
-rw-r--r-- | openvpn/src/openvpn/misc.c | 2 | ||||
-rw-r--r-- | openvpn/src/openvpn/socket.c | 26 |
3 files changed, 8 insertions, 22 deletions
diff --git a/openvpn/src/openvpn/manage.c b/openvpn/src/openvpn/manage.c index b9807551..f28278f9 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 2ded9bfc..3658c348 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 e794c113..524343b5 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 } |