Lines Matching refs:this

9  * file that was distributed with this source code.
60 $this->factory = new DigestMD5MessageFactory();
61 $this->encoder = new DigestMD5Encoder();
62 $this->context = new SaslContext();
63 $this->context->setIsServerMode($isServerMode);
73 $received = $received === null ? null : $this->encoder->decode($received, $this->context);
74 if ($this->context->isServerMode()) {
75 $response = $this->generateServerResponse($received, $options);
77 $response = $this->generateClientResponse($received, $options);
79 $this->context->setResponse($response);
81 return $this->context;
92 if ($this->isClientChallengeNeeded($message)) {
93 return $this->createClientResponse($message, $options);
96 if ($message->has('rspauth') && $this->context->get('verification') === null) {
99 if ($message->has('rspauth') && $message->get('rspauth') === $this->context->get('verification')) {
100 $this->context->setIsAuthenticated(true);
101 $this->context->setHasSecurityLayer($options['use_integrity'] || $options['use_privacy']);
103 if ($this->context->hasSecurityLayer()) {
104 $this->context->set('seqnumsnt', 0);
105 $this->context->set('seqnumrcv', 0);
107 $this->context->setIsComplete($message->has('rspauth'));
115 $response = $this->generateServerChallenge($options);
117 $response = $this->generateServerVerification($received, $options);
120 return $response === null ? null : $this->encoder->encode($response, $this->context);
125 if ($this->context->isServerMode()) {
140 $this->context->set('qop', 'auth-conf');
142 $this->context->set('qop', 'auth-int');
144 $this->context->set('qop', 'auth');
150 'qop' => $this->context->get('qop'),
163 $response = $this->factory->create(
170 $this->context->isServerMode()
174 $this->context->set(
180 !$this->context->isServerMode()
186 $this->context->set('a1', hex2bin(DigestMD5Mechanism::computeA1($password, $message, $response)));
187 $this->context->set('cipher', $response->get('cipher'));
190 return $this->encoder->encode($response, $this->context);
195 $this->context->setIsComplete(true);
197 if ($this->challenge === null) {
210 if (!in_array($qop, $this->challenge->get('qop'), true)) {
214 if (!in_array($cipher, $this->challenge->get('cipher'), true)) {
222 if ($received->get('nonce') !== $this->challenge->get('nonce')) {
228 $expected = DigestMD5Mechanism::computeResponse($password, $this->challenge, $received);
233 $response = DigestMD5Mechanism::computeResponse($password, $this->challenge, $received, true);
234 $this->context->setIsAuthenticated(true);
236 $this->context->setHasSecurityLayer(true);
237 $this->context->set('a1', hex2bin(DigestMD5Mechanism::computeA1($password, $this->challenge, $received)));
238 $this->context->set('cipher', $received->get('cipher'));
239 $this->context->set('seqnumsnt', 0);
240 $this->context->set('seqnumrcv', 0);
243 return $this->factory->create(
258 $this->challenge = $this->factory->create(
262 return $this->challenge;