diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-05-13 13:11:08 +0300 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-05-13 13:11:08 +0300 |
commit | 061d5f2380cdce9ae1e0fa94487346e0e1c67cec (patch) | |
tree | 7fc4c68f2fff25631c03044f403ae0903f1d00b7 /src/ejabberd_pkix.erl | |
parent | Only validate certfiles if public_key:short_name_hash/1 is available (diff) |
Shut up dialyzer/xref if public_key:short_name_hash/1 is not available
Diffstat (limited to 'src/ejabberd_pkix.erl')
-rw-r--r-- | src/ejabberd_pkix.erl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ejabberd_pkix.erl b/src/ejabberd_pkix.erl index f99a2c12..7c03f177 100644 --- a/src/ejabberd_pkix.erl +++ b/src/ejabberd_pkix.erl @@ -393,7 +393,7 @@ check_ca_dir() -> -spec find_local_issuer(cert()) -> {ok, cert()} | {error, {bad_cert, unknown_ca}}. find_local_issuer(Cert) -> {ok, {_, IssuerID}} = public_key:pkix_issuer_id(Cert, self), - Hash = public_key:short_name_hash(IssuerID), + Hash = short_name_hash(IssuerID), filelib:fold_files( ca_dir(), Hash ++ "\\.[0-9]+", false, fun(_, {ok, IssuerCert}) -> @@ -514,3 +514,11 @@ get_cert_path(G, [Root|_] = Acc) -> get_cert_path(G, [V|Acc]) end, Es) end. + +-ifdef(SHORT_NAME_HASH). +short_name_hash(IssuerID) -> + public_key:short_name_hash(IssuerID). +-else. +short_name_hash(_) -> + "". +-endif. |