Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
Botan::TLS::Handshake_Hash Class Reference

`#include <tls_handshake_hash.h>`

## Public Member Functions
secure_vector< uint8_t > | final (Protocol_Version version, const std::string &mac_algo) const
const std::vector< uint8_t > & | get_contents () const
void | reset ()
void | update (const uint8_t in[], size_t length)
void | update (const std::vector< uint8_t > &in)

## Detailed Description

TLS Handshake Hash

Definition at line 22 of file tls_handshake_hash.h.

## Member Function Documentation

secure_vector< uint8_t > Botan::TLS::Handshake_Hash::final | ( | Protocol_Version | version,
|  | const std::string & | mac_algo
| ) |  | const

Return a TLS Handshake Hash

Definition at line 19 of file tls_handshake_hash.cpp.

References Botan::HashFunction::create_or_throw(), hash, and Botan::TLS::Protocol_Version::supports_ciphersuite_specific_prf().

Referenced by Botan::TLS::Session_Keys::Session_Keys().

21 {
22 std::string hash_algo = mac_algo;
23 if(!version.supports_ciphersuite_specific_prf())
24 hash_algo = "Parallel(MD5,SHA-160)";
25 else if(mac_algo == "MD5" || mac_algo == "SHA-1")
26 hash_algo = "SHA-256";
27
28 std::unique_ptr<HashFunction> hash(HashFunction::create_or_throw(hash_algo));
29 hash->update(m_data);
30 return hash->final();
31 }
Botan::HashFunction::create_or_throw
static std::unique_ptr< HashFunction > create_or_throw(const std::string &algo_spec, const std::string &provider="")
Definition: hash.cpp:303
hash
MechanismType hash
Definition: p11_mechanism.cpp:63

const std::vector<uint8_t>& Botan::TLS::Handshake_Hash::get_contents | ( |  | ) | const
| inline

Definition at line 34 of file tls_handshake_hash.h.

Referenced by Botan::TLS::Certificate_Verify::Certificate_Verify(), and Botan::TLS::Certificate_Verify::verify().

34 { return m_data; }

void Botan::TLS::Handshake_Hash::reset | ( |  | ) |
| inline

Definition at line 36 of file tls_handshake_hash.h.

Referenced by Botan::TLS::Handshake_State::hello_verify_request().

36 { m_data.clear(); }

void Botan::TLS::Handshake_Hash::update | ( | const uint8_t | in[],
|  | size_t | length
| ) |  |
| inline

Definition at line 25 of file tls_handshake_hash.h.

Referenced by Botan::TLS::Certificate::Certificate(), Botan::TLS::Certificate_Status::Certificate_Status(), Botan::TLS::Certificate_Verify::Certificate_Verify(), Botan::TLS::Client_Hello::Client_Hello(), Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), Botan::TLS::Finished::Finished(), Botan::TLS::Handshake_State::hello_verify_request(), Botan::TLS::New_Session_Ticket::New_Session_Ticket(), Botan::TLS::Server_Hello::Server_Hello(), Botan::TLS::Server_Hello_Done::Server_Hello_Done(), and Botan::TLS::Server_Key_Exchange::Server_Key_Exchange().

26 { m_data += std::make_pair(in, length); }

void Botan::TLS::Handshake_Hash::update | ( | const std::vector< uint8_t > & | in | ) |
| inline

Definition at line 28 of file tls_handshake_hash.h.

29 { m_data += in; }

The documentation for this class was generated from the following files:

- src/lib/tls/tls_handshake_hash.h
- src/lib/tls/tls_handshake_hash.cpp