From 2604ef9bffd7b22bf3ca5538dbd309bb247020b9 Mon Sep 17 00:00:00 2001 From: Daniil Fedotov Date: Mon, 8 May 2017 16:36:56 +0100 Subject: [PATCH] Wording --- deps/rabbitmq_trust_store/README.md | 2 +- .../src/rabbit_trust_store_file_provider.erl | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/deps/rabbitmq_trust_store/README.md b/deps/rabbitmq_trust_store/README.md index 5f18fd5708..874e67b0b6 100644 --- a/deps/rabbitmq_trust_store/README.md +++ b/deps/rabbitmq_trust_store/README.md @@ -55,7 +55,7 @@ and a refresh interval: Setting `refresh_interval` to `0` seconds will disable automatic refresh. Certificates are distinguished by their **filenames**, file modification time and -a certificate hash. +the hash of file contents. #### Installing a Certificate diff --git a/deps/rabbitmq_trust_store/src/rabbit_trust_store_file_provider.erl b/deps/rabbitmq_trust_store/src/rabbit_trust_store_file_provider.erl index e07dc2adeb..cac69e7d33 100644 --- a/deps/rabbitmq_trust_store/src/rabbit_trust_store_file_provider.erl +++ b/deps/rabbitmq_trust_store/src/rabbit_trust_store_file_provider.erl @@ -49,7 +49,9 @@ list_certs_0(Path) -> lists:map( fun(FileName) -> AbsName = filename:absname(FileName, Path), - CertId = {FileName, modification_time(AbsName), file_hash(AbsName)}, + CertId = {FileName, + modification_time(AbsName), + file_content_hash(AbsName)}, {CertId, [{name, FileName}]} end, FileNames). @@ -58,7 +60,7 @@ modification_time(Path) -> {ok, Info} = file:read_file_info(Path, [{time, posix}]), Info#file_info.mtime. -file_hash(Path) -> +file_content_hash(Path) -> {ok, Data} = file:read_file(Path), erlang:phash2(Data).