Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
fa9bb620
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
12 个月 前同步成功
通知
8
Star
18
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fa9bb620
编写于
2月 17, 2016
作者:
R
Richard Levitte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update the documentation on heap allocators / deallocators
Reviewed-by:
N
Rich Salz
<
rsalz@openssl.org
>
上级
05c7b163
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
20 addition
and
12 deletion
+20
-12
doc/crypto/OPENSSL_malloc.pod
doc/crypto/OPENSSL_malloc.pod
+17
-10
doc/crypto/OPENSSL_secure_malloc.pod
doc/crypto/OPENSSL_secure_malloc.pod
+3
-2
未找到文件。
doc/crypto/OPENSSL_malloc.pod
浏览文件 @
fa9bb620
...
@@ -34,20 +34,20 @@ CRYPTO_mem_leaks, CRYPTO_mem_leaks_fp - Memory allocation functions
...
@@ -34,20 +34,20 @@ CRYPTO_mem_leaks, CRYPTO_mem_leaks_fp - Memory allocation functions
void *CRYPTO_malloc(size_t num, const char *file, int line)
void *CRYPTO_malloc(size_t num, const char *file, int line)
void *CRYPTO_zalloc(size_t num, const char *file, int line)
void *CRYPTO_zalloc(size_t num, const char *file, int line)
void *CRYPTO_realloc(void *p, size_t num, const char *file, int line)
void *CRYPTO_realloc(void *p, size_t num, const char *file, int line)
void CRYPTO_free(void *str)
void CRYPTO_free(void *str
, const char *, int
)
char *CRYPTO_strdup(const char *p, const char *file, int line)
char *CRYPTO_strdup(const char *p, const char *file, int line)
char *CRYPTO_strndup(const char *p, size_t num, const char *file, int line)
char *CRYPTO_strndup(const char *p, size_t num, const char *file, int line)
void *CRYPTO_clear_realloc(void *p, size_t old_len, size_t num, const char *file, int line)
void *CRYPTO_clear_realloc(void *p, size_t old_len, size_t num, const char *file, int line)
void CRYPTO_clear_free(void *str, size_t num)
void CRYPTO_clear_free(void *str, size_t num
, const char *, int
)
void CRYPTO_get_mem_functions(
void CRYPTO_get_mem_functions(
void *(**m)(size_t, const char *, int),
void *(**m)(size_t, const char *, int),
void *(**r)(void *, size_t, const char *, int),
void *(**r)(void *, size_t, const char *, int),
void (**f)(void *))
void (**f)(void *
, const char *, int
))
int CRYPTO_set_mem_functions(
int CRYPTO_set_mem_functions(
void *(*m)(size_t, const char *, int),
void *(*m)(size_t, const char *, int),
void *(*r)(void *, size_t, const char *, int),
void *(*r)(void *, size_t, const char *, int),
void (*f)(void *))
void (*f)(void *
, const char *, int
))
int CRYPTO_set_mem_debug(int onoff)
int CRYPTO_set_mem_debug(int onoff)
...
@@ -96,12 +96,11 @@ OPENSSL_strlcat() and OPENSSL_strnlen() are equivalents of the common C
...
@@ -96,12 +96,11 @@ OPENSSL_strlcat() and OPENSSL_strnlen() are equivalents of the common C
library functions and are provided for portability.
library functions and are provided for portability.
If no allocations have been done, it is possible to "swap out" the default
If no allocations have been done, it is possible to "swap out" the default
implementations and replace them with alternate versions, or wrappers that
implementations for OPENSSL_malloc(), OPENSSL_realloc and OPENSSL_free()
do some additional housekeeping and then defer to the OpenSSL implementation.
and replace them with alternate versions (hooks).
The CRYPTO_get_mem_functions() function fills in the function pointers for
CRYPTO_get_mem_functions() function fills in the given arguments with the
with the current functions (normally, and by default,
function pointers for the current implementations.
CRYPTO_malloc(), CRYPTO_realloc(), and CRYPTO_free()).
With CRYPTO_set_mem_functions(), you can specify a different set of functions.
The CRYPTO_set_mem_functions() specifies a different set of functions.
If any of B<m>, B<r>, or B<f> are NULL, then the function is not changed.
If any of B<m>, B<r>, or B<f> are NULL, then the function is not changed.
The default implementation can include some debugging capability (if enabled
The default implementation can include some debugging capability (if enabled
...
@@ -160,4 +159,12 @@ CRYPTO_mem_ctrl() returns the previous value of the mode.
...
@@ -160,4 +159,12 @@ CRYPTO_mem_ctrl() returns the previous value of the mode.
OPENSSL_mem_debug_push() and OPENSSL_mem_debug_pop()
OPENSSL_mem_debug_push() and OPENSSL_mem_debug_pop()
return 1 on success or 0 on failure.
return 1 on success or 0 on failure.
=head1 NOTES
While it's permitted to swap out only a few and not all the functions
with CRYPTO_set_mem_functions(), it's recommended to swap them all out
at once. I<This applies specially if OpenSSL was built with the
configuration option> C<crypto-mdebug> I<enabled. In case, swapping out
only, say, the malloc() implementation is outright dangerous.>
=cut
=cut
doc/crypto/OPENSSL_secure_malloc.pod
浏览文件 @
fa9bb620
...
@@ -25,7 +25,7 @@ CYRPTO_secure_malloc_used - secure heap storage
...
@@ -25,7 +25,7 @@ CYRPTO_secure_malloc_used - secure heap storage
void *CRYPTO_secure_zalloc(int num, const char *file, int line);
void *CRYPTO_secure_zalloc(int num, const char *file, int line);
void OPENSSL_secure_free(void* ptr);
void OPENSSL_secure_free(void* ptr);
void CRYPTO_secure_free(void *ptr);
void CRYPTO_secure_free(void *ptr
, const char *, int
);
size_t OPENSSL_secure_actual_size(const void *ptr);
size_t OPENSSL_secure_actual_size(const void *ptr);
int OPENSSL_secure_allocated(const void *ptr);
int OPENSSL_secure_allocated(const void *ptr);
...
@@ -74,7 +74,8 @@ OPENSSL_secure_malloc().
...
@@ -74,7 +74,8 @@ OPENSSL_secure_malloc().
If CRYPTO_secure_malloc_init() is not called, this is equivalent to
If CRYPTO_secure_malloc_init() is not called, this is equivalent to
calling OPENSSL_free().
calling OPENSSL_free().
It exists for consistency with OPENSSL_secure_malloc() , and
It exists for consistency with OPENSSL_secure_malloc() , and
is a macro that expands to CRYPTO_secure_free().
is a macro that expands to CRYPTO_secure_free() and adds the C<__FILE__>
and C<__LINE__> parameters..
OPENSSL_secure_allocated() tells whether or not a pointer is within
OPENSSL_secure_allocated() tells whether or not a pointer is within
the secure heap.
the secure heap.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录