-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Implement Secure Pairing class #2021
Conversation
CHIP_ERROR err = CHIP_NO_ERROR; | ||
|
||
VerifyOrExit(salt != nullptr, err = CHIP_ERROR_INVALID_ARGUMENT); | ||
VerifyOrExit(saltLen > 0, err = CHIP_ERROR_INVALID_ARGUMENT); |
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.
Perhaps we should already create a minimum salt length constant since it can never be 0.
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.
@balducci-apple do you have a suggestion for minimum salt length?
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.
Filed #2075 to track it.
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.
Thanks!
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 great! Thanks for the contribution.
VerifyOrExit(header.GetMessageType() == (uint8_t) mNextExpectedMsg, err = CHIP_ERROR_INVALID_MESSAGE_TYPE); | ||
|
||
// The protocol for handling pA, pB, cB and cA is defined in SPAKE2 Plus specifications | ||
// (https://www.ietf.org/id/draft-bar-cfrg-spake2plus-01.html) |
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.
The IETF specification includes test vectors at the end. Could a test be added that proves the code passes the IETF test vectors?
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.
We are running the test vectors on the underlying spake2p implementation (part of CHIP in src/crypto/tests). https://github.com/project-chip/connectedhomeip/blob/master/src/crypto/tests/SPAKE2P_RFC_test_vectors.h
Running those test vectors here may not be feasible, as we cannot control what random values are generated/used by the spake2p APIs internally.
Size increase report for "gn_nrf-example-build"
Full report output
|
Size increase report for "gn_linux-example-build"
Full report output
|
Size increase report for "nrf-example-build"
Full report output
|
Size increase report for "nrfconnect-example-build"
Full report output
|
Size increase report for "linux-example-build"
Full report output
|
Size increase report for "esp32-example-build"
Full report output
|
Problem
Need a class that wraps complexities of secure pairing (using SPAKE2P).
Summary of Changes
Added a new class
SecurePairingSession
. Added some unit tests. More tests are forthcoming.