> This is a post about side channel information leakage that was present in OnionBrowser in some OCSP flows. This is not a exhaustive documentation of OCSP protocol.
Digital certificates are issued for a longer timespan. It reduces maintaince overhead. Most of the cases CAs issue a certificate and they are valid untill the expiration time.
But what are we to do when a certificate is compromised? We can
re-issue a certificate, but the old one is still in the wind. Thats
where Online Certificate Status Protocol comes in. It defines a way to
check validity of a certificate in a timely[^1] manner.
OCSP[^2] works roughly as follows in an https connection:
1. Client looks up the OCSP responder server from `AuthorityInfoAccess`section in the certificate.
2. Client crafts a OCSP request and sends it to OCSP responder.
3. Responder returns the current status of the certificate, one of `good`, `revoked` or `unknown`
There are many other interactions defined in the OCSP ecosystem. Maybe
the most important one is [OCSP
Stapling](https://en.wikipedia.org/wiki/OCSP_stapling). In stapling
the original request server sends back OCSP validation message with
the certificate itself, removing the need for another seperate
request.
## Dissecting an OCSP Request
If the request is <255bytes,OCSPallowsittobepassedasaGETpath.Soatypicalrequestlookslikethis
```bash
GET http://ocsp.int-x3.letsencrypt.org/MFgwVqADAgEAME8wTTBLMAkGBSsOAwIaBQAEFH7maudymrP8%2BKIgZGwWoS1gcQhdBBSoSmpjBH3duubRObemRWXv86jsoQISA6D%2BPqgUVCy3wtolHIxq%2Bk0e
```
The request is `URL-Encoded > BASE64 encoded > ASN-1` data. After decoding, one can use `ocsptool` from [GnuTLS](https://www.gnutls.org/) to read it.