installed plugin WP-WebAuthn version 1.2.8

This commit is contained in:
2022-10-08 02:41:03 +00:00
committed by Gitium
parent 15c71c7c0f
commit 7b1024e711
923 changed files with 124568 additions and 0 deletions
wp-content/plugins/wp-webauthn
LICENSE
blocks
css
js
languages
readme.txt
vendor
autoload.php
beberlei
brick
composer
fgrosse
league
nyholm
php-http
psr
ramsey
collection
uuid
LICENSEREADME.mdcomposer.json
src
BinaryUtils.php
Builder
Codec
Converter
DegradedUuid.phpDeprecatedUuidInterface.phpDeprecatedUuidMethodsTrait.php
Exception
FeatureSet.php
Fields
Generator
Guid
Lazy
Math
Nonstandard
Provider
Rfc4122
Type
Uuid.phpUuidFactory.phpUuidFactoryInterface.phpUuidInterface.php
Validator
functions.php
spomky-labs
symfony
thecodingmachine
safe
LICENSEREADME.mdcomposer.json
deprecated
generated
Exceptions
apache.phpapcu.phparray.phpbzip2.phpcalendar.phpclassobj.phpcom.phpcubrid.phpcurl.phpdatetime.phpdir.phpeio.phperrorfunc.phpexec.phpfileinfo.phpfilesystem.phpfilter.phpfpm.phpftp.phpfunchand.phpfunctionsList.phpgmp.phpgnupg.phphash.phpibase.phpibmDb2.phpiconv.phpimage.phpimap.phpinfo.phpingres-ii.phpinotify.phpjson.phpldap.phplibxml.phplzf.phpmailparse.phpmbstring.phpmisc.phpmsql.phpmysql.phpmysqli.phpmysqlndMs.phpmysqlndQc.phpnetwork.phpoci8.phpopcache.phpopenssl.phpoutcontrol.phppassword.phppcntl.phppcre.phppdf.phppgsql.phpposix.phpps.phppspell.phpreadline.phprpminfo.phprrd.phpsem.phpsession.phpshmop.phpsimplexml.phpsockets.phpsodium.phpsolr.phpspl.phpsqlsrv.phpssdeep.phpssh2.phpstream.phpstrings.phpswoole.phpuodbc.phpuopz.phpurl.phpvar.phpxdiff.phpxml.phpxmlrpc.phpyaml.phpyaz.phpzip.phpzlib.php
lib
rector-migrate-0.7.php
web-auth
cose-lib
metadata-service
webauthn-lib
LICENSEcomposer.json
src
AttestationStatement
AttestedCredentialData.php
AuthenticationExtensions
AuthenticatorAssertionResponse.phpAuthenticatorAssertionResponseValidator.phpAuthenticatorAttestationResponse.phpAuthenticatorAttestationResponseValidator.phpAuthenticatorData.phpAuthenticatorResponse.phpAuthenticatorSelectionCriteria.php
CertificateChainChecker
CertificateToolbox.phpCollectedClientData.php
Counter
Credential.phpPublicKeyCredential.phpPublicKeyCredentialCreationOptions.phpPublicKeyCredentialDescriptor.phpPublicKeyCredentialDescriptorCollection.phpPublicKeyCredentialEntity.phpPublicKeyCredentialLoader.phpPublicKeyCredentialOptions.phpPublicKeyCredentialParameters.phpPublicKeyCredentialRequestOptions.phpPublicKeyCredentialRpEntity.phpPublicKeyCredentialSource.phpPublicKeyCredentialSourceRepository.phpPublicKeyCredentialUserEntity.phpServer.phpStringStream.php
TokenBinding
TrustPath
U2FPublicKey.php
Util
web-token
jwt-core
jwt-key-mgmt
jwt-signature-algorithm-ecdsa
jwt-signature-algorithm-eddsa
jwt-signature-algorithm-rsa
jwt-signature
wp-webauthn.phpwwa-admin-content.phpwwa-ajax.phpwwa-compatibility.phpwwa-functions.phpwwa-menus.phpwwa-profile-content.phpwwa-shortcodes.phpwwa-version.php

@ -0,0 +1,75 @@
<?php
declare(strict_types=1);
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2020 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
namespace Jose\Component\Signature\Algorithm;
use function in_array;
use InvalidArgumentException;
use Jose\Component\Core\JWK;
use Jose\Component\Core\Util\RSAKey;
use RuntimeException;
abstract class RSAPKCS1 implements SignatureAlgorithm
{
public function allowedKeyTypes(): array
{
return ['RSA'];
}
public function verify(JWK $key, string $input, string $signature): bool
{
$this->checkKey($key);
$pub = RSAKey::createFromJWK($key->toPublic());
return 1 === openssl_verify($input, $signature, $pub->toPEM(), $this->getAlgorithm());
}
/**
* @throws InvalidArgumentException if the key is not private
* @throws InvalidArgumentException if the data cannot be signed
*/
public function sign(JWK $key, string $input): string
{
$this->checkKey($key);
if (!$key->has('d')) {
throw new InvalidArgumentException('The key is not a private key.');
}
$priv = RSAKey::createFromJWK($key);
$result = openssl_sign($input, $signature, $priv->toPEM(), $this->getAlgorithm());
if (true !== $result) {
throw new RuntimeException('Unable to sign');
}
return $signature;
}
abstract protected function getAlgorithm(): string;
/**
* @throws InvalidArgumentException if the key type is not allowed
* @throws InvalidArgumentException if the key is not valid
*/
private function checkKey(JWK $key): void
{
if (!in_array($key->get('kty'), $this->allowedKeyTypes(), true)) {
throw new InvalidArgumentException('Wrong key type.');
}
foreach (['n', 'e'] as $k) {
if (!$key->has($k)) {
throw new InvalidArgumentException(sprintf('The key parameter "%s" is missing.', $k));
}
}
}
}