Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
8b8d963d
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
1 年多 前同步成功
通知
9
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看板
提交
8b8d963d
编写于
8月 19, 2016
作者:
R
Rich Salz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add BIO_get_new_index()
Reviewed-by:
N
Dr. Stephen Henson
<
steve@openssl.org
>
上级
9e313563
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
55 addition
and
30 deletion
+55
-30
crypto/bio/b_addr.c
crypto/bio/b_addr.c
+3
-1
crypto/bio/bio_lcl.h
crypto/bio/bio_lcl.h
+1
-0
crypto/bio/bio_lib.c
crypto/bio/bio_lib.c
+2
-0
crypto/bio/bio_meth.c
crypto/bio/bio_meth.c
+12
-0
doc/crypto/BIO_meth_new.pod
doc/crypto/BIO_meth_new.pod
+6
-1
include/openssl/bio.h
include/openssl/bio.h
+30
-28
util/libcrypto.num
util/libcrypto.num
+1
-0
未找到文件。
crypto/bio/b_addr.c
浏览文件 @
8b8d963d
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
#include <ctype.h>
#include <ctype.h>
CRYPTO_RWLOCK
*
bio_lookup_lock
;
CRYPTO_RWLOCK
*
bio_lookup_lock
;
extern
CRYPTO_RWLOCK
*
bio_type_lock
;
static
CRYPTO_ONCE
bio_lookup_init
=
CRYPTO_ONCE_STATIC_INIT
;
static
CRYPTO_ONCE
bio_lookup_init
=
CRYPTO_ONCE_STATIC_INIT
;
/*
/*
...
@@ -605,7 +606,8 @@ static int addrinfo_wrap(int family, int socktype,
...
@@ -605,7 +606,8 @@ static int addrinfo_wrap(int family, int socktype,
DEFINE_RUN_ONCE_STATIC
(
do_bio_lookup_init
)
DEFINE_RUN_ONCE_STATIC
(
do_bio_lookup_init
)
{
{
bio_lookup_lock
=
CRYPTO_THREAD_lock_new
();
bio_lookup_lock
=
CRYPTO_THREAD_lock_new
();
return
(
bio_lookup_lock
!=
NULL
);
bio_type_lock
=
CRYPTO_THREAD_lock_new
();
return
bio_lookup_lock
!=
NULL
&&
bio_type_lock
!=
NULL
;
}
}
/*-
/*-
...
...
crypto/bio/bio_lcl.h
浏览文件 @
8b8d963d
...
@@ -137,6 +137,7 @@ typedef unsigned int socklen_t;
...
@@ -137,6 +137,7 @@ typedef unsigned int socklen_t;
# endif
# endif
extern
CRYPTO_RWLOCK
*
bio_lookup_lock
;
extern
CRYPTO_RWLOCK
*
bio_lookup_lock
;
extern
CRYPTO_RWLOCK
*
bio_type_lock
;
int
BIO_ADDR_make
(
BIO_ADDR
*
ap
,
const
struct
sockaddr
*
sa
);
int
BIO_ADDR_make
(
BIO_ADDR
*
ap
,
const
struct
sockaddr
*
sa
);
const
struct
sockaddr
*
BIO_ADDR_sockaddr
(
const
BIO_ADDR
*
ap
);
const
struct
sockaddr
*
BIO_ADDR_sockaddr
(
const
BIO_ADDR
*
ap
);
...
...
crypto/bio/bio_lib.c
浏览文件 @
8b8d963d
...
@@ -594,5 +594,7 @@ void bio_cleanup(void)
...
@@ -594,5 +594,7 @@ void bio_cleanup(void)
bio_sock_cleanup_int
();
bio_sock_cleanup_int
();
CRYPTO_THREAD_lock_free
(
bio_lookup_lock
);
CRYPTO_THREAD_lock_free
(
bio_lookup_lock
);
bio_lookup_lock
=
NULL
;
bio_lookup_lock
=
NULL
;
CRYPTO_THREAD_lock_free
(
bio_type_lock
);
bio_type_lock
=
NULL
;
#endif
#endif
}
}
crypto/bio/bio_meth.c
浏览文件 @
8b8d963d
...
@@ -9,6 +9,18 @@
...
@@ -9,6 +9,18 @@
#include "bio_lcl.h"
#include "bio_lcl.h"
CRYPTO_RWLOCK
*
bio_type_lock
;
static
int
bio_count
=
BIO_TYPE_START
;
int
BIO_get_new_index
()
{
int
newval
;
if
(
!
CRYPTO_atomic_add
(
&
bio_count
,
1
,
&
newval
,
bio_type_lock
))
return
-
1
;
return
newval
;
}
BIO_METHOD
*
BIO_meth_new
(
int
type
,
const
char
*
name
)
BIO_METHOD
*
BIO_meth_new
(
int
type
,
const
char
*
name
)
{
{
BIO_METHOD
*
biom
=
OPENSSL_zalloc
(
sizeof
(
BIO_METHOD
));
BIO_METHOD
*
biom
=
OPENSSL_zalloc
(
sizeof
(
BIO_METHOD
));
...
...
doc/crypto/BIO_meth_new.pod
浏览文件 @
8b8d963d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
=head1 NAME
=head1 NAME
BIO_get_new_index,
BIO_meth_new, BIO_meth_free, BIO_meth_get_write, BIO_meth_set_write,
BIO_meth_new, BIO_meth_free, BIO_meth_get_write, BIO_meth_set_write,
BIO_meth_get_read, BIO_meth_set_read, BIO_meth_get_puts, BIO_meth_set_puts,
BIO_meth_get_read, BIO_meth_set_read, BIO_meth_get_puts, BIO_meth_set_puts,
BIO_meth_get_gets, BIO_meth_set_gets, BIO_meth_get_ctrl, BIO_meth_set_ctrl,
BIO_meth_get_gets, BIO_meth_set_gets, BIO_meth_get_ctrl, BIO_meth_set_ctrl,
...
@@ -13,6 +14,7 @@ BIO_meth_set_callback_ctrl - Routines to build up BIO methods
...
@@ -13,6 +14,7 @@ BIO_meth_set_callback_ctrl - Routines to build up BIO methods
#include <openssl/bio.h>
#include <openssl/bio.h>
int BIO_get_new_index(void);
BIO_METHOD *BIO_meth_new(int type, const char *name);
BIO_METHOD *BIO_meth_new(int type, const char *name);
void BIO_meth_free(BIO_METHOD *biom);
void BIO_meth_free(BIO_METHOD *biom);
int (*BIO_meth_get_write(BIO_METHOD *biom)) (BIO *, const char *, int);
int (*BIO_meth_get_write(BIO_METHOD *biom)) (BIO *, const char *, int);
...
@@ -47,7 +49,10 @@ types. It provides a set of of functions used by OpenSSL for the implementation
...
@@ -47,7 +49,10 @@ types. It provides a set of of functions used by OpenSSL for the implementation
of the various BIO capabilities. See the L<bio> page for more information.
of the various BIO capabilities. See the L<bio> page for more information.
BIO_meth_new() creates a new B<BIO_METHOD> structure. It should be given a
BIO_meth_new() creates a new B<BIO_METHOD> structure. It should be given a
unique integer B<type> and a string that represents its B<name>. The set of
unique integer B<type> and a string that represents its B<name>.
Use BIO_get_new_index() to get the value for B<type>.
The set of
standard OpenSSL provided BIO types is provided in B<bio.h>. Some examples
standard OpenSSL provided BIO types is provided in B<bio.h>. Some examples
include B<BIO_TYPE_BUFFER> and B<BIO_TYPE_CIPHER>. Filter BIOs should have a
include B<BIO_TYPE_BUFFER> and B<BIO_TYPE_CIPHER>. Filter BIOs should have a
type which have the "filter" bit set (B<BIO_TYPE_FILTER>). Source/sink BIOs
type which have the "filter" bit set (B<BIO_TYPE_FILTER>). Source/sink BIOs
...
...
include/openssl/bio.h
浏览文件 @
8b8d963d
...
@@ -31,38 +31,39 @@
...
@@ -31,38 +31,39 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
/* There are the classes of BIOs */
# define BIO_TYPE_DESCRIPTOR 0x0100
/* socket, fd, connect or accept */
# define BIO_TYPE_FILTER 0x0200
# define BIO_TYPE_SOURCE_SINK 0x0400
/* These are the 'types' of BIOs */
/* These are the 'types' of BIOs */
# define BIO_TYPE_NONE 0
# define BIO_TYPE_NONE
0
# define BIO_TYPE_MEM (
1|0x0400
)
# define BIO_TYPE_MEM (
1|BIO_TYPE_SOURCE_SINK
)
# define BIO_TYPE_FILE (
2|0x0400
)
# define BIO_TYPE_FILE (
2|BIO_TYPE_SOURCE_SINK
)
# define BIO_TYPE_FD (
4|0x0400|0x0100
)
# define BIO_TYPE_FD (
4|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR
)
# define BIO_TYPE_SOCKET (
5|0x0400|0x0100
)
# define BIO_TYPE_SOCKET (
5|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR
)
# define BIO_TYPE_NULL (
6|0x0400
)
# define BIO_TYPE_NULL (
6|BIO_TYPE_SOURCE_SINK
)
# define BIO_TYPE_SSL (
7|0x0200
)
# define BIO_TYPE_SSL (
7|BIO_TYPE_FILTER
)
# define BIO_TYPE_MD (
8|0x0200)
/* passive filter */
# define BIO_TYPE_MD (
8|BIO_TYPE_FILTER)
# define BIO_TYPE_BUFFER (
9|0x0200)
/* filter */
# define BIO_TYPE_BUFFER (
9|BIO_TYPE_FILTER)
# define BIO_TYPE_CIPHER (10|
0x0200)
/* filter */
# define BIO_TYPE_CIPHER (10|
BIO_TYPE_FILTER)
# define BIO_TYPE_BASE64 (11|
0x0200)
/* filter */
# define BIO_TYPE_BASE64 (11|
BIO_TYPE_FILTER)
# define BIO_TYPE_CONNECT (12|
0x0400|0x0100)
/* socket - connect */
# define BIO_TYPE_CONNECT (12|
BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR)
# define BIO_TYPE_ACCEPT (13|
0x0400|0x0100)
/* socket for accept */
# define BIO_TYPE_ACCEPT (13|
BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR)
/* # define BIO_TYPE_PROXY_CLIENT (14|0x0200)*/
/* client proxy BIO */
/* # define BIO_TYPE_PROXY_SERVER (15|0x0200)*/
/* server proxy BIO */
# define BIO_TYPE_NBIO_TEST (16|BIO_TYPE_FILTER)
/* server proxy BIO */
# define BIO_TYPE_N
BIO_TEST (16|0x0200)
/* server proxy BIO */
# define BIO_TYPE_N
ULL_FILTER (17|BIO_TYPE_FILTER)
# define BIO_TYPE_
NULL_FILTER (17|0x0200)
# define BIO_TYPE_
BIO (19|BIO_TYPE_SOURCE_SINK)
/* half a BIO pair */
# define BIO_TYPE_
BER (18|0x0200)
/* BER -> bin filter */
# define BIO_TYPE_
LINEBUFFER (20|BIO_TYPE_FILTER)
# define BIO_TYPE_
BIO (19|0x0400)
/* (half a) BIO pair */
# define BIO_TYPE_
DGRAM (21|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR)
# define BIO_TYPE_
LINEBUFFER (20|0x0200)
/* filter */
# define BIO_TYPE_
ASN1 (22|BIO_TYPE_FILTER)
# define BIO_TYPE_
DGRAM (21|0x0400|0x0100
)
# define BIO_TYPE_
COMP (23|BIO_TYPE_FILTER
)
# ifndef OPENSSL_NO_SCTP
# ifndef OPENSSL_NO_SCTP
# define BIO_TYPE_DGRAM_SCTP
(24|0x0400|0x0100
)
# define BIO_TYPE_DGRAM_SCTP
(24|BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR
)
# endif
# endif
# define BIO_TYPE_ASN1 (22|0x0200)
/* filter */
# define BIO_TYPE_COMP (23|0x0200)
/* filter */
# define BIO_TYPE_DESCRIPTOR 0x0100
/* socket, fd, connect or accept */
#define BIO_TYPE_START 128
# define BIO_TYPE_FILTER 0x0200
# define BIO_TYPE_SOURCE_SINK 0x0400
/*
/*
* BIO_FILENAME_READ|BIO_CLOSE to open or close on free.
* BIO_FILENAME_READ|BIO_CLOSE to open or close on free.
...
@@ -177,6 +178,7 @@ extern "C" {
...
@@ -177,6 +178,7 @@ extern "C" {
typedef
union
bio_addr_st
BIO_ADDR
;
typedef
union
bio_addr_st
BIO_ADDR
;
typedef
struct
bio_addrinfo_st
BIO_ADDRINFO
;
typedef
struct
bio_addrinfo_st
BIO_ADDRINFO
;
int
BIO_get_new_index
(
void
);
void
BIO_set_flags
(
BIO
*
b
,
int
flags
);
void
BIO_set_flags
(
BIO
*
b
,
int
flags
);
int
BIO_test_flags
(
const
BIO
*
b
,
int
flags
);
int
BIO_test_flags
(
const
BIO
*
b
,
int
flags
);
void
BIO_clear_flags
(
BIO
*
b
,
int
flags
);
void
BIO_clear_flags
(
BIO
*
b
,
int
flags
);
...
...
util/libcrypto.num
浏览文件 @
8b8d963d
...
@@ -4198,3 +4198,4 @@ X509_CRL_get0_lastUpdate 4144 1_1_0 EXIST::FUNCTION:
...
@@ -4198,3 +4198,4 @@ X509_CRL_get0_lastUpdate 4144 1_1_0 EXIST::FUNCTION:
X509_get0_notBefore 4145 1_1_0 EXIST::FUNCTION:
X509_get0_notBefore 4145 1_1_0 EXIST::FUNCTION:
X509_get0_notAfter 4146 1_1_0 EXIST::FUNCTION:
X509_get0_notAfter 4146 1_1_0 EXIST::FUNCTION:
X509_CRL_get0_nextUpdate 4147 1_1_0 EXIST::FUNCTION:
X509_CRL_get0_nextUpdate 4147 1_1_0 EXIST::FUNCTION:
BIO_get_new_index 4148 1_1_0 EXIST::FUNCTION:
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录