Home
last modified time | relevance | path

Searched refs:res (Results 1 – 25 of 495) sorted by relevance

12345678910>>...20

/base/security/device_auth/services/authenticators/src/account_unrelated/pake_task/pake_v1_task/pake_v1_protocol_task/
Dpake_v1_client_protocol_task.c50 int res = ConstructOutJson(params, out); in PakeRequest() local
51 if (res != HC_SUCCESS) { in PakeRequest()
52 LOGE("ConstructOutJson failed, res: %d.", res); in PakeRequest()
53 return res; in PakeRequest()
60 res = PackagePakeRequestData(params, payload); in PakeRequest()
61 if (res != HC_SUCCESS) { in PakeRequest()
62 LOGE("PackagePakeRequestData failed, res: %d.", res); in PakeRequest()
63 return res; in PakeRequest()
67 res = AddByteToJson(payload, FIELD_PEER_AUTH_ID, params->baseParams.idSelf.val, in PakeRequest()
69 if (res != HC_SUCCESS) { in PakeRequest()
[all …]
Dpake_v1_server_protocol_task.c43 int res = ConstructOutJson(params, out); in PackageMsgForResponse() local
44 if (res != HC_SUCCESS) { in PackageMsgForResponse()
45 LOGE("ConstructOutJson failed, res: %d.", res); in PackageMsgForResponse()
46 return res; in PackageMsgForResponse()
53 res = PackagePakeResponseData(params, payload); in PackageMsgForResponse()
54 if (res != HC_SUCCESS) { in PackageMsgForResponse()
55 LOGE("PackagePakeResponseData failed, res: %d.", res); in PackageMsgForResponse()
56 return res; in PackageMsgForResponse()
59 res = AddByteToJson(payload, FIELD_CHALLENGE, params->baseParams.challengeSelf.val, in PackageMsgForResponse()
61 if (res != HC_SUCCESS) { in PackageMsgForResponse()
[all …]
/base/security/device_auth/services/authenticators/src/account_unrelated/pake_task/
Dpake_message_util.c73 int32_t res = GetAndCheckKeyLenOnServer(in, &(params->returnKey.length)); in ParsePakeRequestMessage() local
74 if (res != HC_SUCCESS) { in ParsePakeRequestMessage()
75 LOGE("GetAndCheckKeyLenOnServer failed, res: %d.", res); in ParsePakeRequestMessage()
76 return res; in ParsePakeRequestMessage()
85 …int32_t res = AddByteToJson(payload, FIELD_SALT, params->baseParams.salt.val, params->baseParams.s… in PackagePakeResponseData() local
86 if (res != HC_SUCCESS) { in PackagePakeResponseData()
87 LOGE("Add salt failed, res: %d.", res); in PackagePakeResponseData()
88 return res; in PackagePakeResponseData()
90res = AddByteToJson(payload, FIELD_EPK, params->baseParams.epkSelf.val, params->baseParams.epkSelf… in PackagePakeResponseData()
91 if (res != HC_SUCCESS) { in PackagePakeResponseData()
[all …]
/base/security/device_auth/test/unittest/deviceauth/source/
Dkey_agree_sdk_test.cpp73 … KeyAgreeResult res = KeyAgreeInitSession(g_session, KEYAGREE_PROTOCOL_ANY, KEYAGREE_TYPE_CLIENT); variable
74 EXPECT_EQ(res, KEYAGREE_SUCCESS);
80 …KeyAgreeResult res = KeyAgreeInitSession(g_session_s, KEYAGREE_PROTOCOL_ANY, KEYAGREE_TYPE_SERVER); variable
81 EXPECT_EQ(res, KEYAGREE_SUCCESS);
87 …KeyAgreeResult res = KeyAgreeInitSession(g_session, KEYAGREE_PROTOCOL_DL_SPEKE_256, KEYAGREE_TYPE_… variable
88 EXPECT_EQ(res, KEYAGREE_SUCCESS);
94 …KeyAgreeResult res = KeyAgreeInitSession(g_session, KEYAGREE_PROTOCOL_DL_SPEKE_384, KEYAGREE_TYPE_… variable
95 EXPECT_EQ(res, KEYAGREE_SUCCESS);
101 …KeyAgreeResult res = KeyAgreeInitSession(g_session, KEYAGREE_PROTOCOL_EC_SPEKE_P256, KEYAGREE_TYPE… variable
102 EXPECT_EQ(res, KEYAGREE_SUCCESS);
[all …]
/base/security/device_auth/test/unittest/tdd_framework/unit_test/services/session_manager/session/v2/auth_sub_session/
Dauth_sub_session_test.cpp102 int32_t res = CreateAuthSubSession(PROTOCOL_TYPE_ISO, (void *)&g_paramsC, true, &self); variable
103 ASSERT_EQ(res, HC_SUCCESS);
111 int32_t res = CreateAuthSubSession(PROTOCOL_TYPE_ISO, (void *)&g_paramsC, true, &client); variable
112 ASSERT_EQ(res, HC_SUCCESS);
116 res = CreateAuthSubSession(PROTOCOL_TYPE_ISO, (void *)&g_paramsS, false, &server);
117 ASSERT_EQ(res, HC_SUCCESS);
120 res = client->setPsk(client, &g_psk);
121 ASSERT_EQ(res, HC_SUCCESS);
122 res = server->setPsk(server, &g_psk);
123 ASSERT_EQ(res, HC_SUCCESS);
[all …]
/base/security/crypto_framework/test/unittest/src/
Dcrypto_rsa_verify_test.cpp156 int32_t res = HcfVerifyCreate("RSA1024|PSS|SHA256", &verify); variable
157 EXPECT_NE(res, HCF_SUCCESS);
166 int32_t res = HcfVerifyCreate("RSA1024|PSS|SHA256|MGF1_SHA256", &verify); variable
167 EXPECT_EQ(res, HCF_SUCCESS);
176 HcfResult res = HCF_SUCCESS; variable
178 res = HcfVerifyCreate("RSA1024|PSS|SHA256|MGF1_SHA256", &verify);
179 EXPECT_EQ(res, HCF_SUCCESS);
180 res = verify->init(verify, nullptr, nullptr);
181 EXPECT_NE(res, HCF_SUCCESS);
190 HcfResult res = HcfAsyKeyGeneratorCreate("RSA2048|PRIMES_2", &generator); variable
[all …]
Dcrypto_sm2_cipher_test.cpp45 int32_t res = HcfAsyKeyGeneratorCreate("SM2_256", &generator); in SetUpTestCase() local
46 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
50 res = generator->generateKeyPair(generator, nullptr, &keyPair); in SetUpTestCase()
51 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
79 HcfResult res = HCF_SUCCESS; variable
81 res = HcfCipherCreate("SM2|SM3", &cipher);
82 EXPECT_EQ(res, HCF_SUCCESS);
96 HcfResult res = HCF_SUCCESS; variable
97 res = HcfCipherCreate("SM2|SM3", nullptr);
98 EXPECT_NE(res, HCF_SUCCESS);
[all …]
Dcrypto_ecc_sign_test.cpp62 int32_t res = HcfAsyKeyGeneratorCreate("ECC224", &generator); in SetUpTestCase() local
63 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
67 res = generator->generateKeyPair(generator, nullptr, &keyPair); in SetUpTestCase()
68 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
76 res = HcfAsyKeyGeneratorCreate("ECC256", &generator2); in SetUpTestCase()
77 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
81 res = generator2->generateKeyPair(generator2, nullptr, &keyPair2); in SetUpTestCase()
82 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
90 res = HcfAsyKeyGeneratorCreate("ECC384", &generator3); in SetUpTestCase()
91 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
[all …]
Dcrypto_ecc_verify_test.cpp62 int32_t res = HcfAsyKeyGeneratorCreate("ECC224", &generator); in SetUpTestCase() local
63 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
67 res = generator->generateKeyPair(generator, nullptr, &keyPair); in SetUpTestCase()
68 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
76 res = HcfAsyKeyGeneratorCreate("ECC256", &generator2); in SetUpTestCase()
77 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
81 res = generator2->generateKeyPair(generator2, nullptr, &keyPair2); in SetUpTestCase()
82 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
90 res = HcfAsyKeyGeneratorCreate("ECC384", &generator3); in SetUpTestCase()
91 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
[all …]
Dcrypto_ecc_no_length_sign_test.cpp216 int32_t res = ConstructEcc224KeyPairParamsSpec(&paramSpec); in SetUpTestCase() local
217 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
220 res = HcfAsyKeyGeneratorBySpecCreate(paramSpec, &generator); in SetUpTestCase()
221 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
225 res = generator->generateKeyPair(generator, &keyPair); in SetUpTestCase()
226 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
234 res = ConstructEcc256KeyPairParamsSpec(&paramSpec2); in SetUpTestCase()
235 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
238 res = HcfAsyKeyGeneratorBySpecCreate(paramSpec2, &generator2); in SetUpTestCase()
239 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
[all …]
Dcrypto_sm2_sign_test.cpp56 int32_t res = HcfAsyKeyGeneratorCreate("SM2_256", &generator); in SetUpTestCase() local
57 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
61 res = generator->generateKeyPair(generator, nullptr, &keyPair); in SetUpTestCase()
62 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
88 int32_t res = HcfSignCreate("SM2|SM3", &sign); variable
90 ASSERT_EQ(res, HCF_SUCCESS);
99 int32_t res = HcfSignCreate(nullptr, &sign); variable
101 ASSERT_EQ(res, HCF_INVALID_PARAMS);
108 …int32_t res = HcfSignCreate("ABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDA… variable
111 ASSERT_EQ(res, HCF_INVALID_PARAMS);
[all …]
Dcrypto_ecc_no_length_verify_test.cpp216 int32_t res = ConstructEcc224KeyPairParamsSpec(&paramSpec); in SetUpTestCase() local
217 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
220 res = HcfAsyKeyGeneratorBySpecCreate(paramSpec, &generator); in SetUpTestCase()
221 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
225 res = generator->generateKeyPair(generator, &keyPair); in SetUpTestCase()
226 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
234 res = ConstructEcc256KeyPairParamsSpec(&paramSpec2); in SetUpTestCase()
235 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
238 res = HcfAsyKeyGeneratorBySpecCreate(paramSpec2, &generator2); in SetUpTestCase()
239 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
[all …]
Dcrypto_rsa_sign_test.cpp169 HcfResult res = HCF_SUCCESS; variable
171 res = HcfSignCreate("RSA1024|PKCS1|MD5", &sign);
172 EXPECT_EQ(res, HCF_SUCCESS);
184 HcfResult res = HCF_SUCCESS; variable
186 res = HcfSignCreate("RSA1024|PKCS1|SHA1", &sign);
187 EXPECT_EQ(res, HCF_SUCCESS);
199 HcfResult res = HCF_SUCCESS; variable
201 res = HcfSignCreate("RSA1024|PKCS1|SHA256", &sign);
202 EXPECT_EQ(res, HCF_SUCCESS);
214 HcfResult res = HCF_SUCCESS; variable
[all …]
Dcrypto_rsa_cipher_test.cpp160 HcfResult res = HCF_SUCCESS; variable
162 res = HcfCipherCreate("RSA1024|NoPadding", &cipher);
163 EXPECT_EQ(res, HCF_SUCCESS);
178 HcfResult res = HCF_SUCCESS; variable
180 res = HcfCipherCreate("RSA1024|NoPadding", &cipher);
181 EXPECT_EQ(res, HCF_SUCCESS);
193 HcfResult res = HCF_SUCCESS; variable
195 res = HcfCipherCreate("RSA1024|NoPadding", &cipher);
196 EXPECT_EQ(res, HCF_SUCCESS);
208 HcfResult res = HCF_SUCCESS; variable
[all …]
Dcrypto_sm2_verify_test.cpp56 int32_t res = HcfAsyKeyGeneratorCreate("SM2_256", &generator); in SetUpTestCase() local
57 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
61 res = generator->generateKeyPair(generator, nullptr, &keyPair); in SetUpTestCase()
62 ASSERT_EQ(res, HCF_SUCCESS); in SetUpTestCase()
88 int32_t res = HcfVerifyCreate("SM2|SM3", &verify); variable
90 ASSERT_EQ(res, HCF_SUCCESS);
99 int32_t res = HcfVerifyCreate(nullptr, &verify); variable
101 ASSERT_EQ(res, HCF_INVALID_PARAMS);
108 …int32_t res = HcfVerifyCreate("ABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABC… variable
111 ASSERT_EQ(res, HCF_INVALID_PARAMS);
[all …]
/base/security/device_auth/test/unittest/tdd_framework/unit_test/services/session_manager/session/v2/auth_sub_session/protocol_lib/
Dec_speke_protocol_test.cpp98 int32_t res = CreateEcSpekeProtocol(&g_X25519ParamsC, true, &self); variable
99 ASSERT_EQ(res, HC_SUCCESS);
107 int32_t res = CreateEcSpekeProtocol(&g_X25519ParamsC, true, &client); variable
108 ASSERT_EQ(res, HC_SUCCESS);
112 res = CreateEcSpekeProtocol(&g_X25519ParamsS, false, &server);
113 ASSERT_EQ(res, HC_SUCCESS);
116 res = client->setPsk(client, &g_psk);
117 ASSERT_EQ(res, HC_SUCCESS);
118 res = server->setPsk(server, &g_psk);
119 ASSERT_EQ(res, HC_SUCCESS);
[all …]
Diso_protocol_test.cpp95 int32_t res = CreateIsoProtocol(&g_paramsC, true, &self); variable
96 ASSERT_EQ(res, HC_SUCCESS);
104 int32_t res = CreateIsoProtocol(&g_paramsC, true, &client); variable
105 ASSERT_EQ(res, HC_SUCCESS);
109 res = CreateIsoProtocol(&g_paramsS, false, &server);
110 ASSERT_EQ(res, HC_SUCCESS);
113 res = client->setPsk(client, &g_psk);
114 ASSERT_EQ(res, HC_SUCCESS);
115 res = server->setPsk(server, &g_psk);
116 ASSERT_EQ(res, HC_SUCCESS);
[all …]
/base/security/device_auth/services/key_agree_sdk/src/
Dkey_agree_session.c60 int32_t res = InitSingleParam(authIdPeer, authIdLen); in GetIdPeer() local
61 if (res != HC_SUCCESS) { in GetIdPeer()
62 LOGE("InitSingleParam for peer authId failed, res: %d.", res); in GetIdPeer()
63 return res; in GetIdPeer()
267 int32_t res = GetIdPeer(payload, FIELD_PEER_AUTH_ID, authIdSelf, authIdPeer); in GetAuthIdPeerFromPayload() local
268 if (res != HC_SUCCESS) { in GetAuthIdPeerFromPayload()
269 LOGE("GetIdPeer failed, res: %d.", res); in GetAuthIdPeerFromPayload()
271 return res; in GetAuthIdPeerFromPayload()
276 int32_t res = GetByteFromJson(in, FIELD_KCF_DATA, baseParams->kcfDataPeer.val, in ParsePakeServerConfirmMessage() local
278 if (res != HC_SUCCESS) { in ParsePakeServerConfirmMessage()
[all …]
/base/security/device_auth/services/protocol/src/pake_protocol/pake_protocol_dl_common/
Dpake_protocol_dl_common.c54 int res = params->loader->generateRandom(&(params->eskSelf)); in GenerateEsk() local
55 if (res != HC_SUCCESS) { in GenerateEsk()
56 LOGE("GenerateRandom for eskSelf failed, res: %x.", res); in GenerateEsk()
58 return res; in GenerateEsk()
97 int32_t res; in InitDlPakeParams() local
99 res = FillDlKeysLenAccordingToEpkPeer(params); in InitDlPakeParams()
101 res = FillDlKeysLenAccordingToMod(params); in InitDlPakeParams()
103 if (res != HC_SUCCESS) { in InitDlPakeParams()
104 LOGE("FillDlKeysLen failed, res: %x.", res); in InitDlPakeParams()
105 return res; in InitDlPakeParams()
[all …]
/base/security/device_auth/services/mk_agree/src/
Dkey_manager.c44 …int32_t res = ByteToHexString(keyAliasHash->val, keyAliasHash->length, keyAliasHex, keyAliasHexLen… in ConvertHashToAlias() local
45 if (res != HC_SUCCESS) { in ConvertHashToAlias()
48 return res; in ConvertHashToAlias()
67 …int32_t res = ByteToHexString(keyAliasHash->val, keyAliasHash->length, keyAliasHex, keyAliasHexLen… in ConvertHashToAliasWithPrefix() local
68 if (res != HC_SUCCESS) { in ConvertHashToAliasWithPrefix()
71 return res; in ConvertHashToAliasWithPrefix()
98 int32_t res = HcGetUdid((uint8_t *)selfUdid, INPUT_UDID_LEN); in GenerateDevKeyAlias() local
99 if (res != HC_SUCCESS) { in GenerateDevKeyAlias()
101 return res; in GenerateDevKeyAlias()
106 res = GetLoaderInstance()->sha256(&msgBuff, &keyAliasHash); in GenerateDevKeyAlias()
[all …]
/base/customization/enterprise_device_management/test/unittest/src/
Dpolicy_manager_test.cpp64 ErrCode res; variable
67 res = policyMgr_->SetPolicy(TEST_ADMIN_NAME, TEST_BOOL_POLICY_NAME, "false", "true");
68 ASSERT_TRUE(res == ERR_OK);
71 res = policyMgr_->GetPolicy(TEST_ADMIN_NAME, TEST_BOOL_POLICY_NAME, policyValue);
72 ASSERT_TRUE(res == ERR_OK);
74 res = policyMgr_->GetPolicy("", TEST_BOOL_POLICY_NAME, policyValue);
75 ASSERT_TRUE(res == ERR_OK);
78 res = policyMgr_->SetPolicy(TEST_ADMIN_NAME1, TEST_BOOL_POLICY_NAME, "true", "true");
79 ASSERT_TRUE(res == ERR_OK);
80 res = policyMgr_->GetPolicy(TEST_ADMIN_NAME1, TEST_BOOL_POLICY_NAME, policyValue);
[all …]
/base/security/device_auth/services/protocol/src/pake_protocol/pake_protocol_ec_common/
Dpake_protocol_ec_common.c34 int32_t res; in GenerateEsk() local
38 res = params->loader->generateRandom(&(params->eskSelf)); in GenerateEsk()
39 if (res != HC_SUCCESS) { in GenerateEsk()
40 LOGE("CURVE_25519: GenerateRandom for eskSelf failed, res: %x.", res); in GenerateEsk()
41 return res; in GenerateEsk()
59 int32_t res = InitSingleParam(&(params->eskSelf), params->eskSelf.length); in InitEcPakeParams() local
60 if (res != HC_SUCCESS) { in InitEcPakeParams()
61 LOGE("InitSingleParam for eskSelf failed, res: %x.", res); in InitEcPakeParams()
62 return res; in InitEcPakeParams()
64 res = InitSingleParam(&(params->epkSelf), keyBufferLen); in InitEcPakeParams()
[all …]
/base/security/device_auth/services/authenticators/src/account_unrelated/iso_task/iso_protocol_task/
Diso_client_protocol_task.c43 int res; in IsoClientStartPackData() local
49 res = HC_ERR_JSON_CREATE; in IsoClientStartPackData()
55 res = HC_ERR_JSON_CREATE; in IsoClientStartPackData()
58 … GOTO_ERR_AND_SET_RET(AddIntToJson(sendToPeer, FIELD_AUTH_FORM, AUTH_FORM_ACCOUNT_UNRELATED), res); in IsoClientStartPackData()
61 params->baseParams.randSelf.length), res); in IsoClientStartPackData()
63 params->baseParams.authIdSelf.length), res); in IsoClientStartPackData()
64 GOTO_ERR_AND_SET_RET(AddIntToJson(payload, FIELD_OPERATION_CODE, params->opCode), res); in IsoClientStartPackData()
65 …TO_ERR_AND_SET_RET(AddByteToJson(payload, FIELD_SEED, params->seed.val, params->seed.length), res); in IsoClientStartPackData()
66 GOTO_ERR_AND_SET_RET(AddIntToJson(payload, FIELD_PEER_USER_TYPE, params->selfUserType), res); in IsoClientStartPackData()
68 GOTO_ERR_AND_SET_RET(AddStringToJson(payload, FIELD_PKG_NAME, params->packageName), res); in IsoClientStartPackData()
[all …]
/base/security/device_auth/services/authenticators/src/account_unrelated/pake_task/standard_exchange_task/
Dstandard_exchange_message_util.c27 int32_t res = HC_SUCCESS; in PackageNonceAndCipherToJson() local
32 res = HC_ERR_ALLOC_MEMORY; in PackageNonceAndCipherToJson()
37 res = HC_ERR_MEMORY_COPY; in PackageNonceAndCipherToJson()
43 res = HC_ERR_MEMORY_COPY; in PackageNonceAndCipherToJson()
46 GOTO_ERR_AND_SET_RET(AddByteToJson(data, key, exAuthInfoVal, exAuthInfoLen), res); in PackageNonceAndCipherToJson()
49 return res; in PackageNonceAndCipherToJson()
54 int32_t res = HC_SUCCESS; in ParseNonceAndCipherFromJson() local
59 res = HC_ERR_JSON_GET; in ParseNonceAndCipherFromJson()
66 res = HC_ERR_ALLOC_MEMORY; in ParseNonceAndCipherFromJson()
69 res = HexStringToByte(exAuthInfoStr, exAuthInfoVal, exAuthInfoLen); in ParseNonceAndCipherFromJson()
[all …]
/base/security/device_auth/services/authenticators/src/account_unrelated/iso_task/lite_exchange_task/
Diso_server_bind_exchange_task.c53 int res; in Process() local
55 res = GetIntFromJson(in, FIELD_MESSAGE, &message); in Process()
56 if (res != 0 || message != ISO_CLIENT_BIND_EXCHANGE_CONFIRM) { in Process()
59 res = CheckEncResult(params, in, RESULT_AAD); in Process()
60 if (res != 0) { in Process()
61 LOGE("CheckEncResult failed, res:%d", res); in Process()
63 return res; in Process()
65 res = SendResultToFinalSelf(params, out, false); in Process()
66 if (res != 0) { in Process()
67 LOGE("SendResultToFinalSelf failed, res:%d", res); in Process()
[all …]

12345678910>>...20