Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sfackler/rust-openssl
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: openssl-v0.10.48
Choose a base ref
...
head repository: sfackler/rust-openssl
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: openssl-v0.10.55
Choose a head ref

Commits on Jan 16, 2023

  1. Copy the full SHA
    6d69447 View commit details
  2. Fixed systest.

    bkstein committed Jan 16, 2023
    Copy the full SHA
    d2e3018 View commit details
  3. Trigger build

    bkstein committed Jan 16, 2023
    Copy the full SHA
    920ec61 View commit details

Commits on Feb 24, 2023

  1. Fixed review comments.

    bkstein committed Feb 24, 2023
    Copy the full SHA
    b821f00 View commit details
  2. Removed emtpy x509_attr.rs

    bkstein committed Feb 24, 2023
    Copy the full SHA
    d77c651 View commit details
  3. clippy.

    bkstein committed Feb 24, 2023
    Copy the full SHA
    0bd4876 View commit details

Commits on Feb 27, 2023

  1. Copy the full SHA
    9f8c821 View commit details
  2. Removed unnecessary cfg_if's.

    bkstein committed Feb 27, 2023
    Copy the full SHA
    f134271 View commit details
  3. rustfmt hit me once more

    bkstein committed Feb 27, 2023
    Copy the full SHA
    9c30e4e View commit details

Commits on Mar 25, 2023

  1. Bump syn dep to 2

    KamilaBorowska committed Mar 25, 2023
    Copy the full SHA
    8f3da5e View commit details
  2. Merge pull request #1857 from xfix/syn2

    Bump syn dep to 2
    alex authored Mar 25, 2023
    Copy the full SHA
    7478585 View commit details

Commits on Mar 27, 2023

  1. Copy the full SHA
    7632ba6 View commit details
  2. Copy the full SHA
    30aa408 View commit details
  3. Copy the full SHA
    3b25d11 View commit details

Commits on Mar 28, 2023

  1. Copy the full SHA
    95680c8 View commit details
  2. Copy the full SHA
    a888f7a View commit details
  3. Copy the full SHA
    516f1b5 View commit details

Commits on Mar 30, 2023

  1. Merge pull request #1858 from sfackler/asn1-integer-cmp

    Add ASN.1 Integer comparison and to_owned
    sfackler authored Mar 30, 2023
    Copy the full SHA
    0138f52 View commit details
  2. Copy the full SHA
    4247450 View commit details
  3. Copy the full SHA
    f949d40 View commit details
  4. Merge pull request #1864 from alex/fix-and-check

    Fix syntax error I accidentally pushed to master
    alex authored Mar 30, 2023
    Copy the full SHA
    9d91e73 View commit details
  5. Drop dependency on autocfg

    It's used to check for a Rust version well below our MSRV.
    alex committed Mar 30, 2023
    Copy the full SHA
    c906f18 View commit details
  6. Merge pull request #1863 from alex/drop-autocfg

    Drop dependency on autocfg
    alex authored Mar 30, 2023
    Copy the full SHA
    ded3573 View commit details
  7. Copy the full SHA
    d355cb8 View commit details
  8. Merge pull request #1866 from sfackler/no-ip-sni

    Don't use IP addresses in SNI
    sfackler authored Mar 30, 2023
    Copy the full SHA
    297017d View commit details

Commits on Mar 31, 2023

  1. Copy the full SHA
    42469df View commit details
  2. Merge pull request #1867 from tyilo/patch-1

    Fix typo in documentation for set_{min,max}_proto_version
    Skepfyr authored Mar 31, 2023
    Copy the full SHA
    b127fb2 View commit details
  3. Add basic X509 Distribution Point extension support

    Adds support to read the full name of a distribution point extension.
    
    Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
    steffen-eiden authored and Skepfyr committed Mar 31, 2023
    Copy the full SHA
    34171f4 View commit details
  4. Merge pull request #1801 from steffen-eiden/distpoint

    Add basic X509 Distribution Point extension support
    Skepfyr authored Mar 31, 2023
    Copy the full SHA
    6af36a7 View commit details

Commits on Apr 1, 2023

  1. Copy the full SHA
    29d993f View commit details
  2. Release openssl-sys v0.9.84

    sfackler committed Apr 1, 2023
    Copy the full SHA
    545cfa4 View commit details
  3. Release openssl v0.10.49

    sfackler committed Apr 1, 2023
    Copy the full SHA
    36c474a View commit details
  4. Copy the full SHA
    be65acb View commit details

Commits on Apr 5, 2023

  1. Raise the minimum CC version

    alex authored Apr 5, 2023
    Copy the full SHA
    12a0de5 View commit details
  2. whoops

    alex authored Apr 5, 2023
    Copy the full SHA
    b8559cb View commit details
  3. Merge pull request #1870 from sfackler/alex-patch-1

    Raise the minimum CC version
    sfackler authored Apr 5, 2023
    Copy the full SHA
    05ce5bc View commit details

Commits on Apr 6, 2023

  1. Add in-place cipher update method

    Add the cipher_update_inplace method to CipherCtxRef that permits
    encryption and decryption to happen in-place when the cipher is a stream
    cipher. This avoid the need to allocate a second buffer if the original
    data does not have to be maintained.
    haroldbruintjes committed Apr 6, 2023
    Copy the full SHA
    edf3a16 View commit details

Commits on Apr 7, 2023

  1. Merge pull request #1871 from haroldbruintjes/feature/cipher-inplace

    Add in-place cipher update method
    sfackler authored Apr 7, 2023
    Copy the full SHA
    f74b8e6 View commit details

Commits on Apr 9, 2023

  1. Bump LibreSSL to 3.7.2

    3.7 series is now stable
    vishwin committed Apr 9, 2023
    Copy the full SHA
    1a52fa6 View commit details
  2. Merge pull request #1874 from vishwin/master

    Bump LibreSSL to 3.7.2
    alex authored Apr 9, 2023
    Copy the full SHA
    a03a346 View commit details

Commits on Apr 10, 2023

  1. Release openssl-sys v0.9.85

    sfackler committed Apr 10, 2023
    Copy the full SHA
    b03b9ea View commit details
  2. Release openssl v0.10.50

    sfackler committed Apr 10, 2023
    Copy the full SHA
    8395a89 View commit details
  3. Copy the full SHA
    a27dd4d View commit details
  4. Merge pull request #1876 from reaperhulk/doc-fix

    update documentation to reflect libressl support
    alex authored Apr 10, 2023
    Copy the full SHA
    48876d4 View commit details
  5. Merge pull request #1847 from sfackler/x509-revoked-extra-methods

    Add issuer_name and reason_code to X509RevokedRef
    Skepfyr authored Apr 10, 2023
    Copy the full SHA
    0854ffd View commit details
  6. Copy the full SHA
    47abce4 View commit details

Commits on Apr 16, 2023

  1. Copy the full SHA
    c2fbe9a View commit details
  2. Copy the full SHA
    5e48158 View commit details
  3. Merge pull request #1885 from alex/cmp-error-stack

    Fixes #1884 -- don't leave an error on the stack in public_eq
    sfackler authored Apr 16, 2023
    Copy the full SHA
    bdb165b View commit details
  4. Merge pull request #1883 from alex/dh-set-keys

    Fixes #1882 -- added APIs for setting public keys on Dh
    sfackler authored Apr 16, 2023
    Copy the full SHA
    62189c1 View commit details
Showing with 1,963 additions and 271 deletions.
  1. +15 −4 .github/workflows/ci.yml
  2. +2 −2 openssl-macros/Cargo.toml
  3. +70 −1 openssl-sys/CHANGELOG.md
  4. +2 −3 openssl-sys/Cargo.toml
  5. +4 −0 openssl-sys/build/cfgs.rs
  6. +8 −0 openssl-sys/build/expando.c
  7. +11 −37 openssl-sys/build/main.rs
  8. +10 −3 openssl-sys/build/run_bindgen.rs
  9. +32 −36 openssl-sys/src/err.rs
  10. +20 −0 openssl-sys/src/evp.rs
  11. +59 −4 openssl-sys/src/handwritten/asn1.rs
  12. +1 −1 openssl-sys/src/handwritten/bn.rs
  13. +18 −0 openssl-sys/src/handwritten/cmac.rs
  14. +1 −0 openssl-sys/src/handwritten/dh.rs
  15. +3 −1 openssl-sys/src/handwritten/ec.rs
  16. +15 −0 openssl-sys/src/handwritten/evp.rs
  17. +2 −0 openssl-sys/src/handwritten/mod.rs
  18. +1 −0 openssl-sys/src/handwritten/object.rs
  19. +193 −6 openssl-sys/src/handwritten/pkcs7.rs
  20. +15 −2 openssl-sys/src/handwritten/ssl.rs
  21. +19 −2 openssl-sys/src/handwritten/types.rs
  22. +96 −2 openssl-sys/src/handwritten/x509.rs
  23. +42 −0 openssl-sys/src/handwritten/x509v3.rs
  24. +1 −4 openssl-sys/src/lib.rs
  25. +0 −18 openssl-sys/src/macros.rs
  26. +4 −0 openssl-sys/src/obj_mac.rs
  27. +4 −0 openssl-sys/src/tls1.rs
  28. +11 −0 openssl-sys/src/x509v3.rs
  29. +77 −1 openssl/CHANGELOG.md
  30. +2 −2 openssl/Cargo.toml
  31. +139 −2 openssl/src/asn1.rs
  32. +1 −1 openssl/src/bn.rs
  33. +1 −0 openssl/src/cipher.rs
  34. +77 −0 openssl/src/cipher_ctx.rs
  35. +39 −4 openssl/src/derive.rs
  36. +65 −1 openssl/src/dh.rs
  37. +65 −15 openssl/src/dsa.rs
  38. +17 −3 openssl/src/ec.rs
  39. +1 −1 openssl/src/ecdsa.rs
  40. +1 −1 openssl/src/hash.rs
  41. +1 −2 openssl/src/lib.rs
  42. +1 −1 openssl/src/md_ctx.rs
  43. +12 −7 openssl/src/nid.rs
  44. +15 −11 openssl/src/pkcs5.rs
  45. +32 −30 openssl/src/pkey.rs
  46. +15 −6 openssl/src/pkey_ctx.rs
  47. +1 −1 openssl/src/rsa.rs
  48. +8 −8 openssl/src/sign.rs
  49. +3 −2 openssl/src/ssl/connector.rs
  50. +72 −9 openssl/src/ssl/mod.rs
  51. +60 −2 openssl/src/ssl/test/mod.rs
  52. +10 −9 openssl/src/symm.rs
  53. +30 −5 openssl/src/x509/extension.rs
  54. +317 −15 openssl/src/x509/mod.rs
  55. +176 −3 openssl/src/x509/tests.rs
  56. +3 −1 openssl/src/x509/verify.rs
  57. +19 −0 openssl/test/authority_key_identifier.pem
  58. +23 −0 openssl/test/certv3.pem
  59. +1 −0 openssl/test/certv3_extfile
  60. +10 −0 openssl/test/entry_extensions.crl
  61. +10 −2 systest/build.rs
19 changes: 15 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
@@ -153,7 +154,7 @@ jobs:
- false
library:
- name: boringssl
version: 93e8d4463d59d671e9c5c6171226341f04b07907
version: bcecc7d834fc44ad257b2f23f88e1cf597ab2736
- name: openssl
version: vendored
- name: openssl
@@ -181,7 +182,12 @@ jobs:
bindgen: true
library:
name: libressl
version: 3.7.1
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:
@@ -191,7 +197,12 @@ jobs:
bindgen: false
library:
name: libressl
version: 3.7.1
version: 3.7.3
- target: x86_64-unknown-linux-gnu
bindgen: false
library:
name: libressl
version: 3.8.0
name: ${{ matrix.target }}-${{ matrix.library.name }}-${{ matrix.library.version }}-${{ matrix.bindgen }}
runs-on: ubuntu-latest
env:
@@ -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:
4 changes: 2 additions & 2 deletions openssl-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "openssl-macros"
version = "0.1.0"
version = "0.1.1"
edition = "2018"
license = "MIT/Apache-2.0"
description = "Internal macros used by the openssl crate."
@@ -11,4 +11,4 @@ proc-macro = true
[dependencies]
proc-macro2 = "1"
quote = "1"
syn = { version = "1", features = ["full"] }
syn = { version = "2", features = ["full"] }
71 changes: 70 additions & 1 deletion openssl-sys/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,69 @@

## [Unreleased]

## [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

* Added support for LibreSSL 3.7.x.

## [v0.9.84] - 2023-04-01

### Added

* Added `ASN1_INTEGER_dup` and `ASN1_INTEGER_cmp`.
* Added `stack_st_X509_NAME_ENTRY`.
* Added `DIST_POINT_NAME`, `DIST_POINT`, `stack_st_DIST_POINT`, `DIST_POINT_free`, and `DIST_POINT_NAME_free`.

## [v0.9.83] - 2023-03-23

### Fixed
@@ -410,7 +473,13 @@ 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.83..master
[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.89..master
[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
[v0.9.81]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.80...openssl-sys-v0.9.81
5 changes: 2 additions & 3 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.83"
version = "0.9.89"
authors = [
"Alex Crichton <alex@alexcrichton.com>",
"Steven Fackler <sfackler@gmail.com>",
@@ -24,10 +24,9 @@ bssl-sys = { version = "0.1.0", optional = true }

[build-dependencies]
bindgen = { version = "0.64.0", optional = true, features = ["experimental"] }
cc = "1.0"
cc = "1.0.61"
openssl-src = { version = "111", optional = true }
pkg-config = "0.3.9"
autocfg = "1.0"

[target.'cfg(target_env = "msvc")'.build-dependencies]
vcpkg = "0.2.8"
4 changes: 4 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![];

@@ -91,6 +92,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
8 changes: 8 additions & 0 deletions openssl-sys/build/expando.c
Original file line number Diff line number Diff line change
@@ -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
48 changes: 11 additions & 37 deletions openssl-sys/build/main.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
#![allow(
clippy::inconsistent_digit_grouping,
clippy::uninlined_format_args,
clippy::unusual_byte_groupings
)]

extern crate autocfg;
#[cfg(feature = "bindgen")]
extern crate bindgen;
extern crate cc;
@@ -74,8 +67,6 @@ fn check_ssl_kind() {
}

fn main() {
check_rustc_versions();

check_ssl_kind();

let target = env::var("TARGET").unwrap();
@@ -134,15 +125,6 @@ fn main() {
}
}

fn check_rustc_versions() {
let cfg = autocfg::new();

if cfg.probe_rustc_version(1, 31) {
println!("cargo:rustc-cfg=const_fn");
}
}

#[allow(clippy::let_and_return)]
fn postprocess(include_dirs: &[PathBuf]) -> Version {
let version = validate_headers(include_dirs);

@@ -157,7 +139,7 @@ fn postprocess(include_dirs: &[PathBuf]) -> Version {

/// Validates the header files found in `include_dir` and then returns the
/// version string of OpenSSL.
#[allow(clippy::manual_strip)] // we need to support pre-1.45.0
#[allow(clippy::unusual_byte_groupings)]
fn validate_headers(include_dirs: &[PathBuf]) -> Version {
// This `*-sys` crate only works with OpenSSL 1.0.1, 1.0.2, 1.1.0, 1.1.1 and 3.0.0.
// To correctly expose the right API from this crate, take a look at
@@ -173,9 +155,7 @@ fn validate_headers(include_dirs: &[PathBuf]) -> Version {
// account for compile differences and such.
println!("cargo:rerun-if-changed=build/expando.c");
let mut gcc = cc::Build::new();
for include_dir in include_dirs {
gcc.include(include_dir);
}
gcc.includes(include_dirs);
let expanded = match gcc.file("build/expando.c").try_expand() {
Ok(expanded) => expanded,
Err(e) => {
@@ -221,17 +201,14 @@ See rust-openssl documentation for more information:
let libressl_prefix = "RUST_VERSION_LIBRESSL_";
let boringsl_prefix = "RUST_OPENSSL_IS_BORINGSSL";
let conf_prefix = "RUST_CONF_";
if line.starts_with(openssl_prefix) {
let version = &line[openssl_prefix.len()..];
if let Some(version) = line.strip_prefix(openssl_prefix) {
openssl_version = Some(parse_version(version));
} else if line.starts_with(new_openssl_prefix) {
let version = &line[new_openssl_prefix.len()..];
} else if let Some(version) = line.strip_prefix(new_openssl_prefix) {
openssl_version = Some(parse_new_version(version));
} else if line.starts_with(libressl_prefix) {
let version = &line[libressl_prefix.len()..];
} else if let Some(version) = line.strip_prefix(libressl_prefix) {
libressl_version = Some(parse_version(version));
} else if line.starts_with(conf_prefix) {
enabled.push(&line[conf_prefix.len()..]);
} else if let Some(conf) = line.strip_prefix(conf_prefix) {
enabled.push(conf);
} else if line.starts_with(boringsl_prefix) {
is_boringssl = true;
}
@@ -295,6 +272,8 @@ See rust-openssl documentation for more information:
(3, 6, _) => ('3', '6', 'x'),
(3, 7, 0) => ('3', '7', '0'),
(3, 7, 1) => ('3', '7', '1'),
(3, 7, _) => ('3', '7', 'x'),
(3, 8, 0) => ('3', '8', '0'),
_ => version_error(),
};

@@ -337,26 +316,21 @@ fn version_error() -> ! {
"
This crate is only compatible with OpenSSL (version 1.0.1 through 1.1.1, or 3.0.0), or LibreSSL 2.5
through 3.7.1, but a different version of OpenSSL was found. The build is now aborting
through 3.8.0, but a different version of OpenSSL was found. The build is now aborting
due to this version mismatch.
"
);
}

// parses a string that looks like "0x100020cfL"
#[allow(deprecated)] // trim_right_matches is now trim_end_matches
#[allow(clippy::match_like_matches_macro)] // matches macro requires rust 1.42.0
fn parse_version(version: &str) -> u64 {
// cut off the 0x prefix
assert!(version.starts_with("0x"));
let version = &version[2..];

// and the type specifier suffix
let version = version.trim_right_matches(|c: char| match c {
'0'..='9' | 'a'..='f' | 'A'..='F' => false,
_ => true,
});
let version = version.trim_end_matches(|c: char| !c.is_ascii_hexdigit());

u64::from_str_radix(version, 16).unwrap()
}
13 changes: 10 additions & 3 deletions openssl-sys/build/run_bindgen.rs
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ const INCLUDES: &str = "
#include <openssl/aes.h>
#include <openssl/asn1.h>
#include <openssl/bio.h>
#include <openssl/cmac.h>
#include <openssl/conf.h>
#include <openssl/crypto.h>
#include <openssl/dh.h>
@@ -109,12 +110,15 @@ pub fn run_boringssl(include_dirs: &[PathBuf]) {
let mut builder = bindgen::builder()
.rust_target(RustTarget::Stable_1_47)
.ctypes_prefix("::libc")
.raw_line("use libc::*;")
.derive_default(false)
.enable_function_attribute_detection()
.size_t_is_usize(true)
.default_macro_constant_type(MacroTypeVariation::Signed)
.rustified_enum("point_conversion_form_t")
.allowlist_file(".*/openssl/[^/]+\\.h")
.allowlist_recursively(false)
.blocklist_function("BIO_vsnprintf")
.blocklist_function("OPENSSL_vasprintf")
.wrap_static_fns(true)
.wrap_static_fns_path(out_dir.join("boring_static_wrapper").display().to_string())
.layout_tests(false)
@@ -163,14 +167,17 @@ pub fn run_boringssl(include_dirs: &[PathBuf]) {
bindgen_cmd
.arg("-o")
.arg(out_dir.join("bindgen.rs"))
.arg("--rust-target=1.47")
.arg("--rust-target=1.56")
.arg("--ctypes-prefix=::libc")
.arg("--raw-line=use libc::*;")
.arg("--no-derive-default")
.arg("--enable-function-attribute-detection")
.arg("--size_t-is-usize")
.arg("--default-macro-constant-type=signed")
.arg("--rustified-enum=point_conversion_form_t")
.arg("--allowlist-file=.*/openssl/[^/]+\\.h")
.arg("--no-recursive-allowlist")
.arg("--blocklist-function=BIO_vsnprintf")
.arg("--blocklist-function=OPENSSL_vasprintf")
.arg("--experimental")
.arg("--wrap-static-fns")
.arg("--wrap-static-fns-path")
Loading