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

tinycrypt ecc-dh and ecc-dsa should not select entropy generator #16472

Closed
Laczen opened this issue May 29, 2019 · 6 comments
Closed

tinycrypt ecc-dh and ecc-dsa should not select entropy generator #16472

Laczen opened this issue May 29, 2019 · 6 comments
Assignees
Labels
area: Crypto / RNG area: Security Security RFC Request For Comments: want input from the community Security Review To be reviewed by a security expert

Comments

@Laczen
Copy link
Collaborator

Laczen commented May 29, 2019

Introduction

Tinycrypt provides support for ecc-dh and ecc-dsa.

Problem description

When ecc-dh or ecc-dsa are selected the entropy driver is selected. There is no need for this, ecc-dh and ecc-dsa depend on a random generator but this is not provided by the entropy driver.

The addition of the entropy driver is just adding flash usage.

Even in the case entropy driver would provide a random generator, it still would not be required to include the driver as this is only required when key generation is done. To verify a dsa or to do a key exchange there is no need for the random generator.

Why do we want this change and what problem are we trying to address?

Proposed change

Remove the selection of the entropy driver from tinycrypt Kconfig.

@Laczen Laczen added the RFC Request For Comments: want input from the community label May 29, 2019
@aescolar
Copy link
Member

@lpereira Any thoughts?

@alexanderwachter
Copy link
Member

I think you need entropy for the nonce generation.

@Laczen
Copy link
Collaborator Author

Laczen commented Jun 7, 2019

@alexanderwachter, thanks for the reply. In the general case you would need the entropy generator, but you need more than that, you need to provide a random function to use the entropy generator. This entropy does not provide.
And there also is the case where you would use ecc-dh and ecc-dh only for validation, then you don't need the entropy generation at all.
A solution could be that whenever an application needs to generate keys it will select the entropy subsystem and provide the required random function (using the entropy generator) so let the selection of entropy be a application choice. If the application would generate it's own random function (not wise) it would not select entropy saving ram and flash.

@kestewart kestewart added area: Security Security Security Review To be reviewed by a security expert labels Aug 1, 2019
@Laczen
Copy link
Collaborator Author

Laczen commented Sep 24, 2019

@jhedberg, Could you please revisit this ? My opinion is still that the entropy driver should not be selected by tinycrypt. The entropy driver needs to be selected by the subsystem/module that defines the default_CSPRNG routine and uses the entropy driver for that (e.g. hci_ecc.c).

@d3zd3z
Copy link
Collaborator

d3zd3z commented Dec 3, 2019

I believe this analysis is correct. Entropy/random is not necessary to verify signatures, and it is reasonable for an embedded device to be configured for only this situation. Both entropy and a CPRNG would be needed to sign images or generate keys. Hopefully this aspect will get cleaned up by upcoming random/entropy changes.

BTW, is this fixed by #19471.

@Laczen
Copy link
Collaborator Author

Laczen commented Dec 3, 2019

Yes, this is fixed

@Laczen Laczen closed this as completed Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Crypto / RNG area: Security Security RFC Request For Comments: want input from the community Security Review To be reviewed by a security expert
Projects
None yet
Development

No branches or pull requests

6 participants