diff options
author | Dan Gudmundsson <[email protected]> | 2010-01-12 13:43:59 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2010-01-12 13:43:59 +0100 |
commit | bce8acaa10f2265e5454c29097e33680076c7ccb (patch) | |
tree | 7c019a00cfde180f225259fd1c5a95c786921fd7 /lib/ssl/src/ssl_handshake.erl | |
parent | fbe15664033aecd247aa3ee7446562639c10a0f4 (diff) | |
download | otp-bce8acaa10f2265e5454c29097e33680076c7ccb.tar.gz otp-bce8acaa10f2265e5454c29097e33680076c7ccb.tar.bz2 otp-bce8acaa10f2265e5454c29097e33680076c7ccb.zip |
Code cleanup
Diffstat (limited to 'lib/ssl/src/ssl_handshake.erl')
-rw-r--r-- | lib/ssl/src/ssl_handshake.erl | 20 |
1 files 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), - <<?UINT16(DNEncodedLen), DNEncodedBin/binary>> - 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), + <<?UINT16(DNEncodedLen), DNEncodedBin/binary>> + 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. |