aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2007-02-28 02:41:40 +0000
committerlloyd <[email protected]>2007-02-28 02:41:40 +0000
commiteb0bd01952a834e35f70c139807140ec6ce06038 (patch)
treeb7ff104e6694bc60dae584494bb0abb4ae46adb5 /src
parent5b9be64b1238ce2c8672c3dcaa764ffadf8af852 (diff)
parentc54e7ea2c9276214021c392aad6c901624913393 (diff)
propagate from branch 'net.randombit.botan.stable' (head fd0242cd1f44b6d9d0e526c778860fcded174d62)
to branch 'net.randombit.botan' (head 8a5aa356cb3aab0af22b09f51bfa5540fe890bdf)
Diffstat (limited to 'src')
-rw-r--r--src/libstate.cpp3
-rw-r--r--src/pkcs8.cpp20
2 files changed, 8 insertions, 15 deletions
diff --git a/src/libstate.cpp b/src/libstate.cpp
index a8269a2b9..9eaa8a8b3 100644
--- a/src/libstate.cpp
+++ b/src/libstate.cpp
@@ -31,10 +31,7 @@ Library_State* global_lib_state = 0;
Library_State& global_state()
{
if(!global_lib_state)
- {
- abort();
throw Invalid_State("Library was not initialized correctly");
- }
return (*global_lib_state);
}
diff --git a/src/pkcs8.cpp b/src/pkcs8.cpp
index 5815e4f67..efc500c16 100644
--- a/src/pkcs8.cpp
+++ b/src/pkcs8.cpp
@@ -24,22 +24,18 @@ namespace {
* Get info from an EncryptedPrivateKeyInfo *
*************************************************/
SecureVector<byte> PKCS8_extract(DataSource& source,
- AlgorithmIdentifier& alg_id)
+ AlgorithmIdentifier& pbe_alg_id)
{
- SecureVector<byte> enc_pkcs8_key;
+ SecureVector<byte> key_data;
- try {
- BER_Decoder(source).start_cons(SEQUENCE)
- .decode(alg_id)
- .decode(enc_pkcs8_key, OCTET_STRING)
+ BER_Decoder(source)
+ .start_cons(SEQUENCE)
+ .decode(pbe_alg_id)
+ .decode(key_data, OCTET_STRING)
.verify_end();
- }
- catch(Decoding_Error)
- {
- throw PKCS8_Exception("Private key decoding failed");
- }
- return enc_pkcs8_key;
+
+ return key_data;
}
/*************************************************