Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
eea374fd
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
9 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
提交
eea374fd
编写于
8月 21, 2005
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Command line support for RSAPublicKey format.
上级
2e8879fa
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
69 addition
and
5 deletion
+69
-5
CHANGES
CHANGES
+4
-0
apps/apps.c
apps/apps.c
+30
-0
apps/apps.h
apps/apps.h
+2
-0
apps/rsa.c
apps/rsa.c
+33
-5
未找到文件。
CHANGES
浏览文件 @
eea374fd
...
@@ -4,9 +4,13 @@
...
@@ -4,9 +4,13 @@
Changes between 0.9.8 and 0.9.9 [xx XXX xxxx]
Changes between 0.9.8 and 0.9.9 [xx XXX xxxx]
*) Support for PKCS#1 RSAPublicKey format on rsa utility command line.
[Steve Henson]
*) Remove the ancient ASN1_METHOD code. This was only ever used in one
*) Remove the ancient ASN1_METHOD code. This was only ever used in one
place for the (very old) "NETSCAPE" format certificates which are now
place for the (very old) "NETSCAPE" format certificates which are now
handled using new ASN1 code equivalents.
handled using new ASN1 code equivalents.
[Steve Henson]
*) Let the TLSv1_method() etc. functions return a 'const' SSL_METHOD
*) Let the TLSv1_method() etc. functions return a 'const' SSL_METHOD
pointer and make the SSL_METHOD parameter in SSL_CTX_new,
pointer and make the SSL_METHOD parameter in SSL_CTX_new,
...
...
apps/apps.c
浏览文件 @
eea374fd
...
@@ -940,6 +940,36 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
...
@@ -940,6 +940,36 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
{
{
pkey
=
d2i_PUBKEY_bio
(
key
,
NULL
);
pkey
=
d2i_PUBKEY_bio
(
key
,
NULL
);
}
}
else
if
(
format
==
FORMAT_ASN1RSA
)
{
RSA
*
rsa
;
rsa
=
d2i_RSAPublicKey_bio
(
key
,
NULL
);
if
(
rsa
)
{
pkey
=
EVP_PKEY_new
();
if
(
pkey
)
EVP_PKEY_set1_RSA
(
pkey
,
rsa
);
RSA_free
(
rsa
);
}
else
pkey
=
NULL
;
}
else
if
(
format
==
FORMAT_PEMRSA
)
{
RSA
*
rsa
;
rsa
=
PEM_read_bio_RSAPublicKey
(
key
,
NULL
,
(
pem_password_cb
*
)
password_callback
,
&
cb_data
);
if
(
rsa
)
{
pkey
=
EVP_PKEY_new
();
if
(
pkey
)
EVP_PKEY_set1_RSA
(
pkey
,
rsa
);
RSA_free
(
rsa
);
}
else
pkey
=
NULL
;
}
else
if
(
format
==
FORMAT_PEM
)
else
if
(
format
==
FORMAT_PEM
)
{
{
pkey
=
PEM_read_bio_PUBKEY
(
key
,
NULL
,
pkey
=
PEM_read_bio_PUBKEY
(
key
,
NULL
,
...
...
apps/apps.h
浏览文件 @
eea374fd
...
@@ -331,6 +331,8 @@ void policies_print(BIO *out, X509_STORE_CTX *ctx);
...
@@ -331,6 +331,8 @@ void policies_print(BIO *out, X509_STORE_CTX *ctx);
#define FORMAT_ENGINE 7
#define FORMAT_ENGINE 7
#define FORMAT_IISSGC 8
/* XXX this stupid macro helps us to avoid
#define FORMAT_IISSGC 8
/* XXX this stupid macro helps us to avoid
* adding yet another param to load_*key() */
* adding yet another param to load_*key() */
#define FORMAT_PEMRSA 9
/* PEM RSAPubicKey format */
#define FORMAT_ASN1RSA 10
/* DER RSAPubicKey format */
#define EXT_COPY_NONE 0
#define EXT_COPY_NONE 0
#define EXT_COPY_ADD 1
#define EXT_COPY_ADD 1
...
...
apps/rsa.c
浏览文件 @
eea374fd
...
@@ -173,6 +173,10 @@ int MAIN(int argc, char **argv)
...
@@ -173,6 +173,10 @@ int MAIN(int argc, char **argv)
pubin
=
1
;
pubin
=
1
;
else
if
(
strcmp
(
*
argv
,
"-pubout"
)
==
0
)
else
if
(
strcmp
(
*
argv
,
"-pubout"
)
==
0
)
pubout
=
1
;
pubout
=
1
;
else
if
(
strcmp
(
*
argv
,
"-RSAPublicKey_in"
)
==
0
)
pubin
=
2
;
else
if
(
strcmp
(
*
argv
,
"-RSAPublicKey_out"
)
==
0
)
pubout
=
2
;
else
if
(
strcmp
(
*
argv
,
"-noout"
)
==
0
)
else
if
(
strcmp
(
*
argv
,
"-noout"
)
==
0
)
noout
=
1
;
noout
=
1
;
else
if
(
strcmp
(
*
argv
,
"-text"
)
==
0
)
else
if
(
strcmp
(
*
argv
,
"-text"
)
==
0
)
...
@@ -246,10 +250,23 @@ bad:
...
@@ -246,10 +250,23 @@ bad:
EVP_PKEY
*
pkey
;
EVP_PKEY
*
pkey
;
if
(
pubin
)
if
(
pubin
)
pkey
=
load_pubkey
(
bio_err
,
infile
,
{
(
informat
==
FORMAT_NETSCAPE
&&
sgckey
?
int
tmpformat
;
FORMAT_IISSGC
:
informat
),
1
,
if
(
pubin
==
2
)
{
if
(
informat
==
FORMAT_PEM
)
tmpformat
=
FORMAT_PEMRSA
;
else
if
(
informat
==
FORMAT_ASN1
)
tmpformat
=
FORMAT_ASN1RSA
;
}
else
if
(
informat
==
FORMAT_NETSCAPE
&&
sgckey
)
tmpformat
=
FORMAT_IISSGC
;
else
tmpformat
=
informat
;
pkey
=
load_pubkey
(
bio_err
,
infile
,
tmpformat
,
1
,
passin
,
e
,
"Public Key"
);
passin
,
e
,
"Public Key"
);
}
else
else
pkey
=
load_key
(
bio_err
,
infile
,
pkey
=
load_key
(
bio_err
,
infile
,
(
informat
==
FORMAT_NETSCAPE
&&
sgckey
?
(
informat
==
FORMAT_NETSCAPE
&&
sgckey
?
...
@@ -335,7 +352,13 @@ bad:
...
@@ -335,7 +352,13 @@ bad:
}
}
BIO_printf
(
bio_err
,
"writing RSA key
\n
"
);
BIO_printf
(
bio_err
,
"writing RSA key
\n
"
);
if
(
outformat
==
FORMAT_ASN1
)
{
if
(
outformat
==
FORMAT_ASN1
)
{
if
(
pubout
||
pubin
)
i
=
i2d_RSA_PUBKEY_bio
(
out
,
rsa
);
if
(
pubout
||
pubin
)
{
if
(
pubout
==
2
)
i
=
i2d_RSAPublicKey_bio
(
out
,
rsa
);
else
i
=
i2d_RSA_PUBKEY_bio
(
out
,
rsa
);
}
else
i
=
i2d_RSAPrivateKey_bio
(
out
,
rsa
);
else
i
=
i2d_RSAPrivateKey_bio
(
out
,
rsa
);
}
}
#ifndef OPENSSL_NO_RC4
#ifndef OPENSSL_NO_RC4
...
@@ -359,7 +382,12 @@ bad:
...
@@ -359,7 +382,12 @@ bad:
#endif
#endif
else
if
(
outformat
==
FORMAT_PEM
)
{
else
if
(
outformat
==
FORMAT_PEM
)
{
if
(
pubout
||
pubin
)
if
(
pubout
||
pubin
)
i
=
PEM_write_bio_RSA_PUBKEY
(
out
,
rsa
);
{
if
(
pubout
==
2
)
i
=
PEM_write_bio_RSAPublicKey
(
out
,
rsa
);
else
i
=
PEM_write_bio_RSA_PUBKEY
(
out
,
rsa
);
}
else
i
=
PEM_write_bio_RSAPrivateKey
(
out
,
rsa
,
else
i
=
PEM_write_bio_RSAPrivateKey
(
out
,
rsa
,
enc
,
NULL
,
0
,
NULL
,
passout
);
enc
,
NULL
,
0
,
NULL
,
passout
);
}
else
{
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录