From bce8acaa10f2265e5454c29097e33680076c7ccb Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Tue, 12 Jan 2010 13:43:59 +0100 Subject: Code cleanup --- lib/ssl/src/ssl_handshake.erl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/ssl/src/ssl_handshake.erl b/lib/ssl/src/ssl_handshake.erl index 85dc61d3aa..e502c21df4 100644 --- a/lib/ssl/src/ssl_handshake.erl +++ b/lib/ssl/src/ssl_handshake.erl @@ -862,15 +862,15 @@ certificate_types(_) -> certificate_authorities(CertDbRef) -> Authorities = certificate_authorities_from_db(CertDbRef), - Enc = fun(Cert) -> - TBSCert = Cert#'OTPCertificate'.tbsCertificate, - Subj = pubkey_cert_records:transform(TBSCert#'OTPTBSCertificate'.subject, encode), - {ok, DNEncoded} = 'OTP-PUB-KEY':encode('Name', Subj), - DNEncodedBin = iolist_to_binary(DNEncoded), - DNEncodedLen = byte_size(DNEncodedBin), - <> - end, - list_to_binary(lists:map(Enc, [Cert || {_, Cert} <- Authorities])). + Enc = fun(#'OTPCertificate'{tbsCertificate=TBSCert}) -> + OTPSubj = TBSCert#'OTPTBSCertificate'.subject, + Subj = pubkey_cert_records:transform(OTPSubj, encode), + {ok, DNEncoded} = 'OTP-PUB-KEY':encode('Name', Subj), + DNEncodedBin = iolist_to_binary(DNEncoded), + DNEncodedLen = byte_size(DNEncodedBin), + <> + end, + list_to_binary([Enc(Cert) || {_, Cert} <- Authorities]). certificate_authorities_from_db(CertDbRef) -> certificate_authorities_from_db(CertDbRef, no_candidate, []). @@ -882,7 +882,7 @@ certificate_authorities_from_db(CertDbRef, PrevKey, Acc) -> {{CertDbRef, _, _} = Key, Cert} -> certificate_authorities_from_db(CertDbRef, Key, [Cert|Acc]); {Key, _Cert} -> - % skip certs not from this ssl connection + %% skip certs not from this ssl connection certificate_authorities_from_db(CertDbRef, Key, Acc) end. -- cgit v1.2.3