summaryrefslogtreecommitdiff
path: root/asn.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2019-10-03 04:12:16 -0400
committerJeffrey Walton <noloader@gmail.com>2019-10-03 04:12:16 -0400
commit366fdce86f968500994d9fb81bd0d37053a01126 (patch)
tree38ab77659e3142dabad73e860b339faf1a004dcc /asn.cpp
parentf5c817221bace9baec5ace88b3c7588d21a34c0e (diff)
downloadcryptopp-git-366fdce86f968500994d9fb81bd0d37053a01126.tar.gz
Add BytePtr and ConstBytePtr overloads for SecByteBlock (GH #890)
Diffstat (limited to 'asn.cpp')
-rw-r--r--asn.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/asn.cpp b/asn.cpp
index e835238e..99ddf415 100644
--- a/asn.cpp
+++ b/asn.cpp
@@ -6,7 +6,9 @@
#ifndef CRYPTOPP_IMPORTS
+#include "cryptlib.h"
#include "asn.h"
+#include "misc.h"
#include <iostream>
#include <iomanip>
@@ -15,7 +17,6 @@
NAMESPACE_BEGIN(CryptoPP)
-/// DER Length
size_t DERLengthEncode(BufferedTransformation &bt, lword length)
{
size_t i=0;
@@ -129,7 +130,7 @@ size_t BERDecodeOctetString(BufferedTransformation &bt, SecByteBlock &str)
BERDecodeError();
str.New(bc);
- if (bc != bt.Get(str, bc))
+ if (bc != bt.Get(BytePtr(str), bc))
BERDecodeError();
return bc;
}
@@ -181,7 +182,7 @@ size_t BERDecodeTextString(BufferedTransformation &bt, SecByteBlock &str, byte a
BERDecodeError();
str.resize(bc);
- if (bc != bt.Get(str, str.size()))
+ if (bc != bt.Get(BytePtr(str), BytePtrSize(str)))
BERDecodeError();
return bc;
@@ -227,7 +228,7 @@ size_t BERDecodeDate(BufferedTransformation &bt, SecByteBlock &str, byte asnTag)
BERDecodeError();
str.resize(bc);
- if (bc != bt.Get(str, str.size()))
+ if (bc != bt.Get(BytePtr(str), BytePtrSize(str)))
BERDecodeError();
return bc;
@@ -263,7 +264,7 @@ size_t BERDecodeBitString(BufferedTransformation &bt, SecByteBlock &str, unsigne
BERDecodeError();
unusedBits = unused;
str.resize(bc-1);
- if ((bc-1) != bt.Get(str, bc-1))
+ if ((bc-1) != bt.Get(BytePtr(str), bc-1))
BERDecodeError();
return bc-1;
}