aboutsummaryrefslogtreecommitdiffstats
path: root/src/x509cert.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-06-06 16:13:02 +0000
committerlloyd <[email protected]>2006-06-06 16:13:02 +0000
commitc59a57ca84e0ef929f85c059425948c6d6b55c8a (patch)
tree6440cfe63434aa484f939f633b7eeea83ea4088b /src/x509cert.cpp
parent34599f47dc2fda43440e7191acd6f608f5cecdd2 (diff)
Modify force_decode() to take advantage of the new ASN.1 syntax
Diffstat (limited to 'src/x509cert.cpp')
-rw-r--r--src/x509cert.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/x509cert.cpp b/src/x509cert.cpp
index 1313d9590..26de29748 100644
--- a/src/x509cert.cpp
+++ b/src/x509cert.cpp
@@ -79,17 +79,18 @@ void X509_Certificate::force_decode()
X509_Time start, end;
BER_Decoder tbs_cert(tbs_bits);
+
tbs_cert.decode_optional(version, ASN1_Tag(0),
- ASN1_Tag(CONSTRUCTED | CONTEXT_SPECIFIC));
- tbs_cert.decode(serial_bn);
- tbs_cert.decode(sig_algo_inner);
- tbs_cert.decode(dn_issuer);
- tbs_cert.start_cons(SEQUENCE)
- .decode(start)
- .decode(end)
- .verify_end()
- .end_cons()
- .decode(dn_subject);
+ ASN1_Tag(CONSTRUCTED | CONTEXT_SPECIFIC))
+ .decode(serial_bn)
+ .decode(sig_algo_inner)
+ .decode(dn_issuer)
+ .start_cons(SEQUENCE)
+ .decode(start)
+ .decode(end)
+ .verify_end()
+ .end_cons()
+ .decode(dn_subject);
if(version > 2)
throw Decoding_Error("Unknown X.509 cert version " + to_string(version));