Skip to content

Commit 3ccd389

Browse files
authored
Merge branch 'sfackler:master' into implement_crl_revoke
2 parents 75397e8 + 9f29412 commit 3ccd389

File tree

8 files changed

+61
-8
lines changed

8 files changed

+61
-8
lines changed

openssl-sys/CHANGELOG.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,20 @@
22

33
## [Unreleased]
44

5+
## [v0.9.101] - 2024-02-21
6+
7+
### Fixed
8+
9+
* Fixed a bug where, when building with the `vendored` feature, this crate always needed to be rebuilt.
10+
11+
## [v0.9.100] - 2024-02-19
12+
513
### Added
614

715
* Added `OSSL_PARAM`, `OSSL_PARAM_construct_uint` , `OSSL_PARAM_construct_end`.
816
* Added `EVP_PKEY_CTX_set_params` and `EVP_PKEY_CTX_get_params`.
17+
* Added `X509_alias_get0`.
18+
* Added `EVP_default_properties_enable_fips`.
919

1020
## [v0.9.99] - 2024-01-19
1121

@@ -583,7 +593,9 @@ Fixed builds against OpenSSL built with `no-cast`.
583593
* Added `X509_verify` and `X509_REQ_verify`.
584594
* Added `EVP_MD_type` and `EVP_GROUP_get_curve_name`.
585595

586-
[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.99..master
596+
[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.101..master
597+
[v0.9.101]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.100...openssl-sys-v0.9.101
598+
[v0.9.100]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.99...openssl-sys-v0.9.100
587599
[v0.9.99]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.98...openssl-sys-v0.9.99
588600
[v0.9.98]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.97...openssl-sys-v0.9.98
589601
[v0.9.97]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.96...openssl-sys-v0.9.97

openssl-sys/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "openssl-sys"
3-
version = "0.9.99"
3+
version = "0.9.101"
44
authors = [
55
"Alex Crichton <[email protected]>",
66
"Steven Fackler <[email protected]>",

openssl-sys/build/main.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,14 @@ fn main() {
7979
let target = env::var("TARGET").unwrap();
8080

8181
let (lib_dirs, include_dir) = find_openssl(&target);
82-
if let Some(printable_include) = include_dir.join("openssl").to_str() {
83-
println!("cargo:rerun-if-changed={}", printable_include);
82+
// rerun-if-changed causes openssl-sys to rebuild if the openssl include
83+
// dir has changed since the last build. However, this causes a rebuild
84+
// every time when vendoring so we disable it.
85+
let potential_path = include_dir.join("openssl");
86+
if potential_path.exists() && !cfg!(feature = "vendored") {
87+
if let Some(printable_include) = potential_path.to_str() {
88+
println!("cargo:rerun-if-changed={}", printable_include);
89+
}
8490
}
8591

8692
if !lib_dirs.iter().all(|p| p.exists()) {

openssl-sys/src/handwritten/x509.rs

+1
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ extern "C" {
311311
pub fn X509_get_version(x: *const X509) -> c_long;
312312
pub fn X509_set_serialNumber(x: *mut X509, sn: *mut ASN1_INTEGER) -> c_int;
313313
pub fn X509_get_serialNumber(x: *mut X509) -> *mut ASN1_INTEGER;
314+
pub fn X509_alias_get0(x: *mut X509, len: *mut c_int) -> *mut c_uchar;
314315
}
315316
const_ptr_api! {
316317
extern "C" {

openssl/CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
## [Unreleased]
44

5+
## [v0.10.64] - 2024-02-19
6+
57
### Added
68

79
* Added `PkeyCtxRef::{nonce_type, set_nonce_type}`.
10+
* Added `X509Ref::alias`.
11+
812

913
## [v0.10.63] - 2024-01-19
1014

@@ -888,7 +892,8 @@
888892

889893
Look at the [release tags] for information about older releases.
890894

891-
[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.63...master
895+
[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.64...master
896+
[v0.10.64]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.63...openssl-v0.10.64
892897
[v0.10.63]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.62...openssl-v0.10.63
893898
[v0.10.62]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.61...openssl-v0.10.62
894899
[v0.10.61]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.60...openssl-v0.10.61

openssl/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "openssl"
3-
version = "0.10.63"
3+
version = "0.10.64"
44
authors = ["Steven Fackler <[email protected]>"]
55
license = "Apache-2.0"
66
description = "OpenSSL bindings"
@@ -30,7 +30,7 @@ libc = "0.2"
3030
once_cell = "1.5.2"
3131

3232
openssl-macros = { version = "0.1.0", path = "../openssl-macros" }
33-
ffi = { package = "openssl-sys", version = "0.9.99", path = "../openssl-sys" }
33+
ffi = { package = "openssl-sys", version = "0.9.100", path = "../openssl-sys" }
3434

3535
[dev-dependencies]
3636
hex = "0.3"

openssl/src/pkcs12.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,20 @@ mod test {
304304
let parsed = pkcs12.parse2("mypass").unwrap();
305305

306306
assert_eq!(
307-
hex::encode(parsed.cert.unwrap().digest(MessageDigest::sha1()).unwrap()),
307+
hex::encode(
308+
parsed
309+
.cert
310+
.as_ref()
311+
.unwrap()
312+
.digest(MessageDigest::sha1())
313+
.unwrap()
314+
),
308315
"59172d9313e84459bcff27f967e79e6e9217e584"
309316
);
317+
assert_eq!(
318+
parsed.cert.as_ref().unwrap().alias(),
319+
Some(b"foobar.com" as &[u8])
320+
);
310321

311322
let chain = parsed.ca.unwrap();
312323
assert_eq!(chain.len(), 1);

openssl/src/x509/mod.rs

+18
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,24 @@ impl X509Ref {
650650
}
651651
}
652652

653+
/// Returns this certificate's "alias". This field is populated by
654+
/// OpenSSL in some situations -- specifically OpenSSL will store a
655+
/// PKCS#12 `friendlyName` in this field. This is not a part of the X.509
656+
/// certificate itself, OpenSSL merely attaches it to this structure in
657+
/// memory.
658+
#[corresponds(X509_alias_get0)]
659+
pub fn alias(&self) -> Option<&[u8]> {
660+
unsafe {
661+
let mut len = 0;
662+
let ptr = ffi::X509_alias_get0(self.as_ptr(), &mut len);
663+
if ptr.is_null() {
664+
None
665+
} else {
666+
Some(slice::from_raw_parts(ptr, len as usize))
667+
}
668+
}
669+
}
670+
653671
to_pem! {
654672
/// Serializes the certificate into a PEM-encoded X509 structure.
655673
///

0 commit comments

Comments
 (0)