aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/pkcs8.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pubkey/pkcs8.cpp')
-rw-r--r--src/pubkey/pkcs8.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/pubkey/pkcs8.cpp b/src/pubkey/pkcs8.cpp
index 400fdbb48..35ff7f206 100644
--- a/src/pubkey/pkcs8.cpp
+++ b/src/pubkey/pkcs8.cpp
@@ -105,19 +105,14 @@ SecureVector<byte> PKCS8_decode(DataSource& source, const User_Interface& ui,
key = decryptor.read_all();
}
- u32bit version;
-
BER_Decoder(key)
.start_cons(SEQUENCE)
- .decode(version)
+ .decode_and_check<u32bit>(0, "Unknown PKCS #8 version number")
.decode(pk_alg_id)
.decode(key, OCTET_STRING)
.discard_remaining()
.end_cons();
- if(version != 0)
- throw Decoding_Error("PKCS #8: Unknown version number");
-
break;
}
catch(Decoding_Error)