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

Move the temporary fabricSecret bit to be a CASESession member. #7919

Merged

Conversation

bzbarsky-apple
Copy link
Contributor

Right now it's a static and our example apps have the CASESession as a
static in a different file (via CASEServer). At least on Linux the
static initializer for the CASEServer runs first, the CASESession
constructor runs, sets up the fabricSecret, then the
P256ECDHDerivedSecret constructor runs and sets its length to 0. And
then trying to use that fabricSecret later on fails.

Making the fabricSecret a member of CASESession ensures its
constructor runs before the logic in the CASESession constructor.

Problem

all-clusters-app is not able to actually send a SigmaR2 message, because IPK generation fails.

Change overview

Fix things so that IPK generation succeeds.

Testing

Manual for now, but #7896 will end up testing this in CI; this issue is one of the things causing tests there to fail.

Right now it's a static and our example apps have the CASESession as a
static in a different file (via CASEServer).  At least on Linux the
static initializer for the CASEServer runs first, the CASESession
constructor runs, sets up the fabricSecret, then the
P256ECDHDerivedSecret constructor runs and sets its length to 0.  And
then trying to use that fabricSecret later on fails.

Making the fabricSecret a member of CASESession ensures its
constructor runs before the logic in the CASESession constructor.
@bzbarsky-apple bzbarsky-apple requested a review from pan-apple June 25, 2021 18:42
@todo
Copy link

todo bot commented Jun 25, 2021

Remove mFabricSecret later

// TODO: Remove mFabricSecret later
P256ECDHDerivedSecret mFabricSecret;
P256ECDHDerivedSecret mSharedSecret;
OperationalCredentialSet * mOpCredSet;
CertificateKeyId mTrustedRootId;


This comment was generated by todo based on a TODO comment in 5132137 in #7919. cc @bzbarsky-apple.

@bzbarsky-apple bzbarsky-apple merged commit dccf72f into project-chip:master Jun 25, 2021
@todo todo bot mentioned this pull request Jun 25, 2021
@bzbarsky-apple bzbarsky-apple deleted the fix-case-static-init branch June 25, 2021 20:33
nikita-s-wrk pushed a commit to nikita-s-wrk/connectedhomeip that referenced this pull request Sep 23, 2021
…ect-chip#7919)

Right now it's a static and our example apps have the CASESession as a
static in a different file (via CASEServer).  At least on Linux the
static initializer for the CASEServer runs first, the CASESession
constructor runs, sets up the fabricSecret, then the
P256ECDHDerivedSecret constructor runs and sets its length to 0.  And
then trying to use that fabricSecret later on fails.

Making the fabricSecret a member of CASESession ensures its
constructor runs before the logic in the CASESession constructor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants