openssl介绍


OpenSSL是功能强大的,商业级,功能齐全的工具包,可用于传输层安全性(TLS)和安全套接字(SSL)协议。

由于与很多软件保持依赖关系,所以很多情况需要安装它…


下载地址


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

这里选择最新的tar.gz包


编译过程


#tar -zxvf 解压 后cd
#常用参数,具体还是得根据需求裁剪
./Configure linux-generic32  shared no-asm no-async no-tests no-comp no-cms  no-ec   no-cast no-bf \
no-dsa no-ec2m no-idea no-md2 no-ecdh no-rc5  no-ecdsa no-camellia \
no-rc2 no-mdc2  no-sse2 no-rfc3779  no-srp  \
no-ocsp no-seed no-ssl2 \
--prefix=/armlib/openssl \
CROSS_COMPILE=/opt/vtcs_toolchain/vienna/usr/bin/arm-linux- \
CC=gcc CXX=g++make make install

简单参数说明

no-asm : 不使用汇编程序(do not use assembler).
no-async : 不使用GNU的ucontext库,有些版本的编译器不提供GNU C的ucontext库.
no-tests : 不生成测试额外的测试程序
no-comp : 不建立对SSL / TLS压缩的支持。 如果这个选项启用(默认设置),则压缩只会如果还选择了zlib或zlib-dynamic选项,则可以正常工作。
no-cms : 不建立对CMS功能的支持
no-ec : 不建立对椭圆曲线的支持
no-ec2m : 不支持二进制椭圆曲线
no-arg: 不支持这些算法,aria, bf, blake2, camellia, cast, chacha,
cmac, des, dh, dsa, ecdh, ecdsa, idea, md4, mdc2, ocb,
poly1305, rc2, rc4, rmd160, scrypt, seed, siphash, sm2, sm3,
sm4 or whirlpool. The “ripemd” algorithm is deprecated and
if used is synonymous with rmd160.
no-ocsp : 不建立对OCSP的支持。
no-sse2 : 不建立对sse2的支持。
no-rfc3779 : 不建立对RFC3779(“用于IP的X.509扩展地址和AS标识符”)。
no-srp: 不建立对SRP或基于SRP的密码套件的支持。。
no-ocsp : 不建立对OCSP的支持。
–prefix: 用于OpenSSL安装的前缀,其中包含 ==bin, lib, include, share/man,

share/doc/openssl目录,默认的目录为***/ usr / local==***.
linux-generic32: 表示32位linux系统,如果不指定将默认按64位编译.
CROSS_COMPILE: 表示使用的交叉编译链

完整说明

 Configuration Options---------------------There are several options to ./config (or ./Configure) to customizethe build (note that for Windows, the defaults for --prefix and--openssldir depend in what configuration is used and what Windowsimplementation OpenSSL is built on.  More notes on this in NOTES.WIN):--api=x.y.zDon't build with support for deprecated APIs below thespecified version number. For example "--api=1.1.0" willremove support for all APIS that were deprecated in OpenSSLversion 1.1.0 or below. This is a rather specialized optionfor developers. If you just intend to remove all deprecatedAPIs entirely (up to the current version), it is easierto add the 'no-deprecated' option instead (see below).--cross-compile-prefix=PREFIXThe PREFIX to include in front of commands for yourtoolchain. It's likely to have to end with dash, e.g.a-b-c- would invoke GNU compiler as a-b-c-gcc, etc.Unfortunately cross-compiling is too case-specific toput together one-size-fits-all instructions. You mighthave to pass more flags or set up environment variablesto actually make it work. Android and iOS cases arediscussed in corresponding Configurations/15-*.conffiles. But there are cases when this option alone issufficient. For example to build the mingw64 target onLinux "--cross-compile-prefix=x86_64-w64-mingw32-"works. Naturally provided that mingw packages areinstalled. Today Debian and Ubuntu users have option toinstall a number of prepackaged cross-compilers alongwith corresponding run-time and development packages for"alien" hardware. To give another example"--cross-compile-prefix=mipsel-linux-gnu-" sufficesin such case. Needless to mention that you have toinvoke ./Configure, not ./config, and pass your targetname explicitly. Also, note that --openssldir refersto target's file system, not one you are building on.--debugBuild OpenSSL with debugging symbols and zero optimizationlevel.--libdir=DIRThe name of the directory under the top of the installationdirectory tree (see the --prefix option) where libraries willbe installed. By default this is "lib". Note that on Windowsonly ".lib" files will be stored in this location. dll fileswill always be installed to the "bin" directory.--openssldir=DIRDirectory for OpenSSL configuration files, and also thedefault certificate and key store.  Defaults are:Unix:           /usr/local/sslWindows:        C:\Program Files\Common Files\SSLor C:\Program Files (x86)\Common Files\SSLOpenVMS:        SYS$COMMON:[OPENSSL-COMMON]--prefix=DIRThe top of the installation directory tree.  Defaults are:Unix:           /usr/localWindows:        C:\Program Files\OpenSSLor C:\Program Files (x86)\OpenSSLOpenVMS:        SYS$COMMON:[OPENSSL]--releaseBuild OpenSSL without debugging symbols. This is the default.--strict-warningsThis is a developer flag that switches on various compileroptions recommended for OpenSSL development. It only workswhen using gcc or clang as the compiler. If you aredeveloping a patch for OpenSSL then it is recommended thatyou use this option where possible.--with-zlib-include=DIRThe directory for the location of the zlib include file. Thisoption is only necessary if enable-zlib (see below) is usedand the include file is not already on the system includepath.--with-zlib-lib=LIBOn Unix: this is the directory containing the zlib library.If not provided the system library path will be used.On Windows: this is the filename of the zlib library (with orwithout a path). This flag must be provided if thezlib-dynamic option is not also used. If zlib-dynamic is usedthen this flag is optional and a default value ("ZLIB1") isused if not provided.On VMS: this is the filename of the zlib library (with orwithout a path). This flag is optional and if not providedthen "GNV$LIBZSHR", "GNV$LIBZSHR32" or "GNV$LIBZSHR64" isused by default depending on the pointer size chosen.--with-rand-seed=seed1[,seed2,...]A comma separated list of seeding methods which will be triedby OpenSSL in order to obtain random input (a.k.a "entropy")for seeding its cryptographically secure random numbergenerator (CSPRNG). The current seeding methods are:os:         Use a trusted operating system entropy source.This is the default method if such an entropysource exists.getrandom:  Use the L<getrandom(2)> or equivalent systemcall.devrandom:  Use the first device from the DEVRANDOM listwhich can be opened to read random bytes. TheDEVRANDOM preprocessor constant expands to"/dev/urandom","/dev/random","/dev/srandom" onmost unix-ish operating systems.egd:        Check for an entropy generating daemon.rdcpu:      Use the RDSEED or RDRAND command if provided bythe CPU.librandom:  Use librandom (not implemented yet).none:       Disable automatic seeding. This is the defaulton some operating systems where no suitableentropy source exists, or no support for it isimplemented yet.For more information, see the section 'Note on random numbergeneration' at the end of this document.no-afalgengDon't build the AFALG engine. This option will be forced ifon a platform that does not support AFALG.enable-asanBuild with the Address sanitiser. This is a developer optiononly. It may not work on all platforms and should never beused in production environments. It will only work when usedwith gcc or clang and should be used in conjunction with theno-shared option.no-asmDo not use assembler code. This should be viewed asdebugging/trouble-shooting option rather than production.On some platforms a small amount of assembler code maystill be used even with this option.no-asyncDo not build support for async operations.no-autoalginitDon't automatically load all supported ciphers and digests.Typically OpenSSL will make available all of its supportedciphers and digests. For a statically linked application thismay be undesirable if small executable size is an objective.This only affects libcrypto. Ciphers and digests will have tobe loaded manually using EVP_add_cipher() andEVP_add_digest() if this option is used. This option willforce a non-shared build.no-autoerrinitDon't automatically load all libcrypto/libssl error strings.Typically OpenSSL will automatically load human readableerror strings. For a statically linked application this maybe undesirable if small executable size is an objective.no-autoload-configDon't automatically load the default openssl.cnf file.Typically OpenSSL will automatically load a system configfile which configures default ssl options.enable-buildtest-c++While testing, generate C++ buildtest files thatsimply check that the public OpenSSL header filesare usable standalone with C++.Enabling this option demands extra care.  For anycompiler flag given directly as configurationoption, you must ensure that it's valid for boththe C and the C++ compiler.  If not, the C++ buildtest will most likely break.  As an alternative,you can use the language specific variables, CFLAGSand CXXFLAGS.no-capiengDon't build the CAPI engine. This option will be forced ifon a platform that does not support CAPI.no-cmsDon't build support for CMS featuresno-compDon't build support for SSL/TLS compression. If this optionis left enabled (the default), then compression will onlywork if the zlib or zlib-dynamic options are also chosen.enable-crypto-mdebugBuild support for debugging memory allocated viaOPENSSL_malloc() or OPENSSL_zalloc().enable-crypto-mdebug-backtraceAs for crypto-mdebug, but additionally provide backtraceinformation for allocated memory.TO BE USED WITH CARE: this uses GNU C functionality, andis therefore not usable for non-GNU config targets.  Ifyour build complains about the use of '-rdynamic' or thelack of header file execinfo.h, this option is not for you.ALSO NOTE that even though execinfo.h is available on yoursystem (through Gnulib), the functions might just be stubsthat do nothing.no-ctDon't build support for Certificate Transparency.no-deprecatedDon't build with support for any deprecated APIs. This is thesame as using "--api" and supplying the latest versionnumber.no-dgramDon't build support for datagram based BIOs. Selecting thisoption will also force the disabling of DTLS.no-dsoDon't build support for loading Dynamic Shared Objects.enable-devcryptoengBuild the /dev/crypto engine.  It is automatically selectedon BSD implementations, in which case it can be disabled withno-devcryptoeng.no-dynamic-engineDon't build the dynamically loaded engines. This only has aneffect in a "shared" buildno-ecDon't build support for Elliptic Curves.no-ec2mDon't build support for binary Elliptic Curvesenable-ec_nistp_64_gcc_128Enable support for optimised implementations of some commonlyused NIST elliptic curves.This is only supported on platforms:- with little-endian storage of non-byte types- that tolerate misaligned memory references- where the compiler:- supports the non-standard type __uint128_t- defines the built-in macro __SIZEOF_INT128__enable-egdBuild support for gathering entropy from EGD (EntropyGathering Daemon).no-engineDon't build support for loading engines.no-errDon't compile in any error strings.enable-external-testsEnable building of integration with external test suites.This is a developer option and may not work on all platforms.The only supported external test suite at the current time isthe BoringSSL test suite. See the file test/README.externalfor further details.no-filenamesDon't compile in filename and line number information (e.g.for errors and memory allocation).enable-fuzz-libfuzzer, enable-fuzz-aflBuild with support for fuzzing using either libfuzzer or AFL.These are developer options only. They may not work on allplatforms and should never be used in production environments.See the file fuzz/README.md for further details.no-gostDon't build support for GOST based ciphersuites. Note thatif this feature is enabled then GOST ciphersuites are onlyavailable if the GOST algorithms are also available throughloading an externally supplied engine.no-hw-padlockDon't build the padlock engine.no-makedependDon't generate dependencies.no-multiblockDon't build support for writing multiple records in onego in libssl (Note: this is a different capability to thepipelining functionality).no-nextprotonegDon't build support for the NPN TLS extension.no-ocspDon't build support for OCSP.no-picDon't build with support for Position Independent Code.no-pinshared     By default OpenSSL will attempt to stay in memory until theprocess exits. This is so that libcrypto and libssl can beproperly cleaned up automatically via an "atexit()" handler.The handler is registered by libcrypto and cleans up bothlibraries. On some platforms the atexit() handler will run onunload of libcrypto (if it has been dynamically loaded)rather than at process exit. This option can be used to stopOpenSSL from attempting to stay in memory until the processexits. This could lead to crashes if either libcrypto orlibssl have already been unloaded at the pointthat the atexit handler is invoked, e.g. on a platform whichcalls atexit() on unload of the library, and libssl isunloaded before libcrypto then a crash is likely to happen.Applications can suppress running of the atexit() handler atrun time by using the OPENSSL_INIT_NO_ATEXIT option toOPENSSL_init_crypto(). See the man page for it for furtherdetails.no-posix-ioDon't use POSIX IO capabilities.no-pskDon't build support for Pre-Shared Key based ciphersuites.no-rdrandDon't use hardware RDRAND capabilities.no-rfc3779Don't build support for RFC3779 ("X.509 Extensions for IPAddresses and AS Identifiers")sctpBuild support for SCTPno-sharedDo not create shared libraries, only static ones.  See "Noteon shared libraries" below.no-sockDon't build support for socket BIOsno-srpDon't build support for SRP or SRP based ciphersuites.no-srtpDon't build SRTP supportno-sse2Exclude SSE2 code paths from 32-bit x86 assembly modules.Normally SSE2 extension is detected at run-time, but thedecision whether or not the machine code will be executedis taken solely on CPU capability vector. This means thatif you happen to run OS kernel which does not support SSE2extension on Intel P4 processor, then your applicationmight be exposed to "illegal instruction" exception.There might be a way to enable support in kernel, e.g.FreeBSD kernel can  be compiled with CPU_ENABLE_SSE, andthere is a way to disengage SSE2 code paths upon applicationstart-up, but if you aim for wider "audience" runningsuch kernel, consider no-sse2. Both the 386 andno-asm options imply no-sse2.enable-ssl-traceBuild with the SSL Trace capabilities (adds the "-trace"option to s_client and s_server).no-static-engineDon't build the statically linked engines. This onlyhas an impact when not built "shared".no-stdioDon't use anything from the C header file "stdio.h" thatmakes use of the "FILE" type. Only libcrypto and libssl canbe built in this way. Using this option will suppressbuilding the command line applications. Additionally sincethe OpenSSL tests also use the command line applications thetests will also be skipped.no-testsDon't build test programs or run any test.no-threadsDon't try to build with support for multi-threadedapplications.threadsBuild with support for multi-threaded applications. Mostplatforms will enable this by default. However if on aplatform where this is not the case then this will usuallyrequire additional system-dependent options! See "Note onmulti-threading" below.no-tsDon't build Time Stamping Authority support.enable-ubsanBuild with the Undefined Behaviour sanitiser. This is adeveloper option only. It may not work on all platforms andshould never be used in production environments. It will onlywork when used with gcc or clang and should be used inconjunction with the "-DPEDANTIC" option (or the--strict-warnings option).no-ui-consoleDon't build with the "UI" console method (i.e. the "UI"method that enables text based console prompts).enable-unit-testEnable additional unit test APIs. This should not typicallybe used in production deployments.enable-weak-ssl-ciphersBuild support for SSL/TLS ciphers that are considered "weak"(e.g. RC4 based ciphersuites).zlibBuild with support for zlib compression/decompression.zlib-dynamicLike "zlib", but has OpenSSL load the zlib librarydynamically when needed.  This is only supported on systemswhere loading of shared libraries is supported.386In 32-bit x86 builds, when generating assembly modules,use the 80386 instruction set only (the default x86 codeis more efficient, but requires at least a 486). Note:This doesn't affect code generated by compiler, you'relikely to complement configuration command line withsuitable compiler-specific option.no-<prot>Don't build support for negotiating the specified SSL/TLSprotocol (one of ssl, ssl3, tls, tls1, tls1_1, tls1_2,tls1_3, dtls, dtls1 or dtls1_2). If "no-tls" is selected thenall of tls1, tls1_1, tls1_2 and tls1_3 are disabled.Similarly "no-dtls" will disable dtls1 and dtls1_2. The"no-ssl" option is synonymous with "no-ssl3". Note this onlyaffects version negotiation. OpenSSL will still provide themethods for applications to explicitly select the individualprotocol versions.no-<prot>-methodAs for no-<prot> but in addition do not build the methods forapplications to explicitly select individual protocolversions. Note that there is no "no-tls1_3-method" optionbecause there is no application method for TLSv1.3. Usingindividual protocol methods directly is deprecated.Applications should use TLS_method() instead.enable-<alg>Build with support for the specified algorithm, where <alg>is one of: md2 or rc5.no-<alg>Build without support for the specified algorithm, where<alg> is one of: aria, bf, blake2, camellia, cast, chacha,cmac, des, dh, dsa, ecdh, ecdsa, idea, md4, mdc2, ocb,poly1305, rc2, rc4, rmd160, scrypt, seed, siphash, sm2, sm3,sm4 or whirlpool.  The "ripemd" algorithm is deprecated andif used is synonymous with rmd160.-Dxxx, -Ixxx, -Wp, -lxxx, -Lxxx, -Wl, -rpath, -R, -framework, -staticThese system specific options will be recognised andpassed through to the compiler to allow you to definepreprocessor symbols, specify additional libraries, librarydirectories or other compiler options. It might be worthnoting that some compilers generate code specifically forprocessor the compiler currently executes on. This is notnecessarily what you might have in mind, since it might beunsuitable for execution on other, typically older,processor. Consult your compiler documentation.Take note of the VAR=value documentation below and howthese flags interact with those variables.-xxx, +xxx, /xxxAdditional options that are not otherwise recognised arepassed through as they are to the compiler as well.Unix-style options beginning with a '-' or '+' andWindows-style options beginning with a '/' are recognized.Again, consult your compiler documentation.If the option contains arguments separated by spaces,then the URL-style notation %20 can be used for the spacecharacter in order to avoid having to quote the option.For example, -opt%20arg gets expanded to -opt arg.In fact, any ASCII character can be encoded as %xx using itshexadecimal encoding.Take note of the VAR=value documentation below and howthese flags interact with those variables.VAR=valueAssignment of environment variable for Configure.  Thesework just like normal environment variable assignments,but are supported on all platforms and are confined tothe configuration scripts only.  These assignments overridethe corresponding value in the inherited environment, ifthere is one.The following variables are used as "make variables" andcan be used as an alternative to giving preprocessor,compiler and linker options directly as configuration.The following variables are supported:AR              The static library archiver.ARFLAGS         Flags for the static library archiver.AS              The assembler compiler.ASFLAGS         Flags for the assembler compiler.CC              The C compiler.CFLAGS          Flags for the C compiler.CXX             The C++ compiler.CXXFLAGS        Flags for the C++ compiler.CPP             The C/C++ preprocessor.CPPFLAGS        Flags for the C/C++ preprocessor.CPPDEFINES      List of CPP macro definitions, separatedby a platform specific character (':' orspace for Unix, ';' for Windows, ',' forVMS).  This can be used instead of using-D (or what corresponds to that on yourcompiler) in CPPFLAGS.CPPINCLUDES     List of CPP inclusion directories, separatedthe same way as for CPPDEFINES.  This canbe used instead of -I (or what correspondsto that on your compiler) in CPPFLAGS.HASHBANGPERL    Perl invocation to be inserted after '#!'in public perl scripts (only relevant onUnix).LD              The program linker (not used on Unix, $(CC)is used there).LDFLAGS         Flags for the shared library, DSO andprogram linker.LDLIBS          Extra libraries to use when linking.Takes the form of a space separated listof library specifications on Unix andWindows, and as a comma separated list oflibraries on VMS.RANLIB          The library archive indexer.RC              The Windows resource compiler.RCFLAGS         Flags for the Windows resource compiler.RM              The command to remove files and directories.

Linux 裁剪并交叉编译openssl库相关推荐

  1. Linux下openssl库的arm-linux交叉编译

    最近想用openssl库实现AES加解密算法功能,折腾了好几天才解决安装和使用功能. 我的开发环境:ARM和嵌入式Linux系统.交叉编译工具arm-linux-gnueabihf-gcc,我的ope ...

  2. linux交叉编译openssl,交叉编译openssl for linux arm-v5te-linux-gnueabi工具链

    我遇到了同样的问题并写了一本关于如何交叉编译openssl for arm的手册 . 我希望本手册能给你一些想法: 这个过程非常简单 . 在本手册中,我们将给出一个在Ubuntu Linux系统中交叉 ...

  3. 树莓派linux编译不了动态库,linux系统下的树莓派与Qt 5.12.3源码的交叉编译

    {写在前面:按照这个方法,基本可以成功在linux系统下交叉编译Qt5.12.3,其他版本的源码也编译} 我的环境:Linux Mint 19.1;树莓派 3;Qt源码5.12.3 当两个系统全部安装 ...

  4. linux 交叉编译 静态库,从Linux为Windows开发交叉编译静态库

    我想在Linux中为Windows编译静态库.以下是我跟着编译从Linux为Windows开发交叉编译静态库 使用i586-mingw32msvc-cc -c static_lib.c -o stat ...

  5. 单片机c语言 openssl,Linux下C语言使用openssl库进行加密

    在这里插一小节加密的吧,使用openssl库进行加密. 使用MD5加密 我们以一个字符串为例,新建一个文件filename.txt,在文件内写入hello ,然后在Linux下可以使用命令md5sum ...

  6. Linux下C语言使用openssl库进行MD5校验

    http://blog.csdn.net/cassie_huang/article/details/53212933 作者:无脑仔的小明  出处:http://www.cnblogs.com/wuna ...

  7. 更换Qt QtEmbedded库的版本出现问题及解决(交叉编译OpenSSL)

    更换Qt QtEmbedded库的版本出现问题及解决(交叉编译OpenSSL) 参考文章: (1)更换Qt QtEmbedded库的版本出现问题及解决(交叉编译OpenSSL) (2)https:// ...

  8. arm oe linux gnueabi 系统,交叉编译移植openssl

    交叉编译openssl静态库步骤: 1.解压源码 tar xf openssl-1.1.1a.tar.gz 2.进入到解压后的源码目录 cd openssl-1.1.1a/ 3.配置Makefile ...

  9. Windows下编译openssl库

    1.概述 OpenSSL是一个开放源代码的软件库包,它实现了 SSL(Secure SocketLayer)和 TLS(Transport Layer Security)协议,所以应用程序可以使用这个 ...

最新文章

  1. 一文读懂 RoIPooling、RoIAlign 和 RoIWarp
  2. python3连接mysql_第七篇:Python3连接MySQL
  3. 设计模式原则总结--读《大话设计模式》有感 转
  4. Spring Boot + Mybatis 快速整合
  5. 【Flink】Flink 介绍Flink中 Timer 的使用
  6. UI设计素材模板|游戏APP界面
  7. 数据增强 | 现实应用思考
  8. oracle 获得表字段名,注释等的sql语句 .
  9. java list判断是否存在字符串_java怎么判断字符串是否存在于list集合中?
  10. 图形大小_光伏电池正面图形设计优化
  11. 【Python】pip超详细教程,pip的安装与使用,解决pip下载速度慢的问题
  12. 计算机网络课程设计(一)--- VLAN划分和动静态基础配置及其思考
  13. 在虚拟机安装windows xp时所需要的序列号
  14. 【STM32H7的DSP教程】第5章 Matlab简易使用之常用编程语句
  15. 调用情迁机器人发送微信或者QQ消息等即时通讯消息
  16. 置换贴图,法线贴图和凹凸贴图详解
  17. 神经网络学习小记录64——Pytorch 图像处理中注意力机制的解析与代码详解
  18. 学习 PixiJS — 动画精灵
  19. rpg服务器无限刷金币bug,魔兽世界怀旧服:邮箱交易BUG无限刷金币?小号回档一次1000金!...
  20. Codeforces 1250 G Discarding Game —— 贪心

热门文章

  1. 【Easyexcel】根据模板导出excel
  2. PWM整流器仿真模型 单位功率因数 matlab simulink
  3. 抓包工具Charles+fiddler使用方法(一)自用
  4. 郁金香delphi外挂编程(翻录版) 种子发布
  5. AXI协议详解(9)-数据总线
  6. zoj3598----球面三角形内角
  7. Flash版(迷你音乐播放器mp3Player1.0 Beta1 )附源码
  8. ospf:简介+功能配置1(Cisco系)
  9. RAMDISK 内存盘工具推荐
  10. 利用chrom 截长图