Skip to content

Commit 343f8f8

Browse files
committed
Remove X5C EOL (#353)
* Update KeyConverter.php * Tests updated * ECS+RECTOR * Exported files
1 parent 62679f7 commit 343f8f8

File tree

12 files changed

+66
-47
lines changed

12 files changed

+66
-47
lines changed

.gitattributes

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
* text=auto
22

3+
/.github export-ignore
4+
/packs export-ignore
35
/performance export-ignore
6+
/tests export-ignore
7+
/.editorconfig export-ignore
48
/.gitattributes export-ignore
59
/.gitignore export-ignore
6-
/.scrutinizer.yml export-ignore
7-
/.travis.yml export-ignore
10+
/.gitsplit.yml export-ignore
11+
/CODE_OF_CONDUCT.md export-ignore
12+
/ecs.php export-ignore
13+
/infection.json export-ignore
14+
/Makefile export-ignore
815
/phpbench.json export-ignore
16+
/phpstan.neon export-ignore
917
/phpunit.xml.dist export-ignore
10-
/README.md export-ignore
18+
/rector.php export-ignore

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
.phpbench
22
.phpunit.result.cache
3-
.travis/phar-private.pem
43
jose.phar
54
jose.phar.pubkey
65
jose.phar.version
7-
.travis/build-key.pem
8-
.travis/secrets.tar
96
report.md
107
composer.lock
118
.php_cs
129
.php_cs.cache
1310
vendor/
1411
src/Bundle/JoseFramework/var/
12+
infection.txt

.gitsplit.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,4 @@ splits:
5353
target: "https://${GH_TOKEN}@github.com/web-token/signature-pack.git"
5454

5555
origins:
56-
- ^master$
57-
- ^v\d+\.\d+$
58-
- ^v\d+\.\d+\.\d+.*$
56+
- ^\d+\.\d+\.\d+.*$

SECURITY.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
| Version | Supported |
6+
|---------|--------------------|
7+
| 4.0.x | :white_check_mark: |
8+
| 3.1.x | :white_check_mark: |
9+
| 3.0.x | :white_check_mark: |
10+
| < 3.0.0 | :x: |
11+
12+
## Reporting a Vulnerability
13+
14+
If you think you have found a security issue, DO NOT open an issue. You MUST email your issue: security AT
15+
spomky-labs.com.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"phpstan/phpstan-deprecation-rules": "^1.0",
8989
"phpstan/phpstan-phpunit": "^1.0",
9090
"phpstan/phpstan-strict-rules": "^1.0",
91-
"phpunit/phpunit": "^8.0|^9.0",
91+
"phpunit/phpunit": "^9.5.5",
9292
"rector/rector": "^0.14",
9393
"roave/security-advisories": "dev-latest",
9494
"symfony/browser-kit": "^5.4|^6.0",

phpstan.neon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ parameters:
1717
- '#Parameter \#2 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null\, mixed given\.#'
1818
- '#Parameter \#1 \.\.\.\$arrays of function array_merge expects array\, mixed given\.#'
1919
- '#Cannot cast mixed to int\.#'
20-
includes:
21-
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
20+
- '#Parameter .* of (static )?method .* expects Jose\\Component\\Core\\JWK, mixed given\.#'
21+
- '#Cannot call method (get|has)\(\) on mixed\.#'

src/Component/KeyManagement/KeyConverter/KeyConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public static function loadKeyFromX509Resource(OpenSSLCertificate $res): array
7777
$values = self::loadKeyFromPEM($details['key']);
7878
openssl_x509_export($res, $out);
7979
$x5c = preg_replace('#-.*-#', '', $out);
80-
$x5c = preg_replace('~\R~', PHP_EOL, $x5c);
80+
$x5c = preg_replace('~\R~', '', $x5c);
8181
if (! is_string($x5c)) {
8282
throw new InvalidArgumentException('Unable to load the certificate');
8383
}

src/Ecc/Curve.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,13 @@ public function mul(Point $one, BigInteger $n): Point
168168

169169
public function cmp(self $other): int
170170
{
171-
$equal = $this->getA()
172-
->isEqualTo($other->getA())
173-
&& $this->getB()
174-
->isEqualTo($other->getB())
175-
&& $this->getPrime()
176-
->isEqualTo($other->getPrime());
171+
$equalsA = $this->getA()
172+
->isEqualTo($other->getA());
173+
$equalsB = $this->getB()
174+
->isEqualTo($other->getB());
175+
$equalsPrime = $this->getPrime()
176+
->isEqualTo($other->getPrime());
177+
$equal = $equalsA && $equalsB && $equalsPrime;
177178

178179
return $equal ? 0 : 1;
179180
}

tests/Bundle/JoseFramework/config/config_test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
framework:
22
test: ~
33
secret: 'test'
4-
session: ~
4+
session:
5+
handler_id: null
6+
storage_factory_id: 'session.storage.factory.mock_file'
57
router:
68
resource: "%kernel.project_dir%/tests/Bundle/JoseFramework/config/routing.yml"
79
strict_requirements: ~

tests/Component/KeyManagement/CertificateTest.php

Lines changed: 18 additions & 19 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)