Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify ring signature/verification constants #850

Closed
5 tasks
josephlr opened this issue Jun 17, 2019 · 1 comment
Closed
5 tasks

Unify ring signature/verification constants #850

josephlr opened this issue Jun 17, 2019 · 1 comment

Comments

@josephlr
Copy link
Contributor

One of the confusing parts of ring::Signature is that the set of supported verification algorithms is not the set of supported signing algorithms. Specifically,

This difference in support leads to a fairly large API surface in the signature module. I.E.

  • RSA_PSS_2048_8192_SHA{256|384|512} and RSA_PSS_SHA{256|384|512}
  • ECDSA_P256_SHA256_ASN1 and ECDSA_P256_SHA256_ASN1_SIGNING

My proposal to fix this issue would be to:

  • Only support RSA operations up to 4096 bits (second option in RSA 8192 is supported only for verification, not for signing #843 (comment))
  • Remove RSA_PKCS1_3072_8192_SHA384 (as it is inconsistent with the rest of the API).
  • Remove P256_SHA384 support entirely (I could not find any uses in the wild).
  • Add support for P384_SHA256 signing (this is all we need, see Add more variants of ECDSA / SHA2 signing #801 (comment))
  • Unify the signing vs. verification algorithm constants. Specifically the following constants would be deprecated and made aliases for their shorter equivalents:
    • ECDSA_P256_SHA256_FIXED_SIGNING
    • ECDSA_P256_SHA256_ASN1_SIGNING
    • ECDSA_P384_SHA384_FIXED_SIGNING
    • ECDSA_P384_SHA384_ASN1_SIGNING
    • RSA_PKCS1_2048_8192_SHA1
    • RSA_PKCS1_2048_8192_SHA256
    • RSA_PKCS1_2048_8192_SHA384
    • RSA_PKCS1_2048_8192_SHA512
    • RSA_PSS_2048_8192_SHA256
    • RSA_PSS_2048_8192_SHA384
    • RSA_PSS_2048_8192_SHA512

Note that this unification would not preclude, for example, having a RSA_PKCS1_SHA1 constant that only supported verification and not signing. It would just allow RSA_PKCS1_SHA256 to work for both verification and singing.

@briansmith briansmith changed the title Unify ring singnature/verification constants Unify ring signature/verification constants Jul 12, 2019
@briansmith
Copy link
Owner

Those are all intentional decisions. We support a minimal set of functionality and wait for important use cases to justify expanding the API.

In the case of RSA_PKCS1_3072_8192_SHA384, of course it can't verify a 2048-bit RSA signature; its entire purpose for existing is to enforce a minimum size of 3072 bits.

I'm going to close this issue because it seems to be based on the premise that we should be able to generate every kind of signature that we accept. However, we intentionally don't do that. Some kinds of signatures we accept only for legacy reasons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants