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

✨🔒 add optional on-chip debugger authentication #1053

Merged
merged 21 commits into from
Oct 11, 2024

Conversation

stnolting
Copy link
Owner

@stnolting stnolting commented Oct 11, 2024

This PR adds optional support for a authentication module for the on-chip debugger.

The authentication module is enabled by the new OCD_AUTHENTICATION top generic. A simple/exemplary authentication module is implemented in neorv32_debug_auth.vhd. Users can modify/replace this module to implement custom security mechanism.

The interface complies to the the RISC-V debug spec. Hence, the authenticator can (also) be accessed by openOCD (https://openocd.org/doc/html/Architecture-and-Core-Commands.html):

16.11.4 RISC-V Authentication Commands

The following commands can be used to authenticate to a RISC-V system. Eg. a trivial challenge-response protocol could be implemented as follows in a configuration file, immediately following init:

set challenge [riscv authdata_read]
riscv authdata_write [expr {$challenge + 1}]

Command: riscv authdata_read
Return the 32-bit value read from authdata.

Command: riscv authdata_write value
Write the 32-bit value to authdata.


⚠️ This PR also renames the OCD-related top generics:

  • ON_CHIP_DEBUGGER_EN -> OCD_EN
  • DM_LEGACY_MODE -> OCD_DM_LEGACY_MODE

@stnolting stnolting added enhancement New feature or request HW Hardware-related labels Oct 11, 2024
@stnolting stnolting self-assigned this Oct 11, 2024
@stnolting stnolting marked this pull request as ready for review October 11, 2024 18:09
@stnolting stnolting merged commit 8d978b3 into main Oct 11, 2024
14 checks passed
@stnolting stnolting deleted the debug_authentication branch October 11, 2024 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request HW Hardware-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant