From c289f73d6fdc9f86b90e0986ba3b0da0c29e7927 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 11 Sep 2020 22:53:37 +0300 Subject: Match certificate fingerprints case-insensitively --- bpkg/auth.cxx | 13 +++++++------ bpkg/common.cli | 2 +- bpkg/repository-types.cli | 2 +- bpkg/types.hxx | 4 +++- 4 files changed, 12 insertions(+), 9 deletions(-) (limited to 'bpkg') diff --git a/bpkg/auth.cxx b/bpkg/auth.cxx index e661ad0..0693abc 100644 --- a/bpkg/auth.cxx +++ b/bpkg/auth.cxx @@ -61,14 +61,14 @@ namespace bpkg p /= "."; - // If this is a remote location then use the canonical name prefix. For - // a local location this doesn't always work. Consider: + // If this is a remote location then use the canonical name prefix. For a + // local location this doesn't always work. Consider: // // .../pkg/1/build2.org/common/hello // - // In this case we will end with an empty canonical name (because of - // the special pkg/1 treatment). So in case of local locations we will - // use the location rather than the name prefix. + // In this case we will end with an empty canonical name (because of the + // special pkg/1 treatment). So in case of local locations we will use the + // location rather than the name prefix. // if (rl.remote ()) return repository_location ( @@ -527,7 +527,8 @@ namespace bpkg return cert_auth {move (cert), true}; } - if (dependent_trust && *dependent_trust == cert->fingerprint) + if (dependent_trust && + icasecmp (*dependent_trust, cert->fingerprint) == 0) { if (verb >= 2) info << "certificate for repository " << rl.canonical_name () << diff --git a/bpkg/common.cli b/bpkg/common.cli index 4537961..49a7788 100644 --- a/bpkg/common.cli +++ b/bpkg/common.cli @@ -310,7 +310,7 @@ namespace bpkg \cb{none}." } - std::set --trust + std::set --trust { "", "Trust repository certificate with a SHA256 . Such a diff --git a/bpkg/repository-types.cli b/bpkg/repository-types.cli index ad8f09d..21ddaf9 100644 --- a/bpkg/repository-types.cli +++ b/bpkg/repository-types.cli @@ -32,7 +32,7 @@ cannot be guessed from the URL. See \l{bpkg-rep-add(1)} for details. A \cb{pkg} repository is \i{archive}-based. That is, it contains a collection of various packages/versions as archive files. For more information on the structure of \cb{pkg} repositories refer to \l{bpkg The \cb{build2} Package -Manager Manual}. The \cb{dir} repository location can be a local directory +Manager Manual}. The \cb{pkg} repository location can be a local directory path or an \cb{http(s)://} URL. diff --git a/bpkg/types.hxx b/bpkg/types.hxx index 4f0cc98..65dba60 100644 --- a/bpkg/types.hxx +++ b/bpkg/types.hxx @@ -24,7 +24,8 @@ #include #include #include -#include // compare_reference_target +#include // icase_compare_string, + // compare_reference_target #include #include #include @@ -71,6 +72,7 @@ namespace bpkg // // + using butl::icase_compare_string; using butl::compare_reference_target; // -- cgit v1.1