Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
da9b9724
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
da9b9724
编写于
8月 01, 2002
作者:
R
Richard Levitte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make it possible to load keys from stdin, and restore that
functionality in the programs that had that before. Part fo PR 164
上级
bd45950f
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
50 addition
and
34 deletion
+50
-34
apps/apps.c
apps/apps.c
+26
-12
apps/apps.h
apps/apps.h
+2
-2
apps/ca.c
apps/ca.c
+1
-1
apps/dgst.c
apps/dgst.c
+2
-2
apps/ocsp.c
apps/ocsp.c
+2
-2
apps/pkcs12.c
apps/pkcs12.c
+1
-1
apps/pkcs8.c
apps/pkcs8.c
+2
-1
apps/req.c
apps/req.c
+1
-1
apps/rsa.c
apps/rsa.c
+2
-2
apps/rsautl.c
apps/rsautl.c
+2
-2
apps/smime.c
apps/smime.c
+1
-1
apps/spkac.c
apps/spkac.c
+1
-1
apps/x509.c
apps/x509.c
+7
-6
未找到文件。
apps/apps.c
浏览文件 @
da9b9724
...
...
@@ -798,7 +798,7 @@ end:
return
(
x
);
}
EVP_PKEY
*
load_key
(
BIO
*
err
,
const
char
*
file
,
int
format
,
EVP_PKEY
*
load_key
(
BIO
*
err
,
const
char
*
file
,
int
format
,
int
maybe_stdin
,
const
char
*
pass
,
ENGINE
*
e
,
const
char
*
key_descrip
)
{
BIO
*
key
=
NULL
;
...
...
@@ -808,7 +808,7 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format,
cb_data
.
password
=
pass
;
cb_data
.
prompt_info
=
file
;
if
(
file
==
NULL
)
if
(
file
==
NULL
&&
(
!
maybe_stdin
||
format
==
FORMAT_ENGINE
)
)
{
BIO_printf
(
err
,
"no keyfile specified
\n
"
);
goto
end
;
...
...
@@ -828,12 +828,19 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format,
ERR_print_errors
(
err
);
goto
end
;
}
if
(
BIO_read_filename
(
key
,
file
)
<=
0
)
if
(
file
==
NULL
&&
maybe_stdin
)
{
BIO_printf
(
err
,
"Error opening %s %s
\n
"
,
key_descrip
,
file
);
ERR_print_errors
(
err
);
goto
end
;
setvbuf
(
stdin
,
NULL
,
_IONBF
,
0
);
BIO_set_fp
(
key
,
stdin
,
BIO_NOCLOSE
);
}
else
if
(
BIO_read_filename
(
key
,
file
)
<=
0
)
{
BIO_printf
(
err
,
"Error opening %s %s
\n
"
,
key_descrip
,
file
);
ERR_print_errors
(
err
);
goto
end
;
}
if
(
format
==
FORMAT_ASN1
)
{
pkey
=
d2i_PrivateKey_bio
(
key
,
NULL
);
...
...
@@ -867,7 +874,7 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format,
return
(
pkey
);
}
EVP_PKEY
*
load_pubkey
(
BIO
*
err
,
const
char
*
file
,
int
format
,
EVP_PKEY
*
load_pubkey
(
BIO
*
err
,
const
char
*
file
,
int
format
,
int
maybe_stdin
,
const
char
*
pass
,
ENGINE
*
e
,
const
char
*
key_descrip
)
{
BIO
*
key
=
NULL
;
...
...
@@ -877,7 +884,7 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format,
cb_data
.
password
=
pass
;
cb_data
.
prompt_info
=
file
;
if
(
file
==
NULL
)
if
(
file
==
NULL
&&
(
!
maybe_stdin
||
format
==
FORMAT_ENGINE
)
)
{
BIO_printf
(
err
,
"no keyfile specified
\n
"
);
goto
end
;
...
...
@@ -897,11 +904,18 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format,
ERR_print_errors
(
err
);
goto
end
;
}
if
(
BIO_read_filename
(
key
,
file
)
<=
0
)
if
(
file
==
NULL
&&
maybe_stdin
)
{
BIO_printf
(
err
,
"Error opening %s %s
\n
"
,
key_descrip
,
file
);
ERR_print_errors
(
err
);
goto
end
;
setvbuf
(
stdin
,
NULL
,
_IONBF
,
0
);
BIO_set_fp
(
key
,
stdin
,
BIO_NOCLOSE
);
}
else
if
(
BIO_read_filename
(
key
,
file
)
<=
0
)
{
BIO_printf
(
err
,
"Error opening %s %s
\n
"
,
key_descrip
,
file
);
ERR_print_errors
(
err
);
goto
end
;
}
if
(
format
==
FORMAT_ASN1
)
{
...
...
apps/apps.h
浏览文件 @
da9b9724
...
...
@@ -233,9 +233,9 @@ int app_passwd(BIO *err, char *arg1, char *arg2, char **pass1, char **pass2);
int
add_oid_section
(
BIO
*
err
,
CONF
*
conf
);
X509
*
load_cert
(
BIO
*
err
,
const
char
*
file
,
int
format
,
const
char
*
pass
,
ENGINE
*
e
,
const
char
*
cert_descrip
);
EVP_PKEY
*
load_key
(
BIO
*
err
,
const
char
*
file
,
int
format
,
EVP_PKEY
*
load_key
(
BIO
*
err
,
const
char
*
file
,
int
format
,
int
maybe_stdin
,
const
char
*
pass
,
ENGINE
*
e
,
const
char
*
key_descrip
);
EVP_PKEY
*
load_pubkey
(
BIO
*
err
,
const
char
*
file
,
int
format
,
EVP_PKEY
*
load_pubkey
(
BIO
*
err
,
const
char
*
file
,
int
format
,
int
maybe_stdin
,
const
char
*
pass
,
ENGINE
*
e
,
const
char
*
key_descrip
);
STACK_OF
(
X509
)
*
load_certs
(
BIO
*
err
,
const
char
*
file
,
int
format
,
const
char
*
pass
,
ENGINE
*
e
,
const
char
*
cert_descrip
);
...
...
apps/ca.c
浏览文件 @
da9b9724
...
...
@@ -699,7 +699,7 @@ bad:
goto
err
;
}
}
pkey
=
load_key
(
bio_err
,
keyfile
,
keyform
,
key
,
e
,
pkey
=
load_key
(
bio_err
,
keyfile
,
keyform
,
0
,
key
,
e
,
"CA private key"
);
if
(
key
)
memset
(
key
,
0
,
strlen
(
key
));
if
(
pkey
==
NULL
)
...
...
apps/dgst.c
浏览文件 @
da9b9724
...
...
@@ -277,10 +277,10 @@ int MAIN(int argc, char **argv)
if
(
keyfile
)
{
if
(
want_pub
)
sigkey
=
load_pubkey
(
bio_err
,
keyfile
,
keyform
,
NULL
,
sigkey
=
load_pubkey
(
bio_err
,
keyfile
,
keyform
,
0
,
NULL
,
e
,
"key file"
);
else
sigkey
=
load_key
(
bio_err
,
keyfile
,
keyform
,
NULL
,
sigkey
=
load_key
(
bio_err
,
keyfile
,
keyform
,
0
,
NULL
,
e
,
"key file"
);
if
(
!
sigkey
)
{
...
...
apps/ocsp.c
浏览文件 @
da9b9724
...
...
@@ -617,7 +617,7 @@ int MAIN(int argc, char **argv)
NULL
,
e
,
"responder other certificates"
);
if
(
!
rother
)
goto
end
;
}
rkey
=
load_key
(
bio_err
,
rkeyfile
,
FORMAT_PEM
,
NULL
,
NULL
,
rkey
=
load_key
(
bio_err
,
rkeyfile
,
FORMAT_PEM
,
0
,
NULL
,
NULL
,
"responder private key"
);
if
(
!
rkey
)
goto
end
;
...
...
@@ -663,7 +663,7 @@ int MAIN(int argc, char **argv)
NULL
,
e
,
"signer certificates"
);
if
(
!
sign_other
)
goto
end
;
}
key
=
load_key
(
bio_err
,
keyfile
,
FORMAT_PEM
,
NULL
,
NULL
,
key
=
load_key
(
bio_err
,
keyfile
,
FORMAT_PEM
,
0
,
NULL
,
NULL
,
"signer private key"
);
if
(
!
key
)
goto
end
;
...
...
apps/pkcs12.c
浏览文件 @
da9b9724
...
...
@@ -427,7 +427,7 @@ int MAIN(int argc, char **argv)
CRYPTO_push_info
(
"process -export_cert"
);
CRYPTO_push_info
(
"reading private key"
);
#endif
key
=
load_key
(
bio_err
,
keyname
?
keyname
:
infile
,
FORMAT_PEM
,
key
=
load_key
(
bio_err
,
keyname
?
keyname
:
infile
,
FORMAT_PEM
,
1
,
passin
,
e
,
"private key"
);
if
(
!
key
)
{
goto
export_end
;
...
...
apps/pkcs8.c
浏览文件 @
da9b9724
...
...
@@ -222,7 +222,8 @@ int MAIN(int argc, char **argv)
if
(
topk8
)
{
BIO_free
(
in
);
/* Not needed in this section */
pkey
=
load_key
(
bio_err
,
infile
,
informat
,
passin
,
e
,
"key"
);
pkey
=
load_key
(
bio_err
,
infile
,
informat
,
1
,
passin
,
e
,
"key"
);
if
(
!
pkey
)
{
return
(
1
);
}
...
...
apps/req.c
浏览文件 @
da9b9724
...
...
@@ -683,7 +683,7 @@ bad:
if
(
keyfile
!=
NULL
)
{
pkey
=
load_key
(
bio_err
,
keyfile
,
keyform
,
passin
,
e
,
pkey
=
load_key
(
bio_err
,
keyfile
,
keyform
,
0
,
passin
,
e
,
"Private Key"
);
if
(
!
pkey
)
{
...
...
apps/rsa.c
浏览文件 @
da9b9724
...
...
@@ -238,12 +238,12 @@ bad:
if
(
pubin
)
pkey
=
load_pubkey
(
bio_err
,
infile
,
(
informat
==
FORMAT_NETSCAPE
&&
sgckey
?
FORMAT_IISSGC
:
informat
),
FORMAT_IISSGC
:
informat
),
1
,
passin
,
e
,
"Public Key"
);
else
pkey
=
load_key
(
bio_err
,
infile
,
(
informat
==
FORMAT_NETSCAPE
&&
sgckey
?
FORMAT_IISSGC
:
informat
),
FORMAT_IISSGC
:
informat
),
1
,
passin
,
e
,
"Private Key"
);
if
(
pkey
!=
NULL
)
...
...
apps/rsautl.c
浏览文件 @
da9b9724
...
...
@@ -169,12 +169,12 @@ int MAIN(int argc, char **argv)
switch
(
key_type
)
{
case
KEY_PRIVKEY
:
pkey
=
load_key
(
bio_err
,
keyfile
,
keyform
,
pkey
=
load_key
(
bio_err
,
keyfile
,
keyform
,
0
,
NULL
,
e
,
"Private Key"
);
break
;
case
KEY_PUBKEY
:
pkey
=
load_pubkey
(
bio_err
,
keyfile
,
keyform
,
pkey
=
load_pubkey
(
bio_err
,
keyfile
,
keyform
,
0
,
NULL
,
e
,
"Public Key"
);
break
;
...
...
apps/smime.c
浏览文件 @
da9b9724
...
...
@@ -428,7 +428,7 @@ int MAIN(int argc, char **argv)
}
else
keyfile
=
NULL
;
if
(
keyfile
)
{
key
=
load_key
(
bio_err
,
keyfile
,
keyform
,
passin
,
e
,
key
=
load_key
(
bio_err
,
keyfile
,
keyform
,
0
,
passin
,
e
,
"signing key file"
);
if
(
!
key
)
{
goto
end
;
...
...
apps/spkac.c
浏览文件 @
da9b9724
...
...
@@ -186,7 +186,7 @@ bad:
if
(
keyfile
)
{
pkey
=
load_key
(
bio_err
,
strcmp
(
keyfile
,
"-"
)
?
keyfile
:
NULL
,
FORMAT_PEM
,
passin
,
e
,
"private key"
);
FORMAT_PEM
,
1
,
passin
,
e
,
"private key"
);
if
(
!
pkey
)
{
goto
end
;
}
...
...
apps/x509.c
浏览文件 @
da9b9724
...
...
@@ -861,8 +861,8 @@ bad:
if
(
Upkey
==
NULL
)
{
Upkey
=
load_key
(
bio_err
,
keyfile
,
keyformat
,
passin
,
e
,
"Private key"
);
keyfile
,
keyformat
,
0
,
passin
,
e
,
"Private key"
);
if
(
Upkey
==
NULL
)
goto
end
;
}
#ifndef OPENSSL_NO_DSA
...
...
@@ -884,8 +884,9 @@ bad:
if
(
CAkeyfile
!=
NULL
)
{
CApkey
=
load_key
(
bio_err
,
CAkeyfile
,
CAkeyformat
,
passin
,
e
,
"CA Private Key"
);
CAkeyfile
,
CAkeyformat
,
0
,
passin
,
e
,
"CA Private Key"
);
if
(
CApkey
==
NULL
)
goto
end
;
}
#ifndef OPENSSL_NO_DSA
...
...
@@ -916,8 +917,8 @@ bad:
else
{
pk
=
load_key
(
bio_err
,
keyfile
,
FORMAT_PEM
,
passin
,
e
,
"request key"
);
keyfile
,
FORMAT_PEM
,
0
,
passin
,
e
,
"request key"
);
if
(
pk
==
NULL
)
goto
end
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录