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

randombit / botan / 21746428601

06 Feb 2026 07:47AM UTC coverage: 90.074% (+0.002%) from 90.072%
21746428601

push

github

web-flow
Merge pull request #5288 from Rohde-Schwarz/feature/disentangle_tls12_from_tls13

Refactor: Organize most TLS handshake messages into TLS 1.2 and TLS 1.3 modules

102235 of 113501 relevant lines covered (90.07%)

11561717.77 hits per line

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

86.96
/src/lib/tls/msg_cert_verify.cpp
1
/*
2
* Certificate Verify Message
3
* (C) 2004,2006,2011,2012 Jack Lloyd
4
*     2017 Harry Reimann, Rohde & Schwarz Cybersecurity
5
*     2021 Elektrobit Automotive GmbH
6
*     2022 René Meusel, Hannes Rantzsch - neXenio GmbH
7
*
8
* Botan is released under the Simplified BSD License (see license.txt)
9
*/
10

11
#include <botan/tls_messages.h>
12

13
#include <botan/internal/tls_reader.h>
14

15
namespace Botan::TLS {
16

17
/*
18
* Deserialize a Certificate Verify message
19
*/
20
Certificate_Verify::Certificate_Verify(const std::vector<uint8_t>& buf) {
528✔
21
   TLS_Data_Reader reader("CertificateVerify", buf);
528✔
22

23
   m_scheme = Signature_Scheme(reader.get_uint16_t());
528✔
24
   m_signature = reader.get_range<uint8_t>(2, 0, 65535);
527✔
25
   reader.assert_done();
526✔
26

27
   if(!m_scheme.is_set()) {
522✔
28
      throw Decoding_Error("Counterparty did not send hash/sig IDS");
×
29
   }
30
}
528✔
31

32
/*
33
* Serialize a Certificate Verify message
34
*/
35
std::vector<uint8_t> Certificate_Verify::serialize() const {
399✔
36
   BOTAN_ASSERT_NOMSG(m_scheme.is_set());
399✔
37
   std::vector<uint8_t> buf;
399✔
38
   buf.reserve(2 + 2 + m_signature.size());  // work around GCC warning
399✔
39

40
   const auto code = m_scheme.wire_code();
399✔
41
   buf.push_back(get_byte<0>(code));
399✔
42
   buf.push_back(get_byte<1>(code));
399✔
43

44
   if(m_signature.size() > 0xFFFF) {
399✔
45
      throw Encoding_Error("Certificate_Verify signature too long to encode");
×
46
   }
47

48
   const uint16_t sig_len = static_cast<uint16_t>(m_signature.size());
399✔
49
   buf.push_back(get_byte<0>(sig_len));
399✔
50
   buf.push_back(get_byte<1>(sig_len));
399✔
51
   buf += m_signature;
399✔
52

53
   return buf;
399✔
54
}
×
55

56
}  // 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