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

Add SM2 Algorithm Support #131

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

xicilion
Copy link

@xicilion xicilion commented Dec 5, 2024

Overview

Add SM2 (ShangMi 2) cryptographic algorithm support to the controller document specification. SM2 is a public key cryptographic algorithm based on elliptic curves, which has been standardized as GM/T 0003-2012 by the State Cryptography Administration of China.

Changes

  • Added SM2 algorithm specification and parameters
  • Included SM2 in the supported cryptographic algorithms list
  • Added relevant documentation and examples

Motivation

SM2 is widely used in China's commercial cryptographic applications and has been proven to provide strong security. Adding SM2 support enhances the specification's compatibility with Chinese cryptographic standards and provides more options for implementers requiring compliance with Chinese regulations.

Impact

This addition expands the cryptographic algorithm options available to implementers while maintaining backward compatibility with existing implementations.

Related Issues

N/A


Preview | Diff

Copy link
Member

@iherman iherman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not familiar with the details of SM2 to judge whether the definition is mathematically correct. But I approve the principle to include this.

Copy link
Member

@TallTed TallTed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after these a become an

index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
Copy link
Member

@TallTed TallTed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, missed two other locations of "a SM2" that should be "an SM2"

Copy link
Collaborator

@selfissued selfissued left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there is not a registered algorithm identifier for SM2 in https://www.iana.org/assignments/jose/jose.xhtml#web-signature-encryption-algorithms so there is no defined JOSE representation for this algorithm.

@xicilion
Copy link
Author

xicilion commented Dec 11, 2024

It is true that SM2 is not currently supported by JOSE and there is already a community proposal to suggest this feature:

https://www.ietf.org/archive/id/draft-dang-webauthn-sm2-00.html

But it doesn't seem to have been accepted.

But I believe this should not be a barrier, the BLS12381G2 algorithm is also not on the JOSE list, which does not prevent did from using BLS12-381 as one of the optional signature algorithms.

As one of the technical barriers is the definition of MultiCodoc, I have previously initiated proposals to define multibase prefixes for public and private keys for SM2.

https://github.com/multiformats/multicodec/pulls?q=is%3Apr+is%3Aclosed+sm2

@xicilion
Copy link
Author

Sorry, missed two other locations of "a SM2" that should be "an SM2"

No, that was my mistake, I misunderstood you and thought you only wished to modify the two previous ones.

@selfissued
Copy link
Collaborator

I suggest submitting a new draft either called draft-dang-jose-sm2 or draft-dang-cose-sm2, depending upon which working group you want to consider it. (There isn't an IETF WebAuthn working group.) And then request presentation time at IETF 122 in Bangkok to ask for the draft to be considered by the working group.

@xicilion
Copy link
Author

xicilion commented Dec 11, 2024

Thank you very much for your suggestions, I will take the time to figure out how to submit this draft.

index.html Outdated Show resolved Hide resolved
Copy link
Member

@TallTed TallTed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My tweaks were made. English looks good. fwiw

@iherman
Copy link
Member

iherman commented Dec 18, 2024

The issue was discussed in a meeting on 2024-12-18

  • no resolutions were taken
View the transcript

2.3. Add SM2 Algorithm Support (pr cid#131)

See github pull request cid#131.

Brent Zundel: add SM2 algorithm support. Has a couple requests for changes.

Manu Sporny: I put a change suggestion in there to see if the original person that raised the issue would have any objections. If they don't, we can merge it after. I'll remove the JSON web key expression and merge it after a day or two of waiting.

Brent Zundel: I believe the changes requested by TallTed have gone in. Path forward is the SM2 algorithm that's being added will be added for Data Integrity, on the JWK side it would be handled at IETF.
… with that all concerns will have been addressed and the PR can be merged. If folks disagree with this plan please speak up, otherwise we will move to our final PR.

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

Successfully merging this pull request may close these issues.

7 participants