Permalink
Browse files

Merge branch 'ia/ssl-public_key-empty-cert-chain/OTP-8788' into dev

  • Loading branch information...
2 parents d10b369 + 0eefda0 commit 40436debcac9645817c4799fe27d32b6bfa8fddd @IngelaAndin IngelaAndin committed Sep 1, 2010
Showing with 10 additions and 10 deletions.
  1. +10 −10 lib/ssl/src/ssl_certificate.erl
@@ -55,32 +55,32 @@
%% errors. Returns {RootCert, Path, VerifyErrors}
%%--------------------------------------------------------------------
trusted_cert_and_path(CertChain, CertDbRef) ->
- [Cert | RestPath] = lists:reverse(CertChain),
+ Path = [Cert | _] = lists:reverse(CertChain),
OtpCert = public_key:pkix_decode_cert(Cert, otp),
- IssuerAnPath =
+ IssuerID =
case public_key:pkix_is_self_signed(OtpCert) of
true ->
{ok, IssuerId} = public_key:pkix_issuer_id(OtpCert, self),
- {IssuerId, RestPath};
- false ->
+ IssuerId;
+ false ->
case public_key:pkix_issuer_id(OtpCert, other) of
{ok, IssuerId} ->
- {IssuerId, [Cert | RestPath]};
+ IssuerId;
{error, issuer_not_found} ->
case find_issuer(OtpCert, no_candidate) of
{ok, IssuerId} ->
- {IssuerId, [Cert | RestPath]};
+ IssuerId;
Other ->
- {Other, [Cert | RestPath]}
+ Other
end
end
end,
- case IssuerAnPath of
- {{error, issuer_not_found}, Path} ->
+ case IssuerID of
+ {error, issuer_not_found} ->
%% The root CA was not sent and can not be found.
{unknown_ca, Path};
- {{SerialNr, Issuer}, Path} ->
+ {SerialNr, Issuer} ->
case ssl_manager:lookup_trusted_cert(CertDbRef, SerialNr, Issuer) of
{ok, {BinCert,_}} ->
{BinCert, Path};

0 comments on commit 40436de

Please sign in to comment.