-
Notifications
You must be signed in to change notification settings - Fork 24
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
Basic authentication using HMAC for federates joining a federation #105
Conversation
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 realize this is a draft, but it doesn't seem to perform any authentication. Guess this isn't ready for review?
Thanks, @edwardalee for checking! You're right, this is not ready for review yet. I created this draft so that I can easily share my progress with others using |
… modified. Need to add openssl requirements
… statements, and add comments.
…id for authentication messages.
This comment was marked as duplicate.
This comment was marked as duplicate.
with: | ||
runtime-ref: ${{ github.ref }} | ||
compiler-ref: ${{ needs.fetch-lf.outputs.ref }} | ||
scheduler: GEDF_NP_CI | ||
|
||
lf-adaptive: | ||
needs: fetch-lf | ||
uses: lf-lang/lingua-franca/.github/workflows/c-tests.yml@master | ||
uses: lf-lang/lingua-franca/.github/workflows/c-tests.yml@auth | ||
with: |
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.
These changes are only for CI tests.
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 looks good to me. Though I think that we might want to enable security by default and provide the option to disable it for whatever reason...
This PR is a submodule PR of the PR lf-lang/lingua-franca#1432 and is the first step towards resolving lf-lang/lingua-franca#1146. Both PRs should be merged to work.
Overall information is also in lf-lang/lingua-franca#1432. This PR details the HMAC authentication implementation.
This PR is about the RTI.c and federate.c authentication implementation.
The main idea of security is not to send the federation ID in plain text, by using it as an HMAC key.
3-Way Handshake
1. RTI_HELLO (RTI -> Federate)
The RTI sends a RTI_HELLO message to the federate when TCP connection is established. The message is in this order:
2. FED_RESPONSE (Federate -> RTI)
The federate sends a response message to the RTI. It creates it's own nonce, and makes a HMAC tag using the federate ID as the key. The message is in the following order:
The HMAC tag is composed of the following order:
3. RTI_RESPONSE (RTI -> Federate)
The RTI sends a response message to the federate. It checks the received HMAC created by the federate, and also makes a HMAC tag. The message is in the following order:
The HMAC tag is composed of the following order:
Federate Check
The federate finally checks the received HMAC created by the RTI.
Discussion
The 3-way handshake protocol does not change the existing federation id check process.
receive_and_check_fed_id_message()
still always happen after the 3-way handshake. So, theauth:true
option only enables the 3-way handshake. Changing the protocol will be discussed at the future.Also, the
auth:true
option will be changed from boolean to string in future.