diff options
author | lloyd <[email protected]> | 2007-03-01 00:14:49 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2007-03-01 00:14:49 +0000 |
commit | fe17e1b8f9f73fcc7664b1f880677f45c8d6f1ea (patch) | |
tree | b6c6ac461f69e01fc39ea2846fbe6d09cf87d78e /src | |
parent | 3009920d500adada75f8e9dd7b28eeca3c42354f (diff) | |
parent | eb0bd01952a834e35f70c139807140ec6ce06038 (diff) |
merge of '8d39383f5142c3a42ccef1b06333f5aef24e998f'
and 'e5ca819cb65b0c124d3ca9538d2e8bc0faa8ecb0'
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; } /************************************************* |