mbed TLS 简明教程(一)

概述

mbed tls库的设计可以轻松地与现有(嵌入式)应用程序集成,并为安全通讯、密码学和密钥管理提供构建模块.本教程将帮助你了解如何执行这些步骤.

mbed tls 被设计成尽可能松散耦合,让你只需要整合你需要的部分,而不需要关注其余部分.这也为mbed tls 带来了非常低内存占用和构建足迹.通过消除你系统中不需要的部分,你可以将构建版本从低至45kB的版本升级到更典型的300kB版本,以实现更加全面的功能.

mbed tls 被设计成以嵌入式环境作为主要目标的便携式C语言,运行在像ARM和AVR到PCS和iPad,iphones甚至是xbox这样的嵌入式平台上.

堆栈解释(Stack explanation)

本教程的目的是向你展示如何确保你的客户端和服务端与mbed tls的通信.让我们开始展示所涉及的主要组件. 
mbedtls-stack.png

从下往上:

  • 硬件(Hardware)

硬件平台提供物理处理器,存储器,内存和网络接口

  • 操作系统(Operating System) 
    操作系统提供以太网驱动程序和标准服务.这取决于操作系统,包括调度,线程安全,和一个完整的网络堆栈.

  • 网络堆栈(Network Stack) 
    取决于操作系统,网络堆栈要么完全集成,要么是一个单独的模块,从网络接口提供抽象层.最常用的是 lwIP TCP/IP stack和 uIP TCP/IP stack.

  • mbed TLS SSL/TLS Library 
    建立在网络接口之上, mbed tls 为安全通信提供了一个抽象层.

  • 客户端应用(Client Application) 
    客户端应用程序使用mbed tls 本身抽象安全通信.

将mbed tls 集成到应用程序的确切步骤非常依赖与上面特定组件.在基本教程中,我们将假设一个集成了BSD-like TCP/IP 堆栈的操作系统

SSL/TLS 说明

mbed tls的ssl/tls部分提供了使用ssl/tls通过安全通信通道建立和通信方法.

  • 其基本规定是: 
    • 初始化一个SSL/TLS context
    • 执行一个SSL/TLS握手(handshake)
    • 发送/接收数据
    • 通知对方一个连接正在关闭
  • 一个通道很多方面都是通过参数和回调函数来设置的. 
    • 端点角色(endpoint role),客户端和服务器 
    • 身份验证模式: 是否应该进行证书验证
    • 主机到主机通信通道: 发送和接收功能
    • 随机数生成器(RNG)功能
    • 用于加密/解密的密码
    • 证书验证功能
    • 会话控制: 会话获取和设置功能
    • 证书处理和密钥交换的X.509参数 

mbed 通过创建一个SSL/TLS服务器和客户端,通过提供一个框架来建立和通过SSL/TLS通信通道进行通信.SSL/TLS部分直接依赖于库的证书解析,对称和非对称和哈希模块.

参考

 

 

from: https://blog.csdn.net/z2066411585/article/details/79178325

INTRODUCTION lwIP is a small independent implementation of the TCP/IP protocol suite. The focus of the lwIP TCP/IP implementation is to reduce the RAM usage while still having a full scale TCP. This making lwIP suitable for use in embedded systems with tens of kilobytes of free RAM and room for around 40 kilobytes of code ROM. lwIP was originally developed by Adam Dunkels at the Computer and Networks Architectures (CNA) lab at the Swedish Institute of Computer Science (SICS) and is now developed and maintained by a worldwide network of developers. FEATURES * IP (Internet Protocol, IPv4 and IPv6) including packet forwarding over multiple network interfaces * ICMP (Internet Control Message Protocol) for network maintenance and debugging * IGMP (Internet Group Management Protocol) for multicast traffic management * MLD (Multicast listener discovery for IPv6). Aims to be compliant with RFC 2710. No support for MLDv2 * ND (Neighbor discovery and stateless address autoconfiguration for IPv6). Aims to be compliant with RFC 4861 (Neighbor discovery) and RFC 4862 (Address autoconfiguration) * DHCP, AutoIP/APIPA (Zeroconf), ACD (Address Conflict Detection) and (stateless) DHCPv6 * UDP (User Datagram Protocol) including experimental UDP-lite extensions * TCP (Transmission Control Protocol) with congestion control, RTT estimation fast recovery/fast retransmit and sending SACKs * raw/native API for enhanced performance * Optional Berkeley-like socket API * TLS: optional layered TCP ("altcp") for nearly transparent TLS for any TCP-based protocol (ported to mbedTLS) (see changelog for more info) * PPPoS and PPPoE (Point-to-point protocol over Serial/Ethernet) * DNS (Domain name resolver incl. mDNS) * 6LoWPAN (via IEEE 802.15.4, BLE or ZEP) APPLICATIONS * HTTP server with SSI and CGI (HTTPS via altcp) * SNMPv2c agent with MIB compiler (Simple Network Management Protocol), v3 via altcp * SNTP (Simple network time protocol) * NetBIOS name service responder * MDNS (Multicast DNS) responder * iPerf server implementation * MQTT client (TLS support via altcp) LICENSE lwIP is freely available under a BSD license. DEVELOPMENT lwIP has grown into an excellent TCP/IP stack for embedded devices, and developers using the stack often submit bug fixes, improvements, and additions to the stack to further increase its usefulness. Development of lwIP is hosted on Savannah, a central point for software development, maintenance and distribution. Everyone can help improve lwIP by use of Savannah's interface, Git and the mailing list. A core team of developers will commit changes to the Git source tree. The lwIP TCP/IP stack is maintained in the 'lwip' Git module and contributions (such as platform ports) are in the 'contrib' Git module. See doc/savannah.txt for details on Git server access for users and developers. The current Git trees are web-browsable: http://git.savannah.gnu.org/cgit/lwip.git http://git.savannah.gnu.org/cgit/lwip/lwip-contrib.git Submit patches and bugs via the lwIP project page: http://savannah.nongnu.org/projects/lwip/ Continuous integration builds (GCC, clang): https://travis-ci.org/lwip-tcpip/lwip DOCUMENTATION Self documentation of the source code is regularly extracted from the current Git sources and is available from this web page: http://www.nongnu.org/lwip/ Also, there are mailing lists you can subscribe at http://savannah.nongnu.org/mail/?group=lwip plus searchable archives: http://lists.nongnu.org/archive/html/lwip-users/ http://lists.nongnu.org/archive/html/lwip-devel/ There is a wiki about lwIP at http://lwip.wikia.com/wiki/LwIP_Wiki You might get questions answered there, but unfortunately, it is not as well maintained as it should be. lwIP was originally written by Adam Dunkels: http://dunkels.com/adam/ Reading Adam's papers, the files in docs/, browsing the source code documentation and browsing the mailing list archives is a good way to become familiar with the design of lwIP. Adam Dunkels Leon Woestenberg
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值