Skip to content

Misc CI fixes. #322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -3,7 +3,12 @@ name: rustls-ffi
permissions:
contents: read

on: [push, pull_request]
on:
push:
pull_request:
merge_group:
schedule:
- cron: '15 12 * * 3'

jobs:
build:
@@ -17,7 +22,7 @@ jobs:
- stable
- beta
- nightly
- 1.57.0 # MSRV - keep in sync with what rustls considers MSRV
- 1.60.0 # MSRV - keep in sync with what rustls considers MSRV
os: [ubuntu-20.04]
# but only stable on macos/windows (slower platforms)
include:
@@ -72,6 +77,12 @@ jobs:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Install nightly rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
default: true
- name: Configure CMake
run: cmake -S . -B build
- name: Build, debug configuration
@@ -88,6 +99,12 @@ jobs:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Install nightly rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
default: true
- name: Configure CMake
run: cmake -S . -B build
- name: Build, release configuration
@@ -101,7 +118,14 @@ jobs:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Install nightly rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
default: true
- run: touch src/lib.rs
- run: cbindgen --version
- run: make src/rustls.h
- run: git diff --exit-code

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ repository = "https://github.com/rustls/rustls-ffi"
categories = ["network-programming", "cryptography"]
edition = "2021"
links = "rustls_ffi"
rust-version = "1.57"
rust-version = "1.60"

[features]
# Enable this feature when building as Rust dependency. It inhibits the
@@ -29,7 +29,6 @@ libc = "0.2"
sct = "0.7"
rustls-pemfile = "0.2.1"
log = "0.4.17"
num_enum = "0.5.10"

[lib]
name = "rustls_ffi"
2 changes: 1 addition & 1 deletion Makefile.Windows
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ $(RUSTLS_LIB): src/lib.rs Cargo.toml
@echo

target/%.exe: common.obj %.obj $(RUSTLS_LIB)
$(call link_EXE, $@, $^ advapi32.lib credui.lib kernel32.lib secur32.lib legacy_stdio_definitions.lib kernel32.lib advapi32.lib userenv.lib kernel32.lib kernel32.lib ws2_32.lib bcrypt.lib msvcrt.lib legacy_stdio_definitions.lib userenv.lib kernel32.lib msvcrt.lib)
$(call link_EXE, $@, $^ advapi32.lib credui.lib kernel32.lib secur32.lib legacy_stdio_definitions.lib kernel32.lib advapi32.lib userenv.lib kernel32.lib kernel32.lib ws2_32.lib bcrypt.lib msvcrt.lib legacy_stdio_definitions.lib userenv.lib kernel32.lib msvcrt.lib ntdll.lib)

clean:
rm -f *.obj target/.rustc_info.json $(RUSTLS_LIB) vc1*.pdb
4 changes: 4 additions & 0 deletions cbindgen.toml
Original file line number Diff line number Diff line change
@@ -11,3 +11,7 @@ include = ["rustls_tls_version"]

[defines]
"feature = read_buf" = "DEFINE_READ_BUF"

[parse.expand]
crates = ["rustls-ffi"]
features = ["read_buf"]
6 changes: 2 additions & 4 deletions src/client.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::borrow::Cow;
use std::convert::{TryFrom, TryInto};
use std::convert::TryInto;
use std::ffi::{CStr, OsStr};
use std::fs::File;
use std::io::BufReader;
@@ -263,9 +263,7 @@ impl rustls::client::ServerCertVerifier for Verifier {
rustls::Error::General("internal error with thread-local storage".to_string())
})?;
let result: u32 = unsafe { cb(userdata, &params) };
let result: rustls_result =
rustls_result::try_from(result).unwrap_or(rustls_result::General);
match result {
match rustls_result::from(result) {
rustls_result::Ok => Ok(ServerCertVerified::assertion()),
r => Err(error::cert_result_to_error(r)),
}
Loading