Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
57ebe748
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看板
提交
57ebe748
编写于
9月 28, 2015
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
engine/e_capi.c: fix various warnings.
Reviewed-by:
N
Rich Salz
<
rsalz@openssl.org
>
上级
db40a14e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
22 addition
and
16 deletion
+22
-16
engines/e_capi.c
engines/e_capi.c
+22
-16
未找到文件。
engines/e_capi.c
浏览文件 @
57ebe748
...
@@ -239,7 +239,7 @@ struct CAPI_CTX_st {
...
@@ -239,7 +239,7 @@ struct CAPI_CTX_st {
GETCONSWIN
getconswindow
;
GETCONSWIN
getconswindow
;
};
};
static
CAPI_CTX
*
capi_ctx_new
();
static
CAPI_CTX
*
capi_ctx_new
(
void
);
static
void
capi_ctx_free
(
CAPI_CTX
*
ctx
);
static
void
capi_ctx_free
(
CAPI_CTX
*
ctx
);
static
int
capi_ctx_set_provname
(
CAPI_CTX
*
ctx
,
LPSTR
pname
,
DWORD
type
,
static
int
capi_ctx_set_provname
(
CAPI_CTX
*
ctx
,
LPSTR
pname
,
DWORD
type
,
int
check
);
int
check
);
...
@@ -742,7 +742,7 @@ static EVP_PKEY *capi_get_pkey(ENGINE *eng, CAPI_KEY * key)
...
@@ -742,7 +742,7 @@ static EVP_PKEY *capi_get_pkey(ENGINE *eng, CAPI_KEY * key)
dkey
=
NULL
;
dkey
=
NULL
;
}
else
{
}
else
{
char
algstr
[
10
];
char
algstr
[
10
];
BIO_snprintf
(
algstr
,
10
,
"%
l
x"
,
bh
->
aiKeyAlg
);
BIO_snprintf
(
algstr
,
10
,
"%
u
x"
,
bh
->
aiKeyAlg
);
CAPIerr
(
CAPI_F_CAPI_GET_PKEY
,
CAPIerr
(
CAPI_F_CAPI_GET_PKEY
,
CAPI_R_UNSUPPORTED_PUBLIC_KEY_ALGORITHM
);
CAPI_R_UNSUPPORTED_PUBLIC_KEY_ALGORITHM
);
ERR_add_error_data
(
2
,
"aiKeyAlg=0x"
,
algstr
);
ERR_add_error_data
(
2
,
"aiKeyAlg=0x"
,
algstr
);
...
@@ -847,7 +847,7 @@ int capi_rsa_sign(int dtype, const unsigned char *m, unsigned int m_len,
...
@@ -847,7 +847,7 @@ int capi_rsa_sign(int dtype, const unsigned char *m, unsigned int m_len,
default:
default:
{
{
char
algstr
[
10
];
char
algstr
[
10
];
BIO_snprintf
(
algstr
,
10
,
"%
l
x"
,
dtype
);
BIO_snprintf
(
algstr
,
10
,
"%x"
,
dtype
);
CAPIerr
(
CAPI_F_CAPI_RSA_SIGN
,
CAPI_R_UNSUPPORTED_ALGORITHM_NID
);
CAPIerr
(
CAPI_F_CAPI_RSA_SIGN
,
CAPI_R_UNSUPPORTED_ALGORITHM_NID
);
ERR_add_error_data
(
2
,
"NID=0x"
,
algstr
);
ERR_add_error_data
(
2
,
"NID=0x"
,
algstr
);
return
-
1
;
return
-
1
;
...
@@ -901,6 +901,11 @@ int capi_rsa_priv_dec(int flen, const unsigned char *from,
...
@@ -901,6 +901,11 @@ int capi_rsa_priv_dec(int flen, const unsigned char *from,
unsigned
char
*
tmpbuf
;
unsigned
char
*
tmpbuf
;
CAPI_KEY
*
capi_key
;
CAPI_KEY
*
capi_key
;
CAPI_CTX
*
ctx
;
CAPI_CTX
*
ctx
;
DWORD
dlen
;
if
(
flen
<=
0
)
return
flen
;
ctx
=
ENGINE_get_ex_data
(
rsa
->
engine
,
capi_idx
);
ctx
=
ENGINE_get_ex_data
(
rsa
->
engine
,
capi_idx
);
CAPI_trace
(
ctx
,
"Called capi_rsa_priv_dec()
\n
"
);
CAPI_trace
(
ctx
,
"Called capi_rsa_priv_dec()
\n
"
);
...
@@ -928,13 +933,14 @@ int capi_rsa_priv_dec(int flen, const unsigned char *from,
...
@@ -928,13 +933,14 @@ int capi_rsa_priv_dec(int flen, const unsigned char *from,
tmpbuf
[
flen
-
i
-
1
]
=
from
[
i
];
tmpbuf
[
flen
-
i
-
1
]
=
from
[
i
];
/* Finally decrypt it */
/* Finally decrypt it */
if
(
!
CryptDecrypt
(
capi_key
->
key
,
0
,
TRUE
,
0
,
tmpbuf
,
&
flen
))
{
dlen
=
flen
;
if
(
!
CryptDecrypt
(
capi_key
->
key
,
0
,
TRUE
,
0
,
tmpbuf
,
&
dlen
))
{
CAPIerr
(
CAPI_F_CAPI_RSA_PRIV_DEC
,
CAPI_R_DECRYPT_ERROR
);
CAPIerr
(
CAPI_F_CAPI_RSA_PRIV_DEC
,
CAPI_R_DECRYPT_ERROR
);
capi_addlasterror
();
capi_addlasterror
();
OPENSSL_free
(
tmpbuf
);
OPENSSL_free
(
tmpbuf
);
return
-
1
;
return
-
1
;
}
else
}
else
memcpy
(
to
,
tmpbuf
,
flen
);
memcpy
(
to
,
tmpbuf
,
(
flen
=
(
int
)
dlen
)
);
OPENSSL_free
(
tmpbuf
);
OPENSSL_free
(
tmpbuf
);
...
@@ -1147,7 +1153,7 @@ static int capi_list_providers(CAPI_CTX * ctx, BIO *out)
...
@@ -1147,7 +1153,7 @@ static int capi_list_providers(CAPI_CTX * ctx, BIO *out)
break
;
break
;
if
(
ret
==
0
)
if
(
ret
==
0
)
break
;
break
;
BIO_printf
(
out
,
"%
d. %s, type %d
\n
"
,
idx
,
provname
,
ptype
);
BIO_printf
(
out
,
"%
lu. %s, type %lu
\n
"
,
idx
,
provname
,
ptype
);
OPENSSL_free
(
provname
);
OPENSSL_free
(
provname
);
}
}
return
1
;
return
1
;
...
@@ -1223,7 +1229,7 @@ static int capi_list_containers(CAPI_CTX * ctx, BIO *out)
...
@@ -1223,7 +1229,7 @@ static int capi_list_containers(CAPI_CTX * ctx, BIO *out)
CAPI_trace
(
ctx
,
"Enumerate bug: using workaround
\n
"
);
CAPI_trace
(
ctx
,
"Enumerate bug: using workaround
\n
"
);
goto
done
;
goto
done
;
}
}
BIO_printf
(
out
,
"%
d
. %s
\n
"
,
idx
,
cname
);
BIO_printf
(
out
,
"%
lu
. %s
\n
"
,
idx
,
cname
);
}
}
err:
err:
...
@@ -1236,7 +1242,7 @@ static int capi_list_containers(CAPI_CTX * ctx, BIO *out)
...
@@ -1236,7 +1242,7 @@ static int capi_list_containers(CAPI_CTX * ctx, BIO *out)
return
ret
;
return
ret
;
}
}
CRYPT_KEY_PROV_INFO
*
capi_get_prov_info
(
CAPI_CTX
*
ctx
,
PCCERT_CONTEXT
cert
)
static
CRYPT_KEY_PROV_INFO
*
capi_get_prov_info
(
CAPI_CTX
*
ctx
,
PCCERT_CONTEXT
cert
)
{
{
DWORD
len
;
DWORD
len
;
CRYPT_KEY_PROV_INFO
*
pinfo
;
CRYPT_KEY_PROV_INFO
*
pinfo
;
...
@@ -1274,16 +1280,16 @@ static void capi_dump_prov_info(CAPI_CTX * ctx, BIO *out,
...
@@ -1274,16 +1280,16 @@ static void capi_dump_prov_info(CAPI_CTX * ctx, BIO *out,
goto
err
;
goto
err
;
BIO_printf
(
out
,
" Private Key Info:
\n
"
);
BIO_printf
(
out
,
" Private Key Info:
\n
"
);
BIO_printf
(
out
,
" Provider Name: %s, Provider Type %
d
\n
"
,
provname
,
BIO_printf
(
out
,
" Provider Name: %s, Provider Type %
lu
\n
"
,
provname
,
pinfo
->
dwProvType
);
pinfo
->
dwProvType
);
BIO_printf
(
out
,
" Container Name: %s, Key Type %
d
\n
"
,
contname
,
BIO_printf
(
out
,
" Container Name: %s, Key Type %
lu
\n
"
,
contname
,
pinfo
->
dwKeySpec
);
pinfo
->
dwKeySpec
);
err:
err:
OPENSSL_free
(
provname
);
OPENSSL_free
(
provname
);
OPENSSL_free
(
contname
);
OPENSSL_free
(
contname
);
}
}
char
*
capi_cert_get_fname
(
CAPI_CTX
*
ctx
,
PCCERT_CONTEXT
cert
)
static
char
*
capi_cert_get_fname
(
CAPI_CTX
*
ctx
,
PCCERT_CONTEXT
cert
)
{
{
LPWSTR
wfname
;
LPWSTR
wfname
;
DWORD
dlen
;
DWORD
dlen
;
...
@@ -1308,10 +1314,10 @@ char *capi_cert_get_fname(CAPI_CTX * ctx, PCCERT_CONTEXT cert)
...
@@ -1308,10 +1314,10 @@ char *capi_cert_get_fname(CAPI_CTX * ctx, PCCERT_CONTEXT cert)
return
NULL
;
return
NULL
;
}
}
void
capi_dump_cert
(
CAPI_CTX
*
ctx
,
BIO
*
out
,
PCCERT_CONTEXT
cert
)
static
void
capi_dump_cert
(
CAPI_CTX
*
ctx
,
BIO
*
out
,
PCCERT_CONTEXT
cert
)
{
{
X509
*
x
;
X509
*
x
;
unsigned
char
*
p
;
const
unsigned
char
*
p
;
unsigned
long
flags
=
ctx
->
dump_flags
;
unsigned
long
flags
=
ctx
->
dump_flags
;
if
(
flags
&
CAPI_DMP_FNAME
)
{
if
(
flags
&
CAPI_DMP_FNAME
)
{
char
*
fname
;
char
*
fname
;
...
@@ -1349,7 +1355,7 @@ void capi_dump_cert(CAPI_CTX * ctx, BIO *out, PCCERT_CONTEXT cert)
...
@@ -1349,7 +1355,7 @@ void capi_dump_cert(CAPI_CTX * ctx, BIO *out, PCCERT_CONTEXT cert)
X509_free
(
x
);
X509_free
(
x
);
}
}
HCERTSTORE
capi_open_store
(
CAPI_CTX
*
ctx
,
char
*
storename
)
static
HCERTSTORE
capi_open_store
(
CAPI_CTX
*
ctx
,
char
*
storename
)
{
{
HCERTSTORE
hstore
;
HCERTSTORE
hstore
;
...
@@ -1571,7 +1577,7 @@ void capi_free_key(CAPI_KEY * key)
...
@@ -1571,7 +1577,7 @@ void capi_free_key(CAPI_KEY * key)
/* Initialize a CAPI_CTX structure */
/* Initialize a CAPI_CTX structure */
static
CAPI_CTX
*
capi_ctx_new
()
static
CAPI_CTX
*
capi_ctx_new
(
void
)
{
{
CAPI_CTX
*
ctx
=
OPENSSL_zalloc
(
sizeof
(
*
ctx
));
CAPI_CTX
*
ctx
=
OPENSSL_zalloc
(
sizeof
(
*
ctx
));
...
@@ -1669,7 +1675,7 @@ static int capi_load_ssl_client_cert(ENGINE *e, SSL *ssl,
...
@@ -1669,7 +1675,7 @@ static int capi_load_ssl_client_cert(ENGINE *e, SSL *ssl,
STACK_OF
(
X509
)
*
certs
=
NULL
;
STACK_OF
(
X509
)
*
certs
=
NULL
;
X509
*
x
;
X509
*
x
;
char
*
storename
;
char
*
storename
;
const
char
*
p
;
const
unsigned
char
*
p
;
int
i
,
client_cert_idx
;
int
i
,
client_cert_idx
;
HCERTSTORE
hstore
;
HCERTSTORE
hstore
;
PCCERT_CONTEXT
cert
=
NULL
,
excert
=
NULL
;
PCCERT_CONTEXT
cert
=
NULL
,
excert
=
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录