From ec45baa6d85cfb964b5c0db9a94aad2b5a48259c Mon Sep 17 00:00:00 2001 From: Ivan Nikulin Date: Wed, 11 Nov 2020 19:01:29 +0000 Subject: [PATCH] Revive CI --- .github/workflows/ci.yml | 91 +++++++++++++++++++++++++++++++++++++++- .gitmodules | 2 +- boring-sys/src/sha.rs | 9 ++++ boring-sys/src/x509v3.rs | 11 ----- boring/src/ssl/mod.rs | 2 +- 5 files changed, 101 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b226ee8..d898b8fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,4 +57,93 @@ jobs: path: target key: clippy-target-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }} - name: Run clippy - run: cargo clippy --all --all-targets \ No newline at end of file + run: cargo clippy --all --all-targets + test: + name: Test + runs-on: ${{ matrix.os }} + strategy: + matrix: + thing: + - stable + - macos-x86_64 + - arm-android + - arm64-android + - i686-android + - x86_64-android + - i686-linux + - arm-linux + - aarch64-linux + - x86_64-musl + - x86_64-mingw + - i686-msvc + - x86_64-msvc + include: + - thing: stable + target: x86_64-unknown-linux-gnu + rust: stable + os: ubuntu-latest + - thing: macos-x86_64 + target: x86_64-apple-darwin + rust: stable + os: macos-latest + - thing: arm-android + target: arm-linux-androideabi + rust: stable + os: ubuntu-latest + - thing: arm64-android + target: aarch64-linux-android + rust: stable + os: ubuntu-latest + - thing: i686-android + target: i686-linux-android + rust: stable + os: ubuntu-latest + - thing: x86_64-android + target: x86_64-linux-android + rust: stable + os: ubuntu-latest + - thing: i686-linux + target: i686-unknown-linux-gnu + rust: stable + os: ubuntu-latest + - thing: arm-linux + target: arm-unknown-linux-gnueabi + rust: stable + os: ubuntu-latest + - thing: aarch64-linux + target: aarch64-unknown-linux-gnu + rust: stable + os: ubuntu-latest + - thing: x86_64-musl + target: x86_64-unknown-linux-musl + rust: stable + os: ubuntu-latest + - thing: x86_64-mingw + target: x86_64-pc-windows-gnu + rust: stable + os: ubuntu-latest + - thing: i686-msvc + target: i686-pc-windows-msvc + rust: stable-i686-msvc + os: windows-latest + - thing: x86_64-msvc + target: x86_64-pc-windows-msvc + rust: stable-x86_64-msvc + os: windows-latest + + steps: + - uses: actions/checkout@v2 + with: + submodules: 'recursive' + - name: Install Rust (rustup) + run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} + shell: bash + - run: rustup target add ${{ matrix.target }} + - name: Install nasm + if: startsWith(matrix.os, 'windows') + run: choco install nasm + shell: cmd + - run: cargo test + if: startsWith(matrix.os, 'windows') + name: Run tests (Windows) + shell: cmd \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 5b14c99e..53b702f0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "boring-sys/deps/boringssl"] path = boring-sys/deps/boringssl url = https://github.com/google/boringssl.git - ignore = dirty \ No newline at end of file + ignore = dirty \ No newline at end of file diff --git a/boring-sys/src/sha.rs b/boring-sys/src/sha.rs index 94a79f47..3037f646 100644 --- a/boring-sys/src/sha.rs +++ b/boring-sys/src/sha.rs @@ -5,11 +5,20 @@ pub const SHA_CBLOCK: c_uint = 64; #[repr(C)] #[derive(Clone)] pub struct SHA_CTX { + #[cfg(windows)] + pub h: [c_uint; 5], + + #[cfg(not(windows))] pub h0: c_uint, + #[cfg(not(windows))] pub h1: c_uint, + #[cfg(not(windows))] pub h2: c_uint, + #[cfg(not(windows))] pub h3: c_uint, + #[cfg(not(windows))] pub h4: c_uint, + pub Nl: c_uint, pub Nh: c_uint, pub data: [c_uchar; SHA_CBLOCK as usize], diff --git a/boring-sys/src/x509v3.rs b/boring-sys/src/x509v3.rs index f9340a83..a55822a4 100644 --- a/boring-sys/src/x509v3.rs +++ b/boring-sys/src/x509v3.rs @@ -116,17 +116,6 @@ pub const EXFLAG_PROXY: u32 = 0x400; pub const EXFLAG_INVALID_POLICY: u32 = 0x800; pub const EXFLAG_FRESHEST: u32 = 0x1000; pub const EXFLAG_SS: u32 = 0x2000; -/* -cfg_if! { - // probably gonna be in openssl-3.0.0-alpha7 - if #[cfg(any(ossl300))] { - pub const EXFLAG_BCONS_CRITICAL: u32 = 0x10000; - pub const EXFLAG_AKID_CRITICAL: u32 = 0x20000; - pub const EXFLAG_SKID_CRITICAL: u32 = 0x40000; - pub const EXFLAG_SAN_CRITICAL: u32 = 0x80000; - } -} -*/ // X509_get_key_usage pub const X509v3_KU_DIGITAL_SIGNATURE: u32 = 0x0080; diff --git a/boring/src/ssl/mod.rs b/boring/src/ssl/mod.rs index f64abcbe..442f61a6 100644 --- a/boring/src/ssl/mod.rs +++ b/boring/src/ssl/mod.rs @@ -1329,7 +1329,7 @@ impl SslContextBuilder { /// /// [`SSL_CTX_sess_get_cache_size`]: https://www.openssl.org/docs/man1.0.2/man3/SSL_CTX_sess_set_cache_size.html #[allow(clippy::useless_conversion)] - pub fn set_session_cache_size(&mut self, size: u64) -> u64 { + pub fn set_session_cache_size(&mut self, size: u32) -> u64 { unsafe { ffi::SSL_CTX_sess_set_cache_size(self.as_ptr(), size.into()).into() } }