-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for parsing ECPKParameter PEM files (#1670)
Ruby depends on reading/writing PEM files that are defined as `EcpkParameters ` (See RFC3279 for more details). `EcpkParameters` actually just refer to potential different ways of serializing EC Groups and we already have basic support for this. OpenSSL's implementation of `d2i/i2d_ECParameters` actually calls `d2i/i2d_ECPKParameters` internally. * I've borrowed some of the logic for `d2i/i2d_ECParameters` and worked them into the new functions. Apparently we only support parsing named curves or explicitly encoded versions of them, so I've documented that and followed the same pattern. No new parsing logic has been added for `EC_GROUP`s. * We do not support writing custom curves to any ASN.1 output and this PR continues that trend. ### Call-outs: * Code change in `crypto/pem/pem_lib.c` was taken from OpenSSL: openssl/openssl@2059574. It was worth taking, so the call to `PEM_write_bio` could be cleaner. ### Testing: * Tests for named curves and a explicitly encoded versions of P256. The same PEM file works fine with OpenSSL as well * We don't support writing custom curves, so I have a test to make sure. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.
- Loading branch information
1 parent
d9a974f
commit 6056999
Showing
7 changed files
with
187 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters