From 6aca178c218e1edab43142ffbd5cb0104f5e89bb Mon Sep 17 00:00:00 2001 From: liuxiyao223 Date: Sat, 18 Nov 2023 17:06:50 +0800 Subject: [PATCH 01/13] add ndk api for netssl Signed-off-by: liuxiyao223 --- network/netssl/BUILD.gn | 64 ++++++++++++++++++++ network/netssl/include/net_ssl_c.h | 62 +++++++++++++++++++ network/netssl/include/net_ssl_c_type.h | 79 +++++++++++++++++++++++++ network/netssl/libnet_ssl_c.json | 6 ++ 4 files changed, 211 insertions(+) create mode 100644 network/netssl/BUILD.gn create mode 100644 network/netssl/include/net_ssl_c.h create mode 100644 network/netssl/include/net_ssl_c_type.h create mode 100644 network/netssl/libnet_ssl_c.json diff --git a/network/netssl/BUILD.gn b/network/netssl/BUILD.gn new file mode 100644 index 000000000..b6ac21a8b --- /dev/null +++ b/network/netssl/BUILD.gn @@ -0,0 +1,64 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//foundation/communication/netstack/netstack_config.gni") + +ohos_ndk_library("libnet_ssl_ndk") { + output_name = "net_ssl" + output_extension = "so" + ndk_description_file = "./libnet_ssl_c.json" + min_compact_version = "1" + system_capability = "SystemCapability.Communication.Netstack" +} + +ohos_ndk_headers("net_ssl_header") { + dest_dir = "$ndk_headers_out_dir/net_ssl" + sources = [ + "./include/net_ssl_c.h", + "./include/net_ssl_c_type.h", + ] +} + +ohos_shared_library("net_ssl_ndk") { + output_name = "net_ssl" + output_extension = "so" + include_dirs = [ + "//foundation/communication/netstack/interfaces/kits/c/net_ssl/include", + "//foundation/communication/netstack/interfaces/innerkits/net_ssl/include", + "//foundation/communication/netstack/frameworks/native/net_ssl/include" + ] + + sources = [ + "src/net_ssl_c.cpp", + ] + + deps = [ + "//foundation/communication/netstack/interfaces/innerkits/net_ssl:net_ssl", + "$THIRD_PARTY_ROOT/openssl:libssl_shared", + "$THIRD_PARTY_ROOT/openssl:libcrypto_shared", + ] + + external_deps = [ + "hilog:libhilog", + "ipc:ipc_core", + ] + + cflags_cc = [ + "-Wall", + "-Werror", + ] + + part_name = "netstack" + subsystem_name = "communication" +} \ No newline at end of file diff --git a/network/netssl/include/net_ssl_c.h b/network/netssl/include/net_ssl_c.h new file mode 100644 index 000000000..1ffc4c2d5 --- /dev/null +++ b/network/netssl/include/net_ssl_c.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef NET_SSL_C_H +#define NET_SSL_C_H + +/** + * @addtogroup netstack + * @{ + * + * @brief Provides C APIs for the SSL/TLS certificate chain verification module. + * + * @since 11 + * @version 1.0 + */ + +/** + * @file net_ssl_c.h + * + * @brief Defines C APIs for the SSL/TLS certificate chain verification module. + * + * @library libnet_ssl.so + * @syscap SystemCapability.Communication.Netstack + * @since 11 + * @version 1.0 + */ + +#include "net_ssl_c_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Provides certificate chain verification APIs for external systems. + * + * @param cert Certificate to be verified. + * @param caCert CA certificate specified by the user. If this parameter is left blank, the preset certificate is used. + * @return 0 if success; non-0 otherwise. + * @syscap SystemCapability.Communication.Netstack + * @since 11 + * @version 1.0 + */ +uint32_t OH_NetStack_VerifyCertification(const struct OH_NetStack_CertBlob *cert, + const struct OH_NetStack_CertBlob *caCert); +#ifdef __cplusplus +} +#endif + +#endif // NET_SSL_C_H diff --git a/network/netssl/include/net_ssl_c_type.h b/network/netssl/include/net_ssl_c_type.h new file mode 100644 index 000000000..35712e651 --- /dev/null +++ b/network/netssl/include/net_ssl_c_type.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef NET_SSL_C_TYPE_H +#define NET_SSL_C_TYPE_H + +/** + * @addtogroup netstack + * @{ + * + * @brief Provides C APIs for the SSL/TLS certificate chain verification module. + * + * @since 11 + * @version 1.0 + */ + +/** + * @file net_ssl_c_type.h + * @brief Defines the data structures for the C APIs of the SSL/TLS certificate chain verification module. + * + * @library libnet_ssl.so + * @syscap SystemCapability.Communication.Netstack + * @since 11 + * @version 1.0 + */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumerates certificate types. + * + * @since 11 + * @version 1.0 + */ +enum OH_NetStack_CertType { + /** PEM certificate */ + OH_NetStack_CERT_TYPE_PEM = 0, + /** DER certificate */ + OH_NetStack_CERT_TYPE_DER = 1, + /** Invalid certificate */ + OH_NetStack_CERT_TYPE_MAX +}; + +/** + * @brief Defines the certificate data structure. + * + * @since 11 + * @version 1.0 + */ +struct OH_NetStack_CertBlob { + /** Certificate type */ + enum OH_NetStack_CertType type; + /** Certificate content length */ + uint32_t size; + /** Certificate content */ + uint8_t *data; +}; + +#ifdef __cplusplus +} +#endif + +#endif // NET_SSL_C_TYPE_H diff --git a/network/netssl/libnet_ssl_c.json b/network/netssl/libnet_ssl_c.json new file mode 100644 index 000000000..6eaf7bee2 --- /dev/null +++ b/network/netssl/libnet_ssl_c.json @@ -0,0 +1,6 @@ +[ + { + "first_introdeced":"11", + "name": "OH_NetStack_VerifyCertification" + } +] -- Gitee From 53869fb7ed25d874b65aeecdd1cb5d97a2f4444b Mon Sep 17 00:00:00 2001 From: liuxiyao223 Date: Sat, 18 Nov 2023 18:00:20 +0800 Subject: [PATCH 02/13] modify copyright Signed-off-by: liuxiyao223 --- network/netssl/BUILD.gn | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/network/netssl/BUILD.gn b/network/netssl/BUILD.gn index b6ac21a8b..90a7b3882 100644 --- a/network/netssl/BUILD.gn +++ b/network/netssl/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -29,36 +29,3 @@ ohos_ndk_headers("net_ssl_header") { "./include/net_ssl_c_type.h", ] } - -ohos_shared_library("net_ssl_ndk") { - output_name = "net_ssl" - output_extension = "so" - include_dirs = [ - "//foundation/communication/netstack/interfaces/kits/c/net_ssl/include", - "//foundation/communication/netstack/interfaces/innerkits/net_ssl/include", - "//foundation/communication/netstack/frameworks/native/net_ssl/include" - ] - - sources = [ - "src/net_ssl_c.cpp", - ] - - deps = [ - "//foundation/communication/netstack/interfaces/innerkits/net_ssl:net_ssl", - "$THIRD_PARTY_ROOT/openssl:libssl_shared", - "$THIRD_PARTY_ROOT/openssl:libcrypto_shared", - ] - - external_deps = [ - "hilog:libhilog", - "ipc:ipc_core", - ] - - cflags_cc = [ - "-Wall", - "-Werror", - ] - - part_name = "netstack" - subsystem_name = "communication" -} \ No newline at end of file -- Gitee From 8366241fd264254c9e0f339b6e27d1ea5568e860 Mon Sep 17 00:00:00 2001 From: liuxiyao223 Date: Mon, 20 Nov 2023 09:48:34 +0800 Subject: [PATCH 03/13] modify spell Signed-off-by: liuxiyao223 --- network/netssl/libnet_ssl_c.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network/netssl/libnet_ssl_c.json b/network/netssl/libnet_ssl_c.json index 6eaf7bee2..2f804be05 100644 --- a/network/netssl/libnet_ssl_c.json +++ b/network/netssl/libnet_ssl_c.json @@ -1,6 +1,6 @@ [ { - "first_introdeced":"11", + "first_introduced":"11", "name": "OH_NetStack_VerifyCertification" } ] -- Gitee From 11f7e0864041b8cc713db02ad9de1fe1b876aa21 Mon Sep 17 00:00:00 2001 From: liuxiyao223 Date: Mon, 20 Nov 2023 11:38:45 +0800 Subject: [PATCH 04/13] modify base on review Signed-off-by: liuxiyao223 --- network/netssl/include/net_ssl_c.h | 4 ++-- network/netssl/include/net_ssl_c_type.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/network/netssl/include/net_ssl_c.h b/network/netssl/include/net_ssl_c.h index 1ffc4c2d5..489637fcd 100644 --- a/network/netssl/include/net_ssl_c.h +++ b/network/netssl/include/net_ssl_c.h @@ -32,7 +32,7 @@ * @brief Defines C APIs for the SSL/TLS certificate chain verification module. * * @library libnet_ssl.so - * @syscap SystemCapability.Communication.Netstack + * @syscap SystemCapability.Communication.NetStack * @since 11 * @version 1.0 */ @@ -49,7 +49,7 @@ extern "C" { * @param cert Certificate to be verified. * @param caCert CA certificate specified by the user. If this parameter is left blank, the preset certificate is used. * @return 0 if success; non-0 otherwise. - * @syscap SystemCapability.Communication.Netstack + * @syscap SystemCapability.Communication.NetStack * @since 11 * @version 1.0 */ diff --git a/network/netssl/include/net_ssl_c_type.h b/network/netssl/include/net_ssl_c_type.h index 35712e651..9b3cc48cd 100644 --- a/network/netssl/include/net_ssl_c_type.h +++ b/network/netssl/include/net_ssl_c_type.h @@ -31,7 +31,7 @@ * @brief Defines the data structures for the C APIs of the SSL/TLS certificate chain verification module. * * @library libnet_ssl.so - * @syscap SystemCapability.Communication.Netstack + * @syscap SystemCapability.Communication.NetStack * @since 11 * @version 1.0 */ -- Gitee From ec93f589946026cdf6d771c7ee77d73d48c868b9 Mon Sep 17 00:00:00 2001 From: liuxiyao223 Date: Tue, 21 Nov 2023 19:46:24 +0800 Subject: [PATCH 05/13] modify interface name Signed-off-by: liuxiyao223 --- network/netssl/BUILD.gn | 8 ++++++-- network/netssl/include/net_ssl_c.h | 21 ++++++++++++++++++--- network/netssl/include/net_ssl_c_type.h | 2 +- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/network/netssl/BUILD.gn b/network/netssl/BUILD.gn index 90a7b3882..9eee58ea6 100644 --- a/network/netssl/BUILD.gn +++ b/network/netssl/BUILD.gn @@ -20,12 +20,16 @@ ohos_ndk_library("libnet_ssl_ndk") { ndk_description_file = "./libnet_ssl_c.json" min_compact_version = "1" system_capability = "SystemCapability.Communication.Netstack" + system_capability_headers = [ + "/include/net_ssl_c.h" , + "/include/net_ssl_c_type.h", + ] } ohos_ndk_headers("net_ssl_header") { dest_dir = "$ndk_headers_out_dir/net_ssl" sources = [ - "./include/net_ssl_c.h", - "./include/net_ssl_c_type.h", + "include/net_ssl_c.h", + "include/net_ssl_c_type.h", ] } diff --git a/network/netssl/include/net_ssl_c.h b/network/netssl/include/net_ssl_c.h index 489637fcd..764e1a837 100644 --- a/network/netssl/include/net_ssl_c.h +++ b/network/netssl/include/net_ssl_c.h @@ -48,13 +48,28 @@ extern "C" { * * @param cert Certificate to be verified. * @param caCert CA certificate specified by the user. If this parameter is left blank, the preset certificate is used. - * @return 0 if success; non-0 otherwise. + * @return 0 - success. + * 2305001 - Unspecified error. + * 2305002 - Unable to get issuer certificate. + * 2305003 - Unable to get certificate revocation list (CRL). + * 2305004 - Unable to decrypt certificate signature. + * 2305005 - Unable to decrypt CRL signature. + * 2305006 - Unable to decode issuer public key. + * 2305007 - Certificate signature failure. + * 2305008 - CRL signature failure. + * 2305009 - Certificate is not yet valid. + * 2305010 - Certificate has expired. + * 2305011 - CRL is not yet valid. + * 2305012 - CRL has expired. + * 2305023 - Certificate has been revoked. + * 2305024 - Invalid certificate authority (CA). + * 2305027 - Certificate is untrusted. * @syscap SystemCapability.Communication.NetStack * @since 11 * @version 1.0 */ -uint32_t OH_NetStack_VerifyCertification(const struct OH_NetStack_CertBlob *cert, - const struct OH_NetStack_CertBlob *caCert); +uint32_t OH_NetStack_CertVerification(const struct OH_NetStack_CertBlob *cert, + const struct OH_NetStack_CertBlob *caCert); #ifdef __cplusplus } #endif diff --git a/network/netssl/include/net_ssl_c_type.h b/network/netssl/include/net_ssl_c_type.h index 9b3cc48cd..813c0c788 100644 --- a/network/netssl/include/net_ssl_c_type.h +++ b/network/netssl/include/net_ssl_c_type.h @@ -54,7 +54,7 @@ enum OH_NetStack_CertType { /** DER certificate */ OH_NetStack_CERT_TYPE_DER = 1, /** Invalid certificate */ - OH_NetStack_CERT_TYPE_MAX + OH_NetStack_CERT_TYPE_INVALID }; /** -- Gitee From 6645be883be3f4dee871531cf8d43011b0c696cd Mon Sep 17 00:00:00 2001 From: liuxiyao223 Date: Tue, 21 Nov 2023 20:04:51 +0800 Subject: [PATCH 06/13] modify format Signed-off-by: liuxiyao223 --- network/netssl/BUILD.gn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network/netssl/BUILD.gn b/network/netssl/BUILD.gn index 9eee58ea6..b6ba72adc 100644 --- a/network/netssl/BUILD.gn +++ b/network/netssl/BUILD.gn @@ -20,8 +20,8 @@ ohos_ndk_library("libnet_ssl_ndk") { ndk_description_file = "./libnet_ssl_c.json" min_compact_version = "1" system_capability = "SystemCapability.Communication.Netstack" - system_capability_headers = [ - "/include/net_ssl_c.h" , + system_capability_headers = [ + "/include/net_ssl_c.h", "/include/net_ssl_c_type.h", ] } -- Gitee From a8ec4ab655ed5349fe16ed74114e03144f4bacd0 Mon Sep 17 00:00:00 2001 From: liuxiyao223 Date: Tue, 21 Nov 2023 20:54:55 +0800 Subject: [PATCH 07/13] modify Signed-off-by: liuxiyao223 --- network/netssl/libnet_ssl_c.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network/netssl/libnet_ssl_c.json b/network/netssl/libnet_ssl_c.json index 2f804be05..bd17ed3fb 100644 --- a/network/netssl/libnet_ssl_c.json +++ b/network/netssl/libnet_ssl_c.json @@ -1,6 +1,6 @@ [ { "first_introduced":"11", - "name": "OH_NetStack_VerifyCertification" + "name": "OH_NetStack_CertVerification" } ] -- Gitee From 4d0866856f5d22600caf02e0e5a92905dabbb030 Mon Sep 17 00:00:00 2001 From: liuxiyao223 Date: Wed, 22 Nov 2023 10:49:05 +0800 Subject: [PATCH 08/13] modify Signed-off-by: liuxiyao223 --- network/netssl/include/net_ssl_c.h | 32 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/network/netssl/include/net_ssl_c.h b/network/netssl/include/net_ssl_c.h index 764e1a837..ca32dff29 100644 --- a/network/netssl/include/net_ssl_c.h +++ b/network/netssl/include/net_ssl_c.h @@ -48,22 +48,22 @@ extern "C" { * * @param cert Certificate to be verified. * @param caCert CA certificate specified by the user. If this parameter is left blank, the preset certificate is used. - * @return 0 - success. - * 2305001 - Unspecified error. - * 2305002 - Unable to get issuer certificate. - * 2305003 - Unable to get certificate revocation list (CRL). - * 2305004 - Unable to decrypt certificate signature. - * 2305005 - Unable to decrypt CRL signature. - * 2305006 - Unable to decode issuer public key. - * 2305007 - Certificate signature failure. - * 2305008 - CRL signature failure. - * 2305009 - Certificate is not yet valid. - * 2305010 - Certificate has expired. - * 2305011 - CRL is not yet valid. - * 2305012 - CRL has expired. - * 2305023 - Certificate has been revoked. - * 2305024 - Invalid certificate authority (CA). - * 2305027 - Certificate is untrusted. + * @return 0 - success. + * 2305001 - Unspecified error. + * 2305002 - Unable to get issuer certificate. + * 2305003 - Unable to get certificate revocation list (CRL). + * 2305004 - Unable to decrypt certificate signature. + * 2305005 - Unable to decrypt CRL signature. + * 2305006 - Unable to decode issuer public key. + * 2305007 - Certificate signature failure. + * 2305008 - CRL signature failure. + * 2305009 - Certificate is not yet valid. + * 2305010 - Certificate has expired. + * 2305011 - CRL is not yet valid. + * 2305012 - CRL has expired. + * 2305023 - Certificate has been revoked. + * 2305024 - Invalid certificate authority (CA). + * 2305027 - Certificate is untrusted. * @syscap SystemCapability.Communication.NetStack * @since 11 * @version 1.0 -- Gitee From 7d7fd7eef64b5a1fceb9dc9efb53198b5bfc425b Mon Sep 17 00:00:00 2001 From: liuxiyao223 Date: Wed, 22 Nov 2023 11:44:49 +0800 Subject: [PATCH 09/13] modify Signed-off-by: liuxiyao223 --- network/netssl/include/net_ssl_c.h | 32 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/network/netssl/include/net_ssl_c.h b/network/netssl/include/net_ssl_c.h index ca32dff29..764e1a837 100644 --- a/network/netssl/include/net_ssl_c.h +++ b/network/netssl/include/net_ssl_c.h @@ -48,22 +48,22 @@ extern "C" { * * @param cert Certificate to be verified. * @param caCert CA certificate specified by the user. If this parameter is left blank, the preset certificate is used. - * @return 0 - success. - * 2305001 - Unspecified error. - * 2305002 - Unable to get issuer certificate. - * 2305003 - Unable to get certificate revocation list (CRL). - * 2305004 - Unable to decrypt certificate signature. - * 2305005 - Unable to decrypt CRL signature. - * 2305006 - Unable to decode issuer public key. - * 2305007 - Certificate signature failure. - * 2305008 - CRL signature failure. - * 2305009 - Certificate is not yet valid. - * 2305010 - Certificate has expired. - * 2305011 - CRL is not yet valid. - * 2305012 - CRL has expired. - * 2305023 - Certificate has been revoked. - * 2305024 - Invalid certificate authority (CA). - * 2305027 - Certificate is untrusted. + * @return 0 - success. + * 2305001 - Unspecified error. + * 2305002 - Unable to get issuer certificate. + * 2305003 - Unable to get certificate revocation list (CRL). + * 2305004 - Unable to decrypt certificate signature. + * 2305005 - Unable to decrypt CRL signature. + * 2305006 - Unable to decode issuer public key. + * 2305007 - Certificate signature failure. + * 2305008 - CRL signature failure. + * 2305009 - Certificate is not yet valid. + * 2305010 - Certificate has expired. + * 2305011 - CRL is not yet valid. + * 2305012 - CRL has expired. + * 2305023 - Certificate has been revoked. + * 2305024 - Invalid certificate authority (CA). + * 2305027 - Certificate is untrusted. * @syscap SystemCapability.Communication.NetStack * @since 11 * @version 1.0 -- Gitee From 3ea5ecc588d339cfe34f5e945a478440b27fe19c Mon Sep 17 00:00:00 2001 From: liuxiyao223 Date: Mon, 27 Nov 2023 17:09:19 +0800 Subject: [PATCH 10/13] rename Signed-off-by: liuxiyao223 --- network/netssl/include/net_ssl_c.h | 4 ++-- network/netssl/include/net_ssl_c_type.h | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/network/netssl/include/net_ssl_c.h b/network/netssl/include/net_ssl_c.h index 764e1a837..7c615c4a3 100644 --- a/network/netssl/include/net_ssl_c.h +++ b/network/netssl/include/net_ssl_c.h @@ -68,8 +68,8 @@ extern "C" { * @since 11 * @version 1.0 */ -uint32_t OH_NetStack_CertVerification(const struct OH_NetStack_CertBlob *cert, - const struct OH_NetStack_CertBlob *caCert); +uint32_t OH_NetStack_CertVerification(const struct NetStack_CertBlob *cert, + const struct NetStack_CertBlob *caCert); #ifdef __cplusplus } #endif diff --git a/network/netssl/include/net_ssl_c_type.h b/network/netssl/include/net_ssl_c_type.h index 813c0c788..d464e4e73 100644 --- a/network/netssl/include/net_ssl_c_type.h +++ b/network/netssl/include/net_ssl_c_type.h @@ -48,13 +48,13 @@ extern "C" { * @since 11 * @version 1.0 */ -enum OH_NetStack_CertType { +enum NetStack_CertType { /** PEM certificate */ - OH_NetStack_CERT_TYPE_PEM = 0, + NetStack_CERT_TYPE_PEM = 0, /** DER certificate */ - OH_NetStack_CERT_TYPE_DER = 1, + NetStack_CERT_TYPE_DER = 1, /** Invalid certificate */ - OH_NetStack_CERT_TYPE_INVALID + NetStack_CERT_TYPE_INVALID }; /** @@ -63,9 +63,9 @@ enum OH_NetStack_CertType { * @since 11 * @version 1.0 */ -struct OH_NetStack_CertBlob { +struct NetStack_CertBlob { /** Certificate type */ - enum OH_NetStack_CertType type; + enum NetStack_CertType type; /** Certificate content length */ uint32_t size; /** Certificate content */ -- Gitee From 17b942816ea68c5a4f912c00e41728d011cfe15c Mon Sep 17 00:00:00 2001 From: liuxiyao223 Date: Tue, 28 Nov 2023 20:08:31 +0800 Subject: [PATCH 11/13] modify base on review Signed-off-by: liuxiyao223 --- network/netssl/BUILD.gn | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/network/netssl/BUILD.gn b/network/netssl/BUILD.gn index b6ba72adc..dc91d3101 100644 --- a/network/netssl/BUILD.gn +++ b/network/netssl/BUILD.gn @@ -21,15 +21,15 @@ ohos_ndk_library("libnet_ssl_ndk") { min_compact_version = "1" system_capability = "SystemCapability.Communication.Netstack" system_capability_headers = [ - "/include/net_ssl_c.h", - "/include/net_ssl_c_type.h", + "network/netstack/net_ssl/net_ssl_c.h", + "network/netstack/net_ssl/net_ssl_c_type.h", ] } ohos_ndk_headers("net_ssl_header") { - dest_dir = "$ndk_headers_out_dir/net_ssl" + dest_dir = "$ndk_headers_out_dir/network/netstack/net_ssl" sources = [ - "include/net_ssl_c.h", - "include/net_ssl_c_type.h", + "./include/net_ssl_c.h", + "./include/net_ssl_c_type.h", ] } -- Gitee From a9203c91f4af021d7ff5a177b99f193661d87126 Mon Sep 17 00:00:00 2001 From: liuxiyao223 Date: Tue, 28 Nov 2023 21:15:24 +0800 Subject: [PATCH 12/13] modify format Signed-off-by: liuxiyao223 --- network/netssl/include/net_ssl_c.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/network/netssl/include/net_ssl_c.h b/network/netssl/include/net_ssl_c.h index 7c615c4a3..e83abac61 100644 --- a/network/netssl/include/net_ssl_c.h +++ b/network/netssl/include/net_ssl_c.h @@ -68,8 +68,7 @@ extern "C" { * @since 11 * @version 1.0 */ -uint32_t OH_NetStack_CertVerification(const struct NetStack_CertBlob *cert, - const struct NetStack_CertBlob *caCert); +uint32_t OH_NetStack_CertVerification(const struct NetStack_CertBlob *cert, const struct NetStack_CertBlob *caCert); #ifdef __cplusplus } #endif -- Gitee From 41e877d7872e267b7482b45f2ecd805d8ca2c833 Mon Sep 17 00:00:00 2001 From: liuxiyao223 Date: Wed, 29 Nov 2023 14:26:59 +0800 Subject: [PATCH 13/13] modify format Signed-off-by: liuxiyao223 --- network/netssl/BUILD.gn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network/netssl/BUILD.gn b/network/netssl/BUILD.gn index dc91d3101..58a1757d4 100644 --- a/network/netssl/BUILD.gn +++ b/network/netssl/BUILD.gn @@ -29,7 +29,7 @@ ohos_ndk_library("libnet_ssl_ndk") { ohos_ndk_headers("net_ssl_header") { dest_dir = "$ndk_headers_out_dir/network/netstack/net_ssl" sources = [ - "./include/net_ssl_c.h", - "./include/net_ssl_c_type.h", + "include/net_ssl_c.h", + "include/net_ssl_c_type.h", ] } -- Gitee