spacemonkeygo / openssl

OpenSSL bindings for Go
http://godoc.org/github.com/spacemonkeygo/openssl
Apache License 2.0
473 stars 236 forks source link

Add support for additional key types and shared secret derivation #81

Closed chris-dudley closed 6 years ago

chris-dudley commented 6 years ago

This PR makes the following changes:

I tried to follow existing coding conventions as much as possible. Please let me know if anything is unacceptable and I will work to fix it.

All tests passed with go test on the following platforms:


While adding support for other key types for Marshal/Load, I modified the MarshalPKCS1PrivateKey(PEM|DER) functions to use the more general key serialization methods.

This is backwards compatible with the old implementation for RSA keys, but for key types that do not have a PKCS1 format, the keys will be marshaled to PKCS8 instead.

If this is not acceptable, let me know and I will restore the previous implementation and use different names for the new implementation (maybe MarshalTraditionalPrivateKey(PEM|DER) or something).

zeebo commented 6 years ago

I’m going to try to review this, but due to the holidays it might take me some time. Just wanted to let you know :)

Thanks for the contribution!

chris-dudley commented 6 years ago

No problem, happy holidays!

chris-dudley commented 6 years ago

I just realized that on the machine running OpenSSL 1.0.x, I ran the tests on the wrong branch. There are a few things that break when compiling against that version.

I need to fix these issues, so no worries about reviewing this PR right now.

I'll leave another comment once the issues are resolved.

chris-dudley commented 6 years ago

That should fix the incompatibilities with OpenSSL 1.0.x.