aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/tls/msg_cert_status.cpp
diff options
context:
space:
mode:
authorFalko Strenzke <[email protected]>2018-09-28 16:33:24 +0200
committerJack Lloyd <[email protected]>2019-05-22 13:42:59 -0400
commitb5176ca26fd36cb51588a5d3d7094eaa313fcf63 (patch)
treef2a255b68721390ef3b64a58ade4a5a2f2a926cd /src/lib/tls/msg_cert_status.cpp
parent14523b4f2126686edf21004ea15bc148b599a068 (diff)
implemented ocsp stapling (code not yet formatted properly)
Diffstat (limited to 'src/lib/tls/msg_cert_status.cpp')
-rw-r--r--src/lib/tls/msg_cert_status.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/lib/tls/msg_cert_status.cpp b/src/lib/tls/msg_cert_status.cpp
index c0cd82a28..2a07c4672 100644
--- a/src/lib/tls/msg_cert_status.cpp
+++ b/src/lib/tls/msg_cert_status.cpp
@@ -41,18 +41,25 @@ Certificate_Status::Certificate_Status(Handshake_IO& io,
{
hash.update(io.send(*this));
}
+Certificate_Status::Certificate_Status(Handshake_IO& io,
+ Handshake_Hash& hash,
+ std::vector<uint8_t> const& raw_response_bytes) :
+ m_raw_response_bytes(raw_response_bytes)
+ {
+ hash.update(io.send(*this));
+ }
std::vector<uint8_t> Certificate_Status::serialize() const
{
if(m_response.size() > 0xFFFFFF) // unlikely
throw Encoding_Error("OCSP response too long to encode in TLS");
- const uint32_t m_response_len = static_cast<uint32_t>(m_response.size());
+ const uint32_t response_len = static_cast<uint32_t>(m_response.size());
std::vector<uint8_t> buf;
buf.push_back(1); // type OCSP
for(size_t i = 1; i < 4; ++i)
- buf[i] = get_byte(i, m_response_len);
+ buf.push_back(get_byte(i, response_len));
buf += m_response;
return buf;