Skip to content

Commit a6507df

Browse files
committed
android: Build libpts and init/deinit libpts in BYOD IMC
1 parent f0e0101 commit a6507df

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

src/frontends/android/jni/Android.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ ifneq ($(strongswan_USE_BYOD),)
7777
strongswan_BUILD += \
7878
strongswan/src/libtnccs \
7979
strongswan/src/libtncif \
80-
strongswan/src/libimcv
80+
strongswan/src/libimcv \
81+
strongswan/src/libpts
8182
endif
8283

8384
include $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk, \

src/frontends/android/jni/libandroidbridge/Android.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ LOCAL_C_INCLUDES += \
3434
$(strongswan_PATH)/src/libimcv \
3535
$(strongswan_PATH)/src/libtncif \
3636
$(strongswan_PATH)/src/libtnccs \
37+
$(strongswan_PATH)/src/libpts \
3738
$(strongswan_PATH)/src/libtls
3839
endif
3940

@@ -53,7 +54,7 @@ LOCAL_LDLIBS := -llog
5354
LOCAL_SHARED_LIBRARIES := libstrongswan libhydra libipsec libcharon
5455

5556
ifneq ($(strongswan_USE_BYOD),)
56-
LOCAL_SHARED_LIBRARIES += libimcv libtncif libtnccs
57+
LOCAL_SHARED_LIBRARIES += libimcv libtncif libtnccs libpts
5758
endif
5859

5960
include $(BUILD_SHARED_LIBRARY)

src/frontends/android/jni/libandroidbridge/byod/imc_android.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "imc_android_state.h"
1818

1919
#include <tnc/tnc.h>
20+
#include <libpts.h>
2021
#include <imc/imc_agent.h>
2122
#include <imc/imc_msg.h>
2223
#include <pa_tnc/pa_tnc_msg.h>
@@ -64,6 +65,8 @@ TNC_Result TNC_IMC_Initialize(TNC_IMCID imc_id,
6465
return TNC_RESULT_FATAL;
6566
}
6667

68+
libpts_init();
69+
6770
if (min_version > TNC_IFIMC_VERSION_1 || max_version < TNC_IFIMC_VERSION_1)
6871
{
6972
DBG1(DBG_IMC, "no common IF-IMC version");
@@ -352,6 +355,8 @@ TNC_Result TNC_IMC_Terminate(TNC_IMCID imc_id)
352355
DBG1(DBG_IMC, "IMC \"%s\" has not been initialized", imc_name);
353356
return TNC_RESULT_NOT_INITIALIZED;
354357
}
358+
/* has to be done before destroying the agent / deinitializing libimcv */
359+
libpts_deinit();
355360
imc_android->destroy(imc_android);
356361
imc_android = NULL;
357362
return TNC_RESULT_SUCCESS;

src/frontends/android/src/org/strongswan/android/logic/CharonVpnService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,7 @@ public synchronized int establish()
606606
System.loadLibrary("tncif");
607607
System.loadLibrary("tnccs");
608608
System.loadLibrary("imcv");
609+
System.loadLibrary("pts");
609610
}
610611

611612
System.loadLibrary("hydra");

0 commit comments

Comments
 (0)