summaryrefslogtreecommitdiff
path: root/asn.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'asn.cpp')
-rw-r--r--asn.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/asn.cpp b/asn.cpp
index ed4ac82f..b2e86e06 100644
--- a/asn.cpp
+++ b/asn.cpp
@@ -168,13 +168,10 @@ size_t BERDecodeTextString(BufferedTransformation &bt, std::string &str, byte as
if (bc > bt.MaxRetrievable()) // Issue 346
BERDecodeError();
- SecByteBlock temp(bc);
- if (bc != bt.Get(temp, bc))
+ str.resize(bc);
+ if (bc != bt.Get(BytePtr(str), BytePtrSize(str)))
BERDecodeError();
- if (bc)
- str.assign((char *)temp.begin(), bc);
- else
- str.clear();
+
return bc;
}
@@ -304,6 +301,17 @@ void OID::BERDecodeAndCheck(BufferedTransformation &bt) const
BERDecodeError();
}
+std::ostream& OID::Print(std::ostream& out) const
+{
+ for (size_t i = 0; i < m_values.size(); ++i)
+ {
+ out << m_values[i];
+ if (i+1 < m_values.size())
+ out << ".";
+ }
+ return out;
+}
+
inline BufferedTransformation & EncodedObjectFilter::CurrentTarget()
{
if (m_flags & PUT_OBJECTS)