Skip to content

check traditional dsa private keys match their public key - #16008

Open
jmestwa-coder wants to merge 1 commit into
pyca:mainfrom
jmestwa-coder:dsa-traditional-public-key-match
Open

jmestwa-coder wants to merge 1 commit into
pyca:mainfrom
jmestwa-coder:dsa-traditional-public-key-match

Conversation

@jmestwa-coder

Copy link
Copy Markdown
Contributor

Traditional DSA private keys are not checked against their public key

The DSA PRIVATE KEY loader passes the stored y straight through, so a key whose y is not g^x mod p loads and reports a public key that does not verify its own signatures, while the PKCS8 loader, DSAPrivateNumbers.private_key() and the SSH loader (see #15881) already reject it. It now raises ValueError on mismatch; test_nilpotent now expects the load to fail, since that vector stores y = 1 while g^x mod p is 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant