mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-15 22:48:14 +08:00
修改了Web后台的部分界面,增加了HAmqtt中的总电量传感器,后台新增mqtt上报频率设置
This commit is contained in:
132
mico-os/MiCO/security/TLS/mocSSL/mico/mico_ssl.c
Normal file
132
mico-os/MiCO/security/TLS/mocSSL/mico/mico_ssl.c
Normal file
@@ -0,0 +1,132 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file mico_ssl.c
|
||||
* @author William Xu
|
||||
* @version V1.0.0
|
||||
* @date 05-Aug-2018
|
||||
* @brief This file provide the MiCO Socket abstract layer convert functions.
|
||||
******************************************************************************
|
||||
*
|
||||
* UNPUBLISHED PROPRIETARY SOURCE CODE
|
||||
* Copyright (c) 2016 MXCHIP Inc.
|
||||
*
|
||||
* The contents of this file may not be disclosed to third parties, copied or
|
||||
* duplicated in any form, in whole or in part, without the prior written
|
||||
* permission of MXCHIP Corporation.
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "moc_api.h"
|
||||
|
||||
|
||||
/******************************************************
|
||||
* Macros
|
||||
******************************************************/
|
||||
|
||||
/******************************************************
|
||||
* Constants
|
||||
******************************************************/
|
||||
|
||||
/******************************************************
|
||||
* Enumerations
|
||||
******************************************************/
|
||||
|
||||
/******************************************************
|
||||
* Type Definitions
|
||||
******************************************************/
|
||||
|
||||
/******************************************************
|
||||
* Structures
|
||||
******************************************************/
|
||||
|
||||
/******************************************************
|
||||
* Function Declarations
|
||||
******************************************************/
|
||||
|
||||
/******************************************************
|
||||
* Variables Definitions
|
||||
******************************************************/
|
||||
|
||||
extern const mico_api_t *lib_api_p;
|
||||
|
||||
/******************************************************
|
||||
* Function Definitions
|
||||
******************************************************/
|
||||
|
||||
/* SSL */
|
||||
void ssl_set_cert(const char *_cert_pem, const char *private_key_pem)
|
||||
{
|
||||
lib_api_p->ssl_set_cert(_cert_pem, private_key_pem);
|
||||
}
|
||||
|
||||
void* ssl_connect(int fd, int calen, char *ca, int *ssl_errno)
|
||||
{
|
||||
return lib_api_p->ssl_connect(fd, calen, ca, ssl_errno);
|
||||
}
|
||||
|
||||
void* ssl_nonblock_connect(int fd, int calen, char*ca, int *errno, int timeout)
|
||||
{
|
||||
return lib_api_p->ssl_nonblock_connect(fd, calen, ca, errno, timeout);
|
||||
}
|
||||
|
||||
void* ssl_accept(int fd)
|
||||
{
|
||||
return lib_api_p->ssl_accept(fd);
|
||||
}
|
||||
|
||||
int ssl_send(mico_ssl_t ssl, void *data, size_t len)
|
||||
{
|
||||
return lib_api_p->ssl_send(ssl, data, len);
|
||||
}
|
||||
|
||||
int ssl_recv(mico_ssl_t ssl, void *data, size_t len)
|
||||
{
|
||||
return lib_api_p->ssl_recv(ssl, data, len);
|
||||
}
|
||||
|
||||
int ssl_close(mico_ssl_t ssl)
|
||||
{
|
||||
return lib_api_p->ssl_close( ssl);
|
||||
}
|
||||
|
||||
int ssl_socket( mico_ssl_t ssl )
|
||||
{
|
||||
return lib_api_p->ssl_socket( ssl);
|
||||
}
|
||||
|
||||
int ssl_set_loggingcb(ssl_Logging_cb f)
|
||||
{
|
||||
return lib_api_p->ssl_set_loggingcb(f);
|
||||
}
|
||||
|
||||
void ssl_set_client_version( uint8_t version )
|
||||
{
|
||||
lib_api_p->set_ssl_client_version(version);
|
||||
}
|
||||
|
||||
int ssl_pending(void*ssl)
|
||||
{
|
||||
return lib_api_p->ssl_pending(ssl);
|
||||
}
|
||||
|
||||
int ssl_get_error(void* ssl, int ret)
|
||||
{
|
||||
return lib_api_p->ssl_get_error(ssl, ret);
|
||||
}
|
||||
|
||||
void ssl_set_using_nonblock(void* ssl, int nonblock)
|
||||
{
|
||||
lib_api_p->ssl_set_using_nonblock(ssl, nonblock);
|
||||
}
|
||||
|
||||
void ssl_set_client_cert(const char *cert_pem, const char *private_key_pem)
|
||||
{
|
||||
lib_api_p->ssl_set_client_cert(cert_pem, private_key_pem);
|
||||
}
|
||||
|
||||
void* ssl_connect_sni(int fd, int calen, char*ca, char *sni_servername, int *errno)
|
||||
{
|
||||
return lib_api_p->ssl_connect_sni(fd, calen, ca, sni_servername, errno);
|
||||
}
|
||||
|
||||
20
mico-os/MiCO/security/TLS/mocSSL/mocSSL.mk
Normal file
20
mico-os/MiCO/security/TLS/mocSSL/mocSSL.mk
Normal file
@@ -0,0 +1,20 @@
|
||||
#
|
||||
# UNPUBLISHED PROPRIETARY SOURCE CODE
|
||||
# Copyright (c) 2016 MXCHIP Inc.
|
||||
#
|
||||
# The contents of this file may not be disclosed to third parties, copied or
|
||||
# duplicated in any form, in whole or in part, without the prior written
|
||||
# permission of MXCHIP Corporation.
|
||||
#
|
||||
|
||||
NAME := mocSSL
|
||||
|
||||
VERSION := 1.0.0
|
||||
|
||||
$(NAME)_SOURCES := mico/mico_ssl.c
|
||||
|
||||
VALID_OSNS_COMBOS += mocOS-mocIP
|
||||
|
||||
# Define some macros to allow for some specific checks
|
||||
GLOBAL_DEFINES += TLS_SSL_$(NAME)=1
|
||||
GLOBAL_DEFINES += $(NAME)_VERSION=$$(SLASH_QUOTE_START)v$(VERSION)$$(SLASH_QUOTE_END)
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
10
mico-os/MiCO/security/TLS/wolfSSL/High_Security/ReadMe.txt
Normal file
10
mico-os/MiCO/security/TLS/wolfSSL/High_Security/ReadMe.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>SSL<EFBFBD><EFBFBD>֤<EFBFBD>Ŀ⣬<EFBFBD><EFBFBD>ssl<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һЩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD>
|
||||
1<EFBFBD><EFBFBD>֧<EFBFBD><EFBFBD>CRL
|
||||
2<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD>ڽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD>ϵͳʱ<EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>mico_time_get_utc_time_ms<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡϵͳ<EFBFBD><EFBFBD>ʱ<EFBFBD>䣬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤֤<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD>ڡ<EFBFBD>
|
||||
3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>RSA bits<74><73><EFBFBD><EFBFBD>Ϊ2048
|
||||
4<EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤ʱ<EFBFBD>ر<EFBFBD>SHA<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>cipher list<73><74>Ҫ֧<D2AA><D6A7>SHA
|
||||
5<EFBFBD><EFBFBD>TLS 1.2<EFBFBD><EFBFBD>NO_OLD_TLS
|
||||
|
||||
ҪSSLʹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⣬<EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>make<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӣ<EFBFBD>HIGH_SECURITY=1
|
||||
<EFBFBD><EFBFBD><EFBFBD>磺
|
||||
mico make wifi.station@MK3060 HIGH_SECURITY=1
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1
mico-os/MiCO/security/TLS/wolfSSL/wolfSSL.codes
Normal file
1
mico-os/MiCO/security/TLS/wolfSSL/wolfSSL.codes
Normal file
@@ -0,0 +1 @@
|
||||
git@code.aliyun.com:mico_inner_developer/Lib_wolfSSL.git/#09bedbf2d3771b48f90fdbe8e6344b1497f62188
|
||||
27
mico-os/MiCO/security/TLS/wolfSSL/wolfSSL.mk
Normal file
27
mico-os/MiCO/security/TLS/wolfSSL/wolfSSL.mk
Normal file
@@ -0,0 +1,27 @@
|
||||
#
|
||||
# UNPUBLISHED PROPRIETARY SOURCE CODE
|
||||
# Copyright (c) 2016 MXCHIP Inc.
|
||||
#
|
||||
# The contents of this file may not be disclosed to third parties, copied or
|
||||
# duplicated in any form, in whole or in part, without the prior written
|
||||
# permission of MXCHIP Corporation.
|
||||
#
|
||||
|
||||
NAME := Lib_wolfSSL
|
||||
|
||||
|
||||
GLOBAL_INCLUDES += .
|
||||
|
||||
ifneq ($(wildcard $(CURDIR)Lib_wolfSSL.$(HOST_ARCH).$(TOOLCHAIN_NAME).release.a),)
|
||||
ifeq ($(HIGH_SECURITY),1)
|
||||
$(NAME)_PREBUILT_LIBRARY := High_Security/Lib_wolfSSL.$(HOST_ARCH).$(TOOLCHAIN_NAME).release.a
|
||||
else
|
||||
$(NAME)_PREBUILT_LIBRARY := Lib_wolfSSL.$(HOST_ARCH).$(TOOLCHAIN_NAME).release.a
|
||||
endif
|
||||
else
|
||||
# Build from source
|
||||
include $(CURDIR)wolfSSL_src.mk
|
||||
endif
|
||||
|
||||
|
||||
|
||||
71
mico-os/MiCO/security/TLS/wolfSSL/wolfssl_src.mk
Normal file
71
mico-os/MiCO/security/TLS/wolfSSL/wolfssl_src.mk
Normal file
@@ -0,0 +1,71 @@
|
||||
#
|
||||
# UNPUBLISHED PROPRIETARY wolfssl CODE
|
||||
# Copyright (c) 2016 MXCHIP Inc.
|
||||
#
|
||||
# The contents of this file may not be disclosed to third parties, copied or
|
||||
# duplicated in any form, in whole or in part, without the prior written
|
||||
# permission of MXCHIP Corporation.
|
||||
#
|
||||
|
||||
$(NAME)_SOURCES := wolfSSL/wolfcrypt/src/aes.c \
|
||||
wolfSSL/wolfcrypt/src/arc4.c \
|
||||
wolfSSL/wolfcrypt/src/asm.c \
|
||||
wolfSSL/wolfcrypt/src/asn.c \
|
||||
wolfSSL/wolfcrypt/src/blake2b.c \
|
||||
wolfSSL/wolfcrypt/src/camellia.c \
|
||||
wolfSSL/wolfcrypt/src/chacha.c \
|
||||
wolfSSL/wolfcrypt/src/chacha20_poly1305.c \
|
||||
wolfSSL/wolfcrypt/src/coding.c \
|
||||
wolfSSL/wolfcrypt/src/compress.c \
|
||||
wolfSSL/wolfcrypt/src/curve25519.c \
|
||||
wolfSSL/wolfcrypt/src/des3.c \
|
||||
wolfSSL/wolfcrypt/src/dh.c \
|
||||
wolfSSL/wolfcrypt/src/dsa.c \
|
||||
wolfSSL/wolfcrypt/src/ecc.c \
|
||||
wolfSSL/wolfcrypt/src/ecc_fp.c \
|
||||
wolfSSL/wolfcrypt/src/ed25519.c \
|
||||
wolfSSL/wolfcrypt/src/error.c \
|
||||
wolfSSL/wolfcrypt/src/fe_low_mem.c \
|
||||
wolfSSL/wolfcrypt/src/fe_operations.c \
|
||||
wolfSSL/wolfcrypt/src/ge_low_mem.c \
|
||||
wolfSSL/wolfcrypt/src/ge_operations.c \
|
||||
wolfSSL/wolfcrypt/src/hash.c \
|
||||
wolfSSL/wolfcrypt/src/hc128.c \
|
||||
wolfSSL/wolfcrypt/src/hmac.c \
|
||||
wolfSSL/wolfcrypt/src/integer.c \
|
||||
wolfSSL/wolfcrypt/src/logging.c \
|
||||
wolfSSL/wolfcrypt/src/md2.c \
|
||||
wolfSSL/wolfcrypt/src/md4.c \
|
||||
wolfSSL/wolfcrypt/src/md5.c \
|
||||
wolfSSL/wolfcrypt/src/memory.c \
|
||||
wolfSSL/wolfcrypt/src/pkcs7.c \
|
||||
wolfSSL/wolfcrypt/src/poly1305.c \
|
||||
wolfSSL/wolfcrypt/src/pwdbased.c \
|
||||
wolfSSL/wolfcrypt/src/rabbit.c \
|
||||
wolfSSL/wolfcrypt/src/random.c \
|
||||
wolfSSL/wolfcrypt/src/ripemd.c \
|
||||
wolfSSL/wolfcrypt/src/rsa.c \
|
||||
wolfSSL/wolfcrypt/src/sha.c \
|
||||
wolfSSL/wolfcrypt/src/sha256.c \
|
||||
wolfSSL/wolfcrypt/src/sha512.c \
|
||||
wolfSSL/wolfcrypt/src/srp.c \
|
||||
wolfSSL/wolfcrypt/src/tfm.c \
|
||||
wolfSSL/wolfcrypt/src/wc_encrypt.c \
|
||||
wolfSSL/wolfcrypt/src/wc_port.c \
|
||||
wolfSSL/src/crl.c \
|
||||
wolfSSL/src/internal.c \
|
||||
wolfSSL/src/io.c \
|
||||
wolfSSL/src/keys.c \
|
||||
wolfSSL/src/ocsp.c \
|
||||
wolfSSL/src/sniffer.c \
|
||||
wolfSSL/src/ssl.c \
|
||||
wolfSSL/src/tls.c
|
||||
|
||||
$(NAME)_SOURCES += wolfSSL/mico/crypto_wrap.c \
|
||||
wolfSSL/mico/ssl_wrap.c
|
||||
|
||||
$(NAME)_INCLUDES := wolfSSL \
|
||||
wolfSSL/mico
|
||||
|
||||
$(NAME)_DEFINES := WOLFSSL_USER_SETTINGS
|
||||
|
||||
Reference in New Issue
Block a user