aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ffi/ffi_pkey.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-12-28 19:56:29 -0500
committerJack Lloyd <[email protected]>2017-12-28 19:56:29 -0500
commitdfd25890cdd7c3c0148cd8101cab85539d87e475 (patch)
tree182a92d1995f2199775048755ef3d14c3bd477e4 /src/lib/ffi/ffi_pkey.cpp
parent7500ed1eb1ecdb88d154ee1f50030a7e93733dc0 (diff)
Add explicit int return type declarations on FFI lambdas.
Sun Studio gives a strange warning about this. This probably doesn't help actually compile under Sun Studio. But it doesn't hurt to be explicit.
Diffstat (limited to 'src/lib/ffi/ffi_pkey.cpp')
-rw-r--r--src/lib/ffi/ffi_pkey.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/ffi/ffi_pkey.cpp b/src/lib/ffi/ffi_pkey.cpp
index e377f13e7..ae7e61433 100644
--- a/src/lib/ffi/ffi_pkey.cpp
+++ b/src/lib/ffi/ffi_pkey.cpp
@@ -28,7 +28,7 @@ int botan_privkey_create(botan_privkey_t* key_obj,
const char* algo_params,
botan_rng_t rng_obj)
{
- return ffi_guard_thunk(BOTAN_CURRENT_FUNCTION, [=]() {
+ return ffi_guard_thunk(BOTAN_CURRENT_FUNCTION, [=]() -> int {
if(key_obj == nullptr)
return BOTAN_FFI_ERROR_NULL_POINTER;
@@ -60,7 +60,7 @@ int botan_privkey_load(botan_privkey_t* key, botan_rng_t rng_obj,
{
*key = nullptr;
- return ffi_guard_thunk(BOTAN_CURRENT_FUNCTION, [=]() {
+ return ffi_guard_thunk(BOTAN_CURRENT_FUNCTION, [=]() -> int {
Botan::DataSource_Memory src(bits, len);
Botan::RandomNumberGenerator& rng = safe_get(rng_obj);
@@ -95,7 +95,7 @@ int botan_pubkey_load(botan_pubkey_t* key,
{
*key = nullptr;
- return ffi_guard_thunk(BOTAN_CURRENT_FUNCTION, [=]() {
+ return ffi_guard_thunk(BOTAN_CURRENT_FUNCTION, [=]() -> int {
Botan::DataSource_Memory src(bits, bits_len);
std::unique_ptr<Botan::Public_Key> pubkey(Botan::X509::load_key(src));
@@ -114,7 +114,7 @@ int botan_pubkey_destroy(botan_pubkey_t key)
int botan_privkey_export_pubkey(botan_pubkey_t* pubout, botan_privkey_t key_obj)
{
- return ffi_guard_thunk(BOTAN_CURRENT_FUNCTION, [=]() {
+ return ffi_guard_thunk(BOTAN_CURRENT_FUNCTION, [=]() -> int {
std::unique_ptr<Botan::Public_Key>
pubkey(Botan::X509::load_key(Botan::X509::BER_encode(safe_get(key_obj))));
@@ -260,7 +260,7 @@ int botan_pubkey_fingerprint(botan_pubkey_t key, const char* hash_fn,
int botan_pkcs_hash_id(const char* hash_name, uint8_t pkcs_id[], size_t* pkcs_id_len)
{
#if defined(BOTAN_HAS_HASH_ID)
- return ffi_guard_thunk(BOTAN_CURRENT_FUNCTION, [=]() {
+ return ffi_guard_thunk(BOTAN_CURRENT_FUNCTION, [=]() -> int {
const std::vector<uint8_t> hash_id = Botan::pkcs_hash_id(hash_name);
return write_output(pkcs_id, pkcs_id_len, hash_id.data(), hash_id.size());
});