Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Wpa Supplicant
提交
1b232d77
T
Third Party Wpa Supplicant
项目概览
OpenHarmony
/
Third Party Wpa Supplicant
大约 1 年 前同步成功
通知
2
Star
19
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Wpa Supplicant
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1b232d77
编写于
6月 13, 2023
作者:
徐
徐杰
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify code for EAP-TLS/PEAP/TTLS/PWD
Signed-off-by:
N
徐杰
<
xujie223@huawei.com
>
上级
8bc17e57
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
75 addition
and
35 deletion
+75
-35
wpa_supplicant-2.9_standard/BUILD.gn
wpa_supplicant-2.9_standard/BUILD.gn
+5
-0
wpa_supplicant-2.9_standard/src/crypto/tls_openssl.c
wpa_supplicant-2.9_standard/src/crypto/tls_openssl.c
+51
-23
wpa_supplicant-2.9_standard/src/utils/wpa_debug.c
wpa_supplicant-2.9_standard/src/utils/wpa_debug.c
+1
-1
wpa_supplicant-2.9_standard/wpa_supplicant_lib/wpa_evp_key.c
wpa_supplicant-2.9_standard/wpa_supplicant_lib/wpa_evp_key.c
+17
-10
wpa_supplicant-2.9_standard/wpa_supplicant_lib/wpa_evp_key.h
wpa_supplicant-2.9_standard/wpa_supplicant_lib/wpa_evp_key.h
+1
-1
未找到文件。
wpa_supplicant-2.9_standard/BUILD.gn
浏览文件 @
1b232d77
...
...
@@ -293,6 +293,7 @@ wpa_base_sources = [
"$WPA_ROOT_DIR/src/eap_common/eap_sim_common.c",
"$WPA_ROOT_DIR/src/eap_common/eap_wsc_common.c",
"$WPA_ROOT_DIR/src/eap_peer/eap_aka.c",
"$WPA_ROOT_DIR/src/eap_peer/eap_gtc.c",
"$WPA_ROOT_DIR/src/eap_peer/eap_mschapv2.c",
"$WPA_ROOT_DIR/src/eap_peer/eap_peap.c",
"$WPA_ROOT_DIR/src/eap_peer/eap_pwd.c",
...
...
@@ -411,6 +412,8 @@ ohos_shared_library("wpa") {
"-DCONFIG_SAE",
"-DCONFIG_SME",
"-DCONFIG_WEP",
"-DPKCS12_FUNCS",
"-DEAP_GTC",
]
if ("${CONFIG_CTRL_IFACE}" == "udp") {
cflags += [ "-DCONFIG_CTRL_IFACE_UDP" ]
...
...
@@ -555,6 +558,8 @@ ohos_shared_library("wpa_updater") {
"-DCONFIG_SAE",
"-DCONFIG_SME",
"-DCONFIG_WEP",
"-DPKCS12_FUNCS",
"-DEAP_GTC",
]
if ("${CONFIG_CTRL_IFACE}" == "udp") {
cflags += [ "-DCONFIG_CTRL_IFACE_UDP" ]
...
...
wpa_supplicant-2.9_standard/src/crypto/tls_openssl.c
浏览文件 @
1b232d77
...
...
@@ -41,6 +41,8 @@
#include "wpa_evp_key.h"
#endif
#define OH_PREFIX "oh:"
#if !defined(CONFIG_FIPS) && \
(defined(EAP_FAST) || defined(EAP_FAST_DYNAMIC) || \
defined(EAP_SERVER_FAST))
...
...
@@ -3344,14 +3346,34 @@ static int tls_connection_client_cert(struct tls_connection *conn,
#endif
/* ANDROID */
#ifdef CONFIG_OHOS_CERTMGR
if
(
os_strncmp
(
OH_PREFIX
,
client_cert
,
os_strlen
(
OH_PREFIX
))
==
0
)
{
int
ret
=
-
1
;
X509
*
x509
=
NULL
;
BIO
*
bio
=
BIO_from_cm
(
&
client_cert
[
0
]);
if
(
bio
)
struct
Credential
certificate
=
{
0
};
certificate
.
credData
.
data
=
(
uint8_t
*
)
malloc
(
MAX_LEN_CERTIFICATE_CHAIN
);
if
(
certificate
.
credData
.
data
==
NULL
)
{
wpa_printf
(
MSG_ERROR
,
"%s malloc certificate.credData.data fail"
,
__func__
);
return
-
1
;
}
BIO
*
bio
=
BIO_from_cm
(
&
client_cert
[
0
],
certificate
);
if
(
!
bio
)
{
wpa_printf
(
MSG_DEBUG
,
"tls_connection_client_cert: bio = NULL"
);
if
(
certificate
.
credData
.
data
!=
NULL
)
{
free
(
certificate
.
credData
.
data
);
}
return
-
1
;
}
if
(
bio
)
{
x509
=
PEM_read_bio_X509
(
bio
,
NULL
,
NULL
,
NULL
);
}
if
(
x509
)
{
if
(
SSL_use_certificate
(
conn
->
ssl
,
x509
)
==
1
)
if
(
SSL_use_certificate
(
conn
->
ssl
,
x509
)
==
1
)
{
ret
=
0
;
}
X509_free
(
x509
);
}
...
...
@@ -3366,7 +3388,13 @@ static int tls_connection_client_cert(struct tls_connection *conn,
bio
=
NULL
;
}
}
if
(
certificate
.
credData
.
data
!=
NULL
)
{
free
(
certificate
.
credData
.
data
);
}
return
ret
;
}
#endif
#ifndef OPENSSL_NO_STDIO
...
...
wpa_supplicant-2.9_standard/src/utils/wpa_debug.c
浏览文件 @
1b232d77
...
...
@@ -206,7 +206,7 @@ void wpa_debug_close_linux_tracing(void)
#endif // LOG_TAG
#define LOG_DOMAIN 0xD0015C0
#define LOG_TAG "wpa_supplicant"
#define WPA_MAX_LOG_CHAR
1024
#define WPA_MAX_LOG_CHAR
8196
#define WPA_PROP_KEY_DEBUG_ON "persist.sys.wpa_debug_on"
#define PARAM_VALUE_MAX_LEN 10
...
...
wpa_supplicant-2.9_standard/wpa_supplicant_lib/wpa_evp_key.c
浏览文件 @
1b232d77
...
...
@@ -107,13 +107,28 @@ static EVP_PKEY *wrap_rsa(const char *key_id, const RSA *public_rsa)
static
EVP_PKEY
*
get_pubkey
(
const
char
*
key_id
)
{
BIO
*
bio
=
BIO_from_cm
(
key_id
);
struct
Credential
certificate
=
{
0
};
certificate
.
credData
.
data
=
(
uint8_t
*
)
malloc
(
MAX_LEN_CERTIFICATE_CHAIN
);
if
(
certificate
.
credData
.
data
==
NULL
)
{
wpa_printf
(
MSG_ERROR
,
"%s malloc certificate.credData.data fail"
,
__func__
);
return
NULL
;
}
BIO
*
bio
=
BIO_from_cm
(
key_id
,
certificate
);
if
(
bio
==
NULL
)
{
wpa_printf
(
MSG_ERROR
,
"%s bio is null"
,
__func__
);
if
(
certificate
.
credData
.
data
!=
NULL
)
{
free
(
certificate
.
credData
.
data
);
}
return
NULL
;
}
X509
*
decoded_cert
=
PEM_read_bio_X509
(
bio
,
NULL
,
NULL
,
NULL
);
if
(
certificate
.
credData
.
data
!=
NULL
)
{
free
(
certificate
.
credData
.
data
);
}
if
(
decoded_cert
==
NULL
)
{
wpa_printf
(
MSG_ERROR
,
"%s decoded cert is null"
,
__func__
);
return
NULL
;
...
...
@@ -156,10 +171,9 @@ EVP_PKEY *GET_EVP_PKEY(const char *key_id)
return
wrap_key
;
}
BIO
*
BIO_from_cm
(
const
char
*
key_id
)
BIO
*
BIO_from_cm
(
const
char
*
key_id
,
struct
Credential
certificate
)
{
BIO
*
bio
=
NULL
;
struct
Credential
certificate
=
{
0
};
uint32_t
store
=
CM_PRI_CREDENTIAL_STORE
;
struct
CmBlob
keyUri
;
...
...
@@ -170,17 +184,11 @@ BIO *BIO_from_cm(const char *key_id)
keyUri
.
size
=
strlen
(
key_id
)
+
1
;
keyUri
.
data
=
(
uint8_t
*
)
key_id
;
certificate
.
credData
.
data
=
(
uint8_t
*
)
malloc
(
MAX_LEN_CERTIFICATE_CHAIN
);
if
(
certificate
.
credData
.
data
==
NULL
)
{
wpa_printf
(
MSG_ERROR
,
"%s malloc fail"
,
__func__
);
return
bio
;
}
certificate
.
credData
.
size
=
MAX_LEN_CERTIFICATE_CHAIN
;
int
ret
=
CmGetAppCert
(
&
keyUri
,
store
,
&
certificate
);
if
(
ret
!=
0
)
{
wpa_printf
(
MSG_ERROR
,
"%s key:%s, size:%u, ret:%d"
,
__func__
,
key_id
,
certificate
.
credData
.
size
,
ret
);
free
(
certificate
.
credData
.
data
);
return
bio
;
}
...
...
@@ -190,6 +198,5 @@ BIO *BIO_from_cm(const char *key_id)
if
(
certificate
.
credData
.
size
>
0
)
bio
=
BIO_new_mem_buf
(
certificate
.
credData
.
data
,
certificate
.
credData
.
size
);
free
(
certificate
.
credData
.
data
);
return
bio
;
}
wpa_supplicant-2.9_standard/wpa_supplicant_lib/wpa_evp_key.h
浏览文件 @
1b232d77
...
...
@@ -18,7 +18,7 @@ extern "C" {
#define DEFAULT_SIGNATURE_LEN 1024
EVP_PKEY
*
GET_EVP_PKEY
(
const
char
*
key_id
);
BIO
*
BIO_from_cm
(
const
char
*
key_id
);
BIO
*
BIO_from_cm
(
const
char
*
key_id
,
struct
Credential
certificate
);
#ifdef __cplusplus
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录