summaryrefslogtreecommitdiff
path: root/lib/srp/client.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/srp/client.rb')
-rw-r--r--lib/srp/client.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/srp/client.rb b/lib/srp/client.rb
index 3882f1d..ebe158f 100644
--- a/lib/srp/client.rb
+++ b/lib/srp/client.rb
@@ -5,11 +5,16 @@ module SRP
attr_reader :salt, :verifier, :username
- def initialize(username, password, salt = nil)
+ def initialize(username, options)
@username = username
- @password = password
- @salt = salt || bigrand(4).hex
- calculate_verifier
+ if options[:password]
+ @password = options[:password]
+ @salt = options[:salt] || bigrand(4).hex
+ calculate_verifier
+ else
+ @verifier = options[:verifier]
+ @salt = options[:salt]
+ end
end
def authenticate(server)