mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-31 10:18:55 +00:00
Add check for openssl_pseudo_bytes IV generation
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
2018-01-16 DariusIII
|
||||
* Chg: Add check for openssl_pseudo_bytes IV generation
|
||||
* Fix: Fix getCBPTableNames function calls
|
||||
* Fix: Fix call to Releases
|
||||
* Chg: Use Group model and remove nntmux\Groups class
|
||||
|
||||
+8
-2
@@ -399,7 +399,7 @@ class Binaries
|
||||
// We will use this to subtract so we leave articles for the next time (in case the server doesn't have them yet)
|
||||
$leaveOver = $this->messageBuffer;
|
||||
|
||||
// If this is not a new group, go from our newest to the servers newest.
|
||||
// If this is not a new group, go from our newest to the servers newest.
|
||||
} else {
|
||||
// Set our oldest wanted to our newest local article.
|
||||
$first = $groupMySQL['last_record'];
|
||||
@@ -890,6 +890,12 @@ class Binaries
|
||||
$date = $this->header['Date'] > $now ? $now : $this->header['Date'];
|
||||
$unixtime = is_numeric($this->header['Date']) ? $date : $now;
|
||||
|
||||
$random = openssl_random_pseudo_bytes(16, $isSourceStrong);
|
||||
|
||||
if ($isSourceStrong === false || $random === false) {
|
||||
throw new \RuntimeException('IV generation failed');
|
||||
}
|
||||
|
||||
$collectionID = $this->_pdo->queryInsert(
|
||||
sprintf(
|
||||
"
|
||||
@@ -907,7 +913,7 @@ class Binaries
|
||||
sha1($this->header['CollectionKey']),
|
||||
$collMatch['id'],
|
||||
$xref,
|
||||
bin2hex(openssl_random_pseudo_bytes(16))
|
||||
bin2hex($random)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user