aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/tls_client.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2011-12-23 18:22:37 +0000
committerlloyd <[email protected]>2011-12-23 18:22:37 +0000
commit61d461d0a5fb63c3aee906c76b4aefe3335a7591 (patch)
treea936e50187ba7ace33c09fcf5a9119e257987f30 /src/tls/tls_client.h
parent917bf37104eb039a97ef989306954dd8bc05f400 (diff)
Centralize a lot of the handshaking and message parsing in TLS_Channel
Also delete the obsolete/never worked CMS examples
Diffstat (limited to 'src/tls/tls_client.h')
-rw-r--r--src/tls/tls_client.h46
1 files changed, 2 insertions, 44 deletions
diff --git a/src/tls/tls_client.h b/src/tls/tls_client.h
index 6d613be33..063323c8b 100644
--- a/src/tls/tls_client.h
+++ b/src/tls/tls_client.h
@@ -8,17 +8,15 @@
#ifndef BOTAN_TLS_CLIENT_H__
#define BOTAN_TLS_CLIENT_H__
-#include <botan/tls_policy.h>
-#include <botan/tls_record.h>
+#include <botan/tls_channel.h>
#include <vector>
-#include <string>
namespace Botan {
/**
* SSL/TLS Client
*/
-class BOTAN_DLL TLS_Client
+class BOTAN_DLL TLS_Client : public TLS_Channel
{
public:
/**
@@ -29,57 +27,17 @@ class BOTAN_DLL TLS_Client
const TLS_Policy& policy,
RandomNumberGenerator& rng);
- /**
- * Inject TLS traffic received from counterparty
-
- * @return a hint as the how many more bytes we need to process the
- current record (this may be 0 if on a record boundary)
- */
- size_t received_data(const byte buf[], size_t buf_size);
-
- /**
- * Inject plaintext intended for counterparty
- */
- void queue_for_sending(const byte buf[], size_t buf_size);
-
- void close();
-
- bool handshake_complete() const { return active; }
-
- std::vector<X509_Certificate> peer_cert_chain() const { return peer_certs; }
-
void add_client_cert(const X509_Certificate& cert,
Private_Key* cert_key);
~TLS_Client();
private:
- void close(Alert_Level, Alert_Type);
-
- size_t get_pending_socket_input(byte output[], size_t length);
-
- void initialize();
- void do_handshake();
-
- void state_machine();
- void read_handshake(byte, const MemoryRegion<byte>&);
void process_handshake_msg(Handshake_Type, const MemoryRegion<byte>&);
const TLS_Policy& policy;
RandomNumberGenerator& rng;
- std::tr1::function<void (const byte[], size_t, u16bit)> proc_fn;
-
- Record_Writer writer;
- Record_Reader reader;
-
- SecureQueue pre_handshake_write_queue;
-
- std::vector<X509_Certificate> peer_certs;
std::vector<std::pair<X509_Certificate, Private_Key*> > certs;
-
- class Handshake_State* state;
- //SecureVector<byte> session_id;
- bool active;
};
}