aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ffi/ffi_util.h
Commit message (Collapse)AuthorAgeFilesLines
* Verify ffi object is not null before dereferencing itJack Lloyd2019-05-281-1/+5
| | | | | This shouldn't even happen if the header is still intact, but seemingly it can: #1983 so be robust as possible.
* Make exceptions easier to translate to error codesJack Lloyd2018-11-231-1/+3
| | | | | | | | | | | Avoid throwing base Botan::Exception type, as it is difficult to determine what the error is in that case. Add Exception::error_code and Exception::error_type which allows (for error code) more information about the error and (for error type) allows knowing the error type without requiring a sequence of catches. See GH #1742
* Remove support for Visual C++ 2013Jack Lloyd2018-10-011-2/+2
| | | | Closes GH #1557
* Avoid null pointer write in FFIJack Lloyd2018-09-281-1/+4
| | | | | | | | If a function returning variable length output was called with a null output buffer but a non-zero output buffer length, FFI layer would call memset(nullptr, 0, buffer_len) and crash. Caught by Coverity.
* Avoid throwing within the FFI layerJack Lloyd2018-08-161-4/+3
| | | | No reason given we know the message is going to be thrown away.
* De-inline ffi_guard_thunkJack Lloyd2018-08-131-34/+2
| | | | Saves about 300 Kb of code space in the FFI object files
* Better error reporting for FFIJack Lloyd2018-08-121-4/+16
| | | | | Previously safe_get(x) where x was null would return an error about an exception being thrown, instead of a null pointer error.
* Add a function to query output length of symmetric cipherJack Lloyd2018-08-101-1/+4
|
* Add botan_block_cipher_query_keylen plus some new FFI error codesJack Lloyd2018-07-241-2/+11
|
* Ensure exception types are exported from DLLJack Lloyd2018-03-061-1/+1
| | | | GH #983
* Simplify ffi call overheadJack Lloyd2017-10-111-40/+15
| | | | Notable reductions in code size, stack size and function call overhead.
* Add wrappers for reinterpret_cast between char* and uint8_t*Jack Lloyd2017-10-031-4/+5
| | | | | | | Generally speaking reinterpret_cast is sketchy stuff. But the special case of char*/uint8_t* is both common and safe. By isolating those, the remaining (likely sketchy) cases are easier to grep for.
* Avoid using namespace in FFI headersJack Lloyd2017-10-021-1/+1
| | | | Internal only headers but Sonar doesn't know that
* Another FFI struct vs class fixJack Lloyd2017-09-301-1/+1
|
* FFI objects have to be structs because we expose them to CJack Lloyd2017-09-301-1/+1
|
* Use class instead of struct for objects with member functionsJack Lloyd2017-09-301-2/+2
| | | | Flagged by Sonar and quite reasonable
* Apply final annotations to the library alsoJack Lloyd2017-09-221-2/+2
| | | | | Done by a perl script which converted all classes to final, followed by selective reversion where it caused compilation failures.
* Change header guard format to BOTAN_FOO_H_Jack Lloyd2017-09-201-2/+2
| | | | | | ISO C++ reserves names with double underscores in them Closes #512
* Add virtual destructor to FFI botan_structJack Lloyd2017-08-031-1/+1
| | | | | | As we do inherit from it, and delete through the base pointer. Found by Coverity scanner.
* Split up ffi.cpp into several filesJack Lloyd2017-07-311-0/+197
It was getting pretty big and would get worse over time, eg whenver I get around to adding TLS support.