/base/startup/init/services/init/standard/ |
D | init_cmds.c | 124 static void DoIfup(const struct CmdArgs *ctx) in DoIfup() argument 127 …INIT_ERROR_CHECK(strncpy_s(interface.ifr_name, IFNAMSIZ - 1, ctx->argv[0], strlen(ctx->argv[0])) =… in DoIfup() 143 static void DoInsmod(const struct CmdArgs *ctx) in DoInsmod() argument 148 if (ctx->argc > index) { in DoInsmod() 149 fileName = ctx->argv[index]; in DoInsmod() 152 … INIT_ERROR_CHECK(fileName != NULL, return, "Can not find file name from param %s", ctx->argv[0]); in DoInsmod() 155 …INIT_ERROR_CHECK(realPath != NULL, return, "Can not get real file name from param %s", ctx->argv[0… in DoInsmod() 156 if (ctx->argc > 1 && ctx->argv[1] != NULL && strcmp(ctx->argv[1], "-f") == 0) { // [-f] in DoInsmod() 160 char *options = BuildStringFromCmdArg(ctx, index); // [options] in DoInsmod() 178 static void DoSetParam(const struct CmdArgs *ctx) in DoSetParam() argument [all …]
|
/base/security/huks/test/unittest/huks_standard_test/module_test/framework_test/crypto_engine_test/src/ |
D | hks_openssl_aes_test.cpp | 107 struct HksOpensslBlockCipherCtx *ctx = variable 109 ASSERT_EQ(ctx == nullptr, false) << "ctx malloc failed."; 111 ctx->algType = HKS_ALG_AES; 112 ctx->mode = HKS_MODE_ECB; 113 ctx->padding = HKS_PADDING_NONE; 114 ctx->append = nullptr; 116 int32_t ret = HksOpensslAesEncryptUpdate(reinterpret_cast<void *>(ctx), nullptr, nullptr); 119 ret = HksOpensslAesDecryptUpdate(reinterpret_cast<void *>(ctx), nullptr, nullptr); 123 ctx->mode = HKS_MODE_CTR; 124 ret = HksOpensslAesEncryptUpdate(reinterpret_cast<void *>(ctx), nullptr, nullptr); [all …]
|
D | hks_openssl_hash_test.cpp | 91 void *ctx = nullptr; variable 92 int32_t ret = HksOpensslHashInit(&ctx, HKS_DIGEST_SHA256); 95 ret = HksOpensslHashFinal(&ctx, nullptr, nullptr); 107 void *ctx = nullptr; variable 108 int32_t ret = HksOpensslHashInit(&ctx, HKS_DIGEST_SHA256); 111 ret = HksOpensslHashFinal(&ctx, &msg, nullptr); 123 void *ctx = nullptr; variable 124 int32_t ret = HksOpensslHashInit(&ctx, HKS_DIGEST_SHA224); 126 HksOpensslHashFreeCtx(&ctx); 137 void *ctx = nullptr; variable [all …]
|
/base/startup/init/services/init/ |
D | init_common_cmds.c | 77 char *BuildStringFromCmdArg(const struct CmdArgs *ctx, int startIndex) in BuildStringFromCmdArg() argument 79 INIT_ERROR_CHECK(ctx != NULL, return NULL, "Failed to get cmd args "); in BuildStringFromCmdArg() 84 for (int i = startIndex; i < ctx->argc; i++) { // save opt in BuildStringFromCmdArg() 85 if (ctx->argv[i] == NULL) { in BuildStringFromCmdArg() 88 …en = snprintf_s(options + curr, OPTIONS_SIZE - curr, OPTIONS_SIZE - 1 - curr, "%s ", ctx->argv[i]); in BuildStringFromCmdArg() 108 …struct CmdArgs *ctx = (struct CmdArgs *)calloc(1, sizeof(struct CmdArgs) + sizeof(char *) * (argsC… in GetCmdArg() local 109 INIT_ERROR_CHECK(ctx != NULL, return NULL, "Failed to malloc memory for arg"); in GetCmdArg() 110 ctx->argc = 0; in GetCmdArg() 124 ctx->argv[ctx->argc] = AddOneArg(p, end - p); in GetCmdArg() 125 INIT_CHECK(ctx->argv[ctx->argc] != NULL, FreeCmdArg(ctx); in GetCmdArg() [all …]
|
/base/security/crypto_framework/frameworks/js/napi/crypto/src/ |
D | napi_verify.cpp | 102 static void FreeVerifyInitCtx(napi_env env, VerifyInitCtx *ctx) in FreeVerifyInitCtx() argument 104 if (ctx == nullptr) { in FreeVerifyInitCtx() 108 if (ctx->asyncWork != nullptr) { in FreeVerifyInitCtx() 109 napi_delete_async_work(env, ctx->asyncWork); in FreeVerifyInitCtx() 110 ctx->asyncWork = nullptr; in FreeVerifyInitCtx() 113 if (ctx->callback != nullptr) { in FreeVerifyInitCtx() 114 napi_delete_reference(env, ctx->callback); in FreeVerifyInitCtx() 115 ctx->callback = nullptr; in FreeVerifyInitCtx() 118 if (ctx->verifyRef != nullptr) { in FreeVerifyInitCtx() 119 napi_delete_reference(env, ctx->verifyRef); in FreeVerifyInitCtx() [all …]
|
D | napi_asy_key_generator.cpp | 88 static void FreeGenKeyPairCtx(napi_env env, GenKeyPairCtx *ctx) in FreeGenKeyPairCtx() argument 90 if (ctx == nullptr) { in FreeGenKeyPairCtx() 94 if (ctx->asyncWork != nullptr) { in FreeGenKeyPairCtx() 95 napi_delete_async_work(env, ctx->asyncWork); in FreeGenKeyPairCtx() 96 ctx->asyncWork = nullptr; in FreeGenKeyPairCtx() 99 if (ctx->callback != nullptr) { in FreeGenKeyPairCtx() 100 napi_delete_reference(env, ctx->callback); in FreeGenKeyPairCtx() 101 ctx->callback = nullptr; in FreeGenKeyPairCtx() 104 if (ctx->generatorRef != nullptr) { in FreeGenKeyPairCtx() 105 napi_delete_reference(env, ctx->generatorRef); in FreeGenKeyPairCtx() [all …]
|
D | napi_asy_key_spec_generator.cpp | 51 static void FreeAsyKeyCtx(napi_env env, AsyKeyCtx *ctx) in FreeAsyKeyCtx() argument 53 if (ctx == nullptr) { in FreeAsyKeyCtx() 57 if (ctx->asyncWork != nullptr) { in FreeAsyKeyCtx() 58 napi_delete_async_work(env, ctx->asyncWork); in FreeAsyKeyCtx() 59 ctx->asyncWork = nullptr; in FreeAsyKeyCtx() 62 if (ctx->callback != nullptr) { in FreeAsyKeyCtx() 63 napi_delete_reference(env, ctx->callback); in FreeAsyKeyCtx() 64 ctx->callback = nullptr; in FreeAsyKeyCtx() 67 if (ctx->generatorRef != nullptr) { in FreeAsyKeyCtx() 68 napi_delete_reference(env, ctx->generatorRef); in FreeAsyKeyCtx() [all …]
|
D | napi_sign.cpp | 85 static void FreeSignInitCtx(napi_env env, SignInitCtx *ctx) in FreeSignInitCtx() argument 87 if (ctx == nullptr) { in FreeSignInitCtx() 91 if (ctx->asyncWork != nullptr) { in FreeSignInitCtx() 92 napi_delete_async_work(env, ctx->asyncWork); in FreeSignInitCtx() 95 if (ctx->callback != nullptr) { in FreeSignInitCtx() 96 napi_delete_reference(env, ctx->callback); in FreeSignInitCtx() 99 if (ctx->signRef != nullptr) { in FreeSignInitCtx() 100 napi_delete_reference(env, ctx->signRef); in FreeSignInitCtx() 101 ctx->signRef = nullptr; in FreeSignInitCtx() 104 if (ctx->priKeyRef != nullptr) { in FreeSignInitCtx() [all …]
|
D | napi_key_agreement.cpp | 52 static void FreeKeyAgreementCtx(napi_env env, KeyAgreementCtx *ctx) in FreeKeyAgreementCtx() argument 54 if (ctx == nullptr) { in FreeKeyAgreementCtx() 58 if (ctx->asyncWork != nullptr) { in FreeKeyAgreementCtx() 59 napi_delete_async_work(env, ctx->asyncWork); in FreeKeyAgreementCtx() 60 ctx->asyncWork = nullptr; in FreeKeyAgreementCtx() 63 if (ctx->callback != nullptr) { in FreeKeyAgreementCtx() 64 napi_delete_reference(env, ctx->callback); in FreeKeyAgreementCtx() 65 ctx->callback = nullptr; in FreeKeyAgreementCtx() 68 if (ctx->keyAgreementRef != nullptr) { in FreeKeyAgreementCtx() 69 napi_delete_reference(env, ctx->keyAgreementRef); in FreeKeyAgreementCtx() [all …]
|
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/alg_module_test/src/ |
D | openssl_aes_helper.c | 102 static uint32_t AesInit(EVP_CIPHER_CTX **ctx, const EVP_CIPHER **ciper, const struct HksParamSet *p… in AesInit() argument 118 *ctx = EVP_CIPHER_CTX_new(); in AesInit() 119 if (*ctx == NULL) { in AesInit() 138 EVP_CIPHER_CTX *ctx = NULL; in AesEncrypt() local 139 if (AesInit(&ctx, &ciper, paramSetIn) != HKS_SUCCESS) { in AesEncrypt() 143 if (EVP_EncryptInit_ex(ctx, ciper, NULL, NULL, NULL) != 1) { in AesEncrypt() 144 EVP_CIPHER_CTX_free(ctx); in AesEncrypt() 148 if (EVP_EncryptInit_ex(ctx, NULL, NULL, randomKey->data, iv->blob.data) != 1) { in AesEncrypt() 149 EVP_CIPHER_CTX_free(ctx); in AesEncrypt() 155 ret = EVP_CIPHER_CTX_set_padding(ctx, OPENSSL_CTX_PADDING_ENABLE); in AesEncrypt() [all …]
|
/base/hiviewdfx/faultloggerd/interfaces/innerkits/unwinder/ |
D | dfx_accessors.cpp | 48 UnwindContext* ctx = reinterpret_cast<UnwindContext *>(arg); in GetMapByPcAndCtx() local 49 if (ctx->map != nullptr && ctx->map->Contain(static_cast<uint64_t>(pc))) { in GetMapByPcAndCtx() 50 map = ctx->map; in GetMapByPcAndCtx() 55 if (ctx->maps == nullptr) { in GetMapByPcAndCtx() 59 if (!ctx->maps->FindMapByAddr(pc, map) || (map == nullptr)) { in GetMapByPcAndCtx() 62 ctx->map = map; in GetMapByPcAndCtx() 83 UnwindContext* ctx = reinterpret_cast<UnwindContext *>(arg); in AccessMem() local 84 …if ((ctx != nullptr) && (ctx->stackCheck == true) && (!IsValidFrame(addr, ctx->stackBottom, ctx->s… in AccessMem() 94 UnwindContext* ctx = reinterpret_cast<UnwindContext *>(arg); in AccessReg() local 95 if (ctx == nullptr) { in AccessReg() [all …]
|
/base/security/crypto_framework/plugin/openssl_plugin/common/src/ |
D | openssl_adapter.c | 84 void OpensslBnCtxFree(BN_CTX *ctx) in OpensslBnCtxFree() argument 86 if (ctx != NULL) { in OpensslBnCtxFree() 87 BN_CTX_free(ctx); in OpensslBnCtxFree() 210 EC_GROUP *OpensslEcGroupNewCurveGfp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) in OpensslEcGroupNewCurveGfp() argument 212 return EC_GROUP_new_curve_GFp(p, a, b, ctx); in OpensslEcGroupNewCurveGfp() 233 const BIGNUM *y, BN_CTX *ctx) in OpensslEcPointSetAffineCoordinatesGfp() argument 235 return EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx); in OpensslEcPointSetAffineCoordinatesGfp() 259 int OpensslEcGroupGetCurveGfp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx) in OpensslEcGroupGetCurveGfp() argument 261 return EC_GROUP_get_curve_GFp(group, p, a, b, ctx); in OpensslEcGroupGetCurveGfp() 270 BIGNUM *y, BN_CTX *ctx) in OpensslEcPointGetAffineCoordinatesGfp() argument [all …]
|
/base/security/crypto_framework/test/unittest/src/ |
D | openssl_adapter_mock.c | 146 void OpensslBnCtxFree(BN_CTX *ctx) in OpensslBnCtxFree() argument 148 if (ctx != NULL) { in OpensslBnCtxFree() 149 BN_CTX_free(ctx); in OpensslBnCtxFree() 313 BIGNUM *y, BN_CTX *ctx) in OpensslEcPointGetAffineCoordinatesGfp() argument 318 return EC_POINT_get_affine_coordinates_GFp(group, point, x, y, ctx); in OpensslEcPointGetAffineCoordinatesGfp() 329 int OpensslEcGroupGetCurveGfp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx) in OpensslEcGroupGetCurveGfp() argument 334 return EC_GROUP_get_curve_GFp(group, p, a, b, ctx); in OpensslEcGroupGetCurveGfp() 345 int OpensslEcGroupGetOrder(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx) in OpensslEcGroupGetOrder() argument 350 return EC_GROUP_get_order(group, order, ctx); in OpensslEcGroupGetOrder() 353 int OpensslEcGroupGetCofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx) in OpensslEcGroupGetCofactor() argument [all …]
|
/base/security/huks/frameworks/huks_standard/main/crypto_engine/openssl/src/ |
D | hks_openssl_aes.c | 58 static int32_t OpensslBlockCipherCryptInitParams(const struct HksBlob *key, EVP_CIPHER_CTX *ctx, in OpensslBlockCipherCryptInitParams() argument 63 …ret = EVP_EncryptInit_ex(ctx, NULL, NULL, key->data, (cipherParam == NULL) ? NULL : cipherParam->i… in OpensslBlockCipherCryptInitParams() 65 …ret = EVP_DecryptInit_ex(ctx, NULL, NULL, key->data, (cipherParam == NULL) ? NULL : cipherParam->i… in OpensslBlockCipherCryptInitParams() 74 ret = EVP_CIPHER_CTX_set_padding(ctx, OPENSSL_CTX_PADDING_ENABLE); in OpensslBlockCipherCryptInitParams() 77 ret = EVP_CIPHER_CTX_set_padding(ctx, OPENSSL_CTX_PADDING_NONE); in OpensslBlockCipherCryptInitParams() 93 EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); in ENABLE_CFI() local 94 if (ctx == NULL) { in ENABLE_CFI() 101 EVP_CIPHER_CTX_free(ctx); in ENABLE_CFI() 106 ret = EVP_EncryptInit_ex(ctx, cipher, NULL, NULL, NULL); in ENABLE_CFI() 108 ret = EVP_DecryptInit_ex(ctx, cipher, NULL, NULL, NULL); in ENABLE_CFI() [all …]
|
/base/security/huks/frameworks/crypto_lite/cipher/src/ |
D | cipher_aes.c | 111 static int32_t SetIv(const char *ivBuf, int32_t ivBufLen, AesCryptContext *ctx) in SetIv() argument 113 if ((ivBuf == NULL) || (ctx == NULL)) { in SetIv() 117 …if ((ivBufLen < (ctx->iv.ivOffset + ctx->iv.ivLen)) || (ctx->iv.ivOffset < 0) || (ctx->iv.ivLen <=… in SetIv() 121 ctx->iv.ivBuf = malloc(ctx->iv.ivLen); in SetIv() 122 if (ctx->iv.ivBuf == NULL) { in SetIv() 127 int32_t ret = memcpy_s(ctx->iv.ivBuf, ctx->iv.ivLen, ivBuf + ctx->iv.ivOffset, ctx->iv.ivLen); in SetIv() 130 free(ctx->iv.ivBuf); in SetIv() 131 ctx->iv.ivBuf = NULL; in SetIv() 138 static int32_t InitAesCryptContext(const char *key, const AesIvMode *iv, AesCryptContext *ctx) in InitAesCryptContext() argument 142 if (iv == NULL || ctx == NULL || key == NULL) { in InitAesCryptContext() [all …]
|
/base/security/crypto_framework/plugin/openssl_plugin/common/inc/ |
D | openssl_adapter.h | 54 void OpensslBnCtxFree(BN_CTX *ctx); 79 EC_GROUP *OpensslEcGroupNewCurveGfp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); 84 const BIGNUM *y, BN_CTX *ctx); 90 int OpensslEcGroupGetCurveGfp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); 93 BIGNUM *y, BN_CTX *ctx); 94 int OpensslEcGroupGetOrder(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx); 95 int OpensslEcGroupGetCofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx); 101 const BIGNUM *pScalar, BN_CTX *ctx); 104 void OpensslEvpMdCtxFree(EVP_MD_CTX *ctx); 105 void OpensslEvpMdCtxSetPkeyCtx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pctx); [all …]
|
/base/security/dlp_permission_service/frameworks/test/mock/ |
D | openssl_mock.cpp | 35 typedef int (*EvpEncryptInitEx)(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *impl, 37 typedef int (*EvpDecryptInitEx)(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *impl, 41 typedef int (*EvpEncryptUpdate)(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, const unsigned … 42 typedef int (*EvpEncryptFinalEx)(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); 43 typedef int (*EvpDecryptUpdate)(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, const unsigned … 44 typedef int (*EvpDecryptFinalEx)(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); 51 typedef int (*EvpDigestInitEx)(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl); 52 typedef void (*EvpMdCtxSetFlags)(EVP_MD_CTX *ctx, int flags); 53 typedef void (*EvpMdCtxFree)(EVP_MD_CTX *ctx); 54 typedef int (*EvpDigestUpdate)(EVP_MD_CTX *ctx, const void *d, size_t cnt); [all …]
|
/base/security/huks/frameworks/huks_standard/main/crypto_engine/mbedtls/src/ |
D | hks_mbedtls_ecdh.c | 43 const struct HksBlob *pubKey, mbedtls_ecdh_context *ctx) in EccKeyMaterialToCtx() argument 45 int32_t ret = HksEccKeyMaterialToPub(pubKey, &(ctx->MBEDTLS_PRIVATE(Qp))); in EccKeyMaterialToCtx() 48 ret = HksEccKeyMaterialToPri(nativeKey, &(ctx->MBEDTLS_PRIVATE(d))); in EccKeyMaterialToCtx() 71 mbedtls_ecdh_context ctx; in HksMbedtlsEcdh() 72 (void)memset_s(&ctx, sizeof(mbedtls_ecdh_context), 0, sizeof(mbedtls_ecdh_context)); in HksMbedtlsEcdh() 73 mbedtls_ecdh_init(&ctx); in HksMbedtlsEcdh() 76 ret = mbedtls_ecp_group_load(&(ctx.MBEDTLS_PRIVATE(grp)), mbedtlsCurveNist); in HksMbedtlsEcdh() 82 ret = EccKeyMaterialToCtx(nativeKey, pubKey, &ctx); in HksMbedtlsEcdh() 85 ret = mbedtls_ecdh_compute_shared(&(ctx.MBEDTLS_PRIVATE(grp)), &(ctx.MBEDTLS_PRIVATE(z)), in HksMbedtlsEcdh() 86 … &(ctx.MBEDTLS_PRIVATE(Qp)), &(ctx.MBEDTLS_PRIVATE(d)), mbedtls_ctr_drbg_random, &ctrDrbg); in HksMbedtlsEcdh() [all …]
|
D | hks_mbedtls_engine.c | 52 int32_t HksCryptoHalHmacInit(const struct HksBlob *key, uint32_t digestAlg, void **ctx) in HksCryptoHalHmacInit() argument 54 if (CheckBlob(key) != HKS_SUCCESS || ctx == NULL) { in HksCryptoHalHmacInit() 62 return func(ctx, key, digestAlg); in HksCryptoHalHmacInit() 65 int32_t HksCryptoHalHmacUpdate(const struct HksBlob *chunk, void *ctx) in HksCryptoHalHmacUpdate() argument 67 if (CheckBlob(chunk) != HKS_SUCCESS || ctx == NULL) { in HksCryptoHalHmacUpdate() 75 return func(ctx, chunk); in HksCryptoHalHmacUpdate() 78 int32_t HksCryptoHalHmacFinal(const struct HksBlob *msg, void **ctx, struct HksBlob *mac) in HksCryptoHalHmacFinal() argument 80 if (msg == NULL || ctx == NULL || *ctx == NULL || CheckBlob(mac) != HKS_SUCCESS) { in HksCryptoHalHmacFinal() 88 return func(ctx, msg, mac); in HksCryptoHalHmacFinal() 91 void HksCryptoHalHmacFreeCtx(void **ctx) in HksCryptoHalHmacFreeCtx() argument [all …]
|
D | hks_mbedtls_dh.c | 71 static int32_t DhSaveKeyMaterial(const mbedtls_dhm_context *ctx, const uint32_t keySize, struct Hks… in DhSaveKeyMaterial() argument 82 keyMaterial->pubKeySize = mbedtls_mpi_size(&ctx->GX); in DhSaveKeyMaterial() 83 keyMaterial->priKeySize = mbedtls_mpi_size(&ctx->X); in DhSaveKeyMaterial() 88 ret = mbedtls_mpi_write_binary(&(ctx->GX), rawMaterial + offset, keyMaterial->pubKeySize); in DhSaveKeyMaterial() 97 ret = mbedtls_mpi_write_binary(&(ctx->X), rawMaterial + offset, keyMaterial->priKeySize); in DhSaveKeyMaterial() 114 mbedtls_dhm_context ctx; in HksMbedtlsDhGenerateKey() local 115 (void)memset_s(&ctx, sizeof(mbedtls_dhm_context), 0, sizeof(mbedtls_dhm_context)); in HksMbedtlsDhGenerateKey() 116 mbedtls_dhm_init(&ctx); in HksMbedtlsDhGenerateKey() 124 mbedtls_dhm_free(&ctx); in HksMbedtlsDhGenerateKey() 135 if (mbedtls_mpi_read_binary(&ctx.P, paramP.data, paramP.size) != HKS_MBEDTLS_SUCCESS || in HksMbedtlsDhGenerateKey() [all …]
|
D | hks_mbedtls_ecdsa.c | 59 mbedtls_ecdsa_context ctx; in HksMbedtlsEcdsaSign() 60 (void)memset_s(&ctx, sizeof(mbedtls_ecdsa_context), 0, sizeof(mbedtls_ecdsa_context)); in HksMbedtlsEcdsaSign() 61 mbedtls_ecdsa_init(&ctx); in HksMbedtlsEcdsaSign() 64 ret = mbedtls_ecp_group_load(&(ctx.MBEDTLS_PRIVATE(grp)), curveNist); in HksMbedtlsEcdsaSign() 70 ret = HksEccKeyMaterialToPri(key, &(ctx.MBEDTLS_PRIVATE(d))); in HksMbedtlsEcdsaSign() 78 …ret = mbedtls_ecdsa_write_signature(&ctx, (mbedtls_md_type_t)mbedtlsAlg, message->data, (size_t)me… in HksMbedtlsEcdsaSign() 90 mbedtls_ecdsa_free(&ctx); in HksMbedtlsEcdsaSign() 106 mbedtls_ecdsa_context ctx; in HksMbedtlsEcdsaVerify() 107 (void)memset_s(&ctx, sizeof(mbedtls_ecdsa_context), 0, sizeof(mbedtls_ecdsa_context)); in HksMbedtlsEcdsaVerify() 108 mbedtls_ecdsa_init(&ctx); in HksMbedtlsEcdsaVerify() [all …]
|
/base/startup/init/services/init/lite/ |
D | init_cmds.c | 31 static void DoExec(const struct CmdArgs *ctx) in DoExec() argument 34 if (ctx == NULL || ctx->argv[0] == NULL) { in DoExec() 40 INIT_LOGE("DoExec: failed to fork child process to exec \"%s\"", ctx->argv[0]); in DoExec() 44 int ret = execve(ctx->argv[0], ctx->argv, NULL); in DoExec() 46 INIT_LOGE("DoExec: execute \"%s\" failed: %d.", ctx->argv[0], errno); in DoExec() 73 static void DoLoadCfg(const struct CmdArgs *ctx) in DoLoadCfg() argument 77 if (!CheckValidCfg(ctx->argv[0])) { in DoLoadCfg() 78 INIT_LOGE("CheckCfg file %s Failed", ctx->argv[0]); in DoLoadCfg() 81 char *realPath = GetRealPath(ctx->argv[0]); in DoLoadCfg() 82 INIT_ERROR_CHECK(realPath != NULL, return, "Failed to get realpath %s", ctx->argv[0]); in DoLoadCfg() [all …]
|
/base/security/dlp_permission_service/interfaces/inner_api/dlp_parse/test/ |
D | dlp_crypt_test.cpp | 297 void* ctx = nullptr; variable 300 int32_t ret = DlpOpensslAesEncryptInit(&ctx, nullptr, &usageSpec); 313 void* ctx = nullptr; variable 317 int32_t ret = DlpOpensslAesEncryptInit(&ctx, &key, nullptr); 330 void* ctx = nullptr; variable 339 … ASSERT_EQ(DLP_PARSE_ERROR_CRYPTO_ENGINE_ERROR, DlpOpensslAesEncryptInit(&ctx, &key, &usageSpec)); 345 ASSERT_EQ(DLP_PARSE_ERROR_VALUE_INVALID, DlpOpensslAesEncryptInit(&ctx, &key, &usageSpec)); 351 … ASSERT_EQ(DLP_PARSE_ERROR_CRYPTO_ENGINE_ERROR, DlpOpensslAesEncryptInit(&ctx, &key, &usageSpec)); 357 … ASSERT_EQ(DLP_PARSE_ERROR_CRYPTO_ENGINE_ERROR, DlpOpensslAesEncryptInit(&ctx, &key, &usageSpec)); 363 … ASSERT_EQ(DLP_PARSE_ERROR_CRYPTO_ENGINE_ERROR, DlpOpensslAesEncryptInit(&ctx, &key, &usageSpec)); [all …]
|
/base/security/dlp_permission_service/interfaces/inner_api/dlp_parse/src/ |
D | dlp_crypt.cpp | 121 …st struct DlpBlob* key, const struct DlpUsageSpec* usageSpec, bool isEncrypt, EVP_CIPHER_CTX** ctx) in OpensslAesCipherInit() argument 126 *ctx = EVP_CIPHER_CTX_new(); in OpensslAesCipherInit() 127 if (*ctx == nullptr) { in OpensslAesCipherInit() 135 EVP_CIPHER_CTX_free(*ctx); in OpensslAesCipherInit() 140 ret = EVP_EncryptInit_ex(*ctx, cipher, nullptr, nullptr, nullptr); in OpensslAesCipherInit() 142 ret = EVP_DecryptInit_ex(*ctx, cipher, nullptr, nullptr, nullptr); in OpensslAesCipherInit() 146 EVP_CIPHER_CTX_free(*ctx); in OpensslAesCipherInit() 152 … *ctx, nullptr, nullptr, key->data, (cipherParam == nullptr) ? nullptr : cipherParam->iv.data); in OpensslAesCipherInit() 155 … *ctx, nullptr, nullptr, key->data, (cipherParam == nullptr) ? nullptr : cipherParam->iv.data); in OpensslAesCipherInit() 159 EVP_CIPHER_CTX_free(*ctx); in OpensslAesCipherInit() [all …]
|
/base/security/device_auth/deps_adapter/key_management_adapter/impl/src/standard/ |
D | crypto_hash_to_point.c | 112 const struct CurveConstPara *curvePara, BIGNUM *b, BN_CTX *ctx) in CurveHashToPointCalcB() argument 120 if (BN_mul(b, swap, swap, ctx) <= 0) { in CurveHashToPointCalcB() 123 if (BN_mod(b, b, curvePara->p, ctx) <= 0) { in CurveHashToPointCalcB() 126 if (BN_mul(swap, b, curvePara->u, ctx) <= 0) { in CurveHashToPointCalcB() 129 if (BN_mod(swap, swap, curvePara->p, ctx) <= 0) { in CurveHashToPointCalcB() 135 if (BN_mod(b, b, curvePara->p, ctx) <= 0) { in CurveHashToPointCalcB() 138 if (BN_mod_inverse(swap, b, curvePara->p, ctx) <= 0) { in CurveHashToPointCalcB() 141 if (BN_mul(b, swap, curvePara->minusA, ctx) <= 0) { in CurveHashToPointCalcB() 144 if (BN_mod(b, b, curvePara->p, ctx) <= 0) { in CurveHashToPointCalcB() 154 const struct CurveConstPara *curvePara, BIGNUM *a, BN_CTX *ctx) in CurveHashToPointCalcA() argument [all …]
|