Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
a0b76569
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看板
提交
a0b76569
编写于
3月 14, 2009
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update from stable branch.
上级
78625cac
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
14 deletion
+17
-14
crypto/x509v3/v3_addr.c
crypto/x509v3/v3_addr.c
+17
-14
未找到文件。
crypto/x509v3/v3_addr.c
浏览文件 @
a0b76569
...
...
@@ -61,7 +61,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "cryptlib.h"
#include <openssl/conf.h>
#include <openssl/asn1.h>
...
...
@@ -128,7 +128,7 @@ static int length_from_afi(const unsigned afi)
/*
* Extract the AFI from an IPAddressFamily.
*/
unsigned
v3_addr_get_afi
(
const
IPAddressFamily
*
f
)
unsigned
int
v3_addr_get_afi
(
const
IPAddressFamily
*
f
)
{
return
((
f
!=
NULL
&&
f
->
addressFamily
!=
NULL
&&
...
...
@@ -147,7 +147,7 @@ static void addr_expand(unsigned char *addr,
const
int
length
,
const
unsigned
char
fill
)
{
assert
(
bs
->
length
>=
0
&&
bs
->
length
<=
length
);
OPENSSL_
assert
(
bs
->
length
>=
0
&&
bs
->
length
<=
length
);
if
(
bs
->
length
>
0
)
{
memcpy
(
addr
,
bs
->
data
,
bs
->
length
);
if
((
bs
->
flags
&
7
)
!=
0
)
{
...
...
@@ -245,7 +245,7 @@ static int i2r_IPAddrBlocks(const X509V3_EXT_METHOD *method,
int
i
;
for
(
i
=
0
;
i
<
sk_IPAddressFamily_num
(
addr
);
i
++
)
{
IPAddressFamily
*
f
=
sk_IPAddressFamily_value
(
addr
,
i
);
const
unsigned
afi
=
v3_addr_get_afi
(
f
);
const
unsigned
int
afi
=
v3_addr_get_afi
(
f
);
switch
(
afi
)
{
case
IANA_AFI_IPV4
:
BIO_printf
(
out
,
"%*sIPv4"
,
indent
,
""
);
...
...
@@ -454,7 +454,7 @@ static int make_addressRange(IPAddressOrRange **result,
if
((
aor
=
IPAddressOrRange_new
())
==
NULL
)
return
0
;
aor
->
type
=
IPAddressOrRange_addressRange
;
assert
(
aor
->
u
.
addressRange
==
NULL
);
OPENSSL_
assert
(
aor
->
u
.
addressRange
==
NULL
);
if
((
aor
->
u
.
addressRange
=
IPAddressRange_new
())
==
NULL
)
goto
err
;
if
(
aor
->
u
.
addressRange
->
min
==
NULL
&&
...
...
@@ -523,7 +523,7 @@ static IPAddressFamily *make_IPAddressFamily(IPAddrBlocks *addr,
for
(
i
=
0
;
i
<
sk_IPAddressFamily_num
(
addr
);
i
++
)
{
f
=
sk_IPAddressFamily_value
(
addr
,
i
);
assert
(
f
->
addressFamily
->
data
!=
NULL
);
OPENSSL_
assert
(
f
->
addressFamily
->
data
!=
NULL
);
if
(
f
->
addressFamily
->
length
==
keylen
&&
!
memcmp
(
f
->
addressFamily
->
data
,
key
,
keylen
))
return
f
;
...
...
@@ -655,7 +655,7 @@ static void extract_min_max(IPAddressOrRange *aor,
unsigned
char
*
max
,
int
length
)
{
assert
(
aor
!=
NULL
&&
min
!=
NULL
&&
max
!=
NULL
);
OPENSSL_
assert
(
aor
!=
NULL
&&
min
!=
NULL
&&
max
!=
NULL
);
switch
(
aor
->
type
)
{
case
IPAddressOrRange_addressPrefix
:
addr_expand
(
min
,
aor
->
u
.
addressPrefix
,
length
,
0x00
);
...
...
@@ -881,7 +881,7 @@ int v3_addr_canonize(IPAddrBlocks *addr)
}
sk_IPAddressFamily_set_cmp_func
(
addr
,
IPAddressFamily_cmp
);
sk_IPAddressFamily_sort
(
addr
);
assert
(
v3_addr_is_canonical
(
addr
));
OPENSSL_
assert
(
v3_addr_is_canonical
(
addr
));
return
1
;
}
...
...
@@ -1128,7 +1128,10 @@ int v3_addr_subset(IPAddrBlocks *a, IPAddrBlocks *b)
for
(
i
=
0
;
i
<
sk_IPAddressFamily_num
(
a
);
i
++
)
{
IPAddressFamily
*
fa
=
sk_IPAddressFamily_value
(
a
,
i
);
int
j
=
sk_IPAddressFamily_find
(
b
,
fa
);
IPAddressFamily
*
fb
=
sk_IPAddressFamily_value
(
b
,
j
);
IPAddressFamily
*
fb
;
fb
=
sk_IPAddressFamily_value
(
b
,
j
);
if
(
fb
==
NULL
)
return
0
;
if
(
!
addr_contains
(
fb
->
ipAddressChoice
->
u
.
addressesOrRanges
,
fa
->
ipAddressChoice
->
u
.
addressesOrRanges
,
length_from_afi
(
v3_addr_get_afi
(
fb
))))
...
...
@@ -1165,9 +1168,9 @@ static int v3_addr_validate_path_internal(X509_STORE_CTX *ctx,
int
i
,
j
,
ret
=
1
;
X509
*
x
;
assert
(
chain
!=
NULL
&&
sk_X509_num
(
chain
)
>
0
);
assert
(
ctx
!=
NULL
||
ext
!=
NULL
);
assert
(
ctx
==
NULL
||
ctx
->
verify_cb
!=
NULL
);
OPENSSL_
assert
(
chain
!=
NULL
&&
sk_X509_num
(
chain
)
>
0
);
OPENSSL_
assert
(
ctx
!=
NULL
||
ext
!=
NULL
);
OPENSSL_
assert
(
ctx
==
NULL
||
ctx
->
verify_cb
!=
NULL
);
/*
* Figure out where to start. If we don't have an extension to
...
...
@@ -1180,7 +1183,7 @@ static int v3_addr_validate_path_internal(X509_STORE_CTX *ctx,
}
else
{
i
=
0
;
x
=
sk_X509_value
(
chain
,
i
);
assert
(
x
!=
NULL
);
OPENSSL_
assert
(
x
!=
NULL
);
if
((
ext
=
x
->
rfc3779_addr
)
==
NULL
)
goto
done
;
}
...
...
@@ -1199,7 +1202,7 @@ static int v3_addr_validate_path_internal(X509_STORE_CTX *ctx,
*/
for
(
i
++
;
i
<
sk_X509_num
(
chain
);
i
++
)
{
x
=
sk_X509_value
(
chain
,
i
);
assert
(
x
!=
NULL
);
OPENSSL_
assert
(
x
!=
NULL
);
if
(
!
v3_addr_is_canonical
(
x
->
rfc3779_addr
))
validation_err
(
X509_V_ERR_INVALID_EXTENSION
);
if
(
x
->
rfc3779_addr
==
NULL
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录