android: Add flag to suppress sending certificate requests
This commit is contained in:
@@ -30,6 +30,7 @@ public class VpnProfile implements Cloneable
|
|||||||
/* While storing this as EnumSet would be nicer this simplifies storing it in a database */
|
/* While storing this as EnumSet would be nicer this simplifies storing it in a database */
|
||||||
public static final int SPLIT_TUNNELING_BLOCK_IPV4 = 1;
|
public static final int SPLIT_TUNNELING_BLOCK_IPV4 = 1;
|
||||||
public static final int SPLIT_TUNNELING_BLOCK_IPV6 = 2;
|
public static final int SPLIT_TUNNELING_BLOCK_IPV6 = 2;
|
||||||
|
public static final int FLAGS_SUPPRESS_CERT_REQS = 1;
|
||||||
|
|
||||||
private String mName, mGateway, mUsername, mPassword, mCertificate, mUserCertificate;
|
private String mName, mGateway, mUsername, mPassword, mCertificate, mUserCertificate;
|
||||||
private String mRemoteId, mLocalId, mExcludedSubnets, mIncludedSubnets, mSelectedApps;
|
private String mRemoteId, mLocalId, mExcludedSubnets, mIncludedSubnets, mSelectedApps;
|
||||||
|
|||||||
+1
@@ -258,6 +258,7 @@ public class CharonVpnService extends VpnService implements Runnable, VpnStateSe
|
|||||||
writer.setValue("connection.password", mCurrentProfile.getPassword());
|
writer.setValue("connection.password", mCurrentProfile.getPassword());
|
||||||
writer.setValue("connection.local_id", mCurrentProfile.getLocalId());
|
writer.setValue("connection.local_id", mCurrentProfile.getLocalId());
|
||||||
writer.setValue("connection.remote_id", mCurrentProfile.getRemoteId());
|
writer.setValue("connection.remote_id", mCurrentProfile.getRemoteId());
|
||||||
|
writer.setValue("connection.certreq", (mCurrentProfile.getFlags() & VpnProfile.FLAGS_SUPPRESS_CERT_REQS) == 0);
|
||||||
initiate(writer.serialize());
|
initiate(writer.serialize());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -737,11 +737,14 @@ static job_requeue_t initiate(private_android_service_t *this)
|
|||||||
};
|
};
|
||||||
char *type, *server, *remote_id;
|
char *type, *server, *remote_id;
|
||||||
int port;
|
int port;
|
||||||
|
bool certreq;
|
||||||
|
|
||||||
server = this->settings->get_str(this->settings, "connection.server", NULL);
|
server = this->settings->get_str(this->settings, "connection.server", NULL);
|
||||||
port = this->settings->get_int(this->settings, "connection.port",
|
port = this->settings->get_int(this->settings, "connection.port",
|
||||||
IKEV2_UDP_PORT);
|
IKEV2_UDP_PORT);
|
||||||
ike_cfg = ike_cfg_create(IKEV2, TRUE, TRUE, "0.0.0.0",
|
certreq = this->settings->get_bool(this->settings, "connection.certreq",
|
||||||
|
TRUE);
|
||||||
|
ike_cfg = ike_cfg_create(IKEV2, certreq, TRUE, "0.0.0.0",
|
||||||
charon->socket->get_port(charon->socket, FALSE),
|
charon->socket->get_port(charon->socket, FALSE),
|
||||||
server, port, FRAGMENTATION_YES, 0);
|
server, port, FRAGMENTATION_YES, 0);
|
||||||
ike_cfg->add_proposal(ike_cfg, proposal_create_default(PROTO_IKE));
|
ike_cfg->add_proposal(ike_cfg, proposal_create_default(PROTO_IKE));
|
||||||
|
|||||||
Reference in New Issue
Block a user