• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

randombit / botan / 21851334357

10 Feb 2026 01:47AM UTC coverage: 90.073% (+0.004%) from 90.069%
21851334357

push

github

web-flow
Merge pull request #5296 from randombit/jack/tls-header-patrol

Various changes to reduce header dependencies in TLS

102230 of 113497 relevant lines covered (90.07%)

11359047.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.95
/src/lib/tls/tls12/msg_session_ticket_12.cpp
1
/*
2
* Session Tickets
3
* (C) 2012 Jack Lloyd
4
*
5
* Botan is released under the Simplified BSD License (see license.txt)
6
*/
7

8
#include <botan/tls_messages_12.h>
9

10
#include <botan/internal/tls_handshake_hash.h>
11
#include <botan/internal/tls_handshake_io.h>
12
#include <botan/internal/tls_reader.h>
13

14
namespace Botan::TLS {
15

16
New_Session_Ticket_12::New_Session_Ticket_12(Handshake_IO& io,
406✔
17
                                             Handshake_Hash& hash,
18
                                             Session_Ticket ticket,
19
                                             uint32_t lifetime) :
406✔
20
      m_ticket_lifetime_hint(lifetime), m_ticket(std::move(ticket)) {
406✔
21
   hash.update(io.send(*this));
812✔
22
}
406✔
23

24
New_Session_Ticket_12::New_Session_Ticket_12(Handshake_IO& io, Handshake_Hash& hash) {
×
25
   hash.update(io.send(*this));
×
26
}
×
27

28
New_Session_Ticket_12::New_Session_Ticket_12(const std::vector<uint8_t>& buf) {
644✔
29
   if(buf.size() < 6) {
644✔
30
      throw Decoding_Error("Session ticket message too short to be valid");
1✔
31
   }
32

33
   TLS_Data_Reader reader("SessionTicket", buf);
643✔
34

35
   m_ticket_lifetime_hint = reader.get_uint32_t();
643✔
36
   m_ticket = Session_Ticket(reader.get_range<uint8_t>(2, 0, 65535));
643✔
37
   reader.assert_done();
640✔
38
}
644✔
39

40
std::vector<uint8_t> New_Session_Ticket_12::serialize() const {
406✔
41
   auto buf = store_be<std::vector<uint8_t>>(m_ticket_lifetime_hint);
406✔
42
   append_tls_length_value(buf, m_ticket.get(), 2);
406✔
43
   return buf;
406✔
44
}
×
45

46
}  // namespace Botan::TLS
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc