Skip to content

Commit

Permalink
Merge branch 'sfackler:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
TheEnbyperor authored Sep 7, 2023
2 parents 4d9f582 + 6b3b9fc commit 6844301
Show file tree
Hide file tree
Showing 68 changed files with 2,391 additions and 263 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Remember to also update `--rust-target` in `openssl-sys/build/run_bindgen.rs`
- uses: sfackler/actions/rustup@master
with:
version: 1.56.0
Expand Down Expand Up @@ -153,14 +154,14 @@ jobs:
- false
library:
- name: boringssl
version: 93e8d4463d59d671e9c5c6171226341f04b07907
version: bcecc7d834fc44ad257b2f23f88e1cf597ab2736
- name: openssl
version: vendored
- name: openssl
version: 3.1.0
version: 3.1.2
dl-path: /
- name: openssl
version: 1.1.1t
version: 1.1.1v
dl-path: /
- name: openssl
version: 1.1.0l
Expand All @@ -181,7 +182,12 @@ jobs:
bindgen: true
library:
name: libressl
version: 3.7.2
version: 3.7.3
- target: x86_64-unknown-linux-gnu
bindgen: true
library:
name: libressl
version: 3.8.0
- target: x86_64-unknown-linux-gnu
bindgen: false
library:
Expand All @@ -191,7 +197,12 @@ jobs:
bindgen: false
library:
name: libressl
version: 3.7.2
version: 3.7.3
- target: x86_64-unknown-linux-gnu
bindgen: false
library:
name: libressl
version: 3.8.1
name: ${{ matrix.target }}-${{ matrix.library.name }}-${{ matrix.library.version }}-${{ matrix.bindgen }}
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -310,7 +321,7 @@ jobs:
- run: |
mkdir -p .cargo
echo '[patch.crates-io]' > .cargo/config.toml
echo 'bssl-sys = { path = "'$OPENSSL_DIR'/rust" }' >> .cargo/config.toml
echo 'bssl-sys = { path = "'$OPENSSL_DIR'/rust/bssl-sys" }' >> .cargo/config.toml
if: matrix.library.name == 'boringssl' && !matrix.bindgen
- uses: actions/cache@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion openssl-errors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "openssl-errors"
version = "0.2.0"
authors = ["Steven Fackler <[email protected]>"]
edition = "2018"
license = "MIT/Apache-2.0"
license = "MIT OR Apache-2.0"
description = "Custom error library support for the openssl crate."
repository = "https://github.com/sfackler/rust-openssl"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion openssl-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "openssl-macros"
version = "0.1.1"
edition = "2018"
license = "MIT/Apache-2.0"
license = "MIT OR Apache-2.0"
description = "Internal macros used by the openssl crate."

[lib]
Expand Down
96 changes: 94 additions & 2 deletions openssl-sys/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,90 @@

## [Unreleased]

## [v0.9.93] - 2023-09-04

### Changed

* The `vendored` Cargo feature now builds OpenSSL 3.1, as 1.1.1 is reaching its EOL.

### Added

* Added support for LibreSSL 3.8.1.

## [v0.9.92] - 2023-08-27

### Added

* Added `EVP_CIPHER_CTX_copy`
* Expose `EVP_chacha20_poly1305` on LibreSSL
* Added `X509_VERIFY_PARAM_set1_email`

## [v0.9.91] - 2023-08-06

### Added

* Expose `poly1305_state`, `CRYPTO_poly1305_init`, `CRYPTO_poly1305_update`, and `CRYPTO_poly1305_finish` on BoringSSL and LibreSSL.
* Fix detection of libraries on OpenBSD.
* Added `EC_POINT_point2hex` and `EC_POINT_hex2point`.
* Added `EVP_PKEY_verify_recover_init`, `EVP_PKEY_verify_recover`, and `EVP_PKEY_CTX_set_signature_md`.
* Added `EVP_CIPHER_CTX_FLAG_WRAP_ALLOW` and `EVP_CTX_set_flags`.
* Added `BN_mod_sqrt`.

## [v0.9.90] - 2023-06-20

### Fixed

* Fixed compilation with BoringSSL when building with the bindgen CLI.

## [v0.9.89] - 2023-06-20

### Fixed

* Fixed compilation with recent versions of BoringSSL.

### Added

* Added support for detecting OpenSSL compiled with `OPENSSL_NO_OCB`.
* Added `EVP_PKEY_SM2` and `NID_sm2`.
* Added `EVP_PKEY_assign_RSA`, `EVP_PKEY_assign_DSA`, `EVP_PKEY_assign_DH`, and `EVP_PKEY_assign_EC_KEY`.
* Added `EC_GROUP_get_asn1_flag`.
* Expose `EC_POINT_get_affine_coordinates` on BoringSSL and LibreSSL.
* Added `EVP_PKEY_derive_set_peer_ex`.

## [v0.9.88] - 2023-05-30

### Added

* Added support for the LibreSSL 3.8.0.
* Added support for detecting `OPENSSL_NO_RC4`.
* Added `OBJ_dup`.
* Added `ASN1_TYPE_new`, `ASN1_TYPE_set`, `d2i_ASN1_TYPE`, and `i2d_ASN1_TYPE`.
* Added `SSL_bytes_to_cipher_list`, `SSL_CTX_get_num_tickets`, and `SSL_get_num_tickets`.
* Added `GENERAL_NAME_set0_othername`.
* Added `X509_get_pathlen`.

## [v0.9.87] - 2023-04-24

### Added

* Added `DH_CHECK`.
* Added `CMAC_CTX_new`, `CMAC_CTX_free`, `CMAC_Init`, `CMAC_Update`, `CMAC_Final`, and `CMAC_CTX_copy`.
* Added `EVP_default_properties_is_fips_enabled`.
* Added `X509_get0_subject_key_id`, `X509_get0_authority_key_id`, `X509_get0_authority_issuer`, and `X509_get0_authority_serial`.
* Added `NID_poly1305`.


## [v0.9.86] - 2023-04-20

### Fixed

* Fixed BoringSSL support with the latest bindgen release.

### Added

* Added bindings for PKCS#7 functions and more X.509 functions.


## [v0.9.85] - 2023-04-09

### Added
Expand Down Expand Up @@ -424,8 +508,16 @@ Fixed builds against OpenSSL built with `no-cast`.
* Added `X509_verify` and `X509_REQ_verify`.
* Added `EVP_MD_type` and `EVP_GROUP_get_curve_name`.

[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.85..master
[v0.9.85]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.85...openssl-sys-v0.9.85
[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.93..master
[v0.9.93]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.92...openssl-sys-v0.9.93
[v0.9.92]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.91...openssl-sys-v0.9.92
[v0.9.91]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.90...openssl-sys-v0.9.91
[v0.9.90]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.89...openssl-sys-v0.9.90
[v0.9.89]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.88...openssl-sys-v0.9.89
[v0.9.88]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.87...openssl-sys-v0.9.88
[v0.9.87]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.86...openssl-sys-v0.9.87
[v0.9.86]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.85...openssl-sys-v0.9.86
[v0.9.85]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.84...openssl-sys-v0.9.85
[v0.9.84]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.83...openssl-sys-v0.9.84
[v0.9.83]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.82...openssl-sys-v0.9.83
[v0.9.82]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.81...openssl-sys-v0.9.82
Expand Down
6 changes: 2 additions & 4 deletions openssl-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "openssl-sys"
version = "0.9.85"
version = "0.9.93"
authors = [
"Alex Crichton <[email protected]>",
"Steven Fackler <[email protected]>",
Expand All @@ -25,10 +25,8 @@ bssl-sys = { version = "0.1.0", optional = true }
[build-dependencies]
bindgen = { version = "0.64.0", optional = true, features = ["experimental"] }
cc = "1.0.61"
openssl-src = { version = "111", optional = true }
openssl-src = { version = "300.1.2", optional = true, features = ["legacy"] }
pkg-config = "0.3.9"

[target.'cfg(target_env = "msvc")'.build-dependencies]
vcpkg = "0.2.8"

# We don't actually use metadeps for annoying reasons but this is still here for tooling
Expand Down
7 changes: 7 additions & 0 deletions openssl-sys/build/cfgs.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[allow(clippy::unusual_byte_groupings)]
pub fn get(openssl_version: Option<u64>, libressl_version: Option<u64>) -> Vec<&'static str> {
let mut cfgs = vec![];

Expand Down Expand Up @@ -52,6 +53,9 @@ pub fn get(openssl_version: Option<u64>, libressl_version: Option<u64>) -> Vec<&
if libressl_version >= 0x3_07_00_00_0 {
cfgs.push("libressl370");
}
if libressl_version >= 0x3_08_01_00_0 {
cfgs.push("libressl381");
}
} else {
let openssl_version = openssl_version.unwrap();

Expand Down Expand Up @@ -91,6 +95,9 @@ pub fn get(openssl_version: Option<u64>, libressl_version: Option<u64>) -> Vec<&
if openssl_version >= 0x1_01_01_03_0 {
cfgs.push("ossl111c");
}
if openssl_version >= 0x1_01_01_04_0 {
cfgs.push("ossl111d");
}
}

cfgs
Expand Down
12 changes: 12 additions & 0 deletions openssl-sys/build/expando.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,18 @@ RUST_CONF_OPENSSL_NO_NEXTPROTONEG
RUST_CONF_OPENSSL_NO_OCSP
#endif

#ifdef OPENSSL_NO_OCB
RUST_CONF_OPENSSL_NO_OCB
#endif

#ifdef OPENSSL_NO_PSK
RUST_CONF_OPENSSL_NO_PSK
#endif

#ifdef OPENSSL_NO_RC4
RUST_CONF_OPENSSL_NO_RC4
#endif

#ifdef OPENSSL_NO_RFC3779
RUST_CONF_OPENSSL_NO_RFC3779
#endif
Expand All @@ -103,6 +111,10 @@ RUST_CONF_OPENSSL_NO_SSL3_METHOD
RUST_CONF_OPENSSL_NO_TLSEXT
#endif

#ifdef OPENSSL_NO_SOCK
RUST_CONF_OPENSSL_NO_SOCK
#endif

#ifdef OPENSSL_NO_STDIO
RUST_CONF_OPENSSL_NO_STDIO
#endif
Expand Down
21 changes: 10 additions & 11 deletions openssl-sys/build/find_normal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ fn find_openssl_dir(target: &str) -> OsString {
try_pkg_config();
try_vcpkg();

// FreeBSD ships with OpenSSL but doesn't include a pkg-config file :(
if host == target && target.contains("freebsd") {
// FreeBSD and OpenBSD ship with Libre|OpenSSL but don't include a pkg-config file
if host == target && (target.contains("freebsd") || target.contains("openbsd")) {
return OsString::from("/usr");
}

Expand Down Expand Up @@ -198,13 +198,11 @@ fn try_pkg_config() {
let target = env::var("TARGET").unwrap();
let host = env::var("HOST").unwrap();

// If we're going to windows-gnu we can use pkg-config, but only so long as
// we're coming from a windows host.
//
// Otherwise if we're going to windows we probably can't use pkg-config.
// FIXME we really shouldn't be automatically enabling this
if target.contains("windows-gnu") && host.contains("windows") {
env::set_var("PKG_CONFIG_ALLOW_CROSS", "1");
} else if target.contains("windows") {
} else if target.contains("windows-msvc") {
// MSVC targets use vcpkg instead.
return;
}

Expand Down Expand Up @@ -232,8 +230,12 @@ fn try_pkg_config() {
///
/// Note that if this succeeds then the function does not return as vcpkg
/// should emit all of the cargo metadata that we need.
#[cfg(target_env = "msvc")]
fn try_vcpkg() {
let target = env::var("TARGET").unwrap();
if !target.contains("windows") {
return;
}

// vcpkg will not emit any metadata if it can not find libraries
// appropriate for the target triple with the desired linkage.

Expand All @@ -257,9 +259,6 @@ fn try_vcpkg() {
process::exit(0);
}

#[cfg(not(target_env = "msvc"))]
fn try_vcpkg() {}

fn execute_command_and_get_output(cmd: &str, args: &[&str]) -> Option<String> {
let out = Command::new(cmd).args(args).output();
if let Ok(ref r1) = out {
Expand Down
Loading

0 comments on commit 6844301

Please sign in to comment.