From: Theo Buehler Subject: Re: security/vaultwarden - future releases require Ed448 To: Bjorn Ketelaars Cc: ports@openbsd.org, aisha@openbsd.org Date: Sat, 9 Aug 2025 15:04:09 +0200 On Sat, Aug 09, 2025 at 01:43:21PM +0200, Bjorn Ketelaars wrote: > In a recent commit [0], vaultwarden updated webauthn-rs to 0.5.2. As a > result, vaultwarden HEAD fails to build, aborting with "No version of > OpenSSL is found". This is because webauthn-rs now requires > OpenSSL>=3.0.0 [1]. > > While working around the OpenSSL version check is straightforward, the > real issue is that webauthn-rs requires Ed448, which LibreSSL does not > support. > > A possible workaround is to add a dependency on security/openssl/3.5 and > link it statically. Is this the preferred approach, or is there a > better workaround for the missing Ed448 support in LibreSSL? > > For reference, I have attached a diff which builds vaultwarden HEAD on > amd64. This is provided for discussion; I am not asking for OKs. > > [0] > https://github.com/dani-garcia/vaultwarden/commit/a133d4e90c6f864c87ad54a877ea501f4d4f92ec > [1] > https://github.com/kanidm/webauthn-rs/blob/master/attestation-ca/build.rs#L11 I doubt Ed448 is required for WebAuthn given that neither Go nor BoringSSL support it... Given this, it is rather straightforward to make do with libressl. The openssl/openssl-sys patches are to expose NO_CHECK_TIME in rust-openssl which wasn't done for some reason and which webauthn-rs depends on. I should be able to push a version of this upstream easily. Remains the Ed448 support in the WebAuthn framework. I simply disabled everything to do with 448 by commenting it out since I didn't want to think hard. I'm not sure how receptive this upstream will be to patches, but I would suggest to add a compile-time feature "without_curve448" which allows disabling the stuff I commented out using a cargo feature. This could then be used by vaultwarden if libre is detected. I would prefer something along these lines over adding another OpenSSL consumer to the ports tree. Index: Makefile =================================================================== RCS file: /cvs/ports/security/vaultwarden/Makefile,v diff -u -p -r1.49 Makefile --- Makefile 4 Aug 2025 14:10:05 -0000 1.49 +++ Makefile 9 Aug 2025 11:49:01 -0000 @@ -8,7 +8,8 @@ BROKEN-i386 = raw-cpuid-10.2.0/src/lib. COMMENT = unofficial bitwarden compatible server -DIST_TUPLE = github dani-garcia vaultwarden 1.34.3 . +DIST_TUPLE = github dani-garcia vaultwarden a133d4e90c6f864c87ad54a877ea501f4d4f92ec . +PKGNAME = vaultwarden-1.34.3.20250809 CATEGORIES = security @@ -17,7 +18,7 @@ MAINTAINER = Aisha Tammy nid::Nid { + match self { + EDDSACurve::ED25519 => nid::Nid::X9_62_PRIME256V1, +- EDDSACurve::ED448 => nid::Nid::SECP384R1, ++ // EDDSACurve::ED448 => nid::Nid::SECP384R1, + } + } + } +@@ -545,7 +545,7 @@ impl COSEKey { + COSEKeyType::EC_OKP(edk) => { + let id = match &edk.curve { + EDDSACurve::ED25519 => pkey::Id::ED25519, +- EDDSACurve::ED448 => pkey::Id::ED448, ++ // EDDSACurve::ED448 => pkey::Id::ED448, + }; + + pkey::PKey::public_key_from_raw_bytes(edk.x.as_ref(), id) +@@ -719,27 +719,27 @@ mod tests { + } + } + +- #[test] +- fn cbor_ed448() { +- let hex_data = hex!( +- "A4" // Map - 4 elements +- "01 01" // 1: 1, ; kty: OKP key type +- "03 27" // 3: -8, ; alg: EDDSA signature algorithm +- "20 07" // -1: 7, ; crv: Ed448 curve +- "21 58 39 0c04658f79c3fd86c4b3d676057b76353126e9b905a7e204c07846c1a2ab3791b02fc5e9c6930345ea7bf8524b944220d4bd711c010c9b2a80" // -2: x, ; Y-coordinate +- ); +- let val: Value = serde_cbor_2::from_slice(&hex_data).unwrap(); +- let key = COSEKey::try_from(&val).unwrap(); +- assert_eq!(key.type_, COSEAlgorithm::EDDSA); +- match key.key { +- COSEKeyType::EC_OKP(pkey) => { +- assert_eq!( +- pkey.x.as_ref(), +- hex!("0c04658f79c3fd86c4b3d676057b76353126e9b905a7e204c07846c1a2ab3791b02fc5e9c6930345ea7bf8524b944220d4bd711c010c9b2a80") +- ); +- assert_eq!(pkey.curve, EDDSACurve::ED448); +- } +- _ => panic!("Key should be parsed OKP key"), +- } +- } ++// #[test] ++// fn cbor_ed448() { ++// let hex_data = hex!( ++// "A4" // Map - 4 elements ++// "01 01" // 1: 1, ; kty: OKP key type ++// "03 27" // 3: -8, ; alg: EDDSA signature algorithm ++// "20 07" // -1: 7, ; crv: Ed448 curve ++// "21 58 39 0c04658f79c3fd86c4b3d676057b76353126e9b905a7e204c07846c1a2ab3791b02fc5e9c6930345ea7bf8524b944220d4bd711c010c9b2a80" // -2: x, ; Y-coordinate ++// ); ++// let val: Value = serde_cbor_2::from_slice(&hex_data).unwrap(); ++// let key = COSEKey::try_from(&val).unwrap(); ++// assert_eq!(key.type_, COSEAlgorithm::EDDSA); ++// match key.key { ++// COSEKeyType::EC_OKP(pkey) => { ++// assert_eq!( ++// pkey.x.as_ref(), ++// hex!("0c04658f79c3fd86c4b3d676057b76353126e9b905a7e204c07846c1a2ab3791b02fc5e9c6930345ea7bf8524b944220d4bd711c010c9b2a80") ++// ); ++// assert_eq!(pkey.curve, EDDSACurve::ED448); ++// } ++// _ => panic!("Key should be parsed OKP key"), ++// } ++// } + } Index: patches/patch-modcargo-crates_webauthn-rs-core-0_5_2_src_interface_rs =================================================================== RCS file: patches/patch-modcargo-crates_webauthn-rs-core-0_5_2_src_interface_rs diff -N patches/patch-modcargo-crates_webauthn-rs-core-0_5_2_src_interface_rs --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-modcargo-crates_webauthn-rs-core-0_5_2_src_interface_rs 9 Aug 2025 12:22:00 -0000 @@ -0,0 +1,23 @@ +Index: modcargo-crates/webauthn-rs-core-0.5.2/src/interface.rs +--- modcargo-crates/webauthn-rs-core-0.5.2/src/interface.rs.orig ++++ modcargo-crates/webauthn-rs-core-0.5.2/src/interface.rs +@@ -81,8 +81,8 @@ pub enum EDDSACurve { + // X448 = 5, + /// Identifies this OKP as ED25519 + ED25519 = 6, +- /// Identifies this OKP as ED448 +- ED448 = 7, ++ // /// Identifies this OKP as ED448 ++ // ED448 = 7, + } + + impl EDDSACurve { +@@ -90,7 +90,7 @@ impl EDDSACurve { + pub(crate) fn coordinate_size(&self) -> usize { + match self { + Self::ED25519 => 32, +- Self::ED448 => 57, ++ //Self::ED448 => 57, + } + } + } Index: patches/patch-modcargo-crates_webauthn-rs-core-0_5_2_src_internals_rs =================================================================== RCS file: patches/patch-modcargo-crates_webauthn-rs-core-0_5_2_src_internals_rs diff -N patches/patch-modcargo-crates_webauthn-rs-core-0_5_2_src_internals_rs --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-modcargo-crates_webauthn-rs-core-0_5_2_src_internals_rs 9 Aug 2025 11:59:04 -0000 @@ -0,0 +1,12 @@ +Index: modcargo-crates/webauthn-rs-core-0.5.2/src/internals.rs +--- modcargo-crates/webauthn-rs-core-0.5.2/src/internals.rs.orig ++++ modcargo-crates/webauthn-rs-core-0.5.2/src/internals.rs +@@ -257,7 +257,7 @@ impl TryFrom for EDDSACurve { + fn try_from(u: i128) -> Result { + match u { + 6 => Ok(EDDSACurve::ED25519), +- 7 => Ok(EDDSACurve::ED448), ++ //7 => Ok(EDDSACurve::ED448), + _ => Err(WebauthnError::COSEKeyEDDSAInvalidCurve), + } + }