Enable parsing of the initial log entry & use of log entry types. #466
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current implementation will return an empty
LogEntries
structure ifget_log_entries
returns aLogEntries
that contains an initialLogEntry
. AFAIK this is caused by a failure to parse / deserialize thecmd
field of theLogEntry
when it's set to255
as this doesn't currently map to acommand::Code
. The initial log entry is described in https://developers.yubico.com/YubiHSM2/Commands/Get_Log_Entries.htmlThis PR does 2 things:
LogEntries
andLogEntry
structure out of theaudit::commands
module (pub(crate)
visibility) to theaudit
module where they're givenpub
visibility to allow use of these types by external code.from_u8
andto_u8
inresponse::Code
to map the value for the initial log entry value from theLogEntry::cmd
field.