summaryrefslogtreecommitdiff
path: root/validat0.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2021-03-23 06:20:15 -0400
committerJeffrey Walton <noloader@gmail.com>2021-03-23 06:20:15 -0400
commitd8199c88bfa5d3a4e13e1be0b032a166272239d8 (patch)
tree7a7a93b8cc73e8be58f07fed13479e3dbccc524a /validat0.cpp
parent1302bd5b452dac4ead89d55c9701d02c52882381 (diff)
downloadcryptopp-git-d8199c88bfa5d3a4e13e1be0b032a166272239d8.tar.gz
Update self tests
Diffstat (limited to 'validat0.cpp')
-rw-r--r--validat0.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/validat0.cpp b/validat0.cpp
index 3e05ca16..68e73150 100644
--- a/validat0.cpp
+++ b/validat0.cpp
@@ -1603,9 +1603,9 @@ bool TestASN1Functions()
std::cout << "DEREncodeTextString" << "\n";
}
-#if 0
{
- const SecByteBlock message = "Sun, 21 Mar 2021 01:00:00 +0000";
+ const byte date[] = "Sun, 21 Mar 2021 01:00:00 +0000";
+ SecByteBlock message; message.Assign(date, sizeof(date)-1);
const int asnDateTypes[] = {UTC_TIME, GENERALIZED_TIME};
unsigned int failed = 0;
size_t i = 0;
@@ -1613,9 +1613,9 @@ bool TestASN1Functions()
for (i = 0; i < COUNTOF(asnDateTypes); ++i)
{
ByteQueue encoded, decoded;
- std::string recovered;
+ SecByteBlock recovered;
- (void)DEREncodeDate(encoded, ConstBytePtr(message), BytePtrSize(message), asnDateTypes[i]);
+ (void)DEREncodeDate(encoded, message, asnDateTypes[i]);
(void)BERDecodeDate(encoded, recovered, asnDateTypes[i]);
fail = (message != recovered);
@@ -1631,7 +1631,6 @@ bool TestASN1Functions()
std::cout << (fail ? "FAILED" : "passed") << " ";
std::cout << "BERDecodeDate" << "\n";
}
-#endif
return pass;
}