strings record encoding used to create them.

in order to recreate the valid bytes for use in decryption it is necessary to know which encoding was used to read a string token. this is because utf16-be encoding has a byte-order marker which should be included in the resulting bytes.
This commit is contained in:
Eliot Jones
2020-01-26 17:07:58 +00:00
parent 693a3d5958
commit 6cf257a331
5 changed files with 345 additions and 4 deletions

View File

@@ -43,7 +43,7 @@
{
if (ownerToken is StringToken ownerString)
{
ownerBytes = OtherEncodings.StringAsLatin1Bytes(ownerString.Data);
ownerBytes = ownerString.GetBytes();
}
else if (ownerToken is HexToken ownerHex)
{
@@ -56,7 +56,7 @@
{
if (userToken is StringToken userString)
{
userBytes = OtherEncodings.StringAsLatin1Bytes(userString.Data);
userBytes = userString.GetBytes();
}
else if (userToken is HexToken userHex)
{