Skip to content

Commit

Permalink
feat(ffi): Argon2 password hashing API (#250)
Browse files Browse the repository at this point in the history
Issue: ARC-187
  • Loading branch information
CBenoit authored Jan 18, 2024
1 parent 911e7fc commit 5b6e026
Show file tree
Hide file tree
Showing 16 changed files with 696 additions and 3 deletions.
33 changes: 33 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ embed-resource = "2.2.0"
[dependencies]
picky = { path = "../picky/", default-features = false, features = ["ssh", "x509", "time_conversion", "jose", "pkcs12"] }
picky-asn1 = { path = "../picky-asn1", default-features = false }
argon2 = "0.5"

# FFI
diplomat = { git = "https://github.com/CBenoit/diplomat.git", rev = "f4d93d57e93025c57e75e9711d2418faa9311a42" }
Expand Down
17 changes: 17 additions & 0 deletions ffi/dotnet/Devolutions.Picky.Tests/Argon2Tests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;

using Xunit;

namespace Devolutions.Picky.Tests;

public class Argon2Tests
{
[Fact]
public void HashPasswordSmoke()
{
Argon2Params parameters = Argon2Params.New();
Argon2 argon2 = Argon2.New(Argon2Algorithm.Argon2id, parameters);
string password_hash = argon2.HashPassword("hunter42");
Assert.Equal("$argon2id$", password_hash.Substring(0, 10));
}
}
2 changes: 1 addition & 1 deletion ffi/dotnet/Devolutions.Picky/Devolutions.Picky.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Company>Devolutions</Company>
<Description>Bindings to Rust picky native library</Description>
<LangVersion>latest</LangVersion>
<Version>2023.9.20.0</Version>
<Version>2024.1.19.0</Version>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
143 changes: 143 additions & 0 deletions ffi/dotnet/Devolutions.Picky/Generated/Argon2.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions ffi/dotnet/Devolutions.Picky/Generated/Argon2Algorithm.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5b6e026

Please sign in to comment.