aboutsummaryrefslogtreecommitdiffstats
path: root/src/constructs/srp6/srp6_files.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/constructs/srp6/srp6_files.h')
-rw-r--r--src/constructs/srp6/srp6_files.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/constructs/srp6/srp6_files.h b/src/constructs/srp6/srp6_files.h
new file mode 100644
index 000000000..1def0fd51
--- /dev/null
+++ b/src/constructs/srp6/srp6_files.h
@@ -0,0 +1,53 @@
+/*
+* SRP-6a File Handling
+* (C) 2011 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
+
+#ifndef BOTAN_SRP6A_FILES_H__
+#define BOTAN_SRP6A_FILES_H__
+
+#include <botan/bigint.h>
+#include <string>
+#include <map>
+
+namespace Botan {
+
+/**
+* A GnuTLS compatible SRP6 authenticator file
+*/
+class SRP6_Authenticator_File
+ {
+ public:
+ /**
+ * @param filename will be opened and processed as a SRP
+ * authenticator file
+ */
+ SRP6_Authenticator_File(const std::string& filename);
+
+ bool lookup_user(const std::string& username,
+ BigInt& v,
+ MemoryVector<byte>& salt,
+ std::string& group_id) const;
+ private:
+ struct SRP6_Data
+ {
+ SRP6_Data() {}
+
+ SRP6_Data(const BigInt& v,
+ const MemoryRegion<byte>& salt,
+ const std::string& group_id) :
+ v(v), salt(salt), group_id(group_id) {}
+
+ BigInt v;
+ MemoryVector<byte> salt;
+ std::string group_id;
+ };
+
+ std::map<std::string, SRP6_Data> entries;
+ };
+
+}
+
+#endif