Skip to content

Commit

Permalink
Eliminate race conditions; verify hashes to prevent TOCTOU
Browse files Browse the repository at this point in the history
  • Loading branch information
paragonie-scott committed Nov 2, 2015
1 parent 176e4c7 commit e8c3e3b
Show file tree
Hide file tree
Showing 9 changed files with 647 additions and 169 deletions.
7 changes: 7 additions & 0 deletions src/Alerts/FileModified.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
namespace ParagonIE\Halite\Alerts;

class FileModified extends HaliteAlert
{

}
7 changes: 7 additions & 0 deletions src/Alerts/InvalidType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
namespace ParagonIE\Halite\Alerts;

class InvalidType extends HaliteAlert
{

}
26 changes: 26 additions & 0 deletions src/Contract/StreamInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
namespace ParagonIE\Halite\Contract;

/**
*
*/
interface StreamInterface
{
/**
* Read from a stream; prevent partial reads
*
* @param int $num
* @return string
* @throws FileAlert\AccessDenied
*/
public function readBytes($num);

/**
* Write to a stream; prevent partial writes
*
* @param string $buf
* @param int $num (number of bytes)
* @throws FileAlert\AccessDenied
*/
public function writeBytes($buf, $num = null);
}
Loading

0 comments on commit e8c3e3b

Please sign in to comment.