Skip to content

Commit

Permalink
bridge: debug: Drop the need for AST_DEBUG_PASSWORD
Browse files Browse the repository at this point in the history
Aspeed have self-published the password. How to locate the public copy
it is described in the code comment.

Signed-off-by: Andrew Jeffery <[email protected]>
  • Loading branch information
amboar committed May 28, 2024
1 parent 1c838b8 commit 13b1f56
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions src/bridge/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,28 @@

#define to_debug(ahb) container_of(ahb, struct debug, ahb)

/*
* Aspeed have self-published the debug UART password. Given that it's no-longer
* secret, embed it directly in culvert rather than require the user to specify
* it in the environment.
*
* Page 381, under "5. start use debug command"
*
* https://github.com/AspeedTech-BMC/openbmc/releases/download/v09.01/SDK_User_Guide_v09.01.pdf
*/
static const char *password = "5z&0VK{@`HW}H~V310=l=JB+M]IV-f;Sz98XfCA&Rp)i|Jo=2?IBN$QaQ2\"Kb|Ov";

static inline int streq(const char *a, const char *b)
{
return !strcmp(a, b);
}

int debug_enter(struct debug *ctx)
{
const char *password;
int rc;

logi("Entering debug mode\n");

password = getenv("AST_DEBUG_PASSWORD");
if (!password) {
loge("AST_DEBUG_PASSWORD environment variable is not defined\n");
return -ENOTSUP;
}

rc = console_set_baud(ctx->console, 1200);
if (rc < 0)
return rc;
Expand Down Expand Up @@ -464,15 +468,6 @@ int debug_init_v(struct debug *ctx, va_list args)
const char *interface;
int rc, fd;

/*
* Sanity-check presence of the password, though we also test again below
* where we use it to avoid TOCTOU.
*/
if (!getenv("AST_DEBUG_PASSWORD")) {
loge("AST_DEBUG_PASSWORD environment variable is not defined\n");
return -ENOTSUP;
}

interface = va_arg(args, const char *);

if (!interface)
Expand Down

0 comments on commit 13b1f56

Please sign in to comment.