eap-identity eap-mschapv2 eap-md5 eap-gtc
ifneq ($(strongswan_USE_BYOD),)
-strongswan_CHARON_PLUGINS += eap-ttls eap-tnc tnc-imc tnc-tnccs tnccs-20
+strongswan_BYOD_PLUGINS := eap-ttls eap-tnc tnc-imc tnc-tnccs tnccs-20
endif
-strongswan_PLUGINS := $(strongswan_CHARON_PLUGINS)
+strongswan_PLUGINS := $(strongswan_CHARON_PLUGINS) \
+ $(strongswan_BYOD_PLUGINS)
include $(LOCAL_PATH)/strongswan/Android.common.mk
/**
* Initialize the charonservice object
*/
-static void charonservice_init(JNIEnv *env, jobject service, jobject builder)
+static void charonservice_init(JNIEnv *env, jobject service, jobject builder,
+ jboolean byod)
{
private_charonservice_t *this;
static plugin_feature_t features[] = {
countof(features), TRUE);
#ifdef USE_BYOD
+ if (byod)
{
plugin_feature_t byod_features[] = {
PLUGIN_CALLBACK(imc_android_register, this->vpn_service),
* Initialize charon and the libraries via JNI
*/
JNI_METHOD(CharonVpnService, initializeCharon, void,
- jobject builder, jstring jlogfile)
+ jobject builder, jstring jlogfile, jboolean byod)
{
struct sigaction action;
struct utsname utsname;
- char *logfile;
+ char *logfile, *plugins;
/* logging for library during initialization, as we have no bus yet */
dbg = dbg_android;
charon->load_loggers(charon, NULL, FALSE);
- charonservice_init(env, this, builder);
+ charonservice_init(env, this, builder, byod);
if (uname(&utsname) != 0)
{
DBG1(DBG_DMN, "Starting IKE charon daemon (strongSwan "VERSION", %s %s, %s)",
utsname.sysname, utsname.release, utsname.machine);
- if (!charon->initialize(charon, PLUGINS))
+#ifdef PLUGINS_BYOD
+ if (byod)
+ {
+ plugins = PLUGINS " " PLUGINS_BYOD;
+ }
+ else
+#endif
+ {
+ plugins = PLUGINS;
+ }
+
+ if (!charon->initialize(charon, plugins))
{
libcharon_deinit();
charonservice_deinit(env);
mIsDisconnecting = false;
BuilderAdapter builder = new BuilderAdapter(mCurrentProfile.getName());
- initializeCharon(builder, mLogFile);
+ initializeCharon(builder, mLogFile, true);
Log.i(TAG, "charon started");
initiate(mCurrentProfile.getVpnType().getIdentifier(),
*
* @param builder BuilderAdapter for this connection
* @param logfile absolute path to the logfile
+ * @param boyd enable BYOD features
*/
- public native void initializeCharon(BuilderAdapter builder, String logfile);
+ public native void initializeCharon(BuilderAdapter builder, String logfile, boolean byod);
/**
* Deinitialize charon, provided by libandroidbridge.so