Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
65b002f3
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看板
提交
65b002f3
编写于
3月 13, 2000
作者:
B
Bodo Möller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update test suite so that 'make test' succeeds in 'no-rsa' configuration.
上级
bc23b70e
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
135 addition
and
53 deletion
+135
-53
CHANGES
CHANGES
+3
-0
crypto/asn1/t_req.c
crypto/asn1/t_req.c
+4
-3
ssl/ssltest.c
ssl/ssltest.c
+22
-3
test/Makefile.ssl
test/Makefile.ssl
+9
-5
test/testgen
test/testgen
+11
-5
test/testss
test/testss
+9
-2
test/testssl
test/testssl
+72
-35
test/treq
test/treq
+5
-0
未找到文件。
CHANGES
浏览文件 @
65b002f3
...
...
@@ -4,6 +4,9 @@
Changes between 0.9.5 and 0.9.5a [XX XXX 2000]
*) Update test suite so that 'make test' succeeds in 'no-rsa' configuration.
[Bodo Moeller]
*) For SSL_[CTX_]set_tmp_dh, don't create a DH key if SSL_OP_SINGLE_DH_USE
is set; it will be thrown away anyway because each handshake creates
its own key.
...
...
crypto/asn1/t_req.c
浏览文件 @
65b002f3
...
...
@@ -119,7 +119,7 @@ int X509_REQ_print(BIO *bp, X509_REQ *x)
pkey
=
X509_REQ_get_pubkey
(
x
);
#ifndef NO_RSA
if
(
pkey
->
type
==
EVP_PKEY_RSA
)
if
(
pkey
!=
NULL
&&
pkey
->
type
==
EVP_PKEY_RSA
)
{
BIO_printf
(
bp
,
"%12sRSA Public Key: (%d bit)
\n
"
,
""
,
BN_num_bits
(
pkey
->
pkey
.
rsa
->
n
));
...
...
@@ -128,7 +128,7 @@ int X509_REQ_print(BIO *bp, X509_REQ *x)
else
#endif
#ifndef NO_DSA
if
(
pkey
->
type
==
EVP_PKEY_DSA
)
if
(
pkey
!=
NULL
&&
pkey
->
type
==
EVP_PKEY_DSA
)
{
BIO_printf
(
bp
,
"%12sDSA Public Key:
\n
"
,
""
);
DSA_print
(
bp
,
pkey
->
pkey
.
dsa
,
16
);
...
...
@@ -137,7 +137,8 @@ int X509_REQ_print(BIO *bp, X509_REQ *x)
#endif
BIO_printf
(
bp
,
"%12sUnknown Public Key:
\n
"
,
""
);
EVP_PKEY_free
(
pkey
);
if
(
pkey
!=
NULL
)
EVP_PKEY_free
(
pkey
);
/* may not be */
sprintf
(
str
,
"%8sAttributes:
\n
"
,
""
);
...
...
ssl/ssltest.c
浏览文件 @
65b002f3
...
...
@@ -140,6 +140,7 @@ static void sv_usage(void)
fprintf
(
stderr
,
" -CApath arg - PEM format directory of CA's
\n
"
);
fprintf
(
stderr
,
" -CAfile arg - PEM format file of CA's
\n
"
);
fprintf
(
stderr
,
" -cert arg - Certificate file
\n
"
);
fprintf
(
stderr
,
" -key arg - Key file
\n
"
);
fprintf
(
stderr
,
" -s_cert arg - Just the server certificate file
\n
"
);
fprintf
(
stderr
,
" -c_cert arg - Just the client certificate file
\n
"
);
fprintf
(
stderr
,
" -cipher arg - The cipher list
\n
"
);
...
...
@@ -202,7 +203,9 @@ int main(int argc, char *argv[])
int
client_auth
=
0
;
int
server_auth
=
0
,
i
;
char
*
server_cert
=
TEST_SERVER_CERT
;
char
*
server_key
=
NULL
;
char
*
client_cert
=
TEST_CLIENT_CERT
;
char
*
client_key
=
NULL
;
SSL_CTX
*
s_ctx
=
NULL
;
SSL_CTX
*
c_ctx
=
NULL
;
SSL_METHOD
*
meth
=
NULL
;
...
...
@@ -282,11 +285,26 @@ int main(int argc, char *argv[])
if
(
--
argc
<
1
)
goto
bad
;
server_cert
=
*
(
++
argv
);
}
else
if
(
strcmp
(
*
argv
,
"-key"
)
==
0
)
{
if
(
--
argc
<
1
)
goto
bad
;
server_key
=
*
(
++
argv
);
}
else
if
(
strcmp
(
*
argv
,
"-s_key"
)
==
0
)
{
if
(
--
argc
<
1
)
goto
bad
;
server_key
=
*
(
++
argv
);
}
else
if
(
strcmp
(
*
argv
,
"-c_cert"
)
==
0
)
{
if
(
--
argc
<
1
)
goto
bad
;
client_cert
=
*
(
++
argv
);
}
else
if
(
strcmp
(
*
argv
,
"-c_key"
)
==
0
)
{
if
(
--
argc
<
1
)
goto
bad
;
client_key
=
*
(
++
argv
);
}
else
if
(
strcmp
(
*
argv
,
"-cipher"
)
==
0
)
{
if
(
--
argc
<
1
)
goto
bad
;
...
...
@@ -416,8 +434,8 @@ bad:
{
ERR_print_errors
(
bio_err
);
}
else
if
(
!
SSL_CTX_use_PrivateKey_file
(
s_ctx
,
server_cert
,
SSL_FILETYPE_PEM
))
else
if
(
!
SSL_CTX_use_PrivateKey_file
(
s_ctx
,
(
server_key
?
server_key
:
server_cert
),
SSL_FILETYPE_PEM
))
{
ERR_print_errors
(
bio_err
);
goto
end
;
...
...
@@ -427,7 +445,8 @@ bad:
{
SSL_CTX_use_certificate_file
(
c_ctx
,
client_cert
,
SSL_FILETYPE_PEM
);
SSL_CTX_use_PrivateKey_file
(
c_ctx
,
client_cert
,
SSL_CTX_use_PrivateKey_file
(
c_ctx
,
(
client_key
?
client_key
:
client_cert
),
SSL_FILETYPE_PEM
);
}
...
...
test/Makefile.ssl
浏览文件 @
65b002f3
...
...
@@ -206,17 +206,21 @@ test_gen:
@
echo
"Generate and verify a certificate request"
@
sh ./testgen
test_ss
:
test_ss
keyU.ss certU.ss certCA.ss
:
@
echo
"Generate and certify a test certificate"
@
sh ./testss
test_ssl
:
test_ssl
:
keyU.ss certU.ss certCA.ss
@
echo
"test SSL protocol"
@
sh ./testssl
@
sh ./testssl
keyU.ss certU.ss certCA.ss
test_ca
:
@
echo
"Generate and certify a test certificate via the 'ca' program"
@
sh ./testca
@
if
../apps/openssl list-standard-commands |
grep
'^rsa$$'
>
/dev/null
;
then
\
echo
"Generate and certify a test certificate via the 'ca' program"
;
\
sh ./testca
;
\
else
\
echo
"skipping CA.sh test -- requires RSA"
;
\
fi
lint
:
lint
-DLINT
$(INCLUDES)
$(SRC)
>
fluff
...
...
test/testgen
浏览文件 @
65b002f3
...
...
@@ -11,13 +11,19 @@ export PATH
echo
"generating certificate request"
echo
"There should be a 2 sequences of .'s and some +'s."
echo
"There should not be more that at most 80 per line"
echo
"This could take some time."
echo
"string to make the random number generator think it has entropy"
>>
./.rnd
../apps/openssl req
-config
test.cnf
-new
-out
testreq.pem
if
../apps/openssl list-standard-commands |
grep
'^rsa$'
>
/dev/null
;
then
req_new
=
'-new'
echo
"There should be a 2 sequences of .'s and some +'s."
echo
"There should not be more that at most 80 per line"
else
req_new
=
'-newkey dsa:../apps/dsa512.pem'
fi
echo
"This could take some time."
../apps/openssl req
-config
test.cnf
$req_new
-out
testreq.pem
if
[
$?
!=
0
]
;
then
echo
problems creating request
exit
1
...
...
test/testss
浏览文件 @
65b002f3
...
...
@@ -19,7 +19,14 @@ Ucert="certU.ss"
echo
echo
"make a certificate request using 'req'"
$reqcmd
-config
$CAconf
-out
$CAreq
-keyout
$CAkey
-new
#>err.ss
if
../apps/openssl list-standard-commands |
grep
'^rsa$'
>
/dev/null
;
then
req_new
=
'-new'
else
req_new
=
'-newkey dsa:../apps/dsa512.pem'
fi
$reqcmd
-config
$CAconf
-out
$CAreq
-keyout
$CAkey
$req_new
#>err.ss
if
[
$?
!=
0
]
;
then
echo
"error using 'req' to generate a certificate request"
exit
1
...
...
@@ -60,7 +67,7 @@ fi
echo
echo
"make another certificate request using 'req'"
$reqcmd
-config
$Uconf
-out
$Ureq
-keyout
$Ukey
-
new
>
err.ss
$reqcmd
-config
$Uconf
-out
$Ureq
-keyout
$Ukey
$req_
new
>
err.ss
if
[
$?
!=
0
]
;
then
echo
"error using 'req' to generate a certificate request"
exit
1
...
...
test/testssl
浏览文件 @
65b002f3
#!/bin/sh
if
[
"
$1
"
=
""
]
;
then
key
=
../apps/server.pem
else
key
=
"
$1
"
fi
if
[
"
$2
"
=
""
]
;
then
cert
=
../apps/server.pem
else
cert
=
"
$2
"
fi
ssltest
=
"./ssltest -key
$1
-cert
$2
-c_key
$1
-c_cert
$2
"
if
../apps/openssl x509
-in
$cert
-text
-noout
| fgrep
'DSA Public Key'
;
then
dsa_cert
=
YES
else
dsa_cert
=
NO
fi
if
[
"
$3
"
=
""
]
;
then
CA
=
"-CApath ../certs"
else
CA
=
"-CAfile
$3
"
fi
#############################################################################
echo test
sslv2
./
ssltest
-ssl2
||
exit
1
$
ssltest
-ssl2
||
exit
1
echo test
sslv2 with server authentication
./ssltest
-ssl2
-server_auth
-CApath
../certs
||
exit
1
$ssltest
-ssl2
-server_auth
$CA
||
exit
1
echo test
sslv2 with client authentication
./ssltest
-ssl2
-client_auth
-CApath
../certs
||
exit
1
if
[
$dsa_cert
=
NO
]
;
then
echo test
sslv2 with client authentication
$ssltest
-ssl2
-client_auth
$CA
||
exit
1
echo test
sslv2 with both client and server authentication
./ssltest
-ssl2
-server_auth
-client_auth
-CApath
../certs
||
exit
1
echo test
sslv2 with both client and server authentication
$ssltest
-ssl2
-server_auth
-client_auth
$CA
||
exit
1
fi
echo test
sslv3
./
ssltest
-ssl3
||
exit
1
$
ssltest
-ssl3
||
exit
1
echo test
sslv3 with server authentication
./ssltest
-ssl3
-server_auth
-CApath
../certs
||
exit
1
$ssltest
-ssl3
-server_auth
$CA
||
exit
1
echo test
sslv3 with client authentication
./ssltest
-ssl3
-client_auth
-CApath
../certs
||
exit
1
$ssltest
-ssl3
-client_auth
$CA
||
exit
1
echo test
sslv3 with both client and server authentication
./ssltest
-ssl3
-server_auth
-client_auth
-CApath
../certs
||
exit
1
$ssltest
-ssl3
-server_auth
-client_auth
$CA
||
exit
1
echo test
sslv2/sslv3
./
ssltest
||
exit
1
$
ssltest
||
exit
1
echo test
sslv2/sslv3 with server authentication
./ssltest
-server_auth
-CApath
../certs
||
exit
1
$ssltest
-server_auth
$CA
||
exit
1
echo test
sslv2/sslv3 with client authentication
./ssltest
-client_auth
-CApath
../certs
||
exit
1
$ssltest
-client_auth
$CA
||
exit
1
echo test
sslv2/sslv3 with both client and server authentication
./ssltest
-server_auth
-client_auth
-CApath
../certs
||
exit
1
$ssltest
-server_auth
-client_auth
$CA
||
exit
1
echo test
sslv2 via BIO pair
./
ssltest
-bio_pair
-ssl2
||
exit
1
$
ssltest
-bio_pair
-ssl2
||
exit
1
echo test
sslv2 with server authentication via BIO pair
./ssltest
-bio_pair
-ssl2
-server_auth
-CApath
../certs
||
exit
1
$ssltest
-bio_pair
-ssl2
-server_auth
$CA
||
exit
1
echo test
sslv2 with client authentication via BIO pair
./ssltest
-bio_pair
-ssl2
-client_auth
-CApath
../certs
||
exit
1
if
[
$dsa_cert
=
NO
]
;
then
echo test
sslv2 with client authentication via BIO pair
$ssltest
-bio_pair
-ssl2
-client_auth
$CA
||
exit
1
echo test
sslv2 with both client and server authentication via BIO pair
./ssltest
-bio_pair
-ssl2
-server_auth
-client_auth
-CApath
../certs
||
exit
1
echo test
sslv2 with both client and server authentication via BIO pair
$ssltest
-bio_pair
-ssl2
-server_auth
-client_auth
$CA
||
exit
1
fi
echo test
sslv3 via BIO pair
./
ssltest
-bio_pair
-ssl3
||
exit
1
$
ssltest
-bio_pair
-ssl3
||
exit
1
echo test
sslv3 with server authentication via BIO pair
./ssltest
-bio_pair
-ssl3
-server_auth
-CApath
../certs
||
exit
1
$ssltest
-bio_pair
-ssl3
-server_auth
$CA
||
exit
1
echo test
sslv3 with client authentication via BIO pair
./ssltest
-bio_pair
-ssl3
-client_auth
-CApath
../certs
||
exit
1
$ssltest
-bio_pair
-ssl3
-client_auth
$CA
||
exit
1
echo test
sslv3 with both client and server authentication via BIO pair
./ssltest
-bio_pair
-ssl3
-server_auth
-client_auth
-CApath
../certs
||
exit
1
$ssltest
-bio_pair
-ssl3
-server_auth
-client_auth
$CA
||
exit
1
echo test
sslv2/sslv3 via BIO pair
./
ssltest
||
exit
1
$
ssltest
||
exit
1
echo test
sslv2/sslv3 w/o DHE via BIO pair
./ssltest
-bio_pair
-no_dhe
||
exit
1
if
[
$dsa_cert
=
NO
]
;
then
echo test
sslv2/sslv3 w/o DHE via BIO pair
$ssltest
-bio_pair
-no_dhe
||
exit
1
fi
echo test
sslv2/sslv3 with 1024bit DHE via BIO pair
./
ssltest
-bio_pair
-dhe1024dsa
-v
||
exit
1
$
ssltest
-bio_pair
-dhe1024dsa
-v
||
exit
1
echo test
sslv2/sslv3 with server authentication
./ssltest
-bio_pair
-server_auth
-CApath
../certs
||
exit
1
$ssltest
-bio_pair
-server_auth
$CA
||
exit
1
echo test
sslv2/sslv3 with client authentication via BIO pair
./ssltest
-bio_pair
-client_auth
-CApath
../certs
||
exit
1
$ssltest
-bio_pair
-client_auth
$CA
||
exit
1
echo test
sslv2/sslv3 with both client and server authentication via BIO pair
./ssltest
-bio_pair
-server_auth
-client_auth
-CApath
../certs
||
exit
1
$ssltest
-bio_pair
-server_auth
-client_auth
$CA
||
exit
1
#############################################################################
if
../apps/openssl list-standard-commands |
grep
'^rsa$'
>
/dev/null
;
then
echo test
tls1 with 1024bit RSA, no DHE, multiple handshakes
./ssltest
-v
-bio_pair
-tls1
-cert
../apps/server2.pem
-no_dhe
-num
10
-f
-time
||
exit
1
echo test
tls1 with 1024bit RSA, no DHE, multiple handshakes
./ssltest
-v
-bio_pair
-tls1
-cert
../apps/server2.pem
-no_dhe
-num
10
-f
-time
||
exit
1
echo test
tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes
./ssltest
-v
-bio_pair
-tls1
-cert
../apps/server2.pem
-dhe1024dsa
-num
10
-f
-time
||
exit
1
fi
echo test
tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes
./ssltest
-v
-bio_pair
-tls1
-cert
../apps/server2.pem
-dhe1024dsa
-num
10
-f
-time
||
exit
1
exit
0
test/treq
浏览文件 @
65b002f3
...
...
@@ -11,6 +11,11 @@ else
t
=
testreq.pem
fi
if
$cmd
-in
$t
-inform
p
-noout
-text
| fgrep
'Unknown Public Key'
;
then
echo
"skipping req conversion test for
$t
"
exit
0
fi
echo
testing req conversions
cp
$t
fff.p
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录