__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
namespace Tuf\Metadata\Verifier;
use Tuf\Exception\Attack\RollbackAttackException;
use Tuf\Metadata\FileInfoMetadataBase;
/**
* Verifier for metadata classes that have information about other files.
*/
abstract class FileInfoVerifier extends VerifierBase
{
/**
* Checks for rollback of files referenced in $untrustedMetadata.
*
* @param \Tuf\Metadata\FileInfoMetadataBase $untrustedMetadata
* The untrusted metadata.
*
* @throws \Tuf\Exception\Attack\RollbackAttackException
*/
protected function checkFileInfoVersions(FileInfoMetadataBase $untrustedMetadata): void
{
// Check that all files in the trusted/local metadata info under the 'meta' section are less or equal to
// the same files in the new metadata info.
// For 'snapshot' type this is § 5.5.5.
// For 'timestamp' type this is § 5.4.3.?.
$localMetaFileInfos = $this->trustedMetadata->getSigned()['meta'];
$type = $this->trustedMetadata->getType();
foreach ($localMetaFileInfos as $fileName => $localFileInfo) {
/** @var \Tuf\Metadata\SnapshotMetadata|\Tuf\Metadata\TimestampMetadata $untrustedMetadata */
if ($remoteFileInfo = $untrustedMetadata->getFileMetaInfo($fileName, true)) {
if ($remoteFileInfo['version'] < $localFileInfo['version']) {
$message = "Remote $type metadata file '$fileName' version \"{$remoteFileInfo['version']}\" " .
"is less than previously seen version \"{$localFileInfo['version']}\"";
throw new RollbackAttackException($message);
}
}
}
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| FileInfoVerifier.php | File | 1.65 KB | 0664 |
|
| RootVerifier.php | File | 1.94 KB | 0664 |
|
| SnapshotVerifier.php | File | 2.87 KB | 0664 |
|
| TargetsVerifier.php | File | 1.52 KB | 0664 |
|
| TimestampVerifier.php | File | 1.06 KB | 0664 |
|
| TrustedAuthorityTrait.php | File | 2.68 KB | 0664 |
|
| UniversalVerifier.php | File | 2.31 KB | 0664 |
|
| VerifierBase.php | File | 3.23 KB | 0664 |
|