diff options
author | vnugent <public@vaughnnugent.com> | 2023-04-13 11:37:30 -0400 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2023-04-13 11:37:30 -0400 |
commit | 0bafd510a0091960dbfe5ad08d3d524153117536 (patch) | |
tree | 414a00aae7afc84f9b11d6bd7395248d5d24b668 /plugins/VNLib.Plugins.Essentials.Accounts | |
parent | 5d0660dea5e20d1bda06ea9b06b04bbac36b0db9 (diff) |
Database creation tools
Diffstat (limited to 'plugins/VNLib.Plugins.Essentials.Accounts')
-rw-r--r-- | plugins/VNLib.Plugins.Essentials.Accounts/src/SecurityProvider/AccountSecProvider.cs | 11 | ||||
-rw-r--r-- | plugins/VNLib.Plugins.Essentials.Accounts/src/VNLib.Plugins.Essentials.Accounts.csproj | 2 |
2 files changed, 5 insertions, 8 deletions
diff --git a/plugins/VNLib.Plugins.Essentials.Accounts/src/SecurityProvider/AccountSecProvider.cs b/plugins/VNLib.Plugins.Essentials.Accounts/src/SecurityProvider/AccountSecProvider.cs index eadebcc..c63304a 100644 --- a/plugins/VNLib.Plugins.Essentials.Accounts/src/SecurityProvider/AccountSecProvider.cs +++ b/plugins/VNLib.Plugins.Essentials.Accounts/src/SecurityProvider/AccountSecProvider.cs @@ -64,14 +64,11 @@ namespace VNLib.Plugins.Essentials.Accounts.SecurityProvider private const HashAlg ClientTokenHmacType = HashAlg.SHA256; - /// <summary> /// The client data encryption padding. /// </summary> public static readonly RSAEncryptionPadding ClientEncryptonPadding = RSAEncryptionPadding.OaepSHA256; - //private static HMAC GetPubKeySigningAlg(byte[] key) => new HMACSHA256(key); - private readonly AccountSecConfig _config; public AccountSecProvider(PluginBase plugin) @@ -248,7 +245,7 @@ namespace VNLib.Plugins.Essentials.Accounts.SecurityProvider } //Alloc buffer for encode/decode - using IMemoryHandle<byte> buffer = MemoryUtil.SafeAllocNearestPage<byte>(4000, true); + using IMemoryHandle<byte> buffer = MemoryUtil.SafeAllocNearestPage(4000, true); try { using RSA rsa = RSA.Create(); @@ -314,7 +311,7 @@ namespace VNLib.Plugins.Essentials.Accounts.SecurityProvider //Parse the client jwt signed message using JsonWebToken jwt = JsonWebToken.Parse(signedMessage); - using (UnsafeMemoryHandle<byte> decodeBuffer = MemoryUtil.UnsafeAllocNearestPage<byte>(_config.TokenKeySize, true)) + using (UnsafeMemoryHandle<byte> decodeBuffer = MemoryUtil.UnsafeAllocNearestPage(_config.TokenKeySize, true)) { //Recover the key from base32 ERRNO count = VnEncoding.TryFromBase32Chars(sharedKey, decodeBuffer.Span); @@ -401,7 +398,7 @@ namespace VNLib.Plugins.Essentials.Accounts.SecurityProvider //Alloc buffer for decoding the base64 signatures - using UnsafeMemoryHandle<byte> buffer = MemoryUtil.UnsafeAllocNearestPage<byte>(2 * _config.LoginCookieSize, true); + using UnsafeMemoryHandle<byte> buffer = MemoryUtil.UnsafeAllocNearestPage(2 * _config.LoginCookieSize, true); //Slice up buffers Span<byte> cookieBuffer = buffer.Span[.._config.LoginCookieSize]; @@ -496,7 +493,7 @@ namespace VNLib.Plugins.Essentials.Accounts.SecurityProvider } //Alloc a buffer for decoding the public key - using UnsafeMemoryHandle<byte> pubKeyBuffer = MemoryUtil.UnsafeAllocNearestPage<byte>(base64PubKey.Length, true); + using UnsafeMemoryHandle<byte> pubKeyBuffer = MemoryUtil.UnsafeAllocNearestPage(base64PubKey.Length, true); //Decode the public key ERRNO pbkBytesWritten = VnEncoding.TryFromBase64Chars(base64PubKey, pubKeyBuffer.Span); diff --git a/plugins/VNLib.Plugins.Essentials.Accounts/src/VNLib.Plugins.Essentials.Accounts.csproj b/plugins/VNLib.Plugins.Essentials.Accounts/src/VNLib.Plugins.Essentials.Accounts.csproj index e43c0af..c96900e 100644 --- a/plugins/VNLib.Plugins.Essentials.Accounts/src/VNLib.Plugins.Essentials.Accounts.csproj +++ b/plugins/VNLib.Plugins.Essentials.Accounts/src/VNLib.Plugins.Essentials.Accounts.csproj @@ -43,7 +43,7 @@ <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> - <PackageReference Include="FluentValidation" Version="11.5.1" /> + <PackageReference Include="FluentValidation" Version="11.5.2" /> </ItemGroup> <ItemGroup> |