diff options
author | Jack Lloyd <[email protected]> | 2019-01-17 09:16:50 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-01-17 09:16:50 -0500 |
commit | 377ed5445083af5703fe8b0411ad162af1766012 (patch) | |
tree | 77936fb806a62f37508803651b7d73bb8af3b11c /src/lib/tls/msg_cert_verify.cpp | |
parent | 4c3016578da7b9840bb77563f4257df11c9f1de9 (diff) |
Fix some warnings from PVS-Studio
No real bugs, but pointed out some odd constructs and duplicated logic
Diffstat (limited to 'src/lib/tls/msg_cert_verify.cpp')
-rw-r--r-- | src/lib/tls/msg_cert_verify.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/tls/msg_cert_verify.cpp b/src/lib/tls/msg_cert_verify.cpp index 8ca01043a..230474e7a 100644 --- a/src/lib/tls/msg_cert_verify.cpp +++ b/src/lib/tls/msg_cert_verify.cpp @@ -67,6 +67,9 @@ std::vector<uint8_t> Certificate_Verify::serialize() const buf.push_back(get_byte(1, scheme_code)); } + if(m_signature.size() > 0xFFFF) + throw Encoding_Error("Certificate_Verify signature too long to encode"); + const uint16_t sig_len = static_cast<uint16_t>(m_signature.size()); buf.push_back(get_byte(0, sig_len)); buf.push_back(get_byte(1, sig_len)); |