def execute(self, payload):
        if not self.is_nonce_valid(payload):
            # TODO: alert user with popup?
            log.warning(
                "Invalid contact request response nonce from remote peer.")
            return False

        gpg_pub_key = self.fetch_contact_request_pubkey_by_nonce(payload)
        if gpg_pub_key is None:
            # TODO: alert user with popup?
            log.warning(
                "GPG Pubkey Not found in database for request response nonce")
            return False

        self.import_gpg_pub_key_to_key_ring(gpg_pub_key)
        self.delete_contact_request_by_gpg_pubkey(gpg_pub_key)
        self.update_received_requests_treeview()

        success_msg = 'Contact Response was received by peer.'
        self.requests_controller.launch_user_alert(success_msg)
    def execute(self, payload):
        if not self.is_nonce_valid(payload):
            # TODO: Should we also alert user with popup?
            log.warning(
                "Invalid contact request response nonce from remote peer.")
            return False

        gpg_pub_key = self.get_gpg_pubkey_from_payload(payload)
        validator = self.validate_pubkey(gpg_pub_key)
        if not validator.valid:
            # TODO: Should we also alert user with popup?
            log.warning(
                "Invalid contact request response pub_key from remote peer.")
            return False
        else:
            payload['fingerprint'] = validator.key_dict['fingerprint']
            self.database_facade.insert_pending_contact_response(payload)
            self.requests_controller.update_sent_requests_treeview()

            success_msg = 'Contact Request was received by peer.'
            self.requests_controller.launch_user_alert(success_msg)
예제 #3
0
 def launch_alert_log(self, msg):
     log.warning(msg)
     popuplauncher.launch_alert_box_popup(self.root, msg)