• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

crypto/H03-May-2022-

include/H03-May-2022-

ssl/H03-May-2022-

tls/H03-May-2022-

.gitignoreH A D27-Oct-2020484

COPYINGH A D27-Oct-20206.3 KiB

ChangeLogH A D27-Oct-202057 KiB

FindLibreSSL.cmakeH A D27-Oct-20206.2 KiB

INSTALLH A D27-Oct-202015.4 KiB

README.mdH A D27-Oct-20208 KiB

README.windowsH A D27-Oct-20202.8 KiB

VERSIONH A D27-Oct-20207

cmake_export_symbol.cmakeH A D27-Oct-20202.3 KiB

ltmain.shH A D27-Oct-2020276 KiB

tap-driver.shH A D27-Oct-202019 KiB

test-driverH A D27-Oct-20204.5 KiB

README.md

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

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