@@ 175-197 (lines=23) @@ | ||
172 | Verify::verify($this->event); |
|
173 | } |
|
174 | ||
175 | public function testWillRejectPackageSignedWithImportedButUnTrustedKey() : void |
|
176 | { |
|
177 | $personalGpgDirectory = $this->makeGpgHomeDirectory(); |
|
178 | $foreignGpgDirectory = $this->makeGpgHomeDirectory(); |
|
179 | ||
180 | $this->makeKey($personalGpgDirectory, '[email protected]', 'Just Me'); |
|
181 | ||
182 | $vendorName = 'Mr. Magoo'; |
|
183 | $vendorEmail = '[email protected]'; |
|
184 | $vendorKey = $this->makeKey($foreignGpgDirectory, $vendorEmail, $vendorName); |
|
185 | $vendorDir = $this->makeVendorDirectory(); |
|
186 | $vendor1 = $this->makeDependencyGitRepository($vendorDir, 'vendor1/package1', $vendorEmail, $vendorName); |
|
187 | ||
188 | $this->signDependency($vendor1, $foreignGpgDirectory, $vendorKey); |
|
189 | ||
190 | $this->importForeignKeys($personalGpgDirectory, $foreignGpgDirectory, $vendorKey, false); |
|
191 | ||
192 | $this->configureCorrectComposerSetup(); |
|
193 | ||
194 | putenv('GNUPGHOME=' . $personalGpgDirectory); |
|
195 | ||
196 | $this->assertWillFailPackageVerification(); |
|
197 | } |
|
198 | ||
199 | public function testWillRejectPackageSignedWithImportedButUnTrustedKeyWithDifferentLocaleSettings() : void |
|
200 | { |
|
@@ 233-255 (lines=23) @@ | ||
230 | self::fail('Exception was not thrown'); |
|
231 | } |
|
232 | ||
233 | public function testWillAcceptPackageSignedWithImportedAndTrustedKey() : void |
|
234 | { |
|
235 | $personalGpgDirectory = $this->makeGpgHomeDirectory(); |
|
236 | $foreignGpgDirectory = $this->makeGpgHomeDirectory(); |
|
237 | ||
238 | $this->makeKey($personalGpgDirectory, '[email protected]', 'Just Me'); |
|
239 | ||
240 | $vendorName = 'Mr. Magoo'; |
|
241 | $vendorEmail = '[email protected]'; |
|
242 | $vendorKey = $this->makeKey($foreignGpgDirectory, $vendorEmail, $vendorName); |
|
243 | $vendorDir = $this->makeVendorDirectory(); |
|
244 | $vendor1 = $this->makeDependencyGitRepository($vendorDir, 'vendor1/package1', $vendorEmail, $vendorName); |
|
245 | ||
246 | $this->signDependency($vendor1, $foreignGpgDirectory, $vendorKey); |
|
247 | ||
248 | $this->importForeignKeys($personalGpgDirectory, $foreignGpgDirectory, $vendorKey, true); |
|
249 | ||
250 | $this->configureCorrectComposerSetup(); |
|
251 | ||
252 | putenv('GNUPGHOME=' . $personalGpgDirectory); |
|
253 | ||
254 | Verify::verify($this->event); |
|
255 | } |
|
256 | ||
257 | public function testWillRejectPackageTaggedAndSignedWithImportedButUnTrustedKey() : void |
|
258 | { |
|
@@ 257-279 (lines=23) @@ | ||
254 | Verify::verify($this->event); |
|
255 | } |
|
256 | ||
257 | public function testWillRejectPackageTaggedAndSignedWithImportedButUnTrustedKey() : void |
|
258 | { |
|
259 | $personalGpgDirectory = $this->makeGpgHomeDirectory(); |
|
260 | $foreignGpgDirectory = $this->makeGpgHomeDirectory(); |
|
261 | ||
262 | $this->makeKey($personalGpgDirectory, '[email protected]', 'Just Me'); |
|
263 | ||
264 | $vendorName = 'Mr. Magoo'; |
|
265 | $vendorEmail = '[email protected]'; |
|
266 | $vendorKey = $this->makeKey($foreignGpgDirectory, $vendorEmail, $vendorName); |
|
267 | $vendorDir = $this->makeVendorDirectory(); |
|
268 | $vendor1 = $this->makeDependencyGitRepository($vendorDir, 'vendor1/package1', $vendorEmail, $vendorName); |
|
269 | ||
270 | $this->createDependencySignedTag($vendor1, $foreignGpgDirectory, $vendorKey); |
|
271 | ||
272 | $this->importForeignKeys($personalGpgDirectory, $foreignGpgDirectory, $vendorKey, false); |
|
273 | ||
274 | $this->configureCorrectComposerSetup(); |
|
275 | ||
276 | putenv('GNUPGHOME=' . $personalGpgDirectory); |
|
277 | ||
278 | $this->assertWillFailPackageVerification(); |
|
279 | } |
|
280 | ||
281 | public function testWillAcceptPackageTaggedAndSignedWithImportedAndTrustedKey() : void |
|
282 | { |
|
@@ 281-303 (lines=23) @@ | ||
278 | $this->assertWillFailPackageVerification(); |
|
279 | } |
|
280 | ||
281 | public function testWillAcceptPackageTaggedAndSignedWithImportedAndTrustedKey() : void |
|
282 | { |
|
283 | $personalGpgDirectory = $this->makeGpgHomeDirectory(); |
|
284 | $foreignGpgDirectory = $this->makeGpgHomeDirectory(); |
|
285 | ||
286 | $this->makeKey($personalGpgDirectory, '[email protected]', 'Just Me'); |
|
287 | ||
288 | $vendorName = 'Mr. Magoo'; |
|
289 | $vendorEmail = '[email protected]'; |
|
290 | $vendorKey = $this->makeKey($foreignGpgDirectory, $vendorEmail, $vendorName); |
|
291 | $vendorDir = $this->makeVendorDirectory(); |
|
292 | $vendor1 = $this->makeDependencyGitRepository($vendorDir, 'vendor1/package1', $vendorEmail, $vendorName); |
|
293 | ||
294 | $this->createDependencySignedTag($vendor1, $foreignGpgDirectory, $vendorKey); |
|
295 | ||
296 | $this->importForeignKeys($personalGpgDirectory, $foreignGpgDirectory, $vendorKey, true); |
|
297 | ||
298 | $this->configureCorrectComposerSetup(); |
|
299 | ||
300 | putenv('GNUPGHOME=' . $personalGpgDirectory); |
|
301 | ||
302 | Verify::verify($this->event); |
|
303 | } |
|
304 | ||
305 | public function testWillAcceptSignedAndTrustedTaggedPackages() : void |
|
306 | { |