aboutsummaryrefslogtreecommitdiffstats
path: root/src/ssl
diff options
context:
space:
mode:
Diffstat (limited to 'src/ssl')
-rw-r--r--src/ssl/cert_ver.cpp2
-rw-r--r--src/ssl/info.txt2
-rw-r--r--src/ssl/rec_wri.cpp4
-rw-r--r--src/ssl/s_kex.cpp2
-rw-r--r--src/ssl/tls_client.cpp4
-rw-r--r--src/ssl/tls_client.h6
-rw-r--r--src/ssl/tls_record.h15
-rw-r--r--src/ssl/tls_server.cpp4
-rw-r--r--src/ssl/tls_server.h6
-rw-r--r--src/ssl/tls_suites.cpp9
10 files changed, 24 insertions, 30 deletions
diff --git a/src/ssl/cert_ver.cpp b/src/ssl/cert_ver.cpp
index 3220a8c9e..3dcd38141 100644
--- a/src/ssl/cert_ver.cpp
+++ b/src/ssl/cert_ver.cpp
@@ -75,7 +75,7 @@ bool Certificate_Verify::verify(const X509_Certificate& cert,
{
// FIXME: duplicate of Server_Key_Exchange::verify
- std::auto_ptr<Public_Key> key(cert.subject_public_key());
+ std::unique_ptr<Public_Key> key(cert.subject_public_key());
std::string padding = "";
Signature_Format format = IEEE_1363;
diff --git a/src/ssl/info.txt b/src/ssl/info.txt
index 8b566ae60..8f1eda497 100644
--- a/src/ssl/info.txt
+++ b/src/ssl/info.txt
@@ -1,7 +1,5 @@
define SSL_TLS
-uses_tr1 yes
-
<header:public>
socket.h
tls_client.h
diff --git a/src/ssl/rec_wri.cpp b/src/ssl/rec_wri.cpp
index 59dead3cd..04b58e12f 100644
--- a/src/ssl/rec_wri.cpp
+++ b/src/ssl/rec_wri.cpp
@@ -16,7 +16,7 @@ namespace Botan {
/**
* Record_Writer Constructor
*/
-Record_Writer::Record_Writer(std::tr1::function<void (const byte[], size_t)> out) :
+Record_Writer::Record_Writer(std::function<void (const byte[], size_t)> out) :
output_fn(out),
buffer(DEFAULT_BUFFERSIZE)
{
@@ -262,7 +262,7 @@ void Record_Writer::send_record(byte type, byte major, byte minor,
*/
void Record_Writer::alert(Alert_Level level, Alert_Type type)
{
- byte alert[2] = { level, type };
+ byte alert[2] = { (byte)level, (byte)type };
send(ALERT, alert, sizeof(alert));
flush();
}
diff --git a/src/ssl/s_kex.cpp b/src/ssl/s_kex.cpp
index 1e7de31d0..ffec0aa8f 100644
--- a/src/ssl/s_kex.cpp
+++ b/src/ssl/s_kex.cpp
@@ -151,7 +151,7 @@ bool Server_Key_Exchange::verify(const X509_Certificate& cert,
const MemoryRegion<byte>& s_random) const
{
- std::auto_ptr<Public_Key> key(cert.subject_public_key());
+ std::unique_ptr<Public_Key> key(cert.subject_public_key());
std::string padding = "";
Signature_Format format = IEEE_1363;
diff --git a/src/ssl/tls_client.cpp b/src/ssl/tls_client.cpp
index 5447e9904..03c8117cc 100644
--- a/src/ssl/tls_client.cpp
+++ b/src/ssl/tls_client.cpp
@@ -81,8 +81,8 @@ void client_check_state(Handshake_Type new_msg, Handshake_State* state)
/**
* TLS Client Constructor
*/
-TLS_Client::TLS_Client(std::tr1::function<size_t (byte[], size_t)> input_fn,
- std::tr1::function<void (const byte[], size_t)> output_fn,
+TLS_Client::TLS_Client(std::function<size_t (byte[], size_t)> input_fn,
+ std::function<void (const byte[], size_t)> output_fn,
const TLS_Policy& policy,
RandomNumberGenerator& rng) :
input_fn(input_fn),
diff --git a/src/ssl/tls_client.h b/src/ssl/tls_client.h
index 7d2ce9cda..0268c34c1 100644
--- a/src/ssl/tls_client.h
+++ b/src/ssl/tls_client.h
@@ -33,8 +33,8 @@ class BOTAN_DLL TLS_Client : public TLS_Connection
void add_client_cert(const X509_Certificate& cert,
Private_Key* cert_key);
- TLS_Client(std::tr1::function<size_t (byte[], size_t)> input_fn,
- std::tr1::function<void (const byte[], size_t)> output_fn,
+ TLS_Client(std::function<size_t (byte[], size_t)> input_fn,
+ std::function<void (const byte[], size_t)> output_fn,
const TLS_Policy& policy,
RandomNumberGenerator& rng);
@@ -51,7 +51,7 @@ class BOTAN_DLL TLS_Client : public TLS_Connection
void read_handshake(byte, const MemoryRegion<byte>&);
void process_handshake_msg(Handshake_Type, const MemoryRegion<byte>&);
- std::tr1::function<size_t (byte[], size_t)> input_fn;
+ std::function<size_t (byte[], size_t)> input_fn;
const TLS_Policy& policy;
RandomNumberGenerator& rng;
diff --git a/src/ssl/tls_record.h b/src/ssl/tls_record.h
index 7a223095f..b4c052a1c 100644
--- a/src/ssl/tls_record.h
+++ b/src/ssl/tls_record.h
@@ -14,18 +14,11 @@
#include <botan/mac.h>
#include <botan/secqueue.h>
#include <vector>
-
-#if defined(BOTAN_USE_STD_TR1)
- #include <tr1/functional>
-#elif defined(BOTAN_USE_BOOST_TR1)
- #include <boost/tr1/functional.hpp>
-#else
- #error "No TR1 library defined for use"
-#endif
+#include <functional>
namespace Botan {
-using namespace std::tr1::placeholders;
+using namespace std::placeholders;
/**
* TLS Record Writer
@@ -46,7 +39,7 @@ class BOTAN_DLL Record_Writer
void reset();
- Record_Writer(std::tr1::function<void (const byte[], size_t)> output_fn);
+ Record_Writer(std::function<void (const byte[], size_t)> output_fn);
~Record_Writer() { delete mac; }
private:
@@ -54,7 +47,7 @@ class BOTAN_DLL Record_Writer
void send_record(byte type, byte major, byte minor,
const byte input[], size_t length);
- std::tr1::function<void (const byte[], size_t)> output_fn;
+ std::function<void (const byte[], size_t)> output_fn;
Pipe cipher;
MessageAuthenticationCode* mac;
diff --git a/src/ssl/tls_server.cpp b/src/ssl/tls_server.cpp
index 4e071da59..20e98797f 100644
--- a/src/ssl/tls_server.cpp
+++ b/src/ssl/tls_server.cpp
@@ -85,8 +85,8 @@ void server_check_state(Handshake_Type new_msg, Handshake_State* state)
/*
* TLS Server Constructor
*/
-TLS_Server::TLS_Server(std::tr1::function<size_t (byte[], size_t)> input_fn,
- std::tr1::function<void (const byte[], size_t)> output_fn,
+TLS_Server::TLS_Server(std::function<size_t (byte[], size_t)> input_fn,
+ std::function<void (const byte[], size_t)> output_fn,
const TLS_Policy& policy,
RandomNumberGenerator& rng,
const X509_Certificate& cert,
diff --git a/src/ssl/tls_server.h b/src/ssl/tls_server.h
index a6b0f9cb4..f8b38dd0b 100644
--- a/src/ssl/tls_server.h
+++ b/src/ssl/tls_server.h
@@ -36,8 +36,8 @@ class BOTAN_DLL TLS_Server : public TLS_Connection
* FIXME: support cert chains (!)
* FIXME: support anonymous servers
*/
- TLS_Server(std::tr1::function<size_t (byte[], size_t)> input_fn,
- std::tr1::function<void (const byte[], size_t)> output_fn,
+ TLS_Server(std::function<size_t (byte[], size_t)> input_fn,
+ std::function<void (const byte[], size_t)> output_fn,
const TLS_Policy& policy,
RandomNumberGenerator& rng,
const X509_Certificate& cert,
@@ -53,7 +53,7 @@ class BOTAN_DLL TLS_Server : public TLS_Connection
void process_handshake_msg(Handshake_Type, const MemoryRegion<byte>&);
- std::tr1::function<size_t (byte[], size_t)> input_fn;
+ std::function<size_t (byte[], size_t)> input_fn;
const TLS_Policy& policy;
RandomNumberGenerator& rng;
diff --git a/src/ssl/tls_suites.cpp b/src/ssl/tls_suites.cpp
index 07cbec608..304d0b5db 100644
--- a/src/ssl/tls_suites.cpp
+++ b/src/ssl/tls_suites.cpp
@@ -230,7 +230,8 @@ std::pair<std::string, size_t> cipher_code_to_name(TLS_Ciphersuite_Algos algo)
return std::make_pair("SEED", 16);
throw TLS_Exception(INTERNAL_ERROR,
- "CipherSuite: Unknown cipher type " + to_string(algo));
+ "CipherSuite: Unknown cipher type " +
+ std::to_string(algo));
}
std::string mac_code_to_name(TLS_Ciphersuite_Algos algo)
@@ -248,7 +249,8 @@ std::string mac_code_to_name(TLS_Ciphersuite_Algos algo)
return "SHA-384";
throw TLS_Exception(INTERNAL_ERROR,
- "CipherSuite: Unknown MAC type " + to_string(algo));
+ "CipherSuite: Unknown MAC type " +
+ std::to_string(algo));
}
}
@@ -264,7 +266,8 @@ CipherSuite::CipherSuite(u16bit suite_code)
TLS_Ciphersuite_Algos algos = lookup_ciphersuite(suite_code);
if(algos == 0)
- throw Invalid_Argument("Unknown ciphersuite: " + to_string(suite_code));
+ throw Invalid_Argument("Unknown ciphersuite: " +
+ std::to_string(suite_code));
sig_algo = TLS_Ciphersuite_Algos(algos & TLS_ALGO_SIGNER_MASK);