From 91c521ec34fbc9291a0c2d4353bcd41ecb27a191 Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Sun, 9 Apr 2017 16:37:31 +0300 Subject: [PATCH] Delete unused get_subnet method and add TODO for interfacing with keychain --- OpenVPN Adapter/OpenVPNClient.mm | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/OpenVPN Adapter/OpenVPNClient.mm b/OpenVPN Adapter/OpenVPNClient.mm index 16b6dc6..ea94a07 100644 --- a/OpenVPN Adapter/OpenVPNClient.mm +++ b/OpenVPN Adapter/OpenVPNClient.mm @@ -107,6 +107,7 @@ bool OpenVPNClient::socket_protect(int socket) { return true; } +// TODO: Provide interfacing with an OS-layer Keychain void OpenVPNClient::external_pki_cert_request(ClientAPI::ExternalPKICertRequest& certreq) { } void OpenVPNClient::external_pki_sign_request(ClientAPI::ExternalPKISignRequest& signreq) { } @@ -121,17 +122,3 @@ void OpenVPNClient::event(const ClientAPI::Event& ev) { void OpenVPNClient::log(const ClientAPI::LogInfo& log) { [(__bridge OpenVPNAdapter *)adapter handleLog:&log]; } - -std::string OpenVPNClient::get_subnet(int prefix_length) { - uint32_t bitmask = UINT_MAX << (sizeof(uint32_t) * 8 - prefix_length); - - uint8_t first = (bitmask >> 24) & 0xFF; - uint8_t second = (bitmask >> 16) & 0xFF; - uint8_t third = (bitmask >> 8) & 0xFF; - uint8_t fourth = bitmask & 0xFF; - - std::stringstream stream; - stream << std::to_string(first) << "." << std::to_string(second) << "." << std::to_string(third) << "." << std::to_string(fourth); - - return stream.str(); -}