Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
924046ce
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看板
提交
924046ce
编写于
10月 12, 2000
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make non blocking I/O work for accept BIOs.
上级
9e2c0f41
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
40 addition
and
2 deletion
+40
-2
CHANGES
CHANGES
+7
-0
crypto/bio/b_sock.c
crypto/bio/b_sock.c
+1
-0
crypto/bio/bio.h
crypto/bio/bio.h
+3
-1
crypto/bio/bss_acpt.c
crypto/bio/bss_acpt.c
+12
-0
doc/crypto/BIO_s_accept.pod
doc/crypto/BIO_s_accept.pod
+8
-1
ssl/bio_ssl.c
ssl/bio_ssl.c
+4
-0
ssl/ssl.h
ssl/ssl.h
+1
-0
ssl/ssl_lib.c
ssl/ssl_lib.c
+4
-0
未找到文件。
CHANGES
浏览文件 @
924046ce
...
...
@@ -4,6 +4,13 @@
Changes between 0.9.6 and 0.9.7 [xx XXX 2000]
*) Fix for non blocking accept BIOs. Added new I/O special reason
BIO_RR_ACCEPT to cover this case. Previously use of accept BIOs
with non blocking I/O was not possible because no retry code was
implemented. Also added new SSL code SSL_WANT_ACCEPT to cover
this case.
[Steve Henson]
*) Fix for bug in DirectoryString mask setting. Add support for
X509_NAME_print_ex() in 'req' and X509_print_ex() function
to allow certificate printing to more controllable, additional
...
...
crypto/bio/b_sock.c
浏览文件 @
924046ce
...
...
@@ -661,6 +661,7 @@ int BIO_accept(int sock, char **addr)
ret
=
accept
(
sock
,(
struct
sockaddr
*
)
&
from
,(
void
*
)
&
len
);
if
(
ret
==
INVALID_SOCKET
)
{
if
(
BIO_sock_should_retry
(
ret
))
return
-
2
;
SYSerr
(
SYS_F_ACCEPT
,
get_last_socket_error
());
BIOerr
(
BIO_F_BIO_ACCEPT
,
BIO_R_ACCEPT_ERROR
);
goto
end
;
...
...
crypto/bio/bio.h
浏览文件 @
924046ce
...
...
@@ -179,7 +179,7 @@ extern "C" {
#define BIO_retry_type(a) ((a)->flags & BIO_FLAGS_RWS)
#define BIO_should_retry(a) ((a)->flags & BIO_FLAGS_SHOULD_RETRY)
/* The next t
wo
are used in conjunction with the
/* The next t
hree
are used in conjunction with the
* BIO_should_io_special() condition. After this returns true,
* BIO *BIO_get_retry_BIO(BIO *bio, int *reason); will walk the BIO
* stack and return the 'reason' for the special and the offending BIO.
...
...
@@ -188,6 +188,8 @@ extern "C" {
#define BIO_RR_SSL_X509_LOOKUP 0x01
/* Returned from the connect BIO when a connect would have blocked */
#define BIO_RR_CONNECT 0x02
/* Returned from the accept BIO when an accept would have blocked */
#define BIO_RR_ACCEPT 0x03
/* These are passed by the BIO callback */
#define BIO_CB_FREE 0x01
...
...
crypto/bio/bss_acpt.c
浏览文件 @
924046ce
...
...
@@ -236,8 +236,20 @@ again:
c
->
state
=
ACPT_S_OK
;
goto
again
;
}
BIO_clear_retry_flags
(
b
);
b
->
retry_reason
=
0
;
i
=
BIO_accept
(
c
->
accept_sock
,
&
(
c
->
addr
));
/* -2 return means we should retry */
if
(
i
==
-
2
)
{
BIO_set_retry_special
(
b
);
b
->
retry_reason
=
BIO_RR_ACCEPT
;
return
-
1
;
}
if
(
i
<
0
)
return
(
i
);
bio
=
BIO_new_socket
(
i
,
BIO_CLOSE
);
if
(
bio
==
NULL
)
goto
err
;
...
...
doc/crypto/BIO_s_accept.pod
浏览文件 @
924046ce
...
...
@@ -92,7 +92,7 @@ BIO_do_accept() serves two functions. When it is first
called, after the accept BIO has been setup, it will attempt
to create the accept socket and bind an address to it. Second
and subsequent calls to BIO_do_accept() will await an incoming
connection.
connection
, or request a retry in non blocking mode
.
=head1 NOTES
...
...
@@ -130,6 +130,13 @@ however because the accept BIO will still accept additional incoming
connections. This can be resolved by using BIO_pop() (see above)
and freeing up the accept BIO after the initial connection.
If the underlying accept socket is non blocking and BIO_do_accept() is
called to await an incoming connection it is possible for
BIO_should_io_special() with the reason BIO_RR_ACCEPT. If this happens
then it is an indication that an accept attempt would block: the application
should take appropriate action to wait until the underlying socket has
accepted a connection and retry the call.
=head1 RETURN VALUES
TBA
...
...
ssl/bio_ssl.c
浏览文件 @
924046ce
...
...
@@ -206,6 +206,10 @@ static int ssl_read(BIO *b, char *out, int outl)
BIO_set_retry_special
(
b
);
retry_reason
=
BIO_RR_SSL_X509_LOOKUP
;
break
;
case
SSL_ERROR_WANT_ACCEPT
:
BIO_set_retry_special
(
b
);
retry_reason
=
BIO_RR_ACCEPT
;
break
;
case
SSL_ERROR_WANT_CONNECT
:
BIO_set_retry_special
(
b
);
retry_reason
=
BIO_RR_CONNECT
;
...
...
ssl/ssl.h
浏览文件 @
924046ce
...
...
@@ -831,6 +831,7 @@ size_t SSL_get_peer_finished(SSL *s, void *buf, size_t count);
#define SSL_ERROR_SYSCALL 5
/* look at error stack/return value/errno */
#define SSL_ERROR_ZERO_RETURN 6
#define SSL_ERROR_WANT_CONNECT 7
#define SSL_ERROR_WANT_ACCEPT 8
#define SSL_CTRL_NEED_TMP_RSA 1
#define SSL_CTRL_SET_TMP_RSA 2
...
...
ssl/ssl_lib.c
浏览文件 @
924046ce
...
...
@@ -1543,6 +1543,8 @@ int SSL_get_error(SSL *s,int i)
reason
=
BIO_get_retry_reason
(
bio
);
if
(
reason
==
BIO_RR_CONNECT
)
return
(
SSL_ERROR_WANT_CONNECT
);
else
if
(
reason
==
BIO_RR_ACCEPT
)
return
(
SSL_ERROR_WANT_ACCEPT
);
else
return
(
SSL_ERROR_SYSCALL
);
/* unknown */
}
...
...
@@ -1561,6 +1563,8 @@ int SSL_get_error(SSL *s,int i)
reason
=
BIO_get_retry_reason
(
bio
);
if
(
reason
==
BIO_RR_CONNECT
)
return
(
SSL_ERROR_WANT_CONNECT
);
else
if
(
reason
==
BIO_RR_ACCEPT
)
return
(
SSL_ERROR_WANT_ACCEPT
);
else
return
(
SSL_ERROR_SYSCALL
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录