diff options
Diffstat (limited to 'src/credentials')
-rw-r--r-- | src/credentials/credentials_manager.cpp | 16 | ||||
-rw-r--r-- | src/credentials/credentials_manager.h | 26 |
2 files changed, 27 insertions, 15 deletions
diff --git a/src/credentials/credentials_manager.cpp b/src/credentials/credentials_manager.cpp index fee849e47..7ca6ac657 100644 --- a/src/credentials/credentials_manager.cpp +++ b/src/credentials/credentials_manager.cpp @@ -15,12 +15,18 @@ std::string Credentials_Manager::psk_identity_hint(const std::string&, return ""; } -std::pair<std::string, SymmetricKey> -Credentials_Manager::psk(const std::string&, - const std::string&, - const std::string& identity_hint) +std::string Credentials_Manager::psk_identity(const std::string&, + const std::string&, + const std::string&) + { + return ""; + } + +SymmetricKey Credentials_Manager::psk(const std::string&, + const std::string&, + const std::string& identity) { - throw Internal_Error("No PSK set for " + identity_hint); + throw Internal_Error("No PSK set for identity " + identity); } std::string Credentials_Manager::srp_identifier(const std::string&, diff --git a/src/credentials/credentials_manager.h b/src/credentials/credentials_manager.h index 3c7eec3e7..7dc049722 100644 --- a/src/credentials/credentials_manager.h +++ b/src/credentials/credentials_manager.h @@ -34,12 +34,18 @@ class BOTAN_DLL Credentials_Manager /** * @param identity_hint was passed by the server (but may be empty) - * @return pair of PSK identity and the PSK itself. + * @return the PSK identity we want to use */ - virtual std::pair<std::string, SymmetricKey> - psk(const std::string& type, - const std::string& context, - const std::string& identity_hint); + virtual std::string psk_identity(const std::string& type, + const std::string& context, + const std::string& identity_hint); + + /** + * @return the PSK used for identity + */ + virtual SymmetricKey psk(const std::string& type, + const std::string& context, + const std::string& identity); /** * @return identifier for client-side SRP auth, if available @@ -56,16 +62,16 @@ class BOTAN_DLL Credentials_Manager * @return password for client-side SRP auth, if available for this identifier/type/context. */ - virtual std::string srp_password(const std::string& identifier, - const std::string& type, - const std::string& context); + virtual std::string srp_password(const std::string& type, + const std::string& context, + const std::string& identifier); /** * Retrieve SRP verifier parameters */ - virtual bool srp_verifier(const std::string& identifier, - const std::string& type, + virtual bool srp_verifier(const std::string& type, const std::string& context, + const std::string& identifier, BigInt& group_prime, BigInt& group_generator, BigInt& verifier, |