aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_ocsp.cpp
diff options
context:
space:
mode:
authorNuno Goncalves <[email protected]>2017-02-27 18:12:28 +0100
committerNuno Goncalves <[email protected]>2017-03-04 12:20:46 +0100
commit9048a00464a1dcbcaa793fb3b76382589114d05f (patch)
tree95e5b3b7082ff67cca6fd91df7a7e28bf62d6d39 /src/tests/test_ocsp.cpp
parent6203025a02b052fbaebb4b309104497a22737187 (diff)
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 <[email protected]>
Diffstat (limited to 'src/tests/test_ocsp.cpp')
-rw-r--r--src/tests/test_ocsp.cpp10
1 files changed, 8 insertions, 2 deletions
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;