-
Notifications
You must be signed in to change notification settings - Fork 5
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
Generate SSL key and csr on device and support installing a certificate via MQTT #15
Open
mattbnz
wants to merge
9
commits into
oseiler2:main
Choose a base branch
from
co2monnz:registration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is step 1 towards providing an improved "first boot with SSL" experience.
Struggling with stack size here...
Generating a key requires a reasonable number of multi-kb buffers. If we naively put those on the stack we have to enlarge the stack size for the MQTT task, which permanently denies other tasks use of that memory, even though it's going to be almost always unused in the MQTT stack given key generation is a very rare operation. Allocating these buffers explicitly on the heap means the memory is free for everything else to use the rest of the time.
This allows the server to pass back a signed certificate for the monitor, which will check it is signed by the trusted CA and matches the private key previously generated by a requestCert/regenerateKey command and then install it and reboot. This is fully functional for bootstrapping SSL on a device now, but not yet production ready - need further support for updating config, etc first.
Can you give this branch a try please? |
What are the changes? It's a bit tedious to get a diff between what's in this pull request and what's in the branch because of the changed filenames, etc. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'd like to be able to have new devices self-register for secure MQTT without having to generate and transfer keys/certs off the device and then flash them on via a full filesytem update.
This adds the necessary logic to have the device itself generate a new key and associated CSR which it will submit via MQTT, and then await receipt of a signed certificate via a return MQTT message. How and if the server actually signs/generates the certs and sends it back is left up to the user, as its likely to be highly context specific.