Skip to content

*ring* interoperability issues with RSA #697

Closed
@djc

Description

@djc

Problem:

In hickory-dns/hickory-dns#2778 I am preparing to add an aws-lc-rs backend to a pre-existing ring crypto backend for Hickory's DNSSEC implementation. In porting the code, I found one issue where the aws-lc-rs API currently does not seem to offer a capability that ring offers, and there's one piece of API that ring deprecated for which aws-lc-rs does not have the replacement. In order to make this a smooth transition, it would be great if these could be addressed, though I'm also happy to take on some wrapper code to make things fit.

Main issue:

djc-2021 actuallly-aws-lc proto $ cargo c --features dnssec-aws-lc-rs --all-targets
    Checking hickory-proto v0.25.0-alpha.5 (/Users/djc/src/hickory-dns/crates/proto)
error[E0308]: mismatched types
   --> crates/proto/src/dnssec/crypto.rs:453:63
    |
453 |         let components = PublicKeyComponents::<Vec<u8>>::from(self.inner.public_key());
    |                          ------------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^ expected `RsaPublicKeyComponents<Vec<...>>`, found `&RsaSubjectPublicKey`
    |                          |
    |                          arguments to this function are incorrect
    |
    = note: expected struct `PublicKeyComponents<Vec<u8>>`
            found reference `&RsaSubjectPublicKey`

ring's rsa::PublicKeyComponents offers a From<&PublicKey> impl, which we currently use in Hickory to convert the RSA public key to the DNSSEC-specified encoding (see https://github.com/hickory-dns/hickory-dns/blob/42d400f/crates/proto/src/dnssec/ring.rs#L453).

Minor issue:

ring deprecated RsaKeyPair::public_modulus_len() in favor of RsaKeyPair::public().modulus_len(). aws-lc-rs has not deprecated public_modulus_len() but also doesn't offer modulus_len() through its public(). For now, I just stuck an #[allow(deprecated)] on it but it might be nice to adopt the new ring API?

Requirements / Acceptance Criteria:

Would like to be able to merge support for aws-lc-rs into Hickory DNS.

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