aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/ssl_handshake.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2011-11-16 09:47:44 +0100
committerIngela Anderton Andin <[email protected]>2011-11-16 09:47:44 +0100
commit0d3fa967fda3a3d4b302f7b89887cf034d245a47 (patch)
tree511cea215cea89a02bfee9a02e58885a42cfc633 /lib/ssl/src/ssl_handshake.erl
parente21d0a8c944762cc31e03bf097491d446c55a6af (diff)
parenta7b8bf5b8162e9c0473213c77d17c739bdffdc35 (diff)
downloadotp-0d3fa967fda3a3d4b302f7b89887cf034d245a47.tar.gz
otp-0d3fa967fda3a3d4b302f7b89887cf034d245a47.tar.bz2
otp-0d3fa967fda3a3d4b302f7b89887cf034d245a47.zip
Merge branch 'ia/ssl/ets-next-problem/OTP-9703'
* ia/ssl/ets-next-problem/OTP-9703: Replaced ets:next traversal with ets:foldl and throw
Diffstat (limited to 'lib/ssl/src/ssl_handshake.erl')
-rw-r--r--lib/ssl/src/ssl_handshake.erl18
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/ssl/src/ssl_handshake.erl b/lib/ssl/src/ssl_handshake.erl
index f873a6a913..7eb7f44df6 100644
--- a/lib/ssl/src/ssl_handshake.erl
+++ b/lib/ssl/src/ssl_handshake.erl
@@ -1092,18 +1092,12 @@ certificate_authorities(CertDbHandle, CertDbRef) ->
list_to_binary([Enc(Cert) || {_, Cert} <- Authorities]).
certificate_authorities_from_db(CertDbHandle, CertDbRef) ->
- certificate_authorities_from_db(CertDbHandle, CertDbRef, no_candidate, []).
-
-certificate_authorities_from_db(CertDbHandle,CertDbRef, PrevKey, Acc) ->
- case ssl_manager:issuer_candidate(PrevKey, CertDbHandle) of
- no_more_candidates ->
- lists:reverse(Acc);
- {{CertDbRef, _, _} = Key, Cert} ->
- certificate_authorities_from_db(CertDbHandle, CertDbRef, Key, [Cert|Acc]);
- {Key, _Cert} ->
- %% skip certs not from this ssl connection
- certificate_authorities_from_db(CertDbHandle, CertDbRef, Key, Acc)
- end.
+ ConnectionCerts = fun({{Ref, _, _}, Cert}, Acc) when Ref == CertDbRef ->
+ [Cert | Acc];
+ (_, Acc) ->
+ Acc
+ end,
+ ssl_certificate_db:foldl(ConnectionCerts, [], CertDbHandle).
digitally_signed(Hash, #'RSAPrivateKey'{} = Key) ->
public_key:encrypt_private(Hash, Key,