-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix output null-termination for tr31_export()
Unfortunately tr31_export() had a silly bug whereby the last byte of the provided key block output buffer would not be zero'd. Therefore, if the provided buffer was exactly one byte longer than the created key block, the resulting key block string would not be null-terminated. Note that although tr31_import() has been refactored not to require null-terminated key block input to make it more convenient for the caller, it continues to be convenient for the caller that tr31_export() null-terminates the key block output. This is such that the caller can equally easily print the key block output or obtain its length using strlen(). The key block buffer output length parameter has also been renamed to key_block_buf_len to distinguish it from from the exact key block input length expected in key_block_len.
- Loading branch information
Showing
2 changed files
with
16 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters