aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-03-08 21:23:28 +0000
committerlloyd <[email protected]>2015-03-08 21:23:28 +0000
commit9d151adc7cb19831ea844d98fc13af27b790e369 (patch)
tree956ccd68efeecc2e6aff5e8e480339c170780e21 /src
parentc84b150c50093c680f18f0792bf7d52f157b01fe (diff)
Cleanups
Diffstat (limited to 'src')
-rw-r--r--src/cmd/asn1.cpp4
-rw-r--r--src/lib/ffi/ffi.cpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/cmd/asn1.cpp b/src/cmd/asn1.cpp
index 8b6400e2a..d02a4cced 100644
--- a/src/cmd/asn1.cpp
+++ b/src/cmd/asn1.cpp
@@ -287,11 +287,15 @@ void decode(BER_Decoder& decoder, size_t level)
ASN1_String str;
data.decode(str);
if(UTF8_TERMINAL)
+ {
emit(type_name(type_tag), level, length,
Charset::transcode(str.iso_8859(),
LATIN1_CHARSET, UTF8_CHARSET));
+ }
else
+ {
emit(type_name(type_tag), level, length, str.iso_8859());
+ }
}
else if(type_tag == UTC_TIME || type_tag == GENERALIZED_TIME)
{
diff --git a/src/lib/ffi/ffi.cpp b/src/lib/ffi/ffi.cpp
index c5a862200..eba3f5f94 100644
--- a/src/lib/ffi/ffi.cpp
+++ b/src/lib/ffi/ffi.cpp
@@ -786,6 +786,8 @@ int botan_privkey_load(botan_privkey_t* key, botan_rng_t rng_obj,
const uint8_t bits[], size_t len,
const char* password)
{
+ *key = nullptr;
+
try
{
Botan::DataSource_Memory src(bits, len);
@@ -810,8 +812,6 @@ int botan_privkey_load(botan_privkey_t* key, botan_rng_t rng_obj,
}
return -1;
- *key = nullptr;
- return BOTAN_FFI_ERROR_EXCEPTION_THROWN;
}
int botan_privkey_destroy(botan_privkey_t key)