aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-05-25 13:35:03 +0000
committerlloyd <[email protected]>2010-05-25 13:35:03 +0000
commit0eecae9f21172c0a74ad62acaf77148c94a25be7 (patch)
treed0de8bd10b92a648a6700f59c68eed9cac81ba64 /src
parent2295ef9e8d97065ad2920f5039878728e52a144f (diff)
parent211d835a356f55e037ff8035017d79c458f13615 (diff)
propagate from branch 'net.randombit.botan' (head 879d1fc83844976a01b9e3188c4f0b5ddb237f0e)
to branch 'net.randombit.botan.c++0x' (head 4a0af13da3b0e21d6275cd6ec0c835d6bf757c8d)
Diffstat (limited to 'src')
-rw-r--r--src/algo_factory/algo_factory.cpp16
-rw-r--r--src/alloc/secmem.h24
-rw-r--r--src/ssl/unix_socket/unx_sock.cpp5
3 files changed, 31 insertions, 14 deletions
diff --git a/src/algo_factory/algo_factory.cpp b/src/algo_factory/algo_factory.cpp
index 07a072f22..5f3e752bd 100644
--- a/src/algo_factory/algo_factory.cpp
+++ b/src/algo_factory/algo_factory.cpp
@@ -1,6 +1,6 @@
/*
* Algorithm Factory
-* (C) 2008 Jack Lloyd
+* (C) 2008-2010 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/
@@ -26,22 +26,26 @@ namespace {
* Template functions for the factory prototype/search algorithm
*/
template<typename T>
-T* engine_get_algo(Engine* engine, const SCAN_Name& request,
- Algorithm_Factory& af)
+T* engine_get_algo(Engine*,
+ const SCAN_Name&,
+ Algorithm_Factory&)
{ return 0; }
template<>
-BlockCipher* engine_get_algo(Engine* engine, const SCAN_Name& request,
+BlockCipher* engine_get_algo(Engine* engine,
+ const SCAN_Name& request,
Algorithm_Factory& af)
{ return engine->find_block_cipher(request, af); }
template<>
-StreamCipher* engine_get_algo(Engine* engine, const SCAN_Name& request,
+StreamCipher* engine_get_algo(Engine* engine,
+ const SCAN_Name& request,
Algorithm_Factory& af)
{ return engine->find_stream_cipher(request, af); }
template<>
-HashFunction* engine_get_algo(Engine* engine, const SCAN_Name& request,
+HashFunction* engine_get_algo(Engine* engine,
+ const SCAN_Name& request,
Algorithm_Factory& af)
{ return engine->find_hash(request, af); }
diff --git a/src/alloc/secmem.h b/src/alloc/secmem.h
index c50df924d..b3b3fa973 100644
--- a/src/alloc/secmem.h
+++ b/src/alloc/secmem.h
@@ -292,6 +292,10 @@ template<typename T>
class MemoryVector : public MemoryRegion<T>
{
public:
+ using MemoryRegion<T>::set;
+ using MemoryRegion<T>::init;
+ using MemoryRegion<T>::append;
+
/**
* Copy the contents of another buffer into this buffer.
* @param in the buffer to copy the contents from
@@ -304,7 +308,7 @@ class MemoryVector : public MemoryRegion<T>
* Create a buffer of the specified length.
* @param n the length of the buffer to create.
*/
- MemoryVector(u32bit n = 0) { MemoryRegion<T>::init(false, n); }
+ MemoryVector(u32bit n = 0) { init(false, n); }
/**
* Create a buffer with the specified contents.
@@ -313,13 +317,13 @@ class MemoryVector : public MemoryRegion<T>
* @param n the size of the arry in
*/
MemoryVector(const T in[], u32bit n)
- { MemoryRegion<T>::init(false); set(in, n); }
+ { init(false); set(in, n); }
/**
* Copy constructor.
*/
MemoryVector(const MemoryRegion<T>& in)
- { MemoryRegion<T>::init(false); set(in); }
+ { init(false); set(in); }
/**
* Create a buffer whose content is the concatenation of two other
@@ -328,7 +332,7 @@ class MemoryVector : public MemoryRegion<T>
* @param in2 the contents to be appended to in1
*/
MemoryVector(const MemoryRegion<T>& in1, const MemoryRegion<T>& in2)
- { MemoryRegion<T>::init(false); set(in1); append(in2); }
+ { init(false); set(in1); append(in2); }
};
/**
@@ -341,6 +345,10 @@ template<typename T, u32bit INITIAL_LEN = 0>
class SecureVector : public MemoryRegion<T>
{
public:
+ using MemoryRegion<T>::set;
+ using MemoryRegion<T>::init;
+ using MemoryRegion<T>::append;
+
/**
* Copy the contents of another buffer into this buffer.
* @param in the buffer to copy the contents from
@@ -354,7 +362,7 @@ class SecureVector : public MemoryRegion<T>
* @param n the length of the buffer to create.
*/
SecureVector(u32bit n = INITIAL_LEN)
- { MemoryRegion<T>::init(true, n); }
+ { init(true, n); }
/**
* Create a buffer with the specified contents.
@@ -363,7 +371,7 @@ class SecureVector : public MemoryRegion<T>
* @param n the size of the array in
*/
SecureVector(const T in[], u32bit n)
- { MemoryRegion<T>::init(true); set(in, n); }
+ { init(true); set(in, n); }
/**
* Create a buffer with contents specified contents.
@@ -371,7 +379,7 @@ class SecureVector : public MemoryRegion<T>
* copied into the newly created buffer.
*/
SecureVector(const MemoryRegion<T>& in)
- { MemoryRegion<T>::init(true); set(in); }
+ { init(true); set(in); }
/**
* Create a buffer whose content is the concatenation of two other
@@ -380,7 +388,7 @@ class SecureVector : public MemoryRegion<T>
* @param in2 the contents to be appended to in1
*/
SecureVector(const MemoryRegion<T>& in1, const MemoryRegion<T>& in2)
- { MemoryRegion<T>::init(true); set(in1); append(in2); }
+ { init(true); set(in1); append(in2); }
};
}
diff --git a/src/ssl/unix_socket/unx_sock.cpp b/src/ssl/unix_socket/unx_sock.cpp
index f9d9629fb..9954cdc06 100644
--- a/src/ssl/unix_socket/unx_sock.cpp
+++ b/src/ssl/unix_socket/unx_sock.cpp
@@ -41,6 +41,11 @@ Unix_Socket::Unix_Socket(const std::string& host, u16bit port) : peer(host)
::memset(&socket_info, 0, sizeof(socket_info));
socket_info.sin_family = AF_INET;
socket_info.sin_port = htons(port);
+
+ ::memcpy(&socket_info.sin_addr,
+ host_addr->h_addr,
+ host_addr->h_length);
+
socket_info.sin_addr = *(struct in_addr*)host_addr->h_addr; // FIXME
if(::connect(fd, (sockaddr*)&socket_info, sizeof(struct sockaddr)) != 0)