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

load server-side key via CLI #16

Merged
merged 3 commits into from
Oct 14, 2024
Merged

Conversation

bigbrett
Copy link
Contributor

@bigbrett bigbrett commented Oct 11, 2024

  • Adds the ability to load a key into the server keystore with the --key and --id CLI arguments. Required for wolfBoot simulator support
  • Wraps the example server in while(1) and reinitializes the server context on client disconnect

@bigbrett bigbrett requested a review from billphipps October 11, 2024 19:22
@bigbrett bigbrett force-pushed the wolfBoot-sim-server branch from 336bed0 to 3024e76 Compare October 11, 2024 19:22
@bigbrett
Copy link
Contributor Author

@billphipps ug, needs your fixes in #15 to get merged first, otherwise will keep failing CI

@bigbrett bigbrett self-assigned this Oct 11, 2024
Copy link
Contributor

@billphipps billphipps left a comment

Choose a reason for hiding this comment

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

All good. Minor nits. Feel free to completely ignore.


static int wh_ServerTask(void* cf)
static int loadAndStoreKeys(whServerContext* server, whKeyId* outKeyId,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
static int loadAndStoreKeys(whServerContext* server, whKeyId* outKeyId,
static int _LoadAndStoreKeys(whServerContext* server, whKeyId* outKeyId,

Been trying to make all static functions start with _

int ret;
int keyFd;
int keySz;
char keyLabel[] = "baby's first key";
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe consider using basename(keyFilePath) for the label?

#define WOLFHSM_CFG_SERVER_DMAADDR_COUNT 8
#define WOLFHSM_CFG_SERVER_CUSTOMCB_COUNT 8

#define XMEMFENCE() __atomic_thread_fence(__ATOMIC_SEQ_CST)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure you need this override for the example? I think the autodetect logic should pick the right one.

@billphipps billphipps merged commit 768d2d5 into wolfSSL:main Oct 14, 2024
1 check failed
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.

2 participants