Skip to content

Commit

Permalink
Wrong copy & paste
Browse files Browse the repository at this point in the history
  • Loading branch information
rugk committed Dec 25, 2015
1 parent 2415fac commit 4f37ac5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/Threema/MsgApi/Tools/CryptTool.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ final public function encryptMessageText($text, $senderPrivateKey, $recipientPub
$textBytes = "\x01" . $text;

/* determine random amount of PKCS7 padding */
$padbytes = mt_rand(1, 255);

/* append padding */
$padbytes = 0;
while($padbytes < 1 || $padbytes > 255) {
$padbytes = ord($this->createRandom(1));
}

/* append padding */
$textBytes .= str_repeat(chr($padbytes), $padbytes);

return $this->makeBox($textBytes, $nonce, $senderPrivateKey, $recipientPublicKey);
}

Expand Down

0 comments on commit 4f37ac5

Please sign in to comment.