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

Expose the TPM error when the public part of the elliptic key is invalid *debug only PR* #146

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

chrisccoulson
Copy link
Collaborator

There is a test failure in travis which isn't reproducible locally

@chrisccoulson
Copy link
Collaborator Author

Well, this is fantastic. The tests pass and the only change is between this and #144 is e3b76f1

@chrisccoulson
Copy link
Collaborator Author

Huh, this is an obviously intermittent test failure that by some act of magic has never failed before. I think the issue is that go's big.Int truncates numbers to the minimum number of bytes required to hold the number, but the TPM requires key sizes to match the size specified by their configuration - so in the case of an elliptic key using the NIST P-256 curve, the public points must be 32 bytes. This means that keys generated by go's crypto/ecdsa package must be zero-extended to 32 bytes before loading them in to the TPM, something which this test isn't doing and I suspect is the reason for the test failures in #144 and #145

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.

1 participant