Home
last modified time | relevance | path

Searched refs:sharedSecret (Results 1 - 25 of 32) sorted by relevance

12

/base/security/device_auth/services/identity_manager/src/
H A Didentity_pin.c236 Uint8Buff *sharedSecret) in AuthGeneratePskUsePin()
252 return GetLoaderInstance()->computeHmac(&keyParams, seed, sharedSecret); in AuthGeneratePskUsePin()
268 static int32_t GetSharedSecretForPinInIso(const CJson *in, Uint8Buff *sharedSecret) in GetSharedSecretForPinInIso() argument
303 sharedSecret->val = pskVal; in GetSharedSecretForPinInIso()
304 sharedSecret->length = ISO_PSK_LEN; in GetSharedSecretForPinInIso()
305 ret = AuthGeneratePskUsePin(in, &seedBuff, pinCode, sharedSecret); in GetSharedSecretForPinInIso()
309 FreeBuffData(sharedSecret); in GetSharedSecretForPinInIso()
314 static int32_t GetSharedSecretForPinInPake(const CJson *in, Uint8Buff *sharedSecret) in GetSharedSecretForPinInPake() argument
326 sharedSecret->val = (uint8_t *)HcMalloc(pinLen, 0); in GetSharedSecretForPinInPake()
327 if (sharedSecret in GetSharedSecretForPinInPake()
235 AuthGeneratePskUsePin(const CJson *in, const Uint8Buff *seed, const char *pinCode, Uint8Buff *sharedSecret) AuthGeneratePskUsePin() argument
340 GetSharedSecretByUrl( const CJson *in, const Uint8Buff *presharedUrl, ProtocolAlgType protocolType, Uint8Buff *sharedSecret) GetSharedSecretByUrl() argument
368 GetSharedSecretByPeerCert( const CJson *in, const CertInfo *peerCertInfo, ProtocolAlgType protocolType, Uint8Buff *sharedSecret) GetSharedSecretByPeerCert() argument
[all...]
H A Didentity_common.c31 int32_t ConvertPsk(const Uint8Buff *srcPsk, Uint8Buff *sharedSecret) in ConvertPsk() argument
34 sharedSecret->val = (uint8_t *)HcMalloc(len + 1, 0); in ConvertPsk()
35 if (sharedSecret->val == NULL) { in ConvertPsk()
36 LOGE("Failed to alloc memory for sharedSecret!"); in ConvertPsk()
40 if (ByteToHexString(srcPsk->val, srcPsk->length, (char *)sharedSecret->val, len + 1) != HC_SUCCESS) { in ConvertPsk()
42 HcFree(sharedSecret->val); in ConvertPsk()
45 sharedSecret->length = len; in ConvertPsk()
46 (void)UpperToLowercase(sharedSecret); in ConvertPsk()
H A Dcert_operation.c31 #define FIELD_SHARED_SECRET "sharedSecret"
311 const CertInfo *peerCertInfo, Uint8Buff *sharedSecret) in GetSharedSecretForAccountInPake()
332 sharedSecret->val = (uint8_t *)HcMalloc(sharedKeyAliasLen, 0); in GetSharedSecretForAccountInPake()
333 if (sharedSecret->val == NULL) { in GetSharedSecretForAccountInPake()
339 sharedSecret->length = sharedKeyAliasLen; in GetSharedSecretForAccountInPake()
340 (void)memcpy_s(sharedSecret->val, sharedKeyAliasLen, SHARED_KEY_ALIAS, sharedKeyAliasLen); in GetSharedSecretForAccountInPake()
344 &privKeyParams, &pubKeyBuff, P256, P256_SHARED_SECRET_KEY_SIZE, sharedSecret); in GetSharedSecretForAccountInPake()
349 FreeBuffData(sharedSecret); in GetSharedSecretForAccountInPake()
656 int32_t osAccountId, const char *peerUserId, const CertInfo *peerCertInfo, Uint8Buff *sharedSecret) in GetSharedSecretByPeerCertFromPlugin()
691 sharedSecret in GetSharedSecretByPeerCertFromPlugin()
310 GetSharedSecretForAccountInPake(int32_t osAccountId, const char *userId, const char *authId, const CertInfo *peerCertInfo, Uint8Buff *sharedSecret) GetSharedSecretForAccountInPake() argument
655 GetSharedSecretByPeerCertFromPlugin( int32_t osAccountId, const char *peerUserId, const CertInfo *peerCertInfo, Uint8Buff *sharedSecret) GetSharedSecretByPeerCertFromPlugin() argument
700 GetAccountAsymSharedSecret(int32_t osAccountId, const char *peerUserId, const CertInfo *peerCertInfo, Uint8Buff *sharedSecret) GetAccountAsymSharedSecret() argument
734 GetAccountSymSharedSecret(const CJson *in, const CJson *urlJson, Uint8Buff *sharedSecret) GetAccountSymSharedSecret() argument
[all...]
H A Didentity_group.c479 static int32_t AuthGeneratePsk(const CJson *in, const char *groupId, const Uint8Buff *seed, Uint8Buff *sharedSecret) in AuthGeneratePsk() argument
512 ret = GetLoaderInstance()->computeHmacWithThreeStage(&keyAliasParams, seed, sharedSecret); in AuthGeneratePsk()
515 ret = GetLoaderInstance()->computeHmac(&keyAliasParams, seed, sharedSecret); in AuthGeneratePsk()
521 static int32_t GetSharedSecretForP2pInIso(const CJson *in, const char *groupId, Uint8Buff *sharedSecret) in GetSharedSecretForP2pInIso() argument
541 sharedSecret->val = pskVal; in GetSharedSecretForP2pInIso()
542 sharedSecret->length = ISO_PSK_LEN; in GetSharedSecretForP2pInIso()
543 ret = AuthGeneratePsk(in, groupId, &seedBuff, sharedSecret); in GetSharedSecretForP2pInIso()
547 FreeBuffData(sharedSecret); in GetSharedSecretForP2pInIso()
769 static int32_t GetSharedSecretForP2pInPake(const CJson *in, const char *groupId, Uint8Buff *sharedSecret) in GetSharedSecretForP2pInPake() argument
813 ret = ConvertPsk(&pskBuff, sharedSecret); in GetSharedSecretForP2pInPake()
821 GetSharedSecretForP2p( const CJson *in, const CJson *urlJson, ProtocolAlgType protocolType, Uint8Buff *sharedSecret) GetSharedSecretForP2p() argument
840 GetSharedSecretByUrl( const CJson *in, const Uint8Buff *presharedUrl, ProtocolAlgType protocolType, Uint8Buff *sharedSecret) GetSharedSecretByUrl() argument
908 GetSharedSecretByPeerCert( const CJson *in, const CertInfo *peerCertInfo, ProtocolAlgType protocolType, Uint8Buff *sharedSecret) GetSharedSecretByPeerCert() argument
[all...]
/base/security/device_auth/services/key_agree_sdk/src/
H A Dkey_agree_sdk.c33 static int32_t CheckKeyAgreeStartSessionParams(const KeyAgreeBlob *sharedSecret, in CheckKeyAgreeStartSessionParams() argument
36 if ((sharedSecret->length < MIN_SHARED_SECRET_LENGTH) || (sharedSecret->length > MAX_SHARED_SECRET_LENGTH)) { in CheckKeyAgreeStartSessionParams()
37 LOGE("Invalid length of sharedSecret!"); in CheckKeyAgreeStartSessionParams()
40 if (strnlen((const char *)(sharedSecret->data), sharedSecret->length) > sharedSecret->length + 1) { in CheckKeyAgreeStartSessionParams()
41 LOGE("Length of sharedSecret check fail!"); in CheckKeyAgreeStartSessionParams()
107 static int32_t InitKeyAgreeStartSessionParams(SpekeSession *spekeSession, const KeyAgreeBlob *sharedSecret, in InitKeyAgreeStartSessionParams() argument
112 if (InitSingleParam(&(spekeSession->sharedSecret), sharedSecre in InitKeyAgreeStartSessionParams()
191 KeyAgreeStartSession(KeyAgreeSession *session, const KeyAgreeBlob *sharedSecret, const KeyAgreeBlob *deviceId, const char *extras) KeyAgreeStartSession() argument
[all...]
H A Dkey_agree_session.c398 if (spekeSession->sharedSecret.length < MIN_SHAREDSECRET_LEN || in FillPskAndDeviceId()
399 spekeSession->sharedSecret.length > MAX_SHAREDSECRET_LEN) { in FillPskAndDeviceId()
400 LOGE("sharedSecret len is invalid."); in FillPskAndDeviceId()
404 int32_t res = InitSingleParam(&(spekeSession->baseParam.psk), spekeSession->sharedSecret.length); in FillPskAndDeviceId()
410 spekeSession->sharedSecret.val, spekeSession->sharedSecret.length) != HC_SUCCESS) { in FillPskAndDeviceId()
662 FreeAndCleanKey(&spekeSession->sharedSecret); in PakeClientVerifyConfirm()
940 FreeAndCleanKey(&spekeSession->sharedSecret); in DestroySpekeSession()
962 spekeSession->sharedSecret.val = NULL; in CreateSpekeSession()
963 spekeSession->sharedSecret in CreateSpekeSession()
[all...]
/base/security/device_auth/services/identity_manager/src/mock/
H A Dcert_operation_mock.c31 Uint8Buff *sharedSecret) in GetAccountAsymSharedSecret()
36 (void)sharedSecret; in GetAccountAsymSharedSecret()
40 int32_t GetAccountSymSharedSecret(const CJson *in, const CJson *urlJson, Uint8Buff *sharedSecret) in GetAccountSymSharedSecret() argument
44 (void)sharedSecret; in GetAccountSymSharedSecret()
30 GetAccountAsymSharedSecret(int32_t osAccountId, const char *peerUserId, const CertInfo *peerCertInfo, Uint8Buff *sharedSecret) GetAccountAsymSharedSecret() argument
/base/security/device_auth/services/creds_manager/src/
H A Dcreds_manager.c154 const CJson *in, const Uint8Buff *presharedUrl, ProtocolAlgType protocolType, Uint8Buff *sharedSecret) in GetSharedSecretByUrl()
156 if (in == NULL || presharedUrl == NULL || sharedSecret == NULL) { in GetSharedSecretByUrl()
166 authIdentityTest->getSharedSecretByUrl(in, presharedUrl, protocolType, sharedSecret); in GetSharedSecretByUrl()
172 authIdentityTest->getSharedSecretByUrl(in, presharedUrl, protocolType, sharedSecret); in GetSharedSecretByUrl()
181 return authIdentity->getSharedSecretByUrl(in, presharedUrl, protocolType, sharedSecret); in GetSharedSecretByUrl()
213 const CJson *in, const CertInfo *peerCertInfo, ProtocolAlgType protocolType, Uint8Buff *sharedSecret) in GetSharedSecretByPeerCert()
215 if (in == NULL || peerCertInfo == NULL || sharedSecret == NULL) { in GetSharedSecretByPeerCert()
225 authIdentityTest->getSharedSecretByPeerCert(in, peerCertInfo, protocolType, sharedSecret); in GetSharedSecretByPeerCert()
231 authIdentityTest->getSharedSecretByPeerCert(in, peerCertInfo, protocolType, sharedSecret); in GetSharedSecretByPeerCert()
238 return authIdentity->getSharedSecretByPeerCert(in, peerCertInfo, protocolType, sharedSecret); in GetSharedSecretByPeerCert()
153 GetSharedSecretByUrl( const CJson *in, const Uint8Buff *presharedUrl, ProtocolAlgType protocolType, Uint8Buff *sharedSecret) GetSharedSecretByUrl() argument
212 GetSharedSecretByPeerCert( const CJson *in, const CertInfo *peerCertInfo, ProtocolAlgType protocolType, Uint8Buff *sharedSecret) GetSharedSecretByPeerCert() argument
[all...]
/base/security/device_auth/services/protocol/src/pake_protocol/pake_protocol_dl_common_mock/
H A Dpake_protocol_dl_common_mock.c36 int32_t AgreeDlSharedSecret(PakeBaseParams *params, Uint8Buff *sharedSecret) in AgreeDlSharedSecret() argument
39 (void)sharedSecret; in AgreeDlSharedSecret()
/base/security/device_auth/services/protocol/src/pake_protocol/pake_protocol_ec_common_mock/
H A Dpake_protocol_ec_common_mock.c36 int32_t AgreeEcSharedSecret(PakeBaseParams *params, Uint8Buff *sharedSecret) in AgreeEcSharedSecret() argument
39 (void)sharedSecret; in AgreeEcSharedSecret()
/base/security/device_auth/services/creds_manager/inc/
H A Dcreds_manager.h30 const CJson *in, const Uint8Buff *presharedUrl, ProtocolAlgType protocolType, Uint8Buff *sharedSecret);
33 const CJson *in, const CertInfo *peerCertInfo, ProtocolAlgType protocolType, Uint8Buff *sharedSecret);
/base/security/device_auth/services/identity_manager/inc/
H A Dcert_operation.h29 Uint8Buff *sharedSecret);
30 int32_t GetAccountSymSharedSecret(const CJson *in, const CJson *urlJson, Uint8Buff *sharedSecret);
H A Didentity_manager.h46 const CJson *in, const Uint8Buff *presharedUrl, ProtocolAlgType protocolType, Uint8Buff *sharedSecret);
49 const CJson *in, const CertInfo *peerCertInfo, ProtocolAlgType protocolType, Uint8Buff *sharedSecret);
H A Didentity_common.h28 int32_t ConvertPsk(const Uint8Buff *srcPsk, Uint8Buff *sharedSecret);
/base/security/device_auth/test/fuzztest/creds_manager/credsmanager_fuzzer/
H A Dcredsmanager_fuzzer.cpp1198 Uint8Buff sharedSecret = { nullptr, 0 }; in CredsManagerTest38() local
1199 res = GetSharedSecretByUrl(json, &presharedUrl, ALG_ISO, &sharedSecret); in CredsManagerTest38()
1209 res = GetSharedSecretByUrl(json, &presharedUrl, ALG_ISO, &sharedSecret); in CredsManagerTest38()
1222 res = GetSharedSecretByUrl(json, &presharedUrl, ALG_ISO, &sharedSecret); in CredsManagerTest38()
1241 Uint8Buff sharedSecret = { nullptr, 0 }; in CredsManagerTest39() local
1242 (void)GetSharedSecretByUrl(json, &presharedUrl, ALG_ISO, &sharedSecret); in CredsManagerTest39()
1266 Uint8Buff sharedSecret = { nullptr, 0 }; in CredsManagerTest40() local
1267 res = GetSharedSecretByUrl(json, &presharedUrl, ALG_ISO, &sharedSecret); in CredsManagerTest40()
1269 HcFree(sharedSecret.val); in CredsManagerTest40()
1287 Uint8Buff sharedSecret in CredsManagerTest41() local
1304 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest42() local
1321 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest43() local
1337 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest44() local
1353 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest45() local
1370 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest46() local
1388 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest47() local
1407 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest48() local
1427 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest49() local
1455 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest50() local
1492 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest51() local
1528 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest52() local
1548 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest53() local
1565 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest54() local
1590 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest55() local
1620 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest56() local
1652 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest57() local
1673 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest58() local
1692 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest59() local
1713 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest60() local
1742 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest61() local
1770 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest62() local
1802 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest63() local
1818 Uint8Buff sharedSecret = { nullptr, 0 }; CredsManagerTest64() local
[all...]
/base/security/device_auth/test/unittest/tdd_framework/unit_test/services/creds_manager/
H A Dcreds_manager_test.cpp1291 Uint8Buff sharedSecret = { nullptr, 0 }; in HWTEST_F() local
1292 res = GetSharedSecretByUrl(json, &presharedUrl, ALG_ISO, &sharedSecret); in HWTEST_F()
1301 res = GetSharedSecretByUrl(json, &presharedUrl, ALG_ISO, &sharedSecret); in HWTEST_F()
1313 res = GetSharedSecretByUrl(json, &presharedUrl, ALG_ISO, &sharedSecret); in HWTEST_F()
1333 Uint8Buff sharedSecret = { nullptr, 0 }; in HWTEST_F() local
1334 int32_t res = GetSharedSecretByUrl(json, &presharedUrl, ALG_ISO, &sharedSecret); in HWTEST_F()
1359 Uint8Buff sharedSecret = { nullptr, 0 }; in HWTEST_F() local
1361 res = GetSharedSecretByUrl(json, &presharedUrl, ALG_ISO, &sharedSecret); in HWTEST_F()
1364 HcFree(sharedSecret.val); in HWTEST_F()
1382 Uint8Buff sharedSecret in HWTEST_F() local
1403 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1424 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1444 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1464 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1485 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1507 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1530 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1554 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1583 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1617 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1651 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1672 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1693 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1719 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1747 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1777 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1799 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1822 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1847 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1877 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1896 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1922 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
1940 Uint8Buff sharedSecret = { nullptr, 0 }; HWTEST_F() local
[all...]
/base/security/device_auth/services/protocol/src/pake_protocol/pake_protocol_ec_common/
H A Dpake_protocol_ec_common.c113 int32_t AgreeEcSharedSecret(PakeBaseParams *params, Uint8Buff *sharedSecret) in AgreeEcSharedSecret() argument
133 res = params->loader->agreeSharedSecret(&eskSelfParams, &epkPeerBuff, alg, sharedSecret); in AgreeEcSharedSecret()
138 PRINT_DEBUG_MSG(sharedSecret->val, sharedSecret->length, "sharedSecret"); in AgreeEcSharedSecret()
/base/security/device_auth/services/protocol/inc/pake_protocol/pake_protocol_dl_common/
H A Dpake_protocol_dl_common.h29 int32_t AgreeDlSharedSecret(PakeBaseParams *params, Uint8Buff *sharedSecret);
/base/security/device_auth/services/protocol/inc/pake_protocol/pake_protocol_ec_common/
H A Dpake_protocol_ec_common.h29 int32_t AgreeEcSharedSecret(PakeBaseParams *params, Uint8Buff *sharedSecret);
/base/security/device_auth/services/protocol/src/pake_protocol/
H A Dpake_common.c28 FreeAndCleanKey(&params->sharedSecret); in CleanPakeSensitiveKeys()
/base/security/device_auth/services/protocol/src/pake_protocol/pake_v1_protocol/
H A Dpake_v1_protocol_common.c133 params->sharedSecret.val = NULL; in FillDefaultValue()
134 params->sharedSecret.length = 0; in FillDefaultValue()
242 .keyBuff = { params->sharedSecret.val, params->sharedSecret.length, false }, in DeriveKeyFromSharedSecret()
252 FreeAndCleanKey(&params->sharedSecret); in DeriveKeyFromSharedSecret()
273 int32_t res = InitSingleParam(&params->sharedSecret, params->innerKeyLen); in GenerateSessionKey()
275 LOGE("InitSingleParam for sharedSecret failed, res: %x.", res); in GenerateSessionKey()
280 res = AgreeEcSharedSecret(params, &params->sharedSecret); in GenerateSessionKey()
282 res = AgreeDlSharedSecret(params, &params->sharedSecret); in GenerateSessionKey()
/base/security/device_auth/services/protocol/src/pake_protocol/pake_v2_protocol/
H A Dpake_v2_protocol_common.c81 params->sharedSecret.length = SHA256_LEN; in AllocDefaultParams()
82 params->sharedSecret.val = (uint8_t *)HcMalloc(params->sharedSecret.length, 0); in AllocDefaultParams()
83 if (params->sharedSecret.val == NULL) { in AllocDefaultParams()
84 LOGE("Malloc for sharedSecret failed."); in AllocDefaultParams()
358 LOGE("Memcpy for sharedSecret derived factor failed."); in ComputeSharedSecret()
363 res = params->loader->sha256(&sharedSecretMsg, &params->sharedSecret); in ComputeSharedSecret()
379 * sharedSecret = hash(hex(sid) | Z_X | derivedFactor)
402 LOGE("Agree intermediate sharedSecret failed, pakeAlgType: 0x%x, res: %x.", params->supportedPakeAlg, res); in GenerateSharedSecret()
475 params->sharedSecret in CombineProofMsg()
[all...]
/base/security/device_auth/services/protocol/inc/pake_protocol/
H A Dpake_defs.h61 Uint8Buff sharedSecret; member
/base/security/device_auth/services/key_agree_sdk/inc/
H A Dkey_agree_sdk.h98 KeyAgreeResult KeyAgreeStartSession(KeyAgreeSession *session, const KeyAgreeBlob *sharedSecret,
H A Dkey_agree_session.h86 Uint8Buff sharedSecret; member

Completed in 22 milliseconds

12