Lines Matching defs:message

123                 'The received message type of "%s" was unexpected.',
148 throw new SaslException('Failed the decrypt the message.');
150 $message = substr($data, 0, -10);
152 $message = $this->removePadding($message, self::CIPHERS[$cipher]['block_size']);
158 $expectedMac = substr($this->generateMACBlock($ki, $message, $seqnum), 0, 10);
164 return $message;
201 protected function removePadding(string $message, int $blockSize): string
203 $padOrd = isset($message[-1]) ? ord($message[-1]) : 0;
204 $padRaw = $message[-1] ?? '';
211 $msgLength = strlen($message);
213 if ($message[$i] !== $padRaw) {
218 return substr($message, 0, strlen($message) - $padOrd);
235 * Append a signed MAC to the message.
237 protected function sign(string $message, SaslContext $context): string
242 $macBlock = $this->generateMACBlock($ki, $message, $seqnum);
244 return $message . $macBlock;
248 * Verify a signed message. Return the unsigned message without the MAC.
260 $message = substr($data, 0, -16);
264 $expectedMac = $this->generateMACBlock($ki, $message, $seqnum);
270 return $message;
277 * number of padding bytes, such that total length of the encrypted part of the message is a multiple of the
293 * The MAC block is 16 bytes: the first 10 bytes of the HMAC-MD5 [RFC2104] of the message, a 2-byte message type
294 * number in network byte order with value 1, and the 4-byte sequence number in network byte order. The message type
299 protected function generateMACBlock(string $key, string $message, int $seqNum): string
303 $macBlock = substr(hash_hmac('md5', $seqNum . $message, $key, true), 0, 10);
304 /** a 2-byte message type number in network byte order with value 1 */