Skip to content

Commit 813157a

Browse files
authored
Merge pull request #784 from nextcloud/stable21-bump-webauthn
[stable21] Bump Webauthn Lib to 3.3.9
2 parents 1a42635 + b124fd8 commit 813157a

20 files changed

Lines changed: 166 additions & 95 deletions

composer.lock

Lines changed: 24 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composer/installed.json

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6019,17 +6019,17 @@
60196019
},
60206020
{
60216021
"name": "web-auth/cose-lib",
6022-
"version": "v3.3.1",
6023-
"version_normalized": "3.3.1.0",
6022+
"version": "v3.3.9",
6023+
"version_normalized": "3.3.9.0",
60246024
"source": {
60256025
"type": "git",
60266026
"url": "https://github.com/web-auth/cose-lib.git",
6027-
"reference": "eea6fae63ff5c81bf98c115b1be5f38a69682c16"
6027+
"reference": "ed172d2dc1a6b87b5c644c07c118cd30c1b3819b"
60286028
},
60296029
"dist": {
60306030
"type": "zip",
6031-
"url": "https://api.github.com/repos/web-auth/cose-lib/zipball/eea6fae63ff5c81bf98c115b1be5f38a69682c16",
6032-
"reference": "eea6fae63ff5c81bf98c115b1be5f38a69682c16",
6031+
"url": "https://api.github.com/repos/web-auth/cose-lib/zipball/ed172d2dc1a6b87b5c644c07c118cd30c1b3819b",
6032+
"reference": "ed172d2dc1a6b87b5c644c07c118cd30c1b3819b",
60336033
"shasum": ""
60346034
},
60356035
"require": {
@@ -6040,7 +6040,7 @@
60406040
"fgrosse/phpasn1": "^2.1",
60416041
"php": ">=7.2"
60426042
},
6043-
"time": "2021-01-09T13:31:01+00:00",
6043+
"time": "2021-05-02T19:57:09+00:00",
60446044
"type": "library",
60456045
"installation-source": "dist",
60466046
"autoload": {
@@ -6069,7 +6069,7 @@
60696069
"RFC8152"
60706070
],
60716071
"support": {
6072-
"source": "https://github.com/web-auth/cose-lib/tree/v3.3.1"
6072+
"source": "https://github.com/web-auth/cose-lib/tree/v3.3.9"
60736073
},
60746074
"funding": [
60756075
{
@@ -6085,8 +6085,8 @@
60856085
},
60866086
{
60876087
"name": "web-auth/metadata-service",
6088-
"version": "v3.3.1",
6089-
"version_normalized": "3.3.1.0",
6088+
"version": "v3.3.9",
6089+
"version_normalized": "3.3.9.0",
60906090
"source": {
60916091
"type": "git",
60926092
"url": "https://github.com/web-auth/webauthn-metadata-service.git",
@@ -6141,23 +6141,33 @@
61416141
"webauthn"
61426142
],
61436143
"support": {
6144-
"source": "https://github.com/web-auth/webauthn-metadata-service/tree/v3.3.1"
6144+
"source": "https://github.com/web-auth/webauthn-metadata-service/tree/v3.3.9"
61456145
},
6146+
"funding": [
6147+
{
6148+
"url": "https://github.com/Spomky",
6149+
"type": "github"
6150+
},
6151+
{
6152+
"url": "https://www.patreon.com/FlorentMorselli",
6153+
"type": "patreon"
6154+
}
6155+
],
61466156
"install-path": "../web-auth/metadata-service"
61476157
},
61486158
{
61496159
"name": "web-auth/webauthn-lib",
6150-
"version": "v3.3.1",
6151-
"version_normalized": "3.3.1.0",
6160+
"version": "v3.3.9",
6161+
"version_normalized": "3.3.9.0",
61526162
"source": {
61536163
"type": "git",
61546164
"url": "https://github.com/web-auth/webauthn-lib.git",
6155-
"reference": "e411527a41c1013512fccdfce61681eb36484c77"
6165+
"reference": "04b98ee3d39cb79dad68a7c15c297c085bf66bfe"
61566166
},
61576167
"dist": {
61586168
"type": "zip",
6159-
"url": "https://api.github.com/repos/web-auth/webauthn-lib/zipball/e411527a41c1013512fccdfce61681eb36484c77",
6160-
"reference": "e411527a41c1013512fccdfce61681eb36484c77",
6169+
"url": "https://api.github.com/repos/web-auth/webauthn-lib/zipball/04b98ee3d39cb79dad68a7c15c297c085bf66bfe",
6170+
"reference": "04b98ee3d39cb79dad68a7c15c297c085bf66bfe",
61616171
"shasum": ""
61626172
},
61636173
"require": {
@@ -6186,7 +6196,7 @@
61866196
"web-token/jwt-signature-algorithm-eddsa": "Recommended for the AndroidSafetyNet Attestation Statement support",
61876197
"web-token/jwt-signature-algorithm-rsa": "Mandatory for the AndroidSafetyNet Attestation Statement support"
61886198
},
6189-
"time": "2021-01-09T13:31:01+00:00",
6199+
"time": "2021-04-19T20:22:20+00:00",
61906200
"type": "library",
61916201
"installation-source": "dist",
61926202
"autoload": {
@@ -6216,7 +6226,7 @@
62166226
"webauthn"
62176227
],
62186228
"support": {
6219-
"source": "https://github.com/web-auth/webauthn-lib/tree/v3.3.1"
6229+
"source": "https://github.com/web-auth/webauthn-lib/tree/v3.3.9"
62206230
},
62216231
"funding": [
62226232
{

composer/installed.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
'type' => 'library',
66
'install_path' => __DIR__ . '/../',
77
'aliases' => array(),
8-
'reference' => 'fbc872de93b18d3e87367d00e281982eab74c5b9',
8+
'reference' => '1a42635cd768a1fff54b12666cd16f2236f7acd5',
99
'name' => 'nextcloud/3rdparty',
1010
'dev' => false,
1111
),
@@ -286,7 +286,7 @@
286286
'type' => 'library',
287287
'install_path' => __DIR__ . '/../',
288288
'aliases' => array(),
289-
'reference' => 'fbc872de93b18d3e87367d00e281982eab74c5b9',
289+
'reference' => '1a42635cd768a1fff54b12666cd16f2236f7acd5',
290290
'dev_requirement' => false,
291291
),
292292
'nextcloud/lognormalizer' => array(
@@ -845,30 +845,30 @@
845845
'dev_requirement' => false,
846846
),
847847
'web-auth/cose-lib' => array(
848-
'pretty_version' => 'v3.3.1',
849-
'version' => '3.3.1.0',
848+
'pretty_version' => 'v3.3.9',
849+
'version' => '3.3.9.0',
850850
'type' => 'library',
851851
'install_path' => __DIR__ . '/../web-auth/cose-lib',
852852
'aliases' => array(),
853-
'reference' => 'eea6fae63ff5c81bf98c115b1be5f38a69682c16',
853+
'reference' => 'ed172d2dc1a6b87b5c644c07c118cd30c1b3819b',
854854
'dev_requirement' => false,
855855
),
856856
'web-auth/metadata-service' => array(
857-
'pretty_version' => 'v3.3.1',
858-
'version' => '3.3.1.0',
857+
'pretty_version' => 'v3.3.9',
858+
'version' => '3.3.9.0',
859859
'type' => 'library',
860860
'install_path' => __DIR__ . '/../web-auth/metadata-service',
861861
'aliases' => array(),
862862
'reference' => '8488d3a832a38cc81c670fce05de1e515c6e64b1',
863863
'dev_requirement' => false,
864864
),
865865
'web-auth/webauthn-lib' => array(
866-
'pretty_version' => 'v3.3.1',
867-
'version' => '3.3.1.0',
866+
'pretty_version' => 'v3.3.9',
867+
'version' => '3.3.9.0',
868868
'type' => 'library',
869869
'install_path' => __DIR__ . '/../web-auth/webauthn-lib',
870870
'aliases' => array(),
871-
'reference' => 'e411527a41c1013512fccdfce61681eb36484c77',
871+
'reference' => '04b98ee3d39cb79dad68a7c15c297c085bf66bfe',
872872
'dev_requirement' => false,
873873
),
874874
),

composer/package-versions-deprecated/src/PackageVersions/Versions.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ final class Versions
116116
'symfony/translation' => 'v4.4.19@e1d0c67167a553556d9f974b5fa79c2448df317a',
117117
'symfony/translation-contracts' => 'v2.3.0@e2eaa60b558f26a4b0354e1bbb25636efaaad105',
118118
'thecodingmachine/safe' => 'v1.3.3@a8ab0876305a4cdaef31b2350fcb9811b5608dbc',
119-
'web-auth/cose-lib' => 'v3.3.1@eea6fae63ff5c81bf98c115b1be5f38a69682c16',
120-
'web-auth/metadata-service' => 'v3.3.1@8488d3a832a38cc81c670fce05de1e515c6e64b1',
121-
'web-auth/webauthn-lib' => 'v3.3.1@e411527a41c1013512fccdfce61681eb36484c77',
122-
'nextcloud/3rdparty' => 'dev-master@fbc872de93b18d3e87367d00e281982eab74c5b9',
119+
'web-auth/cose-lib' => 'v3.3.9@ed172d2dc1a6b87b5c644c07c118cd30c1b3819b',
120+
'web-auth/metadata-service' => 'v3.3.9@8488d3a832a38cc81c670fce05de1e515c6e64b1',
121+
'web-auth/webauthn-lib' => 'v3.3.9@04b98ee3d39cb79dad68a7c15c297c085bf66bfe',
122+
'nextcloud/3rdparty' => 'dev-master@1a42635cd768a1fff54b12666cd16f2236f7acd5',
123123
);
124124

125125
private function __construct()

web-auth/cose-lib/src/Algorithm/ManagerFactory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
namespace Cose\Algorithm;
1515

1616
use Assert\Assertion;
17-
use function Safe\sprintf;
1817

1918
class ManagerFactory
2019
{

web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ECDSA.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Cose\Algorithm\Signature\Signature;
1818
use Cose\Key\Ec2Key;
1919
use Cose\Key\Key;
20-
use function Safe\openssl_sign;
2120

2221
abstract class ECDSA implements Signature
2322
{

web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ECSignature.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use InvalidArgumentException;
2020
use function mb_strlen;
2121
use function mb_substr;
22-
use function Safe\hex2bin;
2322
use function str_pad;
2423
use const STR_PAD_LEFT;
2524

@@ -53,12 +52,17 @@ public static function toAsn1(string $signature, int $length): string
5352
$totalLength = $lengthR + $lengthS + self::BYTE_SIZE + self::BYTE_SIZE;
5453
$lengthPrefix = $totalLength > self::ASN1_MAX_SINGLE_BYTE ? self::ASN1_LENGTH_2BYTES : '';
5554

56-
return hex2bin(
55+
$bin = hex2bin(
5756
self::ASN1_SEQUENCE
5857
.$lengthPrefix.dechex($totalLength)
5958
.self::ASN1_INTEGER.dechex($lengthR).$pointR
6059
.self::ASN1_INTEGER.dechex($lengthS).$pointS
6160
);
61+
if (false === $bin) {
62+
throw new InvalidArgumentException('Unable to convert into ASN.1');
63+
}
64+
65+
return $bin;
6266
}
6367

6468
public static function fromAsn1(string $signature, int $length): string
@@ -78,7 +82,12 @@ public static function fromAsn1(string $signature, int $length): string
7882
$pointR = self::retrievePositiveInteger(self::readAsn1Integer($message, $position));
7983
$pointS = self::retrievePositiveInteger(self::readAsn1Integer($message, $position));
8084

81-
return hex2bin(str_pad($pointR, $length, '0', STR_PAD_LEFT).str_pad($pointS, $length, '0', STR_PAD_LEFT));
85+
$bin = hex2bin(str_pad($pointR, $length, '0', STR_PAD_LEFT).str_pad($pointS, $length, '0', STR_PAD_LEFT));
86+
if (false === $bin) {
87+
throw new InvalidArgumentException('Unable to convert from ASN.1');
88+
}
89+
90+
return $bin;
8291
}
8392

8493
private static function octetLength(string $data): int

web-auth/cose-lib/src/Algorithm/Signature/RSA/PSSRSA.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
use function ord;
2828
use function random_bytes;
2929
use RuntimeException;
30-
use function Safe\pack;
3130
use function str_pad;
3231
use function str_repeat;
3332

web-auth/cose-lib/src/Algorithm/Signature/RSA/RSA.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Cose\Algorithm\Signature\Signature;
1818
use Cose\Key\Key;
1919
use Cose\Key\RsaKey;
20-
use function Safe\openssl_sign;
20+
use InvalidArgumentException;
2121

2222
abstract class RSA implements Signature
2323
{
@@ -26,7 +26,9 @@ public function sign(string $data, Key $key): string
2626
$key = $this->handleKey($key);
2727
Assertion::true($key->isPrivate(), 'The key is not private');
2828

29-
openssl_sign($data, $signature, $key->asPem(), $this->getHashAlgorithm());
29+
if (false === openssl_sign($data, $signature, $key->asPem(), $this->getHashAlgorithm())) {
30+
throw new InvalidArgumentException('Unable to sign the data');
31+
}
3032

3133
return $signature;
3234
}

web-auth/cose-lib/src/Key/Ec2Key.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
use FG\ASN1\Universal\ObjectIdentifier;
2222
use FG\ASN1\Universal\OctetString;
2323
use FG\ASN1\Universal\Sequence;
24-
use function Safe\sprintf;
2524

2625
class Ec2Key extends Key
2726
{

0 commit comments

Comments
 (0)