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