auth.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:pyatv 作者: postlund 项目源码 文件源码
def finish_authentication(self, username, password):
        """Finish authentication process.

        A username (generated by new_credentials) and the PIN code shown on
        screen must be provided.
        """
        # Step 1
        self.srp.step1(username, password)
        data = yield from self._send_plist(
            'step1', method='pin', user=username)
        resp = plistlib.loads(data)

        # Step 2
        pub_key, key_proof = self.srp.step2(resp['pk'], resp['salt'])
        yield from self._send_plist(
            'step2',
            pk=binascii.unhexlify(pub_key),
            proof=binascii.unhexlify(key_proof))

        # Step 3
        epk, tag = self.srp.step3()
        yield from self._send_plist('step3', epk=epk, authTag=tag)
        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号