-
Notifications
You must be signed in to change notification settings - Fork 16
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
Custom user callbacks (custom requests) #14
Conversation
…esting an unregistered callbacks return error
903e5cb
to
12c810e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Gotta move the state into server context and please make it smaller.
- made custom callback table part of server context - reduced number of callbacks to 8 - deleted wh_server_custom.h and moved contents to wh_server.h - Added wh_Client_CustomResponseCheckRegistered() helper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Minor nits, but I'm good with it at this point.
wolfhsm/wh_server.h
Outdated
@@ -12,6 +12,7 @@ | |||
#include "wolfhsm/wh_common.h" | |||
#include "wolfhsm/wh_comm.h" | |||
#include "wolfhsm/wh_nvm.h" | |||
#include "wolfhsm/wh_message_custom.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see where this was needed in this header.
- Renamed custom structs and functions to customcb - renamed files - added blocking client helper - changed request/response id from uint16_t to uint32_t
b1a94bb
to
1029307
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I'm going to push this in now. Here's a short list of minor tweaks:
- Rename to WH_ERROR_NOHANDLER
- Remove WH_ACTION_MAX if not needed
- Add 1 to actions so we can keep action ==0 as invalid.
- Add prototype for busy wait CheckRegistered to header.
First stab at simple user callback implementation. It allows for multiple (up to 255) "custom request callbacks" to be registered by the server, and allows for these callbacks to be requested by the client via the client API. It supports passing arbitrary data in and out of the server callback. It also provides a query functionality to check if a given callback has been registered.