File 0538-Fix-ERL-1030-Fix-Callback-select-call-from-dps_and_c.patch of Package erlang

From f48b64b2724b06453afef5c97a243de0ce25da33 Mon Sep 17 00:00:00 2001
From: Tim Gleeson <tgleeson@cisco.com>
Date: Tue, 1 Oct 2019 13:56:24 +0100
Subject: [PATCH 3/3] Fix ERL-1030: Fix Callback:select() call from
 dps_and_crls()

dps_and_crls() also made an assumption about the structure of GenNames
which needed fixing.

All ssl_crl_SUITE tests pass, including the new verify_crldp_crlissuer test.
All ssl_dist_SUITE tests pass.
---
 lib/ssl/src/ssl_handshake.erl | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/ssl/src/ssl_handshake.erl b/lib/ssl/src/ssl_handshake.erl
index c0be0fcf3e..22ebed5f49 100644
--- a/lib/ssl/src/ssl_handshake.erl
+++ b/lib/ssl/src/ssl_handshake.erl
@@ -1792,7 +1792,11 @@ dps_and_crls(OtpCert, Callback, CRLDbHandle, ext) ->
 dps_and_crls(OtpCert, Callback, CRLDbHandle, same_issuer) ->    
     DP = #'DistributionPoint'{distributionPoint = {fullName, GenNames}} = 
 	public_key:pkix_dist_point(OtpCert),
-    CRLs = Callback:select(GenNames, CRLDbHandle),
+    CRLs = lists:flatmap(fun({directoryName, Issuer}) ->
+                                 Callback:select(Issuer, CRLDbHandle);
+                            (_) ->
+                                 []
+                         end, GenNames),
     [{DP, {CRL, public_key:der_decode('CertificateList', CRL)}} ||  CRL <- CRLs].
 
 dps_and_crls([], _, Acc) ->
-- 
2.16.4

openSUSE Build Service is sponsored by