Compare commits

...

5 Commits

Author SHA1 Message Date
Benjy Weinberger 924474b939
Merge 7055fe86b5 into 94e6e88ed9 2024-03-20 21:33:41 +08:00
Brian Smith 94e6e88ed9 CI: Use free macOS runners for aarch64-apple-darwin jobs. 2024-02-18 14:48:35 -08:00
Brian Smith 9613e5d115 Sync mk/{cargo.sh,install-build-tools.sh} with *ring*.
In particular, LLVM/Clang 18 so that the coverage jobs succeed after
Rust Nightly upgraded to LLVM 18.
2024-02-18 14:46:52 -08:00
Brian Smith 8f81719df5 Appease Clippy. 2024-02-18 13:14:42 -08:00
Benjy Weinberger 7055fe86b5 Demonstrate an issue with a cert rewritten by SSL inspection. 2021-05-07 10:16:43 -07:00
7 changed files with 59 additions and 4 deletions

View File

@ -141,7 +141,7 @@ jobs:
include:
- target: aarch64-apple-darwin
host_os: macos-13-xlarge
host_os: macos-14
- target: aarch64-pc-windows-msvc
host_os: windows-latest

View File

@ -21,6 +21,9 @@ rustflags_self_contained="-Clink-self-contained=yes -Clinker=rust-lld"
qemu_aarch64="qemu-aarch64 -L /usr/aarch64-linux-gnu"
qemu_arm_gnueabi="qemu-arm -L /usr/arm-linux-gnueabi"
qemu_arm_gnueabihf="qemu-arm -L /usr/arm-linux-gnueabihf"
qemu_mips="qemu-mips -L /usr/mips-linux-gnu"
qemu_mips64="qemu-mips64 -L /usr/mips64-linux-gnuabi64"
qemu_mips64el="qemu-mips64el -L /usr/mips64el-linux-gnuabi64"
qemu_mipsel="qemu-mipsel -L /usr/mipsel-linux-gnu"
qemu_powerpc="qemu-ppc -L /usr/powerpc-linux-gnu"
qemu_powerpc64="qemu-ppc64 -L /usr/powerpc64-linux-gnu"
@ -51,7 +54,7 @@ for arg in $*; do
done
# See comments in install-build-tools.sh.
llvm_version=16
llvm_version=18
case $target in
aarch64-linux-android)
@ -112,6 +115,24 @@ case $target in
export AR_i686_unknown_linux_musl=llvm-ar-$llvm_version
export CARGO_TARGET_I686_UNKNOWN_LINUX_MUSL_RUSTFLAGS="$rustflags_self_contained"
;;
mips-unknown-linux-gnu)
export CC_mips_unknown_linux_gnu=mips-linux-gnu-gcc
export AR_mips_unknown_linux_gnu=mips-linux-gnu-gcc-ar
export CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_LINKER=mips-linux-gnu-gcc
export CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_RUNNER="$qemu_mips"
;;
mips64-unknown-linux-gnuabi64)
export CC_mips64_unknown_linux_gnuabi64=mips64-linux-gnuabi64-gcc
export AR_mips64_unknown_linux_gnuabi64=mips64-linux-gnuabi64-gcc-ar
export CARGO_TARGET_MIPS64_UNKNOWN_LINUX_GNUABI64_LINKER=mips64-linux-gnuabi64-gcc
export CARGO_TARGET_MIPS64_UNKNOWN_LINUX_GNUABI64_RUNNER="$qemu_mips64"
;;
mips64el-unknown-linux-gnuabi64)
export CC_mips64el_unknown_linux_gnuabi64=mips64el-linux-gnuabi64-gcc
export AR_mips64el_unknown_linux_gnuabi64=mips64el-linux-gnuabi64-gcc-ar
export CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_LINKER=mips64el-linux-gnuabi64-gcc
export CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_RUNNER="$qemu_mips64el"
;;
mipsel-unknown-linux-gnu)
export CC_mipsel_unknown_linux_gnu=mipsel-linux-gnu-gcc
export AR_mipsel_unknown_linux_gnu=mipsel-linux-gnu-gcc-ar

View File

@ -94,6 +94,24 @@ case $target in
--target=loongarch64-unknown-linux-gnu)
use_clang=1
;;
--target=mips-unknown-linux-gnu)
install_packages \
gcc-mips-linux-gnu \
libc6-dev-mips-cross \
qemu-user
;;
--target=mips64-unknown-linux-gnuabi64)
install_packages \
gcc-mips64-linux-gnuabi64 \
libc6-dev-mips64-cross \
qemu-user
;;
--target=mips64el-unknown-linux-gnuabi64)
install_packages \
gcc-mips64el-linux-gnuabi64 \
libc6-dev-mips64el-cross \
qemu-user
;;
--target=mipsel-unknown-linux-gnu)
install_packages \
gcc-mipsel-linux-gnu \
@ -155,7 +173,7 @@ esac
case "$OSTYPE" in
linux*)
ubuntu_codename=$(lsb_release --codename --short)
llvm_version=16
llvm_version=18
sudo apt-key add mk/llvm-snapshot.gpg.key
sudo add-apt-repository "deb http://apt.llvm.org/$ubuntu_codename/ llvm-toolchain-$ubuntu_codename-$llvm_version main"
sudo apt-get update

View File

@ -14,7 +14,7 @@
use crate::{calendar, time, Error};
pub use ring::io::{
der::{nested, Tag, CONSTRUCTED},
der::{nested, Tag},
Positive,
};

View File

@ -80,6 +80,7 @@ fn build_chain_inner(
// TODO: revocation.
#[allow(clippy::blocks_in_conditions)]
match loop_while_non_fatal_error(trust_anchors, |trust_anchor: &TrustAnchor| {
let trust_anchor_subject = untrusted::Input::from(trust_anchor.subject);
if !equal(cert.issuer, trust_anchor_subject) {

View File

@ -53,6 +53,21 @@ pub fn netflix() {
);
}
#[test]
pub fn rewritten_cert() {
// This cert is a rewritten version of github.com's end entity cert, generated by an
// SSL inspection system (https://www.forcepoint.com/product/ngfw-next-generation-firewall).
// We believe the cert should be considered valid:
// - It can be parsed by OpenSSL, e.g., these both work:
// `openssl x509 -inform der -in tests/rewritten_cert.der -text -noout`
// `openssl asn1parse -i -inform der -in tests/rewritten_cert.der`
// - It's generated by a robust real-world system that works in practice...
// We encountered an issue where rustls cannot handle this rewritten cert. We traced this
// back to webpki, and specifically to the code exercised by this test.
let ee: &[u8] = include_bytes!("rewritten_cert.der");
webpki::EndEntityCert::try_from(ee).unwrap();
}
#[test]
pub fn ed25519() {
let ee: &[u8] = include_bytes!("ed25519/ee.der");

BIN
tests/rewritten_cert.der Normal file

Binary file not shown.