public function get_challenge_response_pkt($challenge) { $stanza = new JAXLXml('response', NS_SASL); $decoded = $this->explode_data(base64_decode($challenge)); if (!isset($decoded['rspauth'])) { _debug("calculating response to challenge"); $stanza->t($this->get_challenge_response($decoded)); } return $stanza; }
public function wait_for_scram_sha1_response($event, $args) { switch ($event) { case "stanza_cb": $stanza = $args[0]; if ($stanza->name == 'challenge' && $stanza->ns == NS_SASL) { $challenge = $stanza->text; $resp = new JAXLXml('response', NS_SASL); $resp->t($this->get_scram_sha1_response($this->pass, $challenge)); $this->send($resp); return "wait_for_sasl_response"; } else { _debug("got unhandled sasl response, should never happen here"); exit; } break; default: _debug("not catched {$event}, should never happen here"); exit; break; } }