def _make_final_challenge(self, username, realm, cnonce, digest_uri,<EOL>response_val, authzid, nonce_count):
<EOL>username_uq = username.replace(b'<STR_LIT:\\>', b'<STR_LIT>')<EOL>if authzid:<EOL><INDENT>authzid_uq = authzid.replace(b'<STR_LIT:\\>', b'<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>authzid_uq = None<EOL><DEDENT>if realm:<EOL><INDENT>realm_uq = realm.replace(b'<STR_LIT:\\>', b'<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>realm_uq = None<EOL><DEDENT>digest_uri_uq = digest_uri.replace(b'<STR_LIT:\\>', b'<STR_LIT>')<EOL>props = dict(self.in_properties)<EOL>props["<STR_LIT>"] = realm_uq.decode("<STR_LIT:utf-8>")<EOL>password, pformat = self.password_database.get_password(<EOL>username_uq.decode("<STR_LIT:utf-8>"),<EOL>(u"<STR_LIT>", u"<STR_LIT>"), props)<EOL>if pformat == u"<STR_LIT>":<EOL><INDENT>urp_hash = password.a2b_hex()<EOL><DEDENT>elif pformat == u"<STR_LIT>":<EOL><INDENT>urp_hash = _make_urp_hash(username, realm, password.encode("<STR_LIT:utf-8>"))<EOL><DEDENT>else:<EOL><INDENT>logger.debug(u"<STR_LIT>")<EOL>return Failure(u"<STR_LIT>")<EOL><DEDENT>valid_response = _compute_response(urp_hash, self.nonce, cnonce,<EOL>nonce_count, authzid, digest_uri)<EOL>if response_val != valid_response:<EOL><INDENT>logger.debug(u"<STR_LIT>".format(<EOL>response_val, valid_response))<EOL>return Failure(u"<STR_LIT>")<EOL><DEDENT>try:<EOL><INDENT>fields = digest_uri_uq.split(b"<STR_LIT:/>")<EOL>if len(fields) == <NUM_LIT:3>:<EOL><INDENT>serv_type, host, serv_name = [f.decode("<STR_LIT:utf-8>") for f in fields]<EOL><DEDENT>elif len(fields) == <NUM_LIT:2>:<EOL><INDENT>serv_type, host = [f.decode("<STR_LIT:utf-8>") for f in fields]<EOL>serv_name = None<EOL><DEDENT>else:<EOL><INDENT>raise ValueError<EOL><DEDENT><DEDENT>except (ValueError, UnicodeError):<EOL><INDENT>logger.debug("<STR_LIT>".format(digest_uri_uq))<EOL>return Failure("<STR_LIT>")<EOL><DEDENT>if "<STR_LIT>" in self.in_properties:<EOL><INDENT>if serv_type != self.in_properties["<STR_LIT>"]:<EOL><INDENT>logger.debug(u"<STR_LIT>"<EOL>.format(serv_type, self.in_properties["<STR_LIT>"]))<EOL>return Failure("<STR_LIT>")<EOL><DEDENT><DEDENT>if "<STR_LIT>" in self.in_properties:<EOL><INDENT>if serv_name:<EOL><INDENT>if serv_name != self.in_properties["<STR_LIT>"]:<EOL><INDENT>logger.debug(u"<STR_LIT>".format(serv_name,<EOL>self.in_properties["<STR_LIT>"]))<EOL><DEDENT>return Failure("<STR_LIT>")<EOL><DEDENT>elif (host != self.in_properties["<STR_LIT>"]<EOL>and host != self.in_properties.get("<STR_LIT>")):<EOL><INDENT>logger.debug(u"<STR_LIT>"<EOL>u"<STR_LIT>".format(host,<EOL>self.in_properties["<STR_LIT>"],<EOL>self.in_properties.get("<STR_LIT>")))<EOL>return Failure("<STR_LIT>")<EOL><DEDENT><DEDENT>if "<STR_LIT>" in self.in_properties:<EOL><INDENT>if host != self.in_properties["<STR_LIT>"]:<EOL><INDENT>logger.debug(u"<STR_LIT>".format(host,<EOL>self.in_properties["<STR_LIT>"]))<EOL>return Failure("<STR_LIT>")<EOL><DEDENT><DEDENT>rspauth = _compute_response_auth(urp_hash, self.nonce, cnonce,<EOL>nonce_count, authzid, digest_uri)<EOL>if authzid_uq is not None:<EOL><INDENT>authzid_uq =  authzid_uq.decode("<STR_LIT:utf-8>")<EOL><DEDENT>self.out_properties = {<EOL>"<STR_LIT:username>": username.decode("<STR_LIT:utf-8>"),<EOL>"<STR_LIT>": realm.decode("<STR_LIT:utf-8>"),<EOL>"<STR_LIT>": authzid_uq,<EOL>"<STR_LIT>": serv_type,<EOL>"<STR_LIT>": serv_name if serv_name else host,<EOL>"<STR_LIT>": host<EOL>}<EOL>return Success(self.out_properties, b"<STR_LIT>" + rspauth)<EOL>
Send the second challenge in reply to the client response.

        :Parameters:
            - `username`: user name.
            - `realm`: realm.
            - `cnonce`: cnonce value.
            - `digest_uri`: digest-uri value.
            - `response_val`: response value computed by the client.
            - `authzid`: authorization id.
            - `nonce_count`: nonce count value.
        :Types:
            - `username`: `bytes`
            - `realm`: `bytes`
            - `cnonce`: `bytes`
            - `digest_uri`: `bytes`
            - `response_val`: `bytes`
            - `authzid`: `bytes`
            - `nonce_count`: `bytes`

        :return: a challenge, a success indicator or a failure indicator.
        :returntype: `sasl.Success` or `sasl.Failure`