Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
d15711ef
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看板
提交
d15711ef
编写于
6月 11, 2002
作者:
B
Ben Laurie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Handle read errors.
上级
25ace3ed
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
56 addition
and
13 deletion
+56
-13
CHANGES
CHANGES
+3
-0
apps/dgst.c
apps/dgst.c
+43
-13
crypto/bio/bio.h
crypto/bio/bio.h
+1
-0
crypto/bio/bio_err.c
crypto/bio/bio_err.c
+1
-0
crypto/bio/bss_file.c
crypto/bio/bss_file.c
+6
-0
crypto/err/err.c
crypto/err/err.c
+1
-0
crypto/err/err.h
crypto/err/err.h
+1
-0
未找到文件。
CHANGES
浏览文件 @
d15711ef
...
@@ -77,6 +77,9 @@
...
@@ -77,6 +77,9 @@
Changes between 0.9.6d and 0.9.7 [XX xxx 2002]
Changes between 0.9.6d and 0.9.7 [XX xxx 2002]
*) Improve diagnostics in file reading and command-line digests.
[Ben Laurie aided and abetted by Solar Designer <solar@openwall.com>]
*) Add AES modes CFB and OFB to the object database. Correct an
*) Add AES modes CFB and OFB to the object database. Correct an
error in AES-CFB decryption.
error in AES-CFB decryption.
[Richard Levitte]
[Richard Levitte]
...
...
apps/dgst.c
浏览文件 @
d15711ef
...
@@ -73,8 +73,9 @@
...
@@ -73,8 +73,9 @@
#undef PROG
#undef PROG
#define PROG dgst_main
#define PROG dgst_main
void
do_fp
(
BIO
*
out
,
unsigned
char
*
buf
,
BIO
*
bp
,
int
sep
,
int
binout
,
int
do_fp
(
BIO
*
out
,
unsigned
char
*
buf
,
BIO
*
bp
,
int
sep
,
int
binout
,
EVP_PKEY
*
key
,
unsigned
char
*
sigin
,
int
siglen
);
EVP_PKEY
*
key
,
unsigned
char
*
sigin
,
int
siglen
,
const
char
*
title
,
const
char
*
file
);
int
MAIN
(
int
,
char
**
);
int
MAIN
(
int
,
char
**
);
...
@@ -319,22 +320,36 @@ int MAIN(int argc, char **argv)
...
@@ -319,22 +320,36 @@ int MAIN(int argc, char **argv)
if
(
argc
==
0
)
if
(
argc
==
0
)
{
{
BIO_set_fp
(
in
,
stdin
,
BIO_NOCLOSE
);
BIO_set_fp
(
in
,
stdin
,
BIO_NOCLOSE
);
do_fp
(
out
,
buf
,
inp
,
separator
,
out_bin
,
sigkey
,
sigbuf
,
siglen
);
err
=
do_fp
(
out
,
buf
,
inp
,
separator
,
out_bin
,
sigkey
,
sigbuf
,
siglen
,
""
,
"(stdin)"
);
}
}
else
else
{
{
name
=
OBJ_nid2sn
(
md
->
type
);
name
=
OBJ_nid2sn
(
md
->
type
);
for
(
i
=
0
;
i
<
argc
;
i
++
)
for
(
i
=
0
;
i
<
argc
;
i
++
)
{
{
char
*
tmp
,
*
tofree
=
NULL
;
int
r
;
if
(
BIO_read_filename
(
in
,
argv
[
i
])
<=
0
)
if
(
BIO_read_filename
(
in
,
argv
[
i
])
<=
0
)
{
{
perror
(
argv
[
i
]);
perror
(
argv
[
i
]);
err
++
;
err
++
;
continue
;
continue
;
}
}
if
(
!
out_bin
)
BIO_printf
(
out
,
"%s(%s)= "
,
name
,
argv
[
i
]);
if
(
!
out_bin
)
do_fp
(
out
,
buf
,
inp
,
separator
,
out_bin
,
sigkey
,
{
sigbuf
,
siglen
);
tmp
=
tofree
=
OPENSSL_malloc
(
strlen
(
name
)
+
strlen
(
argv
[
i
])
+
5
);
sprintf
(
tmp
,
"%s(%s)= "
,
name
,
argv
[
i
]);
}
else
tmp
=
""
;
r
=
do_fp
(
out
,
buf
,
inp
,
separator
,
out_bin
,
sigkey
,
sigbuf
,
siglen
,
tmp
,
argv
[
i
]);
if
(
r
)
err
=
r
;
if
(
tofree
)
OPENSSL_free
(
tofree
);
(
void
)
BIO_reset
(
bmd
);
(
void
)
BIO_reset
(
bmd
);
}
}
}
}
...
@@ -353,8 +368,9 @@ end:
...
@@ -353,8 +368,9 @@ end:
EXIT
(
err
);
EXIT
(
err
);
}
}
void
do_fp
(
BIO
*
out
,
unsigned
char
*
buf
,
BIO
*
bp
,
int
sep
,
int
binout
,
int
do_fp
(
BIO
*
out
,
unsigned
char
*
buf
,
BIO
*
bp
,
int
sep
,
int
binout
,
EVP_PKEY
*
key
,
unsigned
char
*
sigin
,
int
siglen
)
EVP_PKEY
*
key
,
unsigned
char
*
sigin
,
int
siglen
,
const
char
*
title
,
const
char
*
file
)
{
{
int
len
;
int
len
;
int
i
;
int
i
;
...
@@ -362,21 +378,33 @@ void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
...
@@ -362,21 +378,33 @@ void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
for
(;;)
for
(;;)
{
{
i
=
BIO_read
(
bp
,(
char
*
)
buf
,
BUFSIZE
);
i
=
BIO_read
(
bp
,(
char
*
)
buf
,
BUFSIZE
);
if
(
i
<=
0
)
break
;
if
(
i
<
0
)
{
BIO_printf
(
bio_err
,
"Read Error in %s
\n
"
,
file
);
ERR_print_errors
(
bio_err
);
return
1
;
}
if
(
i
==
0
)
break
;
}
}
if
(
sigin
)
if
(
sigin
)
{
{
EVP_MD_CTX
*
ctx
;
EVP_MD_CTX
*
ctx
;
BIO_get_md_ctx
(
bp
,
&
ctx
);
BIO_get_md_ctx
(
bp
,
&
ctx
);
i
=
EVP_VerifyFinal
(
ctx
,
sigin
,
(
unsigned
int
)
siglen
,
key
);
i
=
EVP_VerifyFinal
(
ctx
,
sigin
,
(
unsigned
int
)
siglen
,
key
);
if
(
i
>
0
)
BIO_printf
(
out
,
"Verified OK
\n
"
);
if
(
i
>
0
)
else
if
(
i
==
0
)
BIO_printf
(
out
,
"Verification Failure
\n
"
);
BIO_printf
(
out
,
"Verified OK
\n
"
);
else
if
(
i
==
0
)
{
BIO_printf
(
out
,
"Verification Failure
\n
"
);
return
1
;
}
else
else
{
{
BIO_printf
(
bio_err
,
"Error Verifying Data
\n
"
);
BIO_printf
(
bio_err
,
"Error Verifying Data
\n
"
);
ERR_print_errors
(
bio_err
);
ERR_print_errors
(
bio_err
);
return
1
;
}
}
return
;
return
0
;
}
}
if
(
key
)
if
(
key
)
{
{
...
@@ -386,7 +414,7 @@ void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
...
@@ -386,7 +414,7 @@ void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
{
{
BIO_printf
(
bio_err
,
"Error Signing Data
\n
"
);
BIO_printf
(
bio_err
,
"Error Signing Data
\n
"
);
ERR_print_errors
(
bio_err
);
ERR_print_errors
(
bio_err
);
return
;
return
1
;
}
}
}
}
else
else
...
@@ -395,6 +423,7 @@ void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
...
@@ -395,6 +423,7 @@ void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
if
(
binout
)
BIO_write
(
out
,
buf
,
len
);
if
(
binout
)
BIO_write
(
out
,
buf
,
len
);
else
else
{
{
BIO_write
(
out
,
title
,
strlen
(
title
));
for
(
i
=
0
;
i
<
len
;
i
++
)
for
(
i
=
0
;
i
<
len
;
i
++
)
{
{
if
(
sep
&&
(
i
!=
0
))
if
(
sep
&&
(
i
!=
0
))
...
@@ -403,5 +432,6 @@ void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
...
@@ -403,5 +432,6 @@ void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
}
}
BIO_printf
(
out
,
"
\n
"
);
BIO_printf
(
out
,
"
\n
"
);
}
}
return
0
;
}
}
crypto/bio/bio.h
浏览文件 @
d15711ef
...
@@ -647,6 +647,7 @@ void ERR_load_BIO_strings(void);
...
@@ -647,6 +647,7 @@ void ERR_load_BIO_strings(void);
#define BIO_F_CONN_CTRL 127
#define BIO_F_CONN_CTRL 127
#define BIO_F_CONN_STATE 115
#define BIO_F_CONN_STATE 115
#define BIO_F_FILE_CTRL 116
#define BIO_F_FILE_CTRL 116
#define BIO_F_FILE_READ 130
#define BIO_F_LINEBUFFER_CTRL 129
#define BIO_F_LINEBUFFER_CTRL 129
#define BIO_F_MEM_READ 128
#define BIO_F_MEM_READ 128
#define BIO_F_MEM_WRITE 117
#define BIO_F_MEM_WRITE 117
...
...
crypto/bio/bio_err.c
浏览文件 @
d15711ef
...
@@ -91,6 +91,7 @@ static ERR_STRING_DATA BIO_str_functs[]=
...
@@ -91,6 +91,7 @@ static ERR_STRING_DATA BIO_str_functs[]=
{
ERR_PACK
(
0
,
BIO_F_CONN_CTRL
,
0
),
"CONN_CTRL"
},
{
ERR_PACK
(
0
,
BIO_F_CONN_CTRL
,
0
),
"CONN_CTRL"
},
{
ERR_PACK
(
0
,
BIO_F_CONN_STATE
,
0
),
"CONN_STATE"
},
{
ERR_PACK
(
0
,
BIO_F_CONN_STATE
,
0
),
"CONN_STATE"
},
{
ERR_PACK
(
0
,
BIO_F_FILE_CTRL
,
0
),
"FILE_CTRL"
},
{
ERR_PACK
(
0
,
BIO_F_FILE_CTRL
,
0
),
"FILE_CTRL"
},
{
ERR_PACK
(
0
,
BIO_F_FILE_READ
,
0
),
"FILE_READ"
},
{
ERR_PACK
(
0
,
BIO_F_LINEBUFFER_CTRL
,
0
),
"LINEBUFFER_CTRL"
},
{
ERR_PACK
(
0
,
BIO_F_LINEBUFFER_CTRL
,
0
),
"LINEBUFFER_CTRL"
},
{
ERR_PACK
(
0
,
BIO_F_MEM_READ
,
0
),
"MEM_READ"
},
{
ERR_PACK
(
0
,
BIO_F_MEM_READ
,
0
),
"MEM_READ"
},
{
ERR_PACK
(
0
,
BIO_F_MEM_WRITE
,
0
),
"MEM_WRITE"
},
{
ERR_PACK
(
0
,
BIO_F_MEM_WRITE
,
0
),
"MEM_WRITE"
},
...
...
crypto/bio/bss_file.c
浏览文件 @
d15711ef
...
@@ -162,6 +162,12 @@ static int MS_CALLBACK file_read(BIO *b, char *out, int outl)
...
@@ -162,6 +162,12 @@ static int MS_CALLBACK file_read(BIO *b, char *out, int outl)
if
(
b
->
init
&&
(
out
!=
NULL
))
if
(
b
->
init
&&
(
out
!=
NULL
))
{
{
ret
=
fread
(
out
,
1
,(
int
)
outl
,(
FILE
*
)
b
->
ptr
);
ret
=
fread
(
out
,
1
,(
int
)
outl
,(
FILE
*
)
b
->
ptr
);
if
(
ret
==
0
&&
ferror
((
FILE
*
)
b
->
ptr
))
{
SYSerr
(
SYS_F_FREAD
,
get_last_sys_error
());
BIOerr
(
BIO_F_FILE_READ
,
ERR_R_SYS_LIB
);
ret
=-
1
;
}
}
}
return
(
ret
);
return
(
ret
);
}
}
...
...
crypto/err/err.c
浏览文件 @
d15711ef
...
@@ -166,6 +166,7 @@ static ERR_STRING_DATA ERR_str_functs[]=
...
@@ -166,6 +166,7 @@ static ERR_STRING_DATA ERR_str_functs[]=
{
ERR_PACK
(
0
,
SYS_F_WSASTARTUP
,
0
),
"WSAstartup"
},
{
ERR_PACK
(
0
,
SYS_F_WSASTARTUP
,
0
),
"WSAstartup"
},
#endif
#endif
{
ERR_PACK
(
0
,
SYS_F_OPENDIR
,
0
),
"opendir"
},
{
ERR_PACK
(
0
,
SYS_F_OPENDIR
,
0
),
"opendir"
},
{
ERR_PACK
(
0
,
SYS_F_FREAD
,
0
),
"fread"
},
{
0
,
NULL
},
{
0
,
NULL
},
};
};
...
...
crypto/err/err.h
浏览文件 @
d15711ef
...
@@ -184,6 +184,7 @@ typedef struct err_state_st
...
@@ -184,6 +184,7 @@ typedef struct err_state_st
#define SYS_F_ACCEPT 8
#define SYS_F_ACCEPT 8
#define SYS_F_WSASTARTUP 9
/* Winsock stuff */
#define SYS_F_WSASTARTUP 9
/* Winsock stuff */
#define SYS_F_OPENDIR 10
#define SYS_F_OPENDIR 10
#define SYS_F_FREAD 11
/* reasons */
/* reasons */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录