Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions .github/workflows/artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
push:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
windows-binaries:
name: Windows (x86_64 MSVC)
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
schedule:
- cron: '15 12 * * 3'

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
name: "Build+Test (${{ matrix.os }}, ${{ matrix.cc }}, ${{ matrix.rust }}, ${{ matrix.crypto }}${{ matrix.cert_compression == 'on' && ', cert compression' || '' }}${{ matrix.prefer-pq == 'on' && ', prefer-post-quantum' || '' }}${{ matrix.dyn_link == 'on' && ', dynamic linking' || '' }})"
Expand Down Expand Up @@ -331,9 +335,8 @@ jobs:
persist-credentials: false

- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.73" # Matching MSRV
components: rustfmt

- name: Install Gersemi
Expand Down
4 changes: 2 additions & 2 deletions librustls/src/acceptor.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use libc::{c_void, size_t, EINVAL, EIO};
use libc::{EINVAL, EIO, c_void, size_t};
use rustls::server::{Accepted, AcceptedAlert, Acceptor};

use crate::connection::rustls_connection;
Expand All @@ -7,7 +7,7 @@ use crate::ffi::{
box_castable, free_box, set_boxed_mut_ptr, to_box, to_boxed_mut_ptr, try_callback,
try_clone_arc, try_mut_from_ptr, try_mut_from_ptr_ptr, try_ref_from_ptr, try_take,
};
use crate::io::{rustls_read_callback, rustls_write_callback, CallbackReader, CallbackWriter};
use crate::io::{CallbackReader, CallbackWriter, rustls_read_callback, rustls_write_callback};
use crate::panic::ffi_panic_boundary;
use crate::rslice::{rustls_slice_bytes, rustls_str};
use crate::server::rustls_server_config;
Expand Down
2 changes: 1 addition & 1 deletion librustls/src/certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use std::ptr::null;
use std::slice;

use libc::{c_char, size_t};
use rustls::RootCertStore;
use rustls::pki_types::pem::PemObject;
use rustls::pki_types::{CertificateDer, PrivateKeyDer};
use rustls::sign::CertifiedKey;
use rustls::RootCertStore;

use crate::crypto_provider::{self, rustls_signing_key};
use crate::error::{map_error, rustls_result};
Expand Down
10 changes: 5 additions & 5 deletions librustls/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ use std::sync::Arc;
use libc::{c_char, size_t};
use rustls::client::danger::{HandshakeSignatureValid, ServerCertVerified, ServerCertVerifier};
use rustls::client::{EchConfig, EchGreaseConfig, EchMode, ResolvesClientCert};
use rustls::crypto::{verify_tls12_signature, verify_tls13_signature, CryptoProvider};
use rustls::crypto::{CryptoProvider, verify_tls12_signature, verify_tls13_signature};
use rustls::pki_types::{CertificateDer, EchConfigListBytes, ServerName, UnixTime};
use rustls::{
sign::CertifiedKey, ClientConfig, ClientConnection, DigitallySignedStruct, Error, KeyLog,
KeyLogFile, ProtocolVersion, SignatureScheme, SupportedProtocolVersion,
ClientConfig, ClientConnection, DigitallySignedStruct, Error, KeyLog, KeyLogFile,
ProtocolVersion, SignatureScheme, SupportedProtocolVersion, sign::CertifiedKey,
};

use crate::certificate::rustls_certified_key;
use crate::connection::{rustls_connection, Connection};
use crate::connection::{Connection, rustls_connection};
use crate::crypto_provider::{self, rustls_crypto_provider, rustls_hpke};
use crate::error::{self, map_error, rustls_result};
use crate::ffi::{
arc_castable, box_castable, free_arc, free_box, set_arc_mut_ptr, set_boxed_mut_ptr,
to_boxed_mut_ptr, try_box_from_ptr, try_clone_arc, try_mut_from_ptr, try_mut_from_ptr_ptr,
try_ref_from_ptr, try_ref_from_ptr_ptr, try_slice,
};
use crate::keylog::{rustls_keylog_log_callback, rustls_keylog_will_log_callback, CallbackKeyLog};
use crate::keylog::{CallbackKeyLog, rustls_keylog_log_callback, rustls_keylog_will_log_callback};
use crate::panic::ffi_panic_boundary;
use crate::rslice::NulByte;
use crate::rslice::{rustls_slice_bytes, rustls_slice_slice_bytes, rustls_str};
Expand Down
16 changes: 8 additions & 8 deletions librustls/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use std::io::{ErrorKind, Read, Write};
use std::{ffi::c_void, ptr::null};
use std::{ptr::null_mut, slice};

use libc::{size_t, EINVAL, EIO};
use rustls::pki_types::CertificateDer;
use libc::{EINVAL, EIO, size_t};
use rustls::CipherSuite::TLS_NULL_WITH_NULL_NULL;
use rustls::pki_types::CertificateDer;
use rustls::{ClientConnection, ServerConnection};

use crate::certificate::rustls_certificate;
Expand All @@ -15,8 +15,8 @@ use crate::ffi::{
try_slice_mut,
};
use crate::io::{
rustls_read_callback, rustls_write_callback, rustls_write_vectored_callback, CallbackReader,
CallbackWriter, VectoredCallbackWriter,
CallbackReader, CallbackWriter, VectoredCallbackWriter, rustls_read_callback,
rustls_write_callback, rustls_write_vectored_callback,
};
use crate::log::{ensure_log_registered, rustls_log_callback};
use crate::panic::ffi_panic_boundary;
Expand Down Expand Up @@ -556,10 +556,10 @@ impl rustls_connection {
let n_read = match conn.reader().read(read_buf) {
Ok(n) => n,
Err(e) if e.kind() == ErrorKind::UnexpectedEof => {
return rustls_result::UnexpectedEof
return rustls_result::UnexpectedEof;
}
Err(e) if e.kind() == ErrorKind::WouldBlock => {
return rustls_result::PlaintextEmpty
return rustls_result::PlaintextEmpty;
}
Err(_) => return rustls_result::Io,
};
Expand Down Expand Up @@ -601,10 +601,10 @@ impl rustls_connection {
let n_read = match conn.reader().read_buf(read_buf.unfilled()) {
Ok(()) => read_buf.filled().len(),
Err(e) if e.kind() == ErrorKind::UnexpectedEof => {
return rustls_result::UnexpectedEof
return rustls_result::UnexpectedEof;
}
Err(e) if e.kind() == ErrorKind::WouldBlock => {
return rustls_result::PlaintextEmpty
return rustls_result::PlaintextEmpty;
}
Err(_) => return rustls_result::Io,
};
Expand Down
6 changes: 3 additions & 3 deletions librustls/src/crypto_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ use std::sync::Arc;

use libc::size_t;

use rustls::SupportedCipherSuite;
#[cfg(feature = "aws-lc-rs")]
use rustls::crypto::aws_lc_rs;
#[cfg(feature = "ring")]
use rustls::crypto::ring;
use rustls::crypto::{hpke, CryptoProvider};
use rustls::pki_types::pem::PemObject;
use rustls::crypto::{CryptoProvider, hpke};
use rustls::pki_types::PrivateKeyDer;
use rustls::pki_types::pem::PemObject;
use rustls::sign::SigningKey;
use rustls::SupportedCipherSuite;

use crate::cipher::rustls_supported_ciphersuite;
use crate::error::{map_error, rustls_result};
Expand Down
5 changes: 4 additions & 1 deletion librustls/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,10 @@ impl Display for rustls_result {
write!(f, "an error occurred with the selected HPKE suite")
}
BuilderIncompatibleTlsVersions => {
write!(f, "the client config builder specifies incompatible TLS versions for the requested feature")
write!(
f,
"the client config builder specifies incompatible TLS versions for the requested feature"
)
}

CertEncodingBad => Error::InvalidCertificate(CertificateError::BadEncoding).fmt(f),
Expand Down
4 changes: 2 additions & 2 deletions librustls/src/rslice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub extern "C" fn rustls_slice_slice_bytes_get(
data: null(),
len: 0,
phantom: PhantomData,
}
};
}
}
};
Expand Down Expand Up @@ -329,7 +329,7 @@ pub extern "C" fn rustls_slice_str_get(input: *const rustls_slice_str, n: size_t
data: null(),
len: 0,
phantom: PhantomData,
}
};
}
}
};
Expand Down
12 changes: 6 additions & 6 deletions librustls/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ use rustls::sign::CertifiedKey;
use rustls::{KeyLog, KeyLogFile, ProtocolVersion, SignatureScheme, SupportedProtocolVersion};

use crate::certificate::rustls_certified_key;
use crate::connection::{rustls_connection, Connection};
use crate::connection::{Connection, rustls_connection};
use crate::crypto_provider::{self, rustls_crypto_provider};
use crate::error::{map_error, rustls_result};
use crate::ffi::{
arc_castable, box_castable, free_arc, free_box, set_arc_mut_ptr, set_boxed_mut_ptr,
to_boxed_mut_ptr, try_box_from_ptr, try_clone_arc, try_mut_from_ptr, try_mut_from_ptr_ptr,
try_ref_from_ptr, try_ref_from_ptr_ptr, try_slice, Castable, OwnershipRef,
Castable, OwnershipRef, arc_castable, box_castable, free_arc, free_box, set_arc_mut_ptr,
set_boxed_mut_ptr, to_boxed_mut_ptr, try_box_from_ptr, try_clone_arc, try_mut_from_ptr,
try_mut_from_ptr_ptr, try_ref_from_ptr, try_ref_from_ptr_ptr, try_slice,
};
use crate::keylog::{rustls_keylog_log_callback, rustls_keylog_will_log_callback, CallbackKeyLog};
use crate::keylog::{CallbackKeyLog, rustls_keylog_log_callback, rustls_keylog_will_log_callback};
use crate::panic::ffi_panic_boundary;
use crate::rslice::{rustls_slice_bytes, rustls_slice_slice_bytes, rustls_slice_u16, rustls_str};
use crate::session::{
rustls_session_store_get_callback, rustls_session_store_put_callback, SessionStoreBroker,
SessionStoreBroker, rustls_session_store_get_callback, rustls_session_store_put_callback,
};
use crate::userdata::userdata_get;
use crate::verifier::rustls_client_cert_verifier;
Expand Down
6 changes: 3 additions & 3 deletions librustls/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ use std::slice;
use std::sync::Arc;

use libc::size_t;
use rustls::client::danger::ServerCertVerifier;
use rustls::client::WebPkiServerVerifier;
use rustls::client::danger::ServerCertVerifier;
use rustls::crypto::CryptoProvider;
use rustls::pki_types::pem::PemObject;
use rustls::pki_types::CertificateRevocationListDer;
use rustls::server::danger::ClientCertVerifier;
use rustls::pki_types::pem::PemObject;
use rustls::server::WebPkiClientVerifier;
use rustls::server::danger::ClientCertVerifier;
use rustls::{DistinguishedName, RootCertStore};
use webpki::{ExpirationPolicy, RevocationCheckDepth, UnknownStatusPolicy};

Expand Down
1 change: 1 addition & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
style_edition = "2024"
Loading