-
Notifications
You must be signed in to change notification settings - Fork 96
Remove Diffie-Hellman examples #80
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
Remove Diffie-Hellman examples #80
Conversation
Are there any CMakeLists or Makefile or visual studio files to update? |
All of these files need updating:
|
I remember talking about it, but I don't remember how we decided, do we want to keep updating ChangeLog in mbed-crypto? |
We've talked about it but not decided anything. In the meantime, I propose to keep updating |
6b8d597
to
0307707
Compare
Please don't add any Mbed Crypto entries to the ChangeLog. Feel free to start a wiki page for the next version's release notes, though. Until we have a solution to ChangeLog maintenance and automatic merging, it's not worth the effort. We can bring it back later if it makes sense. |
The PR is ready for review again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok except for the ChangeLog entry. Also, Jaeden wanted to keep the changelog entry somewhere else (I have no strong feelings about that point).
ChangeLog
Outdated
@@ -64,6 +64,9 @@ Features | |||
* Add a new function mbedtls_asn1_write_named_bitstring() to write ASN.1 | |||
named bitstring in DER as required by RFC 5280 Appendix B. | |||
|
|||
Mbed Crypto | |||
* Removed two Diffie-Hellman examples which were relying on the Net module. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changelog entries are primarily for users of the library. Most users of the library don't care much about module dependencies, but they might care about the example programs. So we should tell them what to look at instead. Proposal:
Remove the Diffie-Hellman examples which implemented a toy protocol inspired by TLS DH key exchange. For an example of how to use the DHM module, see the code that calls
mbedtls_dhm_xxx
inssl_tls.c
andssl_cli.c
in Mbed TLS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing it. (I had removed it before the review, just forgot to push.)
programs/Makefile
Outdated
@@ -49,8 +49,7 @@ endif | |||
|
|||
APPS = aes/aescrypt2$(EXEXT) aes/crypt_and_hash$(EXEXT) \ | |||
hash/hello$(EXEXT) hash/generic_sum$(EXEXT) \ | |||
pkey/dh_client$(EXEXT) \ | |||
pkey/dh_genprime$(EXEXT) pkey/dh_server$(EXEXT) \ | |||
pkey/dh_genprime$(EXEXT) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check alignment of \
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in ff43390.
ChangeLog
Outdated
@@ -64,6 +64,9 @@ Features | |||
* Add a new function mbedtls_asn1_write_named_bitstring() to write ASN.1 | |||
named bitstring in DER as required by RFC 5280 Appendix B. | |||
|
|||
Mbed Crypto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add release note items to our upcoming release's release notes page. We can edit them and get them into shape before publishing separately from code changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added the text suggested by @gilles-peskine-arm to the page.
0307707
to
ce1e24b
Compare
The PR is ready for review again. |
programs/Makefile
Outdated
pkey/rsa_sign$(EXEXT) pkey/rsa_verify$(EXEXT) \ | ||
pkey/rsa_sign_pss$(EXEXT) pkey/rsa_verify_pss$(EXEXT) \ | ||
psa/crypto_examples$(EXEXT) \ | ||
hash/hello$(EXEXT) hash/generic_sum$(EXEXT) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you align with tab-width 8 please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
These examples rely on the NET module, which we want to remove. In theory we could remove just the dependency, but we decided to remove the whole example because: - They showcase some bad crypto: custom, undocumented protocol (not obviously broken though, apart from authenticating only one side); hard-coded limit of 512-bit size for the DH modulus (2048 is the recommended minimum these days); direct use of the shared secret as a key (instead of applying a KDF); encryption with ECB, custom parameters and the client not having the ability to verify them. - The programs use the DH API in the same way that TLS does, so they have limited demonstration value. - The programs only show finite-field DH, which is not used all that much these days. What people want to see is mostly ECDH.
ff43390
to
bea98b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
These examples rely on the NET module, which we want to remove. In
theory we could remove just the dependency, but we decided to remove the
whole example because:
obviously broken though, apart from authenticating only one side);
hard-coded limit of 512-bit size for the DH modulus (2048 is the
recommended minimum these days); direct use of the shared secret as a
key (instead of applying a KDF); encryption with ECB, custom
parameters and the client not having the ability to verify them.
have limited demonstration value.
much these days. What people want to see is mostly ECDH.