Closed chris-dudley closed 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!
No problem, happy holidays!
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.
That should fix the incompatibilities with OpenSSL 1.0.x.
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).