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

Fixes #61 #68

Closed
wants to merge 1 commit into from
Closed

Fixes #61 #68

wants to merge 1 commit into from

Conversation

sappenin
Copy link

@sappenin sappenin commented Jan 9, 2019

Fixes #61

  • Add java.io.Serializable interface to EdDSAPublicKey and EdDSAPrivateKey class heirarchies.
  • Add Java Serialization unit test coverage for EdDSAPublicKey and EdDSAPrivateKey.

Signed-off-by: sappenin [email protected]

Fixes #61

* Add `java.io.Serializable` interface to `EdDSAPublicKey` and `EdDSAPrivateKey` class heirarchies.
* Add Java Serialization unit test coverage for `EdDSAPublicKey` and `EdDSAPrivateKey`.

Signed-off-by: sappenin <[email protected]>
@str4d
Copy link
Owner

str4d commented Jan 20, 2019

Thanks for the PR!

It's been a while since I last had my head in this code, so I'm going to take a bit of time to make sure that these changes make sense in the context of the overall API (and potential changes I am currently sketching out). So I will probably not get to reviewing this in depth this month.

@str4d
Copy link
Owner

str4d commented Feb 13, 2019

Okay, I've had time to get my head back into the codebase. Short answer is, I won't merge this PR as-is, because it causes the internal representations of GroupElement to be used as a serialization format, which is not good: they are in no way canonical, and may change at any time. It was a mistake on my part (back when I first wrote this library four years ago) to allow java.io.Serializable to be blanket-applied to EdDSAPublicKey and EdDSAPrivateKey. Fortunately the bug in #61 meant that no one has used it up to this point (at least without forking the library, at which point they are on their own).

Instead, we should override the java.io.Serializable functions to internally serialize using the canonical encodings of the private key and public key. I'm not sure whether that should be the X.509 format, or the canonical encoding of the underlying GroupElement, but given that it is a serialization of EdDSAPublicKey etc. I think the former makes sense.

@str4d
Copy link
Owner

str4d commented May 10, 2019

I've implemented the core of this in cryptography-cafe/curve25519-elisabeth#21

@sappenin sappenin closed this Mar 31, 2020
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.

Ed25519LittleEndianEncoding is not serializable
2 participants