Skip to content

SM2 private key cannot produce valid signatures #8435

@bbbrumley

Description

@bbbrumley
-----BEGIN PRIVATE KEY-----
MEECAQAwEwYHKoZIzj0CAQYIKoEcz1UBgi0EJzAlAgEBBCD////+////////////////cgPfayHG
BStTu/QJOdVBIg==
-----END PRIVATE KEY-----

Above private key cannot produce valid digital signatures:

openssl pkey -in sm2_bad.key -pubout > sm2_bad.key.pub
openssl pkeyutl -inkey sm2_bad.key -in /etc/lsb-release -rawin -sign -pkeyopt sm2_id:Alice > sm2_bad.sig
openssl pkeyutl -inkey sm2_bad.key.pub -pubin -in /etc/lsb-release -rawin -verify -pkeyopt sm2_id:Alice -sigfile sm2_bad.sig
Signature Verification Failure

@InfoHunter What does the spec say about key generation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    branch: 3.0Applies to openssl-3.0 branchbranch: 3.1Applies to openssl-3.1 (EOL)branch: 3.2Applies to openssl-3.2 (EOL)branch: 3.3Applies to openssl-3.3branch: 3.4Applies to openssl-3.4branch: masterApplies to master branchseverity: importantImportant bugs affecting a released versiontriaged: bugThe issue/pr is/fixes a bug

    Type

    No type

    Projects

    Status

    Pre-Refinement

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions