Skip to content

Commit 8da4972

Browse files
committed
chore(sys): bump tinydtls to 9d6cf54, update bindgen, bump crate version
bindgen 0.59.X depended on a crate with a cargo audit warning, updating it to fix that. Also made some minor changes to build script and tests to accomodate for bindgen and tinydtls changes.
1 parent 14614c6 commit 8da4972

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
members = [
55
"tinydtls-sys",
66
]
7+
resolver = "2"

tinydtls-sys/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[package]
55
name = "tinydtls-sys"
66
description = "Raw bindings to the TinyDTLS library."
7-
version = "0.1.2+tinydtls-c84e36f"
7+
version = "0.2.0+tinydtls-9d6cf54"
88
edition = "2021"
99
links = "tinydtls"
1010
# For tinydtls, both licenses can be applied, see https://www.eclipse.org/legal/eplfaq.php#DUALLIC
@@ -18,6 +18,7 @@ authors = ["Hugo Hakim Damer <[email protected]>"]
1818
categories = ["external-ffi-bindings", "network-programming", "cryptography", "embedded"]
1919
keywords = ["tinydtls", "sys", "dtls", "crypto"]
2020
exclude = ['/src/tinydtls/share/', '/src/tinydtls/include/', '/src/tinydtls/configure.prev']
21+
resolver = "2"
2122

2223
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
2324
[features]
@@ -39,6 +40,6 @@ libc = "^0.2.112"
3940
lazy_static = "^1.4"
4041

4142
[build-dependencies]
42-
bindgen = "^0.59.2"
43+
bindgen = "^0.69.4"
4344
autotools = "^0.2.3"
4445
fs_extra = "^1.2"

tinydtls-sys/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ fn main() {
113113
bindgen_builder = bindgen_builder
114114
.header("src/wrapper.h")
115115
.default_enum_style(EnumVariation::Rust { non_exhaustive: true })
116-
.rustfmt_bindings(false)
116+
.formatter(bindgen::Formatter::None)
117117
// Some types cannot have `Debug` as they are packed and have non-Copy fields.
118118
.no_debug("dtls_hello_verify_t")
119119
// Declarations that should be part of the bindings.
@@ -158,7 +158,7 @@ fn main() {
158158
// the included headers seem to come from our built version.
159159
// Should be fine though, as we already printed `cargo:rerun-if-changed=src/tinydtls/` at the
160160
// start of the file.
161-
bindgen_builder = bindgen_builder.parse_callbacks(Box::new(bindgen::CargoCallbacks));
161+
bindgen_builder = bindgen_builder.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()));
162162
}
163163

164164
// Run binding generation and write the output to a file.

tinydtls-sys/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ mod tests {
402402
get_psk_info: Some(echo_get_psk_info),
403403
get_ecdsa_key: None,
404404
verify_ecdsa_key: None,
405+
get_user_parameters: None,
405406
};
406407

407408
// SAFETY: Supplied pointer is valid, dtls_new_context does not do anything with it except
@@ -433,8 +434,6 @@ mod tests {
433434
// this pointer should be valid up until here.
434435
unsafe {
435436
dtls_free_context(server_context);
436-
// To ensure that we don't use the context pointer sometime later (in case the tests are extended later on), we drop the pointer.
437-
std::mem::drop(server_context);
438437
}
439438
}
440439

@@ -463,6 +462,7 @@ mod tests {
463462
get_psk_info: Some(echo_get_psk_info),
464463
get_ecdsa_key: None,
465464
verify_ecdsa_key: None,
465+
get_user_parameters: None,
466466
};
467467

468468
let client_socket = UdpSocket::bind("localhost:0").expect("Could not bind UDP socket");
@@ -512,8 +512,6 @@ mod tests {
512512
// this pointer should be valid up until here.
513513
unsafe {
514514
dtls_free_context(client_context);
515-
// To ensure that we don't use the context pointer sometime later (in case the tests are extended later on), we drop the pointer.
516-
std::mem::drop(client_context);
517515
}
518516
server_thread.join().unwrap();
519517
}

tinydtls-sys/src/tinydtls

0 commit comments

Comments
 (0)