Exemple #1
0
 def remote_login(self, username, A):
     try:
         A = srp.bytes_to_long(A)
         v = SRPValidator( self.avatar_factory, SimpleSRP(username, *self.lookup_user_sv(username)), username, A)
         return v.challenge, v
     except Exception, e:
         traceback.print_exc()
         return 'Authentication Failed: ' + str(e), None
Exemple #2
0
def _pb_srp_connected(login_mgr, username,  password, disconnect_func):
    #print 'PB SRP Login as:', username
    
    c = srp.Client( username, password )
    I,A = c.step1()
    
    d = login_mgr.callRemote('login', I, srp.long_to_bytes(A))
    
    def step2( ((s,B), validator) ):
        
        if s is None or B is None or validator is None:
            raise Exception('User Authentication Failed')
        
        s = srp.bytes_to_long(s)
        B = srp.bytes_to_long(B)
        
        M = c.step2( (s,B) )
        
        return validator.callRemote('validate_user', M)