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

‘sign’ is not supported for“sm3'? #8912

Closed
liyangzbx opened this issue May 12, 2023 · 5 comments
Closed

‘sign’ is not supported for“sm3'? #8912

liyangzbx opened this issue May 12, 2023 · 5 comments
Labels
Stale waiting-on-reporter Issue is waiting on a reply from the reporter. It will be automatically cloesd if there is no reply.

Comments

@liyangzbx
Copy link

    def sign(
        self,
        private_key: CertificateIssuerPrivateKeyTypes,
        algorithm: typing.Optional[_AllowedHashTypes],
        backend: typing.Any = None,
    ) -> CertificateRevocationList:
        if self._issuer_name is None:
            raise ValueError("A CRL must have an issuer name")

        if self._last_update is None:
            raise ValueError("A CRL must have a last update time")

        if self._next_update is None:
            raise ValueError("A CRL must have a next update time")

        return rust_x509.create_x509_crl(self, private_key, algorithm)

class SM3(HashAlgorithm):
    name = "sm3"
    digest_size = 32
    block_size = 64

@reaperhulk
Copy link
Member

We don’t currently support SM3 in x509. Are there SM3 OIDs for rsa and ecdsa or is it just sm2-with-sm3?

@alex alex added the waiting-on-reporter Issue is waiting on a reply from the reporter. It will be automatically cloesd if there is no reply. label May 12, 2023
@github-actions
Copy link

This issue has been waiting for a reporter response for 3 days. It will be auto-closed if no activity occurs in the next 5 days.

@github-actions github-actions bot added the Stale label May 16, 2023
@github-actions
Copy link

This issue has not received a reporter response and has been auto-closed. If the issue is still relevant please leave a comment and we can reopen it.

@raydoom
Copy link

raydoom commented Jun 12, 2023

I think it is just sm2-with-sm3

@reaperhulk
Copy link
Member

Thanks @raydoom. For others who might have seen this issue -- supporting this in cryptography requires us to add support for SM2, then add support in the X509 signer for this OID. We've had a contributor attempt to add SM2 in the past but unfortunately they were unable to finish the work. At the moment we (the primary maintainers) aren't planning to implement that ourselves, but if someone wants to contribute it roughly looks like:

  • Ensure rust-openssl has the appropriate bindings
  • Add support for a new key type in this project via a PR that looks similar to the work in Migrate EC support to Rust #9024 from a rust perspective but also implements the SM2Sign construction rather than ECDSA.
  • Follow up that PR with extending it to allow signatures in X.509

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Stale waiting-on-reporter Issue is waiting on a reply from the reporter. It will be automatically cloesd if there is no reply.
Development

No branches or pull requests

4 participants