Skip to content

Commit 19ee285

Browse files
The key length is increased from 16 to 32 bits.
1 parent 39d264f commit 19ee285

File tree

5 files changed

+32
-4
lines changed

5 files changed

+32
-4
lines changed

dotnet/src/dotnetframework/GxClasses/Security/WebSecurity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static class WebSecurityHelper
1818
{
1919
static readonly IGXLogger _log = GXLoggerFactory.GetLogger(typeof(WebSecurityHelper).FullName);
2020

21-
const int SecretKeyMinimumLength = 16;
21+
const int SecretKeyMinimumLength = 32;
2222

2323
public static string StripInvalidChars(string input)
2424
{
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using System.Diagnostics;
3+
using System.Web.Configuration;
4+
using GeneXus.Application;
5+
using GeneXus.Utils;
6+
using GeneXus.Web.Security;
7+
using Xunit;
8+
9+
namespace UnitTesting
10+
{
11+
public class SignatureTest
12+
{
13+
[Fact]
14+
public void SignSecurityToken()
15+
{
16+
GxContext context = new GxContext();
17+
string signed = WebSecurityHelper.Sign("WFPROTOTYPER", string.Empty, "Customer.CustomerRegistration", SecureTokenHelper.SecurityMode.Sign, context);
18+
Assert.NotEmpty(signed);
19+
20+
}
21+
}
22+
}

dotnet/test/DotNetUnitTest/DotNetUnitTest.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@
7070
</Content>
7171
</ItemGroup>
7272
<ItemGroup>
73+
<None Update="application.key">
74+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
75+
</None>
7376
<None Update="confmapping.json">
7477
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
7578
</None>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
7E2E22D26FF2989E2444852A85E57867
2+
7E2E22D26FF2989E2444852A85E57867

dotnet/test/DotNetUnitTest/client.exe.config

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,10 @@
9090
<add key="STATIC_CONTENT" value=""/>
9191
<add key="GX_BUILD_NUMBER" value="140565"/>
9292
<add key="CACHE_CONTENT_EXPIRATION" value="36"/>
93-
<add key="DataStore1" value="Default"/>
94-
<add key="DataStore-Count" value="1"/>
95-
<add key="DataStore-Default" value="Default"/>
93+
<add key="DataStore1" value="Default"/>
94+
<add key="DataStore-Count" value="1"/>
95+
<add key="DataStore-Default" value="Default"/>
96+
<add key="USE_ENCRYPTION" value="SESSION"/>
9697
</appSettings>
9798
<languages >
9899
<English code="eng" time_fmt="12" decimal_point="." thousand_sep="," date_fmt="MDY" culture="en-US"/>

0 commit comments

Comments
 (0)