Skip to content

Comments

Fix no-ec (again)#5673

Closed
mattcaswell wants to merge 2 commits intoopenssl:masterfrom
mattcaswell:fix-no-sm2
Closed

Fix no-ec (again)#5673
mattcaswell wants to merge 2 commits intoopenssl:masterfrom
mattcaswell:fix-no-sm2

Conversation

@mattcaswell
Copy link
Member

We broke no-ec again. I only just fixed it this morning :-)

This PR is mainly about fixing no-sm2, and then if no-ec is requested then this implies no-sm2.

Checklist
  • documentation is added or updated
  • tests are added or updated


static int key_disabled(EVP_PKEY *pkey)
{
#if defined(OPENSSL_NO_SM2) && !defined(OPENSSL_NO_EC)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line could do with a little bit more bang (!)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No - this is correct. If we have asked for sm2 to be disabled, but ec is still enabled then we may end up reading ec keys with an sm2 group. We need to detect those and ignore them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would an easier solution be to not add the NID_sm2 to the curve_list[] in ec_curve.c?

@levitte levitte dismissed their stale review March 19, 2018 17:07

Ok then

@tmshort
Copy link
Contributor

tmshort commented Mar 19, 2018

I was about to make a similar fix

@tmshort
Copy link
Contributor

tmshort commented Mar 19, 2018

I have some additional fixes related to SM2 and no-sm3.

@mattcaswell
Copy link
Member Author

Pushed. Thanks.

I have some additional fixes related to SM2 and no-sm3.

Great. Anything urgent, or can it wait until after the beta?

levitte pushed a commit that referenced this pull request Mar 19, 2018
Reviewed-by: Richard Levitte <[email protected]>
(Merged from #5673)
levitte pushed a commit that referenced this pull request Mar 19, 2018
Reviewed-by: Richard Levitte <[email protected]>
(Merged from #5673)
@tmshort
Copy link
Contributor

tmshort commented Mar 19, 2018

I think this should be closed?

@mattcaswell
Copy link
Member Author

Oh, right! Yes - thanks. This was merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants