diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-04 16:17:47 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-04 16:17:47 +0100 |
commit | 1619968a033dcbaa1c94d735d53c3ca0bfd3a469 (patch) | |
tree | f16f090950db9b4079f5deb539d5e99a1469dfef /tests | |
parent | 52ce83993d16edf7ddacede5968ef5c32459479c (diff) | |
parent | 4db563850535bf3c4b212bd1804bf1ab4cd01b64 (diff) | |
download | nextcloud-server-1619968a033dcbaa1c94d735d53c3ca0bfd3a469.tar.gz nextcloud-server-1619968a033dcbaa1c94d735d53c3ca0bfd3a469.zip |
Merge pull request #22111 from owncloud/use-intermediate-certificate
Use intermediate root authority + sign other release channels
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/command/integrity/SignCoreTest.php | 19 | ||||
-rw-r--r-- | tests/lib/integritycheck/checkertest.php | 12 |
2 files changed, 21 insertions, 10 deletions
diff --git a/tests/lib/command/integrity/SignCoreTest.php b/tests/lib/command/integrity/SignCoreTest.php index 885c6fc664e..ff1f6b23a95 100644 --- a/tests/lib/command/integrity/SignCoreTest.php +++ b/tests/lib/command/integrity/SignCoreTest.php @@ -63,7 +63,7 @@ class SignCoreTest extends TestCase { $outputInterface ->expects($this->at(0)) ->method('writeln') - ->with('--privateKey and --certificate are required.'); + ->with('--privateKey, --certificate and --path are required.'); $this->invokePrivate($this->signCore, 'execute', [$inputInterface, $outputInterface]); } @@ -86,7 +86,7 @@ class SignCoreTest extends TestCase { $outputInterface ->expects($this->at(0)) ->method('writeln') - ->with('--privateKey and --certificate are required.'); + ->with('--privateKey, --certificate and --path are required.'); $this->invokePrivate($this->signCore, 'execute', [$inputInterface, $outputInterface]); } @@ -105,6 +105,11 @@ class SignCoreTest extends TestCase { ->method('getOption') ->with('certificate') ->will($this->returnValue('certificate')); + $inputInterface + ->expects($this->at(2)) + ->method('getOption') + ->with('path') + ->will($this->returnValue('certificate')); $this->fileAccessHelper ->expects($this->at(0)) @@ -134,6 +139,11 @@ class SignCoreTest extends TestCase { ->method('getOption') ->with('certificate') ->will($this->returnValue('certificate')); + $inputInterface + ->expects($this->at(2)) + ->method('getOption') + ->with('path') + ->will($this->returnValue('certificate')); $this->fileAccessHelper ->expects($this->at(0)) @@ -168,6 +178,11 @@ class SignCoreTest extends TestCase { ->method('getOption') ->with('certificate') ->will($this->returnValue('certificate')); + $inputInterface + ->expects($this->at(2)) + ->method('getOption') + ->with('path') + ->will($this->returnValue('certificate')); $this->fileAccessHelper ->expects($this->at(0)) diff --git a/tests/lib/integritycheck/checkertest.php b/tests/lib/integritycheck/checkertest.php index dec3ea84a64..fac60b0c123 100644 --- a/tests/lib/integritycheck/checkertest.php +++ b/tests/lib/integritycheck/checkertest.php @@ -465,7 +465,7 @@ class CheckerTest extends TestCase { $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); $x509->loadX509($keyBundle); - $this->checker->writeCoreSignature($x509, $rsa); + $this->checker->writeCoreSignature($x509, $rsa, \OC::$SERVERROOT . '/tests/data/integritycheck/app/'); } public function testWriteCoreSignatureWithUnmodifiedHtaccess() { @@ -495,7 +495,7 @@ class CheckerTest extends TestCase { $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); $x509->loadX509($keyBundle); - $this->checker->writeCoreSignature($x509, $rsa); + $this->checker->writeCoreSignature($x509, $rsa, \OC::$SERVERROOT . '/tests/data/integritycheck/htaccessUnmodified/'); } public function testWriteCoreSignatureWithInvalidModifiedHtaccess() { @@ -506,10 +506,6 @@ class CheckerTest extends TestCase { "signature": "qpDddYGgAKNR3TszOgjPXRphUl2P9Ym5OQaetltocgZASGDkOun5D64+1D0QJRKb4SG2+48muxGOHyL2Ngos4NUrrSR+SIkywZacay82YQBCEdr7\/4MjW1WHRPjvboLwEJwViw0EdAjsWRpD68aPnzUGrGsy2BsCo06P5iwjk9cXcHxdjC9R39npvoC3QNvQ2jmNIbh1Lc4U97dbb+CsXEQCLU1OSa9p3q6cEFV98Easwt7uF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5kQG8hYST0MDK6VihJoPpvCmAm4E\r\npEYKQ96x6A4EH9Y9mZlYozH\/eqmxPbTK8n89\/p7Ydun4rI+B2iiLnY8REWWy6+UQ\r\nV204fGUkJqW5CrKy3P3XvY9X\r\n-----END CERTIFICATE-----" }'; - $this->environmentHelper - ->expects($this->any()) - ->method('getServerRoot') - ->will($this->returnValue(\OC::$SERVERROOT . '/tests/data/integritycheck/htaccessWithInvalidModifiedContent/')); $this->fileAccessHelper ->expects($this->once()) ->method('file_put_contents') @@ -524,7 +520,7 @@ class CheckerTest extends TestCase { $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); $x509->loadX509($keyBundle); - $this->checker->writeCoreSignature($x509, $rsa); + $this->checker->writeCoreSignature($x509, $rsa, \OC::$SERVERROOT . '/tests/data/integritycheck/htaccessWithInvalidModifiedContent/'); } public function testWriteCoreSignatureWithValidModifiedHtaccess() { @@ -554,7 +550,7 @@ class CheckerTest extends TestCase { $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); $x509->loadX509($keyBundle); - $this->checker->writeCoreSignature($x509, $rsa); + $this->checker->writeCoreSignature($x509, $rsa, \OC::$SERVERROOT . '/tests/data/integritycheck/htaccessWithValidModifiedContent'); } public function testVerifyCoreSignatureWithoutSignatureData() { |