Skip to content

curl client checkpoint #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/libssl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ jobs:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install valgrind
run: sudo apt-get update && sudo apt-get install -y valgrind
- name: Install build dependencies
Expand Down Expand Up @@ -84,9 +86,8 @@ jobs:
with:
persist-credentials: false
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.67.1
components: rustfmt
- name: Check Rust formatting
run: cargo fmt --all -- --check
Expand Down
17 changes: 17 additions & 0 deletions rustls-libssl/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions rustls-libssl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "rustls-libssl"
version = "0.1.0"
edition = "2021"
build = "build.rs"
rust-version = "1.77"

[lib]
name = "ssl"
Expand All @@ -13,3 +14,4 @@ env_logger = "0.10"
log = "0.4"
openssl-sys = "0.9.98"
rustls = "0.22"
rustls-pemfile = "2"
14 changes: 13 additions & 1 deletion rustls-libssl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ifneq (,$(TARGET))
CARGOFLAGS += --target $(TARGET)
endif

all: target/$(PROFILE)/libssl.so.3
all: target/ciphers target/client target/constants target/$(PROFILE)/libssl.so.3

test: all
${CARGO} test --locked
Expand All @@ -36,6 +36,18 @@ target/$(PROFILE)/libssl.so.3: target/$(PROFILE)/libssl.so
target/$(PROFILE)/libssl.so: *.rs src/*.rs Cargo.toml
${CARGO} build $(CARGOFLAGS)

target/%.o: tests/%.c | target
$(CC) -o $@ -c $< $(CFLAGS)

target/ciphers: target/ciphers.o
$(CC) -o $@ $^ $(LDFLAGS) $(shell pkg-config --libs openssl)

target/client: target/client.o
$(CC) -o $@ $^ $(LDFLAGS) $(shell pkg-config --libs openssl)

target/constants: target/constants.o
$(CC) -o $@ $^ $(LDFLAGS) $(shell pkg-config --libs openssl)

clean:
rm -rf target

Expand Down
2 changes: 2 additions & 0 deletions rustls-libssl/admin/format
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
# `entry!` with `mod entry`, and then restore it back afterwards.

sed -i -e 's/^entry! {/mod entry {/g' src/entry.rs
sed -i -e 's/^entry_stub! {/mod entry_stub {/g' src/entry.rs
cargo fmt "$@"
rc=$?
sed -i -e 's/^mod entry {/entry! {/g' src/entry.rs
sed -i -e 's/^mod entry_stub {/entry_stub! {/g' src/entry.rs
exit $rc
78 changes: 78 additions & 0 deletions rustls-libssl/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,91 @@ fn write_version_file() -> String {
}

const ENTRYPOINTS: &[&str] = &[
"BIO_f_ssl",
"OPENSSL_init_ssl",
"SSL_alert_desc_string",
"SSL_alert_desc_string_long",
"SSL_CIPHER_description",
"SSL_CIPHER_find",
"SSL_CIPHER_get_bits",
"SSL_CIPHER_get_id",
"SSL_CIPHER_get_name",
"SSL_CIPHER_get_protocol_id",
"SSL_CIPHER_get_version",
"SSL_CIPHER_standard_name",
"SSL_clear_options",
"SSL_connect",
"SSL_ctrl",
"SSL_CTX_add_client_CA",
"SSL_CTX_check_private_key",
"SSL_CTX_clear_options",
"SSL_CTX_ctrl",
"SSL_CTX_free",
"SSL_CTX_get_cert_store",
"SSL_CTX_get_ex_data",
"SSL_CTX_get_options",
"SSL_CTX_load_verify_dir",
"SSL_CTX_load_verify_file",
"SSL_CTX_new",
"SSL_CTX_sess_set_new_cb",
"SSL_CTX_set_alpn_protos",
"SSL_CTX_set_cipher_list",
"SSL_CTX_set_ciphersuites",
"SSL_CTX_set_default_passwd_cb",
"SSL_CTX_set_default_passwd_cb_userdata",
"SSL_CTX_set_ex_data",
"SSL_CTX_set_keylog_callback",
"SSL_CTX_set_msg_callback",
"SSL_CTX_set_next_proto_select_cb",
"SSL_CTX_set_options",
"SSL_CTX_set_post_handshake_auth",
"SSL_CTX_set_srp_password",
"SSL_CTX_set_srp_username",
"SSL_CTX_set_verify",
"SSL_CTX_up_ref",
"SSL_CTX_use_certificate",
"SSL_CTX_use_certificate_chain_file",
"SSL_CTX_use_certificate_file",
"SSL_CTX_use_PrivateKey",
"SSL_CTX_use_PrivateKey_file",
"SSL_free",
"SSL_get0_alpn_selected",
"SSL_get0_peer_certificate",
"SSL_get0_verified_chain",
"SSL_get1_peer_certificate",
"SSL_get_certificate",
"SSL_get_current_cipher",
"SSL_get_error",
"SSL_get_ex_data",
"SSL_get_options",
"SSL_get_peer_cert_chain",
"SSL_get_privatekey",
"SSL_get_shutdown",
"SSL_get_verify_result",
"SSL_get_version",
"SSL_has_pending",
"SSL_is_server",
"SSL_new",
"SSL_pending",
"SSL_read",
"SSL_SESSION_free",
"SSL_set0_rbio",
"SSL_set0_wbio",
"SSL_set1_host",
"SSL_set_accept_state",
"SSL_set_alpn_protos",
"SSL_set_bio",
"SSL_set_connect_state",
"SSL_set_ex_data",
"SSL_set_fd",
"SSL_set_options",
"SSL_set_post_handshake_auth",
"SSL_set_session",
"SSL_set_shutdown",
"SSL_shutdown",
"SSL_up_ref",
"SSL_want",
"SSL_write",
"TLS_client_method",
"TLS_method",
"TLS_server_method",
Expand Down
Loading