Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
bug #904 NTLMAuthenticator - avoid clobbering bcmath scale #903 (laur…
…inomme-helmes)

This PR was merged into the 5.x branch.

Discussion
----------

NTLMAuthenticator - avoid clobbering bcmath scale #903

Commits
-------

9738418 NTLMAuthenticator - avoid clobbering bcmath scale #903
  • Loading branch information
fabpot committed Apr 20, 2017
2 parents 7f075aa + 9738418 commit fca6ebc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/classes/Swift/Transport/Esmtp/Auth/NTLMAuthenticator.php
Expand Up @@ -366,11 +366,9 @@ protected function createNTLMPassword($password, $challenge)
protected function getCorrectTimestamp($time)
{
// Get our timestamp (tricky!)
bcscale(0);

$time = number_format($time, 0, '.', ''); // save microtime to string
$time = bcadd($time, '11644473600000'); // add epoch time
$time = bcmul($time, 10000); // tenths of a microsecond.
$time = bcadd($time, '11644473600000', 0); // add epoch time
$time = bcmul($time, 10000, 0); // tenths of a microsecond.

$binary = $this->si2bin($time, 64); // create 64 bit binary string
$timestamp = '';
Expand Down

0 comments on commit fca6ebc

Please sign in to comment.