Projects
Kolab:16:Testing
erlang-ssl_verify_hostname
update-to-and-fix-recent-rebar3-version.patch
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File update-to-and-fix-recent-rebar3-version.patch of Package erlang-ssl_verify_hostname
From 5e96f335eb4d3b3e5b02e2e24d06bc869fdbd1f4 Mon Sep 17 00:00:00 2001 From: Ilya Khaprov <dead.trickster@gmail.com> Date: Fri, 15 Jul 2016 12:50:30 +0300 Subject: [PATCH] update to (and fix) recent rebar3 version --- .gitignore | 2 +- .travis.yml | 2 ++ rebar.lock | 1 + test/ssl_verify_fingerprint_tests.erl | 2 +- test/ssl_verify_hostname_tests.erl | 10 ++-------- test/ssl_verify_pk_tests.erl | 14 +++----------- 7 files changed, 10 insertions(+), 21 deletions(-) create mode 100644 rebar.lock create mode 100755 rebar3 diff --git a/.gitignore b/.gitignore index ab3acdd..a752014 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ deps erl_crash.dump .eunit .rebar - +_build #emacs stuff *~ \#* diff --git a/.travis.yml b/.travis.yml index b1a08bc..f8c2e62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,3 +12,5 @@ otp_release: - R16B - R15B03 - R15B02 + +script: "./rebar3 eunit" diff --git a/rebar.lock b/rebar.lock new file mode 100644 index 0000000..57afcca --- /dev/null +++ b/rebar.lock @@ -0,0 +1 @@ +[]. diff --git a/test/ssl_verify_fingerprint_tests.erl b/test/ssl_verify_fingerprint_tests.erl index bfea0c7..915e3f6 100644 --- a/test/ssl_verify_fingerprint_tests.erl +++ b/test/ssl_verify_fingerprint_tests.erl @@ -12,7 +12,7 @@ google_cert() -> load_cert("google.der"). load_cert(Cert) -> - {ok, Bin} = file:read_file("../test/certs/" ++ Cert), + {ok, Bin} = file:read_file("test/certs/" ++ Cert), public_key:pkix_decode_cert(Bin, otp). verify_google_cert_fingerprint_test () -> diff --git a/test/ssl_verify_hostname_tests.erl b/test/ssl_verify_hostname_tests.erl index 8bc431e..20e7da4 100644 --- a/test/ssl_verify_hostname_tests.erl +++ b/test/ssl_verify_hostname_tests.erl @@ -2,7 +2,7 @@ %%% %%% MIT License %%% -%%% Copyright (c) 2014,2015 Ilya Khaprov <ilya.khaprov@publitechs.com> +%%% Copyright (c) 2014-2016 Ilya Khaprov <ilya.khaprov@publitechs.com> -module(ssl_verify_hostname_tests). @@ -54,7 +54,7 @@ google_cert() -> load_cert("google.der"). load_cert(Cert) -> - {ok, Bin} = file:read_file("../test/certs/" ++ Cert), + {ok, Bin} = file:read_file("test/certs/" ++ Cert), public_key:pkix_decode_cert(Bin, otp). google_cert_dns_wildcard() -> @@ -84,15 +84,12 @@ verify_google_cert_test () -> verify_google_cert_dns_wildcard_test () -> ?assertEqual({valid, "www.google.co.uk"}, ssl_verify_hostname:verify_fun(google_cert_dns_wildcard(), valid_peer, [{check_hostname, "www.google.co.uk"}])). - verify_google_cert_without_dns_test () -> ?assertEqual({valid, "www.google.co.uk"}, ssl_verify_hostname:verify_fun(google_cert_without_dns(), valid_peer, [{check_hostname, "www.google.co.uk"}])). verify_google_cert_printable_string_test() -> ?assertEqual({valid, "www.google.co.uk"}, ssl_verify_hostname:verify_fun(google_cert_printable_string(), valid_peer, [{check_hostname, "www.google.co.uk"}])). - - verify_google_cert_teletex_string_test() -> ?assertEqual({valid, "www.google.co.uk"}, ssl_verify_hostname:verify_fun(google_cert_teletex_string(), valid_peer, [{check_hostname, "www.google.co.uk"}])). @@ -101,6 +98,3 @@ verify_google_cert_bmp_string_test() -> verify_google_cert_universal_string_test() -> ?assertEqual({valid, "google.co.uk"}, ssl_verify_hostname:verify_fun(google_cert_universal_string(), valid_peer, [{check_hostname, "google.co.uk"}])). - - -%%TODO: add certificate tests diff --git a/test/ssl_verify_pk_tests.erl b/test/ssl_verify_pk_tests.erl index 4267aad..7f285a6 100644 --- a/test/ssl_verify_pk_tests.erl +++ b/test/ssl_verify_pk_tests.erl @@ -6,24 +6,16 @@ -module(ssl_verify_pk_tests). +-import(ssl_verify_util, [hexstr_to_bin/1]). + -include_lib("eunit/include/eunit.hrl"). -include_lib("public_key/include/public_key.hrl"). google_cert() -> load_cert("google.der"). -hexstr_to_bin(S) when is_list(S) and (length(S) rem 2 =:= 0) -> - hexstr_to_bin(S, []); -hexstr_to_bin(_) -> - invalid. -hexstr_to_bin([], Acc) -> - list_to_binary(lists:reverse(Acc)); -hexstr_to_bin([X,Y|T], Acc) -> - {ok, [V], []} = io_lib:fread("~16u", [X,Y]), - hexstr_to_bin(T, [V | Acc]). - load_cert(Cert) -> - {ok, Bin} = file:read_file("../test/certs/" ++ Cert), + {ok, Bin} = file:read_file("test/certs/" ++ Cert), public_key:pkix_decode_cert(Bin, otp). verify_google_cert_pk_plain_test () -> -- 2.1.4
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.