-
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
Align Spake2 protocol message type definition with spec #4167
Align Spake2 protocol message type definition with spec #4167
Conversation
payloadHeader | ||
.SetMessageType(msgType) // | ||
.SetProtocolID(Protocols::kProtocol_SecureChannel); | ||
payloadHeader.SetMessageType(static_cast<uint8_t>(msgType)).SetProtocolID(Protocols::kProtocol_SecureChannel); |
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.
nit: it was slightly easier to read before even though // was awkward
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.
@yufengwangca Please merge on top of #4166 ? |
Done |
Size increase report for "esp32-example-build" from 4e78f50
Full report output
|
@@ -63,7 +63,7 @@ void SecurePairingSession::Clear() | |||
memset(&mPoint[0], 0, sizeof(mPoint)); | |||
memset(&mWS[0][0], 0, sizeof(mWS)); | |||
memset(&mKe[0], 0, sizeof(mKe)); | |||
mNextExpectedMsg = Spake2pMsgType::kSpake2pMsgError; | |||
mNextExpectedMsg = Protocols::SecureChannel::MsgType::PASE_Spake2pError; |
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 wonder whether using namespace Protocols::SecureChannel;
might be helpful to reduce the typing. Or using MsgType = Protocols::SecureChannel::MsgType
?
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.
Followup for this one as desired.
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.
using MsgType = Protocols::SecureChannel::MsgType
Now we have taken out the prefix of MsgType, Then how we differentiate "using MsgType = Protocols::Common::MsgType" and "using MsgType = Protocols::SecureChannel::MsgType" ?
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.
If we have to deal with both of them here, then we can't do that, of course. In that case maybe the best thing to do is using namespace chip::Protocols;
or namespace SecureChannel = Protocols::SecureChannel;
. Again, just to make things a bit shorter; it's not a big deal either way.
Problem
Currently, transport layer still use the internal temporary message type definition for protocol Spake2
Summary of Changes
Align Spake2 protocol message type definition with spec 0.7.