diff options
author | Jeffrey Walton <noloader@gmail.com> | 2019-09-30 03:32:09 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2019-09-30 03:32:09 -0400 |
commit | 42044d509587659605ffacdbd275825ed747adc6 (patch) | |
tree | 7674f60e8a7eb8b4bf3e3275ac43b1a318cf5a3d /asn.cpp | |
parent | e4b25dcffed47ce799caef4d290590816ca19708 (diff) | |
download | cryptopp-git-42044d509587659605ffacdbd275825ed747adc6.tar.gz |
Fix Travis build on OS X
Diffstat (limited to 'asn.cpp')
-rw-r--r-- | asn.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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()
|