IRadio 1.6: Public Key Type For IMSI Encryption
- Add public key type for IMSI encryption.
- Add VTS test case for setCarrierInfoForImsiEncryption_1_6
Test: Manual
Bug: 142333634
Merged-In: Id11055354b32e492e24f43b348bdf2745d63529c
Change-Id: Id11055354b32e492e24f43b348bdf2745d63529c
(cherry picked from commit 10ca7b1d5bc1820b402c49003b9fe6f8d88505dd)
diff --git a/radio/1.6/IRadio.hal b/radio/1.6/IRadio.hal
index df28940..a631fe1 100644
--- a/radio/1.6/IRadio.hal
+++ b/radio/1.6/IRadio.hal
@@ -496,4 +496,20 @@
* Response function is IRadioResponse.getCurrentCallsResponse_1_6()
*/
oneway getCurrentCalls_1_6(int32_t serial);
+
+ /**
+ * Provide Carrier specific information to the modem that must be used to
+ * encrypt the IMSI and IMPI. Sent by the framework during boot, carrier
+ * switch and everytime the framework receives a new certificate.
+ *
+ * @param serial Serial number of request.
+ * @param imsiEncryptionInfo ImsiEncryptionInfo as defined in types.hal.
+ *
+ * Response callback is
+ * IRadioResponse.setCarrierInfoForImsiEncryptionResponse()
+ *
+ * Note this API is the same as the 1.1 version except using the 1.6 ImsiEncryptionInfo
+ * as the input param.
+ */
+ oneway setCarrierInfoForImsiEncryption_1_6(int32_t serial, @1.6::ImsiEncryptionInfo imsiEncryptionInfo);
};
diff --git a/radio/1.6/types.hal b/radio/1.6/types.hal
index 8560b3d..88d3c02 100644
--- a/radio/1.6/types.hal
+++ b/radio/1.6/types.hal
@@ -27,6 +27,7 @@
import @1.1::GeranBands;
import @1.1::ScanStatus;
import @1.1::UtranBands;
+import @1.1::ImsiEncryptionInfo;
import @1.2::Call;
import @1.2::CellInfoCdma;
import @1.2::CellConnectionStatus;
@@ -895,3 +896,20 @@
*/
SLICE_REJECTED = 0x8CC,
};
+
+/**
+ * Public key type from carrier certificate.
+ */
+enum PublicKeyType : int32_t {
+ EPDG = 1, // Key type to be used for ePDG
+ WLAN = 2, // Key type to be used for WLAN
+};
+
+/**
+ * Carrier specific Information sent by the carrier,
+ * which will be used to encrypt the IMSI and IMPI.
+ */
+struct ImsiEncryptionInfo {
+ @1.1::ImsiEncryptionInfo base;
+ PublicKeyType keyType; // Public key type
+};
diff --git a/radio/1.6/vts/functional/radio_hidl_hal_api.cpp b/radio/1.6/vts/functional/radio_hidl_hal_api.cpp
index 44900b8..1b476a4 100644
--- a/radio/1.6/vts/functional/radio_hidl_hal_api.cpp
+++ b/radio/1.6/vts/functional/radio_hidl_hal_api.cpp
@@ -583,3 +583,29 @@
EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial);
EXPECT_EQ(::android::hardware::radio::V1_6::RadioError::NONE, radioRsp_v1_6->rspInfo.error);
}
+
+/*
+ * Test IRadio.setCarrierInfoForImsiEncryption_1_6() for the response returned.
+ */
+TEST_P(RadioHidlTest_v1_6, setCarrierInfoForImsiEncryption_1_6) {
+ serial = GetRandomSerialNumber();
+ ::android::hardware::radio::V1_6::ImsiEncryptionInfo imsiInfo;
+ imsiInfo.base.mcc = "310";
+ imsiInfo.base.mnc = "004";
+ imsiInfo.base.carrierKey = (std::vector<uint8_t>){1, 2, 3, 4, 5, 6};
+ imsiInfo.base.keyIdentifier = "Test";
+ imsiInfo.base.expirationTime = 20180101;
+ imsiInfo.keyType = PublicKeyType::EPDG;
+
+ radio_v1_6->setCarrierInfoForImsiEncryption_1_6(serial, imsiInfo);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial);
+
+ if (cardStatus.base.base.base.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_v1_6->rspInfo.error,
+ {::android::hardware::radio::V1_6::RadioError::NONE,
+ ::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+}