Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
777ab7e6
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
1 年多 前同步成功
通知
10
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看板
提交
777ab7e6
编写于
7月 09, 1999
作者:
B
Bodo Möller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix memory checking.
上级
a026fd20
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
42 addition
and
14 deletion
+42
-14
CHANGES
CHANGES
+14
-0
apps/openssl.c
apps/openssl.c
+1
-1
crypto/dsa/dsatest.c
crypto/dsa/dsatest.c
+1
-1
crypto/mem.c
crypto/mem.c
+24
-10
crypto/rsa/rsa_oaep_test.c
crypto/rsa/rsa_oaep_test.c
+1
-1
ssl/ssltest.c
ssl/ssltest.c
+1
-1
未找到文件。
CHANGES
浏览文件 @
777ab7e6
...
...
@@ -4,6 +4,20 @@
Changes between 0.9.3a and 0.9.4
*) Memory leak checking had some problems. The interface is as follows:
Applications can use
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON) aka MemCheck_start(),
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF) aka MemCheck_stop();
"off" is now the default.
The library internally uses
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE) aka MemCheck_off(),
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE) aka MemCheck_on()
to disable memory-checking temporarily.
Some inconsistent states that previously were possible (and were
even the default) are now avoided.
[Bodo Moeller]
*) Introduce "mode" for SSL structures (with defaults in SSL_CTX),
which largely parallels "options", but is for changing API behaviour,
whereas "options" are about protocol behaviour.
...
...
apps/openssl.c
浏览文件 @
777ab7e6
...
...
@@ -136,7 +136,7 @@ int main(int Argc, char *Argv[])
if
((
bio_err
=
BIO_new
(
BIO_s_file
()))
!=
NULL
)
BIO_set_fp
(
bio_err
,
stderr
,
BIO_NOCLOSE
|
BIO_FP_TEXT
);
CRYPTO_mem_ctrl
(
CRYPTO_MEM_CHECK_
ENABLE
);
CRYPTO_mem_ctrl
(
CRYPTO_MEM_CHECK_
ON
);
ERR_load_crypto_strings
();
...
...
crypto/dsa/dsatest.c
浏览文件 @
777ab7e6
...
...
@@ -134,7 +134,7 @@ int main(int argc, char **argv)
if
(
bio_err
==
NULL
)
bio_err
=
BIO_new_fp
(
stderr
,
BIO_NOCLOSE
);
CRYPTO_mem_ctrl
(
CRYPTO_MEM_CHECK_
ENABLE
);
CRYPTO_mem_ctrl
(
CRYPTO_MEM_CHECK_
ON
);
BIO_printf
(
bio_err
,
"test generation of DSA parameters
\n
"
);
BIO_printf
(
bio_err
,
"expect '.*' followed by 5 lines of '.'s and '+'s
\n
"
);
...
...
crypto/mem.c
浏览文件 @
777ab7e6
...
...
@@ -63,11 +63,21 @@
#include <openssl/lhash.h>
#include "cryptlib.h"
#ifdef CRYPTO_MDEBUG
static
int
mh_mode
=
CRYPTO_MEM_CHECK_ON
;
#else
/* #ifdef CRYPTO_MDEBUG */
/* static int mh_mode=CRYPTO_MEM_CHECK_ON; */
/* #else */
static
int
mh_mode
=
CRYPTO_MEM_CHECK_OFF
;
#endif
/* #endif */
/* State CRYPTO_MEM_CHECK_ON exists only temporarily when the library
* thinks that certain allocations should not be checked (e.g. the data
* structures used for memory checking). It is not suitable as an initial
* state: the library will unexpectedly enable memory checking when it
* executes one of those sections that want to disable checking
* temporarily.
*
* State CRYPTO_MEM_CHECK_ENABLE without ..._ON makes no sense whatsoever.
*/
static
unsigned
long
order
=
0
;
static
LHASH
*
mh
=
NULL
;
...
...
@@ -88,19 +98,23 @@ int CRYPTO_mem_ctrl(int mode)
CRYPTO_w_lock
(
CRYPTO_LOCK_MALLOC
);
switch
(
mode
)
{
case
CRYPTO_MEM_CHECK_ON
:
mh_mode
|=
CRYPTO_MEM_CHECK_ON
;
/* for applications: */
case
CRYPTO_MEM_CHECK_ON
:
/* aka MemCheck_start() */
mh_mode
=
CRYPTO_MEM_CHECK_ON
|
CRYPTO_MEM_CHECK_ENABLE
;
break
;
case
CRYPTO_MEM_CHECK_OFF
:
mh_mode
&=
~
CRYPTO_MEM_CHECK_ON
;
case
CRYPTO_MEM_CHECK_OFF
:
/* aka MemCheck_stop() */
mh_mode
=
0
;
break
;
case
CRYPTO_MEM_CHECK_DISABLE
:
/* switch off temporarily (for library-internal use): */
case
CRYPTO_MEM_CHECK_DISABLE
:
/* aka MemCheck_off() */
mh_mode
&=
~
CRYPTO_MEM_CHECK_ENABLE
;
break
;
case
CRYPTO_MEM_CHECK_ENABLE
:
case
CRYPTO_MEM_CHECK_ENABLE
:
/* aka MemCheck_on() */
if
(
mh_mode
&
CRYPTO_MEM_CHECK_ON
)
mh_mode
|=
CRYPTO_MEM_CHECK_ENABLE
;
break
;
default:
break
;
}
...
...
crypto/rsa/rsa_oaep_test.c
浏览文件 @
777ab7e6
...
...
@@ -216,7 +216,7 @@ int main()
int
clen
=
0
;
int
num
;
CRYPTO_mem_ctrl
(
CRYPTO_MEM_CHECK_
ENABLE
);
CRYPTO_mem_ctrl
(
CRYPTO_MEM_CHECK_
ON
);
plen
=
sizeof
(
ptext_ex
)
-
1
;
...
...
ssl/ssltest.c
浏览文件 @
777ab7e6
...
...
@@ -163,7 +163,7 @@ int main(int argc, char *argv[])
bio_err
=
BIO_new_fp
(
stderr
,
BIO_NOCLOSE
);
bio_stdout
=
BIO_new_fp
(
stdout
,
BIO_NOCLOSE
);
CRYPTO_mem_ctrl
(
CRYPTO_MEM_CHECK_
ENABLE
);
CRYPTO_mem_ctrl
(
CRYPTO_MEM_CHECK_
ON
);
argc
--
;
argv
++
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录