From 552574bfb0a0160935452b605bb262b5b52c4f67 Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 6 Aug 2012 12:34:47 +0200 Subject: added authenticate! which raises SRP::WrongPassword if it fails, version 0.0.2 --- lib/srp/authentication.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/srp') 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) -- cgit v1.2.3