Skip to content

Commit

Permalink
Fixed Generate* methods generating too large secrets. They will gener…
Browse files Browse the repository at this point in the history
…ate 160-bit (20-byte) secrets now, instead of previous 80.
  • Loading branch information
Emzi0767 committed Sep 30, 2020
1 parent b53c2db commit be2ae2a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/EzOTP/EzOTP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<!-- Project info -->
<PropertyGroup>
<RootNamespace>EzOTP</RootNamespace>
<Version>1.0.0</Version>
<Version>1.0.1</Version>
<AssemblyVersion>$(Version).0</AssemblyVersion>
<FileVersion>$(Version).0</FileVersion>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/EzOTP/Generator/HotpGeneratorSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static HotpGeneratorSettings CreateGoogleAuthenticator(string label, stri
/// <returns>Created generator settings.</returns>
public static HotpGeneratorSettings GenerateGoogleAuthenticator(string label, string issuer)
{
var secret = new byte[80];
var secret = new byte[160 / 8];
long counter;
using (var rng = new SecureRandom())
{
Expand Down
2 changes: 1 addition & 1 deletion src/EzOTP/Generator/TotpGeneratorSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static TotpGeneratorSettings CreateGoogleAuthenticator(string label, stri
/// <returns>Created generator settings.</returns>
public static TotpGeneratorSettings GenerateGoogleAuthenticator(string label, string issuer)
{
var secret = new byte[80];
var secret = new byte[160 / 8];
using (var rng = new SecureRandom())
rng.GetBytes(secret);

Expand Down
2 changes: 1 addition & 1 deletion tests/EzOTP.TestApp/EzOTP.TestApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<!-- Project info -->
<PropertyGroup>
<RootNamespace>EzOTP.TestApp</RootNamespace>
<Version>1.0.0</Version>
<Version>1.0.1</Version>
<AssemblyVersion>$(Version).0</AssemblyVersion>
<FileVersion>$(Version).0</FileVersion>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion tests/EzOTP.Tests/EzOTP.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<!-- Project info -->
<PropertyGroup>
<RootNamespace>EzOTP.Tests</RootNamespace>
<Version>1.0.0</Version>
<Version>1.0.1</Version>
<AssemblyVersion>$(Version).0</AssemblyVersion>
<FileVersion>$(Version).0</FileVersion>
</PropertyGroup>
Expand Down

0 comments on commit be2ae2a

Please sign in to comment.