gnutls: Build the certificate chain recursively instead of using a loop 97/66897/1 accepted/tizen/common/20160422.172039 accepted/tizen/ivi/20160423.060543 accepted/tizen/mobile/20160423.055610 accepted/tizen/tv/20160423.060016 accepted/tizen/wearable/20160423.060307 submit/tizen/20160422.054856
authorSeonah Moon <seonah1.moon@samsung.com>
Fri, 22 Apr 2016 01:57:22 +0000 (10:57 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Fri, 22 Apr 2016 01:57:38 +0000 (10:57 +0900)
commitc8dde95f88f281d220ce279ac5474a344fd2ee9b
tree9071154e54704b261cc098bf2bf17f07b0630e44
parentcc98c695615ba763d03d4f29468589447118fe3b
gnutls: Build the certificate chain recursively instead of using a loop

We are currently checking every certificate in the chain and also
looking for an issuer in the database for the last certificate of the
chain. Now build_certificate_chain is called recursively so that for all
issuers that fail, we also try to find an issuer in the database,
instead of just for the last one. Pinned certificates are now handled by
the caller since they are done only once for the first certificate.
This fixes the case of fbcdn-dragon-a.akamaihd.net for which all the
certificates in the chain are not anchored, but we can find an issuer in
the database for the second certificate that is anchored.

 https://bugzilla.gnome.org/show_bug.cgi?id=750457

Change-Id: Ib3da8118b8873e3c5afec173bcd4160252b2a0b1
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
tls/gnutls/gtlsdatabase-gnutls.c