diff options
author | Jack Lloyd <[email protected]> | 2018-08-16 15:41:29 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-08-16 15:41:29 -0400 |
commit | 15e149ac2dab3b22273c166839cfbf1fb947b2d4 (patch) | |
tree | b70cb82b5561a5d107ac67801d0fa1ecf84849d1 /src/lib/ffi/ffi_pkey_algs.cpp | |
parent | 7886721dfcd6b09c187ca624a7d31c8d5f6f62e0 (diff) |
Avoid throwing within the FFI layer
No reason given we know the message is going to be thrown away.
Diffstat (limited to 'src/lib/ffi/ffi_pkey_algs.cpp')
-rw-r--r-- | src/lib/ffi/ffi_pkey_algs.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/ffi/ffi_pkey_algs.cpp b/src/lib/ffi/ffi_pkey_algs.cpp index 622da7a14..7987639c8 100644 --- a/src/lib/ffi/ffi_pkey_algs.cpp +++ b/src/lib/ffi/ffi_pkey_algs.cpp @@ -117,7 +117,7 @@ Botan::BigInt pubkey_get_field(const Botan::Public_Key& key, else if(field == "e") return rsa->get_e(); else - throw Botan::Exception("Field not supported"); + return BOTAN_FFI_ERROR_BAD_PARAMETER; } #endif @@ -134,7 +134,7 @@ Botan::BigInt pubkey_get_field(const Botan::Public_Key& key, else if(field == "y") return dl->get_y(); else - throw Botan::Exception("Field not supported"); + return BOTAN_FFI_ERROR_BAD_PARAMETER; } #endif @@ -160,12 +160,12 @@ Botan::BigInt pubkey_get_field(const Botan::Public_Key& key, else if(field == "order") return ecc->domain().get_order(); else - throw Botan::Exception("Field not supported"); + return BOTAN_FFI_ERROR_BAD_PARAMETER; } #endif // Some other algorithm type not supported by this function - throw Botan::Exception("Unsupported algorithm type for botan_pubkey_get_field"); + return BOTAN_FFI_ERROR_NOT_IMPLEMENTED; } Botan::BigInt privkey_get_field(const Botan::Private_Key& key, @@ -216,7 +216,7 @@ Botan::BigInt privkey_get_field(const Botan::Private_Key& key, #endif // Some other algorithm type not supported by this function - throw Botan::Exception("Unsupported algorithm type for botan_privkey_get_field"); + return BOTAN_FFI_ERROR_NOT_IMPLEMENTED; } } |