Skip to content

Commit 7b427fa

Browse files
committed
Initial commit
This builds a libssl.so.3, with a correct soname and a handful of basic functions that are correctly versioned: ``` $ readelf -d target/debug/libssl.so.3 | grep SONAME 0x000000000000000e (SONAME) Library soname: [libssl.so.3] $ readelf -Wa --dyn-syms target/debug/libssl.so.3 | grep @@ 62: 00000000000e8600 0 FUNC GLOBAL DEFAULT 16 TLS_server_method@@OPENSSL_3.0.0 65: 00000000000e8540 0 FUNC GLOBAL DEFAULT 16 TLS_method@@OPENSSL_3.0.0 66: 00000000000e8960 0 FUNC GLOBAL DEFAULT 16 SSL_CTX_free@@OPENSSL_3.0.0 67: 00000000000e8a30 0 FUNC GLOBAL DEFAULT 16 SSL_new@@OPENSSL_3.0.0 69: 00000000000e86c0 0 FUNC GLOBAL DEFAULT 16 TLS_client_method@@OPENSSL_3.0.0 70: 00000000000e8c10 0 FUNC GLOBAL DEFAULT 16 SSL_free@@OPENSSL_3.0.0 73: 00000000000e8780 0 FUNC GLOBAL DEFAULT 16 SSL_CTX_new@@OPENSSL_3.0.0 74: 00000000000e8870 0 FUNC GLOBAL DEFAULT 16 SSL_CTX_up_ref@@OPENSSL_3.0.0 78: 00000000000e8b20 0 FUNC GLOBAL DEFAULT 16 SSL_up_ref@@OPENSSL_3.0.0 79: 00000000000e8450 0 FUNC GLOBAL DEFAULT 16 OPENSSL_init_ssl@@OPENSSL_3.0.0 ``` See `build.rs` for how this works roughly, including the requirement for lld. There are a handful of tests, and these work under miri.
0 parents  commit 7b427fa

File tree

15 files changed

+1747
-0
lines changed

15 files changed

+1747
-0
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: cargo
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: github-actions
9+
directory: "/"
10+
schedule:
11+
interval: weekly

.github/workflows/libssl.yaml

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
name: rustls-libssl
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
pull_request:
9+
merge_group:
10+
schedule:
11+
- cron: '15 12 * * 3'
12+
13+
defaults:
14+
run:
15+
working-directory: rustls-libssl
16+
17+
jobs:
18+
build:
19+
name: Build+test
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
matrix:
23+
rust:
24+
- stable
25+
- beta
26+
- nightly
27+
os: [ubuntu-latest]
28+
steps:
29+
- name: Checkout sources
30+
uses: actions/checkout@v4
31+
with:
32+
persist-credentials: false
33+
34+
- name: Install build dependencies
35+
run: sudo apt-get update && sudo apt-get install -y openssl libssl3 libssl-dev lld
36+
37+
- name: Install ${{ matrix.rust }} toolchain
38+
uses: dtolnay/rust-toolchain@master
39+
with:
40+
toolchain: ${{ matrix.rust }}
41+
42+
- run: make PROFILE=release test
43+
44+
valgrind:
45+
name: Valgrind
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v4
49+
with:
50+
persist-credentials: false
51+
- name: Install valgrind
52+
run: sudo apt-get update && sudo apt-get install -y valgrind
53+
- name: Install build dependencies
54+
run: sudo apt-get update && sudo apt-get install -y openssl libssl3 libssl-dev lld
55+
- run: export VALGRIND="valgrind -q"
56+
- run: make test
57+
58+
docs:
59+
name: Check for documentation errors
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Checkout sources
63+
uses: actions/checkout@v4
64+
with:
65+
persist-credentials: false
66+
67+
- name: Install build dependencies
68+
run: sudo apt-get update && sudo apt-get install -y openssl libssl3 libssl-dev lld
69+
70+
- name: Install rust toolchain
71+
uses: dtolnay/rust-toolchain@nightly
72+
73+
- name: cargo doc (all features)
74+
run: cargo doc --all-features --no-deps --workspace
75+
env:
76+
RUSTDOCFLAGS: -Dwarnings
77+
78+
format:
79+
name: Format
80+
runs-on: ubuntu-latest
81+
steps:
82+
- name: Checkout sources
83+
uses: actions/checkout@v4
84+
with:
85+
persist-credentials: false
86+
- name: Install rust toolchain
87+
uses: dtolnay/rust-toolchain@master
88+
with:
89+
toolchain: 1.67.1
90+
components: rustfmt
91+
- name: Check Rust formatting
92+
run: cargo fmt --all -- --check
93+
- name: Check src/entry.rs formatting
94+
run: ./admin/format --all -- --check
95+
- name: Check C formatting
96+
run: make format-check
97+
98+
clippy:
99+
name: Clippy
100+
runs-on: ubuntu-latest
101+
steps:
102+
- name: Checkout sources
103+
uses: actions/checkout@v4
104+
with:
105+
persist-credentials: false
106+
- name: Install rust toolchain
107+
uses: dtolnay/rust-toolchain@stable
108+
with:
109+
components: clippy
110+
- name: Check clippy
111+
# We allow unknown lints here because sometimes the nightly job
112+
# (below) will have a new lint that we want to suppress.
113+
# If we suppress (e.g. #![allow(clippy::arc_with_non_send_sync)]),
114+
# we would get an unknown-lint error from older clippy versions.
115+
run: cargo clippy --locked --workspace -- -D warnings -A unknown-lints
116+
117+
clippy-nightly-optional:
118+
name: Clippy nightly (optional)
119+
runs-on: ubuntu-latest
120+
steps:
121+
- name: Checkout sources
122+
uses: actions/checkout@v4
123+
with:
124+
persist-credentials: false
125+
- name: Install rust toolchain
126+
uses: dtolnay/rust-toolchain@nightly
127+
with:
128+
components: clippy
129+
- name: Check clippy
130+
run: cargo clippy --locked --workspace -- -D warnings
131+
132+
clang-tidy:
133+
name: Clang Tidy
134+
runs-on: ubuntu-latest
135+
steps:
136+
- name: Checkout sources
137+
uses: actions/checkout@v4
138+
with:
139+
persist-credentials: false
140+
- name: Clang tidy
141+
run: clang-tidy tests/*.c -- -I src/
142+
143+
miri:
144+
name: Miri
145+
runs-on: ubuntu-latest
146+
steps:
147+
- name: Checkout sources
148+
uses: actions/checkout@v4
149+
with:
150+
persist-credentials: false
151+
152+
- name: Install nightly Rust
153+
uses: dtolnay/rust-toolchain@nightly
154+
- run: rustup override set "nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)"
155+
- run: rustup component add miri
156+
- run: cargo miri test

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# rustls-openssl-compat
2+
3+
This is the planned home of several rustls ↔️ OpenSSL compatibility layers.
4+
Currently here:
5+
6+
- **rustls-libssl**: an implementation of the OpenSSL libssl ABI in terms of rustls.
7+
8+
Not yet here:
9+
10+
- **rustls-libcrypto**: an implementation of rustls `CryptoProvider` in terms of OpenSSL's libcrypto.

rustls-libssl/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target/

0 commit comments

Comments
 (0)