Skip to content

Conversation

@zowens
Copy link
Contributor

@zowens zowens commented May 15, 2014

To enable the use of ECDH, the SSL context has to have an ECDH key.

In openssl 1.0.2 (not yet released), SSL_CTX_set_ecdh_auto can be used. As a fallback, SSL_CTX_set_tmp_ecdh can be used with a named curve.

@jtolio
Copy link
Member

jtolio commented May 16, 2014

So, I think we've decided we're happy with this pull request except for the hardcoded default curve. I think I'd rather just expose SSL_CTX_set_tmp_ecdh and SSL_CTX_set_ecdh_auto separately, and if SSL_CTX_set_ecdh_auto isn't actually defined, the Go method that wraps it just returns an error or something.

Would you be okay with that?

@zowens
Copy link
Contributor Author

zowens commented May 20, 2014

I think I read somewhere that this is what nginx does. If we want to expose the curves, we may just want to have 1 func for now that sets the curve using SSL_CTX_set_tmp_ecdh without messing with SSL_CTX_set_ecdh_auto. Does that seem reasonable?

EDIT: I meant to suggest that we defer adding a function that wraps SSL_CTX_set_ecdh_auto until openssl has a release with that functionality in it and simply wrap SSL_CTX_set_tmp_ecdh.

@jtolio
Copy link
Member

jtolio commented May 20, 2014

yep, that sounds good to me

@zowens
Copy link
Contributor Author

zowens commented May 20, 2014

Do you want all the curves in as constants? There's 64 in 1.0.1g... maybe just some common curves as constants?

@jtolio
Copy link
Member

jtolio commented May 20, 2014

heh, up to you. I'm cool with starting with some common ones and them getting added as needed

@zowens
Copy link
Contributor Author

zowens commented May 21, 2014

I decided to just add P-256 and P-384, which are the only curves supported by Firefox. It turns out, openssl implements all 15 recommended curves from FIPS 186-4.

@jtolio
Copy link
Member

jtolio commented May 21, 2014

awesome, thanks

jtolio added a commit that referenced this pull request May 21, 2014
Adding EnableECDH to Context
@jtolio jtolio merged commit 2bf5553 into spacemonkeygo:master May 21, 2014
nathan454 pushed a commit to nathan454/openssl that referenced this pull request Nov 30, 2022
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.

2 participants