Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This MR slightly changes how EC keys are read.
Currently, both private and public keys are read (if provided), but the public key has no effect and the internally used openssl structure is overridden by the private part. Thus the public key has no effecton the final ecdsa object other than possibly throwing exceptions in the constructor.
This MR reads the keys the same way as they are read for RSA key, i.e., prefer private key if present, and completely ignore public part.
I also switched from
PEM_read_bio_EC_PUBKEY
toPEM_read_bio_PUBKEY
, and fromPEM_read_bio_ECPrivateKey
toPEM_read_bio_PrivateKey
. This change made it obvious that one could use the same code for reading RSA and EC keys. The functions only differ in type of errors they report, e.g.,error::ecdsa_error::create_mem_bio_failed
vs.error::rsa_error::create_mem_bio_failed
.