Skip to content

Commit 88b6899

Browse files
committed
minkipc: Update tag to v1.2.4 to add support for PKCS#11
Updated minkipc tag to v1.2.4 which brings support for PKCS#11 on Qualcomm platforms with QTEE support. The support is provided through optee_client and optee_test repos v4.0.0 which are placed in the optee-client/ and optee-test/ sub directories. Only the PKCS#11 relevant library and test suites are built and supported, i.e. libckteec_qtee and xtest_qtee (pkcs11-tests). The recipe license is updated to reflect the licenses of these repos. The PKCS#11 test-signed Trusted Application binaries is also installed for supported targets (qcm6490, qcs9100, qcs8300 and qcs615) under /lib/qtee-tas. On an RPMB provisioned device, the pkcs11-tests can be run by invoking the xtest_qtee binary. Signed-off-by: Harshal Dev <harshal.dev@oss.qualcomm.com>
1 parent 1f7b152 commit 88b6899

3 files changed

Lines changed: 294 additions & 4 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
From a147d820c115f0c5b0b72a9d3fc622118fbe0f83 Mon Sep 17 00:00:00 2001
2+
From: Harshal Dev <harshal.dev@oss.qualcomm.com>
3+
Date: Fri, 3 Apr 2026 14:24:28 +0530
4+
Subject: [PATCH] xtest: Remove regression suite from default test suite list
5+
6+
Remove the regression suite from default test-suite list since it is not
7+
applicable for QTEE.
8+
9+
Upstream-Status: Inappropriate [tests applicable for optee]
10+
11+
Signed-off-by: Harshal Dev <harshal.dev@oss.qualcomm.com>
12+
---
13+
host/xtest/xtest_main.c | 8 +++++++-
14+
1 file changed, 7 insertions(+), 1 deletion(-)
15+
16+
diff --git a/host/xtest/xtest_main.c b/host/xtest/xtest_main.c
17+
index 5e907e2..476f89e 100644
18+
--- a/host/xtest/xtest_main.c
19+
+++ b/host/xtest/xtest_main.c
20+
@@ -47,6 +47,12 @@ char *xtest_tee_name = NULL;
21+
unsigned int level = 0;
22+
static const char glevel[] = "0";
23+
24+
+#ifdef WITH_REGRESSION_TESTS
25+
+#define REGRESSION_SUITE "regression"
26+
+#else
27+
+#define REGRESSION_SUITE ""
28+
+#endif
29+
+
30+
#ifdef WITH_GP_TESTS
31+
#define GP_SUITE "+gp"
32+
#else
33+
@@ -65,7 +71,7 @@ static const char glevel[] = "0";
34+
#define FFA_SPMC_SUITE ""
35+
#endif
36+
37+
-static char gsuitename[] = "regression" GP_SUITE PKCS11_SUITE FFA_SPMC_SUITE;
38+
+static char gsuitename[] = REGRESSION_SUITE GP_SUITE PKCS11_SUITE FFA_SPMC_SUITE;
39+
40+
void usage(char *program);
41+
42+
--
43+
2.34.1
44+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
From 62115299515bb7babda3f2db0b585b582662327e Mon Sep 17 00:00:00 2001
2+
From: Harshal Dev <harshal.dev@oss.qualcomm.com>
3+
Date: Fri, 3 Apr 2026 17:00:02 +0530
4+
Subject: [PATCH 2/2] xtest: pkcs11: Stub the test cases inapplicable for QTEE
5+
6+
Mark and stub out the test cases which are inapplicable for QTEE.
7+
8+
Upstream-Status: Inappropriate [tests applicable for optee]
9+
10+
Signed-off-by: Harshal Dev <harshal.dev@oss.qualcomm.com>
11+
---
12+
host/xtest/pkcs11_1000.c | 32 ++++++++++++++++++++++++++++++++
13+
1 file changed, 32 insertions(+)
14+
15+
diff --git a/host/xtest/pkcs11_1000.c b/host/xtest/pkcs11_1000.c
16+
index a55691d..690610f 100644
17+
--- a/host/xtest/pkcs11_1000.c
18+
+++ b/host/xtest/pkcs11_1000.c
19+
@@ -4098,6 +4098,7 @@ close_lib:
20+
ADBG_CASE_DEFINE(pkcs11, 1015, xtest_pkcs11_test_1015,
21+
"PKCS11: Test C_CopyObject()");
22+
23+
+#ifdef BUILD_FOR_OPTEE
24+
static void xtest_pkcs11_test_1016(ADBG_Case_t *c)
25+
{
26+
CK_RV rv = CKR_GENERAL_ERROR;
27+
@@ -4186,6 +4187,7 @@ close_lib:
28+
}
29+
ADBG_CASE_DEFINE(pkcs11, 1016, xtest_pkcs11_test_1016,
30+
"PKCS11: Random number generator tests");
31+
+#endif
32+
33+
static CK_RV derive_sym_key(CK_SESSION_HANDLE session,
34+
CK_OBJECT_HANDLE parent_key,
35+
@@ -4629,6 +4631,8 @@ ADBG_CASE_DEFINE(pkcs11, 1017, xtest_pkcs11_test_1017,
36+
37+
/* Digest test patterns */
38+
static const char digest_test_pattern[] = "The quick brown fox jumps over the lazy dog";
39+
+
40+
+#ifdef BUILD_FOR_OPTEE
41+
static const char digest_test_pattern_empty[] = "";
42+
43+
/* MD5 checksums for digest test patterns */
44+
@@ -4640,16 +4644,20 @@ static const uint8_t digest_test_pattern_empty_md5[] = {
45+
0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04, 0xe9, 0x80, 0x09, 0x98,
46+
0xec, 0xf8, 0x42, 0x7e
47+
};
48+
+#endif
49+
50+
/* SHA-1 checksums for digest test patterns */
51+
static const uint8_t digest_test_pattern_sha1[] = {
52+
0x2f, 0xd4, 0xe1, 0xc6, 0x7a, 0x2d, 0x28, 0xfc, 0xed, 0x84, 0x9e, 0xe1,
53+
0xbb, 0x76, 0xe7, 0x39, 0x1b, 0x93, 0xeb, 0x12
54+
};
55+
+
56+
+#ifdef BUILD_FOR_OPTEE
57+
static const uint8_t digest_test_pattern_empty_sha1[] = {
58+
0xda, 0x39, 0xa3, 0xee, 0x5e, 0x6b, 0x4b, 0x0d, 0x32, 0x55, 0xbf, 0xef,
59+
0x95, 0x60, 0x18, 0x90, 0xaf, 0xd8, 0x07, 0x09
60+
};
61+
+#endif
62+
63+
/* SHA-224 checksums for digest test patterns */
64+
static const uint8_t digest_test_pattern_sha224[] = {
65+
@@ -4657,11 +4665,14 @@ static const uint8_t digest_test_pattern_sha224[] = {
66+
0x9a, 0xa2, 0x32, 0x5d, 0x24, 0x30, 0x58, 0x7d, 0xdb, 0xc0, 0xc3, 0x8b,
67+
0xad, 0x91, 0x15, 0x25
68+
};
69+
+
70+
+#ifdef BUILD_FOR_OPTEE
71+
static const uint8_t digest_test_pattern_empty_sha224[] = {
72+
0xd1, 0x4a, 0x02, 0x8c, 0x2a, 0x3a, 0x2b, 0xc9, 0x47, 0x61, 0x02, 0xbb,
73+
0x28, 0x82, 0x34, 0xc4, 0x15, 0xa2, 0xb0, 0x1f, 0x82, 0x8e, 0xa6, 0x2a,
74+
0xc5, 0xb3, 0xe4, 0x2f
75+
};
76+
+#endif
77+
78+
/* SHA-256 checksums for digest test patterns */
79+
static const uint8_t digest_test_pattern_sha256[] = {
80+
@@ -4669,11 +4680,14 @@ static const uint8_t digest_test_pattern_sha256[] = {
81+
0xb0, 0x08, 0x2e, 0x4f, 0x8d, 0x56, 0x51, 0xe4, 0x6d, 0x3c, 0xdb, 0x76,
82+
0x2d, 0x02, 0xd0, 0xbf, 0x37, 0xc9, 0xe5, 0x92
83+
};
84+
+
85+
+#ifdef BUILD_FOR_OPTEE
86+
static const uint8_t digest_test_pattern_empty_sha256[] = {
87+
0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8,
88+
0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c,
89+
0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55
90+
};
91+
+#endif
92+
93+
/* SHA-384 checksums for digest test patterns */
94+
static const uint8_t digest_test_pattern_sha384[] = {
95+
@@ -4682,12 +4696,15 @@ static const uint8_t digest_test_pattern_sha384[] = {
96+
0x40, 0x11, 0xe3, 0x31, 0x7d, 0xbf, 0x9a, 0x50, 0x9c, 0xb1, 0xe5, 0xdc,
97+
0x1e, 0x85, 0xa9, 0x41, 0xbb, 0xee, 0x3d, 0x7f, 0x2a, 0xfb, 0xc9, 0xb1
98+
};
99+
+
100+
+#ifdef BUILD_FOR_OPTEE
101+
static const uint8_t digest_test_pattern_empty_sha384[] = {
102+
0x38, 0xb0, 0x60, 0xa7, 0x51, 0xac, 0x96, 0x38, 0x4c, 0xd9, 0x32, 0x7e,
103+
0xb1, 0xb1, 0xe3, 0x6a, 0x21, 0xfd, 0xb7, 0x11, 0x14, 0xbe, 0x07, 0x43,
104+
0x4c, 0x0c, 0xc7, 0xbf, 0x63, 0xf6, 0xe1, 0xda, 0x27, 0x4e, 0xde, 0xbf,
105+
0xe7, 0x6f, 0x65, 0xfb, 0xd5, 0x1a, 0xd2, 0xf1, 0x48, 0x98, 0xb9, 0x5b
106+
};
107+
+#endif
108+
109+
/* SHA-512 checksums for digest test patterns */
110+
static const uint8_t digest_test_pattern_sha512[] = {
111+
@@ -4698,6 +4715,8 @@ static const uint8_t digest_test_pattern_sha512[] = {
112+
0xe1, 0xbf, 0xd7, 0x09, 0x78, 0x21, 0x23, 0x3f, 0xa0, 0x53, 0x8f, 0x3d,
113+
0xb8, 0x54, 0xfe, 0xe6
114+
};
115+
+
116+
+#ifdef BUILD_FOR_OPTEE
117+
static const uint8_t digest_test_pattern_empty_sha512[] = {
118+
0xcf, 0x83, 0xe1, 0x35, 0x7e, 0xef, 0xb8, 0xbd, 0xf1, 0x54, 0x28, 0x50,
119+
0xd6, 0x6d, 0x80, 0x07, 0xd6, 0x20, 0xe4, 0x05, 0x0b, 0x57, 0x15, 0xdc,
120+
@@ -4706,6 +4725,7 @@ static const uint8_t digest_test_pattern_empty_sha512[] = {
121+
0x63, 0xb9, 0x31, 0xbd, 0x47, 0x41, 0x7a, 0x81, 0xa5, 0x38, 0x32, 0x7a,
122+
0xf9, 0x27, 0xda, 0x3e
123+
};
124+
+#endif
125+
126+
#define DIGEST_TEST(_test_name, _mecha, _data, _digest) \
127+
{ \
128+
@@ -4717,6 +4737,7 @@ static const uint8_t digest_test_pattern_empty_sha512[] = {
129+
.digest_size = sizeof(_digest) \
130+
}
131+
132+
+#ifdef BUILD_FOR_OPTEE
133+
/* Digest simple test suite */
134+
static struct {
135+
const char *test_name;
136+
@@ -5435,6 +5456,7 @@ close_lib:
137+
}
138+
ADBG_CASE_DEFINE(pkcs11, 1018, xtest_pkcs11_test_1018,
139+
"PKCS11: Digest tests");
140+
+#endif
141+
142+
/**
143+
* 0:d=0 hl=2 l= 22 cons: SEQUENCE
144+
@@ -5448,6 +5470,7 @@ static uint8_t subject_common_name[] = {
145+
0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x20, 0x6e, 0x61, 0x6d, 0x65
146+
};
147+
148+
+#ifdef BUILD_FOR_OPTEE
149+
/**
150+
* 0:d=0 hl=2 l= 8 prim: OBJECT :prime256v1
151+
*/
152+
@@ -5805,6 +5828,7 @@ close_lib:
153+
}
154+
ADBG_CASE_DEFINE(pkcs11, 1019, xtest_pkcs11_test_1019,
155+
"PKCS11: Elliptic Curve key generation and signing");
156+
+#endif
157+
158+
#define WRAPPED_TEST_KEY_SIZE 48
159+
160+
@@ -6449,6 +6473,7 @@ ADBG_CASE_DEFINE(pkcs11, 1020, xtest_pkcs11_test_1020,
161+
.data_size = sizeof(_data) - 1, \
162+
}
163+
164+
+#ifdef BUILD_FOR_OPTEE
165+
/* List of RSA PKCS signing multi stage digest mechanisms */
166+
static struct {
167+
const char *test_name;
168+
@@ -6800,6 +6825,7 @@ close_lib:
169+
}
170+
ADBG_CASE_DEFINE(pkcs11, 1021, xtest_pkcs11_test_1021,
171+
"PKCS11: RSA PKCS key generation and signing");
172+
+#endif
173+
174+
#define RSA_PSS_HASH_SIGN_TEST(_test_name, _min_rsa_bits, _mecha, _hash_algo, _mgf_algo, \
175+
_salt_len, _data) \
176+
@@ -8006,6 +8032,7 @@ struct eddsa_test {
177+
size_t context_len;
178+
};
179+
180+
+#ifdef BUILD_FOR_OPTEE
181+
static CK_BYTE ed25519_params[] = {
182+
0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0xda,
183+
0x47, 0x0f, 0x01,
184+
@@ -8174,6 +8201,7 @@ err_close_lib:
185+
}
186+
ADBG_CASE_DEFINE(pkcs11, 1025, xtest_pkcs11_test_1025,
187+
"PKCS11: EDDSA key generation and signing");
188+
+#endif
189+
190+
#define RSA_AES_MAX_KEY_SIZE 32
191+
192+
@@ -8196,6 +8224,7 @@ ADBG_CASE_DEFINE(pkcs11, 1025, xtest_pkcs11_test_1025,
193+
194+
#define RSA_AES_WRAP_AES(_size) { .aes = { .size = (_size) } }
195+
196+
+#ifdef BUILD_FOR_OPTEE
197+
static struct rsa_aes_wrap_test {
198+
CK_KEY_TYPE target_type;
199+
union {
200+
@@ -8737,6 +8766,7 @@ out_unsetenv:
201+
}
202+
ADBG_CASE_DEFINE(pkcs11, 1027, xtest_pkcs11_test_1027,
203+
"PKCS11: Login to PKCS#11 token with ACL based authentication");
204+
+#endif
205+
206+
int xtest_pkcs11_1028_destroy_token_object(void)
207+
{
208+
@@ -8809,6 +8839,7 @@ out_lib:
209+
* process so that cryptoki library sees it as a different client and
210+
* generates another handle for the same object.
211+
*/
212+
+#ifdef BUILD_FOR_OPTEE
213+
static void xtest_pkcs11_test_1028(ADBG_Case_t *c)
214+
{
215+
CK_SESSION_HANDLE session = CK_INVALID_HANDLE;
216+
@@ -8871,3 +8902,4 @@ out_lib:
217+
}
218+
ADBG_CASE_DEFINE(pkcs11, 1028, xtest_pkcs11_test_1028,
219+
"PKCS11: destroy PKCS#11 objects handled by another session");
220+
+#endif
221+
--
222+
2.34.1
223+

dynamic-layers/openembedded-layer/recipes-security/minkipc/minkipc_1.1.1.bb renamed to dynamic-layers/openembedded-layer/recipes-security/minkipc/minkipc_1.2.4.bb

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,26 @@ qteesupplicant service is designed for invocation dispatch and handling callback
88
HOMEPAGE = "https://github.com/qualcomm/minkipc.git"
99
SECTION = "devel"
1010

11-
LICENSE = "BSD-3-Clause"
12-
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=2b1366ebba1ebd9ae25ad19626bbca93"
11+
LICENSE = "BSD-3-Clause & BSD-2-Clause & GPL-2.0-only"
1312

1413
inherit cmake systemd pkgconfig
1514

16-
SRC_URI = "git://github.com/qualcomm/minkipc.git;branch=main;protocol=https;tag=v${PV}"
17-
SRCREV = "307a2f368051d0436d450a9d1f5fa14ff0f94580"
15+
SRC_URI = "git://github.com/qualcomm/minkipc.git;branch=main;protocol=https;tag=v${PV};name=minkipc \
16+
git://github.com/OP-TEE/optee_client.git;branch=master;protocol=https;tag=4.0.0;name=opteec;destsuffix=${BPN}-${PV}/optee-client/optee_client \
17+
git://github.com/OP-TEE/optee_test.git;branch=master;protocol=https;tag=4.0.0;name=opteet;destsuffix=${BPN}-${PV}/optee-test/optee_test \
18+
file://0001-xtest-Remove-regression-suite-from-default-test-suit.patch;patchdir=optee-test/optee_test \
19+
file://0002-xtest-pkcs11-Stub-the-test-cases-inapplicable-for-QT.patch;patchdir=optee-test/optee_test \
20+
"
21+
22+
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=2b1366ebba1ebd9ae25ad19626bbca93 \
23+
file://optee-client/optee_client/LICENSE;md5=69663ab153298557a59c67a60a743e5b \
24+
file://optee-test/optee_test/LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa"
25+
26+
SRCREV_minkipc = "117484de484003637f27c41a9aa379f3b2faa476"
27+
SRCREV_opteec = "acb0885c117e73cb6c5c9b1dd9054cb3f93507ee"
28+
SRCREV_opteet = "1c3d6be5eaa6174e3dbabf60928d15628e39b994"
29+
30+
SRCREV_FORMAT = "minkipc_opteec_opteet"
1831

1932
DEPENDS += "qcbor qcomtee mink-idl-compiler-native glib-2.0"
2033

@@ -39,3 +52,13 @@ FILES:${PN}-qteesupplicant = "${bindir}/qtee_supplicant \
3952
RDEPENDS:${PN}-qteesupplicant = "${PN}"
4053
RRECOMMENDS:${PN}-qteesupplicant = "mount-tee-partition"
4154

55+
do_install:append() {
56+
mkdir -p ${D}${nonarch_base_libdir}/qtee-tas
57+
cp -R ${S}/ta/* ${D}${nonarch_base_libdir}/qtee-tas/
58+
59+
# No need to install the license file in rootfs
60+
rm ${D}${nonarch_base_libdir}/qtee-tas/NO.LOGIN.BINARY.LICENSE.QTI.pdf
61+
}
62+
63+
FILES:${PN} += "${nonarch_base_libdir}/qtee-tas"
64+

0 commit comments

Comments
 (0)