Botan 1.10.17

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

`#include <tls_messages.h>`

Inheritance diagram for Botan::Finished:

## Public Member Functions
| Finished (Record_Writer &, Version_Code, Connection_Side, const MemoryRegion< byte > &, HandshakeHash &)
| Finished (const MemoryRegion< byte > &buf)
void | send (Record_Writer &, HandshakeHash &) const
Handshake_Type | type () const
bool | verify (const MemoryRegion< byte > &, Version_Code, const HandshakeHash &, Connection_Side)

## Detailed Description

Finished Message

Definition at line 185 of file tls_messages.h.

## Constructor & Destructor Documentation

## ◆ Finished() [1/2]

Botan::Finished::Finished | ( | Record_Writer & | writer,
|  | Version_Code | version,
|  | Connection_Side | side,
|  | const MemoryRegion< byte > & | master_secret,
|  | HandshakeHash & | hash
| ) |  |

Create a new Finished message

Definition at line 16 of file finished.cpp.

References Botan::HandshakeMessage::send().

20 {
21 verification_data = compute_verify(master_secret, hash, side, version);
22 send(writer, hash);
23 }
Botan::HandshakeMessage::send
void send(Record_Writer &, HandshakeHash &) const
Definition: hello.cpp:16

## ◆ Finished() [2/2]

Botan::Finished::Finished | ( | const MemoryRegion< byte > & | buf | ) |
| inline

Definition at line 195 of file tls_messages.h.

195 { deserialize(buf); }

## Member Function Documentation

## ◆ send()

void Botan::HandshakeMessage::send | ( | Record_Writer & | writer,
|  | HandshakeHash & | hash
| ) |  | const
| inherited

Definition at line 16 of file hello.cpp.

References Botan::Record_Writer::flush(), Botan::HANDSHAKE, Botan::Record_Writer::send(), Botan::MemoryRegion< T >::size(), Botan::HandshakeMessage::type(), and Botan::HandshakeHash::update().

Referenced by Botan::Certificate::Certificate(), Botan::Certificate_Req::Certificate_Req(), Finished(), Botan::Hello_Request::Hello_Request(), and Botan::Server_Hello_Done::Server_Hello_Done().

17 {
18 SecureVector<byte> buf = serialize();
19 SecureVector<byte> send_buf(4);
20
21 const size_t buf_size = buf.size();
22
23 send_buf[0] = type();
24
25 for(size_t i = 1; i != 4; ++i)
26 send_buf[i] = get_byte<u32bit>(i, buf_size);
27
28 send_buf += buf;
29
30 hash.update(send_buf);
31
32 writer.send(HANDSHAKE, &send_buf[0], send_buf.size());
33 writer.flush();
34 }
Botan::HANDSHAKE
Definition: tls_magic.h:36
Botan::HandshakeMessage::type
virtual Handshake_Type type() const =0

## ◆ type()

Handshake_Type Botan::Finished::type | ( |  | ) | const
| inline virtual

Implements Botan::HandshakeMessage.

Definition at line 188 of file tls_messages.h.

References Botan::FINISHED.

188 { return FINISHED; }
Botan::FINISHED
Definition: tls_magic.h:51

## ◆ verify()

bool Botan::Finished::verify | ( | const MemoryRegion< byte > & | secret,
|  | Version_Code | version,
|  | const HandshakeHash & | hash,
|  | Connection_Side | side
| ) |  |

Verify a Finished message

Definition at line 44 of file finished.cpp.

46 {
47 SecureVector<byte> computed = compute_verify(secret, hash, side, version);
48 if(computed == verification_data)
49 return true;
50 return false;
51 }

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

- src/ssl/tls_messages.h
- src/ssl/finished.cpp