Clear MSVC conversion warning

This commit is contained in:
Jeffrey Walton 2022-02-11 19:55:33 -05:00
parent 4473b50803
commit 9dcfe507d3
No known key found for this signature in database
GPG Key ID: B36AB348921B1838

View File

@ -1543,6 +1543,10 @@ bool TestASN1Parse()
return pass;
}
inline byte int2byte(int n) {
return static_cast<byte>(n);
}
bool TestASN1Functions()
{
std::cout << "\nTesting ASN.1 functions...\n\n";
@ -1584,7 +1588,7 @@ bool TestASN1Functions()
ByteQueue encoded, reencoded, decoded;
std::string recovered;
len = DEREncodeTextString(encoded, ConstBytePtr(message), BytePtrSize(message), asnStringTypes[i]);
len = DEREncodeTextString(encoded, ConstBytePtr(message), BytePtrSize(message), int2byte(asnStringTypes[i]));
DERReencode(encoded, reencoded);
rlen = reencoded.MaxRetrievable();
(void)BERDecodeTextString(reencoded, recovered, asnStringTypes[i]);
@ -1615,8 +1619,8 @@ bool TestASN1Functions()
ByteQueue encoded, decoded;
SecByteBlock recovered;
(void)DEREncodeDate(encoded, message, asnDateTypes[i]);
(void)BERDecodeDate(encoded, recovered, asnDateTypes[i]);
(void)DEREncodeDate(encoded, message, int2byte(asnDateTypes[i]));
(void)BERDecodeDate(encoded, recovered, int2byte(asnDateTypes[i]));
fail = (message != recovered);
if (fail) failed++;