summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/bonafide
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/bonafide')
-rw-r--r--src/leap/bitmask/bonafide/_protocol.py6
-rw-r--r--src/leap/bitmask/bonafide/_srp.py1
-rw-r--r--src/leap/bitmask/bonafide/config.py5
-rw-r--r--src/leap/bitmask/bonafide/cred_srp.py18
-rw-r--r--src/leap/bitmask/bonafide/service.py5
-rw-r--r--src/leap/bitmask/bonafide/session.py8
6 files changed, 13 insertions, 30 deletions
diff --git a/src/leap/bitmask/bonafide/_protocol.py b/src/leap/bitmask/bonafide/_protocol.py
index 726185e..3986540 100644
--- a/src/leap/bitmask/bonafide/_protocol.py
+++ b/src/leap/bitmask/bonafide/_protocol.py
@@ -21,10 +21,10 @@ import os
import resource
from collections import defaultdict
-from leap.bonafide import config
-from leap.bonafide.provider import Api
-from leap.bonafide.session import Session, OK
from leap.common.config import get_path_prefix
+from leap.bitmask.bonafide import config
+from leap.bitmask.bonafide.provider import Api
+from leap.bitmask.bonafide.session import Session, OK
from twisted.cred.credentials import UsernamePassword
from twisted.internet.defer import fail
diff --git a/src/leap/bitmask/bonafide/_srp.py b/src/leap/bitmask/bonafide/_srp.py
index 38f657b..b0dd83f 100644
--- a/src/leap/bitmask/bonafide/_srp.py
+++ b/src/leap/bitmask/bonafide/_srp.py
@@ -143,5 +143,6 @@ class SRPAuthNoB(SRPAuthError):
class SRPAuthBadDataFromServer(SRPAuthError):
pass
+
class SRPRegistrationError(Exception):
pass
diff --git a/src/leap/bitmask/bonafide/config.py b/src/leap/bitmask/bonafide/config.py
index ae66a0e..0288676 100644
--- a/src/leap/bitmask/bonafide/config.py
+++ b/src/leap/bitmask/bonafide/config.py
@@ -30,13 +30,12 @@ from twisted.internet.ssl import ClientContextFactory
from twisted.python import log
from twisted.web.client import Agent, downloadPage
-from leap.bonafide._http import httpRequest
-from leap.bonafide.provider import Discovery
-
from leap.common.check import leap_assert
from leap.common.config import get_path_prefix as common_get_path_prefix
from leap.common.files import mkdir_p
# check_and_fix_urw_only, get_mtime
+from leap.bitmask.bonafide._http import httpRequest
+from leap.bitmask.bonafide.provider import Discovery
APPNAME = "bonafide"
diff --git a/src/leap/bitmask/bonafide/cred_srp.py b/src/leap/bitmask/bonafide/cred_srp.py
index 9fcb97b..c986c61 100644
--- a/src/leap/bitmask/bonafide/cred_srp.py
+++ b/src/leap/bitmask/bonafide/cred_srp.py
@@ -31,7 +31,7 @@ from twisted.cred import portal, credentials, error as credError
from twisted.cred.checkers import ICredentialsChecker
from twisted.internet import defer, reactor
-from leap.bonafide.session import Session
+from leap.bitmask.bonafide.session import Session
@implementer(ICredentialsChecker)
@@ -126,26 +126,10 @@ class LeapAuthRealm(object):
if __name__ == '__main__':
- # from the browser-id implementation
- #import sys
- #def _done(res):
- #print res
- #reactor.stop()
- #assertion = sys.argv[1]
- #d = defer.Deferred()
- #reactor.callLater(0, d.callback, "http://localhost:8081")
- #d.addCallback(SRPCredentialsChecker)
- #d.addCallback(lambda c: c.requestAvatarId(assertion))
- #d.addBoth(_done)
- #reactor.run()
-
# XXX move boilerplate to some bitmask-core template.
-
leap_realm = LeapAuthRealm()
# XXX should pass a provider mapping to realm too?
-
leap_portal = portal.Portal(leap_realm)
-
# XXX should we add an offline credentials checker, that's able
# to unlock local soledad sqlcipher backend?
# XXX should pass a provider mapping to credentials checker too?
diff --git a/src/leap/bitmask/bonafide/service.py b/src/leap/bitmask/bonafide/service.py
index 14585ef..deead22 100644
--- a/src/leap/bitmask/bonafide/service.py
+++ b/src/leap/bitmask/bonafide/service.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# service.py
-# Copyright (C) 2015 LEAP
+# Copyright (C) 2015-2016 LEAP
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -14,7 +14,6 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
"""
Bonafide Service.
"""
@@ -23,7 +22,7 @@ from collections import defaultdict
from leap.common.config import get_path_prefix
from leap.common.service_hooks import HookableService
-from leap.bonafide._protocol import BonafideProtocol
+from leap.bitmask.bonafide._protocol import BonafideProtocol
from twisted.internet import defer
from twisted.python import log
diff --git a/src/leap/bitmask/bonafide/session.py b/src/leap/bitmask/bonafide/session.py
index 4180041..f25fa05 100644
--- a/src/leap/bitmask/bonafide/session.py
+++ b/src/leap/bitmask/bonafide/session.py
@@ -20,9 +20,9 @@ LEAP Session management.
from twisted.internet import defer, reactor
from twisted.python import log
-from leap.bonafide import _srp
-from leap.bonafide import provider
-from leap.bonafide._http import httpRequest, cookieAgentFactory
+from leap.bitmask.bonafide import _srp
+from leap.bitmask.bonafide import provider
+from leap.bitmask.bonafide._http import httpRequest, cookieAgentFactory
OK = 'ok'
@@ -209,7 +209,7 @@ if __name__ == "__main__":
d.addErrback(auth_eb)
d.addCallback(lambda _: session.get_smtp_cert())
- #d.addCallback(lambda _: session.get_vpn_cert())
+ # d.addCallback(lambda _: session.get_vpn_cert())
d.addCallback(print_result)
d.addErrback(auth_eb)