Skip to content

We have HardwareRNG, let's use it!#10274

Merged
jp-bennett merged 1 commit intomasterfrom
moar-random
Apr 23, 2026
Merged

We have HardwareRNG, let's use it!#10274
jp-bennett merged 1 commit intomasterfrom
moar-random

Conversation

@jp-bennett
Copy link
Copy Markdown
Collaborator

Now that we have the HardwareRNG feature, let's start preferring it over simple random() calls in places that make sense.

We might in the future even add a set of HardwareRNG::random() functions to make this even simpler.

@github-actions github-actions Bot added needs-review Needs human review enhancement New feature or request labels Apr 23, 2026
@thebentern thebentern requested a review from Copilot April 23, 2026 16:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates nRF52 Bluetooth pairing to prefer HardwareRNG over random() when generating a non-fixed BLE PIN, aligning BLE security behavior with the new hardware-backed entropy facility.

Changes:

  • Add HardwareRNG include to the nRF52 Bluetooth implementation.
  • Generate random BLE passkeys using HardwareRNG::fill() and map to a 6-digit PIN range.

@jp-bennett jp-bennett added the cleanup Code cleanup or refactor label Apr 23, 2026
@jp-bennett jp-bennett merged commit 031f332 into master Apr 23, 2026
81 of 85 checks passed
@jp-bennett jp-bennett deleted the moar-random branch April 23, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Code cleanup or refactor enhancement New feature or request needs-review Needs human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants