[ocsp] Avoid including a double path separator in request URI
authorMichael Brown <mcb30@ipxe.org>
Thu, 21 Jan 2016 17:50:34 +0000 (17:50 +0000)
committerMichael Brown <mcb30@ipxe.org>
Thu, 21 Jan 2016 17:50:34 +0000 (17:50 +0000)
commit42c2a6aab7727e7359600515471f463c65315ff0
treeb7f0775c7e32a6f596c0d6534a5b380ce20b29df
parent295ad113675dbc2cd595d783ec7b25b93b2ea465
[ocsp] Avoid including a double path separator in request URI

The OCSP responder URI included within an X.509 certificate may or may
not include a trailing slash.  We currently rely on the fact that
format_uri() incorrectly inserts an initial slash, which we include
unconditionally within the OCSP request URI.

Switch to using uri_encode() directly, and insert a slash only if the
X.509 certificate's OCSP responder URI does not already include a
trailing slash.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/crypto/ocsp.c