Skip to content

Conversation

rouming
Copy link
Contributor

@rouming rouming commented Aug 16, 2023

AuthContainer is the envelope for all messages coming from the controller or sent by EVE. For the LOC case the node config should be encrypted. The best place to provide encryption is to modify the AuthContainer itself, so that the message can be both signed and encrypted (in this exact order).

This patch adds the cipherData and cipherContext members to the AuthContainer to encrypt the payload. The decrypt and validate procedure is the following:

  1. if cipherData is valid the encrypted payload is defined in the cipherData.cipherData member, the protectedPayload is set to null.
  2. Once EVE stack decrypts the payload, protectedPayload member is set with the decrypted data.
  3. The signature verification procedure can follow.

CC: @deitch

Cipher structures will be used not only from the config package.
In the next patch CipherBlock will be used from auth/auth.proto,
in order to avoid cycle dependencies move everything cipher related
to the evecommon package

Signed-off-by: Roman Penyaev <[email protected]>
@rouming rouming requested a review from eriknordmark as a code owner August 16, 2023 11:20
@deitch
Copy link
Contributor

deitch commented Aug 17, 2023

I cannot comment on the content of the change (especially as Erik did that). I can comment on the toolset. It looks like yo ran this using a single step more recent minor version of protoc, but a several steps older minor version of protoc-gen-go.

Can you rerun the make proto with the right tools? Or more easily, inside the devcontainer? If you are in vscode, it should recognize it for you. Else follow the instructions in the README.

@rouming
Copy link
Contributor Author

rouming commented Aug 17, 2023

I cannot comment on the content of the change (especially as Erik did that). I can comment on the toolset. It looks like yo ran this using a single step more recent minor version of protoc, but a several steps older minor version of protoc-gen-go.

Can you rerun the make proto with the right tools? Or more easily, inside the devcontainer? If you are in vscode, it should recognize it for you. Else follow the instructions in the README.

Avi, as I said in the mail thread I can't install devcontainer. I spent quite a lot of time trying to build it from sources and also failed (I'm on linux, not on mac). I'm not using vscode. The whole procedure of 'make proto' now is inconvenient for me and I expect more complains will follow (the whole eve team is using linux, not mac).

I can rebuild the protoc-gen-go, but as I said this is very inconvenient.

AuthContainer is the envolope for all messages comming from the controller
or sent by EVE. For the LOC the node config should be encrypted. The best
place to provide encryption is to modify the `AuthContainer` itself, so that
the message can be both signed and encrypted (in this exact order).

This patch adds the `cipherData` and `cipherContext` members to the
`AuthContainer` to encrypt the payload. The decrypt and validate
procedure is the following:

  1. if `cipherData` is valid the encrypted payload is defined in the
     `cipherData.cipherData` member, the `protectedPayload` is set to null.
  2. Once EVE stack decrypts the payload, `protectedPayload` member is set
     with the decrypted data.
  3. The signature verification procedure can follow.

Signed-off-by: Roman Penyaev <[email protected]>
All changes after the 'make proto'.

Signed-off-by: Roman Penyaev <[email protected]>
@rouming
Copy link
Contributor Author

rouming commented Aug 17, 2023

@deitch @eriknordmark updated, please take a look.

Copy link
Contributor

@eriknordmark eriknordmark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but if you can pull in #15 you should be able to manually use the devcontainer on Linux.

@rouming
Copy link
Contributor Author

rouming commented Aug 18, 2023

LGTM but if you can pull in #15 you should be able to manually use the devcontainer on Linux.

Thanks, @eriknordmark . These changes work for me. I replied here: #15 (comment)

@rouming
Copy link
Contributor Author

rouming commented Aug 18, 2023

@eriknordmark @deitch can you please merge this? I don't have write access.

@eriknordmark eriknordmark merged commit 272fc06 into lf-edge:main Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants