Skip to content

Commit

Permalink
Merge branch 'release/1.9.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
g-andrade committed Sep 3, 2021
2 parents 855cafa + 0bdc3b3 commit 3ed7c2b
Show file tree
Hide file tree
Showing 72 changed files with 1,743 additions and 342 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
matrix:
otp_vsn: [22.0, 22.1, 22.2, 22.3,
23.0, 23.1, 23.2, 23.3,
24]
24.0]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/hardcoded-authorities-updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ if git branch -a | grep "${BRANCH}" >/dev/null; then
exit
fi

ORIGIN=origin
REMOTE=origin
PR_TITLE="Update bundled CAs to latest as of $DATE"
git checkout -b "$BRANCH"
git add .
git commit -a -m "${PR_TITLE}"
git push "$ORIGIN" "$BRANCH"
git push "$REMOTE" "$BRANCH"

PR_LABEL="hardcoded authorities update"
if ! gh pr list --state open --label "$PR_LABEL" | grep "${PR_TITLE}" >/dev/null; then
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ _build
.idea
*.iml
rebar3.crashdump
/doc/
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.9.0] - 2021-09-03

### Added

- test coverage of certificates yet-to-be valid
- test coverage of misordered certificate chains

### Changed

- **partial chain validation to prepare for
[DST Root CA X3 expiration](https://blog.voltone.net/post/30)**
- documentation from edoc to ExDoc

### Removed

- dependency on badssl.com for important test cases

## [1.8.0] - 2021-08-31

### Added
Expand Down
11 changes: 1 addition & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,7 @@ shell:
@$(REBAR3) as development shell

doc: $(REBAR3)
@$(REBAR3) edoc

README.md: doc
# non-portable dirty hack follows (pandoc 2.11.0.4 used)
# gfm: "github-flavoured markdown"
@pandoc --from html --to gfm doc/overview-summary.html -o README.md
@tail -n +11 <"README.md" >"README.md_"
@head -n -12 <"README.md_" >"README.md"
@tail -n 2 <"README.md_" >>"README.md"
@rm "README.md_"
./support/scripts/generate_docs.sh

publish: $(REBAR3)
@$(REBAR3) hex publish
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ rebar.config
``` erlang
{deps,
[% [...]
{tls_certificate_check, "~> 1.7"}
{tls_certificate_check, "~> 1.9"}
]}.
```

Expand Down Expand Up @@ -64,7 +64,7 @@ mix.exs
defp deps do
[
# [...]
{:tls_certificate_check, "~> 1.7"}
{:tls_certificate_check, "~> 1.9"}
]
end
```
Expand Down Expand Up @@ -111,7 +111,3 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-----

*Generated by EDoc*
1 change: 0 additions & 1 deletion doc/.gitignore

This file was deleted.

82 changes: 0 additions & 82 deletions doc/custom_stylesheet.css

This file was deleted.

121 changes: 0 additions & 121 deletions doc/overview.edoc

This file was deleted.

15 changes: 13 additions & 2 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
warn_unused_import,
warnings_as_errors,
{platform_define, "^2[3-9]", 'HARDCODED_AUTHORITIES_UPDATER_SUPPORTED'},
{platform_define, "^[3-9]", 'HARDCODED_AUTHORITIES_UPDATER_SUPPORTED'}
{platform_define, "^[3-9]", 'HARDCODED_AUTHORITIES_UPDATER_SUPPORTED'},
{platform_define, "^22\\.", 'EXPIRED_CAs_ARE_CONSIDERED_VALID'},
{platform_define, "^23\\.[0-2][^0-9]", 'EXPIRED_CAs_ARE_CONSIDERED_VALID'},
{platform_define, "^22\\.", 'FLAKY_CROSS_SIGNING_VALIDATION'},
{platform_define, "^23\\.[0-1][^0-9]", 'FLAKY_CROSS_SIGNING_VALIDATION'}
]}.

{minimum_otp_vsn, "22.0"}.
Expand Down Expand Up @@ -72,7 +76,14 @@
]},
{escript_name, "tls_certificate_check_hardcoded_authorities_updater"},
{escript_emu_args, "%%! -noinput\n"}
]}
]},

{docs,
[{edoc_opts, [{preprocess, true},
{doclet, edoc_doclet_chunks},
{layout, edoc_layout_chunks},
{dir, "_build/default/lib/tls_certificate_check/doc"}]}
]}
]}.

{edoc_opts,
Expand Down
24 changes: 21 additions & 3 deletions src/tls_certificate_check.erl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
%% DEALINGS IN THE SOFTWARE.

%% @doc Main API
-module(tls_certificate_check).

-ifdef(TEST).
Expand Down Expand Up @@ -83,9 +84,8 @@ options(Target) ->
[{verify, verify_peer},
{depth, ?DEFAULT_MAX_CERTIFICATE_CHAIN_DEPTH},
{cacerts, CAs},
{partial_chain,
fun tls_certificate_check_shared_state:find_trusted_authority/1},
{verify_fun, CertificateVerificationFun}
{verify_fun, CertificateVerificationFun},
{partial_chain, fun tls_certificate_check_shared_state:find_trusted_authority/1}
| HostnameCheckOptions]
catch
http_target ->
Expand Down Expand Up @@ -129,4 +129,22 @@ trusted_authorities_is_exported_test() ->
{ok, _} = application:ensure_all_started(tls_certificate_check),
?assertMatch([_|_], ?MODULE:trusted_authorities()).

http_target_test() ->
{ok, _} = application:ensure_all_started(tls_certificate_check),
?assertEqual([], ?MODULE:options("http://example.com/")).

https_target_test() ->
{ok, _} = application:ensure_all_started(tls_certificate_check),
?assertMatch([_|_], ?MODULE:options("https://example.com/")).

generic_tls_target_test() ->
{ok, _} = application:ensure_all_started(tls_certificate_check),
?assertMatch([_|_], ?MODULE:options("example.com")).

https_and_generic_tls_targets_equivalence_test() ->
?assertEqual(
?MODULE:options("example.com"),
?MODULE:options("https://example.com/")
).

-endif. % -ifdef(TEST).
Loading

0 comments on commit 3ed7c2b

Please sign in to comment.