diff options
| -rw-r--r-- | lib/ruby-srp.rb (renamed from lib/srp.rb) | 2 | ||||
| -rw-r--r-- | lib/srp/authentication.rb | 4 | ||||
| -rw-r--r-- | ruby-srp.gemspec | 2 | ||||
| -rw-r--r-- | test/test_helper.rb | 2 | 
4 files changed, 8 insertions, 2 deletions
| diff --git a/lib/srp.rb b/lib/ruby-srp.rb index a008b82..7cbe06f 100644 --- a/lib/srp.rb +++ b/lib/ruby-srp.rb @@ -10,4 +10,6 @@ $:.unshift File.dirname(__FILE__)  module SRP    autoload :Client, 'srp/client'    autoload :Authentication, 'srp/authentication' +  class WrongPassword < StandardError +  end  end diff --git a/lib/srp/authentication.rb b/lib/srp/authentication.rb index a2431d0..4afe20b 100644 --- a/lib/srp/authentication.rb +++ b/lib/srp/authentication.rb @@ -41,6 +41,10 @@ module SRP        return Session.new(aa, verifier)      end +    def authenticate!(m, session) +      authenticate(m, session) || raise(SRP::WrongPassword) +    end +      def authenticate(m, session)        if(m == session.m1(verifier))          return session.m2(m, verifier) diff --git a/ruby-srp.gemspec b/ruby-srp.gemspec index a7383c9..eac9076 100644 --- a/ruby-srp.gemspec +++ b/ruby-srp.gemspec @@ -1,6 +1,6 @@  Gem::Specification.new do |s|    s.name              = "ruby-srp" -  s.version           = "0.0.1" +  s.version           = "0.0.2"    s.platform          = Gem::Platform::RUBY    s.authors           = ["Azul"]    s.email             = ["azul@leap.se"] diff --git a/test/test_helper.rb b/test/test_helper.rb index 68d3acf..65be0d5 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,3 +1,3 @@  require "rubygems"  require 'test/unit' -require File.expand_path(File.dirname(__FILE__) + '/../lib/srp.rb') +require File.expand_path(File.dirname(__FILE__) + '/../lib/ruby-srp.rb') | 
