summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-05-18 13:45:41 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-05-18 14:24:28 (GMT)
commit23fa0f462ddd0c686c677bfe5d4d743621432b7e (patch)
treeb8f0ea1860640f89eafba2460cc5d45bf28fc77c /Swiften/StringCodecs/SHA1.h
parent2456a8b12163b3249b6b9164b601c36772eb05a1 (diff)
downloadswift-23fa0f462ddd0c686c677bfe5d4d743621432b7e.zip
swift-23fa0f462ddd0c686c677bfe5d4d743621432b7e.tar.bz2
Introduce safe containers for storing passwords.
Diffstat (limited to 'Swiften/StringCodecs/SHA1.h')
-rw-r--r--Swiften/StringCodecs/SHA1.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Swiften/StringCodecs/SHA1.h b/Swiften/StringCodecs/SHA1.h
index 671d890..25bfa54 100644
--- a/Swiften/StringCodecs/SHA1.h
+++ b/Swiften/StringCodecs/SHA1.h
@@ -10,6 +10,7 @@
#include <boost/cstdint.hpp>
#include <Swiften/Base/ByteArray.h>
+#include <Swiften/Base/SafeByteArray.h>
namespace Swift {
class SHA1 {
@@ -26,6 +27,8 @@ namespace Swift {
*/
static ByteArray getHash(const ByteArray& data);
+ static ByteArray getHash(const SafeByteArray& data);
+
private:
typedef struct {
boost::uint32_t state[5];
@@ -37,6 +40,8 @@ namespace Swift {
static void Update(CTX* context, boost::uint8_t* data, unsigned int len);
static void Final(boost::uint8_t digest[20], CTX* context);
+ template<typename Container> static ByteArray getHashInternal(const Container& input);
+
private:
CTX context;
};