diff options
author | lloyd <[email protected]> | 2011-12-31 04:15:06 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2011-12-31 04:15:06 +0000 |
commit | 9f5c73d78fd709c5ab3890bd280c43449fde9195 (patch) | |
tree | d2442ae4fdb678d437f19eaab831ff41caf9d3aa /src/constructs/srp6/srp6_files.h | |
parent | 2b266b5fae7e8d8bb346019daf7211da83c597f7 (diff) |
Remove the autheticator generation from the SRP code as it's not used
by TLS (relies on the finished message check). Add a class for reading
files created by GnuTLS's srptool.
Diffstat (limited to 'src/constructs/srp6/srp6_files.h')
-rw-r--r-- | src/constructs/srp6/srp6_files.h | 53 |
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 |