Name Date Size

..22-Apr.-20214 KiB

.github/workflows/H26-May-20214 KiB

.gitignoreH A D17-May-20212.8 KiB

apps/H29-Aug.-20174 KiB

appveyor.ymlH A D08-Apr.-20211.4 KiB

autogen.shH A D29-Aug.-2017374

ChangeLogH A D16-Apr.-202171.4 KiB

check-release.shH A D17-Sep.-20171.5 KiB

cmake_export_symbol.cmakeH A D18-Mar.-20182.3 KiB

cmake_uninstall.cmake.inH A D29-Aug.-20171,007

CMakeLists.txtH A D21-Jul.-202111.8 KiB

configH A D29-Aug.-2017398

configure.acH A D08-Apr.-20214.5 KiB

crypto/H10-May-20214 KiB

dist-win.shH A D29-Aug.-20171.1 KiB

dist.shH A D17-Sep.-201799

FindLibreSSL.cmakeH A D20-Dec.-20196.2 KiB

gen-coverage-report.shH A D29-Aug.-20171.1 KiB

gen-openbsd-tags.shH A D29-Aug.-2017542

include/H15-Sep.-20204 KiB

libcrypto.pc.inH A D14-Jun.-2021294

libressl.pubH A D09-Apr.-2020131

libssl.pc.inH A D14-Jun.-2021293

libtls.pc.inH A D14-Jun.-2021308

m4/H30-May-20214 KiB

Makefile.amH A D08-Apr.-20211.2 KiB

Makefile.am.commonH A D29-Aug.-2017162

man/H19-Jul.-20214 KiB

OPENBSD_BRANCHH A D29-Aug.-20177

openssl.pc.inH A D29-Aug.-2017248

patches/H08-Apr.-20214 KiB

README.mdH A D30-May-20218.4 KiB

README.windowsH A D29-Aug.-20172.8 KiB

scripts/H30-May-20214 KiB

ssl/H30-May-20214 KiB

tap-driver.shH A D15-Apr.-202119 KiB

tests/H19-Jul.-20214 KiB

tls/H10-May-20214 KiB

update.shH A D08-Apr.-202112 KiB

README.md

1![LibreSSL image](https://www.libressl.org/images/libressl.jpg)
2## Official portable version of [LibreSSL](https://www.libressl.org) ##
3
4[![Linux Build Status](https://github.com/libressl-portable/portable/actions/workflows/linux_test.yml/badge.svg)](https://github.com/libressl-portable/portable/actions/workflows/linux_test.yml)
5[![macOS Build Status](https://github.com/libressl-portable/portable/actions/workflows/macos_test.yml/badge.svg)](https://github.com/libressl-portable/portable/actions/workflows/macos_test.yml)
6[![Android_Build Status](https://github.com/libressl-portable/portable/actions/workflows/android_test.yml/badge.svg)](https://github.com/libressl-portable/portable/actions/workflows/android_test.yml)
7[![Cross_Build Status](https://github.com/libressl-portable/portable/actions/workflows/cross_test.yml/badge.svg)](https://github.com/libressl-portable/portable/actions/workflows/cross_test.yml)
8[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/libressl.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:libressl)
9
10LibreSSL is a fork of [OpenSSL](https://www.openssl.org) 1.0.1g developed by the
11[OpenBSD](https://www.openbsd.org) project.  Our goal is to modernize the codebase,
12improve security, and apply best practice development processes from OpenBSD.
13
14## Compatibility with OpenSSL: ##
15
16LibreSSL is API compatible with OpenSSL 1.0.1, but does not yet include all
17new APIs from OpenSSL 1.0.2 and later. LibreSSL also includes APIs not yet
18present in OpenSSL. The current common API subset is OpenSSL 1.0.1.
19
20LibreSSL is not ABI compatible with any release of OpenSSL, or necessarily
21earlier releases of LibreSSL. You will need to relink your programs to
22LibreSSL in order to use it, just as in moving between major versions of OpenSSL.
23LibreSSL's installed library version numbers are incremented to account for
24ABI and API changes.
25
26## Compatibility with other operating systems: ##
27
28While primarily developed on and taking advantage of APIs available on OpenBSD,
29the LibreSSL portable project attempts to provide working alternatives for
30other operating systems, and assists with improving OS-native implementations
31where possible.
32
33At the time of this writing, LibreSSL is known to build and work on:
34
35* Linux (kernel 3.17 or later recommended)
36* FreeBSD (tested with 9.2 and later)
37* NetBSD (7.0 or later recommended)
38* HP-UX (11i)
39* Solaris (11 and later preferred)
40* Mac OS X (tested with 10.8 and later)
41* AIX (5.3 and later)
42
43LibreSSL also supports the following Windows environments:
44* Microsoft Windows (Windows 7 / Windows Server 2008r2 or later, x86 and x64)
45* Wine (32-bit and 64-bit)
46* Mingw-w64, Cygwin, and Visual Studio
47
48Official release tarballs are available at your friendly neighborhood
49OpenBSD mirror in directory
50[LibreSSL](https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/),
51although we suggest that you use a [mirror](https://www.openbsd.org/ftp.html).
52
53The LibreSSL portable build framework is also
54[mirrored](https://github.com/libressl-portable/portable) in Github.
55
56Please report bugs either to the public libressl@openbsd.org mailing list,
57or to the github
58[issue tracker](https://github.com/libressl-portable/portable/issues)
59
60Severe vulnerabilities or bugs requiring coordination with OpenSSL can be
61sent to the core team at libressl-security@openbsd.org.
62
63# Building LibreSSL #
64
65## Prerequisites when building from a Git checkout ##
66
67If you have checked this source using Git, or have downloaded a source tarball
68from Github, follow these initial steps to prepare the source tree for
69building. _Note: Your build will fail if you do not follow these instructions! If you cannot follow these instructions (e.g. Windows system using CMake) or cannot meet these prerequistes, please download an official release distribution from https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/ instead. Using official releases is strongly advised if you are not a developer._
70
711. Ensure you have the following packages installed:
72   automake, autoconf, git, libtool, perl
732. Run `./autogen.sh` to prepare the source tree for building or
74   run `./dist.sh` to prepare a tarball.
75
76## Steps that apply to all builds ##
77
78Once you have a source tree, either by downloaded using git and having
79run the `autogen.sh` script above, or by downloading a release distribution from
80an OpenBSD mirror, run these commands to build and install the package on most
81systems:
82
83```sh
84./configure   # see ./configure --help for configuration options
85make check    # runs builtin unit tests
86make install  # set DESTDIR= to install to an alternate location
87```
88
89If you wish to use the CMake build system, use these commands:
90
91```sh
92mkdir build
93cd build
94cmake ..
95make
96make test
97```
98
99For faster builds, you can use Ninja as well:
100
101```sh
102mkdir build-ninja
103cd build-ninja
104cmake -G"Ninja" ..
105ninja
106ninja test
107```
108
109### OS specific build information: ###
110
111#### HP-UX (11i) ####
112
113Set the UNIX_STD environment variable to `2003` before running `configure`
114in order to build with the HP C/aC++ compiler. See the "standards(5)" man
115page for more details.
116
117```sh
118export UNIX_STD=2003
119./configure
120make
121```
122
123#### Windows - Mingw-w64 ####
124
125LibreSSL builds against relatively recent versions of Mingw-w64, not to be
126confused with the original mingw.org project.  Mingw-w64 3.2 or later
127should work. See README.windows for more information
128
129#### Windows - Visual Studio ####
130
131LibreSSL builds using the CMake target "Visual Studio 12 2013" and newer. To
132generate a Visual Studio project, install CMake, enter the LibreSSL source
133directory and run:
134
135```sh
136 mkdir build-vs2013
137 cd build-vs2013
138 cmake -G"Visual Studio 12 2013" ..
139```
140
141Replace "Visual Studio 12 2013" with whatever version of Visual Studio you
142have installed. This will generate a LibreSSL.sln file that you can incorporate
143into other projects or build by itself.
144
145#### Cmake - Additional Options ####
146
147| Option Name | Default | Description
148| ------------ | -----: | ------
149|  LIBRESSL_SKIP_INSTALL | OFF | allows skipping install() rules.  Can be specified from command line using <br>```-DLIBRESSL_SKIP_INSTALL=ON``` |
150|  LIBRESSL_APPS | ON | allows skipping application builds. Apps are required to run tests |
151|  LIBRESSL_TESTS | ON | allows skipping of tests. Tests are only available in static builds |
152|  BUILD_SHARED_LIBS | OFF | CMake option for building shared libraries. |
153|  ENABLE_ASM | ON | builds assembly optimized rules. |
154|  ENABLE_EXTRATESTS | OFF | Enable extra tests that may be unreliable on some platforms |
155|  ENABLE_NC | OFF | Enable installing TLS-enabled nc(1) |
156|  OPENSSLDIR | Blank | Set the default openssl directory.  Can be specified from command line using <br>```-DOPENSSLDIR=<dirname>``` |
157
158# Using LibreSSL #
159
160## CMake ##
161
162Make a new folder in your project root (where your main CMakeLists.txt file is located) called CMake. Copy the FindLibreSSL.cmake file to that folder, and add the following line to your main CMakeLists.txt:
163
164```cmake
165set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}")
166```
167
168After your **add_executable** or **add_library** line in your CMakeLists.txt file add the following:
169
170```cmake
171find_package(LibreSSL REQUIRED)
172```
173
174It will tell CMake to find LibreSSL and if found will let you use the following 3 interfaces in your CMakeLists.txt file:
175
176* LibreSSL::Crypto
177* LibreSSL::SSL
178* LibreSSL::TLS
179
180If you for example want to use the LibreSSL TLS library in your test program, include it like so (SSL and Cryto are required by TLS and included automatically too):
181
182```cmake
183target_link_libraries(test LibreSSL::TLS)
184```
185
186Full example:
187
188```cmake
189cmake_minimum_required(VERSION 3.10.0)
190
191set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}")
192
193project(test)
194
195add_executable(test Main.cpp)
196
197find_package(LibreSSL REQUIRED)
198
199target_link_libraries(test LibreSSL::TLS)
200```
201
202#### Linux ####
203
204Following the guide in the sections above to compile LibreSSL using make and running "sudo make install" will install LibreSSL to the /usr/local/ folder, and will found automatically by find_package. If your system installs it to another location or you have placed them yourself in a different location, you can set the CMake variable LIBRESSL_ROOT_DIR to the correct path, to help CMake find the library.
205
206#### Windows ####
207
208Placing the library files in C:/Program Files/LibreSSL/lib and the include files in C:/Program Files/LibreSSL/include should let CMake find them automatically, but it is recommended that you use CMake-GUI to set the paths. It is more convenient as you can have the files in any folder you choose.
209

README.windows

1# Building
2
3For Windows systems, LibreSSL supports the mingw-w64 toolchain, which can use
4GCC or Clang as the compiler. Contrary to its name, mingw-w64 supports both
532-bit and 64-bit build environments. If your project already uses mingw-w64,
6then LibreSSL should integrate very nicely. Old versions of the mingw-w64
7toolchain, such as the one packaged with Ubuntu 12.04, may have trouble
8building LibreSSL. Please try it with a recent toolchain if you encounter
9troubles. Cygwin provides an easy method of installing the latest mingw-w64
10cross compilers on Windows.
11
12To configure and build LibreSSL for a 32-bit system, use the following
13build steps:
14
15 CC=i686-w64-mingw32-gcc CPPFLAGS=-D__MINGW_USE_VC2005_COMPAT \
16 ./configure --host=i686-w64-mingw32
17 make
18 make check
19
20For 64-bit builds, use these instead:
21
22 CC=x86_64-w64-mingw32-gcc ./configure --host=x86_64-w64-mingw32
23 make
24 make check
25
26# Why the -D__MINGW_USE_VC2005_COMPAT flag on 32-bit systems?
27
28An ABI change introduced with Microsoft Visual C++ 2005 (also known as
29Visual C++ 8.0) switched time_t from 32-bit to 64-bit. It is important to
30build LibreSSL with 64-bit time_t whenever possible, because 32-bit time_t
31is unable to represent times past 2038 (this is commonly known as the
32Y2K38 problem).
33
34If LibreSSL is built with 32-bit time_t, when verifying a certificate whose
35expiry date is set past 19 January 2038, it will be unable to tell if the
36certificate has expired or not, and thus take the safe stance and reject it.
37
38In order to avoid this, you need to build LibreSSL (and everything that links
39with it) with the -D__MINGW_USE_VC2005_COMPAT flag. This tells mingw-w64 to
40use the new ABI.
41
4264-bit systems always have a 64-bit time_t and are not affected by this
43problem.
44
45# Using Libressl with Visual Studio
46
47A script for generating ready-to-use .DLL and static .LIB files is included in
48the source repository at
49https://github.com/libressl-portable/portable/blob/master/dist-win.sh
50
51This script uses mingw-w64 to build LibreSSL and then uses Visual Studio tools
52to generate compatible library import files ready-to-use with Visual
53Studio projects. Static and dynamic libraries are included. The script uses
54cv2pdb to generate Visual Studio and windbg compatible debug files. cv2pdb is a
55tool developed for the D language and can be found here:
56https://github.com/rainers/cv2pdb
57
58Pre-built Windows binaries are available with LibreSSL releases if you do not
59have a mingw-w64 build environment. Mingw-w64 code is largely, but not 100%,
60compatible with code built from Visual Studio. Notably, FILE * pointers cannot
61be shared between code built for Mingw-w64 and Visual Studio.
62
63As of LibreSSL 2.2.2, Visual Studio Native builds can be produced using CMake.
64This produces ABI-compatible libraries for linking with native code generated
65by Visual Studio.
66