Skip to content

Commit dcf250e

Browse files
committed
Fixed two UAFs and bumped versions for release
1 parent 7c7b2e6 commit dcf250e

File tree

6 files changed

+55
-7
lines changed

6 files changed

+55
-7
lines changed

openssl-sys/CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## [Unreleased]
44

5+
## [v0.9.107] - 2025-04-04
6+
7+
### Added
8+
9+
* Support for building with AWS-LC.
10+
511
## [v0.9.106] - 2025-02-15
612

713
### Added
@@ -636,7 +642,8 @@ Fixed builds against OpenSSL built with `no-cast`.
636642
* Added `X509_verify` and `X509_REQ_verify`.
637643
* Added `EVP_MD_type` and `EVP_GROUP_get_curve_name`.
638644

639-
[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.106..master
645+
[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.107..master
646+
[v0.9.107]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.106...openssl-sys-v0.9.107
640647
[v0.9.106]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.105...openssl-sys-v0.9.106
641648
[v0.9.105]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.104...openssl-sys-v0.9.105
642649
[v0.9.104]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.103...openssl-sys-v0.9.104

openssl-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "openssl-sys"
3-
version = "0.9.106"
3+
version = "0.9.107"
44
authors = [
55
"Alex Crichton <[email protected]>",
66
"Steven Fackler <[email protected]>",

openssl/CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
## [Unreleased]
44

5+
## [v0.10.72] - 2025-04-04
6+
7+
### Fixed
8+
9+
* Fixed use-after-free in `Md::fetch` and `Cipher::fetch` when `properties` is `Some(...)`. In practice this use-after-free most likely resulted in OpenSSL treating the `properties` as `b""`.
10+
11+
### Added
12+
13+
* Support for building with AWS-LC.
14+
515
## [v0.10.71] - 2025-02-15
616

717
### Added
@@ -959,7 +969,8 @@
959969

960970
Look at the [release tags] for information about older releases.
961971

962-
[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.71...master
972+
[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.72...master
973+
[v0.10.72]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.71...openssl-v0.10.72
963974
[v0.10.71]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.70...openssl-v0.10.71
964975
[v0.10.70]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.69...openssl-v0.10.70
965976
[v0.10.69]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.68...openssl-v0.10.69

openssl/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "openssl"
3-
version = "0.10.71"
3+
version = "0.10.72"
44
authors = ["Steven Fackler <[email protected]>"]
55
license = "Apache-2.0"
66
description = "OpenSSL bindings"
@@ -32,7 +32,7 @@ libc = "0.2"
3232
once_cell = "1.5.2"
3333

3434
openssl-macros = { version = "0.1.1", path = "../openssl-macros" }
35-
ffi = { package = "openssl-sys", version = "0.9.106", path = "../openssl-sys" }
35+
ffi = { package = "openssl-sys", version = "0.9.107", path = "../openssl-sys" }
3636

3737
[dev-dependencies]
3838
hex = "0.4"

openssl/src/cipher.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl Cipher {
146146
let ptr = cvt_p(ffi::EVP_CIPHER_fetch(
147147
ctx.map_or(ptr::null_mut(), ForeignTypeRef::as_ptr),
148148
algorithm.as_ptr(),
149-
properties.map_or(ptr::null_mut(), |s| s.as_ptr()),
149+
properties.as_ref().map_or(ptr::null_mut(), |s| s.as_ptr()),
150150
))?;
151151

152152
Ok(Cipher::from_ptr(ptr))
@@ -595,3 +595,18 @@ impl CipherRef {
595595
unsafe { EVP_CIPHER_block_size(self.as_ptr()) as usize }
596596
}
597597
}
598+
599+
#[cfg(test)]
600+
mod test {
601+
#[cfg(ossl300)]
602+
use super::Cipher;
603+
604+
#[test]
605+
#[cfg(ossl300)]
606+
fn test_cipher_fetch_properties() {
607+
assert!(matches!(
608+
Cipher::fetch(None, "AES-128-GCM", Some("provider=gibberish")),
609+
Err(_)
610+
));
611+
}
612+
}

openssl/src/md.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl Md {
109109
let ptr = cvt_p(ffi::EVP_MD_fetch(
110110
ctx.map_or(ptr::null_mut(), ForeignTypeRef::as_ptr),
111111
algorithm.as_ptr(),
112-
properties.map_or(ptr::null_mut(), |s| s.as_ptr()),
112+
properties.as_ref().map_or(ptr::null_mut(), |s| s.as_ptr()),
113113
))?;
114114

115115
Ok(Md::from_ptr(ptr))
@@ -233,3 +233,18 @@ impl MdRef {
233233
unsafe { Nid::from_raw(ffi::EVP_MD_type(self.as_ptr())) }
234234
}
235235
}
236+
237+
#[cfg(test)]
238+
mod test {
239+
#[cfg(ossl300)]
240+
use super::Md;
241+
242+
#[test]
243+
#[cfg(ossl300)]
244+
fn test_md_fetch_properties() {
245+
assert!(matches!(
246+
Md::fetch(None, "SHA-256", Some("provider=gibberish")),
247+
Err(_)
248+
));
249+
}
250+
}

0 commit comments

Comments
 (0)