summaryrefslogtreecommitdiff
path: root/asn.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-04-03 17:32:56 -0400
committerJeffrey Walton <noloader@gmail.com>2018-04-03 17:32:56 -0400
commitc27d3a944246113251caf4b0b844475ce2ca164a (patch)
tree468cda8e4ad73685882ab98cfab3f5b0c6f1ca55 /asn.h
parent9888d22d4bd2d090c9d67bde1e096ec80b046b3d (diff)
downloadcryptopp-git-c27d3a944246113251caf4b0b844475ce2ca164a.tar.gz
Make ASN.1 decoder m_values protected
Diffstat (limited to 'asn.h')
-rw-r--r--asn.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/asn.h b/asn.h
index 66641997..b3c71629 100644
--- a/asn.h
+++ b/asn.h
@@ -201,6 +201,15 @@ public:
/// </pre>
void BERDecodeAndCheck(BufferedTransformation &bt) const;
+ const std::vector<word32>& GetValues() const {
+ return m_values;
+ }
+
+protected:
+ friend bool operator==(const OID &lhs, const OID &rhs);
+ friend bool operator!=(const OID &lhs, const OID &rhs);
+ friend bool operator<(const OID &lhs, const OID &rhs);
+
std::vector<word32> m_values;
private:
@@ -213,6 +222,7 @@ class EncodedObjectFilter : public Filter
{
public:
enum Flag {PUT_OBJECTS=1, PUT_MESSANGE_END_AFTER_EACH_OBJECT=2, PUT_MESSANGE_END_AFTER_ALL_OBJECTS=4, PUT_MESSANGE_SERIES_END_AFTER_ALL_OBJECTS=8};
+ enum State {IDENTIFIER, LENGTH, BODY, TAIL, ALL_DONE} m_state;
virtual ~EncodedObjectFilter() {}
@@ -233,13 +243,11 @@ public:
private:
BufferedTransformation & CurrentTarget();
- word32 m_flags;
- unsigned int m_nObjects, m_nCurrentObject, m_level;
- std::vector<unsigned int> m_positions;
ByteQueue m_queue;
- enum State {IDENTIFIER, LENGTH, BODY, TAIL, ALL_DONE} m_state;
- byte m_id;
+ std::vector<unsigned int> m_positions;
lword m_lengthRemaining;
+ word32 m_nObjects, m_nCurrentObject, m_level, m_flags;
+ byte m_id;
};
/// \brief BER General Decoder
@@ -265,8 +273,8 @@ public:
protected:
BufferedTransformation &m_inQueue;
- bool m_finished, m_definiteLength;
lword m_length;
+ bool m_finished, m_definiteLength;
private:
void Init(byte asnTag);
@@ -294,9 +302,8 @@ public:
private:
BufferedTransformation &m_outQueue;
- bool m_finished;
-
byte m_asnTag;
+ bool m_finished;
};
/// \brief BER Sequence Decoder