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

Change Store AWS IoT Private Key and Certificate in SPI Flash avoiding device-specific compilations #6179

Merged
merged 1 commit into from
Aug 4, 2019

Conversation

s-hadinger
Copy link
Collaborator

Description:

Following discussion on #5860, the AWS IoT credentials (~800 bytes) are now moved from source code to SPI Flash in unused location in bank FF.

This means that you will not need to compile device-specific firmwares. The same AWS IoT enabled firmware can be used on multiple devices, and the credentials (Private Key and Certificate) can be loaded with the new TLSKey command.

Added base64-1.1.1 Arduino library, used only when AWS IoT is enabled.

Code impact: +500 bytes when AWS IoT is enabled. No impact on standard firmware.

Related issue (if applicable): fixes #5860

Checklist:

  • The pull request is done against the latest dev branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR.
  • The code change is tested and works on core 2.3.0, 2.4.2 and 2.5.2
    only 2.4.2 and 2.5.2
  • The code change pass travis tests. Your PR cannot be merged unless tests pass
  • I accept the CLA.

@s-hadinger
Copy link
Collaborator Author

Note: I will change the wiki page after the PR is merged.

@arendst arendst merged commit 93e2d76 into arendst:development Aug 4, 2019
@s-hadinger s-hadinger deleted the tls_privkey_flash branch August 4, 2019 18:51
@arendst
Copy link
Owner

arendst commented Aug 5, 2019

Thx for the implementation.

As it stands it will only work with 1M devices; the location has to move with other flash sizes.

I will refactor with correct offset based on used linker script (as I do with OTA too) and move the code also to settings.ino as there the flash routines are currently stored.

@s-hadinger
Copy link
Collaborator Author

Thanks Theo. I didn’t think of 4M devices. Appreciated.

arendst added a commit that referenced this pull request Aug 5, 2019
Fix AWS exceptions and make TLS flash location relative to flash size (#6179)
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.

Best place to store AWS IoT client private_key+certificate?
2 participants