Home
last modified time | relevance | path

Searched refs:addr (Results 1 – 25 of 72) sorted by relevance

123

/base/security/device_auth/deps_adapter/os_adapter/impl/src/liteos/
Dhc_types.c29 void *addr = OhosMalloc(MEM_TYPE_HICHAIN, size); in HcMalloc() local
31 void *addr = malloc(size); in HcMalloc() local
33 if (addr == NULL) { in HcMalloc()
37 (void)memset_s(addr, size, val, size); in HcMalloc()
38 return addr; in HcMalloc()
41 void HcFree(void *addr) in HcFree() argument
43 if (addr != NULL) { in HcFree()
45 OhosFree(addr); in HcFree()
47 free(addr); in HcFree()
/base/security/device_auth/test/unittest/tdd_framework/tdd_helper/memory_mock/src/
Dmemory_mock.c34 void* addr = malloc(size); in MockMalloc() local
35 if (addr != NULL) { in MockMalloc()
36 (void)memset_s(addr, size, val, size); in MockMalloc()
37 HcMonitorMalloc(addr, size, strFile, nLine); in MockMalloc()
39 return addr; in MockMalloc()
42 void MockFree(void *addr) in MockFree() argument
44 if (addr != NULL) { in MockFree()
45 HcMonitorFree(addr); in MockFree()
46 free(addr); in MockFree()
/base/security/crypto_framework/common/src/
Dmemory.c27 void *addr = malloc(size); in HcfMalloc() local
28 if (addr != NULL) { in HcfMalloc()
29 (void)memset_s(addr, size, val, size); in HcfMalloc()
31 return addr; in HcfMalloc()
34 void HcfFree(void *addr) in HcfFree() argument
36 if (addr != NULL) { in HcfFree()
37 free(addr); in HcfFree()
/base/startup/init/ueventd/
Dueventd_socket.c30 struct sockaddr_nl addr; in UeventdSocketInit() local
34 if (memset_s(&addr, sizeof(addr), 0, sizeof(addr)) != EOK) { in UeventdSocketInit()
38 addr.nl_family = AF_NETLINK; in UeventdSocketInit()
39 addr.nl_pid = getpid(); in UeventdSocketInit()
40 addr.nl_groups = 0xffffffff; in UeventdSocketInit()
51 if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) { in UeventdSocketInit()
66 struct sockaddr_nl addr; in ReadUeventMessage() local
76 msghdr.msg_name = &addr; in ReadUeventMessage()
77 msghdr.msg_namelen = sizeof(addr); in ReadUeventMessage()
/base/security/certificate_framework/frameworks/common/v1.0/src/
Dcf_memory.c27 void *addr = malloc(size); in HcfMalloc() local
28 if (addr != NULL) { in HcfMalloc()
29 (void)memset_s(addr, size, val, size); in HcfMalloc()
31 return addr; in HcfMalloc()
34 void CfFree(void *addr) in CfFree() argument
36 if (addr != NULL) { in CfFree()
37 free(addr); in CfFree()
/base/startup/init/services/init/
Dinit_service_socket.c37 static int GetSocketAddr(struct sockaddr_un *addr, const char *name) in GetSocketAddr() argument
39 (void)memset_s(addr, sizeof(struct sockaddr_un), 0x0, sizeof(struct sockaddr_un)); in GetSocketAddr()
40 addr->sun_family = AF_UNIX; in GetSocketAddr()
41 size_t addrLen = sizeof(addr->sun_path); in GetSocketAddr()
42 int ret = snprintf_s(addr->sun_path, addrLen, addrLen - 1, HOS_SOCKET_DIR "/%s", name); in GetSocketAddr()
47 static int SetSocketAddr(ServiceSocket *sockopt, sockaddr_union *addr) in SetSocketAddr() argument
52 if (memset_s(&(addr->addrnl), sizeof(addr->addrnl), 0, sizeof(addr->addrnl)) != EOK) { in SetSocketAddr()
56 addr->addrnl.nl_family = AF_NETLINK; in SetSocketAddr()
57 addr->addrnl.nl_pid = getpid(); in SetSocketAddr()
58 addr->addrnl.nl_groups = 0xffffffff; in SetSocketAddr()
[all …]
/base/security/device_auth/deps_adapter/os_adapter/impl/src/linux/
Dhc_types.c30 void* addr = malloc(size); in HcMalloc() local
31 if (addr == NULL) { in HcMalloc()
35 (void)memset_s(addr, size, val, size); in HcMalloc()
36 return addr; in HcMalloc()
39 void HcFree(void* addr) in HcFree() argument
41 if (addr != NULL) { in HcFree()
42 free(addr); in HcFree()
/base/security/crypto_framework/test/unittest/src/
Dmemory_mock.c44 void *addr = malloc(size); in HcfMalloc() local
45 if (addr != NULL) { in HcfMalloc()
46 (void)memset_s(addr, size, val, size); in HcfMalloc()
48 return addr; in HcfMalloc()
51 void HcfFree(void *addr) in HcfFree() argument
53 if (addr != NULL) { in HcfFree()
54 free(addr); in HcfFree()
/base/startup/init/test/exec_test/
Dclient.c38 struct sockaddr_un addr; in main() local
39 bzero(&addr, sizeof(struct sockaddr_un)); in main()
40 addr.sun_family = PF_UNIX; in main()
41 size_t addrLen = sizeof(addr.sun_path); in main()
44 ret = snprintf_s(addr.sun_path, addrLen, addrLen - 1, "/dev/unix/socket/serversock"); in main()
46 if (connect(sockFd, (struct sockaddr *)&addr, sizeof(addr))) { in main()
/base/startup/hvb/libhvb/src/rvt/
Dhvb_rvt.c33 ret = hash_calc_update(&ctx, vd->certs[n].data.addr, vd->certs[n].data.size); in hvb_calculate_certs_digest()
54 hvb_return_hvb_err_if_null(rvt->addr); in hvb_rvt_head_parser()
62 hvb_memcpy(header, rvt->addr, sizeof(*header)); in hvb_rvt_head_parser()
76 hvb_return_hvb_err_if_null(rvt->addr); in hvb_rvt_get_pubk_desc()
84 pubk_desc->addr = rvt->addr + sizeof(struct rvt_image_header); in hvb_rvt_get_pubk_desc()
98 hvb_return_hvb_err_if_null(pubk->addr); in hvb_rvt_pubk_desc_parser()
106 hvb_memcpy(desc, pubk->addr, sizeof(*desc)); in hvb_rvt_pubk_desc_parser()
115 hvb_return_hvb_err_if_null(rvt->addr); in hvb_rvt_get_pubk_buf()
118 key_buf->addr = rvt->addr + desc->pubkey_offset; in hvb_rvt_get_pubk_buf()
/base/hiviewdfx/faultloggerd/frameworks/unwinder/
Ddfx_memory.cpp39 bool DfxMemory::ReadFully(uint64_t addr, void* dst, size_t size) in ReadFully() argument
41 size_t rc = Read(addr, dst, size); in ReadFully()
45 bool DfxMemory::ReadString(uint64_t addr, std::string* dst, size_t maxRead) in ReadString() argument
51 size = Read(addr + nRead, buffer, read); in ReadString()
62 return ReadFully(addr, (void*)(dst->data()), dst->size()); in ReadString()
69 inline bool DfxMemory::Read32(uint64_t addr, uint32_t* dst) in Read32() argument
71 return ReadFully(addr, dst, sizeof(uint32_t)); in Read32()
74 inline bool DfxMemory::Read64(uint64_t addr, uint64_t* dst) in Read64() argument
76 return ReadFully(addr, dst, sizeof(uint64_t)); in Read64()
/base/startup/init/services/modules/seccomp/scripts/tools/
Dlibc_static_analysis.py26 def __init__(self, arch, addr, func_name, nr): argument
30 self.addr = addr
40 def update_addr(self, addr): argument
41 self.addr = addr
50 … print('{}\t{}\t{} use function is {}'.format(self.addr, self.func_name, nrs, self.use_function))
53 def remove_head_zero(addr): argument
55 for ch in addr:
59 return addr[pos:]
119 addr = line[:line.find(' ')]
120 addr = remove_head_zero(addr)
[all …]
/base/startup/hvb/libhvb/src/cert/
Dhvb_cert.c75 hash_err = hash_calc_update(&ctx, salt_buf->addr, salt_buf->size); in hvb_compare_hash()
81 …hash_err = hash_calc_do_final(&ctx, msg_buf->addr, msg_buf->size, &computed_hash[0], digest_buf->s… in hvb_compare_hash()
87 if (hvb_memcmp(&computed_hash[0], digest_buf->addr, computed_hash_size) != 0) { in hvb_compare_hash()
114 image_buf.addr = hvb_malloc(image_buf.size); in hash_image_init_desc()
115 if (image_buf.addr == NULL) { in hash_image_init_desc()
120 io_ret = ops->read_partition(ops, ptn, 0, image_buf.size, image_buf.addr, &read_bytes); in hash_image_init_desc()
152 if (image_buf.addr != NULL) in hash_image_init_desc()
153 hvb_free(image_buf.addr); in hash_image_init_desc()
164 buf->addr = *p; in _decode_octets()
182 payload->salt = buf.addr; in _hvb_cert_payload_parser()
[all …]
/base/security/device_auth/deps_adapter/os_adapter/interfaces/
Dhc_types.h40 #define HcFree(addr) MockFree(addr) argument
42 void MockFree(void *addr);
47 void HcFree(void* addr);
/base/hiviewdfx/faultloggerd/frameworks/unwinder/include/
Ddfx_memory.h41 bool ReadFully(uint64_t addr, void* dst, size_t size);
42 virtual size_t Read(uint64_t addr, void* dst, size_t size) = 0;
43 virtual bool ReadString(uint64_t addr, std::string* dst, size_t maxRead);
44 inline bool Read32(uint64_t addr, uint32_t* dst);
45 inline bool Read64(uint64_t addr, uint64_t* dst);
/base/startup/init/services/param/linux/
Dparam_message.c30 struct sockaddr_un addr; in ConnectServer() local
32 ret = memset_s(&addr, sizeof(addr), 0, sizeof(addr)); in ConnectServer()
34 addr.sun_family = AF_UNIX; in ConnectServer()
35 ret = sprintf_s(addr.sun_path, sizeof(addr.sun_path) - 1, "%s", servername); in ConnectServer()
37 socklen_t len = offsetof(struct sockaddr_un, sun_path) + strlen(addr.sun_path); in ConnectServer()
38 ret = connect(fd, (struct sockaddr *)&addr, len); in ConnectServer()
/base/startup/init/interfaces/innerkits/socket/
Dinit_socket.c55 struct sockaddr_un addr; in GetControlSocket() local
56 socklen_t addrlen = sizeof(addr); in GetControlSocket()
57 ret = getsockname(fd, (struct sockaddr*)&addr, &addrlen); in GetControlSocket()
62 BEGET_LOGV("Compary sockDir %s and addr.sun_path %s", sockDir, addr.sun_path); in GetControlSocket()
63 if (strncmp(sockDir, addr.sun_path, strlen(sockDir)) == 0) { in GetControlSocket()
/base/startup/init/interfaces/innerkits/fd_holder/
Dfd_holder.c31 struct sockaddr_un addr; in BuildClientSocket() local
32 (void)memset_s(&addr, sizeof(addr), 0, sizeof(addr)); in BuildClientSocket()
33 addr.sun_family = AF_UNIX; in BuildClientSocket()
34 int ret = strncpy_s(addr.sun_path, sizeof(addr.sun_path), INIT_HOLDER_SOCKET_PATH, in BuildClientSocket()
39 socklen_t len = (socklen_t)(offsetof(struct sockaddr_un, sun_path) + strlen(addr.sun_path) + 1); in BuildClientSocket()
41 ret = connect(sockFd, (struct sockaddr *)&addr, len); in BuildClientSocket()
/base/powermgr/thermal_manager/utils/native/src/
Dstring_operation.cpp90 auto addr = str.c_str(); in StrToUint() local
91 auto result = strtoul(addr, &end, 10); // 10 means decimal in StrToUint()
92 if ((end == addr) || (end[0] != '\0') || (errno == ERANGE) || (result >= ULONG_MAX)) { in StrToUint()
107 auto addr = str.c_str(); in StrToDouble() local
108 auto result = strtod(addr, &end); in StrToDouble()
109 if ((end == addr) || (end[0] != '\0') || (errno == ERANGE) || (result == HUGE_VAL)) { in StrToDouble()
/base/startup/hvb/libhvb/src/footer/
Dhvb_footer.c29 hvb_memcpy((uint8_t *)footer, footer_buf->addr, sizeof(*footer)); in _footer_parser()
55 …io_ret = ops->read_partition(ops, ptn, -HVB_FOOTER_SIZE, HVB_FOOTER_SIZE, footer_buf.addr, &read_b… in _load_and_parse_footer()
81 io_ret = ops->read_partition(ops, ptn, offset, cert->size, cert->addr, &read_bytes); in _load_cert()
108 cert_buf.addr = hvb_malloc(cert_buf.size); in footer_init_desc()
109 if (!cert_buf.addr) { in footer_init_desc()
136 if (cert_buf.addr != NULL) in footer_init_desc()
137 hvb_free(cert_buf.addr); in footer_init_desc()
/base/update/updater/services/applypatch/
Draw_writer.cpp23 bool RawWriter::Write(const uint8_t *addr, size_t len, [[maybe_unused]] const void *context) in Write() argument
25 if (addr == nullptr) { in Write()
42 if (WriteInternal(fd_, addr, len) < 0) { in Write()
Dblock_writer.cpp38 bool BlockWriter::Write(const uint8_t *addr, size_t len, [[maybe_unused]] const void *context) in Write() argument
75 if (Updater::Utils::WriteFully(fd_, addr, written) == false) { in Write()
80 addr += written; in Write()
/base/security/device_auth/test/unittest/tdd_framework/tdd_helper/memory_monitor/inc/
Dmemory_monitor.h25 void HcMonitorMalloc(void *addr, uint32_t size, const char *strFile, int nLine);
26 void HcMonitorFree(void *addr);
/base/security/device_auth/test/unittest/tdd_framework/tdd_helper/memory_monitor/src/
Dmemory_monitor.cpp60 void HcMonitorMalloc(void *addr, uint32_t size, const char *strFile, int nLine) in HcMonitorMalloc() argument
66 map<void *, MemoryBlock>::iterator iter = gMemoryMap.find(addr); in HcMonitorMalloc()
83 gMemoryMap[addr] = mb; in HcMonitorMalloc()
95 void HcMonitorFree(void *addr) in HcMonitorFree() argument
101 map<void *, MemoryBlock>::iterator iter = gMemoryMap.find(addr); in HcMonitorFree()
/base/startup/hvb/libhvb/src/auth/
Dhvb.c85 io_ret = ops->valid_rvt_key(ops, cert_pubk.addr, cert_pubk.size, NULL, 0, &is_trusted); in hvb_rvt_verify_root()
118 return buf1->size == buf2->size && hvb_memcmp(buf1->addr, buf2->addr, buf1->size) == 0; in hvb_buf_equal()
170 pubk_descs.addr += sizeof(struct rvt_pubk_desc); in hvb_walk_verify_nodes()
299 if (vd->certs[n].data.addr != NULL) in hvb_chain_verify_data_free()
300 hvb_free(vd->certs[n].data.addr); in hvb_chain_verify_data_free()
312 if (vd->images[n].data.addr != NULL) in hvb_chain_verify_data_free()
313 hvb_free(vd->images[n].data.addr); in hvb_chain_verify_data_free()

123