Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
openssl
提交
757e392d
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,发现更多精彩内容 >>
提交
757e392d
编写于
11月 12, 2000
作者:
B
Ben Laurie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make Rijndael work! Those long flights have some good points.
上级
2f9f0c72
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
10 addition
and
8 deletion
+10
-8
apps/enc.c
apps/enc.c
+3
-3
crypto/bn/bn_mont.c
crypto/bn/bn_mont.c
+1
-1
crypto/evp/bio_enc.c
crypto/evp/bio_enc.c
+4
-3
crypto/evp/evp.h
crypto/evp/evp.h
+2
-1
未找到文件。
apps/enc.c
浏览文件 @
757e392d
...
@@ -92,7 +92,7 @@ int MAIN(int argc, char **argv)
...
@@ -92,7 +92,7 @@ int MAIN(int argc, char **argv)
unsigned
char
*
buff
=
NULL
,
*
bufsize
=
NULL
;
unsigned
char
*
buff
=
NULL
,
*
bufsize
=
NULL
;
int
bsize
=
BSIZE
,
verbose
=
0
;
int
bsize
=
BSIZE
,
verbose
=
0
;
int
ret
=
1
,
inl
;
int
ret
=
1
,
inl
;
unsigned
char
key
[
24
],
iv
[
MD5_DIGEST
_LENGTH
];
unsigned
char
key
[
EVP_MAX_KEY_LENGTH
],
iv
[
EVP_MAX_IV
_LENGTH
];
unsigned
char
salt
[
PKCS5_SALT_LEN
];
unsigned
char
salt
[
PKCS5_SALT_LEN
];
char
*
str
=
NULL
,
*
passarg
=
NULL
,
*
pass
=
NULL
;
char
*
str
=
NULL
,
*
passarg
=
NULL
,
*
pass
=
NULL
;
char
*
hkey
=
NULL
,
*
hiv
=
NULL
,
*
hsalt
=
NULL
;
char
*
hkey
=
NULL
,
*
hiv
=
NULL
,
*
hsalt
=
NULL
;
...
@@ -542,12 +542,12 @@ bad:
...
@@ -542,12 +542,12 @@ bad:
else
else
memset
(
str
,
0
,
strlen
(
str
));
memset
(
str
,
0
,
strlen
(
str
));
}
}
if
((
hiv
!=
NULL
)
&&
!
set_hex
(
hiv
,
iv
,
8
))
if
((
hiv
!=
NULL
)
&&
!
set_hex
(
hiv
,
iv
,
sizeof
iv
))
{
{
BIO_printf
(
bio_err
,
"invalid hex iv value
\n
"
);
BIO_printf
(
bio_err
,
"invalid hex iv value
\n
"
);
goto
end
;
goto
end
;
}
}
if
((
hkey
!=
NULL
)
&&
!
set_hex
(
hkey
,
key
,
24
))
if
((
hkey
!=
NULL
)
&&
!
set_hex
(
hkey
,
key
,
sizeof
key
))
{
{
BIO_printf
(
bio_err
,
"invalid hex key value
\n
"
);
BIO_printf
(
bio_err
,
"invalid hex key value
\n
"
);
goto
end
;
goto
end
;
...
...
crypto/bn/bn_mont.c
浏览文件 @
757e392d
...
@@ -72,7 +72,7 @@
...
@@ -72,7 +72,7 @@
int
BN_mod_mul_montgomery
(
BIGNUM
*
r
,
const
BIGNUM
*
a
,
const
BIGNUM
*
b
,
int
BN_mod_mul_montgomery
(
BIGNUM
*
r
,
const
BIGNUM
*
a
,
const
BIGNUM
*
b
,
BN_MONT_CTX
*
mont
,
BN_CTX
*
ctx
)
BN_MONT_CTX
*
mont
,
BN_CTX
*
ctx
)
{
{
BIGNUM
*
tmp
,
*
tmp2
;
BIGNUM
*
tmp
;
int
ret
=
0
;
int
ret
=
0
;
BN_CTX_start
(
ctx
);
BN_CTX_start
(
ctx
);
...
...
crypto/evp/bio_enc.c
浏览文件 @
757e392d
...
@@ -71,6 +71,7 @@ static int enc_new(BIO *h);
...
@@ -71,6 +71,7 @@ static int enc_new(BIO *h);
static
int
enc_free
(
BIO
*
data
);
static
int
enc_free
(
BIO
*
data
);
static
long
enc_callback_ctrl
(
BIO
*
h
,
int
cmd
,
bio_info_cb
*
fps
);
static
long
enc_callback_ctrl
(
BIO
*
h
,
int
cmd
,
bio_info_cb
*
fps
);
#define ENC_BLOCK_SIZE (1024*4)
#define ENC_BLOCK_SIZE (1024*4)
#define BUF_OFFSET 8
/* XXX: why? */
typedef
struct
enc_struct
typedef
struct
enc_struct
{
{
...
@@ -80,7 +81,7 @@ typedef struct enc_struct
...
@@ -80,7 +81,7 @@ typedef struct enc_struct
int
finished
;
int
finished
;
int
ok
;
/* bad decrypt */
int
ok
;
/* bad decrypt */
EVP_CIPHER_CTX
cipher
;
EVP_CIPHER_CTX
cipher
;
char
buf
[
ENC_BLOCK_SIZE
+
10
];
char
buf
[
ENC_BLOCK_SIZE
+
BUF_OFFSET
+
2
/*why?*/
];
}
BIO_ENC_CTX
;
}
BIO_ENC_CTX
;
static
BIO_METHOD
methods_enc
=
static
BIO_METHOD
methods_enc
=
...
@@ -172,7 +173,7 @@ static int enc_read(BIO *b, char *out, int outl)
...
@@ -172,7 +173,7 @@ static int enc_read(BIO *b, char *out, int outl)
/* read in at offset 8, read the EVP_Cipher
/* read in at offset 8, read the EVP_Cipher
* documentation about why */
* documentation about why */
i
=
BIO_read
(
b
->
next_bio
,
&
(
ctx
->
buf
[
8
]),
ENC_BLOCK_SIZE
);
i
=
BIO_read
(
b
->
next_bio
,
&
(
ctx
->
buf
[
BUF_OFFSET
]),
ENC_BLOCK_SIZE
);
if
(
i
<=
0
)
if
(
i
<=
0
)
{
{
...
@@ -196,7 +197,7 @@ static int enc_read(BIO *b, char *out, int outl)
...
@@ -196,7 +197,7 @@ static int enc_read(BIO *b, char *out, int outl)
{
{
EVP_CipherUpdate
(
&
(
ctx
->
cipher
),
EVP_CipherUpdate
(
&
(
ctx
->
cipher
),
(
unsigned
char
*
)
ctx
->
buf
,
&
ctx
->
buf_len
,
(
unsigned
char
*
)
ctx
->
buf
,
&
ctx
->
buf_len
,
(
unsigned
char
*
)
&
(
ctx
->
buf
[
8
]),
i
);
(
unsigned
char
*
)
&
(
ctx
->
buf
[
BUF_OFFSET
]),
i
);
ctx
->
cont
=
1
;
ctx
->
cont
=
1
;
/* Note: it is possible for EVP_CipherUpdate to
/* Note: it is possible for EVP_CipherUpdate to
* decrypt zero bytes because this is or looks like
* decrypt zero bytes because this is or looks like
...
...
crypto/evp/evp.h
浏览文件 @
757e392d
...
@@ -121,6 +121,7 @@
...
@@ -121,6 +121,7 @@
#define EVP_MAX_MD_SIZE (16+20)
/* The SSLv3 md5+sha1 type */
#define EVP_MAX_MD_SIZE (16+20)
/* The SSLv3 md5+sha1 type */
#define EVP_MAX_KEY_LENGTH 32
#define EVP_MAX_KEY_LENGTH 32
#define EVP_MAX_IV_LENGTH 16
#define EVP_MAX_IV_LENGTH 16
#define EVP_MAX_BLOCK_LENGTH 32
#define PKCS5_SALT_LEN 8
#define PKCS5_SALT_LEN 8
/* Default PKCS#5 iteration count */
/* Default PKCS#5 iteration count */
...
@@ -396,7 +397,7 @@ struct evp_cipher_ctx_st
...
@@ -396,7 +397,7 @@ struct evp_cipher_ctx_st
unsigned
char
oiv
[
EVP_MAX_IV_LENGTH
];
/* original iv */
unsigned
char
oiv
[
EVP_MAX_IV_LENGTH
];
/* original iv */
unsigned
char
iv
[
EVP_MAX_IV_LENGTH
];
/* working iv */
unsigned
char
iv
[
EVP_MAX_IV_LENGTH
];
/* working iv */
unsigned
char
buf
[
EVP_MAX_
IV_LENGTH
];
/* saved partial block */
unsigned
char
buf
[
EVP_MAX_
BLOCK_LENGTH
];
/* saved partial block */
int
num
;
/* used by cfb/ofb mode */
int
num
;
/* used by cfb/ofb mode */
void
*
app_data
;
/* application stuff */
void
*
app_data
;
/* application stuff */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录