Skip to content

Commit 0671182

Browse files
committed
Add packaging for custom openssl
1 parent bb5a3d1 commit 0671182

33 files changed

+922
-500
lines changed

.github/workflows/debian-package.yml

Lines changed: 260 additions & 72 deletions
Large diffs are not rendered by default.

.github/workflows/replace-default.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,23 @@ debian/*.deb
109109
debian/*.buildinfo
110110
debian/files
111111
debian/libwolfprov*
112+
debian/libssl-dev*
113+
debian/openssl*
114+
debian/libssl3*
112115
!debian/libwolfprov.install
113116
!debian/libwolfprov.postinst
114117
!debian/libwolfprov.postrm
115118
!debian/libwolfprov-dev.docs
116119
!debian/libwolfprov-dev.install
120+
!debian/openssl.cnf
121+
!debian/openssl.install
122+
!debian/openssl.postinst
123+
!debian/openssl.postrm
124+
!debian/libssl3.postinst
125+
!debian/libssl3.postrm
126+
!debian/libssl3.install
127+
!debian/libssl3.docs
128+
!debian/libssl3.install
129+
!debian/libssl3.postinst
130+
!debian/libssl3.postrm
131+

Makefile.am

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/include
1414

1515
lib_LTLIBRARIES = libwolfprov.la
1616

17-
# Conditionally build libdefault.so when --replace-default is enabled
18-
if BUILD_REPLACE_DEFAULT
19-
# Install libdefault.la directly to OpenSSL lib directory
20-
openssldir = $(OPENSSL_LIB_DIR)
21-
openssl_LTLIBRARIES = libdefault.la
22-
libdefault_la_SOURCES = src/wp_default_replace.c
23-
libdefault_la_LIBADD = libwolfprov.la
24-
endif
17+
# Create only libwolfprov.so, and not .so.X.Y.Z
18+
libwolfprov_la_LDFLAGS = -avoid-version
2519

2620
EXTRA_DIST+=ChangeLog.md
2721
EXTRA_DIST+=README.md

README-packaging.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# WolfProvider Debian Packaging
2+
This is the flow for building and installing
3+
4+
## Local build
5+
6+
From the repo root, run the following command:
7+
```
8+
./scripts/build-wolfprovider.sh --debian
9+
```
10+
11+
For a FIPS build, run the following:
12+
```
13+
./scripts/build-wolfprovider.sh --debian --enable-fips
14+
```
15+
16+
The Debian packages are placed in the parent directory, which should be one level above the repo root.
17+
18+
## CI build
19+
Instead of doing a local build as outlined above, we can alternatively use packages generated from CI.
20+
21+
To use a build from CI for local install, download the artifacts from the Debian CI job. Then install the .deb's from the zip file with `apt` as shown below rather than from the build.
22+
23+
## Install
24+
25+
If not already done, install the WolfSSL Debian package. The non-FIPS version is available in this repo and is installed by the script below. This step is only needed once, and can be done prior to the `build-wolfprovider.sh` step above.
26+
```
27+
./debian/install-wolfssl.sh ./.github/packages/debian-wolfssl.tar.gz
28+
```
29+
30+
For the script above, some systems may require additional packages:
31+
```
32+
apt install build-essential devscripts dh-exec
33+
```
34+
35+
### Optionally install custom OpenSSL
36+
37+
**Important**: before proceeding with the wolfProvider install, make sure packages are not present:
38+
```
39+
apt purge -y libwolfprov ; apt purge -y openssl-config ; apt purge -y openssl ; apt purge -y libssl3
40+
```
41+
42+
Get the system architecture which determines the library paths for the following steps:
43+
```
44+
export CURRENT_ARCH=$(dpkg --print-architecture)
45+
```
46+
47+
Then install the wolfProvider-specific OpenSSL. From the repo root:
48+
```
49+
apt install ../openssl*${CURRENT_ARCH}*.deb ../libssl3*${CURRENT_ARCH}*.deb
50+
```
51+
52+
Check that the provider API is disabled since wolfProvider is not installed:
53+
```
54+
$ openssl list -providers
55+
Could not load libwolfprov.so. Is the libwolfprov package installed?
56+
libwolfprov.so: cannot open shared object file: No such file or directory
57+
```
58+
59+
### Install wolfProvider
60+
61+
Then install wolfProvider:
62+
```
63+
apt install ../libwolfprov*${CURRENT_ARCH}*.deb
64+
```
65+
66+
Confirm that wolfProvider is installed:
67+
```
68+
$ openssl list -providers
69+
```
70+
71+
Output should look like this:
72+
```
73+
Providers:
74+
default
75+
name: wolfSSL Provider
76+
version: 1.0.2
77+
status: active
78+
```
79+
80+
## Release process
81+
Always use CI to perform the release build to avoid potential errors from building locally.
82+
83+
* Tag the wolfProvider repo in the format `vX.Y.Z`
84+
* The changelog is generated by the Debian scripts
85+
* Run the Debian job in CI
86+
* Download the artifacts zip file which contains the .deb's
87+
* Generate release archives as needed
88+

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,6 @@ To remove all source directories, use the following:
7878
./scripts/build-wolfprovider.sh --distclean
7979
```
8080

81-
To build a Debian package file, use the following command.
82-
Note this will remove all ignored files in the repo, and there must be no staged changes.
83-
```
84-
./scripts/build-wolfprovider.sh --debian
85-
```
86-
8781
Alternatively, you can manually compile each component using the following guide.
8882

8983
### OpenSSL

debian/clean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
wolfProvider/scripts/build-release.log

debian/compat

Lines changed: 0 additions & 1 deletion
This file was deleted.

debian/control

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,25 @@ Section: libs
33
Priority: optional
44
Maintainer: WolfSSL <[email protected]>
55
Standards-Version: 4.6.2
6-
Build-Depends: debhelper (>= 12),
7-
devscripts,
8-
pkgconf,
9-
openssl,
10-
libwolfssl,
11-
libwolfssl-dev
12-
6+
Rules-Requires-Root: no
7+
Build-Depends:
8+
debhelper-compat (= 13),
9+
devscripts,
10+
dh-exec,
11+
openssl,
12+
git,
13+
pkgconf,
14+
libwolfssl-dev
1315

1416
Package: libwolfprov
1517
Architecture: any
18+
Multi-Arch: same
1619
Depends: ${shlibs:Depends}, ${misc:Depends}, libssl3 (>= 3.0.3), libwolfssl (>= 5.8.2), openssl
1720
Provides: ${variant:provides}
1821
XB-Variant: ${variant}
1922
Description: wolfProvider library for OpenSSL — ${variant:desc}
2023
wolfProvider is a library that can be used as a Provider in OpenSSL.
2124
It provides cryptographic functionality through wolfSSL including:
22-
.
2325
* Hash functions (MD5, SHA-1, SHA-2, SHA-3)
2426
* Symmetric encryption (AES, DES)
2527
* Asymmetric cryptography (RSA, ECC, DH)
@@ -31,7 +33,40 @@ Description: wolfProvider library for OpenSSL — ${variant:desc}
3133
Package: libwolfprov-dev
3234
Architecture: any
3335
Section: libdevel
36+
Multi-Arch: same
3437
Depends: libwolfprov (= ${binary:Version}), ${misc:Depends}
35-
Description: Development files for wolfProvider
36-
This package contains the header files and development libraries
37-
needed to build applications using wolfProvider.
38+
XB-Variant: ${variant}
39+
Description: Development files for wolfProvider — ${variant:desc}
40+
This package contains the headers and development files
41+
for applications using wolfProvider.
42+
43+
Package: openssl
44+
Architecture: any
45+
Section: utils
46+
Multi-Arch: foreign
47+
Depends: ${shlibs:Depends}, ${misc:Depends}
48+
Description: Secure Sockets Layer toolkit - command line interface
49+
This package contains the OpenSSL command line utility.
50+
Built for use with wolfProvider.
51+
52+
Package: libssl3
53+
Architecture: any
54+
Multi-Arch: same
55+
Depends: libssl3 (= ${binary:Version}), ${misc:Depends}
56+
Breaks: libssl3 (<< 3.0.0)
57+
Replaces: libssl3
58+
Recommends: openssl
59+
Description: OpenSSL shared libraries (wolfProvider build)
60+
This package contains the OpenSSL shared libraries built
61+
for use with wolfProvider.
62+
63+
Package: libssl-dev
64+
Architecture: any
65+
Section: libdevel
66+
Multi-Arch: same
67+
Depends: libssl3 (= ${binary:Version}), ${misc:Depends}
68+
Breaks: libssl-dev (<< 3.0.0)
69+
Replaces: libssl-dev
70+
Description: OpenSSL development files (wolfProvider build)
71+
This package contains headers, pkg-config files and linker symlinks
72+
for the OpenSSL version built for wolfProvider.

0 commit comments

Comments
 (0)