From 9048a00464a1dcbcaa793fb3b76382589114d05f Mon Sep 17 00:00:00 2001 From: Nuno Goncalves Date: Mon, 27 Feb 2017 18:12:28 +0100 Subject: Allow OCSP requests without the full subject certificate A OCSP request doesn't need the full subject certificate. This extends the API to require instead of the subject certificate: * OCSP::Request: subject serial. * OCSP::online_check: subject serial AND ocsp responder url. API breaking change: * removal of OCSP::Request::subject() as OCSP::Request doesn't need to hold the certificate, but only the serial. Signed-off-by: Nuno Goncalves --- src/tests/test_ocsp.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/tests') diff --git a/src/tests/test_ocsp.cpp b/src/tests/test_ocsp.cpp index 3fc1ad765..587977149 100644 --- a/src/tests/test_ocsp.cpp +++ b/src/tests/test_ocsp.cpp @@ -98,11 +98,17 @@ class OCSP_Tests : public Test result.test_success("Bad arguments rejected"); } - const Botan::OCSP::Request req(issuer, end_entity); + const std::string expected_request = "ME4wTKADAgEAMEUwQzBBMAkGBSsOAwIaBQAEFPLgavmFih2NcJtJGSN6qbUaKH5kBBRK3QYWG7z2aLV29YG2u2IaulqBLwIIQkg+DF+RYMY="; + const Botan::OCSP::Request req1(issuer, end_entity); + result.test_eq("Encoded OCSP request", + req1.base64_encode(), + expected_request); + + const Botan::OCSP::Request req2(issuer, BigInt::decode(end_entity.serial_number())); result.test_eq("Encoded OCSP request", - req.base64_encode(), + req2.base64_encode(), expected_request); return result; -- cgit v1.2.3