Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
7cc684f4
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
接近 2 年 前同步成功
通知
12
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看板
提交
7cc684f4
编写于
1月 27, 2011
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Redirect FIPS memory allocation to FIPS_malloc() routine, remove
OpenSSL malloc dependencies.
上级
e36d6b8f
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
80 addition
and
6 deletion
+80
-6
Makefile.org
Makefile.org
+0
-1
crypto/bn/bn_blind.c
crypto/bn/bn_blind.c
+6
-0
crypto/bn/bn_ctx.c
crypto/bn/bn_ctx.c
+6
-0
crypto/bn/bn_exp.c
crypto/bn/bn_exp.c
+5
-0
crypto/bn/bn_lib.c
crypto/bn/bn_lib.c
+5
-0
crypto/bn/bn_rand.c
crypto/bn/bn_rand.c
+5
-0
crypto/bn/bn_recp.c
crypto/bn/bn_recp.c
+5
-0
crypto/buffer/buf_str.c
crypto/buffer/buf_str.c
+5
-0
crypto/dsa/dsa_sign.c
crypto/dsa/dsa_sign.c
+5
-0
crypto/rsa/rsa_gen.c
crypto/rsa/rsa_gen.c
+2
-0
crypto/rsa/rsa_oaep.c
crypto/rsa/rsa_oaep.c
+4
-0
crypto/rsa/rsa_pss.c
crypto/rsa/rsa_pss.c
+4
-0
fips/dh/fips_dh_lib.c
fips/dh/fips_dh_lib.c
+3
-0
fips/dsa/fips_dsa_lib.c
fips/dsa/fips_dsa_lib.c
+3
-0
fips/fips.h
fips/fips.h
+5
-0
fips/fips_utl.h
fips/fips_utl.h
+3
-0
fips/hmac/fips_hmactest.c
fips/hmac/fips_hmactest.c
+0
-1
fips/rand/fips_randtest.c
fips/rand/fips_randtest.c
+2
-0
fips/rsa/fips_rsa_lib.c
fips/rsa/fips_rsa_lib.c
+3
-1
fips/rsa/fips_rsa_sign.c
fips/rsa/fips_rsa_sign.c
+1
-0
fips/utl/Makefile
fips/utl/Makefile
+2
-2
fips/utl/fips_enc.c
fips/utl/fips_enc.c
+3
-1
fips/utl/fips_md.c
fips/utl/fips_md.c
+3
-0
未找到文件。
Makefile.org
浏览文件 @
7cc684f4
...
@@ -313,7 +313,6 @@ FIPS_EX_OBJ= ../crypto/aes/aes_cfb.o \
...
@@ -313,7 +313,6 @@ FIPS_EX_OBJ= ../crypto/aes/aes_cfb.o \
../crypto/evp/e_des3.o
\
../crypto/evp/e_des3.o
\
../crypto/evp/m_sha1.o
\
../crypto/evp/m_sha1.o
\
../crypto/hmac/hmac.o
\
../crypto/hmac/hmac.o
\
../crypto/mem.o
\
../crypto/modes/cfb128.o
\
../crypto/modes/cfb128.o
\
../crypto/modes/ctr128.o
\
../crypto/modes/ctr128.o
\
../crypto/modes/ofb128.o
\
../crypto/modes/ofb128.o
\
...
...
crypto/bn/bn_blind.c
浏览文件 @
7cc684f4
...
@@ -113,6 +113,12 @@
...
@@ -113,6 +113,12 @@
#include "cryptlib.h"
#include "cryptlib.h"
#include "bn_lcl.h"
#include "bn_lcl.h"
#define OPENSSL_FIPSAPI
#ifdef OPENSSL_FIPS
#include <openssl/fips.h>
#endif
#define BN_BLINDING_COUNTER 32
#define BN_BLINDING_COUNTER 32
struct
bn_blinding_st
struct
bn_blinding_st
...
...
crypto/bn/bn_ctx.c
浏览文件 @
7cc684f4
...
@@ -60,12 +60,18 @@
...
@@ -60,12 +60,18 @@
#endif
#endif
#endif
#endif
#define OPENSSL_FIPSAPI
#include <stdio.h>
#include <stdio.h>
#include <assert.h>
#include <assert.h>
#include "cryptlib.h"
#include "cryptlib.h"
#include "bn_lcl.h"
#include "bn_lcl.h"
#ifdef OPENSSL_FIPS
#include <openssl/fips.h>
#endif
/* TODO list
/* TODO list
*
*
* 1. Check a bunch of "(words+1)" type hacks in various bignum functions and
* 1. Check a bunch of "(words+1)" type hacks in various bignum functions and
...
...
crypto/bn/bn_exp.c
浏览文件 @
7cc684f4
...
@@ -113,6 +113,11 @@
...
@@ -113,6 +113,11 @@
#include "cryptlib.h"
#include "cryptlib.h"
#include "bn_lcl.h"
#include "bn_lcl.h"
#define OPENSSL_FIPSAPI
#ifdef OPENSSL_FIPS
#include <openssl/fips.h>
#endif
/* maximum precomputation table size for *variable* sliding windows */
/* maximum precomputation table size for *variable* sliding windows */
#define TABLE_SIZE 32
#define TABLE_SIZE 32
...
...
crypto/bn/bn_lib.c
浏览文件 @
7cc684f4
...
@@ -67,6 +67,11 @@
...
@@ -67,6 +67,11 @@
#include "cryptlib.h"
#include "cryptlib.h"
#include "bn_lcl.h"
#include "bn_lcl.h"
#define OPENSSL_FIPSAPI
#ifdef OPENSSL_FIPS
#include <openssl/fips.h>
#endif
const
char
BN_version
[]
=
"Big Number"
OPENSSL_VERSION_PTEXT
;
const
char
BN_version
[]
=
"Big Number"
OPENSSL_VERSION_PTEXT
;
/* This stuff appears to be completely unused, so is deprecated */
/* This stuff appears to be completely unused, so is deprecated */
...
...
crypto/bn/bn_rand.c
浏览文件 @
7cc684f4
...
@@ -115,6 +115,11 @@
...
@@ -115,6 +115,11 @@
#include "bn_lcl.h"
#include "bn_lcl.h"
#include <openssl/rand.h>
#include <openssl/rand.h>
#define OPENSSL_FIPSAPI
#ifdef OPENSSL_FIPS
#include <openssl/fips.h>
#endif
static
int
bnrand
(
int
pseudorand
,
BIGNUM
*
rnd
,
int
bits
,
int
top
,
int
bottom
)
static
int
bnrand
(
int
pseudorand
,
BIGNUM
*
rnd
,
int
bits
,
int
top
,
int
bottom
)
{
{
unsigned
char
*
buf
=
NULL
;
unsigned
char
*
buf
=
NULL
;
...
...
crypto/bn/bn_recp.c
浏览文件 @
7cc684f4
...
@@ -60,6 +60,11 @@
...
@@ -60,6 +60,11 @@
#include "cryptlib.h"
#include "cryptlib.h"
#include "bn_lcl.h"
#include "bn_lcl.h"
#define OPENSSL_FIPSAPI
#ifdef OPENSSL_FIPS
#include <openssl/fips.h>
#endif
void
BN_RECP_CTX_init
(
BN_RECP_CTX
*
recp
)
void
BN_RECP_CTX_init
(
BN_RECP_CTX
*
recp
)
{
{
BN_init
(
&
(
recp
->
N
));
BN_init
(
&
(
recp
->
N
));
...
...
crypto/buffer/buf_str.c
浏览文件 @
7cc684f4
...
@@ -60,6 +60,11 @@
...
@@ -60,6 +60,11 @@
#include "cryptlib.h"
#include "cryptlib.h"
#include <openssl/buffer.h>
#include <openssl/buffer.h>
#define OPENSSL_FIPSAPI
#ifdef OPENSSL_FIPS
#include <openssl/fips.h>
#endif
char
*
BUF_strdup
(
const
char
*
str
)
char
*
BUF_strdup
(
const
char
*
str
)
{
{
if
(
str
==
NULL
)
return
(
NULL
);
if
(
str
==
NULL
)
return
(
NULL
);
...
...
crypto/dsa/dsa_sign.c
浏览文件 @
7cc684f4
...
@@ -63,6 +63,11 @@
...
@@ -63,6 +63,11 @@
#include <openssl/rand.h>
#include <openssl/rand.h>
#include <openssl/bn.h>
#include <openssl/bn.h>
#define OPENSSL_FIPSAPI
#ifdef OPENSSL_FIPS
#include <openssl/fips.h>
#endif
DSA_SIG
*
DSA_do_sign
(
const
unsigned
char
*
dgst
,
int
dlen
,
DSA
*
dsa
)
DSA_SIG
*
DSA_do_sign
(
const
unsigned
char
*
dgst
,
int
dlen
,
DSA
*
dsa
)
{
{
return
dsa
->
meth
->
dsa_do_sign
(
dgst
,
dlen
,
dsa
);
return
dsa
->
meth
->
dsa_do_sign
(
dgst
,
dlen
,
dsa
);
...
...
crypto/rsa/rsa_gen.c
浏览文件 @
7cc684f4
...
@@ -70,6 +70,8 @@
...
@@ -70,6 +70,8 @@
#ifdef OPENSSL_FIPS
#ifdef OPENSSL_FIPS
#define OPENSSL_FIPSAPI
#include <openssl/fips.h>
#include <openssl/fips.h>
#include <openssl/evp.h>
#include <openssl/evp.h>
...
...
crypto/rsa/rsa_oaep.c
浏览文件 @
7cc684f4
...
@@ -30,6 +30,10 @@
...
@@ -30,6 +30,10 @@
#include <openssl/rand.h>
#include <openssl/rand.h>
#include <openssl/sha.h>
#include <openssl/sha.h>
#ifdef OPENSSL_FIPS
#include <openssl/fips.h>
#endif
static
int
MGF1
(
unsigned
char
*
mask
,
long
len
,
static
int
MGF1
(
unsigned
char
*
mask
,
long
len
,
const
unsigned
char
*
seed
,
long
seedlen
);
const
unsigned
char
*
seed
,
long
seedlen
);
...
...
crypto/rsa/rsa_pss.c
浏览文件 @
7cc684f4
...
@@ -67,6 +67,10 @@
...
@@ -67,6 +67,10 @@
#include <openssl/sha.h>
#include <openssl/sha.h>
#include "rsa_locl.h"
#include "rsa_locl.h"
#ifdef OPENSSL_FIPS
#include <openssl/fips.h>
#endif
static
const
unsigned
char
zeroes
[]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
static
const
unsigned
char
zeroes
[]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
#if defined(_MSC_VER) && defined(_ARM_)
#if defined(_MSC_VER) && defined(_ARM_)
...
...
fips/dh/fips_dh_lib.c
浏览文件 @
7cc684f4
...
@@ -56,9 +56,12 @@
...
@@ -56,9 +56,12 @@
*
*
*/
*/
#define OPENSSL_FIPSAPI
#include <string.h>
#include <string.h>
#include <openssl/bn.h>
#include <openssl/bn.h>
#include <openssl/dh.h>
#include <openssl/dh.h>
#include <openssl/fips.h>
/* Minimal FIPS versions of FIPS_dh_new() and FIPS_dh_free(): to
/* Minimal FIPS versions of FIPS_dh_new() and FIPS_dh_free(): to
* reduce external dependencies.
* reduce external dependencies.
...
...
fips/dsa/fips_dsa_lib.c
浏览文件 @
7cc684f4
...
@@ -56,9 +56,12 @@
...
@@ -56,9 +56,12 @@
*
*
*/
*/
#define OPENSSL_FIPSAPI
#include <string.h>
#include <string.h>
#include <openssl/dsa.h>
#include <openssl/dsa.h>
#include <openssl/bn.h>
#include <openssl/bn.h>
#include <openssl/fips.h>
/* Minimal FIPS versions of FIPS_dsa_new() and FIPS_dsa_free: to
/* Minimal FIPS versions of FIPS_dsa_new() and FIPS_dsa_free: to
* reduce external dependencies.
* reduce external dependencies.
...
...
fips/fips.h
浏览文件 @
7cc684f4
...
@@ -113,8 +113,13 @@ void FIPS_lock(int mode, int type,const char *file,int line);
...
@@ -113,8 +113,13 @@ void FIPS_lock(int mode, int type,const char *file,int line);
void
FIPS_set_locking_callback
(
void
(
*
func
)(
int
mode
,
int
type
,
void
FIPS_set_locking_callback
(
void
(
*
func
)(
int
mode
,
int
type
,
const
char
*
file
,
int
line
));
const
char
*
file
,
int
line
));
void
*
FIPS_malloc
(
int
num
,
const
char
*
file
,
int
line
);
void
FIPS_free
(
void
*
);
#if defined(OPENSSL_FIPSCANISTER) && defined(OPENSSL_FIPSAPI)
#if defined(OPENSSL_FIPSCANISTER) && defined(OPENSSL_FIPSAPI)
#define CRYPTO_lock FIPS_lock
#define CRYPTO_lock FIPS_lock
#define CRYPTO_malloc FIPS_malloc
#define CRYPTO_free FIPS_free
#endif
#endif
/* BEGIN ERROR CODES */
/* BEGIN ERROR CODES */
...
...
fips/fips_utl.h
浏览文件 @
7cc684f4
...
@@ -47,6 +47,9 @@
...
@@ -47,6 +47,9 @@
*
*
*/
*/
#define OPENSSL_FIPSAPI
#include <openssl/fips.h>
int
hex2bin
(
const
char
*
in
,
unsigned
char
*
out
);
int
hex2bin
(
const
char
*
in
,
unsigned
char
*
out
);
unsigned
char
*
hex2bin_m
(
const
char
*
in
,
long
*
plen
);
unsigned
char
*
hex2bin_m
(
const
char
*
in
,
long
*
plen
);
int
do_hex2bn
(
BIGNUM
**
pr
,
const
char
*
in
);
int
do_hex2bn
(
BIGNUM
**
pr
,
const
char
*
in
);
...
...
fips/hmac/fips_hmactest.c
浏览文件 @
7cc684f4
...
@@ -77,7 +77,6 @@ int main(int argc, char *argv[])
...
@@ -77,7 +77,6 @@ int main(int argc, char *argv[])
#else
#else
#include <openssl/fips.h>
#include "fips_utl.h"
#include "fips_utl.h"
static
int
hmac_test
(
const
EVP_MD
*
md
,
FILE
*
out
,
FILE
*
in
);
static
int
hmac_test
(
const
EVP_MD
*
md
,
FILE
*
out
,
FILE
*
in
);
...
...
fips/rand/fips_randtest.c
浏览文件 @
7cc684f4
...
@@ -123,6 +123,8 @@ int main(int argc, char *argv[])
...
@@ -123,6 +123,8 @@ int main(int argc, char *argv[])
#else
#else
#define OPENSSL_FIPSAPI
#include <openssl/fips.h>
#include <openssl/fips.h>
#include "fips_utl.h"
#include "fips_utl.h"
...
...
fips/rsa/fips_rsa_lib.c
浏览文件 @
7cc684f4
...
@@ -56,11 +56,14 @@
...
@@ -56,11 +56,14 @@
*
*
*/
*/
#define OPENSSL_FIPSAPI
#include <string.h>
#include <string.h>
#include <openssl/evp.h>
#include <openssl/evp.h>
#include <openssl/rsa.h>
#include <openssl/rsa.h>
#include <openssl/bn.h>
#include <openssl/bn.h>
#include <openssl/err.h>
#include <openssl/err.h>
#include <openssl/fips.h>
/* Minimal FIPS versions of FIPS_rsa_new() and FIPS_rsa_free: to
/* Minimal FIPS versions of FIPS_rsa_new() and FIPS_rsa_free: to
* reduce external dependencies.
* reduce external dependencies.
...
@@ -95,7 +98,6 @@ void FIPS_rsa_free(RSA *r)
...
@@ -95,7 +98,6 @@ void FIPS_rsa_free(RSA *r)
if
(
r
->
iqmp
!=
NULL
)
BN_clear_free
(
r
->
iqmp
);
if
(
r
->
iqmp
!=
NULL
)
BN_clear_free
(
r
->
iqmp
);
if
(
r
->
blinding
!=
NULL
)
BN_BLINDING_free
(
r
->
blinding
);
if
(
r
->
blinding
!=
NULL
)
BN_BLINDING_free
(
r
->
blinding
);
if
(
r
->
mt_blinding
!=
NULL
)
BN_BLINDING_free
(
r
->
mt_blinding
);
if
(
r
->
mt_blinding
!=
NULL
)
BN_BLINDING_free
(
r
->
mt_blinding
);
if
(
r
->
bignum_data
!=
NULL
)
OPENSSL_free_locked
(
r
->
bignum_data
);
OPENSSL_free
(
r
);
OPENSSL_free
(
r
);
}
}
fips/rsa/fips_rsa_sign.c
浏览文件 @
7cc684f4
...
@@ -63,6 +63,7 @@
...
@@ -63,6 +63,7 @@
#include <openssl/rsa.h>
#include <openssl/rsa.h>
#include <openssl/err.h>
#include <openssl/err.h>
#include <openssl/sha.h>
#include <openssl/sha.h>
#include <openssl/fips.h>
#ifdef OPENSSL_FIPS
#ifdef OPENSSL_FIPS
...
...
fips/utl/Makefile
浏览文件 @
7cc684f4
...
@@ -22,8 +22,8 @@ TEST=
...
@@ -22,8 +22,8 @@ TEST=
APPS
=
APPS
=
LIB
=
$(TOP)
/libcrypto.a
LIB
=
$(TOP)
/libcrypto.a
LIBSRC
=
fips_err.c fips_md.c fips_enc.c fips_lck.c
LIBSRC
=
fips_err.c fips_md.c fips_enc.c fips_lck.c
fips_mem.c
LIBOBJ
=
fips_err.o fips_md.o fips_enc.o fips_lck.o
LIBOBJ
=
fips_err.o fips_md.o fips_enc.o fips_lck.o
fips_mem.o
SRC
=
$(LIBSRC)
SRC
=
$(LIBSRC)
...
...
fips/utl/fips_enc.c
浏览文件 @
7cc684f4
...
@@ -56,11 +56,13 @@
...
@@ -56,11 +56,13 @@
* [including the GNU Public Licence.]
* [including the GNU Public Licence.]
*/
*/
#define OPENSSL_FIPSAPI
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <string.h>
#include <openssl/evp.h>
#include <openssl/evp.h>
#include <openssl/err.h>
#include <openssl/err.h>
#include <openssl/
rand
.h>
#include <openssl/
fips
.h>
void
FIPS_cipher_ctx_init
(
EVP_CIPHER_CTX
*
ctx
)
void
FIPS_cipher_ctx_init
(
EVP_CIPHER_CTX
*
ctx
)
{
{
...
...
fips/utl/fips_md.c
浏览文件 @
7cc684f4
...
@@ -111,11 +111,14 @@
...
@@ -111,11 +111,14 @@
/* Minimal standalone FIPS versions of Digest operations */
/* Minimal standalone FIPS versions of Digest operations */
#define OPENSSL_FIPSAPI
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <string.h>
#include <openssl/objects.h>
#include <openssl/objects.h>
#include <openssl/evp.h>
#include <openssl/evp.h>
#include <openssl/err.h>
#include <openssl/err.h>
#include <openssl/fips.h>
void
FIPS_md_ctx_init
(
EVP_MD_CTX
*
ctx
)
void
FIPS_md_ctx_init
(
EVP_MD_CTX
*
ctx
)
{
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录