/test/xts/device_attest/services/core/security/ |
H A D | attest_security_ticket.c | 29 uint8_t salt[SALT_LEN] = {0}; in WriteTicketToDevice() local 38 GetSalt(salt, sizeof(salt)); in WriteTicketToDevice() 45 SecurityParam saltParam = {salt, sizeof(salt)}; in WriteTicketToDevice() 61 memcpy_s(ticketInfo.salt, sizeof(ticketInfo.salt), salt, SALT_LEN) != 0) { in WriteTicketToDevice() 62 ATTEST_LOG_ERROR("[WriteTicketToDevice] ticket or salt memcpy_s fail."); in WriteTicketToDevice() 94 SecurityParam saltParam = {(uint8_t*)ticketInfo.salt, sizeo in ReadTicketFromDevice() [all...] |
H A D | attest_security_token.c | 136 const char *salt = "OpenHarmony/salt"; in GetTokenValueSpecial() local 138 int32_t ret = EncryptHmac(salt, ikm, strlen((const char *)ikm), prk, sizeof(prk)); in GetTokenValueSpecial() 246 static int32_t GetProductSalt(char *salt, int32_t saltLen) in GetProductSalt() argument 248 if (salt == NULL || saltLen < 0) { in GetProductSalt() 264 int32_t ret = Sha256ValueToAscii((unsigned char *)udid, strlen(udid), salt, saltLen); in GetProductSalt() 347 char salt[SHA256_OUTPUT_SIZE + 1] = {0}; in GetProductToken() local 348 int32_t ret = GetProductSalt((char *)salt, SHA256_OUTPUT_SIZE); in GetProductToken() 372 ret = mbedtls_hkdf(mdInfo, (const unsigned char*)salt, SHA256_OUTPUT_SIZE, in GetProductToken() 484 SecurityParam saltParam = {(uint8_t*)tokenInfo->salt, sizeo in GetDecryptedTokenValue() 626 uint8_t salt[SALT_LEN] = {0}; GetTokenInfo() local [all...] |
H A D | attest_security.c | 152 void GetSalt(uint8_t* salt, uint32_t saltLen) in GetSalt() argument 154 if ((salt == NULL) || (saltLen != SALT_LEN)) { in GetSalt() 167 salt[i] = (uint8_t)((temp >> ((i % randomNumBytes) * offsetBits)) & 0xff); in GetSalt() 168 if (salt[i] == 0) { in GetSalt() 169 salt[i]++; in GetSalt() 339 int32_t GetAesKey(const SecurityParam* salt, const VersionData* versionData, const SecurityParam* aesKey) in GetAesKey() argument 341 if ((salt == NULL) || (versionData == NULL) || (aesKey == NULL) || (versionData->versionLen == 0)) { in GetAesKey() 362 ret = mbedtls_hkdf(mdInfo, salt->param, salt->paramLen, in GetAesKey()
|
/test/xts/device_attest_lite/services/core/security/ |
H A D | attest_security_ticket.c | 30 uint8_t salt[SALT_LEN] = {0}; in WriteTicketToDevice() local 40 GetSalt(salt, sizeof(salt)); in WriteTicketToDevice() 42 SecurityParam saltParam = {salt, sizeof(salt)}; in WriteTicketToDevice() 59 memcpy_s(ticketInfo.salt, sizeof(ticketInfo.salt), salt, SALT_LEN) != 0) { in WriteTicketToDevice() 60 ATTEST_LOG_ERROR("[WriteTicketToDevice] ticket or salt memcpy_s fail."); in WriteTicketToDevice() 87 SecurityParam saltParam = {(uint8_t*)ticketInfo.salt, sizeo in ReadTicketFromDevice() [all...] |
H A D | attest_security_token.c | 136 const char *salt = "OpenHarmony/salt"; in GetTokenValueSpecial() local 138 int32_t ret = EncryptHmac(salt, ikm, strlen((const char *)ikm), prk, sizeof(prk)); in GetTokenValueSpecial() 246 static int32_t GetProductSalt(unsigned char *salt, int32_t saltLen) in GetProductSalt() argument 248 if (salt == NULL || saltLen < 0) { in GetProductSalt() 264 int32_t ret = Sha256ValueToAscii((unsigned char *)udid, strlen(udid), salt, saltLen); in GetProductSalt() 347 unsigned char salt[SHA256_OUTPUT_SIZE + 1] = {0}; in GetProductToken() local 348 int32_t ret = GetProductSalt(salt, SHA256_OUTPUT_SIZE); in GetProductToken() 372 ret = mbedtls_hkdf(mdInfo, salt, SHA256_OUTPUT_SIZE, in GetProductToken() 476 SecurityParam saltParam = {(uint8_t*)tokenInfo->salt, sizeo in GetDecryptedTokenValue() 601 uint8_t salt[SALT_LEN] = {0}; GetTokenInfo() local [all...] |
H A D | attest_security.c | 74 void GetSalt(uint8_t* salt, uint32_t saltLen) in GetSalt() argument 76 if ((salt == NULL) || (saltLen != SALT_LEN)) { in GetSalt() 89 salt[i] = (uint8_t)((temp >> ((i % randomNumBytes) * offsetBits)) & 0xff); in GetSalt() 90 if (salt[i] == 0) { in GetSalt() 91 salt[i]++; in GetSalt() 164 int32_t GetAesKey(const SecurityParam* salt, const VersionData* versionData, const SecurityParam* aesKey) in GetAesKey() argument 166 if ((salt == NULL) || (versionData == NULL) || (aesKey == NULL) || (versionData->versionLen == 0)) { in GetAesKey() 187 ret = mbedtls_hkdf(mdInfo, salt->param, salt->paramLen, in GetAesKey()
|
/test/xts/device_attest/services/core/dfx/ |
H A D | attest_dfx.c | 231 if (tokenInfo->salt[0] == '\0') { in PrintTokenInfo() 232 ATTEST_LOG_WARN("salt = null;"); in PrintTokenInfo() 234 ATTEST_LOG_INFO("salt = %s;", (char*)(tokenInfo->salt)); in PrintTokenInfo() 256 if (ticketInfo->salt[0] == '\0') { in PrintTicketInfo() 257 ATTEST_LOG_WARN("salt = null;"); in PrintTicketInfo() 259 ATTEST_LOG_INFO("salt = %s;", (char*)(ticketInfo->salt)); in PrintTicketInfo()
|
/test/xts/device_attest_lite/services/core/dfx/ |
H A D | attest_dfx.c | 231 if (tokenInfo->salt[0] == '\0') { in PrintTokenInfo() 232 ATTEST_LOG_WARN("salt = null;"); in PrintTokenInfo() 234 ATTEST_LOG_INFO("salt = %s;", (char*)(tokenInfo->salt)); in PrintTokenInfo() 256 if (ticketInfo->salt[0] == '\0') { in PrintTicketInfo() 257 ATTEST_LOG_WARN("salt = null;"); in PrintTicketInfo() 259 ATTEST_LOG_INFO("salt = %s;", (char*)(ticketInfo->salt)); in PrintTicketInfo()
|
/test/xts/device_attest/services/core/adapter/ |
H A D | attest_adapter_hal.c | 69 if (memcpy_s(token + offset, sizeof(token), tokenInfo->salt, sizeof(tokenInfo->salt)) != 0) {
in AttestWriteToken() 118 if (memcpy_s(tokenInfo->salt, SALT_ENCRYPT_LEN, token + offset, SALT_ENCRYPT_LEN) != 0) {
in AttestReadToken()
|
H A D | attest_adapter_oem.c | 77 memcpy_s(ticketInfo->salt, SALT_ENCRYPT_LEN, ticket + TICKET_ENCRYPT_LEN, SALT_ENCRYPT_LEN) != 0) { in OEMReadTicket() 88 memcpy_s(ticket + TICKET_ENCRYPT_LEN, SALT_ENCRYPT_LEN, ticketInfo->salt, SALT_ENCRYPT_LEN) != 0) { in OEMWriteTicket()
|
/test/xts/device_attest_lite/services/core/adapter/ |
H A D | attest_adapter_hal.c | 69 if (memcpy_s(token + offset, sizeof(token), tokenInfo->salt, sizeof(tokenInfo->salt)) != 0) {
in AttestWriteToken() 130 if (memcpy_s(tokenInfo->salt, SALT_ENCRYPT_LEN, token + offset, SALT_ENCRYPT_LEN) != 0) {
in AttestReadToken()
|
H A D | attest_adapter_oem.c | 77 memcpy_s(ticketInfo->salt, SALT_ENCRYPT_LEN, ticket + TICKET_ENCRYPT_LEN, SALT_ENCRYPT_LEN) != 0) { in OEMReadTicket() 88 memcpy_s(ticket + TICKET_ENCRYPT_LEN, SALT_ENCRYPT_LEN, ticketInfo->salt, SALT_ENCRYPT_LEN) != 0) { in OEMWriteTicket()
|
/test/xts/device_attest_lite/services/core/include/security/ |
H A D | attest_security.h | 71 void GetSalt(uint8_t* salt, uint32_t saltLen); 73 int32_t GetAesKey(const SecurityParam* salt, const VersionData* versionData, const SecurityParam* aesKey);
|
/test/xts/device_attest/services/core/include/security/ |
H A D | attest_security.h | 75 void GetSalt(uint8_t* salt, uint32_t saltLen); 77 int32_t GetAesKey(const SecurityParam* salt, const VersionData* versionData, const SecurityParam* aesKey);
|
/test/xts/device_attest/services/core/include/ |
H A D | attest_type.h | 139 char salt[SALT_ENCRYPT_LEN]; member 145 char salt[SALT_ENCRYPT_LEN]; member
|
/test/xts/device_attest_lite/services/core/include/ |
H A D | attest_type.h | 125 char salt[SALT_ENCRYPT_LEN]; member 131 char salt[SALT_ENCRYPT_LEN]; member
|
/test/xts/acts/security/huks/security_huks_basic/utils/param/derive/ |
H A D | publicDeriveParam.js | 18 let salt = new Uint8Array([
300 value: salt
|
/test/xts/acts/security/huks/security_huks_reformed_test/utils/param/derive/ |
H A D | publicDeriveParam.js | 18 let salt = new Uint8Array([ 300 value: salt
|
/test/xts/device_attest/services/devattest_ability/test/tdd/gtest/src/ |
H A D | attest_tdd_mock_hal.c | 60 memcpy_s(tokenInfo->salt, SALT_ENCRYPT_LEN, ATTEST_FIRST_SALT, SALT_ENCRYPT_LEN); in AttestReadToken()
|
/test/xts/device_attest_lite/test/tdd/gtest/src/ |
H A D | attest_tdd_mock_hal.c | 62 memcpy_s(tokenInfo->salt, SALT_ENCRYPT_LEN, ATTEST_FIRST_SALT, SALT_ENCRYPT_LEN); in AttestReadToken()
|
/test/xts/acts/commonlibrary/thirdparty/musl/entry/src/main/cpp/ |
H A D | unistdndk.cpp | 205 char *salt = static_cast<char *>(malloc(sizeof(char) * lenV));
in Crypt() local 206 napi_get_value_string_utf8(env, args[PARAM_0], salt, lenV, &lenA);
in Crypt() 207 char *cryptResult = crypt(key, salt);
in Crypt()
|