Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
openssl
提交
021e5043
O
openssl
项目概览
btwise
/
openssl
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
021e5043
编写于
7月 08, 2014
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Please Clang's sanitizer.
PR: #3424,#3423,#3422
上级
c4f8efab
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
47 addition
and
39 deletion
+47
-39
crypto/cast/cast_lcl.h
crypto/cast/cast_lcl.h
+2
-0
crypto/md32_common.h
crypto/md32_common.h
+10
-10
crypto/modes/cbc128.c
crypto/modes/cbc128.c
+1
-1
crypto/modes/modes_lcl.h
crypto/modes/modes_lcl.h
+2
-0
crypto/rc4/rc4_enc.c
crypto/rc4/rc4_enc.c
+1
-1
engines/ccgost/gost89.c
engines/ccgost/gost89.c
+8
-8
engines/ccgost/gost_crypt.c
engines/ccgost/gost_crypt.c
+2
-2
ssl/heartbeat_test.c
ssl/heartbeat_test.c
+21
-17
未找到文件。
crypto/cast/cast_lcl.h
浏览文件 @
021e5043
...
...
@@ -154,6 +154,8 @@
#if defined(OPENSSL_SYS_WIN32) && defined(_MSC_VER)
#define ROTL(a,n) (_lrotl(a,n))
#elif defined(PEDANTIC)
#define ROTL(a,n) ((((a)<<(n))&0xffffffffL)|((a)>>((32-(n))&31)))
#else
#define ROTL(a,n) ((((a)<<(n))&0xffffffffL)|((a)>>(32-(n))))
#endif
...
...
crypto/md32_common.h
浏览文件 @
021e5043
...
...
@@ -235,10 +235,10 @@
# endif
# endif
# endif
#
endif
#
if defined(__s390__) || defined(__s390x__
)
#
define HOST_c2l(c,l) ((l)=*((const unsigned int *)(c)
), (c)+=4, (l))
#
define HOST_l2c(l,c) (*((unsigned int *)(c))=(l), (c)+=4, (l))
#
if defined(__s390__) || defined(__s390x__)
#
define HOST_c2l(c,l) ((l)=*((const unsigned int *)(c)), (c)+=4, (l)
)
#
define HOST_l2c(l,c) (*((unsigned int *)(c))=(l
), (c)+=4, (l))
#
endif
#endif
#ifndef HOST_c2l
...
...
@@ -269,12 +269,12 @@
(c)+=4; (l); })
# endif
# endif
#
endif
#
if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
# ifndef B_ENDIAN
/* See comment in DATA_ORDER_IS_BIG_ENDIAN section. */
#
define HOST_c2l(c,l) ((l)=*((const unsigned int *)(c)
), (c)+=4, l)
#
define HOST_l2c(l,c) (*((unsigned int *)(c))=(l), (c)+=4, l)
#
if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
#
ifndef B_ENDIAN
/* See comment in DATA_ORDER_IS_BIG_ENDIAN section. */
# define HOST_c2l(c,l) ((l)=*((const unsigned int *)(c)), (c)+=4, l)
#
define HOST_l2c(l,c) (*((unsigned int *)(c))=(l
), (c)+=4, l)
#
endif
# endif
#endif
...
...
crypto/modes/cbc128.c
浏览文件 @
021e5043
...
...
@@ -59,7 +59,7 @@
#endif
#include <assert.h>
#if
ndef STRICT_ALIGNMENT
#if
!defined(STRICT_ALIGNMENT) && !defined(PEDANTIC)
# define STRICT_ALIGNMENT 0
#endif
...
...
crypto/modes/modes_lcl.h
浏览文件 @
021e5043
...
...
@@ -26,6 +26,7 @@ typedef unsigned int u32;
typedef
unsigned
char
u8
;
#define STRICT_ALIGNMENT 1
#ifndef PEDANTIC
#if defined(__i386) || defined(__i386__) || \
defined(__x86_64) || defined(__x86_64__) || \
defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || \
...
...
@@ -33,6 +34,7 @@ typedef unsigned char u8;
defined(__s390__) || defined(__s390x__)
# undef STRICT_ALIGNMENT
#endif
#endif
#if !defined(PEDANTIC) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
#if defined(__GNUC__) && __GNUC__>=2
...
...
crypto/rc4/rc4_enc.c
浏览文件 @
021e5043
...
...
@@ -78,7 +78,7 @@ void RC4(RC4_KEY *key, size_t len, const unsigned char *indata,
y
=
key
->
y
;
d
=
key
->
data
;
#if defined(RC4_CHUNK)
#if defined(RC4_CHUNK)
&& !defined(PEDANTIC)
/*
* The original reason for implementing this(*) was the fact that
* pre-21164a Alpha CPUs don't have byte load/store instructions
...
...
engines/ccgost/gost89.c
浏览文件 @
021e5043
...
...
@@ -120,7 +120,7 @@ static void kboxinit(gost_ctx *c, const gost_subst_block *b)
for
(
i
=
0
;
i
<
256
;
i
++
)
{
c
->
k87
[
i
]
=
(
b
->
k8
[
i
>>
4
]
<<
4
|
b
->
k7
[
i
&
15
])
<<
24
;
c
->
k87
[
i
]
=
(
word32
)(
b
->
k8
[
i
>>
4
]
<<
4
|
b
->
k7
[
i
&
15
])
<<
24
;
c
->
k65
[
i
]
=
(
b
->
k6
[
i
>>
4
]
<<
4
|
b
->
k5
[
i
&
15
])
<<
16
;
c
->
k43
[
i
]
=
(
b
->
k4
[
i
>>
4
]
<<
4
|
b
->
k3
[
i
&
15
])
<<
8
;
c
->
k21
[
i
]
=
b
->
k2
[
i
>>
4
]
<<
4
|
b
->
k1
[
i
&
15
];
...
...
@@ -140,8 +140,8 @@ static word32 f(gost_ctx *c,word32 x)
void
gostcrypt
(
gost_ctx
*
c
,
const
byte
*
in
,
byte
*
out
)
{
register
word32
n1
,
n2
;
/* As named in the GOST */
n1
=
in
[
0
]
|
(
in
[
1
]
<<
8
)
|
(
in
[
2
]
<<
16
)
|
(
in
[
3
]
<<
24
);
n2
=
in
[
4
]
|
(
in
[
5
]
<<
8
)
|
(
in
[
6
]
<<
16
)
|
(
in
[
7
]
<<
24
);
n1
=
in
[
0
]
|
(
in
[
1
]
<<
8
)
|
(
in
[
2
]
<<
16
)
|
(
(
word32
)
in
[
3
]
<<
24
);
n2
=
in
[
4
]
|
(
in
[
5
]
<<
8
)
|
(
in
[
6
]
<<
16
)
|
(
(
word32
)
in
[
7
]
<<
24
);
/* Instead of swapping halves, swap names each round */
n2
^=
f
(
c
,
n1
+
c
->
k
[
0
]);
n1
^=
f
(
c
,
n2
+
c
->
k
[
1
]);
...
...
@@ -173,8 +173,8 @@ void gostcrypt(gost_ctx *c, const byte *in, byte *out)
void
gostdecrypt
(
gost_ctx
*
c
,
const
byte
*
in
,
byte
*
out
)
{
register
word32
n1
,
n2
;
/* As named in the GOST */
n1
=
in
[
0
]
|
(
in
[
1
]
<<
8
)
|
(
in
[
2
]
<<
16
)
|
(
in
[
3
]
<<
24
);
n2
=
in
[
4
]
|
(
in
[
5
]
<<
8
)
|
(
in
[
6
]
<<
16
)
|
(
in
[
7
]
<<
24
);
n1
=
in
[
0
]
|
(
in
[
1
]
<<
8
)
|
(
in
[
2
]
<<
16
)
|
(
(
word32
)
in
[
3
]
<<
24
);
n2
=
in
[
4
]
|
(
in
[
5
]
<<
8
)
|
(
in
[
6
]
<<
16
)
|
(
(
word32
)
in
[
7
]
<<
24
);
n2
^=
f
(
c
,
n1
+
c
->
k
[
0
]);
n1
^=
f
(
c
,
n2
+
c
->
k
[
1
]);
n2
^=
f
(
c
,
n1
+
c
->
k
[
2
]);
n1
^=
f
(
c
,
n2
+
c
->
k
[
3
]);
...
...
@@ -275,7 +275,7 @@ void gost_key(gost_ctx *c, const byte *k)
int
i
,
j
;
for
(
i
=
0
,
j
=
0
;
i
<
8
;
i
++
,
j
+=
4
)
{
c
->
k
[
i
]
=
k
[
j
]
|
(
k
[
j
+
1
]
<<
8
)
|
(
k
[
j
+
2
]
<<
16
)
|
(
k
[
j
+
3
]
<<
24
);
c
->
k
[
i
]
=
k
[
j
]
|
(
k
[
j
+
1
]
<<
8
)
|
(
k
[
j
+
2
]
<<
16
)
|
(
(
word32
)
k
[
j
+
3
]
<<
24
);
}
}
...
...
@@ -323,8 +323,8 @@ void mac_block(gost_ctx *c,byte *buffer,const byte *block)
{
buffer
[
i
]
^=
block
[
i
];
}
n1
=
buffer
[
0
]
|
(
buffer
[
1
]
<<
8
)
|
(
buffer
[
2
]
<<
16
)
|
(
buffer
[
3
]
<<
24
);
n2
=
buffer
[
4
]
|
(
buffer
[
5
]
<<
8
)
|
(
buffer
[
6
]
<<
16
)
|
(
buffer
[
7
]
<<
24
);
n1
=
buffer
[
0
]
|
(
buffer
[
1
]
<<
8
)
|
(
buffer
[
2
]
<<
16
)
|
(
(
word32
)
buffer
[
3
]
<<
24
);
n2
=
buffer
[
4
]
|
(
buffer
[
5
]
<<
8
)
|
(
buffer
[
6
]
<<
16
)
|
(
(
word32
)
buffer
[
7
]
<<
24
);
/* Instead of swapping halves, swap names each round */
n2
^=
f
(
c
,
n1
+
c
->
k
[
0
]);
n1
^=
f
(
c
,
n2
+
c
->
k
[
1
]);
...
...
engines/ccgost/gost_crypt.c
浏览文件 @
021e5043
...
...
@@ -241,13 +241,13 @@ static void gost_cnt_next (void *ctx, unsigned char *iv, unsigned char *buf)
{
memcpy
(
buf1
,
iv
,
8
);
}
g
=
buf1
[
0
]
|
(
buf1
[
1
]
<<
8
)
|
(
buf1
[
2
]
<<
16
)
|
(
buf1
[
3
]
<<
24
);
g
=
buf1
[
0
]
|
(
buf1
[
1
]
<<
8
)
|
(
buf1
[
2
]
<<
16
)
|
(
(
word32
)
buf1
[
3
]
<<
24
);
g
+=
0x01010101
;
buf1
[
0
]
=
(
unsigned
char
)(
g
&
0xff
);
buf1
[
1
]
=
(
unsigned
char
)((
g
>>
8
)
&
0xff
);
buf1
[
2
]
=
(
unsigned
char
)((
g
>>
16
)
&
0xff
);
buf1
[
3
]
=
(
unsigned
char
)((
g
>>
24
)
&
0xff
);
g
=
buf1
[
4
]
|
(
buf1
[
5
]
<<
8
)
|
(
buf1
[
6
]
<<
16
)
|
(
buf1
[
7
]
<<
24
);
g
=
buf1
[
4
]
|
(
buf1
[
5
]
<<
8
)
|
(
buf1
[
6
]
<<
16
)
|
(
(
word32
)
buf1
[
7
]
<<
24
);
go
=
g
;
g
+=
0x01010104
;
if
(
go
>
g
)
/* overflow*/
...
...
ssl/heartbeat_test.c
浏览文件 @
021e5043
...
...
@@ -273,7 +273,8 @@ static int test_dtls1_not_bleeding()
{
SETUP_HEARTBEAT_TEST_FIXTURE
(
dtls
);
/* Three-byte pad at the beginning for type and payload length */
unsigned
char
payload_buf
[]
=
" Not bleeding, sixteen spaces of padding"
unsigned
char
payload_buf
[
MAX_PRINTABLE_CHARACTERS
+
4
]
=
" Not bleeding, sixteen spaces of padding"
" "
;
const
int
payload_buf_len
=
honest_payload_size
(
payload_buf
);
...
...
@@ -292,9 +293,9 @@ static int test_dtls1_not_bleeding_empty_payload()
SETUP_HEARTBEAT_TEST_FIXTURE
(
dtls
);
/* Three-byte pad at the beginning for type and payload length, plus a NUL
* at the end */
unsigned
char
payload_buf
[
4
+
M
IN_PADDING_SIZE
];
memset
(
payload_buf
,
' '
,
sizeof
(
payload_buf
)
);
payload_buf
[
sizeof
(
payload_buf
)
-
1
]
=
'\0'
;
unsigned
char
payload_buf
[
4
+
M
AX_PRINTABLE_CHARACTERS
];
memset
(
payload_buf
,
' '
,
MIN_PADDING_SIZE
+
3
);
payload_buf
[
MIN_PADDING_SIZE
+
3
]
=
'\0'
;
payload_buf_len
=
honest_payload_size
(
payload_buf
);
fixture
.
payload
=
&
payload_buf
[
0
];
...
...
@@ -309,7 +310,8 @@ static int test_dtls1_heartbleed()
{
SETUP_HEARTBEAT_TEST_FIXTURE
(
dtls
);
/* Three-byte pad at the beginning for type and payload length */
unsigned
char
payload_buf
[]
=
" HEARTBLEED "
;
unsigned
char
payload_buf
[
4
+
MAX_PRINTABLE_CHARACTERS
]
=
" HEARTBLEED "
;
fixture
.
payload
=
&
payload_buf
[
0
];
fixture
.
sent_payload_len
=
MAX_PRINTABLE_CHARACTERS
;
...
...
@@ -324,9 +326,9 @@ static int test_dtls1_heartbleed_empty_payload()
SETUP_HEARTBEAT_TEST_FIXTURE
(
dtls
);
/* Excluding the NUL at the end, one byte short of type + payload length +
* minimum padding */
unsigned
char
payload_buf
[
M
IN_PADDING_SIZE
+
3
];
memset
(
payload_buf
,
' '
,
sizeof
(
payload_buf
)
);
payload_buf
[
sizeof
(
payload_buf
)
-
1
]
=
'\0'
;
unsigned
char
payload_buf
[
M
AX_PRINTABLE_CHARACTERS
+
4
];
memset
(
payload_buf
,
' '
,
MIN_PADDING_SIZE
+
2
);
payload_buf
[
MIN_PADDING_SIZE
+
2
]
=
'\0'
;
fixture
.
payload
=
&
payload_buf
[
0
];
fixture
.
sent_payload_len
=
MAX_PRINTABLE_CHARACTERS
;
...
...
@@ -357,8 +359,9 @@ static int test_tls1_not_bleeding()
{
SETUP_HEARTBEAT_TEST_FIXTURE
(
tls
);
/* Three-byte pad at the beginning for type and payload length */
unsigned
char
payload_buf
[]
=
" Not bleeding, sixteen spaces of padding"
" "
;
unsigned
char
payload_buf
[
MAX_PRINTABLE_CHARACTERS
+
4
]
=
" Not bleeding, sixteen spaces of padding"
" "
;
const
int
payload_buf_len
=
honest_payload_size
(
payload_buf
);
fixture
.
payload
=
&
payload_buf
[
0
];
...
...
@@ -376,9 +379,9 @@ static int test_tls1_not_bleeding_empty_payload()
SETUP_HEARTBEAT_TEST_FIXTURE
(
tls
);
/* Three-byte pad at the beginning for type and payload length, plus a NUL
* at the end */
unsigned
char
payload_buf
[
4
+
M
IN_PADDING_SIZE
];
memset
(
payload_buf
,
' '
,
sizeof
(
payload_buf
)
);
payload_buf
[
sizeof
(
payload_buf
)
-
1
]
=
'\0'
;
unsigned
char
payload_buf
[
4
+
M
AX_PRINTABLE_CHARACTERS
];
memset
(
payload_buf
,
' '
,
MIN_PADDING_SIZE
+
3
);
payload_buf
[
MIN_PADDING_SIZE
+
3
]
=
'\0'
;
payload_buf_len
=
honest_payload_size
(
payload_buf
);
fixture
.
payload
=
&
payload_buf
[
0
];
...
...
@@ -393,7 +396,8 @@ static int test_tls1_heartbleed()
{
SETUP_HEARTBEAT_TEST_FIXTURE
(
tls
);
/* Three-byte pad at the beginning for type and payload length */
unsigned
char
payload_buf
[]
=
" HEARTBLEED "
;
unsigned
char
payload_buf
[
MAX_PRINTABLE_CHARACTERS
+
4
]
=
" HEARTBLEED "
;
fixture
.
payload
=
&
payload_buf
[
0
];
fixture
.
sent_payload_len
=
MAX_PRINTABLE_CHARACTERS
;
...
...
@@ -408,9 +412,9 @@ static int test_tls1_heartbleed_empty_payload()
SETUP_HEARTBEAT_TEST_FIXTURE
(
tls
);
/* Excluding the NUL at the end, one byte short of type + payload length +
* minimum padding */
unsigned
char
payload_buf
[
M
IN_PADDING_SIZE
+
3
];
memset
(
payload_buf
,
' '
,
sizeof
(
payload_buf
)
);
payload_buf
[
sizeof
(
payload_buf
)
-
1
]
=
'\0'
;
unsigned
char
payload_buf
[
M
AX_PRINTABLE_CHARACTERS
+
4
];
memset
(
payload_buf
,
' '
,
MIN_PADDING_SIZE
+
2
);
payload_buf
[
MIN_PADDING_SIZE
+
2
]
=
'\0'
;
fixture
.
payload
=
&
payload_buf
[
0
];
fixture
.
sent_payload_len
=
MAX_PRINTABLE_CHARACTERS
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录