Important News

Rust

Rust FIPS 140-3 Implementation with CryptoComply Core 

Build and verify Rust applications with a FIPS 140-3 validated cryptographic software foundation—without forcing teams to abandon Rust’s performance, safety, and developer flexibility.

Developer Summary:

What changes

Build/link Node.js against the validated OpenSSL-compatible foundation and constrain TLS policies to approved suites/groups.

What it is

Standardize on supported OpenSSL-based crates such as rust-openssl or rustls-openssl, point Cargo and build tooling to the CryptoComply OpenSSL installation, enable FIPS mode, and verify that compiled binaries resolve OpenSSL libraries from the validated CryptoComply path.

How to Verify

Use ldd to confirm Rust executable links to /usr/local/lib/libssl.so.3and /usr/local/lib/libcrypto.so.3, not the system OpenSSL libraries.

What You Get

Validated cryptographic software, repeatable Rust build guidance, example crate integrations, Docker-supported workflows, and evidence artifacts for audit and compliance programs.

Quickstart: Build Rust Applications
with CryptoComply Core

This workflow builds Rust applications from source and links them against SafeLogic’s CryptoComply Core OpenSSL libraries.

The example package supports two Rust crate paths:

  • rust-openssl
  • rustls-openssl

These examples help teams standardize Rust cryptography on an OpenSSL-compatible, FIPS-validated foundation while preserving Rust’s application-level flexibility.

Prerequisites

Before proceeding, make sure you have:

  • Rust toolchain installed via rustup
  • CryptoComply Core binaries from the SafeLogic Customer Portal
  • Example Rust application source trees
  • Build dependencies including:
    • C/C++ compiler toolchain
    • pkg-config
    • curl
    • perl
    • git
    • wget
    • CA certificates
  • Docker, optional, for automated build and test workflows

Example source layout:

/app/
├── crate-openssl/
│   ├── Cargo.toml
│   └── src/
│       └── main.rs
└── crate-rustls-openssl/
    ├── Cargo.toml
    └── src/
        └── main.rs

For Debian-based systems:

apt-get update apt-get install -y wget git build-essential ca-certificates curl pkg-config perl

Set Environment Variables

Point Rust, Cargo, openssl-sys, and pkg-config to the CryptoComply OpenSSL installation instead of the system OpenSSL defaults.

export OPENSSL_DIR=/usr/local
export OPENSSL_LIB_DIR=/usr/local/lib
export OPENSSL_INCLUDE_DIR=/usr/local/include
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export OPENSSL_CONF=/usr/local/ssl/openssl.cnf
export OPENSSL_MODULES=/usr/local/lib/ossl-modules
export LD_LIBRARY_PATH=/usr/local/lib

These variables ensure that Rust build scripts and runtime linking resolve the CryptoComply-provided OpenSSL headers, libraries, configuration, and provider modules.

Update the Dynamic Linker

Configure the system dynamic linker so the runtime loader can locate the CryptoComply OpenSSL libraries.

export OPENSSL_CONF=/usr/local/ssl/openssl.cnf
echo "/usr/local/lib" > /etc/ld.so.conf.d/openssl.conf
ldconfig

Verify the build

Basic checks

nginx -v
nginx -t

The automated build flow also includes an enable-fips.sh helper intended to enable FIPS mode before the Rust crate examples are verified.

Build rust-openssl

The first example builds a Rust application using the rust-openssl crate.

cargo build --release --manifest-path /app/crate-openssl/Cargo.toml

Verify that the resulting executable links to CryptoComply OpenSSL:

ldd /app/crate-openssl/target/release/cc-crate-openssl | grep /usr/local/lib

The expected output should show OpenSSL libraries resolving from /usr/local/lib, for example:

libssl.so.3 => /usr/local/lib/libssl.so.3
libcrypto.so.3 => /usr/local/lib/libcrypto.so.3

Build rustls-openssl

The second example builds a Rust application using the rustls-openssl crate while relying on the same CryptoComply installation.

cargo build --release --manifest-path /app/crate-rustls-openssl/Cargo.toml

Verify linkage:

ldd /app/crate-rustls-openssl/target/release/cc-rustls-openssl | grep /usr/local/lib

Expected output should again confirm that the executable resolves OpenSSL libraries from /usr/local/lib.

Want the Automated Scripts?

SafeLogic’s portal-delivered Rust use case package includes OS-specific automated scripts that install dependencies, configure the Rust/OpenSSL build environment, enable FIPS mode, and build both crate examples for Debian- and RHEL-based systems.

Technical Overview

Validated cryptographic foundation, crate governance, and build evidence

Note: TLS is negotiated. Node.js may use different cipher suites and groups depending on peer support and configuration. This table reflects what regulated programs commonly require teams to constrain or enforce.

Component / Area

Default Behavior in Rust

SafeLogic-Approved Approach

Notes / Compliance Impact

Cryptographic Foundation

Rust applications select crypto through external crates

Standardize on OpenSSL-based crates linked to CryptoComply Core

Creates a consistent validated cryptographic foundation

Crate Selection

Teams may choose native Rust crypto, OpenSSL wrappers, or alternate TLS stacks

Use supported OpenSSL-linked crates such as rust-openssl and rustls-openssl

Helps prevent applications from bypassing approved cryptographic boundaries

Build Configuration

Cargo may discover system OpenSSL by default

Set OPENSSL_DIR, OPENSSL_LIB_DIR, OPENSSL_INCLUDE_DIR, PKG_CONFIG_PATH, and runtime linker paths

Ensures builds use CryptoComply OpenSSL rather than system OpenSSL

FIPS Mode

Not enforced by Rust itself

Use CryptoComply OpenSSL configuration and provider modules

Enables policy-driven operation through the validated cryptographic backend

Verification

Linkage may be assumed but not proven

Use ldd to confirm binaries resolve libssl and libcrypto from /usr/local/lib

Provides concrete build evidence

Audit Readiness

Dependency behavior may vary by project

Use validation artifacts, repeatable build scripts, and configuration guidance

Supports evidence collection for regulated environments

The Compliance Gap with
Standard Rust Cryptography

Rust is widely used for secure, high-performance systems, including infrastructure services, backend systems, security tooling, cloud-native environments, and embedded applications. Its memory safety and concurrency guarantees make it attractive for sensitive and mission-critical workloads.

But Rust does not provide a single built-in cryptographic implementation. Instead, cryptography is introduced through external crates. Developers may choose OpenSSL-based crates, native Rust cryptographic libraries, BoringSSL, AWS-LC, or other TLS and crypto stacks.

That flexibility creates a compliance challenge: FIPS 140 requirements apply to the underlying cryptographic implementation, not to the Rust language itself. If a Rust application uses cryptography outside a validated boundary, the organization may have difficulty proving compliance during audits, procurement reviews, or regulated deployments.

Access, Rollout, and Evidence

How Customers Access it

Customers access required build artifacts through SafeLogic’s Customer Portal and integrate them into internal artifact repositories and CI/CD pipelines.

Delivery Formats

Pre-built artifacts and/or build toolchain integration (based on workflow)

Supported platforms (OS/architectures)

Portal-provided builds across operating systems and CPU architectures (customers see what they're licensed for)

Selecting the Right Build

Locate artifacts by product/version/operating system/architecture and pull into internal repositories/pipelines

Need the exact OS/architecture matrix for your environment?

Typical Rollout

1

Proof of Concept

Identify Rust applications that perform cryptographic operations, determine whether they use OpenSSL-based crates, and confirm target platforms.

2

Integration

Configure Cargo and build tooling to link against CryptoComply Core. Build the rust-openssl and/or rustls-openssl examples.

3

Verification

Confirm runtime linkage using ldd, verify CryptoComply OpenSSL library paths, and validate FIPS configuration.

4

Production

Integrate the workflow into standard build pipelines, container images, deployment processes, and audit evidence collection.

Evidence for Auditors

Frequently Asked Questions
(Rust + FIPS)

Does Rust include FIPS-validated cryptography by default?

No. Rust does not provide a built-in cryptographic implementation or enforce a single cryptographic standard. Cryptography is introduced through dependencies, which means FIPS alignment depends on the crates selected and the cryptographic libraries they use.

The provided Rust integration guide includes examples for rust-openssl and rustls-openssl. Both examples are built against the same CryptoComply Core OpenSSL installation.

Native Rust crypto libraries may offer portability and performance benefits, but they often do not rely on OpenSSL and therefore cannot automatically leverage OpenSSL-based FIPS-validated modules. SafeLogic recommends defining approved cryptographic libraries and auditing dependencies that bypass validated modules.

Use ldd against the compiled Rust executable and confirm that libssl.so.3 and libcrypto.so.3 resolve from /usr/local/lib, not the system OpenSSL path.

Not necessarily. For applications already using OpenSSL-based crates, the primary work is build configuration, dependency governance, FIPS enablement, and verification. Applications that use non-OpenSSL cryptographic libraries may require changes to dependencies or additional review.

Yes. The use case package includes automated build scripts for Debian-based and RHEL-based systems, plus an enable-fips.sh helper. These scripts perform the same operations described in the manual workflow. 

Ready to Bring FIPS-Validated
Cryptography to Rust Applications?

Get guidance on supported Rust crate paths, validated cryptographic integration, and the evidence your program requires. Call us at 844.436.2797 or complete the form below.

What's New in Regulated Cryptography?

Blog

Configuring TLS for Post-Quantum Cryptography in Apache and NGINX

For most of the last two decades, configuring TLS on...

Blog

Bringing FIPS 140-3 Compliance to strongSwan with CryptoComply Core

At SafeLogic, we help software that already does its job...

Blog

Enabling FIPS-Compliant Cryptography in Rust Applications

Modern systems programming is evolving rapidly, driven by the need...