aboutsummaryrefslogtreecommitdiffstats
path: root/src/cert/x509crl
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-10-07 15:32:51 +0000
committerlloyd <[email protected]>2010-10-07 15:32:51 +0000
commit232b855507e28ff92476d60adb08cd05564a20a6 (patch)
treeeddf0e2b3abf8be44f229853e5f558852ac59564 /src/cert/x509crl
parenta89498427ca32822fe1a273c8eb83b48da01ee1b (diff)
Forward port CRL fixes from rev 7bb2001cd554a1acc3d345914ea710ff0e1d3a6b
Diffstat (limited to 'src/cert/x509crl')
-rw-r--r--src/cert/x509crl/crl_ent.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/cert/x509crl/crl_ent.cpp b/src/cert/x509crl/crl_ent.cpp
index 807e99ac9..bdc35b038 100644
--- a/src/cert/x509crl/crl_ent.cpp
+++ b/src/cert/x509crl/crl_ent.cpp
@@ -1,6 +1,6 @@
/*
* CRL Entry
-* (C) 1999-2007 Jack Lloyd
+* (C) 1999-2010 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/
@@ -77,7 +77,9 @@ void CRL_Entry::encode_into(DER_Encoder& der) const
der.start_cons(SEQUENCE)
.encode(BigInt::decode(serial))
.encode(time)
- .encode(extensions)
+ .start_cons(SEQUENCE)
+ .encode(extensions)
+ .end_cons()
.end_cons();
}
@@ -87,20 +89,23 @@ void CRL_Entry::encode_into(DER_Encoder& der) const
void CRL_Entry::decode_from(BER_Decoder& source)
{
BigInt serial_number_bn;
+ reason = UNSPECIFIED;
+
+ BER_Decoder entry = source.start_cons(SEQUENCE);
- source.start_cons(SEQUENCE)
- .decode(serial_number_bn)
- .decode(time);
+ entry.decode(serial_number_bn).decode(time);
- if(source.more_items())
+ if(entry.more_items())
{
Extensions extensions(throw_on_unknown_critical);
- source.decode(extensions);
+ entry.decode(extensions);
Data_Store info;
extensions.contents_to(info, info);
reason = CRL_Code(info.get1_u32bit("X509v3.CRLReasonCode"));
}
+ entry.end_cons();
+
serial = BigInt::encode(serial_number_bn);
}