aboutsummaryrefslogtreecommitdiff
path: root/plugins/VNLib.Plugins.Essentials.SocialOauth
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/VNLib.Plugins.Essentials.SocialOauth')
-rw-r--r--plugins/VNLib.Plugins.Essentials.SocialOauth/src/ClientAccessTokenState.cs2
-rw-r--r--plugins/VNLib.Plugins.Essentials.SocialOauth/src/ClientRequestState.cs4
-rw-r--r--plugins/VNLib.Plugins.Essentials.SocialOauth/src/SocialOauthBase.cs10
3 files changed, 8 insertions, 8 deletions
diff --git a/plugins/VNLib.Plugins.Essentials.SocialOauth/src/ClientAccessTokenState.cs b/plugins/VNLib.Plugins.Essentials.SocialOauth/src/ClientAccessTokenState.cs
index e5de597..8a7aea3 100644
--- a/plugins/VNLib.Plugins.Essentials.SocialOauth/src/ClientAccessTokenState.cs
+++ b/plugins/VNLib.Plugins.Essentials.SocialOauth/src/ClientAccessTokenState.cs
@@ -69,7 +69,7 @@ namespace VNLib.Plugins.Essentials.SocialOauth
public override int GetHashCode() => Token!.GetHashCode(StringComparison.Ordinal);
void ICacheable.Evicted()
{
- Memory.UnsafeZeroMemory(Nonce);
+ MemoryUtil.UnsafeZeroMemory(Nonce);
}
void INonce.ComputeNonce(Span<byte> buffer)
diff --git a/plugins/VNLib.Plugins.Essentials.SocialOauth/src/ClientRequestState.cs b/plugins/VNLib.Plugins.Essentials.SocialOauth/src/ClientRequestState.cs
index 2f35e48..ba369c2 100644
--- a/plugins/VNLib.Plugins.Essentials.SocialOauth/src/ClientRequestState.cs
+++ b/plugins/VNLib.Plugins.Essentials.SocialOauth/src/ClientRequestState.cs
@@ -74,8 +74,8 @@ namespace VNLib.Plugins.Essentials.SocialOauth
void ICacheable.Evicted()
{
//Zero secrets on eviction
- Memory.UnsafeZeroMemory(State);
- Memory.UnsafeZeroMemory(_rawKey);
+ MemoryUtil.UnsafeZeroMemory(State);
+ MemoryUtil.UnsafeZeroMemory(_rawKey);
}
}
} \ No newline at end of file
diff --git a/plugins/VNLib.Plugins.Essentials.SocialOauth/src/SocialOauthBase.cs b/plugins/VNLib.Plugins.Essentials.SocialOauth/src/SocialOauthBase.cs
index 6815bf3..79e3b1b 100644
--- a/plugins/VNLib.Plugins.Essentials.SocialOauth/src/SocialOauthBase.cs
+++ b/plugins/VNLib.Plugins.Essentials.SocialOauth/src/SocialOauthBase.cs
@@ -238,7 +238,7 @@ namespace VNLib.Plugins.Essentials.SocialOauth
void ICacheable.Evicted()
{
//Erase nonce
- Memory.UnsafeZeroMemory(RawNonce);
+ MemoryUtil.UnsafeZeroMemory(RawNonce);
}
public override bool Equals(object? obj)
@@ -422,11 +422,11 @@ namespace VNLib.Plugins.Essentials.SocialOauth
//Generate a new random passowrd incase the user wants to use a local account to log in sometime in the future
PrivateString passhash = Config.Passwords.Hash(randomPass);
//overwite the password bytes
- Memory.InitializeBlock(randomPass.AsSpan());
+ MemoryUtil.InitializeBlock(randomPass.AsSpan());
try
{
//Create the user with the specified email address, minimum privilage level, and an empty password
- user = await Config.Users.CreateUserAsync(userLogin.UserId!, userAccount.EmailAddress, AccountManager.MINIMUM_LEVEL, passhash, entity.EventCancellation);
+ user = await Config.Users.CreateUserAsync(userLogin.UserId!, userAccount.EmailAddress, AccountUtil.MINIMUM_LEVEL, passhash, entity.EventCancellation);
//Set active status
user.Status = UserStatus.Active;
//Store the new profile
@@ -570,7 +570,7 @@ namespace VNLib.Plugins.Essentials.SocialOauth
private string BuildUrl(string base32Nonce, string pubKey, ReadOnlySpan<char> scheme, ReadOnlySpan<char> redirectAuthority, Encoding enc)
{
//Char buffer for base32 and url building
- using UnsafeMemoryHandle<byte> buffer = Memory.UnsafeAlloc<byte>(8192, true);
+ using UnsafeMemoryHandle<byte> buffer = MemoryUtil.UnsafeAlloc<byte>(8192, true);
//get bin buffer slice
Span<byte> binBuffer = buffer.Span[1024..];
@@ -609,7 +609,7 @@ namespace VNLib.Plugins.Essentials.SocialOauth
//Encode the url to binary
int byteCount = enc.GetBytes(url, encodingBuffer);
//Encrypt the binary
- ERRNO count = AccountManager.TryEncryptClientData(pubKey, encodingBuffer[..byteCount], in encryptionBuffer);
+ ERRNO count = AccountUtil.TryEncryptClientData(pubKey, encodingBuffer[..byteCount], in encryptionBuffer);
//base64 encode the encrypted
return Convert.ToBase64String(encryptionBuffer[0..(int)count]);
}