/**
  * Find out which version upgrade should be handled. This may
  * be different depending on whether development or regular release.
  *
  * @throws \TYPO3\CMS\Install\Controller\Exception
  * @return string Version to handle, eg. 6.2.2
  */
 protected function getVersionToHandle()
 {
     $getVars = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('install');
     if (!isset($getVars['type'])) {
         throw new \TYPO3\CMS\Install\Controller\Exception('Type must be set to either "regular" or "development"', 1380975303);
     }
     $type = $getVars['type'];
     if ($type === 'development') {
         $versionToHandle = $this->coreVersionService->getYoungestPatchDevelopmentRelease();
     } else {
         $versionToHandle = $this->coreVersionService->getYoungestPatchRelease();
     }
     return $versionToHandle;
 }
示例#2
0
 /**
  * Verify checksum of downloaded version
  *
  * @param string $version A downloaded version to check
  * @return boolean TRUE on success
  */
 public function verifyFileChecksum($version)
 {
     $fileLocation = $this->getDownloadTarGzTargetPath($version);
     $expectedChecksum = $this->coreVersionService->getTarGzSha1OfVersion($version);
     $messages = array();
     $success = TRUE;
     if (!file_exists($fileLocation)) {
         $success = FALSE;
         /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
         $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
         $message->setTitle('Downloaded core not found');
         $messages[] = $message;
     } else {
         $actualChecksum = sha1_file($fileLocation);
         if ($actualChecksum !== $expectedChecksum) {
             $success = FALSE;
             /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
             $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
             $message->setTitle('New core checksum mismatch');
             $message->setMessage('The official TYPO3 CMS version system on https://get.typo3.org expects a sha1 checksum of ' . $expectedChecksum . ' from the content of the downloaded new core version ' . $version . '.' . ' The actual checksum is ' . $actualChecksum . '. The update is stopped. This may be a' . ' failed download, an attack, or an issue with the typo3.org infrastructure.');
             $messages[] = $message;
         }
     }
     $this->messages = $messages;
     return $success;
 }
示例#3
0
 /**
  * Verify checksum of downloaded version
  *
  * @param string $version A downloaded version to check
  * @return bool TRUE on success
  */
 public function verifyFileChecksum($version)
 {
     $messages = array();
     $success = true;
     if ($this->checkCoreFilesAvailable($version)) {
         /** @var $message StatusInterface */
         $message = $this->objectManager->get(WarningStatus::class);
         $message->setTitle('Verifying existing TYPO3 CMS core checksum is not possible');
         $messages[] = $message;
     } else {
         $fileLocation = $this->getDownloadTarGzTargetPath($version);
         $expectedChecksum = $this->coreVersionService->getTarGzSha1OfVersion($version);
         if (!file_exists($fileLocation)) {
             $success = false;
             /** @var $message StatusInterface */
             $message = $this->objectManager->get(ErrorStatus::class);
             $message->setTitle('Downloaded TYPO3 CMS core not found');
             $messages[] = $message;
         } else {
             $actualChecksum = sha1_file($fileLocation);
             if ($actualChecksum !== $expectedChecksum) {
                 $success = false;
                 /** @var $message StatusInterface */
                 $message = $this->objectManager->get(ErrorStatus::class);
                 $message->setTitle('New TYPO3 CMS core checksum mismatch');
                 $message->setMessage('The official TYPO3 CMS version system on https://get.typo3.org expects a sha1 checksum of ' . $expectedChecksum . ' from the content of the downloaded new TYPO3 CMS core version ' . $version . '.' . ' The actual checksum is ' . $actualChecksum . '. The update is stopped. This may be a' . ' failed download, an attack, or an issue with the typo3.org infrastructure.');
                 $messages[] = $message;
             } else {
                 $message = $this->objectManager->get(OkStatus::class);
                 $message->setTitle('Checksum verified');
                 $messages[] = $message;
             }
         }
     }
     $this->messages = $messages;
     return $success;
 }