Don't call pkix_is_self_signed/1 too frequently

This commit is contained in:
Evgeniy Khramtsov 2017-12-07 17:24:34 +03:00
parent 97c9058246
commit f1ac793d56
1 changed files with 11 additions and 11 deletions

View File

@ -767,22 +767,22 @@ get_cert_paths(Certs, G) ->
end, Certs).
add_edges(G, [Cert1|T], L) ->
lists:foreach(
fun(Cert2) when Cert1 /= Cert2 ->
case public_key:pkix_is_self_signed(Cert1) of
true ->
ok;
false ->
case public_key:pkix_is_self_signed(Cert1) of
true ->
ok;
false ->
lists:foreach(
fun(Cert2) when Cert1 /= Cert2 ->
case public_key:pkix_is_issuer(Cert1, Cert2) of
true ->
digraph:add_edge(G, Cert1, Cert2);
false ->
ok
end
end;
(_) ->
ok
end, L),
end;
(_) ->
ok
end, L)
end,
add_edges(G, T, L);
add_edges(_, [], _) ->
ok.