Skip to content

Commit

Permalink
The key length is increased from 16 to 32 bits. (#954)
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiamurialdo authored Jan 30, 2024
1 parent afc3d1e commit 7968b35
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static class WebSecurityHelper
{
static readonly IGXLogger _log = GXLoggerFactory.GetLogger(typeof(WebSecurityHelper).FullName);

const int SecretKeyMinimumLength = 16;
const int SecretKeyMinimumLength = 32;

public static string StripInvalidChars(string input)
{
Expand Down
22 changes: 22 additions & 0 deletions dotnet/test/DotNetUnitTest/Crypto/SignatureTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.Diagnostics;
using System.Web.Configuration;
using GeneXus.Application;
using GeneXus.Utils;
using GeneXus.Web.Security;
using Xunit;

namespace UnitTesting
{
public class SignatureTest
{
[Fact]
public void SignSecurityToken()
{
GxContext context = new GxContext();
string signed = WebSecurityHelper.Sign("WFPROTOTYPER", string.Empty, "Customer.CustomerRegistration", SecureTokenHelper.SecurityMode.Sign, context);
Assert.NotEmpty(signed);

}
}
}
3 changes: 3 additions & 0 deletions dotnet/test/DotNetUnitTest/DotNetUnitTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
</Content>
</ItemGroup>
<ItemGroup>
<None Update="application.key">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="confmapping.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
2 changes: 2 additions & 0 deletions dotnet/test/DotNetUnitTest/application.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
7E2E22D26FF2989E2444852A85E57867
7E2E22D26FF2989E2444852A85E57867
7 changes: 4 additions & 3 deletions dotnet/test/DotNetUnitTest/client.exe.config
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@
<add key="STATIC_CONTENT" value=""/>
<add key="GX_BUILD_NUMBER" value="140565"/>
<add key="CACHE_CONTENT_EXPIRATION" value="36"/>
<add key="DataStore1" value="Default"/>
<add key="DataStore-Count" value="1"/>
<add key="DataStore-Default" value="Default"/>
<add key="DataStore1" value="Default"/>
<add key="DataStore-Count" value="1"/>
<add key="DataStore-Default" value="Default"/>
<add key="USE_ENCRYPTION" value="SESSION"/>
</appSettings>
<languages >
<English code="eng" time_fmt="12" decimal_point="." thousand_sep="," date_fmt="MDY" culture="en-US"/>
Expand Down

0 comments on commit 7968b35

Please sign in to comment.