[1.0.2-bp][ec_asn1.c] Avoid injecting seed when built-in matches #10141
Conversation
An unintended consequence of #9808 is that when an explicit parameters curve is matched against one of the well-known builtin curves we automatically inherit also the associated seed parameter, even if the the input parameters excluded such parameter. This later affects the serialization of such parsed keys, causing their input DER encoding and output DER encoding to differ due to the additional optional field. This does not cause problems internally but could affect external applications, as reported in #9811 (comment) This commit fixes the issue by conditionally clearing the seed field if the original input parameters did not include it.
|
@matthauck could you give this PR a try to verify if it does indeed resolve your problem? |
|
Awesome, thank you! Will give this a try and report back. |
|
This did indeed fix our issue. Thank you! |
|
Out of WIP as #10140 was approved without further changes. |
|
Same here: 'the the input parameters' -> 'the input parameters' |
levitte
pushed a commit
that referenced
this pull request
Oct 15, 2019
An unintended consequence of #9808 is that when an explicit parameters curve is matched against one of the well-known builtin curves we automatically inherit also the associated seed parameter, even if the input parameters excluded such parameter. This later affects the serialization of such parsed keys, causing their input DER encoding and output DER encoding to differ due to the additional optional field. This does not cause problems internally but could affect external applications, as reported in #9811 (comment) This commit fixes the issue by conditionally clearing the seed field if the original input parameters did not include it. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from #10141)
|
Merged with 4e545c6 Thanks everyone and thanks again @matthauck for reporting and testing this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a backport of #10140 for
1.0.2where it did not cherry-pick cleanly.I'd like to keep the discussion about patching vs non-patching in the parent PR.
It is marked as WIP until the discussion in #10140 reaches a consensus.
Also we might need to add a
CHANGESentry.