-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add test for PK parsing of keys using compressed points #6937
Add test for PK parsing of keys using compressed points #6937
Conversation
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
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.
What's there looks good to me, but I have a question about what isn't there: why no ec_224_pub.comp.pem
(and associated Parse Public EC Key #3a
test case)?
Because I'm not sure those curves are supported: Indeed if I try to add it then |
Ah good point :) Still, it might be better to be explicit about it and add a negative test case with a comment then. Otherwise it's hard to know if the missing case is intentional or an oversight when looking at it in the future. |
I thought about adding a comment, but you're right: a negative test is probably better here in order to enforce/verify the check |
The test is expected to fail, so we verify that this is really not suppported Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
4bbad5e
to
247d123
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.
Looks good except one point where I think a cleaner solution is available.
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
247d123
to
fa49a8e
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.
Just one bit of documentation to improve.
CI is still going, but already unhappy |
c4a7f05
to
ad0adf6
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
I created #7060 to track the parts that we decided to consider out of scope here. @gilles-peskine-arm perhaps that should be added to some tech debt list? Also, CI is now green so this is ready for re-review. |
Note to self & other gatekeepers: I suspect this might conflict (as in, not seen by git but only by the CI) with #6970 which was just merged, so we want to wait for the nightly re-run of pr-merge before merging this. Temporarily labeling "do not merge" "needs-ci" as a reminder. |
No conflict with #6970. Now that I see the results, I should have known: 6970 is about building without ECDSA, and we'll run into problem with compressed points only when building without ECP. Anyway, better safe than sorry. |
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.
Just one problem in the documentation.
include/mbedtls/ecp.h
Outdated
* Point formats, from RFC 4492's enum ECPointFormat | ||
/** | ||
* The uncompressed point format for Short Weierstrass curves | ||
* (MBEDTLS_ECP_DP_SECP* and MBEDTLS_ECP_DP_BP*). //no-check-names |
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.
This includes “//no-check-names” in the documentation. That's not good.
Our normal convention is to write XXX
or xxx
for a wildcard, not *
. And check_names.py
has an exception for names containing these.
* (MBEDTLS_ECP_DP_SECP* and MBEDTLS_ECP_DP_BP*). //no-check-names | |
* (MBEDTLS_ECP_DP_SECP_XXX and MBEDTLS_ECP_DP_BP_XXX). |
and likewise below.
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
ad0adf6
to
78f79d3
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
* \warning While this format is supported for all concerned curves for | ||
* writing, when it comes to parsing, it is not supported for all | ||
* curves. Specifically, parsing compressed points on | ||
* MBEDTLS_ECP_DP_SECP224R1 and MBEDTLS_ECP_DP_SECP224K1 is not |
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.
Non-blocker:
* MBEDTLS_ECP_DP_SECP224R1 and MBEDTLS_ECP_DP_SECP224K1 is not | |
* #MBEDTLS_ECP_DP_SECP224R1 and #MBEDTLS_ECP_DP_SECP224K1 is not |
(Doxygen automatically makes links for foo()
, but not for a macro name.)
Description
Following merging of PR #6282,
PK parse
module should now be able to parse EC compressed points. This PR adds some test for that purpose.Resolves #6886
Gatekeeper checklist