Skip to content

0.4 to 0.5

Upgrade saml-rs, opensaml, samlify, or samlet from the latest 0.4.x release to 0.5.x.

If you only call saml-rs and keep the default crypto-bergshamra feature, update the toolchain and leave your feature flags as they are. Change application code when you call Bergshamra directly, or when you select the FIPS provider.

The minimum supported Rust version is 1.88, including builds with default-features = false. Install it and select it for the project before you upgrade the crates:

Terminal window
rustup toolchain install 1.88
rustup override set 1.88

Use the same version in CI.

The default crypto-bergshamra feature now uses Bergshamra 0.8.0 and Kryptering 0.5. It is still the compatibility alias for the RustCrypto provider plus Bergshamra’s legacy-algorithm, post-quantum, and PKCS#11 capabilities. Leave an existing feature selection unchanged.

saml-rs keeps the same public errors:

  • provider and key-import failures return SamlError::Crypto;
  • a missing operation key returns SamlError::MissingKey;
  • an invalid detached signature still returns Ok(false).

saml-rs initialises and attests the selected provider before its first crypto operation. Call initialize_crypto_provider at startup to surface that failure earlier and to read CryptoProviderInfo. In a crypto-fips build, success reports CryptoFipsStatus::Active. That attests the provider, not the consuming binary or deployment. Initialisation, attestation, capability, and key-import failures stay fail-closed as SamlError::Crypto.

Handle the new Result<Option<SoftwareKey>> returned by key-import methods such as Key::to_signing_key(). Concrete RustCrypto RSA accessors are gone. Read public keys with Key::algorithm_name() and Key::to_spki_der().

Set default-features = false and enable exactly one of crypto-rustcrypto, crypto-aws-lc, or crypto-fips. Bergshamra supports AWS-LC and FIPS on Linux x86_64 and aarch64. The saml-rs provider tests cover Linux x86_64. Provider features are mutually exclusive, so a workspace --all-features build does not apply.

On the FIPS provider, reject paths change as follows:

  • RSA_OAEP_MGF1P uses SHA-1 and is unavailable.
  • AWS-LC and FIPS reject signing with RSA_SHA1.
  • FIPS also rejects verifying RSA_SHA1. Non-FIPS AWS-LC still verifies inbound RSA-SHA1 Redirect and XML-DSig signatures.
  • AWS-LC covers less RSA-OAEP, AES-KW, finite-field DH, legacy, and post-quantum surface than RustCrypto.

Inbound SAML XML signatures still trust metadata-pinned keys only. They still require strict signed-reference placement, a 160-bit minimum HMAC output, and local digest and reference coverage. Inline <KeyInfo> is not a trust anchor. The adapter still skips public-CA chain and time checks because metadata certificates are pinned key material.

The software RSA key-transport compatibility opt-in stays off by default on RustCrypto because that backend is affected by RUSTSEC-2023-0071. AWS-LC and FIPS decrypt RSA-OAEP with default options. FIPS still rejects SHA-1 RSA_OAEP_MGF1P.