00. 目录

01. OpenSSL概述

在这里插入图片描述

OpenSSL是一款开源的安全套接字层(SSL)和加密套接字层(TLS)库,它可以为互联网通信、邮件、文件传输和其他应用程序提供安全保护。它支持多种加密算法,包括对称和非对称加密,并且可以在各种操作系统和硬件平台上运行。OpenSSL由全球各地的开发者和组织共同维护和开发,是目前最流行的SSL和TLS库之一。

OpenSSL主要由以下几个部分组成:

  • 命令行工具:openssl命令行工具可以用于生成证书、密钥、TLS连接和其他安全操作。
  • 库文件:openssl库文件包含了OpenSSL的主要功能,可以在程序中直接使用。
  • 编译器和框架:openssl使用的编译器和框架可以根据需要进行配置。
  • 扩展模块:openssl还提供了许多扩展模块,可以增强其功能和性能。

OpenSSL的主要用途包括:

  • 安全的邮件和文件传输
  • 安全的网络会话和协议
  • 数字签名和身份验证
  • 加密和解密数据

02. OpenSSL下载

官网:https://www.openssl.org/source/

03. OpenSSL移植

3.1 解压openssl-1.1.1d.tar.gz

deng@local:~/iot$ tar -xzvf openssl-1.1.1d.tar.gz 

3.2 cd到openssl目录

deng@local:~/iot$ cd openssl-1.1.1d/
deng@local:~/iot/openssl-1.1.1d$ 

3.3 生成Makefile文件

deng@local:~/iot/openssl-1.1.1d$ ./config no-asm shared CROSS_COMPILE=arm-linux- --prefix=/home/deng/openssl --openssldir=/home/deng/openssl/ssl
Operating system: x86_64-whatever-linux2
Configuring OpenSSL version 1.1.1d (0x1010104fL) for linux-x86_64
Using os-specific seed configuration
Creating configdata.pm
Creating Makefile

**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   'Troubleshooting' section in the INSTALL file first)         ***
***                                                                ***
**********************************************************************

相关参数描述:

其中“prefix”是安装目录,“openssldir”是配置文件目录,“shared”作用是生成动态链接库(即.so库) 。

CROSS_COMPILE指定交叉编译器的前缀

如果编译有问题,配置命令加上no-asm(表示不使用汇编代码),no-asm是在交叉编译过程中不使用汇编代码加速编译过程,原因是它的汇编代码对arm平台不支持。

3.4 打开Makefile文件,删除所有-m64选项

咱们的arm-linux-gcc 是32位的

3.5 查看是否有依赖找不到

deng@local:~/iot/openssl-1.1.1d$ make depend
deng@local:~/iot/openssl-1.1.1d$ 

3.5 执行make命令,编译openssl

deng@local:~/iot/openssl-1.1.1d$ make 

3.6 安装

deng@local:~/iot/openssl-1.1.1d$ make install

04. OpenSSL问题讨论

05. 附录

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐