Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change the default PQ KEX algorithm of OQS-chromium? #100

Closed
ray19941201 opened this issue Sep 7, 2021 · 9 comments
Closed

How to change the default PQ KEX algorithm of OQS-chromium? #100

ray19941201 opened this issue Sep 7, 2021 · 9 comments

Comments

@ray19941201
Copy link

Hi,

I have followed the instructions within the oqs-demos repository to build an OQS-enabled chromium and an OQS-enabled httpd server.

I found out that due to the chromium currently doesn't support curves option like the command line, it will use the default algorithm when I issue a HTTP request to my httpd server from it.
So if I configure my server only support algorithm "kyber512", the chromium will return the error page as shown below.
image

I have read the implementation notes of the BoringSSL saying that the client can use the SSL_CTX_set1_curves_list call to override this. But I can't find any instructions about how to actually do this.

Is that possible can anyone provide some information or instructions about how to do this?

Kind regards,

Ray

@baentsch
Copy link
Member

baentsch commented Sep 7, 2021

You have hit on a shortcoming of OQS-chromium: No-one got around to implementing #52. If you need this feature and would have time to do this, we'd be very glad to receive a PR for this.

Presently the only way to set the acceptable client algorithms is to build the boringssl client (OQS-chromium) with the desired (set of) acceptable client algorithm(s) "baked in". This should be possible by changing the kDefaultGroups array as desired.

@ray19941201
Copy link
Author

ray19941201 commented Sep 8, 2021

I see. Thank you for your response.

If you need this feature and would have time to do this, we'd be very glad to receive a PR for this.

Thanks for the invitation! Unfortunately I'm more like a researcher than a developer.😅 Not really good at programming. I'm doing a proof of concept project for my company which is setting an OQS enabled reverse proxy in front of all the company's servers to provide quantum safe front end connection.

Presently the only way to set the acceptable client algorithms is to build the boringssl client (OQS-chromium) with the desired (set of) acceptable client algorithm(s) "baked in". This should be possible by changing the kDefaultGroups array as desired.

Does this mean once I built the chromium I can no longer change it anymore?
Btw, may I ask when should I modify the file during the building process(like before which step)?
I'm guessing I probably should do this once the BoringSSL has been swapped with OQS-BoringSSL?

Kind regards,
Ray

@baentsch
Copy link
Member

baentsch commented Sep 8, 2021

Unfortunately I'm more like a researcher than a developer. Not really good at programming.

In my view, a good researcher (still consider myself one) shouldn't shy back from understanding others' code to give it new capabilities (call it "source code archaeology" and it's a scientific undertaking :-)

Does this mean once I built the chromium I can no longer change it anymore?

Yes. Thus it would be prudent to include all QSC algorithms your company servers would want to support: This is just a list: The more complete it is, the more algorithms your QSC-chromium build can support. It's only getting slightly more inefficient with an extremely long list of algorithms.

I'm guessing I probably should do this once the BoringSSL has been swapped with OQS-BoringSSL?

Yes. If you successfully built chromium all you (should) need to do is a re-build (after changing the list): The build system should take care of the rest.

@ray19941201
Copy link
Author

In my view, a good researcher (still consider myself one) shouldn't shy back from understanding others' code to give it new capabilities (call it "source code archaeology" and it's a scientific undertaking :-)

Totally agree. Maybe I should put it another way, I should say coding is my weakness and I'm still learning to improve it. But just consider what I am currently capable of I would say that the task is too hard for me. 😅😅

Yes. Thus it would be prudent to include all QSC algorithms your company servers would want to support: This is just a list: The more complete it is, the more algorithms your QSC-chromium build can support. It's only getting slightly more inefficient with an extremely long list of algorithms.

Yes. If you successfully built chromium all you (should) need to do is a re-build (after changing the list): The build system should take care of the rest.

I see. Thank you very much sir. This is very clear and helpful. I will rebuild it and choose a proper subset of the algorithms.

@baentsch
Copy link
Member

baentsch commented Sep 9, 2021

I would say that the task is too hard for me

All right. But skills change over time and it'd be great if you could see this as a challenge to grow your skills on and help us resolve #52.

I see. Thank you very much sir. This is very clear and helpful. I will rebuild it and choose a proper subset of the algorithms.

Good to hear. I'd then be glad to hear if this worked and we can close this issue.

In any case, thanks for making us aware of some shortcomings in our documentation: We improved that accordingly.

@ray19941201
Copy link
Author

ray19941201 commented Sep 10, 2021

All right. But skills change over time and it'd be great if you could see this as a challenge to grow your skills on and help us resolve #52.

Sure. May I ask is there any information I can dig in to do this? I might start with researching about how to build this feature first. But no guarantee of completion cuz this task is apparently beyond my might. 😅😅

I'd then be glad to hear if this worked and we can close this issue.

Sure, I will get back to you once I've done this. Considering my testing environment, it might be next week.

@baentsch
Copy link
Member

May I ask is there any information I can dig in to do this?

Sorry, I don't know: I didn't look into that myself. I'd start with a web search on chromium design docs and probably also use grep -r for existing command line parameters (implementation) and dig forward from there.

@ray19941201
Copy link
Author

I'd then be glad to hear if this worked and we can close this issue.

Sorry for the late response. In the past few days, I have been suffered from the side effects of my vaccination(AstraZeneca).

I have swapped the default algorithm into all kyber above level 3 and rebuilt the chromium.

螢幕擷取畫面 2021-09-15 092334

The result was successful.

Since Chrome can connect to the server only when the server uses one of its default KEX algorithms, I used SSLOpenSSSLConfCmd in the httpd-ssl.conf file to specify which algorithm is allowed on the server side.

I chose algorithm kyber768 and kyber90s1024, the server returned the it works page.
螢幕擷取畫面 2021-09-15 093256

螢幕擷取畫面 2021-09-15 093746

螢幕擷取畫面 2021-09-15 093623

On the other hand, I chose the algorithm kyber512, then it returned the error page cuz it's not one of the default algorithm.

螢幕擷取畫面 2021-09-15 093826

螢幕擷取畫面 2021-09-15 093856

Thanks again for all the help!

@baentsch
Copy link
Member

UW. Thanks for the feedback & get well soon.

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

No branches or pull requests

2 participants