summaryrefslogtreecommitdiff
path: root/asn.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2019-09-30 03:32:09 -0400
committerJeffrey Walton <noloader@gmail.com>2019-09-30 03:32:09 -0400
commit42044d509587659605ffacdbd275825ed747adc6 (patch)
tree7674f60e8a7eb8b4bf3e3275ac43b1a318cf5a3d /asn.cpp
parente4b25dcffed47ce799caef4d290590816ca19708 (diff)
downloadcryptopp-git-42044d509587659605ffacdbd275825ed747adc6.tar.gz
Fix Travis build on OS X
Diffstat (limited to 'asn.cpp')
-rw-r--r--asn.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/asn.cpp b/asn.cpp
index 231125c4..e835238e 100644
--- a/asn.cpp
+++ b/asn.cpp
@@ -8,7 +8,9 @@
#include "asn.h"
+#include <iostream>
#include <iomanip>
+#include <sstream>
#include <time.h>
NAMESPACE_BEGIN(CryptoPP)
@@ -285,8 +287,10 @@ void DERReencode(BufferedTransformation &source, BufferedTransformation &dest)
size_t BERDecodePeekLength(BufferedTransformation &bt)
{
- ByteQueue tagAndLength;
lword count = (std::min)(bt.MaxRetrievable(), static_cast<lword>(16));
+ if (count == 0) return 0;
+
+ ByteQueue tagAndLength;
bt.CopyTo(tagAndLength, count);
// Skip tag
@@ -376,13 +380,14 @@ void OID::BERDecodeAndCheck(BufferedTransformation &bt) const
std::ostream& OID::Print(std::ostream& out) const
{
+ std::ostringstream oss;
for (size_t i = 0; i < m_values.size(); ++i)
{
- out << m_values[i];
+ oss << m_values[i];
if (i+1 < m_values.size())
- out << ".";
+ oss << ".";
}
- return out;
+ return out << oss.str();
}
inline BufferedTransformation & EncodedObjectFilter::CurrentTarget()