diff options
author | lloyd <[email protected]> | 2010-10-13 03:25:16 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-10-13 03:25:16 +0000 |
commit | ba142ed2eaa21445d49cbbc8ae3b3d4dc625b9d7 (patch) | |
tree | be1a9fa07d0ea26fd7713bb52205f7a3bcc3e907 /src/wrap | |
parent | 406d4f8556d41083bfa551e7a777b0cb02925b6c (diff) | |
parent | 5913bf42b4c32e43d0db11bf9299130f3b0b62a4 (diff) |
propagate from branch 'net.randombit.botan' (head 2898d79f992f27a328a3e41d34b46eb1052da0de)
to branch 'net.randombit.botan.c++0x' (head 6cba76268fd69a73195760c021b7f881b8a6552c)
Diffstat (limited to 'src/wrap')
-rw-r--r-- | src/wrap/python/core.cpp | 2 | ||||
-rw-r--r-- | src/wrap/python/filter.cpp | 14 | ||||
-rw-r--r-- | src/wrap/python/python_botan.h | 3 | ||||
-rw-r--r-- | src/wrap/python/rsa.cpp | 8 |
4 files changed, 14 insertions, 13 deletions
diff --git a/src/wrap/python/core.cpp b/src/wrap/python/core.cpp index 7dac7be7f..6dcceee74 100644 --- a/src/wrap/python/core.cpp +++ b/src/wrap/python/core.cpp @@ -178,7 +178,7 @@ std::string python_kdf2(const std::string& param, const std::string& masterkey, u32bit outputlength) { - std::auto_ptr<KDF> kdf(get_kdf("KDF2(SHA-1)")); + std::unique_ptr<KDF> kdf(get_kdf("KDF2(SHA-1)")); return make_string( kdf->derive_key(outputlength, diff --git a/src/wrap/python/filter.cpp b/src/wrap/python/filter.cpp index 343c0831b..a2ad620de 100644 --- a/src/wrap/python/filter.cpp +++ b/src/wrap/python/filter.cpp @@ -111,19 +111,19 @@ Filter* make_filter4(const std::string& name, name); } -void append_filter(Pipe& pipe, std::auto_ptr<Filter> filter) +void append_filter(Pipe& pipe, std::unique_ptr<Filter> filter) { pipe.append(filter.get()); filter.release(); } -void prepend_filter(Pipe& pipe, std::auto_ptr<Filter> filter) +void prepend_filter(Pipe& pipe, std::unique_ptr<Filter> filter) { pipe.prepend(filter.get()); filter.release(); } -void do_send(std::auto_ptr<FilterWrapper> filter, const std::string& data) +void do_send(std::unique_ptr<FilterWrapper> filter, const std::string& data) { printf("Sending %s to %p\n", data.c_str(), filter.get()); filter->send_str(data); @@ -133,7 +133,7 @@ BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(rallas_ovls, read_all_as_string, 0, 1) void export_filters() { - class_<Filter, std::auto_ptr<Filter>, boost::noncopyable> + class_<Filter, std::unique_ptr<Filter>, boost::noncopyable> ("__Internal_FilterObj", no_init); def("make_filter", make_filter1, @@ -147,7 +147,7 @@ void export_filters() // This might not work - Pipe will delete the filter, but Python // might have allocated the space with malloc() or who-knows-what -> bad - class_<FilterWrapper, std::auto_ptr<FilterWrapper>, + class_<FilterWrapper, std::unique_ptr<FilterWrapper>, bases<Filter>, boost::noncopyable> ("FilterObj") .def("write", pure_virtual(&Py_Filter::write_str)) @@ -155,8 +155,8 @@ void export_filters() .def("start_msg", &Filter::start_msg, &FilterWrapper::default_start_msg) .def("end_msg", &Filter::end_msg, &FilterWrapper::default_end_msg); - implicitly_convertible<std::auto_ptr<FilterWrapper>, - std::auto_ptr<Filter> >(); + implicitly_convertible<std::unique_ptr<FilterWrapper>, + std::unique_ptr<Filter> >(); void (Pipe::*pipe_write_str)(const std::string&) = &Pipe::write; void (Pipe::*pipe_process_str)(const std::string&) = &Pipe::process_msg; diff --git a/src/wrap/python/python_botan.h b/src/wrap/python/python_botan.h index a7a2e505e..ac0a17d7f 100644 --- a/src/wrap/python/python_botan.h +++ b/src/wrap/python/python_botan.h @@ -24,7 +24,8 @@ class Bad_Size : public Exception public: Bad_Size(u32bit got, u32bit expected) : Exception("Bad size detected in Python/C++ conversion layer: got " + - to_string(got) + " bytes, expected " + to_string(expected)) + std::to_string(got) + " bytes, expected " + + std::to_string(expected)) {} }; diff --git a/src/wrap/python/rsa.cpp b/src/wrap/python/rsa.cpp index cbccf96e8..fd9fff37e 100644 --- a/src/wrap/python/rsa.cpp +++ b/src/wrap/python/rsa.cpp @@ -63,7 +63,7 @@ class Py_RSA_PrivateKey std::string Py_RSA_PrivateKey::decrypt(const std::string& in, const std::string& padding) { - std::auto_ptr<PK_Decryptor> enc(get_pk_decryptor(*rsa_key, padding)); + std::unique_ptr<PK_Decryptor> enc(get_pk_decryptor(*rsa_key, padding)); const byte* in_bytes = reinterpret_cast<const byte*>(in.data()); @@ -74,7 +74,7 @@ std::string Py_RSA_PrivateKey::sign(const std::string& in, const std::string& padding, Python_RandomNumberGenerator& rng) { - std::auto_ptr<PK_Signer> sign(get_pk_signer(*rsa_key, padding)); + std::unique_ptr<PK_Signer> sign(get_pk_signer(*rsa_key, padding)); const byte* in_bytes = reinterpret_cast<const byte*>(in.data()); sign->update(in_bytes, in.size()); return make_string(sign->signature(rng.get_underlying_rng())); @@ -160,7 +160,7 @@ std::string Py_RSA_PublicKey::encrypt(const std::string& in, const std::string& padding, Python_RandomNumberGenerator& rng) { - std::auto_ptr<PK_Encryptor> enc(get_pk_encryptor(*rsa_key, padding)); + std::unique_ptr<PK_Encryptor> enc(get_pk_encryptor(*rsa_key, padding)); const byte* in_bytes = reinterpret_cast<const byte*>(in.data()); @@ -172,7 +172,7 @@ bool Py_RSA_PublicKey::verify(const std::string& in, const std::string& signature, const std::string& padding) { - std::auto_ptr<PK_Verifier> ver(get_pk_verifier(*rsa_key, padding)); + std::unique_ptr<PK_Verifier> ver(get_pk_verifier(*rsa_key, padding)); const byte* in_bytes = reinterpret_cast<const byte*>(in.data()); const byte* sig_bytes = reinterpret_cast<const byte*>(signature.data()); |