break them a bit more...

This commit is contained in:
UbitUmarov
2024-02-24 15:47:06 +00:00
parent 121f270414
commit eb9afdaffc
3 changed files with 47 additions and 36 deletions

View File

@@ -6380,13 +6380,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if(string.IsNullOrEmpty(secret) || string.IsNullOrEmpty(plainText))
return LSL_String.Empty;
string ret = Util.AESEncrypt(secret, plainText);
if(string.IsNullOrEmpty(ret))
ReadOnlySpan<char> ret = Util.AESEncrypt(secret.AsSpan(), plainText.AsSpan());
if(ret.Length == 0)
{
OSSLShoutError("osAESEncrypt: Failed to encrypt!");
return LSL_String.Empty;
}
return ret;
return ret.ToString();
}
public LSL_String osAESDecrypt(string secret, string encryptedText)
@@ -6394,13 +6394,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if(string.IsNullOrEmpty(secret) || string.IsNullOrEmpty(encryptedText))
return LSL_String.Empty;
string ret = Util.AESDecrypt(secret, encryptedText);
if(string.IsNullOrEmpty(ret))
ReadOnlySpan<char> ret = Util.AESDecrypt(secret.AsSpan(), encryptedText.AsSpan());
if(ret.Length == 0)
{
OSSLShoutError("osAESDecrypt: Failed to Decrypt!");
return LSL_String.Empty;
}
return ret;
return ret.ToString();
}
public LSL_String osAESEncryptTo(string secret, string plainText, string ivString)
@@ -6408,13 +6408,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if(string.IsNullOrEmpty(secret) || string.IsNullOrEmpty(plainText) || string.IsNullOrEmpty(ivString))
return LSL_String.Empty;
string ret = Util.AESEncryptTo(secret, plainText, ivString);
if(string.IsNullOrEmpty(ret))
ReadOnlySpan<char> ret = Util.AESEncryptTo(secret.AsSpan(), plainText.AsSpan(), ivString.AsSpan());
if (ret.Length == 0)
{
OSSLShoutError("osAESEncryptTo: Failed to encrypt!");
return LSL_String.Empty;
}
return ret;
return ret.ToString();
}
public LSL_String osAESDecryptFrom(string secret, string encryptedText, string ivString)
@@ -6422,13 +6422,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if(string.IsNullOrEmpty(secret) || string.IsNullOrEmpty(encryptedText) || string.IsNullOrEmpty(ivString))
return LSL_String.Empty;
string ret = Util.AESDecryptFrom(secret, encryptedText, ivString);
if(string.IsNullOrEmpty(ret))
ReadOnlySpan<char> ret = Util.AESDecryptFrom(secret.AsSpan(), encryptedText.AsSpan(), ivString.AsSpan());
if (ret.Length == 0)
{
OSSLShoutError("osAESDecryptFrom: Failed to decrypt!");
return LSL_String.Empty;
}
return ret;
return ret.ToString();
}
}
}