-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement BIO_puts and add callback function support to BIO_puts,gets…
…,ctrl (#1721) ### Issues: CryptoAlg-2463 ### Description of changes: Currently, `BIO_puts` delegates to the public `BIO_write` API, which may result in unexpected behavior should applications rely on them being distinguishable (e.g., if a callback has certain logic for when write is called versus when puts is called). This change implements BIO_puts as its own function should this method be defined in the application, otherwise, it defaults to calling the "write" function of the type of BIO instantiated. This also expands on the work done in commit 5131684 to add support for `callback_ex`s in `BIO_puts`, `BIO_gets`, and `BIO_ctrl`. If no custom callback_ex function is defined, the default behavior remains unchanged. ### Call-outs: N/A ### Testing: - A custom BIO is defined to test cases where BIO_puts is defined - Additional test cases were added which use a mock callback created in previous testing to test the added callback functionality of BIO_gets, BIO_puts, and BIO_ctrl By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license. --------- Co-authored-by: Sean McGrail <[email protected]>
- Loading branch information
Showing
3 changed files
with
263 additions
and
21 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
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