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.46
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.47
Choose a head ref
  • 11 commits
  • 12 files changed
  • 2 contributors

Commits on Mar 15, 2023

  1. fix changelog

    sfackler committed Mar 15, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    816eb64 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2fe8b94 View commit details
  3. Merge pull request #1845 from alex/25519-is-boring

    Enable X/Ed25519 support on BoringSSL
    sfackler authored Mar 15, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    39d1436 View commit details
  4. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0d44062 View commit details
  5. Merge pull request #1846 from alex/25519-is-libre

    Enable X/Ed25519 support on LibreSSL 3.7.0
    sfackler authored Mar 15, 2023
    Copy the full SHA
    9ea51ec View commit details

Commits on Mar 19, 2023

  1. Copy the full SHA
    4bc21b0 View commit details
  2. Merge pull request #1848 from alex/expose-lib-reason

    Expose the raw library and reason codes on Error
    sfackler authored Mar 19, 2023
    Copy the full SHA
    e62129f View commit details
  3. bump libressl to 3.7.1

    sfackler committed Mar 19, 2023
    Copy the full SHA
    286320c View commit details
  4. Merge pull request #1849 from sfackler/libressl-371

    Support LibreSSL 3.7.1
    sfackler authored Mar 19, 2023
    Copy the full SHA
    f533aa1 View commit details
  5. Release openssl-sys v0.9.82

    sfackler committed Mar 19, 2023
    Copy the full SHA
    803e245 View commit details
  6. Release openssl v0.10.47

    sfackler committed Mar 19, 2023
    Copy the full SHA
    ead5e0a View commit details
24 changes: 2 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -181,17 +181,7 @@ jobs:
bindgen: true
library:
name: libressl
version: 3.5.3
- target: x86_64-unknown-linux-gnu
bindgen: true
library:
name: libressl
version: 3.6.1
- target: x86_64-unknown-linux-gnu
bindgen: true
library:
name: libressl
version: 3.7.0
version: 3.7.1
- target: x86_64-unknown-linux-gnu
bindgen: false
library:
@@ -201,17 +191,7 @@ jobs:
bindgen: false
library:
name: libressl
version: 3.5.3
- target: x86_64-unknown-linux-gnu
bindgen: false
library:
name: libressl
version: 3.6.1
- target: x86_64-unknown-linux-gnu
bindgen: false
library:
name: libressl
version: 3.7.0
version: 3.7.1
name: ${{ matrix.target }}-${{ matrix.library.name }}-${{ matrix.library.version }}-${{ matrix.bindgen }}
runs-on: ubuntu-latest
env:
11 changes: 10 additions & 1 deletion openssl-sys/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,13 @@

## [Unreleased]

## [v0.9.82] - 2023-03-19

### Added

* Added support for LibreSSL 3.7.1.
* Added support for X25519 and Ed25519 on LibreSSL and BoringSSL.

## [v0.9.81] - 2023-03-14

### Fixed
@@ -392,7 +399,9 @@ 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.80..master
[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.82..master
[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
[v0.9.80]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.79...openssl-sys-v0.9.80
[v0.9.79]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.78...openssl-sys-v0.9.79
[v0.9.78]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.77...openssl-sys-v0.9.78
2 changes: 1 addition & 1 deletion 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.81"
version = "0.9.82"
authors = [
"Alex Crichton <alex@alexcrichton.com>",
"Steven Fackler <sfackler@gmail.com>",
3 changes: 2 additions & 1 deletion openssl-sys/build/main.rs
Original file line number Diff line number Diff line change
@@ -294,6 +294,7 @@ See rust-openssl documentation for more information:
(3, 6, 0) => ('3', '6', '0'),
(3, 6, _) => ('3', '6', 'x'),
(3, 7, 0) => ('3', '7', '0'),
(3, 7, 1) => ('3', '7', '1'),
_ => version_error(),
};

@@ -336,7 +337,7 @@ 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.0, but a different version of OpenSSL was found. The build is now aborting
through 3.7.1, but a different version of OpenSSL was found. The build is now aborting
due to this version mismatch.
"
4 changes: 2 additions & 2 deletions openssl-sys/src/evp.rs
Original file line number Diff line number Diff line change
@@ -10,9 +10,9 @@ pub const EVP_PKEY_RSA: c_int = NID_rsaEncryption;
pub const EVP_PKEY_DSA: c_int = NID_dsa;
pub const EVP_PKEY_DH: c_int = NID_dhKeyAgreement;
pub const EVP_PKEY_EC: c_int = NID_X9_62_id_ecPublicKey;
#[cfg(ossl111)]
#[cfg(any(ossl111, libressl370))]
pub const EVP_PKEY_X25519: c_int = NID_X25519;
#[cfg(ossl111)]
#[cfg(any(ossl111, libressl370))]
pub const EVP_PKEY_ED25519: c_int = NID_ED25519;
#[cfg(ossl111)]
pub const EVP_PKEY_X448: c_int = NID_X448;
4 changes: 2 additions & 2 deletions openssl-sys/src/handwritten/evp.rs
Original file line number Diff line number Diff line change
@@ -230,7 +230,7 @@ cfg_if! {
}
}
cfg_if! {
if #[cfg(ossl111)] {
if #[cfg(any(ossl111, libressl370))] {
extern "C" {
pub fn EVP_DigestSign(
ctx: *mut EVP_MD_CTX,
@@ -566,7 +566,7 @@ const_ptr_api! {
}

cfg_if! {
if #[cfg(any(ossl111))] {
if #[cfg(any(ossl111, libressl370))] {
extern "C" {
pub fn EVP_PKEY_get_raw_public_key(
pkey: *const EVP_PKEY,
4 changes: 4 additions & 0 deletions openssl-sys/src/obj_mac.rs
Original file line number Diff line number Diff line change
@@ -920,12 +920,16 @@ pub const NID_aes_192_cbc_hmac_sha1: c_int = 917;
pub const NID_aes_256_cbc_hmac_sha1: c_int = 918;
#[cfg(ossl111)]
pub const NID_X25519: c_int = 1034;
#[cfg(libressl370)]
pub const NID_X25519: c_int = 950;
#[cfg(ossl111)]
pub const NID_X448: c_int = 1035;
#[cfg(ossl110)]
pub const NID_hkdf: c_int = 1036;
#[cfg(ossl111)]
pub const NID_ED25519: c_int = 1087;
#[cfg(libressl370)]
pub const NID_ED25519: c_int = 952;
#[cfg(ossl111)]
pub const NID_ED448: c_int = 1088;
#[cfg(ossl111)]
10 changes: 9 additions & 1 deletion openssl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,13 @@

## [Unreleased]

## [v0.10.47] - 2023-03-19

### Added

* Added support for X25519 and Ed25519 on LibreSSL and BoringSSL.
* Added `Error::library_code` and `Error::reason_code`.

## [v0.10.46] - 2023-03-14

### Fixed
@@ -690,7 +697,8 @@

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

[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.46...master
[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.47...master
[v0.10.47]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.46...openssl-v0.10.47
[v0.10.46]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.45...openssl-v0.10.46
[v0.10.45]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.44...openssl-v0.10.45
[v0.10.44]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.43...openssl-v0.10.44
4 changes: 2 additions & 2 deletions openssl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "openssl"
version = "0.10.46"
version = "0.10.47"
authors = ["Steven Fackler <sfackler@gmail.com>"]
license = "Apache-2.0"
description = "OpenSSL bindings"
@@ -30,7 +30,7 @@ libc = "0.2"
once_cell = "1.5.2"

openssl-macros = { version = "0.1.0", path = "../openssl-macros" }
ffi = { package = "openssl-sys", version = "0.9.81", path = "../openssl-sys" }
ffi = { package = "openssl-sys", version = "0.9.82", path = "../openssl-sys" }

[dev-dependencies]
hex = "0.3"
48 changes: 37 additions & 11 deletions openssl/src/error.rs
Original file line number Diff line number Diff line change
@@ -198,11 +198,7 @@ impl Error {
self.line,
self.func.as_ref().map_or(ptr::null(), |s| s.as_ptr()),
);
ffi::ERR_set_error(
ffi::ERR_GET_LIB(self.code),
ffi::ERR_GET_REASON(self.code),
ptr::null(),
);
ffi::ERR_set_error(self.library_code(), self.reason_code(), ptr::null());
}
}

@@ -214,9 +210,9 @@ impl Error {
let line = self.line.try_into().unwrap();
unsafe {
ffi::ERR_put_error(
ffi::ERR_GET_LIB(self.code),
self.library_code(),
ffi::ERR_GET_FUNC(self.code),
ffi::ERR_GET_REASON(self.code),
self.reason_code(),
self.file.as_ptr(),
line,
);
@@ -240,6 +236,15 @@ impl Error {
}
}

/// Returns the raw OpenSSL error constant for the library reporting the
/// error.
// On BoringSSL ERR_GET_{LIB,FUNC,REASON} are `unsafe`, but on
// OpenSSL/LibreSSL they're safe.
#[allow(unused_unsafe)]
pub fn library_code(&self) -> libc::c_int {
unsafe { ffi::ERR_GET_LIB(self.code) }
}

/// Returns the name of the function reporting the error.
pub fn function(&self) -> Option<RetStr<'_>> {
self.func.as_ref().map(|s| s.as_str())
@@ -257,6 +262,14 @@ impl Error {
}
}

/// Returns the raw OpenSSL error constant for the reason for the error.
// On BoringSSL ERR_GET_{LIB,FUNC,REASON} are `unsafe`, but on
// OpenSSL/LibreSSL they're safe.
#[allow(unused_unsafe)]
pub fn reason_code(&self) -> libc::c_int {
unsafe { ffi::ERR_GET_REASON(self.code) }
}

/// Returns the name of the source file which encountered the error.
pub fn file(&self) -> RetStr<'_> {
self.file.as_str()
@@ -304,17 +317,15 @@ impl fmt::Display for Error {
write!(fmt, "error:{:08X}", self.code())?;
match self.library() {
Some(l) => write!(fmt, ":{}", l)?,
None => write!(fmt, ":lib({})", unsafe { ffi::ERR_GET_LIB(self.code()) })?,
None => write!(fmt, ":lib({})", self.library_code())?,
}
match self.function() {
Some(f) => write!(fmt, ":{}", f)?,
None => write!(fmt, ":func({})", unsafe { ffi::ERR_GET_FUNC(self.code()) })?,
}
match self.reason() {
Some(r) => write!(fmt, ":{}", r)?,
None => write!(fmt, ":reason({})", unsafe {
ffi::ERR_GET_REASON(self.code())
})?,
None => write!(fmt, ":reason({})", self.reason_code())?,
}
write!(
fmt,
@@ -387,3 +398,18 @@ cfg_if! {
}
}
}

#[cfg(test)]
mod tests {
use crate::nid::Nid;

#[test]
fn test_error_library_code() {
let stack = Nid::create("not-an-oid", "invalid", "invalid").unwrap_err();
let errors = stack.errors();
#[cfg(not(boringssl))]
assert_eq!(errors[0].library_code(), ffi::ERR_LIB_ASN1);
#[cfg(boringssl)]
assert_eq!(errors[0].library_code(), ffi::ERR_LIB_OBJ as libc::c_int);
}
}
Loading