From b5176ca26fd36cb51588a5d3d7094eaa313fcf63 Mon Sep 17 00:00:00 2001 From: Falko Strenzke Date: Fri, 28 Sep 2018 16:33:24 +0200 Subject: implemented ocsp stapling (code not yet formatted properly) --- src/lib/tls/msg_cert_status.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/lib/tls/msg_cert_status.cpp') 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 const& raw_response_bytes) : + m_raw_response_bytes(raw_response_bytes) + { + hash.update(io.send(*this)); + } std::vector 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(m_response.size()); + const uint32_t response_len = static_cast(m_response.size()); std::vector 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; -- cgit v1.2.3