From 1a42cfac152faa98c2e3d9e9fd6889209de195fe Mon Sep 17 00:00:00 2001 From: Nick Pelly Date: Thu, 24 Sep 2009 18:03:42 -0700 Subject: Use LM_SECURE when auth && encrypt. LM_SECURE enforces man in the middle (MITM) protection. Change-Id: Ia800bb657b429f8872d72072f7c9450a74028af0 --- core/jni/android_bluetooth_BluetoothSocket.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/jni/android_bluetooth_BluetoothSocket.cpp b/core/jni/android_bluetooth_BluetoothSocket.cpp index 51cf0cb9232c..70d74d52e7df 100644 --- a/core/jni/android_bluetooth_BluetoothSocket.cpp +++ b/core/jni/android_bluetooth_BluetoothSocket.cpp @@ -124,11 +124,13 @@ static void initSocketNative(JNIEnv *env, jobject obj) { switch (type) { case TYPE_RFCOMM: lm |= auth ? RFCOMM_LM_AUTH : 0; - lm |= encrypt? RFCOMM_LM_ENCRYPT : 0; + lm |= encrypt ? RFCOMM_LM_ENCRYPT : 0; + lm |= (auth && encrypt) ? RFCOMM_LM_SECURE : 0; break; case TYPE_L2CAP: lm |= auth ? L2CAP_LM_AUTH : 0; - lm |= encrypt? L2CAP_LM_ENCRYPT : 0; + lm |= encrypt ? L2CAP_LM_ENCRYPT : 0; + lm |= (auth && encrypt) ? L2CAP_LM_SECURE : 0; break; } -- cgit v1.2.3-59-g8ed1b