Skip to content

Commit

Permalink
Merge pull request #12 from esl/updates
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
NelsonVides authored Dec 28, 2023
2 parents c705306 + 26af702 commit fa85c80
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 68 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,24 @@ jobs:
name: OTP ${{matrix.otp}}
strategy:
matrix:
otp: ['24.0', '23.3', '22.3', '21.3']
runs-on: 'ubuntu-20.04'
otp: ['26.2', '25.3', '24.3']
rebar3: ['3.22.1']
runs-on: 'ubuntu-22.04'
env:
OTPVER: ${{ matrix.otp }}
steps:
- uses: actions/checkout@v2
- uses: ErlGang/setup-erlang@v1.0.0
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
- run: make rebar3
- run: make
- run: make test
- run: make dialyzer
if: ${{ matrix.otp == '24.0' }}
- run: make codecov
if: ${{ matrix.otp == '24.0' }}
- run: pip install --user codecov
if: ${{ matrix.otp == '24.0' }}
- run: /home/runner/.local/bin/codecov
if: ${{ matrix.otp == '24.0' }}
otp-version: ${{matrix.otp}}
rebar3-version: ${{matrix.rebar3}}
- run: rebar3 do ct --cover
- run: rebar3 as test codecov analyze
- run: rebar3 dialyzer
if: ${{ matrix.otp == '26.2' }}
- uses: codecov/codecov-action@v3
name: Upload coverage reports to Codecov
if: ${{ matrix.otp == '26.2' }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true # optional (default = false)
36 changes: 0 additions & 36 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
[{compile, {pc, compile}},
{clean, {pc, clean}}]}]}.
{deps,
[{fast_scram, {git, "https://github.com/esl/fast_scram.git", {branch, "master"}}}]}.
[{fast_scram, "0.6.0"}]}.
```

## Using
Expand Down
27 changes: 21 additions & 6 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{erl_opts, []}.

{deps, [{fast_pbkdf2, "1.0.3"}]}.
{plugins, [rebar3_hex]}.
{deps, [
{fast_pbkdf2, "1.0.5"}
]}.

{project_plugins, [
rebar3_hex,
rebar3_ex_doc
]}.


{profiles, [
{test, [
Expand All @@ -11,14 +18,22 @@
{base16, "2.0.1"}
]},
{plugins, [
{rebar3_codecov, "0.4.0"}
]}
{rebar3_codecov, "0.6.0"}
]},
{cover_enabled, true},
{cover_export_enabled, true}
]},
{prod, [
{erl_opts, [inline_list_funcs, deterministic]}
]}
]
}.

{cover_enabled, true}.
{cover_export_enabled, true}.
{hex, [
{doc, #{provider => ex_doc}}
]}.
{ex_doc, [
{source_url, <<"https://github.com/esl/fast_scram">>},
{extras, [<<"README.md">>, <<"LICENSE">>]},
{main, <<"readme">>}
]}.
6 changes: 3 additions & 3 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{"1.2.0",
[{<<"fast_pbkdf2">>,{pkg,<<"fast_pbkdf2">>,<<"1.0.3">>},0}]}.
[{<<"fast_pbkdf2">>,{pkg,<<"fast_pbkdf2">>,<<"1.0.5">>},0}]}.
[
{pkg_hash,[
{<<"fast_pbkdf2">>, <<"4F09D6C6C20DBEE1970E0A6AE91432E1B7731F88426C671D083BAC31FFA1FDAD">>}]},
{<<"fast_pbkdf2">>, <<"6045138C4C209FC8222A0B18B2CB1D7BD7407EF4ADAD0F14C5E0F7F4726E3E41">>}]},
{pkg_hash_ext,[
{<<"fast_pbkdf2">>, <<"2900431E2E6402F23A92754448BBD949DA366BC9C984FDC791DDCFCC41042434">>}]}
{<<"fast_pbkdf2">>, <<"BC3B5A3CAB47AD114FF8BB815FEDE62A6187ACD14D8B37412F2AF8236A089CEF">>}]}
].
8 changes: 2 additions & 6 deletions src/fast_scram.erl
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,6 @@ server_key(Sha, SaltedPassword) ->
server_signature(Sha, ServerKey, AuthMessage) ->
fast_scram_definitions:server_signature(Sha, ServerKey, AuthMessage).

%%%===================================================================
%%% NIF
%%%===================================================================
-spec hi(sha_type(), binary(), binary(), non_neg_integer()) -> binary().
hi(Hash, Password, Salt, IterationCount)
when ?is_valid_hash(Hash), is_binary(Password), is_binary(Salt), ?is_positive_integer(IterationCount) ->
fast_pbkdf2:pbkdf2(Hash, Password, Salt, IterationCount).
hi(Hash, Password, Salt, IterationCount) ->
fast_scram_definitions:salted_password(Hash, Password, Salt, IterationCount).

0 comments on commit fa85c80

Please sign in to comment.