Skip to content
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

Basic server support #7

Merged
merged 19 commits into from
Apr 15, 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
4 changes: 2 additions & 2 deletions rustls-libssl/Cargo.lock

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

2 changes: 1 addition & 1 deletion rustls-libssl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ env_logger = "0.10"
log = "0.4"
openssl-probe = "0.1"
openssl-sys = "0.9.98"
rustls = "0.23"
rustls = "0.23.4"
rustls-pemfile = "2"
62 changes: 31 additions & 31 deletions rustls-libssl/MATRIX.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
| `SSL_CTX_add_server_custom_ext` | | | |
| `SSL_CTX_add_session` | | | |
| `SSL_CTX_callback_ctrl` | | :white_check_mark: | |
| `SSL_CTX_check_private_key` | :white_check_mark: | | :exclamation: [^stub] |
| `SSL_CTX_check_private_key` | :white_check_mark: | | :white_check_mark: |
| `SSL_CTX_clear_options` | | :white_check_mark: | :white_check_mark: |
| `SSL_CTX_config` | | | |
| `SSL_CTX_ct_is_enabled` [^ct] | | | |
Expand All @@ -81,10 +81,10 @@
| `SSL_CTX_flush_sessions` | | | |
| `SSL_CTX_free` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `SSL_CTX_get0_CA_list` | | | |
| `SSL_CTX_get0_certificate` | | | |
| `SSL_CTX_get0_certificate` | | | :white_check_mark: |
| `SSL_CTX_get0_ctlog_store` [^ct] | | | |
| `SSL_CTX_get0_param` | | | |
| `SSL_CTX_get0_privatekey` | | | |
| `SSL_CTX_get0_privatekey` | | | :white_check_mark: |
| `SSL_CTX_get0_security_ex_data` | | | |
| `SSL_CTX_get_cert_store` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `SSL_CTX_get_ciphers` | | | |
Expand Down Expand Up @@ -115,13 +115,13 @@
| `SSL_CTX_load_verify_store` | | | |
| `SSL_CTX_new` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `SSL_CTX_new_ex` | | | |
| `SSL_CTX_remove_session` | | :white_check_mark: | |
| `SSL_CTX_remove_session` | | :white_check_mark: | :exclamation: [^stub] |
| `SSL_CTX_sess_get_get_cb` | | | |
| `SSL_CTX_sess_get_new_cb` | | | |
| `SSL_CTX_sess_get_remove_cb` | | | |
| `SSL_CTX_sess_set_get_cb` | | :white_check_mark: | |
| `SSL_CTX_sess_set_get_cb` | | :white_check_mark: | :exclamation: [^stub] |
| `SSL_CTX_sess_set_new_cb` | :white_check_mark: | :white_check_mark: | :exclamation: [^stub] |
| `SSL_CTX_sess_set_remove_cb` | | :white_check_mark: | |
| `SSL_CTX_sess_set_remove_cb` | | :white_check_mark: | :exclamation: [^stub] |
| `SSL_CTX_sessions` | | | |
| `SSL_CTX_set0_CA_list` | | | |
| `SSL_CTX_set0_ctlog_store` [^ct] | | | |
Expand Down Expand Up @@ -179,7 +179,7 @@
| `SSL_CTX_set_recv_max_early_data` | | | |
| `SSL_CTX_set_security_callback` | | | |
| `SSL_CTX_set_security_level` | | | |
| `SSL_CTX_set_session_id_context` | | :white_check_mark: | |
| `SSL_CTX_set_session_id_context` | | :white_check_mark: | :exclamation: [^stub] |
| `SSL_CTX_set_session_ticket_cb` | | | |
| `SSL_CTX_set_srp_cb_arg` [^deprecatedin_3_0] [^srp] | | | |
| `SSL_CTX_set_srp_client_pwd_callback` [^deprecatedin_3_0] [^srp] | | | |
Expand All @@ -200,16 +200,16 @@
| `SSL_CTX_set_verify` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `SSL_CTX_set_verify_depth` | | :white_check_mark: | |
| `SSL_CTX_up_ref` | | | :white_check_mark: |
| `SSL_CTX_use_PrivateKey` | :white_check_mark: | :white_check_mark: | :exclamation: [^stub] |
| `SSL_CTX_use_PrivateKey` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `SSL_CTX_use_PrivateKey_ASN1` | | | |
| `SSL_CTX_use_PrivateKey_file` | :white_check_mark: | | :exclamation: [^stub] |
| `SSL_CTX_use_PrivateKey_file` | :white_check_mark: | | :white_check_mark: |
| `SSL_CTX_use_RSAPrivateKey` [^deprecatedin_3_0] | | | |
| `SSL_CTX_use_RSAPrivateKey_ASN1` [^deprecatedin_3_0] | | | |
| `SSL_CTX_use_RSAPrivateKey_file` [^deprecatedin_3_0] | | | |
| `SSL_CTX_use_cert_and_key` | | | |
| `SSL_CTX_use_certificate` | :white_check_mark: | :white_check_mark: | :exclamation: [^stub] |
| `SSL_CTX_use_certificate` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `SSL_CTX_use_certificate_ASN1` | | | |
| `SSL_CTX_use_certificate_chain_file` | :white_check_mark: | | :exclamation: [^stub] |
| `SSL_CTX_use_certificate_chain_file` | :white_check_mark: | | :white_check_mark: |
| `SSL_CTX_use_certificate_file` | :white_check_mark: | | :exclamation: [^stub] |
| `SSL_CTX_use_psk_identity_hint` [^psk] | | | |
| `SSL_CTX_use_serverinfo` | | | |
Expand All @@ -226,7 +226,7 @@
| `SSL_SESSION_get0_ticket_appdata` | | | |
| `SSL_SESSION_get_compress_id` | | | |
| `SSL_SESSION_get_ex_data` | | | |
| `SSL_SESSION_get_id` | | :white_check_mark: | |
| `SSL_SESSION_get_id` | | :white_check_mark: | :exclamation: [^stub] |
| `SSL_SESSION_get_master_key` | | | |
| `SSL_SESSION_get_max_early_data` | | | |
| `SSL_SESSION_get_max_fragment_length` | | | |
Expand All @@ -252,10 +252,10 @@
| `SSL_SESSION_set_protocol_version` | | | |
| `SSL_SESSION_set_time` | | | |
| `SSL_SESSION_set_timeout` | | | |
| `SSL_SESSION_up_ref` | | :white_check_mark: | |
| `SSL_SESSION_up_ref` | | :white_check_mark: | :exclamation: [^stub] |
| `SSL_SRP_CTX_free` [^deprecatedin_3_0] [^srp] | | | |
| `SSL_SRP_CTX_init` [^deprecatedin_3_0] [^srp] | | | |
| `SSL_accept` | | | |
| `SSL_accept` | | | :white_check_mark: |
| `SSL_add1_host` | | | |
| `SSL_add1_to_CA_list` | | | |
| `SSL_add_client_CA` | | | |
Expand Down Expand Up @@ -316,12 +316,12 @@
| `SSL_get0_security_ex_data` | | | |
| `SSL_get0_verified_chain` | | | :white_check_mark: |
| `SSL_get1_peer_certificate` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `SSL_get1_session` | | :white_check_mark: | |
| `SSL_get1_session` | | :white_check_mark: | :exclamation: [^stub] |
| `SSL_get1_supported_ciphers` | | | |
| `SSL_get_SSL_CTX` | | | |
| `SSL_get_all_async_fds` | | | |
| `SSL_get_async_status` | | | |
| `SSL_get_certificate` | :white_check_mark: | :white_check_mark: | :exclamation: [^stub] |
| `SSL_get_certificate` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `SSL_get_changed_async_fds` | | | |
| `SSL_get_cipher_list` | | | |
| `SSL_get_ciphers` | | | |
Expand Down Expand Up @@ -349,11 +349,11 @@
| `SSL_get_peer_finished` | | | |
| `SSL_get_peer_signature_type_nid` | | | |
| `SSL_get_pending_cipher` | | | |
| `SSL_get_privatekey` | :white_check_mark: | | :exclamation: [^stub] |
| `SSL_get_privatekey` | :white_check_mark: | | :white_check_mark: |
| `SSL_get_psk_identity` [^psk] | | | |
| `SSL_get_psk_identity_hint` [^psk] | | | |
| `SSL_get_quiet_shutdown` | | | |
| `SSL_get_rbio` | | :white_check_mark: | |
| `SSL_get_rbio` | | :white_check_mark: | :white_check_mark: |
| `SSL_get_read_ahead` | | | |
| `SSL_get_record_padding_callback_arg` | | | |
| `SSL_get_recv_max_early_data` | | | |
Expand All @@ -364,7 +364,7 @@
| `SSL_get_server_random` | | | |
| `SSL_get_servername` | | :white_check_mark: | |
| `SSL_get_servername_type` | | | |
| `SSL_get_session` | | :white_check_mark: | |
| `SSL_get_session` | | :white_check_mark: | :exclamation: [^stub] |
| `SSL_get_shared_ciphers` | | | |
| `SSL_get_shared_sigalgs` | | | |
| `SSL_get_shutdown` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
Expand All @@ -376,21 +376,21 @@
| `SSL_get_srp_username` [^deprecatedin_3_0] [^srp] | | | |
| `SSL_get_srtp_profiles` [^srtp] | | | |
| `SSL_get_ssl_method` | | | |
| `SSL_get_state` | | | |
| `SSL_get_state` | | | :white_check_mark: |
| `SSL_get_verify_callback` | | | |
| `SSL_get_verify_depth` | | | |
| `SSL_get_verify_mode` | | | |
| `SSL_get_verify_result` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `SSL_get_version` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `SSL_get_wbio` | | :white_check_mark: | |
| `SSL_get_wbio` | | :white_check_mark: | :white_check_mark: |
| `SSL_get_wfd` | | | |
| `SSL_group_to_name` | | | |
| `SSL_has_matching_session_id` | | | |
| `SSL_has_pending` | | | :white_check_mark: |
| `SSL_in_before` | | | |
| `SSL_in_init` | | :white_check_mark: | |
| `SSL_in_before` | | | :white_check_mark: |
| `SSL_in_init` | | :white_check_mark: | :white_check_mark: |
| `SSL_is_dtls` | | | |
| `SSL_is_init_finished` | | :white_check_mark: | |
| `SSL_is_init_finished` | | :white_check_mark: | :white_check_mark: |
| `SSL_is_server` | | | :white_check_mark: |
| `SSL_key_update` | | | |
| `SSL_load_client_CA_file` | | :white_check_mark: | |
Expand All @@ -410,15 +410,15 @@
| `SSL_rstate_string_long` | | | |
| `SSL_select_next_proto` | | :white_check_mark: | |
| `SSL_sendfile` | | | |
| `SSL_session_reused` | | :white_check_mark: | |
| `SSL_session_reused` | | :white_check_mark: | :exclamation: [^stub] |
| `SSL_set0_CA_list` | | | |
| `SSL_set0_rbio` | | | :white_check_mark: |
| `SSL_set0_security_ex_data` | | | |
| `SSL_set0_tmp_dh_pkey` | | | |
| `SSL_set0_wbio` | | | :white_check_mark: |
| `SSL_set1_host` | | | :white_check_mark: |
| `SSL_set1_param` | | | |
| `SSL_set_SSL_CTX` | | :white_check_mark: | |
| `SSL_set_SSL_CTX` | | :white_check_mark: | :white_check_mark: |
| `SSL_set_accept_state` | | :white_check_mark: | :white_check_mark: |
| `SSL_set_allow_early_data_cb` | | | |
| `SSL_set_alpn_protos` | | | :white_check_mark: |
Expand Down Expand Up @@ -461,7 +461,7 @@
| `SSL_set_security_callback` | | | |
| `SSL_set_security_level` | | | |
| `SSL_set_session` | :white_check_mark: | :white_check_mark: | :exclamation: [^stub] |
| `SSL_set_session_id_context` | | | |
| `SSL_set_session_id_context` | | | :exclamation: [^stub] |
| `SSL_set_session_secret_cb` | | | |
| `SSL_set_session_ticket_ext` | | | |
| `SSL_set_session_ticket_ext_cb` | | | |
Expand All @@ -485,14 +485,14 @@
| `SSL_test_functions` [^unit_test] | | | |
| `SSL_trace` [^ssl_trace] | | | |
| `SSL_up_ref` | | | :white_check_mark: |
| `SSL_use_PrivateKey` | | :white_check_mark: | |
| `SSL_use_PrivateKey` | | :white_check_mark: | :white_check_mark: |
| `SSL_use_PrivateKey_ASN1` | | | |
| `SSL_use_PrivateKey_file` | | | |
| `SSL_use_RSAPrivateKey` [^deprecatedin_3_0] | | | |
| `SSL_use_RSAPrivateKey_ASN1` [^deprecatedin_3_0] | | | |
| `SSL_use_RSAPrivateKey_file` [^deprecatedin_3_0] | | | |
| `SSL_use_cert_and_key` | | | |
| `SSL_use_certificate` | | :white_check_mark: | |
| `SSL_use_certificate` | | :white_check_mark: | :white_check_mark: |
| `SSL_use_certificate_ASN1` | | | |
| `SSL_use_certificate_chain_file` | | | |
| `SSL_use_certificate_file` | | | |
Expand All @@ -519,8 +519,8 @@
| `TLSv1_client_method` [^deprecatedin_1_1_0] [^tls1_method] | | | |
| `TLSv1_method` [^deprecatedin_1_1_0] [^tls1_method] | | | |
| `TLSv1_server_method` [^deprecatedin_1_1_0] [^tls1_method] | | | |
| `d2i_SSL_SESSION` | | :white_check_mark: | |
| `i2d_SSL_SESSION` | | :white_check_mark: | |
| `d2i_SSL_SESSION` | | :white_check_mark: | :exclamation: [^stub] |
| `i2d_SSL_SESSION` | | :white_check_mark: | :exclamation: [^stub] |

[^stub]: symbol exists, but just returns an error.
[^deprecatedin_1_1_0]: deprecated in openssl 1.1.0
Expand Down
5 changes: 4 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/ciphers target/client target/constants target/$(PROFILE)/libssl.so.3
all: target/ciphers target/client target/constants target/server target/$(PROFILE)/libssl.so.3

test: all
${CARGO} test $(CARGOFLAGS)
Expand Down Expand Up @@ -48,6 +48,9 @@ target/client: target/client.o
target/constants: target/constants.o
$(CC) -o $@ $^ $(LDFLAGS) $(shell pkg-config --libs openssl)

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

clean:
rm -rf target

Expand Down
24 changes: 24 additions & 0 deletions rustls-libssl/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ fn write_version_file() -> String {

const ENTRYPOINTS: &[&str] = &[
"BIO_f_ssl",
"d2i_SSL_SESSION",
"i2d_SSL_SESSION",
"OPENSSL_init_ssl",
"SSL_accept",
"SSL_alert_desc_string",
"SSL_alert_desc_string_long",
"SSL_CIPHER_description",
Expand All @@ -62,13 +65,18 @@ const ENTRYPOINTS: &[&str] = &[
"SSL_CTX_clear_options",
"SSL_CTX_ctrl",
"SSL_CTX_free",
"SSL_CTX_get0_certificate",
"SSL_CTX_get0_privatekey",
"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_remove_session",
"SSL_CTX_sess_set_get_cb",
"SSL_CTX_sess_set_new_cb",
"SSL_CTX_sess_set_remove_cb",
"SSL_CTX_set_alpn_protos",
"SSL_CTX_set_cipher_list",
"SSL_CTX_set_ciphersuites",
Expand All @@ -84,6 +92,7 @@ const ENTRYPOINTS: &[&str] = &[
"SSL_CTX_set_next_proto_select_cb",
"SSL_CTX_set_options",
"SSL_CTX_set_post_handshake_auth",
"SSL_CTX_set_session_id_context",
"SSL_CTX_set_srp_password",
"SSL_CTX_set_srp_username",
"SSL_CTX_set_verify",
Expand All @@ -98,22 +107,33 @@ const ENTRYPOINTS: &[&str] = &[
"SSL_get0_peer_certificate",
"SSL_get0_verified_chain",
"SSL_get1_peer_certificate",
"SSL_get1_session",
"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_rbio",
"SSL_get_session",
"SSL_get_shutdown",
"SSL_get_state",
"SSL_get_verify_result",
"SSL_get_version",
"SSL_get_wbio",
"SSL_has_pending",
"SSL_in_before",
"SSL_in_init",
"SSL_is_init_finished",
"SSL_is_server",
"SSL_new",
"SSL_pending",
"SSL_read",
"SSL_SESSION_free",
"SSL_SESSION_get_id",
"SSL_session_reused",
"SSL_SESSION_up_ref",
"SSL_set0_rbio",
"SSL_set0_wbio",
"SSL_set1_host",
Expand All @@ -126,9 +146,13 @@ const ENTRYPOINTS: &[&str] = &[
"SSL_set_options",
"SSL_set_post_handshake_auth",
"SSL_set_session",
"SSL_set_session_id_context",
"SSL_set_shutdown",
"SSL_set_SSL_CTX",
"SSL_shutdown",
"SSL_up_ref",
"SSL_use_certificate",
"SSL_use_PrivateKey",
"SSL_want",
"SSL_write",
"TLS_client_method",
Expand Down
Loading