示例#1
0
 def load_publickey(self, text):
     """ Load Bob's public key.
     """
     for type_, blob in dearmor(text):
         if type_ in ['dh-publickey']:
             self.B = bytes2int(blob)
             break
示例#2
0
    def checkCredentials(self, conn):
        DEBUG(AUTH, "looking for auth cookie")
        auth = conn.requestCookie.get(self.cookieName)
        if not auth:
            return None

        #have cookie, now check, assuming basicAuth style cookie w/armoring
        auth = auth.value
        txt = armor.dearmor(self.cookieNonce, auth)
        if not txt:
            return

        bits = txt.split(':')
        user = bits[0]
        password = '******'.join(bits[1:])
        conn.remoteUser = user
        conn.remotePassword = password
        conn.env['REMOTE_USER'] = conn.remoteUser
        conn.env['REMOTE_PASSWORD'] = conn.remotePassword
        return self.validate(user, password)
示例#3
0
    def checkCredentials(self, conn):
        DEBUG(AUTH, "looking for auth cookie")
        auth = conn.requestCookie.get(self.cookieName)
        if not auth:
            return None

        #have cookie, now check, assuming basicAuth style cookie w/armoring
        auth = auth.value
        txt = armor.dearmor(self.cookieNonce, auth)
        if not txt:
            return

        bits = txt.split(':')
        user = bits[0]
        password = '******'.join(bits[1:])
        conn.remoteUser = user
        conn.remotePassword = password
        conn.env['REMOTE_USER']=conn.remoteUser
        conn.env['REMOTE_PASSWORD']=conn.remotePassword        
        return self.validate(user, password)