aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-06-23 06:00:52 +0000
committerlloyd <[email protected]>2006-06-23 06:00:52 +0000
commit940697169376f32d10da71d6f0d4660a71c45545 (patch)
tree2a55510b53c8106674c7677b6c3f5b6ac140e34f
parent754c16487b5c2f6ded58a251802ba72c74753282 (diff)
Add a new variant of Extensions::decode_from that doesn't thrown an
exception if it finds an unknown critical extension.
-rw-r--r--include/x509_ext.h1
-rw-r--r--src/x509_ext.cpp8
2 files changed, 9 insertions, 0 deletions
diff --git a/include/x509_ext.h b/include/x509_ext.h
index 147f17aa5..b26913feb 100644
--- a/include/x509_ext.h
+++ b/include/x509_ext.h
@@ -51,6 +51,7 @@ class Extensions : public ASN1_Object
public:
void encode_into(class DER_Encoder&) const;
void decode_from(class BER_Decoder&);
+ void decode_from(class BER_Decoder&, bool);
void contents_to(Data_Store&, Data_Store&) const;
diff --git a/src/x509_ext.cpp b/src/x509_ext.cpp
index 6f5e76645..d9e93a9af 100644
--- a/src/x509_ext.cpp
+++ b/src/x509_ext.cpp
@@ -48,6 +48,14 @@ void Extensions::encode_into(DER_Encoder& to_object) const
*************************************************/
void Extensions::decode_from(BER_Decoder& from_source)
{
+ decode_from(from_source, true);
+ }
+
+/*************************************************
+* Decode a list of Extensions *
+*************************************************/
+void Extensions::decode_from(BER_Decoder& from_source, bool throw_on_unknown)
+ {
for(u32bit j = 0; j != extensions.size(); ++j)
delete extensions[j];
extensions.clear();