Skip to content

Commit

Permalink
Implement SSL_CTX_load_verify_locations
Browse files Browse the repository at this point in the history
  • Loading branch information
ctz committed Apr 5, 2024
1 parent 91965ae commit 7fe7977
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rustls-libssl/MATRIX.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
| `SSL_CTX_has_client_custom_ext` | | | |
| `SSL_CTX_load_verify_dir` | :white_check_mark: | | :white_check_mark: |
| `SSL_CTX_load_verify_file` | :white_check_mark: | | :white_check_mark: |
| `SSL_CTX_load_verify_locations` | | :white_check_mark: | |
| `SSL_CTX_load_verify_locations` | | :white_check_mark: | :white_check_mark: |
| `SSL_CTX_load_verify_store` | | | |
| `SSL_CTX_new` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `SSL_CTX_new_ex` | | | |
Expand Down
1 change: 1 addition & 0 deletions rustls-libssl/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ const ENTRYPOINTS: &[&str] = &[
"SSL_CTX_get_verify_mode",
"SSL_CTX_load_verify_dir",
"SSL_CTX_load_verify_file",
"SSL_CTX_load_verify_locations",
"SSL_CTX_new",
"SSL_CTX_remove_session",
"SSL_CTX_sess_set_get_cb",
Expand Down
26 changes: 26 additions & 0 deletions rustls-libssl/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,32 @@ entry! {
}
}

entry! {
pub fn _SSL_CTX_load_verify_locations(
ctx: *mut SSL_CTX,
ca_file: *const c_char,
ca_path: *const c_char,
) -> c_int {
if ca_path.is_null() && ca_path.is_null() {
return 0;
}

if !ca_file.is_null() {
if _SSL_CTX_load_verify_file(ctx, ca_file) == 0 {
return 0;
}
}

if !ca_path.is_null() {
if _SSL_CTX_load_verify_dir(ctx, ca_path) == 0 {
return 0;
}
}

C_INT_SUCCESS
}
}

entry! {
pub fn _SSL_CTX_set_alpn_protos(
ctx: *mut SSL_CTX,
Expand Down

0 comments on commit 7fe7977

Please sign in to comment.