/base/security/huks/frameworks/huks_standard/main/crypto_engine/mbedtls/src/ |
D | hks_mbedtls_ecdsa.c | 43 const struct HksBlob *message, struct HksBlob *signature) in HksMbedtlsEcdsaSign() argument 77 size_t keyLen = signature->size; in HksMbedtlsEcdsaSign() 79 signature->data, &keyLen, mbedtls_ctr_drbg_random, &ctrDrbg); in HksMbedtlsEcdsaSign() 80 signature->size = (uint32_t)keyLen; in HksMbedtlsEcdsaSign() 83 (void)memset_s(signature->data, signature->size, 0, signature->size); in HksMbedtlsEcdsaSign() 96 const struct HksBlob *message, const struct HksBlob *signature) in HksMbedtlsEcdsaVerify() argument 121 message->data, message->size, signature->data, signature->size); in HksMbedtlsEcdsaVerify()
|
D | hks_crypto_ed25519.c | 180 const struct HksBlob *message, struct HksBlob *signature) in HksEd25519Sign() argument 185 if (signature->size < HKS_SIGNATURE_MIN_SIZE || in HksEd25519Sign() 188 signature->size, key->size); in HksEd25519Sign() 192 ret = ED25519_SIGN(signature->data, message->data, message->size, in HksEd25519Sign() 199 signature->size = HKS_SIGNATURE_MIN_SIZE; in HksEd25519Sign() 205 const struct HksBlob *message, const struct HksBlob *signature) in HksEd25519Verify() argument 210 if (signature->size < HKS_SIGNATURE_MIN_SIZE) { in HksEd25519Verify() 214 ret = ED25519_VERIFY(message->data, message->size, signature->data, in HksEd25519Verify()
|
/base/security/device_security_level/test/dslm_unit_test/cmocker/ |
D | c_mocker.h | 67 #define PARAMETER(index, signature, dummy) \ argument 68 GMOCK_PP_COMMA_IF(index) GMOCK_INTERNAL_ARG_O(index, GMOCK_PP_REMOVE_PARENS(signature)) 77 #define IMPLEMENT_FUNCTION_INTERNAL(cls, method, count, signature, invoker) … argument 79 …testing::internal::Function<GMOCK_PP_REMOVE_PARENS(signature)>::Result method( … 80 …GMOCK_PP_REPEAT(GMOCK_INTERNAL_PARAMETER, signature, count)) \ 93 … return mock->method(GMOCK_PP_REPEAT(GMOCK_INTERNAL_FORWARD_ARG, signature, count)); \ 97 … return stub(GMOCK_PP_REPEAT(GMOCK_INTERNAL_FORWARD_ARG, signature, count)); \ 101 …return testing::internal::Function<GMOCK_PP_REMOVE_PARENS(signature)>::Result(); \
|
/base/security/device_security_level/oem_property/common/ |
D | dslm_credential_utils.c | 60 DataBuffer signature; member 66 DataBuffer signature; member 74 const char *signature; member 180 … int32_t ret = EcdsaVerify(&root->publicKey, &root->signature, &root->publicKey, root->algorithm); in VerifyCredentialCb() 188 …ret = EcdsaVerify(&intermediate->publicKey, &intermediate->signature, &root->publicKey, intermedia… in VerifyCredentialCb() 196 … ret = EcdsaVerify(&last->publicKey, &last->signature, &intermediate->publicKey, last->algorithm); in VerifyCredentialCb() 204 ret = EcdsaVerify(&payload->payload, &payload->signature, &last->publicKey, TYPE_ECDSA_SHA_384); in VerifyCredentialCb() 206 … ret = EcdsaVerify(&payload->payload, &payload->signature, &last->publicKey, TYPE_ECDSA_SHA_256); in VerifyCredentialCb() 266 credCb->signature = strtok_s(NULL, ".", &context); in SplitCredentialString() 267 if (context == NULL || credCb->signature == NULL) { in SplitCredentialString() [all …]
|
/base/update/packaging_tools/ |
D | build_pkcs7.py | 88 signature = private_key.sign( 95 return signature 109 signature = private_key.sign( 116 return signature 129 def write_signed_package(unsigned_package, signature, signed_package): argument 133 signature_size = len(signature) 151 f_signed.write(signature) 161 signature = sign_digest(digest, private_key) 170 signatute_file.write(signature) 209 signer_info['signature'] = signature
|
D | create_signed_data.py | 35 signature = sign_digest(hash_sha256.digest(), private_key_file) 36 if signature == False: 39 return str(b64encode(signature).decode("ascii"))
|
D | create_update_package.py | 229 signature = private_key.sign(digest, pad, hashes.SHA256()) 232 return signature 242 signature = private_key.sign(digest, padding.PKCS1v15(), hashes.SHA256()) 245 return signature 258 signature = self.sign_digest(digest) 260 signature = self.sign_digest_with_pss(digest) 264 if not signature: 268 if len(signature) == SIGN_SHA384_LEN: 273 package_file.write(signature) 288 signature = self.sign_digest(digest) [all …]
|
/base/update/updater/services/package/pkg_verify/ |
D | pkg_verify_util.cpp | 39 std::vector<uint8_t> signature; in VerifyPackageSign() local 41 if (GetSignature(pkgStream, signatureSize, signature, commentTotalLenAll) != PKG_SUCCESS) { in VerifyPackageSign() 48 int32_t ret = Pkcs7verify(signature, hash); in VerifyPackageSign() 65 std::vector<uint8_t> &signature, uint16_t &commentTotalLenAll) const in GetSignature() argument 84 signature.assign(signData.buffer, signData.buffer + readLen); in GetSignature() 114 int32_t PkgVerifyUtil::Pkcs7verify(std::vector<uint8_t> &signature, std::vector<uint8_t> &hash) con… in Pkcs7verify() argument 118 return pkcs7.GetHashFromSignBlock(signature.data(), signature.size(), hash); in Pkcs7verify()
|
/base/security/code_signature/services/local_code_sign/src/ |
D | local_code_sign_stub.cpp | 89 ByteBuffer signature; in SignLocalCodeInner() local 90 int32_t result = SignLocalCode(filePath, signature); in SignLocalCodeInner() 98 if (!reply.WriteUint32(signature.GetSize())) { in SignLocalCodeInner() 101 if (!reply.WriteBuffer(signature.GetBuffer(), signature.GetSize())) { in SignLocalCodeInner()
|
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/alg_module_test/include/ |
D | openssl_ecc_helper.h | 33 …n(const struct HksBlob *key, int digest, const struct HksBlob *message, struct HksBlob *signature); 36 …t struct HksBlob *key, int digest, const struct HksBlob *message, const struct HksBlob *signature); 47 …WithDigestNone(const struct HksBlob *key, const struct HksBlob *message, struct HksBlob *signature,
|
/base/security/huks/test/unittest/huks_standard_test/crypto_engine_test/src/ |
D | hks_crypto_hal_api_openssl.cpp | 311 HksBlob signature = { .size = 0, .data = nullptr }; variable 314 EXPECT_EQ(HksCryptoHalSign(&key, nullptr, &message, &signature), HKS_ERROR_INVALID_ARGUMENT); 317 EXPECT_EQ(HksCryptoHalSign(&key, nullptr, &message, &signature), HKS_ERROR_INVALID_ARGUMENT); 320 EXPECT_EQ(HksCryptoHalSign(&key, nullptr, &message, &signature), HKS_ERROR_INVALID_ARGUMENT); 322 signature = { .size = 1, .data = buff }; 323 EXPECT_EQ(HksCryptoHalSign(&key, nullptr, &message, &signature), HKS_ERROR_INVALID_ARGUMENT); 325 EXPECT_EQ(HksCryptoHalSign(&key, &spec, &message, &signature), HKS_ERROR_INVALID_ARGUMENT); 338 HksBlob signature = { .size = 0, .data = nullptr }; variable 341 EXPECT_EQ(HksCryptoHalVerify(&key, nullptr, &message, &signature), HKS_ERROR_INVALID_ARGUMENT); 344 EXPECT_EQ(HksCryptoHalVerify(&key, nullptr, &message, &signature), HKS_ERROR_INVALID_ARGUMENT); [all …]
|
/base/security/code_signature/interfaces/innerkits/local_code_sign/src/ |
D | local_code_sign_kit.cpp | 28 int32_t LocalCodeSignKit::SignLocalCode(const std::string &filePath, ByteBuffer &signature) in SignLocalCode() argument 30 return LocalCodeSignClient::GetInstance().SignLocalCode(filePath, signature); in SignLocalCode()
|
/base/security/huks/frameworks/huks_standard/main/crypto_engine/mbedtls/include/ |
D | hks_mbedtls_ecdsa.h | 35 const struct HksBlob *message, struct HksBlob *signature); 38 const struct HksBlob *message, const struct HksBlob *signature);
|
D | hks_mbedtls_dsa.h | 43 const struct HksBlob *message, struct HksBlob *signature); 46 const struct HksBlob *message, const struct HksBlob *signature);
|
D | hks_crypto_ed25519.h | 42 const struct HksBlob *message, struct HksBlob *signature); 45 const struct HksBlob *message, const struct HksBlob *signature);
|
/base/security/device_auth/frameworks/deviceauth_lite/source/key_agreement/ |
D | sts_client.c | 172 …t verify_response_data(void *handle, const struct uint8_buff *message, struct signature *signature) in verify_response_data() argument 177 check_ptr_return_val(signature, HC_INPUT_ERROR); in verify_response_data() 204 int32_t ret = verify(&key_alias, sts_client->peer_user_type, message, signature); in verify_response_data() 212 static int32_t generate_sts_request_sign(void *handle, struct signature *signature) in generate_sts_request_sign() argument 250 int32_t ret = sign(&key_alias, &sign_message, signature); in generate_sts_request_sign() 274 static int32_t init_signature(void *handle, struct signature *signature) in init_signature() argument 306 …if (memcpy_s(signature->signature, sizeof(signature->signature), out_plain.val, out_plain.length) … in init_signature() 310 signature->length = out_plain.length; in init_signature() 317 struct signature signature = { 0, {0} }; in verify_data() local 318 int32_t ret = init_signature(handle, &signature); in verify_data() [all …]
|
D | sts_server.c | 220 static int32_t generate_sts_response_sign(void *handle, struct signature *signature) in generate_sts_response_sign() argument 257 int32_t ret = sign(&key_alias, &sign_message, signature); in generate_sts_response_sign() 291 struct signature signature; in build_start_response_data() local 292 int32_t ret = generate_sts_response_sign(handle, &signature); in build_start_response_data() 311 struct uint8_buff plain = { signature.signature, signature.length, signature.length }; in build_start_response_data() 373 …_t verify_request_data(void *handle, const struct uint8_buff *message, struct signature *signature) in verify_request_data() argument 378 check_ptr_return_val(signature, HC_INPUT_ERROR); in verify_request_data() 419 int32_t ret = verify(&key_alias, sts_server->peer_user_type, message, signature); in verify_request_data() 475 struct signature signature; in parse_end_request_data() local 477 …if (memcpy_s(signature.signature, sizeof(signature.signature), out_plain.val, out_plain.length) !=… in parse_end_request_data() [all …]
|
/base/security/huks/services/huks_standard/huks_service/main/os_dependency/ca/ |
D | hks_teec.h | 38 const struct HksBlob *srcData, struct HksBlob *signature); 41 const struct HksBlob *srcData, const struct HksBlob *signature); 77 const struct HksBlob *challengeIn, struct HksBlob *signature, struct HksBlob *certData); 80 const struct HksBlob *challengeIn, struct HksBlob *signature);
|
D | hks_ca_access.c | 42 const struct HksBlob *srcData, struct HksBlob *signature) in HksAccessSign() argument 44 return HksTeeSign(key, paramSet, srcData, signature); in HksAccessSign() 48 const struct HksBlob *srcData, const struct HksBlob *signature) in HksAccessVerify() argument 50 return HksTeeVerify(key, paramSet, srcData, signature); in HksAccessVerify()
|
/base/security/huks/frameworks/huks_standard/main/crypto_engine/openssl/include/ |
D | hks_openssl_dsa.h | 41 const struct HksBlob *message, struct HksBlob *signature); 44 const struct HksBlob *message, const struct HksBlob *signature);
|
/base/security/code_signature/interfaces/innerkits/code_sign_utils/src/ |
D | code_sign_utils.cpp | 136 int32_t CodeSignUtils::EnforceCodeSignForFile(const std::string &path, const ByteBuffer &signature) in EnforceCodeSignForFile() argument 138 return EnforceCodeSignForFile(path, signature.GetBuffer(), signature.GetSize()); in EnforceCodeSignForFile() 141 int32_t CodeSignUtils::EnforceCodeSignForFile(const std::string &path, const uint8_t *signature, in EnforceCodeSignForFile() argument 145 if ((signature == nullptr) || (size == 0)) { in EnforceCodeSignForFile() 177 arg.sig_ptr = reinterpret_cast<uintptr_t>(signature); in EnforceCodeSignForFile()
|
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/sdk_test/src/ |
D | hks_test_curve25519.c | 98 struct HksBlob signature = { TEST_CURVE_256, g_buffer }; in TestSignEd25519() local 99 ret = HksSign(&alias, paramSet, &msg, &signature); in TestSignEd25519() 101 g_bufferSize = signature.size; in TestSignEd25519() 102 HKS_TEST_LOG_I("TestSignEd25519 signature size is %u", signature.size); in TestSignEd25519() 143 struct HksBlob signature = { g_bufferSize, g_buffer }; in TestVerifyEd25519() local 144 ret = HksVerify(&alias, paramSet, &msg, &signature); in TestVerifyEd25519() 319 struct HksBlob signature = { TEST_CURVE_256, g_buffer }; in TestEd25519SignTeeVerifyLocal() local 335 ret = HksSign(&ed25519Alias, paramSetSign, &msg, &signature); in TestEd25519SignTeeVerifyLocal() 337 HKS_TEST_LOG_I("Test_Ed25519_Sign_TEE signature size is %u", signature.size); in TestEd25519SignTeeVerifyLocal() 341 ret = HksVerify(&pubKeyInfo, paramSetVerify, &msg, &signature); in TestEd25519SignTeeVerifyLocal() [all …]
|
/base/security/huks/test/unittest/huks_lite_test/common/ |
D | hks_test_curve25519.c | 100 struct HksBlob signature = { TEST_CURVE_256, g_buffer }; in TestSignEd25519() local 101 ret = HksSign(&alias, paramSet, &msg, &signature); in TestSignEd25519() 103 g_bufferSize = signature.size; in TestSignEd25519() 104 HKS_TEST_LOG_I("TestSignEd25519 signature size is %u", signature.size); in TestSignEd25519() 145 struct HksBlob signature = { g_bufferSize, g_buffer }; in TestVerifyEd25519() local 146 ret = HksVerify(&alias, paramSet, &msg, &signature); in TestVerifyEd25519() 323 struct HksBlob signature = { TEST_CURVE_256, g_buffer }; in TestEd25519SignTeeVerifyLocal() local 337 ret = HksSign(&ed25519Alias, paramSetSign, &msg, &signature); in TestEd25519SignTeeVerifyLocal() 339 HKS_TEST_LOG_I("Test_Ed25519_Sign_TEE signature size is %u", signature.size); in TestEd25519SignTeeVerifyLocal() 343 ret = HksVerify(&pubKeyInfo, paramSetVerify, &msg, &signature); in TestEd25519SignTeeVerifyLocal() [all …]
|
/base/security/code_signature/ |
D | README.md | 5 Code signature is a security mechanism on OpenHarmony to protect integrity of the application and v… 7 The code signature component provides the following features: 37 | int32_t EnforceCodeSignForFile(const std::string &path, const ByteBuffer &signature); | Enforces … 38 | int32_t SignLocalCode(const std::string &filePath, ByteBuffer &signature); | Signs the local code…
|
/base/security/code_signature/interfaces/innerkits/code_sign_utils/include/ |
D | code_sign_utils.h | 49 …static int32_t EnforceCodeSignForFile(const std::string &path, const uint8_t *signature, const uin… 56 static int32_t EnforceCodeSignForFile(const std::string &path, const ByteBuffer &signature);
|