diff options
-rw-r--r-- | core/Controller/TwoFactorChallengeController.php | 1 | ||||
-rw-r--r-- | core/js/update.js | 2 | ||||
-rw-r--r-- | lib/private/Security/CertificateManager.php | 20 | ||||
-rw-r--r-- | lib/private/Server.php | 4 | ||||
-rw-r--r-- | tests/Core/Controller/TwoFactorChallengeControllerTest.php | 1 | ||||
-rw-r--r-- | tests/lib/Security/CertificateManagerTest.php | 7 | ||||
-rw-r--r-- | version.php | 4 |
7 files changed, 28 insertions, 11 deletions
diff --git a/core/Controller/TwoFactorChallengeController.php b/core/Controller/TwoFactorChallengeController.php index b2614138123..34f0092bea8 100644 --- a/core/Controller/TwoFactorChallengeController.php +++ b/core/Controller/TwoFactorChallengeController.php @@ -128,6 +128,7 @@ class TwoFactorChallengeController extends Controller { 'provider' => $provider, 'backupProvider' => $backupProvider, 'logout_attribute' => $this->getLogoutAttribute(), + 'redirect_url' => $redirect_url, 'template' => $tmpl->fetchPage(), ]; return new TemplateResponse($this->appName, 'twofactorshowchallenge', $data, 'guest'); diff --git a/core/js/update.js b/core/js/update.js index 32cf2ce5ecc..e849d8a16ce 100644 --- a/core/js/update.js +++ b/core/js/update.js @@ -72,7 +72,7 @@ var span = $('<span>') .addClass('bold'); if(message === 'Exception: Updates between multiple major versions and downgrades are unsupported.') { - span.append(t('core', 'The update was unsuccessful. For more information <a href="{url}">check our forum post</a> covering this issue.', {'url': 'https://forum.owncloud.org/viewtopic.php?f=17&t=32087'})); + span.append(t('core', 'The update was unsuccessful. For more information <a href="{url}">check our forum post</a> covering this issue.', {'url': 'https://help.nextcloud.com/t/updates-between-multiple-major-versions-are-unsupported/7094'})); } else { span.append(t('core', 'The update was unsuccessful. ' + 'Please report this issue to the ' + diff --git a/lib/private/Security/CertificateManager.php b/lib/private/Security/CertificateManager.php index f7bf0df58c5..461ef9457a7 100644 --- a/lib/private/Security/CertificateManager.php +++ b/lib/private/Security/CertificateManager.php @@ -30,6 +30,7 @@ namespace OC\Security; use OC\Files\Filesystem; use OCP\ICertificateManager; use OCP\IConfig; +use OCP\ILogger; /** * Manage trusted certificates for users @@ -51,14 +52,21 @@ class CertificateManager implements ICertificateManager { protected $config; /** + * @var ILogger + */ + protected $logger; + + /** * @param string $uid * @param \OC\Files\View $view relative to data/ * @param IConfig $config + * @param ILogger $logger */ - public function __construct($uid, \OC\Files\View $view, IConfig $config) { + public function __construct($uid, \OC\Files\View $view, IConfig $config, ILogger $logger) { $this->uid = $uid; $this->view = $view; $this->config = $config; + $this->logger = $logger; } /** @@ -104,6 +112,13 @@ class CertificateManager implements ICertificateManager { $this->view->mkdir($path); } + $defaultCertificates = file_get_contents(\OC::$SERVERROOT . '/resources/config/ca-bundle.crt'); + if (strlen($defaultCertificates) < 1024) { // sanity check to verify that we have some content for our bundle + // log as exception so we have a stacktrace + $this->logger->logException(new \Exception('Shipped ca-bundle is empty, refusing to create certificate bundle')); + return; + } + $fhCerts = $this->view->fopen($path . '/rootcerts.crt', 'w'); // Write user certificates @@ -117,7 +132,6 @@ class CertificateManager implements ICertificateManager { } // Append the default certificates - $defaultCertificates = file_get_contents(\OC::$SERVERROOT . '/resources/config/ca-bundle.crt'); fwrite($fhCerts, $defaultCertificates); // Append the system certificate bundle @@ -203,7 +217,7 @@ class CertificateManager implements ICertificateManager { } if ($this->needsRebundling($uid)) { if (is_null($uid)) { - $manager = new CertificateManager(null, $this->view, $this->config); + $manager = new CertificateManager(null, $this->view, $this->config, $this->logger); $manager->createCertificateBundle(); } else { $this->createCertificateBundle(); diff --git a/lib/private/Server.php b/lib/private/Server.php index 2c0aac9b43c..1d9a9f4d721 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -485,7 +485,7 @@ class Server extends ServerContainer implements IServerContainer { $uid = $user ? $user : null; return new ClientService( $c->getConfig(), - new \OC\Security\CertificateManager($uid, new View(), $c->getConfig()) + new \OC\Security\CertificateManager($uid, new View(), $c->getConfig(), $c->getLogger()) ); }); $this->registerService('EventLogger', function (Server $c) { @@ -1233,7 +1233,7 @@ class Server extends ServerContainer implements IServerContainer { } $userId = $user->getUID(); } - return new CertificateManager($userId, new View(), $this->getConfig()); + return new CertificateManager($userId, new View(), $this->getConfig(), $this->getLogger()); } /** diff --git a/tests/Core/Controller/TwoFactorChallengeControllerTest.php b/tests/Core/Controller/TwoFactorChallengeControllerTest.php index 8a1cfb9edf1..9421a2537e8 100644 --- a/tests/Core/Controller/TwoFactorChallengeControllerTest.php +++ b/tests/Core/Controller/TwoFactorChallengeControllerTest.php @@ -143,6 +143,7 @@ class TwoFactorChallengeControllerTest extends TestCase { 'backupProvider' => $backupProvider, 'logout_attribute' => 'logoutAttribute', 'template' => '<html/>', + 'redirect_url' => '/re/dir/ect/url', ], 'guest'); $this->assertEquals($expected, $this->controller->showChallenge('myprovider', '/re/dir/ect/url')); diff --git a/tests/lib/Security/CertificateManagerTest.php b/tests/lib/Security/CertificateManagerTest.php index 92a063d47c7..408e65c6766 100644 --- a/tests/lib/Security/CertificateManagerTest.php +++ b/tests/lib/Security/CertificateManagerTest.php @@ -8,8 +8,10 @@ namespace Test\Security; +use OC\Files\Storage\Temporary; use \OC\Security\CertificateManager; use OCP\IConfig; +use OCP\ILogger; /** * Class CertificateManagerTest @@ -43,7 +45,7 @@ class CertificateManagerTest extends \Test\TestCase { $config->expects($this->any())->method('getSystemValue') ->with('installed', false)->willReturn(true); - $this->certificateManager = new CertificateManager($this->username, new \OC\Files\View(), $config); + $this->certificateManager = new CertificateManager($this->username, new \OC\Files\View(), $config, $this->createMock(ILogger::class)); } protected function tearDown() { @@ -143,7 +145,7 @@ class CertificateManagerTest extends \Test\TestCase { /** @var CertificateManager | \PHPUnit_Framework_MockObject_MockObject $certificateManager */ $certificateManager = $this->getMockBuilder('OC\Security\CertificateManager') - ->setConstructorArgs([$uid, $view, $config]) + ->setConstructorArgs([$uid, $view, $config, $this->createMock(ILogger::class)]) ->setMethods(['getFilemtimeOfCaBundle', 'getCertificateBundle']) ->getMock(); @@ -210,5 +212,4 @@ class CertificateManagerTest extends \Test\TestCase { [null, 10, 5, 8, false, true], ]; } - } diff --git a/version.php b/version.php index 257fe0316cb..aec911688cb 100644 --- a/version.php +++ b/version.php @@ -26,10 +26,10 @@ // between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel // when updating major/minor version number. -$OC_Version = array(11, 0, 1, 0); +$OC_Version = array(11, 0, 1, 1); // The human readable string -$OC_VersionString = '11.0.1'; +$OC_VersionString = '11.0.1 RC1'; $OC_VersionCanBeUpgradedFrom = array(9, 1); |