Skip to content

Commit e7bdc14

Browse files
committed
Updated SRP Nuget package reference to v1.0.1.
1 parent a314ba5 commit e7bdc14

14 files changed

+27
-26
lines changed

source/Zyan.Communication/Security/SecureRemotePassword/SrpAuthenticationProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private AuthResponseMessage AuthStep1(AuthRequestMessage authRequest)
9393
}
9494

9595
// generate fake salt and B values so that attacker cannot tell whether the given user exists or not
96-
var fakeSalt = SrpParameters.H(userName + UnknownUserSalt).ToHex();
96+
var fakeSalt = SrpParameters.Hash(userName + UnknownUserSalt).ToHex();
9797
var fakeEphemeral = SrpServer.GenerateEphemeral(fakeSalt);
9898
return ResponseStep1(fakeSalt, fakeEphemeral.Public);
9999
}

source/Zyan.Communication/Zyan.Communication.Android.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<HintPath>..\packages\Zyan.SafeDeserializationHelpers.0.3.0\lib\net35\Zyan.SafeDeserializationHelpers.dll</HintPath>
5656
</Reference>
5757
<Reference Include="srp">
58-
<HintPath>..\packages\srp.1.0.0\lib\net45\srp.dll</HintPath>
58+
<HintPath>..\packages\srp.1.0.1\lib\net45\srp.dll</HintPath>
5959
<Private>True</Private>
6060
</Reference>
6161
</ItemGroup>

source/Zyan.Communication/Zyan.Communication.Fx3.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<HintPath>..\packages\Zyan.SafeDeserializationHelpers.0.5.0\lib\net35\Zyan.SafeDeserializationHelpers.dll</HintPath>
7171
</Reference>
7272
<Reference Include="srp">
73-
<HintPath>..\packages\srp.1.0.0\lib\net35\srp.dll</HintPath>
73+
<HintPath>..\packages\srp.1.0.1\lib\net35\srp.dll</HintPath>
7474
<Private>True</Private>
7575
</Reference>
7676
</ItemGroup>

source/Zyan.Communication/Zyan.Communication.Fx4.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<HintPath>..\packages\Zyan.SafeDeserializationHelpers.0.5.0\lib\net35\Zyan.SafeDeserializationHelpers.dll</HintPath>
5959
</Reference>
6060
<Reference Include="srp">
61-
<HintPath>..\packages\srp.1.0.0\lib\net40\srp.dll</HintPath>
61+
<HintPath>..\packages\srp.1.0.1\lib\net40\srp.dll</HintPath>
6262
<Private>True</Private>
6363
</Reference>
6464
</ItemGroup>

source/Zyan.Communication/Zyan.Communication.Fx45.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
<SignAssembly>true</SignAssembly>
5959
</PropertyGroup>
6060
<ItemGroup>
61+
<Reference Include="Microsoft.CSharp" />
6162
<Reference Include="System" />
6263
<Reference Include="System.ComponentModel.Composition" />
6364
<Reference Include="System.configuration" />
@@ -78,8 +79,7 @@
7879
<Private>True</Private>
7980
</Reference>
8081
<Reference Include="srp">
81-
<HintPath>..\packages\srp.1.0.0\lib\net45\srp.dll</HintPath>
82-
<Private>True</Private>
82+
<HintPath>..\packages\srp.1.0.1\lib\net45\srp.dll</HintPath>
8383
</Reference>
8484
</ItemGroup>
8585
<ItemGroup>

source/Zyan.Communication/Zyan.Communication.Mono.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<HintPath>..\packages\Zyan.SafeDeserializationHelpers.0.5.0\lib\net35\Zyan.SafeDeserializationHelpers.dll</HintPath>
7676
</Reference>
7777
<Reference Include="srp">
78-
<HintPath>..\packages\srp.1.0.0\lib\net45\srp.dll</HintPath>
78+
<HintPath>..\packages\srp.1.0.1\lib\net45\srp.dll</HintPath>
7979
<Private>True</Private>
8080
</Reference>
8181
</ItemGroup>

source/Zyan.Communication/Zyan.Communication.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
<HintPath>..\packages\Zyan.SafeDeserializationHelpers.0.5.0\lib\net35\Zyan.SafeDeserializationHelpers.dll</HintPath>
7777
</Reference>
7878
<Reference Include="srp">
79-
<HintPath>..\packages\srp.1.0.0\lib\net45\srp.dll</HintPath>
79+
<HintPath>..\packages\srp.1.0.1\lib\net45\srp.dll</HintPath>
8080
<Private>True</Private>
8181
</Reference>
8282
</ItemGroup>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="srp" version="1.0.0" targetFramework="net46" />
3+
<package id="srp" version="1.0.1" targetFramework="net46" />
44
<package id="Zyan.SafeDeserializationHelpers" version="0.5.0" targetFramework="net35" />
55
</packages>

source/Zyan.Tests/SecureRemotePasswordTests.cs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Linq;
33
using System.Security.Cryptography;
44
using SecureRemotePassword;
5+
using H = SecureRemotePassword.SrpParameters.SrpHashFunction;
56

67
namespace Zyan.Tests
78
{
@@ -169,8 +170,8 @@ public void SrpIntegetModPowCompatibleWithJsbn()
169170
public void SrpIntegerModPowRegressionTest()
170171
{
171172
var p = new SrpParameters();
172-
var g = p.G;
173-
var N = p.N;
173+
var g = p.Generator;
174+
var N = p.Prime;
174175

175176
var a = SrpInteger.FromHex("64e1124e73967bb4806cf5e3f151c574d0012147255e10fca02e9b4bafc8f4ba");
176177
var A = g.ModPow(a, N);
@@ -247,21 +248,21 @@ public void SrpHashComputesValidStringHashes()
247248
var sample = string.Concat(parts);
248249
var srpint = SrpInteger.FromHex(sample);
249250

250-
var md5 = new SrpHash<MD5>().HashFunction;
251+
H md5 = new SrpHash<MD5>().ComputeHash;
251252
var hashmd5 = SrpInteger.FromHex("34ada39bbabfa6e663f1aad3d7814121");
252253
Assert.AreEqual(hashmd5, md5(srpint.ToHex().ToUpper()));
253254
Assert.AreEqual(hashmd5, md5(sample));
254255
Assert.AreEqual(hashmd5, md5(parts));
255256
Assert.AreEqual(16, new SrpHash<MD5>().HashSizeBytes);
256257

257-
var sha256 = new SrpHash<SHA256>().HashFunction;
258+
H sha256 = new SrpHash<SHA256>().ComputeHash;
258259
var hash256 = SrpInteger.FromHex("1767fe8c94508ad3514b8332493fab5396757fe347023fc9d1fef6d26c3a70d3");
259260
Assert.AreEqual(hash256, sha256(srpint.ToHex().ToUpper()));
260261
Assert.AreEqual(hash256, sha256(sample));
261262
Assert.AreEqual(hash256, sha256(parts));
262263
Assert.AreEqual(256 / 8, new SrpHash<SHA256>().HashSizeBytes);
263264

264-
var sha512 = new SrpHash<SHA512>().HashFunction;
265+
H sha512 = new SrpHash<SHA512>().ComputeHash;
265266
var hash512 = SrpInteger.FromHex("f2406fd4b33b15a6b47ff78ccac7cd80eec7944092425b640d740e7dc695fdd42f583a9b4a4b98ffa5409680181999bfe319f2a3b50ddb111e8405019a8c552a");
266267
Assert.AreEqual(hash512, sha512(srpint.ToHex().ToUpper()));
267268
Assert.AreEqual(hash512, sha512(sample));
@@ -276,21 +277,21 @@ public void SrpHashComputesValidSrpIntegerHashes()
276277
var sample = string.Concat(parts);
277278
var srpint = SrpInteger.FromHex("48 65 6C 6C 6F 20 77 6F 72 6c 64 21");
278279

279-
var md5 = new SrpHash<MD5>().HashFunction;
280+
H md5 = new SrpHash<MD5>().ComputeHash;
280281
var hashmd5 = SrpInteger.FromHex("86FB269D190D2C85F6E0468CECA42A20");
281282
Assert.AreEqual(hashmd5, md5(srpint));
282283
Assert.AreEqual(hashmd5, md5(sample));
283284
Assert.AreEqual(hashmd5, md5(parts));
284285
Assert.AreEqual(16, new SrpHash<MD5>().HashSizeBytes);
285286

286-
var sha256 = new SrpHash<SHA256>().HashFunction;
287+
H sha256 = new SrpHash<SHA256>().ComputeHash;
287288
var hash256 = SrpInteger.FromHex("C0535E4BE2B79FFD93291305436BF889314E4A3FAEC05ECFFCBB7DF31AD9E51A");
288289
Assert.AreEqual(hash256, sha256(srpint));
289290
Assert.AreEqual(hash256, sha256(sample));
290291
Assert.AreEqual(hash256, sha256(parts));
291292
Assert.AreEqual(256 / 8, new SrpHash<SHA256>().HashSizeBytes);
292293

293-
var sha512 = new SrpHash<SHA512>().HashFunction;
294+
H sha512 = new SrpHash<SHA512>().ComputeHash;
294295
var hash512 = SrpInteger.FromHex("F6CDE2A0F819314CDDE55FC227D8D7DAE3D28CC556222A0A8AD66D91CCAD4AAD6094F517A2182360C9AACF6A3DC323162CB6FD8CDFFEDB0FE038F55E85FFB5B6");
295296
Assert.AreEqual(hash512, sha512(srpint));
296297
Assert.AreEqual(hash512, sha512(sample));
@@ -313,7 +314,7 @@ public void SrpClientDerivesThePrivateKeyAndVerifier()
313314
// validate intermediate steps
314315
var userName = "hacker@example.com";
315316
var password = "secret";
316-
var H = new SrpHash<SHA256>().HashFunction;
317+
H H = new SrpHash<SHA256>().ComputeHash;
317318
var step1 = H($"{userName}:{password}");
318319
Assert.AreEqual(SrpInteger.FromHex("ed3250071433e544b62b5dd0341564825a697357b5379f07aabca795a4e0a109"), step1);
319320

@@ -502,8 +503,8 @@ 7BCF1885 C529F566 660E57EC 68EDBC3C 05726CC0 2FD4CBF4 976EAA9A
502503
FD5138FE 8376435B 9FC61D2F C0EB06E3");
503504
var g = SrpInteger.FromHex("02");
504505
var p = SrpParameters.Create<SHA1>(N, g);
505-
var H = p.H;
506-
var k = p.K;
506+
var H = p.Hash;
507+
var k = p.Multiplier;
507508
var kx = SrpInteger.FromHex(@"7556AA04 5AEF2CDD 07ABAF0F 665C3E81 8913186F");
508509
Assert.AreEqual(kx, k);
509510

source/Zyan.Tests/Zyan.Tests.Fx3.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@
6565
<HintPath>..\packages\Zyan.SafeDeserializationHelpers.0.5.0\lib\net35\Zyan.SafeDeserializationHelpers.dll</HintPath>
6666
</Reference>
6767
<Reference Include="srp">
68-
<HintPath>..\packages\srp.1.0.0\lib\net35\srp.dll</HintPath>
69-
<Private>True</Private>
68+
<HintPath>..\packages\srp.1.0.1\lib\net35\srp.dll</HintPath>
7069
</Reference>
7170
</ItemGroup>
7271
<ItemGroup>
@@ -113,6 +112,7 @@
113112
<None Include="DistributedEvents.GenericTest">
114113
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
115114
</None>
115+
<None Include="packages.config" />
116116
</ItemGroup>
117117
<ItemGroup>
118118
<ProjectReference Include="..\Zyan.Communication\Zyan.Communication.Fx3.csproj">

0 commit comments

Comments
 (0)