8#include <botan/tls_messages.h>
10#include <botan/ber_dec.h>
11#include <botan/der_enc.h>
12#include <botan/ocsp.h>
13#include <botan/tls_extensions.h>
14#include <botan/internal/tls_handshake_hash.h>
15#include <botan/internal/tls_handshake_io.h>
16#include <botan/internal/tls_reader.h>
22 throw Decoding_Error(
"Invalid Certificate_Status message: too small");
26 throw Decoding_Error(
"Unexpected Certificate_Status message: unexpected response type");
29 size_t len =
make_uint32(0, buf[1], buf[2], buf[3]);
32 if(buf.size() != len + 4) {
33 throw Decoding_Error(
"Invalid Certificate_Status: invalid length field");
36 m_response.assign(buf.begin() + 4, buf.end());
40 m_response(ocsp.raw_bits()) {
46 std::vector<uint8_t> raw_response_bytes) :
52 m_response(std::move(raw_response_bytes)) {}
55 if(m_response.size() > 0xFFFFFF) {
59 const uint32_t response_len =
static_cast<uint32_t
>(m_response.size());
61 std::vector<uint8_t> buf;
62 buf.reserve(1 + 3 + m_response.size());
64 for(
size_t i = 1; i < 4; ++i) {
Certificate_Status(const std::vector< uint8_t > &buf, Connection_Side from)
std::vector< uint8_t > serialize() const override
void update(const uint8_t in[], size_t length)
virtual std::vector< uint8_t > send(const Handshake_Message &msg)=0
constexpr uint32_t make_uint32(uint8_t i0, uint8_t i1, uint8_t i2, uint8_t i3)
constexpr uint8_t get_byte_var(size_t byte_num, T input)