Skip to content

P-521 signature algorithms require the aws_lc_rs feature even for custom SigningKeys #460

Open

Description

@kixelated

PKCS_ECDSA_P521_SHA256, PKCS_ECDSA_P521_SHA384, and PKCS_ECDSA_P521_SHA512 are behind #[cfg(feature = "aws_lc_rs")] (also on main), and SignatureAlgorithm has no public constructor. So a custom SigningKey built with default-features = false (an HSM, a remote signer, or another crypto backend) cannot return a P-521 algorithm from PublicKeyData::algorithm() without compiling aws-lc-rs, even though rcgen never calls aws-lc-rs for that key.

The gate exists for sign_alg, which only rcgen's own KeyPair reads. One option is to gate the statics on any(feature = "aws_lc_rs", not(feature = "crypto")), so they exist whenever no backend that lacks P-521 is compiled in; another is to make sign_alg optional for algorithms the active backend cannot sign with.

Context: rind-rcgen implements SigningKey on a pure-Rust backend that signs P-521, and builds rcgen without crypto.

(Written by Claude Opus 5.5)

Activity

  1. djc commented on Oct 31, 2026

    @djc
    Member

    There's a bunch of work going on in

    to make all this more flexible. Please review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions