diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libstate.cpp | 3 | ||||
-rw-r--r-- | src/pkcs8.cpp | 20 |
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; } /************************************************* |