Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
openssl
提交
43760a2c
O
openssl
项目概览
btwise
/
openssl
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
43760a2c
编写于
10月 20, 2011
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix error codes.
上级
5f132a03
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
37 addition
and
36 deletion
+37
-36
fips/fips.h
fips/fips.h
+2
-1
fips/rand/fips_drbg_lib.c
fips/rand/fips_drbg_lib.c
+3
-3
fips/rand/fips_drbg_selftest.c
fips/rand/fips_drbg_selftest.c
+32
-32
未找到文件。
fips/fips.h
浏览文件 @
43760a2c
...
...
@@ -344,6 +344,7 @@ void ERR_load_FIPS_strings(void);
/* Function codes. */
#define FIPS_F_DH_BUILTIN_GENPARAMS 100
#define FIPS_F_DH_INIT 148
#define FIPS_F_DRBG_RESEED 162
#define FIPS_F_DSA_BUILTIN_PARAMGEN 101
#define FIPS_F_DSA_BUILTIN_PARAMGEN2 102
#define FIPS_F_DSA_DO_SIGN 103
...
...
@@ -364,8 +365,8 @@ void ERR_load_FIPS_strings(void);
#define FIPS_F_FIPS_DRBG_BYTES 111
#define FIPS_F_FIPS_DRBG_CHECK 146
#define FIPS_F_FIPS_DRBG_CPRNG_TEST 112
#define FIPS_F_FIPS_DRBG_ERROR_CHECK 114
#define FIPS_F_FIPS_DRBG_GENERATE 113
#define FIPS_F_FIPS_DRBG_HEALTH_CHECK 114
#define FIPS_F_FIPS_DRBG_INIT 115
#define FIPS_F_FIPS_DRBG_INSTANTIATE 116
#define FIPS_F_FIPS_DRBG_NEW 117
...
...
fips/rand/fips_drbg_lib.c
浏览文件 @
43760a2c
...
...
@@ -278,8 +278,8 @@ static int drbg_reseed(DRBG_CTX *dctx,
int
r
=
0
;
#if 0
FIPSerr(FIPS_F_
FIPS_
DRBG_RESEED, FIPS_R_NOT_INSTANTIATED);
FIPSerr(FIPS_F_
FIPS_
DRBG_RESEED, FIPS_R_ADDITIONAL_INPUT_TOO_LONG);
FIPSerr(FIPS_F_DRBG_RESEED, FIPS_R_NOT_INSTANTIATED);
FIPSerr(FIPS_F_DRBG_RESEED, FIPS_R_ADDITIONAL_INPUT_TOO_LONG);
#endif
if
(
dctx
->
status
!=
DRBG_STATUS_READY
&&
dctx
->
status
!=
DRBG_STATUS_RESEED
)
...
...
@@ -336,7 +336,7 @@ static int drbg_reseed(DRBG_CTX *dctx,
return
1
;
if
(
r
&&
!
(
dctx
->
iflags
&
DRBG_FLAG_NOERR
))
FIPSerr
(
FIPS_F_
FIPS_
DRBG_RESEED
,
r
);
FIPSerr
(
FIPS_F_DRBG_RESEED
,
r
);
return
0
;
}
...
...
fips/rand/fips_drbg_selftest.c
浏览文件 @
43760a2c
...
...
@@ -410,7 +410,7 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
if
(
FIPS_drbg_instantiate
(
dctx
,
td
->
pers
,
dctx
->
max_pers
+
1
)
>
0
)
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_PERSONALISATION_ERROR_UNDETECTED
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_PERSONALISATION_ERROR_UNDETECTED
);
goto
err
;
}
...
...
@@ -422,7 +422,7 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
if
(
FIPS_drbg_instantiate
(
dctx
,
td
->
pers
,
td
->
perslen
)
>
0
)
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_ENTROPY_ERROR_UNDETECTED
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_ENTROPY_ERROR_UNDETECTED
);
goto
err
;
}
...
...
@@ -430,14 +430,14 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
if
(
FIPS_drbg_generate
(
dctx
,
randout
,
td
->
katlen
,
0
,
td
->
adin
,
td
->
adinlen
))
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_GENERATE_ERROR_UNDETECTED
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_GENERATE_ERROR_UNDETECTED
);
goto
err
;
}
dctx
->
iflags
&=
~
DRBG_FLAG_NOERR
;
if
(
!
FIPS_drbg_uninstantiate
(
dctx
))
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_UNINSTANTIATE_ERROR
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_UNINSTANTIATE_ERROR
);
goto
err
;
}
...
...
@@ -452,14 +452,14 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
if
(
FIPS_drbg_instantiate
(
dctx
,
td
->
pers
,
td
->
perslen
)
>
0
)
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_ENTROPY_ERROR_UNDETECTED
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_ENTROPY_ERROR_UNDETECTED
);
goto
err
;
}
dctx
->
iflags
&=
~
DRBG_FLAG_NOERR
;
if
(
!
FIPS_drbg_uninstantiate
(
dctx
))
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_UNINSTANTIATE_ERROR
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_UNINSTANTIATE_ERROR
);
goto
err
;
}
...
...
@@ -474,14 +474,14 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
if
(
FIPS_drbg_instantiate
(
dctx
,
td
->
pers
,
td
->
perslen
)
>
0
)
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_ENTROPY_ERROR_UNDETECTED
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_ENTROPY_ERROR_UNDETECTED
);
goto
err
;
}
dctx
->
iflags
&=
~
DRBG_FLAG_NOERR
;
if
(
!
FIPS_drbg_uninstantiate
(
dctx
))
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_UNINSTANTIATE_ERROR
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_UNINSTANTIATE_ERROR
);
goto
err
;
}
...
...
@@ -501,14 +501,14 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
if
(
FIPS_drbg_instantiate
(
dctx
,
td
->
pers
,
td
->
perslen
)
>
0
)
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_NONCE_ERROR_UNDETECTED
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_NONCE_ERROR_UNDETECTED
);
goto
err
;
}
dctx
->
iflags
&=
~
DRBG_FLAG_NOERR
;
if
(
!
FIPS_drbg_uninstantiate
(
dctx
))
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_UNINSTANTIATE_ERROR
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_UNINSTANTIATE_ERROR
);
goto
err
;
}
...
...
@@ -528,14 +528,14 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
if
(
FIPS_drbg_instantiate
(
dctx
,
td
->
pers
,
td
->
perslen
)
>
0
)
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_NONCE_ERROR_UNDETECTED
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_NONCE_ERROR_UNDETECTED
);
goto
err
;
}
dctx
->
iflags
&=
~
DRBG_FLAG_NOERR
;
if
(
!
FIPS_drbg_uninstantiate
(
dctx
))
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_UNINSTANTIATE_ERROR
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_UNINSTANTIATE_ERROR
);
goto
err
;
}
...
...
@@ -556,7 +556,7 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
if
(
FIPS_drbg_generate
(
dctx
,
randout
,
dctx
->
max_request
+
1
,
0
,
td
->
adin
,
td
->
adinlen
))
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_REQUEST_LENGTH_ERROR_UNDETECTED
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_REQUEST_LENGTH_ERROR_UNDETECTED
);
goto
err
;
}
...
...
@@ -564,7 +564,7 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
if
(
FIPS_drbg_generate
(
dctx
,
randout
,
td
->
katlen
,
0
,
td
->
adin
,
dctx
->
max_adin
+
1
))
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_ADDITIONAL_INPUT_ERROR_UNDETECTED
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_ADDITIONAL_INPUT_ERROR_UNDETECTED
);
goto
err
;
}
...
...
@@ -577,7 +577,7 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
if
(
FIPS_drbg_generate
(
dctx
,
randout
,
td
->
katlen
,
1
,
td
->
adin
,
td
->
adinlen
))
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_ENTROPY_ERROR_UNDETECTED
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_ENTROPY_ERROR_UNDETECTED
);
goto
err
;
}
...
...
@@ -585,7 +585,7 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
if
(
!
FIPS_drbg_uninstantiate
(
dctx
))
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_UNINSTANTIATE_ERROR
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_UNINSTANTIATE_ERROR
);
goto
err
;
}
...
...
@@ -607,13 +607,13 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
goto
err
;
if
(
t
.
entcnt
!=
1
)
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_ENTROPY_NOT_REQUESTED_FOR_RESEED
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_ENTROPY_NOT_REQUESTED_FOR_RESEED
);
goto
err
;
}
/* Check reseed counter has been reset */
if
(
dctx
->
reseed_counter
!=
reseed_counter_tmp
+
1
)
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_RESEED_COUNTER_ERROR
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_RESEED_COUNTER_ERROR
);
goto
err
;
}
...
...
@@ -627,7 +627,7 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
if
(
FIPS_drbg_reseed
(
dctx
,
td
->
adin
,
dctx
->
max_adin
+
1
)
>
0
)
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_ADDITIONAL_INPUT_ERROR_UNDETECTED
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_ADDITIONAL_INPUT_ERROR_UNDETECTED
);
goto
err
;
}
...
...
@@ -642,7 +642,7 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
if
(
FIPS_drbg_generate
(
dctx
,
randout
,
td
->
katlen
,
1
,
td
->
adin
,
td
->
adinlen
))
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_ENTROPY_ERROR_UNDETECTED
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_ENTROPY_ERROR_UNDETECTED
);
goto
err
;
}
...
...
@@ -650,7 +650,7 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
if
(
!
FIPS_drbg_uninstantiate
(
dctx
))
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_UNINSTANTIATE_ERROR
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_UNINSTANTIATE_ERROR
);
goto
err
;
}
...
...
@@ -670,13 +670,13 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
goto
err
;
if
(
t
.
entcnt
!=
1
)
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_ENTROPY_NOT_REQUESTED_FOR_RESEED
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_ENTROPY_NOT_REQUESTED_FOR_RESEED
);
goto
err
;
}
/* Check reseed counter has been reset */
if
(
dctx
->
reseed_counter
!=
reseed_counter_tmp
+
1
)
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_RESEED_COUNTER_ERROR
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_RESEED_COUNTER_ERROR
);
goto
err
;
}
...
...
@@ -690,7 +690,7 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
if
(
FIPS_drbg_reseed
(
dctx
,
td
->
adin
,
dctx
->
max_adin
+
1
)
>
0
)
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_ADDITIONAL_INPUT_ERROR_UNDETECTED
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_ADDITIONAL_INPUT_ERROR_UNDETECTED
);
goto
err
;
}
...
...
@@ -705,13 +705,13 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
if
(
FIPS_drbg_reseed
(
dctx
,
td
->
adin
,
td
->
adinlen
)
>
0
)
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_ENTROPY_ERROR_UNDETECTED
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_ENTROPY_ERROR_UNDETECTED
);
goto
err
;
}
if
(
!
FIPS_drbg_uninstantiate
(
dctx
))
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_UNINSTANTIATE_ERROR
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_UNINSTANTIATE_ERROR
);
goto
err
;
}
...
...
@@ -726,13 +726,13 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
if
(
FIPS_drbg_reseed
(
dctx
,
td
->
adin
,
td
->
adinlen
)
>
0
)
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_ENTROPY_ERROR_UNDETECTED
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_ENTROPY_ERROR_UNDETECTED
);
goto
err
;
}
if
(
!
FIPS_drbg_uninstantiate
(
dctx
))
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_UNINSTANTIATE_ERROR
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_UNINSTANTIATE_ERROR
);
goto
err
;
}
...
...
@@ -747,13 +747,13 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
if
(
FIPS_drbg_reseed
(
dctx
,
td
->
adin
,
td
->
adinlen
)
>
0
)
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_ENTROPY_ERROR_UNDETECTED
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_ENTROPY_ERROR_UNDETECTED
);
goto
err
;
}
if
(
!
FIPS_drbg_uninstantiate
(
dctx
))
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_UNINSTANTIATE_ERROR
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_UNINSTANTIATE_ERROR
);
goto
err
;
}
...
...
@@ -765,7 +765,7 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
{
if
(
*
p
!=
0
)
{
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_UNINSTANTIATE_ZEROISE_ERROR
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_UNINSTANTIATE_ZEROISE_ERROR
);
goto
err
;
}
p
++
;
...
...
@@ -778,7 +778,7 @@ static int fips_drbg_error_check(DRBG_CTX *dctx, DRBG_SELFTEST_DATA *td)
* indicate the error.
*/
if
(
!
(
dctx
->
iflags
&
DRBG_FLAG_NOERR
))
FIPSerr
(
FIPS_F_FIPS_DRBG_
HEALTH
_CHECK
,
FIPS_R_FUNCTION_ERROR
);
FIPSerr
(
FIPS_F_FIPS_DRBG_
ERROR
_CHECK
,
FIPS_R_FUNCTION_ERROR
);
FIPS_drbg_uninstantiate
(
dctx
);
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录