/base/security/device_auth/services/key_agree_sdk/src/ |
D | key_agree_sdk.c | 33 static int32_t CheckKeyAgreeStartSessionParams(const KeyAgreeBlob *sharedSecret, in CheckKeyAgreeStartSessionParams() argument 36 …if ((sharedSecret->length < MIN_SHARED_SECRET_LENGTH) || (sharedSecret->length > MAX_SHARED_SECRET… in CheckKeyAgreeStartSessionParams() 40 …if (strnlen((const char *)(sharedSecret->data), sharedSecret->length) > sharedSecret->length + 1) { in CheckKeyAgreeStartSessionParams() 107 …nt32_t InitKeyAgreeStartSessionParams(SpekeSession *spekeSession, const KeyAgreeBlob *sharedSecret, in InitKeyAgreeStartSessionParams() argument 112 if (InitSingleParam(&(spekeSession->sharedSecret), sharedSecret->length) != HC_SUCCESS) { in InitKeyAgreeStartSessionParams() 117 if (memcpy_s(spekeSession->sharedSecret.val, spekeSession->sharedSecret.length, in InitKeyAgreeStartSessionParams() 118 sharedSecret->data, sharedSecret->length) != HC_SUCCESS) { in InitKeyAgreeStartSessionParams() 139 FreeAndCleanKey(&spekeSession->sharedSecret); in InitKeyAgreeStartSessionParams() 190 KeyAgreeResult KeyAgreeStartSession(KeyAgreeSession *session, const KeyAgreeBlob *sharedSecret, in KeyAgreeStartSession() argument 194 if ((sharedSecret == NULL) || (deviceId == NULL) || (session == NULL)) { in KeyAgreeStartSession() [all …]
|
D | key_agree_session.c | 398 if (spekeSession->sharedSecret.length < MIN_SHAREDSECRET_LEN || in FillPskAndDeviceId() 399 spekeSession->sharedSecret.length > MAX_SHAREDSECRET_LEN) { 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.length = 0; in CreateSpekeSession()
|
/base/security/device_auth/services/creds_manager/src/account_related_mock/ |
D | account_related_creds_manager_mock.c | 31 …AccountAsymSharedSecret(int32_t osAccountId, const CertInfo *peerCertInfo, Uint8Buff *sharedSecret) in GetAccountAsymSharedSecret() argument 35 (void)sharedSecret; in GetAccountAsymSharedSecret() 39 int32_t GetAccountSymSharedSecret(const CJson *in, const CJson *urlJson, Uint8Buff *sharedSecret) in GetAccountSymSharedSecret() argument 43 (void)sharedSecret; in GetAccountSymSharedSecret()
|
/base/security/device_auth/services/creds_manager/src/ |
D | creds_manager.c | 286 static int32_t GetSharedSecretForPinInPake(const CJson *in, Uint8Buff *sharedSecret) in GetSharedSecretForPinInPake() argument 294 sharedSecret->val = (uint8_t *)HcMalloc(pinLen, 0); in GetSharedSecretForPinInPake() 295 if (sharedSecret->val == NULL) { in GetSharedSecretForPinInPake() 299 if (memcpy_s(sharedSecret->val, pinLen, pinCode, pinLen) != HC_SUCCESS) { in GetSharedSecretForPinInPake() 301 FreeBuffData(sharedSecret); in GetSharedSecretForPinInPake() 304 sharedSecret->length = pinLen; in GetSharedSecretForPinInPake() 340 Uint8Buff *sharedSecret) in AuthGeneratePsk() argument 349 return GetLoaderInstance()->computeHmac(&keyAliasBuf, seed, sharedSecret, true); in AuthGeneratePsk() 352 … int32_t AuthGeneratePskUsePin(const Uint8Buff *seed, const char *pinCode, Uint8Buff *sharedSecret) in AuthGeneratePskUsePin() argument 362 return GetLoaderInstance()->computeHmac(&hashBuf, seed, sharedSecret, false); in AuthGeneratePskUsePin() [all …]
|
/base/security/device_auth/services/protocol/src/pake_protocol/pake_protocol_dl_common_mock/ |
D | pake_protocol_dl_common_mock.c | 36 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/ |
D | pake_protocol_ec_common_mock.c | 36 int32_t AgreeEcSharedSecret(PakeBaseParams *params, Uint8Buff *sharedSecret) in AgreeEcSharedSecret() argument 39 (void)sharedSecret; in AgreeEcSharedSecret()
|
/base/security/device_auth/services/creds_manager/src/account_related/ |
D | account_related_creds_manager.c | 137 const CertInfo *peerCertInfo, Uint8Buff *sharedSecret) in GetSharedSecretForAccountInPake() argument 168 sharedSecret->val = (uint8_t *)HcMalloc(sharedKeyAliasLen, 0); in GetSharedSecretForAccountInPake() 169 if (sharedSecret->val == NULL) { in GetSharedSecretForAccountInPake() 174 sharedSecret->length = sharedKeyAliasLen; in GetSharedSecretForAccountInPake() 175 (void)memcpy_s(sharedSecret->val, sharedKeyAliasLen, SHARED_KEY_ALIAS, sharedKeyAliasLen); in GetSharedSecretForAccountInPake() 177 P256, P256_SHARED_SECRET_KEY_SIZE, sharedSecret); in GetSharedSecretForAccountInPake() 181 FreeBuffData(sharedSecret); in GetSharedSecretForAccountInPake() 488 Uint8Buff *sharedSecret) in GetSharedSecretByPeerCertFromPlugin() argument 519 sharedSecret->val = aliasVal; in GetSharedSecretByPeerCertFromPlugin() 520 sharedSecret->length = sharedKeyAliasLen; in GetSharedSecretByPeerCertFromPlugin() [all …]
|
/base/security/device_auth/services/creds_manager/inc/account_related/ |
D | account_related_creds_manager.h | 28 …ccountAsymSharedSecret(int32_t osAccountId, const CertInfo *peerCertInfo, Uint8Buff *sharedSecret); 29 int32_t GetAccountSymSharedSecret(const CJson *in, const CJson *urlJson, Uint8Buff *sharedSecret);
|
/base/security/device_auth/services/creds_manager/inc/ |
D | creds_manager.h | 30 Uint8Buff *sharedSecret); 33 Uint8Buff *sharedSecret);
|
/base/security/device_auth/test/unittest/tdd_framework/unit_test/services/creds_manager/ |
D | creds_manager_test.cpp | 1294 Uint8Buff sharedSecret = { nullptr, 0 }; variable 1295 res = GetSharedSecretByUrl(json, &presharedUrl, ALG_ISO, &sharedSecret); 1304 res = GetSharedSecretByUrl(json, &presharedUrl, ALG_ISO, &sharedSecret); 1315 res = GetSharedSecretByUrl(json, &presharedUrl, ALG_ISO, &sharedSecret); 1335 Uint8Buff sharedSecret = { nullptr, 0 }; variable 1336 int32_t res = GetSharedSecretByUrl(json, &presharedUrl, ALG_ISO, &sharedSecret); 1361 Uint8Buff sharedSecret = { nullptr, 0 }; variable 1362 res = GetSharedSecretByUrl(json, &presharedUrl, ALG_ISO, &sharedSecret); 1365 HcFree(sharedSecret.val); 1382 Uint8Buff sharedSecret = { nullptr, 0 }; variable [all …]
|
/base/security/device_auth/services/protocol/inc/pake_protocol/pake_protocol_ec_common/ |
D | pake_protocol_ec_common.h | 29 int32_t AgreeEcSharedSecret(PakeBaseParams *params, Uint8Buff *sharedSecret);
|
/base/security/device_auth/services/protocol/inc/pake_protocol/pake_protocol_dl_common/ |
D | pake_protocol_dl_common.h | 29 int32_t AgreeDlSharedSecret(PakeBaseParams *params, Uint8Buff *sharedSecret);
|
/base/security/device_auth/services/protocol/src/pake_protocol/ |
D | pake_common.c | 28 FreeAndCleanKey(¶ms->sharedSecret); in CleanPakeSensitiveKeys()
|
/base/security/device_auth/services/protocol/src/pake_protocol/pake_v2_protocol/ |
D | pake_v2_protocol_common.c | 81 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() 361 res = params->loader->sha256(&sharedSecretMsg, ¶ms->sharedSecret); in ComputeSharedSecret() 473 params->sharedSecret.val, params->sharedSecret.length) != EOK) { in CombineProofMsg() 477 usedLen += params->sharedSecret.length; in CombineProofMsg() 501 params->sharedSecret.length + params->innerKeyLen + params->extraData.length; in GenerateProof() 531 params->sharedSecret.length + params->innerKeyLen + params->extraData.length; in VerifyProof() 567 …int res = params->loader->computeHkdf(¶ms->sharedSecret, ¶ms->salt, &keyInfo, ¶ms->ses… in GenerateSessionKey() 573 FreeAndCleanKey(¶ms->sharedSecret); in GenerateSessionKey()
|
/base/security/device_auth/services/protocol/src/pake_protocol/pake_v1_protocol/ |
D | pake_v1_protocol_common.c | 133 params->sharedSecret.val = NULL; in FillDefaultValue() 134 params->sharedSecret.length = 0; in FillDefaultValue() 235 …res = params->loader->computeHkdf(&(params->sharedSecret), &(params->salt), &keyInfo, &unionKey, f… in DeriveKeyFromSharedSecret() 240 FreeAndCleanKey(¶ms->sharedSecret); in DeriveKeyFromSharedSecret() 259 int32_t res = InitSingleParam(¶ms->sharedSecret, params->innerKeyLen); in GenerateSessionKey() 266 res = AgreeEcSharedSecret(params, ¶ms->sharedSecret); in GenerateSessionKey() 268 res = AgreeDlSharedSecret(params, ¶ms->sharedSecret); in GenerateSessionKey()
|
/base/security/device_auth/services/protocol/inc/pake_protocol/ |
D | pake_defs.h | 61 Uint8Buff sharedSecret; member
|
/base/security/device_auth/services/protocol/src/pake_protocol/pake_protocol_ec_common/ |
D | pake_protocol_ec_common.c | 110 int32_t AgreeEcSharedSecret(PakeBaseParams *params, Uint8Buff *sharedSecret) in AgreeEcSharedSecret() argument 129 res = params->loader->agreeSharedSecret(&eskSelfBuff, &epkPeerBuff, alg, sharedSecret); in AgreeEcSharedSecret()
|
/base/security/device_auth/services/protocol/src/pake_protocol/pake_protocol_dl_common/ |
D | pake_protocol_dl_common.c | 172 int32_t AgreeDlSharedSecret(PakeBaseParams *params, Uint8Buff *sharedSecret) in AgreeDlSharedSecret() argument 184 …ader->bigNumExpMod(&(params->epkPeer), &(params->eskSelf), params->largePrimeNumHex, sharedSecret); in AgreeDlSharedSecret()
|
/base/security/device_auth/services/key_agree_sdk/inc/ |
D | key_agree_sdk.h | 97 KeyAgreeResult KeyAgreeStartSession(KeyAgreeSession *session, const KeyAgreeBlob *sharedSecret,
|
D | key_agree_session.h | 86 Uint8Buff sharedSecret; member
|
/base/security/device_auth/services/session_manager/src/session/v2/auth_sub_session/protocol_lib/ |
D | ec_speke_protocol.c | 68 Uint8Buff sharedSecret; member 491 if (InitUint8Buff(¶ms->sharedSecret, SHA256_LEN)) { in CalSharedSecret() 496 res = GetLoaderInstance()->sha256(&sharedSecretMsg, ¶ms->sharedSecret); in CalSharedSecret() 551 params->sharedSecret.val, params->sharedSecret.length) != EOK) { in GenerateKcfDataMsg() 555 usedLen += params->sharedSecret.length; in GenerateKcfDataMsg() 640 …int32_t res = GetLoaderInstance()->computeHkdf(&impl->params.sharedSecret, &impl->params.salt, &ke… in CalSessionKey() 643 ClearFreeUint8Buff(&impl->params.sharedSecret); in CalSessionKey() 1079 ClearFreeUint8Buff(&impl->params.sharedSecret); in DestroyEcSpekeProtocol()
|
/base/security/huks/services/huks_standard/huks_engine/main/core/src/ |
D | hks_core_service.c | 664 struct HksBlob sharedSecret = { 0, NULL }; in AgreeSharedSecretWithPeerPublicKey() local 665 sharedSecret.size = HKS_KEY_BYTES(HKS_AES_KEY_SIZE_256); in AgreeSharedSecretWithPeerPublicKey() 666 uint8_t *shareSecretBuffer = (uint8_t *) HksMalloc(sharedSecret.size); in AgreeSharedSecretWithPeerPublicKey() 672 sharedSecret.data = shareSecretBuffer; in AgreeSharedSecretWithPeerPublicKey() 674 ret = HksCoreAgreeKey(agreeKeyParamSet, wrappingKey, publicKey, &sharedSecret); in AgreeSharedSecretWithPeerPublicKey() 678 HKS_FREE_PTR(sharedSecret.data); in AgreeSharedSecretWithPeerPublicKey() 682 agreeSharedSecret->size = sharedSecret.size; in AgreeSharedSecretWithPeerPublicKey() 683 agreeSharedSecret->data = sharedSecret.data; in AgreeSharedSecretWithPeerPublicKey()
|