Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: OTP ${{matrix.otp}}
strategy:
matrix:
otp: ['28', '27', '26']
otp: ['29', '28', '27']
rebar3: ['3.27.0']
runs-on: 'ubuntu-24.04'
env:
Expand All @@ -28,10 +28,10 @@ jobs:
- run: rebar3 do ct --cover
- run: rebar3 as test codecov analyze
- run: rebar3 dialyzer
if: ${{ matrix.otp == '28' }}
if: ${{ matrix.otp == '29' }}
- name: Upload code coverage
uses: codecov/codecov-action@v4
if: ${{ matrix.otp == '28' }}
if: ${{ matrix.otp == '29' }}
with:
files: _build/test/covertool/fast_scram.covertool.xml
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v6
- uses: erlef/setup-beam@v1
with:
otp-version: "28"
otp-version: "29"
rebar3-version: "3.27"
- run: rebar3 compile
- run: rebar3 hex publish -r hexpm --yes
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/revert-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v6
- uses: erlef/setup-beam@v1
with:
otp-version: "28"
otp-version: "29"
rebar3-version: "3.27"
- run: rebar3 hex publish --revert ${{ inputs.version }} -r hexpm --yes
env:
Expand Down
50 changes: 25 additions & 25 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@
{project_plugins, [
{rebar3_hex, "~> 7.0"},
{rebar3_ex_doc, "~> 0.2"},
{rebar3_lint, "~> 3.2"},
{rebar3_lint, "~> 5.0"},
{erlfmt, "~> 1.6"}
]}.

{profiles, [
{test, [
{erl_opts, []},
{deps, [
{proper, "1.5.0"}
]},
{plugins, [
{rebar3_codecov, "0.7.0"}
]},
Expand All @@ -38,27 +35,30 @@
]}.

{elvis, [
#{
dirs => ["src/**"],
filter => "*.erl",
ruleset => erl_files,
rules => [
{elvis_style, private_data_types, disable},
{elvis_style, atom_naming_convention, #{
regex => "^([a-z][a-zA-Z0-9_]*_?)*$"
}}
]
},
#{
dirs => ["."],
filter => "rebar.config",
ruleset => rebar_config
},
#{
dirs => ["src/**"],
filter => "*.hrl",
ruleset => hrl_files
}
{config, [
#{
files => ["src/**/*.erl"],
ruleset => erl_files,
rules => [
{elvis_style, private_data_types, disable},
{elvis_style, dont_repeat_yourself, disable},
{elvis_style, atom_naming_convention, #{
regex => "^([a-z][a-zA-Z0-9_]*_?)*$"
}}
]
},
#{
files => ["rebar.config"],
ruleset => rebar_config
},
#{
files => ["src/**/*.hrl"],
ruleset => hrl_files,
rules => [
{elvis_style, no_includes, disable}
]
}
]}
]}.

{hex, [
Expand Down
16 changes: 4 additions & 12 deletions src/fast_scram.erl
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,7 @@ parse_client_first_message(ClientIn, State0) ->
],
Chunks = binary:split(ClientIn, <<",">>, [global]),
case match_rules(Chunks, Rules, State0) of
{UnusedRules, State1 = #fast_scram_state{}} when
is_list(UnusedRules), length(UnusedRules) == 1
->
{[_], State1 = #fast_scram_state{}} ->
ClientFirstMsgBare = extract_client_first_msg_bare_from_first(Chunks, ClientIn),
State2 = fast_scram_parse_rules:append_to_auth_message_in_state(
State1, ClientFirstMsgBare
Expand All @@ -276,9 +274,7 @@ parse_server_first_message(ServerIn, State0) ->
],
ServerInChunks = binary:split(ServerIn, <<",">>, [global]),
case match_rules(ServerInChunks, Rules, State0) of
{UnusedRules, State1 = #fast_scram_state{}} when
is_list(UnusedRules), length(UnusedRules) == 1
->
{[_], State1 = #fast_scram_state{}} ->
State2 = fast_scram_parse_rules:append_to_auth_message_in_state(
State1, <<",", ServerIn/binary>>
),
Expand All @@ -299,9 +295,7 @@ parse_client_final_message(ClientIn, State0) ->
],
ClientInList = binary:split(ClientIn, <<",">>, [global]),
case match_rules(ClientInList, Rules, State0) of
{UnusedRules, State1 = #fast_scram_state{}} when
is_list(UnusedRules), length(UnusedRules) == 0
->
{[], State1 = #fast_scram_state{}} ->
ClientFinalNoProof = extract_client_final_no_proof(ClientIn),
State2 = fast_scram_parse_rules:append_to_auth_message_in_state(
State1, <<",", ClientFinalNoProof/binary>>
Expand All @@ -323,9 +317,7 @@ parse_server_final_message(ServerIn, State0) ->
],
ServerInChunks = binary:split(ServerIn, <<",">>, [global]),
case match_rules(ServerInChunks, Rules, State0) of
{UnusedRules, State1 = #fast_scram_state{}} when
is_list(UnusedRules), length(UnusedRules) == 1
->
{[_], State1 = #fast_scram_state{}} ->
{ok, State1};
{error, Reason} ->
{error, Reason}
Expand Down
3 changes: 2 additions & 1 deletion src/fast_scram_configuration.erl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ set_val_in_state(it_count, Num, #fast_scram_state{challenge = Ch} = St) when
set_val_in_state(salt, Bin, #fast_scram_state{challenge = Ch} = St) when is_binary(Bin) ->
St#fast_scram_state{challenge = Ch#challenge{salt = Bin}};
set_val_in_state(channel_binding, {Type, Data}, #fast_scram_state{channel_binding = CB} = St) when
is_atom(Type) orelse is_binary(Type), is_binary(Data)
is_atom(Type), is_binary(Data);
is_binary(Type), is_binary(Data)
->
St#fast_scram_state{channel_binding = CB#channel_binding{variant = Type, data = Data}};
set_val_in_state(hash_method, HM, #fast_scram_state{scram_definitions = SD} = St) when
Expand Down
Loading