From 19985dbb8c0aa66dc4bf7905abc1148de909097d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Tue, 11 Jan 2022 12:35:47 +0100 Subject: prvi-commit --- vendor/autoload.php | 7 + vendor/composer/ClassLoader.php | 445 ++ vendor/composer/InstalledVersions.php | 337 ++ vendor/composer/LICENSE | 21 + vendor/composer/autoload_classmap.php | 438 ++ vendor/composer/autoload_files.php | 23 + vendor/composer/autoload_namespaces.php | 9 + vendor/composer/autoload_psr4.php | 38 + vendor/composer/autoload_real.php | 70 + vendor/composer/autoload_static.php | 652 +++ vendor/composer/ca-bundle/LICENSE | 19 + vendor/composer/ca-bundle/README.md | 85 + vendor/composer/ca-bundle/composer.json | 54 + vendor/composer/ca-bundle/res/cacert.pem | 3138 +++++++++++ vendor/composer/ca-bundle/src/CaBundle.php | 353 ++ vendor/composer/installed.json | 1992 +++++++ vendor/composer/installed.php | 371 ++ vendor/composer/platform_check.php | 26 + vendor/fgrosse/phpasn1/CHANGELOG.md | 51 + vendor/fgrosse/phpasn1/LICENSE | 19 + vendor/fgrosse/phpasn1/README.md | 167 + vendor/fgrosse/phpasn1/composer.json | 49 + vendor/fgrosse/phpasn1/lib/ASN1/ASNObject.php | 355 ++ vendor/fgrosse/phpasn1/lib/ASN1/AbstractString.php | 136 + vendor/fgrosse/phpasn1/lib/ASN1/AbstractTime.php | 78 + vendor/fgrosse/phpasn1/lib/ASN1/Base128.php | 63 + .../lib/ASN1/Composite/AttributeTypeAndValue.php | 35 + .../phpasn1/lib/ASN1/Composite/RDNString.php | 37 + .../ASN1/Composite/RelativeDistinguishedName.php | 50 + vendor/fgrosse/phpasn1/lib/ASN1/Construct.php | 191 + .../lib/ASN1/Exception/NotImplementedException.php | 15 + .../phpasn1/lib/ASN1/Exception/ParserException.php | 29 + .../phpasn1/lib/ASN1/ExplicitlyTaggedObject.php | 131 + vendor/fgrosse/phpasn1/lib/ASN1/Identifier.php | 339 ++ vendor/fgrosse/phpasn1/lib/ASN1/OID.php | 199 + vendor/fgrosse/phpasn1/lib/ASN1/Parsable.php | 32 + vendor/fgrosse/phpasn1/lib/ASN1/TemplateParser.php | 70 + .../phpasn1/lib/ASN1/Universal/BMPString.php | 41 + .../phpasn1/lib/ASN1/Universal/BitString.php | 88 + .../fgrosse/phpasn1/lib/ASN1/Universal/Boolean.php | 75 + .../phpasn1/lib/ASN1/Universal/CharacterString.php | 28 + .../phpasn1/lib/ASN1/Universal/Enumerated.php | 21 + .../phpasn1/lib/ASN1/Universal/GeneralString.php | 34 + .../phpasn1/lib/ASN1/Universal/GeneralizedTime.php | 134 + .../phpasn1/lib/ASN1/Universal/GraphicString.php | 34 + .../phpasn1/lib/ASN1/Universal/IA5String.php | 35 + .../fgrosse/phpasn1/lib/ASN1/Universal/Integer.php | 130 + .../phpasn1/lib/ASN1/Universal/NullObject.php | 54 + .../phpasn1/lib/ASN1/Universal/NumericString.php | 38 + .../lib/ASN1/Universal/ObjectDescriptor.php | 26 + .../lib/ASN1/Universal/ObjectIdentifier.php | 138 + .../phpasn1/lib/ASN1/Universal/OctetString.php | 91 + .../phpasn1/lib/ASN1/Universal/PrintableString.php | 53 + .../ASN1/Universal/RelativeObjectIdentifier.php | 57 + .../phpasn1/lib/ASN1/Universal/Sequence.php | 23 + vendor/fgrosse/phpasn1/lib/ASN1/Universal/Set.php | 21 + .../phpasn1/lib/ASN1/Universal/T61String.php | 36 + .../fgrosse/phpasn1/lib/ASN1/Universal/UTCTime.php | 77 + .../phpasn1/lib/ASN1/Universal/UTF8String.php | 34 + .../phpasn1/lib/ASN1/Universal/UniversalString.php | 36 + .../phpasn1/lib/ASN1/Universal/VisibleString.php | 34 + .../phpasn1/lib/ASN1/UnknownConstructedObject.php | 59 + vendor/fgrosse/phpasn1/lib/ASN1/UnknownObject.php | 59 + vendor/fgrosse/phpasn1/lib/Utility/BigInteger.php | 195 + .../phpasn1/lib/Utility/BigIntegerBcmath.php | 133 + .../fgrosse/phpasn1/lib/Utility/BigIntegerGmp.php | 133 + .../phpasn1/lib/X509/AlgorithmIdentifier.php | 22 + vendor/fgrosse/phpasn1/lib/X509/CSR/Attributes.php | 68 + vendor/fgrosse/phpasn1/lib/X509/CSR/CSR.php | 159 + .../phpasn1/lib/X509/CertificateExtensions.php | 100 + .../phpasn1/lib/X509/CertificateSubject.php | 108 + vendor/fgrosse/phpasn1/lib/X509/PrivateKey.php | 35 + vendor/fgrosse/phpasn1/lib/X509/PublicKey.php | 35 + vendor/fgrosse/phpasn1/lib/X509/SAN/DNSName.php | 28 + vendor/fgrosse/phpasn1/lib/X509/SAN/IPAddress.php | 73 + .../lib/X509/SAN/SubjectAlternativeNames.php | 96 + vendor/geoip2/geoip2/CHANGELOG.md | 282 + vendor/geoip2/geoip2/LICENSE | 202 + vendor/geoip2/geoip2/README.md | 409 ++ vendor/geoip2/geoip2/composer.json | 31 + vendor/geoip2/geoip2/examples/benchmark.php | 25 + vendor/geoip2/geoip2/src/Database/Reader.php | 287 + .../src/Exception/AddressNotFoundException.php | 10 + .../src/Exception/AuthenticationException.php | 10 + .../geoip2/src/Exception/GeoIp2Exception.php | 10 + .../geoip2/geoip2/src/Exception/HttpException.php | 24 + .../src/Exception/InvalidRequestException.php | 26 + .../geoip2/src/Exception/OutOfQueriesException.php | 10 + vendor/geoip2/geoip2/src/Model/AbstractModel.php | 67 + vendor/geoip2/geoip2/src/Model/AnonymousIp.php | 56 + vendor/geoip2/geoip2/src/Model/Asn.php | 43 + vendor/geoip2/geoip2/src/Model/City.php | 116 + vendor/geoip2/geoip2/src/Model/ConnectionType.php | 39 + vendor/geoip2/geoip2/src/Model/Country.php | 71 + vendor/geoip2/geoip2/src/Model/Domain.php | 39 + vendor/geoip2/geoip2/src/Model/Enterprise.php | 14 + vendor/geoip2/geoip2/src/Model/Insights.php | 14 + vendor/geoip2/geoip2/src/Model/Isp.php | 52 + vendor/geoip2/geoip2/src/ProviderInterface.php | 20 + .../geoip2/src/Record/AbstractPlaceRecord.php | 66 + vendor/geoip2/geoip2/src/Record/AbstractRecord.php | 61 + vendor/geoip2/geoip2/src/Record/City.php | 29 + vendor/geoip2/geoip2/src/Record/Continent.php | 32 + vendor/geoip2/geoip2/src/Record/Country.php | 40 + vendor/geoip2/geoip2/src/Record/Location.php | 52 + vendor/geoip2/geoip2/src/Record/MaxMind.php | 19 + vendor/geoip2/geoip2/src/Record/Postal.php | 26 + .../geoip2/src/Record/RepresentedCountry.php | 26 + vendor/geoip2/geoip2/src/Record/Subdivision.php | 40 + vendor/geoip2/geoip2/src/Record/Traits.php | 140 + vendor/geoip2/geoip2/src/Util.php | 37 + vendor/geoip2/geoip2/src/WebService/Client.php | 239 + vendor/guzzlehttp/guzzle/.php_cs | 23 + vendor/guzzlehttp/guzzle/CHANGELOG.md | 1338 +++++ vendor/guzzlehttp/guzzle/Dockerfile | 18 + vendor/guzzlehttp/guzzle/LICENSE | 19 + vendor/guzzlehttp/guzzle/README.md | 90 + vendor/guzzlehttp/guzzle/UPGRADING.md | 1203 ++++ vendor/guzzlehttp/guzzle/composer.json | 59 + vendor/guzzlehttp/guzzle/src/Client.php | 501 ++ vendor/guzzlehttp/guzzle/src/ClientInterface.php | 87 + vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php | 316 ++ .../guzzle/src/Cookie/CookieJarInterface.php | 84 + .../guzzlehttp/guzzle/src/Cookie/FileCookieJar.php | 91 + .../guzzle/src/Cookie/SessionCookieJar.php | 72 + vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php | 403 ++ .../guzzle/src/Exception/BadResponseException.php | 27 + .../guzzle/src/Exception/ClientException.php | 9 + .../guzzle/src/Exception/ConnectException.php | 37 + .../guzzle/src/Exception/GuzzleException.php | 23 + .../src/Exception/InvalidArgumentException.php | 7 + .../guzzle/src/Exception/RequestException.php | 192 + .../guzzle/src/Exception/SeekException.php | 27 + .../guzzle/src/Exception/ServerException.php | 9 + .../src/Exception/TooManyRedirectsException.php | 6 + .../guzzle/src/Exception/TransferException.php | 6 + .../guzzlehttp/guzzle/src/Handler/CurlFactory.php | 585 ++ .../guzzle/src/Handler/CurlFactoryInterface.php | 27 + .../guzzlehttp/guzzle/src/Handler/CurlHandler.php | 45 + .../guzzle/src/Handler/CurlMultiHandler.php | 219 + .../guzzlehttp/guzzle/src/Handler/EasyHandle.php | 92 + .../guzzlehttp/guzzle/src/Handler/MockHandler.php | 195 + vendor/guzzlehttp/guzzle/src/Handler/Proxy.php | 55 + .../guzzle/src/Handler/StreamHandler.php | 545 ++ vendor/guzzlehttp/guzzle/src/HandlerStack.php | 277 + vendor/guzzlehttp/guzzle/src/MessageFormatter.php | 185 + vendor/guzzlehttp/guzzle/src/Middleware.php | 254 + vendor/guzzlehttp/guzzle/src/Pool.php | 134 + .../guzzle/src/PrepareBodyMiddleware.php | 111 + .../guzzlehttp/guzzle/src/RedirectMiddleware.php | 255 + vendor/guzzlehttp/guzzle/src/RequestOptions.php | 263 + vendor/guzzlehttp/guzzle/src/RetryMiddleware.php | 128 + vendor/guzzlehttp/guzzle/src/TransferStats.php | 126 + vendor/guzzlehttp/guzzle/src/UriTemplate.php | 237 + vendor/guzzlehttp/guzzle/src/Utils.php | 92 + vendor/guzzlehttp/guzzle/src/functions.php | 334 ++ vendor/guzzlehttp/guzzle/src/functions_include.php | 6 + vendor/guzzlehttp/promises/CHANGELOG.md | 84 + vendor/guzzlehttp/promises/LICENSE | 19 + vendor/guzzlehttp/promises/Makefile | 13 + vendor/guzzlehttp/promises/README.md | 532 ++ vendor/guzzlehttp/promises/composer.json | 39 + .../guzzlehttp/promises/src/AggregateException.php | 17 + .../promises/src/CancellationException.php | 10 + vendor/guzzlehttp/promises/src/Coroutine.php | 169 + vendor/guzzlehttp/promises/src/Create.php | 84 + vendor/guzzlehttp/promises/src/Each.php | 90 + vendor/guzzlehttp/promises/src/EachPromise.php | 254 + .../guzzlehttp/promises/src/FulfilledPromise.php | 84 + vendor/guzzlehttp/promises/src/Is.php | 46 + vendor/guzzlehttp/promises/src/Promise.php | 278 + .../guzzlehttp/promises/src/PromiseInterface.php | 97 + .../guzzlehttp/promises/src/PromisorInterface.php | 16 + vendor/guzzlehttp/promises/src/RejectedPromise.php | 91 + .../guzzlehttp/promises/src/RejectionException.php | 48 + vendor/guzzlehttp/promises/src/TaskQueue.php | 67 + .../guzzlehttp/promises/src/TaskQueueInterface.php | 24 + vendor/guzzlehttp/promises/src/Utils.php | 274 + vendor/guzzlehttp/promises/src/functions.php | 363 ++ .../guzzlehttp/promises/src/functions_include.php | 6 + vendor/guzzlehttp/psr7/.github/workflows/bc.yml | 16 + vendor/guzzlehttp/psr7/.github/workflows/ci.yml | 30 + .../psr7/.github/workflows/integration.yml | 37 + .../guzzlehttp/psr7/.github/workflows/static.yml | 29 + vendor/guzzlehttp/psr7/.php_cs.dist | 56 + vendor/guzzlehttp/psr7/CHANGELOG.md | 294 + vendor/guzzlehttp/psr7/LICENSE | 19 + vendor/guzzlehttp/psr7/README.md | 809 +++ vendor/guzzlehttp/psr7/composer.json | 49 + vendor/guzzlehttp/psr7/src/AppendStream.php | 246 + vendor/guzzlehttp/psr7/src/BufferStream.php | 142 + vendor/guzzlehttp/psr7/src/CachingStream.php | 141 + vendor/guzzlehttp/psr7/src/DroppingStream.php | 45 + vendor/guzzlehttp/psr7/src/FnStream.php | 163 + vendor/guzzlehttp/psr7/src/Header.php | 71 + vendor/guzzlehttp/psr7/src/InflateStream.php | 56 + vendor/guzzlehttp/psr7/src/LazyOpenStream.php | 42 + vendor/guzzlehttp/psr7/src/LimitStream.php | 157 + vendor/guzzlehttp/psr7/src/Message.php | 252 + vendor/guzzlehttp/psr7/src/MessageTrait.php | 214 + vendor/guzzlehttp/psr7/src/MimeType.php | 140 + vendor/guzzlehttp/psr7/src/MultipartStream.php | 158 + vendor/guzzlehttp/psr7/src/NoSeekStream.php | 25 + vendor/guzzlehttp/psr7/src/PumpStream.php | 170 + vendor/guzzlehttp/psr7/src/Query.php | 113 + vendor/guzzlehttp/psr7/src/Request.php | 152 + vendor/guzzlehttp/psr7/src/Response.php | 155 + vendor/guzzlehttp/psr7/src/Rfc7230.php | 19 + vendor/guzzlehttp/psr7/src/ServerRequest.php | 379 ++ vendor/guzzlehttp/psr7/src/Stream.php | 270 + .../guzzlehttp/psr7/src/StreamDecoratorTrait.php | 152 + vendor/guzzlehttp/psr7/src/StreamWrapper.php | 165 + vendor/guzzlehttp/psr7/src/UploadedFile.php | 328 ++ vendor/guzzlehttp/psr7/src/Uri.php | 810 +++ vendor/guzzlehttp/psr7/src/UriNormalizer.php | 219 + vendor/guzzlehttp/psr7/src/UriResolver.php | 222 + vendor/guzzlehttp/psr7/src/Utils.php | 428 ++ vendor/guzzlehttp/psr7/src/functions.php | 422 ++ vendor/guzzlehttp/psr7/src/functions_include.php | 6 + vendor/maxmind-db/reader/CHANGELOG.md | 222 + vendor/maxmind-db/reader/LICENSE | 202 + vendor/maxmind-db/reader/README.md | 178 + vendor/maxmind-db/reader/autoload.php | 45 + vendor/maxmind-db/reader/composer.json | 44 + vendor/maxmind-db/reader/ext/config.m4 | 40 + vendor/maxmind-db/reader/ext/maxminddb.c | 704 +++ vendor/maxmind-db/reader/ext/php_maxminddb.h | 24 + vendor/maxmind-db/reader/ext/tests/001-load.phpt | 12 + vendor/maxmind-db/reader/ext/tests/002-final.phpt | 13 + .../reader/ext/tests/003-open-basedir.phpt | 12 + vendor/maxmind-db/reader/package.xml | 63 + vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php | 327 ++ .../reader/src/MaxMind/Db/Reader/Decoder.php | 381 ++ .../MaxMind/Db/Reader/InvalidDatabaseException.php | 12 + .../reader/src/MaxMind/Db/Reader/Metadata.php | 88 + .../reader/src/MaxMind/Db/Reader/Util.php | 26 + vendor/maxmind/web-service-common/CHANGELOG.md | 91 + vendor/maxmind/web-service-common/LICENSE | 202 + vendor/maxmind/web-service-common/README.md | 25 + vendor/maxmind/web-service-common/composer.json | 31 + .../maxmind/web-service-common/dev-bin/release.sh | 60 + .../src/Exception/AuthenticationException.php | 10 + .../src/Exception/HttpException.php | 40 + .../src/Exception/InsufficientFundsException.php | 10 + .../src/Exception/InvalidInputException.php | 12 + .../src/Exception/InvalidRequestException.php | 37 + .../src/Exception/IpAddressNotFoundException.php | 7 + .../src/Exception/PermissionRequiredException.php | 10 + .../src/Exception/WebServiceException.php | 10 + .../web-service-common/src/WebService/Client.php | 488 ++ .../src/WebService/Http/CurlRequest.php | 136 + .../src/WebService/Http/Request.php | 29 + .../src/WebService/Http/RequestFactory.php | 49 + vendor/minishlink/web-push/LICENSE | 19 + vendor/minishlink/web-push/composer.json | 39 + vendor/minishlink/web-push/src/Encryption.php | 321 ++ .../minishlink/web-push/src/MessageSentReport.php | 181 + vendor/minishlink/web-push/src/Notification.php | 86 + vendor/minishlink/web-push/src/Subscription.php | 122 + .../web-push/src/SubscriptionInterface.php | 40 + vendor/minishlink/web-push/src/Utils.php | 63 + vendor/minishlink/web-push/src/VAPID.php | 197 + vendor/minishlink/web-push/src/WebPush.php | 412 ++ vendor/paragonie/random_compat/LICENSE | 22 + vendor/paragonie/random_compat/build-phar.sh | 5 + vendor/paragonie/random_compat/composer.json | 34 + .../random_compat/dist/random_compat.phar.pubkey | 5 + .../dist/random_compat.phar.pubkey.asc | 11 + vendor/paragonie/random_compat/lib/random.php | 32 + .../paragonie/random_compat/other/build_phar.php | 57 + vendor/paragonie/random_compat/psalm-autoload.php | 9 + vendor/paragonie/random_compat/psalm.xml | 19 + .../sodium_compat/.github/workflows/ci.yml | 96 + vendor/paragonie/sodium_compat/.gitignore | 9 + vendor/paragonie/sodium_compat/LICENSE | 16 + vendor/paragonie/sodium_compat/README.md | 347 ++ vendor/paragonie/sodium_compat/appveyor.yml | 27 + vendor/paragonie/sodium_compat/autoload-fast.php | 4 + .../paragonie/sodium_compat/autoload-pedantic.php | 6 + vendor/paragonie/sodium_compat/autoload-php7.php | 31 + .../paragonie/sodium_compat/autoload-phpunit.php | 8 + vendor/paragonie/sodium_compat/autoload.php | 72 + vendor/paragonie/sodium_compat/build-phar.sh | 8 + vendor/paragonie/sodium_compat/composer-php52.json | 87 + vendor/paragonie/sodium_compat/composer.json | 66 + vendor/paragonie/sodium_compat/dist/Makefile | 39 + vendor/paragonie/sodium_compat/dist/box.json | 32 + vendor/paragonie/sodium_compat/lib/constants.php | 52 + vendor/paragonie/sodium_compat/lib/namespaced.php | 48 + vendor/paragonie/sodium_compat/lib/php72compat.php | 1369 +++++ .../sodium_compat/lib/php72compat_const.php | 92 + .../paragonie/sodium_compat/lib/ristretto255.php | 239 + .../paragonie/sodium_compat/lib/sodium_compat.php | 827 +++ .../sodium_compat/lib/stream-xchacha20.php | 43 + .../paragonie/sodium_compat/namespaced/Compat.php | 7 + .../sodium_compat/namespaced/Core/BLAKE2b.php | 7 + .../sodium_compat/namespaced/Core/ChaCha20.php | 7 + .../sodium_compat/namespaced/Core/ChaCha20/Ctx.php | 7 + .../namespaced/Core/ChaCha20/IetfCtx.php | 7 + .../sodium_compat/namespaced/Core/Curve25519.php | 7 + .../namespaced/Core/Curve25519/Fe.php | 7 + .../namespaced/Core/Curve25519/Ge/Cached.php | 7 + .../namespaced/Core/Curve25519/Ge/P1p1.php | 7 + .../namespaced/Core/Curve25519/Ge/P2.php | 7 + .../namespaced/Core/Curve25519/Ge/P3.php | 7 + .../namespaced/Core/Curve25519/Ge/Precomp.php | 7 + .../sodium_compat/namespaced/Core/Curve25519/H.php | 7 + .../sodium_compat/namespaced/Core/Ed25519.php | 7 + .../sodium_compat/namespaced/Core/HChaCha20.php | 7 + .../sodium_compat/namespaced/Core/HSalsa20.php | 7 + .../sodium_compat/namespaced/Core/Poly1305.php | 7 + .../namespaced/Core/Poly1305/State.php | 7 + .../sodium_compat/namespaced/Core/Salsa20.php | 7 + .../sodium_compat/namespaced/Core/SipHash.php | 7 + .../sodium_compat/namespaced/Core/Util.php | 7 + .../sodium_compat/namespaced/Core/X25519.php | 7 + .../sodium_compat/namespaced/Core/XChaCha20.php | 7 + .../sodium_compat/namespaced/Core/Xsalsa20.php | 7 + .../paragonie/sodium_compat/namespaced/Crypto.php | 7 + vendor/paragonie/sodium_compat/namespaced/File.php | 7 + vendor/paragonie/sodium_compat/phpunit.xml.dist | 16 + vendor/paragonie/sodium_compat/psalm-above-3.xml | 57 + vendor/paragonie/sodium_compat/psalm-below-3.xml | 43 + vendor/paragonie/sodium_compat/src/Compat.php | 3947 +++++++++++++ .../paragonie/sodium_compat/src/Core/BLAKE2b.php | 790 +++ .../sodium_compat/src/Core/Base64/Common.php | 213 + .../sodium_compat/src/Core/Base64/Original.php | 248 + .../sodium_compat/src/Core/Base64/UrlSafe.php | 247 + .../paragonie/sodium_compat/src/Core/ChaCha20.php | 395 ++ .../sodium_compat/src/Core/ChaCha20/Ctx.php | 119 + .../sodium_compat/src/Core/ChaCha20/IetfCtx.php | 38 + .../sodium_compat/src/Core/Curve25519.php | 4106 ++++++++++++++ .../sodium_compat/src/Core/Curve25519/Fe.php | 123 + .../src/Core/Curve25519/Ge/Cached.php | 65 + .../sodium_compat/src/Core/Curve25519/Ge/P1p1.php | 64 + .../sodium_compat/src/Core/Curve25519/Ge/P2.php | 54 + .../sodium_compat/src/Core/Curve25519/Ge/P3.php | 65 + .../src/Core/Curve25519/Ge/Precomp.php | 54 + .../sodium_compat/src/Core/Curve25519/H.php | 1549 ++++++ .../sodium_compat/src/Core/Curve25519/README.md | 3 + .../paragonie/sodium_compat/src/Core/Ed25519.php | 551 ++ .../paragonie/sodium_compat/src/Core/HChaCha20.php | 108 + .../paragonie/sodium_compat/src/Core/HSalsa20.php | 96 + .../paragonie/sodium_compat/src/Core/Poly1305.php | 63 + .../sodium_compat/src/Core/Poly1305/State.php | 445 ++ .../sodium_compat/src/Core/Ristretto255.php | 707 +++ .../paragonie/sodium_compat/src/Core/Salsa20.php | 273 + .../sodium_compat/src/Core/SecretStream/State.php | 163 + .../paragonie/sodium_compat/src/Core/SipHash.php | 306 ++ vendor/paragonie/sodium_compat/src/Core/Util.php | 942 ++++ vendor/paragonie/sodium_compat/src/Core/X25519.php | 327 ++ .../paragonie/sodium_compat/src/Core/XChaCha20.php | 117 + .../paragonie/sodium_compat/src/Core/XSalsa20.php | 57 + .../paragonie/sodium_compat/src/Core32/BLAKE2b.php | 719 +++ .../sodium_compat/src/Core32/ChaCha20.php | 400 ++ .../sodium_compat/src/Core32/ChaCha20/Ctx.php | 126 + .../sodium_compat/src/Core32/ChaCha20/IetfCtx.php | 39 + .../sodium_compat/src/Core32/Curve25519.php | 3196 +++++++++++ .../sodium_compat/src/Core32/Curve25519/Fe.php | 185 + .../src/Core32/Curve25519/Ge/Cached.php | 65 + .../src/Core32/Curve25519/Ge/P1p1.php | 67 + .../sodium_compat/src/Core32/Curve25519/Ge/P2.php | 54 + .../sodium_compat/src/Core32/Curve25519/Ge/P3.php | 65 + .../src/Core32/Curve25519/Ge/Precomp.php | 56 + .../sodium_compat/src/Core32/Curve25519/H.php | 1467 +++++ .../sodium_compat/src/Core32/Curve25519/README.md | 3 + .../paragonie/sodium_compat/src/Core32/Ed25519.php | 482 ++ .../sodium_compat/src/Core32/HChaCha20.php | 127 + .../sodium_compat/src/Core32/HSalsa20.php | 141 + .../paragonie/sodium_compat/src/Core32/Int32.php | 871 +++ .../paragonie/sodium_compat/src/Core32/Int64.php | 1066 ++++ .../sodium_compat/src/Core32/Poly1305.php | 63 + .../sodium_compat/src/Core32/Poly1305/State.php | 451 ++ .../paragonie/sodium_compat/src/Core32/Salsa20.php | 306 ++ .../src/Core32/SecretStream/State.php | 163 + .../paragonie/sodium_compat/src/Core32/SipHash.php | 238 + vendor/paragonie/sodium_compat/src/Core32/Util.php | 13 + .../paragonie/sodium_compat/src/Core32/X25519.php | 345 ++ .../sodium_compat/src/Core32/XChaCha20.php | 64 + .../sodium_compat/src/Core32/XSalsa20.php | 57 + vendor/paragonie/sodium_compat/src/Crypto.php | 1655 ++++++ vendor/paragonie/sodium_compat/src/Crypto32.php | 1654 ++++++ vendor/paragonie/sodium_compat/src/File.php | 1560 ++++++ .../sodium_compat/src/PHP52/SplFixedArray.php | 189 + .../sodium_compat/src/SodiumException.php | 11 + vendor/paypal/paypal-checkout-sdk/.gitignore | 2 + vendor/paypal/paypal-checkout-sdk/LICENSE | 86 + vendor/paypal/paypal-checkout-sdk/README.md | 169 + vendor/paypal/paypal-checkout-sdk/composer.json | 35 + vendor/paypal/paypal-checkout-sdk/composer.phar | Bin 0 -> 1874955 bytes vendor/paypal/paypal-checkout-sdk/gen.yml | 6 + vendor/paypal/paypal-checkout-sdk/homepage.jpg | Bin 0 -> 165333 bytes vendor/paypal/paypal-checkout-sdk/init | 0 .../lib/PayPalCheckoutSdk/Core/AccessToken.php | 25 + .../PayPalCheckoutSdk/Core/AccessTokenRequest.php | 27 + .../Core/AuthorizationInjector.php | 51 + .../Core/FPTIInstrumentationInjector.php | 16 + .../lib/PayPalCheckoutSdk/Core/GzipInjector.php | 14 + .../PayPalCheckoutSdk/Core/PayPalEnvironment.php | 23 + .../PayPalCheckoutSdk/Core/PayPalHttpClient.php | 27 + .../Core/ProductionEnvironment.php | 16 + .../PayPalCheckoutSdk/Core/RefreshTokenRequest.php | 19 + .../PayPalCheckoutSdk/Core/SandboxEnvironment.php | 16 + .../lib/PayPalCheckoutSdk/Core/UserAgent.php | 52 + .../lib/PayPalCheckoutSdk/Core/Version.php | 8 + .../Orders/OrdersAuthorizeRequest.php | 37 + .../Orders/OrdersCaptureRequest.php | 37 + .../Orders/OrdersCreateRequest.php | 31 + .../PayPalCheckoutSdk/Orders/OrdersGetRequest.php | 26 + .../Orders/OrdersPatchRequest.php | 26 + .../Orders/OrdersValidateRequest.php | 29 + .../Payments/AuthorizationsCaptureRequest.php | 33 + .../Payments/AuthorizationsGetRequest.php | 25 + .../Payments/AuthorizationsReauthorizeRequest.php | 33 + .../Payments/AuthorizationsVoidRequest.php | 25 + .../Payments/CapturesGetRequest.php | 25 + .../Payments/CapturesRefundRequest.php | 33 + .../Payments/RefundsGetRequest.php | 25 + vendor/paypal/paypal-checkout-sdk/phpunit.xml | 9 + .../AuthorizeIntentExamples/AuthorizeOrder.php | 61 + .../AuthorizeIntentExamples/CaptureOrder.php | 55 + .../AuthorizeIntentExamples/CreateOrder.php | 237 + .../samples/AuthorizeIntentExamples/RunAll.php | 82 + .../samples/CaptureIntentExamples/CaptureOrder.php | 60 + .../samples/CaptureIntentExamples/CreateOrder.php | 178 + .../samples/CaptureIntentExamples/RunAll.php | 74 + .../paypal-checkout-sdk/samples/ErrorSample.php | 94 + .../paypal-checkout-sdk/samples/GetOrder.php | 54 + .../paypal-checkout-sdk/samples/PatchOrder.php | 82 + .../paypal-checkout-sdk/samples/PayPalClient.php | 35 + .../paypal-checkout-sdk/samples/RefundOrder.php | 60 + .../tests/Orders/OrdersAuthorizeTest.php | 26 + .../tests/Orders/OrdersCaptureTest.php | 26 + .../tests/Orders/OrdersCreateTest.php | 69 + .../tests/Orders/OrdersGetTest.php | 48 + .../tests/Orders/OrdersPatchTest.php | 73 + .../paypal-checkout-sdk/tests/TestHarness.php | 24 + vendor/paypal/paypalhttp/.gitattributes | 7 + vendor/paypal/paypalhttp/.gitignore | 32 + vendor/paypal/paypalhttp/.travis.yml | 16 + vendor/paypal/paypalhttp/CHANGELOG.md | 2 + vendor/paypal/paypalhttp/CONTRIBUTING.md | 10 + vendor/paypal/paypalhttp/LICENSE | 23 + vendor/paypal/paypalhttp/README.md | 76 + vendor/paypal/paypalhttp/Rakefile | 2 + vendor/paypal/paypalhttp/composer.json | 23 + vendor/paypal/paypalhttp/lib/PayPalHttp/Curl.php | 57 + .../paypal/paypalhttp/lib/PayPalHttp/Encoder.php | 114 + .../paypalhttp/lib/PayPalHttp/Environment.php | 18 + .../paypalhttp/lib/PayPalHttp/HttpClient.php | 231 + .../paypalhttp/lib/PayPalHttp/HttpException.php | 23 + .../paypalhttp/lib/PayPalHttp/HttpRequest.php | 42 + .../paypalhttp/lib/PayPalHttp/HttpResponse.php | 34 + .../paypalhttp/lib/PayPalHttp/IOException.php | 13 + .../paypal/paypalhttp/lib/PayPalHttp/Injector.php | 19 + .../paypalhttp/lib/PayPalHttp/Serializer.php | 29 + .../paypalhttp/lib/PayPalHttp/Serializer/Form.php | 46 + .../lib/PayPalHttp/Serializer/FormPart.php | 25 + .../paypalhttp/lib/PayPalHttp/Serializer/Json.php | 38 + .../lib/PayPalHttp/Serializer/Multipart.php | 134 + .../paypalhttp/lib/PayPalHttp/Serializer/Text.php | 38 + vendor/paypal/paypalhttp/phpunit.xml | 10 + vendor/phpmailer/phpmailer/COMMITMENT | 46 + vendor/phpmailer/phpmailer/LICENSE | 502 ++ vendor/phpmailer/phpmailer/README.md | 222 + vendor/phpmailer/phpmailer/SECURITY.md | 37 + vendor/phpmailer/phpmailer/VERSION | 1 + vendor/phpmailer/phpmailer/composer.json | 65 + vendor/phpmailer/phpmailer/get_oauth_token.php | 146 + .../phpmailer/language/phpmailer.lang-af.php | 26 + .../phpmailer/language/phpmailer.lang-ar.php | 27 + .../phpmailer/language/phpmailer.lang-az.php | 27 + .../phpmailer/language/phpmailer.lang-ba.php | 27 + .../phpmailer/language/phpmailer.lang-be.php | 27 + .../phpmailer/language/phpmailer.lang-bg.php | 27 + .../phpmailer/language/phpmailer.lang-ca.php | 27 + .../phpmailer/language/phpmailer.lang-ch.php | 27 + .../phpmailer/language/phpmailer.lang-cs.php | 28 + .../phpmailer/language/phpmailer.lang-da.php | 29 + .../phpmailer/language/phpmailer.lang-de.php | 28 + .../phpmailer/language/phpmailer.lang-el.php | 26 + .../phpmailer/language/phpmailer.lang-eo.php | 26 + .../phpmailer/language/phpmailer.lang-es.php | 27 + .../phpmailer/language/phpmailer.lang-et.php | 28 + .../phpmailer/language/phpmailer.lang-fa.php | 28 + .../phpmailer/language/phpmailer.lang-fi.php | 28 + .../phpmailer/language/phpmailer.lang-fo.php | 27 + .../phpmailer/language/phpmailer.lang-fr.php | 32 + .../phpmailer/language/phpmailer.lang-gl.php | 27 + .../phpmailer/language/phpmailer.lang-he.php | 27 + .../phpmailer/language/phpmailer.lang-hi.php | 27 + .../phpmailer/language/phpmailer.lang-hr.php | 27 + .../phpmailer/language/phpmailer.lang-hu.php | 27 + .../phpmailer/language/phpmailer.lang-hy.php | 27 + .../phpmailer/language/phpmailer.lang-id.php | 31 + .../phpmailer/language/phpmailer.lang-it.php | 28 + .../phpmailer/language/phpmailer.lang-ja.php | 28 + .../phpmailer/language/phpmailer.lang-ka.php | 27 + .../phpmailer/language/phpmailer.lang-ko.php | 27 + .../phpmailer/language/phpmailer.lang-lt.php | 27 + .../phpmailer/language/phpmailer.lang-lv.php | 27 + .../phpmailer/language/phpmailer.lang-mg.php | 27 + .../phpmailer/language/phpmailer.lang-ms.php | 27 + .../phpmailer/language/phpmailer.lang-nb.php | 26 + .../phpmailer/language/phpmailer.lang-nl.php | 29 + .../phpmailer/language/phpmailer.lang-pl.php | 27 + .../phpmailer/language/phpmailer.lang-pt.php | 27 + .../phpmailer/language/phpmailer.lang-pt_br.php | 30 + .../phpmailer/language/phpmailer.lang-ro.php | 27 + .../phpmailer/language/phpmailer.lang-ru.php | 28 + .../phpmailer/language/phpmailer.lang-sk.php | 30 + .../phpmailer/language/phpmailer.lang-sl.php | 31 + .../phpmailer/language/phpmailer.lang-sr.php | 28 + .../phpmailer/language/phpmailer.lang-sr_latn.php | 28 + .../phpmailer/language/phpmailer.lang-sv.php | 27 + .../phpmailer/language/phpmailer.lang-tl.php | 28 + .../phpmailer/language/phpmailer.lang-tr.php | 31 + .../phpmailer/language/phpmailer.lang-uk.php | 28 + .../phpmailer/language/phpmailer.lang-vi.php | 27 + .../phpmailer/language/phpmailer.lang-zh.php | 29 + .../phpmailer/language/phpmailer.lang-zh_cn.php | 29 + vendor/phpmailer/phpmailer/phpunit.xml.dist | 35 + vendor/phpmailer/phpmailer/src/Exception.php | 40 + vendor/phpmailer/phpmailer/src/OAuth.php | 139 + vendor/phpmailer/phpmailer/src/PHPMailer.php | 4970 +++++++++++++++++ vendor/phpmailer/phpmailer/src/POP3.php | 448 ++ vendor/phpmailer/phpmailer/src/SMTP.php | 1456 +++++ vendor/psr/http-message/CHANGELOG.md | 36 + vendor/psr/http-message/LICENSE | 19 + vendor/psr/http-message/README.md | 13 + vendor/psr/http-message/composer.json | 26 + vendor/psr/http-message/src/MessageInterface.php | 187 + vendor/psr/http-message/src/RequestInterface.php | 129 + vendor/psr/http-message/src/ResponseInterface.php | 68 + .../http-message/src/ServerRequestInterface.php | 261 + vendor/psr/http-message/src/StreamInterface.php | 158 + .../psr/http-message/src/UploadedFileInterface.php | 123 + vendor/psr/http-message/src/UriInterface.php | 323 ++ vendor/ralouphie/getallheaders/LICENSE | 21 + vendor/ralouphie/getallheaders/README.md | 27 + vendor/ralouphie/getallheaders/composer.json | 26 + .../ralouphie/getallheaders/src/getallheaders.php | 46 + vendor/sonata-project/google-authenticator/LICENSE | 21 + .../google-authenticator/composer.json | 50 + .../google-authenticator/sample/example.php | 41 + .../sample/tmpl/ask-for-otp.php | 23 + .../google-authenticator/sample/tmpl/loggedin.php | 19 + .../sample/tmpl/login-error.php | 6 + .../google-authenticator/sample/tmpl/login.php | 8 + .../google-authenticator/sample/tmpl/show-qr.php | 11 + .../google-authenticator/sample/users.dat | 1 + .../google-authenticator/sample/web/Users.php | 155 + .../google-authenticator/sample/web/index.php | 119 + .../google-authenticator/src/FixedBitNotation.php | 292 + .../src/GoogleAuthenticator.php | 178 + .../src/GoogleAuthenticatorInterface.php | 44 + .../google-authenticator/src/GoogleQrUrl.php | 93 + .../google-authenticator/src/RuntimeException.php | 46 + vendor/spomky-labs/base64url/.github/FUNDING.yml | 2 + vendor/spomky-labs/base64url/LICENSE | 22 + vendor/spomky-labs/base64url/composer.json | 35 + vendor/spomky-labs/base64url/src/Base64Url.php | 56 + .../stripe-php/.coveralls.github-actions.yml | 3 + vendor/stripe/stripe-php/.editorconfig | 20 + vendor/stripe/stripe-php/.gitignore | 31 + vendor/stripe/stripe-php/.php_cs.dist | 45 + vendor/stripe/stripe-php/CHANGELOG.md | 1411 +++++ vendor/stripe/stripe-php/CODE_OF_CONDUCT.md | 77 + vendor/stripe/stripe-php/LICENSE | 21 + vendor/stripe/stripe-php/Makefile | 36 + vendor/stripe/stripe-php/README.md | 269 + vendor/stripe/stripe-php/VERSION | 1 + vendor/stripe/stripe-php/build.php | 25 + vendor/stripe/stripe-php/composer.json | 48 + vendor/stripe/stripe-php/data/ca-certificates.crt | 3476 ++++++++++++ vendor/stripe/stripe-php/init.php | 247 + vendor/stripe/stripe-php/lib/Account.php | 432 ++ vendor/stripe/stripe-php/lib/AccountLink.php | 26 + vendor/stripe/stripe-php/lib/AlipayAccount.php | 75 + vendor/stripe/stripe-php/lib/ApiOperations/All.php | 37 + .../stripe/stripe-php/lib/ApiOperations/Create.php | 31 + .../stripe/stripe-php/lib/ApiOperations/Delete.php | 30 + .../lib/ApiOperations/NestedResource.php | 135 + .../stripe-php/lib/ApiOperations/Request.php | 102 + .../stripe-php/lib/ApiOperations/Retrieve.php | 30 + .../stripe/stripe-php/lib/ApiOperations/Update.php | 52 + vendor/stripe/stripe-php/lib/ApiRequestor.php | 594 ++ vendor/stripe/stripe-php/lib/ApiResource.php | 120 + vendor/stripe/stripe-php/lib/ApiResponse.php | 45 + vendor/stripe/stripe-php/lib/ApplePayDomain.php | 31 + vendor/stripe/stripe-php/lib/ApplicationFee.php | 90 + .../stripe/stripe-php/lib/ApplicationFeeRefund.php | 66 + vendor/stripe/stripe-php/lib/Balance.php | 45 + .../stripe/stripe-php/lib/BalanceTransaction.php | 71 + vendor/stripe/stripe-php/lib/BankAccount.php | 132 + vendor/stripe/stripe-php/lib/BaseStripeClient.php | 269 + .../stripe-php/lib/BillingPortal/Configuration.php | 31 + .../stripe-php/lib/BillingPortal/Session.php | 42 + vendor/stripe/stripe-php/lib/BitcoinReceiver.php | 71 + .../stripe/stripe-php/lib/BitcoinTransaction.php | 19 + vendor/stripe/stripe-php/lib/Capability.php | 87 + vendor/stripe/stripe-php/lib/Card.php | 142 + vendor/stripe/stripe-php/lib/Charge.php | 146 + vendor/stripe/stripe-php/lib/Checkout/Session.php | 93 + vendor/stripe/stripe-php/lib/Collection.php | 281 + vendor/stripe/stripe-php/lib/CountrySpec.php | 30 + vendor/stripe/stripe-php/lib/Coupon.php | 41 + vendor/stripe/stripe-php/lib/CreditNote.php | 111 + .../stripe/stripe-php/lib/CreditNoteLineItem.php | 26 + vendor/stripe/stripe-php/lib/Customer.php | 277 + .../stripe-php/lib/CustomerBalanceTransaction.php | 103 + vendor/stripe/stripe-php/lib/Discount.php | 23 + vendor/stripe/stripe-php/lib/Dispute.php | 82 + vendor/stripe/stripe-php/lib/EphemeralKey.php | 43 + vendor/stripe/stripe-php/lib/ErrorObject.php | 164 + vendor/stripe/stripe-php/lib/Event.php | 231 + .../lib/Exception/ApiConnectionException.php | 12 + .../stripe-php/lib/Exception/ApiErrorException.php | 219 + .../lib/Exception/AuthenticationException.php | 11 + .../lib/Exception/BadMethodCallException.php | 7 + .../stripe-php/lib/Exception/CardException.php | 84 + .../lib/Exception/ExceptionInterface.php | 22 + .../lib/Exception/IdempotencyException.php | 11 + .../lib/Exception/InvalidArgumentException.php | 7 + .../lib/Exception/InvalidRequestException.php | 60 + .../lib/Exception/OAuth/ExceptionInterface.php | 10 + .../lib/Exception/OAuth/InvalidClientException.php | 12 + .../lib/Exception/OAuth/InvalidGrantException.php | 13 + .../Exception/OAuth/InvalidRequestException.php | 11 + .../lib/Exception/OAuth/InvalidScopeException.php | 10 + .../lib/Exception/OAuth/OAuthErrorException.php | 19 + .../Exception/OAuth/UnknownOAuthErrorException.php | 12 + .../OAuth/UnsupportedGrantTypeException.php | 11 + .../OAuth/UnsupportedResponseTypeException.php | 11 + .../lib/Exception/PermissionException.php | 11 + .../lib/Exception/RateLimitException.php | 12 + .../Exception/SignatureVerificationException.php | 74 + .../lib/Exception/UnexpectedValueException.php | 7 + .../lib/Exception/UnknownApiErrorException.php | 12 + vendor/stripe/stripe-php/lib/ExchangeRate.php | 30 + vendor/stripe/stripe-php/lib/File.php | 87 + vendor/stripe/stripe-php/lib/FileLink.php | 30 + .../stripe-php/lib/HttpClient/ClientInterface.php | 22 + .../stripe-php/lib/HttpClient/CurlClient.php | 735 +++ .../stripe-php/lib/Identity/VerificationReport.php | 45 + .../lib/Identity/VerificationSession.php | 88 + vendor/stripe/stripe-php/lib/Invoice.php | 262 + vendor/stripe/stripe-php/lib/InvoiceItem.php | 49 + vendor/stripe/stripe-php/lib/InvoiceLineItem.php | 33 + .../stripe-php/lib/Issuing/Authorization.php | 81 + vendor/stripe/stripe-php/lib/Issuing/Card.php | 59 + .../stripe/stripe-php/lib/Issuing/CardDetails.php | 19 + .../stripe/stripe-php/lib/Issuing/Cardholder.php | 39 + vendor/stripe/stripe-php/lib/Issuing/Dispute.php | 53 + .../stripe/stripe-php/lib/Issuing/Transaction.php | 43 + vendor/stripe/stripe-php/lib/LineItem.php | 26 + vendor/stripe/stripe-php/lib/LoginLink.php | 15 + vendor/stripe/stripe-php/lib/Mandate.php | 27 + vendor/stripe/stripe-php/lib/OAuth.php | 101 + vendor/stripe/stripe-php/lib/OAuthErrorObject.php | 31 + vendor/stripe/stripe-php/lib/Order.php | 81 + vendor/stripe/stripe-php/lib/OrderItem.php | 19 + vendor/stripe/stripe-php/lib/OrderReturn.php | 32 + vendor/stripe/stripe-php/lib/PaymentIntent.php | 125 + vendor/stripe/stripe-php/lib/PaymentMethod.php | 90 + vendor/stripe/stripe-php/lib/Payout.php | 108 + vendor/stripe/stripe-php/lib/Person.php | 120 + vendor/stripe/stripe-php/lib/Plan.php | 57 + vendor/stripe/stripe-php/lib/Price.php | 67 + vendor/stripe/stripe-php/lib/Product.php | 54 + vendor/stripe/stripe-php/lib/PromotionCode.php | 33 + .../stripe-php/lib/Radar/EarlyFraudWarning.php | 38 + vendor/stripe/stripe-php/lib/Radar/ValueList.php | 35 + .../stripe/stripe-php/lib/Radar/ValueListItem.php | 31 + vendor/stripe/stripe-php/lib/Recipient.php | 44 + vendor/stripe/stripe-php/lib/RecipientTransfer.php | 36 + vendor/stripe/stripe-php/lib/Refund.php | 58 + .../stripe/stripe-php/lib/Reporting/ReportRun.php | 37 + .../stripe/stripe-php/lib/Reporting/ReportType.php | 34 + vendor/stripe/stripe-php/lib/RequestTelemetry.php | 26 + vendor/stripe/stripe-php/lib/Review.php | 66 + vendor/stripe/stripe-php/lib/SKU.php | 44 + .../stripe-php/lib/Service/AbstractService.php | 79 + .../lib/Service/AbstractServiceFactory.php | 59 + .../stripe-php/lib/Service/AccountLinkService.php | 25 + .../stripe-php/lib/Service/AccountService.php | 381 ++ .../lib/Service/ApplePayDomainService.php | 70 + .../lib/Service/ApplicationFeeService.php | 125 + .../stripe-php/lib/Service/BalanceService.php | 26 + .../lib/Service/BalanceTransactionService.php | 47 + .../BillingPortal/BillingPortalServiceFactory.php | 27 + .../Service/BillingPortal/ConfigurationService.php | 73 + .../lib/Service/BillingPortal/SessionService.php | 23 + .../stripe-php/lib/Service/ChargeService.php | 101 + .../Service/Checkout/CheckoutServiceFactory.php | 25 + .../lib/Service/Checkout/SessionService.php | 73 + .../stripe-php/lib/Service/CoreServiceFactory.php | 129 + .../stripe-php/lib/Service/CountrySpecService.php | 39 + .../stripe-php/lib/Service/CouponService.php | 104 + .../stripe-php/lib/Service/CreditNoteService.php | 156 + .../stripe-php/lib/Service/CustomerService.php | 353 ++ .../stripe-php/lib/Service/DisputeService.php | 83 + .../stripe-php/lib/Service/EphemeralKeyService.php | 43 + .../stripe/stripe-php/lib/Service/EventService.php | 44 + .../stripe-php/lib/Service/ExchangeRateService.php | 41 + .../stripe-php/lib/Service/FileLinkService.php | 70 + .../stripe/stripe-php/lib/Service/FileService.php | 66 + .../Service/Identity/IdentityServiceFactory.php | 27 + .../Service/Identity/VerificationReportService.php | 39 + .../Identity/VerificationSessionService.php | 146 + .../stripe-php/lib/Service/InvoiceItemService.php | 93 + .../stripe-php/lib/Service/InvoiceService.php | 272 + .../lib/Service/Issuing/AuthorizationService.php | 97 + .../stripe-php/lib/Service/Issuing/CardService.php | 73 + .../lib/Service/Issuing/CardholderService.php | 74 + .../lib/Service/Issuing/DisputeService.php | 99 + .../lib/Service/Issuing/IssuingServiceFactory.php | 33 + .../lib/Service/Issuing/TransactionService.php | 59 + .../stripe-php/lib/Service/MandateService.php | 24 + .../stripe/stripe-php/lib/Service/OAuthService.php | 150 + .../stripe-php/lib/Service/OrderReturnService.php | 42 + .../stripe/stripe-php/lib/Service/OrderService.php | 109 + .../lib/Service/PaymentIntentService.php | 181 + .../lib/Service/PaymentMethodService.php | 121 + .../stripe-php/lib/Service/PayoutService.php | 127 + .../stripe/stripe-php/lib/Service/PlanService.php | 91 + .../stripe/stripe-php/lib/Service/PriceService.php | 72 + .../stripe-php/lib/Service/ProductService.php | 92 + .../lib/Service/PromotionCodeService.php | 72 + .../lib/Service/Radar/EarlyFraudWarningService.php | 43 + .../lib/Service/Radar/RadarServiceFactory.php | 29 + .../lib/Service/Radar/ValueListItemService.php | 74 + .../lib/Service/Radar/ValueListService.php | 93 + .../stripe-php/lib/Service/RefundService.php | 76 + .../lib/Service/Reporting/ReportRunService.php | 55 + .../lib/Service/Reporting/ReportTypeService.php | 40 + .../Service/Reporting/ReportingServiceFactory.php | 27 + .../stripe-php/lib/Service/ReviewService.php | 58 + .../stripe-php/lib/Service/SetupAttemptService.php | 23 + .../stripe-php/lib/Service/SetupIntentService.php | 127 + .../lib/Service/Sigma/ScheduledQueryRunService.php | 39 + .../lib/Service/Sigma/SigmaServiceFactory.php | 25 + .../stripe/stripe-php/lib/Service/SkuService.php | 95 + .../stripe-php/lib/Service/SourceService.php | 110 + .../lib/Service/SubscriptionItemService.php | 151 + .../lib/Service/SubscriptionScheduleService.php | 113 + .../stripe-php/lib/Service/SubscriptionService.php | 124 + .../stripe-php/lib/Service/TaxCodeService.php | 41 + .../stripe-php/lib/Service/TaxRateService.php | 71 + .../Service/Terminal/ConnectionTokenService.php | 25 + .../lib/Service/Terminal/LocationService.php | 87 + .../lib/Service/Terminal/ReaderService.php | 87 + .../Service/Terminal/TerminalServiceFactory.php | 29 + .../stripe/stripe-php/lib/Service/TokenService.php | 42 + .../stripe/stripe-php/lib/Service/TopupService.php | 89 + .../stripe-php/lib/Service/TransferService.php | 175 + .../lib/Service/WebhookEndpointService.php | 97 + vendor/stripe/stripe-php/lib/SetupAttempt.php | 32 + vendor/stripe/stripe-php/lib/SetupIntent.php | 114 + .../stripe-php/lib/Sigma/ScheduledQueryRun.php | 37 + .../stripe/stripe-php/lib/SingletonApiResource.php | 38 + vendor/stripe/stripe-php/lib/Source.php | 168 + vendor/stripe/stripe-php/lib/SourceTransaction.php | 20 + vendor/stripe/stripe-php/lib/Stripe.php | 278 + vendor/stripe/stripe-php/lib/StripeClient.php | 79 + .../stripe-php/lib/StripeClientInterface.php | 56 + vendor/stripe/stripe-php/lib/StripeObject.php | 576 ++ vendor/stripe/stripe-php/lib/Subscription.php | 117 + vendor/stripe/stripe-php/lib/SubscriptionItem.php | 84 + .../stripe/stripe-php/lib/SubscriptionSchedule.php | 74 + vendor/stripe/stripe-php/lib/TaxCode.php | 22 + vendor/stripe/stripe-php/lib/TaxId.php | 112 + vendor/stripe/stripe-php/lib/TaxRate.php | 48 + .../stripe-php/lib/Terminal/ConnectionToken.php | 22 + vendor/stripe/stripe-php/lib/Terminal/Location.php | 29 + vendor/stripe/stripe-php/lib/Terminal/Reader.php | 35 + vendor/stripe/stripe-php/lib/ThreeDSecure.php | 37 + vendor/stripe/stripe-php/lib/Token.php | 57 + vendor/stripe/stripe-php/lib/Topup.php | 63 + vendor/stripe/stripe-php/lib/Transfer.php | 130 + vendor/stripe/stripe-php/lib/TransferReversal.php | 79 + vendor/stripe/stripe-php/lib/UsageRecord.php | 25 + .../stripe/stripe-php/lib/UsageRecordSummary.php | 19 + .../stripe-php/lib/Util/CaseInsensitiveArray.php | 72 + .../stripe/stripe-php/lib/Util/DefaultLogger.php | 29 + .../stripe/stripe-php/lib/Util/LoggerInterface.php | 34 + vendor/stripe/stripe-php/lib/Util/ObjectTypes.php | 103 + .../stripe/stripe-php/lib/Util/RandomGenerator.php | 36 + .../stripe/stripe-php/lib/Util/RequestOptions.php | 168 + vendor/stripe/stripe-php/lib/Util/Set.php | 44 + vendor/stripe/stripe-php/lib/Util/Util.php | 265 + vendor/stripe/stripe-php/lib/Webhook.php | 42 + vendor/stripe/stripe-php/lib/WebhookEndpoint.php | 41 + vendor/stripe/stripe-php/lib/WebhookSignature.php | 140 + vendor/stripe/stripe-php/phpdoc.dist.xml | 31 + vendor/stripe/stripe-php/phpstan-baseline.neon | 12 + vendor/stripe/stripe-php/phpstan.neon.dist | 11 + vendor/stripe/stripe-php/update_certs.php | 19 + vendor/symfony/polyfill-intl-idn/Idn.php | 925 ++++ vendor/symfony/polyfill-intl-idn/Info.php | 23 + vendor/symfony/polyfill-intl-idn/LICENSE | 19 + vendor/symfony/polyfill-intl-idn/README.md | 12 + .../Resources/unidata/DisallowedRanges.php | 375 ++ .../polyfill-intl-idn/Resources/unidata/Regex.php | 24 + .../Resources/unidata/deviation.php | 8 + .../Resources/unidata/disallowed.php | 2638 +++++++++ .../Resources/unidata/disallowed_STD3_mapped.php | 308 ++ .../Resources/unidata/disallowed_STD3_valid.php | 71 + .../Resources/unidata/ignored.php | 273 + .../polyfill-intl-idn/Resources/unidata/mapped.php | 5778 ++++++++++++++++++++ .../polyfill-intl-idn/Resources/unidata/virama.php | 65 + vendor/symfony/polyfill-intl-idn/bootstrap.php | 145 + vendor/symfony/polyfill-intl-idn/bootstrap80.php | 125 + vendor/symfony/polyfill-intl-idn/composer.json | 44 + vendor/symfony/polyfill-intl-normalizer/LICENSE | 19 + .../polyfill-intl-normalizer/Normalizer.php | 310 ++ vendor/symfony/polyfill-intl-normalizer/README.md | 14 + .../Resources/stubs/Normalizer.php | 17 + .../Resources/unidata/canonicalComposition.php | 945 ++++ .../Resources/unidata/canonicalDecomposition.php | 2065 +++++++ .../Resources/unidata/combiningClass.php | 876 +++ .../unidata/compatibilityDecomposition.php | 3695 +++++++++++++ .../symfony/polyfill-intl-normalizer/bootstrap.php | 23 + .../polyfill-intl-normalizer/bootstrap80.php | 19 + .../symfony/polyfill-intl-normalizer/composer.json | 39 + vendor/symfony/polyfill-php72/LICENSE | 19 + vendor/symfony/polyfill-php72/Php72.php | 217 + vendor/symfony/polyfill-php72/README.md | 28 + vendor/symfony/polyfill-php72/bootstrap.php | 57 + vendor/symfony/polyfill-php72/composer.json | 35 + vendor/web-token/jwt-core/Algorithm.php | 29 + vendor/web-token/jwt-core/AlgorithmManager.php | 95 + .../web-token/jwt-core/AlgorithmManagerFactory.php | 77 + .../web-token/jwt-core/Converter/JsonConverter.php | 30 + .../jwt-core/Converter/StandardConverter.php | 50 + vendor/web-token/jwt-core/JWK.php | 148 + vendor/web-token/jwt-core/JWKSet.php | 321 ++ vendor/web-token/jwt-core/JWT.php | 23 + vendor/web-token/jwt-core/LICENSE | 21 + vendor/web-token/jwt-core/Util/BigInteger.php | 232 + vendor/web-token/jwt-core/Util/ECKey.php | 306 ++ vendor/web-token/jwt-core/Util/ECSignature.php | 93 + vendor/web-token/jwt-core/Util/Hash.php | 90 + vendor/web-token/jwt-core/Util/JsonConverter.php | 27 + vendor/web-token/jwt-core/Util/KeyChecker.php | 107 + vendor/web-token/jwt-core/Util/RSAKey.php | 322 ++ vendor/web-token/jwt-core/composer.json | 44 + vendor/web-token/jwt-key-mgmt/JKUFactory.php | 50 + vendor/web-token/jwt-key-mgmt/JWKFactory.php | 304 + .../jwt-key-mgmt/KeyAnalyzer/AlgorithmAnalyzer.php | 26 + .../jwt-key-mgmt/KeyAnalyzer/KeyAnalyzer.php | 24 + .../KeyAnalyzer/KeyAnalyzerManager.php | 50 + .../KeyAnalyzer/KeyIdentifierAnalyzer.php | 26 + .../web-token/jwt-key-mgmt/KeyAnalyzer/Message.php | 96 + .../jwt-key-mgmt/KeyAnalyzer/MessageBag.php | 59 + .../jwt-key-mgmt/KeyAnalyzer/NoneAnalyzer.php | 28 + .../jwt-key-mgmt/KeyAnalyzer/OctAnalyzer.php | 50 + .../jwt-key-mgmt/KeyAnalyzer/RsaAnalyzer.php | 34 + .../jwt-key-mgmt/KeyAnalyzer/UsageAnalyzer.php | 31 + .../web-token/jwt-key-mgmt/KeyConverter/ECKey.php | 273 + .../jwt-key-mgmt/KeyConverter/KeyConverter.php | 256 + .../web-token/jwt-key-mgmt/KeyConverter/RSAKey.php | 244 + vendor/web-token/jwt-key-mgmt/LICENSE | 21 + vendor/web-token/jwt-key-mgmt/UrlKeySetFactory.php | 54 + vendor/web-token/jwt-key-mgmt/X5UFactory.php | 66 + vendor/web-token/jwt-key-mgmt/composer.json | 46 + .../jwt-signature-algorithm-ecdsa/ECDSA.php | 79 + .../jwt-signature-algorithm-ecdsa/ES256.php | 32 + .../jwt-signature-algorithm-ecdsa/ES384.php | 32 + .../jwt-signature-algorithm-ecdsa/ES512.php | 32 + .../jwt-signature-algorithm-ecdsa/LICENSE | 21 + .../jwt-signature-algorithm-ecdsa/composer.json | 36 + .../jwt-signature-algorithm-eddsa/EdDSA.php | 76 + .../jwt-signature-algorithm-eddsa/LICENSE | 21 + .../jwt-signature-algorithm-eddsa/composer.json | 36 + .../jwt-signature-algorithm-hmac/HMAC.php | 49 + .../jwt-signature-algorithm-hmac/HS256.php | 27 + .../jwt-signature-algorithm-hmac/HS384.php | 27 + .../jwt-signature-algorithm-hmac/HS512.php | 27 + .../web-token/jwt-signature-algorithm-hmac/LICENSE | 21 + .../jwt-signature-algorithm-hmac/composer.json | 36 + .../web-token/jwt-signature-algorithm-none/LICENSE | 21 + .../jwt-signature-algorithm-none/None.php | 48 + .../jwt-signature-algorithm-none/composer.json | 36 + .../web-token/jwt-signature-algorithm-rsa/LICENSE | 21 + .../jwt-signature-algorithm-rsa/PS256.php | 34 + .../jwt-signature-algorithm-rsa/PS384.php | 34 + .../jwt-signature-algorithm-rsa/PS512.php | 34 + .../jwt-signature-algorithm-rsa/RS256.php | 34 + .../jwt-signature-algorithm-rsa/RS384.php | 34 + .../jwt-signature-algorithm-rsa/RS512.php | 34 + .../web-token/jwt-signature-algorithm-rsa/RSA.php | 62 + .../jwt-signature-algorithm-rsa/composer.json | 36 + .../jwt-signature/Algorithm/SignatureAlgorithm.php | 41 + vendor/web-token/jwt-signature/JWS.php | 159 + vendor/web-token/jwt-signature/JWSBuilder.php | 213 + .../web-token/jwt-signature/JWSBuilderFactory.php | 51 + vendor/web-token/jwt-signature/JWSLoader.php | 122 + .../web-token/jwt-signature/JWSLoaderFactory.php | 62 + vendor/web-token/jwt-signature/JWSTokenSupport.php | 38 + vendor/web-token/jwt-signature/JWSVerifier.php | 160 + .../web-token/jwt-signature/JWSVerifierFactory.php | 44 + vendor/web-token/jwt-signature/LICENSE | 21 + .../jwt-signature/Serializer/CompactSerializer.php | 97 + .../Serializer/JSONFlattenedSerializer.php | 109 + .../Serializer/JSONGeneralSerializer.php | 174 + .../jwt-signature/Serializer/JWSSerializer.php | 42 + .../Serializer/JWSSerializerManager.php | 104 + .../Serializer/JWSSerializerManagerFactory.php | 64 + .../jwt-signature/Serializer/Serializer.php | 22 + vendor/web-token/jwt-signature/Signature.php | 144 + vendor/web-token/jwt-signature/Util/RSA.php | 229 + vendor/web-token/jwt-signature/composer.json | 49 + vendor/web-token/jwt-util-ecc/Curve.php | 315 ++ vendor/web-token/jwt-util-ecc/LICENSE | 21 + vendor/web-token/jwt-util-ecc/Math.php | 97 + .../web-token/jwt-util-ecc/ModularArithmetic.php | 35 + vendor/web-token/jwt-util-ecc/NistCurve.php | 92 + vendor/web-token/jwt-util-ecc/Point.php | 152 + vendor/web-token/jwt-util-ecc/PrivateKey.php | 67 + vendor/web-token/jwt-util-ecc/PublicKey.php | 70 + vendor/web-token/jwt-util-ecc/composer.json | 38 + 922 files changed, 141539 insertions(+) create mode 100644 vendor/autoload.php create mode 100644 vendor/composer/ClassLoader.php create mode 100644 vendor/composer/InstalledVersions.php create mode 100644 vendor/composer/LICENSE create mode 100644 vendor/composer/autoload_classmap.php create mode 100644 vendor/composer/autoload_files.php create mode 100644 vendor/composer/autoload_namespaces.php create mode 100644 vendor/composer/autoload_psr4.php create mode 100644 vendor/composer/autoload_real.php create mode 100644 vendor/composer/autoload_static.php create mode 100644 vendor/composer/ca-bundle/LICENSE create mode 100644 vendor/composer/ca-bundle/README.md create mode 100644 vendor/composer/ca-bundle/composer.json create mode 100644 vendor/composer/ca-bundle/res/cacert.pem create mode 100644 vendor/composer/ca-bundle/src/CaBundle.php create mode 100644 vendor/composer/installed.json create mode 100644 vendor/composer/installed.php create mode 100644 vendor/composer/platform_check.php create mode 100644 vendor/fgrosse/phpasn1/CHANGELOG.md create mode 100644 vendor/fgrosse/phpasn1/LICENSE create mode 100644 vendor/fgrosse/phpasn1/README.md create mode 100644 vendor/fgrosse/phpasn1/composer.json create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/ASNObject.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/AbstractString.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/AbstractTime.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Base128.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Composite/AttributeTypeAndValue.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Composite/RDNString.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Composite/RelativeDistinguishedName.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Construct.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Exception/NotImplementedException.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Exception/ParserException.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/ExplicitlyTaggedObject.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Identifier.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/OID.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Parsable.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/TemplateParser.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/BMPString.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/BitString.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/Boolean.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/CharacterString.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/Enumerated.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/GeneralString.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/GeneralizedTime.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/GraphicString.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/IA5String.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/Integer.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/NullObject.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/NumericString.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/ObjectDescriptor.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/ObjectIdentifier.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/OctetString.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/PrintableString.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/RelativeObjectIdentifier.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/Sequence.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/Set.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/T61String.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/UTCTime.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/UTF8String.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/UniversalString.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/Universal/VisibleString.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/UnknownConstructedObject.php create mode 100644 vendor/fgrosse/phpasn1/lib/ASN1/UnknownObject.php create mode 100644 vendor/fgrosse/phpasn1/lib/Utility/BigInteger.php create mode 100644 vendor/fgrosse/phpasn1/lib/Utility/BigIntegerBcmath.php create mode 100644 vendor/fgrosse/phpasn1/lib/Utility/BigIntegerGmp.php create mode 100644 vendor/fgrosse/phpasn1/lib/X509/AlgorithmIdentifier.php create mode 100644 vendor/fgrosse/phpasn1/lib/X509/CSR/Attributes.php create mode 100644 vendor/fgrosse/phpasn1/lib/X509/CSR/CSR.php create mode 100644 vendor/fgrosse/phpasn1/lib/X509/CertificateExtensions.php create mode 100644 vendor/fgrosse/phpasn1/lib/X509/CertificateSubject.php create mode 100644 vendor/fgrosse/phpasn1/lib/X509/PrivateKey.php create mode 100644 vendor/fgrosse/phpasn1/lib/X509/PublicKey.php create mode 100644 vendor/fgrosse/phpasn1/lib/X509/SAN/DNSName.php create mode 100644 vendor/fgrosse/phpasn1/lib/X509/SAN/IPAddress.php create mode 100644 vendor/fgrosse/phpasn1/lib/X509/SAN/SubjectAlternativeNames.php create mode 100644 vendor/geoip2/geoip2/CHANGELOG.md create mode 100644 vendor/geoip2/geoip2/LICENSE create mode 100644 vendor/geoip2/geoip2/README.md create mode 100644 vendor/geoip2/geoip2/composer.json create mode 100644 vendor/geoip2/geoip2/examples/benchmark.php create mode 100644 vendor/geoip2/geoip2/src/Database/Reader.php create mode 100644 vendor/geoip2/geoip2/src/Exception/AddressNotFoundException.php create mode 100644 vendor/geoip2/geoip2/src/Exception/AuthenticationException.php create mode 100644 vendor/geoip2/geoip2/src/Exception/GeoIp2Exception.php create mode 100644 vendor/geoip2/geoip2/src/Exception/HttpException.php create mode 100644 vendor/geoip2/geoip2/src/Exception/InvalidRequestException.php create mode 100644 vendor/geoip2/geoip2/src/Exception/OutOfQueriesException.php create mode 100644 vendor/geoip2/geoip2/src/Model/AbstractModel.php create mode 100644 vendor/geoip2/geoip2/src/Model/AnonymousIp.php create mode 100644 vendor/geoip2/geoip2/src/Model/Asn.php create mode 100644 vendor/geoip2/geoip2/src/Model/City.php create mode 100644 vendor/geoip2/geoip2/src/Model/ConnectionType.php create mode 100644 vendor/geoip2/geoip2/src/Model/Country.php create mode 100644 vendor/geoip2/geoip2/src/Model/Domain.php create mode 100644 vendor/geoip2/geoip2/src/Model/Enterprise.php create mode 100644 vendor/geoip2/geoip2/src/Model/Insights.php create mode 100644 vendor/geoip2/geoip2/src/Model/Isp.php create mode 100644 vendor/geoip2/geoip2/src/ProviderInterface.php create mode 100644 vendor/geoip2/geoip2/src/Record/AbstractPlaceRecord.php create mode 100644 vendor/geoip2/geoip2/src/Record/AbstractRecord.php create mode 100644 vendor/geoip2/geoip2/src/Record/City.php create mode 100644 vendor/geoip2/geoip2/src/Record/Continent.php create mode 100644 vendor/geoip2/geoip2/src/Record/Country.php create mode 100644 vendor/geoip2/geoip2/src/Record/Location.php create mode 100644 vendor/geoip2/geoip2/src/Record/MaxMind.php create mode 100644 vendor/geoip2/geoip2/src/Record/Postal.php create mode 100644 vendor/geoip2/geoip2/src/Record/RepresentedCountry.php create mode 100644 vendor/geoip2/geoip2/src/Record/Subdivision.php create mode 100644 vendor/geoip2/geoip2/src/Record/Traits.php create mode 100644 vendor/geoip2/geoip2/src/Util.php create mode 100644 vendor/geoip2/geoip2/src/WebService/Client.php create mode 100644 vendor/guzzlehttp/guzzle/.php_cs create mode 100644 vendor/guzzlehttp/guzzle/CHANGELOG.md create mode 100644 vendor/guzzlehttp/guzzle/Dockerfile create mode 100644 vendor/guzzlehttp/guzzle/LICENSE create mode 100644 vendor/guzzlehttp/guzzle/README.md create mode 100644 vendor/guzzlehttp/guzzle/UPGRADING.md create mode 100644 vendor/guzzlehttp/guzzle/composer.json create mode 100644 vendor/guzzlehttp/guzzle/src/Client.php create mode 100644 vendor/guzzlehttp/guzzle/src/ClientInterface.php create mode 100644 vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php create mode 100644 vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php create mode 100644 vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php create mode 100644 vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php create mode 100644 vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/ClientException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/RequestException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/SeekException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/ServerException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Exception/TransferException.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/Proxy.php create mode 100644 vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php create mode 100644 vendor/guzzlehttp/guzzle/src/HandlerStack.php create mode 100644 vendor/guzzlehttp/guzzle/src/MessageFormatter.php create mode 100644 vendor/guzzlehttp/guzzle/src/Middleware.php create mode 100644 vendor/guzzlehttp/guzzle/src/Pool.php create mode 100644 vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php create mode 100644 vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php create mode 100644 vendor/guzzlehttp/guzzle/src/RequestOptions.php create mode 100644 vendor/guzzlehttp/guzzle/src/RetryMiddleware.php create mode 100644 vendor/guzzlehttp/guzzle/src/TransferStats.php create mode 100644 vendor/guzzlehttp/guzzle/src/UriTemplate.php create mode 100644 vendor/guzzlehttp/guzzle/src/Utils.php create mode 100644 vendor/guzzlehttp/guzzle/src/functions.php create mode 100644 vendor/guzzlehttp/guzzle/src/functions_include.php create mode 100644 vendor/guzzlehttp/promises/CHANGELOG.md create mode 100644 vendor/guzzlehttp/promises/LICENSE create mode 100644 vendor/guzzlehttp/promises/Makefile create mode 100644 vendor/guzzlehttp/promises/README.md create mode 100644 vendor/guzzlehttp/promises/composer.json create mode 100644 vendor/guzzlehttp/promises/src/AggregateException.php create mode 100644 vendor/guzzlehttp/promises/src/CancellationException.php create mode 100644 vendor/guzzlehttp/promises/src/Coroutine.php create mode 100644 vendor/guzzlehttp/promises/src/Create.php create mode 100644 vendor/guzzlehttp/promises/src/Each.php create mode 100644 vendor/guzzlehttp/promises/src/EachPromise.php create mode 100644 vendor/guzzlehttp/promises/src/FulfilledPromise.php create mode 100644 vendor/guzzlehttp/promises/src/Is.php create mode 100644 vendor/guzzlehttp/promises/src/Promise.php create mode 100644 vendor/guzzlehttp/promises/src/PromiseInterface.php create mode 100644 vendor/guzzlehttp/promises/src/PromisorInterface.php create mode 100644 vendor/guzzlehttp/promises/src/RejectedPromise.php create mode 100644 vendor/guzzlehttp/promises/src/RejectionException.php create mode 100644 vendor/guzzlehttp/promises/src/TaskQueue.php create mode 100644 vendor/guzzlehttp/promises/src/TaskQueueInterface.php create mode 100644 vendor/guzzlehttp/promises/src/Utils.php create mode 100644 vendor/guzzlehttp/promises/src/functions.php create mode 100644 vendor/guzzlehttp/promises/src/functions_include.php create mode 100644 vendor/guzzlehttp/psr7/.github/workflows/bc.yml create mode 100644 vendor/guzzlehttp/psr7/.github/workflows/ci.yml create mode 100644 vendor/guzzlehttp/psr7/.github/workflows/integration.yml create mode 100644 vendor/guzzlehttp/psr7/.github/workflows/static.yml create mode 100644 vendor/guzzlehttp/psr7/.php_cs.dist create mode 100644 vendor/guzzlehttp/psr7/CHANGELOG.md create mode 100644 vendor/guzzlehttp/psr7/LICENSE create mode 100644 vendor/guzzlehttp/psr7/README.md create mode 100644 vendor/guzzlehttp/psr7/composer.json create mode 100644 vendor/guzzlehttp/psr7/src/AppendStream.php create mode 100644 vendor/guzzlehttp/psr7/src/BufferStream.php create mode 100644 vendor/guzzlehttp/psr7/src/CachingStream.php create mode 100644 vendor/guzzlehttp/psr7/src/DroppingStream.php create mode 100644 vendor/guzzlehttp/psr7/src/FnStream.php create mode 100644 vendor/guzzlehttp/psr7/src/Header.php create mode 100644 vendor/guzzlehttp/psr7/src/InflateStream.php create mode 100644 vendor/guzzlehttp/psr7/src/LazyOpenStream.php create mode 100644 vendor/guzzlehttp/psr7/src/LimitStream.php create mode 100644 vendor/guzzlehttp/psr7/src/Message.php create mode 100644 vendor/guzzlehttp/psr7/src/MessageTrait.php create mode 100644 vendor/guzzlehttp/psr7/src/MimeType.php create mode 100644 vendor/guzzlehttp/psr7/src/MultipartStream.php create mode 100644 vendor/guzzlehttp/psr7/src/NoSeekStream.php create mode 100644 vendor/guzzlehttp/psr7/src/PumpStream.php create mode 100644 vendor/guzzlehttp/psr7/src/Query.php create mode 100644 vendor/guzzlehttp/psr7/src/Request.php create mode 100644 vendor/guzzlehttp/psr7/src/Response.php create mode 100644 vendor/guzzlehttp/psr7/src/Rfc7230.php create mode 100644 vendor/guzzlehttp/psr7/src/ServerRequest.php create mode 100644 vendor/guzzlehttp/psr7/src/Stream.php create mode 100644 vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php create mode 100644 vendor/guzzlehttp/psr7/src/StreamWrapper.php create mode 100644 vendor/guzzlehttp/psr7/src/UploadedFile.php create mode 100644 vendor/guzzlehttp/psr7/src/Uri.php create mode 100644 vendor/guzzlehttp/psr7/src/UriNormalizer.php create mode 100644 vendor/guzzlehttp/psr7/src/UriResolver.php create mode 100644 vendor/guzzlehttp/psr7/src/Utils.php create mode 100644 vendor/guzzlehttp/psr7/src/functions.php create mode 100644 vendor/guzzlehttp/psr7/src/functions_include.php create mode 100644 vendor/maxmind-db/reader/CHANGELOG.md create mode 100644 vendor/maxmind-db/reader/LICENSE create mode 100644 vendor/maxmind-db/reader/README.md create mode 100644 vendor/maxmind-db/reader/autoload.php create mode 100644 vendor/maxmind-db/reader/composer.json create mode 100644 vendor/maxmind-db/reader/ext/config.m4 create mode 100644 vendor/maxmind-db/reader/ext/maxminddb.c create mode 100644 vendor/maxmind-db/reader/ext/php_maxminddb.h create mode 100644 vendor/maxmind-db/reader/ext/tests/001-load.phpt create mode 100644 vendor/maxmind-db/reader/ext/tests/002-final.phpt create mode 100644 vendor/maxmind-db/reader/ext/tests/003-open-basedir.phpt create mode 100644 vendor/maxmind-db/reader/package.xml create mode 100644 vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php create mode 100644 vendor/maxmind-db/reader/src/MaxMind/Db/Reader/Decoder.php create mode 100644 vendor/maxmind-db/reader/src/MaxMind/Db/Reader/InvalidDatabaseException.php create mode 100644 vendor/maxmind-db/reader/src/MaxMind/Db/Reader/Metadata.php create mode 100644 vendor/maxmind-db/reader/src/MaxMind/Db/Reader/Util.php create mode 100644 vendor/maxmind/web-service-common/CHANGELOG.md create mode 100644 vendor/maxmind/web-service-common/LICENSE create mode 100644 vendor/maxmind/web-service-common/README.md create mode 100644 vendor/maxmind/web-service-common/composer.json create mode 100644 vendor/maxmind/web-service-common/dev-bin/release.sh create mode 100644 vendor/maxmind/web-service-common/src/Exception/AuthenticationException.php create mode 100644 vendor/maxmind/web-service-common/src/Exception/HttpException.php create mode 100644 vendor/maxmind/web-service-common/src/Exception/InsufficientFundsException.php create mode 100644 vendor/maxmind/web-service-common/src/Exception/InvalidInputException.php create mode 100644 vendor/maxmind/web-service-common/src/Exception/InvalidRequestException.php create mode 100644 vendor/maxmind/web-service-common/src/Exception/IpAddressNotFoundException.php create mode 100644 vendor/maxmind/web-service-common/src/Exception/PermissionRequiredException.php create mode 100644 vendor/maxmind/web-service-common/src/Exception/WebServiceException.php create mode 100644 vendor/maxmind/web-service-common/src/WebService/Client.php create mode 100644 vendor/maxmind/web-service-common/src/WebService/Http/CurlRequest.php create mode 100644 vendor/maxmind/web-service-common/src/WebService/Http/Request.php create mode 100644 vendor/maxmind/web-service-common/src/WebService/Http/RequestFactory.php create mode 100644 vendor/minishlink/web-push/LICENSE create mode 100644 vendor/minishlink/web-push/composer.json create mode 100644 vendor/minishlink/web-push/src/Encryption.php create mode 100644 vendor/minishlink/web-push/src/MessageSentReport.php create mode 100644 vendor/minishlink/web-push/src/Notification.php create mode 100644 vendor/minishlink/web-push/src/Subscription.php create mode 100644 vendor/minishlink/web-push/src/SubscriptionInterface.php create mode 100644 vendor/minishlink/web-push/src/Utils.php create mode 100644 vendor/minishlink/web-push/src/VAPID.php create mode 100644 vendor/minishlink/web-push/src/WebPush.php create mode 100644 vendor/paragonie/random_compat/LICENSE create mode 100644 vendor/paragonie/random_compat/build-phar.sh create mode 100644 vendor/paragonie/random_compat/composer.json create mode 100644 vendor/paragonie/random_compat/dist/random_compat.phar.pubkey create mode 100644 vendor/paragonie/random_compat/dist/random_compat.phar.pubkey.asc create mode 100644 vendor/paragonie/random_compat/lib/random.php create mode 100644 vendor/paragonie/random_compat/other/build_phar.php create mode 100644 vendor/paragonie/random_compat/psalm-autoload.php create mode 100644 vendor/paragonie/random_compat/psalm.xml create mode 100644 vendor/paragonie/sodium_compat/.github/workflows/ci.yml create mode 100644 vendor/paragonie/sodium_compat/.gitignore create mode 100644 vendor/paragonie/sodium_compat/LICENSE create mode 100644 vendor/paragonie/sodium_compat/README.md create mode 100644 vendor/paragonie/sodium_compat/appveyor.yml create mode 100644 vendor/paragonie/sodium_compat/autoload-fast.php create mode 100644 vendor/paragonie/sodium_compat/autoload-pedantic.php create mode 100644 vendor/paragonie/sodium_compat/autoload-php7.php create mode 100644 vendor/paragonie/sodium_compat/autoload-phpunit.php create mode 100644 vendor/paragonie/sodium_compat/autoload.php create mode 100644 vendor/paragonie/sodium_compat/build-phar.sh create mode 100644 vendor/paragonie/sodium_compat/composer-php52.json create mode 100644 vendor/paragonie/sodium_compat/composer.json create mode 100644 vendor/paragonie/sodium_compat/dist/Makefile create mode 100644 vendor/paragonie/sodium_compat/dist/box.json create mode 100644 vendor/paragonie/sodium_compat/lib/constants.php create mode 100644 vendor/paragonie/sodium_compat/lib/namespaced.php create mode 100644 vendor/paragonie/sodium_compat/lib/php72compat.php create mode 100644 vendor/paragonie/sodium_compat/lib/php72compat_const.php create mode 100644 vendor/paragonie/sodium_compat/lib/ristretto255.php create mode 100644 vendor/paragonie/sodium_compat/lib/sodium_compat.php create mode 100644 vendor/paragonie/sodium_compat/lib/stream-xchacha20.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Compat.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/BLAKE2b.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/ChaCha20.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/ChaCha20/Ctx.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/ChaCha20/IetfCtx.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/Curve25519.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/Curve25519/Fe.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/Cached.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/P1p1.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/P2.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/P3.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/Precomp.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/Curve25519/H.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/Ed25519.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/HChaCha20.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/HSalsa20.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/Poly1305.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/Poly1305/State.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/Salsa20.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/SipHash.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/Util.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/X25519.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/XChaCha20.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Core/Xsalsa20.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/Crypto.php create mode 100644 vendor/paragonie/sodium_compat/namespaced/File.php create mode 100644 vendor/paragonie/sodium_compat/phpunit.xml.dist create mode 100644 vendor/paragonie/sodium_compat/psalm-above-3.xml create mode 100644 vendor/paragonie/sodium_compat/psalm-below-3.xml create mode 100644 vendor/paragonie/sodium_compat/src/Compat.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/BLAKE2b.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/Base64/Common.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/Base64/Original.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/Base64/UrlSafe.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/ChaCha20.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/ChaCha20/Ctx.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/ChaCha20/IetfCtx.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/Curve25519.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/Curve25519/Fe.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/Curve25519/Ge/Cached.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/Curve25519/Ge/P1p1.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/Curve25519/Ge/P2.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/Curve25519/Ge/P3.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/Curve25519/Ge/Precomp.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/Curve25519/H.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/Curve25519/README.md create mode 100644 vendor/paragonie/sodium_compat/src/Core/Ed25519.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/HChaCha20.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/HSalsa20.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/Poly1305.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/Poly1305/State.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/Ristretto255.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/Salsa20.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/SecretStream/State.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/SipHash.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/Util.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/X25519.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/XChaCha20.php create mode 100644 vendor/paragonie/sodium_compat/src/Core/XSalsa20.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/BLAKE2b.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/ChaCha20.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/ChaCha20/Ctx.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/ChaCha20/IetfCtx.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/Curve25519.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/Curve25519/Fe.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/Curve25519/Ge/Cached.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/Curve25519/Ge/P1p1.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/Curve25519/Ge/P2.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/Curve25519/Ge/P3.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/Curve25519/Ge/Precomp.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/Curve25519/H.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/Curve25519/README.md create mode 100644 vendor/paragonie/sodium_compat/src/Core32/Ed25519.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/HChaCha20.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/HSalsa20.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/Int32.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/Int64.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/Poly1305.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/Poly1305/State.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/Salsa20.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/SecretStream/State.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/SipHash.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/Util.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/X25519.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/XChaCha20.php create mode 100644 vendor/paragonie/sodium_compat/src/Core32/XSalsa20.php create mode 100644 vendor/paragonie/sodium_compat/src/Crypto.php create mode 100644 vendor/paragonie/sodium_compat/src/Crypto32.php create mode 100644 vendor/paragonie/sodium_compat/src/File.php create mode 100644 vendor/paragonie/sodium_compat/src/PHP52/SplFixedArray.php create mode 100644 vendor/paragonie/sodium_compat/src/SodiumException.php create mode 100644 vendor/paypal/paypal-checkout-sdk/.gitignore create mode 100644 vendor/paypal/paypal-checkout-sdk/LICENSE create mode 100644 vendor/paypal/paypal-checkout-sdk/README.md create mode 100644 vendor/paypal/paypal-checkout-sdk/composer.json create mode 100644 vendor/paypal/paypal-checkout-sdk/composer.phar create mode 100644 vendor/paypal/paypal-checkout-sdk/gen.yml create mode 100644 vendor/paypal/paypal-checkout-sdk/homepage.jpg create mode 100644 vendor/paypal/paypal-checkout-sdk/init create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessToken.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessTokenRequest.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AuthorizationInjector.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/FPTIInstrumentationInjector.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/GzipInjector.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/PayPalEnvironment.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/PayPalHttpClient.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/ProductionEnvironment.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/RefreshTokenRequest.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/SandboxEnvironment.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/UserAgent.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/Version.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersAuthorizeRequest.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersCaptureRequest.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersCreateRequest.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersGetRequest.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersPatchRequest.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersValidateRequest.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsCaptureRequest.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsGetRequest.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsReauthorizeRequest.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsVoidRequest.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/CapturesGetRequest.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/CapturesRefundRequest.php create mode 100644 vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/RefundsGetRequest.php create mode 100644 vendor/paypal/paypal-checkout-sdk/phpunit.xml create mode 100644 vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/AuthorizeOrder.php create mode 100644 vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/CaptureOrder.php create mode 100644 vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/CreateOrder.php create mode 100644 vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/RunAll.php create mode 100644 vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/CaptureOrder.php create mode 100644 vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/CreateOrder.php create mode 100644 vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/RunAll.php create mode 100644 vendor/paypal/paypal-checkout-sdk/samples/ErrorSample.php create mode 100644 vendor/paypal/paypal-checkout-sdk/samples/GetOrder.php create mode 100644 vendor/paypal/paypal-checkout-sdk/samples/PatchOrder.php create mode 100644 vendor/paypal/paypal-checkout-sdk/samples/PayPalClient.php create mode 100644 vendor/paypal/paypal-checkout-sdk/samples/RefundOrder.php create mode 100644 vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersAuthorizeTest.php create mode 100644 vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersCaptureTest.php create mode 100644 vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersCreateTest.php create mode 100644 vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersGetTest.php create mode 100644 vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersPatchTest.php create mode 100644 vendor/paypal/paypal-checkout-sdk/tests/TestHarness.php create mode 100644 vendor/paypal/paypalhttp/.gitattributes create mode 100644 vendor/paypal/paypalhttp/.gitignore create mode 100644 vendor/paypal/paypalhttp/.travis.yml create mode 100644 vendor/paypal/paypalhttp/CHANGELOG.md create mode 100644 vendor/paypal/paypalhttp/CONTRIBUTING.md create mode 100644 vendor/paypal/paypalhttp/LICENSE create mode 100644 vendor/paypal/paypalhttp/README.md create mode 100644 vendor/paypal/paypalhttp/Rakefile create mode 100644 vendor/paypal/paypalhttp/composer.json create mode 100644 vendor/paypal/paypalhttp/lib/PayPalHttp/Curl.php create mode 100644 vendor/paypal/paypalhttp/lib/PayPalHttp/Encoder.php create mode 100644 vendor/paypal/paypalhttp/lib/PayPalHttp/Environment.php create mode 100644 vendor/paypal/paypalhttp/lib/PayPalHttp/HttpClient.php create mode 100644 vendor/paypal/paypalhttp/lib/PayPalHttp/HttpException.php create mode 100644 vendor/paypal/paypalhttp/lib/PayPalHttp/HttpRequest.php create mode 100644 vendor/paypal/paypalhttp/lib/PayPalHttp/HttpResponse.php create mode 100644 vendor/paypal/paypalhttp/lib/PayPalHttp/IOException.php create mode 100644 vendor/paypal/paypalhttp/lib/PayPalHttp/Injector.php create mode 100644 vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer.php create mode 100644 vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Form.php create mode 100644 vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/FormPart.php create mode 100644 vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Json.php create mode 100644 vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Multipart.php create mode 100644 vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Text.php create mode 100644 vendor/paypal/paypalhttp/phpunit.xml create mode 100644 vendor/phpmailer/phpmailer/COMMITMENT create mode 100644 vendor/phpmailer/phpmailer/LICENSE create mode 100644 vendor/phpmailer/phpmailer/README.md create mode 100644 vendor/phpmailer/phpmailer/SECURITY.md create mode 100644 vendor/phpmailer/phpmailer/VERSION create mode 100644 vendor/phpmailer/phpmailer/composer.json create mode 100644 vendor/phpmailer/phpmailer/get_oauth_token.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ar.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ba.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-el.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-eo.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-fo.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-gl.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-hy.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-pt.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-uk.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php create mode 100644 vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php create mode 100644 vendor/phpmailer/phpmailer/phpunit.xml.dist create mode 100644 vendor/phpmailer/phpmailer/src/Exception.php create mode 100644 vendor/phpmailer/phpmailer/src/OAuth.php create mode 100644 vendor/phpmailer/phpmailer/src/PHPMailer.php create mode 100644 vendor/phpmailer/phpmailer/src/POP3.php create mode 100644 vendor/phpmailer/phpmailer/src/SMTP.php create mode 100644 vendor/psr/http-message/CHANGELOG.md create mode 100644 vendor/psr/http-message/LICENSE create mode 100644 vendor/psr/http-message/README.md create mode 100644 vendor/psr/http-message/composer.json create mode 100644 vendor/psr/http-message/src/MessageInterface.php create mode 100644 vendor/psr/http-message/src/RequestInterface.php create mode 100644 vendor/psr/http-message/src/ResponseInterface.php create mode 100644 vendor/psr/http-message/src/ServerRequestInterface.php create mode 100644 vendor/psr/http-message/src/StreamInterface.php create mode 100644 vendor/psr/http-message/src/UploadedFileInterface.php create mode 100644 vendor/psr/http-message/src/UriInterface.php create mode 100644 vendor/ralouphie/getallheaders/LICENSE create mode 100644 vendor/ralouphie/getallheaders/README.md create mode 100644 vendor/ralouphie/getallheaders/composer.json create mode 100644 vendor/ralouphie/getallheaders/src/getallheaders.php create mode 100644 vendor/sonata-project/google-authenticator/LICENSE create mode 100644 vendor/sonata-project/google-authenticator/composer.json create mode 100644 vendor/sonata-project/google-authenticator/sample/example.php create mode 100644 vendor/sonata-project/google-authenticator/sample/tmpl/ask-for-otp.php create mode 100644 vendor/sonata-project/google-authenticator/sample/tmpl/loggedin.php create mode 100644 vendor/sonata-project/google-authenticator/sample/tmpl/login-error.php create mode 100644 vendor/sonata-project/google-authenticator/sample/tmpl/login.php create mode 100644 vendor/sonata-project/google-authenticator/sample/tmpl/show-qr.php create mode 100644 vendor/sonata-project/google-authenticator/sample/users.dat create mode 100644 vendor/sonata-project/google-authenticator/sample/web/Users.php create mode 100644 vendor/sonata-project/google-authenticator/sample/web/index.php create mode 100644 vendor/sonata-project/google-authenticator/src/FixedBitNotation.php create mode 100644 vendor/sonata-project/google-authenticator/src/GoogleAuthenticator.php create mode 100644 vendor/sonata-project/google-authenticator/src/GoogleAuthenticatorInterface.php create mode 100644 vendor/sonata-project/google-authenticator/src/GoogleQrUrl.php create mode 100644 vendor/sonata-project/google-authenticator/src/RuntimeException.php create mode 100644 vendor/spomky-labs/base64url/.github/FUNDING.yml create mode 100644 vendor/spomky-labs/base64url/LICENSE create mode 100644 vendor/spomky-labs/base64url/composer.json create mode 100644 vendor/spomky-labs/base64url/src/Base64Url.php create mode 100644 vendor/stripe/stripe-php/.coveralls.github-actions.yml create mode 100644 vendor/stripe/stripe-php/.editorconfig create mode 100644 vendor/stripe/stripe-php/.gitignore create mode 100644 vendor/stripe/stripe-php/.php_cs.dist create mode 100644 vendor/stripe/stripe-php/CHANGELOG.md create mode 100644 vendor/stripe/stripe-php/CODE_OF_CONDUCT.md create mode 100644 vendor/stripe/stripe-php/LICENSE create mode 100644 vendor/stripe/stripe-php/Makefile create mode 100644 vendor/stripe/stripe-php/README.md create mode 100644 vendor/stripe/stripe-php/VERSION create mode 100644 vendor/stripe/stripe-php/build.php create mode 100644 vendor/stripe/stripe-php/composer.json create mode 100644 vendor/stripe/stripe-php/data/ca-certificates.crt create mode 100644 vendor/stripe/stripe-php/init.php create mode 100644 vendor/stripe/stripe-php/lib/Account.php create mode 100644 vendor/stripe/stripe-php/lib/AccountLink.php create mode 100644 vendor/stripe/stripe-php/lib/AlipayAccount.php create mode 100644 vendor/stripe/stripe-php/lib/ApiOperations/All.php create mode 100644 vendor/stripe/stripe-php/lib/ApiOperations/Create.php create mode 100644 vendor/stripe/stripe-php/lib/ApiOperations/Delete.php create mode 100644 vendor/stripe/stripe-php/lib/ApiOperations/NestedResource.php create mode 100644 vendor/stripe/stripe-php/lib/ApiOperations/Request.php create mode 100644 vendor/stripe/stripe-php/lib/ApiOperations/Retrieve.php create mode 100644 vendor/stripe/stripe-php/lib/ApiOperations/Update.php create mode 100644 vendor/stripe/stripe-php/lib/ApiRequestor.php create mode 100644 vendor/stripe/stripe-php/lib/ApiResource.php create mode 100644 vendor/stripe/stripe-php/lib/ApiResponse.php create mode 100644 vendor/stripe/stripe-php/lib/ApplePayDomain.php create mode 100644 vendor/stripe/stripe-php/lib/ApplicationFee.php create mode 100644 vendor/stripe/stripe-php/lib/ApplicationFeeRefund.php create mode 100644 vendor/stripe/stripe-php/lib/Balance.php create mode 100644 vendor/stripe/stripe-php/lib/BalanceTransaction.php create mode 100644 vendor/stripe/stripe-php/lib/BankAccount.php create mode 100644 vendor/stripe/stripe-php/lib/BaseStripeClient.php create mode 100644 vendor/stripe/stripe-php/lib/BillingPortal/Configuration.php create mode 100644 vendor/stripe/stripe-php/lib/BillingPortal/Session.php create mode 100644 vendor/stripe/stripe-php/lib/BitcoinReceiver.php create mode 100644 vendor/stripe/stripe-php/lib/BitcoinTransaction.php create mode 100644 vendor/stripe/stripe-php/lib/Capability.php create mode 100644 vendor/stripe/stripe-php/lib/Card.php create mode 100644 vendor/stripe/stripe-php/lib/Charge.php create mode 100644 vendor/stripe/stripe-php/lib/Checkout/Session.php create mode 100644 vendor/stripe/stripe-php/lib/Collection.php create mode 100644 vendor/stripe/stripe-php/lib/CountrySpec.php create mode 100644 vendor/stripe/stripe-php/lib/Coupon.php create mode 100644 vendor/stripe/stripe-php/lib/CreditNote.php create mode 100644 vendor/stripe/stripe-php/lib/CreditNoteLineItem.php create mode 100644 vendor/stripe/stripe-php/lib/Customer.php create mode 100644 vendor/stripe/stripe-php/lib/CustomerBalanceTransaction.php create mode 100644 vendor/stripe/stripe-php/lib/Discount.php create mode 100644 vendor/stripe/stripe-php/lib/Dispute.php create mode 100644 vendor/stripe/stripe-php/lib/EphemeralKey.php create mode 100644 vendor/stripe/stripe-php/lib/ErrorObject.php create mode 100644 vendor/stripe/stripe-php/lib/Event.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/ApiConnectionException.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/ApiErrorException.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/AuthenticationException.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/BadMethodCallException.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/CardException.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/ExceptionInterface.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/IdempotencyException.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/InvalidArgumentException.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/InvalidRequestException.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/OAuth/ExceptionInterface.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/OAuth/InvalidClientException.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/OAuth/InvalidGrantException.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/OAuth/InvalidRequestException.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/OAuth/InvalidScopeException.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/OAuth/OAuthErrorException.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/OAuth/UnknownOAuthErrorException.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/OAuth/UnsupportedGrantTypeException.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/OAuth/UnsupportedResponseTypeException.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/PermissionException.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/RateLimitException.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/SignatureVerificationException.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/UnexpectedValueException.php create mode 100644 vendor/stripe/stripe-php/lib/Exception/UnknownApiErrorException.php create mode 100644 vendor/stripe/stripe-php/lib/ExchangeRate.php create mode 100644 vendor/stripe/stripe-php/lib/File.php create mode 100644 vendor/stripe/stripe-php/lib/FileLink.php create mode 100644 vendor/stripe/stripe-php/lib/HttpClient/ClientInterface.php create mode 100644 vendor/stripe/stripe-php/lib/HttpClient/CurlClient.php create mode 100644 vendor/stripe/stripe-php/lib/Identity/VerificationReport.php create mode 100644 vendor/stripe/stripe-php/lib/Identity/VerificationSession.php create mode 100644 vendor/stripe/stripe-php/lib/Invoice.php create mode 100644 vendor/stripe/stripe-php/lib/InvoiceItem.php create mode 100644 vendor/stripe/stripe-php/lib/InvoiceLineItem.php create mode 100644 vendor/stripe/stripe-php/lib/Issuing/Authorization.php create mode 100644 vendor/stripe/stripe-php/lib/Issuing/Card.php create mode 100644 vendor/stripe/stripe-php/lib/Issuing/CardDetails.php create mode 100644 vendor/stripe/stripe-php/lib/Issuing/Cardholder.php create mode 100644 vendor/stripe/stripe-php/lib/Issuing/Dispute.php create mode 100644 vendor/stripe/stripe-php/lib/Issuing/Transaction.php create mode 100644 vendor/stripe/stripe-php/lib/LineItem.php create mode 100644 vendor/stripe/stripe-php/lib/LoginLink.php create mode 100644 vendor/stripe/stripe-php/lib/Mandate.php create mode 100644 vendor/stripe/stripe-php/lib/OAuth.php create mode 100644 vendor/stripe/stripe-php/lib/OAuthErrorObject.php create mode 100644 vendor/stripe/stripe-php/lib/Order.php create mode 100644 vendor/stripe/stripe-php/lib/OrderItem.php create mode 100644 vendor/stripe/stripe-php/lib/OrderReturn.php create mode 100644 vendor/stripe/stripe-php/lib/PaymentIntent.php create mode 100644 vendor/stripe/stripe-php/lib/PaymentMethod.php create mode 100644 vendor/stripe/stripe-php/lib/Payout.php create mode 100644 vendor/stripe/stripe-php/lib/Person.php create mode 100644 vendor/stripe/stripe-php/lib/Plan.php create mode 100644 vendor/stripe/stripe-php/lib/Price.php create mode 100644 vendor/stripe/stripe-php/lib/Product.php create mode 100644 vendor/stripe/stripe-php/lib/PromotionCode.php create mode 100644 vendor/stripe/stripe-php/lib/Radar/EarlyFraudWarning.php create mode 100644 vendor/stripe/stripe-php/lib/Radar/ValueList.php create mode 100644 vendor/stripe/stripe-php/lib/Radar/ValueListItem.php create mode 100644 vendor/stripe/stripe-php/lib/Recipient.php create mode 100644 vendor/stripe/stripe-php/lib/RecipientTransfer.php create mode 100644 vendor/stripe/stripe-php/lib/Refund.php create mode 100644 vendor/stripe/stripe-php/lib/Reporting/ReportRun.php create mode 100644 vendor/stripe/stripe-php/lib/Reporting/ReportType.php create mode 100644 vendor/stripe/stripe-php/lib/RequestTelemetry.php create mode 100644 vendor/stripe/stripe-php/lib/Review.php create mode 100644 vendor/stripe/stripe-php/lib/SKU.php create mode 100644 vendor/stripe/stripe-php/lib/Service/AbstractService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/AbstractServiceFactory.php create mode 100644 vendor/stripe/stripe-php/lib/Service/AccountLinkService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/AccountService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/ApplePayDomainService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/ApplicationFeeService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/BalanceService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/BalanceTransactionService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/BillingPortal/BillingPortalServiceFactory.php create mode 100644 vendor/stripe/stripe-php/lib/Service/BillingPortal/ConfigurationService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/BillingPortal/SessionService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/ChargeService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Checkout/CheckoutServiceFactory.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Checkout/SessionService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/CoreServiceFactory.php create mode 100644 vendor/stripe/stripe-php/lib/Service/CountrySpecService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/CouponService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/CreditNoteService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/CustomerService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/DisputeService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/EphemeralKeyService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/EventService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/ExchangeRateService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/FileLinkService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/FileService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Identity/IdentityServiceFactory.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Identity/VerificationReportService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Identity/VerificationSessionService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/InvoiceItemService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/InvoiceService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Issuing/AuthorizationService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Issuing/CardService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Issuing/CardholderService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Issuing/DisputeService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Issuing/IssuingServiceFactory.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Issuing/TransactionService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/MandateService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/OAuthService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/OrderReturnService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/OrderService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/PaymentIntentService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/PaymentMethodService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/PayoutService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/PlanService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/PriceService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/ProductService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/PromotionCodeService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Radar/EarlyFraudWarningService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Radar/RadarServiceFactory.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Radar/ValueListItemService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Radar/ValueListService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/RefundService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Reporting/ReportRunService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Reporting/ReportTypeService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Reporting/ReportingServiceFactory.php create mode 100644 vendor/stripe/stripe-php/lib/Service/ReviewService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/SetupAttemptService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/SetupIntentService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Sigma/ScheduledQueryRunService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Sigma/SigmaServiceFactory.php create mode 100644 vendor/stripe/stripe-php/lib/Service/SkuService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/SourceService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/SubscriptionItemService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/SubscriptionScheduleService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/SubscriptionService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/TaxCodeService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/TaxRateService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Terminal/ConnectionTokenService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Terminal/LocationService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Terminal/ReaderService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Terminal/TerminalServiceFactory.php create mode 100644 vendor/stripe/stripe-php/lib/Service/TokenService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/TopupService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/TransferService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/WebhookEndpointService.php create mode 100644 vendor/stripe/stripe-php/lib/SetupAttempt.php create mode 100644 vendor/stripe/stripe-php/lib/SetupIntent.php create mode 100644 vendor/stripe/stripe-php/lib/Sigma/ScheduledQueryRun.php create mode 100644 vendor/stripe/stripe-php/lib/SingletonApiResource.php create mode 100644 vendor/stripe/stripe-php/lib/Source.php create mode 100644 vendor/stripe/stripe-php/lib/SourceTransaction.php create mode 100644 vendor/stripe/stripe-php/lib/Stripe.php create mode 100644 vendor/stripe/stripe-php/lib/StripeClient.php create mode 100644 vendor/stripe/stripe-php/lib/StripeClientInterface.php create mode 100644 vendor/stripe/stripe-php/lib/StripeObject.php create mode 100644 vendor/stripe/stripe-php/lib/Subscription.php create mode 100644 vendor/stripe/stripe-php/lib/SubscriptionItem.php create mode 100644 vendor/stripe/stripe-php/lib/SubscriptionSchedule.php create mode 100644 vendor/stripe/stripe-php/lib/TaxCode.php create mode 100644 vendor/stripe/stripe-php/lib/TaxId.php create mode 100644 vendor/stripe/stripe-php/lib/TaxRate.php create mode 100644 vendor/stripe/stripe-php/lib/Terminal/ConnectionToken.php create mode 100644 vendor/stripe/stripe-php/lib/Terminal/Location.php create mode 100644 vendor/stripe/stripe-php/lib/Terminal/Reader.php create mode 100644 vendor/stripe/stripe-php/lib/ThreeDSecure.php create mode 100644 vendor/stripe/stripe-php/lib/Token.php create mode 100644 vendor/stripe/stripe-php/lib/Topup.php create mode 100644 vendor/stripe/stripe-php/lib/Transfer.php create mode 100644 vendor/stripe/stripe-php/lib/TransferReversal.php create mode 100644 vendor/stripe/stripe-php/lib/UsageRecord.php create mode 100644 vendor/stripe/stripe-php/lib/UsageRecordSummary.php create mode 100644 vendor/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php create mode 100644 vendor/stripe/stripe-php/lib/Util/DefaultLogger.php create mode 100644 vendor/stripe/stripe-php/lib/Util/LoggerInterface.php create mode 100644 vendor/stripe/stripe-php/lib/Util/ObjectTypes.php create mode 100644 vendor/stripe/stripe-php/lib/Util/RandomGenerator.php create mode 100644 vendor/stripe/stripe-php/lib/Util/RequestOptions.php create mode 100644 vendor/stripe/stripe-php/lib/Util/Set.php create mode 100644 vendor/stripe/stripe-php/lib/Util/Util.php create mode 100644 vendor/stripe/stripe-php/lib/Webhook.php create mode 100644 vendor/stripe/stripe-php/lib/WebhookEndpoint.php create mode 100644 vendor/stripe/stripe-php/lib/WebhookSignature.php create mode 100644 vendor/stripe/stripe-php/phpdoc.dist.xml create mode 100644 vendor/stripe/stripe-php/phpstan-baseline.neon create mode 100644 vendor/stripe/stripe-php/phpstan.neon.dist create mode 100644 vendor/stripe/stripe-php/update_certs.php create mode 100644 vendor/symfony/polyfill-intl-idn/Idn.php create mode 100644 vendor/symfony/polyfill-intl-idn/Info.php create mode 100644 vendor/symfony/polyfill-intl-idn/LICENSE create mode 100644 vendor/symfony/polyfill-intl-idn/README.md create mode 100644 vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php create mode 100644 vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php create mode 100644 vendor/symfony/polyfill-intl-idn/Resources/unidata/deviation.php create mode 100644 vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php create mode 100644 vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_mapped.php create mode 100644 vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php create mode 100644 vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php create mode 100644 vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php create mode 100644 vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php create mode 100644 vendor/symfony/polyfill-intl-idn/bootstrap.php create mode 100644 vendor/symfony/polyfill-intl-idn/bootstrap80.php create mode 100644 vendor/symfony/polyfill-intl-idn/composer.json create mode 100644 vendor/symfony/polyfill-intl-normalizer/LICENSE create mode 100644 vendor/symfony/polyfill-intl-normalizer/Normalizer.php create mode 100644 vendor/symfony/polyfill-intl-normalizer/README.md create mode 100644 vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php create mode 100644 vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalComposition.php create mode 100644 vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php create mode 100644 vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php create mode 100644 vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php create mode 100644 vendor/symfony/polyfill-intl-normalizer/bootstrap.php create mode 100644 vendor/symfony/polyfill-intl-normalizer/bootstrap80.php create mode 100644 vendor/symfony/polyfill-intl-normalizer/composer.json create mode 100644 vendor/symfony/polyfill-php72/LICENSE create mode 100644 vendor/symfony/polyfill-php72/Php72.php create mode 100644 vendor/symfony/polyfill-php72/README.md create mode 100644 vendor/symfony/polyfill-php72/bootstrap.php create mode 100644 vendor/symfony/polyfill-php72/composer.json create mode 100644 vendor/web-token/jwt-core/Algorithm.php create mode 100644 vendor/web-token/jwt-core/AlgorithmManager.php create mode 100644 vendor/web-token/jwt-core/AlgorithmManagerFactory.php create mode 100644 vendor/web-token/jwt-core/Converter/JsonConverter.php create mode 100644 vendor/web-token/jwt-core/Converter/StandardConverter.php create mode 100644 vendor/web-token/jwt-core/JWK.php create mode 100644 vendor/web-token/jwt-core/JWKSet.php create mode 100644 vendor/web-token/jwt-core/JWT.php create mode 100644 vendor/web-token/jwt-core/LICENSE create mode 100644 vendor/web-token/jwt-core/Util/BigInteger.php create mode 100644 vendor/web-token/jwt-core/Util/ECKey.php create mode 100644 vendor/web-token/jwt-core/Util/ECSignature.php create mode 100644 vendor/web-token/jwt-core/Util/Hash.php create mode 100644 vendor/web-token/jwt-core/Util/JsonConverter.php create mode 100644 vendor/web-token/jwt-core/Util/KeyChecker.php create mode 100644 vendor/web-token/jwt-core/Util/RSAKey.php create mode 100644 vendor/web-token/jwt-core/composer.json create mode 100644 vendor/web-token/jwt-key-mgmt/JKUFactory.php create mode 100644 vendor/web-token/jwt-key-mgmt/JWKFactory.php create mode 100644 vendor/web-token/jwt-key-mgmt/KeyAnalyzer/AlgorithmAnalyzer.php create mode 100644 vendor/web-token/jwt-key-mgmt/KeyAnalyzer/KeyAnalyzer.php create mode 100644 vendor/web-token/jwt-key-mgmt/KeyAnalyzer/KeyAnalyzerManager.php create mode 100644 vendor/web-token/jwt-key-mgmt/KeyAnalyzer/KeyIdentifierAnalyzer.php create mode 100644 vendor/web-token/jwt-key-mgmt/KeyAnalyzer/Message.php create mode 100644 vendor/web-token/jwt-key-mgmt/KeyAnalyzer/MessageBag.php create mode 100644 vendor/web-token/jwt-key-mgmt/KeyAnalyzer/NoneAnalyzer.php create mode 100644 vendor/web-token/jwt-key-mgmt/KeyAnalyzer/OctAnalyzer.php create mode 100644 vendor/web-token/jwt-key-mgmt/KeyAnalyzer/RsaAnalyzer.php create mode 100644 vendor/web-token/jwt-key-mgmt/KeyAnalyzer/UsageAnalyzer.php create mode 100644 vendor/web-token/jwt-key-mgmt/KeyConverter/ECKey.php create mode 100644 vendor/web-token/jwt-key-mgmt/KeyConverter/KeyConverter.php create mode 100644 vendor/web-token/jwt-key-mgmt/KeyConverter/RSAKey.php create mode 100644 vendor/web-token/jwt-key-mgmt/LICENSE create mode 100644 vendor/web-token/jwt-key-mgmt/UrlKeySetFactory.php create mode 100644 vendor/web-token/jwt-key-mgmt/X5UFactory.php create mode 100644 vendor/web-token/jwt-key-mgmt/composer.json create mode 100644 vendor/web-token/jwt-signature-algorithm-ecdsa/ECDSA.php create mode 100644 vendor/web-token/jwt-signature-algorithm-ecdsa/ES256.php create mode 100644 vendor/web-token/jwt-signature-algorithm-ecdsa/ES384.php create mode 100644 vendor/web-token/jwt-signature-algorithm-ecdsa/ES512.php create mode 100644 vendor/web-token/jwt-signature-algorithm-ecdsa/LICENSE create mode 100644 vendor/web-token/jwt-signature-algorithm-ecdsa/composer.json create mode 100644 vendor/web-token/jwt-signature-algorithm-eddsa/EdDSA.php create mode 100644 vendor/web-token/jwt-signature-algorithm-eddsa/LICENSE create mode 100644 vendor/web-token/jwt-signature-algorithm-eddsa/composer.json create mode 100644 vendor/web-token/jwt-signature-algorithm-hmac/HMAC.php create mode 100644 vendor/web-token/jwt-signature-algorithm-hmac/HS256.php create mode 100644 vendor/web-token/jwt-signature-algorithm-hmac/HS384.php create mode 100644 vendor/web-token/jwt-signature-algorithm-hmac/HS512.php create mode 100644 vendor/web-token/jwt-signature-algorithm-hmac/LICENSE create mode 100644 vendor/web-token/jwt-signature-algorithm-hmac/composer.json create mode 100644 vendor/web-token/jwt-signature-algorithm-none/LICENSE create mode 100644 vendor/web-token/jwt-signature-algorithm-none/None.php create mode 100644 vendor/web-token/jwt-signature-algorithm-none/composer.json create mode 100644 vendor/web-token/jwt-signature-algorithm-rsa/LICENSE create mode 100644 vendor/web-token/jwt-signature-algorithm-rsa/PS256.php create mode 100644 vendor/web-token/jwt-signature-algorithm-rsa/PS384.php create mode 100644 vendor/web-token/jwt-signature-algorithm-rsa/PS512.php create mode 100644 vendor/web-token/jwt-signature-algorithm-rsa/RS256.php create mode 100644 vendor/web-token/jwt-signature-algorithm-rsa/RS384.php create mode 100644 vendor/web-token/jwt-signature-algorithm-rsa/RS512.php create mode 100644 vendor/web-token/jwt-signature-algorithm-rsa/RSA.php create mode 100644 vendor/web-token/jwt-signature-algorithm-rsa/composer.json create mode 100644 vendor/web-token/jwt-signature/Algorithm/SignatureAlgorithm.php create mode 100644 vendor/web-token/jwt-signature/JWS.php create mode 100644 vendor/web-token/jwt-signature/JWSBuilder.php create mode 100644 vendor/web-token/jwt-signature/JWSBuilderFactory.php create mode 100644 vendor/web-token/jwt-signature/JWSLoader.php create mode 100644 vendor/web-token/jwt-signature/JWSLoaderFactory.php create mode 100644 vendor/web-token/jwt-signature/JWSTokenSupport.php create mode 100644 vendor/web-token/jwt-signature/JWSVerifier.php create mode 100644 vendor/web-token/jwt-signature/JWSVerifierFactory.php create mode 100644 vendor/web-token/jwt-signature/LICENSE create mode 100644 vendor/web-token/jwt-signature/Serializer/CompactSerializer.php create mode 100644 vendor/web-token/jwt-signature/Serializer/JSONFlattenedSerializer.php create mode 100644 vendor/web-token/jwt-signature/Serializer/JSONGeneralSerializer.php create mode 100644 vendor/web-token/jwt-signature/Serializer/JWSSerializer.php create mode 100644 vendor/web-token/jwt-signature/Serializer/JWSSerializerManager.php create mode 100644 vendor/web-token/jwt-signature/Serializer/JWSSerializerManagerFactory.php create mode 100644 vendor/web-token/jwt-signature/Serializer/Serializer.php create mode 100644 vendor/web-token/jwt-signature/Signature.php create mode 100644 vendor/web-token/jwt-signature/Util/RSA.php create mode 100644 vendor/web-token/jwt-signature/composer.json create mode 100644 vendor/web-token/jwt-util-ecc/Curve.php create mode 100644 vendor/web-token/jwt-util-ecc/LICENSE create mode 100644 vendor/web-token/jwt-util-ecc/Math.php create mode 100644 vendor/web-token/jwt-util-ecc/ModularArithmetic.php create mode 100644 vendor/web-token/jwt-util-ecc/NistCurve.php create mode 100644 vendor/web-token/jwt-util-ecc/Point.php create mode 100644 vendor/web-token/jwt-util-ecc/PrivateKey.php create mode 100644 vendor/web-token/jwt-util-ecc/PublicKey.php create mode 100644 vendor/web-token/jwt-util-ecc/composer.json (limited to 'vendor') diff --git a/vendor/autoload.php b/vendor/autoload.php new file mode 100644 index 0000000..aa9f579 --- /dev/null +++ b/vendor/autoload.php @@ -0,0 +1,7 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + * @see http://www.php-fig.org/psr/psr-0/ + * @see http://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + // PSR-4 + private $prefixLengthsPsr4 = array(); + private $prefixDirsPsr4 = array(); + private $fallbackDirsPsr4 = array(); + + // PSR-0 + private $prefixesPsr0 = array(); + private $fallbackDirsPsr0 = array(); + + private $useIncludePath = false; + private $classMap = array(); + private $classMapAuthoritative = false; + private $missingClasses = array(); + private $apcuPrefix; + + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', $this->prefixesPsr0); + } + + return array(); + } + + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param array $classMap Class to filename map + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + */ + public function add($prefix, $paths, $prepend = false) + { + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + (array) $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + (array) $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = (array) $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + (array) $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories + * + * @throws \InvalidArgumentException + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + (array) $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + (array) $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + (array) $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 base directories + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, + * replacing any others previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories + * + * @throws \InvalidArgumentException + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. + * + * @param string|null $apcuPrefix + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + } + + /** + * Unregisters this instance as an autoloader. + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return bool|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + includeFile($file); + + return true; + } + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { + return false; + } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if (false === $file && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + + if (false === $file) { + // Remember that this class does not exist. + $this->missingClasses[$class] = true; + } + + return $file; + } + + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + $subPath = $class; + while (false !== $lastPos = strrpos($subPath, '\\')) { + $subPath = substr($subPath, 0, $lastPos); + $search = $subPath . '\\'; + if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); + foreach ($this->prefixDirsPsr4[$search] as $dir) { + if (file_exists($file = $dir . $pathEnd)) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + + return false; + } +} + +/** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + */ +function includeFile($file) +{ + include $file; +} diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php new file mode 100644 index 0000000..b3a4e16 --- /dev/null +++ b/vendor/composer/InstalledVersions.php @@ -0,0 +1,337 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer; + +use Composer\Autoload\ClassLoader; +use Composer\Semver\VersionParser; + +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require it's presence, you can require `composer-runtime-api ^2.0` + */ +class InstalledVersions +{ + private static $installed; + private static $canGetVendors; + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints($constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. + * @return array[] + * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array} $data + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + if (isset(self::$installedByVendor[$vendorDir])) { + $installed[] = self::$installedByVendor[$vendorDir]; + } elseif (is_file($vendorDir.'/composer/installed.php')) { + $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } + } + } + } + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = require __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + $installed[] = self::$installed; + + return $installed; + } +} diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE new file mode 100644 index 0000000..f27399a --- /dev/null +++ b/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) Nils Adermann, Jordi Boggiano + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php new file mode 100644 index 0000000..6a8443c --- /dev/null +++ b/vendor/composer/autoload_classmap.php @@ -0,0 +1,438 @@ + $baseDir . '/admin/survey/export/latexclasses/Analize/AnalizaBreak.php', + 'AnalizaCReport' => $baseDir . '/admin/survey/export/latexclasses/Analize/AnalizaCReport.php', + 'AnalizaCharts' => $baseDir . '/admin/survey/export/latexclasses/Analize/AnalizaCharts.php', + 'AnalizaCrosstab' => $baseDir . '/admin/survey/export/latexclasses/Analize/AnalizaCrosstab.php', + 'AnalizaDesc' => $baseDir . '/admin/survey/export/latexclasses/Analize/AnalizaDesc.php', + 'AnalizaFreq' => $baseDir . '/admin/survey/export/latexclasses/Analize/AnalizaFreq.php', + 'AnalizaMean' => $baseDir . '/admin/survey/export/latexclasses/Analize/AnalizaMean.php', + 'AnalizaMultiCrosstab' => $baseDir . '/admin/survey/export/latexclasses/Analize/AnalizaMultiCrosstab.php', + 'AnalizaSums' => $baseDir . '/admin/survey/export/latexclasses/Analize/AnalizaSums.php', + 'AnalizaTTest' => $baseDir . '/admin/survey/export/latexclasses/Analize/AnalizaTTest.php', + 'ApiController' => $baseDir . '/admin/survey/api/class.ApiController.php', + 'ApiNarocilaController' => $baseDir . '/frontend/payments/classes/class.ApiNarocilaController.php', + 'ApiSurvey' => $baseDir . '/admin/survey/api/class.ApiSurvey.php', + 'BesediloLatex' => $baseDir . '/admin/survey/export/latexclasses/Vprasanja/BesediloLatex.php', + 'BesediloXml' => $baseDir . '/admin/survey/export/xmlClasses/Vprasanja/BesediloXml.php', + 'Branching' => $baseDir . '/admin/survey/Branching.php', + 'BranchingAjax' => $baseDir . '/admin/survey/BranchingAjax.php', + 'Cache' => $baseDir . '/admin/survey/classes/class.Cache.php', + 'CheckboxXml' => $baseDir . '/admin/survey/export/xmlClasses/Vprasanja/CheckboxXml.php', + 'Common' => $baseDir . '/admin/survey/classes/class.Common.php', + 'CrossRoad' => $baseDir . '/admin/survey/classes/tracking/CrossRoad.php', + 'DatumLatex' => $baseDir . '/admin/survey/export/latexclasses/Vprasanja/DatumLatex.php', + 'Demografija' => $baseDir . '/admin/survey/classes/class.Demografija.php', + 'Dostop' => $baseDir . '/admin/survey/classes/class.Dostop.php', + 'ExclusiveLock' => $baseDir . '/admin/survey/classes/surveyData/class.ExclusiveLock.php', + 'Export' => $baseDir . '/admin/survey/classes/class.Export.php', + 'ExportController' => $baseDir . '/admin/survey/export/class.ExportController.php', + 'Forum' => $baseDir . '/admin/survey/classes/class.Forum.php', + 'GDPR' => $baseDir . '/admin/survey/classes/class.GDPR.php', + 'GetSiteUrl' => $baseDir . '/admin/survey/classes/class.GetSiteUrl.php', + 'Glasovanje' => $baseDir . '/admin/survey/Glasovanje.php', + 'GlobalMisc' => $baseDir . '/admin/survey/classes/class.GlobalMisc.php', + 'GridMultipleLatex' => $baseDir . '/admin/survey/export/latexclasses/Vprasanja/GridMultipleLatex.php', + 'HTML5' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Lexer/PH5P.php', + 'HTML5TreeConstructer' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Lexer/PH5P.php', + 'HTMLPurifier' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier.php', + 'HTMLPurifier_AttrCollections' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrCollections.php', + 'HTMLPurifier_AttrDef' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef.php', + 'HTMLPurifier_AttrDef_CSS' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS.php', + 'HTMLPurifier_AttrDef_CSS_AlphaValue' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php', + 'HTMLPurifier_AttrDef_CSS_Background' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/Background.php', + 'HTMLPurifier_AttrDef_CSS_BackgroundPosition' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php', + 'HTMLPurifier_AttrDef_CSS_Border' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/Border.php', + 'HTMLPurifier_AttrDef_CSS_Color' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/Color.php', + 'HTMLPurifier_AttrDef_CSS_Composite' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/Composite.php', + 'HTMLPurifier_AttrDef_CSS_DenyElementDecorator' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php', + 'HTMLPurifier_AttrDef_CSS_Filter' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/Filter.php', + 'HTMLPurifier_AttrDef_CSS_Font' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/Font.php', + 'HTMLPurifier_AttrDef_CSS_FontFamily' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/FontFamily.php', + 'HTMLPurifier_AttrDef_CSS_ImportantDecorator' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php', + 'HTMLPurifier_AttrDef_CSS_Length' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/Length.php', + 'HTMLPurifier_AttrDef_CSS_ListStyle' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/ListStyle.php', + 'HTMLPurifier_AttrDef_CSS_Multiple' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/Multiple.php', + 'HTMLPurifier_AttrDef_CSS_Number' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/Number.php', + 'HTMLPurifier_AttrDef_CSS_Percentage' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/Percentage.php', + 'HTMLPurifier_AttrDef_CSS_TextDecoration' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php', + 'HTMLPurifier_AttrDef_CSS_URI' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/URI.php', + 'HTMLPurifier_AttrDef_Enum' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/Enum.php', + 'HTMLPurifier_AttrDef_HTML_Bool' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/HTML/Bool.php', + 'HTMLPurifier_AttrDef_HTML_Class' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/HTML/Class.php', + 'HTMLPurifier_AttrDef_HTML_Color' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/HTML/Color.php', + 'HTMLPurifier_AttrDef_HTML_FrameTarget' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php', + 'HTMLPurifier_AttrDef_HTML_ID' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/HTML/ID.php', + 'HTMLPurifier_AttrDef_HTML_Length' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/HTML/Length.php', + 'HTMLPurifier_AttrDef_HTML_LinkTypes' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php', + 'HTMLPurifier_AttrDef_HTML_MultiLength' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/HTML/MultiLength.php', + 'HTMLPurifier_AttrDef_HTML_Nmtokens' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/HTML/Nmtokens.php', + 'HTMLPurifier_AttrDef_HTML_Pixels' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/HTML/Pixels.php', + 'HTMLPurifier_AttrDef_Integer' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/Integer.php', + 'HTMLPurifier_AttrDef_Lang' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/Lang.php', + 'HTMLPurifier_AttrDef_Switch' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/Switch.php', + 'HTMLPurifier_AttrDef_Text' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/Text.php', + 'HTMLPurifier_AttrDef_URI' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/URI.php', + 'HTMLPurifier_AttrDef_URI_Email' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/URI/Email.php', + 'HTMLPurifier_AttrDef_URI_Email_SimpleCheck' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php', + 'HTMLPurifier_AttrDef_URI_Host' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/URI/Host.php', + 'HTMLPurifier_AttrDef_URI_IPv4' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/URI/IPv4.php', + 'HTMLPurifier_AttrDef_URI_IPv6' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/URI/IPv6.php', + 'HTMLPurifier_AttrTransform' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform.php', + 'HTMLPurifier_AttrTransform_Background' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/Background.php', + 'HTMLPurifier_AttrTransform_BdoDir' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/BdoDir.php', + 'HTMLPurifier_AttrTransform_BgColor' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/BgColor.php', + 'HTMLPurifier_AttrTransform_BoolToCSS' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/BoolToCSS.php', + 'HTMLPurifier_AttrTransform_Border' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/Border.php', + 'HTMLPurifier_AttrTransform_EnumToCSS' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/EnumToCSS.php', + 'HTMLPurifier_AttrTransform_ImgRequired' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/ImgRequired.php', + 'HTMLPurifier_AttrTransform_ImgSpace' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/ImgSpace.php', + 'HTMLPurifier_AttrTransform_Input' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/Input.php', + 'HTMLPurifier_AttrTransform_Lang' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/Lang.php', + 'HTMLPurifier_AttrTransform_Length' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/Length.php', + 'HTMLPurifier_AttrTransform_Name' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/Name.php', + 'HTMLPurifier_AttrTransform_NameSync' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/NameSync.php', + 'HTMLPurifier_AttrTransform_Nofollow' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/Nofollow.php', + 'HTMLPurifier_AttrTransform_SafeEmbed' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/SafeEmbed.php', + 'HTMLPurifier_AttrTransform_SafeObject' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/SafeObject.php', + 'HTMLPurifier_AttrTransform_SafeParam' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/SafeParam.php', + 'HTMLPurifier_AttrTransform_ScriptRequired' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/ScriptRequired.php', + 'HTMLPurifier_AttrTransform_Textarea' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/Textarea.php', + 'HTMLPurifier_AttrTypes' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTypes.php', + 'HTMLPurifier_AttrValidator' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrValidator.php', + 'HTMLPurifier_Bootstrap' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Bootstrap.php', + 'HTMLPurifier_CSSDefinition' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/CSSDefinition.php', + 'HTMLPurifier_ChildDef' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ChildDef.php', + 'HTMLPurifier_ChildDef_Chameleon' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ChildDef/Chameleon.php', + 'HTMLPurifier_ChildDef_Custom' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ChildDef/Custom.php', + 'HTMLPurifier_ChildDef_Empty' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ChildDef/Empty.php', + 'HTMLPurifier_ChildDef_Optional' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ChildDef/Optional.php', + 'HTMLPurifier_ChildDef_Required' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ChildDef/Required.php', + 'HTMLPurifier_ChildDef_StrictBlockquote' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ChildDef/StrictBlockquote.php', + 'HTMLPurifier_ChildDef_Table' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ChildDef/Table.php', + 'HTMLPurifier_Config' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Config.php', + 'HTMLPurifier_ConfigSchema' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ConfigSchema.php', + 'HTMLPurifier_ConfigSchema_Builder_ConfigSchema' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php', + 'HTMLPurifier_ConfigSchema_Builder_Xml' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ConfigSchema/Builder/Xml.php', + 'HTMLPurifier_ConfigSchema_Exception' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ConfigSchema/Exception.php', + 'HTMLPurifier_ConfigSchema_Interchange' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ConfigSchema/Interchange.php', + 'HTMLPurifier_ConfigSchema_InterchangeBuilder' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php', + 'HTMLPurifier_ConfigSchema_Interchange_Directive' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php', + 'HTMLPurifier_ConfigSchema_Interchange_Id' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ConfigSchema/Interchange/Id.php', + 'HTMLPurifier_ConfigSchema_Validator' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ConfigSchema/Validator.php', + 'HTMLPurifier_ConfigSchema_ValidatorAtom' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php', + 'HTMLPurifier_ContentSets' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ContentSets.php', + 'HTMLPurifier_Context' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Context.php', + 'HTMLPurifier_Definition' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Definition.php', + 'HTMLPurifier_DefinitionCache' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/DefinitionCache.php', + 'HTMLPurifier_DefinitionCacheFactory' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/DefinitionCacheFactory.php', + 'HTMLPurifier_DefinitionCache_Decorator' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/DefinitionCache/Decorator.php', + 'HTMLPurifier_DefinitionCache_Decorator_Cleanup' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php', + 'HTMLPurifier_DefinitionCache_Decorator_Memory' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/DefinitionCache/Decorator/Memory.php', + 'HTMLPurifier_DefinitionCache_Null' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/DefinitionCache/Null.php', + 'HTMLPurifier_DefinitionCache_Serializer' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/DefinitionCache/Serializer.php', + 'HTMLPurifier_Doctype' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Doctype.php', + 'HTMLPurifier_DoctypeRegistry' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/DoctypeRegistry.php', + 'HTMLPurifier_ElementDef' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ElementDef.php', + 'HTMLPurifier_Encoder' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Encoder.php', + 'HTMLPurifier_EntityLookup' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/EntityLookup.php', + 'HTMLPurifier_EntityParser' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/EntityParser.php', + 'HTMLPurifier_ErrorCollector' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ErrorCollector.php', + 'HTMLPurifier_ErrorStruct' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ErrorStruct.php', + 'HTMLPurifier_Exception' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Exception.php', + 'HTMLPurifier_Filter' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Filter.php', + 'HTMLPurifier_Filter_ExtractStyleBlocks' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Filter/ExtractStyleBlocks.php', + 'HTMLPurifier_Filter_YouTube' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Filter/YouTube.php', + 'HTMLPurifier_Generator' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Generator.php', + 'HTMLPurifier_HTMLDefinition' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLDefinition.php', + 'HTMLPurifier_HTMLModule' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule.php', + 'HTMLPurifier_HTMLModuleManager' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModuleManager.php', + 'HTMLPurifier_HTMLModule_Bdo' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Bdo.php', + 'HTMLPurifier_HTMLModule_CommonAttributes' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/CommonAttributes.php', + 'HTMLPurifier_HTMLModule_Edit' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Edit.php', + 'HTMLPurifier_HTMLModule_Forms' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Forms.php', + 'HTMLPurifier_HTMLModule_Hypertext' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Hypertext.php', + 'HTMLPurifier_HTMLModule_Image' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Image.php', + 'HTMLPurifier_HTMLModule_Legacy' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Legacy.php', + 'HTMLPurifier_HTMLModule_List' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/List.php', + 'HTMLPurifier_HTMLModule_Name' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Name.php', + 'HTMLPurifier_HTMLModule_Nofollow' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Nofollow.php', + 'HTMLPurifier_HTMLModule_NonXMLCommonAttributes' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php', + 'HTMLPurifier_HTMLModule_Object' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Object.php', + 'HTMLPurifier_HTMLModule_Presentation' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Presentation.php', + 'HTMLPurifier_HTMLModule_Proprietary' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Proprietary.php', + 'HTMLPurifier_HTMLModule_Ruby' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Ruby.php', + 'HTMLPurifier_HTMLModule_SafeEmbed' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/SafeEmbed.php', + 'HTMLPurifier_HTMLModule_SafeObject' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/SafeObject.php', + 'HTMLPurifier_HTMLModule_Scripting' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Scripting.php', + 'HTMLPurifier_HTMLModule_StyleAttribute' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/StyleAttribute.php', + 'HTMLPurifier_HTMLModule_Tables' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Tables.php', + 'HTMLPurifier_HTMLModule_Target' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Target.php', + 'HTMLPurifier_HTMLModule_Text' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Text.php', + 'HTMLPurifier_HTMLModule_Tidy' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Tidy.php', + 'HTMLPurifier_HTMLModule_Tidy_Name' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Tidy/Name.php', + 'HTMLPurifier_HTMLModule_Tidy_Proprietary' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Tidy/Proprietary.php', + 'HTMLPurifier_HTMLModule_Tidy_Strict' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Tidy/Strict.php', + 'HTMLPurifier_HTMLModule_Tidy_Transitional' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Tidy/Transitional.php', + 'HTMLPurifier_HTMLModule_Tidy_XHTML' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Tidy/XHTML.php', + 'HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php', + 'HTMLPurifier_HTMLModule_XMLCommonAttributes' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/XMLCommonAttributes.php', + 'HTMLPurifier_IDAccumulator' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/IDAccumulator.php', + 'HTMLPurifier_Injector' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Injector.php', + 'HTMLPurifier_Injector_AutoParagraph' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Injector/AutoParagraph.php', + 'HTMLPurifier_Injector_DisplayLinkURI' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Injector/DisplayLinkURI.php', + 'HTMLPurifier_Injector_Linkify' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Injector/Linkify.php', + 'HTMLPurifier_Injector_PurifierLinkify' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Injector/PurifierLinkify.php', + 'HTMLPurifier_Injector_RemoveEmpty' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Injector/RemoveEmpty.php', + 'HTMLPurifier_Injector_RemoveSpansWithoutAttributes' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php', + 'HTMLPurifier_Injector_SafeObject' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Injector/SafeObject.php', + 'HTMLPurifier_Language' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Language.php', + 'HTMLPurifier_LanguageFactory' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/LanguageFactory.php', + 'HTMLPurifier_Language_en_x_test' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Language/classes/en-x-test.php', + 'HTMLPurifier_Length' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Length.php', + 'HTMLPurifier_Lexer' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Lexer.php', + 'HTMLPurifier_Lexer_DOMLex' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Lexer/DOMLex.php', + 'HTMLPurifier_Lexer_DirectLex' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Lexer/DirectLex.php', + 'HTMLPurifier_Lexer_PEARSax3' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Lexer/PEARSax3.php', + 'HTMLPurifier_Lexer_PH5P' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Lexer/PH5P.php', + 'HTMLPurifier_PercentEncoder' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/PercentEncoder.php', + 'HTMLPurifier_Printer' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Printer.php', + 'HTMLPurifier_Printer_CSSDefinition' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Printer/CSSDefinition.php', + 'HTMLPurifier_Printer_ConfigForm' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Printer/ConfigForm.php', + 'HTMLPurifier_Printer_ConfigForm_NullDecorator' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Printer/ConfigForm.php', + 'HTMLPurifier_Printer_ConfigForm_bool' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Printer/ConfigForm.php', + 'HTMLPurifier_Printer_ConfigForm_default' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Printer/ConfigForm.php', + 'HTMLPurifier_Printer_HTMLDefinition' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Printer/HTMLDefinition.php', + 'HTMLPurifier_PropertyList' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/PropertyList.php', + 'HTMLPurifier_PropertyListIterator' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/PropertyListIterator.php', + 'HTMLPurifier_Strategy' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Strategy.php', + 'HTMLPurifier_Strategy_Composite' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Strategy/Composite.php', + 'HTMLPurifier_Strategy_Core' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Strategy/Core.php', + 'HTMLPurifier_Strategy_FixNesting' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Strategy/FixNesting.php', + 'HTMLPurifier_Strategy_MakeWellFormed' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Strategy/MakeWellFormed.php', + 'HTMLPurifier_Strategy_RemoveForeignElements' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Strategy/RemoveForeignElements.php', + 'HTMLPurifier_Strategy_ValidateAttributes' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Strategy/ValidateAttributes.php', + 'HTMLPurifier_StringHash' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/StringHash.php', + 'HTMLPurifier_StringHashParser' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/StringHashParser.php', + 'HTMLPurifier_TagTransform' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/TagTransform.php', + 'HTMLPurifier_TagTransform_Font' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/TagTransform/Font.php', + 'HTMLPurifier_TagTransform_Simple' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/TagTransform/Simple.php', + 'HTMLPurifier_Token' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Token.php', + 'HTMLPurifier_TokenFactory' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/TokenFactory.php', + 'HTMLPurifier_Token_Comment' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Token/Comment.php', + 'HTMLPurifier_Token_Empty' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Token/Empty.php', + 'HTMLPurifier_Token_End' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Token/End.php', + 'HTMLPurifier_Token_Start' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Token/Start.php', + 'HTMLPurifier_Token_Tag' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Token/Tag.php', + 'HTMLPurifier_Token_Text' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Token/Text.php', + 'HTMLPurifier_URI' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URI.php', + 'HTMLPurifier_URIDefinition' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIDefinition.php', + 'HTMLPurifier_URIFilter' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIFilter.php', + 'HTMLPurifier_URIFilter_DisableExternal' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIFilter/DisableExternal.php', + 'HTMLPurifier_URIFilter_DisableExternalResources' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIFilter/DisableExternalResources.php', + 'HTMLPurifier_URIFilter_DisableResources' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIFilter/DisableResources.php', + 'HTMLPurifier_URIFilter_HostBlacklist' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIFilter/HostBlacklist.php', + 'HTMLPurifier_URIFilter_MakeAbsolute' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIFilter/MakeAbsolute.php', + 'HTMLPurifier_URIFilter_Munge' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIFilter/Munge.php', + 'HTMLPurifier_URIParser' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIParser.php', + 'HTMLPurifier_URIScheme' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIScheme.php', + 'HTMLPurifier_URISchemeRegistry' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URISchemeRegistry.php', + 'HTMLPurifier_URIScheme_data' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIScheme/data.php', + 'HTMLPurifier_URIScheme_file' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIScheme/file.php', + 'HTMLPurifier_URIScheme_ftp' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIScheme/ftp.php', + 'HTMLPurifier_URIScheme_http' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIScheme/http.php', + 'HTMLPurifier_URIScheme_https' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIScheme/https.php', + 'HTMLPurifier_URIScheme_mailto' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIScheme/mailto.php', + 'HTMLPurifier_URIScheme_news' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIScheme/news.php', + 'HTMLPurifier_URIScheme_nntp' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIScheme/nntp.php', + 'HTMLPurifier_UnitConverter' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/UnitConverter.php', + 'HTMLPurifier_VarParser' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/VarParser.php', + 'HTMLPurifier_VarParserException' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/VarParserException.php', + 'HTMLPurifier_VarParser_Flexible' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/VarParser/Flexible.php', + 'HTMLPurifier_VarParser_Native' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/VarParser/Native.php', + 'HashUrl' => $baseDir . '/admin/survey/classes/class.HashUrl.php', + 'HeatmapLatex' => $baseDir . '/admin/survey/export/latexclasses/Vprasanja/HeatmapLatex.php', + 'Help' => $baseDir . '/admin/survey/Help.php', + 'HierarhijaAnalysis' => $baseDir . '/admin/survey/modules/mod_hierarhija/class/HierarhijaAnalysisClass.php', + 'Hierarhija\\Ajax\\AjaxHierarhija' => $baseDir . '/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxHierarhijaClass.php', + 'Hierarhija\\Ajax\\AjaxHierarhijaDostopUporabnikovClass' => $baseDir . '/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxHierarhijaDostopUporabnikovClass.php', + 'Hierarhija\\Ajax\\AjaxSuperSifra' => $baseDir . '/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxSuperSifraClass.php', + 'Hierarhija\\Ajax\\AjaxUporabniki' => $baseDir . '/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxUporabnikiClass.php', + 'Hierarhija\\Hierarhija' => $baseDir . '/admin/survey/modules/mod_hierarhija/class/HierarhijaClass.php', + 'Hierarhija\\HierarhijaAjax' => $baseDir . '/admin/survey/modules/mod_hierarhija/class/HierarhijaAjaxClass.php', + 'Hierarhija\\HierarhijaHelper' => $baseDir . '/admin/survey/modules/mod_hierarhija/class/HierarhijaHelper.php', + 'Hierarhija\\HierarhijaIzvoz' => $baseDir . '/admin/survey/modules/mod_hierarhija/class/HierarhijaIzvoz.php', + 'Hierarhija\\HierarhijaIzvozAnalize' => $baseDir . '/admin/survey/modules/mod_hierarhija/class/HierarhijaIzvozAnalize.php', + 'Hierarhija\\HierarhijaKopiranjeClass' => $baseDir . '/admin/survey/modules/mod_hierarhija/class/HierarhijaKopiranjeClass.php', + 'Hierarhija\\HierarhijaPorocilaClass' => $baseDir . '/admin/survey/modules/mod_hierarhija/class/HierarhijaPorocilaClass.php', + 'Hierarhija\\Model\\HierarhijaOnlyQuery' => $baseDir . '/admin/survey/modules/mod_hierarhija/model/HierarhijaOnlyQuery.php', + 'Hierarhija\\Model\\HierarhijaQuery' => $baseDir . '/admin/survey/modules/mod_hierarhija/model/HierarhijaQuery.php', + 'KalkulacijaLatex' => $baseDir . '/admin/survey/export/latexclasses/Vprasanja/KalkulacijaLatex.php', + 'KvotaLatex' => $baseDir . '/admin/survey/export/latexclasses/Vprasanja/KvotaLatex.php', + 'LatexAnalysis' => $baseDir . '/admin/survey/export/latexclasses/class.LatexAnalysis.php', + 'LatexAnalysisElement' => $baseDir . '/admin/survey/export/latexclasses/class.LatexAnalysisElement.php', + 'LatexDocument' => $baseDir . '/admin/survey/export/latexclasses/class.LatexDocument.php', + 'LatexEditsAnalysis' => $baseDir . '/admin/survey/export/latexclasses/class.LatexEditsAnalysis.php', + 'LatexGDPR' => $baseDir . '/admin/survey/export/latexclasses/class.LatexGDPR.php', + 'LatexStatus' => $baseDir . '/admin/survey/export/latexclasses/class.LatexStatus.php', + 'LatexSurvey' => $baseDir . '/admin/survey/export/latexclasses/class.LatexSurvey.php', + 'LatexSurveyElement' => $baseDir . '/admin/survey/export/latexclasses/class.LatexSurveyElement.php', + 'Library' => $baseDir . '/admin/survey/classes/class.Library.php', + 'LokacijaLatex' => $baseDir . '/admin/survey/export/latexclasses/Vprasanja/LokacijaLatex.php', + 'MAZA' => $baseDir . '/admin/survey/modules/mod_MAZA/class.MAZA.php', + 'MAZAExport' => $baseDir . '/admin/survey/modules/mod_MAZA/class.MAZAExport.php', + 'MailAdapter' => $baseDir . '/admin/survey/classes/objects/obj.MailAdapter.php', + 'MobileSurveyAdmin' => $baseDir . '/admin/survey/classes/mobile/class.MobileSurveyAdmin.php', + 'MultiGridLatex' => $baseDir . '/admin/survey/export/latexclasses/Vprasanja/MultiGridLatex.php', + 'MultiGridXml' => $baseDir . '/admin/survey/export/xmlClasses/Vprasanja/MultiGridXml.php', + 'MustangWord' => $baseDir . '/admin/survey/classes/class.SurveyLanguageTechnology.php', + 'MyHorBar' => $baseDir . '/admin/survey/pChart/classes/class.MyHorBar.php', + 'NagovorLatex' => $baseDir . '/admin/survey/export/latexclasses/Vprasanja/NagovorLatex.php', + 'NewSurvey' => $baseDir . '/admin/survey/classes/class.NewSurvey.php', + 'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', + 'Notifications' => $baseDir . '/admin/survey/classes/class.Notifications.php', + 'PopUp' => $baseDir . '/admin/survey/classes/objects/obj.PopUp.php', + 'PopUpButton' => $baseDir . '/admin/survey/classes/objects/obj.PopUpButton.php', + 'PopUpCancelButton' => $baseDir . '/admin/survey/classes/objects/obj.PopUpCancelButton.php', + 'Prevajanje' => $baseDir . '/admin/survey/classes/class.Prevajanje.php', + 'Purifier' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/Purifier.php', + 'RadioCheckboxSelectLatex' => $baseDir . '/admin/survey/export/latexclasses/Vprasanja/RadioCheckboxSelectLatex.php', + 'RadioXml' => $baseDir . '/admin/survey/export/xmlClasses/Vprasanja/RadioXml.php', + 'RazvrscanjeLatex' => $baseDir . '/admin/survey/export/latexclasses/Vprasanja/RazvrscanjeLatex.php', + 'RecodeValues' => $baseDir . '/admin/survey/classes/class.RecodeValues.php', + 'SNImenaLatex' => $baseDir . '/admin/survey/export/latexclasses/Vprasanja/SNImena.php', + 'Setting' => $baseDir . '/admin/survey/classes/class.Setting.php', + 'SpremenljivkaSkala' => $baseDir . '/admin/survey/classes/objects/obj.SpremenljivkaSkala.php', + 'SqualoApi' => $baseDir . '/admin/survey/classes/surveyEmails/squalo/class.SqualoApi.php', + 'SteviloLatex' => $baseDir . '/admin/survey/export/latexclasses/Vprasanja/SteviloLatex.php', + 'SteviloXml' => $baseDir . '/admin/survey/export/xmlClasses/Vprasanja/SteviloXml.php', + 'Survey3601ka' => $baseDir . '/admin/survey/modules/mod_360_1KA/class.Survey3601ka.php', + 'SurveyAapor' => $baseDir . '/admin/survey/classes/class.SurveyAapor.php', + 'SurveyAdmin' => $baseDir . '/admin/survey/SurveyAdmin.php', + 'SurveyAdminAjax' => $baseDir . '/admin/survey/SurveyAdminAjax.php', + 'SurveyAdminSettings' => $baseDir . '/admin/survey/SurveyAdminSettings.php', + 'SurveyAdvancedParadata' => $baseDir . '/admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadata.php', + 'SurveyAdvancedParadataExport' => $baseDir . '/admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadataExport.php', + 'SurveyAdvancedParadataLog' => $baseDir . '/admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadataLog.php', + 'SurveyAktivnost' => $baseDir . '/admin/survey/classes/class.SurveyAktivnost.php', + 'SurveyAlert' => $baseDir . '/admin/survey/classes/surveyEmails/class.SurveyAlert.php', + 'SurveyAnalysis' => $baseDir . '/admin/survey/classes/surveyAnalysis/class.SurveyAnalysis.php', + 'SurveyAnalysisArchive' => $baseDir . '/admin/survey/classes/surveyAnalysis/class.SurveyAnalysisArchive.php', + 'SurveyAnalysisHelper' => $baseDir . '/admin/survey/classes/surveyAnalysis/class.SurveyAnalysisHelper.php', + 'SurveyAnalysisR' => $baseDir . '/admin/survey/R/class.SurveyAnalysisR.php', + 'SurveyAppendMerge' => $baseDir . '/admin/survey/classes/class.SurveyAppendMerge.php', + 'SurveyBaseSetting' => $baseDir . '/admin/survey/classes/class.SurveyBaseSetting.php', + 'SurveyBreak' => $baseDir . '/admin/survey/classes/surveyAnalysis/class.SurveyBreak.php', + 'SurveyChart' => $baseDir . '/admin/survey/classes/surveyAnalysis/class.SurveyChart.php', + 'SurveyChat' => $baseDir . '/admin/survey/modules/mod_chat/class.SurveyChat.php', + 'SurveyCondition' => $baseDir . '/admin/survey/classes/class.SurveyCondition.php', + 'SurveyConditionProfiles' => $baseDir . '/admin/survey/classes/class.SurveyConditionProfiles.php', + 'SurveyConnect' => $baseDir . '/admin/survey/classes/class.SurveyConnect.php', + 'SurveyCopy' => $baseDir . '/admin/survey/classes/class.SurveyCopy.php', + 'SurveyCrosstabs' => $baseDir . '/admin/survey/classes/surveyAnalysis/class.SurveyCrosstabs.php', + 'SurveyCustomReport' => $baseDir . '/admin/survey/classes/class.SurveyCustomReport.php', + 'SurveyDataCollect' => $baseDir . '/admin/survey/classes/surveyData/class.SurveyDataCollect.php', + 'SurveyDataDisplay' => $baseDir . '/admin/survey/classes/surveyData/class.SurveyDataDisplay.php', + 'SurveyDataFile' => $baseDir . '/admin/survey/classes/surveyData/class.SurveyDataFile.php', + 'SurveyDataSettingProfiles' => $baseDir . '/admin/survey/classes/class.SurveyDataSettingProfiles.php', + 'SurveyDiagnostics' => $baseDir . '/admin/survey/classes/class.SurveyDiagnostics.php', + 'SurveyEditsAnalysis' => $baseDir . '/admin/survey/classes/surveyAnalysis/class.SurveyEditsAnalysis.php', + 'SurveyExport' => $baseDir . '/admin/survey/classes/class.SurveyExport.php', + 'SurveyExportProfiles' => $baseDir . '/admin/survey/classes/class.SurveyExportProfiles.php', + 'SurveyFieldwork' => $baseDir . '/admin/survey/modules/mod_fieldwork/class.SurveyFieldwork.php', + 'SurveyGeoIP' => $baseDir . '/admin/survey/modules/mod_geoIP/class.SurveyGeoIP.php', + 'SurveyGetHeatMapRadij' => $baseDir . '/admin/survey/classes/class.SurveyGetHeatMapRadij.php', + 'SurveyHeatMap' => $baseDir . '/admin/survey/classes/class.SurveyHeatMap.php', + 'SurveyHeatMapBackground' => $baseDir . '/admin/survey/classes/class.SurveyHeatMapBackground.php', + 'SurveyHeatMapExportIcons' => $baseDir . '/admin/survey/classes/class.SurveyHeatMapExportIcons.php', + 'SurveyHeatMapImageSave' => $baseDir . '/admin/survey/classes/class.SurveyHeatMapSaveImage.php', + 'SurveyHeatMapRadij' => $baseDir . '/admin/survey/classes/class.SurveyHeatMapRadij.php', + 'SurveyInfo' => $baseDir . '/admin/survey/classes/class.SurveyInfo.php', + 'SurveyInspect' => $baseDir . '/admin/survey/classes/class.SurveyInpect.php', + 'SurveyInvitationsNew' => $baseDir . '/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php', + 'SurveyInvitationsSqualo' => $baseDir . '/admin/survey/classes/surveyEmails/squalo/class.SurveyInvitationsSqualo.php', + 'SurveyJsonSurveyData' => $baseDir . '/admin/survey/modules/mod_json_survey_export/class.SurveyJsonSurveyData.php', + 'SurveyKakovost' => $baseDir . '/admin/survey/modules/mod_kakovost/class.SurveyKakovost.php', + 'SurveyLanguageTechnology' => $baseDir . '/admin/survey/classes/class.SurveyLanguageTechnology.php', + 'SurveyList' => $baseDir . '/admin/survey/classes/class.SurveyList.php', + 'SurveyLog' => $baseDir . '/admin/survey/classes/log/class.SurveyLog.php', + 'SurveyMapData' => $baseDir . '/admin/survey/classes/class.SurveyMapData.php', + 'SurveyMeans' => $baseDir . '/admin/survey/classes/surveyAnalysis/class.SurveyMeans.php', + 'SurveyMissingProfiles' => $baseDir . '/admin/survey/classes/class.SurveyMissingProfiles.php', + 'SurveyMissingValues' => $baseDir . '/admin/survey/classes/class.SurveyMissingValues.php', + 'SurveyMobile' => $baseDir . '/admin/survey/classes/class.SurveyMobile.php', + 'SurveyMultiCrosstabs' => $baseDir . '/admin/survey/classes/surveyAnalysis/class.SurveyMultiCrosstabs.php', + 'SurveyPanel' => $baseDir . '/admin/survey/modules/mod_panel/class.SurveyPanel.php', + 'SurveyParaAnalysis' => $baseDir . '/admin/survey/classes/class.SurveyParaAnalysis.php', + 'SurveyParaGraph' => $baseDir . '/admin/survey/classes/class.SurveyParaGraph.php', + 'SurveyPostProcess' => $baseDir . '/admin/survey/classes/class.SurveyPostProcess.php', + 'SurveyProfileManager' => $baseDir . '/admin/survey/classes/class.SurveyProfileManager.php', + 'SurveyQuiz' => $baseDir . '/admin/survey/modules/mod_quiz/class.SurveyQuiz.php', + 'SurveyQuotas' => $baseDir . '/admin/survey/classes/class.SurveyQuotas.php', + 'SurveyRecoding' => $baseDir . '/admin/survey/classes/class.SurveyRecoding.php', + 'SurveyReminderTracking' => $baseDir . '/admin/survey/classes/class.SurveyReminderTracking.php', + 'SurveyRespondents' => $baseDir . '/admin/survey/classes/class.SurveyRespondents.php', + 'SurveySNDataFile' => $baseDir . '/admin/survey/classes/surveyData/class.SurveySNDataFile.php', + 'SurveySession' => $baseDir . '/admin/survey/classes/class.SurveySession.php', + 'SurveySessionDestructor' => $baseDir . '/admin/survey/classes/class.SurveySession.php', + 'SurveySetting' => $baseDir . '/admin/survey/classes/class.SurveySetting.php', + 'SurveySimpleMailInvitation' => $baseDir . '/admin/survey/classes/surveyEmails/class.SurveySimpleMailInvitation.php', + 'SurveySkupine' => $baseDir . '/admin/survey/classes/class.SurveySkupine.php', + 'SurveySlideshow' => $baseDir . '/admin/survey/modules/mod_slideshow/class.SurveySlideshow.php', + 'SurveySpeedIndex' => $baseDir . '/admin/survey/modules/mod_SPEEDINDEX/class.SurveySpeedIndex.php', + 'SurveyStaticHtml' => $baseDir . '/admin/survey/classes/class.SurveyStaticHtml.php', + 'SurveyStatistic' => $baseDir . '/admin/survey/classes/class.SurveyStatistic.php', + 'SurveyStatisticProfiles' => $baseDir . '/admin/survey/classes/class.SurveyStatisticProfiles.php', + 'SurveyStatusCasi' => $baseDir . '/admin/survey/classes/class.SurveyStatusCasi.php', + 'SurveyStatusProfiles' => $baseDir . '/admin/survey/classes/class.SurveyStatusProfiles.php', + 'SurveyTTest' => $baseDir . '/admin/survey/classes/surveyAnalysis/class.SurveyTTest.php', + 'SurveyTableChart' => $baseDir . '/admin/survey/classes/surveyAnalysis/class.SurveyTableChart.php', + 'SurveyTelephone' => $baseDir . '/admin/survey/classes/class.SurveyTelephone.php', + 'SurveyTextAnalysis' => $baseDir . '/admin/survey/classes/class.SurveyTextAnalysis.php', + 'SurveyTheme' => $baseDir . '/admin/survey/classes/class.SurveyTheme.php', + 'SurveyThemeEditor' => $baseDir . '/admin/survey/classes/class.SurveyThemeEditor.php', + 'SurveyTimeProfiles' => $baseDir . '/admin/survey/classes/class.SurveyTimeProfiles.php', + 'SurveyUnsubscribe' => $baseDir . '/admin/survey/classes/surveyEmails/class.SurveyUnsubscribe.php', + 'SurveyUporabnost' => $baseDir . '/admin/survey/modules/mod_uporabnost/class.SurveyUporabnost.php', + 'SurveyUrlLinks' => $baseDir . '/admin/survey/classes/class.SurveyUrlLinks.php', + 'SurveyUsableResp' => $baseDir . '/admin/survey/classes/class.SurveyUsableResp.php', + 'SurveyUserSession' => $baseDir . '/admin/survey/classes/class.SurveyUserSession.php', + 'SurveyUserSessionDestructor' => $baseDir . '/admin/survey/classes/class.SurveyUserSession.php', + 'SurveyUserSetting' => $baseDir . '/admin/survey/classes/class.SurveyUserSetting.php', + 'SurveyVariablesProfiles' => $baseDir . '/admin/survey/classes/class.SurveyVariablesProfiles.php', + 'SurveyVizualizacija' => $baseDir . '/admin/survey/modules/mod_vizualizacija/class.SurveyVizualizacija.php', + 'SurveyVoting' => $baseDir . '/admin/survey/modules/mod_voting/class.SurveyVoting.php', + 'SurveyZankaProfiles' => $baseDir . '/admin/survey/classes/class.SurveyZankaProfiles.php', + 'SurveyZoom' => $baseDir . '/admin/survey/classes/class.SurveyZoom.php', + 'Timer' => $baseDir . '/admin/survey/classes/class.Timer.php', + 'TrackingClass' => $baseDir . '/admin/survey/classes/tracking/TrackingClass.php', + 'User' => $baseDir . '/admin/survey/classes/class.User.php', + 'UserAccess' => $baseDir . '/frontend/payments/classes/class.UserAccess.php', + 'UserMailCron' => $baseDir . '/frontend/payments/classes/class.UserMailCron.php', + 'UserNarocila' => $baseDir . '/frontend/payments/classes/class.UserNarocila.php', + 'UserNarocilaCebelica' => $baseDir . '/frontend/payments/classes/class.UserNarocilaCebelica.php', + 'UserNarocilaCron' => $baseDir . '/frontend/payments/classes/class.UserNarocilaCron.php', + 'UserNarocilaPaypal' => $baseDir . '/frontend/payments/classes/class.UserNarocilaPaypal.php', + 'UserNarocilaStripe' => $baseDir . '/frontend/payments/classes/class.UserNarocilaStripe.php', + 'UserPlacila' => $baseDir . '/frontend/payments/classes/class.UserPlacila.php', + 'UserSetting' => $baseDir . '/admin/survey/classes/class.UserSetting.php', + 'UserTrackingClass' => $baseDir . '/admin/survey/classes/tracking/UserTrackingClass.php', + 'VariableView' => $baseDir . '/admin/survey/classes/class.SurveyVariableView.php', + 'Vprasanje' => $baseDir . '/admin/survey/classes/class.Vprasanje.php', + 'VprasanjeInline' => $baseDir . '/admin/survey/classes/class.VprasanjeInline.php', + 'VsotaLatex' => $baseDir . '/admin/survey/export/latexclasses/Vprasanja/VsotaLatex.php', + 'WPN' => $baseDir . '/admin/survey/modules/mod_WPN/class.WPN.php', + 'XmlDocument' => $baseDir . '/admin/survey/export/xmlClasses/class.XmlDocument.php', + 'XmlSurvey' => $baseDir . '/admin/survey/export/xmlClasses/class.XmlSurvey.php', + 'XmlSurveyElement' => $baseDir . '/admin/survey/export/xmlClasses/class.XmlSurveyElement.php', + 'enkaParameters' => $baseDir . '/admin/survey/classes/class.params.php', + 'pCache' => $baseDir . '/admin/survey/pChart/classes/class.pCache.php', + 'pChart' => $baseDir . '/admin/survey/pChart/classes/class.pChart.php', + 'pData' => $baseDir . '/admin/survey/pChart/classes/class.pData.php', +); diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php new file mode 100644 index 0000000..10fd836 --- /dev/null +++ b/vendor/composer/autoload_files.php @@ -0,0 +1,23 @@ + $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', + 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', + '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', + 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', + 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', + '3109cb1a231dcd04bee1f9f620d46975' => $vendorDir . '/paragonie/sodium_compat/autoload.php', + 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', + '5bc35216aa4f6cb823ce4a5cec52fdce' => $baseDir . '/main/survey/mobile-detect/Mobile_Detect.php', + '22b9df91cd299713e735921c8347a64c' => $baseDir . '/admin/survey/classes/phpqrcode/phpqrcode.php', + 'b16a1c1f07a2cd49108ffd9526301d46' => $baseDir . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier.auto.php', + '42ee429c4fc185623d97225cd58c1721' => $baseDir . '/frontend/api/class.ApiLoginController.php', + '5c9b5464443c3e2e223486d66948f183' => $baseDir . '/frontend/api/class.ApiLogin.php', + '35561f6018bff40f363b94411e0141e0' => $baseDir . '/utils/1kaCron/class.CronJobs.php', +); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php new file mode 100644 index 0000000..b7fc012 --- /dev/null +++ b/vendor/composer/autoload_namespaces.php @@ -0,0 +1,9 @@ + array($vendorDir . '/symfony/polyfill-php72'), + 'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'), + 'Symfony\\Polyfill\\Intl\\Idn\\' => array($vendorDir . '/symfony/polyfill-intl-idn'), + 'Stripe\\' => array($vendorDir . '/stripe/stripe-php/lib'), + 'Sonata\\GoogleAuthenticator\\' => array($vendorDir . '/sonata-project/google-authenticator/src'), + 'Sample\\' => array($vendorDir . '/paypal/paypal-checkout-sdk/samples'), + 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), + 'PayPalHttp\\' => array($vendorDir . '/paypal/paypalhttp/lib/PayPalHttp'), + 'PayPalCheckoutSdk\\' => array($vendorDir . '/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk'), + 'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'), + 'Minishlink\\WebPush\\' => array($vendorDir . '/minishlink/web-push/src'), + 'MaxMind\\WebService\\' => array($vendorDir . '/maxmind/web-service-common/src/WebService'), + 'MaxMind\\Exception\\' => array($vendorDir . '/maxmind/web-service-common/src/Exception'), + 'MaxMind\\Db\\' => array($vendorDir . '/maxmind-db/reader/src/MaxMind/Db'), + 'Jose\\Component\\Signature\\Algorithm\\' => array($vendorDir . '/web-token/jwt-signature-algorithm-ecdsa', $vendorDir . '/web-token/jwt-signature-algorithm-eddsa', $vendorDir . '/web-token/jwt-signature-algorithm-hmac', $vendorDir . '/web-token/jwt-signature-algorithm-none', $vendorDir . '/web-token/jwt-signature-algorithm-rsa'), + 'Jose\\Component\\Signature\\' => array($vendorDir . '/web-token/jwt-signature'), + 'Jose\\Component\\KeyManagement\\' => array($vendorDir . '/web-token/jwt-key-mgmt'), + 'Jose\\Component\\Core\\Util\\Ecc\\' => array($vendorDir . '/web-token/jwt-util-ecc'), + 'Jose\\Component\\Core\\' => array($vendorDir . '/web-token/jwt-core'), + 'Hierarhija\\' => array($baseDir . '/admin/survey/modules/mod_hierarhija'), + 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), + 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), + 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), + 'Google\\Authenticator\\' => array($vendorDir . '/sonata-project/google-authenticator/src'), + 'GeoIp2\\' => array($vendorDir . '/geoip2/geoip2/src'), + 'FG\\' => array($vendorDir . '/fgrosse/phpasn1/lib'), + 'Composer\\CaBundle\\' => array($vendorDir . '/composer/ca-bundle/src'), + 'Base64Url\\' => array($vendorDir . '/spomky-labs/base64url/src'), + 'App\\' => array($baseDir . '/main/survey/app'), +); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php new file mode 100644 index 0000000..691ebf4 --- /dev/null +++ b/vendor/composer/autoload_real.php @@ -0,0 +1,70 @@ += 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); + if ($useStaticLoader) { + require_once __DIR__ . '/autoload_static.php'; + + call_user_func(\Composer\Autoload\ComposerStaticInit6b03163c371c5541881b55b762b8c779::getInitializer($loader)); + } else { + $map = require __DIR__ . '/autoload_namespaces.php'; + foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); + } + + $map = require __DIR__ . '/autoload_psr4.php'; + foreach ($map as $namespace => $path) { + $loader->setPsr4($namespace, $path); + } + + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } + } + + $loader->register(true); + + if ($useStaticLoader) { + $includeFiles = Composer\Autoload\ComposerStaticInit6b03163c371c5541881b55b762b8c779::$files; + } else { + $includeFiles = require __DIR__ . '/autoload_files.php'; + } + foreach ($includeFiles as $fileIdentifier => $file) { + composerRequire6b03163c371c5541881b55b762b8c779($fileIdentifier, $file); + } + + return $loader; + } +} + +function composerRequire6b03163c371c5541881b55b762b8c779($fileIdentifier, $file) +{ + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + require $file; + + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + } +} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php new file mode 100644 index 0000000..da93477 --- /dev/null +++ b/vendor/composer/autoload_static.php @@ -0,0 +1,652 @@ + __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', + 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', + '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', + 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', + 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', + '3109cb1a231dcd04bee1f9f620d46975' => __DIR__ . '/..' . '/paragonie/sodium_compat/autoload.php', + 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', + '5bc35216aa4f6cb823ce4a5cec52fdce' => __DIR__ . '/../..' . '/main/survey/mobile-detect/Mobile_Detect.php', + '22b9df91cd299713e735921c8347a64c' => __DIR__ . '/../..' . '/admin/survey/classes/phpqrcode/phpqrcode.php', + 'b16a1c1f07a2cd49108ffd9526301d46' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier.auto.php', + '42ee429c4fc185623d97225cd58c1721' => __DIR__ . '/../..' . '/frontend/api/class.ApiLoginController.php', + '5c9b5464443c3e2e223486d66948f183' => __DIR__ . '/../..' . '/frontend/api/class.ApiLogin.php', + '35561f6018bff40f363b94411e0141e0' => __DIR__ . '/../..' . '/utils/1kaCron/class.CronJobs.php', + ); + + public static $prefixLengthsPsr4 = array ( + 'S' => + array ( + 'Symfony\\Polyfill\\Php72\\' => 23, + 'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33, + 'Symfony\\Polyfill\\Intl\\Idn\\' => 26, + 'Stripe\\' => 7, + 'Sonata\\GoogleAuthenticator\\' => 27, + 'Sample\\' => 7, + ), + 'P' => + array ( + 'Psr\\Http\\Message\\' => 17, + 'PayPalHttp\\' => 11, + 'PayPalCheckoutSdk\\' => 18, + 'PHPMailer\\PHPMailer\\' => 20, + ), + 'M' => + array ( + 'Minishlink\\WebPush\\' => 19, + 'MaxMind\\WebService\\' => 19, + 'MaxMind\\Exception\\' => 18, + 'MaxMind\\Db\\' => 11, + ), + 'J' => + array ( + 'Jose\\Component\\Signature\\Algorithm\\' => 35, + 'Jose\\Component\\Signature\\' => 25, + 'Jose\\Component\\KeyManagement\\' => 29, + 'Jose\\Component\\Core\\Util\\Ecc\\' => 29, + 'Jose\\Component\\Core\\' => 20, + ), + 'H' => + array ( + 'Hierarhija\\' => 11, + ), + 'G' => + array ( + 'GuzzleHttp\\Psr7\\' => 16, + 'GuzzleHttp\\Promise\\' => 19, + 'GuzzleHttp\\' => 11, + 'Google\\Authenticator\\' => 21, + 'GeoIp2\\' => 7, + ), + 'F' => + array ( + 'FG\\' => 3, + ), + 'C' => + array ( + 'Composer\\CaBundle\\' => 18, + ), + 'B' => + array ( + 'Base64Url\\' => 10, + ), + 'A' => + array ( + 'App\\' => 4, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'Symfony\\Polyfill\\Php72\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php72', + ), + 'Symfony\\Polyfill\\Intl\\Normalizer\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer', + ), + 'Symfony\\Polyfill\\Intl\\Idn\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-idn', + ), + 'Stripe\\' => + array ( + 0 => __DIR__ . '/..' . '/stripe/stripe-php/lib', + ), + 'Sonata\\GoogleAuthenticator\\' => + array ( + 0 => __DIR__ . '/..' . '/sonata-project/google-authenticator/src', + ), + 'Sample\\' => + array ( + 0 => __DIR__ . '/..' . '/paypal/paypal-checkout-sdk/samples', + ), + 'Psr\\Http\\Message\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/http-message/src', + ), + 'PayPalHttp\\' => + array ( + 0 => __DIR__ . '/..' . '/paypal/paypalhttp/lib/PayPalHttp', + ), + 'PayPalCheckoutSdk\\' => + array ( + 0 => __DIR__ . '/..' . '/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk', + ), + 'PHPMailer\\PHPMailer\\' => + array ( + 0 => __DIR__ . '/..' . '/phpmailer/phpmailer/src', + ), + 'Minishlink\\WebPush\\' => + array ( + 0 => __DIR__ . '/..' . '/minishlink/web-push/src', + ), + 'MaxMind\\WebService\\' => + array ( + 0 => __DIR__ . '/..' . '/maxmind/web-service-common/src/WebService', + ), + 'MaxMind\\Exception\\' => + array ( + 0 => __DIR__ . '/..' . '/maxmind/web-service-common/src/Exception', + ), + 'MaxMind\\Db\\' => + array ( + 0 => __DIR__ . '/..' . '/maxmind-db/reader/src/MaxMind/Db', + ), + 'Jose\\Component\\Signature\\Algorithm\\' => + array ( + 0 => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-ecdsa', + 1 => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-eddsa', + 2 => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-hmac', + 3 => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-none', + 4 => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-rsa', + ), + 'Jose\\Component\\Signature\\' => + array ( + 0 => __DIR__ . '/..' . '/web-token/jwt-signature', + ), + 'Jose\\Component\\KeyManagement\\' => + array ( + 0 => __DIR__ . '/..' . '/web-token/jwt-key-mgmt', + ), + 'Jose\\Component\\Core\\Util\\Ecc\\' => + array ( + 0 => __DIR__ . '/..' . '/web-token/jwt-util-ecc', + ), + 'Jose\\Component\\Core\\' => + array ( + 0 => __DIR__ . '/..' . '/web-token/jwt-core', + ), + 'Hierarhija\\' => + array ( + 0 => __DIR__ . '/../..' . '/admin/survey/modules/mod_hierarhija', + ), + 'GuzzleHttp\\Psr7\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src', + ), + 'GuzzleHttp\\Promise\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/promises/src', + ), + 'GuzzleHttp\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src', + ), + 'Google\\Authenticator\\' => + array ( + 0 => __DIR__ . '/..' . '/sonata-project/google-authenticator/src', + ), + 'GeoIp2\\' => + array ( + 0 => __DIR__ . '/..' . '/geoip2/geoip2/src', + ), + 'FG\\' => + array ( + 0 => __DIR__ . '/..' . '/fgrosse/phpasn1/lib', + ), + 'Composer\\CaBundle\\' => + array ( + 0 => __DIR__ . '/..' . '/composer/ca-bundle/src', + ), + 'Base64Url\\' => + array ( + 0 => __DIR__ . '/..' . '/spomky-labs/base64url/src', + ), + 'App\\' => + array ( + 0 => __DIR__ . '/../..' . '/main/survey/app', + ), + ); + + public static $classMap = array ( + 'AnalizaBreak' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Analize/AnalizaBreak.php', + 'AnalizaCReport' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Analize/AnalizaCReport.php', + 'AnalizaCharts' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Analize/AnalizaCharts.php', + 'AnalizaCrosstab' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Analize/AnalizaCrosstab.php', + 'AnalizaDesc' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Analize/AnalizaDesc.php', + 'AnalizaFreq' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Analize/AnalizaFreq.php', + 'AnalizaMean' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Analize/AnalizaMean.php', + 'AnalizaMultiCrosstab' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Analize/AnalizaMultiCrosstab.php', + 'AnalizaSums' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Analize/AnalizaSums.php', + 'AnalizaTTest' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Analize/AnalizaTTest.php', + 'ApiController' => __DIR__ . '/../..' . '/admin/survey/api/class.ApiController.php', + 'ApiNarocilaController' => __DIR__ . '/../..' . '/frontend/payments/classes/class.ApiNarocilaController.php', + 'ApiSurvey' => __DIR__ . '/../..' . '/admin/survey/api/class.ApiSurvey.php', + 'BesediloLatex' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Vprasanja/BesediloLatex.php', + 'BesediloXml' => __DIR__ . '/../..' . '/admin/survey/export/xmlClasses/Vprasanja/BesediloXml.php', + 'Branching' => __DIR__ . '/../..' . '/admin/survey/Branching.php', + 'BranchingAjax' => __DIR__ . '/../..' . '/admin/survey/BranchingAjax.php', + 'Cache' => __DIR__ . '/../..' . '/admin/survey/classes/class.Cache.php', + 'CheckboxXml' => __DIR__ . '/../..' . '/admin/survey/export/xmlClasses/Vprasanja/CheckboxXml.php', + 'Common' => __DIR__ . '/../..' . '/admin/survey/classes/class.Common.php', + 'CrossRoad' => __DIR__ . '/../..' . '/admin/survey/classes/tracking/CrossRoad.php', + 'DatumLatex' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Vprasanja/DatumLatex.php', + 'Demografija' => __DIR__ . '/../..' . '/admin/survey/classes/class.Demografija.php', + 'Dostop' => __DIR__ . '/../..' . '/admin/survey/classes/class.Dostop.php', + 'ExclusiveLock' => __DIR__ . '/../..' . '/admin/survey/classes/surveyData/class.ExclusiveLock.php', + 'Export' => __DIR__ . '/../..' . '/admin/survey/classes/class.Export.php', + 'ExportController' => __DIR__ . '/../..' . '/admin/survey/export/class.ExportController.php', + 'Forum' => __DIR__ . '/../..' . '/admin/survey/classes/class.Forum.php', + 'GDPR' => __DIR__ . '/../..' . '/admin/survey/classes/class.GDPR.php', + 'GetSiteUrl' => __DIR__ . '/../..' . '/admin/survey/classes/class.GetSiteUrl.php', + 'Glasovanje' => __DIR__ . '/../..' . '/admin/survey/Glasovanje.php', + 'GlobalMisc' => __DIR__ . '/../..' . '/admin/survey/classes/class.GlobalMisc.php', + 'GridMultipleLatex' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Vprasanja/GridMultipleLatex.php', + 'HTML5' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Lexer/PH5P.php', + 'HTML5TreeConstructer' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Lexer/PH5P.php', + 'HTMLPurifier' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier.php', + 'HTMLPurifier_AttrCollections' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrCollections.php', + 'HTMLPurifier_AttrDef' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef.php', + 'HTMLPurifier_AttrDef_CSS' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS.php', + 'HTMLPurifier_AttrDef_CSS_AlphaValue' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php', + 'HTMLPurifier_AttrDef_CSS_Background' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/Background.php', + 'HTMLPurifier_AttrDef_CSS_BackgroundPosition' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php', + 'HTMLPurifier_AttrDef_CSS_Border' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/Border.php', + 'HTMLPurifier_AttrDef_CSS_Color' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/Color.php', + 'HTMLPurifier_AttrDef_CSS_Composite' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/Composite.php', + 'HTMLPurifier_AttrDef_CSS_DenyElementDecorator' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php', + 'HTMLPurifier_AttrDef_CSS_Filter' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/Filter.php', + 'HTMLPurifier_AttrDef_CSS_Font' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/Font.php', + 'HTMLPurifier_AttrDef_CSS_FontFamily' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/FontFamily.php', + 'HTMLPurifier_AttrDef_CSS_ImportantDecorator' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php', + 'HTMLPurifier_AttrDef_CSS_Length' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/Length.php', + 'HTMLPurifier_AttrDef_CSS_ListStyle' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/ListStyle.php', + 'HTMLPurifier_AttrDef_CSS_Multiple' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/Multiple.php', + 'HTMLPurifier_AttrDef_CSS_Number' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/Number.php', + 'HTMLPurifier_AttrDef_CSS_Percentage' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/Percentage.php', + 'HTMLPurifier_AttrDef_CSS_TextDecoration' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php', + 'HTMLPurifier_AttrDef_CSS_URI' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/CSS/URI.php', + 'HTMLPurifier_AttrDef_Enum' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/Enum.php', + 'HTMLPurifier_AttrDef_HTML_Bool' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/HTML/Bool.php', + 'HTMLPurifier_AttrDef_HTML_Class' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/HTML/Class.php', + 'HTMLPurifier_AttrDef_HTML_Color' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/HTML/Color.php', + 'HTMLPurifier_AttrDef_HTML_FrameTarget' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php', + 'HTMLPurifier_AttrDef_HTML_ID' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/HTML/ID.php', + 'HTMLPurifier_AttrDef_HTML_Length' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/HTML/Length.php', + 'HTMLPurifier_AttrDef_HTML_LinkTypes' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php', + 'HTMLPurifier_AttrDef_HTML_MultiLength' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/HTML/MultiLength.php', + 'HTMLPurifier_AttrDef_HTML_Nmtokens' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/HTML/Nmtokens.php', + 'HTMLPurifier_AttrDef_HTML_Pixels' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/HTML/Pixels.php', + 'HTMLPurifier_AttrDef_Integer' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/Integer.php', + 'HTMLPurifier_AttrDef_Lang' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/Lang.php', + 'HTMLPurifier_AttrDef_Switch' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/Switch.php', + 'HTMLPurifier_AttrDef_Text' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/Text.php', + 'HTMLPurifier_AttrDef_URI' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/URI.php', + 'HTMLPurifier_AttrDef_URI_Email' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/URI/Email.php', + 'HTMLPurifier_AttrDef_URI_Email_SimpleCheck' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php', + 'HTMLPurifier_AttrDef_URI_Host' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/URI/Host.php', + 'HTMLPurifier_AttrDef_URI_IPv4' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/URI/IPv4.php', + 'HTMLPurifier_AttrDef_URI_IPv6' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/URI/IPv6.php', + 'HTMLPurifier_AttrTransform' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform.php', + 'HTMLPurifier_AttrTransform_Background' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/Background.php', + 'HTMLPurifier_AttrTransform_BdoDir' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/BdoDir.php', + 'HTMLPurifier_AttrTransform_BgColor' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/BgColor.php', + 'HTMLPurifier_AttrTransform_BoolToCSS' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/BoolToCSS.php', + 'HTMLPurifier_AttrTransform_Border' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/Border.php', + 'HTMLPurifier_AttrTransform_EnumToCSS' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/EnumToCSS.php', + 'HTMLPurifier_AttrTransform_ImgRequired' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/ImgRequired.php', + 'HTMLPurifier_AttrTransform_ImgSpace' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/ImgSpace.php', + 'HTMLPurifier_AttrTransform_Input' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/Input.php', + 'HTMLPurifier_AttrTransform_Lang' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/Lang.php', + 'HTMLPurifier_AttrTransform_Length' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/Length.php', + 'HTMLPurifier_AttrTransform_Name' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/Name.php', + 'HTMLPurifier_AttrTransform_NameSync' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/NameSync.php', + 'HTMLPurifier_AttrTransform_Nofollow' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/Nofollow.php', + 'HTMLPurifier_AttrTransform_SafeEmbed' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/SafeEmbed.php', + 'HTMLPurifier_AttrTransform_SafeObject' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/SafeObject.php', + 'HTMLPurifier_AttrTransform_SafeParam' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/SafeParam.php', + 'HTMLPurifier_AttrTransform_ScriptRequired' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/ScriptRequired.php', + 'HTMLPurifier_AttrTransform_Textarea' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTransform/Textarea.php', + 'HTMLPurifier_AttrTypes' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrTypes.php', + 'HTMLPurifier_AttrValidator' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrValidator.php', + 'HTMLPurifier_Bootstrap' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Bootstrap.php', + 'HTMLPurifier_CSSDefinition' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/CSSDefinition.php', + 'HTMLPurifier_ChildDef' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ChildDef.php', + 'HTMLPurifier_ChildDef_Chameleon' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ChildDef/Chameleon.php', + 'HTMLPurifier_ChildDef_Custom' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ChildDef/Custom.php', + 'HTMLPurifier_ChildDef_Empty' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ChildDef/Empty.php', + 'HTMLPurifier_ChildDef_Optional' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ChildDef/Optional.php', + 'HTMLPurifier_ChildDef_Required' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ChildDef/Required.php', + 'HTMLPurifier_ChildDef_StrictBlockquote' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ChildDef/StrictBlockquote.php', + 'HTMLPurifier_ChildDef_Table' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ChildDef/Table.php', + 'HTMLPurifier_Config' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Config.php', + 'HTMLPurifier_ConfigSchema' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ConfigSchema.php', + 'HTMLPurifier_ConfigSchema_Builder_ConfigSchema' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php', + 'HTMLPurifier_ConfigSchema_Builder_Xml' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ConfigSchema/Builder/Xml.php', + 'HTMLPurifier_ConfigSchema_Exception' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ConfigSchema/Exception.php', + 'HTMLPurifier_ConfigSchema_Interchange' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ConfigSchema/Interchange.php', + 'HTMLPurifier_ConfigSchema_InterchangeBuilder' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php', + 'HTMLPurifier_ConfigSchema_Interchange_Directive' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php', + 'HTMLPurifier_ConfigSchema_Interchange_Id' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ConfigSchema/Interchange/Id.php', + 'HTMLPurifier_ConfigSchema_Validator' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ConfigSchema/Validator.php', + 'HTMLPurifier_ConfigSchema_ValidatorAtom' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php', + 'HTMLPurifier_ContentSets' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ContentSets.php', + 'HTMLPurifier_Context' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Context.php', + 'HTMLPurifier_Definition' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Definition.php', + 'HTMLPurifier_DefinitionCache' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/DefinitionCache.php', + 'HTMLPurifier_DefinitionCacheFactory' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/DefinitionCacheFactory.php', + 'HTMLPurifier_DefinitionCache_Decorator' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/DefinitionCache/Decorator.php', + 'HTMLPurifier_DefinitionCache_Decorator_Cleanup' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php', + 'HTMLPurifier_DefinitionCache_Decorator_Memory' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/DefinitionCache/Decorator/Memory.php', + 'HTMLPurifier_DefinitionCache_Null' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/DefinitionCache/Null.php', + 'HTMLPurifier_DefinitionCache_Serializer' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/DefinitionCache/Serializer.php', + 'HTMLPurifier_Doctype' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Doctype.php', + 'HTMLPurifier_DoctypeRegistry' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/DoctypeRegistry.php', + 'HTMLPurifier_ElementDef' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ElementDef.php', + 'HTMLPurifier_Encoder' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Encoder.php', + 'HTMLPurifier_EntityLookup' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/EntityLookup.php', + 'HTMLPurifier_EntityParser' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/EntityParser.php', + 'HTMLPurifier_ErrorCollector' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ErrorCollector.php', + 'HTMLPurifier_ErrorStruct' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/ErrorStruct.php', + 'HTMLPurifier_Exception' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Exception.php', + 'HTMLPurifier_Filter' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Filter.php', + 'HTMLPurifier_Filter_ExtractStyleBlocks' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Filter/ExtractStyleBlocks.php', + 'HTMLPurifier_Filter_YouTube' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Filter/YouTube.php', + 'HTMLPurifier_Generator' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Generator.php', + 'HTMLPurifier_HTMLDefinition' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLDefinition.php', + 'HTMLPurifier_HTMLModule' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule.php', + 'HTMLPurifier_HTMLModuleManager' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModuleManager.php', + 'HTMLPurifier_HTMLModule_Bdo' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Bdo.php', + 'HTMLPurifier_HTMLModule_CommonAttributes' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/CommonAttributes.php', + 'HTMLPurifier_HTMLModule_Edit' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Edit.php', + 'HTMLPurifier_HTMLModule_Forms' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Forms.php', + 'HTMLPurifier_HTMLModule_Hypertext' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Hypertext.php', + 'HTMLPurifier_HTMLModule_Image' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Image.php', + 'HTMLPurifier_HTMLModule_Legacy' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Legacy.php', + 'HTMLPurifier_HTMLModule_List' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/List.php', + 'HTMLPurifier_HTMLModule_Name' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Name.php', + 'HTMLPurifier_HTMLModule_Nofollow' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Nofollow.php', + 'HTMLPurifier_HTMLModule_NonXMLCommonAttributes' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php', + 'HTMLPurifier_HTMLModule_Object' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Object.php', + 'HTMLPurifier_HTMLModule_Presentation' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Presentation.php', + 'HTMLPurifier_HTMLModule_Proprietary' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Proprietary.php', + 'HTMLPurifier_HTMLModule_Ruby' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Ruby.php', + 'HTMLPurifier_HTMLModule_SafeEmbed' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/SafeEmbed.php', + 'HTMLPurifier_HTMLModule_SafeObject' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/SafeObject.php', + 'HTMLPurifier_HTMLModule_Scripting' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Scripting.php', + 'HTMLPurifier_HTMLModule_StyleAttribute' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/StyleAttribute.php', + 'HTMLPurifier_HTMLModule_Tables' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Tables.php', + 'HTMLPurifier_HTMLModule_Target' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Target.php', + 'HTMLPurifier_HTMLModule_Text' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Text.php', + 'HTMLPurifier_HTMLModule_Tidy' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Tidy.php', + 'HTMLPurifier_HTMLModule_Tidy_Name' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Tidy/Name.php', + 'HTMLPurifier_HTMLModule_Tidy_Proprietary' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Tidy/Proprietary.php', + 'HTMLPurifier_HTMLModule_Tidy_Strict' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Tidy/Strict.php', + 'HTMLPurifier_HTMLModule_Tidy_Transitional' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Tidy/Transitional.php', + 'HTMLPurifier_HTMLModule_Tidy_XHTML' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Tidy/XHTML.php', + 'HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php', + 'HTMLPurifier_HTMLModule_XMLCommonAttributes' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/HTMLModule/XMLCommonAttributes.php', + 'HTMLPurifier_IDAccumulator' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/IDAccumulator.php', + 'HTMLPurifier_Injector' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Injector.php', + 'HTMLPurifier_Injector_AutoParagraph' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Injector/AutoParagraph.php', + 'HTMLPurifier_Injector_DisplayLinkURI' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Injector/DisplayLinkURI.php', + 'HTMLPurifier_Injector_Linkify' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Injector/Linkify.php', + 'HTMLPurifier_Injector_PurifierLinkify' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Injector/PurifierLinkify.php', + 'HTMLPurifier_Injector_RemoveEmpty' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Injector/RemoveEmpty.php', + 'HTMLPurifier_Injector_RemoveSpansWithoutAttributes' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php', + 'HTMLPurifier_Injector_SafeObject' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Injector/SafeObject.php', + 'HTMLPurifier_Language' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Language.php', + 'HTMLPurifier_LanguageFactory' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/LanguageFactory.php', + 'HTMLPurifier_Language_en_x_test' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Language/classes/en-x-test.php', + 'HTMLPurifier_Length' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Length.php', + 'HTMLPurifier_Lexer' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Lexer.php', + 'HTMLPurifier_Lexer_DOMLex' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Lexer/DOMLex.php', + 'HTMLPurifier_Lexer_DirectLex' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Lexer/DirectLex.php', + 'HTMLPurifier_Lexer_PEARSax3' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Lexer/PEARSax3.php', + 'HTMLPurifier_Lexer_PH5P' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Lexer/PH5P.php', + 'HTMLPurifier_PercentEncoder' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/PercentEncoder.php', + 'HTMLPurifier_Printer' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Printer.php', + 'HTMLPurifier_Printer_CSSDefinition' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Printer/CSSDefinition.php', + 'HTMLPurifier_Printer_ConfigForm' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Printer/ConfigForm.php', + 'HTMLPurifier_Printer_ConfigForm_NullDecorator' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Printer/ConfigForm.php', + 'HTMLPurifier_Printer_ConfigForm_bool' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Printer/ConfigForm.php', + 'HTMLPurifier_Printer_ConfigForm_default' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Printer/ConfigForm.php', + 'HTMLPurifier_Printer_HTMLDefinition' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Printer/HTMLDefinition.php', + 'HTMLPurifier_PropertyList' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/PropertyList.php', + 'HTMLPurifier_PropertyListIterator' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/PropertyListIterator.php', + 'HTMLPurifier_Strategy' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Strategy.php', + 'HTMLPurifier_Strategy_Composite' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Strategy/Composite.php', + 'HTMLPurifier_Strategy_Core' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Strategy/Core.php', + 'HTMLPurifier_Strategy_FixNesting' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Strategy/FixNesting.php', + 'HTMLPurifier_Strategy_MakeWellFormed' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Strategy/MakeWellFormed.php', + 'HTMLPurifier_Strategy_RemoveForeignElements' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Strategy/RemoveForeignElements.php', + 'HTMLPurifier_Strategy_ValidateAttributes' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Strategy/ValidateAttributes.php', + 'HTMLPurifier_StringHash' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/StringHash.php', + 'HTMLPurifier_StringHashParser' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/StringHashParser.php', + 'HTMLPurifier_TagTransform' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/TagTransform.php', + 'HTMLPurifier_TagTransform_Font' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/TagTransform/Font.php', + 'HTMLPurifier_TagTransform_Simple' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/TagTransform/Simple.php', + 'HTMLPurifier_Token' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Token.php', + 'HTMLPurifier_TokenFactory' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/TokenFactory.php', + 'HTMLPurifier_Token_Comment' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Token/Comment.php', + 'HTMLPurifier_Token_Empty' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Token/Empty.php', + 'HTMLPurifier_Token_End' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Token/End.php', + 'HTMLPurifier_Token_Start' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Token/Start.php', + 'HTMLPurifier_Token_Tag' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Token/Tag.php', + 'HTMLPurifier_Token_Text' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Token/Text.php', + 'HTMLPurifier_URI' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URI.php', + 'HTMLPurifier_URIDefinition' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIDefinition.php', + 'HTMLPurifier_URIFilter' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIFilter.php', + 'HTMLPurifier_URIFilter_DisableExternal' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIFilter/DisableExternal.php', + 'HTMLPurifier_URIFilter_DisableExternalResources' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIFilter/DisableExternalResources.php', + 'HTMLPurifier_URIFilter_DisableResources' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIFilter/DisableResources.php', + 'HTMLPurifier_URIFilter_HostBlacklist' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIFilter/HostBlacklist.php', + 'HTMLPurifier_URIFilter_MakeAbsolute' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIFilter/MakeAbsolute.php', + 'HTMLPurifier_URIFilter_Munge' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIFilter/Munge.php', + 'HTMLPurifier_URIParser' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIParser.php', + 'HTMLPurifier_URIScheme' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIScheme.php', + 'HTMLPurifier_URISchemeRegistry' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URISchemeRegistry.php', + 'HTMLPurifier_URIScheme_data' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIScheme/data.php', + 'HTMLPurifier_URIScheme_file' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIScheme/file.php', + 'HTMLPurifier_URIScheme_ftp' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIScheme/ftp.php', + 'HTMLPurifier_URIScheme_http' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIScheme/http.php', + 'HTMLPurifier_URIScheme_https' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIScheme/https.php', + 'HTMLPurifier_URIScheme_mailto' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIScheme/mailto.php', + 'HTMLPurifier_URIScheme_news' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIScheme/news.php', + 'HTMLPurifier_URIScheme_nntp' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/URIScheme/nntp.php', + 'HTMLPurifier_UnitConverter' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/UnitConverter.php', + 'HTMLPurifier_VarParser' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/VarParser.php', + 'HTMLPurifier_VarParserException' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/VarParserException.php', + 'HTMLPurifier_VarParser_Flexible' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/VarParser/Flexible.php', + 'HTMLPurifier_VarParser_Native' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/VarParser/Native.php', + 'HashUrl' => __DIR__ . '/../..' . '/admin/survey/classes/class.HashUrl.php', + 'HeatmapLatex' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Vprasanja/HeatmapLatex.php', + 'Help' => __DIR__ . '/../..' . '/admin/survey/Help.php', + 'HierarhijaAnalysis' => __DIR__ . '/../..' . '/admin/survey/modules/mod_hierarhija/class/HierarhijaAnalysisClass.php', + 'Hierarhija\\Ajax\\AjaxHierarhija' => __DIR__ . '/../..' . '/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxHierarhijaClass.php', + 'Hierarhija\\Ajax\\AjaxHierarhijaDostopUporabnikovClass' => __DIR__ . '/../..' . '/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxHierarhijaDostopUporabnikovClass.php', + 'Hierarhija\\Ajax\\AjaxSuperSifra' => __DIR__ . '/../..' . '/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxSuperSifraClass.php', + 'Hierarhija\\Ajax\\AjaxUporabniki' => __DIR__ . '/../..' . '/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxUporabnikiClass.php', + 'Hierarhija\\Hierarhija' => __DIR__ . '/../..' . '/admin/survey/modules/mod_hierarhija/class/HierarhijaClass.php', + 'Hierarhija\\HierarhijaAjax' => __DIR__ . '/../..' . '/admin/survey/modules/mod_hierarhija/class/HierarhijaAjaxClass.php', + 'Hierarhija\\HierarhijaHelper' => __DIR__ . '/../..' . '/admin/survey/modules/mod_hierarhija/class/HierarhijaHelper.php', + 'Hierarhija\\HierarhijaIzvoz' => __DIR__ . '/../..' . '/admin/survey/modules/mod_hierarhija/class/HierarhijaIzvoz.php', + 'Hierarhija\\HierarhijaIzvozAnalize' => __DIR__ . '/../..' . '/admin/survey/modules/mod_hierarhija/class/HierarhijaIzvozAnalize.php', + 'Hierarhija\\HierarhijaKopiranjeClass' => __DIR__ . '/../..' . '/admin/survey/modules/mod_hierarhija/class/HierarhijaKopiranjeClass.php', + 'Hierarhija\\HierarhijaPorocilaClass' => __DIR__ . '/../..' . '/admin/survey/modules/mod_hierarhija/class/HierarhijaPorocilaClass.php', + 'Hierarhija\\Model\\HierarhijaOnlyQuery' => __DIR__ . '/../..' . '/admin/survey/modules/mod_hierarhija/model/HierarhijaOnlyQuery.php', + 'Hierarhija\\Model\\HierarhijaQuery' => __DIR__ . '/../..' . '/admin/survey/modules/mod_hierarhija/model/HierarhijaQuery.php', + 'KalkulacijaLatex' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Vprasanja/KalkulacijaLatex.php', + 'KvotaLatex' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Vprasanja/KvotaLatex.php', + 'LatexAnalysis' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/class.LatexAnalysis.php', + 'LatexAnalysisElement' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/class.LatexAnalysisElement.php', + 'LatexDocument' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/class.LatexDocument.php', + 'LatexEditsAnalysis' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/class.LatexEditsAnalysis.php', + 'LatexGDPR' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/class.LatexGDPR.php', + 'LatexStatus' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/class.LatexStatus.php', + 'LatexSurvey' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/class.LatexSurvey.php', + 'LatexSurveyElement' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/class.LatexSurveyElement.php', + 'Library' => __DIR__ . '/../..' . '/admin/survey/classes/class.Library.php', + 'LokacijaLatex' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Vprasanja/LokacijaLatex.php', + 'MAZA' => __DIR__ . '/../..' . '/admin/survey/modules/mod_MAZA/class.MAZA.php', + 'MAZAExport' => __DIR__ . '/../..' . '/admin/survey/modules/mod_MAZA/class.MAZAExport.php', + 'MailAdapter' => __DIR__ . '/../..' . '/admin/survey/classes/objects/obj.MailAdapter.php', + 'MobileSurveyAdmin' => __DIR__ . '/../..' . '/admin/survey/classes/mobile/class.MobileSurveyAdmin.php', + 'MultiGridLatex' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Vprasanja/MultiGridLatex.php', + 'MultiGridXml' => __DIR__ . '/../..' . '/admin/survey/export/xmlClasses/Vprasanja/MultiGridXml.php', + 'MustangWord' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyLanguageTechnology.php', + 'MyHorBar' => __DIR__ . '/../..' . '/admin/survey/pChart/classes/class.MyHorBar.php', + 'NagovorLatex' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Vprasanja/NagovorLatex.php', + 'NewSurvey' => __DIR__ . '/../..' . '/admin/survey/classes/class.NewSurvey.php', + 'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', + 'Notifications' => __DIR__ . '/../..' . '/admin/survey/classes/class.Notifications.php', + 'PopUp' => __DIR__ . '/../..' . '/admin/survey/classes/objects/obj.PopUp.php', + 'PopUpButton' => __DIR__ . '/../..' . '/admin/survey/classes/objects/obj.PopUpButton.php', + 'PopUpCancelButton' => __DIR__ . '/../..' . '/admin/survey/classes/objects/obj.PopUpCancelButton.php', + 'Prevajanje' => __DIR__ . '/../..' . '/admin/survey/classes/class.Prevajanje.php', + 'Purifier' => __DIR__ . '/../..' . '/admin/survey/classes/htmlpurifier-4.3.0/Purifier.php', + 'RadioCheckboxSelectLatex' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Vprasanja/RadioCheckboxSelectLatex.php', + 'RadioXml' => __DIR__ . '/../..' . '/admin/survey/export/xmlClasses/Vprasanja/RadioXml.php', + 'RazvrscanjeLatex' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Vprasanja/RazvrscanjeLatex.php', + 'RecodeValues' => __DIR__ . '/../..' . '/admin/survey/classes/class.RecodeValues.php', + 'SNImenaLatex' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Vprasanja/SNImena.php', + 'Setting' => __DIR__ . '/../..' . '/admin/survey/classes/class.Setting.php', + 'SpremenljivkaSkala' => __DIR__ . '/../..' . '/admin/survey/classes/objects/obj.SpremenljivkaSkala.php', + 'SqualoApi' => __DIR__ . '/../..' . '/admin/survey/classes/surveyEmails/squalo/class.SqualoApi.php', + 'SteviloLatex' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Vprasanja/SteviloLatex.php', + 'SteviloXml' => __DIR__ . '/../..' . '/admin/survey/export/xmlClasses/Vprasanja/SteviloXml.php', + 'Survey3601ka' => __DIR__ . '/../..' . '/admin/survey/modules/mod_360_1KA/class.Survey3601ka.php', + 'SurveyAapor' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyAapor.php', + 'SurveyAdmin' => __DIR__ . '/../..' . '/admin/survey/SurveyAdmin.php', + 'SurveyAdminAjax' => __DIR__ . '/../..' . '/admin/survey/SurveyAdminAjax.php', + 'SurveyAdminSettings' => __DIR__ . '/../..' . '/admin/survey/SurveyAdminSettings.php', + 'SurveyAdvancedParadata' => __DIR__ . '/../..' . '/admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadata.php', + 'SurveyAdvancedParadataExport' => __DIR__ . '/../..' . '/admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadataExport.php', + 'SurveyAdvancedParadataLog' => __DIR__ . '/../..' . '/admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadataLog.php', + 'SurveyAktivnost' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyAktivnost.php', + 'SurveyAlert' => __DIR__ . '/../..' . '/admin/survey/classes/surveyEmails/class.SurveyAlert.php', + 'SurveyAnalysis' => __DIR__ . '/../..' . '/admin/survey/classes/surveyAnalysis/class.SurveyAnalysis.php', + 'SurveyAnalysisArchive' => __DIR__ . '/../..' . '/admin/survey/classes/surveyAnalysis/class.SurveyAnalysisArchive.php', + 'SurveyAnalysisHelper' => __DIR__ . '/../..' . '/admin/survey/classes/surveyAnalysis/class.SurveyAnalysisHelper.php', + 'SurveyAnalysisR' => __DIR__ . '/../..' . '/admin/survey/R/class.SurveyAnalysisR.php', + 'SurveyAppendMerge' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyAppendMerge.php', + 'SurveyBaseSetting' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyBaseSetting.php', + 'SurveyBreak' => __DIR__ . '/../..' . '/admin/survey/classes/surveyAnalysis/class.SurveyBreak.php', + 'SurveyChart' => __DIR__ . '/../..' . '/admin/survey/classes/surveyAnalysis/class.SurveyChart.php', + 'SurveyChat' => __DIR__ . '/../..' . '/admin/survey/modules/mod_chat/class.SurveyChat.php', + 'SurveyCondition' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyCondition.php', + 'SurveyConditionProfiles' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyConditionProfiles.php', + 'SurveyConnect' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyConnect.php', + 'SurveyCopy' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyCopy.php', + 'SurveyCrosstabs' => __DIR__ . '/../..' . '/admin/survey/classes/surveyAnalysis/class.SurveyCrosstabs.php', + 'SurveyCustomReport' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyCustomReport.php', + 'SurveyDataCollect' => __DIR__ . '/../..' . '/admin/survey/classes/surveyData/class.SurveyDataCollect.php', + 'SurveyDataDisplay' => __DIR__ . '/../..' . '/admin/survey/classes/surveyData/class.SurveyDataDisplay.php', + 'SurveyDataFile' => __DIR__ . '/../..' . '/admin/survey/classes/surveyData/class.SurveyDataFile.php', + 'SurveyDataSettingProfiles' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyDataSettingProfiles.php', + 'SurveyDiagnostics' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyDiagnostics.php', + 'SurveyEditsAnalysis' => __DIR__ . '/../..' . '/admin/survey/classes/surveyAnalysis/class.SurveyEditsAnalysis.php', + 'SurveyExport' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyExport.php', + 'SurveyExportProfiles' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyExportProfiles.php', + 'SurveyFieldwork' => __DIR__ . '/../..' . '/admin/survey/modules/mod_fieldwork/class.SurveyFieldwork.php', + 'SurveyGeoIP' => __DIR__ . '/../..' . '/admin/survey/modules/mod_geoIP/class.SurveyGeoIP.php', + 'SurveyGetHeatMapRadij' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyGetHeatMapRadij.php', + 'SurveyHeatMap' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyHeatMap.php', + 'SurveyHeatMapBackground' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyHeatMapBackground.php', + 'SurveyHeatMapExportIcons' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyHeatMapExportIcons.php', + 'SurveyHeatMapImageSave' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyHeatMapSaveImage.php', + 'SurveyHeatMapRadij' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyHeatMapRadij.php', + 'SurveyInfo' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyInfo.php', + 'SurveyInspect' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyInpect.php', + 'SurveyInvitationsNew' => __DIR__ . '/../..' . '/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php', + 'SurveyInvitationsSqualo' => __DIR__ . '/../..' . '/admin/survey/classes/surveyEmails/squalo/class.SurveyInvitationsSqualo.php', + 'SurveyJsonSurveyData' => __DIR__ . '/../..' . '/admin/survey/modules/mod_json_survey_export/class.SurveyJsonSurveyData.php', + 'SurveyKakovost' => __DIR__ . '/../..' . '/admin/survey/modules/mod_kakovost/class.SurveyKakovost.php', + 'SurveyLanguageTechnology' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyLanguageTechnology.php', + 'SurveyList' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyList.php', + 'SurveyLog' => __DIR__ . '/../..' . '/admin/survey/classes/log/class.SurveyLog.php', + 'SurveyMapData' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyMapData.php', + 'SurveyMeans' => __DIR__ . '/../..' . '/admin/survey/classes/surveyAnalysis/class.SurveyMeans.php', + 'SurveyMissingProfiles' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyMissingProfiles.php', + 'SurveyMissingValues' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyMissingValues.php', + 'SurveyMobile' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyMobile.php', + 'SurveyMultiCrosstabs' => __DIR__ . '/../..' . '/admin/survey/classes/surveyAnalysis/class.SurveyMultiCrosstabs.php', + 'SurveyPanel' => __DIR__ . '/../..' . '/admin/survey/modules/mod_panel/class.SurveyPanel.php', + 'SurveyParaAnalysis' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyParaAnalysis.php', + 'SurveyParaGraph' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyParaGraph.php', + 'SurveyPostProcess' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyPostProcess.php', + 'SurveyProfileManager' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyProfileManager.php', + 'SurveyQuiz' => __DIR__ . '/../..' . '/admin/survey/modules/mod_quiz/class.SurveyQuiz.php', + 'SurveyQuotas' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyQuotas.php', + 'SurveyRecoding' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyRecoding.php', + 'SurveyReminderTracking' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyReminderTracking.php', + 'SurveyRespondents' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyRespondents.php', + 'SurveySNDataFile' => __DIR__ . '/../..' . '/admin/survey/classes/surveyData/class.SurveySNDataFile.php', + 'SurveySession' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveySession.php', + 'SurveySessionDestructor' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveySession.php', + 'SurveySetting' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveySetting.php', + 'SurveySimpleMailInvitation' => __DIR__ . '/../..' . '/admin/survey/classes/surveyEmails/class.SurveySimpleMailInvitation.php', + 'SurveySkupine' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveySkupine.php', + 'SurveySlideshow' => __DIR__ . '/../..' . '/admin/survey/modules/mod_slideshow/class.SurveySlideshow.php', + 'SurveySpeedIndex' => __DIR__ . '/../..' . '/admin/survey/modules/mod_SPEEDINDEX/class.SurveySpeedIndex.php', + 'SurveyStaticHtml' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyStaticHtml.php', + 'SurveyStatistic' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyStatistic.php', + 'SurveyStatisticProfiles' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyStatisticProfiles.php', + 'SurveyStatusCasi' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyStatusCasi.php', + 'SurveyStatusProfiles' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyStatusProfiles.php', + 'SurveyTTest' => __DIR__ . '/../..' . '/admin/survey/classes/surveyAnalysis/class.SurveyTTest.php', + 'SurveyTableChart' => __DIR__ . '/../..' . '/admin/survey/classes/surveyAnalysis/class.SurveyTableChart.php', + 'SurveyTelephone' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyTelephone.php', + 'SurveyTextAnalysis' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyTextAnalysis.php', + 'SurveyTheme' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyTheme.php', + 'SurveyThemeEditor' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyThemeEditor.php', + 'SurveyTimeProfiles' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyTimeProfiles.php', + 'SurveyUnsubscribe' => __DIR__ . '/../..' . '/admin/survey/classes/surveyEmails/class.SurveyUnsubscribe.php', + 'SurveyUporabnost' => __DIR__ . '/../..' . '/admin/survey/modules/mod_uporabnost/class.SurveyUporabnost.php', + 'SurveyUrlLinks' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyUrlLinks.php', + 'SurveyUsableResp' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyUsableResp.php', + 'SurveyUserSession' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyUserSession.php', + 'SurveyUserSessionDestructor' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyUserSession.php', + 'SurveyUserSetting' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyUserSetting.php', + 'SurveyVariablesProfiles' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyVariablesProfiles.php', + 'SurveyVizualizacija' => __DIR__ . '/../..' . '/admin/survey/modules/mod_vizualizacija/class.SurveyVizualizacija.php', + 'SurveyVoting' => __DIR__ . '/../..' . '/admin/survey/modules/mod_voting/class.SurveyVoting.php', + 'SurveyZankaProfiles' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyZankaProfiles.php', + 'SurveyZoom' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyZoom.php', + 'Timer' => __DIR__ . '/../..' . '/admin/survey/classes/class.Timer.php', + 'TrackingClass' => __DIR__ . '/../..' . '/admin/survey/classes/tracking/TrackingClass.php', + 'User' => __DIR__ . '/../..' . '/admin/survey/classes/class.User.php', + 'UserAccess' => __DIR__ . '/../..' . '/frontend/payments/classes/class.UserAccess.php', + 'UserMailCron' => __DIR__ . '/../..' . '/frontend/payments/classes/class.UserMailCron.php', + 'UserNarocila' => __DIR__ . '/../..' . '/frontend/payments/classes/class.UserNarocila.php', + 'UserNarocilaCebelica' => __DIR__ . '/../..' . '/frontend/payments/classes/class.UserNarocilaCebelica.php', + 'UserNarocilaCron' => __DIR__ . '/../..' . '/frontend/payments/classes/class.UserNarocilaCron.php', + 'UserNarocilaPaypal' => __DIR__ . '/../..' . '/frontend/payments/classes/class.UserNarocilaPaypal.php', + 'UserNarocilaStripe' => __DIR__ . '/../..' . '/frontend/payments/classes/class.UserNarocilaStripe.php', + 'UserPlacila' => __DIR__ . '/../..' . '/frontend/payments/classes/class.UserPlacila.php', + 'UserSetting' => __DIR__ . '/../..' . '/admin/survey/classes/class.UserSetting.php', + 'UserTrackingClass' => __DIR__ . '/../..' . '/admin/survey/classes/tracking/UserTrackingClass.php', + 'VariableView' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyVariableView.php', + 'Vprasanje' => __DIR__ . '/../..' . '/admin/survey/classes/class.Vprasanje.php', + 'VprasanjeInline' => __DIR__ . '/../..' . '/admin/survey/classes/class.VprasanjeInline.php', + 'VsotaLatex' => __DIR__ . '/../..' . '/admin/survey/export/latexclasses/Vprasanja/VsotaLatex.php', + 'WPN' => __DIR__ . '/../..' . '/admin/survey/modules/mod_WPN/class.WPN.php', + 'XmlDocument' => __DIR__ . '/../..' . '/admin/survey/export/xmlClasses/class.XmlDocument.php', + 'XmlSurvey' => __DIR__ . '/../..' . '/admin/survey/export/xmlClasses/class.XmlSurvey.php', + 'XmlSurveyElement' => __DIR__ . '/../..' . '/admin/survey/export/xmlClasses/class.XmlSurveyElement.php', + 'enkaParameters' => __DIR__ . '/../..' . '/admin/survey/classes/class.params.php', + 'pCache' => __DIR__ . '/../..' . '/admin/survey/pChart/classes/class.pCache.php', + 'pChart' => __DIR__ . '/../..' . '/admin/survey/pChart/classes/class.pChart.php', + 'pData' => __DIR__ . '/../..' . '/admin/survey/pChart/classes/class.pData.php', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInit6b03163c371c5541881b55b762b8c779::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit6b03163c371c5541881b55b762b8c779::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit6b03163c371c5541881b55b762b8c779::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/vendor/composer/ca-bundle/LICENSE b/vendor/composer/ca-bundle/LICENSE new file mode 100644 index 0000000..c5b5220 --- /dev/null +++ b/vendor/composer/ca-bundle/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2016 Composer + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/composer/ca-bundle/README.md b/vendor/composer/ca-bundle/README.md new file mode 100644 index 0000000..d8205ec --- /dev/null +++ b/vendor/composer/ca-bundle/README.md @@ -0,0 +1,85 @@ +composer/ca-bundle +================== + +Small utility library that lets you find a path to the system CA bundle, +and includes a fallback to the Mozilla CA bundle. + +Originally written as part of [composer/composer](https://github.com/composer/composer), +now extracted and made available as a stand-alone library. + + +Installation +------------ + +Install the latest version with: + +```bash +$ composer require composer/ca-bundle +``` + + +Requirements +------------ + +* PHP 5.3.2 is required but using the latest version of PHP is highly recommended. + + +Basic usage +----------- + +### `Composer\CaBundle\CaBundle` + +- `CaBundle::getSystemCaRootBundlePath()`: Returns the system CA bundle path, or a path to the bundled one as fallback +- `CaBundle::getBundledCaBundlePath()`: Returns the path to the bundled CA file +- `CaBundle::validateCaFile($filename)`: Validates a CA file using openssl_x509_parse only if it is safe to use +- `CaBundle::isOpensslParseSafe()`: Test if it is safe to use the PHP function openssl_x509_parse() +- `CaBundle::reset()`: Resets the static caches + + +#### To use with curl + +```php +$curl = curl_init("https://example.org/"); + +$caPathOrFile = \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath(); +if (is_dir($caPathOrFile)) { + curl_setopt($curl, CURLOPT_CAPATH, $caPathOrFile); +} else { + curl_setopt($curl, CURLOPT_CAINFO, $caPathOrFile); +} + +$result = curl_exec($curl); +``` + +#### To use with php streams + +```php +$opts = array( + 'http' => array( + 'method' => "GET" + ) +); + +$caPathOrFile = \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath(); +if (is_dir($caPathOrFile)) { + $opts['ssl']['capath'] = $caPathOrFile; +} else { + $opts['ssl']['cafile'] = $caPathOrFile; +} + +$context = stream_context_create($opts); +$result = file_get_contents('https://example.com', false, $context); +``` + +#### To use with Guzzle + +```php +$client = new \GuzzleHttp\Client([ + \GuzzleHttp\RequestOptions::VERIFY => \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath() +]); +``` + +License +------- + +composer/ca-bundle is licensed under the MIT License, see the LICENSE file for details. diff --git a/vendor/composer/ca-bundle/composer.json b/vendor/composer/ca-bundle/composer.json new file mode 100644 index 0000000..5213e97 --- /dev/null +++ b/vendor/composer/ca-bundle/composer.json @@ -0,0 +1,54 @@ +{ + "name": "composer/ca-bundle", + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "type": "library", + "license": "MIT", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/ca-bundle/issues" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.2 || ^5", + "phpstan/phpstan": "^0.12.55", + "psr/log": "^1.0", + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Composer\\CaBundle\\": "tests" + } + }, + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "scripts": { + "test": "SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 vendor/bin/simple-phpunit", + "phpstan": "vendor/bin/phpstan analyse" + } +} diff --git a/vendor/composer/ca-bundle/res/cacert.pem b/vendor/composer/ca-bundle/res/cacert.pem new file mode 100644 index 0000000..2030a4e --- /dev/null +++ b/vendor/composer/ca-bundle/res/cacert.pem @@ -0,0 +1,3138 @@ +## +## Bundle of CA Root Certificates +## +## Certificate data from Mozilla as of: Tue May 25 03:12:05 2021 GMT +## +## This is a bundle of X.509 certificates of public Certificate Authorities +## (CA). These were automatically extracted from Mozilla's root certificates +## file (certdata.txt). This file can be found in the mozilla source tree: +## https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt +## +## It contains the certificates in PEM format and therefore +## can be directly used with curl / libcurl / php_curl, or with +## an Apache+mod_ssl webserver for SSL client authentication. +## Just configure this file as the SSLCACertificateFile. +## +## Conversion done with mk-ca-bundle.pl version 1.28. +## SHA256: e292bd4e2d500c86df45b830d89417be5c42ee670408f1d2c454c63d8a782865 +## + + +GlobalSign Root CA +================== +-----BEGIN CERTIFICATE----- +MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx +GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds +b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV +BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD +VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa +DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc +THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb +Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP +c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX +gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF +AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj +Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG +j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH +hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC +X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== +-----END CERTIFICATE----- + +GlobalSign Root CA - R2 +======================= +-----BEGIN CERTIFICATE----- +M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Hu +01yiPqFbQfXf5WRDLenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7 +9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 +TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== +-----END CERTIFICATE----- + +Entrust.net Premium 2048 Secure Server CA +========================================= +-----BEGIN CERTIFICATE----- +MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u +ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp +bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV +BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx +NzUwNTFaFw0yOTA3MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3 +d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl +MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u +ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL +Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr +hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW +nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi +VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo0IwQDAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJ +KoZIhvcNAQEFBQADggEBADubj1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPy +T/4xmf3IDExoU8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf +zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5bu/8j72gZyxKT +J1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+bYQLCIt+jerXmCHG8+c8eS9e +nNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/ErfF6adulZkMV8gzURZVE= +-----END CERTIFICATE----- + +Baltimore CyberTrust Root +========================= +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE +ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li +ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC +SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs +dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME +uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB +UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C +G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9 +XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr +l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI +VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB +BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh +cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5 +hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa +Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H +RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp +-----END CERTIFICATE----- + +Entrust Root Certification Authority +==================================== +-----BEGIN CERTIFICATE----- +MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAUBgNV +BAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0Lm5ldC9DUFMgaXMgaW5jb3Jw +b3JhdGVkIGJ5IHJlZmVyZW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4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9tO1KzKtvn1ISM +Y/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6ZuaAGAT/3B+XxFNSRuzFVJ7yVTa +v52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTS +W3iDVuycNsMm4hH2Z0kdkquM++v/eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0 +tHuu2guQOHXvgR1m0vdXcDazv/wor3ElhVsT/h5/WrQ8 +-----END CERTIFICATE----- + +Comodo AAA Services root +======================== +-----BEGIN CERTIFICATE----- +MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS +R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg +TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw +MFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hl +c3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV +BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQuaBtDFcCLNSS1UY8y2bmhG +C1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe3M/vg4aijJRPn2jymJBGhCfHdr/jzDUs +i14HZGWCwEiwqJH5YZ92IFCokcdmtet4YgNW8Io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IFBvbGljeS4wIgYIKwYBBQUHAgEW +Fmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3TKbkGGew5Oanwl4Rqy+/fMIGu +BgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rqy+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkw +FwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MS4wLAYDVQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6 +tlCLMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSkfnIYj9lo +fFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf87C9TqnN7Az10buYWnuul +LsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1RcHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2x +gI4JVrmcGmD+XcHXetwReNDWXcG31a0ymQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi +5upZIof4l/UO/erMkqQWxFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi +5nrQNiOKSnQ2+Q== +-----END CERTIFICATE----- + +QuoVadis Root CA 2 +================== +-----BEGIN CERTIFICATE----- +MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT +EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMjAeFw0wNjExMjQx +ODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM +aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDIwgg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ywLQoUmkRzBFMQswCQYDVQQGEwJCTTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UE +AxMSUXVvVmFkaXMgUm9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZV +qyM07ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSemd1o417+s +hvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd+LJ2w/w4E6oM3kJpK27z +POuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2 +Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadNt54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp +8kokUvd0/bpO5qgdAm6xDYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBC +bjPsMZ57k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6szHXu +g/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0jWy10QJLZYxkNc91p +vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr +qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto= +-----END CERTIFICATE----- + +Security Communication Root CA +============================== +-----BEGIN CERTIFICATE----- +MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP +U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw +HhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP +U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw +8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJDKaVv0uM +DPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9Ms+k2Y7CI9eNqPPYJayX +5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/NQV3Is00qVUarH9oe4kA92819uZKAnDfd +DJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2 +JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYw +DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g +0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+a +mCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJ +s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ +6rBK+1YWc26sTfcioU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAi +FL39vmwLAw== +-----END CERTIFICATE----- + +Sonera Class 2 Root CA +====================== +-----BEGIN CERTIFICATE----- +MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG +U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoXDTIxMDQw +NjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh +IENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3 +/Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybT +dXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s3TmVToMG +f+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2EjvOr7nQKV0ba5cTppCD8P +tOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu8nYybieDwnPz3BjotJPqdURrBGAgcVeH +nfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITT +XjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt +0jSv9zilzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEI +cbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavph +Oe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSx +EtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLH +llpwrN9M +-----END CERTIFICATE----- + +XRamp Global CA Root +==================== +-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iOr18SPaAIBQi2XKVlOARFmR6j +YGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmY +vLEHZ6IVDd2gWMZEewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0O +BBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h/t2o +atTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMu +MTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG +A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wim +PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt +I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ +HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI +Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b +vZ8= +-----END CERTIFICATE----- + +Starfield Class 2 CA +==================== +-----BEGIN CERTIFICATE----- +MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc +U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBo +MQswC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tJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3 +QBFGmh95DmK/D5fs4C8fF5Q= +-----END CERTIFICATE----- + +DigiCert Assured ID Root CA +=========================== +-----BEGIN CERTIFICATE----- +MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw +IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzEx +MTEwMDAwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL +ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0Ew +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7cJpSIqvTO +9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYPmDI2dsze3Tyoou9q+yHy +UmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW +/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpy +oeb6pNnVFzF1roV9Iq4/AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whf +GHdPAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRF +66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq +hkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRCdWKuh+vy1dneVrOfzM4UKLkNl2Bc +EkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTffwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38Fn +SbNd67IJKusm7Xi+fT8r87cmNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i +8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe ++o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== +-----END CERTIFICATE----- + +DigiCert Global Root CA +======================= +-----BEGIN CERTIFICATE----- +MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw +HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw +MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 +dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn +TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5 +BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H +4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y +7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB +o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm +8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF +BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr +EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt +tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886 +UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk +CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= +-----END CERTIFICATE----- + +DigiCert High Assurance EV Root CA +================================== +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw +KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAw +MFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZ +MBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFu +Y2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qTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUWyV7lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64 +OfPAeGZe6Drn8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov +L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe645R88a7A3hfm +5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczOUYrHUDFu4Up+GC9pWbY9ZIEr +44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOf +Mke6UiI0HTJ6CVanfCU2qT1L2sCCbwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6m +Gu6uLftIdxf+u+yvGPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxp +mo/a77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCChdiDyyJk +vC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid392qgQmwLOM7XdVAyksLf +KzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEppLd6leNcG2mqeSz53OiATIgHQv2ieY2Br +NU0LbbqhPcCT4H8js1WtciVORvnSFu+wZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6Lqj +viOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ +-----END CERTIFICATE----- + +SwissSign Silver CA - G2 +======================== +-----BEGIN CERTIFICATE----- +MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gx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BBQUAA4IBAQBjGghAfaReUw132HquHw0LURYD7xh8yOOvaliTFGCRsoTciE6+ +OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXOH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cn +CDpOGR86p1hcF895P4vkp9MmI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/5 +3CYNv6ZHdAbYiNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc +f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW +-----END CERTIFICATE----- + +COMODO Certification Authority +============================== +-----BEGIN CERTIFICATE----- +MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UE +BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG +A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNVBAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1 +dGhvcml0eTAeFw0wNjEyMDEwMDAwMDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEb +MBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFD +T01PRE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3UcEbVASY06m/weaKXTuH ++7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI2GqGd0S7WWaXUF601CxwRM/aN5VCaTww +xHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV +4EajcNxo2f8ESIl33rXp+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA +1KGzqSX+DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5OnKVI +rLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW/zAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6gPKA6hjhodHRwOi8vY3JsLmNvbW9k +b2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOC +AQEAPpiem/Yb6dc5t3iuHXIYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CP +OGEIqB6BCsAvIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ +RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmc +IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN ++8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ== +-----END CERTIFICATE----- + +Network Solutions Certificate Authority +======================================= +-----BEGIN CERTIFICATE----- +MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG +EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr +IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMx +MjM1O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HNpGxlaKFJdlxD +ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey +-----END CERTIFICATE----- + +COMODO ECC Certification Authority +================================== +-----BEGIN CERTIFICATE----- +MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UEBhMC +R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE +ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0Ix +GzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR +Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRo +b3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSRFtSrYpn1PlILBs5BAH+X +4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0JcfRK9ChQtP6IHG4/bC8vCVlbpVsLM5ni +wz2J+Wos77LTBumjQjBAMB0GA1UdDgQWBBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VG +FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA +U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= +-----END CERTIFICATE----- + +Certigna +======== +-----BEGIN CERTIFICATE----- +MIIDqDCCApCgAwIBAg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vkj1klu +PBS1xp81HlDQwY9qcEQCYsuuHWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY +1gkIl2PlwS6wt0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw +WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== +-----END CERTIFICATE----- + +Cybertrust Global Root +====================== +-----BEGIN CERTIFICATE----- +MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYGA1UEChMPQ3li +ZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBSb290MB4XDTA2MTIxNTA4 +MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQD +ExZDeWJlcnRydXN0IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA ++Mi8vRRQZhP/8NN57CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW +0ozSJ8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2yHLtgwEZL +AfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iPt3sMpTjr3kfb1V05/Iin +89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNzFtApD0mpSPCzqrdsxacwOUBdrsTiXSZT +8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAYXSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAP +BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2 +MDSgMqAwhi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3JsMB8G +A1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUAA4IBAQBW7wojoFRO +lZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMjWqd8BfP9IjsO0QbE2zZMcwSO5bAi +5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUxXOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2 +hO0j9n0Hq0V+09+zv+mKts2oomcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+T +X3EJIrduPuocA06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW +WL1WMRJOEcgh4LMRkWXbtKaIOM5V +-----END CERTIFICATE----- + +ePKI Root Certification Authority +================================= +-----BEGIN CERTIFICATE----- +MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG +EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg +Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx +MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq +MCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAHSyZbCUNs +IZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAhijHyl3SJCRImHJ7K2RKi +lTza6We/CKBk49ZCt0Xvl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VR0TAQH/BAUwAwEB/zAOBgNVHQ8B +Af8EBAMCAcYwHQYDVR0OBBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IB +AQA+0hyJLjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecYMnQ8 +SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ44gx+FkagQnIl6Z0 +x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6IJd1hJyMctTEHBDa0GpC9oHRxUIlt +vBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7Nz +TogVZ96edhBiIL5VaZVDADlN9u6wWk5JRFRYX0KD +-----END CERTIFICATE----- + +NetLock Arany (Class Gold) Főtanúsítvány +======================================== +-----BEGIN CERTIFICATE----- +MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTERMA8G +A1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3MDUGA1UECwwuVGFuw7pzw610 +dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBB +cmFueSAoQ2xhc3MgR29sZCkgRsWRdGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgx +MjA2MTUwODIxWjCBpzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxO +ZXRMb2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlmaWNhdGlv +biBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNzIEdvbGQpIEbFkXRhb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drb25nIFBvc3QgUm9vdCBDQSAxMB4XDTAzMDUx +NTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25n +IFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1 +ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEnPzlTCeqr +auh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjhZY4bXSNmO7ilMlHIhqqh +qZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9nnV0ttgCXjqQesBCNnLsak3c78QA3xMY +V18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNV +HRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7i +h9legYsCmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37pio +l7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5Lmei +IAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88ps +T/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilT +c4afU9hDDl3WY4JxHYB0yvbiAmvZWg== +-----END CERTIFICATE----- + +SecureSign RootCA11 +=================== +-----BEGIN CERTIFICATE----- +MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9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AQDAgEGMB0GA1UdDgQWBBTLD8bf +QkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAbBgNVHREE +FDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqGSIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0o +lZMEyL/azXm4Q5DwpL7v8u8hmLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfX +I/OMn74dseGkddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775 +tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c2Pm2G2JwCz02 +yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5tHMN1Rq41Bab2XD0h7lbwyYIi +LXpUq3DDfSJlgnCW +-----END CERTIFICATE----- + +GlobalSign Root CA - R3 +======================= +-----BEGIN CERTIFICATE----- +MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UECxMXR2xv +YmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh +bFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT +aWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln +bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWt +iHL8RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsTgHeMCOFJ +0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmmKPZpO/bLyCiR5Z2KYVc3 +rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zdQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjl +OCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2 +xmmFghcCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE +FI/wS3+oLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZURUm7 +lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMpjjM5RcOO5LlXbKr8 +EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK6fBdRoyV3XpYKBovHd7NADdBj+1E +bddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQXmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18 +YIvDQVETI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7r +kpeDMdmztcpHWD9f +-----END CERTIFICATE----- + +Autoridad de Certificacion Firmaprofesional CIF A62634068 +========================================================= +-----BEGIN CERTIFICATE----- +MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UEBhMCRVMxQjBA +BgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2 +MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEyMzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIw +QAYDVQQDDDlBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBB +NjI2MzQwNjgwggIiMA0GCSqGS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ggIBABd9oPm03cXF661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx +51tkljYyGOylMnfX40S2wBEqgLk9am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qk +R71kMrv2JYSiJ0L1ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaP +T481PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS3a/DTg4f +Jl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5kSeTy36LssUzAKh3ntLFl +osS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF3dvd6qJ2gHN99ZwExEWN57kci57q13XR +crHedUTnQn3iV2t93Jm8PYMo6oCTjcVMZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoR +saS8I8nkvof/uZS2+F0gStRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTD +KCOM/iczQ0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQBjLMi +6Et8Vcad+qMUu2WFbm5PEn4KPJ2V +-----END CERTIFICATE----- + +Izenpe.com +========== +-----BEGIN CERTIFICATE----- +MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4MQswCQYDVQQG +EwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wHhcNMDcxMjEz +MTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMu +QS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ +03rKDx6sp4boFmVqscIbRTJxldn+EFvMr+ele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KvV9pF9rnHzP7MOeIWblaQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbga +kEyrkgPH7UIBzg/YsfqikuFgba56awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8q +hT/AQKM6WfxZSzwoJNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Cs +g1lwLDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCTVyvehQP5 +aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGkLhObNA5me0mrZJfQRsN5 +nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJbUjWumDqtujWTI6cfSN01RpiyEGjkpTHC +ClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZo +Q0iy2+tzJOeRf1SktoA+naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1Z +WrOZyGlsQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== +-----END CERTIFICATE----- + +Go Daddy Root Certificate Authority - G2 +======================================== +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoTEUdvRGFkZHkuY29tLCBJbmMu +MTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 +MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 +b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8G +A1UEAxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKDE6bFIEMBO4Tx5oVJnyfq +9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD ++qK+ihVqf94Lw7YZFAXK6sOoBJQ7RnwyDfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutd +fMh8+7ArU6SSYmlRJQVhGkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMl +NAJWJwGRtDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFDqahQcQZyi27/a9 +BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmXWWcDYfF+OwYxdS2hII5PZYe096ac +vNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r +5N9ss4UXnT3ZJE95kTXWXwTrgIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYV +N8Gb5DKj7Tjo2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO +LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI4uJEvlz36hz1 +-----END CERTIFICATE----- + +Starfield Root Certificate Authority - G2 +========================================= +-----BEGIN CERTIFICATE----- +MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMxEDAOBgNVB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5oUw +F5okxBDgBPfg8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K +pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1mMpYjn0q7pBZ +c2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 +-----END CERTIFICATE----- + +Starfield Services Root Certificate Authority - G2 +================================================== +-----BEGIN CERTIFICATE----- +MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s +b2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVsZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRl +IEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNV +BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxT +dGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2VydmljZXMg +Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20pOsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2 +h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm28xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4Pa +hHQUw2eeBGg6345AWh1KTs9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLP +LJGmpufehRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk6mFB +rMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAwDwYDVR0TAQH/BAUw +AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+qAdcwKziIorhtSpzyEZGDMA0GCSqG +SIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMIbw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPP +E95Dz+I0swSdHynVv/heyNXBve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTy +xQGjhdByPq1zqwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd +iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn0q23KXB56jza +YyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCNsSi6 +-----END CERTIFICATE----- + +AffirmTrust Commercial +====================== +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCVVMxFDAS +BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMB4XDTEw +MDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly +bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6Eqdb +DuKPHx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yrba0F8PrV +C8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPALMeIrJmqbTFeurCA+ukV6 +BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1yHp52UKqK39c/s4mT6NmgTWvRLpUHhww +MmWd5jyTXlBOeuM61G7MGvv50jeuJCqrVwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNV +HQ4EFgQUnZPGU4teyq8/nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwDQYJKoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYGXUPG +hi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNjvbz4YYCanrHOQnDi +qX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivtZ8SOyUOyXGsViQK8YvxO8rUzqrJv +0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9gN53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0kh +sUlHRUe072o0EclNmsxZt9YCnlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= +-----END CERTIFICATE----- + +AffirmTrust Networking +====================== +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UEBhMCVVMxFDAS +BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMB4XDTEw +MDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly +bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SE +Hi3yYJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbuakCNrmreI +dIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRLQESxG9fhwoXA3hA/Pe24 +/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gb +h+0t+nvujArjqWaJGctB+d1ENmHP4ndGyH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNV +HQ4EFgQUBx/S55zawm6iQLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwDQYJKoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfOtDIu +UFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzuQY0x2+c06lkh1QF6 +12S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZLgo/bNjR9eUJtGxUAArgFU2HdW23 +WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4uolu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9 +/ZFvgrG+CJPbFEfxojfHRZ48x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= +-----END CERTIFICATE----- + +AffirmTrust Premium +=================== +-----BEGIN CERTIFICATE----- +MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UEBhMCVVMxFDAS +BgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMB4XDTEwMDEy +OTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkGA1UEBhMCVVMxFDASBgNV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4Py/VpfzZotReBA4Xrf5B8OWycvpEgjNC +6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQMKSOyARiqcTtNd56l+0OOF6S +L5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK ++4w1IX2COPKpVJEZNZOUbWo6xbLQu4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmV +BtWVyuEklut89pMFu+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFg +IxpHYoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8GKa1qF60 +g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaORtGdFNrHF+QFlozEJLUb +zxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6eKeC2uAloGRwYQw== +-----END CERTIFICATE----- + +AffirmTrust Premium ECC +======================= +-----BEGIN CERTIFICATE----- +MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMCVVMxFDASBgNV +BAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQcmVtaXVtIEVDQzAeFw0xMDAx +MjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1U +cnVzdDEgMB4GA1UEAwwXQWZmaXJtVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQA +IgNiAAQNMF4bFZ0D0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQ +N8O9ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0GA1UdDgQW +BBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAK +BggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/VsaobgxCd05DhT1wV/GzTjxi+zygk8N53X +57hG8f2h4nECMEJZh0PUUd+60wkyWs6Iflc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKM +eQ== +-----END CERTIFICATE----- + +Certum Trusted Network CA +========================= +-----BEGIN CERTIFICATE----- +MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBMMSIwIAYDVQQK +ExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBUcnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIy +MTIwNzM3WhcNMjkxMjMxMTIwNzM3WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBU +ZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rHUV+rpDKmYYe2bg+G0jAC +l/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LMTXPb865Px1bVWqeWifrzq2jUI4ZZJ88J +J7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVUBBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4 +fOQtf/WsX+sWn7Et0brMkUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0 +cvW0QM8xAcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNVHRMB +Af8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNVHQ8BAf8EBAMCAQYw +DQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15ysHhE49wcrwn9I0j6vSrEuVUEtRCj +jSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfLI9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1 +mS1FhIrlQgnXdAIv94nYmem8J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5aj +Zt3hrvJBW8qYVoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI +03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= +-----END CERTIFICATE----- + +TWCA Root Certification Authority +================================= +-----BEGIN CERTIFICATE----- +MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJ +VEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMzWhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQG +EwJUVzESMBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NB +IFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK +AoIBAQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFEAcK0HMMx +QhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HHK3XLfJ+utdGdIzdjp9xC +oi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeXRfwZVzsrb+RH9JlF/h3x+JejiB03HFyP +4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/zrX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1r +y+UPizgN7gr8/g+YnzAx3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIB +BjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkqhkiG +9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeCMErJk/9q56YAf4lC +mtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdlsXebQ79NqZp4VKIV66IIArB6nCWlW +QtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62Dlhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVY +T0bf+215WfKEIlKuD8z7fDvnaspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocny +Yh0igzyXxfkZYiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== +-----END CERTIFICATE----- + +Security Communication RootCA2 +============================== +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDElMCMGA1UEChMc +U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMeU2VjdXJpdHkgQ29tbXVuaWNh +dGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoXDTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMC +SlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAs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1UdEQQWMBSBEmVjX2FjY0BjYXRjZXJ0Lm5ldDAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUoMOLRKo3pUW/l4Ba0fF4opvpXY0wfwYD +VR0gBHgwdjB0BgsrBgEEAfV4AQMBCjBlMCwGCCsGAQUFBwIBFiBodHRwczovL3d3dy5jYXRjZXJ0 +Lm5ldC92ZXJhcnJlbDA1BggrBgEFBQcCAjApGidWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5l +dC92ZXJhcnJlbCAwDQYJKoZIhvcNAQEFBQADggEBAKBIW4IB9k1IuDlVNZyAelOZ1Vr/sXE7zDkJ +lF7W2u++AVtd0x7Y/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNa +Al6kSBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhyRp/7SNVe +l+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOSAgu+TGbrIP65y7WZf+a2 +E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xlnJ2lYJU6Un/10asIbvPuW/mIPX64b24D +5EI= +-----END CERTIFICATE----- + +Hellenic Academic and Research Institutions RootCA 2011 +======================================================= +-----BEGIN CERTIFICATE----- +MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1IxRDBCBgNVBAoT +O0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9y +aXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z +IFJvb3RDQSAyMDExMB4XDTExMTIwNjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYT +AkdSMUQ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EvUUXBj08yrl3NI/K6s8/MT7jiOOASSXIl7WdmplNsDz4SgCbZN2fOUvRJ9e4 +-----END CERTIFICATE----- + +Actalis Authentication Root CA +============================== +-----BEGIN CERTIFICATE----- +MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UEBhMCSVQxDjAM +BgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UE +AwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDky +MjExMjIwMlowazELMAkGA1UEBhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlz +IFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290 +IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNvUTufClrJ +wkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX4ay8IMKx4INRimlNAJZa +by/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9KK3giq0itFZljoZUj5NDKd45RnijMCO6 +zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/gCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1f +YVEiVRvjRuPjPdA1YprbrxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2 +oxgkg4YQ51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2Fbe8l +EfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxeKF+w6D9Fz8+vm2/7 +hNN3WpVvrJSEnu68wEqPSpP4RCHiMUVhUE4Q2OM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j4W1OLBuAZ+ytIJ8MYmHV +l/9D7S3B2l0pKoU/rGXuhg8FjZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYl +iB6XzCGcKQENZetX2fNXlrtIzYE= +-----END CERTIFICATE----- + +Buypass Class 2 Root CA +======================= +-----BEGIN CERTIFICATE----- +MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU +QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMiBSb290IENBMB4X +DTEwMTAyNjA4MzgwM1oXDTQwMTAyNjA4MzgwM1owTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1 +eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDIgUm9vdCBDQTCCAiIw +DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANfHXvfBB9R3+0Mh9PT1aeTuMgHbo4Yf5FkNuud1 +g1Lr6hxhFUi7HQfKjK6w3Jad6sNgkoaCKHOcVgb/S2TwDCo3SbXlzwx87vFKu3MwZfPVL4O2fuPn +9Z6rYPnT8Z2SdIrkHJasW4DptfQxh6NR/Md+oW+OU3fUl8FVM5I+GC911K2GScuVr1QGbNgGE41b +/+EmGVnAJLqBcXmQRFBoJJRfuLMR8SlBYaNByyM21cHxMlAQTn/0hpPshNOOvEu/XAFOBz3cFIqU +CqTqc/sLUegTBxj6DvEr0VQVfTzh97QZQmdiXnfgolXsttlpF9U6r0TtSsWe5HonfOV116rLJeff +awrbD02TTqigzXsu8lkBarcNuAeBfos4GzjmCleZPe4h6KP1DBbdi+w0jpwqHAAVF41og9JwnxgI +zRFo1clrUs3ERo/ctfPYV3Me6ZQ5BL/T3jjetFPsaRyifsSP5BtwrfKi+fv3FmRmaZ9JUaLiFRhn +Bkp/1Wy1TbMz4GHrXb7pmA8y1x1LPC5aAVKRCfLf6o3YBkBjqhHk/sM3nhRSP/TizPJhk9H9Z2vX +Uq6/aKtAQ6BXNVN48FP4YUIHZMbXb5tMOA1jrGKvNouicwoN9SG9dKpN6nIDSdvHXx1iY8f93ZHs +M+71bbRuMGjeyNYmsHVee7QHIJihdjK4TWxPAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD +VR0OBBYEFMmAd+BikoL1RpzzuvdMw964o605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF +AAOCAgEAU18h9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s +A20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3tOluwlN5E40EI +osHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo+fsicdl9sz1Gv7SEr5AcD48S +aq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7KcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYd +DnkM/crqJIByw5c/8nerQyIKx+u2DISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWD +LfJ6v9r9jv6ly0UsH8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0 +oyLQI+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK75t98biGC +wWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h3PFaTWwyI0PurKju7koS +CTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPzY11aWOIv4x3kqdbQCtCev9eBCfHJxyYN +rJgWVqA= +-----END CERTIFICATE----- + +Buypass Class 3 Root CA +======================= +-----BEGIN CERTIFICATE----- +MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswC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A4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF +AAOCAgEAACAjQTUEkMJAYmDv4jVM1z+s4jSQuKFvdvoWFqRINyzpkMLyPPgKn9iB5btb2iUspKdV +cSQy9sgL8rxq+JOssgfCX5/bzMiKqr5qb+FJEMwx14C7u8jYog5kV+qi9cKpMRXSIGrs/CIBKM+G +uIAeqcwRpTzyFrNHnfzSgCHEy9BHcEGhyoMZCCxt8l13nIoUE9Q2HJLw5QY33KbmkJs4j1xrG0aG +Q0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsaO5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8 +ZORK15FTAaggiG6cX0S5y2CBNOxv033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2 +KSb12tjE8nVhz36udmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz +6MkEkbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg413OEMXbug +UZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvDu79leNKGef9JOxqDDPDe +eOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq4/g7u9xN12TyUb7mqqta6THuBrxzvxNi +Cp/HuZc= +-----END CERTIFICATE----- + +T-TeleSec GlobalRoot Class 3 +============================ +-----BEGIN CERTIFICATE----- +MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM +IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU +cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwHhcNMDgx +MDAxMTAyOTU2WhcNMzMxMDAxMjM1OTU5WjCBgjELMAk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L2QtdHJ1c3Rfcm9vdF9jbGFzc18zX2NhXzJfMjAw +OS5jcmwwDQYJKoZIhvcNAQELBQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm +2H6NMLVwMeniacfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0 +o3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4KzCUqNQT4YJEV +dT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8PIWmawomDeCTmGCufsYkl4ph +X5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3YJohw1+qRzT65ysCQblrGXnRl11z+o+I= +-----END CERTIFICATE----- + +D-TRUST Root Class 3 CA 2 EV 2009 +================================= +-----BEGIN CERTIFICATE----- +MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK +DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw +OTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUwNDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK +DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw +OTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfS +egpnljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM03TP1YtHh +zRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6ZqQTMFexgaDbtCHu39b+T +7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lRp75mpoo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GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1UdDgQWBBTwj1k4ALP1j5qW +DNXr+nuqF+gTEjANBgkqhkiG9w0BAQUFAAOCAgEAvuRcYk4k9AwI//DTDGjkk0kiP0Qnb7tt3oNm +zqjMDfz1mgbldxSR651Be5kqhOX//CHBXfDkH1e3damhXwIm/9fH907eT/j3HEbAek9ALCI18Bmx +0GtnLLCo4MBANzX2hFxc469CeP6nyQ1Q6g2EdvZR74NTxnr/DlZJLo961gzmJ1TjTQpgcmLNkQfW +pb/ImWvtxBnmq0wROMVvMeJuScg/doAmAyYp4Db29iBT4xdwNBedY2gea+zDTYa4EzAvXUYNR0PV +G6pZDrlcjQZIrXSHX8f8MVRBE+LHIQ6e4B4N4cB7Q4WQxYpYxmUKeFfyxiMPAdkgS94P+5KFdSpc +c41teyWRyu5FrgZLAMzTsVlQ2jqIOylDRl6XK1TOU2+NSueW+r9xDkKLfP0ooNBIytrEgUy7onOT +JsjrDNYmiLbAJM+7vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2 +qReWt88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcnHL/EVlP6 +Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVxSK236thZiNSQvxaz2ems +WWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY= +-----END CERTIFICATE----- + +E-Tugra Certification Authority +=============================== +-----BEGIN CERTIFICATE----- +MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNVBAYTAlRSMQ8w +DQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamls +ZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2Vyd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0n7vUaDmUStVkhUXU8u3Zg5mTPj5 +dUyQ5xJwx0UCAwEAAaNjMGEwHQYDVR0OBBYEFC7j27JJ0JxUeVz6Jyr+zE7S6E5UMA8GA1UdEwEB +/wQFMAMBAf8wHwYDVR0jBBgwFoAULuPbsknQnFR5XPonKv7MTtLoTlQwDgYDVR0PAQH/BAQDAgEG +MA0GCSqGSIb3DQEBCwUAA4ICAQAFNzr0TbdF4kV1JI+2d1LoHNgQk2Xz8lkGpD4eKexd0dCrfOAK +kEh47U6YA5n+KGCRHTAduGN8qOY1tfrTYXbm1gdLymmasoR6d5NFFxWfJNCYExL/u6Au/U5Mh/jO +XKqYGwXgAEZKgoClM4so3O0409/lPun++1ndYYRP0lSWE2ETPo+Aab6TR7U1Q9Jauz1c77NCR807 +VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3+GbHeJAAFS6LrVE1Uweo +a2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WKvJUawSg5TB9D0pH0clmKuVb8P7Sd2nCc +dlqMQ1DujjByTd//SffGqWfZbawCEeI6FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEV +KV0jq9BgoRJP3vQXzTLlyb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gT +Dx4JnW2PAJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpDy4Q0 +8ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8dNL/+I5c30jn6PQ0G +C7TbO6Orb1wdtn7os4I07QZcJA== +-----END CERTIFICATE----- + +T-TeleSec GlobalRoot Class 2 +============================ +-----BEGIN CERTIFICATE----- +MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM +IlQtU3lzdGVtcyBFbnRl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g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN +9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlPBSeOE6Fuwg== +-----END CERTIFICATE----- + +Atos TrustedRoot 2011 +===================== +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcNAQELBQAwPDEeMBwGA1UEAwwVQXRvcyBU +cnVzdGVkUm9vdCAyMDExMQ0wCwYDVQQKDARBdG9zMQswCQYDVQQGEwJERTAeFw0xMTA3MDcxNDU4 +MzBaFw0zMDEyMzEyMzU5NTlaMDwxHjAcBgNVBAMMFUF0b3MgVHJ1c3RlZFJvb3QgMjAxMTENMAsG +A1UECgwEQXRvczELMAkGA1UEBhMCREUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCV +hTuXbyo7LjvPpvMpNb7PGKw+qtn4TaA+Gke5vJrf8v7MPkfoepbCJI419KkM/IL9bcFyYie96mvr +54rMVD6QUM+A1JX76LWC1BTFtqlVJVfbsVD2sGBkWXppzwO3bw2+yj5vdHLqqjAqc2K+SZFhyBH+ +DgMq92og3AIVDV4VavzjgsG1xZ1kCWyjWZgHJ8cblithdHFsQ/H3NYkQ4J7sVaE3IqKHBAUsR320 +HLliKWYoyrfhk/WklAOZuXCFteZI6o1Q/NnezG8HDt0Lcp2AMBYHlT8oDv3FdU9T1nSatCQujgKR +z3bFmx5VdJx4IbHwLfELn8LVlhgf8FQieowHAgMBAAGjfTB7MB0GA1UdDgQWBBSnpQaxLKYJYO7R +l+lwrrw7GWzbITAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKelBrEspglg7tGX6XCuvDsZ +bNshMBgGA1UdIAQRMA8wDQYLKwYBBAGwLQMEAQEwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB +CwUAA4IBAQAmdzTblEiGKkGdLD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Mf3W1daWhpq1467HxpvMc7hU6eFbm0 +FU/DlXpY18ls6Wy58yljXrQs8C097Vpl4KlbQMJImYFtnh8GKjwStIsPm6Ik8KaN1nrgS7ZklmOV +hMJKzRwuJIczYOXD +-----END CERTIFICATE----- + +QuoVadis Root CA 2 G3 +===================== +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIURFc0JFuBiZs18s64KztbpybwdSgwDQYJKoZIhvcNAQELBQAwSDELMAkG +A1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAcBgNVBAMTFVF1b1ZhZGlzIFJv +b3QgQ0EgMiBHMzAeFw0xMjAxMTIxODU5MzJaFw00MjAxMTIxODU5MzJaMEgxCzAJBgNVBAYTAkJN +MRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDIg +RzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQChriWyARjcV4g/Ruv5r+LrI3HimtFh +ZiFfqq8nUeVuGxbULX1QsFN3vXg6YOJkApt8hpvWGo6t/x8Vf9WVHhLL5hSEBMHfNrMWn4rjyduY +NM7YMxcoRvynyfDStNVNCXJJ+fKH46nafaF9a7I6JaltUkSs+L5u+9ymc5GQYaYDFCDy54ejiK2t +oIz/pgslUiXnFgHVy7g1gQyjO/Dh4fxaXc6AcW34Sas+O7q414AB+6XrW7PFXmAqMaCvN+ggOp+o +MiwMzAkd056OXbxMmO7FGmh77FOm6RQ1o9/NgJ8MSPsc9PG/Srj61YxxSscfrf5BmrODXfKEVu+l +V0POKa2Mq1W/xPtbAd0jIaFYAI7D0GoT7RPjEiuA3GfmlbLNHiJuKvhB1PLKFAeNilUSxmn1uIZo +L1NesNKqIcGY5jDjZ1XHm26sGahVpkUG0CM62+tlXSoREfA7T8pt9DTEceT/AFr2XK4jYIVz8eQQ +sSWu1ZK7E8EM4DnatDlXtas1qnIhO4M15zHfeiFuuDIIfR0ykRVKYnLP43ehvNURG3YBZwjgQQvD +6xVu+KQZ2aKrr+InUlYrAoosFCT5v0ICvybIxo/gbjh9Uy3l7ZizlWNof/k19N+IxWA1ksB8aRxh +lRbQ694Lrz4EEEVlWFA4r0jyWbYW8jwNkALGcC4BrTwV1wIDAQABo0IwQDAPBgNVHRMBAf8EBTAD +AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU7edvdlq/YOxJW8ald7tyFnGbxD0wDQYJKoZI +hvcNAQELBQADggIBAJHfgD9DCX5xwvfrs4iP4VGyvD11+ShdyLyZm3tdquXK4Qr36LLTn91nMX66 +AarHakE7kNQIXLJgapDwyM4DYvmL7ftuKtwGTTwpD4kWilhMSA/ohGHqPHKmd+RCroijQ1h5fq7K +pVMNqT1wvSAZYaRsOPxDMuHBR//47PERIjKWnML2W2mWeyAMQ0GaW/ZZGYjeVYg3UQt4XAoeo0L9 +x52ID8DyeAIkVJOviYeIyUqAHerQbj5hLja7NQ4nlv1mNDthcnPxFlxHBlRJAHpYErAK74X9sbgz +dWqTHBLmYF5vHX/JHyPLhGGfHoJE+V+tYlUkmlKY7VHnoX6XOuYvHxHaU4AshZ6rNRDbIl9qxV6X +U/IyAgkwo1jwDQHVcsaxfGl7w/U2Rcxhbl5MlMVerugOXou/983g7aEOGzPuVBj+D77vfoRrQ+Nw +mNtddbINWQeFFSM51vHfqSYP1kjHs6Yi9TM3WpVHn3u6GBVv/9YUZINJ0gpnIdsPNWNgKCLjsZWD +zYWm3S8P52dSbrsvhXz1SnPnxT7AvSESBT/8twNJAlvIJebiVDj1eYeMHVOyToV7BjjHLPj4sHKN +JeV3UvQDHEimUF+IIDBu8oJDqz2XhOdT+yHBTw8imoa4WSr2Rz0ZiC3oheGe7IUIarFsNMkd7Egr +O3jtZsSOeWmD3n+M +-----END CERTIFICATE----- + +QuoVadis Root CA 3 G3 +===================== +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIULvWbAiin23r/1aOp7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NVHQ4EFgQUxhfQvKjqAkPyGwaZXSuQILnXnOQwDQYJKoZI +hvcNAQELBQADggIBADRh2Va1EodVTd2jNTFGu6QHcrxfYWLopfsLN7E8trP6KZ1/AvWkyaiTt3px +KGmPc+FSkNrVvjrlt3ZqVoAh313m6Tqe5T72omnHKgqwGEfcIHB9UqM+WXzBusnIFUBhynLWcKzS +t/Ac5IYp8M7vaGPQtSCKFWGafoaYtMnCdvvMujAWzKNhxnQT5WvvoxXqA/4Ti2Tk08HS6IT7SdEQ +TXlm66r99I0xHnAUrdzeZxNMgRVhvLfZkXdxGYFgu/BYpbWcC/ePIlUnwEsBbTuZDdQdm2NnL9Du +DcpmvJRPpq3t/O5jrFc/ZSXPsoaP0Aj/uHYUbt7lJ+yreLVTubY/6CD50qi+YUbKh4yE8/nxoGib +Ih6BJpsQBJFxwAYf3KDTuVan45gtf4Od34wrnDKOMpTwATwiKp9Dwi7DmDkHOHv8XgBCH/MyJnmD +hPbl8MFREsALHgQjDFSlTC9JxUrRtm5gDWv8a4uFJGS3iQ6rJUdbPM9+Sb3H6QrG2vd+DhcI00iX +0HGS8A85PjRqHH3Y8iKuu2n0M7SmSFXRDw4m6Oy2Cy2nhTXN/VnIn9HNPlopNLk9hM6xZdRZkZFW +dSHBd575euFgndOtBBj0fOtek49TSiIp+EgrPk2GrFt/ywaZWWDYWGWVjUTR939+J399roD1B0y2 +PpxxVJkES/1Y+Zj0 +-----END CERTIFICATE----- + +DigiCert Assured ID Root G2 +=========================== +-----BEGIN CERTIFICATE----- +MIIDljCCAn6gAwIBAgIQC5McOtY5Z+pnI7/Dr5r0SzANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw +IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIwHhcNMTMwODAxMTIwMDAwWhcNMzgw +MTE1MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL +ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZ5ygvUj82ckmIkzTz+GoeMVSAn61UQbVH +35ao1K+ALbkKz3X9iaV9JPrjIgwrvJUXCzO/GU1BBpAAvQxNEP4HteccbiJVMWWXvdMX0h5i89vq +bFCMP4QMls+3ywPgym2hFEwbid3tALBSfK+RbLE4E9HpEgjAALAcKxHad3A2m67OeYfcgnDmCXRw +VWmvo2ifv922ebPynXApVfSr/5Vh88lAbx3RvpO704gqu52/clpWcTs/1PPRCv4o76Pu2ZmvA9OP +YLfykqGxvYmJHzDNw6YuYjOuFgJ3RFrngQo8p0Quebg/BLxcoIfhG69Rjs3sLPr4/m3wOnyqi+Rn +lTGNAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTO +w0q5mVXyuNtgv6l+vVa1lzan1jANBgkqhkiG9w0BAQsFAAOCAQEAyqVVjOPIQW5pJ6d1Ee88hjZv +0p3GeDgdaZaikmkuOGybfQTUiaWxMTeKySHMq2zNixya1r9I0jJmwYrA8y8678Dj1JGG0VDjA9tz +d29KOVPt3ibHtX2vK0LRdWLjSisCx1BL4GnilmwORGYQRI+tBev4eaymG+g3NJ1TyWGqolKvSnAW +hsI6yLETcDbYz+70CjTVW0z9B5yiutkBclzzTcHdDrEcDcRjvq30FPuJ7KJBDkzMyFdA0G4Dqs0M +jomZmWzwPDCvON9vvKO+KSAnq3T/EyJ43pdSVR6DtVQgA+6uwE9W3jfMw3+qBCe703e4YtsXfJwo +IhNzbM8m9Yop5w== +-----END CERTIFICATE----- + +DigiCert Assured ID Root G3 +=========================== +-----BEGIN CERTIFICATE----- +MIICRjCCAc2gAwIBAgIQC6Fa+h3foLVJRK/NJKBs7DAKBggqhkjOPQQDAzBlMQswCQYDVQQGEwJV +UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQwIgYD +VQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1 +MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwdjAQ +BgcqhkjOPQIBBgUrgQQAIgNiAAQZ57ysRGXtzbg/WPuNsVepRC0FFfLvC/8QdJ+1YlJfZn4f5dwb +RXkLzMZTCp2NXQLZqVneAlr2lSoOjThKiknGvMYDOAdfVdp+CW7if17QRSAPWXYQ1qAk8C3eNvJs +KTmjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTL0L2p4ZgF +UaFNN6KDec6NHSrkhDAKBggqhkjOPQQDAwNnADBkAjAlpIFFAmsSS3V0T8gj43DydXLefInwz5Fy +YZ5eEJJZVrmDxxDnOOlYJjZ91eQ0hjkCMHw2U/Aw5WJjOpnitqM7mzT6HtoQknFekROn3aRukswy +1vUhZscv6pZjamVFkpUBtA== +-----END CERTIFICATE----- + +DigiCert Global Root G2 +======================= +-----BEGIN CERTIFICATE----- +MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw +HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUx +MjAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 +dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkq +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI2/Ou8jqJ +kTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx1x7e/dfgy5SDN67sH0NO +3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQq2EGnI/yuum06ZIya7XzV+hdG82MHauV +BJVJ8zUtluNJbd134/tJS7SsVQepj5WztCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyM +UNGPHgm+F6HmIcr9g+UQvIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQAB +o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV5uNu +5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY1Yl9PMWLSn/pvtsr +F9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4NeF22d+mQrvHRAiGfzZ0JFrabA0U +WTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NGFdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBH +QRFXGU7Aj64GxJUTFy8bJZ918rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/ +iyK5S9kJRaTepLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl +MrY= +-----END CERTIFICATE----- + +DigiCert Global Root G3 +======================= +-----BEGIN CERTIFICATE----- +MIICPz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k5hQpVgs2SV1EY+CtnJYY +ZhsjDT156W1r1lT40jzBQ0CuHVD1UvyQO7uYmWlrx8GnqGikJ9yd+SeuMIW59mdNOj6PWTkiU0Tr +yF0Dyu1Qen1iIQqAyHNm0aAFYF/opbSnr6j3bTWcfFqK1qI4mfN4i/RN0iAL3gTujJtHgXINwBQy +7zBZLq7gcfJW5GqXb5JQbZaNaHqasjYUegbyJLkJEVDXCLG4iXqEI2FCKeWjzaIgQdfRnGTZ6iah +ixTXTBmyUEFxPT9NcCOGDErcgdLMMpSEDQgJlxxPwO5rIHQw0uA5NBCFIRUBCOhVMt5xSdkoF1BN +5r5N0XWs0Mr7QbhDparTwwVETyw2m+L64kW4I1NsBm9nVX9GtUw/bihaeSbSpKhil9Ie4u1Ki7wb +/UdKDd9nZn6yW0HQO+T0O/QEY+nvwlQAUaCKKsnOeMzV6ocEGLPOr0mIr/OSmbaz5mEP0oUA51Aa +5BuVnRmhuZyxm7EAHu/QD09CbMkKvO5D+jpxpchNJqU1/YldvIViHTLSoCtU7ZpXwdv6EM8Zt4tK +G48BtieVU+i2iW1bvGjUI+iLUaJW+fCmgKDWHrO8Dw9TdSmq6hN35N6MgSGtBxBHEa2HPQfRdbzP +82Z+ +-----END CERTIFICATE----- + +COMODO RSA Certification Authority +================================== +-----BEGIN CERTIFICATE----- +MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCBhTELMAkGA1UE +BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG +A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkwHhcNMTAwMTE5MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMC +R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQ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ZRGxhNaKatBYSaVqM4dc+pBroLwP0rmEdEBsqpIt6xf4FpuHA1sj+ +nq6PK7o9mfjYcwlYRm6mnPTXJ9OV2jeDchzTc+CiR5kDOF3VSXkAKRzH7JsgHAckaVd4sjn8OoSg +tZx8jb8uk2IntznaFxiuvTwJaP+EmzzV1gsD41eeFPfR60/IvYcjt7ZJQ3mFXLrrkguhxuhoqEwW +sRqZCuhTLJK7oQkYdQxlqHvLI7cawiiFwxv/0Cti76R7CZGYZ4wUAc1oBmpjIXUDgIiKboHGhfKp +pC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmckejkk9u+UJueBPSZI9FoJA +zMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yLS0Zj/gA0QHDBw7mh3aZw4gSzQbzpgJHq +ZJx64SIDqZxubw5lT2yHh17zbqD5daWbQOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk52 +7RH89elWsn2/x20Kk4yl0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7I +LaZRfyHBNVOFBkpdn627G190 +-----END CERTIFICATE----- + +USERTrust RSA Certification Authority +===================================== +-----BEGIN CERTIFICATE----- +MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCBiDELMAkGA1UE +BhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQK +ExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UE +BhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQK +ExVUaGUgVVNFUl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7l8wXEskEVX/JJpuXior7gtNn3/3ATiUFJVDBwn7YKnuHKsSjKCaXqeYalltiz8I+8jRRa8YFWSQ +Eg9zKC7F4iRO/Fjs8PRF/iKz6y+O0tlFYQXBl2+odnKPi4w2r78NBc5xjeambx9spnFixdjQg3IM +8WcRiQycE0xyNN+81XHfqnHd4blsjDwSXWXavVcStkNr/+XeTWYRUc+ZruwXtuhxkYzeSf7dNXGi +FSeUHM9h4ya7b6NnJSFd5t0dCy5oGzuCr+yDZ4XUmFF0sbmZgIn/f3gZXHlKYC6SQK5MNyosycdi +yA5d9zZbyuAlJQG03RoHnHcAP9Dc1ew91Pq7P8yF1m9/qS3fuQL39ZeatTXaw2ewh0qpKJ4jjv9c +J2vhsE/zB+4ALtRZh8tSQZXq9EfX7mRBVXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGw +sAvgnEzDHNb842m1R0aBL6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gx +Q+6IHdfGjjxDah2nGN59PRbxYvnKkKj9 +-----END CERTIFICATE----- + +USERTrust ECC Certification Authority +===================================== +-----BEGIN CERTIFICATE----- +MIICjzCCAhWgAwIBAgIQXIuZxVqUxdJxVt7NiYDMJjAKBggqhkjOPQQDAzCBiDELMAkGA1UEBhMC +VVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU +aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMC +VVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU +aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRV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8o4TV +MAoGCCqGSM49BAMCA0gAMEUCIQDckqGgE6bPA7DmxCGXkPoUVy0D7O48027KqGx2vKLeuwIgJ6iF +JzWbVsaj8kfSt24bAgAXqmemFZHe+pTsewv4n4Q= +-----END CERTIFICATE----- + +GlobalSign ECC Root CA - R5 +=========================== +-----BEGIN CERTIFICATE----- +MIICHjCCAaSgAwIBAgIRYFlJ4CYuu1X5CneKcflK2GwwCgYIKoZIzj0EAwMwUDEkMCIGA1UECxMb +R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD +EwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMb +R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD +EwpHbG9iYWxTaWduMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAER0UOlvt9Xb/pOdEh+J8LttV7HpI6 +SFkc8GIxLcB6KP4ap1yztsyX50XUWPrRd21DosCHZTQKH3rd6zwzocWdTaRvQZU4f8kehOvRnkmS +h5SHDDqFSmafnVmTTZdhBoZKo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAd +BgNVHQ4EFgQUPeYpSJvqB8ohREom3m7e0oPQn1kwCgYIKoZIzj0EAwMDaAAwZQIxAOVpEslu28Yx +uglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7 +yFz9SO8NdCKoCOJuxUnOxwy8p2Fp8fc74SrL+SvzZpA3 +-----END CERTIFICATE----- + +Staat der Nederlanden EV Root CA +================================ +-----BEGIN CERTIFICATE----- +MIIFcDCCA1igAwIBAgIEAJiWjTANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJOTDEeMBwGA1UE +CgwVU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rAJCYniT8qcwa +ivsnuL8wbqg7MA0GCSqGSIb3DQEBCwUAA4ICAQDPdyxuVr5Os7aEAJSrR8kN0nbHhp8dB9O2tLsI +eK9p0gtJ3jPFrK3CiAJ9Brc1AsFgyb/E6JTe1NOpEyVa/m6irn0F3H3zbPB+po3u2dfOWBfoqSmu +c0iH55vKbimhZF8ZE/euBhD/UcabTVUlT5OZEAFTdfETzsemQUHSv4ilf0X8rLiltTMMgsT7B/Zq +5SWEXwbKwYY5EdtYzXc7LMJMD16a4/CrPmEbUCTCwPTxGfARKbalGAKb12NMcIxHowNDXLldRqAN +b/9Zjr7dn3LDWyvfjFvO5QxGbJKyCqNMVEIYFRIYvdr8unRu/8G2oGTYqV9Vrp9canaW2HNnh/tN +f1zuacpzEPuKqf2evTY4SUmH9A4U8OmHuD+nT3pajnnUk+S7aFKErGzp85hwVXIy+TSrK0m1zSBi +5Dp6Z2Orltxtrpfs/J92VoguZs9btsmksNcFuuEnL5O7Jiqik7Ab846+HUCjuTaPPoIaGl6I6lD4 +WeKDRikL40Rc4ZW2aZCaFG+XroHPaO+Zmr615+F/+PoTRxZMzG0IQOeLeG9QgkRQP2YGiqtDhFZK +DyAthg710tvSeopLzaXoTvFeJiUBWSOgftL2fiFX1ye8FVdMpEbB4IMeDExNH08GGeL5qPQ6gqGy +eUN51q1veieQA6TqJIc/2b3Z6fJfUEkc7uzXLg== +-----END CERTIFICATE----- + +IdenTrust Commercial Root CA 1 +============================== +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIQCgFCgAAAAUUjyES1AAAAAjANBgkqhkiG9w0BAQsFADBKMQswCQYDVQQG +EwJVUzESMBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBS +b290IENBIDEwHhcNMTQwMTE2MTgxMjIzWhcNMzQwMTE2MTgxMjIzWjBKMQswCQYDVQQGEwJVUzES +MBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5J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8U1mwF10A0Cj7oV+wh93nAbowacYXVKV7cndJZ5t+qnt +ozo00Fl72u1Q8zW/7esUTTHHYPTa8Yec4kjixsU3+wYQ+nVZZjFHKdp2mhzpgq7vmrlR94gjmmmV +YjzlVYA211QC//G5Xc7UI2/YRYRKW2XviQzdFKcgyxilJbQN+QHwotL0AMh0jqEqSI5l2xPE4iUX +feu+h1sXIFRRk0pTAwvsXcoz7WL9RccvW9xYoIA55vrX/hMUpu09lEpCdNTDd1lzzY9GvlU47/ro +kTLql1gEIt44w8y8bckzOmoKaT+gyOpyj4xjhiO9bTyWnpXgSUyqorkqG5w2gXjtw+hG4iZZRHUe +2XWJUc0QhJ1hYMtd+ZciTY6Y5uN/9lu7rs3KSoFrXgvzUeF0K+l+J6fZmUlO+KWA2yUPHGNiiskz +Z2s8EIPGrd6ozRaOjfAHN3Gf8qv8QfXBi+wAN10J5U6A7/qxXDgGpRtK4dw4LTzcqx+QGtVKnO7R +cGzM7vRX+Bi6hG6H +-----END CERTIFICATE----- + +IdenTrust Public Sector Root CA 1 +================================= +-----BEGIN CERTIFICATE----- +MIIFZjCCA06gAwIBAgIQCgFCgAAAAUUjz0Z8AAAAAjANBgkqhkiG9w0BAQsFADBNMQswCQYDVQQG +EwJVUzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3Rv +ciBSb290IENBIDEwHhcNMTQwMTE2MTc1MzMyWhcNMzQwMTE2MTc1MzMyWjBNMQswCQYDVQQGEwJV +UzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3RvciBS +b290IENBIDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2IpT8pEiv6EdrCvsnduTy +P4o7ekosMSqMjbCpwzFrqHd2hCa2rIFCDQjrVVi7evi8ZX3yoG2LqEfpYnYeEe4IFNGyRBb06tD6 +Hi9e28tzQa68ALBKK0CyrOE7S8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oA0beOY02QnrEh+KHdcxiVhJfiFDGX6xDIvpZgF5PgLZxYWxoK4 +Mhn5+bl53B/N66+rDt0b20XkeucC4pVd/GnwU2lhlXV5C15V5jgclKlZM57IcXR5f1GJtshquDDI +ajjDbp7hNxbqBWJMWxJH7ae0s1hWx0nzfxJoCTFx8G34Tkf71oXuxVhAGaQdp/lLQzfcaFpPz+vC +ZHTetBXZ9FRUGi8c15dxVJCO2SCdUyt/q4/i6jC8UDfv8Ue1fXwsBOxonbRJRBD0ckscZOf85muQ +3Wl9af0AVqW3rLatt8o+Ae+c +-----END CERTIFICATE----- + +Entrust Root Certification Authority - G2 +========================================= +-----BEGIN CERTIFICATE----- +MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMCVVMxFjAUBgNV +BAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVy +bXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ug +b25seTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIw +HhcNMDkwNzA3MTcyNTU0WhcNMzAxMjA3MTc1NTU0WjCBvjELMAkGA1UEBhMCVVMxFjAUBgNVBAoT +DUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMx +OTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25s +eTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIwggEi +MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6hLZy254Ma+KZ6TABp3bqMriVQRrJ2mFOWHLP +/vaCeb9zYQYKpSfYs1/TRU4cctZOMvJyig/3gxnQaoCAAEUesMfnmr8SVycco2gvCoe9amsOXmXz +HHfV1IWNcCG0szLni6LVhjkCsbjSR87kyUnEO6fe+1R9V77w6G7CebI6C1XiUJgWMhNcL3hWwcKU +s/Ja5CeanyTXxuzQmyWC48zCxEXFjJd6BmsqEZ+pCm5IO2/b1BEZQvePB7/1U1+cPvQXLOZprE4y +TGJ36rfo5bs0vBmLrpxR57d+tVOxMyLlbc9wPBr64ptntoP0jaWvYkxN4FisZDQSA/i2jZRjJKRx +AgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqciZ6 +0B7vfec7aVHUbI2fkBJmqzANBgkqhkiG9w0BAQsFAAOCAQEAeZ8dlsa2eT8ijYfThwMEYGprmi5Z +iXMRrEPR9RP/jTkrwPK9T3CMqS/qF8QLVJ7UG5aYMzyorWKiAHarWWluBh1+xLlEjZivEtRh2woZ +Rkfz6/djwUAFQKXSt/S1mja/qYh2iARVBCuch38aNzx+LaUa2NSJXsq9rD1s2G2v1fN2D807iDgi +nWyTmsQ9v4IbZT+mD12q/OWyFcq1rca8PdCE6OoGcrBNOTJ4vz4RnAuknZoh8/CbCzB428Hch0P+ +vGOaysXCHMnHjf87ElgI5rY97HosTvuDls4MPGmHVHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ19xO +e4pIb4tF9g== +-----END CERTIFICATE----- + +Entrust Root Certification Authority - EC1 +========================================== +-----BEGIN CERTIFICATE----- +MIIC+TCCAoCgAwIBAgINAKaLeSkAAAAAUNCR+TAKBggqhkjOPQQDAzCBvzELMAkGA1UEBhMCVVMx +FjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVn +YWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEyIEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXpl +ZCB1c2Ugb25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ecsAIyjmHjdXNYmEwnZPNDatZ8POQQaIxffu2Bq41gt/UP+TqhdLjOztUmCypAbqTuv0axn96/Ua +4CUqmtzHQTb3yHQFhDmVOdYLO6Qn+gjYXB74BGBSESgoA//vU2YApUo0FmZ8/Qmkrp5nGm9BC2sG +E5uPhnEFtC+NiWYzKXZUmhH4J/qyP5Hgzg0b8zAarb8iXRvTvyUFTeGSGn+ZnzxEk8rUQElsgIfX +BDrDMlI1Dlb4pd19xIsNER9Tyx6yF7Zod1rg1MvIB671Oi6ON7fQAUtDKXeMOZePglr4UeWJoBjn +aH9dCi77o0cOPaYjesYBx4/IXr9tgFa+iiS6M+qf4TIRnvHST4D2G0CvOJ4RUHlzEhLN5mydLIhy +PDCBBpEi6lmt2hkuIsKNuYyH4Ga8cyNfIWRjgEj1oDwYPZTISEEdQLpe/v5WOaHIz16eGWRGENoX +kbcFgKyLmZJ956LYBws2J+dIeWCKw9cTXPhyQN9Ky8+ZAAoACxGV2lZFA4gKn2fQ1XmxqI1AbQ3C +ekD6819kR5LLU7m7Wc5P/dAVUwHY3+vZ5nbv0CO7O6l5s9UCKc2Jo5YPSjXnTkLAdc0Hz+Ys63su +-----END CERTIFICATE----- + +OISTE WISeKey Global Root GB CA +=============================== +-----BEGIN CERTIFICATE----- +MIIDtTCCAp2gAwIBAgIQdrEgUnTwhYdGs/gjGvbCwDANBgkqhkiG9w0BAQsFADBtMQswCQYDVQQG +EwJDSDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNl +ZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQiBDQTAeFw0xNDEyMDExNTAw +MzJaFw0zOTEyMDExNTEwMzFaMG0xCzAJBgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNlS2V5MSIwIAYD +VQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5IEds +b2JhbCBSb290IEdCIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2Be3HEokKtaX +scriHvt9OO+Y9bI5mE4nuBFde9IllIiCFSZqGzG7qFshISvYD06fWvGxWuR51jIjK+FTzJlFXHtP +rby/h0oLS5daqPZI7H17Dc0hBt+eFf1Biki3IPShehtX1F1Q/7pn2COZH8g/497/b1t3sWtuuMlk +9+HKQUYOKXHQuSP8yYFfTvdv37+ErXNku7dCjmn21HYdfp2nuFeKUWdy19SouJVUQHMD9ur06/4o +Qnc/nSMbsrY9gBQHTC5P99UKFg29ZkM3fiNDecNAhvVMKdqOmq0NpQSHiB6F4+lT1ZvIiwNjeOvg +GUpuuy9rM2RYk61pv48b74JIxwIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB +/zAdBgNVHQ4EFgQUNQ/INmNe4qPs+TtmFc5RUuORmj0wEAYJKwYBBAGCNxUBBAMCAQAwDQYJKoZI +hvcNAQELBQADggEBAEBM+4eymYGQfp3FsLAmzYh7KzKNbrghcViXfa43FK8+5/ea4n32cZiZBKpD +dHij40lhPnOMTZTg+XHEthYOU3gf1qKHLwI5gSk8rxWYITD+KJAAjNHhy/peyP34EEY7onhCkRd0 +VQreUGdNZtGn//3ZwLWoo4rOZvUPQ82nK1d7Y0Zqqi5S2PTt4W2tKZB4SLrhI6qjiey1q5bAtEui +HZeeevJuQHHfaPFlTc58Bd9TZaml8LGXBHAVRgOY1NK/VLSgWH1Sb9pWJmLU2NuJMW8c8CLC02Ic +Nc1MaRVUGpCY3useX8p3x8uOPUNpnJpY0CQ73xtAln41rYHHTnG6iBM= +-----END CERTIFICATE----- + +SZAFIR ROOT CA2 +=============== +-----BEGIN CERTIFICATE----- +MIIDcjCCAlqgAwIBAgIUPopdB+xV0jLVt+O2XwHrLdzk1uQwDQYJKoZIhvcNAQELBQAwUTELMAkG +A1UEBhMCUEwxKDAmBgNVBAoMH0tyYWpvd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Cz/UXeHPhJ/iGcJfitYgHuNztw== +-----END CERTIFICATE----- + +Certum Trusted Network CA 2 +=========================== +-----BEGIN CERTIFICATE----- +MIIF0jCCA7qgAwIBAgIQIdbQSk8lD8kyN/yqXhKN6TANBgkqhkiG9w0BAQ0FADCBgDELMAkGA1UE +BhMCUEwxIjAgBgNVBAoTGVVuaXpldG8gVGVjaG5vbG9naWVzIFMuQS4xJzAlBgNVBAsTHkNlcnR1 +bSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEkMCIGA1UEAxMbQ2VydHVtIFRydXN0ZWQgTmV0d29y +ayBDQSAyMCIYDzIwMTExMDA2MDgzOTU2WhgPMjA0NjEwMDYwODM5NTZaMIGAMQswCQYDVQQGEwJQ +TDEiMCAGA1UEChMZVW5pemV0byBUZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENl +cnRpZmljYXRpb24gQXV0aG9yaXR5MSQwIgYDVQQDExtDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENB +IDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC9+Xj45tWADGSdhhuWZGc/IjoedQF9 +7/tcZ4zJzFxrqZHmuULlIEub2pt7uZld2ZuAS9eEQCsn0+i6MLs+CRqnSZXvK0AkwpfHp+6bJe+o +CgCXhVqqndwpyeI1B+twTUrWwbNWuKFBOJvR+zF/j+Bf4bE/D44WSWDXBo0Y+aomEKsq09DRZ40b +Rr5HMNUuctHFY9rnY3lEfktjJImGLjQ/KUxSiyqnwOKRKIm5wFv5HdnnJ63/mgKXwcZQkpsCLL2p +uTRZCr+ESv/f/rOf69me4Jgj7KZrdxYq28ytOxykh9xGc14ZYmhFV+SQgkK7QtbwYeDBoz1mo130 +GO6IyY0XRSmZMnUCMe4pJshrAua1YkV/NxVaI2iJ1D7eTiew8EAMvE0Xy02isx7QBlrd9pPPV3WZ +9fqGGmd4s7+W/jTcvedSVuWz5XV710GRBdxdaeOVDUO5/IOWOZV7bIBaTxNyxtd9KXpEulKkKtVB +Rgkg/iKgtlswjbyJDNXXcPiHUv3a76xRLgezTv7QCdpw75j6VuZt27VXS9zlLCUVyJ4ueE742pye +hizKV/Ma5ciSixqClnrDvFASadgOWkaLOusm+iPJtrCBvkIApPjW/jAux9JG9uWOdf3yzLnQh1vM +BhBgu4M1t15n3kfsmUjxpKEV/q2MYo45VU85FrmxY53/twIDAQABo0IwQDAPBgNVHRMBAf8EBTAD +AQH/MB0GA1UdDgQWBBS2oVQ5AsOgP46KvPrU+Bym0ToO/TAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZI +hvcNAQENBQADggIBAHGlDs7k6b8/ONWJWsQCYftMxRQXLYtPU2sQF/xlhMcQSZDe28cmk4gmb3DW +Al45oPePq5a1pRNcgRRtDoGCERuKTsZPpd1iHkTfCVn0W3cLN+mLIMb4Ck4uWBzrM9DPhmDJ2vuA +L55MYIR4PSFk1vtBHxgP58l1cb29XN40hz5BsA72udY/CROWFC/emh1auVbONTqwX3BNXuMp8SMo +clm2q8KMZiYcdywmdjWLKKdpoPk79SPdhRB0yZADVpHnr7pH1BKXESLjokmUbOe3lEu6LaTaM4tM +pkT/WjzGHWTYtTHkpjx6qFcL2+1hGsvxznN3Y6SHb0xRONbkX8eftoEq5IVIeVheO/jbAoJnwTnb +w3RLPTYe+SmTiGhbqEQZIfCn6IENLOiTNrQ3ssqwGyZ6miUfmpqAnksqP/ujmv5zMnHCnsZy4Ypo +J/HkD7TETKVhk/iXEAcqMCWpuchxuO9ozC1+9eB+D4Kob7a6bINDd82Kkhehnlt4Fj1F4jNy3eFm +ypnTycUm/Q1oBEauttmbjL4ZvrHG8hnjXALKLNhvSgfZyTXaQHXyxKcZb55CEJh15pWLYLztxRLX +is7VmFxWlgPF7ncGNf/P5O4/E2Hu29othfDNrp2yGAlFw5Khchf8R7agCyzxxN5DaAhqXzvwdmP7 +zAYspsbiDrW5viSP +-----END CERTIFICATE----- + +Hellenic Academic and Research Institutions RootCA 2015 +======================================================= +-----BEGIN CERTIFICATE----- +MIIGCzCCA/OgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBpjELMAkGA1UEBhMCR1IxDzANBgNVBAcT +BkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0 +aW9ucyBDZXJ0LiBBdXRob3JpdHkxQDA+BgNVBAMTN0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNl +YXJjaCBJbnN0aXR1dGlvbnMgUm9vdENBIDIwMTUwHhcNMTUwNzA3MTAxMTIxWhcNNDAwNjMwMTAx +MTIxWjCBpjELMAkGA1UEBhMCR1IxDzANBgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMg +QWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxQDA+BgNV +BAMTN0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgUm9vdENBIDIw +MTUwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDC+Kk/G4n8PDwEXT2QNrCROnk8Zlrv +bTkBSRq0t89/TSNTt5AA4xMqKKYx8ZEA4yjsriFBzh/a/X0SWwGDD7mwX5nh8hKDgE0GPt+sr+eh +iGsxr/CL0BgzuNtFajT0AoAkKAoCFZVedioNmToUW/bLy1O8E00BiDeUJRtCvCLYjqOWXjrZMts+ +6PAQZe104S+nfK8nNLspfZu2zwnI5dMK/IhlZXQK3HMcXM1AsRzUtoSMTFDPaI6oWa7CJ06CojXd +FPQf/7J31Ycvqm59JCfnxssm5uX+Zwdj2EUN3TpZZTlYepKZcj2chF6IIbjV9Cz82XBST3i4vTwr +i5WY9bPRaM8gFH5MXF/ni+X1NYEZN9cRCLdmvtNKzoNXADrDgfgXy5I2XdGj2HUb4Ysn6npIQf1F +GQatJ5lOwXBH3bWfgVMS5bGMSF0xQxfjjM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 +-----END CERTIFICATE----- + +Hellenic Academic and Research Institutions ECC RootCA 2015 +=========================================================== +-----BEGIN CERTIFICATE----- +MIICwzCCAkqgAwIBAgIBADAKBggqhkjOPQQDAjCBqjELMAkGA1UEBhMCR1IxDzANBgNVBAcTBkF0 +aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9u +cyBDZXJ0LiBBdXRob3JpdHkxRDBCBgNVBAMTO0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJj +aCBJbnN0aXR1dGlvbnMgRUNDIFJvb3RDQSAyMDE1MB4XDTE1MDcwNzEwMzcxMloXDTQwMDYzMDEw +MzcxMlowgaoxCzAJBgNVBAYTAkdSMQ8wDQYDVQQHEwZBdGhlbnMxRDBCBgNVBAoTO0hlbGxlbmlj +IEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9yaXR5MUQwQgYD +VQQDEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIEVDQyBSb290 +Q0EgMjAxNTB2MBAGByqGSM49AgEGBSuBBAAiA2IABJKgQehLgoRc4vgxEZmGZE4JJS+dQS8KrjVP +dJWyUWRrjWvmP3CV8AVER6ZyOFB2lQJajq4onvktTpnvLEhvTCUp6NFxW98dwXU3tNf6e3pCnGoK +Vlp8aQuqgAkkbH7BRqNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0O +BBYEFLQiC4KZJAEOnLvkDv2/+5cgk5kqMAoGCCqGSM49BAMCA2cAMGQCMGfOFmI4oqxiRaeplSTA +GiecMjvAwNW6qef4BENThe5SId6d9SWDPp5YSy/XZxMOIQIwBeF1Ad5o7SofTUwJCA3sS61kFyjn +dc5FZXIhF8siQQ6ME5g4mlRtm8rifOoCWCKR +-----END CERTIFICATE----- + +ISRG Root X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91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgH +FzZM9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qwIFAGbHrQ +gLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6VOujw5H5SNz/0egwLX0t +dHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L93FcXmn/6pUCyziKrlA4b9v7LWIbxcce +VOF34GfID5yHI9Y/QCB/IIDEgEw+OyQmjgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB +/zAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3 +DQEBCwUAA4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDIU5PM +CCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUsN+gDS63pYaACbvXy +8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vvo/ufQJVtMVT8QtPHRh8jrdkPSHCa +2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2 +xJNDd2ZhwLnoQdeXeGADbkpyrqXRfboQnoZsG4q5WTP468SQvvG5 +-----END CERTIFICATE----- + +Amazon Root CA 2 +================ +-----BEGIN CERTIFICATE----- +MIIFQTCCAymgAwIBAgITBmyf0pY1hp8KD+WGePhbJruKNzANBgkqhkiG9w0BAQwFADA5MQswCQYD +VQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSAyMB4XDTE1 +MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpv +bjEZMBcGA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nrp+gvU5LE +YFiwzAJRGFuFjWJZY7attN6a+yb3ACfAXVU3dJnJUH/jWS5E4ywl7uxMMne0nxrpS10gxdr9HIcW +xkPo1LsmmkVwXqkLN1PiRnsn/eBG8om3zEK2yygmbtmlyTrIQRNg91CMFa6ybRoVGld45pIq2WWQ +gj9sAq+uEjonljYE1x2igGOpm/HlurR8FLBOybEfdF849lHqm/osohHUqS0nGkWxr7JOcQ3AWEbW +aQbLU8uz/mtBzUF+fUwPfHJ5elnNXkoOrJupmHN5fLT0zLm4BwyydFy4x2+IoZCn9Kr5v2c69BoV +Yh63n749sSmvZ6ES8lgQGVMDMBu4Gon2nL2XA46jCfMdiyHxtN/kHNGfZQIG6lzWE7OE76KlXIx3 +KadowGuuQNKotOrN8I1LOJwZmhsoVLiJkO/KdYE+HvJkJMcYr07/R54H9jVlpNMKVv/1F2Rs76gi +JUmTtt8AF9pYfl3uxRuw0dFfIRDH+fO6AgonB8Xx1sfT4PsJYGw= +-----END CERTIFICATE----- + +Amazon Root CA 3 +================ +-----BEGIN CERTIFICATE----- +MIIBtjCCAVugAwIBAgITBmyf1XSXNmY/Owua2eiedgPySjAKBggqhkjOPQQDAjA5MQswCQYDVQQG +EwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSAzMB4XDTE1MDUy +NjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZ +MBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgMzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABCmXp8ZB +f8ANm+gBG1bG8lKlui2yEujSLtf6ycXYqm0fc4E7O5hrOXwzpcVOho6AF2hiRVd9RFgdszflZwjr +Zt6jQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSrttvXBp43 +rDCGB5Fwx5zEGbF4wDAKBggqhkjOPQQDAgNJADBGAiEA4IWSoxe3jfkrBqWTrBqYaGFy+uGh0Psc +eGCmQ5nFuMQCIQCcAu/xlJyzlvnrxir4tiz+OpAUFteMYyRIHN8wfdVoOw== +-----END CERTIFICATE----- + +Amazon Root CA 4 +================ +-----BEGIN CERTIFICATE----- +MIIB8jCCAXigAwIBAgITBmyf18G7EEwpQ+Vxe3ssyBrBDjAKBggqhkjOPQQDAzA5MQswCQYDVQQG +EwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSA0MB4XDTE1MDUy +NjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZ +MBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgNDB2MBAGByqGSM49AgEGBSuBBAAiA2IABNKrijdPo1MN +/sGKe0uoe0ZLY7Bi9i0b2whxIdIA6GO9mif78DluXeo9pcmBqqNbIJhFXRbb/egQbeOc4OO9X4Ri +83BkM6DLJC9wuoihKqB1+IGuYgbEgds5bimwHvouXKNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV +HQ8BAf8EBAMCAYYwHQYDVR0OBBYEFNPsxzplbszh2naaVvuc84ZtV+WBMAoGCCqGSM49BAMDA2gA +MGUCMDqLIfG9fhGt0O9Yli/W651+kI0rz2ZVwyzjKKlwCkcO8DdZEv8tmZQoTipPNU0zWgIxAOp1 +AE47xDqUEpHJWEadIRNyp4iciuRMStuW1KyLa2tJElMzrdfkviT8tQp21KW8EA== +-----END CERTIFICATE----- + +TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1 +============================================= +-----BEGIN CERTIFICATE----- +MIIEYzCCA0ugAwIBAgIBATANBgkqhkiG9w0BAQsFADCB0jELMAkGA1UEBhMCVFIxGDAWBgNVBAcT +D0dlYnplIC0gS29jYWVsaTFCMEAGA1UEChM5VHVya2l5ZSBCaWxpbXNlbCB2ZSBUZWtub2xvamlr +IEFyYXN0a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He+SMg1qIGf5LgsyX8OsNJLN13qudULXjS99HMpw+0mFZx+CFOKWI3QSyjfwbPfIPP54+M638yc +lNhOT8NrF7f3cuitZjO1JVOr4PhMqZ398g26rrnZqsZr+ZO7rqu4lzwDGrpDxpa5RXI4s6ehlj2R +e37AIVNMh+3yC1SVUZPVIqUNivGTDj5UDrDYyU7c8jEyVupk+eq1nRZmQnLzf9OxMUP8pI4X8W0j +q5Rm+K37DwhuJi1/FwcJsoz7UMCflo3Ptv0AnVoUmr8CRPXBwp8iXqIPoeM= +-----END CERTIFICATE----- + +GDCA TrustAUTH R5 ROOT +====================== +-----BEGIN CERTIFICATE----- +MIIFiDCCA3CgAwIBAgIIfQmX/vBH6nowDQYJKoZIhvcNAQELBQAwYjELMAkGA1UEBhMCQ04xMjAw +BgNVBAoMKUdVQU5HIERPTkcgQ0VSVElGSUNBVEUgQVVUSE9SSVRZIENPLixMVEQuMR8wHQYDVQQD +DBZHRENBIFRydXN0QVVUSCBSNSBST09UMB4XDTE0MTEyNjA1MTMxNVoXDTQwMTIzMTE1NTk1OVow +YjELMAkGA1UEBhMCQ04xMjAwBgNVBAoMKUdVQU5HIERPTkcgQ0VSVElGSUNBVEUgQVVUSE9SSVRZ +IENPLixMVEQuMR8wHQYDVQQDDBZHRENBIFRydXN0QVVUSCBSNSBST09UMIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEA2aMW8Mh0dHeb7zMNOwZ+Vfy1YI92hhJCfVZmPoiC7XJjDp6L3TQs +AlFRwxn9WVSEyfFrs0yw6ehGXTjGoqcuEVe6ghWinI9tsJlKCvLriXBjTnnEt1u9ol2x8kECK62p +OqPseQrsXzrj/e+APK00mxqriCZ7VqKChh/rNYmDf1+uKU49tm7srsHwJ5uu4/Ts765/94Y9cnrr +pftZTqfrlYwiOXnhLQiPzLyRuEH3FMEjqcOtmkVEs7LXLM3GKeJQEK5cy4KOFxg2fZfmiJqwTTQJ +9Cy5WmYqsBebnh52nUpmMUHfP/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rylvLmrH+33RZjEizIYAfmaDDEL0vTSSwxrqT8p+ck0LcIymSLumoRT2+1hEmRSuqguT +aaApJUqlyyvdimYHFngVV3Eb7PVHhPOeMTd61X8kreS8/f3MboPoDKi3QWwH3b08hpcv0g== +-----END CERTIFICATE----- + +TrustCor RootCert CA-1 +====================== +-----BEGIN CERTIFICATE----- +MIIEMDCCAxigAwIBAgIJANqb7HHzA7AZMA0GCSqGSIb3DQEBCwUAMIGkMQswCQYDVQQGEwJQQTEP +MA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5hbWEgQ2l0eTEkMCIGA1UECgwbVHJ1c3RDb3Ig +U3lzdGVtcyBTLiBkZSBSLkwuMScwJQYDVQQLDB5UcnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3Jp +dHkxHzAdBgNVBAMMFlRydXN0Q29yIFJvb3RDZXJ0IENBLTEwHhcNMTYwMjA0MTIzMjE2WhcNMjkx +MjMxMTcyMzE2WjCBpDELMAkGA1UEBhMCUEExDzANBgNVBAgMBlBhbmFtYTEUMBIGA1UEBwwLUGFu +YW1hIENpdHkxJDAiBgNVBAoMG1RydXN0Q29yIFN5c3RlbXMgUy4gZGUgUi5MLjEnMCUGA1UECwwe +VHJ1c3RDb3IgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MR8wHQYDVQQDDBZUcnVzdENvciBSb290Q2Vy +dCBDQS0xMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv463leLCJhJrMxnHQFgKq1mq +jQCj/IDHUHuO1CAmujIS2CNUSSUQIpidRtLByZ5OGy4sDjjzGiVoHKZaBeYei0i/mJZ0PmnK6bV4 +pQa81QBeCQryJ3pS/C3Vseq0iWEk8xoT26nPUu0MJLq5nux+AHT6k61sKZKuUbS701e/s/OojZz0 +JEsq1pme9J7+wH5COucLlVPat2gOkEz7cD+PSiyU8ybdY2mplNgQTsVHCJCZGxdNuWxu72CVEY4h +gLW9oHPY0LJ3xEXqWib7Zn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LSC +jaoITmJF4PkL0uDgPFveXHEnJcLmA4GLEFPjx1WitJ/X5g== +-----END CERTIFICATE----- + +SSL.com Root Certification Authority RSA +======================================== +-----BEGIN CERTIFICATE----- +MIIF3TCCA8WgAwIBAgIIeyyb0xaAMpkwDQYJKoZIhvcNAQELBQAwfDELMAkGA1UEBhMCVVMxDjAM +BgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9TU0wgQ29ycG9yYXRpb24x +MTAvBgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBSU0EwHhcNMTYw +MjEyMTczOTM5WhcNNDEwMjEyMTczOTM5WjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMx +EDAOBgNVBAcMB0hvdXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NM +LmNvbSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFJTQTCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBAPkP3aMrfcvQKv7sZ4Wm5y4bunfh4/WvpOz6Sl2RxFdHaxh3a3by/ZPkPQ/C +Fp4LZsNWlJ4Xg4XOVu/yFv0AYvUiCVToZRdOQbngT0aXqhvIuG5iXmmxX9sqAn78bMrzQdjt0Oj8 +P2FI7bADFB0QDksZ4LtO7IZl/zbzXmcCC52GVWH9ejjt/uIZALdvoVBidXQ8oPrIJZK0bnoix/ge +oeOy3ZExqysdBP+lSgQ36YWkMyv94tZVNHwZpEpox7Ko07fKoZOI68GXvIz5HdkihCR0xwQ9aqkp +k8zruFvh/l8lqjRYyMEjVJ0bmBHDOJx+PYZspQ9AhnwC9FwCTyjLrnGfDzrIM/4RJTXq/LrFYD3Z +fBjVsqnTdXgDciLKOsMf7yzlLqn6niy2UUb9rwPW6mBo6oUWNmuF6R7As93EJNyAKoFBbZQ+yODJ +gUEAnl6/f8UImKIYLE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2wBlX7Jz9TkHCpBB5XJ7k= +-----END CERTIFICATE----- + +SSL.com Root Certification Authority ECC +======================================== +-----BEGIN CERTIFICATE----- +MIICjTCCAhSgAwIBAgIIdebfy8FoW6gwCgYIKoZIzj0EAwIwfDELMAkGA1UEBhMCVVMxDjAMBgNV +BAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9TU0wgQ29ycG9yYXRpb24xMTAv +BgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBFQ0MwHhcNMTYwMjEy +MTgxNDAzWhcNNDEwMjEyMTgxNDAzWjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAO +BgNVBAcMB0hvdXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NMLmNv +bSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzB2MBAGByqGSM49AgEGBSuBBAAiA2IA +BEVuqVDEpiM2nl8ojRfLliJkP9x6jh3MCLOicSS6jkm5BBtHllirLZXI7Z4INcgn64mMU1jrYor+ +8FsPazFSY0E7ic3s7LaNGdM0B9y7xgZ/wkWV7Mt/qCPgCemB+vNH06NjMGEwHQYDVR0OBBYEFILR +hXMw5zUE044CkvvlpNHEIejNMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUgtGFczDnNQTT +jgKS++Wk0cQh6M0wDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA2cAMGQCMG/n61kRpGDPYbCW +e+0F+S8Tkdzt5fxQaxFGRrMcIQBiu77D5+jNB5n5DQtdcj7EqgIwH7y6C+IwJPt8bYBVCpk+gA0z +5Wajs6O7pdWLjwkspl1+4vAHCGht0nxpbl/f5Wpl +-----END CERTIFICATE----- + +SSL.com EV Root Certification Authority RSA R2 +============================================== +-----BEGIN CERTIFICATE----- +MIIF6zCCA9OgAwIBAgIIVrYpz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uUDkiFCbLsjtzdFVHB3mBOagwE0TlBIqulhMlQg+5U8Sb/M3kHN48 ++qvWBkofZ6aYMBzdLNvcGJVXZsb/XItW9XcCAwEAAaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAfBgNV +HSMEGDAWgBT5YLvU49U09rj1BoAlp3PbRmmonjAdBgNVHQ4EFgQU+WC71OPVNPa49QaAJadz20Zp +qJ4wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4ICAQBWs47LCp1Jjr+kxJG7ZhcFUZh1 +++VQLHqe8RT6q9OKPv+RKY9ji9i0qVQBDb6Thi/5Sm3HXvVX+cpVHBK+Rw82xd9qt9t1wkclf7nx +Y/hoLVUE0fKNsKTPvDxeH3jnpaAgcLAExbf3cqfeIg29MyVGjGSSJuM+LmOW2puMPfgYCdcDzH2G +guDKBAdRUNf/ktUM79qGn5nX67evaOI5JpS6aLe/g9Pqemc9YmeuJeVy6OLk7K4S9ksrPJ/psEDz +OFSz/bdoyNrGj1E8svuR3Bznm53htw1yj+KkxKl4+esUrMZDBcJlOSgYAsOCsp0FvmXtll9ldDz7 +CTUue5wT/RsPXcdtgTpWD8w74a8CLyKsRspGPKAcTNZEtF4uXBVmCeEmKf7GUmG6sXP/wwyc5Wxq +lD8UykAWlYTzWamsX0xhk23RO8yilQwipmdnRC652dKKQbNmC1r7fSOl8hqw/96bg5Qu0T/fkreR +rwU7ZcegbLHNYhLDkBvjJc40vG93drEQw/cFGsDWr3RiSBd3kmmQYRzelYB0VI8YHMPzA9C/pEN1 +hlMYegouCRw2n5H9gooiS9EOUCXdywMMF8mDAAhONU2Ki+3wApRmLER/y5UnlhetCTCstnEXbosX +9hwJ1C07mKVx01QT2WDz9UtmT/rx7iASjbSsV7FFY6GsdqnC+w== +-----END CERTIFICATE----- + +SSL.com EV Root Certification Authority ECC +=========================================== +-----BEGIN CERTIFICATE----- +MIIClDCCAhqgAwIBAgIILCmcWxbtBZUwCgYIKoZIzj0EAwIwfzELMAk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ed41mWYqVuoPId8AorRbrcWc+ZfwFSY1XS+wc3iEZGtIxg93eFyRJa0 +lV7Ae46ZeBZDE1ZXs6KzO7V33EByrKPrmzU+sQghoefEQzd5Mr6155wsTLxDKZmOMNOsIeDjHfrY +BzN2VAAiKrlNIC5waNrlU/yDXNOd8v9EDERm8tLjvUYAGm0CuiVdjaExUd1URhxN25mW7xocBFym +Fe944Hn+Xds+qkxV/ZoVqW/hpvvfcDDpw+5CRu3CkwWJ+n1jez/QcYF8AOiYrg54NMMl+68KnyBr +3TsTjxKM4kEaSHpzoHdpx7Zcf4LIHv5YGygrqGytXm3ABdJ7t+uA/iU3/gKbaKxCXcPu9czc8FB1 +0jZpnOZ7BN9uBmm23goJSFmH63sUYHpkqmlD75HHTOwY3WzvUy2MmeFe8nI+z1TIvWfspA9MRf/T +uTAjB0yPEL+GltmZWrSZVxykzLsViVO6LAUP5MSeGbEYNNVMnbrt9x+vJJUEeKgDu+6B5dpffItK +oZB0JaezPkvILFa9x8jvOOJckvB595yEunQtYQEgfn7R8k8HWV+LLUNS60YMlOH1Zkd5d9VUWx+t +JDfLRVpOoERIyNiwmcUVhAn21klJwGW45hpxbqCo8YLoRT5s1gLXCmeDBVrJpBA= +-----END CERTIFICATE----- + +OISTE WISeKey Global Root GC CA +=============================== +-----BEGIN CERTIFICATE----- +MIICaTCCAe+gAwIBAgIQISpWDK7aDKtARb8roi066jAKBggqhkjOPQQDAzBtMQswCQYDVQQGEwJD +SDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEo +MCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQyBDQTAeFw0xNzA1MDkwOTQ4MzRa +Fw00MjA1MDkwOTU4MzNaMG0xCzAJBgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNlS2V5MSIwIAYDVQQL +ExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDV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0dzpqPJeaAcWEr +tXvM+SUWgeExX6GjfhaknBZqlxi9dnKlC54dNuYvoS++cJEPqOba+MSSQGwlfnuzCdyyF62ARPBo +pY+Udf90WuioAnwMCeKpSwughQtiue+hMZL77/ZRBIls6Kl0obsXs7X9SQ98POyDGCBDTtWTurQ0 +sR8WNh8M5mQ5Fkzc4P4dyKliPUDqysU0ArSuiYgzNdwsE3PYJ/HQcu51OyLemGhmW/HGY0dVHLql +CFF1pkgl +-----END CERTIFICATE----- + +GTS Root R2 +=========== +-----BEGIN CERTIFICATE----- +MIIFWjCCA0KgAwIBAgIQbkepxlqz5yDFMJo/aFLybzANBgkqhkiG9w0BAQwFADBHMQswCQYDVQQG +EwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJv +b3QgUjIwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAG +A1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjIwggIi +MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDO3v2m++zsFDQ8BwZabFn3GTXd98GdVarTzTuk +k3LvCvptnfbwhYBboUhSnznFt+4orO/LdmgUud+tAWyZH8QiHZ/+cnfgLFuv5AS/T3KgGjSY6Dlo +7JUle3ah5mm5hRm9iYz+re026nO8/4Piy33B0s5Ks40FnotJk9/BW9BuXvAuMC6C/Pq8tBcKSOWI +m8Wba96wyrQD8Nr0kLhlZPdcTK3ofmZemde4wj7I0BOdre7kRXuJVfeKH2JShBKzwkCX44ofR5Gm +dFrS+LFjKBC4swm4VndAoiaYecb+3yXuPuWgf9RhD1FLPD+M2uFwdNjCaKH5wQzpoeJ/u1U8dgbu +ak7MkogwTZq9TwtImoS1mKPV+3PBV2HdKFZ1E66HjucMUQkQdYhMvI35ezzUIkgfKtzra7tEscsz +cTJGr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cOEArf9LAhST4Ld +o/DUhgkC +-----END CERTIFICATE----- + +GTS Root R3 +=========== +-----BEGIN CERTIFICATE----- +MIICDDCCAZGgAwIBAgIQbkepx2ypcyRAiQ8DVd2NHTAKBggqhkjOPQQDAzBHMQswCQYDVQQGEwJV +UzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3Qg +UjMwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UE +ChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjMwdjAQBgcq +hkjOPQIBBgUrgQQAIgNiAAQfTzOHMymKoYTey8chWEGJ6ladK0uFxh1MJ7x/JlFyb+Kf1qPKzEUU +Rout736GjOyxfi//qXGdGIRFBEFVbivqJn+7kAHjSxm65FSWRQmx1WyRRK2EE46ajA2ADDL24Cej +QjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTB8Sa6oC2uhYHP +0/EqEr24Cmf9vDAKBggqhkjOPQQDAwNpADBmAjEAgFukfCPAlaUs3L6JbyO5o91lAFJekazInXJ0 +glMLfalAvWhgxeG4VDvBNhcl2MG9AjEAnjWSdIUlUfUk7GRSJFClH9voy8l27OyCbvWFGFPouOOa +KaqW04MjyaR7YbPMAuhd +-----END CERTIFICATE----- + +GTS Root R4 +=========== +-----BEGIN CERTIFICATE----- +MIICCjCCAZGgAwIBAgIQbkepyIuUtui7OyrYorLBmTAKBggqhkjOPQQDAzBHMQswCQYDVQQGEwJV +UzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3Qg +UjQwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UE +ChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjQwdjAQBgcq +hkjOPQIBBgUrgQQAIgNiAATzdHOnaItgrkO4NcWBMHtLSZ37wWHO5t5GvWvVYRg1rkDdc/eJkTBa +6zzuhXyiQHY7qca4R9gq55KRanPpsXI5nymfopjTX15YhmUPoYRlBtHci8nHc8iMai/lxKvRHYqj +QjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSATNbrdP9JNqPV +2Py1PsVq8JQdjDAKBggqhkjOPQQDAwNnADBkAjBqUFJ0CMRw3J5QdCHojXohw0+WbhXRIjVhLfoI +N+4Zba3bssx9BzT1YBkstTTZbyACMANxsbqjYAuG7ZoIapVon+Kz4ZNkfF6Tpt95LY2F45TPI11x +zPKwTdb+mciUqXWi4w== +-----END CERTIFICATE----- + +UCA Global G2 Root +================== +-----BEGIN CERTIFICATE----- +MIIFRjCCAy6gAwIBAgIQXd+x2lqj7V2+WmUgZQOQ7zANBgkqhkiG9w0BAQsFADA9MQswCQYDVQQG +EwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxGzAZBgNVBAMMElVDQSBHbG9iYWwgRzIgUm9vdDAeFw0x +NjAzMTEwMDAwMDBaFw00MDEyMzEwMDAwMDBaMD0xCzAJBgNVBAYTAkNOMREwDwYDVQQKDAhVbmlU +cnVzdDEbMBkGA1UEAwwSVUNBIEdsb2JhbCBHMiBSb290MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A +MIICCgKCAgEAxeYrb3zvJgUno4Ek2m/LAfmZmqkywiKHYUGRO8vDaBsGxUypK8FnFyIdK+35KYmT +oni9kmugow2ifsqTs6bRjDXVdfkX9s9FxeV67HeToI8jrg4aA3++1NDtLnurRiNb/yzmVHqUwCoV +8MmNsHo7JOHXaOIxPAYzRrZUEaalLyJUKlgNAQLx+hVRZ2zA+te2G3/RVogvGjqNO7uCEeBHANBS +h6v7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bxqgDMUIYs6Ao9Dz7GjevjPHF1t/gMRMTLGmhIrDO7gJzRSBuhjjVFc2/tsvfEehOjPI+Vg7RE+x +ygKJBJYoaMVLuCaJu9YzL1DV/pqJuhgyklTGW+Cd+V7lDSKb9triyCGyYiGqhkCyLmTTX8jjfhFn +RR8F/uOi77Oos/N9j/gMHyIfLXC0uAE0djAA5SN4p1bXUB+K+wb1whnw0A== +-----END CERTIFICATE----- + +UCA Extended Validation Root +============================ +-----BEGIN CERTIFICATE----- +MIIFWjCCA0KgAwIBAgIQT9Irj/VkyDOeTzRYZiNwYDANBgkqhkiG9w0BAQsFADBHMQswCQYDVQQG +EwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxJTAjBgNVBAMMHFVDQSBFeHRlbmRlZCBWYWxpZGF0aW9u +IFJvb3QwHhcNMTUwMzEzMDAwMDAwWhcNMzgxMjMxMDAwMDAwWjBHMQswCQYDVQQGEwJDTjERMA8G +A1UECgwIVW5pVHJ1c3QxJTAjBgNVBAMMHFVDQSBFeHRlbmRlZCBWYWxpZGF0aW9uIFJvb3QwggIi +MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCpCQcoEwKwmeBkqh5DFnpzsZGgdT6o+uM4AHrs +iWogD4vFsJszA1qGxliG1cGFu0/GnEBNyr7uaZa4rYEwmnySBesFK5pI0Lh2PpbIILvSsPGP2KxF +Rv+qZ2C0d35qHzwaUnoEPQc8hQ2E0B92CvdqFN9y4zR8V05WAT558aopO2z6+I9tTcg1367r3CTu +eUWnhbYFiN6IXSV8l2RnCdm/WhUFhvMJHuxYMjMR83dksHYf5BA1FxvyDrFspCqjc/wJHx4yGVMR +59mzLC52LqGj3n5qiAno8geK+LLNEOfic0CTuwjRP+H8C5SzJe98ptfRr5//lpr1kXuYC3fUfugH +0mK1lTnj8/FtDw5lhIpjVMWAtuCeS31HJqcBCF3RiJ7XwzJE+oJKCmhUfzhTA8ykADNkUVkLo4KR +el7sFsLzKuZi2irbWWIQJUoqgQtH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s/3GkDpv0mztO+7skb6iQ12LAEpmJURw3kAP+HwV96LOPNde +E4yBFxgX0b3xdxA61GU5wSesVywlVP+i2k+KYTlerj1KjL0= +-----END CERTIFICATE----- + +emSign Root CA - G1 +=================== +-----BEGIN CERTIFICATE----- +MIIDlDCCAnygAwIBAgIKMfXkYgxsWO3W2DANBgkqhkiG9w0BAQsFADBnMQswCQYDVQQGEwJJTjET +MBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNobm9sb2dpZXMgTGltaXRl +ZDEcMBoGA1UEAxMTZW1TaWduIFJvb3QgQ0EgLSBHMTAeFw0xODAyMTgxODMwMDBaFw00MzAyMTgx +ODMwMDBaMGcxCzAJBgNVBAYTAklOMRMwEQYDVQQLEwplbVNpZ24gUEtJMSUwIwYDVQQKExxlTXVk +aHJhIFRlY2hub2xvZ2llcyBMaW1pdGVkMRwwGgYDVQQDExNlbVNpZ24gUm9vdCBDQSAtIEcxMIIB +IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAk0u76WaK7p1b1TST0Bsew+eeuGQzf2N4aLTN +LnF115sgxk0pvLZoYIr3IZpWNVrzdr3YzZr/k1ZLpVkGoZM0Kd0WNHVO8oG0x5ZOrRkVUkr+PHB1 +cM2vK6sVmjM8qrOLqs1D/fXqcP/tzxE7lM5OMhbTI0Aqd7OvPAEsbO2ZLIvZTmmYsvePQbAyeGHW +DV/D+qJAkh1cF+ZwPjXnorfCYuKrpDhMtTk1b+oDafo6VGiFbdbyL0NVHpENDtjVaqSW0RM8LHhQ +6DqS0hdW5TUaQBw+jSztOd9C4INBdN+jzcKGYEho42kLVACL5HZpIQ15TjQIXhTCzLG3rdd8cIrH +hQIDAQABo0IwQDAdBgNVHQ4EFgQU++8Nhp6w492pufEhF38+/PB3KxowDgYDVR0PAQH/BAQDAgEG +MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAFn/8oz1h31xPaOfG1vR2vjTnGs2 +vZupYeveFix0PZ7mddrXuqe8QhfnPZHr5X3dPpzxz5KsbEjMwiI/aTvFthUvozXGaCocV685743Q +NcMYDHsAVhzNixl03r4PEuDQqqE/AjSxcM6dGNYIAwlG7mDgfrbESQRRfXBgvKqy/3lyeqYdPV8q ++Mri/Tm3R7nrft8EI6/6nAYH6ftjk4BAtcZsCjEozgyfz7MjNYBBjWzEN3uBL4ChQEKF6dk4jeih +U80Bv2noWgbyRQuQ+q7hv53yrlc8pa6yVvSLZUDp/TGBLPQ5Cdjua6e0ph0VpZj3AYHYhX3zUVxx +iN66zB+Afko= +-----END CERTIFICATE----- + +emSign ECC Root CA - G3 +======================= +-----BEGIN CERTIFICATE----- +MIICTjCCAdOgAwIBAgIKPPYHqWhwDtqLhDAKBggqhkjOPQQDAzBrMQswCQYDVQQGEwJJTjETMBEG +A1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNobm9sb2dpZXMgTGltaXRlZDEg +MB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0gRzMwHhcNMTgwMjE4MTgzMDAwWhcNNDMwMjE4 +MTgzMDAwWjBrMQswCQYDVQQGEwJJTjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11 +ZGhyYSBUZWNobm9sb2dpZXMgTGltaXRlZDEgMB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0g +RzMwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQjpQy4LRL1KPOxst3iAhKAnjlfSU2fySU0WXTsuwYc +58Byr+iuL+FBVIcUqEqy6HyC5ltqtdyzdc6LBtCGI79G1Y4PPwT01xySfvalY8L1X44uT6EYGQIr +MgqCZH0Wk9GjQjBAMB0GA1UdDgQWBBR8XQKEE9TMipuBzhccLikenEhjQjAOBgNVHQ8BAf8EBAMC +AQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNpADBmAjEAvvNhzwIQHWSVB7gYboiFBS+D +CBe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87/kOXSTKZEhVb3xEp +/6tT+LvBeA+snFOvV71ojD1pM/CjoCNjO2RnIkSt1XHLVip4kqNPEjE2NuLe/gDEo2APJ62gsIq1 +NnpSob0n9CAnYuhNlCQT5AoE6TyrLshDCUrGYQTlSTR+08TI9Q/Aqum6VF7zYytPT1DU/rl7mYw9 +wC68AivTxEDkigcxHpvOJpkT+xHqmiIMERnHXhuBUDDIlhJu58tBf5E7oke3VIAb3ADMmpDqw8NQ +BmIMMMAVSKeoWXzhriKi4gp6D/piq1JM4fHfyr6DDUI= +-----END CERTIFICATE----- + +emSign ECC Root CA - C3 +======================= +-----BEGIN CERTIFICATE----- +MIICKzCCAbGgAwIBAgIKe3G2gla4EnycqDAKBggqhkjOPQQDAzBaMQswCQYDVQQGEwJVUzETMBEG +A1UECxMKZW1TaWduIFBLSTEUMBIGA1UEChMLZU11ZGhyYSBJbmMxIDAeBgNVBAMTF2VtU2lnbiBF +Q0MgUm9vdCBDQSAtIEMzMB4XDTE4MDIxODE4MzAwMFoXDTQzMDIxODE4MzAwMFowWjELMAkGA1UE +BhMCVVMxEzARBgNVBAsTCmVtU2lnbiBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMSAwHgYDVQQD +ExdlbVNpZ24gRUNDIFJvb3QgQ0EgLSBDMzB2MBAGByqGSM49AgEGBSuBBAAiA2IABP2lYa57JhAd +6bciMK4G9IGzsUJxlTm801Ljr6/58pc1kjZGDoeVjbk5Wum739D+yAdBPLtVb4OjavtisIGJAnB9 +SMVK4+kiVCJNk7tCDK93nCOmfddhEc5lx/h//vXyqaNCMEAwHQYDVR0OBBYEFPtaSNCAIEDyqOkA +B2kZd6fmw/TPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MAoGCCqGSM49BAMDA2gA +MGUCMQC02C8Cif22TGK6Q04ThHK1rt0c3ta13FaPWEBaLd4gTCKDypOofu4SQMfWh0/434UCMBwU +ZOR8loMRnLDRWmFLpg9J0wD8ofzkpf9/rdcw0Md3f76BB1UwUCAU9Vc4CqgxUQ== +-----END CERTIFICATE----- + +Hongkong Post Root CA 3 +======================= +-----BEGIN CERTIFICATE----- +MIIFzzCCA7egAwIBAgIUCBZfikyl7ADJk0DfxMauI7gcWqQwDQYJKoZIhvcNAQELBQAwbzELMAkG +A1UEBhMCSEsxEjAQBgNVBAgTCUhvbmcgS29uZzESMBAGA1UEBxMJSG9uZyBLb25nMRYwFAYDVQQK +Ew1Ib25na29uZyBQb3N0MSAwHgYDVQQDExdIb25na29uZyBQb3N0IFJvb3QgQ0EgMzAeFw0xNzA2 +MDMwMjI5NDZaFw00MjA2MDMwMjI5NDZaMG8xCzAJBgNVBAYTAkhLMRIwEAYDVQQIEwlIb25nIEtv +bmcxEjAQBgNVBAcTCUhvbmcgS29uZzEWMBQGA1UEChMNSG9uZ2tvbmcgUG9zdDEgMB4GA1UEAxMX +SG9uZ2tvbmcgUG9zdCBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCz +iNfqzg8gTr7m1gNt7ln8wlffKWihgw4+aMdoWJwcYEuJQwy51BWy7sFOdem1p+/l6TWZ5Mwc50tf +jTMwIDNT2aa71T4Tjukfh0mtUC1Qyhi+AViiE3CWu4mIVoBc+L0sPOFMV4i707mV78vH9toxdCim +5lSJ9UExyuUmGs2C4HDaOym71QP1mbpV9WTRYA6ziUm4ii8F0oRFKHyPaFASePwLtVPLwpgchKOe +sL4jpNrcyCse2m5FHomY2vkALgbpDDtw1VAliJnLzXNg99X/NWfFobxeq81KuEXryGgeDQ0URhLj +0mRiikKYvLTGCAj4/ahMZJx2Ab0vqWwzD9g/KLg8aQFChn5pwckGyuV6RmXpwtZQQS4/t+TtbNe/ +JgERohYpSms0BpDsE9K2+2p20jzt8NYt3eEV7KObLyzJPivkaTv/ciWxNoZbx39ri1UbSsUgYT2u +y1DhCDq+sI9jQVMwCFk8mB13umOResoQUGC/8Ne8lYePl8X+l2oBlKN8W4UdKjk60FSh0Tlxnf0h ++bV78OLgAo9uliQlLKAeLKjEiafv7ZkGL7YKTE/bosw3Gq9HhS2KX8Q0NEwA/RiTZxPRN+ZItIsG +xVd7GYYKecsAyVKvQv83j+GjHno9UKtjBucVtT+2RTeUN7F+8kjDf8V1/peNRY8apxpyKBpADwID +AQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBQXnc0e +i9Y5K3DTXNSguB+wAPzFYTAdBgNVHQ4EFgQUF53NHovWOStw01zUoLgfsAD8xWEwDQYJKoZIhvcN +AQELBQADggIBAFbVe27mIgHSQpsY1Q7XZiNc4/6gx5LS6ZStS6LG7BJ8dNVI0lkUmcDrudHr9Egw +W62nV3OZqdPlt9EuWSRY3GguLmLYauRwCy0gUCCkMpXRAJi70/33MvJJrsZ64Ee+bs7Lo3I6LWld +y8joRTnU+kLBEUx3XZL7av9YROXrgZ6voJmtvqkBZss4HTzfQx/0TW60uhdG/H39h4F5ag0zD/ov ++BS5gLNdTaqX4fnkGMX41TiMJjz98iji7lpJiCzfeT2OnpA8vUFKOt1b9pq0zj8lMH8yfaIDlNDc +eqFS3m6TjRgm/VWsvY+b0s+v54Ysyx8Jb6NvqYTUc79NoXQbTiNg8swOqn+knEwlqLJmOzj/2ZQw +9nKEvmhVEA/GcywWaZMH/rFF7buiVWqw2rVKAiUnhde3t4ZEFolsgCs+l6mc1X5VTMbeRRAc6uk7 +nwNT7u56AQIWeNTowr5GdogTPyK7SBIdUgC0An4hGh6cJfTzPV4e0hz5sy229zdcxsshTrD3mUcY +hcErulWuBurQB7Lcq9CClnXO0lD+mefPL5/ndtFhKvshuzHQqp9HpLIiyhY6UFfEW0NnxWViA0kB +60PZ2Pierc+xYw5F9KBaLJstxabArahH9CdMOA0uG0k7UvToiIMrVCjU8jVStDKDYmlkDJGcn5fq +dBb9HxEGmpv0 +-----END CERTIFICATE----- + +Entrust Root Certification Authority - G4 +========================================= +-----BEGIN CERTIFICATE-----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PpVkAh7DE9ZapD8j3fcEThuk0mEDuYn/PIjhs4ViFqUZPT +kcpG2om3PVODLAgfi49T3f+sHw== +-----END CERTIFICATE----- + +Microsoft ECC Root Certificate Authority 2017 +============================================= +-----BEGIN CERTIFICATE----- +MIICWTCCAd+gAwIBAgIQZvI9r4fei7FK6gxXMQHC7DAKBggqhkjOPQQDAzBlMQswCQYDVQQGEwJV +UzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTYwNAYDVQQDEy1NaWNyb3NvZnQgRUND +IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTcwHhcNMTkxMjE4MjMwNjQ1WhcNNDIwNzE4 +MjMxNjA0WjBlMQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTYw +NAYDVQQDEy1NaWNyb3NvZnQgRUNDIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTcwdjAQ +BgcqhkjOPQIBBgUrgQQAIgNiAATUvD0CQnVBEyPNgASGAlEvaqiBYgtlzPbKnR5vSmZRogPZnZH6 +thaxjG7efM3beaYvzrvOcS/lpaso7GMEZpn4+vKTEAXhgShC48Zo9OYbhGBKia/teQ87zvH2RPUB +eMCjVDBSMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTIy5lycFIM ++Oa+sgRXKSrPQhDtNTAQBgkrBgEEAYI3FQEEAwIBADAKBggqhkjOPQQDAwNoADBlAjBY8k3qDPlf +Xu5gKcs68tvWMoQZP3zVL8KxzJOuULsJMsbG7X7JNpQS5GiFBqIb0C8CMQCZ6Ra0DvpWSNSkMBaR +eNtUjGUBiudQZsIxtzm6uBoiB078a1QWIP8rtedMDE2mT3M= +-----END CERTIFICATE----- + +Microsoft RSA Root Certificate Authority 2017 +============================================= +-----BEGIN CERTIFICATE----- +MIIFqDCCA5CgAwIBAgIQHtOXCV/YtLNHcB6qv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+avNJVgyeY+QW5g5xAgGwax/Dj0ApQIDAQABo1QwUjAOBgNVHQ8BAf8EBAMCAYYw +DwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUCctZf4aycI8awznjwNnpv7tNsiMwEAYJKwYBBAGC +NxUBBAMCAQAwDQYJKoZIhvcNAQEMBQADggIBAKyvPl3CEZaJjqPnktaXFbgToqZCLgLNFgVZJ8og +6Lq46BrsTaiXVq5lQ7GPAJtSzVXNUzltYkyLDVt8LkS/gxCP81OCgMNPOsduET/m4xaRhPtthH80 +dK2Jp86519efhGSSvpWhrQlTM93uCupKUY5vVau6tZRGrox/2KJQJWVggEbbMwSubLWYdFQl3JPk ++ONVFT24bcMKpBLBaYVu32TxU5nhSnUgnZUP5NbcA/FZGOhHibJXWpS2qdgXKxdJ5XbLwVaZOjex +/2kskZGT4d9Mozd2TaGf+G0eHdP67Pv0RR0Tbc/3WeUiJ3IrhvNXuzDtJE3cfVa7o7P4NHmJweDy +AmH3pvwPuxwXC65B2Xy9J6P9LjrRk5Sxcx0ki69bIImtt2dmefU6xqaWM/5TkshGsRGRxpl/j8nW +ZjEgQRCHLQzWwa80mMpkg/sTV9HB8Dx6jKXB/ZUhoHHBk2dxEuqPiAppGWSZI1b7rCoucL5mxAyE +7+WL85MB+GqQk2dLsmijtWKP6T+MejteD+eMuMZ87zf9dOLITzNy4ZQ5bb0Sr74MTnB8G2+NszKT +c0QWbej09+CVgI+WXTik9KveCjCHk9hNAHFiRSdLOkKEW39lt2c0Ui2cFmuqqNh7o0JMcccMyj6D +5KbvtwEwXlGjefVwaaZBRA+GsCyRxj3qrg+E +-----END CERTIFICATE----- + +e-Szigno Root CA 2017 +===================== +-----BEGIN CERTIFICATE----- +MIICQDCCAeWgAwIBAgIMAVRI7yH9l1kN9QQKMAoGCCqGSM49BAMCMHExCzAJBgNVBAYTAkhVMREw +DwYDVQQHDAhCdWRhcGVzdDEWMBQGA1UECgwNTWljcm9zZWMgTHRkLjEXMBUGA1UEYQwOVkFUSFUt +MjM1ODQ0OTcxHjAcBgNVBAMMFWUtU3ppZ25vIFJvb3QgQ0EgMjAxNzAeFw0xNzA4MjIxMjA3MDZa +Fw00MjA4MjIxMjA3MDZaMHExCzAJBgNVBAYTAkhVMREwDwYDVQQHDAhCdWRhcGVzdDEWMBQGA1UE +CgwNTWljcm9zZWMgTHRkLjEXMBUGA1UEYQwOVkFUSFUtMjM1ODQ0OTcxHjAcBgNVBAMMFWUtU3pp +Z25vIFJvb3QgQ0EgMjAxNzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABJbcPYrYsHtvxie+RJCx +s1YVe45DJH0ahFnuY2iyxl6H0BVIHqiQrb1TotreOpCmYF9oMrWGQd+HWyx7xf58etqjYzBhMA8G +A1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSHERUI0arBeAyxr87GyZDv +vzAEwDAfBgNVHSMEGDAWgBSHERUI0arBeAyxr87GyZDvvzAEwDAKBggqhkjOPQQDAgNJADBGAiEA +tVfd14pVCzbhhkT61NlojbjcI4qKDdQvfepz7L9NbKgCIQDLpbQS+ue16M9+k/zzNY9vTlp8tLxO +svxyqltZ+efcMQ== +-----END CERTIFICATE----- + +certSIGN Root CA G2 +=================== +-----BEGIN CERTIFICATE----- +MIIFRzCCAy+gAwIBAgIJEQA0tk7GNi02MA0GCSqGSIb3DQEBCwUAMEExCzAJBgNVBAYTAlJPMRQw +EgYDVQQKEwtDRVJUU0lHTiBTQTEcMBoGA1UECxMTY2VydFNJR04gUk9PVCBDQSBHMjAeFw0xNzAy +MDYwOTI3MzVaFw00MjAyMDYwOTI3MzVaMEExCzAJBgNVBAYTAlJPMRQwEgYDVQQKEwtDRVJUU0lH +TiBTQTEcMBoGA1UECxMTY2VydFNJR04gUk9PVCBDQSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAMDFdRmRfUR0dIf+DjuW3NgBFszuY5HnC2/OOwppGnzC46+Cjob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mf9nGvnAvRCjj5 +BiKDUyUM/FHE5r7iOZULJK2v0ZXkltd0ZGtxTgI8qoXzIKNDOXZbbFD+mpwUHmUUihW9o4JFWklW +atKcsWMy5WHgUyIOpwpJ6st+H6jiYoD2EEVSmAYY3qXNL3+q1Ok+CHLsIwMCPKaq2LxndD0UF/tU +Sxfj03k9bWtJySgOLnRQvwzZRjoQhsmnP+mg7H/rpXdYaXHmgwo38oZJar55CJD2AhZkPuXaTH4M +NMn5X7azKFGnpyuqSfqNZSlO42sTp5SjLVFteAxEy9/eCG/Oo2Sr05WE1LlSVHJ7liXMvGnjSG4N +0MedJ5qq+BOS3R7fY581qRY27Iy4g/Q9iY/NtBde17MXQRBdJ3NghVdJIgc= +-----END CERTIFICATE----- + +Trustwave Global Certification Authority +======================================== +-----BEGIN CERTIFICATE----- +MIIF2jCCA8KgAwIBAgIMBfcOhtpJ80Y1LrqyMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJV +UzERMA8GA1UECAwISWxsaW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xITAfBgNVBAoMGFRydXN0d2F2 +ZSBIb2xkaW5ncywgSW5jLjExMC8GA1UEAwwoVHJ1c3R3YXZlIEdsb2JhbCBDZXJ0aWZpY2F0aW9u +IEF1dGhvcml0eTAeFw0xNzA4MjMxOTM0MTJaFw00MjA4MjMxOTM0MTJaMIGIMQswCQYDVQQGEwJV +UzERMA8GA1UECAwISWxsaW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xITAfBgNVBAoMGFRydXN0d2F2 +ZSBIb2xkaW5ncywgSW5jLjExMC8GA1UEAwwoVHJ1c3R3YXZlIEdsb2JhbCBDZXJ0aWZpY2F0aW9u +IEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALldUShLPDeS0YLOvR29 +zd24q88KPuFd5dyqCblXAj7mY2Hf8g+CY66j96xz0XznswuvCAAJWX/NKSqIk4cXGIDtiLK0thAf +LdZfVaIT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0faZmZ26NraAL4hHT4a/RDqA5Dccprrql5gR0IRiR2Qequ5AvzSxnI9O4fKSTx+O +856X3vOmeWqJcU9LJxdI/uz0UA9PSX3MReO9ekDFQdxhVicGaeVyQYHTtgGJoC86cnn+OjC/QezH +Yj6RS8fZMXZC+fc8Y+wmjHMMfRod6qh8h6jCJ3zhM0EPz8/8AKAigJ5Kp28AsEFFtyLKaEjFQqKu +3R3y4G5OBVixwJAWKqQ9EEC+j2Jjg6mcgn0tAumDMHzLJ8n9HmYAsC7TIS+OMxZsmO0QqAfWzJPP +29FpHOTKyeC2nOnOcXHebD8WpHk= +-----END CERTIFICATE----- + +Trustwave Global ECC P256 Certification Authority +================================================= +-----BEGIN CERTIFICATE----- +MIICYDCCAgegAwIBAgIMDWpfCD8oXD5Rld9dMAoGCCqGSM49BAMCMIGRMQswCQYDVQQGEwJVUzER +MA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRydXN0d2F2ZSBI +b2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBFQ0MgUDI1NiBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eTAeFw0xNzA4MjMxOTM1MTBaFw00MjA4MjMxOTM1MTBaMIGRMQswCQYD +VQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRy +dXN0d2F2ZSBIb2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBFQ0MgUDI1 +NiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABH77bOYj +43MyCMpg5lOcunSNGLB4kFKA3TjASh3RqMyTpJcGOMoNFWLGjgEqZZ2q3zSRLoHB5DOSMcT9CTqm +P62jQzBBMA8GA1UdEwEB/wQFMAMBAf8wDwYDVR0PAQH/BAUDAwcGADAdBgNVHQ4EFgQUo0EGrJBt +0UrrdaVKEJmzsaGLSvcwCgYIKoZIzj0EAwIDRwAwRAIgB+ZU2g6gWrKuEZ+Hxbb/ad4lvvigtwjz +RM4q3wghDDcCIC0mA6AFvWvR9lz4ZcyGbbOcNEhjhAnFjXca4syc4XR7 +-----END CERTIFICATE----- + +Trustwave Global ECC P384 Certification Authority +================================================= +-----BEGIN CERTIFICATE----- +MIICnTCCAiSgAwIBAgIMCL2Fl2yZJ6SAaEc7MAoGCCqGSM49BAMDMIGRMQswCQYDVQQGEwJVUzER +MA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRydXN0d2F2ZSBI +b2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBFQ0MgUDM4NCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eTAeFw0xNzA4MjMxOTM2NDNaFw00MjA4MjMxOTM2NDNaMIGRMQswCQYD +VQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRy +dXN0d2F2ZSBIb2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBFQ0MgUDM4 +NCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTB2MBAGByqGSM49AgEGBSuBBAAiA2IABGvaDXU1CDFH +Ba5FmVXxERMuSvgQMSOjfoPTfygIOiYaOs+Xgh+AtycJj9GOMMQKmw6sWASr9zZ9lCOkmwqKi6vr +/TklZvFe/oyujUF5nQlgziip04pt89ZF1PKYhDhloKNDMEEwDwYDVR0TAQH/BAUwAwEB/zAPBgNV +HQ8BAf8EBQMDBwYAMB0GA1UdDgQWBBRVqYSJ0sEyvRjLbKYHTsjnnb6CkDAKBggqhkjOPQQDAwNn +ADBkAjA3AZKXRRJ+oPM+rRk6ct30UJMDEr5E0k9BpIycnR+j9sKS50gU/k6bpZFXrsY3crsCMGcl +CrEMXu6pY5Jv5ZAL/mYiykf9ijH3g/56vxC+GCsej/YpHpRZ744hN8tRmKVuSw== +-----END CERTIFICATE----- + +NAVER Global Root Certification Authority +========================================= +-----BEGIN CERTIFICATE----- +MIIFojCCA4qgAwIBAgIUAZQwHqIL3fXFMyqxQ0Rx+NZQTQ0wDQYJKoZIhvcNAQEMBQAwaTELMAkG +A1UEBhMCS1IxJjAkBgNVBAoMHU5BVkVSIEJVU0lORVNTIFBMQVRGT1JNIENvcnAuMTIwMAYDVQQD +DClOQVZFUiBHbG9iYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xNzA4MTgwODU4 +NDJaFw0zNzA4MTgyMzU5NTlaMGkxCzAJBgNVBAYTAktSMSYwJAYDVQQKDB1OQVZFUiBCVVNJTkVT +UyBQTEFURk9STSBDb3JwLjEyMDAGA1UEAwwpTkFWRVIgR2xvYmFsIFJvb3QgQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC21PGTXLVAiQqrDZBb +UGOukJR0F0Vy1ntlWilLp1agS7gvQnXp2XskWjFlqxcX0TM62RHcQDaH38dq6SZeWYp34+hInDEW ++j6RscrJo+KfziFTowI2MMtSAuXaMl3Dxeb57hHHi8lEHoSTGEq0n+USZGnQJoViAbbJAh2+g1G7 +XNr4rRVqmfeSVPc0W+m/6imBEtRTkZazkVrd/pBzKPswRrXKCAfHcXLJZtM0l/aM9BhK4dA9WkW2 +aacp+yPOiNgSnABIqKYPszuSjXEOdMWLyEz59JuOuDxp7W87UC9Y7cSw0BwbagzivESq2M0UXZR4 +Yb8ObtoqvC8MC3GmsxY/nOb5zJ9TNeIDoKAYv7vxvvTWjIcNQvcGufFt7QSUqP620wbGQGHfnZ3z +VHbOUzoBppJB7ASjjw2i1QnK1sua8e9DXcCrpUHPXFNwcMmIpi3Ua2FzUCaGYQ5fG8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EGUROS +=================================== +-----BEGIN CERTIFICATE----- +MIICbjCCAfOgAwIBAgIQYvYybOXE42hcG2LdnC6dlTAKBggqhkjOPQQDAzB4MQswCQYDVQQGEwJF +UzERMA8GA1UECgwIRk5NVC1SQ00xDjAMBgNVBAsMBUNlcmVzMRgwFgYDVQRhDA9WQVRFUy1RMjgy +NjAwNEoxLDAqBgNVBAMMI0FDIFJBSVogRk5NVC1SQ00gU0VSVklET1JFUyBTRUdVUk9TMB4XDTE4 +MTIyMDA5MzczM1oXDTQzMTIyMDA5MzczM1oweDELMAkGA1UEBhMCRVMxETAPBgNVBAoMCEZOTVQt +UkNNMQ4wDAYDVQQLDAVDZXJlczEYMBYGA1UEYQwPVkFURVMtUTI4MjYwMDRKMSwwKgYDVQQDDCNB +QyBSQUlaIEZOTVQtUkNNIFNFUlZJRE9SRVMgU0VHVVJPUzB2MBAGByqGSM49AgEGBSuBBAAiA2IA +BPa6V1PIyqvfNkpSIeSX0oNnnvBlUdBeh8dHsVnyV0ebAAKTRBdp20LHsbI6GA60XYyzZl2hNPk2 +LEnb80b8s0RpRBNm/dfF/a82Tc4DTQdxz69qBdKiQ1oKUm8BA06Oi6NCMEAwDwYDVR0TAQH/BAUw +AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFAG5L++/EYZg8k/QQW6rcx/n0m5JMAoGCCqG +SM49BAMDA2kAMGYCMQCuSuMrQMN0EfKVrRYj3k4MGuZdpSRea0R7/DjiT8ucRRcRTBQnJlU5dUoD +zBOQn5ICMQD6SmxgiHPz7riYYqnOK8LZiqZwMR2vsJRM60/G49HzYqc8/5MuB1xJAWdpEgJyv+c= +-----END CERTIFICATE----- + +GlobalSign Root R46 +=================== +-----BEGIN CERTIFICATE----- +MIIFWjCCA0KgAwIBAgISEdK7udcjGJ5AXwqdLdDfJWfRMA0GCSqGSIb3DQEBDAUAMEYxCzAJBgNV +BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRwwGg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ScDrHPt+ieUnd1NPqlRqetMhkytAepJ8qUuwzSChDH2omwlwxwEwkB +jtjqR+q+soArzfwoDdusvKSGN+1wCAB16pMLey5SnCNoIwZD7JIvU4Tb+0cUB+hflGddyXqBPCCj +QjBAMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBQxCpCPtsad0kRL +gLWi5h+xEk8blTAKBggqhkjOPQQDAwNoADBlAjEA31SQ7Zvvi5QCkxeCmb6zniz2C5GMn0oUsfZk +vLtoURMMA/cVi4RguYv/Uo7njLwcAjA8+RHUjE7AwWHCFUyqqx0LMV87HOIAl0Qx5v5zli/altP+ +CAezNIm8BZ/3Hobui3A= +-----END CERTIFICATE----- diff --git a/vendor/composer/ca-bundle/src/CaBundle.php b/vendor/composer/ca-bundle/src/CaBundle.php new file mode 100644 index 0000000..0109ba0 --- /dev/null +++ b/vendor/composer/ca-bundle/src/CaBundle.php @@ -0,0 +1,353 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Composer\CaBundle; + +use Psr\Log\LoggerInterface; +use Symfony\Component\Process\PhpProcess; + +/** + * @author Chris Smith + * @author Jordi Boggiano + */ +class CaBundle +{ + /** @var string|null */ + private static $caPath; + /** @var array */ + private static $caFileValidity = array(); + /** @var bool|null */ + private static $useOpensslParse; + + /** + * Returns the system CA bundle path, or a path to the bundled one + * + * This method was adapted from Sslurp. + * https://github.com/EvanDotPro/Sslurp + * + * (c) Evan Coury + * + * For the full copyright and license information, please see below: + * + * Copyright (c) 2013, Evan Coury + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @param LoggerInterface $logger optional logger for information about which CA files were loaded + * @return string path to a CA bundle file or directory + */ + public static function getSystemCaRootBundlePath(LoggerInterface $logger = null) + { + if (self::$caPath !== null) { + return self::$caPath; + } + $caBundlePaths = array(); + + // If SSL_CERT_FILE env variable points to a valid certificate/bundle, use that. + // This mimics how OpenSSL uses the SSL_CERT_FILE env variable. + $caBundlePaths[] = self::getEnvVariable('SSL_CERT_FILE'); + + // If SSL_CERT_DIR env variable points to a valid certificate/bundle, use that. + // This mimics how OpenSSL uses the SSL_CERT_FILE env variable. + $caBundlePaths[] = self::getEnvVariable('SSL_CERT_DIR'); + + $caBundlePaths[] = ini_get('openssl.cafile'); + $caBundlePaths[] = ini_get('openssl.capath'); + + $otherLocations = array( + '/etc/pki/tls/certs/ca-bundle.crt', // Fedora, RHEL, CentOS (ca-certificates package) + '/etc/ssl/certs/ca-certificates.crt', // Debian, Ubuntu, Gentoo, Arch Linux (ca-certificates package) + '/etc/ssl/ca-bundle.pem', // SUSE, openSUSE (ca-certificates package) + '/usr/local/share/certs/ca-root-nss.crt', // FreeBSD (ca_root_nss_package) + '/usr/ssl/certs/ca-bundle.crt', // Cygwin + '/opt/local/share/curl/curl-ca-bundle.crt', // OS X macports, curl-ca-bundle package + '/usr/local/share/curl/curl-ca-bundle.crt', // Default cURL CA bunde path (without --with-ca-bundle option) + '/usr/share/ssl/certs/ca-bundle.crt', // Really old RedHat? + '/etc/ssl/cert.pem', // OpenBSD + '/usr/local/etc/ssl/cert.pem', // FreeBSD 10.x + '/usr/local/etc/openssl/cert.pem', // OS X homebrew, openssl package + '/usr/local/etc/openssl@1.1/cert.pem', // OS X homebrew, openssl@1.1 package + ); + + foreach($otherLocations as $location) { + $otherLocations[] = dirname($location); + } + + $caBundlePaths = array_merge($caBundlePaths, $otherLocations); + + foreach ($caBundlePaths as $caBundle) { + if ($caBundle && self::caFileUsable($caBundle, $logger)) { + return self::$caPath = $caBundle; + } + + if ($caBundle && self::caDirUsable($caBundle)) { + return self::$caPath = $caBundle; + } + } + + return self::$caPath = static::getBundledCaBundlePath(); // Bundled CA file, last resort + } + + /** + * Returns the path to the bundled CA file + * + * In case you don't want to trust the user or the system, you can use this directly + * + * @return string path to a CA bundle file + */ + public static function getBundledCaBundlePath() + { + $caBundleFile = __DIR__.'/../res/cacert.pem'; + + // cURL does not understand 'phar://' paths + // see https://github.com/composer/ca-bundle/issues/10 + if (0 === strpos($caBundleFile, 'phar://')) { + $tempCaBundleFile = tempnam(sys_get_temp_dir(), 'openssl-ca-bundle-'); + if (false === $tempCaBundleFile) { + throw new \RuntimeException('Could not create a temporary file to store the bundled CA file'); + } + + file_put_contents( + $tempCaBundleFile, + file_get_contents($caBundleFile) + ); + + register_shutdown_function(function() use ($tempCaBundleFile) { + @unlink($tempCaBundleFile); + }); + + $caBundleFile = $tempCaBundleFile; + } + + return $caBundleFile; + } + + /** + * Validates a CA file using opensl_x509_parse only if it is safe to use + * + * @param string $filename + * @param LoggerInterface $logger optional logger for information about which CA files were loaded + * + * @return bool + */ + public static function validateCaFile($filename, LoggerInterface $logger = null) + { + static $warned = false; + + if (isset(self::$caFileValidity[$filename])) { + return self::$caFileValidity[$filename]; + } + + $contents = file_get_contents($filename); + + // assume the CA is valid if php is vulnerable to + // https://www.sektioneins.de/advisories/advisory-012013-php-openssl_x509_parse-memory-corruption-vulnerability.html + if (!static::isOpensslParseSafe()) { + if (!$warned && $logger) { + $logger->warning(sprintf( + 'Your version of PHP, %s, is affected by CVE-2013-6420 and cannot safely perform certificate validation, we strongly suggest you upgrade.', + PHP_VERSION + )); + $warned = true; + } + + $isValid = !empty($contents); + } elseif (is_string($contents) && strlen($contents) > 0) { + $contents = preg_replace("/^(\\-+(?:BEGIN|END))\\s+TRUSTED\\s+(CERTIFICATE\\-+)\$/m", '$1 $2', $contents); + if (null === $contents) { + // regex extraction failed + $isValid = false; + } else { + $isValid = (bool) openssl_x509_parse($contents); + } + } else { + $isValid = false; + } + + if ($logger) { + $logger->debug('Checked CA file '.realpath($filename).': '.($isValid ? 'valid' : 'invalid')); + } + + return self::$caFileValidity[$filename] = $isValid; + } + + /** + * Test if it is safe to use the PHP function openssl_x509_parse(). + * + * This checks if OpenSSL extensions is vulnerable to remote code execution + * via the exploit documented as CVE-2013-6420. + * + * @return bool + */ + public static function isOpensslParseSafe() + { + if (null !== self::$useOpensslParse) { + return self::$useOpensslParse; + } + + if (PHP_VERSION_ID >= 50600) { + return self::$useOpensslParse = true; + } + + // Vulnerable: + // PHP 5.3.0 - PHP 5.3.27 + // PHP 5.4.0 - PHP 5.4.22 + // PHP 5.5.0 - PHP 5.5.6 + if ( + (PHP_VERSION_ID < 50400 && PHP_VERSION_ID >= 50328) + || (PHP_VERSION_ID < 50500 && PHP_VERSION_ID >= 50423) + || PHP_VERSION_ID >= 50507 + ) { + // This version of PHP has the fix for CVE-2013-6420 applied. + return self::$useOpensslParse = true; + } + + if (defined('PHP_WINDOWS_VERSION_BUILD')) { + // Windows is probably insecure in this case. + return self::$useOpensslParse = false; + } + + $compareDistroVersionPrefix = function ($prefix, $fixedVersion) { + $regex = '{^'.preg_quote($prefix).'([0-9]+)$}'; + + if (preg_match($regex, PHP_VERSION, $m)) { + return ((int) $m[1]) >= $fixedVersion; + } + + return false; + }; + + // Hard coded list of PHP distributions with the fix backported. + if ( + $compareDistroVersionPrefix('5.3.3-7+squeeze', 18) // Debian 6 (Squeeze) + || $compareDistroVersionPrefix('5.4.4-14+deb7u', 7) // Debian 7 (Wheezy) + || $compareDistroVersionPrefix('5.3.10-1ubuntu3.', 9) // Ubuntu 12.04 (Precise) + ) { + return self::$useOpensslParse = true; + } + + // Symfony Process component is missing so we assume it is unsafe at this point + if (!class_exists('Symfony\Component\Process\PhpProcess')) { + return self::$useOpensslParse = false; + } + + // This is where things get crazy, because distros backport security + // fixes the chances are on NIX systems the fix has been applied but + // it's not possible to verify that from the PHP version. + // + // To verify exec a new PHP process and run the issue testcase with + // known safe input that replicates the bug. + + // Based on testcase in https://github.com/php/php-src/commit/c1224573c773b6845e83505f717fbf820fc18415 + // changes in https://github.com/php/php-src/commit/76a7fd893b7d6101300cc656058704a73254d593 + $cert = 'LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVwRENDQTR5Z0F3SUJBZ0lKQUp6dThyNnU2ZUJjTUEwR0NTcUdTSWIzRFFFQkJRVUFNSUhETVFzd0NRWUQKVlFRR0V3SkVSVEVjTUJvR0ExVUVDQXdUVG05eVpISm9aV2x1TFZkbGMzUm1ZV3hsYmpFUU1BNEdBMVVFQnd3SApTOE9Ed3Jac2JqRVVNQklHQTFVRUNnd0xVMlZyZEdsdmJrVnBibk14SHpBZEJnTlZCQXNNRmsxaGJHbGphVzkxCmN5QkRaWEowSUZObFkzUnBiMjR4SVRBZkJnTlZCQU1NR0cxaGJHbGphVzkxY3k1elpXdDBhVzl1WldsdWN5NWsKWlRFcU1DZ0dDU3FHU0liM0RRRUpBUlliYzNSbFptRnVMbVZ6YzJWeVFITmxhM1JwYjI1bGFXNXpMbVJsTUhVWQp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Q5RGJHdkhUY3lPdU4rblpMUEJtM3ZXeG50eUlJdlZBZ01CQUFHalFqQkFNQWtHQTFVZEV3UUNNQUF3CkVRWUpZSVpJQVliNFFnRUJCQVFEQWdlQU1Bc0dBMVVkRHdRRUF3SUZvREFUQmdOVkhTVUVEREFLQmdnckJnRUYKQlFjREFqQU5CZ2txaGtpRzl3MEJBUVVGQUFPQ0FRRUFHMGZaWVlDVGJkajFYWWMrMVNub2FQUit2SThDOENhRAo4KzBVWWhkbnlVNGdnYTBCQWNEclk5ZTk0ZUVBdTZacXljRjZGakxxWFhkQWJvcHBXb2NyNlQ2R0QxeDMzQ2tsClZBcnpHL0t4UW9oR0QySmVxa2hJTWxEb214SE83a2EzOStPYThpMnZXTFZ5alU4QVp2V01BcnVIYTRFRU55RzcKbFcyQWFnYUZLRkNyOVRuWFRmcmR4R1ZFYnY3S1ZRNmJkaGc1cDVTanBXSDErTXEwM3VSM1pYUEJZZHlWODMxOQpvMGxWajFLRkkyRENML2xpV2lzSlJvb2YrMWNSMzVDdGQwd1lCY3BCNlRac2xNY09QbDc2ZHdLd0pnZUpvMlFnClpzZm1jMnZDMS9xT2xOdU5xLzBUenprVkd2OEVUVDNDZ2FVK1VYZTRYT1Z2a2NjZWJKbjJkZz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K'; + $script = <<<'EOT' + +error_reporting(-1); +$info = openssl_x509_parse(base64_decode('%s')); +var_dump(PHP_VERSION, $info['issuer']['emailAddress'], $info['validFrom_time_t']); + +EOT; + $script = '<'."?php\n".sprintf($script, $cert); + + try { + $process = new PhpProcess($script); + $process->mustRun(); + } catch (\Exception $e) { + // In the case of any exceptions just accept it is not possible to + // determine the safety of openssl_x509_parse and bail out. + return self::$useOpensslParse = false; + } + + $output = preg_split('{\r?\n}', trim($process->getOutput())); + $errorOutput = trim($process->getErrorOutput()); + + if ( + is_array($output) + && count($output) === 3 + && $output[0] === sprintf('string(%d) "%s"', strlen(PHP_VERSION), PHP_VERSION) + && $output[1] === 'string(27) "stefan.esser@sektioneins.de"' + && $output[2] === 'int(-1)' + && preg_match('{openssl_x509_parse\(\): illegal (?:ASN1 data type for|length in) timestamp in - on line \d+}', $errorOutput) + ) { + // This PHP has the fix backported probably by a distro security team. + return self::$useOpensslParse = true; + } + + return self::$useOpensslParse = false; + } + + /** + * Resets the static caches + * @return void + */ + public static function reset() + { + self::$caFileValidity = array(); + self::$caPath = null; + self::$useOpensslParse = null; + } + + /** + * @param string $name + * @return string|false + */ + private static function getEnvVariable($name) + { + if (isset($_SERVER[$name])) { + return (string) $_SERVER[$name]; + } + + if (PHP_SAPI === 'cli' && ($value = getenv($name)) !== false && $value !== null) { + return (string) $value; + } + + return false; + } + + /** + * @param string|false $certFile + * @return bool + */ + private static function caFileUsable($certFile, LoggerInterface $logger = null) + { + return $certFile && @is_file($certFile) && @is_readable($certFile) && static::validateCaFile($certFile, $logger); + } + + /** + * @param string|false $certDir + * @return bool + */ + private static function caDirUsable($certDir) + { + return $certDir && @is_dir($certDir) && @is_readable($certDir) && glob($certDir . '/*'); + } +} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json new file mode 100644 index 0000000..a0ed482 --- /dev/null +++ b/vendor/composer/installed.json @@ -0,0 +1,1992 @@ +[ + { + "name": "composer/ca-bundle", + "version": "1.2.10", + "version_normalized": "1.2.10.0", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "9fdb22c2e97a614657716178093cd1da90a64aa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/9fdb22c2e97a614657716178093cd1da90a64aa8", + "reference": "9fdb22c2e97a614657716178093cd1da90a64aa8", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.55", + "psr/log": "^1.0", + "symfony/phpunit-bridge": "^4.2 || ^5", + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" + }, + "time": "2021-06-07T13:58:28+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/ca-bundle/issues", + "source": "https://github.com/composer/ca-bundle/tree/1.2.10" + } + }, + { + "name": "fgrosse/phpasn1", + "version": "v2.3.0", + "version_normalized": "2.3.0.0", + "source": { + "type": "git", + "url": "https://github.com/fgrosse/PHPASN1.git", + "reference": "20299033c35f4300eb656e7e8e88cf52d1d6694e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fgrosse/PHPASN1/zipball/20299033c35f4300eb656e7e8e88cf52d1d6694e", + "reference": "20299033c35f4300eb656e7e8e88cf52d1d6694e", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": "~6.3", + "satooshi/php-coveralls": "~2.0" + }, + "suggest": { + "ext-bcmath": "BCmath is the fallback extension for big integer calculations", + "ext-curl": "For loading OID information from the web if they have not bee defined statically", + "ext-gmp": "GMP is the preferred extension for big integer calculations", + "phpseclib/bcmath_compat": "BCmath polyfill for servers where neither GMP nor BCmath is available" + }, + "time": "2021-04-24T19:01:55+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "FG\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Friedrich Große", + "email": "friedrich.grosse@gmail.com", + "homepage": "https://github.com/FGrosse", + "role": "Author" + }, + { + "name": "All contributors", + "homepage": "https://github.com/FGrosse/PHPASN1/contributors" + } + ], + "description": "A PHP Framework that allows you to encode and decode arbitrary ASN.1 structures using the ITU-T X.690 Encoding Rules.", + "homepage": "https://github.com/FGrosse/PHPASN1", + "keywords": [ + "DER", + "asn.1", + "asn1", + "ber", + "binary", + "decoding", + "encoding", + "x.509", + "x.690", + "x509", + "x690" + ] + }, + { + "name": "geoip2/geoip2", + "version": "v2.11.0", + "version_normalized": "2.11.0.0", + "source": { + "type": "git", + "url": "https://github.com/maxmind/GeoIP2-php.git", + "reference": "d01be5894a5c1a3381c58c9b1795cd07f96c30f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/d01be5894a5c1a3381c58c9b1795cd07f96c30f7", + "reference": "d01be5894a5c1a3381c58c9b1795cd07f96c30f7", + "shasum": "" + }, + "require": { + "ext-json": "*", + "maxmind-db/reader": "~1.8", + "maxmind/web-service-common": "~0.8", + "php": ">=7.2" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "2.*", + "phpunit/phpunit": "^8.0 || ^9.0", + "squizlabs/php_codesniffer": "3.*" + }, + "time": "2020-10-01T18:48:34+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "GeoIp2\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Gregory J. Oschwald", + "email": "goschwald@maxmind.com", + "homepage": "https://www.maxmind.com/" + } + ], + "description": "MaxMind GeoIP2 PHP API", + "homepage": "https://github.com/maxmind/GeoIP2-php", + "keywords": [ + "IP", + "geoip", + "geoip2", + "geolocation", + "maxmind" + ] + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.5.5", + "version_normalized": "6.5.5.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", + "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.6.1", + "php": ">=5.5", + "symfony/polyfill-intl-idn": "^1.17.0" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.1" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "time": "2020-06-16T21:01:06+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.5-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ] + }, + { + "name": "guzzlehttp/promises", + "version": "1.4.1", + "version_normalized": "1.4.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d", + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "time": "2021-03-07T09:25:29+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ] + }, + { + "name": "guzzlehttp/psr7", + "version": "1.8.2", + "version_normalized": "1.8.2.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "dc960a912984efb74d0a90222870c72c87f10c91" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91", + "reference": "dc960a912984efb74d0a90222870c72c87f10c91", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "time": "2021-04-26T09:17:50+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ] + }, + { + "name": "maxmind-db/reader", + "version": "v1.10.1", + "version_normalized": "1.10.1.0", + "source": { + "type": "git", + "url": "https://github.com/maxmind/MaxMind-DB-Reader-php.git", + "reference": "569bd44d97d30a4ec12c7793a33004a76d4caf18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maxmind/MaxMind-DB-Reader-php/zipball/569bd44d97d30a4ec12c7793a33004a76d4caf18", + "reference": "569bd44d97d30a4ec12c7793a33004a76d4caf18", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "conflict": { + "ext-maxminddb": "<1.10.1,>=2.0.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "*", + "php-coveralls/php-coveralls": "^2.1", + "phpstan/phpstan": "*", + "phpunit/phpcov": ">=6.0.0", + "phpunit/phpunit": ">=8.0.0,<10.0.0", + "squizlabs/php_codesniffer": "3.*" + }, + "suggest": { + "ext-bcmath": "bcmath or gmp is required for decoding larger integers with the pure PHP decoder", + "ext-gmp": "bcmath or gmp is required for decoding larger integers with the pure PHP decoder", + "ext-maxminddb": "A C-based database decoder that provides significantly faster lookups" + }, + "time": "2021-04-14T17:49:35+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "MaxMind\\Db\\": "src/MaxMind/Db" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Gregory J. Oschwald", + "email": "goschwald@maxmind.com", + "homepage": "https://www.maxmind.com/" + } + ], + "description": "MaxMind DB Reader API", + "homepage": "https://github.com/maxmind/MaxMind-DB-Reader-php", + "keywords": [ + "database", + "geoip", + "geoip2", + "geolocation", + "maxmind" + ] + }, + { + "name": "maxmind/web-service-common", + "version": "v0.8.1", + "version_normalized": "0.8.1.0", + "source": { + "type": "git", + "url": "https://github.com/maxmind/web-service-common-php.git", + "reference": "32f274051c543fc865e5a84d3a2c703913641ea8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maxmind/web-service-common-php/zipball/32f274051c543fc865e5a84d3a2c703913641ea8", + "reference": "32f274051c543fc865e5a84d3a2c703913641ea8", + "shasum": "" + }, + "require": { + "composer/ca-bundle": "^1.0.3", + "ext-curl": "*", + "ext-json": "*", + "php": ">=7.2" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "2.*", + "phpunit/phpunit": "^8.0 || ^9.0", + "squizlabs/php_codesniffer": "3.*" + }, + "time": "2020-11-02T17:00:53+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "MaxMind\\Exception\\": "src/Exception", + "MaxMind\\WebService\\": "src/WebService" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Gregory Oschwald", + "email": "goschwald@maxmind.com" + } + ], + "description": "Internal MaxMind Web Service API", + "homepage": "https://github.com/maxmind/web-service-common-php" + }, + { + "name": "minishlink/web-push", + "version": "v5.2.5", + "version_normalized": "5.2.5.0", + "source": { + "type": "git", + "url": "https://github.com/web-push-libs/web-push-php.git", + "reference": "0e75af425126435794ed42d7aa92119fd563e503" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-push-libs/web-push-php/zipball/0e75af425126435794ed42d7aa92119fd563e503", + "reference": "0e75af425126435794ed42d7aa92119fd563e503", + "shasum": "" + }, + "require": { + "ext-gmp": "*", + "ext-json": "*", + "guzzlehttp/guzzle": "^6.2", + "lib-openssl": "*", + "php": "^7.1", + "web-token/jwt-key-mgmt": "^1.0", + "web-token/jwt-signature": "^1.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.14", + "phpstan/phpstan": "0.11.2", + "phpunit/phpunit": "^7.0" + }, + "time": "2020-08-02T08:58:01+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Minishlink\\WebPush\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Louis Lagrange", + "email": "lagrange.louis@gmail.com", + "homepage": "https://github.com/Minishlink" + } + ], + "description": "Web Push library for PHP", + "homepage": "https://github.com/web-push-libs/web-push-php", + "keywords": [ + "Push API", + "WebPush", + "notifications", + "push", + "web" + ] + }, + { + "name": "paragonie/random_compat", + "version": "v9.99.100", + "version_normalized": "9.99.100.0", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", + "shasum": "" + }, + "require": { + "php": ">= 7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "time": "2020-10-15T08:29:30+00:00", + "type": "library", + "installation-source": "dist", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ] + }, + { + "name": "paragonie/sodium_compat", + "version": "v1.16.1", + "version_normalized": "1.16.1.0", + "source": { + "type": "git", + "url": "https://github.com/paragonie/sodium_compat.git", + "reference": "2e856afe80bfc968b47da1f4a7e1ea8f03d06b38" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/2e856afe80bfc968b47da1f4a7e1ea8f03d06b38", + "reference": "2e856afe80bfc968b47da1f4a7e1ea8f03d06b38", + "shasum": "" + }, + "require": { + "paragonie/random_compat": ">=1", + "php": "^5.2.4|^5.3|^5.4|^5.5|^5.6|^7|^8" + }, + "require-dev": { + "phpunit/phpunit": "^3|^4|^5|^6|^7|^8|^9" + }, + "suggest": { + "ext-libsodium": "PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.", + "ext-sodium": "PHP >= 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security." + }, + "time": "2021-05-25T12:58:14+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "autoload.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com" + }, + { + "name": "Frank Denis", + "email": "jedisct1@pureftpd.org" + } + ], + "description": "Pure PHP implementation of libsodium; uses the PHP extension if it exists", + "keywords": [ + "Authentication", + "BLAKE2b", + "ChaCha20", + "ChaCha20-Poly1305", + "Chapoly", + "Curve25519", + "Ed25519", + "EdDSA", + "Edwards-curve Digital Signature Algorithm", + "Elliptic Curve Diffie-Hellman", + "Poly1305", + "Pure-PHP cryptography", + "RFC 7748", + "RFC 8032", + "Salpoly", + "Salsa20", + "X25519", + "XChaCha20-Poly1305", + "XSalsa20-Poly1305", + "Xchacha20", + "Xsalsa20", + "aead", + "cryptography", + "ecdh", + "elliptic curve", + "elliptic curve cryptography", + "encryption", + "libsodium", + "php", + "public-key cryptography", + "secret-key cryptography", + "side-channel resistant" + ], + "support": { + "issues": "https://github.com/paragonie/sodium_compat/issues", + "source": "https://github.com/paragonie/sodium_compat/tree/v1.16.1" + } + }, + { + "name": "paypal/paypal-checkout-sdk", + "version": "1.0.1", + "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/paypal/Checkout-PHP-SDK.git", + "reference": "ed6a55075448308b87a8b59dcb7fedf04a048cb1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paypal/Checkout-PHP-SDK/zipball/ed6a55075448308b87a8b59dcb7fedf04a048cb1", + "reference": "ed6a55075448308b87a8b59dcb7fedf04a048cb1", + "shasum": "" + }, + "require": { + "paypal/paypalhttp": "1.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7" + }, + "time": "2019-11-07T23:16:44+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "PayPalCheckoutSdk\\": "lib/PayPalCheckoutSdk", + "Sample\\": "samples/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "https://github.com/paypal/Checkout-PHP-SDK/blob/master/LICENSE" + ], + "authors": [ + { + "name": "PayPal", + "homepage": "https://github.com/paypal/Checkout-PHP-SDK/contributors" + } + ], + "description": "PayPal's PHP SDK for Checkout REST APIs", + "homepage": "http://github.com/paypal/Checkout-PHP-SDK/", + "keywords": [ + "checkout", + "orders", + "payments", + "paypal", + "rest", + "sdk" + ] + }, + { + "name": "paypal/paypalhttp", + "version": "1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/paypal/paypalhttp_php.git", + "reference": "1ad9b846a046f09d6135cbf2cbaa7701bbc630a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paypal/paypalhttp_php/zipball/1ad9b846a046f09d6135cbf2cbaa7701bbc630a3", + "reference": "1ad9b846a046f09d6135cbf2cbaa7701bbc630a3", + "shasum": "" + }, + "require": { + "ext-curl": "*" + }, + "require-dev": { + "phpunit/phpunit": "^5.7", + "wiremock-php/wiremock-php": "1.43.2" + }, + "time": "2019-11-06T21:27:12+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "PayPalHttp\\": "lib/PayPalHttp" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PayPal", + "homepage": "https://github.com/paypal/paypalhttp_php/contributors" + } + ], + "abandoned": true + }, + { + "name": "phpmailer/phpmailer", + "version": "v6.5.0", + "version_normalized": "6.5.0.0", + "source": { + "type": "git", + "url": "https://github.com/PHPMailer/PHPMailer.git", + "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a5b5c43e50b7fba655f793ad27303cd74c57363c", + "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-filter": "*", + "ext-hash": "*", + "php": ">=5.5.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.2", + "phpcompatibility/php-compatibility": "^9.3.5", + "roave/security-advisories": "dev-latest", + "squizlabs/php_codesniffer": "^3.5.6", + "yoast/phpunit-polyfills": "^0.2.0" + }, + "suggest": { + "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", + "league/oauth2-google": "Needed for Google XOAUTH2 authentication", + "psr/log": "For optional PSR-3 debug logging", + "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" + }, + "time": "2021-06-16T14:33:43+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "PHPMailer\\PHPMailer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-only" + ], + "authors": [ + { + "name": "Marcus Bointon", + "email": "phpmailer@synchromedia.co.uk" + }, + { + "name": "Jim Jagielski", + "email": "jimjag@gmail.com" + }, + { + "name": "Andy Prevost", + "email": "codeworxtech@users.sourceforge.net" + }, + { + "name": "Brent R. Matzelle" + } + ], + "description": "PHPMailer is a full-featured email creation and transfer class for PHP", + "support": { + "issues": "https://github.com/PHPMailer/PHPMailer/issues", + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.0" + } + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2016-08-06T14:39:51+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ] + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "version_normalized": "3.0.3.0", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "time": "2019-03-08T08:55:37+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders." + }, + { + "name": "sonata-project/google-authenticator", + "version": "2.3.1", + "version_normalized": "2.3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sonata-project/GoogleAuthenticator.git", + "reference": "71a4189228f93a9662574dc8c65e77ef55061b59" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sonata-project/GoogleAuthenticator/zipball/71a4189228f93a9662574dc8c65e77ef55061b59", + "reference": "71a4189228f93a9662574dc8c65e77ef55061b59", + "shasum": "" + }, + "require": { + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^5.1.8" + }, + "time": "2021-02-15T19:23:18+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Google\\Authenticator\\": "src/", + "Sonata\\GoogleAuthenticator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Thomas Rabaix", + "email": "thomas.rabaix@gmail.com" + }, + { + "name": "Christian Stocker", + "email": "me@chregu.tv" + }, + { + "name": "Andre DeMarre", + "homepage": "http://www.devnetwork.net/viewtopic.php?f=50&t=94989" + } + ], + "description": "Library to integrate Google Authenticator into a PHP project", + "homepage": "https://github.com/sonata-project/GoogleAuthenticator", + "keywords": [ + "google authenticator" + ], + "support": { + "issues": "https://github.com/sonata-project/GoogleAuthenticator/issues", + "source": "https://github.com/sonata-project/GoogleAuthenticator/tree/2.3.1" + } + }, + { + "name": "spomky-labs/base64url", + "version": "v2.0.4", + "version_normalized": "2.0.4.0", + "source": { + "type": "git", + "url": "https://github.com/Spomky-Labs/base64url.git", + "reference": "7752ce931ec285da4ed1f4c5aa27e45e097be61d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Spomky-Labs/base64url/zipball/7752ce931ec285da4ed1f4c5aa27e45e097be61d", + "reference": "7752ce931ec285da4ed1f4c5aa27e45e097be61d", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.11|^0.12", + "phpstan/phpstan-beberlei-assert": "^0.11|^0.12", + "phpstan/phpstan-deprecation-rules": "^0.11|^0.12", + "phpstan/phpstan-phpunit": "^0.11|^0.12", + "phpstan/phpstan-strict-rules": "^0.11|^0.12" + }, + "time": "2020-11-03T09:10:25+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Base64Url\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky-Labs/base64url/contributors" + } + ], + "description": "Base 64 URL Safe Encoding/Decoding PHP Library", + "homepage": "https://github.com/Spomky-Labs/base64url", + "keywords": [ + "base64", + "rfc4648", + "safe", + "url" + ] + }, + { + "name": "stripe/stripe-php", + "version": "v7.87.0", + "version_normalized": "7.87.0.0", + "source": { + "type": "git", + "url": "https://github.com/stripe/stripe-php.git", + "reference": "9392f03cb8d8803bf8273378ce42d5cbbf1e24fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/stripe/stripe-php/zipball/9392f03cb8d8803bf8273378ce42d5cbbf1e24fc", + "reference": "9392f03cb8d8803bf8273378ce42d5cbbf1e24fc", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "php": ">=5.6.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "2.17.1", + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5.7", + "squizlabs/php_codesniffer": "^3.3", + "symfony/process": "~3.4" + }, + "time": "2021-06-30T18:22:47+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Stripe\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Stripe and contributors", + "homepage": "https://github.com/stripe/stripe-php/contributors" + } + ], + "description": "Stripe PHP Library", + "homepage": "https://stripe.com/", + "keywords": [ + "api", + "payment processing", + "stripe" + ] + }, + { + "name": "symfony/polyfill-intl-idn", + "version": "v1.23.0", + "version_normalized": "1.23.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "65bd267525e82759e7d8c4e8ceea44f398838e65" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/65bd267525e82759e7d8c4e8ceea44f398838e65", + "reference": "65bd267525e82759e7d8c4e8ceea44f398838e65", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "symfony/polyfill-intl-normalizer": "^1.10", + "symfony/polyfill-php72": "^1.10" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "time": "2021-05-27T09:27:20+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.23.0" + } + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.23.0", + "version_normalized": "1.23.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "time": "2021-02-19T12:13:01+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" + } + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.23.0", + "version_normalized": "1.23.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2021-05-27T09:17:38+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" + } + }, + { + "name": "web-token/jwt-core", + "version": "v1.3.10", + "version_normalized": "1.3.10.0", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-core.git", + "reference": "30e9df9e040d933043b16237f9dba7a3be746566" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-core/zipball/30e9df9e040d933043b16237f9dba7a3be746566", + "reference": "30e9df9e040d933043b16237f9dba7a3be746566", + "shasum": "" + }, + "require": { + "ext-gmp": "*", + "ext-mbstring": "*", + "fgrosse/phpasn1": "^2.0", + "php": "^7.1", + "spomky-labs/base64url": "^1.0|^2.0", + "web-token/jwt-util-ecc": "^1.3" + }, + "conflict": { + "spomky-labs/jose": "*" + }, + "require-dev": { + "phpunit/phpunit": "^6.0|^7.0" + }, + "time": "2020-03-20T13:29:04+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Jose\\Component\\Core\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-core/contributors" + } + ], + "description": "Core component of the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ] + }, + { + "name": "web-token/jwt-key-mgmt", + "version": "v1.3.10", + "version_normalized": "1.3.10.0", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-key-mgmt.git", + "reference": "65b1e908e50b0e5be6b28135085d3c1097b81801" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-key-mgmt/zipball/65b1e908e50b0e5be6b28135085d3c1097b81801", + "reference": "65b1e908e50b0e5be6b28135085d3c1097b81801", + "shasum": "" + }, + "require": { + "lib-openssl": "*", + "paragonie/sodium_compat": "^1.2", + "web-token/jwt-core": "^1.3", + "web-token/jwt-util-ecc": "^1.3" + }, + "require-dev": { + "php-http/httplug": "^1.1", + "php-http/message-factory": "^1.0", + "php-http/mock-client": "^1.0", + "phpunit/phpunit": "^6.0|^7.0" + }, + "suggest": { + "php-http/httplug": "To enable JKU/X5U support.", + "php-http/message-factory": "To enable JKU/X5U support." + }, + "time": "2020-03-20T13:29:04+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Jose\\Component\\KeyManagement\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-key-mgmt/contributors" + } + ], + "description": "Key Management component of the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ] + }, + { + "name": "web-token/jwt-signature", + "version": "v1.3.10", + "version_normalized": "1.3.10.0", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-signature.git", + "reference": "00f23e997c9032536444f819bc3338ab475d69f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-signature/zipball/00f23e997c9032536444f819bc3338ab475d69f9", + "reference": "00f23e997c9032536444f819bc3338ab475d69f9", + "shasum": "" + }, + "require": { + "web-token/jwt-core": "^1.3", + "web-token/jwt-signature-algorithm-ecdsa": "^1.3", + "web-token/jwt-signature-algorithm-eddsa": "^1.3", + "web-token/jwt-signature-algorithm-hmac": "^1.3", + "web-token/jwt-signature-algorithm-none": "^1.3", + "web-token/jwt-signature-algorithm-rsa": "^1.3" + }, + "require-dev": { + "phpunit/phpunit": "^6.0|^7.0" + }, + "suggest": { + "web-token/jwt-signature-algorithm-ecdsa": "ECDSA Based Signature Algorithms", + "web-token/jwt-signature-algorithm-eddsa": "EdDSA Based Signature Algorithms", + "web-token/jwt-signature-algorithm-experimental": "Experimental Signature Algorithms", + "web-token/jwt-signature-algorithm-hmac": "HMAC Based Signature Algorithms", + "web-token/jwt-signature-algorithm-none": "None Signature Algorithm", + "web-token/jwt-signature-algorithm-rsa": "RSA Based Signature Algorithms" + }, + "time": "2020-03-20T13:29:04+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Jose\\Component\\Signature\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-signature/contributors" + } + ], + "description": "Signature component of the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ] + }, + { + "name": "web-token/jwt-signature-algorithm-ecdsa", + "version": "v1.3.10", + "version_normalized": "1.3.10.0", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-signature-algorithm-ecdsa.git", + "reference": "a3babd3b82c29c739d426271ccb9dc1a56222e36" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-signature-algorithm-ecdsa/zipball/a3babd3b82c29c739d426271ccb9dc1a56222e36", + "reference": "a3babd3b82c29c739d426271ccb9dc1a56222e36", + "shasum": "" + }, + "require": { + "web-token/jwt-signature": "^1.3" + }, + "require-dev": { + "phpunit/phpunit": "^6.0|^7.0" + }, + "time": "2020-03-20T13:29:04+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Jose\\Component\\Signature\\Algorithm\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-core/contributors" + } + ], + "description": "ECDSA Based Signature Algorithms the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ] + }, + { + "name": "web-token/jwt-signature-algorithm-eddsa", + "version": "v1.3.10", + "version_normalized": "1.3.10.0", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-signature-algorithm-eddsa.git", + "reference": "b0dad134313b14b3ba077b63a7afcc2b38e5f793" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-signature-algorithm-eddsa/zipball/b0dad134313b14b3ba077b63a7afcc2b38e5f793", + "reference": "b0dad134313b14b3ba077b63a7afcc2b38e5f793", + "shasum": "" + }, + "require": { + "web-token/jwt-signature": "^1.3" + }, + "require-dev": { + "phpunit/phpunit": "^6.0|^7.0" + }, + "time": "2020-03-20T13:29:04+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Jose\\Component\\Signature\\Algorithm\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-core/contributors" + } + ], + "description": "EdDSA Signature Algorithm the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ] + }, + { + "name": "web-token/jwt-signature-algorithm-hmac", + "version": "v1.3.10", + "version_normalized": "1.3.10.0", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-signature-algorithm-hmac.git", + "reference": "3bc85e1d13804902a8d81a11f58c28c9a471b5e2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-signature-algorithm-hmac/zipball/3bc85e1d13804902a8d81a11f58c28c9a471b5e2", + "reference": "3bc85e1d13804902a8d81a11f58c28c9a471b5e2", + "shasum": "" + }, + "require": { + "web-token/jwt-signature": "^1.3" + }, + "require-dev": { + "phpunit/phpunit": "^6.0|^7.0" + }, + "time": "2020-03-20T13:29:04+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Jose\\Component\\Signature\\Algorithm\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-core/contributors" + } + ], + "description": "HMAC Based Signature Algorithms the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ] + }, + { + "name": "web-token/jwt-signature-algorithm-none", + "version": "v1.3.10", + "version_normalized": "1.3.10.0", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-signature-algorithm-none.git", + "reference": "0391e160367e85846736e63ea6026e2dab667b6e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-signature-algorithm-none/zipball/0391e160367e85846736e63ea6026e2dab667b6e", + "reference": "0391e160367e85846736e63ea6026e2dab667b6e", + "shasum": "" + }, + "require": { + "web-token/jwt-signature": "^1.3" + }, + "require-dev": { + "phpunit/phpunit": "^6.0|^7.0" + }, + "time": "2020-03-20T13:29:04+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Jose\\Component\\Signature\\Algorithm\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-core/contributors" + } + ], + "description": "None Signature Algorithm the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ] + }, + { + "name": "web-token/jwt-signature-algorithm-rsa", + "version": "v1.3.10", + "version_normalized": "1.3.10.0", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-signature-algorithm-rsa.git", + "reference": "344181ef6cdd3aca77f7ff7defc9fb502eb33ec0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-signature-algorithm-rsa/zipball/344181ef6cdd3aca77f7ff7defc9fb502eb33ec0", + "reference": "344181ef6cdd3aca77f7ff7defc9fb502eb33ec0", + "shasum": "" + }, + "require": { + "web-token/jwt-signature": "^1.3" + }, + "require-dev": { + "phpunit/phpunit": "^6.0|^7.0" + }, + "time": "2020-03-20T13:29:04+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Jose\\Component\\Signature\\Algorithm\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-core/contributors" + } + ], + "description": "RSA Based Signature Algorithms the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ] + }, + { + "name": "web-token/jwt-util-ecc", + "version": "v1.3.10", + "version_normalized": "1.3.10.0", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-util-ecc.git", + "reference": "2011af8454561ebce06a77fcd681c29a252e0068" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-util-ecc/zipball/2011af8454561ebce06a77fcd681c29a252e0068", + "reference": "2011af8454561ebce06a77fcd681c29a252e0068", + "shasum": "" + }, + "require": { + "ext-gmp": "*", + "ext-mbstring": "*", + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.0|^7.0" + }, + "time": "2020-03-20T13:29:04+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Jose\\Component\\Core\\Util\\Ecc\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-core/contributors" + } + ], + "description": "ECC Tools for the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ] + } +] diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php new file mode 100644 index 0000000..8308c8e --- /dev/null +++ b/vendor/composer/installed.php @@ -0,0 +1,371 @@ + array( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'type' => 'project', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'reference' => 'd1ac198102e27b374ad4ca2071a9038abeda1278', + 'name' => '1ka/1ka.si', + 'dev' => true, + ), + 'versions' => array( + '1ka/1ka.si' => array( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'type' => 'project', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'reference' => 'd1ac198102e27b374ad4ca2071a9038abeda1278', + 'dev_requirement' => false, + ), + 'composer/ca-bundle' => array( + 'pretty_version' => '1.2.10', + 'version' => '1.2.10.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/./ca-bundle', + 'aliases' => array(), + 'reference' => '9fdb22c2e97a614657716178093cd1da90a64aa8', + 'dev_requirement' => false, + ), + 'fgrosse/phpasn1' => array( + 'pretty_version' => 'v2.3.0', + 'version' => '2.3.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../fgrosse/phpasn1', + 'aliases' => array(), + 'reference' => '20299033c35f4300eb656e7e8e88cf52d1d6694e', + 'dev_requirement' => false, + ), + 'filp/whoops' => array( + 'pretty_version' => '2.13.0', + 'version' => '2.13.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../filp/whoops', + 'aliases' => array(), + 'reference' => '2edbc73a4687d9085c8f20f398eebade844e8424', + 'dev_requirement' => true, + ), + 'geoip2/geoip2' => array( + 'pretty_version' => 'v2.11.0', + 'version' => '2.11.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../geoip2/geoip2', + 'aliases' => array(), + 'reference' => 'd01be5894a5c1a3381c58c9b1795cd07f96c30f7', + 'dev_requirement' => false, + ), + 'guzzlehttp/guzzle' => array( + 'pretty_version' => '6.5.5', + 'version' => '6.5.5.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', + 'aliases' => array(), + 'reference' => '9d4290de1cfd701f38099ef7e183b64b4b7b0c5e', + 'dev_requirement' => false, + ), + 'guzzlehttp/promises' => array( + 'pretty_version' => '1.4.1', + 'version' => '1.4.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/promises', + 'aliases' => array(), + 'reference' => '8e7d04f1f6450fef59366c399cfad4b9383aa30d', + 'dev_requirement' => false, + ), + 'guzzlehttp/psr7' => array( + 'pretty_version' => '1.8.2', + 'version' => '1.8.2.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/psr7', + 'aliases' => array(), + 'reference' => 'dc960a912984efb74d0a90222870c72c87f10c91', + 'dev_requirement' => false, + ), + 'kint-php/kint' => array( + 'pretty_version' => '1.1', + 'version' => '1.1.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../kint-php/kint', + 'aliases' => array(), + 'reference' => 'a8549198558560b24e2879c6bac2875de5371483', + 'dev_requirement' => true, + ), + 'maximebf/debugbar' => array( + 'pretty_version' => 'v1.16.5', + 'version' => '1.16.5.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../maximebf/debugbar', + 'aliases' => array(), + 'reference' => '6d51ee9e94cff14412783785e79a4e7ef97b9d62', + 'dev_requirement' => true, + ), + 'maxmind-db/reader' => array( + 'pretty_version' => 'v1.10.1', + 'version' => '1.10.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../maxmind-db/reader', + 'aliases' => array(), + 'reference' => '569bd44d97d30a4ec12c7793a33004a76d4caf18', + 'dev_requirement' => false, + ), + 'maxmind/web-service-common' => array( + 'pretty_version' => 'v0.8.1', + 'version' => '0.8.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../maxmind/web-service-common', + 'aliases' => array(), + 'reference' => '32f274051c543fc865e5a84d3a2c703913641ea8', + 'dev_requirement' => false, + ), + 'minishlink/web-push' => array( + 'pretty_version' => 'v5.2.5', + 'version' => '5.2.5.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../minishlink/web-push', + 'aliases' => array(), + 'reference' => '0e75af425126435794ed42d7aa92119fd563e503', + 'dev_requirement' => false, + ), + 'paragonie/random_compat' => array( + 'pretty_version' => 'v9.99.100', + 'version' => '9.99.100.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../paragonie/random_compat', + 'aliases' => array(), + 'reference' => '996434e5492cb4c3edcb9168db6fbb1359ef965a', + 'dev_requirement' => false, + ), + 'paragonie/sodium_compat' => array( + 'pretty_version' => 'v1.16.1', + 'version' => '1.16.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../paragonie/sodium_compat', + 'aliases' => array(), + 'reference' => '2e856afe80bfc968b47da1f4a7e1ea8f03d06b38', + 'dev_requirement' => false, + ), + 'paypal/paypal-checkout-sdk' => array( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../paypal/paypal-checkout-sdk', + 'aliases' => array(), + 'reference' => 'ed6a55075448308b87a8b59dcb7fedf04a048cb1', + 'dev_requirement' => false, + ), + 'paypal/paypalhttp' => array( + 'pretty_version' => '1.0.0', + 'version' => '1.0.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../paypal/paypalhttp', + 'aliases' => array(), + 'reference' => '1ad9b846a046f09d6135cbf2cbaa7701bbc630a3', + 'dev_requirement' => false, + ), + 'phpmailer/phpmailer' => array( + 'pretty_version' => 'v6.5.0', + 'version' => '6.5.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpmailer/phpmailer', + 'aliases' => array(), + 'reference' => 'a5b5c43e50b7fba655f793ad27303cd74c57363c', + 'dev_requirement' => false, + ), + 'psr/http-message' => array( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/http-message', + 'aliases' => array(), + 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', + 'dev_requirement' => false, + ), + 'psr/http-message-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), + 'psr/log' => array( + 'pretty_version' => '1.1.4', + 'version' => '1.1.4.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/log', + 'aliases' => array(), + 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11', + 'dev_requirement' => true, + ), + 'ralouphie/getallheaders' => array( + 'pretty_version' => '3.0.3', + 'version' => '3.0.3.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../ralouphie/getallheaders', + 'aliases' => array(), + 'reference' => '120b605dfeb996808c31b6477290a714d356e822', + 'dev_requirement' => false, + ), + 'sonata-project/google-authenticator' => array( + 'pretty_version' => '2.3.1', + 'version' => '2.3.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../sonata-project/google-authenticator', + 'aliases' => array(), + 'reference' => '71a4189228f93a9662574dc8c65e77ef55061b59', + 'dev_requirement' => false, + ), + 'spomky-labs/base64url' => array( + 'pretty_version' => 'v2.0.4', + 'version' => '2.0.4.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../spomky-labs/base64url', + 'aliases' => array(), + 'reference' => '7752ce931ec285da4ed1f4c5aa27e45e097be61d', + 'dev_requirement' => false, + ), + 'stripe/stripe-php' => array( + 'pretty_version' => 'v7.87.0', + 'version' => '7.87.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../stripe/stripe-php', + 'aliases' => array(), + 'reference' => '9392f03cb8d8803bf8273378ce42d5cbbf1e24fc', + 'dev_requirement' => false, + ), + 'symfony/polyfill-intl-idn' => array( + 'pretty_version' => 'v1.23.0', + 'version' => '1.23.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-intl-idn', + 'aliases' => array(), + 'reference' => '65bd267525e82759e7d8c4e8ceea44f398838e65', + 'dev_requirement' => false, + ), + 'symfony/polyfill-intl-normalizer' => array( + 'pretty_version' => 'v1.23.0', + 'version' => '1.23.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', + 'aliases' => array(), + 'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8', + 'dev_requirement' => false, + ), + 'symfony/polyfill-mbstring' => array( + 'pretty_version' => 'v1.23.0', + 'version' => '1.23.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', + 'aliases' => array(), + 'reference' => '2df51500adbaebdc4c38dea4c89a2e131c45c8a1', + 'dev_requirement' => true, + ), + 'symfony/polyfill-php72' => array( + 'pretty_version' => 'v1.23.0', + 'version' => '1.23.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php72', + 'aliases' => array(), + 'reference' => '9a142215a36a3888e30d0a9eeea9766764e96976', + 'dev_requirement' => false, + ), + 'symfony/polyfill-php80' => array( + 'pretty_version' => 'v1.23.0', + 'version' => '1.23.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php80', + 'aliases' => array(), + 'reference' => 'eca0bf41ed421bed1b57c4958bab16aa86b757d0', + 'dev_requirement' => true, + ), + 'symfony/var-dumper' => array( + 'pretty_version' => 'v4.4.26', + 'version' => '4.4.26.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/var-dumper', + 'aliases' => array(), + 'reference' => 'a586efdf2aa832d05b9249e9115d24f6a2691160', + 'dev_requirement' => true, + ), + 'web-token/jwt-core' => array( + 'pretty_version' => 'v1.3.10', + 'version' => '1.3.10.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../web-token/jwt-core', + 'aliases' => array(), + 'reference' => '30e9df9e040d933043b16237f9dba7a3be746566', + 'dev_requirement' => false, + ), + 'web-token/jwt-key-mgmt' => array( + 'pretty_version' => 'v1.3.10', + 'version' => '1.3.10.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../web-token/jwt-key-mgmt', + 'aliases' => array(), + 'reference' => '65b1e908e50b0e5be6b28135085d3c1097b81801', + 'dev_requirement' => false, + ), + 'web-token/jwt-signature' => array( + 'pretty_version' => 'v1.3.10', + 'version' => '1.3.10.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../web-token/jwt-signature', + 'aliases' => array(), + 'reference' => '00f23e997c9032536444f819bc3338ab475d69f9', + 'dev_requirement' => false, + ), + 'web-token/jwt-signature-algorithm-ecdsa' => array( + 'pretty_version' => 'v1.3.10', + 'version' => '1.3.10.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../web-token/jwt-signature-algorithm-ecdsa', + 'aliases' => array(), + 'reference' => 'a3babd3b82c29c739d426271ccb9dc1a56222e36', + 'dev_requirement' => false, + ), + 'web-token/jwt-signature-algorithm-eddsa' => array( + 'pretty_version' => 'v1.3.10', + 'version' => '1.3.10.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../web-token/jwt-signature-algorithm-eddsa', + 'aliases' => array(), + 'reference' => 'b0dad134313b14b3ba077b63a7afcc2b38e5f793', + 'dev_requirement' => false, + ), + 'web-token/jwt-signature-algorithm-hmac' => array( + 'pretty_version' => 'v1.3.10', + 'version' => '1.3.10.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../web-token/jwt-signature-algorithm-hmac', + 'aliases' => array(), + 'reference' => '3bc85e1d13804902a8d81a11f58c28c9a471b5e2', + 'dev_requirement' => false, + ), + 'web-token/jwt-signature-algorithm-none' => array( + 'pretty_version' => 'v1.3.10', + 'version' => '1.3.10.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../web-token/jwt-signature-algorithm-none', + 'aliases' => array(), + 'reference' => '0391e160367e85846736e63ea6026e2dab667b6e', + 'dev_requirement' => false, + ), + 'web-token/jwt-signature-algorithm-rsa' => array( + 'pretty_version' => 'v1.3.10', + 'version' => '1.3.10.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../web-token/jwt-signature-algorithm-rsa', + 'aliases' => array(), + 'reference' => '344181ef6cdd3aca77f7ff7defc9fb502eb33ec0', + 'dev_requirement' => false, + ), + 'web-token/jwt-util-ecc' => array( + 'pretty_version' => 'v1.3.10', + 'version' => '1.3.10.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../web-token/jwt-util-ecc', + 'aliases' => array(), + 'reference' => '2011af8454561ebce06a77fcd681c29a252e0068', + 'dev_requirement' => false, + ), + ), +); diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php new file mode 100644 index 0000000..92370c5 --- /dev/null +++ b/vendor/composer/platform_check.php @@ -0,0 +1,26 @@ += 70300)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 7.3.0". You are running ' . PHP_VERSION . '.'; +} + +if ($issues) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + trigger_error( + 'Composer detected issues in your platform: ' . implode(' ', $issues), + E_USER_ERROR + ); +} diff --git a/vendor/fgrosse/phpasn1/CHANGELOG.md b/vendor/fgrosse/phpasn1/CHANGELOG.md new file mode 100644 index 0000000..e38b982 --- /dev/null +++ b/vendor/fgrosse/phpasn1/CHANGELOG.md @@ -0,0 +1,51 @@ +#### v2.3.0 (2021-04) +* Allow creating an unsigned CSR and adding the signature later + https://github.com/fgrosse/PHPASN1/pull/82 + +#### v2.2.0 (2020-08) +* support polyfills for bcmath and gmp, and add a composer.json + suggestion for the `phpseclib/bcmath_polyfill` for servers unable + to install PHP the gmp or bcmath extensions. + +#### v.2.1.1 & &v.2.0.2 (2018-12) +* add stricter validation around some structures, highlighed + by wycheproof test suite + +#### v.2.1.0 (2018-03) +* add support for `bcmath` extension (making `gmp` optional)
+ https://github.com/fgrosse/PHPASN1/pull/68 + +#### v.2.0.1 & v.1.5.3 (2017-12) +* add .gitattributes file to prevent examples and tests to be installed via composer when --prefer-dist was set + +#### v.2.0.0 (2017-08) +* rename `FG\ASN1\Object` to `FG\ASN1\ASNObject` because `Object` is a special class name in the next major PHP release + - when you upgrade you have to adapt all corresponding `use` and `extends` statements as well as type hints and all + usages of `Object::fromBinary(…)`. +* generally drop PHP 5.6 support + +#### v.1.5.2 (2016-10-29) +* allow empty octet strings + +#### v.1.5.1 (2015-10-02) +* add keywords to composer.json (this is a version on its own so the keywords are found on a stable version at packagist.org) + +#### v.1.5.0 (2015-10-30) +* fix a bug that would prevent you from decoding context specific tags on multiple objects [#57](https://github.com/fgrosse/PHPASN1/issues/57) + - `ExplicitlyTaggedObject::__construct` does now accept multiple objects to be tagged with a single tag + - `ExplicitlyTaggedObject::getContent` will now always return an array (even if only one object is tagged) + +#### v.1.4.2 (2015-09-29) +* fix a bug that would prevent you from decoding empty tagged objects [#57](https://github.com/fgrosse/PHPASN1/issues/57) + +#### v.1.4.1 +* improve exception messages and general error handling [#55](https://github.com/fgrosse/PHPASN1/pull/55) + +#### v.1.4.0 +* **require PHP 5.6** +* support big integers (closes #1 and #37) +* enforce one code style via [styleci.io][9] +* track code coverage via [coveralls.io][10] +* replace obsolete `FG\ASN1\Exception\GeneralException` with `\Exception` +* `Construct` (`Sequence`, `Set`) does now implement `ArrayAccess`, `Countable` and `Iterator` so its easier to use +* add [`TemplateParser`][11] diff --git a/vendor/fgrosse/phpasn1/LICENSE b/vendor/fgrosse/phpasn1/LICENSE new file mode 100644 index 0000000..1e17eb0 --- /dev/null +++ b/vendor/fgrosse/phpasn1/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012-2015 Friedrich Große + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/fgrosse/phpasn1/README.md b/vendor/fgrosse/phpasn1/README.md new file mode 100644 index 0000000..3931010 --- /dev/null +++ b/vendor/fgrosse/phpasn1/README.md @@ -0,0 +1,167 @@ +PHPASN1 +======= + +[![Build Status](https://secure.travis-ci.org/fgrosse/PHPASN1.png?branch=master)](http://travis-ci.org/fgrosse/PHPASN1) +[![PHP 7 ready](http://php7ready.timesplinter.ch/fgrosse/PHPASN1/badge.svg)](https://travis-ci.org/fgrosse/PHPASN1) +[![Coverage Status](https://coveralls.io/repos/fgrosse/PHPASN1/badge.svg?branch=master&service=github)](https://coveralls.io/github/fgrosse/PHPASN1?branch=master) + +[![Latest Stable Version](https://poser.pugx.org/fgrosse/phpasn1/v/stable.png)](https://packagist.org/packages/fgrosse/phpasn1) +[![Total Downloads](https://poser.pugx.org/fgrosse/phpasn1/downloads.png)](https://packagist.org/packages/fgrosse/phpasn1) +[![Latest Unstable Version](https://poser.pugx.org/fgrosse/phpasn1/v/unstable.png)](https://packagist.org/packages/fgrosse/phpasn1) +[![License](https://poser.pugx.org/fgrosse/phpasn1/license.png)](https://packagist.org/packages/fgrosse/phpasn1) + +A PHP Framework that allows you to encode and decode arbitrary [ASN.1][3] structures +using the [ITU-T X.690 Encoding Rules][4]. +This encoding is very frequently used in [X.509 PKI environments][5] or the communication between heterogeneous computer systems. + +The API allows you to encode ASN.1 structures to create binary data such as certificate +signing requests (CSR), X.509 certificates or certificate revocation lists (CRL). +PHPASN1 can also read [BER encoded][6] binary data into separate PHP objects that can be manipulated by the user and reencoded afterwards. + +The **changelog** can now be found at [CHANGELOG.md](CHANGELOG.md). + +## Dependencies + +PHPASN1 requires at least `PHP 7.0` and either the `gmp` or `bcmath` extension. +Support for older PHP versions (i.e. PHP 5.6) was dropped starting with `v2.0`. +If you must use an outdated PHP version consider using [PHPASN v1.5][13]. + +For the loading of object identifier names directly from the web [curl][7] is used. + +## Installation + +The preferred way to install this library is to rely on [Composer][2]: + +```bash +$ composer require fgrosse/phpasn1 +``` + +## Usage + +### Encoding ASN.1 Structures + +PHPASN1 offers you a class for each of the implemented ASN.1 universal types. +The constructors should be pretty self explanatory so you should have no big trouble getting started. +All data will be encoded using [DER encoding][8] + +```php +use FG\ASN1\OID; +use FG\ASN1\Universal\Integer; +use FG\ASN1\Universal\Boolean; +use FG\ASN1\Universal\Enumerated; +use FG\ASN1\Universal\IA5String; +use FG\ASN1\Universal\ObjectIdentifier; +use FG\ASN1\Universal\PrintableString; +use FG\ASN1\Universal\Sequence; +use FG\ASN1\Universal\Set; +use FG\ASN1\Universal\NullObject; + +$integer = new Integer(123456); +$boolean = new Boolean(true); +$enum = new Enumerated(1); +$ia5String = new IA5String('Hello world'); + +$asnNull = new NullObject(); +$objectIdentifier1 = new ObjectIdentifier('1.2.250.1.16.9'); +$objectIdentifier2 = new ObjectIdentifier(OID::RSA_ENCRYPTION); +$printableString = new PrintableString('Foo bar'); + +$sequence = new Sequence($integer, $boolean, $enum, $ia5String); +$set = new Set($sequence, $asnNull, $objectIdentifier1, $objectIdentifier2, $printableString); + +$myBinary = $sequence->getBinary(); +$myBinary .= $set->getBinary(); + +echo base64_encode($myBinary); +``` + + +### Decoding binary data + +Decoding BER encoded binary data is just as easy as encoding it: + +```php +use FG\ASN1\ASNObject; + +$base64String = ... +$binaryData = base64_decode($base64String); +$asnObject = ASNObject::fromBinary($binaryData); + + +// do stuff +``` + +If you already know exactly how your expected data should look like you can use the `FG\ASN1\TemplateParser`: + +```php +use FG\ASN1\TemplateParser; + +// first define your template +$template = [ + Identifier::SEQUENCE => [ + Identifier::SET => [ + Identifier::OBJECT_IDENTIFIER, + Identifier::SEQUENCE => [ + Identifier::INTEGER, + Identifier::BITSTRING, + ] + ] + ] +]; + +// if your binary data is not matching the template you provided this will throw an `\Exception`: +$parser = new TemplateParser(); +$object = $parser->parseBinary($data, $template); + +// there is also a convenience function if you parse binary data from base64: +$object = $parser->parseBase64($data, $template); +``` + +You can use this function to make sure your data has exactly the format you are expecting. + +### Navigating decoded data + +All constructed classes (i.e. `Sequence` and `Set`) can be navigated by array access or using an iterator. +You can find examples +[here](https://github.com/fgrosse/PHPASN1/blob/f6442cadda9d36f3518c737e32f28300a588b777/tests/ASN1/Universal/SequenceTest.php#L148-148), +[here](https://github.com/fgrosse/PHPASN1/blob/f6442cadda9d36f3518c737e32f28300a588b777/tests/ASN1/Universal/SequenceTest.php#L121) and +[here](https://github.com/fgrosse/PHPASN1/blob/f6442cadda9d36f3518c737e32f28300a588b777/tests/ASN1/TemplateParserTest.php#L45). + + +### Give me more examples! + +To see some example usage of the API classes or some generated output check out the [examples](https://github.com/fgrosse/PHPASN1/tree/master/examples). + + +### How do I contribute? + +If you found an issue or have a question submit a github issue with detailed information. + +In case you already know what caused the issue and feel in the mood to fix it, your code contributions are always welcome. Just fork the repository, implement your changes and make sure that you covered everything with tests. +Afterwards submit a pull request via github and be a little patient :) I usually try to comment and/or merge as soon as possible. + +#### Mailing list + +New features or questions can be discussed in [this google group/mailing list][12]. + +### Thanks + +To [all contributors][1] so far! + +## License + +This library is distributed under the [MIT License](LICENSE). + +[1]: https://github.com/fgrosse/PHPASN1/graphs/contributors +[2]: https://getcomposer.org/ +[3]: http://www.itu.int/ITU-T/asn1/ +[4]: http://www.itu.int/ITU-T/recommendations/rec.aspx?rec=x.690 +[5]: http://en.wikipedia.org/wiki/X.509 +[6]: http://en.wikipedia.org/wiki/X.690#BER_encoding +[7]: http://php.net/manual/en/book.curl.php +[8]: http://en.wikipedia.org/wiki/X.690#DER_encoding +[9]: https://styleci.io +[10]: https://coveralls.io/github/fgrosse/PHPASN1 +[11]: https://github.com/fgrosse/PHPASN1/blob/master/tests/ASN1/TemplateParserTest.php#L16 +[12]: https://groups.google.com/d/forum/phpasn1 +[13]: https://packagist.org/packages/fgrosse/phpasn1#1.5.2 diff --git a/vendor/fgrosse/phpasn1/composer.json b/vendor/fgrosse/phpasn1/composer.json new file mode 100644 index 0000000..01ffada --- /dev/null +++ b/vendor/fgrosse/phpasn1/composer.json @@ -0,0 +1,49 @@ +{ + "name": "fgrosse/phpasn1", + "description": "A PHP Framework that allows you to encode and decode arbitrary ASN.1 structures using the ITU-T X.690 Encoding Rules.", + "type": "library", + "homepage": "https://github.com/FGrosse/PHPASN1", + "license": "MIT", + "authors": [ + { + "name": "Friedrich Große", + "email": "friedrich.grosse@gmail.com", + "homepage": "https://github.com/FGrosse", + "role": "Author" + }, + { + "name": "All contributors", + "homepage": "https://github.com/FGrosse/PHPASN1/contributors" + } + ], + "keywords": [ "x690", "x.690", "x.509", "x509", "asn1", "asn.1", "ber", "der", "binary", "encoding", "decoding" ], + + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": "~6.3", + "satooshi/php-coveralls": "~2.0" + }, + "suggest": { + "ext-gmp": "GMP is the preferred extension for big integer calculations", + "ext-bcmath": "BCmath is the fallback extension for big integer calculations", + "phpseclib/bcmath_compat": "BCmath polyfill for servers where neither GMP nor BCmath is available", + "ext-curl": "For loading OID information from the web if they have not bee defined statically" + }, + "autoload": { + "psr-4": { + "FG\\": "lib/" + } + }, + "autoload-dev": { + "psr-4": { + "FG\\Test\\": "tests/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/ASNObject.php b/vendor/fgrosse/phpasn1/lib/ASN1/ASNObject.php new file mode 100644 index 0000000..3b7f162 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/ASNObject.php @@ -0,0 +1,355 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1; + +use FG\ASN1\Exception\ParserException; +use FG\ASN1\Universal\BitString; +use FG\ASN1\Universal\Boolean; +use FG\ASN1\Universal\Enumerated; +use FG\ASN1\Universal\GeneralizedTime; +use FG\ASN1\Universal\Integer; +use FG\ASN1\Universal\NullObject; +use FG\ASN1\Universal\ObjectIdentifier; +use FG\ASN1\Universal\RelativeObjectIdentifier; +use FG\ASN1\Universal\OctetString; +use FG\ASN1\Universal\Sequence; +use FG\ASN1\Universal\Set; +use FG\ASN1\Universal\UTCTime; +use FG\ASN1\Universal\IA5String; +use FG\ASN1\Universal\PrintableString; +use FG\ASN1\Universal\NumericString; +use FG\ASN1\Universal\UTF8String; +use FG\ASN1\Universal\UniversalString; +use FG\ASN1\Universal\CharacterString; +use FG\ASN1\Universal\GeneralString; +use FG\ASN1\Universal\VisibleString; +use FG\ASN1\Universal\GraphicString; +use FG\ASN1\Universal\BMPString; +use FG\ASN1\Universal\T61String; +use FG\ASN1\Universal\ObjectDescriptor; +use FG\Utility\BigInteger; +use LogicException; + +/** + * Class ASNObject is the base class for all concrete ASN.1 objects. + */ +abstract class ASNObject implements Parsable +{ + private $contentLength; + private $nrOfLengthOctets; + + /** + * Must return the number of octets of the content part. + * + * @return int + */ + abstract protected function calculateContentLength(); + + /** + * Encode the object using DER encoding. + * + * @see http://en.wikipedia.org/wiki/X.690#DER_encoding + * + * @return string the binary representation of an objects value + */ + abstract protected function getEncodedValue(); + + /** + * Return the content of this object in a non encoded form. + * This can be used to print the value in human readable form. + * + * @return mixed + */ + abstract public function getContent(); + + /** + * Return the object type octet. + * This should use the class constants of Identifier. + * + * @see Identifier + * + * @return int + */ + abstract public function getType(); + + /** + * Returns all identifier octets. If an inheriting class models a tag with + * the long form identifier format, it MUST reimplement this method to + * return all octets of the identifier. + * + * @throws LogicException If the identifier format is long form + * + * @return string Identifier as a set of octets + */ + public function getIdentifier() + { + $firstOctet = $this->getType(); + + if (Identifier::isLongForm($firstOctet)) { + throw new LogicException(sprintf('Identifier of %s uses the long form and must therefor override "ASNObject::getIdentifier()".', get_class($this))); + } + + return chr($firstOctet); + } + + /** + * Encode this object using DER encoding. + * + * @return string the full binary representation of the complete object + */ + public function getBinary() + { + $result = $this->getIdentifier(); + $result .= $this->createLengthPart(); + $result .= $this->getEncodedValue(); + + return $result; + } + + private function createLengthPart() + { + $contentLength = $this->getContentLength(); + $nrOfLengthOctets = $this->getNumberOfLengthOctets($contentLength); + + if ($nrOfLengthOctets == 1) { + return chr($contentLength); + } else { + // the first length octet determines the number subsequent length octets + $lengthOctets = chr(0x80 | ($nrOfLengthOctets - 1)); + for ($shiftLength = 8 * ($nrOfLengthOctets - 2); $shiftLength >= 0; $shiftLength -= 8) { + $lengthOctets .= chr($contentLength >> $shiftLength); + } + + return $lengthOctets; + } + } + + protected function getNumberOfLengthOctets($contentLength = null) + { + if (!isset($this->nrOfLengthOctets)) { + if ($contentLength == null) { + $contentLength = $this->getContentLength(); + } + + $this->nrOfLengthOctets = 1; + if ($contentLength > 127) { + do { // long form + $this->nrOfLengthOctets++; + $contentLength = $contentLength >> 8; + } while ($contentLength > 0); + } + } + + return $this->nrOfLengthOctets; + } + + protected function getContentLength() + { + if (!isset($this->contentLength)) { + $this->contentLength = $this->calculateContentLength(); + } + + return $this->contentLength; + } + + protected function setContentLength($newContentLength) + { + $this->contentLength = $newContentLength; + $this->getNumberOfLengthOctets($newContentLength); + } + + /** + * Returns the length of the whole object (including the identifier and length octets). + */ + public function getObjectLength() + { + $nrOfIdentifierOctets = strlen($this->getIdentifier()); + $contentLength = $this->getContentLength(); + $nrOfLengthOctets = $this->getNumberOfLengthOctets($contentLength); + + return $nrOfIdentifierOctets + $nrOfLengthOctets + $contentLength; + } + + public function __toString() + { + return $this->getContent(); + } + + /** + * Returns the name of the ASN.1 Type of this object. + * + * @see Identifier::getName() + */ + public function getTypeName() + { + return Identifier::getName($this->getType()); + } + + /** + * @param string $binaryData + * @param int $offsetIndex + * + * @throws ParserException + * + * @return \FG\ASN1\ASNObject + */ + public static function fromBinary(&$binaryData, &$offsetIndex = 0) + { + if (strlen($binaryData) <= $offsetIndex) { + throw new ParserException('Can not parse binary from data: Offset index larger than input size', $offsetIndex); + } + + $identifierOctet = ord($binaryData[$offsetIndex]); + if (Identifier::isContextSpecificClass($identifierOctet) && Identifier::isConstructed($identifierOctet)) { + return ExplicitlyTaggedObject::fromBinary($binaryData, $offsetIndex); + } + + switch ($identifierOctet) { + case Identifier::BITSTRING: + return BitString::fromBinary($binaryData, $offsetIndex); + case Identifier::BOOLEAN: + return Boolean::fromBinary($binaryData, $offsetIndex); + case Identifier::ENUMERATED: + return Enumerated::fromBinary($binaryData, $offsetIndex); + case Identifier::INTEGER: + return Integer::fromBinary($binaryData, $offsetIndex); + case Identifier::NULL: + return NullObject::fromBinary($binaryData, $offsetIndex); + case Identifier::OBJECT_IDENTIFIER: + return ObjectIdentifier::fromBinary($binaryData, $offsetIndex); + case Identifier::RELATIVE_OID: + return RelativeObjectIdentifier::fromBinary($binaryData, $offsetIndex); + case Identifier::OCTETSTRING: + return OctetString::fromBinary($binaryData, $offsetIndex); + case Identifier::SEQUENCE: + return Sequence::fromBinary($binaryData, $offsetIndex); + case Identifier::SET: + return Set::fromBinary($binaryData, $offsetIndex); + case Identifier::UTC_TIME: + return UTCTime::fromBinary($binaryData, $offsetIndex); + case Identifier::GENERALIZED_TIME: + return GeneralizedTime::fromBinary($binaryData, $offsetIndex); + case Identifier::IA5_STRING: + return IA5String::fromBinary($binaryData, $offsetIndex); + case Identifier::PRINTABLE_STRING: + return PrintableString::fromBinary($binaryData, $offsetIndex); + case Identifier::NUMERIC_STRING: + return NumericString::fromBinary($binaryData, $offsetIndex); + case Identifier::UTF8_STRING: + return UTF8String::fromBinary($binaryData, $offsetIndex); + case Identifier::UNIVERSAL_STRING: + return UniversalString::fromBinary($binaryData, $offsetIndex); + case Identifier::CHARACTER_STRING: + return CharacterString::fromBinary($binaryData, $offsetIndex); + case Identifier::GENERAL_STRING: + return GeneralString::fromBinary($binaryData, $offsetIndex); + case Identifier::VISIBLE_STRING: + return VisibleString::fromBinary($binaryData, $offsetIndex); + case Identifier::GRAPHIC_STRING: + return GraphicString::fromBinary($binaryData, $offsetIndex); + case Identifier::BMP_STRING: + return BMPString::fromBinary($binaryData, $offsetIndex); + case Identifier::T61_STRING: + return T61String::fromBinary($binaryData, $offsetIndex); + case Identifier::OBJECT_DESCRIPTOR: + return ObjectDescriptor::fromBinary($binaryData, $offsetIndex); + default: + // At this point the identifier may be >1 byte. + if (Identifier::isConstructed($identifierOctet)) { + return new UnknownConstructedObject($binaryData, $offsetIndex); + } else { + $identifier = self::parseBinaryIdentifier($binaryData, $offsetIndex); + $lengthOfUnknownObject = self::parseContentLength($binaryData, $offsetIndex); + $offsetIndex += $lengthOfUnknownObject; + + return new UnknownObject($identifier, $lengthOfUnknownObject); + } + } + } + + protected static function parseIdentifier($identifierOctet, $expectedIdentifier, $offsetForExceptionHandling) + { + if (is_string($identifierOctet) || is_numeric($identifierOctet) == false) { + $identifierOctet = ord($identifierOctet); + } + + if ($identifierOctet != $expectedIdentifier) { + $message = 'Can not create an '.Identifier::getName($expectedIdentifier).' from an '.Identifier::getName($identifierOctet); + throw new ParserException($message, $offsetForExceptionHandling); + } + } + + protected static function parseBinaryIdentifier($binaryData, &$offsetIndex) + { + if (strlen($binaryData) <= $offsetIndex) { + throw new ParserException('Can not parse identifier from data: Offset index larger than input size', $offsetIndex); + } + + $identifier = $binaryData[$offsetIndex++]; + + if (Identifier::isLongForm(ord($identifier)) == false) { + return $identifier; + } + + while (true) { + if (strlen($binaryData) <= $offsetIndex) { + throw new ParserException('Can not parse identifier (long form) from data: Offset index larger than input size', $offsetIndex); + } + $nextOctet = $binaryData[$offsetIndex++]; + $identifier .= $nextOctet; + + if ((ord($nextOctet) & 0x80) === 0) { + // the most significant bit is 0 to we have reached the end of the identifier + break; + } + } + + return $identifier; + } + + protected static function parseContentLength(&$binaryData, &$offsetIndex, $minimumLength = 0) + { + if (strlen($binaryData) <= $offsetIndex) { + throw new ParserException('Can not parse content length from data: Offset index larger than input size', $offsetIndex); + } + + $contentLength = ord($binaryData[$offsetIndex++]); + if (($contentLength & 0x80) != 0) { + // bit 8 is set -> this is the long form + $nrOfLengthOctets = $contentLength & 0x7F; + $contentLength = BigInteger::create(0x00); + for ($i = 0; $i < $nrOfLengthOctets; $i++) { + if (strlen($binaryData) <= $offsetIndex) { + throw new ParserException('Can not parse content length (long form) from data: Offset index larger than input size', $offsetIndex); + } + $contentLength = $contentLength->shiftLeft(8)->add(ord($binaryData[$offsetIndex++])); + } + + if ($contentLength->compare(PHP_INT_MAX) > 0) { + throw new ParserException("Can not parse content length from data: length > maximum integer", $offsetIndex); + } + + $contentLength = $contentLength->toInteger(); + } + + if ($contentLength < $minimumLength) { + throw new ParserException('A '.get_called_class()." should have a content length of at least {$minimumLength}. Extracted length was {$contentLength}", $offsetIndex); + } + + $lenDataRemaining = strlen($binaryData) - $offsetIndex; + + if ($lenDataRemaining < $contentLength) { + throw new ParserException("Content length {$contentLength} exceeds remaining data length {$lenDataRemaining}", $offsetIndex); + } + + return $contentLength; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/AbstractString.php b/vendor/fgrosse/phpasn1/lib/ASN1/AbstractString.php new file mode 100644 index 0000000..7e0d7dd --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/AbstractString.php @@ -0,0 +1,136 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1; + +use Exception; + +abstract class AbstractString extends ASNObject implements Parsable +{ + /** @var string */ + protected $value; + private $checkStringForIllegalChars = true; + private $allowedCharacters = []; + + /** + * The abstract base class for ASN.1 classes which represent some string of character. + * + * @param string $string + */ + public function __construct($string) + { + $this->value = $string; + } + + public function getContent() + { + return $this->value; + } + + protected function allowCharacter($character) + { + $this->allowedCharacters[] = $character; + } + + protected function allowCharacters(...$characters) + { + foreach ($characters as $character) { + $this->allowedCharacters[] = $character; + } + } + + protected function allowNumbers() + { + foreach (range('0', '9') as $char) { + $this->allowedCharacters[] = (string) $char; + } + } + + protected function allowAllLetters() + { + $this->allowSmallLetters(); + $this->allowCapitalLetters(); + } + + protected function allowSmallLetters() + { + foreach (range('a', 'z') as $char) { + $this->allowedCharacters[] = $char; + } + } + + protected function allowCapitalLetters() + { + foreach (range('A', 'Z') as $char) { + $this->allowedCharacters[] = $char; + } + } + + protected function allowSpaces() + { + $this->allowedCharacters[] = ' '; + } + + protected function allowAll() + { + $this->checkStringForIllegalChars = false; + } + + protected function calculateContentLength() + { + return strlen($this->value); + } + + protected function getEncodedValue() + { + if ($this->checkStringForIllegalChars) { + $this->checkString(); + } + + return $this->value; + } + + protected function checkString() + { + $stringLength = $this->getContentLength(); + for ($i = 0; $i < $stringLength; $i++) { + if (in_array($this->value[$i], $this->allowedCharacters) == false) { + $typeName = Identifier::getName($this->getType()); + throw new Exception("Could not create a {$typeName} from the character sequence '{$this->value}'."); + } + } + } + + public static function fromBinary(&$binaryData, &$offsetIndex = 0) + { + $parsedObject = new static(''); + + self::parseIdentifier($binaryData[$offsetIndex], $parsedObject->getType(), $offsetIndex++); + $contentLength = self::parseContentLength($binaryData, $offsetIndex); + $string = substr($binaryData, $offsetIndex, $contentLength); + $offsetIndex += $contentLength; + + $parsedObject->value = $string; + $parsedObject->setContentLength($contentLength); + return $parsedObject; + } + + public static function isValid($string) + { + $testObject = new static($string); + try { + $testObject->checkString(); + + return true; + } catch (Exception $exception) { + return false; + } + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/AbstractTime.php b/vendor/fgrosse/phpasn1/lib/ASN1/AbstractTime.php new file mode 100644 index 0000000..9fad505 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/AbstractTime.php @@ -0,0 +1,78 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1; + +use DateInterval; +use DateTime; +use DateTimeZone; +use Exception; + +abstract class AbstractTime extends ASNObject +{ + /** @var DateTime */ + protected $value; + + public function __construct($dateTime = null, $dateTimeZone = 'UTC') + { + if ($dateTime == null || is_string($dateTime)) { + $timeZone = new DateTimeZone($dateTimeZone); + $dateTimeObject = new DateTime($dateTime, $timeZone); + if ($dateTimeObject == false) { + $errorMessage = $this->getLastDateTimeErrors(); + $className = Identifier::getName($this->getType()); + throw new Exception(sprintf("Could not create %s from date time string '%s': %s", $className, $dateTime, $errorMessage)); + } + $dateTime = $dateTimeObject; + } elseif (!$dateTime instanceof DateTime) { + throw new Exception('Invalid first argument for some instance of AbstractTime constructor'); + } + + $this->value = $dateTime; + } + + public function getContent() + { + return $this->value; + } + + protected function getLastDateTimeErrors() + { + $messages = ''; + $lastErrors = DateTime::getLastErrors(); + foreach ($lastErrors['errors'] as $errorMessage) { + $messages .= "{$errorMessage}, "; + } + + return substr($messages, 0, -2); + } + + public function __toString() + { + return $this->value->format("Y-m-d\tH:i:s"); + } + + protected static function extractTimeZoneData(&$binaryData, &$offsetIndex, DateTime $dateTime) + { + $sign = $binaryData[$offsetIndex++]; + $timeOffsetHours = intval(substr($binaryData, $offsetIndex, 2)); + $timeOffsetMinutes = intval(substr($binaryData, $offsetIndex + 2, 2)); + $offsetIndex += 4; + + $interval = new DateInterval("PT{$timeOffsetHours}H{$timeOffsetMinutes}M"); + if ($sign == '+') { + $dateTime->sub($interval); + } else { + $dateTime->add($interval); + } + + return $dateTime; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Base128.php b/vendor/fgrosse/phpasn1/lib/ASN1/Base128.php new file mode 100644 index 0000000..119ee7b --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Base128.php @@ -0,0 +1,63 @@ +modulus(0x80)->toInteger()); + + $value = $value->shiftRight(7); + while ($value->compare(0) > 0) { + $octets .= chr(0x80 | $value->modulus(0x80)->toInteger()); + $value = $value->shiftRight(7); + } + + return strrev($octets); + } + + /** + * @param string $octets + * + * @throws InvalidArgumentException if the given octets represent a malformed base-128 value or the decoded value would exceed the the maximum integer length + * + * @return int + */ + public static function decode($octets) + { + $bitsPerOctet = 7; + $value = BigInteger::create(0); + $i = 0; + + while (true) { + if (!isset($octets[$i])) { + throw new InvalidArgumentException(sprintf('Malformed base-128 encoded value (0x%s).', strtoupper(bin2hex($octets)) ?: '0')); + } + + $octet = ord($octets[$i++]); + + $l1 = $value->shiftLeft($bitsPerOctet); + $r1 = $octet & 0x7f; + $value = $l1->add($r1); + + if (0 === ($octet & 0x80)) { + break; + } + } + + return (string)$value; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Composite/AttributeTypeAndValue.php b/vendor/fgrosse/phpasn1/lib/ASN1/Composite/AttributeTypeAndValue.php new file mode 100644 index 0000000..3f4027c --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Composite/AttributeTypeAndValue.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Composite; + +use FG\ASN1\ASNObject; +use FG\ASN1\Universal\Sequence; +use FG\ASN1\Universal\ObjectIdentifier; + +class AttributeTypeAndValue extends Sequence +{ + /** + * @param ObjectIdentifier|string $objIdentifier + * @param \FG\ASN1\ASNObject $value + */ + public function __construct($objIdentifier, ASNObject $value) + { + if ($objIdentifier instanceof ObjectIdentifier == false) { + $objIdentifier = new ObjectIdentifier($objIdentifier); + } + parent::__construct($objIdentifier, $value); + } + + public function __toString() + { + return $this->children[0].': '.$this->children[1]; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Composite/RDNString.php b/vendor/fgrosse/phpasn1/lib/ASN1/Composite/RDNString.php new file mode 100644 index 0000000..e95e7ac --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Composite/RDNString.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Composite; + +use FG\ASN1\Universal\PrintableString; +use FG\ASN1\Universal\IA5String; +use FG\ASN1\Universal\UTF8String; + +class RDNString extends RelativeDistinguishedName +{ + /** + * @param string|\FG\ASN1\Universal\ObjectIdentifier $objectIdentifierString + * @param string|\FG\ASN1\ASNObject $value + */ + public function __construct($objectIdentifierString, $value) + { + if (PrintableString::isValid($value)) { + $value = new PrintableString($value); + } else { + if (IA5String::isValid($value)) { + $value = new IA5String($value); + } else { + $value = new UTF8String($value); + } + } + + parent::__construct($objectIdentifierString, $value); + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Composite/RelativeDistinguishedName.php b/vendor/fgrosse/phpasn1/lib/ASN1/Composite/RelativeDistinguishedName.php new file mode 100644 index 0000000..4185f41 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Composite/RelativeDistinguishedName.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Composite; + +use FG\ASN1\Exception\NotImplementedException; +use FG\ASN1\ASNObject; +use FG\ASN1\Universal\Set; + +class RelativeDistinguishedName extends Set +{ + /** + * @param string|\FG\ASN1\Universal\ObjectIdentifier $objIdentifierString + * @param \FG\ASN1\ASNObject $value + */ + public function __construct($objIdentifierString, ASNObject $value) + { + // TODO: This does only support one element in the RelativeDistinguishedName Set but it it is defined as follows: + // RelativeDistinguishedName ::= SET SIZE (1..MAX) OF AttributeTypeAndValue + parent::__construct(new AttributeTypeAndValue($objIdentifierString, $value)); + } + + public function getContent() + { + /** @var \FG\ASN1\ASNObject $firstObject */ + $firstObject = $this->children[0]; + return $firstObject->__toString(); + } + + /** + * At the current version this code can not work since the implementation of Construct requires + * the class to support a constructor without arguments. + * + * @deprecated this function is not yet implemented! Feel free to submit a pull request on github + * @param string $binaryData + * @param int $offsetIndex + * @throws NotImplementedException + */ + public static function fromBinary(&$binaryData, &$offsetIndex = 0) + { + throw new NotImplementedException(); + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Construct.php b/vendor/fgrosse/phpasn1/lib/ASN1/Construct.php new file mode 100644 index 0000000..58f9613 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Construct.php @@ -0,0 +1,191 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1; + +use ArrayAccess; +use ArrayIterator; +use Countable; +use FG\ASN1\Exception\ParserException; +use Iterator; + +abstract class Construct extends ASNObject implements Countable, ArrayAccess, Iterator, Parsable +{ + /** @var \FG\ASN1\ASNObject[] */ + protected $children; + private $iteratorPosition; + + /** + * @param \FG\ASN1\ASNObject[] $children the variadic type hint is commented due to https://github.com/facebook/hhvm/issues/4858 + */ + public function __construct(/* HH_FIXME[4858]: variadic + strict */ ...$children) + { + $this->children = $children; + $this->iteratorPosition = 0; + } + + public function getContent() + { + return $this->children; + } + + public function rewind() + { + $this->iteratorPosition = 0; + } + + public function current() + { + return $this->children[$this->iteratorPosition]; + } + + public function key() + { + return $this->iteratorPosition; + } + + public function next() + { + $this->iteratorPosition++; + } + + public function valid() + { + return isset($this->children[$this->iteratorPosition]); + } + + public function offsetExists($offset) + { + return array_key_exists($offset, $this->children); + } + + public function offsetGet($offset) + { + return $this->children[$offset]; + } + + public function offsetSet($offset, $value) + { + if ($offset === null) { + $offset = count($this->children); + } + + $this->children[$offset] = $value; + } + + public function offsetUnset($offset) + { + unset($this->children[$offset]); + } + + protected function calculateContentLength() + { + $length = 0; + foreach ($this->children as $component) { + $length += $component->getObjectLength(); + } + + return $length; + } + + protected function getEncodedValue() + { + $result = ''; + foreach ($this->children as $component) { + $result .= $component->getBinary(); + } + + return $result; + } + + public function addChild(ASNObject $child) + { + $this->children[] = $child; + } + + public function addChildren(array $children) + { + foreach ($children as $child) { + $this->addChild($child); + } + } + + public function __toString() + { + $nrOfChildren = $this->getNumberOfChildren(); + $childString = $nrOfChildren == 1 ? 'child' : 'children'; + + return "[{$nrOfChildren} {$childString}]"; + } + + public function getNumberOfChildren() + { + return count($this->children); + } + + /** + * @return \FG\ASN1\ASNObject[] + */ + public function getChildren() + { + return $this->children; + } + + /** + * @return \FG\ASN1\ASNObject + */ + public function getFirstChild() + { + return $this->children[0]; + } + + /** + * @param string $binaryData + * @param int $offsetIndex + * + * @throws Exception\ParserException + * + * @return Construct|static + */ + public static function fromBinary(&$binaryData, &$offsetIndex = 0) + { + $parsedObject = new static(); + self::parseIdentifier($binaryData[$offsetIndex], $parsedObject->getType(), $offsetIndex++); + $contentLength = self::parseContentLength($binaryData, $offsetIndex); + $startIndex = $offsetIndex; + + $children = []; + $octetsToRead = $contentLength; + while ($octetsToRead > 0) { + $newChild = ASNObject::fromBinary($binaryData, $offsetIndex); + $octetsToRead -= $newChild->getObjectLength(); + $children[] = $newChild; + } + + if ($octetsToRead !== 0) { + throw new ParserException("Sequence length incorrect", $startIndex); + } + + $parsedObject->addChildren($children); + $parsedObject->setContentLength($contentLength); + + return $parsedObject; + } + + public function count($mode = COUNT_NORMAL) + { + return count($this->children, $mode); + } + + public function getIterator() + { + return new ArrayIterator($this->children); + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Exception/NotImplementedException.php b/vendor/fgrosse/phpasn1/lib/ASN1/Exception/NotImplementedException.php new file mode 100644 index 0000000..c9f8e82 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Exception/NotImplementedException.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Exception; + +class NotImplementedException extends \Exception +{ +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Exception/ParserException.php b/vendor/fgrosse/phpasn1/lib/ASN1/Exception/ParserException.php new file mode 100644 index 0000000..4bda4e8 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Exception/ParserException.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Exception; + +class ParserException extends \Exception +{ + private $errorMessage; + private $offset; + + public function __construct($errorMessage, $offset) + { + $this->errorMessage = $errorMessage; + $this->offset = $offset; + parent::__construct("ASN.1 Parser Exception at offset {$this->offset}: {$this->errorMessage}"); + } + + public function getOffset() + { + return $this->offset; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/ExplicitlyTaggedObject.php b/vendor/fgrosse/phpasn1/lib/ASN1/ExplicitlyTaggedObject.php new file mode 100644 index 0000000..b947a95 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/ExplicitlyTaggedObject.php @@ -0,0 +1,131 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1; + +use FG\ASN1\Exception\ParserException; + +/** + * Class ExplicitlyTaggedObject decorate an inner object with an additional tag that gives information about + * its context specific meaning. + * + * Explanation taken from A Layman's Guide to a Subset of ASN.1, BER, and DER: + * >>> An RSA Laboratories Technical Note + * >>> Burton S. Kaliski Jr. + * >>> Revised November 1, 1993 + * + * [...] + * Explicitly tagged types are derived from other types by adding an outer tag to the underlying type. + * In effect, explicitly tagged types are structured types consisting of one component, the underlying type. + * Explicit tagging is denoted by the ASN.1 keywords [class number] EXPLICIT (see Section 5.2). + * [...] + * + * @see http://luca.ntop.org/Teaching/Appunti/asn1.html + */ +class ExplicitlyTaggedObject extends ASNObject +{ + /** @var \FG\ASN1\ASNObject[] */ + private $decoratedObjects; + private $tag; + + /** + * @param int $tag + * @param \FG\ASN1\ASNObject $objects,... + */ + public function __construct($tag, /* HH_FIXME[4858]: variadic + strict */ ...$objects) + { + $this->tag = $tag; + $this->decoratedObjects = $objects; + } + + protected function calculateContentLength() + { + $length = 0; + foreach ($this->decoratedObjects as $object) { + $length += $object->getObjectLength(); + } + + return $length; + } + + protected function getEncodedValue() + { + $encoded = ''; + foreach ($this->decoratedObjects as $object) { + $encoded .= $object->getBinary(); + } + + return $encoded; + } + + public function getContent() + { + return $this->decoratedObjects; + } + + public function __toString() + { + switch ($length = count($this->decoratedObjects)) { + case 0: + return "Context specific empty object with tag [{$this->tag}]"; + case 1: + $decoratedType = Identifier::getShortName($this->decoratedObjects[0]->getType()); + return "Context specific $decoratedType with tag [{$this->tag}]"; + default: + return "$length context specific objects with tag [{$this->tag}]"; + } + } + + public function getType() + { + return ord($this->getIdentifier()); + } + + public function getIdentifier() + { + $identifier = Identifier::create(Identifier::CLASS_CONTEXT_SPECIFIC, true, $this->tag); + + return is_int($identifier) ? chr($identifier) : $identifier; + } + + public function getTag() + { + return $this->tag; + } + + public static function fromBinary(&$binaryData, &$offsetIndex = 0) + { + $identifier = self::parseBinaryIdentifier($binaryData, $offsetIndex); + $firstIdentifierOctet = ord($identifier); + assert(Identifier::isContextSpecificClass($firstIdentifierOctet), 'identifier octet should indicate context specific class'); + assert(Identifier::isConstructed($firstIdentifierOctet), 'identifier octet should indicate constructed object'); + $tag = Identifier::getTagNumber($identifier); + + $totalContentLength = self::parseContentLength($binaryData, $offsetIndex); + $remainingContentLength = $totalContentLength; + + $offsetIndexOfDecoratedObject = $offsetIndex; + $decoratedObjects = []; + + while ($remainingContentLength > 0) { + $nextObject = ASNObject::fromBinary($binaryData, $offsetIndex); + $remainingContentLength -= $nextObject->getObjectLength(); + $decoratedObjects[] = $nextObject; + } + + if ($remainingContentLength != 0) { + throw new ParserException("Context-Specific explicitly tagged object [$tag] starting at offset $offsetIndexOfDecoratedObject specifies a length of $totalContentLength octets but $remainingContentLength remain after parsing the content", $offsetIndexOfDecoratedObject); + } + + $parsedObject = new self($tag, ...$decoratedObjects); + $parsedObject->setContentLength($totalContentLength); + return $parsedObject; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Identifier.php b/vendor/fgrosse/phpasn1/lib/ASN1/Identifier.php new file mode 100644 index 0000000..b21caa3 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Identifier.php @@ -0,0 +1,339 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1; + +use Exception; + +/** + * The Identifier encodes the ASN.1 tag (class and number) of the type of a data value. + * + * Every identifier whose number is in the range 0 to 30 has the following structure: + * + * Bits: 8 7 6 5 4 3 2 1 + * | Class | P/C | Tag number | + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * Bits 8 and 7 define the class of this type ( Universal, Application, Context-specific or Private). + * Bit 6 encoded whether this type is primitive or constructed + * The remaining bits 5 - 1 encode the tag number + */ +class Identifier +{ + const CLASS_UNIVERSAL = 0x00; + const CLASS_APPLICATION = 0x01; + const CLASS_CONTEXT_SPECIFIC = 0x02; + const CLASS_PRIVATE = 0x03; + + const EOC = 0x00; // unsupported for now + const BOOLEAN = 0x01; + const INTEGER = 0x02; + const BITSTRING = 0x03; + const OCTETSTRING = 0x04; + const NULL = 0x05; + const OBJECT_IDENTIFIER = 0x06; + const OBJECT_DESCRIPTOR = 0x07; + const EXTERNAL = 0x08; // unsupported for now + const REAL = 0x09; // unsupported for now + const ENUMERATED = 0x0A; + const EMBEDDED_PDV = 0x0B; // unsupported for now + const UTF8_STRING = 0x0C; + const RELATIVE_OID = 0x0D; + // value 0x0E and 0x0F are reserved for future use + + const SEQUENCE = 0x30; + const SET = 0x31; + const NUMERIC_STRING = 0x12; + const PRINTABLE_STRING = 0x13; + const T61_STRING = 0x14; // sometimes referred to as TeletextString + const VIDEOTEXT_STRING = 0x15; + const IA5_STRING = 0x16; + const UTC_TIME = 0x17; + const GENERALIZED_TIME = 0x18; + const GRAPHIC_STRING = 0x19; + const VISIBLE_STRING = 0x1A; + const GENERAL_STRING = 0x1B; + const UNIVERSAL_STRING = 0x1C; + const CHARACTER_STRING = 0x1D; // Unrestricted character type + const BMP_STRING = 0x1E; + + const LONG_FORM = 0x1F; + const IS_CONSTRUCTED = 0x20; + + /** + * Creates an identifier. Short form identifiers are returned as integers + * for BC, long form identifiers will be returned as a string of octets. + * + * @param int $class + * @param bool $isConstructed + * @param int $tagNumber + * + * @throws Exception if the given arguments are invalid + * + * @return int|string + */ + public static function create($class, $isConstructed, $tagNumber) + { + if (!is_numeric($class) || $class < self::CLASS_UNIVERSAL || $class > self::CLASS_PRIVATE) { + throw new Exception(sprintf('Invalid class %d given', $class)); + } + + if (!is_bool($isConstructed)) { + throw new Exception("\$isConstructed must be a boolean value ($isConstructed given)"); + } + + $tagNumber = self::makeNumeric($tagNumber); + if ($tagNumber < 0) { + throw new Exception(sprintf('Invalid $tagNumber %d given. You can only use positive integers.', $tagNumber)); + } + + if ($tagNumber < self::LONG_FORM) { + return ($class << 6) | ($isConstructed << 5) | $tagNumber; + } + + $firstOctet = ($class << 6) | ($isConstructed << 5) | self::LONG_FORM; + + // Tag numbers formatted in long form are base-128 encoded. See X.609#8.1.2.4 + return chr($firstOctet).Base128::encode($tagNumber); + } + + public static function isConstructed($identifierOctet) + { + return ($identifierOctet & self::IS_CONSTRUCTED) === self::IS_CONSTRUCTED; + } + + public static function isLongForm($identifierOctet) + { + return ($identifierOctet & self::LONG_FORM) === self::LONG_FORM; + } + + /** + * Return the name of the mapped ASN.1 type with a preceding "ASN.1 ". + * + * Example: ASN.1 Octet String + * + * @see Identifier::getShortName() + * + * @param int|string $identifier + * + * @return string + */ + public static function getName($identifier) + { + $identifierOctet = self::makeNumeric($identifier); + + $typeName = static::getShortName($identifier); + + if (($identifierOctet & self::LONG_FORM) < self::LONG_FORM) { + $typeName = "ASN.1 {$typeName}"; + } + + return $typeName; + } + + /** + * Return the short version of the type name. + * + * If the given identifier octet can be mapped to a known universal type this will + * return its name. Else Identifier::getClassDescription() is used to retrieve + * information about the identifier. + * + * @see Identifier::getName() + * @see Identifier::getClassDescription() + * + * @param int|string $identifier + * + * @return string + */ + public static function getShortName($identifier) + { + $identifierOctet = self::makeNumeric($identifier); + + switch ($identifierOctet) { + case self::EOC: + return 'End-of-contents octet'; + case self::BOOLEAN: + return 'Boolean'; + case self::INTEGER: + return 'Integer'; + case self::BITSTRING: + return 'Bit String'; + case self::OCTETSTRING: + return 'Octet String'; + case self::NULL: + return 'NULL'; + case self::OBJECT_IDENTIFIER: + return 'Object Identifier'; + case self::OBJECT_DESCRIPTOR: + return 'Object Descriptor'; + case self::EXTERNAL: + return 'External Type'; + case self::REAL: + return 'Real'; + case self::ENUMERATED: + return 'Enumerated'; + case self::EMBEDDED_PDV: + return 'Embedded PDV'; + case self::UTF8_STRING: + return 'UTF8 String'; + case self::RELATIVE_OID: + return 'Relative OID'; + case self::SEQUENCE: + return 'Sequence'; + case self::SET: + return 'Set'; + case self::NUMERIC_STRING: + return 'Numeric String'; + case self::PRINTABLE_STRING: + return 'Printable String'; + case self::T61_STRING: + return 'T61 String'; + case self::VIDEOTEXT_STRING: + return 'Videotext String'; + case self::IA5_STRING: + return 'IA5 String'; + case self::UTC_TIME: + return 'UTC Time'; + case self::GENERALIZED_TIME: + return 'Generalized Time'; + case self::GRAPHIC_STRING: + return 'Graphic String'; + case self::VISIBLE_STRING: + return 'Visible String'; + case self::GENERAL_STRING: + return 'General String'; + case self::UNIVERSAL_STRING: + return 'Universal String'; + case self::CHARACTER_STRING: + return 'Character String'; + case self::BMP_STRING: + return 'BMP String'; + + case 0x0E: + return 'RESERVED (0x0E)'; + case 0x0F: + return 'RESERVED (0x0F)'; + + case self::LONG_FORM: + default: + $classDescription = self::getClassDescription($identifier); + + if (is_int($identifier)) { + $identifier = chr($identifier); + } + + return "$classDescription (0x".strtoupper(bin2hex($identifier)).')'; + } + } + + /** + * Returns a textual description of the information encoded in a given identifier octet. + * + * The first three (most significant) bytes are evaluated to determine if this is a + * constructed or primitive type and if it is either universal, application, context-specific or + * private. + * + * Example: + * Constructed context-specific + * Primitive universal + * + * @param int|string $identifier + * + * @return string + */ + public static function getClassDescription($identifier) + { + $identifierOctet = self::makeNumeric($identifier); + + if (self::isConstructed($identifierOctet)) { + $classDescription = 'Constructed '; + } else { + $classDescription = 'Primitive '; + } + $classBits = $identifierOctet >> 6; + switch ($classBits) { + case self::CLASS_UNIVERSAL: + $classDescription .= 'universal'; + break; + case self::CLASS_APPLICATION: + $classDescription .= 'application'; + break; + case self::CLASS_CONTEXT_SPECIFIC: + $tagNumber = self::getTagNumber($identifier); + $classDescription = "[$tagNumber] Context-specific"; + break; + case self::CLASS_PRIVATE: + $classDescription .= 'private'; + break; + + default: + return "INVALID IDENTIFIER OCTET: {$identifierOctet}"; + } + + return $classDescription; + } + + /** + * @param int|string $identifier + * + * @return int + */ + public static function getTagNumber($identifier) + { + $firstOctet = self::makeNumeric($identifier); + $tagNumber = $firstOctet & self::LONG_FORM; + + if ($tagNumber < self::LONG_FORM) { + return $tagNumber; + } + + if (is_numeric($identifier)) { + $identifier = chr($identifier); + } + return Base128::decode(substr($identifier, 1)); + } + + public static function isUniversalClass($identifier) + { + $identifier = self::makeNumeric($identifier); + + return $identifier >> 6 == self::CLASS_UNIVERSAL; + } + + public static function isApplicationClass($identifier) + { + $identifier = self::makeNumeric($identifier); + + return $identifier >> 6 == self::CLASS_APPLICATION; + } + + public static function isContextSpecificClass($identifier) + { + $identifier = self::makeNumeric($identifier); + + return $identifier >> 6 == self::CLASS_CONTEXT_SPECIFIC; + } + + public static function isPrivateClass($identifier) + { + $identifier = self::makeNumeric($identifier); + + return $identifier >> 6 == self::CLASS_PRIVATE; + } + + private static function makeNumeric($identifierOctet) + { + if (!is_numeric($identifierOctet)) { + return ord($identifierOctet); + } else { + return $identifierOctet; + } + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/OID.php b/vendor/fgrosse/phpasn1/lib/ASN1/OID.php new file mode 100644 index 0000000..d4875c7 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/OID.php @@ -0,0 +1,199 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1; + +class OID +{ + const RSA_ENCRYPTION = '1.2.840.113549.1.1.1'; + const MD5_WITH_RSA_ENCRYPTION = '1.2.840.113549.1.1.4'; + const SHA1_WITH_RSA_SIGNATURE = '1.2.840.113549.1.1.5'; + const SHA256_WITH_RSA_SIGNATURE = '1.2.840.113549.1.1.11'; + const PKCS9_EMAIL = '1.2.840.113549.1.9.1'; + const PKCS9_UNSTRUCTURED_NAME = '1.2.840.113549.1.9.2'; + const PKCS9_CONTENT_TYPE = '1.2.840.113549.1.9.3'; + const PKCS9_MESSAGE_DIGEST = '1.2.840.113549.1.9.4'; + const PKCS9_SIGNING_TIME = '1.2.840.113549.1.9.5'; + const PKCS9_EXTENSION_REQUEST = '1.2.840.113549.1.9.14'; + + // certificate extension identifier + const CERT_EXT_SUBJECT_DIRECTORY_ATTR = '2.5.29.9'; + const CERT_EXT_SUBJECT_KEY_IDENTIFIER = '2.5.29.14'; + const CERT_EXT_KEY_USAGE = '2.5.29.15'; + const CERT_EXT_PRIVATE_KEY_USAGE_PERIOD = '2.5.29.16'; + const CERT_EXT_SUBJECT_ALT_NAME = '2.5.29.17'; + const CERT_EXT_ISSUER_ALT_NAME = '2.5.29.18'; + const CERT_EXT_BASIC_CONSTRAINTS = '2.5.29.19'; + const CERT_EXT_CRL_NUMBER = '2.5.29.20'; + const CERT_EXT_REASON_CODE = '2.5.29.21'; + const CERT_EXT_INVALIDITY_DATE = '2.5.29.24'; + const CERT_EXT_DELTA_CRL_INDICATOR = '2.5.29.27'; + const CERT_EXT_ISSUING_DIST_POINT = '2.5.29.28'; + const CERT_EXT_CERT_ISSUER = '2.5.29.29'; + const CERT_EXT_NAME_CONSTRAINTS = '2.5.29.30'; + const CERT_EXT_CRL_DISTRIBUTION_POINTS = '2.5.29.31'; + const CERT_EXT_CERT_POLICIES = '2.5.29.32'; + const CERT_EXT_AUTHORITY_KEY_IDENTIFIER = '2.5.29.35'; + const CERT_EXT_EXTENDED_KEY_USAGE = '2.5.29.37'; + + // standard certificate files + const COMMON_NAME = '2.5.4.3'; + const SURNAME = '2.5.4.4'; + const SERIAL_NUMBER = '2.5.4.5'; + const COUNTRY_NAME = '2.5.4.6'; + const LOCALITY_NAME = '2.5.4.7'; + const STATE_OR_PROVINCE_NAME = '2.5.4.8'; + const STREET_ADDRESS = '2.5.4.9'; + const ORGANIZATION_NAME = '2.5.4.10'; + const OU_NAME = '2.5.4.11'; + const TITLE = '2.5.4.12'; + const DESCRIPTION = '2.5.4.13'; + const POSTAL_ADDRESS = '2.5.4.16'; + const POSTAL_CODE = '2.5.4.17'; + const AUTHORITY_REVOCATION_LIST = '2.5.4.38'; + + const AUTHORITY_INFORMATION_ACCESS = '1.3.6.1.5.5.7.1.1'; + + /** + * Returns the name of the given object identifier. + * + * Some OIDs are saved as class constants in this class. + * If the wanted oidString is not among them, this method will + * query http://oid-info.com for the right name. + * This behavior can be suppressed by setting the second method parameter to false. + * + * @param string $oidString + * @param bool $loadFromWeb + * + * @see self::loadFromWeb($oidString) + * + * @return string + */ + public static function getName($oidString, $loadFromWeb = true) + { + switch ($oidString) { + case self::RSA_ENCRYPTION: + return 'RSA Encryption'; + case self::MD5_WITH_RSA_ENCRYPTION: + return 'MD5 with RSA Encryption'; + case self::SHA1_WITH_RSA_SIGNATURE: + return 'SHA-1 with RSA Signature'; + + case self::PKCS9_EMAIL: + return 'PKCS #9 Email Address'; + case self::PKCS9_UNSTRUCTURED_NAME: + return 'PKCS #9 Unstructured Name'; + case self::PKCS9_CONTENT_TYPE: + return 'PKCS #9 Content Type'; + case self::PKCS9_MESSAGE_DIGEST: + return 'PKCS #9 Message Digest'; + case self::PKCS9_SIGNING_TIME: + return 'PKCS #9 Signing Time'; + + case self::COMMON_NAME: + return 'Common Name'; + case self::SURNAME: + return 'Surname'; + case self::SERIAL_NUMBER: + return 'Serial Number'; + case self::COUNTRY_NAME: + return 'Country Name'; + case self::LOCALITY_NAME: + return 'Locality Name'; + case self::STATE_OR_PROVINCE_NAME: + return 'State or Province Name'; + case self::STREET_ADDRESS: + return 'Street Address'; + case self::ORGANIZATION_NAME: + return 'Organization Name'; + case self::OU_NAME: + return 'Organization Unit Name'; + case self::TITLE: + return 'Title'; + case self::DESCRIPTION: + return 'Description'; + case self::POSTAL_ADDRESS: + return 'Postal Address'; + case self::POSTAL_CODE: + return 'Postal Code'; + case self::AUTHORITY_REVOCATION_LIST: + return 'Authority Revocation List'; + + case self::CERT_EXT_SUBJECT_DIRECTORY_ATTR: + return 'Subject directory attributes'; + case self::CERT_EXT_SUBJECT_KEY_IDENTIFIER: + return 'Subject key identifier'; + case self::CERT_EXT_KEY_USAGE: + return 'Key usage certificate extension'; + case self::CERT_EXT_PRIVATE_KEY_USAGE_PERIOD: + return 'Private key usage'; + case self::CERT_EXT_SUBJECT_ALT_NAME: + return 'Subject alternative name (SAN)'; + case self::CERT_EXT_ISSUER_ALT_NAME: + return 'Issuer alternative name'; + case self::CERT_EXT_BASIC_CONSTRAINTS: + return 'Basic constraints'; + case self::CERT_EXT_CRL_NUMBER: + return 'CRL number'; + case self::CERT_EXT_REASON_CODE: + return 'Reason code'; + case self::CERT_EXT_INVALIDITY_DATE: + return 'Invalidity code'; + case self::CERT_EXT_DELTA_CRL_INDICATOR: + return 'Delta CRL indicator'; + case self::CERT_EXT_ISSUING_DIST_POINT: + return 'Issuing distribution point'; + case self::CERT_EXT_CERT_ISSUER: + return 'Certificate issuer'; + case self::CERT_EXT_NAME_CONSTRAINTS: + return 'Name constraints'; + case self::CERT_EXT_CRL_DISTRIBUTION_POINTS: + return 'CRL distribution points'; + case self::CERT_EXT_CERT_POLICIES: + return 'Certificate policies '; + case self::CERT_EXT_AUTHORITY_KEY_IDENTIFIER: + return 'Authority key identifier'; + case self::CERT_EXT_EXTENDED_KEY_USAGE: + return 'Extended key usage'; + case self::AUTHORITY_INFORMATION_ACCESS: + return 'Certificate Authority Information Access (AIA)'; + + default: + if ($loadFromWeb) { + return self::loadFromWeb($oidString); + } else { + return $oidString; + } + } + } + + public static function loadFromWeb($oidString) + { + $ch = curl_init("http://oid-info.com/get/{$oidString}"); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_HEADER, 0); + + $contents = curl_exec($ch); + curl_close($ch); + + // This pattern needs to be updated as soon as the website layout of oid-info.com changes + preg_match_all('#(.+)\(\d+\)#si', $contents, $oidName); + + if (empty($oidName[1])) { + return "{$oidString} (unknown)"; + } + + $oidName = ucfirst(strtolower(preg_replace('/([A-Z][a-z])/', ' $1', $oidName[1][0]))); + $oidName = str_replace('-', ' ', $oidName); + + return "{$oidName} ({$oidString})"; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Parsable.php b/vendor/fgrosse/phpasn1/lib/ASN1/Parsable.php new file mode 100644 index 0000000..fa66b55 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Parsable.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1; + +use FG\ASN1\Exception\ParserException; + +/** + * The Parsable interface describes classes that can be parsed from their binary DER representation. + */ +interface Parsable +{ + /** + * Parse an instance of this class from its binary DER encoded representation. + * + * @param string $binaryData + * @param int $offsetIndex the offset at which parsing of the $binaryData is started. This parameter ill be modified + * to contain the offset index of the next object after this object has been parsed + * + * @throws ParserException if the given binary data is either invalid or not currently supported + * + * @return static + */ + public static function fromBinary(&$binaryData, &$offsetIndex = null); +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/TemplateParser.php b/vendor/fgrosse/phpasn1/lib/ASN1/TemplateParser.php new file mode 100644 index 0000000..90a40b0 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/TemplateParser.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1; + +use Exception; +use FG\ASN1\Exception\ParserException; +use FG\ASN1\Universal\Sequence; + +class TemplateParser +{ + /** + * @param string $data + * @param array $template + * @return \FG\ASN1\ASNObject|Sequence + * @throws ParserException if there was an issue parsing + */ + public function parseBase64($data, array $template) + { + // TODO test with invalid data + return $this->parseBinary(base64_decode($data), $template); + } + + /** + * @param string $binary + * @param array $template + * @return \FG\ASN1\ASNObject|Sequence + * @throws ParserException if there was an issue parsing + */ + public function parseBinary($binary, array $template) + { + $parsedObject = ASNObject::fromBinary($binary); + + foreach ($template as $key => $value) { + $this->validate($parsedObject, $key, $value); + } + + return $parsedObject; + } + + private function validate(ASNObject $object, $key, $value) + { + if (is_array($value)) { + $this->assertTypeId($key, $object); + + /* @var Construct $object */ + foreach ($value as $key => $child) { + $this->validate($object->current(), $key, $child); + $object->next(); + } + } else { + $this->assertTypeId($value, $object); + } + } + + private function assertTypeId($expectedTypeId, ASNObject $object) + { + $actualType = $object->getType(); + if ($expectedTypeId != $actualType) { + throw new Exception("Expected type ($expectedTypeId) does not match actual type ($actualType"); + } + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/BMPString.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/BMPString.php new file mode 100644 index 0000000..83ec6a9 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/BMPString.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use FG\ASN1\AbstractString; +use FG\ASN1\Identifier; + +class BMPString extends AbstractString +{ + /** + * Creates a new ASN.1 BMP String. + * + * BMPString is a subtype of UniversalString that has its own + * unique tag and contains only the characters in the + * Basic Multilingual Plane (those corresponding to the first + * 64K-2 cells, less cells whose encoding is used to address + * characters outside the Basic Multilingual Plane) of ISO/IEC 10646-1. + * + * TODO The encodable characters of this type are not yet checked. + * + * @param string $string + */ + public function __construct($string) + { + $this->value = $string; + $this->allowAll(); + } + + public function getType() + { + return Identifier::BMP_STRING; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/BitString.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/BitString.php new file mode 100644 index 0000000..226695c --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/BitString.php @@ -0,0 +1,88 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use Exception; +use FG\ASN1\Exception\ParserException; +use FG\ASN1\Parsable; +use FG\ASN1\Identifier; + +class BitString extends OctetString implements Parsable +{ + private $nrOfUnusedBits; + + /** + * Creates a new ASN.1 BitString object. + * + * @param string|int $value Either the hexadecimal value as a string (spaces are allowed - leading 0x is optional) or a numeric value + * @param int $nrOfUnusedBits the number of unused bits in the last octet [optional]. + * + * @throws Exception if the second parameter is no positive numeric value + */ + public function __construct($value, $nrOfUnusedBits = 0) + { + parent::__construct($value); + + if (!is_numeric($nrOfUnusedBits) || $nrOfUnusedBits < 0) { + throw new Exception('BitString: second parameter needs to be a positive number (or zero)!'); + } + + $this->nrOfUnusedBits = $nrOfUnusedBits; + } + + public function getType() + { + return Identifier::BITSTRING; + } + + protected function calculateContentLength() + { + // add one to the length for the first octet which encodes the number of unused bits in the last octet + return parent::calculateContentLength() + 1; + } + + protected function getEncodedValue() + { + // the first octet determines the number of unused bits + $nrOfUnusedBitsOctet = chr($this->nrOfUnusedBits); + $actualContent = parent::getEncodedValue(); + + return $nrOfUnusedBitsOctet.$actualContent; + } + + public function getNumberOfUnusedBits() + { + return $this->nrOfUnusedBits; + } + + public static function fromBinary(&$binaryData, &$offsetIndex = 0) + { + self::parseIdentifier($binaryData[$offsetIndex], Identifier::BITSTRING, $offsetIndex++); + $contentLength = self::parseContentLength($binaryData, $offsetIndex, 2); + + $nrOfUnusedBits = ord($binaryData[$offsetIndex]); + $value = substr($binaryData, $offsetIndex + 1, $contentLength - 1); + + if ($nrOfUnusedBits > 7 || // no less than 1 used, otherwise non-minimal + ($contentLength - 1) == 1 && $nrOfUnusedBits > 0 || // content length only 1, no + (ord($value[strlen($value)-1])&((1<<$nrOfUnusedBits)-1)) != 0 // unused bits set + ) { + throw new ParserException("Can not parse bit string with invalid padding", $offsetIndex); + } + + $offsetIndex += $contentLength; + + $parsedObject = new self(bin2hex($value), $nrOfUnusedBits); + $parsedObject->setContentLength($contentLength); + + return $parsedObject; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/Boolean.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/Boolean.php new file mode 100644 index 0000000..b73c99f --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/Boolean.php @@ -0,0 +1,75 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use FG\ASN1\ASNObject; +use FG\ASN1\Parsable; +use FG\ASN1\Identifier; +use FG\ASN1\Exception\ParserException; + +class Boolean extends ASNObject implements Parsable +{ + private $value; + + /** + * @param bool $value + */ + public function __construct($value) + { + $this->value = $value; + } + + public function getType() + { + return Identifier::BOOLEAN; + } + + protected function calculateContentLength() + { + return 1; + } + + protected function getEncodedValue() + { + if ($this->value == false) { + return chr(0x00); + } else { + return chr(0xFF); + } + } + + public function getContent() + { + if ($this->value == true) { + return 'TRUE'; + } else { + return 'FALSE'; + } + } + + public static function fromBinary(&$binaryData, &$offsetIndex = 0) + { + self::parseIdentifier($binaryData[$offsetIndex], Identifier::BOOLEAN, $offsetIndex++); + $contentLength = self::parseContentLength($binaryData, $offsetIndex); + + if ($contentLength != 1) { + throw new ParserException("An ASN.1 Boolean should not have a length other than one. Extracted length was {$contentLength}", $offsetIndex); + } + + $value = ord($binaryData[$offsetIndex++]); + $booleanValue = $value == 0xFF ? true : false; + + $parsedObject = new self($booleanValue); + $parsedObject->setContentLength($contentLength); + + return $parsedObject; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/CharacterString.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/CharacterString.php new file mode 100644 index 0000000..bfc170d --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/CharacterString.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use FG\ASN1\AbstractString; +use FG\ASN1\Identifier; + +class CharacterString extends AbstractString +{ + public function __construct($string) + { + $this->value = $string; + $this->allowAll(); + } + + public function getType() + { + return Identifier::CHARACTER_STRING; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/Enumerated.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/Enumerated.php new file mode 100644 index 0000000..06d04a3 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/Enumerated.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use FG\ASN1\Identifier; + +class Enumerated extends Integer +{ + public function getType() + { + return Identifier::ENUMERATED; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/GeneralString.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/GeneralString.php new file mode 100644 index 0000000..fb0346f --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/GeneralString.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use FG\ASN1\AbstractString; +use FG\ASN1\Identifier; + +class GeneralString extends AbstractString +{ + /** + * Creates a new ASN.1 GeneralString. + * TODO The encodable characters of this type are not yet checked. + * + * @param string $string + */ + public function __construct($string) + { + $this->value = $string; + $this->allowAll(); + } + + public function getType() + { + return Identifier::GENERAL_STRING; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/GeneralizedTime.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/GeneralizedTime.php new file mode 100644 index 0000000..ca92209 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/GeneralizedTime.php @@ -0,0 +1,134 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use FG\ASN1\AbstractTime; +use FG\ASN1\Parsable; +use FG\ASN1\Identifier; +use FG\ASN1\Exception\ParserException; + +/** + * This ASN.1 universal type contains date and time information according to ISO 8601. + * + * The type consists of values representing: + * a) a calendar date, as defined in ISO 8601; and + * b) a time of day, to any of the precisions defined in ISO 8601, except for the hours value 24 which shall not be used; and + * c) the local time differential factor as defined in ISO 8601. + * + * Decoding of this type will accept the Basic Encoding Rules (BER) + * The encoding will comply with the Distinguished Encoding Rules (DER). + */ +class GeneralizedTime extends AbstractTime implements Parsable +{ + private $microseconds; + + public function __construct($dateTime = null, $dateTimeZone = 'UTC') + { + parent::__construct($dateTime, $dateTimeZone); + $this->microseconds = $this->value->format('u'); + if ($this->containsFractionalSecondsElement()) { + // DER requires us to remove trailing zeros + $this->microseconds = preg_replace('/([1-9]+)0+$/', '$1', $this->microseconds); + } + } + + public function getType() + { + return Identifier::GENERALIZED_TIME; + } + + protected function calculateContentLength() + { + $contentSize = 15; // YYYYMMDDHHmmSSZ + + if ($this->containsFractionalSecondsElement()) { + $contentSize += 1 + strlen($this->microseconds); + } + + return $contentSize; + } + + public function containsFractionalSecondsElement() + { + return intval($this->microseconds) > 0; + } + + protected function getEncodedValue() + { + $encodedContent = $this->value->format('YmdHis'); + if ($this->containsFractionalSecondsElement()) { + $encodedContent .= ".{$this->microseconds}"; + } + + return $encodedContent.'Z'; + } + + public function __toString() + { + if ($this->containsFractionalSecondsElement()) { + return $this->value->format("Y-m-d\tH:i:s.uP"); + } else { + return $this->value->format("Y-m-d\tH:i:sP"); + } + } + + public static function fromBinary(&$binaryData, &$offsetIndex = 0) + { + self::parseIdentifier($binaryData[$offsetIndex], Identifier::GENERALIZED_TIME, $offsetIndex++); + $lengthOfMinimumTimeString = 14; // YYYYMMDDHHmmSS + $contentLength = self::parseContentLength($binaryData, $offsetIndex, $lengthOfMinimumTimeString); + $maximumBytesToRead = $contentLength; + + $format = 'YmdGis'; + $content = substr($binaryData, $offsetIndex, $contentLength); + $dateTimeString = substr($content, 0, $lengthOfMinimumTimeString); + $offsetIndex += $lengthOfMinimumTimeString; + $maximumBytesToRead -= $lengthOfMinimumTimeString; + + if ($contentLength == $lengthOfMinimumTimeString) { + $localTimeZone = new \DateTimeZone(date_default_timezone_get()); + $dateTime = \DateTime::createFromFormat($format, $dateTimeString, $localTimeZone); + } else { + if ($binaryData[$offsetIndex] == '.') { + $maximumBytesToRead--; // account for the '.' + $nrOfFractionalSecondElements = 1; // account for the '.' + + while ($maximumBytesToRead > 0 + && $binaryData[$offsetIndex + $nrOfFractionalSecondElements] != '+' + && $binaryData[$offsetIndex + $nrOfFractionalSecondElements] != '-' + && $binaryData[$offsetIndex + $nrOfFractionalSecondElements] != 'Z') { + $nrOfFractionalSecondElements++; + $maximumBytesToRead--; + } + + $dateTimeString .= substr($binaryData, $offsetIndex, $nrOfFractionalSecondElements); + $offsetIndex += $nrOfFractionalSecondElements; + $format .= '.u'; + } + + $dateTime = \DateTime::createFromFormat($format, $dateTimeString, new \DateTimeZone('UTC')); + + if ($maximumBytesToRead > 0) { + if ($binaryData[$offsetIndex] == '+' + || $binaryData[$offsetIndex] == '-') { + $dateTime = static::extractTimeZoneData($binaryData, $offsetIndex, $dateTime); + } elseif ($binaryData[$offsetIndex++] != 'Z') { + throw new ParserException('Invalid ISO 8601 Time String', $offsetIndex); + } + } + } + + $parsedObject = new self($dateTime); + $parsedObject->setContentLength($contentLength); + + return $parsedObject; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/GraphicString.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/GraphicString.php new file mode 100644 index 0000000..4a01d67 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/GraphicString.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use FG\ASN1\AbstractString; +use FG\ASN1\Identifier; + +class GraphicString extends AbstractString +{ + /** + * Creates a new ASN.1 Graphic String. + * TODO The encodable characters of this type are not yet checked. + * + * @param string $string + */ + public function __construct($string) + { + $this->value = $string; + $this->allowAll(); + } + + public function getType() + { + return Identifier::GRAPHIC_STRING; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/IA5String.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/IA5String.php new file mode 100644 index 0000000..33a8067 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/IA5String.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use FG\ASN1\AbstractString; +use FG\ASN1\Identifier; + +/** + * The International Alphabet No.5 (IA5) references the encoding of the ASCII characters. + * + * Each character in the data is encoded as 1 byte. + */ +class IA5String extends AbstractString +{ + public function __construct($string) + { + parent::__construct($string); + for ($i = 1; $i < 128; $i++) { + $this->allowCharacter(chr($i)); + } + } + + public function getType() + { + return Identifier::IA5_STRING; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/Integer.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/Integer.php new file mode 100644 index 0000000..fe3806b --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/Integer.php @@ -0,0 +1,130 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use Exception; +use FG\Utility\BigInteger; +use FG\ASN1\Exception\ParserException; +use FG\ASN1\ASNObject; +use FG\ASN1\Parsable; +use FG\ASN1\Identifier; + +class Integer extends ASNObject implements Parsable +{ + /** @var int */ + private $value; + + /** + * @param int $value + * + * @throws Exception if the value is not numeric + */ + public function __construct($value) + { + if (is_numeric($value) == false) { + throw new Exception("Invalid VALUE [{$value}] for ASN1_INTEGER"); + } + $this->value = $value; + } + + public function getType() + { + return Identifier::INTEGER; + } + + public function getContent() + { + return $this->value; + } + + protected function calculateContentLength() + { + return strlen($this->getEncodedValue()); + } + + protected function getEncodedValue() + { + $value = BigInteger::create($this->value, 10); + $negative = $value->compare(0) < 0; + if ($negative) { + $value = $value->absoluteValue(); + $limit = 0x80; + } else { + $limit = 0x7f; + } + + $mod = 0xff+1; + $values = []; + while($value->compare($limit) > 0) { + $values[] = $value->modulus($mod)->toInteger(); + $value = $value->shiftRight(8); + } + + $values[] = $value->modulus($mod)->toInteger(); + $numValues = count($values); + + if ($negative) { + for ($i = 0; $i < $numValues; $i++) { + $values[$i] = 0xff - $values[$i]; + } + for ($i = 0; $i < $numValues; $i++) { + $values[$i] += 1; + if ($values[$i] <= 0xff) { + break; + } + assert($i != $numValues - 1); + $values[$i] = 0; + } + if ($values[$numValues - 1] == 0x7f) { + $values[] = 0xff; + } + } + $values = array_reverse($values); + $r = pack("C*", ...$values); + return $r; + } + + private static function ensureMinimalEncoding($binaryData, $offsetIndex) + { + // All the first nine bits cannot equal 0 or 1, which would + // be non-minimal encoding for positive and negative integers respectively + if ((ord($binaryData[$offsetIndex]) == 0x00 && (ord($binaryData[$offsetIndex+1]) & 0x80) == 0) || + (ord($binaryData[$offsetIndex]) == 0xff && (ord($binaryData[$offsetIndex+1]) & 0x80) == 0x80)) { + throw new ParserException("Integer not minimally encoded", $offsetIndex); + } + } + + public static function fromBinary(&$binaryData, &$offsetIndex = 0) + { + $parsedObject = new static(0); + self::parseIdentifier($binaryData[$offsetIndex], $parsedObject->getType(), $offsetIndex++); + $contentLength = self::parseContentLength($binaryData, $offsetIndex, 1); + + if ($contentLength > 1) { + self::ensureMinimalEncoding($binaryData, $offsetIndex); + } + $isNegative = (ord($binaryData[$offsetIndex]) & 0x80) != 0x00; + $number = BigInteger::create(ord($binaryData[$offsetIndex++]) & 0x7F); + + for ($i = 0; $i < $contentLength - 1; $i++) { + $number = $number->multiply(0x100)->add(ord($binaryData[$offsetIndex++])); + } + + if ($isNegative) { + $number = $number->subtract(BigInteger::create(2)->toPower(8 * $contentLength - 1)); + } + + $parsedObject = new static((string)$number); + $parsedObject->setContentLength($contentLength); + + return $parsedObject; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/NullObject.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/NullObject.php new file mode 100644 index 0000000..b5293e4 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/NullObject.php @@ -0,0 +1,54 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use FG\ASN1\ASNObject; +use FG\ASN1\Parsable; +use FG\ASN1\Identifier; +use FG\ASN1\Exception\ParserException; + +class NullObject extends ASNObject implements Parsable +{ + public function getType() + { + return Identifier::NULL; + } + + protected function calculateContentLength() + { + return 0; + } + + protected function getEncodedValue() + { + return null; + } + + public function getContent() + { + return 'NULL'; + } + + public static function fromBinary(&$binaryData, &$offsetIndex = 0) + { + self::parseIdentifier($binaryData[$offsetIndex], Identifier::NULL, $offsetIndex++); + $contentLength = self::parseContentLength($binaryData, $offsetIndex); + + if ($contentLength != 0) { + throw new ParserException("An ASN.1 Null should not have a length other than zero. Extracted length was {$contentLength}", $offsetIndex); + } + + $parsedObject = new self(); + $parsedObject->setContentLength(0); + + return $parsedObject; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/NumericString.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/NumericString.php new file mode 100644 index 0000000..13fb7c3 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/NumericString.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use FG\ASN1\AbstractString; +use FG\ASN1\Identifier; + +class NumericString extends AbstractString +{ + /** + * Creates a new ASN.1 NumericString. + * + * The following characters are permitted: + * Digits 0,1, ... 9 + * SPACE (space) + * + * @param string $string + */ + public function __construct($string) + { + $this->value = $string; + $this->allowNumbers(); + $this->allowSpaces(); + } + + public function getType() + { + return Identifier::NUMERIC_STRING; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/ObjectDescriptor.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/ObjectDescriptor.php new file mode 100644 index 0000000..1c5d349 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/ObjectDescriptor.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use FG\ASN1\Identifier; + +class ObjectDescriptor extends GraphicString +{ + public function __construct($objectDescription) + { + parent::__construct($objectDescription); + } + + public function getType() + { + return Identifier::OBJECT_DESCRIPTOR; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/ObjectIdentifier.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/ObjectIdentifier.php new file mode 100644 index 0000000..150ce9c --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/ObjectIdentifier.php @@ -0,0 +1,138 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use Exception; +use FG\ASN1\Base128; +use FG\ASN1\OID; +use FG\ASN1\ASNObject; +use FG\ASN1\Parsable; +use FG\ASN1\Identifier; +use FG\ASN1\Exception\ParserException; + +class ObjectIdentifier extends ASNObject implements Parsable +{ + protected $subIdentifiers; + protected $value; + + public function __construct($value) + { + $this->subIdentifiers = explode('.', $value); + $nrOfSubIdentifiers = count($this->subIdentifiers); + + for ($i = 0; $i < $nrOfSubIdentifiers; $i++) { + if (is_numeric($this->subIdentifiers[$i])) { + // enforce the integer type + $this->subIdentifiers[$i] = intval($this->subIdentifiers[$i]); + } else { + throw new Exception("[{$value}] is no valid object identifier (sub identifier ".($i + 1).' is not numeric)!'); + } + } + + // Merge the first to arcs of the OID registration tree (per ASN definition!) + if ($nrOfSubIdentifiers >= 2) { + $this->subIdentifiers[1] = ($this->subIdentifiers[0] * 40) + $this->subIdentifiers[1]; + unset($this->subIdentifiers[0]); + } + + $this->value = $value; + } + + public function getContent() + { + return $this->value; + } + + public function getType() + { + return Identifier::OBJECT_IDENTIFIER; + } + + protected function calculateContentLength() + { + $length = 0; + foreach ($this->subIdentifiers as $subIdentifier) { + do { + $subIdentifier = $subIdentifier >> 7; + $length++; + } while ($subIdentifier > 0); + } + + return $length; + } + + protected function getEncodedValue() + { + $encodedValue = ''; + foreach ($this->subIdentifiers as $subIdentifier) { + $encodedValue .= Base128::encode($subIdentifier); + } + + return $encodedValue; + } + + public function __toString() + { + return OID::getName($this->value); + } + + public static function fromBinary(&$binaryData, &$offsetIndex = 0) + { + self::parseIdentifier($binaryData[$offsetIndex], Identifier::OBJECT_IDENTIFIER, $offsetIndex++); + $contentLength = self::parseContentLength($binaryData, $offsetIndex, 1); + + $firstOctet = ord($binaryData[$offsetIndex++]); + $oidString = floor($firstOctet / 40).'.'.($firstOctet % 40); + $oidString .= '.'.self::parseOid($binaryData, $offsetIndex, $contentLength - 1); + + $parsedObject = new self($oidString); + $parsedObject->setContentLength($contentLength); + + return $parsedObject; + } + + /** + * Parses an object identifier except for the first octet, which is parsed + * differently. This way relative object identifiers can also be parsed + * using this. + * + * @param $binaryData + * @param $offsetIndex + * @param $octetsToRead + * + * @throws ParserException + * + * @return string + */ + protected static function parseOid(&$binaryData, &$offsetIndex, $octetsToRead) + { + $oid = ''; + + while ($octetsToRead > 0) { + $octets = ''; + + do { + if (0 === $octetsToRead) { + throw new ParserException('Malformed ASN.1 Object Identifier', $offsetIndex - 1); + } + + $octetsToRead--; + $octet = $binaryData[$offsetIndex++]; + $octets .= $octet; + } while (ord($octet) & 0x80); + + $oid .= sprintf('%d.', Base128::decode($octets)); + } + + // Remove trailing '.' + return substr($oid, 0, -1) ?: ''; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/OctetString.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/OctetString.php new file mode 100644 index 0000000..5d69ae7 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/OctetString.php @@ -0,0 +1,91 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use Exception; +use FG\ASN1\ASNObject; +use FG\ASN1\Parsable; +use FG\ASN1\Identifier; + +class OctetString extends ASNObject implements Parsable +{ + protected $value; + + public function __construct($value) + { + if (is_string($value)) { + // remove gaps between hex digits + $value = preg_replace('/\s|0x/', '', $value); + } elseif (is_numeric($value)) { + $value = dechex($value); + } elseif ($value === null) { + return; + } else { + throw new Exception('OctetString: unrecognized input type!'); + } + + if (strlen($value) % 2 != 0) { + // transform values like 1F2 to 01F2 + $value = '0'.$value; + } + + $this->value = $value; + } + + public function getType() + { + return Identifier::OCTETSTRING; + } + + protected function calculateContentLength() + { + return strlen($this->value) / 2; + } + + protected function getEncodedValue() + { + $value = $this->value; + $result = ''; + + //Actual content + while (strlen($value) >= 2) { + // get the hex value byte by byte from the string and and add it to binary result + $result .= chr(hexdec(substr($value, 0, 2))); + $value = substr($value, 2); + } + + return $result; + } + + public function getContent() + { + return strtoupper($this->value); + } + + public function getBinaryContent() + { + return $this->getEncodedValue(); + } + + public static function fromBinary(&$binaryData, &$offsetIndex = 0) + { + self::parseIdentifier($binaryData[$offsetIndex], Identifier::OCTETSTRING, $offsetIndex++); + $contentLength = self::parseContentLength($binaryData, $offsetIndex); + + $value = substr($binaryData, $offsetIndex, $contentLength); + $offsetIndex += $contentLength; + + $parsedObject = new self(bin2hex($value)); + $parsedObject->setContentLength($contentLength); + + return $parsedObject; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/PrintableString.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/PrintableString.php new file mode 100644 index 0000000..fe6d4bc --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/PrintableString.php @@ -0,0 +1,53 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use FG\ASN1\AbstractString; +use FG\ASN1\Identifier; + +class PrintableString extends AbstractString +{ + /** + * Creates a new ASN.1 PrintableString. + * + * The ITU-T X.680 Table 8 permits the following characters: + * Latin capital letters A,B, ... Z + * Latin small letters a,b, ... z + * Digits 0,1, ... 9 + * SPACE (space) + * APOSTROPHE ' + * LEFT PARENTHESIS ( + * RIGHT PARENTHESIS ) + * PLUS SIGN + + * COMMA , + * HYPHEN-MINUS - + * FULL STOP . + * SOLIDUS / + * COLON : + * EQUALS SIGN = + * QUESTION MARK ? + * + * @param string $string + */ + public function __construct($string) + { + $this->value = $string; + $this->allowNumbers(); + $this->allowAllLetters(); + $this->allowSpaces(); + $this->allowCharacters("'", '(', ')', '+', '-', '.', ',', '/', ':', '=', '?'); + } + + public function getType() + { + return Identifier::PRINTABLE_STRING; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/RelativeObjectIdentifier.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/RelativeObjectIdentifier.php new file mode 100644 index 0000000..2aa9643 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/RelativeObjectIdentifier.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use Exception; +use FG\ASN1\Parsable; +use FG\ASN1\Identifier; +use FG\ASN1\Exception\ParserException; + +class RelativeObjectIdentifier extends ObjectIdentifier implements Parsable +{ + public function __construct($subIdentifiers) + { + $this->value = $subIdentifiers; + $this->subIdentifiers = explode('.', $subIdentifiers); + $nrOfSubIdentifiers = count($this->subIdentifiers); + + for ($i = 0; $i < $nrOfSubIdentifiers; $i++) { + if (is_numeric($this->subIdentifiers[$i])) { + // enforce the integer type + $this->subIdentifiers[$i] = intval($this->subIdentifiers[$i]); + } else { + throw new Exception("[{$subIdentifiers}] is no valid object identifier (sub identifier ".($i + 1).' is not numeric)!'); + } + } + } + + public function getType() + { + return Identifier::RELATIVE_OID; + } + + public static function fromBinary(&$binaryData, &$offsetIndex = 0) + { + self::parseIdentifier($binaryData[$offsetIndex], Identifier::RELATIVE_OID, $offsetIndex++); + $contentLength = self::parseContentLength($binaryData, $offsetIndex, 1); + + try { + $oidString = self::parseOid($binaryData, $offsetIndex, $contentLength); + } catch (ParserException $e) { + throw new ParserException('Malformed ASN.1 Relative Object Identifier', $e->getOffset()); + } + + $parsedObject = new self($oidString); + $parsedObject->setContentLength($contentLength); + + return $parsedObject; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/Sequence.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/Sequence.php new file mode 100644 index 0000000..0397cf1 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/Sequence.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use FG\ASN1\Construct; +use FG\ASN1\Parsable; +use FG\ASN1\Identifier; + +class Sequence extends Construct implements Parsable +{ + public function getType() + { + return Identifier::SEQUENCE; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/Set.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/Set.php new file mode 100644 index 0000000..6e6d346 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/Set.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use FG\ASN1\Identifier; + +class Set extends Sequence +{ + public function getType() + { + return Identifier::SET; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/T61String.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/T61String.php new file mode 100644 index 0000000..5641864 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/T61String.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use FG\ASN1\AbstractString; +use FG\ASN1\Identifier; + +class T61String extends AbstractString +{ + /** + * Creates a new ASN.1 T61 String. + * TODO The encodable characters of this type are not yet checked. + * + * @see http://en.wikipedia.org/wiki/ITU_T.61 + * + * @param string $string + */ + public function __construct($string) + { + $this->value = $string; + $this->allowAll(); + } + + public function getType() + { + return Identifier::T61_STRING; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/UTCTime.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/UTCTime.php new file mode 100644 index 0000000..c4d303c --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/UTCTime.php @@ -0,0 +1,77 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use FG\ASN1\AbstractTime; +use FG\ASN1\Parsable; +use FG\ASN1\Identifier; +use FG\ASN1\Exception\ParserException; + +/** + * This ASN.1 universal type contains the calendar date and time. + * + * The precision is one minute or one second and optionally a + * local time differential from coordinated universal time. + * + * Decoding of this type will accept the Basic Encoding Rules (BER) + * The encoding will comply with the Distinguished Encoding Rules (DER). + */ +class UTCTime extends AbstractTime implements Parsable +{ + public function getType() + { + return Identifier::UTC_TIME; + } + + protected function calculateContentLength() + { + return 13; // Content is a string o the following format: YYMMDDhhmmssZ (13 octets) + } + + protected function getEncodedValue() + { + return $this->value->format('ymdHis').'Z'; + } + + public static function fromBinary(&$binaryData, &$offsetIndex = 0) + { + self::parseIdentifier($binaryData[$offsetIndex], Identifier::UTC_TIME, $offsetIndex++); + $contentLength = self::parseContentLength($binaryData, $offsetIndex, 11); + + $format = 'ymdGi'; + $dateTimeString = substr($binaryData, $offsetIndex, 10); + $offsetIndex += 10; + + // extract optional seconds part + if ($binaryData[$offsetIndex] != 'Z' + && $binaryData[$offsetIndex] != '+' + && $binaryData[$offsetIndex] != '-') { + $dateTimeString .= substr($binaryData, $offsetIndex, 2); + $offsetIndex += 2; + $format .= 's'; + } + + $dateTime = \DateTime::createFromFormat($format, $dateTimeString, new \DateTimeZone('UTC')); + + // extract time zone settings + if ($binaryData[$offsetIndex] == '+' + || $binaryData[$offsetIndex] == '-') { + $dateTime = static::extractTimeZoneData($binaryData, $offsetIndex, $dateTime); + } elseif ($binaryData[$offsetIndex++] != 'Z') { + throw new ParserException('Invalid UTC String', $offsetIndex); + } + + $parsedObject = new self($dateTime); + $parsedObject->setContentLength($contentLength); + + return $parsedObject; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/UTF8String.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/UTF8String.php new file mode 100644 index 0000000..cba568d --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/UTF8String.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use FG\ASN1\AbstractString; +use FG\ASN1\Identifier; + +class UTF8String extends AbstractString +{ + /** + * Creates a new ASN.1 Universal String. + * TODO The encodable characters of this type are not yet checked. + * + * @param string $string + */ + public function __construct($string) + { + $this->value = $string; + $this->allowAll(); + } + + public function getType() + { + return Identifier::UTF8_STRING; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/UniversalString.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/UniversalString.php new file mode 100644 index 0000000..0c3fe1d --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/UniversalString.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use FG\ASN1\AbstractString; +use FG\ASN1\Identifier; + +class UniversalString extends AbstractString +{ + /** + * Creates a new ASN.1 Universal String. + * TODO The encodable characters of this type are not yet checked. + * + * @see http://en.wikipedia.org/wiki/Universal_Character_Set + * + * @param string $string + */ + public function __construct($string) + { + $this->value = $string; + $this->allowAll(); + } + + public function getType() + { + return Identifier::UNIVERSAL_STRING; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Universal/VisibleString.php b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/VisibleString.php new file mode 100644 index 0000000..d9326d3 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Universal/VisibleString.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +use FG\ASN1\AbstractString; +use FG\ASN1\Identifier; + +class VisibleString extends AbstractString +{ + /** + * Creates a new ASN.1 Visible String. + * TODO The encodable characters of this type are not yet checked. + * + * @param string $string + */ + public function __construct($string) + { + $this->value = $string; + $this->allowAll(); + } + + public function getType() + { + return Identifier::VISIBLE_STRING; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/UnknownConstructedObject.php b/vendor/fgrosse/phpasn1/lib/ASN1/UnknownConstructedObject.php new file mode 100644 index 0000000..b19a07a --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/UnknownConstructedObject.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1; + +class UnknownConstructedObject extends Construct +{ + private $identifier; + private $contentLength; + + /** + * @param string $binaryData + * @param int $offsetIndex + * + * @throws \FG\ASN1\Exception\ParserException + */ + public function __construct($binaryData, &$offsetIndex) + { + $this->identifier = self::parseBinaryIdentifier($binaryData, $offsetIndex); + $this->contentLength = self::parseContentLength($binaryData, $offsetIndex); + + $children = []; + $octetsToRead = $this->contentLength; + while ($octetsToRead > 0) { + $newChild = ASNObject::fromBinary($binaryData, $offsetIndex); + $octetsToRead -= $newChild->getObjectLength(); + $children[] = $newChild; + } + + parent::__construct(...$children); + } + + public function getType() + { + return ord($this->identifier); + } + + public function getIdentifier() + { + return $this->identifier; + } + + protected function calculateContentLength() + { + return $this->contentLength; + } + + protected function getEncodedValue() + { + return ''; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/UnknownObject.php b/vendor/fgrosse/phpasn1/lib/ASN1/UnknownObject.php new file mode 100644 index 0000000..4ac536a --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/ASN1/UnknownObject.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1; + +class UnknownObject extends ASNObject +{ + /** @var string */ + private $value; + + private $identifier; + + /** + * @param string|int $identifier Either the first identifier octet as int or all identifier bytes as a string + * @param int $contentLength + */ + public function __construct($identifier, $contentLength) + { + if (is_int($identifier)) { + $identifier = chr($identifier); + } + + $this->identifier = $identifier; + $this->value = "Unparsable Object ({$contentLength} bytes)"; + $this->setContentLength($contentLength); + } + + public function getContent() + { + return $this->value; + } + + public function getType() + { + return ord($this->identifier[0]); + } + + public function getIdentifier() + { + return $this->identifier; + } + + protected function calculateContentLength() + { + return $this->getContentLength(); + } + + protected function getEncodedValue() + { + return ''; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/Utility/BigInteger.php b/vendor/fgrosse/phpasn1/lib/Utility/BigInteger.php new file mode 100644 index 0000000..866162c --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/Utility/BigInteger.php @@ -0,0 +1,195 @@ +_fromInteger($val); + } + else { + // convert to string, if not already one + $val = (string)$val; + + // validate string + if (!preg_match('/^-?[0-9]+$/', $val)) { + throw new \InvalidArgumentException('Expects a string representation of an integer.'); + } + $ret->_fromString($val); + } + + return $ret; + } + + /** + * BigInteger constructor. + * Prevent directly instantiating object, use BigInteger::create instead. + */ + protected function __construct() + { + + } + + /** + * Subclasses must provide clone functionality. + * @return BigInteger + */ + abstract public function __clone(); + + /** + * Assign the instance value from base 10 string. + * @param string $str + */ + abstract protected function _fromString($str); + + /** + * Assign the instance value from an integer type. + * @param int $integer + */ + abstract protected function _fromInteger($integer); + + /** + * Must provide string implementation that returns base 10 number. + * @return string + */ + abstract public function __toString(); + + /* INFORMATIONAL FUNCTIONS */ + + /** + * Return integer, if possible. Throws an exception if the number can not be represented as a native integer. + * @return int + * @throws \OverflowException + */ + abstract public function toInteger(); + + /** + * Is represented integer negative? + * @return bool + */ + abstract public function isNegative(); + + /** + * Compare the integer with $number, returns a negative integer if $this is less than number, returns 0 if $this is + * equal to number and returns a positive integer if $this is greater than number. + * @param BigInteger|string|int $number + * @return int + */ + abstract public function compare($number); + + /* MODIFY */ + + /** + * Add another integer $b and returns the result. + * @param BigInteger|string|int $b + * @return BigInteger + */ + abstract public function add($b); + + /** + * Subtract $b from $this and returns the result. + * @param BigInteger|string|int $b + * @return BigInteger + */ + abstract public function subtract($b); + + /** + * Multiply value. + * @param BigInteger|string|int $b + * @return BigInteger + */ + abstract public function multiply($b); + + /** + * The value $this modulus $b. + * @param BigInteger|string|int $b + * @return BigInteger + */ + abstract public function modulus($b); + + /** + * Raise $this to the power of $b and returns the result. + * @param BigInteger|string|int $b + * @return BigInteger + */ + abstract public function toPower($b); + + /** + * Shift the value to the right by a set number of bits and returns the result. + * @param int $bits + * @return BigInteger + */ + abstract public function shiftRight($bits = 8); + + /** + * Shift the value to the left by a set number of bits and returns the result. + * @param int $bits + * @return BigInteger + */ + abstract public function shiftLeft($bits = 8); + + /** + * Returns the absolute value. + * @return BigInteger + */ + abstract public function absoluteValue(); +} diff --git a/vendor/fgrosse/phpasn1/lib/Utility/BigIntegerBcmath.php b/vendor/fgrosse/phpasn1/lib/Utility/BigIntegerBcmath.php new file mode 100644 index 0000000..25ad891 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/Utility/BigIntegerBcmath.php @@ -0,0 +1,133 @@ +_str = (string)$str; + } + + protected function _fromInteger($integer) + { + $this->_str = (string)$integer; + } + + public function __toString() + { + return $this->_str; + } + + public function toInteger() + { + if ($this->compare(PHP_INT_MAX) > 0 || $this->compare(PHP_INT_MIN) < 0) { + throw new \OverflowException(sprintf('Can not represent %s as integer.', $this->_str)); + } + return (int)$this->_str; + } + + public function isNegative() + { + return bccomp($this->_str, '0', 0) < 0; + } + + protected function _unwrap($number) + { + if ($number instanceof self) { + return $number->_str; + } + return $number; + } + + public function compare($number) + { + return bccomp($this->_str, $this->_unwrap($number), 0); + } + + public function add($b) + { + $ret = new self(); + $ret->_str = bcadd($this->_str, $this->_unwrap($b), 0); + return $ret; + } + + public function subtract($b) + { + $ret = new self(); + $ret->_str = bcsub($this->_str, $this->_unwrap($b), 0); + return $ret; + } + + public function multiply($b) + { + $ret = new self(); + $ret->_str = bcmul($this->_str, $this->_unwrap($b), 0); + return $ret; + } + + public function modulus($b) + { + $ret = new self(); + if ($this->isNegative()) { + // bcmod handles negative numbers differently + $b = $this->_unwrap($b); + $ret->_str = bcsub($b, bcmod(bcsub('0', $this->_str, 0), $b), 0); + } + else { + $ret->_str = bcmod($this->_str, $this->_unwrap($b)); + } + return $ret; + } + + public function toPower($b) + { + $ret = new self(); + $ret->_str = bcpow($this->_str, $this->_unwrap($b), 0); + return $ret; + } + + public function shiftRight($bits = 8) + { + $ret = new self(); + $ret->_str = bcdiv($this->_str, bcpow('2', $bits)); + return $ret; + } + + public function shiftLeft($bits = 8) { + $ret = new self(); + $ret->_str = bcmul($this->_str, bcpow('2', $bits)); + return $ret; + } + + public function absoluteValue() + { + $ret = new self(); + if (-1 === bccomp($this->_str, '0', 0)) { + $ret->_str = bcsub('0', $this->_str, 0); + } + else { + $ret->_str = $this->_str; + } + return $ret; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/Utility/BigIntegerGmp.php b/vendor/fgrosse/phpasn1/lib/Utility/BigIntegerGmp.php new file mode 100644 index 0000000..0791226 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/Utility/BigIntegerGmp.php @@ -0,0 +1,133 @@ +_rh = gmp_add($this->_rh, 0); + } + + protected function _fromString($str) + { + $this->_rh = gmp_init($str, 10); + } + + protected function _fromInteger($integer) + { + $this->_rh = gmp_init($integer, 10); + } + + public function __toString() + { + return gmp_strval($this->_rh, 10); + } + + public function toInteger() + { + if ($this->compare(PHP_INT_MAX) > 0 || $this->compare(PHP_INT_MIN) < 0) { + throw new \OverflowException(sprintf('Can not represent %s as integer.', $this)); + } + return gmp_intval($this->_rh); + } + + public function isNegative() + { + return gmp_sign($this->_rh) === -1; + } + + protected function _unwrap($number) + { + if ($number instanceof self) { + return $number->_rh; + } + return $number; + } + + public function compare($number) + { + return gmp_cmp($this->_rh, $this->_unwrap($number)); + } + + public function add($b) + { + $ret = new self(); + $ret->_rh = gmp_add($this->_rh, $this->_unwrap($b)); + return $ret; + } + + public function subtract($b) + { + $ret = new self(); + $ret->_rh = gmp_sub($this->_rh, $this->_unwrap($b)); + return $ret; + } + + public function multiply($b) + { + $ret = new self(); + $ret->_rh = gmp_mul($this->_rh, $this->_unwrap($b)); + return $ret; + } + + public function modulus($b) + { + $ret = new self(); + $ret->_rh = gmp_mod($this->_rh, $this->_unwrap($b)); + return $ret; + } + + public function toPower($b) + { + if ($b instanceof self) { + // gmp_pow accepts just an integer + if ($b->compare(PHP_INT_MAX) > 0) { + throw new \UnexpectedValueException('Unable to raise to power greater than PHP_INT_MAX.'); + } + $b = gmp_intval($b->_rh); + } + $ret = new self(); + $ret->_rh = gmp_pow($this->_rh, $b); + return $ret; + } + + public function shiftRight($bits=8) + { + $ret = new self(); + $ret->_rh = gmp_div($this->_rh, gmp_pow(2, $bits)); + return $ret; + } + + public function shiftLeft($bits=8) + { + $ret = new self(); + $ret->_rh = gmp_mul($this->_rh, gmp_pow(2, $bits)); + return $ret; + } + + public function absoluteValue() + { + $ret = new self(); + $ret->_rh = gmp_abs($this->_rh); + return $ret; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/X509/AlgorithmIdentifier.php b/vendor/fgrosse/phpasn1/lib/X509/AlgorithmIdentifier.php new file mode 100644 index 0000000..a06b56f --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/X509/AlgorithmIdentifier.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\X509; + +use FG\ASN1\Universal\NullObject; +use FG\ASN1\Composite\AttributeTypeAndValue; + +class AlgorithmIdentifier extends AttributeTypeAndValue +{ + public function __construct($objectIdentifierString) + { + parent::__construct($objectIdentifierString, new NullObject()); + } +} diff --git a/vendor/fgrosse/phpasn1/lib/X509/CSR/Attributes.php b/vendor/fgrosse/phpasn1/lib/X509/CSR/Attributes.php new file mode 100644 index 0000000..5a965e2 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/X509/CSR/Attributes.php @@ -0,0 +1,68 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\X509\CSR; + +use FG\ASN1\ASNObject; +use FG\X509\CertificateExtensions; +use FG\ASN1\OID; +use FG\ASN1\Parsable; +use FG\ASN1\Construct; +use FG\ASN1\Identifier; +use FG\ASN1\Universal\Set; +use FG\ASN1\Universal\Sequence; +use FG\ASN1\Universal\ObjectIdentifier; + +class Attributes extends Construct implements Parsable +{ + public function getType() + { + return 0xA0; + } + + public function addAttribute($objectIdentifier, Set $attribute) + { + if (is_string($objectIdentifier)) { + $objectIdentifier = new ObjectIdentifier($objectIdentifier); + } + $attributeSequence = new Sequence($objectIdentifier, $attribute); + $attributeSequence->getNumberOfLengthOctets(); // length and number of length octets is calculated + $this->addChild($attributeSequence); + } + + public static function fromBinary(&$binaryData, &$offsetIndex = 0) + { + self::parseIdentifier($binaryData[$offsetIndex], 0xA0, $offsetIndex++); + $contentLength = self::parseContentLength($binaryData, $offsetIndex); + $octetsToRead = $contentLength; + + $parsedObject = new self(); + while ($octetsToRead > 0) { + $initialOffset = $offsetIndex; // used to calculate how much bits have been read + self::parseIdentifier($binaryData[$offsetIndex], Identifier::SEQUENCE, $offsetIndex++); + self::parseContentLength($binaryData, $offsetIndex); + + $objectIdentifier = ObjectIdentifier::fromBinary($binaryData, $offsetIndex); + $oidString = $objectIdentifier->getContent(); + if ($oidString == OID::PKCS9_EXTENSION_REQUEST) { + $attribute = CertificateExtensions::fromBinary($binaryData, $offsetIndex); + } else { + $attribute = ASNObject::fromBinary($binaryData, $offsetIndex); + } + + $parsedObject->addAttribute($objectIdentifier, $attribute); + $octetsToRead -= ($offsetIndex - $initialOffset); + } + + $parsedObject->setContentLength($contentLength); + + return $parsedObject; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/X509/CSR/CSR.php b/vendor/fgrosse/phpasn1/lib/X509/CSR/CSR.php new file mode 100644 index 0000000..53f9aeb --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/X509/CSR/CSR.php @@ -0,0 +1,159 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\X509\CSR; + +use FG\ASN1\OID; +use FG\ASN1\Universal\Integer; +use FG\ASN1\Universal\BitString; +use FG\ASN1\Universal\Sequence; +use FG\X509\CertificateSubject; +use FG\X509\AlgorithmIdentifier; +use FG\X509\PublicKey; + +class CSR extends Sequence +{ + const CSR_VERSION_NR = 0; + + protected $subject; + protected $publicKey; + protected $signature; + protected $signatureAlgorithm; + + protected $startSequence; + + /** + * @param string $commonName + * @param string $email + * @param string $organization + * @param string $locality + * @param string $state + * @param string $country + * @param string $organizationalUnit + * @param string $publicKey + * @param string $signature + * @param string $signatureAlgorithm + */ + public function __construct($commonName, $email, $organization, $locality, $state, $country, $organizationalUnit, $publicKey, $signature = null, $signatureAlgorithm = OID::SHA1_WITH_RSA_SIGNATURE) + { + $this->subject = new CertificateSubject( + $commonName, + $email, + $organization, + $locality, + $state, + $country, + $organizationalUnit + ); + $this->publicKey = $publicKey; + $this->signature = $signature; + $this->signatureAlgorithm = $signatureAlgorithm; + + if (isset($signature)) { + $this->createCSRSequence(); + } + } + + protected function createCSRSequence() + { + $versionNr = new Integer(self::CSR_VERSION_NR); + $publicKey = new PublicKey($this->publicKey); + $signature = new BitString($this->signature); + $signatureAlgorithm = new AlgorithmIdentifier($this->signatureAlgorithm); + + $certRequestInfo = new Sequence($versionNr, $this->subject, $publicKey); + + // Clear the underlying Construct + $this->rewind(); + $this->children = []; + $this->addChild($certRequestInfo); + $this->addChild($signatureAlgorithm); + $this->addChild($signature); + } + + public function getSignatureSubject() + { + $versionNr = new Integer(self::CSR_VERSION_NR); + $publicKey = new PublicKey($this->publicKey); + + $certRequestInfo = new Sequence($versionNr, $this->subject, $publicKey); + return $certRequestInfo->getBinary(); + } + + public function setSignature($signature, $signatureAlgorithm = OID::SHA1_WITH_RSA_SIGNATURE) + { + $this->signature = $signature; + $this->signatureAlgorithm = $signatureAlgorithm; + + $this->createCSRSequence(); + } + + public function __toString() + { + $tmp = base64_encode($this->getBinary()); + + for ($i = 0; $i < strlen($tmp); $i++) { + if (($i + 2) % 65 == 0) { + $tmp = substr($tmp, 0, $i + 1)."\n".substr($tmp, $i + 1); + } + } + + $result = '-----BEGIN CERTIFICATE REQUEST-----'.PHP_EOL; + $result .= $tmp.PHP_EOL; + $result .= '-----END CERTIFICATE REQUEST-----'; + + return $result; + } + + public function getVersion() + { + return self::CSR_VERSION_NR; + } + + public function getOrganizationName() + { + return $this->subject->getOrganization(); + } + + public function getLocalName() + { + return $this->subject->getLocality(); + } + + public function getState() + { + return $this->subject->getState(); + } + + public function getCountry() + { + return $this->subject->getCountry(); + } + + public function getOrganizationalUnit() + { + return $this->subject->getOrganizationalUnit(); + } + + public function getPublicKey() + { + return $this->publicKey; + } + + public function getSignature() + { + return $this->signature; + } + + public function getSignatureAlgorithm() + { + return $this->signatureAlgorithm; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/X509/CertificateExtensions.php b/vendor/fgrosse/phpasn1/lib/X509/CertificateExtensions.php new file mode 100644 index 0000000..6ed1c6a --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/X509/CertificateExtensions.php @@ -0,0 +1,100 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\X509; + +use FG\ASN1\Exception\ParserException; +use FG\ASN1\OID; +use FG\ASN1\ASNObject; +use FG\ASN1\Parsable; +use FG\ASN1\Identifier; +use FG\ASN1\Universal\OctetString; +use FG\ASN1\Universal\Set; +use FG\ASN1\Universal\Sequence; +use FG\ASN1\Universal\ObjectIdentifier; +use FG\X509\SAN\SubjectAlternativeNames; + +class CertificateExtensions extends Set implements Parsable +{ + private $innerSequence; + private $extensions = []; + + public function __construct() + { + $this->innerSequence = new Sequence(); + parent::__construct($this->innerSequence); + } + + public function addSubjectAlternativeNames(SubjectAlternativeNames $sans) + { + $this->addExtension(OID::CERT_EXT_SUBJECT_ALT_NAME, $sans); + } + + private function addExtension($oidString, ASNObject $extension) + { + $sequence = new Sequence(); + $sequence->addChild(new ObjectIdentifier($oidString)); + $sequence->addChild($extension); + + $this->innerSequence->addChild($sequence); + $this->extensions[] = $extension; + } + + public function getContent() + { + return $this->extensions; + } + + public static function fromBinary(&$binaryData, &$offsetIndex = 0) + { + self::parseIdentifier($binaryData[$offsetIndex], Identifier::SET, $offsetIndex++); + self::parseContentLength($binaryData, $offsetIndex); + + $tmpOffset = $offsetIndex; + $extensions = Sequence::fromBinary($binaryData, $offsetIndex); + $tmpOffset += 1 + $extensions->getNumberOfLengthOctets(); + + $parsedObject = new self(); + foreach ($extensions as $extension) { + if ($extension->getType() != Identifier::SEQUENCE) { + //FIXME wrong offset index + throw new ParserException('Could not parse Certificate Extensions: Expected ASN.1 Sequence but got '.$extension->getTypeName(), $offsetIndex); + } + + $tmpOffset += 1 + $extension->getNumberOfLengthOctets(); + $children = $extension->getChildren(); + if (count($children) < 2) { + throw new ParserException('Could not parse Certificate Extensions: Needs at least two child elements per extension sequence (object identifier and octet string)', $tmpOffset); + } + /** @var \FG\ASN1\ASNObject $objectIdentifier */ + $objectIdentifier = $children[0]; + + /** @var OctetString $octetString */ + $octetString = $children[1]; + + if ($objectIdentifier->getType() != Identifier::OBJECT_IDENTIFIER) { + throw new ParserException('Could not parse Certificate Extensions: Expected ASN.1 Object Identifier but got '.$extension->getTypeName(), $tmpOffset); + } + + $tmpOffset += $objectIdentifier->getObjectLength(); + + if ($objectIdentifier->getContent() == OID::CERT_EXT_SUBJECT_ALT_NAME) { + $sans = SubjectAlternativeNames::fromBinary($binaryData, $tmpOffset); + $parsedObject->addSubjectAlternativeNames($sans); + } else { + // can now only parse SANs. There might be more in the future + $tmpOffset += $octetString->getObjectLength(); + } + } + + $parsedObject->getBinary(); // Determine the number of content octets and object sizes once (just to let the equality unit tests pass :/ ) + return $parsedObject; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/X509/CertificateSubject.php b/vendor/fgrosse/phpasn1/lib/X509/CertificateSubject.php new file mode 100644 index 0000000..0a04d57 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/X509/CertificateSubject.php @@ -0,0 +1,108 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\X509; + +use FG\ASN1\Composite\RelativeDistinguishedName; +use FG\ASN1\Identifier; +use FG\ASN1\OID; +use FG\ASN1\Parsable; +use FG\ASN1\Composite\RDNString; +use FG\ASN1\Universal\Sequence; + +class CertificateSubject extends Sequence implements Parsable +{ + private $commonName; + private $email; + private $organization; + private $locality; + private $state; + private $country; + private $organizationalUnit; + + /** + * @param string $commonName + * @param string $email + * @param string $organization + * @param string $locality + * @param string $state + * @param string $country + * @param string $organizationalUnit + */ + public function __construct($commonName, $email, $organization, $locality, $state, $country, $organizationalUnit) + { + parent::__construct( + new RDNString(OID::COUNTRY_NAME, $country), + new RDNString(OID::STATE_OR_PROVINCE_NAME, $state), + new RDNString(OID::LOCALITY_NAME, $locality), + new RDNString(OID::ORGANIZATION_NAME, $organization), + new RDNString(OID::OU_NAME, $organizationalUnit), + new RDNString(OID::COMMON_NAME, $commonName), + new RDNString(OID::PKCS9_EMAIL, $email) + ); + + $this->commonName = $commonName; + $this->email = $email; + $this->organization = $organization; + $this->locality = $locality; + $this->state = $state; + $this->country = $country; + $this->organizationalUnit = $organizationalUnit; + } + + public function getCommonName() + { + return $this->commonName; + } + + public function getEmail() + { + return $this->email; + } + + public function getOrganization() + { + return $this->organization; + } + + public function getLocality() + { + return $this->locality; + } + + public function getState() + { + return $this->state; + } + + public function getCountry() + { + return $this->country; + } + + public function getOrganizationalUnit() + { + return $this->organizationalUnit; + } + + public static function fromBinary(&$binaryData, &$offsetIndex = 0) + { + self::parseIdentifier($binaryData[$offsetIndex], Identifier::SEQUENCE, $offsetIndex++); + $contentLength = self::parseContentLength($binaryData, $offsetIndex); + + $names = []; + $octetsToRead = $contentLength; + while ($octetsToRead > 0) { + $relativeDistinguishedName = RelativeDistinguishedName::fromBinary($binaryData, $offsetIndex); + $octetsToRead -= $relativeDistinguishedName->getObjectLength(); + $names[] = $relativeDistinguishedName; + } + } +} diff --git a/vendor/fgrosse/phpasn1/lib/X509/PrivateKey.php b/vendor/fgrosse/phpasn1/lib/X509/PrivateKey.php new file mode 100644 index 0000000..d57ad86 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/X509/PrivateKey.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\X509; + +use FG\ASN1\OID; +use FG\ASN1\Universal\NullObject; +use FG\ASN1\Universal\Sequence; +use FG\ASN1\Universal\BitString; +use FG\ASN1\Universal\ObjectIdentifier; + +class PrivateKey extends Sequence +{ + /** + * @param string $hexKey + * @param \FG\ASN1\ASNObject|string $algorithmIdentifierString + */ + public function __construct($hexKey, $algorithmIdentifierString = OID::RSA_ENCRYPTION) + { + parent::__construct( + new Sequence( + new ObjectIdentifier($algorithmIdentifierString), + new NullObject() + ), + new BitString($hexKey) + ); + } +} diff --git a/vendor/fgrosse/phpasn1/lib/X509/PublicKey.php b/vendor/fgrosse/phpasn1/lib/X509/PublicKey.php new file mode 100644 index 0000000..ab8b451 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/X509/PublicKey.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\X509; + +use FG\ASN1\OID; +use FG\ASN1\Universal\NullObject; +use FG\ASN1\Universal\Sequence; +use FG\ASN1\Universal\BitString; +use FG\ASN1\Universal\ObjectIdentifier; + +class PublicKey extends Sequence +{ + /** + * @param string $hexKey + * @param \FG\ASN1\ASNObject|string $algorithmIdentifierString + */ + public function __construct($hexKey, $algorithmIdentifierString = OID::RSA_ENCRYPTION) + { + parent::__construct( + new Sequence( + new ObjectIdentifier($algorithmIdentifierString), + new NullObject() + ), + new BitString($hexKey) + ); + } +} diff --git a/vendor/fgrosse/phpasn1/lib/X509/SAN/DNSName.php b/vendor/fgrosse/phpasn1/lib/X509/SAN/DNSName.php new file mode 100644 index 0000000..502738b --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/X509/SAN/DNSName.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\X509\SAN; + +use FG\ASN1\Universal\GeneralString; + +class DNSName extends GeneralString +{ + const IDENTIFIER = 0x82; // not sure yet why this is the identifier used in SAN extensions + + public function __construct($dnsNameString) + { + parent::__construct($dnsNameString); + } + + public function getType() + { + return self::IDENTIFIER; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/X509/SAN/IPAddress.php b/vendor/fgrosse/phpasn1/lib/X509/SAN/IPAddress.php new file mode 100644 index 0000000..f55be95 --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/X509/SAN/IPAddress.php @@ -0,0 +1,73 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\X509\SAN; + +use FG\ASN1\ASNObject; +use FG\ASN1\Parsable; +use FG\ASN1\Exception\ParserException; + +class IPAddress extends ASNObject implements Parsable +{ + const IDENTIFIER = 0x87; // not sure yet why this is the identifier used in SAN extensions + + /** @var string */ + private $value; + + public function __construct($ipAddressString) + { + $this->value = $ipAddressString; + } + + public function getType() + { + return self::IDENTIFIER; + } + + public function getContent() + { + return $this->value; + } + + protected function calculateContentLength() + { + return 4; + } + + protected function getEncodedValue() + { + $ipParts = explode('.', $this->value); + $binary = chr($ipParts[0]); + $binary .= chr($ipParts[1]); + $binary .= chr($ipParts[2]); + $binary .= chr($ipParts[3]); + + return $binary; + } + + public static function fromBinary(&$binaryData, &$offsetIndex = 0) + { + self::parseIdentifier($binaryData[$offsetIndex], self::IDENTIFIER, $offsetIndex++); + $contentLength = self::parseContentLength($binaryData, $offsetIndex); + if ($contentLength != 4) { + throw new ParserException("A FG\\X509\SAN\IPAddress should have a content length of 4. Extracted length was {$contentLength}", $offsetIndex); + } + + $ipAddressString = ord($binaryData[$offsetIndex++]).'.'; + $ipAddressString .= ord($binaryData[$offsetIndex++]).'.'; + $ipAddressString .= ord($binaryData[$offsetIndex++]).'.'; + $ipAddressString .= ord($binaryData[$offsetIndex++]); + + $parsedObject = new self($ipAddressString); + $parsedObject->getObjectLength(); + + return $parsedObject; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/X509/SAN/SubjectAlternativeNames.php b/vendor/fgrosse/phpasn1/lib/X509/SAN/SubjectAlternativeNames.php new file mode 100644 index 0000000..271ddde --- /dev/null +++ b/vendor/fgrosse/phpasn1/lib/X509/SAN/SubjectAlternativeNames.php @@ -0,0 +1,96 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\X509\SAN; + +use FG\ASN1\Exception\ParserException; +use FG\ASN1\ASNObject; +use FG\ASN1\OID; +use FG\ASN1\Parsable; +use FG\ASN1\Identifier; +use FG\ASN1\Universal\Sequence; + +/** + * See section 8.3.2.1 of ITU-T X.509. + */ +class SubjectAlternativeNames extends ASNObject implements Parsable +{ + private $alternativeNamesSequence; + + public function __construct() + { + $this->alternativeNamesSequence = new Sequence(); + } + + protected function calculateContentLength() + { + return $this->alternativeNamesSequence->getObjectLength(); + } + + public function getType() + { + return Identifier::OCTETSTRING; + } + + public function addDomainName(DNSName $domainName) + { + $this->alternativeNamesSequence->addChild($domainName); + } + + public function addIP(IPAddress $ip) + { + $this->alternativeNamesSequence->addChild($ip); + } + + public function getContent() + { + return $this->alternativeNamesSequence->getContent(); + } + + protected function getEncodedValue() + { + return $this->alternativeNamesSequence->getBinary(); + } + + public static function fromBinary(&$binaryData, &$offsetIndex = 0) + { + self::parseIdentifier($binaryData[$offsetIndex], Identifier::OCTETSTRING, $offsetIndex++); + $contentLength = self::parseContentLength($binaryData, $offsetIndex); + + if ($contentLength < 2) { + throw new ParserException('Can not parse Subject Alternative Names: The Sequence within the octet string after the Object identifier '.OID::CERT_EXT_SUBJECT_ALT_NAME." is too short ({$contentLength} octets)", $offsetIndex); + } + + $offsetOfSequence = $offsetIndex; + $sequence = Sequence::fromBinary($binaryData, $offsetIndex); + $offsetOfSequence += $sequence->getNumberOfLengthOctets() + 1; + + if ($sequence->getObjectLength() != $contentLength) { + throw new ParserException('Can not parse Subject Alternative Names: The Sequence length does not match the length of the surrounding octet string', $offsetIndex); + } + + $parsedObject = new self(); + /** @var \FG\ASN1\ASNObject $object */ + foreach ($sequence as $object) { + if ($object->getType() == DNSName::IDENTIFIER) { + $domainName = DNSName::fromBinary($binaryData, $offsetOfSequence); + $parsedObject->addDomainName($domainName); + } elseif ($object->getType() == IPAddress::IDENTIFIER) { + $ip = IPAddress::fromBinary($binaryData, $offsetOfSequence); + $parsedObject->addIP($ip); + } else { + throw new ParserException('Could not parse Subject Alternative Name: Only DNSName and IP SANs are currently supported', $offsetIndex); + } + } + + $parsedObject->getBinary(); // Determine the number of content octets and object sizes once (just to let the equality unit tests pass :/ ) + return $parsedObject; + } +} diff --git a/vendor/geoip2/geoip2/CHANGELOG.md b/vendor/geoip2/geoip2/CHANGELOG.md new file mode 100644 index 0000000..9881b4d --- /dev/null +++ b/vendor/geoip2/geoip2/CHANGELOG.md @@ -0,0 +1,282 @@ +CHANGELOG +========= + +2.10.0 (2019-12-12) +------------------- + +* PHP 5.6 or greater is now required. +* The `network` property was added to `GeoIp2\Record\Traits`, + `GeoIp2\Model\AnonymousIp`, `GeoIp2\Model\Asn`, + `GeoIp2\Model\ConnectionType`, `Geoip2\Model\Domain`, + and `GeoIp2\Model\Isp`. This is a string in CIDR format representing the + largest network where all of the properties besides `ipAddress` have the + same value. +* Updated documentation of anonymizer properties - `isAnonymousVpn` + and `isHostingProvider` - to be more descriptive. +* The `userCount` property was added to `GeoIp2\Record\Traits`. This is an + integer which indicates the estimated number of users sharing the + IP/network during the past 24 hours. This output is available from GeoIP2 + Precision Insights. +* The `staticIpScore` property was added to `GeoIp2\Record\Traits`. This is + a float which indicates how static or dynamic an IP address is. This + output is available from GeoIP2 Precision Insights. + +2.9.0 (2018-04-10) +------------------ + +* Refer to account IDs using the terminology "account" rather than "user". + +2.8.0 (2018-01-18) +------------------ + +* The `isInEuropeanUnion` property was added to `GeoIp2\Record\Country` + and `GeoIp2\Record\RepresentedCountry`. This property is `true` if the + country is a member state of the European Union. + +2.7.0 (2017-10-27) +------------------ + +* The following new anonymizer properties were added to `GeoIp2\Record\Traits` + for use with GeoIP2 Precision Insights: `isAnonymous`, `isAnonymousVpn`, + `isHostingProvider`, `isPublicProxy`, and `isTorExitNode`. + +2.6.0 (2017-07-10) +----------------- + +* Code clean-up and tidying. +* Set minimum required PHP version to 5.4 in `composer.json`. Previously, + 5.3 would work but was not tested. Now 5.4 is hard minimum version. + +2.5.0 (2017-05-08) +------------------ + +* Support for PHP 5.3 was dropped. +* Added support for GeoLite2 ASN database. + +2.4.5 (2017-01-31) +------------------ + +* Additional error checking on the data returned from `MaxMind\Db\Reader` + was added to help detect corrupt databases. GitHub #83. + +2.4.4 (2016-10-11) +------------------ + +* `isset()` on `mostSpecificSubdivision` attribute now returns the + correct value. Reported by Juan Francisco Giordana. GitHub #81. + +2.4.3 (2016-10-11) +------------------ + +* `isset()` on `name` attribute now returns the correct value. Reported by + Juan Francisco Giordana. GitHub #79. + +2.4.2 (2016-08-17) +------------------ + +* Updated documentation to clarify what the accuracy radius refers to. +* Upgraded `maxmind/web-service-common` to 0.3.0. This version uses + `composer/ca-bundle` rather than our own CA bundle. GitHub #75. +* Improved PHP documentation generation. + +2.4.1 (2016-06-10) +------------------ + +* Corrected type annotations in documentation. GitHub #66. +* Updated documentation to reflect that the accuracy radius is now included + in City. +* Upgraded web service client, which supports setting a proxy. GitHub #59. + +2.4.0 (2016-04-15) +------------------ + +* Added support for the GeoIP2 Enterprise database. + +2.3.3 (2015-09-24) +------------------ + +* Corrected case on `JsonSerializable` interface. Reported by Axel Etcheverry. + GitHub #56. + +2.3.2 (2015-09-23) +------------------ + +* `JsonSerializable` compatibility interface was moved to `GeoIp2\Compat` + rather than the global namespace to prevent autoloading issues. Reported by + Tomas Buteler. GitHub #54. +* Missing documentation for the `$postal` property was added to the + `GeoIp2\Model\City` class. Fix by Roy Sindre Norangshol. GitHub #51. +* In the Phar distribution, source files for this module no longer have their + documentation stripped, allowing IDE introspection to work properly. + Reported by Dominic Black. GitHub #52. + +2.3.1 (2015-06-30) +------------------ + +* Updated `maxmind/web-service-common` to version with fixes for PHP 5.3 and + 5.4. + +2.3.0 (2015-06-29) +------------------ + +* Support for demographics fields `averageIncome` and `populationDensity` in + the `Location` record, returned by the Insights endpoint. +* The `isAnonymousProxy` and `isSatelliteProvider` properties on + `GeoIP2\Record\Traits` have been deprecated. Please use our [GeoIP2 + Anonymous IP database](https://www.maxmind.com/en/geoip2-anonymous-ip-database) + to determine whether an IP address is used by an anonymizing service. + +2.2.0-beta1 (2015-06-09) +------------------------ + +* Typo fix in documentation. + +2.2.0-alpha2 (2015-06-01) +------------------------- + +* `maxmind-ws/web-service-common` was renamed to `maxmind/web-service-common`. + +2.2.0-alpha1 (2015-05-22) +------------------------- + +* The library no longer uses Guzzle and instead uses curl directly. +* Support for `timeout` and `connectTimout` were added to the `$options` array + passed to the `GeoIp2\WebService\Client` constructor. Pull request by Will + Bradley. GitHub #36. + +2.1.1 (2014-12-03) +------------------ + +* The 2.1.0 Phar builds included a shebang line, causing issues when loading + it as a library. This has been corrected. GitHub #33. + +2.1.0 (2014-10-29) +------------------ + +* Update ApiGen dependency to version that isn't broken on case sensitive + file systems. +* Added support for the GeoIP2 Anonymous IP database. The + `GeoIP2\Database\Reader` class now has an `anonymousIp` method which returns + a `GeoIP2\Model\AnonymousIp` object. +* Boolean attributes like those in the `GeoIP2\Record\Traits` class now return + `false` instead of `null` when they were not true. + +2.0.0 (2014-09-22) +------------------ + +* First production release. + +0.9.0 (2014-09-15) +------------------ + +* IMPORTANT: The deprecated `omni()` and `cityIspOrg()` methods have been + removed from `GeoIp2\WebService\Client`. + +0.8.1 (2014-09-12) +------------------ + +* The check added to the `GeoIP2\Database\Reader` lookup methods in 0.8.0 did + not work with the GeoIP2 City Database Subset by Continent with World + Countries. This has been fixed. Fixes GitHub issue #23. + +0.8.0 (2014-09-10) +------------------ + +* The `GeoIp2\Database\Reader` lookup methods (e.g., `city()`, `isp()`) now + throw a `BadMethodCallException` if they are used with a database that + does not match the method. In particular, doing a `city()` lookup on a + GeoIP2 Country database will result in an exception, and vice versa. +* A `metadata()` method has been added to the `GeoIP2\Database\Reader` class. + This returns a `MaxMind\Db\Reader\Metadata` class with information about the + database. +* The name attribute was missing from the RepresentedCountry class. + +0.7.0 (2014-07-22) +------------------ + +* The web service client API has been updated for the v2.1 release of the web + service. In particular, the `cityIspOrg` and `omni` methods on + `GeoIp2\WebService\Client` should be considered deprecated. The `city` + method now provides all of the data formerly provided by `cityIspOrg`, and + the `omni` method has been replaced by the `insights` method. +* Support was added for GeoIP2 Connection Type, Domain and ISP databases. + + +0.6.3 (2014-05-12) +------------------ + +* With the previous Phar builds, some users received `phar error: invalid url + or non-existent phar` errors. The correct alias is now used for the Phar, + and this should no longer be an issue. + +0.6.2 (2014-05-08) +------------------ + +* The Phar build was broken with Guzzle 3.9.0+. This has been fixed. + +0.6.1 (2014-05-01) +------------------ + +* This API now officially supports HHVM. +* The `maxmind-db/reader` dependency was updated to a version that does not + require BC Math. +* The Composer compatibility autoload rules are now targeted more narrowly. +* A `box.json` file is included to build a Phar package. + +0.6.0 (2014-02-19) +------------------ + +* This API is now licensed under the Apache License, Version 2.0. +* Model and record classes now implement `JsonSerializable`. +* `isset` now works with model and record classes. + +0.5.0 (2013-10-21) +------------------ + +* Renamed $languages constructor parameters to $locales for both the Client + and Reader classes. +* Documentation and code clean-up (Ben Morel). +* Added the interface `GeoIp2\ProviderInterface`, which is implemented by both + `\GeoIp2\Database\Reader` and `\GeoIp2\WebService\Client`. + +0.4.0 (2013-07-16) +------------------ + +* This is the first release with the GeoIP2 database reader. Please see the + `README.md` file and the `\GeoIp2\Database\Reader` class. +* The general exception classes were replaced with specific exception classes + representing particular types of errors, such as an authentication error. + +0.3.0 (2013-07-12) +------------------ + +* In namespaces and class names, "GeoIP2" was renamed to "GeoIp2" to improve + consistency. + +0.2.1 (2013-06-10) +------------------ + +* First official beta release. +* Documentation updates and corrections. + +0.2.0 (2013-05-29) +------------------ + +* `GenericException` was renamed to `GeoIP2Exception`. +* We now support more languages. The new languages are de, es, fr, and pt-BR. +* The REST API now returns a record with data about your account. There is + a new `GeoIP\Records\MaxMind` class for this data. +* The `continentCode` attribute on `Continent` was renamed to `code`. +* Documentation updates. + +0.1.1 (2013-05-14) +------------------ + +* Updated Guzzle version requirement. +* Fixed Composer example in README.md. + + +0.1.0 (2013-05-13) +------------------ + +* Initial release. diff --git a/vendor/geoip2/geoip2/LICENSE b/vendor/geoip2/geoip2/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/vendor/geoip2/geoip2/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/geoip2/geoip2/README.md b/vendor/geoip2/geoip2/README.md new file mode 100644 index 0000000..e4a74dc --- /dev/null +++ b/vendor/geoip2/geoip2/README.md @@ -0,0 +1,409 @@ +# GeoIP2 PHP API # + +## Description ## + +This package provides an API for the GeoIP2 +[web services](https://dev.maxmind.com/geoip/geoip2/web-services) and +[databases](https://dev.maxmind.com/geoip/geoip2/downloadable). The API also +works with the free +[GeoLite2 databases](https://dev.maxmind.com/geoip/geoip2/geolite2/). + +## Install via Composer ## + +We recommend installing this package with [Composer](https://getcomposer.org/). + +### Download Composer ### + +To download Composer, run in the root directory of your project: + +```bash +curl -sS https://getcomposer.org/installer | php +``` + +You should now have the file `composer.phar` in your project directory. + +### Install Dependencies ### + +Run in your project root: + +``` +php composer.phar require geoip2/geoip2:~2.0 +``` + +You should now have the files `composer.json` and `composer.lock` as well as +the directory `vendor` in your project directory. If you use a version control +system, `composer.json` should be added to it. + +### Require Autoloader ### + +After installing the dependencies, you need to require the Composer autoloader +from your code: + +```php +require 'vendor/autoload.php'; +``` + +## Install via Phar ## + +Although we strongly recommend using Composer, we also provide a +[phar archive](https://php.net/manual/en/book.phar.php) containing most of the +dependencies for GeoIP2. Our latest phar archive is available on +[our releases page](https://github.com/maxmind/GeoIP2-php/releases). + +### Install Dependencies ### + +In order to use the phar archive, you must have the PHP +[Phar extension](https://php.net/manual/en/book.phar.php) installed and +enabled. + +If you will be making web service requests, you must have the PHP +[cURL extension](https://php.net/manual/en/book.curl.php) +installed to use this archive. For Debian based distributions, this can +typically be found in the the `php-curl` package. For other operating +systems, please consult the relevant documentation. After installing the +extension you may need to restart your web server. + +If you are missing this extension, you will see errors like the following: + +``` +PHP Fatal error: Uncaught Error: Call to undefined function MaxMind\WebService\curl_version() +``` + +### Require Package ### + +To use the archive, just require it from your script: + +```php +require 'geoip2.phar'; +``` + +## Optional C Extension ## + +The [MaxMind DB API](https://github.com/maxmind/MaxMind-DB-Reader-php) +includes an optional C extension that you may install to dramatically increase +the performance of lookups in GeoIP2 or GeoLite2 databases. To install, please +follow the instructions included with that API. + +The extension has no effect on web-service lookups. + +## IP Geolocation Usage ## + +IP geolocation is inherently imprecise. Locations are often near the center of +the population. Any location provided by a GeoIP2 database or web service +should not be used to identify a particular address or household. + +## Database Reader ## + +### Usage ### + +To use this API, you must create a new `\GeoIp2\Database\Reader` object with +the path to the database file as the first argument to the constructor. You +may then call the method corresponding to the database you are using. + +If the lookup succeeds, the method call will return a model class for the +record in the database. This model in turn contains multiple container +classes for the different parts of the data such as the city in which the +IP address is located. + +If the record is not found, a `\GeoIp2\Exception\AddressNotFoundException` +is thrown. If the database is invalid or corrupt, a +`\MaxMind\Db\InvalidDatabaseException` will be thrown. + +See the API documentation for more details. + +### City Example ### + +```php +city('128.101.101.101'); + +print($record->country->isoCode . "\n"); // 'US' +print($record->country->name . "\n"); // 'United States' +print($record->country->names['zh-CN'] . "\n"); // '美国' + +print($record->mostSpecificSubdivision->name . "\n"); // 'Minnesota' +print($record->mostSpecificSubdivision->isoCode . "\n"); // 'MN' + +print($record->city->name . "\n"); // 'Minneapolis' + +print($record->postal->code . "\n"); // '55455' + +print($record->location->latitude . "\n"); // 44.9733 +print($record->location->longitude . "\n"); // -93.2323 + +print($record->traits->network . "\n"); // '128.101.101.101/32' + +``` + +### Anonymous IP Example ### + +```php +anonymousIp('128.101.101.101'); + +if ($record->isAnonymous) { print "anon\n"; } +print($record->ipAddress . "\n"); // '128.101.101.101' +print($record->network . "\n"); // '128.101.101.101/32' + +``` + +### Connection-Type Example ### + +```php +connectionType('128.101.101.101'); + +print($record->connectionType . "\n"); // 'Corporate' +print($record->ipAddress . "\n"); // '128.101.101.101' +print($record->network . "\n"); // '128.101.101.101/32' + +``` + +### Domain Example ### + +```php +domain('128.101.101.101'); + +print($record->domain . "\n"); // 'umn.edu' +print($record->ipAddress . "\n"); // '128.101.101.101' +print($record->network . "\n"); // '128.101.101.101/32' + +``` + +### Enterprise Example ### + +```php +enterprise method to do a lookup in the Enterprise database +$record = $reader->enterprise('128.101.101.101'); + +print($record->country->confidence . "\n"); // 99 +print($record->country->isoCode . "\n"); // 'US' +print($record->country->name . "\n"); // 'United States' +print($record->country->names['zh-CN'] . "\n"); // '美国' + +print($record->mostSpecificSubdivision->confidence . "\n"); // 77 +print($record->mostSpecificSubdivision->name . "\n"); // 'Minnesota' +print($record->mostSpecificSubdivision->isoCode . "\n"); // 'MN' + +print($record->city->confidence . "\n"); // 60 +print($record->city->name . "\n"); // 'Minneapolis' + +print($record->postal->code . "\n"); // '55455' + +print($record->location->accuracyRadius . "\n"); // 50 +print($record->location->latitude . "\n"); // 44.9733 +print($record->location->longitude . "\n"); // -93.2323 + +print($record->traits->network . "\n"); // '128.101.101.101/32' + +``` + +### ISP Example ### + +```php +isp('128.101.101.101'); + +print($record->autonomousSystemNumber . "\n"); // 217 +print($record->autonomousSystemOrganization . "\n"); // 'University of Minnesota' +print($record->isp . "\n"); // 'University of Minnesota' +print($record->organization . "\n"); // 'University of Minnesota' + +print($record->ipAddress . "\n"); // '128.101.101.101' +print($record->network . "\n"); // '128.101.101.101/32' + +``` + +## Web Service Client ## + +### Usage ### + +To use this API, you must create a new `\GeoIp2\WebService\Client` +object with your `$accountId` and `$licenseKey`, then you call the method +corresponding to a specific end point, passing it the IP address you want to +look up. + +If the request succeeds, the method call will return a model class for the end +point you called. This model in turn contains multiple record classes, each of +which represents part of the data returned by the web service. + +If there is an error, a structured exception is thrown. + +See the API documentation for more details. + +### Example ### + +```php +city('128.101.101.101'); + +print($record->country->isoCode . "\n"); // 'US' +print($record->country->name . "\n"); // 'United States' +print($record->country->names['zh-CN'] . "\n"); // '美国' + +print($record->mostSpecificSubdivision->name . "\n"); // 'Minnesota' +print($record->mostSpecificSubdivision->isoCode . "\n"); // 'MN' + +print($record->city->name . "\n"); // 'Minneapolis' + +print($record->postal->code . "\n"); // '55455' + +print($record->location->latitude . "\n"); // 44.9733 +print($record->location->longitude . "\n"); // -93.2323 + +print($record->traits->network . "\n"); // '128.101.101.101/32' + +``` + +## Values to use for Database or Array Keys ## + +**We strongly discourage you from using a value from any `names` property as +a key in a database or array.** + +These names may change between releases. Instead we recommend using one of the +following: + +* `GeoIp2\Record\City` - `$city->geonameId` +* `GeoIp2\Record\Continent` - `$continent->code` or `$continent->geonameId` +* `GeoIp2\Record\Country` and `GeoIp2\Record\RepresentedCountry` - + `$country->isoCode` or `$country->geonameId` +* `GeoIp2\Record\Subdivision` - `$subdivision->isoCode` or `$subdivision->geonameId` + +### What data is returned? ### + +While many of the end points return the same basic records, the attributes +which can be populated vary between end points. In addition, while an end +point may offer a particular piece of data, MaxMind does not always have every +piece of data for any given IP address. + +Because of these factors, it is possible for any end point to return a record +where some or all of the attributes are unpopulated. + +See the +[GeoIP2 Precision web service docs](https://dev.maxmind.com/geoip/geoip2/web-services) +for details on what data each end point may return. + +The only piece of data which is always returned is the `ipAddress` +attribute in the `GeoIp2\Record\Traits` record. + +## Integration with GeoNames ## + +[GeoNames](https://www.geonames.org/) offers web services and downloadable +databases with data on geographical features around the world, including +populated places. They offer both free and paid premium data. Each +feature is unique identified by a `geonameId`, which is an integer. + +Many of the records returned by the GeoIP2 web services and databases +include a `geonameId` property. This is the ID of a geographical feature +(city, region, country, etc.) in the GeoNames database. + +Some of the data that MaxMind provides is also sourced from GeoNames. We +source things like place names, ISO codes, and other similar data from +the GeoNames premium data set. + +## Reporting data problems ## + +If the problem you find is that an IP address is incorrectly mapped, +please +[submit your correction to MaxMind](https://www.maxmind.com/en/correction). + +If you find some other sort of mistake, like an incorrect spelling, +please check the [GeoNames site](https://www.geonames.org/) first. Once +you've searched for a place and found it on the GeoNames map view, there +are a number of links you can use to correct data ("move", "edit", +"alternate names", etc.). Once the correction is part of the GeoNames +data set, it will be automatically incorporated into future MaxMind +releases. + +If you are a paying MaxMind customer and you're not sure where to submit +a correction, please +[contact MaxMind support](https://www.maxmind.com/en/support) for help. + +## Other Support ## + +Please report all issues with this code using the +[GitHub issue tracker](https://github.com/maxmind/GeoIP2-php/issues). + +If you are having an issue with a MaxMind service that is not specific +to the client API, please see +[our support page](https://www.maxmind.com/en/support). + +## Requirements ## + +This library requires PHP 5.6 or greater. + +This library also relies on the [MaxMind DB Reader](https://github.com/maxmind/MaxMind-DB-Reader-php). + +## Contributing ## + +Patches and pull requests are encouraged. All code should follow the PSR-2 +style guidelines. Please include unit tests whenever possible. You may obtain +the test data for the maxmind-db folder by running `git submodule update +--init --recursive` or adding `--recursive` to your initial clone, or from +https://github.com/maxmind/MaxMind-DB + +## Versioning ## + +The GeoIP2 PHP API uses [Semantic Versioning](https://semver.org/). + +## Copyright and License ## + +This software is Copyright (c) 2013-2019 by MaxMind, Inc. + +This is free software, licensed under the Apache License, Version 2.0. diff --git a/vendor/geoip2/geoip2/composer.json b/vendor/geoip2/geoip2/composer.json new file mode 100644 index 0000000..94669ff --- /dev/null +++ b/vendor/geoip2/geoip2/composer.json @@ -0,0 +1,31 @@ +{ + "name": "geoip2/geoip2", + "description": "MaxMind GeoIP2 PHP API", + "keywords": ["geoip", "geoip2", "geolocation", "ip", "maxmind"], + "homepage": "https://github.com/maxmind/GeoIP2-php", + "type": "library", + "license": "Apache-2.0", + "authors": [ + { + "name": "Gregory J. Oschwald", + "email": "goschwald@maxmind.com", + "homepage": "https://www.maxmind.com/" + } + ], + "require": { + "maxmind-db/reader": "~1.5", + "maxmind/web-service-common": "~0.6", + "php": ">=5.6", + "ext-json": "*" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "2.*", + "phpunit/phpunit": "5.*", + "squizlabs/php_codesniffer": "3.*" + }, + "autoload": { + "psr-4": { + "GeoIp2\\": "src" + } + } +} diff --git a/vendor/geoip2/geoip2/examples/benchmark.php b/vendor/geoip2/geoip2/examples/benchmark.php new file mode 100644 index 0000000..7af2a5d --- /dev/null +++ b/vendor/geoip2/geoip2/examples/benchmark.php @@ -0,0 +1,25 @@ +city($ip); + } catch (\GeoIp2\Exception\AddressNotFoundException $e) { + } + if ($i % 10000 === 0) { + echo $i . ' ' . $ip . "\n"; + } +} +$endTime = microtime(true); + +$duration = $endTime - $startTime; +echo 'Requests per second: ' . $count / $duration . "\n"; diff --git a/vendor/geoip2/geoip2/src/Database/Reader.php b/vendor/geoip2/geoip2/src/Database/Reader.php new file mode 100644 index 0000000..9c33e3d --- /dev/null +++ b/vendor/geoip2/geoip2/src/Database/Reader.php @@ -0,0 +1,287 @@ +dbReader = new DbReader($filename); + $this->dbType = $this->dbReader->metadata()->databaseType; + $this->locales = $locales; + } + + /** + * This method returns a GeoIP2 City model. + * + * @param string $ipAddress an IPv4 or IPv6 address as a string + * + * @throws \GeoIp2\Exception\AddressNotFoundException if the address is + * not in the database + * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database + * is corrupt or invalid + * + * @return \GeoIp2\Model\City + */ + public function city($ipAddress) + { + return $this->modelFor('City', 'City', $ipAddress); + } + + /** + * This method returns a GeoIP2 Country model. + * + * @param string $ipAddress an IPv4 or IPv6 address as a string + * + * @throws \GeoIp2\Exception\AddressNotFoundException if the address is + * not in the database + * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database + * is corrupt or invalid + * + * @return \GeoIp2\Model\Country + */ + public function country($ipAddress) + { + return $this->modelFor('Country', 'Country', $ipAddress); + } + + /** + * This method returns a GeoIP2 Anonymous IP model. + * + * @param string $ipAddress an IPv4 or IPv6 address as a string + * + * @throws \GeoIp2\Exception\AddressNotFoundException if the address is + * not in the database + * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database + * is corrupt or invalid + * + * @return \GeoIp2\Model\AnonymousIp + */ + public function anonymousIp($ipAddress) + { + return $this->flatModelFor( + 'AnonymousIp', + 'GeoIP2-Anonymous-IP', + $ipAddress + ); + } + + /** + * This method returns a GeoLite2 ASN model. + * + * @param string $ipAddress an IPv4 or IPv6 address as a string + * + * @throws \GeoIp2\Exception\AddressNotFoundException if the address is + * not in the database + * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database + * is corrupt or invalid + * + * @return \GeoIp2\Model\Asn + */ + public function asn($ipAddress) + { + return $this->flatModelFor( + 'Asn', + 'GeoLite2-ASN', + $ipAddress + ); + } + + /** + * This method returns a GeoIP2 Connection Type model. + * + * @param string $ipAddress an IPv4 or IPv6 address as a string + * + * @throws \GeoIp2\Exception\AddressNotFoundException if the address is + * not in the database + * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database + * is corrupt or invalid + * + * @return \GeoIp2\Model\ConnectionType + */ + public function connectionType($ipAddress) + { + return $this->flatModelFor( + 'ConnectionType', + 'GeoIP2-Connection-Type', + $ipAddress + ); + } + + /** + * This method returns a GeoIP2 Domain model. + * + * @param string $ipAddress an IPv4 or IPv6 address as a string + * + * @throws \GeoIp2\Exception\AddressNotFoundException if the address is + * not in the database + * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database + * is corrupt or invalid + * + * @return \GeoIp2\Model\Domain + */ + public function domain($ipAddress) + { + return $this->flatModelFor( + 'Domain', + 'GeoIP2-Domain', + $ipAddress + ); + } + + /** + * This method returns a GeoIP2 Enterprise model. + * + * @param string $ipAddress an IPv4 or IPv6 address as a string + * + * @throws \GeoIp2\Exception\AddressNotFoundException if the address is + * not in the database + * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database + * is corrupt or invalid + * + * @return \GeoIp2\Model\Enterprise + */ + public function enterprise($ipAddress) + { + return $this->modelFor('Enterprise', 'Enterprise', $ipAddress); + } + + /** + * This method returns a GeoIP2 ISP model. + * + * @param string $ipAddress an IPv4 or IPv6 address as a string + * + * @throws \GeoIp2\Exception\AddressNotFoundException if the address is + * not in the database + * @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database + * is corrupt or invalid + * + * @return \GeoIp2\Model\Isp + */ + public function isp($ipAddress) + { + return $this->flatModelFor( + 'Isp', + 'GeoIP2-ISP', + $ipAddress + ); + } + + private function modelFor($class, $type, $ipAddress) + { + list($record, $prefixLen) = $this->getRecord($class, $type, $ipAddress); + + $record['traits']['ip_address'] = $ipAddress; + $record['traits']['prefix_len'] = $prefixLen; + + $class = 'GeoIp2\\Model\\' . $class; + + return new $class($record, $this->locales); + } + + private function flatModelFor($class, $type, $ipAddress) + { + list($record, $prefixLen) = $this->getRecord($class, $type, $ipAddress); + + $record['ip_address'] = $ipAddress; + $record['prefix_len'] = $prefixLen; + $class = 'GeoIp2\\Model\\' . $class; + + return new $class($record); + } + + private function getRecord($class, $type, $ipAddress) + { + if (strpos($this->dbType, $type) === false) { + $method = lcfirst($class); + throw new \BadMethodCallException( + "The $method method cannot be used to open a {$this->dbType} database" + ); + } + list($record, $prefixLen) = $this->dbReader->getWithPrefixLen($ipAddress); + if ($record === null) { + throw new AddressNotFoundException( + "The address $ipAddress is not in the database." + ); + } + if (!\is_array($record)) { + // This can happen on corrupt databases. Generally, + // MaxMind\Db\Reader will throw a + // MaxMind\Db\Reader\InvalidDatabaseException, but occasionally + // the lookup may result in a record that looks valid but is not + // an array. This mostly happens when the user is ignoring all + // exceptions and the more frequent InvalidDatabaseException + // exceptions go unnoticed. + throw new InvalidDatabaseException( + "Expected an array when looking up $ipAddress but received: " + . \gettype($record) + ); + } + + return [$record, $prefixLen]; + } + + /** + * @throws \InvalidArgumentException if arguments are passed to the method + * @throws \BadMethodCallException if the database has been closed + * + * @return \MaxMind\Db\Reader\Metadata object for the database + */ + public function metadata() + { + return $this->dbReader->metadata(); + } + + /** + * Closes the GeoIP2 database and returns the resources to the system. + */ + public function close() + { + $this->dbReader->close(); + } +} diff --git a/vendor/geoip2/geoip2/src/Exception/AddressNotFoundException.php b/vendor/geoip2/geoip2/src/Exception/AddressNotFoundException.php new file mode 100644 index 0000000..4e60c28 --- /dev/null +++ b/vendor/geoip2/geoip2/src/Exception/AddressNotFoundException.php @@ -0,0 +1,10 @@ +uri = $uri; + parent::__construct($message, $httpStatus, $previous); + } +} diff --git a/vendor/geoip2/geoip2/src/Exception/InvalidRequestException.php b/vendor/geoip2/geoip2/src/Exception/InvalidRequestException.php new file mode 100644 index 0000000..63b6e42 --- /dev/null +++ b/vendor/geoip2/geoip2/src/Exception/InvalidRequestException.php @@ -0,0 +1,26 @@ +error = $error; + parent::__construct($message, $httpStatus, $uri, $previous); + } +} diff --git a/vendor/geoip2/geoip2/src/Exception/OutOfQueriesException.php b/vendor/geoip2/geoip2/src/Exception/OutOfQueriesException.php new file mode 100644 index 0000000..16dc7b8 --- /dev/null +++ b/vendor/geoip2/geoip2/src/Exception/OutOfQueriesException.php @@ -0,0 +1,10 @@ +raw = $raw; + } + + /** + * @ignore + * + * @param mixed $field + */ + protected function get($field) + { + if (isset($this->raw[$field])) { + return $this->raw[$field]; + } + if (preg_match('/^is_/', $field)) { + return false; + } + + return null; + } + + /** + * @ignore + * + * @param mixed $attr + */ + public function __get($attr) + { + if ($attr !== 'instance' && property_exists($this, $attr)) { + return $this->$attr; + } + + throw new \RuntimeException("Unknown attribute: $attr"); + } + + /** + * @ignore + * + * @param mixed $attr + */ + public function __isset($attr) + { + return $attr !== 'instance' && isset($this->$attr); + } + + public function jsonSerialize() + { + return $this->raw; + } +} diff --git a/vendor/geoip2/geoip2/src/Model/AnonymousIp.php b/vendor/geoip2/geoip2/src/Model/AnonymousIp.php new file mode 100644 index 0000000..bf05b88 --- /dev/null +++ b/vendor/geoip2/geoip2/src/Model/AnonymousIp.php @@ -0,0 +1,56 @@ +isAnonymous = $this->get('is_anonymous'); + $this->isAnonymousVpn = $this->get('is_anonymous_vpn'); + $this->isHostingProvider = $this->get('is_hosting_provider'); + $this->isPublicProxy = $this->get('is_public_proxy'); + $this->isTorExitNode = $this->get('is_tor_exit_node'); + $ipAddress = $this->get('ip_address'); + $this->ipAddress = $ipAddress; + $this->network = Util::cidr($ipAddress, $this->get('prefix_len')); + } +} diff --git a/vendor/geoip2/geoip2/src/Model/Asn.php b/vendor/geoip2/geoip2/src/Model/Asn.php new file mode 100644 index 0000000..09f746e --- /dev/null +++ b/vendor/geoip2/geoip2/src/Model/Asn.php @@ -0,0 +1,43 @@ +autonomousSystemNumber = $this->get('autonomous_system_number'); + $this->autonomousSystemOrganization = + $this->get('autonomous_system_organization'); + $ipAddress = $this->get('ip_address'); + $this->ipAddress = $ipAddress; + $this->network = Util::cidr($ipAddress, $this->get('prefix_len')); + } +} diff --git a/vendor/geoip2/geoip2/src/Model/City.php b/vendor/geoip2/geoip2/src/Model/City.php new file mode 100644 index 0000000..bf8e352 --- /dev/null +++ b/vendor/geoip2/geoip2/src/Model/City.php @@ -0,0 +1,116 @@ +city = new \GeoIp2\Record\City($this->get('city'), $locales); + $this->location = new \GeoIp2\Record\Location($this->get('location')); + $this->postal = new \GeoIp2\Record\Postal($this->get('postal')); + + $this->createSubdivisions($raw, $locales); + } + + private function createSubdivisions($raw, $locales) + { + if (!isset($raw['subdivisions'])) { + return; + } + + foreach ($raw['subdivisions'] as $sub) { + array_push( + $this->subdivisions, + new \GeoIp2\Record\Subdivision($sub, $locales) + ); + } + } + + /** + * @ignore + * + * @param mixed $attr + */ + public function __get($attr) + { + if ($attr === 'mostSpecificSubdivision') { + return $this->$attr(); + } + + return parent::__get($attr); + } + + /** + * @ignore + * + * @param mixed $attr + */ + public function __isset($attr) + { + if ($attr === 'mostSpecificSubdivision') { + // We always return a mostSpecificSubdivision, even if it is the + // empty subdivision + return true; + } + + return parent::__isset($attr); + } + + private function mostSpecificSubdivision() + { + return empty($this->subdivisions) ? + new \GeoIp2\Record\Subdivision([], $this->locales) : + end($this->subdivisions); + } +} diff --git a/vendor/geoip2/geoip2/src/Model/ConnectionType.php b/vendor/geoip2/geoip2/src/Model/ConnectionType.php new file mode 100644 index 0000000..013e6c3 --- /dev/null +++ b/vendor/geoip2/geoip2/src/Model/ConnectionType.php @@ -0,0 +1,39 @@ +connectionType = $this->get('connection_type'); + $ipAddress = $this->get('ip_address'); + $this->ipAddress = $ipAddress; + $this->network = Util::cidr($ipAddress, $this->get('prefix_len')); + } +} diff --git a/vendor/geoip2/geoip2/src/Model/Country.php b/vendor/geoip2/geoip2/src/Model/Country.php new file mode 100644 index 0000000..64d2650 --- /dev/null +++ b/vendor/geoip2/geoip2/src/Model/Country.php @@ -0,0 +1,71 @@ +continent = new \GeoIp2\Record\Continent( + $this->get('continent'), + $locales + ); + $this->country = new \GeoIp2\Record\Country( + $this->get('country'), + $locales + ); + $this->maxmind = new \GeoIp2\Record\MaxMind($this->get('maxmind')); + $this->registeredCountry = new \GeoIp2\Record\Country( + $this->get('registered_country'), + $locales + ); + $this->representedCountry = new \GeoIp2\Record\RepresentedCountry( + $this->get('represented_country'), + $locales + ); + $this->traits = new \GeoIp2\Record\Traits($this->get('traits')); + + $this->locales = $locales; + } +} diff --git a/vendor/geoip2/geoip2/src/Model/Domain.php b/vendor/geoip2/geoip2/src/Model/Domain.php new file mode 100644 index 0000000..57982f7 --- /dev/null +++ b/vendor/geoip2/geoip2/src/Model/Domain.php @@ -0,0 +1,39 @@ +domain = $this->get('domain'); + $ipAddress = $this->get('ip_address'); + $this->ipAddress = $ipAddress; + $this->network = Util::cidr($ipAddress, $this->get('prefix_len')); + } +} diff --git a/vendor/geoip2/geoip2/src/Model/Enterprise.php b/vendor/geoip2/geoip2/src/Model/Enterprise.php new file mode 100644 index 0000000..7f153fa --- /dev/null +++ b/vendor/geoip2/geoip2/src/Model/Enterprise.php @@ -0,0 +1,14 @@ +autonomousSystemNumber = $this->get('autonomous_system_number'); + $this->autonomousSystemOrganization = + $this->get('autonomous_system_organization'); + $this->isp = $this->get('isp'); + $this->organization = $this->get('organization'); + + $ipAddress = $this->get('ip_address'); + $this->ipAddress = $ipAddress; + $this->network = Util::cidr($ipAddress, $this->get('prefix_len')); + } +} diff --git a/vendor/geoip2/geoip2/src/ProviderInterface.php b/vendor/geoip2/geoip2/src/ProviderInterface.php new file mode 100644 index 0000000..9162069 --- /dev/null +++ b/vendor/geoip2/geoip2/src/ProviderInterface.php @@ -0,0 +1,20 @@ +locales = $locales; + parent::__construct($record); + } + + /** + * @ignore + * + * @param mixed $attr + */ + public function __get($attr) + { + if ($attr === 'name') { + return $this->name(); + } + + return parent::__get($attr); + } + + /** + * @ignore + * + * @param mixed $attr + */ + public function __isset($attr) + { + if ($attr === 'name') { + return $this->firstSetNameLocale() === null ? false : true; + } + + return parent::__isset($attr); + } + + private function name() + { + $locale = $this->firstSetNameLocale(); + + return $locale === null ? null : $this->names[$locale]; + } + + private function firstSetNameLocale() + { + foreach ($this->locales as $locale) { + if (isset($this->names[$locale])) { + return $locale; + } + } + + return null; + } +} diff --git a/vendor/geoip2/geoip2/src/Record/AbstractRecord.php b/vendor/geoip2/geoip2/src/Record/AbstractRecord.php new file mode 100644 index 0000000..b2441ad --- /dev/null +++ b/vendor/geoip2/geoip2/src/Record/AbstractRecord.php @@ -0,0 +1,61 @@ +record = isset($record) ? $record : []; + } + + /** + * @ignore + * + * @param mixed $attr + */ + public function __get($attr) + { + // XXX - kind of ugly but greatly reduces boilerplate code + $key = $this->attributeToKey($attr); + + if ($this->__isset($attr)) { + return $this->record[$key]; + } elseif ($this->validAttribute($attr)) { + if (preg_match('/^is_/', $key)) { + return false; + } + + return null; + } + throw new \RuntimeException("Unknown attribute: $attr"); + } + + public function __isset($attr) + { + return $this->validAttribute($attr) && + isset($this->record[$this->attributeToKey($attr)]); + } + + private function attributeToKey($attr) + { + return strtolower(preg_replace('/([A-Z])/', '_\1', $attr)); + } + + private function validAttribute($attr) + { + return \in_array($attr, $this->validAttributes, true); + } + + public function jsonSerialize() + { + return $this->record; + } +} diff --git a/vendor/geoip2/geoip2/src/Record/City.php b/vendor/geoip2/geoip2/src/Record/City.php new file mode 100644 index 0000000..f2e1f61 --- /dev/null +++ b/vendor/geoip2/geoip2/src/Record/City.php @@ -0,0 +1,29 @@ +military + * but this could expand to include other types in the future. + */ +class RepresentedCountry extends Country +{ + protected $validAttributes = [ + 'confidence', + 'geonameId', + 'isInEuropeanUnion', + 'isoCode', + 'names', + 'type', + ]; +} diff --git a/vendor/geoip2/geoip2/src/Record/Subdivision.php b/vendor/geoip2/geoip2/src/Record/Subdivision.php new file mode 100644 index 0000000..4ad4e7f --- /dev/null +++ b/vendor/geoip2/geoip2/src/Record/Subdivision.php @@ -0,0 +1,40 @@ +The user type associated with the IP + * address. This can be one of the following values:

+ *
    + *
  • business + *
  • cafe + *
  • cellular + *
  • college + *
  • content_delivery_network + *
  • dialup + *
  • government + *
  • hosting + *
  • library + *
  • military + *
  • residential + *
  • router + *
  • school + *
  • search_engine_spider + *
  • traveler + *
+ *

+ * This attribute is only available from the Insights web service and the + * GeoIP2 Enterprise database. + *

+ */ +class Traits extends AbstractRecord +{ + /** + * @ignore + */ + protected $validAttributes = [ + 'autonomousSystemNumber', + 'autonomousSystemOrganization', + 'connectionType', + 'domain', + 'ipAddress', + 'isAnonymous', + 'isAnonymousProxy', + 'isAnonymousVpn', + 'isHostingProvider', + 'isLegitimateProxy', + 'isp', + 'isPublicProxy', + 'isSatelliteProvider', + 'isTorExitNode', + 'network', + 'organization', + 'staticIpScore', + 'userCount', + 'userType', + ]; + + public function __construct($record) + { + if (!isset($record['network']) && isset($record['ip_address']) && isset($record['prefix_len'])) { + $record['network'] = Util::cidr($record['ip_address'], $record['prefix_len']); + } + + parent::__construct($record); + } +} diff --git a/vendor/geoip2/geoip2/src/Util.php b/vendor/geoip2/geoip2/src/Util.php new file mode 100644 index 0000000..ac6d14c --- /dev/null +++ b/vendor/geoip2/geoip2/src/Util.php @@ -0,0 +1,37 @@ + 0; $i++) { + $b = $ipBytes[$i]; + if ($curPrefix < 8) { + $shiftN = 8 - $curPrefix; + $b = \chr(0xFF & (\ord($b) >> $shiftN) << $shiftN); + } + $networkBytes[$i] = $b; + $curPrefix -= 8; + } + + $network = inet_ntop($networkBytes); + + return "$network/$prefixLen"; + } +} diff --git a/vendor/geoip2/geoip2/src/WebService/Client.php b/vendor/geoip2/geoip2/src/WebService/Client.php new file mode 100644 index 0000000..bebca56 --- /dev/null +++ b/vendor/geoip2/geoip2/src/WebService/Client.php @@ -0,0 +1,239 @@ +locales = $locales; + + // This is for backwards compatibility. Do not remove except for a + // major version bump. + if (\is_string($options)) { + $options = ['host' => $options]; + } + + if (!isset($options['host'])) { + $options['host'] = 'geoip.maxmind.com'; + } + + $options['userAgent'] = $this->userAgent(); + + $this->client = new WsClient($accountId, $licenseKey, $options); + } + + private function userAgent() + { + return 'GeoIP2-API/' . self::VERSION; + } + + /** + * This method calls the GeoIP2 Precision: City service. + * + * @param string $ipAddress IPv4 or IPv6 address as a string. If no + * address is provided, the address that the web service is called + * from will be used. + * + * @throws \GeoIp2\Exception\AddressNotFoundException if the address you + * provided is not in our database (e.g., a private address). + * @throws \GeoIp2\Exception\AuthenticationException if there is a problem + * with the account ID or license key that you provided + * @throws \GeoIp2\Exception\OutOfQueriesException if your account is out + * of queries + * @throws \GeoIp2\Exception\InvalidRequestException} if your request was received by the web service but is + * invalid for some other reason. This may indicate an issue + * with this API. Please report the error to MaxMind. + * @throws \GeoIp2\Exception\HttpException if an unexpected HTTP error code or message was returned. + * This could indicate a problem with the connection between + * your server and the web service or that the web service + * returned an invalid document or 500 error code + * @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent + * class to the above exceptions. It will be thrown directly + * if a 200 status code is returned but the body is invalid. + * + * @return \GeoIp2\Model\City + */ + public function city($ipAddress = 'me') + { + return $this->responseFor('city', 'City', $ipAddress); + } + + /** + * This method calls the GeoIP2 Precision: Country service. + * + * @param string $ipAddress IPv4 or IPv6 address as a string. If no + * address is provided, the address that the web service is called + * from will be used. + * + * @throws \GeoIp2\Exception\AddressNotFoundException if the address you provided is not in our database (e.g., + * a private address). + * @throws \GeoIp2\Exception\AuthenticationException if there is a problem + * with the account ID or license key that you provided + * @throws \GeoIp2\Exception\OutOfQueriesException if your account is out of queries + * @throws \GeoIp2\Exception\InvalidRequestException} if your request was received by the web service but is + * invalid for some other reason. This may indicate an + * issue with this API. Please report the error to MaxMind. + * @throws \GeoIp2\Exception\HttpException if an unexpected HTTP error + * code or message was returned. This could indicate a problem + * with the connection between your server and the web service + * or that the web service returned an invalid document or 500 + * error code. + * @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent class to the above exceptions. It + * will be thrown directly if a 200 status code is returned but + * the body is invalid. + * + * @return \GeoIp2\Model\Country + */ + public function country($ipAddress = 'me') + { + return $this->responseFor('country', 'Country', $ipAddress); + } + + /** + * This method calls the GeoIP2 Precision: Insights service. + * + * @param string $ipAddress IPv4 or IPv6 address as a string. If no + * address is provided, the address that the web service is called + * from will be used. + * + * @throws \GeoIp2\Exception\AddressNotFoundException if the address you + * provided is not in our database (e.g., a private address). + * @throws \GeoIp2\Exception\AuthenticationException if there is a problem + * with the account ID or license key that you provided + * @throws \GeoIp2\Exception\OutOfQueriesException if your account is out + * of queries + * @throws \GeoIp2\Exception\InvalidRequestException} if your request was received by the web service but is + * invalid for some other reason. This may indicate an + * issue with this API. Please report the error to MaxMind. + * @throws \GeoIp2\Exception\HttpException if an unexpected HTTP error code or message was returned. + * This could indicate a problem with the connection between + * your server and the web service or that the web service + * returned an invalid document or 500 error code + * @throws \GeoIp2\Exception\GeoIp2Exception This serves as the parent + * class to the above exceptions. It will be thrown directly + * if a 200 status code is returned but the body is invalid. + * + * @return \GeoIp2\Model\Insights + */ + public function insights($ipAddress = 'me') + { + return $this->responseFor('insights', 'Insights', $ipAddress); + } + + private function responseFor($endpoint, $class, $ipAddress) + { + $path = implode('/', [self::$basePath, $endpoint, $ipAddress]); + + try { + $body = $this->client->get('GeoIP2 ' . $class, $path); + } catch (\MaxMind\Exception\IpAddressNotFoundException $ex) { + throw new AddressNotFoundException( + $ex->getMessage(), + $ex->getStatusCode(), + $ex + ); + } catch (\MaxMind\Exception\AuthenticationException $ex) { + throw new AuthenticationException( + $ex->getMessage(), + $ex->getStatusCode(), + $ex + ); + } catch (\MaxMind\Exception\InsufficientFundsException $ex) { + throw new OutOfQueriesException( + $ex->getMessage(), + $ex->getStatusCode(), + $ex + ); + } catch (\MaxMind\Exception\InvalidRequestException $ex) { + throw new InvalidRequestException( + $ex->getMessage(), + $ex->getErrorCode(), + $ex->getStatusCode(), + $ex->getUri(), + $ex + ); + } catch (\MaxMind\Exception\HttpException $ex) { + throw new HttpException( + $ex->getMessage(), + $ex->getStatusCode(), + $ex->getUri(), + $ex + ); + } catch (\MaxMind\Exception\WebServiceException $ex) { + throw new GeoIp2Exception( + $ex->getMessage(), + $ex->getCode(), + $ex + ); + } + + $class = 'GeoIp2\\Model\\' . $class; + + return new $class($body, $this->locales); + } +} diff --git a/vendor/guzzlehttp/guzzle/.php_cs b/vendor/guzzlehttp/guzzle/.php_cs new file mode 100644 index 0000000..2dd5036 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/.php_cs @@ -0,0 +1,23 @@ +setRiskyAllowed(true) + ->setRules([ + '@PSR2' => true, + 'array_syntax' => ['syntax' => 'short'], + 'declare_strict_types' => false, + 'concat_space' => ['spacing'=>'one'], + 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], + 'ordered_imports' => true, + // 'phpdoc_align' => ['align'=>'vertical'], + // 'native_function_invocation' => true, + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->in(__DIR__.'/src') + ->in(__DIR__.'/tests') + ->name('*.php') + ) +; + +return $config; diff --git a/vendor/guzzlehttp/guzzle/CHANGELOG.md b/vendor/guzzlehttp/guzzle/CHANGELOG.md new file mode 100644 index 0000000..464cf1c --- /dev/null +++ b/vendor/guzzlehttp/guzzle/CHANGELOG.md @@ -0,0 +1,1338 @@ +# Change Log + +## 6.5.5 - 2020-06-16 + +* Unpin version constraint for `symfony/polyfill-intl-idn` [#2678](https://github.com/guzzle/guzzle/pull/2678) + +## 6.5.4 - 2020-05-25 + +* Fix various intl icu issues [#2626](https://github.com/guzzle/guzzle/pull/2626) + +## 6.5.3 - 2020-04-18 + +* Use Symfony intl-idn polyfill [#2550](https://github.com/guzzle/guzzle/pull/2550) +* Remove use of internal functions [#2548](https://github.com/guzzle/guzzle/pull/2548) + +## 6.5.2 - 2019-12-23 + +* idn_to_ascii() fix for old PHP versions [#2489](https://github.com/guzzle/guzzle/pull/2489) + +## 6.5.1 - 2019-12-21 + +* Better defaults for PHP installations with old ICU lib [#2454](https://github.com/guzzle/guzzle/pull/2454) +* IDN support for redirects [#2424](https://github.com/guzzle/guzzle/pull/2424) + +## 6.5.0 - 2019-12-07 + +* Improvement: Added support for reset internal queue in MockHandler. [#2143](https://github.com/guzzle/guzzle/pull/2143) +* Improvement: Added support to pass arbitrary options to `curl_multi_init`. [#2287](https://github.com/guzzle/guzzle/pull/2287) +* Fix: Gracefully handle passing `null` to the `header` option. [#2132](https://github.com/guzzle/guzzle/pull/2132) +* Fix: `RetryMiddleware` did not do exponential delay between retries due unit mismatch. [#2132](https://github.com/guzzle/guzzle/pull/2132) + Previously, `RetryMiddleware` would sleep for 1 millisecond, then 2 milliseconds, then 4 milliseconds. + **After this change, `RetryMiddleware` will sleep for 1 second, then 2 seconds, then 4 seconds.** + `Middleware::retry()` accepts a second callback parameter to override the default timeouts if needed. +* Fix: Prevent undefined offset when using array for ssl_key options. [#2348](https://github.com/guzzle/guzzle/pull/2348) +* Deprecated `ClientInterface::VERSION` + +## 6.4.1 - 2019-10-23 + +* No `guzzle.phar` was created in 6.4.0 due expired API token. This release will fix that +* Added `parent::__construct()` to `FileCookieJar` and `SessionCookieJar` + +## 6.4.0 - 2019-10-23 + +* Improvement: Improved error messages when using curl < 7.21.2 [#2108](https://github.com/guzzle/guzzle/pull/2108) +* Fix: Test if response is readable before returning a summary in `RequestException::getResponseBodySummary()` [#2081](https://github.com/guzzle/guzzle/pull/2081) +* Fix: Add support for GUZZLE_CURL_SELECT_TIMEOUT environment variable [#2161](https://github.com/guzzle/guzzle/pull/2161) +* Improvement: Added `GuzzleHttp\Exception\InvalidArgumentException` [#2163](https://github.com/guzzle/guzzle/pull/2163) +* Improvement: Added `GuzzleHttp\_current_time()` to use `hrtime()` if that function exists. [#2242](https://github.com/guzzle/guzzle/pull/2242) +* Improvement: Added curl's `appconnect_time` in `TransferStats` [#2284](https://github.com/guzzle/guzzle/pull/2284) +* Improvement: Make GuzzleException extend Throwable wherever it's available [#2273](https://github.com/guzzle/guzzle/pull/2273) +* Fix: Prevent concurrent writes to file when saving `CookieJar` [#2335](https://github.com/guzzle/guzzle/pull/2335) +* Improvement: Update `MockHandler` so we can test transfer time [#2362](https://github.com/guzzle/guzzle/pull/2362) + +## 6.3.3 - 2018-04-22 + +* Fix: Default headers when decode_content is specified + + +## 6.3.2 - 2018-03-26 + +* Fix: Release process + + +## 6.3.1 - 2018-03-26 + +* Bug fix: Parsing 0 epoch expiry times in cookies [#2014](https://github.com/guzzle/guzzle/pull/2014) +* Improvement: Better ConnectException detection [#2012](https://github.com/guzzle/guzzle/pull/2012) +* Bug fix: Malformed domain that contains a "/" [#1999](https://github.com/guzzle/guzzle/pull/1999) +* Bug fix: Undefined offset when a cookie has no first key-value pair [#1998](https://github.com/guzzle/guzzle/pull/1998) +* Improvement: Support PHPUnit 6 [#1953](https://github.com/guzzle/guzzle/pull/1953) +* Bug fix: Support empty headers [#1915](https://github.com/guzzle/guzzle/pull/1915) +* Bug fix: Ignore case during header modifications [#1916](https://github.com/guzzle/guzzle/pull/1916) + ++ Minor code cleanups, documentation fixes and clarifications. + + +## 6.3.0 - 2017-06-22 + +* Feature: force IP resolution (ipv4 or ipv6) [#1608](https://github.com/guzzle/guzzle/pull/1608), [#1659](https://github.com/guzzle/guzzle/pull/1659) +* Improvement: Don't include summary in exception message when body is empty [#1621](https://github.com/guzzle/guzzle/pull/1621) +* Improvement: Handle `on_headers` option in MockHandler [#1580](https://github.com/guzzle/guzzle/pull/1580) +* Improvement: Added SUSE Linux CA path [#1609](https://github.com/guzzle/guzzle/issues/1609) +* Improvement: Use class reference for getting the name of the class instead of using hardcoded strings [#1641](https://github.com/guzzle/guzzle/pull/1641) +* Feature: Added `read_timeout` option [#1611](https://github.com/guzzle/guzzle/pull/1611) +* Bug fix: PHP 7.x fixes [#1685](https://github.com/guzzle/guzzle/pull/1685), [#1686](https://github.com/guzzle/guzzle/pull/1686), [#1811](https://github.com/guzzle/guzzle/pull/1811) +* Deprecation: BadResponseException instantiation without a response [#1642](https://github.com/guzzle/guzzle/pull/1642) +* Feature: Added NTLM auth [#1569](https://github.com/guzzle/guzzle/pull/1569) +* Feature: Track redirect HTTP status codes [#1711](https://github.com/guzzle/guzzle/pull/1711) +* Improvement: Check handler type during construction [#1745](https://github.com/guzzle/guzzle/pull/1745) +* Improvement: Always include the Content-Length if there's a body [#1721](https://github.com/guzzle/guzzle/pull/1721) +* Feature: Added convenience method to access a cookie by name [#1318](https://github.com/guzzle/guzzle/pull/1318) +* Bug fix: Fill `CURLOPT_CAPATH` and `CURLOPT_CAINFO` properly [#1684](https://github.com/guzzle/guzzle/pull/1684) +* Improvement: Use `\GuzzleHttp\Promise\rejection_for` function instead of object init [#1827](https://github.com/guzzle/guzzle/pull/1827) + + ++ Minor code cleanups, documentation fixes and clarifications. + +## 6.2.3 - 2017-02-28 + +* Fix deprecations with guzzle/psr7 version 1.4 + +## 6.2.2 - 2016-10-08 + +* Allow to pass nullable Response to delay callable +* Only add scheme when host is present +* Fix drain case where content-length is the literal string zero +* Obfuscate in-URL credentials in exceptions + +## 6.2.1 - 2016-07-18 + +* Address HTTP_PROXY security vulnerability, CVE-2016-5385: + https://httpoxy.org/ +* Fixing timeout bug with StreamHandler: + https://github.com/guzzle/guzzle/pull/1488 +* Only read up to `Content-Length` in PHP StreamHandler to avoid timeouts when + a server does not honor `Connection: close`. +* Ignore URI fragment when sending requests. + +## 6.2.0 - 2016-03-21 + +* Feature: added `GuzzleHttp\json_encode` and `GuzzleHttp\json_decode`. + https://github.com/guzzle/guzzle/pull/1389 +* Bug fix: Fix sleep calculation when waiting for delayed requests. + https://github.com/guzzle/guzzle/pull/1324 +* Feature: More flexible history containers. + https://github.com/guzzle/guzzle/pull/1373 +* Bug fix: defer sink stream opening in StreamHandler. + https://github.com/guzzle/guzzle/pull/1377 +* Bug fix: do not attempt to escape cookie values. + https://github.com/guzzle/guzzle/pull/1406 +* Feature: report original content encoding and length on decoded responses. + https://github.com/guzzle/guzzle/pull/1409 +* Bug fix: rewind seekable request bodies before dispatching to cURL. + https://github.com/guzzle/guzzle/pull/1422 +* Bug fix: provide an empty string to `http_build_query` for HHVM workaround. + https://github.com/guzzle/guzzle/pull/1367 + +## 6.1.1 - 2015-11-22 + +* Bug fix: Proxy::wrapSync() now correctly proxies to the appropriate handler + https://github.com/guzzle/guzzle/commit/911bcbc8b434adce64e223a6d1d14e9a8f63e4e4 +* Feature: HandlerStack is now more generic. + https://github.com/guzzle/guzzle/commit/f2102941331cda544745eedd97fc8fd46e1ee33e +* Bug fix: setting verify to false in the StreamHandler now disables peer + verification. https://github.com/guzzle/guzzle/issues/1256 +* Feature: Middleware now uses an exception factory, including more error + context. https://github.com/guzzle/guzzle/pull/1282 +* Feature: better support for disabled functions. + https://github.com/guzzle/guzzle/pull/1287 +* Bug fix: fixed regression where MockHandler was not using `sink`. + https://github.com/guzzle/guzzle/pull/1292 + +## 6.1.0 - 2015-09-08 + +* Feature: Added the `on_stats` request option to provide access to transfer + statistics for requests. https://github.com/guzzle/guzzle/pull/1202 +* Feature: Added the ability to persist session cookies in CookieJars. + https://github.com/guzzle/guzzle/pull/1195 +* Feature: Some compatibility updates for Google APP Engine + https://github.com/guzzle/guzzle/pull/1216 +* Feature: Added support for NO_PROXY to prevent the use of a proxy based on + a simple set of rules. https://github.com/guzzle/guzzle/pull/1197 +* Feature: Cookies can now contain square brackets. + https://github.com/guzzle/guzzle/pull/1237 +* Bug fix: Now correctly parsing `=` inside of quotes in Cookies. + https://github.com/guzzle/guzzle/pull/1232 +* Bug fix: Cusotm cURL options now correctly override curl options of the + same name. https://github.com/guzzle/guzzle/pull/1221 +* Bug fix: Content-Type header is now added when using an explicitly provided + multipart body. https://github.com/guzzle/guzzle/pull/1218 +* Bug fix: Now ignoring Set-Cookie headers that have no name. +* Bug fix: Reason phrase is no longer cast to an int in some cases in the + cURL handler. https://github.com/guzzle/guzzle/pull/1187 +* Bug fix: Remove the Authorization header when redirecting if the Host + header changes. https://github.com/guzzle/guzzle/pull/1207 +* Bug fix: Cookie path matching fixes + https://github.com/guzzle/guzzle/issues/1129 +* Bug fix: Fixing the cURL `body_as_string` setting + https://github.com/guzzle/guzzle/pull/1201 +* Bug fix: quotes are no longer stripped when parsing cookies. + https://github.com/guzzle/guzzle/issues/1172 +* Bug fix: `form_params` and `query` now always uses the `&` separator. + https://github.com/guzzle/guzzle/pull/1163 +* Bug fix: Adding a Content-Length to PHP stream wrapper requests if not set. + https://github.com/guzzle/guzzle/pull/1189 + +## 6.0.2 - 2015-07-04 + +* Fixed a memory leak in the curl handlers in which references to callbacks + were not being removed by `curl_reset`. +* Cookies are now extracted properly before redirects. +* Cookies now allow more character ranges. +* Decoded Content-Encoding responses are now modified to correctly reflect + their state if the encoding was automatically removed by a handler. This + means that the `Content-Encoding` header may be removed an the + `Content-Length` modified to reflect the message size after removing the + encoding. +* Added a more explicit error message when trying to use `form_params` and + `multipart` in the same request. +* Several fixes for HHVM support. +* Functions are now conditionally required using an additional level of + indirection to help with global Composer installations. + +## 6.0.1 - 2015-05-27 + +* Fixed a bug with serializing the `query` request option where the `&` + separator was missing. +* Added a better error message for when `body` is provided as an array. Please + use `form_params` or `multipart` instead. +* Various doc fixes. + +## 6.0.0 - 2015-05-26 + +* See the UPGRADING.md document for more information. +* Added `multipart` and `form_params` request options. +* Added `synchronous` request option. +* Added the `on_headers` request option. +* Fixed `expect` handling. +* No longer adding default middlewares in the client ctor. These need to be + present on the provided handler in order to work. +* Requests are no longer initiated when sending async requests with the + CurlMultiHandler. This prevents unexpected recursion from requests completing + while ticking the cURL loop. +* Removed the semantics of setting `default` to `true`. This is no longer + required now that the cURL loop is not ticked for async requests. +* Added request and response logging middleware. +* No longer allowing self signed certificates when using the StreamHandler. +* Ensuring that `sink` is valid if saving to a file. +* Request exceptions now include a "handler context" which provides handler + specific contextual information. +* Added `GuzzleHttp\RequestOptions` to allow request options to be applied + using constants. +* `$maxHandles` has been removed from CurlMultiHandler. +* `MultipartPostBody` is now part of the `guzzlehttp/psr7` package. + +## 5.3.0 - 2015-05-19 + +* Mock now supports `save_to` +* Marked `AbstractRequestEvent::getTransaction()` as public. +* Fixed a bug in which multiple headers using different casing would overwrite + previous headers in the associative array. +* Added `Utils::getDefaultHandler()` +* Marked `GuzzleHttp\Client::getDefaultUserAgent` as deprecated. +* URL scheme is now always lowercased. + +## 6.0.0-beta.1 + +* Requires PHP >= 5.5 +* Updated to use PSR-7 + * Requires immutable messages, which basically means an event based system + owned by a request instance is no longer possible. + * Utilizing the [Guzzle PSR-7 package](https://github.com/guzzle/psr7). + * Removed the dependency on `guzzlehttp/streams`. These stream abstractions + are available in the `guzzlehttp/psr7` package under the `GuzzleHttp\Psr7` + namespace. +* Added middleware and handler system + * Replaced the Guzzle event and subscriber system with a middleware system. + * No longer depends on RingPHP, but rather places the HTTP handlers directly + in Guzzle, operating on PSR-7 messages. + * Retry logic is now encapsulated in `GuzzleHttp\Middleware::retry`, which + means the `guzzlehttp/retry-subscriber` is now obsolete. + * Mocking responses is now handled using `GuzzleHttp\Handler\MockHandler`. +* Asynchronous responses + * No longer supports the `future` request option to send an async request. + Instead, use one of the `*Async` methods of a client (e.g., `requestAsync`, + `getAsync`, etc.). + * Utilizing `GuzzleHttp\Promise` instead of React's promise library to avoid + recursion required by chaining and forwarding react promises. See + https://github.com/guzzle/promises + * Added `requestAsync` and `sendAsync` to send request asynchronously. + * Added magic methods for `getAsync()`, `postAsync()`, etc. to send requests + asynchronously. +* Request options + * POST and form updates + * Added the `form_fields` and `form_files` request options. + * Removed the `GuzzleHttp\Post` namespace. + * The `body` request option no longer accepts an array for POST requests. + * The `exceptions` request option has been deprecated in favor of the + `http_errors` request options. + * The `save_to` request option has been deprecated in favor of `sink` request + option. +* Clients no longer accept an array of URI template string and variables for + URI variables. You will need to expand URI templates before passing them + into a client constructor or request method. +* Client methods `get()`, `post()`, `put()`, `patch()`, `options()`, etc. are + now magic methods that will send synchronous requests. +* Replaced `Utils.php` with plain functions in `functions.php`. +* Removed `GuzzleHttp\Collection`. +* Removed `GuzzleHttp\BatchResults`. Batched pool results are now returned as + an array. +* Removed `GuzzleHttp\Query`. Query string handling is now handled using an + associative array passed into the `query` request option. The query string + is serialized using PHP's `http_build_query`. If you need more control, you + can pass the query string in as a string. +* `GuzzleHttp\QueryParser` has been replaced with the + `GuzzleHttp\Psr7\parse_query`. + +## 5.2.0 - 2015-01-27 + +* Added `AppliesHeadersInterface` to make applying headers to a request based + on the body more generic and not specific to `PostBodyInterface`. +* Reduced the number of stack frames needed to send requests. +* Nested futures are now resolved in the client rather than the RequestFsm +* Finishing state transitions is now handled in the RequestFsm rather than the + RingBridge. +* Added a guard in the Pool class to not use recursion for request retries. + +## 5.1.0 - 2014-12-19 + +* Pool class no longer uses recursion when a request is intercepted. +* The size of a Pool can now be dynamically adjusted using a callback. + See https://github.com/guzzle/guzzle/pull/943. +* Setting a request option to `null` when creating a request with a client will + ensure that the option is not set. This allows you to overwrite default + request options on a per-request basis. + See https://github.com/guzzle/guzzle/pull/937. +* Added the ability to limit which protocols are allowed for redirects by + specifying a `protocols` array in the `allow_redirects` request option. +* Nested futures due to retries are now resolved when waiting for synchronous + responses. See https://github.com/guzzle/guzzle/pull/947. +* `"0"` is now an allowed URI path. See + https://github.com/guzzle/guzzle/pull/935. +* `Query` no longer typehints on the `$query` argument in the constructor, + allowing for strings and arrays. +* Exceptions thrown in the `end` event are now correctly wrapped with Guzzle + specific exceptions if necessary. + +## 5.0.3 - 2014-11-03 + +This change updates query strings so that they are treated as un-encoded values +by default where the value represents an un-encoded value to send over the +wire. A Query object then encodes the value before sending over the wire. This +means that even value query string values (e.g., ":") are url encoded. This +makes the Query class match PHP's http_build_query function. However, if you +want to send requests over the wire using valid query string characters that do +not need to be encoded, then you can provide a string to Url::setQuery() and +pass true as the second argument to specify that the query string is a raw +string that should not be parsed or encoded (unless a call to getQuery() is +subsequently made, forcing the query-string to be converted into a Query +object). + +## 5.0.2 - 2014-10-30 + +* Added a trailing `\r\n` to multipart/form-data payloads. See + https://github.com/guzzle/guzzle/pull/871 +* Added a `GuzzleHttp\Pool::send()` convenience method to match the docs. +* Status codes are now returned as integers. See + https://github.com/guzzle/guzzle/issues/881 +* No longer overwriting an existing `application/x-www-form-urlencoded` header + when sending POST requests, allowing for customized headers. See + https://github.com/guzzle/guzzle/issues/877 +* Improved path URL serialization. + + * No longer double percent-encoding characters in the path or query string if + they are already encoded. + * Now properly encoding the supplied path to a URL object, instead of only + encoding ' ' and '?'. + * Note: This has been changed in 5.0.3 to now encode query string values by + default unless the `rawString` argument is provided when setting the query + string on a URL: Now allowing many more characters to be present in the + query string without being percent encoded. See http://tools.ietf.org/html/rfc3986#appendix-A + +## 5.0.1 - 2014-10-16 + +Bugfix release. + +* Fixed an issue where connection errors still returned response object in + error and end events event though the response is unusable. This has been + corrected so that a response is not returned in the `getResponse` method of + these events if the response did not complete. https://github.com/guzzle/guzzle/issues/867 +* Fixed an issue where transfer statistics were not being populated in the + RingBridge. https://github.com/guzzle/guzzle/issues/866 + +## 5.0.0 - 2014-10-12 + +Adding support for non-blocking responses and some minor API cleanup. + +### New Features + +* Added support for non-blocking responses based on `guzzlehttp/guzzle-ring`. +* Added a public API for creating a default HTTP adapter. +* Updated the redirect plugin to be non-blocking so that redirects are sent + concurrently. Other plugins like this can now be updated to be non-blocking. +* Added a "progress" event so that you can get upload and download progress + events. +* Added `GuzzleHttp\Pool` which implements FutureInterface and transfers + requests concurrently using a capped pool size as efficiently as possible. +* Added `hasListeners()` to EmitterInterface. +* Removed `GuzzleHttp\ClientInterface::sendAll` and marked + `GuzzleHttp\Client::sendAll` as deprecated (it's still there, just not the + recommended way). + +### Breaking changes + +The breaking changes in this release are relatively minor. The biggest thing to +look out for is that request and response objects no longer implement fluent +interfaces. + +* Removed the fluent interfaces (i.e., `return $this`) from requests, + responses, `GuzzleHttp\Collection`, `GuzzleHttp\Url`, + `GuzzleHttp\Query`, `GuzzleHttp\Post\PostBody`, and + `GuzzleHttp\Cookie\SetCookie`. This blog post provides a good outline of + why I did this: http://ocramius.github.io/blog/fluent-interfaces-are-evil/. + This also makes the Guzzle message interfaces compatible with the current + PSR-7 message proposal. +* Removed "functions.php", so that Guzzle is truly PSR-4 compliant. Except + for the HTTP request functions from function.php, these functions are now + implemented in `GuzzleHttp\Utils` using camelCase. `GuzzleHttp\json_decode` + moved to `GuzzleHttp\Utils::jsonDecode`. `GuzzleHttp\get_path` moved to + `GuzzleHttp\Utils::getPath`. `GuzzleHttp\set_path` moved to + `GuzzleHttp\Utils::setPath`. `GuzzleHttp\batch` should now be + `GuzzleHttp\Pool::batch`, which returns an `objectStorage`. Using functions.php + caused problems for many users: they aren't PSR-4 compliant, require an + explicit include, and needed an if-guard to ensure that the functions are not + declared multiple times. +* Rewrote adapter layer. + * Removing all classes from `GuzzleHttp\Adapter`, these are now + implemented as callables that are stored in `GuzzleHttp\Ring\Client`. + * Removed the concept of "parallel adapters". Sending requests serially or + concurrently is now handled using a single adapter. + * Moved `GuzzleHttp\Adapter\Transaction` to `GuzzleHttp\Transaction`. The + Transaction object now exposes the request, response, and client as public + properties. The getters and setters have been removed. +* Removed the "headers" event. This event was only useful for changing the + body a response once the headers of the response were known. You can implement + a similar behavior in a number of ways. One example might be to use a + FnStream that has access to the transaction being sent. For example, when the + first byte is written, you could check if the response headers match your + expectations, and if so, change the actual stream body that is being + written to. +* Removed the `asArray` parameter from + `GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header + value as an array, then use the newly added `getHeaderAsArray()` method of + `MessageInterface`. This change makes the Guzzle interfaces compatible with + the PSR-7 interfaces. +* `GuzzleHttp\Message\MessageFactory` no longer allows subclasses to add + custom request options using double-dispatch (this was an implementation + detail). Instead, you should now provide an associative array to the + constructor which is a mapping of the request option name mapping to a + function that applies the option value to a request. +* Removed the concept of "throwImmediately" from exceptions and error events. + This control mechanism was used to stop a transfer of concurrent requests + from completing. This can now be handled by throwing the exception or by + cancelling a pool of requests or each outstanding future request individually. +* Updated to "GuzzleHttp\Streams" 3.0. + * `GuzzleHttp\Stream\StreamInterface::getContents()` no longer accepts a + `maxLen` parameter. This update makes the Guzzle streams project + compatible with the current PSR-7 proposal. + * `GuzzleHttp\Stream\Stream::__construct`, + `GuzzleHttp\Stream\Stream::factory`, and + `GuzzleHttp\Stream\Utils::create` no longer accept a size in the second + argument. They now accept an associative array of options, including the + "size" key and "metadata" key which can be used to provide custom metadata. + +## 4.2.2 - 2014-09-08 + +* Fixed a memory leak in the CurlAdapter when reusing cURL handles. +* No longer using `request_fulluri` in stream adapter proxies. +* Relative redirects are now based on the last response, not the first response. + +## 4.2.1 - 2014-08-19 + +* Ensuring that the StreamAdapter does not always add a Content-Type header +* Adding automated github releases with a phar and zip + +## 4.2.0 - 2014-08-17 + +* Now merging in default options using a case-insensitive comparison. + Closes https://github.com/guzzle/guzzle/issues/767 +* Added the ability to automatically decode `Content-Encoding` response bodies + using the `decode_content` request option. This is set to `true` by default + to decode the response body if it comes over the wire with a + `Content-Encoding`. Set this value to `false` to disable decoding the + response content, and pass a string to provide a request `Accept-Encoding` + header and turn on automatic response decoding. This feature now allows you + to pass an `Accept-Encoding` header in the headers of a request but still + disable automatic response decoding. + Closes https://github.com/guzzle/guzzle/issues/764 +* Added the ability to throw an exception immediately when transferring + requests in parallel. Closes https://github.com/guzzle/guzzle/issues/760 +* Updating guzzlehttp/streams dependency to ~2.1 +* No longer utilizing the now deprecated namespaced methods from the stream + package. + +## 4.1.8 - 2014-08-14 + +* Fixed an issue in the CurlFactory that caused setting the `stream=false` + request option to throw an exception. + See: https://github.com/guzzle/guzzle/issues/769 +* TransactionIterator now calls rewind on the inner iterator. + See: https://github.com/guzzle/guzzle/pull/765 +* You can now set the `Content-Type` header to `multipart/form-data` + when creating POST requests to force multipart bodies. + See https://github.com/guzzle/guzzle/issues/768 + +## 4.1.7 - 2014-08-07 + +* Fixed an error in the HistoryPlugin that caused the same request and response + to be logged multiple times when an HTTP protocol error occurs. +* Ensuring that cURL does not add a default Content-Type when no Content-Type + has been supplied by the user. This prevents the adapter layer from modifying + the request that is sent over the wire after any listeners may have already + put the request in a desired state (e.g., signed the request). +* Throwing an exception when you attempt to send requests that have the + "stream" set to true in parallel using the MultiAdapter. +* Only calling curl_multi_select when there are active cURL handles. This was + previously changed and caused performance problems on some systems due to PHP + always selecting until the maximum select timeout. +* Fixed a bug where multipart/form-data POST fields were not correctly + aggregated (e.g., values with "&"). + +## 4.1.6 - 2014-08-03 + +* Added helper methods to make it easier to represent messages as strings, + including getting the start line and getting headers as a string. + +## 4.1.5 - 2014-08-02 + +* Automatically retrying cURL "Connection died, retrying a fresh connect" + errors when possible. +* cURL implementation cleanup +* Allowing multiple event subscriber listeners to be registered per event by + passing an array of arrays of listener configuration. + +## 4.1.4 - 2014-07-22 + +* Fixed a bug that caused multi-part POST requests with more than one field to + serialize incorrectly. +* Paths can now be set to "0" +* `ResponseInterface::xml` now accepts a `libxml_options` option and added a + missing default argument that was required when parsing XML response bodies. +* A `save_to` stream is now created lazily, which means that files are not + created on disk unless a request succeeds. + +## 4.1.3 - 2014-07-15 + +* Various fixes to multipart/form-data POST uploads +* Wrapping function.php in an if-statement to ensure Guzzle can be used + globally and in a Composer install +* Fixed an issue with generating and merging in events to an event array +* POST headers are only applied before sending a request to allow you to change + the query aggregator used before uploading +* Added much more robust query string parsing +* Fixed various parsing and normalization issues with URLs +* Fixing an issue where multi-valued headers were not being utilized correctly + in the StreamAdapter + +## 4.1.2 - 2014-06-18 + +* Added support for sending payloads with GET requests + +## 4.1.1 - 2014-06-08 + +* Fixed an issue related to using custom message factory options in subclasses +* Fixed an issue with nested form fields in a multi-part POST +* Fixed an issue with using the `json` request option for POST requests +* Added `ToArrayInterface` to `GuzzleHttp\Cookie\CookieJar` + +## 4.1.0 - 2014-05-27 + +* Added a `json` request option to easily serialize JSON payloads. +* Added a `GuzzleHttp\json_decode()` wrapper to safely parse JSON. +* Added `setPort()` and `getPort()` to `GuzzleHttp\Message\RequestInterface`. +* Added the ability to provide an emitter to a client in the client constructor. +* Added the ability to persist a cookie session using $_SESSION. +* Added a trait that can be used to add event listeners to an iterator. +* Removed request method constants from RequestInterface. +* Fixed warning when invalid request start-lines are received. +* Updated MessageFactory to work with custom request option methods. +* Updated cacert bundle to latest build. + +4.0.2 (2014-04-16) +------------------ + +* Proxy requests using the StreamAdapter now properly use request_fulluri (#632) +* Added the ability to set scalars as POST fields (#628) + +## 4.0.1 - 2014-04-04 + +* The HTTP status code of a response is now set as the exception code of + RequestException objects. +* 303 redirects will now correctly switch from POST to GET requests. +* The default parallel adapter of a client now correctly uses the MultiAdapter. +* HasDataTrait now initializes the internal data array as an empty array so + that the toArray() method always returns an array. + +## 4.0.0 - 2014-03-29 + +* For more information on the 4.0 transition, see: + http://mtdowling.com/blog/2014/03/15/guzzle-4-rc/ +* For information on changes and upgrading, see: + https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40 +* Added `GuzzleHttp\batch()` as a convenience function for sending requests in + parallel without needing to write asynchronous code. +* Restructured how events are added to `GuzzleHttp\ClientInterface::sendAll()`. + You can now pass a callable or an array of associative arrays where each + associative array contains the "fn", "priority", and "once" keys. + +## 4.0.0.rc-2 - 2014-03-25 + +* Removed `getConfig()` and `setConfig()` from clients to avoid confusion + around whether things like base_url, message_factory, etc. should be able to + be retrieved or modified. +* Added `getDefaultOption()` and `setDefaultOption()` to ClientInterface +* functions.php functions were renamed using snake_case to match PHP idioms +* Added support for `HTTP_PROXY`, `HTTPS_PROXY`, and + `GUZZLE_CURL_SELECT_TIMEOUT` environment variables +* Added the ability to specify custom `sendAll()` event priorities +* Added the ability to specify custom stream context options to the stream + adapter. +* Added a functions.php function for `get_path()` and `set_path()` +* CurlAdapter and MultiAdapter now use a callable to generate curl resources +* MockAdapter now properly reads a body and emits a `headers` event +* Updated Url class to check if a scheme and host are set before adding ":" + and "//". This allows empty Url (e.g., "") to be serialized as "". +* Parsing invalid XML no longer emits warnings +* Curl classes now properly throw AdapterExceptions +* Various performance optimizations +* Streams are created with the faster `Stream\create()` function +* Marked deprecation_proxy() as internal +* Test server is now a collection of static methods on a class + +## 4.0.0-rc.1 - 2014-03-15 + +* See https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40 + +## 3.8.1 - 2014-01-28 + +* Bug: Always using GET requests when redirecting from a 303 response +* Bug: CURLOPT_SSL_VERIFYHOST is now correctly set to false when setting `$certificateAuthority` to false in + `Guzzle\Http\ClientInterface::setSslVerification()` +* Bug: RedirectPlugin now uses strict RFC 3986 compliance when combining a base URL with a relative URL +* Bug: The body of a request can now be set to `"0"` +* Sending PHP stream requests no longer forces `HTTP/1.0` +* Adding more information to ExceptionCollection exceptions so that users have more context, including a stack trace of + each sub-exception +* Updated the `$ref` attribute in service descriptions to merge over any existing parameters of a schema (rather than + clobbering everything). +* Merging URLs will now use the query string object from the relative URL (thus allowing custom query aggregators) +* Query strings are now parsed in a way that they do no convert empty keys with no value to have a dangling `=`. + For example `foo&bar=baz` is now correctly parsed and recognized as `foo&bar=baz` rather than `foo=&bar=baz`. +* Now properly escaping the regular expression delimiter when matching Cookie domains. +* Network access is now disabled when loading XML documents + +## 3.8.0 - 2013-12-05 + +* Added the ability to define a POST name for a file +* JSON response parsing now properly walks additionalProperties +* cURL error code 18 is now retried automatically in the BackoffPlugin +* Fixed a cURL error when URLs contain fragments +* Fixed an issue in the BackoffPlugin retry event where it was trying to access all exceptions as if they were + CurlExceptions +* CURLOPT_PROGRESS function fix for PHP 5.5 (69fcc1e) +* Added the ability for Guzzle to work with older versions of cURL that do not support `CURLOPT_TIMEOUT_MS` +* Fixed a bug that was encountered when parsing empty header parameters +* UriTemplate now has a `setRegex()` method to match the docs +* The `debug` request parameter now checks if it is truthy rather than if it exists +* Setting the `debug` request parameter to true shows verbose cURL output instead of using the LogPlugin +* Added the ability to combine URLs using strict RFC 3986 compliance +* Command objects can now return the validation errors encountered by the command +* Various fixes to cache revalidation (#437 and 29797e5) +* Various fixes to the AsyncPlugin +* Cleaned up build scripts + +## 3.7.4 - 2013-10-02 + +* Bug fix: 0 is now an allowed value in a description parameter that has a default value (#430) +* Bug fix: SchemaFormatter now returns an integer when formatting to a Unix timestamp + (see https://github.com/aws/aws-sdk-php/issues/147) +* Bug fix: Cleaned up and fixed URL dot segment removal to properly resolve internal dots +* Minimum PHP version is now properly specified as 5.3.3 (up from 5.3.2) (#420) +* Updated the bundled cacert.pem (#419) +* OauthPlugin now supports adding authentication to headers or query string (#425) + +## 3.7.3 - 2013-09-08 + +* Added the ability to get the exception associated with a request/command when using `MultiTransferException` and + `CommandTransferException`. +* Setting `additionalParameters` of a response to false is now honored when parsing responses with a service description +* Schemas are only injected into response models when explicitly configured. +* No longer guessing Content-Type based on the path of a request. Content-Type is now only guessed based on the path of + an EntityBody. +* Bug fix: ChunkedIterator can now properly chunk a \Traversable as well as an \Iterator. +* Bug fix: FilterIterator now relies on `\Iterator` instead of `\Traversable`. +* Bug fix: Gracefully handling malformed responses in RequestMediator::writeResponseBody() +* Bug fix: Replaced call to canCache with canCacheRequest in the CallbackCanCacheStrategy of the CachePlugin +* Bug fix: Visiting XML attributes first before visiting XML children when serializing requests +* Bug fix: Properly parsing headers that contain commas contained in quotes +* Bug fix: mimetype guessing based on a filename is now case-insensitive + +## 3.7.2 - 2013-08-02 + +* Bug fix: Properly URL encoding paths when using the PHP-only version of the UriTemplate expander + See https://github.com/guzzle/guzzle/issues/371 +* Bug fix: Cookie domains are now matched correctly according to RFC 6265 + See https://github.com/guzzle/guzzle/issues/377 +* Bug fix: GET parameters are now used when calculating an OAuth signature +* Bug fix: Fixed an issue with cache revalidation where the If-None-Match header was being double quoted +* `Guzzle\Common\AbstractHasDispatcher::dispatch()` now returns the event that was dispatched +* `Guzzle\Http\QueryString::factory()` now guesses the most appropriate query aggregator to used based on the input. + See https://github.com/guzzle/guzzle/issues/379 +* Added a way to add custom domain objects to service description parsing using the `operation.parse_class` event. See + https://github.com/guzzle/guzzle/pull/380 +* cURL multi cleanup and optimizations + +## 3.7.1 - 2013-07-05 + +* Bug fix: Setting default options on a client now works +* Bug fix: Setting options on HEAD requests now works. See #352 +* Bug fix: Moving stream factory before send event to before building the stream. See #353 +* Bug fix: Cookies no longer match on IP addresses per RFC 6265 +* Bug fix: Correctly parsing header parameters that are in `<>` and quotes +* Added `cert` and `ssl_key` as request options +* `Host` header can now diverge from the host part of a URL if the header is set manually +* `Guzzle\Service\Command\LocationVisitor\Request\XmlVisitor` was rewritten to change from using SimpleXML to XMLWriter +* OAuth parameters are only added via the plugin if they aren't already set +* Exceptions are now thrown when a URL cannot be parsed +* Returning `false` if `Guzzle\Http\EntityBody::getContentMd5()` fails +* Not setting a `Content-MD5` on a command if calculating the Content-MD5 fails via the CommandContentMd5Plugin + +## 3.7.0 - 2013-06-10 + +* See UPGRADING.md for more information on how to upgrade. +* Requests now support the ability to specify an array of $options when creating a request to more easily modify a + request. You can pass a 'request.options' configuration setting to a client to apply default request options to + every request created by a client (e.g. default query string variables, headers, curl options, etc.). +* Added a static facade class that allows you to use Guzzle with static methods and mount the class to `\Guzzle`. + See `Guzzle\Http\StaticClient::mount`. +* Added `command.request_options` to `Guzzle\Service\Command\AbstractCommand` to pass request options to requests + created by a command (e.g. custom headers, query string variables, timeout settings, etc.). +* Stream size in `Guzzle\Stream\PhpStreamRequestFactory` will now be set if Content-Length is returned in the + headers of a response +* Added `Guzzle\Common\Collection::setPath($path, $value)` to set a value into an array using a nested key + (e.g. `$collection->setPath('foo/baz/bar', 'test'); echo $collection['foo']['bar']['bar'];`) +* ServiceBuilders now support storing and retrieving arbitrary data +* CachePlugin can now purge all resources for a given URI +* CachePlugin can automatically purge matching cached items when a non-idempotent request is sent to a resource +* CachePlugin now uses the Vary header to determine if a resource is a cache hit +* `Guzzle\Http\Message\Response` now implements `\Serializable` +* Added `Guzzle\Cache\CacheAdapterFactory::fromCache()` to more easily create cache adapters +* `Guzzle\Service\ClientInterface::execute()` now accepts an array, single command, or Traversable +* Fixed a bug in `Guzzle\Http\Message\Header\Link::addLink()` +* Better handling of calculating the size of a stream in `Guzzle\Stream\Stream` using fstat() and caching the size +* `Guzzle\Common\Exception\ExceptionCollection` now creates a more readable exception message +* Fixing BC break: Added back the MonologLogAdapter implementation rather than extending from PsrLog so that older + Symfony users can still use the old version of Monolog. +* Fixing BC break: Added the implementation back in for `Guzzle\Http\Message\AbstractMessage::getTokenizedHeader()`. + Now triggering an E_USER_DEPRECATED warning when used. Use `$message->getHeader()->parseParams()`. +* Several performance improvements to `Guzzle\Common\Collection` +* Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`: + createRequest, head, delete, put, patch, post, options, prepareRequest +* Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()` +* Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface` +* Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to + `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a + resource, string, or EntityBody into the $options parameter to specify the download location of the response. +* Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a + default `array()` +* Added `Guzzle\Stream\StreamInterface::isRepeatable` +* Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use + $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or + $client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))`. +* Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use $client->getConfig()->getPath('request.options/headers')`. +* Removed `Guzzle\Http\ClientInterface::expandTemplate()` +* Removed `Guzzle\Http\ClientInterface::setRequestFactory()` +* Removed `Guzzle\Http\ClientInterface::getCurlMulti()` +* Removed `Guzzle\Http\Message\RequestInterface::canCache` +* Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect` +* Removed `Guzzle\Http\Message\RequestInterface::isRedirect` +* Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods. +* You can now enable E_USER_DEPRECATED warnings to see if you are using a deprecated method by setting + `Guzzle\Common\Version::$emitWarnings` to true. +* Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use + `$request->getResponseBody()->isRepeatable()` instead. +* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use + `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use + `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +* Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead. +* Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead. +* Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated +* Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. + These will work through Guzzle 4.0 +* Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use [request.options][params]. +* Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client. +* Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use $client->getConfig()->getPath('request.options/headers')`. +* Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. +* Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8. +* Marked `Guzzle\Common\Collection::inject()` as deprecated. +* Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest');` +* CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a + CacheStorageInterface. These two objects and interface will be removed in a future version. +* Always setting X-cache headers on cached responses +* Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin +* `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface + $request, Response $response);` +* `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);` +* `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);` +* Added `CacheStorageInterface::purge($url)` +* `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin + $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache, + CanCacheStrategyInterface $canCache = null)` +* Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)` + +## 3.6.0 - 2013-05-29 + +* ServiceDescription now implements ToArrayInterface +* Added command.hidden_params to blacklist certain headers from being treated as additionalParameters +* Guzzle can now correctly parse incomplete URLs +* Mixed casing of headers are now forced to be a single consistent casing across all values for that header. +* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution +* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader(). +* Specific header implementations can be created for complex headers. When a message creates a header, it uses a + HeaderFactory which can map specific headers to specific header classes. There is now a Link header and + CacheControl header implementation. +* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate +* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti() +* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in + Guzzle\Http\Curl\RequestMediator +* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string. +* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface +* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders() +* Removed Guzzle\Parser\ParserRegister::get(). Use getParser() +* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser(). +* All response header helper functions return a string rather than mixing Header objects and strings inconsistently +* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle + directly via interfaces +* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist + but are a no-op until removed. +* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a + `Guzzle\Service\Command\ArrayCommandInterface`. +* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response + on a request while the request is still being transferred +* The ability to case-insensitively search for header values +* Guzzle\Http\Message\Header::hasExactHeader +* Guzzle\Http\Message\Header::raw. Use getAll() +* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object + instead. +* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess +* Added the ability to cast Model objects to a string to view debug information. + +## 3.5.0 - 2013-05-13 + +* Bug: Fixed a regression so that request responses are parsed only once per oncomplete event rather than multiple times +* Bug: Better cleanup of one-time events across the board (when an event is meant to fire once, it will now remove + itself from the EventDispatcher) +* Bug: `Guzzle\Log\MessageFormatter` now properly writes "total_time" and "connect_time" values +* Bug: Cloning an EntityEnclosingRequest now clones the EntityBody too +* Bug: Fixed an undefined index error when parsing nested JSON responses with a sentAs parameter that reference a + non-existent key +* Bug: All __call() method arguments are now required (helps with mocking frameworks) +* Deprecating Response::getRequest() and now using a shallow clone of a request object to remove a circular reference + to help with refcount based garbage collection of resources created by sending a request +* Deprecating ZF1 cache and log adapters. These will be removed in the next major version. +* Deprecating `Response::getPreviousResponse()` (method signature still exists, but it's deprecated). Use the + HistoryPlugin for a history. +* Added a `responseBody` alias for the `response_body` location +* Refactored internals to no longer rely on Response::getRequest() +* HistoryPlugin can now be cast to a string +* HistoryPlugin now logs transactions rather than requests and responses to more accurately keep track of the requests + and responses that are sent over the wire +* Added `getEffectiveUrl()` and `getRedirectCount()` to Response objects + +## 3.4.3 - 2013-04-30 + +* Bug fix: Fixing bug introduced in 3.4.2 where redirect responses are duplicated on the final redirected response +* Added a check to re-extract the temp cacert bundle from the phar before sending each request + +## 3.4.2 - 2013-04-29 + +* Bug fix: Stream objects now work correctly with "a" and "a+" modes +* Bug fix: Removing `Transfer-Encoding: chunked` header when a Content-Length is present +* Bug fix: AsyncPlugin no longer forces HEAD requests +* Bug fix: DateTime timezones are now properly handled when using the service description schema formatter +* Bug fix: CachePlugin now properly handles stale-if-error directives when a request to the origin server fails +* Setting a response on a request will write to the custom request body from the response body if one is specified +* LogPlugin now writes to php://output when STDERR is undefined +* Added the ability to set multiple POST files for the same key in a single call +* application/x-www-form-urlencoded POSTs now use the utf-8 charset by default +* Added the ability to queue CurlExceptions to the MockPlugin +* Cleaned up how manual responses are queued on requests (removed "queued_response" and now using request.before_send) +* Configuration loading now allows remote files + +## 3.4.1 - 2013-04-16 + +* Large refactoring to how CurlMulti handles work. There is now a proxy that sits in front of a pool of CurlMulti + handles. This greatly simplifies the implementation, fixes a couple bugs, and provides a small performance boost. +* Exceptions are now properly grouped when sending requests in parallel +* Redirects are now properly aggregated when a multi transaction fails +* Redirects now set the response on the original object even in the event of a failure +* Bug fix: Model names are now properly set even when using $refs +* Added support for PHP 5.5's CurlFile to prevent warnings with the deprecated @ syntax +* Added support for oauth_callback in OAuth signatures +* Added support for oauth_verifier in OAuth signatures +* Added support to attempt to retrieve a command first literally, then ucfirst, the with inflection + +## 3.4.0 - 2013-04-11 + +* Bug fix: URLs are now resolved correctly based on http://tools.ietf.org/html/rfc3986#section-5.2. #289 +* Bug fix: Absolute URLs with a path in a service description will now properly override the base URL. #289 +* Bug fix: Parsing a query string with a single PHP array value will now result in an array. #263 +* Bug fix: Better normalization of the User-Agent header to prevent duplicate headers. #264. +* Bug fix: Added `number` type to service descriptions. +* Bug fix: empty parameters are removed from an OAuth signature +* Bug fix: Revalidating a cache entry prefers the Last-Modified over the Date header +* Bug fix: Fixed "array to string" error when validating a union of types in a service description +* Bug fix: Removed code that attempted to determine the size of a stream when data is written to the stream +* Bug fix: Not including an `oauth_token` if the value is null in the OauthPlugin. +* Bug fix: Now correctly aggregating successful requests and failed requests in CurlMulti when a redirect occurs. +* The new default CURLOPT_TIMEOUT setting has been increased to 150 seconds so that Guzzle works on poor connections. +* Added a feature to EntityEnclosingRequest::setBody() that will automatically set the Content-Type of the request if + the Content-Type can be determined based on the entity body or the path of the request. +* Added the ability to overwrite configuration settings in a client when grabbing a throwaway client from a builder. +* Added support for a PSR-3 LogAdapter. +* Added a `command.after_prepare` event +* Added `oauth_callback` parameter to the OauthPlugin +* Added the ability to create a custom stream class when using a stream factory +* Added a CachingEntityBody decorator +* Added support for `additionalParameters` in service descriptions to define how custom parameters are serialized. +* The bundled SSL certificate is now provided in the phar file and extracted when running Guzzle from a phar. +* You can now send any EntityEnclosingRequest with POST fields or POST files and cURL will handle creating bodies +* POST requests using a custom entity body are now treated exactly like PUT requests but with a custom cURL method. This + means that the redirect behavior of POST requests with custom bodies will not be the same as POST requests that use + POST fields or files (the latter is only used when emulating a form POST in the browser). +* Lots of cleanup to CurlHandle::factory and RequestFactory::createRequest + +## 3.3.1 - 2013-03-10 + +* Added the ability to create PHP streaming responses from HTTP requests +* Bug fix: Running any filters when parsing response headers with service descriptions +* Bug fix: OauthPlugin fixes to allow for multi-dimensional array signing, and sorting parameters before signing +* Bug fix: Removed the adding of default empty arrays and false Booleans to responses in order to be consistent across + response location visitors. +* Bug fix: Removed the possibility of creating configuration files with circular dependencies +* RequestFactory::create() now uses the key of a POST file when setting the POST file name +* Added xmlAllowEmpty to serialize an XML body even if no XML specific parameters are set + +## 3.3.0 - 2013-03-03 + +* A large number of performance optimizations have been made +* Bug fix: Added 'wb' as a valid write mode for streams +* Bug fix: `Guzzle\Http\Message\Response::json()` now allows scalar values to be returned +* Bug fix: Fixed bug in `Guzzle\Http\Message\Response` where wrapping quotes were stripped from `getEtag()` +* BC: Removed `Guzzle\Http\Utils` class +* BC: Setting a service description on a client will no longer modify the client's command factories. +* BC: Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using + the 'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' +* BC: `Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getSteamType()` are no longer converted to + lowercase +* Operation parameter objects are now lazy loaded internally +* Added ErrorResponsePlugin that can throw errors for responses defined in service description operations' errorResponses +* Added support for instantiating responseType=class responseClass classes. Classes must implement + `Guzzle\Service\Command\ResponseClassInterface` +* Added support for additionalProperties for top-level parameters in responseType=model responseClasses. These + additional properties also support locations and can be used to parse JSON responses where the outermost part of the + JSON is an array +* Added support for nested renaming of JSON models (rename sentAs to name) +* CachePlugin + * Added support for stale-if-error so that the CachePlugin can now serve stale content from the cache on error + * Debug headers can now added to cached response in the CachePlugin + +## 3.2.0 - 2013-02-14 + +* CurlMulti is no longer reused globally. A new multi object is created per-client. This helps to isolate clients. +* URLs with no path no longer contain a "/" by default +* Guzzle\Http\QueryString does no longer manages the leading "?". This is now handled in Guzzle\Http\Url. +* BadResponseException no longer includes the full request and response message +* Adding setData() to Guzzle\Service\Description\ServiceDescriptionInterface +* Adding getResponseBody() to Guzzle\Http\Message\RequestInterface +* Various updates to classes to use ServiceDescriptionInterface type hints rather than ServiceDescription +* Header values can now be normalized into distinct values when multiple headers are combined with a comma separated list +* xmlEncoding can now be customized for the XML declaration of a XML service description operation +* Guzzle\Http\QueryString now uses Guzzle\Http\QueryAggregator\QueryAggregatorInterface objects to add custom value + aggregation and no longer uses callbacks +* The URL encoding implementation of Guzzle\Http\QueryString can now be customized +* Bug fix: Filters were not always invoked for array service description parameters +* Bug fix: Redirects now use a target response body rather than a temporary response body +* Bug fix: The default exponential backoff BackoffPlugin was not giving when the request threshold was exceeded +* Bug fix: Guzzle now takes the first found value when grabbing Cache-Control directives + +## 3.1.2 - 2013-01-27 + +* Refactored how operation responses are parsed. Visitors now include a before() method responsible for parsing the + response body. For example, the XmlVisitor now parses the XML response into an array in the before() method. +* Fixed an issue where cURL would not automatically decompress responses when the Accept-Encoding header was sent +* CURLOPT_SSL_VERIFYHOST is never set to 1 because it is deprecated (see 5e0ff2ef20f839e19d1eeb298f90ba3598784444) +* Fixed a bug where redirect responses were not chained correctly using getPreviousResponse() +* Setting default headers on a client after setting the user-agent will not erase the user-agent setting + +## 3.1.1 - 2013-01-20 + +* Adding wildcard support to Guzzle\Common\Collection::getPath() +* Adding alias support to ServiceBuilder configs +* Adding Guzzle\Service\Resource\CompositeResourceIteratorFactory and cleaning up factory interface + +## 3.1.0 - 2013-01-12 + +* BC: CurlException now extends from RequestException rather than BadResponseException +* BC: Renamed Guzzle\Plugin\Cache\CanCacheStrategyInterface::canCache() to canCacheRequest() and added CanCacheResponse() +* Added getData to ServiceDescriptionInterface +* Added context array to RequestInterface::setState() +* Bug: Removing hard dependency on the BackoffPlugin from Guzzle\Http +* Bug: Adding required content-type when JSON request visitor adds JSON to a command +* Bug: Fixing the serialization of a service description with custom data +* Made it easier to deal with exceptions thrown when transferring commands or requests in parallel by providing + an array of successful and failed responses +* Moved getPath from Guzzle\Service\Resource\Model to Guzzle\Common\Collection +* Added Guzzle\Http\IoEmittingEntityBody +* Moved command filtration from validators to location visitors +* Added `extends` attributes to service description parameters +* Added getModels to ServiceDescriptionInterface + +## 3.0.7 - 2012-12-19 + +* Fixing phar detection when forcing a cacert to system if null or true +* Allowing filename to be passed to `Guzzle\Http\Message\Request::setResponseBody()` +* Cleaning up `Guzzle\Common\Collection::inject` method +* Adding a response_body location to service descriptions + +## 3.0.6 - 2012-12-09 + +* CurlMulti performance improvements +* Adding setErrorResponses() to Operation +* composer.json tweaks + +## 3.0.5 - 2012-11-18 + +* Bug: Fixing an infinite recursion bug caused from revalidating with the CachePlugin +* Bug: Response body can now be a string containing "0" +* Bug: Using Guzzle inside of a phar uses system by default but now allows for a custom cacert +* Bug: QueryString::fromString now properly parses query string parameters that contain equal signs +* Added support for XML attributes in service description responses +* DefaultRequestSerializer now supports array URI parameter values for URI template expansion +* Added better mimetype guessing to requests and post files + +## 3.0.4 - 2012-11-11 + +* Bug: Fixed a bug when adding multiple cookies to a request to use the correct glue value +* Bug: Cookies can now be added that have a name, domain, or value set to "0" +* Bug: Using the system cacert bundle when using the Phar +* Added json and xml methods to Response to make it easier to parse JSON and XML response data into data structures +* Enhanced cookie jar de-duplication +* Added the ability to enable strict cookie jars that throw exceptions when invalid cookies are added +* Added setStream to StreamInterface to actually make it possible to implement custom rewind behavior for entity bodies +* Added the ability to create any sort of hash for a stream rather than just an MD5 hash + +## 3.0.3 - 2012-11-04 + +* Implementing redirects in PHP rather than cURL +* Added PECL URI template extension and using as default parser if available +* Bug: Fixed Content-Length parsing of Response factory +* Adding rewind() method to entity bodies and streams. Allows for custom rewinding of non-repeatable streams. +* Adding ToArrayInterface throughout library +* Fixing OauthPlugin to create unique nonce values per request + +## 3.0.2 - 2012-10-25 + +* Magic methods are enabled by default on clients +* Magic methods return the result of a command +* Service clients no longer require a base_url option in the factory +* Bug: Fixed an issue with URI templates where null template variables were being expanded + +## 3.0.1 - 2012-10-22 + +* Models can now be used like regular collection objects by calling filter, map, etc. +* Models no longer require a Parameter structure or initial data in the constructor +* Added a custom AppendIterator to get around a PHP bug with the `\AppendIterator` + +## 3.0.0 - 2012-10-15 + +* Rewrote service description format to be based on Swagger + * Now based on JSON schema + * Added nested input structures and nested response models + * Support for JSON and XML input and output models + * Renamed `commands` to `operations` + * Removed dot class notation + * Removed custom types +* Broke the project into smaller top-level namespaces to be more component friendly +* Removed support for XML configs and descriptions. Use arrays or JSON files. +* Removed the Validation component and Inspector +* Moved all cookie code to Guzzle\Plugin\Cookie +* Magic methods on a Guzzle\Service\Client now return the command un-executed. +* Calling getResult() or getResponse() on a command will lazily execute the command if needed. +* Now shipping with cURL's CA certs and using it by default +* Added previousResponse() method to response objects +* No longer sending Accept and Accept-Encoding headers on every request +* Only sending an Expect header by default when a payload is greater than 1MB +* Added/moved client options: + * curl.blacklist to curl.option.blacklist + * Added ssl.certificate_authority +* Added a Guzzle\Iterator component +* Moved plugins from Guzzle\Http\Plugin to Guzzle\Plugin +* Added a more robust backoff retry strategy (replaced the ExponentialBackoffPlugin) +* Added a more robust caching plugin +* Added setBody to response objects +* Updating LogPlugin to use a more flexible MessageFormatter +* Added a completely revamped build process +* Cleaning up Collection class and removing default values from the get method +* Fixed ZF2 cache adapters + +## 2.8.8 - 2012-10-15 + +* Bug: Fixed a cookie issue that caused dot prefixed domains to not match where popular browsers did + +## 2.8.7 - 2012-09-30 + +* Bug: Fixed config file aliases for JSON includes +* Bug: Fixed cookie bug on a request object by using CookieParser to parse cookies on requests +* Bug: Removing the path to a file when sending a Content-Disposition header on a POST upload +* Bug: Hardening request and response parsing to account for missing parts +* Bug: Fixed PEAR packaging +* Bug: Fixed Request::getInfo +* Bug: Fixed cases where CURLM_CALL_MULTI_PERFORM return codes were causing curl transactions to fail +* Adding the ability for the namespace Iterator factory to look in multiple directories +* Added more getters/setters/removers from service descriptions +* Added the ability to remove POST fields from OAuth signatures +* OAuth plugin now supports 2-legged OAuth + +## 2.8.6 - 2012-09-05 + +* Added the ability to modify and build service descriptions +* Added the use of visitors to apply parameters to locations in service descriptions using the dynamic command +* Added a `json` parameter location +* Now allowing dot notation for classes in the CacheAdapterFactory +* Using the union of two arrays rather than an array_merge when extending service builder services and service params +* Ensuring that a service is a string before doing strpos() checks on it when substituting services for references + in service builder config files. +* Services defined in two different config files that include one another will by default replace the previously + defined service, but you can now create services that extend themselves and merge their settings over the previous +* The JsonLoader now supports aliasing filenames with different filenames. This allows you to alias something like + '_default' with a default JSON configuration file. + +## 2.8.5 - 2012-08-29 + +* Bug: Suppressed empty arrays from URI templates +* Bug: Added the missing $options argument from ServiceDescription::factory to enable caching +* Added support for HTTP responses that do not contain a reason phrase in the start-line +* AbstractCommand commands are now invokable +* Added a way to get the data used when signing an Oauth request before a request is sent + +## 2.8.4 - 2012-08-15 + +* Bug: Custom delay time calculations are no longer ignored in the ExponentialBackoffPlugin +* Added the ability to transfer entity bodies as a string rather than streamed. This gets around curl error 65. Set `body_as_string` in a request's curl options to enable. +* Added a StreamInterface, EntityBodyInterface, and added ftell() to Guzzle\Common\Stream +* Added an AbstractEntityBodyDecorator and a ReadLimitEntityBody decorator to transfer only a subset of a decorated stream +* Stream and EntityBody objects will now return the file position to the previous position after a read required operation (e.g. getContentMd5()) +* Added additional response status codes +* Removed SSL information from the default User-Agent header +* DELETE requests can now send an entity body +* Added an EventDispatcher to the ExponentialBackoffPlugin and added an ExponentialBackoffLogger to log backoff retries +* Added the ability of the MockPlugin to consume mocked request bodies +* LogPlugin now exposes request and response objects in the extras array + +## 2.8.3 - 2012-07-30 + +* Bug: Fixed a case where empty POST requests were sent as GET requests +* Bug: Fixed a bug in ExponentialBackoffPlugin that caused fatal errors when retrying an EntityEnclosingRequest that does not have a body +* Bug: Setting the response body of a request to null after completing a request, not when setting the state of a request to new +* Added multiple inheritance to service description commands +* Added an ApiCommandInterface and added `getParamNames()` and `hasParam()` +* Removed the default 2mb size cutoff from the Md5ValidatorPlugin so that it now defaults to validating everything +* Changed CurlMulti::perform to pass a smaller timeout to CurlMulti::executeHandles + +## 2.8.2 - 2012-07-24 + +* Bug: Query string values set to 0 are no longer dropped from the query string +* Bug: A Collection object is no longer created each time a call is made to `Guzzle\Service\Command\AbstractCommand::getRequestHeaders()` +* Bug: `+` is now treated as an encoded space when parsing query strings +* QueryString and Collection performance improvements +* Allowing dot notation for class paths in filters attribute of a service descriptions + +## 2.8.1 - 2012-07-16 + +* Loosening Event Dispatcher dependency +* POST redirects can now be customized using CURLOPT_POSTREDIR + +## 2.8.0 - 2012-07-15 + +* BC: Guzzle\Http\Query + * Query strings with empty variables will always show an equal sign unless the variable is set to QueryString::BLANK (e.g. ?acl= vs ?acl) + * Changed isEncodingValues() and isEncodingFields() to isUrlEncoding() + * Changed setEncodeValues(bool) and setEncodeFields(bool) to useUrlEncoding(bool) + * Changed the aggregation functions of QueryString to be static methods + * Can now use fromString() with querystrings that have a leading ? +* cURL configuration values can be specified in service descriptions using `curl.` prefixed parameters +* Content-Length is set to 0 before emitting the request.before_send event when sending an empty request body +* Cookies are no longer URL decoded by default +* Bug: URI template variables set to null are no longer expanded + +## 2.7.2 - 2012-07-02 + +* BC: Moving things to get ready for subtree splits. Moving Inflection into Common. Moving Guzzle\Http\Parser to Guzzle\Parser. +* BC: Removing Guzzle\Common\Batch\Batch::count() and replacing it with isEmpty() +* CachePlugin now allows for a custom request parameter function to check if a request can be cached +* Bug fix: CachePlugin now only caches GET and HEAD requests by default +* Bug fix: Using header glue when transferring headers over the wire +* Allowing deeply nested arrays for composite variables in URI templates +* Batch divisors can now return iterators or arrays + +## 2.7.1 - 2012-06-26 + +* Minor patch to update version number in UA string +* Updating build process + +## 2.7.0 - 2012-06-25 + +* BC: Inflection classes moved to Guzzle\Inflection. No longer static methods. Can now inject custom inflectors into classes. +* BC: Removed magic setX methods from commands +* BC: Magic methods mapped to service description commands are now inflected in the command factory rather than the client __call() method +* Verbose cURL options are no longer enabled by default. Set curl.debug to true on a client to enable. +* Bug: Now allowing colons in a response start-line (e.g. HTTP/1.1 503 Service Unavailable: Back-end server is at capacity) +* Guzzle\Service\Resource\ResourceIteratorApplyBatched now internally uses the Guzzle\Common\Batch namespace +* Added Guzzle\Service\Plugin namespace and a PluginCollectionPlugin +* Added the ability to set POST fields and files in a service description +* Guzzle\Http\EntityBody::factory() now accepts objects with a __toString() method +* Adding a command.before_prepare event to clients +* Added BatchClosureTransfer and BatchClosureDivisor +* BatchTransferException now includes references to the batch divisor and transfer strategies +* Fixed some tests so that they pass more reliably +* Added Guzzle\Common\Log\ArrayLogAdapter + +## 2.6.6 - 2012-06-10 + +* BC: Removing Guzzle\Http\Plugin\BatchQueuePlugin +* BC: Removing Guzzle\Service\Command\CommandSet +* Adding generic batching system (replaces the batch queue plugin and command set) +* Updating ZF cache and log adapters and now using ZF's composer repository +* Bug: Setting the name of each ApiParam when creating through an ApiCommand +* Adding result_type, result_doc, deprecated, and doc_url to service descriptions +* Bug: Changed the default cookie header casing back to 'Cookie' + +## 2.6.5 - 2012-06-03 + +* BC: Renaming Guzzle\Http\Message\RequestInterface::getResourceUri() to getResource() +* BC: Removing unused AUTH_BASIC and AUTH_DIGEST constants from +* BC: Guzzle\Http\Cookie is now used to manage Set-Cookie data, not Cookie data +* BC: Renaming methods in the CookieJarInterface +* Moving almost all cookie logic out of the CookiePlugin and into the Cookie or CookieJar implementations +* Making the default glue for HTTP headers ';' instead of ',' +* Adding a removeValue to Guzzle\Http\Message\Header +* Adding getCookies() to request interface. +* Making it easier to add event subscribers to HasDispatcherInterface classes. Can now directly call addSubscriber() + +## 2.6.4 - 2012-05-30 + +* BC: Cleaning up how POST files are stored in EntityEnclosingRequest objects. Adding PostFile class. +* BC: Moving ApiCommand specific functionality from the Inspector and on to the ApiCommand +* Bug: Fixing magic method command calls on clients +* Bug: Email constraint only validates strings +* Bug: Aggregate POST fields when POST files are present in curl handle +* Bug: Fixing default User-Agent header +* Bug: Only appending or prepending parameters in commands if they are specified +* Bug: Not requiring response reason phrases or status codes to match a predefined list of codes +* Allowing the use of dot notation for class namespaces when using instance_of constraint +* Added any_match validation constraint +* Added an AsyncPlugin +* Passing request object to the calculateWait method of the ExponentialBackoffPlugin +* Allowing the result of a command object to be changed +* Parsing location and type sub values when instantiating a service description rather than over and over at runtime + +## 2.6.3 - 2012-05-23 + +* [BC] Guzzle\Common\FromConfigInterface no longer requires any config options. +* [BC] Refactoring how POST files are stored on an EntityEnclosingRequest. They are now separate from POST fields. +* You can now use an array of data when creating PUT request bodies in the request factory. +* Removing the requirement that HTTPS requests needed a Cache-Control: public directive to be cacheable. +* [Http] Adding support for Content-Type in multipart POST uploads per upload +* [Http] Added support for uploading multiple files using the same name (foo[0], foo[1]) +* Adding more POST data operations for easier manipulation of POST data. +* You can now set empty POST fields. +* The body of a request is only shown on EntityEnclosingRequest objects that do not use POST files. +* Split the Guzzle\Service\Inspector::validateConfig method into two methods. One to initialize when a command is created, and one to validate. +* CS updates + +## 2.6.2 - 2012-05-19 + +* [Http] Better handling of nested scope requests in CurlMulti. Requests are now always prepares in the send() method rather than the addRequest() method. + +## 2.6.1 - 2012-05-19 + +* [BC] Removing 'path' support in service descriptions. Use 'uri'. +* [BC] Guzzle\Service\Inspector::parseDocBlock is now protected. Adding getApiParamsForClass() with cache. +* [BC] Removing Guzzle\Common\NullObject. Use https://github.com/mtdowling/NullObject if you need it. +* [BC] Removing Guzzle\Common\XmlElement. +* All commands, both dynamic and concrete, have ApiCommand objects. +* Adding a fix for CurlMulti so that if all of the connections encounter some sort of curl error, then the loop exits. +* Adding checks to EntityEnclosingRequest so that empty POST files and fields are ignored. +* Making the method signature of Guzzle\Service\Builder\ServiceBuilder::factory more flexible. + +## 2.6.0 - 2012-05-15 + +* [BC] Moving Guzzle\Service\Builder to Guzzle\Service\Builder\ServiceBuilder +* [BC] Executing a Command returns the result of the command rather than the command +* [BC] Moving all HTTP parsing logic to Guzzle\Http\Parsers. Allows for faster C implementations if needed. +* [BC] Changing the Guzzle\Http\Message\Response::setProtocol() method to accept a protocol and version in separate args. +* [BC] Moving ResourceIterator* to Guzzle\Service\Resource +* [BC] Completely refactored ResourceIterators to iterate over a cloned command object +* [BC] Moved Guzzle\Http\UriTemplate to Guzzle\Http\Parser\UriTemplate\UriTemplate +* [BC] Guzzle\Guzzle is now deprecated +* Moving Guzzle\Common\Guzzle::inject to Guzzle\Common\Collection::inject +* Adding Guzzle\Version class to give version information about Guzzle +* Adding Guzzle\Http\Utils class to provide getDefaultUserAgent() and getHttpDate() +* Adding Guzzle\Curl\CurlVersion to manage caching curl_version() data +* ServiceDescription and ServiceBuilder are now cacheable using similar configs +* Changing the format of XML and JSON service builder configs. Backwards compatible. +* Cleaned up Cookie parsing +* Trimming the default Guzzle User-Agent header +* Adding a setOnComplete() method to Commands that is called when a command completes +* Keeping track of requests that were mocked in the MockPlugin +* Fixed a caching bug in the CacheAdapterFactory +* Inspector objects can be injected into a Command object +* Refactoring a lot of code and tests to be case insensitive when dealing with headers +* Adding Guzzle\Http\Message\HeaderComparison for easy comparison of HTTP headers using a DSL +* Adding the ability to set global option overrides to service builder configs +* Adding the ability to include other service builder config files from within XML and JSON files +* Moving the parseQuery method out of Url and on to QueryString::fromString() as a static factory method. + +## 2.5.0 - 2012-05-08 + +* Major performance improvements +* [BC] Simplifying Guzzle\Common\Collection. Please check to see if you are using features that are now deprecated. +* [BC] Using a custom validation system that allows a flyweight implementation for much faster validation. No longer using Symfony2 Validation component. +* [BC] No longer supporting "{{ }}" for injecting into command or UriTemplates. Use "{}" +* Added the ability to passed parameters to all requests created by a client +* Added callback functionality to the ExponentialBackoffPlugin +* Using microtime in ExponentialBackoffPlugin to allow more granular backoff strategies. +* Rewinding request stream bodies when retrying requests +* Exception is thrown when JSON response body cannot be decoded +* Added configurable magic method calls to clients and commands. This is off by default. +* Fixed a defect that added a hash to every parsed URL part +* Fixed duplicate none generation for OauthPlugin. +* Emitting an event each time a client is generated by a ServiceBuilder +* Using an ApiParams object instead of a Collection for parameters of an ApiCommand +* cache.* request parameters should be renamed to params.cache.* +* Added the ability to set arbitrary curl options on requests (disable_wire, progress, etc.). See CurlHandle. +* Added the ability to disable type validation of service descriptions +* ServiceDescriptions and ServiceBuilders are now Serializable diff --git a/vendor/guzzlehttp/guzzle/Dockerfile b/vendor/guzzlehttp/guzzle/Dockerfile new file mode 100644 index 0000000..f6a0952 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/Dockerfile @@ -0,0 +1,18 @@ +FROM composer:latest as setup + +RUN mkdir /guzzle + +WORKDIR /guzzle + +RUN set -xe \ + && composer init --name=guzzlehttp/test --description="Simple project for testing Guzzle scripts" --author="Márk Sági-Kazár " --no-interaction \ + && composer require guzzlehttp/guzzle + + +FROM php:7.3 + +RUN mkdir /guzzle + +WORKDIR /guzzle + +COPY --from=setup /guzzle /guzzle diff --git a/vendor/guzzlehttp/guzzle/LICENSE b/vendor/guzzlehttp/guzzle/LICENSE new file mode 100644 index 0000000..50a177b --- /dev/null +++ b/vendor/guzzlehttp/guzzle/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011-2018 Michael Dowling, https://github.com/mtdowling + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/guzzlehttp/guzzle/README.md b/vendor/guzzlehttp/guzzle/README.md new file mode 100644 index 0000000..5fdb6c5 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/README.md @@ -0,0 +1,90 @@ +Guzzle, PHP HTTP client +======================= + +[![Latest Version](https://img.shields.io/github/release/guzzle/guzzle.svg?style=flat-square)](https://github.com/guzzle/guzzle/releases) +[![Build Status](https://img.shields.io/travis/guzzle/guzzle.svg?style=flat-square)](https://travis-ci.org/guzzle/guzzle) +[![Total Downloads](https://img.shields.io/packagist/dt/guzzlehttp/guzzle.svg?style=flat-square)](https://packagist.org/packages/guzzlehttp/guzzle) + +Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and +trivial to integrate with web services. + +- Simple interface for building query strings, POST requests, streaming large + uploads, streaming large downloads, using HTTP cookies, uploading JSON data, + etc... +- Can send both synchronous and asynchronous requests using the same interface. +- Uses PSR-7 interfaces for requests, responses, and streams. This allows you + to utilize other PSR-7 compatible libraries with Guzzle. +- Abstracts away the underlying HTTP transport, allowing you to write + environment and transport agnostic code; i.e., no hard dependency on cURL, + PHP streams, sockets, or non-blocking event loops. +- Middleware system allows you to augment and compose client behavior. + +```php +$client = new \GuzzleHttp\Client(); +$response = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle'); + +echo $response->getStatusCode(); # 200 +echo $response->getHeaderLine('content-type'); # 'application/json; charset=utf8' +echo $response->getBody(); # '{"id": 1420053, "name": "guzzle", ...}' + +# Send an asynchronous request. +$request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org'); +$promise = $client->sendAsync($request)->then(function ($response) { + echo 'I completed! ' . $response->getBody(); +}); + +$promise->wait(); +``` + +## Help and docs + +- [Documentation](http://guzzlephp.org/) +- [Stack Overflow](http://stackoverflow.com/questions/tagged/guzzle) +- [Gitter](https://gitter.im/guzzle/guzzle) + + +## Installing Guzzle + +The recommended way to install Guzzle is through +[Composer](http://getcomposer.org). + +```bash +# Install Composer +curl -sS https://getcomposer.org/installer | php +``` + +Next, run the Composer command to install the latest stable version of Guzzle: + +```bash +composer require guzzlehttp/guzzle +``` + +After installing, you need to require Composer's autoloader: + +```php +require 'vendor/autoload.php'; +``` + +You can then later update Guzzle using composer: + + ```bash +composer update + ``` + + +## Version Guidance + +| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version | +|---------|------------|---------------------|--------------|---------------------|---------------------|-------|-------------| +| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >= 5.3.3 | +| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >= 5.4 | +| 5.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >= 5.4 | +| 6.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >= 5.5 | + +[guzzle-3-repo]: https://github.com/guzzle/guzzle3 +[guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x +[guzzle-5-repo]: https://github.com/guzzle/guzzle/tree/5.3 +[guzzle-6-repo]: https://github.com/guzzle/guzzle +[guzzle-3-docs]: http://guzzle3.readthedocs.org +[guzzle-5-docs]: http://guzzle.readthedocs.org/en/5.3/ +[guzzle-6-docs]: http://guzzle.readthedocs.org/en/latest/ diff --git a/vendor/guzzlehttp/guzzle/UPGRADING.md b/vendor/guzzlehttp/guzzle/UPGRADING.md new file mode 100644 index 0000000..91d1dcc --- /dev/null +++ b/vendor/guzzlehttp/guzzle/UPGRADING.md @@ -0,0 +1,1203 @@ +Guzzle Upgrade Guide +==================== + +5.0 to 6.0 +---------- + +Guzzle now uses [PSR-7](http://www.php-fig.org/psr/psr-7/) for HTTP messages. +Due to the fact that these messages are immutable, this prompted a refactoring +of Guzzle to use a middleware based system rather than an event system. Any +HTTP message interaction (e.g., `GuzzleHttp\Message\Request`) need to be +updated to work with the new immutable PSR-7 request and response objects. Any +event listeners or subscribers need to be updated to become middleware +functions that wrap handlers (or are injected into a +`GuzzleHttp\HandlerStack`). + +- Removed `GuzzleHttp\BatchResults` +- Removed `GuzzleHttp\Collection` +- Removed `GuzzleHttp\HasDataTrait` +- Removed `GuzzleHttp\ToArrayInterface` +- The `guzzlehttp/streams` dependency has been removed. Stream functionality + is now present in the `GuzzleHttp\Psr7` namespace provided by the + `guzzlehttp/psr7` package. +- Guzzle no longer uses ReactPHP promises and now uses the + `guzzlehttp/promises` library. We use a custom promise library for three + significant reasons: + 1. React promises (at the time of writing this) are recursive. Promise + chaining and promise resolution will eventually blow the stack. Guzzle + promises are not recursive as they use a sort of trampolining technique. + Note: there has been movement in the React project to modify promises to + no longer utilize recursion. + 2. Guzzle needs to have the ability to synchronously block on a promise to + wait for a result. Guzzle promises allows this functionality (and does + not require the use of recursion). + 3. Because we need to be able to wait on a result, doing so using React + promises requires wrapping react promises with RingPHP futures. This + overhead is no longer needed, reducing stack sizes, reducing complexity, + and improving performance. +- `GuzzleHttp\Mimetypes` has been moved to a function in + `GuzzleHttp\Psr7\mimetype_from_extension` and + `GuzzleHttp\Psr7\mimetype_from_filename`. +- `GuzzleHttp\Query` and `GuzzleHttp\QueryParser` have been removed. Query + strings must now be passed into request objects as strings, or provided to + the `query` request option when creating requests with clients. The `query` + option uses PHP's `http_build_query` to convert an array to a string. If you + need a different serialization technique, you will need to pass the query + string in as a string. There are a couple helper functions that will make + working with query strings easier: `GuzzleHttp\Psr7\parse_query` and + `GuzzleHttp\Psr7\build_query`. +- Guzzle no longer has a dependency on RingPHP. Due to the use of a middleware + system based on PSR-7, using RingPHP and it's middleware system as well adds + more complexity than the benefits it provides. All HTTP handlers that were + present in RingPHP have been modified to work directly with PSR-7 messages + and placed in the `GuzzleHttp\Handler` namespace. This significantly reduces + complexity in Guzzle, removes a dependency, and improves performance. RingPHP + will be maintained for Guzzle 5 support, but will no longer be a part of + Guzzle 6. +- As Guzzle now uses a middleware based systems the event system and RingPHP + integration has been removed. Note: while the event system has been removed, + it is possible to add your own type of event system that is powered by the + middleware system. + - Removed the `Event` namespace. + - Removed the `Subscriber` namespace. + - Removed `Transaction` class + - Removed `RequestFsm` + - Removed `RingBridge` + - `GuzzleHttp\Subscriber\Cookie` is now provided by + `GuzzleHttp\Middleware::cookies` + - `GuzzleHttp\Subscriber\HttpError` is now provided by + `GuzzleHttp\Middleware::httpError` + - `GuzzleHttp\Subscriber\History` is now provided by + `GuzzleHttp\Middleware::history` + - `GuzzleHttp\Subscriber\Mock` is now provided by + `GuzzleHttp\Handler\MockHandler` + - `GuzzleHttp\Subscriber\Prepare` is now provided by + `GuzzleHttp\PrepareBodyMiddleware` + - `GuzzleHttp\Subscriber\Redirect` is now provided by + `GuzzleHttp\RedirectMiddleware` +- Guzzle now uses `Psr\Http\Message\UriInterface` (implements in + `GuzzleHttp\Psr7\Uri`) for URI support. `GuzzleHttp\Url` is now gone. +- Static functions in `GuzzleHttp\Utils` have been moved to namespaced + functions under the `GuzzleHttp` namespace. This requires either a Composer + based autoloader or you to include functions.php. +- `GuzzleHttp\ClientInterface::getDefaultOption` has been renamed to + `GuzzleHttp\ClientInterface::getConfig`. +- `GuzzleHttp\ClientInterface::setDefaultOption` has been removed. +- The `json` and `xml` methods of response objects has been removed. With the + migration to strictly adhering to PSR-7 as the interface for Guzzle messages, + adding methods to message interfaces would actually require Guzzle messages + to extend from PSR-7 messages rather then work with them directly. + +## Migrating to middleware + +The change to PSR-7 unfortunately required significant refactoring to Guzzle +due to the fact that PSR-7 messages are immutable. Guzzle 5 relied on an event +system from plugins. The event system relied on mutability of HTTP messages and +side effects in order to work. With immutable messages, you have to change your +workflow to become more about either returning a value (e.g., functional +middlewares) or setting a value on an object. Guzzle v6 has chosen the +functional middleware approach. + +Instead of using the event system to listen for things like the `before` event, +you now create a stack based middleware function that intercepts a request on +the way in and the promise of the response on the way out. This is a much +simpler and more predictable approach than the event system and works nicely +with PSR-7 middleware. Due to the use of promises, the middleware system is +also asynchronous. + +v5: + +```php +use GuzzleHttp\Event\BeforeEvent; +$client = new GuzzleHttp\Client(); +// Get the emitter and listen to the before event. +$client->getEmitter()->on('before', function (BeforeEvent $e) { + // Guzzle v5 events relied on mutation + $e->getRequest()->setHeader('X-Foo', 'Bar'); +}); +``` + +v6: + +In v6, you can modify the request before it is sent using the `mapRequest` +middleware. The idiomatic way in v6 to modify the request/response lifecycle is +to setup a handler middleware stack up front and inject the handler into a +client. + +```php +use GuzzleHttp\Middleware; +// Create a handler stack that has all of the default middlewares attached +$handler = GuzzleHttp\HandlerStack::create(); +// Push the handler onto the handler stack +$handler->push(Middleware::mapRequest(function (RequestInterface $request) { + // Notice that we have to return a request object + return $request->withHeader('X-Foo', 'Bar'); +})); +// Inject the handler into the client +$client = new GuzzleHttp\Client(['handler' => $handler]); +``` + +## POST Requests + +This version added the [`form_params`](http://guzzle.readthedocs.org/en/latest/request-options.html#form_params) +and `multipart` request options. `form_params` is an associative array of +strings or array of strings and is used to serialize an +`application/x-www-form-urlencoded` POST request. The +[`multipart`](http://guzzle.readthedocs.org/en/latest/request-options.html#multipart) +option is now used to send a multipart/form-data POST request. + +`GuzzleHttp\Post\PostFile` has been removed. Use the `multipart` option to add +POST files to a multipart/form-data request. + +The `body` option no longer accepts an array to send POST requests. Please use +`multipart` or `form_params` instead. + +The `base_url` option has been renamed to `base_uri`. + +4.x to 5.0 +---------- + +## Rewritten Adapter Layer + +Guzzle now uses [RingPHP](http://ringphp.readthedocs.org/en/latest) to send +HTTP requests. The `adapter` option in a `GuzzleHttp\Client` constructor +is still supported, but it has now been renamed to `handler`. Instead of +passing a `GuzzleHttp\Adapter\AdapterInterface`, you must now pass a PHP +`callable` that follows the RingPHP specification. + +## Removed Fluent Interfaces + +[Fluent interfaces were removed](http://ocramius.github.io/blog/fluent-interfaces-are-evil) +from the following classes: + +- `GuzzleHttp\Collection` +- `GuzzleHttp\Url` +- `GuzzleHttp\Query` +- `GuzzleHttp\Post\PostBody` +- `GuzzleHttp\Cookie\SetCookie` + +## Removed functions.php + +Removed "functions.php", so that Guzzle is truly PSR-4 compliant. The following +functions can be used as replacements. + +- `GuzzleHttp\json_decode` -> `GuzzleHttp\Utils::jsonDecode` +- `GuzzleHttp\get_path` -> `GuzzleHttp\Utils::getPath` +- `GuzzleHttp\Utils::setPath` -> `GuzzleHttp\set_path` +- `GuzzleHttp\Pool::batch` -> `GuzzleHttp\batch`. This function is, however, + deprecated in favor of using `GuzzleHttp\Pool::batch()`. + +The "procedural" global client has been removed with no replacement (e.g., +`GuzzleHttp\get()`, `GuzzleHttp\post()`, etc.). Use a `GuzzleHttp\Client` +object as a replacement. + +## `throwImmediately` has been removed + +The concept of "throwImmediately" has been removed from exceptions and error +events. This control mechanism was used to stop a transfer of concurrent +requests from completing. This can now be handled by throwing the exception or +by cancelling a pool of requests or each outstanding future request +individually. + +## headers event has been removed + +Removed the "headers" event. This event was only useful for changing the +body a response once the headers of the response were known. You can implement +a similar behavior in a number of ways. One example might be to use a +FnStream that has access to the transaction being sent. For example, when the +first byte is written, you could check if the response headers match your +expectations, and if so, change the actual stream body that is being +written to. + +## Updates to HTTP Messages + +Removed the `asArray` parameter from +`GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header +value as an array, then use the newly added `getHeaderAsArray()` method of +`MessageInterface`. This change makes the Guzzle interfaces compatible with +the PSR-7 interfaces. + +3.x to 4.0 +---------- + +## Overarching changes: + +- Now requires PHP 5.4 or greater. +- No longer requires cURL to send requests. +- Guzzle no longer wraps every exception it throws. Only exceptions that are + recoverable are now wrapped by Guzzle. +- Various namespaces have been removed or renamed. +- No longer requiring the Symfony EventDispatcher. A custom event dispatcher + based on the Symfony EventDispatcher is + now utilized in `GuzzleHttp\Event\EmitterInterface` (resulting in significant + speed and functionality improvements). + +Changes per Guzzle 3.x namespace are described below. + +## Batch + +The `Guzzle\Batch` namespace has been removed. This is best left to +third-parties to implement on top of Guzzle's core HTTP library. + +## Cache + +The `Guzzle\Cache` namespace has been removed. (Todo: No suitable replacement +has been implemented yet, but hoping to utilize a PSR cache interface). + +## Common + +- Removed all of the wrapped exceptions. It's better to use the standard PHP + library for unrecoverable exceptions. +- `FromConfigInterface` has been removed. +- `Guzzle\Common\Version` has been removed. The VERSION constant can be found + at `GuzzleHttp\ClientInterface::VERSION`. + +### Collection + +- `getAll` has been removed. Use `toArray` to convert a collection to an array. +- `inject` has been removed. +- `keySearch` has been removed. +- `getPath` no longer supports wildcard expressions. Use something better like + JMESPath for this. +- `setPath` now supports appending to an existing array via the `[]` notation. + +### Events + +Guzzle no longer requires Symfony's EventDispatcher component. Guzzle now uses +`GuzzleHttp\Event\Emitter`. + +- `Symfony\Component\EventDispatcher\EventDispatcherInterface` is replaced by + `GuzzleHttp\Event\EmitterInterface`. +- `Symfony\Component\EventDispatcher\EventDispatcher` is replaced by + `GuzzleHttp\Event\Emitter`. +- `Symfony\Component\EventDispatcher\Event` is replaced by + `GuzzleHttp\Event\Event`, and Guzzle now has an EventInterface in + `GuzzleHttp\Event\EventInterface`. +- `AbstractHasDispatcher` has moved to a trait, `HasEmitterTrait`, and + `HasDispatcherInterface` has moved to `HasEmitterInterface`. Retrieving the + event emitter of a request, client, etc. now uses the `getEmitter` method + rather than the `getDispatcher` method. + +#### Emitter + +- Use the `once()` method to add a listener that automatically removes itself + the first time it is invoked. +- Use the `listeners()` method to retrieve a list of event listeners rather than + the `getListeners()` method. +- Use `emit()` instead of `dispatch()` to emit an event from an emitter. +- Use `attach()` instead of `addSubscriber()` and `detach()` instead of + `removeSubscriber()`. + +```php +$mock = new Mock(); +// 3.x +$request->getEventDispatcher()->addSubscriber($mock); +$request->getEventDispatcher()->removeSubscriber($mock); +// 4.x +$request->getEmitter()->attach($mock); +$request->getEmitter()->detach($mock); +``` + +Use the `on()` method to add a listener rather than the `addListener()` method. + +```php +// 3.x +$request->getEventDispatcher()->addListener('foo', function (Event $event) { /* ... */ } ); +// 4.x +$request->getEmitter()->on('foo', function (Event $event, $name) { /* ... */ } ); +``` + +## Http + +### General changes + +- The cacert.pem certificate has been moved to `src/cacert.pem`. +- Added the concept of adapters that are used to transfer requests over the + wire. +- Simplified the event system. +- Sending requests in parallel is still possible, but batching is no longer a + concept of the HTTP layer. Instead, you must use the `complete` and `error` + events to asynchronously manage parallel request transfers. +- `Guzzle\Http\Url` has moved to `GuzzleHttp\Url`. +- `Guzzle\Http\QueryString` has moved to `GuzzleHttp\Query`. +- QueryAggregators have been rewritten so that they are simply callable + functions. +- `GuzzleHttp\StaticClient` has been removed. Use the functions provided in + `functions.php` for an easy to use static client instance. +- Exceptions in `GuzzleHttp\Exception` have been updated to all extend from + `GuzzleHttp\Exception\TransferException`. + +### Client + +Calling methods like `get()`, `post()`, `head()`, etc. no longer create and +return a request, but rather creates a request, sends the request, and returns +the response. + +```php +// 3.0 +$request = $client->get('/'); +$response = $request->send(); + +// 4.0 +$response = $client->get('/'); + +// or, to mirror the previous behavior +$request = $client->createRequest('GET', '/'); +$response = $client->send($request); +``` + +`GuzzleHttp\ClientInterface` has changed. + +- The `send` method no longer accepts more than one request. Use `sendAll` to + send multiple requests in parallel. +- `setUserAgent()` has been removed. Use a default request option instead. You + could, for example, do something like: + `$client->setConfig('defaults/headers/User-Agent', 'Foo/Bar ' . $client::getDefaultUserAgent())`. +- `setSslVerification()` has been removed. Use default request options instead, + like `$client->setConfig('defaults/verify', true)`. + +`GuzzleHttp\Client` has changed. + +- The constructor now accepts only an associative array. You can include a + `base_url` string or array to use a URI template as the base URL of a client. + You can also specify a `defaults` key that is an associative array of default + request options. You can pass an `adapter` to use a custom adapter, + `batch_adapter` to use a custom adapter for sending requests in parallel, or + a `message_factory` to change the factory used to create HTTP requests and + responses. +- The client no longer emits a `client.create_request` event. +- Creating requests with a client no longer automatically utilize a URI + template. You must pass an array into a creational method (e.g., + `createRequest`, `get`, `put`, etc.) in order to expand a URI template. + +### Messages + +Messages no longer have references to their counterparts (i.e., a request no +longer has a reference to it's response, and a response no loger has a +reference to its request). This association is now managed through a +`GuzzleHttp\Adapter\TransactionInterface` object. You can get references to +these transaction objects using request events that are emitted over the +lifecycle of a request. + +#### Requests with a body + +- `GuzzleHttp\Message\EntityEnclosingRequest` and + `GuzzleHttp\Message\EntityEnclosingRequestInterface` have been removed. The + separation between requests that contain a body and requests that do not + contain a body has been removed, and now `GuzzleHttp\Message\RequestInterface` + handles both use cases. +- Any method that previously accepts a `GuzzleHttp\Response` object now accept a + `GuzzleHttp\Message\ResponseInterface`. +- `GuzzleHttp\Message\RequestFactoryInterface` has been renamed to + `GuzzleHttp\Message\MessageFactoryInterface`. This interface is used to create + both requests and responses and is implemented in + `GuzzleHttp\Message\MessageFactory`. +- POST field and file methods have been removed from the request object. You + must now use the methods made available to `GuzzleHttp\Post\PostBodyInterface` + to control the format of a POST body. Requests that are created using a + standard `GuzzleHttp\Message\MessageFactoryInterface` will automatically use + a `GuzzleHttp\Post\PostBody` body if the body was passed as an array or if + the method is POST and no body is provided. + +```php +$request = $client->createRequest('POST', '/'); +$request->getBody()->setField('foo', 'bar'); +$request->getBody()->addFile(new PostFile('file_key', fopen('/path/to/content', 'r'))); +``` + +#### Headers + +- `GuzzleHttp\Message\Header` has been removed. Header values are now simply + represented by an array of values or as a string. Header values are returned + as a string by default when retrieving a header value from a message. You can + pass an optional argument of `true` to retrieve a header value as an array + of strings instead of a single concatenated string. +- `GuzzleHttp\PostFile` and `GuzzleHttp\PostFileInterface` have been moved to + `GuzzleHttp\Post`. This interface has been simplified and now allows the + addition of arbitrary headers. +- Custom headers like `GuzzleHttp\Message\Header\Link` have been removed. Most + of the custom headers are now handled separately in specific + subscribers/plugins, and `GuzzleHttp\Message\HeaderValues::parseParams()` has + been updated to properly handle headers that contain parameters (like the + `Link` header). + +#### Responses + +- `GuzzleHttp\Message\Response::getInfo()` and + `GuzzleHttp\Message\Response::setInfo()` have been removed. Use the event + system to retrieve this type of information. +- `GuzzleHttp\Message\Response::getRawHeaders()` has been removed. +- `GuzzleHttp\Message\Response::getMessage()` has been removed. +- `GuzzleHttp\Message\Response::calculateAge()` and other cache specific + methods have moved to the CacheSubscriber. +- Header specific helper functions like `getContentMd5()` have been removed. + Just use `getHeader('Content-MD5')` instead. +- `GuzzleHttp\Message\Response::setRequest()` and + `GuzzleHttp\Message\Response::getRequest()` have been removed. Use the event + system to work with request and response objects as a transaction. +- `GuzzleHttp\Message\Response::getRedirectCount()` has been removed. Use the + Redirect subscriber instead. +- `GuzzleHttp\Message\Response::isSuccessful()` and other related methods have + been removed. Use `getStatusCode()` instead. + +#### Streaming responses + +Streaming requests can now be created by a client directly, returning a +`GuzzleHttp\Message\ResponseInterface` object that contains a body stream +referencing an open PHP HTTP stream. + +```php +// 3.0 +use Guzzle\Stream\PhpStreamRequestFactory; +$request = $client->get('/'); +$factory = new PhpStreamRequestFactory(); +$stream = $factory->fromRequest($request); +$data = $stream->read(1024); + +// 4.0 +$response = $client->get('/', ['stream' => true]); +// Read some data off of the stream in the response body +$data = $response->getBody()->read(1024); +``` + +#### Redirects + +The `configureRedirects()` method has been removed in favor of a +`allow_redirects` request option. + +```php +// Standard redirects with a default of a max of 5 redirects +$request = $client->createRequest('GET', '/', ['allow_redirects' => true]); + +// Strict redirects with a custom number of redirects +$request = $client->createRequest('GET', '/', [ + 'allow_redirects' => ['max' => 5, 'strict' => true] +]); +``` + +#### EntityBody + +EntityBody interfaces and classes have been removed or moved to +`GuzzleHttp\Stream`. All classes and interfaces that once required +`GuzzleHttp\EntityBodyInterface` now require +`GuzzleHttp\Stream\StreamInterface`. Creating a new body for a request no +longer uses `GuzzleHttp\EntityBody::factory` but now uses +`GuzzleHttp\Stream\Stream::factory` or even better: +`GuzzleHttp\Stream\create()`. + +- `Guzzle\Http\EntityBodyInterface` is now `GuzzleHttp\Stream\StreamInterface` +- `Guzzle\Http\EntityBody` is now `GuzzleHttp\Stream\Stream` +- `Guzzle\Http\CachingEntityBody` is now `GuzzleHttp\Stream\CachingStream` +- `Guzzle\Http\ReadLimitEntityBody` is now `GuzzleHttp\Stream\LimitStream` +- `Guzzle\Http\IoEmittyinEntityBody` has been removed. + +#### Request lifecycle events + +Requests previously submitted a large number of requests. The number of events +emitted over the lifecycle of a request has been significantly reduced to make +it easier to understand how to extend the behavior of a request. All events +emitted during the lifecycle of a request now emit a custom +`GuzzleHttp\Event\EventInterface` object that contains context providing +methods and a way in which to modify the transaction at that specific point in +time (e.g., intercept the request and set a response on the transaction). + +- `request.before_send` has been renamed to `before` and now emits a + `GuzzleHttp\Event\BeforeEvent` +- `request.complete` has been renamed to `complete` and now emits a + `GuzzleHttp\Event\CompleteEvent`. +- `request.sent` has been removed. Use `complete`. +- `request.success` has been removed. Use `complete`. +- `error` is now an event that emits a `GuzzleHttp\Event\ErrorEvent`. +- `request.exception` has been removed. Use `error`. +- `request.receive.status_line` has been removed. +- `curl.callback.progress` has been removed. Use a custom `StreamInterface` to + maintain a status update. +- `curl.callback.write` has been removed. Use a custom `StreamInterface` to + intercept writes. +- `curl.callback.read` has been removed. Use a custom `StreamInterface` to + intercept reads. + +`headers` is a new event that is emitted after the response headers of a +request have been received before the body of the response is downloaded. This +event emits a `GuzzleHttp\Event\HeadersEvent`. + +You can intercept a request and inject a response using the `intercept()` event +of a `GuzzleHttp\Event\BeforeEvent`, `GuzzleHttp\Event\CompleteEvent`, and +`GuzzleHttp\Event\ErrorEvent` event. + +See: http://docs.guzzlephp.org/en/latest/events.html + +## Inflection + +The `Guzzle\Inflection` namespace has been removed. This is not a core concern +of Guzzle. + +## Iterator + +The `Guzzle\Iterator` namespace has been removed. + +- `Guzzle\Iterator\AppendIterator`, `Guzzle\Iterator\ChunkedIterator`, and + `Guzzle\Iterator\MethodProxyIterator` are nice, but not a core requirement of + Guzzle itself. +- `Guzzle\Iterator\FilterIterator` is no longer needed because an equivalent + class is shipped with PHP 5.4. +- `Guzzle\Iterator\MapIterator` is not really needed when using PHP 5.5 because + it's easier to just wrap an iterator in a generator that maps values. + +For a replacement of these iterators, see https://github.com/nikic/iter + +## Log + +The LogPlugin has moved to https://github.com/guzzle/log-subscriber. The +`Guzzle\Log` namespace has been removed. Guzzle now relies on +`Psr\Log\LoggerInterface` for all logging. The MessageFormatter class has been +moved to `GuzzleHttp\Subscriber\Log\Formatter`. + +## Parser + +The `Guzzle\Parser` namespace has been removed. This was previously used to +make it possible to plug in custom parsers for cookies, messages, URI +templates, and URLs; however, this level of complexity is not needed in Guzzle +so it has been removed. + +- Cookie: Cookie parsing logic has been moved to + `GuzzleHttp\Cookie\SetCookie::fromString`. +- Message: Message parsing logic for both requests and responses has been moved + to `GuzzleHttp\Message\MessageFactory::fromMessage`. Message parsing is only + used in debugging or deserializing messages, so it doesn't make sense for + Guzzle as a library to add this level of complexity to parsing messages. +- UriTemplate: URI template parsing has been moved to + `GuzzleHttp\UriTemplate`. The Guzzle library will automatically use the PECL + URI template library if it is installed. +- Url: URL parsing is now performed in `GuzzleHttp\Url::fromString` (previously + it was `Guzzle\Http\Url::factory()`). If custom URL parsing is necessary, + then developers are free to subclass `GuzzleHttp\Url`. + +## Plugin + +The `Guzzle\Plugin` namespace has been renamed to `GuzzleHttp\Subscriber`. +Several plugins are shipping with the core Guzzle library under this namespace. + +- `GuzzleHttp\Subscriber\Cookie`: Replaces the old CookiePlugin. Cookie jar + code has moved to `GuzzleHttp\Cookie`. +- `GuzzleHttp\Subscriber\History`: Replaces the old HistoryPlugin. +- `GuzzleHttp\Subscriber\HttpError`: Throws errors when a bad HTTP response is + received. +- `GuzzleHttp\Subscriber\Mock`: Replaces the old MockPlugin. +- `GuzzleHttp\Subscriber\Prepare`: Prepares the body of a request just before + sending. This subscriber is attached to all requests by default. +- `GuzzleHttp\Subscriber\Redirect`: Replaces the RedirectPlugin. + +The following plugins have been removed (third-parties are free to re-implement +these if needed): + +- `GuzzleHttp\Plugin\Async` has been removed. +- `GuzzleHttp\Plugin\CurlAuth` has been removed. +- `GuzzleHttp\Plugin\ErrorResponse\ErrorResponsePlugin` has been removed. This + functionality should instead be implemented with event listeners that occur + after normal response parsing occurs in the guzzle/command package. + +The following plugins are not part of the core Guzzle package, but are provided +in separate repositories: + +- `Guzzle\Http\Plugin\BackoffPlugin` has been rewritten to be much simpler + to build custom retry policies using simple functions rather than various + chained classes. See: https://github.com/guzzle/retry-subscriber +- `Guzzle\Http\Plugin\Cache\CachePlugin` has moved to + https://github.com/guzzle/cache-subscriber +- `Guzzle\Http\Plugin\Log\LogPlugin` has moved to + https://github.com/guzzle/log-subscriber +- `Guzzle\Http\Plugin\Md5\Md5Plugin` has moved to + https://github.com/guzzle/message-integrity-subscriber +- `Guzzle\Http\Plugin\Mock\MockPlugin` has moved to + `GuzzleHttp\Subscriber\MockSubscriber`. +- `Guzzle\Http\Plugin\Oauth\OauthPlugin` has moved to + https://github.com/guzzle/oauth-subscriber + +## Service + +The service description layer of Guzzle has moved into two separate packages: + +- http://github.com/guzzle/command Provides a high level abstraction over web + services by representing web service operations using commands. +- http://github.com/guzzle/guzzle-services Provides an implementation of + guzzle/command that provides request serialization and response parsing using + Guzzle service descriptions. + +## Stream + +Stream have moved to a separate package available at +https://github.com/guzzle/streams. + +`Guzzle\Stream\StreamInterface` has been given a large update to cleanly take +on the responsibilities of `Guzzle\Http\EntityBody` and +`Guzzle\Http\EntityBodyInterface` now that they have been removed. The number +of methods implemented by the `StreamInterface` has been drastically reduced to +allow developers to more easily extend and decorate stream behavior. + +## Removed methods from StreamInterface + +- `getStream` and `setStream` have been removed to better encapsulate streams. +- `getMetadata` and `setMetadata` have been removed in favor of + `GuzzleHttp\Stream\MetadataStreamInterface`. +- `getWrapper`, `getWrapperData`, `getStreamType`, and `getUri` have all been + removed. This data is accessible when + using streams that implement `GuzzleHttp\Stream\MetadataStreamInterface`. +- `rewind` has been removed. Use `seek(0)` for a similar behavior. + +## Renamed methods + +- `detachStream` has been renamed to `detach`. +- `feof` has been renamed to `eof`. +- `ftell` has been renamed to `tell`. +- `readLine` has moved from an instance method to a static class method of + `GuzzleHttp\Stream\Stream`. + +## Metadata streams + +`GuzzleHttp\Stream\MetadataStreamInterface` has been added to denote streams +that contain additional metadata accessible via `getMetadata()`. +`GuzzleHttp\Stream\StreamInterface::getMetadata` and +`GuzzleHttp\Stream\StreamInterface::setMetadata` have been removed. + +## StreamRequestFactory + +The entire concept of the StreamRequestFactory has been removed. The way this +was used in Guzzle 3 broke the actual interface of sending streaming requests +(instead of getting back a Response, you got a StreamInterface). Streaming +PHP requests are now implemented through the `GuzzleHttp\Adapter\StreamAdapter`. + +3.6 to 3.7 +---------- + +### Deprecations + +- You can now enable E_USER_DEPRECATED warnings to see if you are using any deprecated methods.: + +```php +\Guzzle\Common\Version::$emitWarnings = true; +``` + +The following APIs and options have been marked as deprecated: + +- Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use `$request->getResponseBody()->isRepeatable()` instead. +- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +- Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead. +- Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead. +- Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated +- Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client. +- Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8. +- Marked `Guzzle\Common\Collection::inject()` as deprecated. +- Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use + `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` or + `$client->setDefaultOption('auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` + +3.7 introduces `request.options` as a parameter for a client configuration and as an optional argument to all creational +request methods. When paired with a client's configuration settings, these options allow you to specify default settings +for various aspects of a request. Because these options make other previous configuration options redundant, several +configuration options and methods of a client and AbstractCommand have been deprecated. + +- Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use `$client->getDefaultOption('headers')`. +- Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use `$client->setDefaultOption('headers/{header_name}', 'value')`. +- Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use `$client->setDefaultOption('params/{param_name}', 'value')` +- Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. These will work through Guzzle 4.0 + + $command = $client->getCommand('foo', array( + 'command.headers' => array('Test' => '123'), + 'command.response_body' => '/path/to/file' + )); + + // Should be changed to: + + $command = $client->getCommand('foo', array( + 'command.request_options' => array( + 'headers' => array('Test' => '123'), + 'save_as' => '/path/to/file' + ) + )); + +### Interface changes + +Additions and changes (you will need to update any implementations or subclasses you may have created): + +- Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`: + createRequest, head, delete, put, patch, post, options, prepareRequest +- Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()` +- Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface` +- Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to + `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a + resource, string, or EntityBody into the $options parameter to specify the download location of the response. +- Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a + default `array()` +- Added `Guzzle\Stream\StreamInterface::isRepeatable` +- Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods. + +The following methods were removed from interfaces. All of these methods are still available in the concrete classes +that implement them, but you should update your code to use alternative methods: + +- Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use + `$client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or + `$client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))` or + `$client->setDefaultOption('headers/{header_name}', 'value')`. or + `$client->setDefaultOption('headers', array('header_name' => 'value'))`. +- Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use `$client->getConfig()->getPath('request.options/headers')`. +- Removed `Guzzle\Http\ClientInterface::expandTemplate()`. This is an implementation detail. +- Removed `Guzzle\Http\ClientInterface::setRequestFactory()`. This is an implementation detail. +- Removed `Guzzle\Http\ClientInterface::getCurlMulti()`. This is a very specific implementation detail. +- Removed `Guzzle\Http\Message\RequestInterface::canCache`. Use the CachePlugin. +- Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect`. Use the HistoryPlugin. +- Removed `Guzzle\Http\Message\RequestInterface::isRedirect`. Use the HistoryPlugin. + +### Cache plugin breaking changes + +- CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a + CacheStorageInterface. These two objects and interface will be removed in a future version. +- Always setting X-cache headers on cached responses +- Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin +- `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface + $request, Response $response);` +- `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);` +- `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);` +- Added `CacheStorageInterface::purge($url)` +- `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin + $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache, + CanCacheStrategyInterface $canCache = null)` +- Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)` + +3.5 to 3.6 +---------- + +* Mixed casing of headers are now forced to be a single consistent casing across all values for that header. +* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution +* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader(). + For example, setHeader() first removes the header using unset on a HeaderCollection and then calls addHeader(). + Keeping the Host header and URL host in sync is now handled by overriding the addHeader method in Request. +* Specific header implementations can be created for complex headers. When a message creates a header, it uses a + HeaderFactory which can map specific headers to specific header classes. There is now a Link header and + CacheControl header implementation. +* Moved getLinks() from Response to just be used on a Link header object. + +If you previously relied on Guzzle\Http\Message\Header::raw(), then you will need to update your code to use the +HeaderInterface (e.g. toArray(), getAll(), etc.). + +### Interface changes + +* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate +* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti() +* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in + Guzzle\Http\Curl\RequestMediator +* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string. +* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface +* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders() + +### Removed deprecated functions + +* Removed Guzzle\Parser\ParserRegister::get(). Use getParser() +* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser(). + +### Deprecations + +* The ability to case-insensitively search for header values +* Guzzle\Http\Message\Header::hasExactHeader +* Guzzle\Http\Message\Header::raw. Use getAll() +* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object + instead. + +### Other changes + +* All response header helper functions return a string rather than mixing Header objects and strings inconsistently +* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle + directly via interfaces +* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist + but are a no-op until removed. +* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a + `Guzzle\Service\Command\ArrayCommandInterface`. +* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response + on a request while the request is still being transferred +* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess + +3.3 to 3.4 +---------- + +Base URLs of a client now follow the rules of http://tools.ietf.org/html/rfc3986#section-5.2.2 when merging URLs. + +3.2 to 3.3 +---------- + +### Response::getEtag() quote stripping removed + +`Guzzle\Http\Message\Response::getEtag()` no longer strips quotes around the ETag response header + +### Removed `Guzzle\Http\Utils` + +The `Guzzle\Http\Utils` class was removed. This class was only used for testing. + +### Stream wrapper and type + +`Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getStreamType()` are no longer converted to lowercase. + +### curl.emit_io became emit_io + +Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using the +'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' + +3.1 to 3.2 +---------- + +### CurlMulti is no longer reused globally + +Before 3.2, the same CurlMulti object was reused globally for each client. This can cause issue where plugins added +to a single client can pollute requests dispatched from other clients. + +If you still wish to reuse the same CurlMulti object with each client, then you can add a listener to the +ServiceBuilder's `service_builder.create_client` event to inject a custom CurlMulti object into each client as it is +created. + +```php +$multi = new Guzzle\Http\Curl\CurlMulti(); +$builder = Guzzle\Service\Builder\ServiceBuilder::factory('/path/to/config.json'); +$builder->addListener('service_builder.create_client', function ($event) use ($multi) { + $event['client']->setCurlMulti($multi); +} +}); +``` + +### No default path + +URLs no longer have a default path value of '/' if no path was specified. + +Before: + +```php +$request = $client->get('http://www.foo.com'); +echo $request->getUrl(); +// >> http://www.foo.com/ +``` + +After: + +```php +$request = $client->get('http://www.foo.com'); +echo $request->getUrl(); +// >> http://www.foo.com +``` + +### Less verbose BadResponseException + +The exception message for `Guzzle\Http\Exception\BadResponseException` no longer contains the full HTTP request and +response information. You can, however, get access to the request and response object by calling `getRequest()` or +`getResponse()` on the exception object. + +### Query parameter aggregation + +Multi-valued query parameters are no longer aggregated using a callback function. `Guzzle\Http\Query` now has a +setAggregator() method that accepts a `Guzzle\Http\QueryAggregator\QueryAggregatorInterface` object. This object is +responsible for handling the aggregation of multi-valued query string variables into a flattened hash. + +2.8 to 3.x +---------- + +### Guzzle\Service\Inspector + +Change `\Guzzle\Service\Inspector::fromConfig` to `\Guzzle\Common\Collection::fromConfig` + +**Before** + +```php +use Guzzle\Service\Inspector; + +class YourClient extends \Guzzle\Service\Client +{ + public static function factory($config = array()) + { + $default = array(); + $required = array('base_url', 'username', 'api_key'); + $config = Inspector::fromConfig($config, $default, $required); + + $client = new self( + $config->get('base_url'), + $config->get('username'), + $config->get('api_key') + ); + $client->setConfig($config); + + $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); + + return $client; + } +``` + +**After** + +```php +use Guzzle\Common\Collection; + +class YourClient extends \Guzzle\Service\Client +{ + public static function factory($config = array()) + { + $default = array(); + $required = array('base_url', 'username', 'api_key'); + $config = Collection::fromConfig($config, $default, $required); + + $client = new self( + $config->get('base_url'), + $config->get('username'), + $config->get('api_key') + ); + $client->setConfig($config); + + $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); + + return $client; + } +``` + +### Convert XML Service Descriptions to JSON + +**Before** + +```xml + + + + + + Get a list of groups + + + Uses a search query to get a list of groups + + + + Create a group + + + + + Delete a group by ID + + + + + + + Update a group + + + + + + +``` + +**After** + +```json +{ + "name": "Zendesk REST API v2", + "apiVersion": "2012-12-31", + "description":"Provides access to Zendesk views, groups, tickets, ticket fields, and users", + "operations": { + "list_groups": { + "httpMethod":"GET", + "uri": "groups.json", + "summary": "Get a list of groups" + }, + "search_groups":{ + "httpMethod":"GET", + "uri": "search.json?query=\"{query} type:group\"", + "summary": "Uses a search query to get a list of groups", + "parameters":{ + "query":{ + "location": "uri", + "description":"Zendesk Search Query", + "type": "string", + "required": true + } + } + }, + "create_group": { + "httpMethod":"POST", + "uri": "groups.json", + "summary": "Create a group", + "parameters":{ + "data": { + "type": "array", + "location": "body", + "description":"Group JSON", + "filters": "json_encode", + "required": true + }, + "Content-Type":{ + "type": "string", + "location":"header", + "static": "application/json" + } + } + }, + "delete_group": { + "httpMethod":"DELETE", + "uri": "groups/{id}.json", + "summary": "Delete a group", + "parameters":{ + "id":{ + "location": "uri", + "description":"Group to delete by ID", + "type": "integer", + "required": true + } + } + }, + "get_group": { + "httpMethod":"GET", + "uri": "groups/{id}.json", + "summary": "Get a ticket", + "parameters":{ + "id":{ + "location": "uri", + "description":"Group to get by ID", + "type": "integer", + "required": true + } + } + }, + "update_group": { + "httpMethod":"PUT", + "uri": "groups/{id}.json", + "summary": "Update a group", + "parameters":{ + "id": { + "location": "uri", + "description":"Group to update by ID", + "type": "integer", + "required": true + }, + "data": { + "type": "array", + "location": "body", + "description":"Group JSON", + "filters": "json_encode", + "required": true + }, + "Content-Type":{ + "type": "string", + "location":"header", + "static": "application/json" + } + } + } +} +``` + +### Guzzle\Service\Description\ServiceDescription + +Commands are now called Operations + +**Before** + +```php +use Guzzle\Service\Description\ServiceDescription; + +$sd = new ServiceDescription(); +$sd->getCommands(); // @returns ApiCommandInterface[] +$sd->hasCommand($name); +$sd->getCommand($name); // @returns ApiCommandInterface|null +$sd->addCommand($command); // @param ApiCommandInterface $command +``` + +**After** + +```php +use Guzzle\Service\Description\ServiceDescription; + +$sd = new ServiceDescription(); +$sd->getOperations(); // @returns OperationInterface[] +$sd->hasOperation($name); +$sd->getOperation($name); // @returns OperationInterface|null +$sd->addOperation($operation); // @param OperationInterface $operation +``` + +### Guzzle\Common\Inflection\Inflector + +Namespace is now `Guzzle\Inflection\Inflector` + +### Guzzle\Http\Plugin + +Namespace is now `Guzzle\Plugin`. Many other changes occur within this namespace and are detailed in their own sections below. + +### Guzzle\Http\Plugin\LogPlugin and Guzzle\Common\Log + +Now `Guzzle\Plugin\Log\LogPlugin` and `Guzzle\Log` respectively. + +**Before** + +```php +use Guzzle\Common\Log\ClosureLogAdapter; +use Guzzle\Http\Plugin\LogPlugin; + +/** @var \Guzzle\Http\Client */ +$client; + +// $verbosity is an integer indicating desired message verbosity level +$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $verbosity = LogPlugin::LOG_VERBOSE); +``` + +**After** + +```php +use Guzzle\Log\ClosureLogAdapter; +use Guzzle\Log\MessageFormatter; +use Guzzle\Plugin\Log\LogPlugin; + +/** @var \Guzzle\Http\Client */ +$client; + +// $format is a string indicating desired message format -- @see MessageFormatter +$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $format = MessageFormatter::DEBUG_FORMAT); +``` + +### Guzzle\Http\Plugin\CurlAuthPlugin + +Now `Guzzle\Plugin\CurlAuth\CurlAuthPlugin`. + +### Guzzle\Http\Plugin\ExponentialBackoffPlugin + +Now `Guzzle\Plugin\Backoff\BackoffPlugin`, and other changes. + +**Before** + +```php +use Guzzle\Http\Plugin\ExponentialBackoffPlugin; + +$backoffPlugin = new ExponentialBackoffPlugin($maxRetries, array_merge( + ExponentialBackoffPlugin::getDefaultFailureCodes(), array(429) + )); + +$client->addSubscriber($backoffPlugin); +``` + +**After** + +```php +use Guzzle\Plugin\Backoff\BackoffPlugin; +use Guzzle\Plugin\Backoff\HttpBackoffStrategy; + +// Use convenient factory method instead -- see implementation for ideas of what +// you can do with chaining backoff strategies +$backoffPlugin = BackoffPlugin::getExponentialBackoff($maxRetries, array_merge( + HttpBackoffStrategy::getDefaultFailureCodes(), array(429) + )); +$client->addSubscriber($backoffPlugin); +``` + +### Known Issues + +#### [BUG] Accept-Encoding header behavior changed unintentionally. + +(See #217) (Fixed in 09daeb8c666fb44499a0646d655a8ae36456575e) + +In version 2.8 setting the `Accept-Encoding` header would set the CURLOPT_ENCODING option, which permitted cURL to +properly handle gzip/deflate compressed responses from the server. In versions affected by this bug this does not happen. +See issue #217 for a workaround, or use a version containing the fix. diff --git a/vendor/guzzlehttp/guzzle/composer.json b/vendor/guzzlehttp/guzzle/composer.json new file mode 100644 index 0000000..c01864f --- /dev/null +++ b/vendor/guzzlehttp/guzzle/composer.json @@ -0,0 +1,59 @@ +{ + "name": "guzzlehttp/guzzle", + "type": "library", + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "framework", + "http", + "rest", + "web service", + "curl", + "client", + "HTTP client" + ], + "homepage": "http://guzzlephp.org/", + "license": "MIT", + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "require": { + "php": ">=5.5", + "ext-json": "*", + "symfony/polyfill-intl-idn": "^1.17.0", + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.6.1" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.1" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "config": { + "sort-packages": true + }, + "extra": { + "branch-alias": { + "dev-master": "6.5-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Tests\\": "tests/" + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Client.php b/vendor/guzzlehttp/guzzle/src/Client.php new file mode 100644 index 0000000..315a022 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Client.php @@ -0,0 +1,501 @@ + 'http://www.foo.com/1.0/', + * 'timeout' => 0, + * 'allow_redirects' => false, + * 'proxy' => '192.168.16.1:10' + * ]); + * + * Client configuration settings include the following options: + * + * - handler: (callable) Function that transfers HTTP requests over the + * wire. The function is called with a Psr7\Http\Message\RequestInterface + * and array of transfer options, and must return a + * GuzzleHttp\Promise\PromiseInterface that is fulfilled with a + * Psr7\Http\Message\ResponseInterface on success. + * If no handler is provided, a default handler will be created + * that enables all of the request options below by attaching all of the + * default middleware to the handler. + * - base_uri: (string|UriInterface) Base URI of the client that is merged + * into relative URIs. Can be a string or instance of UriInterface. + * - **: any request option + * + * @param array $config Client configuration settings. + * + * @see \GuzzleHttp\RequestOptions for a list of available request options. + */ + public function __construct(array $config = []) + { + if (!isset($config['handler'])) { + $config['handler'] = HandlerStack::create(); + } elseif (!is_callable($config['handler'])) { + throw new \InvalidArgumentException('handler must be a callable'); + } + + // Convert the base_uri to a UriInterface + if (isset($config['base_uri'])) { + $config['base_uri'] = Psr7\uri_for($config['base_uri']); + } + + $this->configureDefaults($config); + } + + /** + * @param string $method + * @param array $args + * + * @return Promise\PromiseInterface + */ + public function __call($method, $args) + { + if (count($args) < 1) { + throw new \InvalidArgumentException('Magic request methods require a URI and optional options array'); + } + + $uri = $args[0]; + $opts = isset($args[1]) ? $args[1] : []; + + return substr($method, -5) === 'Async' + ? $this->requestAsync(substr($method, 0, -5), $uri, $opts) + : $this->request($method, $uri, $opts); + } + + /** + * Asynchronously send an HTTP request. + * + * @param array $options Request options to apply to the given + * request and to the transfer. See \GuzzleHttp\RequestOptions. + * + * @return Promise\PromiseInterface + */ + public function sendAsync(RequestInterface $request, array $options = []) + { + // Merge the base URI into the request URI if needed. + $options = $this->prepareDefaults($options); + + return $this->transfer( + $request->withUri($this->buildUri($request->getUri(), $options), $request->hasHeader('Host')), + $options + ); + } + + /** + * Send an HTTP request. + * + * @param array $options Request options to apply to the given + * request and to the transfer. See \GuzzleHttp\RequestOptions. + * + * @return ResponseInterface + * @throws GuzzleException + */ + public function send(RequestInterface $request, array $options = []) + { + $options[RequestOptions::SYNCHRONOUS] = true; + return $this->sendAsync($request, $options)->wait(); + } + + /** + * Create and send an asynchronous HTTP request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string $method HTTP method + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions. + * + * @return Promise\PromiseInterface + */ + public function requestAsync($method, $uri = '', array $options = []) + { + $options = $this->prepareDefaults($options); + // Remove request modifying parameter because it can be done up-front. + $headers = isset($options['headers']) ? $options['headers'] : []; + $body = isset($options['body']) ? $options['body'] : null; + $version = isset($options['version']) ? $options['version'] : '1.1'; + // Merge the URI into the base URI. + $uri = $this->buildUri($uri, $options); + if (is_array($body)) { + $this->invalidBody(); + } + $request = new Psr7\Request($method, $uri, $headers, $body, $version); + // Remove the option so that they are not doubly-applied. + unset($options['headers'], $options['body'], $options['version']); + + return $this->transfer($request, $options); + } + + /** + * Create and send an HTTP request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. + * + * @param string $method HTTP method. + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions. + * + * @return ResponseInterface + * @throws GuzzleException + */ + public function request($method, $uri = '', array $options = []) + { + $options[RequestOptions::SYNCHRONOUS] = true; + return $this->requestAsync($method, $uri, $options)->wait(); + } + + /** + * Get a client configuration option. + * + * These options include default request options of the client, a "handler" + * (if utilized by the concrete client), and a "base_uri" if utilized by + * the concrete client. + * + * @param string|null $option The config option to retrieve. + * + * @return mixed + */ + public function getConfig($option = null) + { + return $option === null + ? $this->config + : (isset($this->config[$option]) ? $this->config[$option] : null); + } + + /** + * @param string|null $uri + * + * @return UriInterface + */ + private function buildUri($uri, array $config) + { + // for BC we accept null which would otherwise fail in uri_for + $uri = Psr7\uri_for($uri === null ? '' : $uri); + + if (isset($config['base_uri'])) { + $uri = Psr7\UriResolver::resolve(Psr7\uri_for($config['base_uri']), $uri); + } + + if (isset($config['idn_conversion']) && ($config['idn_conversion'] !== false)) { + $idnOptions = ($config['idn_conversion'] === true) ? IDNA_DEFAULT : $config['idn_conversion']; + $uri = Utils::idnUriConvert($uri, $idnOptions); + } + + return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri; + } + + /** + * Configures the default options for a client. + * + * @param array $config + * @return void + */ + private function configureDefaults(array $config) + { + $defaults = [ + 'allow_redirects' => RedirectMiddleware::$defaultSettings, + 'http_errors' => true, + 'decode_content' => true, + 'verify' => true, + 'cookies' => false, + 'idn_conversion' => true, + ]; + + // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set. + + // We can only trust the HTTP_PROXY environment variable in a CLI + // process due to the fact that PHP has no reliable mechanism to + // get environment variables that start with "HTTP_". + if (php_sapi_name() === 'cli' && getenv('HTTP_PROXY')) { + $defaults['proxy']['http'] = getenv('HTTP_PROXY'); + } + + if ($proxy = getenv('HTTPS_PROXY')) { + $defaults['proxy']['https'] = $proxy; + } + + if ($noProxy = getenv('NO_PROXY')) { + $cleanedNoProxy = str_replace(' ', '', $noProxy); + $defaults['proxy']['no'] = explode(',', $cleanedNoProxy); + } + + $this->config = $config + $defaults; + + if (!empty($config['cookies']) && $config['cookies'] === true) { + $this->config['cookies'] = new CookieJar(); + } + + // Add the default user-agent header. + if (!isset($this->config['headers'])) { + $this->config['headers'] = ['User-Agent' => default_user_agent()]; + } else { + // Add the User-Agent header if one was not already set. + foreach (array_keys($this->config['headers']) as $name) { + if (strtolower($name) === 'user-agent') { + return; + } + } + $this->config['headers']['User-Agent'] = default_user_agent(); + } + } + + /** + * Merges default options into the array. + * + * @param array $options Options to modify by reference + * + * @return array + */ + private function prepareDefaults(array $options) + { + $defaults = $this->config; + + if (!empty($defaults['headers'])) { + // Default headers are only added if they are not present. + $defaults['_conditional'] = $defaults['headers']; + unset($defaults['headers']); + } + + // Special handling for headers is required as they are added as + // conditional headers and as headers passed to a request ctor. + if (array_key_exists('headers', $options)) { + // Allows default headers to be unset. + if ($options['headers'] === null) { + $defaults['_conditional'] = []; + unset($options['headers']); + } elseif (!is_array($options['headers'])) { + throw new \InvalidArgumentException('headers must be an array'); + } + } + + // Shallow merge defaults underneath options. + $result = $options + $defaults; + + // Remove null values. + foreach ($result as $k => $v) { + if ($v === null) { + unset($result[$k]); + } + } + + return $result; + } + + /** + * Transfers the given request and applies request options. + * + * The URI of the request is not modified and the request options are used + * as-is without merging in default options. + * + * @param array $options See \GuzzleHttp\RequestOptions. + * + * @return Promise\PromiseInterface + */ + private function transfer(RequestInterface $request, array $options) + { + // save_to -> sink + if (isset($options['save_to'])) { + $options['sink'] = $options['save_to']; + unset($options['save_to']); + } + + // exceptions -> http_errors + if (isset($options['exceptions'])) { + $options['http_errors'] = $options['exceptions']; + unset($options['exceptions']); + } + + $request = $this->applyOptions($request, $options); + /** @var HandlerStack $handler */ + $handler = $options['handler']; + + try { + return Promise\promise_for($handler($request, $options)); + } catch (\Exception $e) { + return Promise\rejection_for($e); + } + } + + /** + * Applies the array of request options to a request. + * + * @param RequestInterface $request + * @param array $options + * + * @return RequestInterface + */ + private function applyOptions(RequestInterface $request, array &$options) + { + $modify = [ + 'set_headers' => [], + ]; + + if (isset($options['headers'])) { + $modify['set_headers'] = $options['headers']; + unset($options['headers']); + } + + if (isset($options['form_params'])) { + if (isset($options['multipart'])) { + throw new \InvalidArgumentException('You cannot use ' + . 'form_params and multipart at the same time. Use the ' + . 'form_params option if you want to send application/' + . 'x-www-form-urlencoded requests, and the multipart ' + . 'option to send multipart/form-data requests.'); + } + $options['body'] = http_build_query($options['form_params'], '', '&'); + unset($options['form_params']); + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'application/x-www-form-urlencoded'; + } + + if (isset($options['multipart'])) { + $options['body'] = new Psr7\MultipartStream($options['multipart']); + unset($options['multipart']); + } + + if (isset($options['json'])) { + $options['body'] = \GuzzleHttp\json_encode($options['json']); + unset($options['json']); + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'application/json'; + } + + if (!empty($options['decode_content']) + && $options['decode_content'] !== true + ) { + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\_caseless_remove(['Accept-Encoding'], $options['_conditional']); + $modify['set_headers']['Accept-Encoding'] = $options['decode_content']; + } + + if (isset($options['body'])) { + if (is_array($options['body'])) { + $this->invalidBody(); + } + $modify['body'] = Psr7\stream_for($options['body']); + unset($options['body']); + } + + if (!empty($options['auth']) && is_array($options['auth'])) { + $value = $options['auth']; + $type = isset($value[2]) ? strtolower($value[2]) : 'basic'; + switch ($type) { + case 'basic': + // Ensure that we don't have the header in different case and set the new value. + $modify['set_headers'] = Psr7\_caseless_remove(['Authorization'], $modify['set_headers']); + $modify['set_headers']['Authorization'] = 'Basic ' + . base64_encode("$value[0]:$value[1]"); + break; + case 'digest': + // @todo: Do not rely on curl + $options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_DIGEST; + $options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]"; + break; + case 'ntlm': + $options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_NTLM; + $options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]"; + break; + } + } + + if (isset($options['query'])) { + $value = $options['query']; + if (is_array($value)) { + $value = http_build_query($value, null, '&', PHP_QUERY_RFC3986); + } + if (!is_string($value)) { + throw new \InvalidArgumentException('query must be a string or array'); + } + $modify['query'] = $value; + unset($options['query']); + } + + // Ensure that sink is not an invalid value. + if (isset($options['sink'])) { + // TODO: Add more sink validation? + if (is_bool($options['sink'])) { + throw new \InvalidArgumentException('sink must not be a boolean'); + } + } + + $request = Psr7\modify_request($request, $modify); + if ($request->getBody() instanceof Psr7\MultipartStream) { + // Use a multipart/form-data POST if a Content-Type is not set. + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'multipart/form-data; boundary=' + . $request->getBody()->getBoundary(); + } + + // Merge in conditional headers if they are not present. + if (isset($options['_conditional'])) { + // Build up the changes so it's in a single clone of the message. + $modify = []; + foreach ($options['_conditional'] as $k => $v) { + if (!$request->hasHeader($k)) { + $modify['set_headers'][$k] = $v; + } + } + $request = Psr7\modify_request($request, $modify); + // Don't pass this internal value along to middleware/handlers. + unset($options['_conditional']); + } + + return $request; + } + + /** + * Throw Exception with pre-set message. + * @return void + * @throws \InvalidArgumentException Invalid body. + */ + private function invalidBody() + { + throw new \InvalidArgumentException('Passing in the "body" request ' + . 'option as an array to send a POST request has been deprecated. ' + . 'Please use the "form_params" request option to send a ' + . 'application/x-www-form-urlencoded request, or the "multipart" ' + . 'request option to send a multipart/form-data request.'); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/ClientInterface.php b/vendor/guzzlehttp/guzzle/src/ClientInterface.php new file mode 100644 index 0000000..638b75d --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/ClientInterface.php @@ -0,0 +1,87 @@ +strictMode = $strictMode; + + foreach ($cookieArray as $cookie) { + if (!($cookie instanceof SetCookie)) { + $cookie = new SetCookie($cookie); + } + $this->setCookie($cookie); + } + } + + /** + * Create a new Cookie jar from an associative array and domain. + * + * @param array $cookies Cookies to create the jar from + * @param string $domain Domain to set the cookies to + * + * @return self + */ + public static function fromArray(array $cookies, $domain) + { + $cookieJar = new self(); + foreach ($cookies as $name => $value) { + $cookieJar->setCookie(new SetCookie([ + 'Domain' => $domain, + 'Name' => $name, + 'Value' => $value, + 'Discard' => true + ])); + } + + return $cookieJar; + } + + /** + * @deprecated + */ + public static function getCookieValue($value) + { + return $value; + } + + /** + * Evaluate if this cookie should be persisted to storage + * that survives between requests. + * + * @param SetCookie $cookie Being evaluated. + * @param bool $allowSessionCookies If we should persist session cookies + * @return bool + */ + public static function shouldPersist( + SetCookie $cookie, + $allowSessionCookies = false + ) { + if ($cookie->getExpires() || $allowSessionCookies) { + if (!$cookie->getDiscard()) { + return true; + } + } + + return false; + } + + /** + * Finds and returns the cookie based on the name + * + * @param string $name cookie name to search for + * @return SetCookie|null cookie that was found or null if not found + */ + public function getCookieByName($name) + { + // don't allow a non string name + if ($name === null || !is_scalar($name)) { + return null; + } + foreach ($this->cookies as $cookie) { + if ($cookie->getName() !== null && strcasecmp($cookie->getName(), $name) === 0) { + return $cookie; + } + } + + return null; + } + + public function toArray() + { + return array_map(function (SetCookie $cookie) { + return $cookie->toArray(); + }, $this->getIterator()->getArrayCopy()); + } + + public function clear($domain = null, $path = null, $name = null) + { + if (!$domain) { + $this->cookies = []; + return; + } elseif (!$path) { + $this->cookies = array_filter( + $this->cookies, + function (SetCookie $cookie) use ($domain) { + return !$cookie->matchesDomain($domain); + } + ); + } elseif (!$name) { + $this->cookies = array_filter( + $this->cookies, + function (SetCookie $cookie) use ($path, $domain) { + return !($cookie->matchesPath($path) && + $cookie->matchesDomain($domain)); + } + ); + } else { + $this->cookies = array_filter( + $this->cookies, + function (SetCookie $cookie) use ($path, $domain, $name) { + return !($cookie->getName() == $name && + $cookie->matchesPath($path) && + $cookie->matchesDomain($domain)); + } + ); + } + } + + public function clearSessionCookies() + { + $this->cookies = array_filter( + $this->cookies, + function (SetCookie $cookie) { + return !$cookie->getDiscard() && $cookie->getExpires(); + } + ); + } + + public function setCookie(SetCookie $cookie) + { + // If the name string is empty (but not 0), ignore the set-cookie + // string entirely. + $name = $cookie->getName(); + if (!$name && $name !== '0') { + return false; + } + + // Only allow cookies with set and valid domain, name, value + $result = $cookie->validate(); + if ($result !== true) { + if ($this->strictMode) { + throw new \RuntimeException('Invalid cookie: ' . $result); + } else { + $this->removeCookieIfEmpty($cookie); + return false; + } + } + + // Resolve conflicts with previously set cookies + foreach ($this->cookies as $i => $c) { + + // Two cookies are identical, when their path, and domain are + // identical. + if ($c->getPath() != $cookie->getPath() || + $c->getDomain() != $cookie->getDomain() || + $c->getName() != $cookie->getName() + ) { + continue; + } + + // The previously set cookie is a discard cookie and this one is + // not so allow the new cookie to be set + if (!$cookie->getDiscard() && $c->getDiscard()) { + unset($this->cookies[$i]); + continue; + } + + // If the new cookie's expiration is further into the future, then + // replace the old cookie + if ($cookie->getExpires() > $c->getExpires()) { + unset($this->cookies[$i]); + continue; + } + + // If the value has changed, we better change it + if ($cookie->getValue() !== $c->getValue()) { + unset($this->cookies[$i]); + continue; + } + + // The cookie exists, so no need to continue + return false; + } + + $this->cookies[] = $cookie; + + return true; + } + + public function count() + { + return count($this->cookies); + } + + public function getIterator() + { + return new \ArrayIterator(array_values($this->cookies)); + } + + public function extractCookies( + RequestInterface $request, + ResponseInterface $response + ) { + if ($cookieHeader = $response->getHeader('Set-Cookie')) { + foreach ($cookieHeader as $cookie) { + $sc = SetCookie::fromString($cookie); + if (!$sc->getDomain()) { + $sc->setDomain($request->getUri()->getHost()); + } + if (0 !== strpos($sc->getPath(), '/')) { + $sc->setPath($this->getCookiePathFromRequest($request)); + } + $this->setCookie($sc); + } + } + } + + /** + * Computes cookie path following RFC 6265 section 5.1.4 + * + * @link https://tools.ietf.org/html/rfc6265#section-5.1.4 + * + * @param RequestInterface $request + * @return string + */ + private function getCookiePathFromRequest(RequestInterface $request) + { + $uriPath = $request->getUri()->getPath(); + if ('' === $uriPath) { + return '/'; + } + if (0 !== strpos($uriPath, '/')) { + return '/'; + } + if ('/' === $uriPath) { + return '/'; + } + if (0 === $lastSlashPos = strrpos($uriPath, '/')) { + return '/'; + } + + return substr($uriPath, 0, $lastSlashPos); + } + + public function withCookieHeader(RequestInterface $request) + { + $values = []; + $uri = $request->getUri(); + $scheme = $uri->getScheme(); + $host = $uri->getHost(); + $path = $uri->getPath() ?: '/'; + + foreach ($this->cookies as $cookie) { + if ($cookie->matchesPath($path) && + $cookie->matchesDomain($host) && + !$cookie->isExpired() && + (!$cookie->getSecure() || $scheme === 'https') + ) { + $values[] = $cookie->getName() . '=' + . $cookie->getValue(); + } + } + + return $values + ? $request->withHeader('Cookie', implode('; ', $values)) + : $request; + } + + /** + * If a cookie already exists and the server asks to set it again with a + * null value, the cookie must be deleted. + * + * @param SetCookie $cookie + */ + private function removeCookieIfEmpty(SetCookie $cookie) + { + $cookieValue = $cookie->getValue(); + if ($cookieValue === null || $cookieValue === '') { + $this->clear( + $cookie->getDomain(), + $cookie->getPath(), + $cookie->getName() + ); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php new file mode 100644 index 0000000..6ee1188 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php @@ -0,0 +1,84 @@ +filename = $cookieFile; + $this->storeSessionCookies = $storeSessionCookies; + + if (file_exists($cookieFile)) { + $this->load($cookieFile); + } + } + + /** + * Saves the file when shutting down + */ + public function __destruct() + { + $this->save($this->filename); + } + + /** + * Saves the cookies to a file. + * + * @param string $filename File to save + * @throws \RuntimeException if the file cannot be found or created + */ + public function save($filename) + { + $json = []; + foreach ($this as $cookie) { + /** @var SetCookie $cookie */ + if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { + $json[] = $cookie->toArray(); + } + } + + $jsonStr = \GuzzleHttp\json_encode($json); + if (false === file_put_contents($filename, $jsonStr, LOCK_EX)) { + throw new \RuntimeException("Unable to save file {$filename}"); + } + } + + /** + * Load cookies from a JSON formatted file. + * + * Old cookies are kept unless overwritten by newly loaded ones. + * + * @param string $filename Cookie file to load. + * @throws \RuntimeException if the file cannot be loaded. + */ + public function load($filename) + { + $json = file_get_contents($filename); + if (false === $json) { + throw new \RuntimeException("Unable to load file {$filename}"); + } elseif ($json === '') { + return; + } + + $data = \GuzzleHttp\json_decode($json, true); + if (is_array($data)) { + foreach (json_decode($json, true) as $cookie) { + $this->setCookie(new SetCookie($cookie)); + } + } elseif (strlen($data)) { + throw new \RuntimeException("Invalid cookie file: {$filename}"); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php b/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php new file mode 100644 index 0000000..0224a24 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php @@ -0,0 +1,72 @@ +sessionKey = $sessionKey; + $this->storeSessionCookies = $storeSessionCookies; + $this->load(); + } + + /** + * Saves cookies to session when shutting down + */ + public function __destruct() + { + $this->save(); + } + + /** + * Save cookies to the client session + */ + public function save() + { + $json = []; + foreach ($this as $cookie) { + /** @var SetCookie $cookie */ + if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { + $json[] = $cookie->toArray(); + } + } + + $_SESSION[$this->sessionKey] = json_encode($json); + } + + /** + * Load the contents of the client session into the data array + */ + protected function load() + { + if (!isset($_SESSION[$this->sessionKey])) { + return; + } + $data = json_decode($_SESSION[$this->sessionKey], true); + if (is_array($data)) { + foreach ($data as $cookie) { + $this->setCookie(new SetCookie($cookie)); + } + } elseif (strlen($data)) { + throw new \RuntimeException("Invalid cookie data"); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php b/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php new file mode 100644 index 0000000..3d776a7 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php @@ -0,0 +1,403 @@ + null, + 'Value' => null, + 'Domain' => null, + 'Path' => '/', + 'Max-Age' => null, + 'Expires' => null, + 'Secure' => false, + 'Discard' => false, + 'HttpOnly' => false + ]; + + /** @var array Cookie data */ + private $data; + + /** + * Create a new SetCookie object from a string + * + * @param string $cookie Set-Cookie header string + * + * @return self + */ + public static function fromString($cookie) + { + // Create the default return array + $data = self::$defaults; + // Explode the cookie string using a series of semicolons + $pieces = array_filter(array_map('trim', explode(';', $cookie))); + // The name of the cookie (first kvp) must exist and include an equal sign. + if (empty($pieces[0]) || !strpos($pieces[0], '=')) { + return new self($data); + } + + // Add the cookie pieces into the parsed data array + foreach ($pieces as $part) { + $cookieParts = explode('=', $part, 2); + $key = trim($cookieParts[0]); + $value = isset($cookieParts[1]) + ? trim($cookieParts[1], " \n\r\t\0\x0B") + : true; + + // Only check for non-cookies when cookies have been found + if (empty($data['Name'])) { + $data['Name'] = $key; + $data['Value'] = $value; + } else { + foreach (array_keys(self::$defaults) as $search) { + if (!strcasecmp($search, $key)) { + $data[$search] = $value; + continue 2; + } + } + $data[$key] = $value; + } + } + + return new self($data); + } + + /** + * @param array $data Array of cookie data provided by a Cookie parser + */ + public function __construct(array $data = []) + { + $this->data = array_replace(self::$defaults, $data); + // Extract the Expires value and turn it into a UNIX timestamp if needed + if (!$this->getExpires() && $this->getMaxAge()) { + // Calculate the Expires date + $this->setExpires(time() + $this->getMaxAge()); + } elseif ($this->getExpires() && !is_numeric($this->getExpires())) { + $this->setExpires($this->getExpires()); + } + } + + public function __toString() + { + $str = $this->data['Name'] . '=' . $this->data['Value'] . '; '; + foreach ($this->data as $k => $v) { + if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) { + if ($k === 'Expires') { + $str .= 'Expires=' . gmdate('D, d M Y H:i:s \G\M\T', $v) . '; '; + } else { + $str .= ($v === true ? $k : "{$k}={$v}") . '; '; + } + } + } + + return rtrim($str, '; '); + } + + public function toArray() + { + return $this->data; + } + + /** + * Get the cookie name + * + * @return string + */ + public function getName() + { + return $this->data['Name']; + } + + /** + * Set the cookie name + * + * @param string $name Cookie name + */ + public function setName($name) + { + $this->data['Name'] = $name; + } + + /** + * Get the cookie value + * + * @return string + */ + public function getValue() + { + return $this->data['Value']; + } + + /** + * Set the cookie value + * + * @param string $value Cookie value + */ + public function setValue($value) + { + $this->data['Value'] = $value; + } + + /** + * Get the domain + * + * @return string|null + */ + public function getDomain() + { + return $this->data['Domain']; + } + + /** + * Set the domain of the cookie + * + * @param string $domain + */ + public function setDomain($domain) + { + $this->data['Domain'] = $domain; + } + + /** + * Get the path + * + * @return string + */ + public function getPath() + { + return $this->data['Path']; + } + + /** + * Set the path of the cookie + * + * @param string $path Path of the cookie + */ + public function setPath($path) + { + $this->data['Path'] = $path; + } + + /** + * Maximum lifetime of the cookie in seconds + * + * @return int|null + */ + public function getMaxAge() + { + return $this->data['Max-Age']; + } + + /** + * Set the max-age of the cookie + * + * @param int $maxAge Max age of the cookie in seconds + */ + public function setMaxAge($maxAge) + { + $this->data['Max-Age'] = $maxAge; + } + + /** + * The UNIX timestamp when the cookie Expires + * + * @return mixed + */ + public function getExpires() + { + return $this->data['Expires']; + } + + /** + * Set the unix timestamp for which the cookie will expire + * + * @param int $timestamp Unix timestamp + */ + public function setExpires($timestamp) + { + $this->data['Expires'] = is_numeric($timestamp) + ? (int) $timestamp + : strtotime($timestamp); + } + + /** + * Get whether or not this is a secure cookie + * + * @return bool|null + */ + public function getSecure() + { + return $this->data['Secure']; + } + + /** + * Set whether or not the cookie is secure + * + * @param bool $secure Set to true or false if secure + */ + public function setSecure($secure) + { + $this->data['Secure'] = $secure; + } + + /** + * Get whether or not this is a session cookie + * + * @return bool|null + */ + public function getDiscard() + { + return $this->data['Discard']; + } + + /** + * Set whether or not this is a session cookie + * + * @param bool $discard Set to true or false if this is a session cookie + */ + public function setDiscard($discard) + { + $this->data['Discard'] = $discard; + } + + /** + * Get whether or not this is an HTTP only cookie + * + * @return bool + */ + public function getHttpOnly() + { + return $this->data['HttpOnly']; + } + + /** + * Set whether or not this is an HTTP only cookie + * + * @param bool $httpOnly Set to true or false if this is HTTP only + */ + public function setHttpOnly($httpOnly) + { + $this->data['HttpOnly'] = $httpOnly; + } + + /** + * Check if the cookie matches a path value. + * + * A request-path path-matches a given cookie-path if at least one of + * the following conditions holds: + * + * - The cookie-path and the request-path are identical. + * - The cookie-path is a prefix of the request-path, and the last + * character of the cookie-path is %x2F ("/"). + * - The cookie-path is a prefix of the request-path, and the first + * character of the request-path that is not included in the cookie- + * path is a %x2F ("/") character. + * + * @param string $requestPath Path to check against + * + * @return bool + */ + public function matchesPath($requestPath) + { + $cookiePath = $this->getPath(); + + // Match on exact matches or when path is the default empty "/" + if ($cookiePath === '/' || $cookiePath == $requestPath) { + return true; + } + + // Ensure that the cookie-path is a prefix of the request path. + if (0 !== strpos($requestPath, $cookiePath)) { + return false; + } + + // Match if the last character of the cookie-path is "/" + if (substr($cookiePath, -1, 1) === '/') { + return true; + } + + // Match if the first character not included in cookie path is "/" + return substr($requestPath, strlen($cookiePath), 1) === '/'; + } + + /** + * Check if the cookie matches a domain value + * + * @param string $domain Domain to check against + * + * @return bool + */ + public function matchesDomain($domain) + { + // Remove the leading '.' as per spec in RFC 6265. + // http://tools.ietf.org/html/rfc6265#section-5.2.3 + $cookieDomain = ltrim($this->getDomain(), '.'); + + // Domain not set or exact match. + if (!$cookieDomain || !strcasecmp($domain, $cookieDomain)) { + return true; + } + + // Matching the subdomain according to RFC 6265. + // http://tools.ietf.org/html/rfc6265#section-5.1.3 + if (filter_var($domain, FILTER_VALIDATE_IP)) { + return false; + } + + return (bool) preg_match('/\.' . preg_quote($cookieDomain, '/') . '$/', $domain); + } + + /** + * Check if the cookie is expired + * + * @return bool + */ + public function isExpired() + { + return $this->getExpires() !== null && time() > $this->getExpires(); + } + + /** + * Check if the cookie is valid according to RFC 6265 + * + * @return bool|string Returns true if valid or an error message if invalid + */ + public function validate() + { + // Names must not be empty, but can be 0 + $name = $this->getName(); + if (empty($name) && !is_numeric($name)) { + return 'The cookie name must not be empty'; + } + + // Check if any of the invalid characters are present in the cookie name + if (preg_match( + '/[\x00-\x20\x22\x28-\x29\x2c\x2f\x3a-\x40\x5c\x7b\x7d\x7f]/', + $name + )) { + return 'Cookie name must not contain invalid characters: ASCII ' + . 'Control characters (0-31;127), space, tab and the ' + . 'following characters: ()<>@,;:\"/?={}'; + } + + // Value must not be empty, but can be 0 + $value = $this->getValue(); + if (empty($value) && !is_numeric($value)) { + return 'The cookie value must not be empty'; + } + + // Domains must not be empty, but can be 0 + // A "0" is not a valid internet domain, but may be used as server name + // in a private network. + $domain = $this->getDomain(); + if (empty($domain) && !is_numeric($domain)) { + return 'The cookie domain must not be empty'; + } + + return true; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php b/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php new file mode 100644 index 0000000..427d896 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php @@ -0,0 +1,27 @@ +getStatusCode() + : 0; + parent::__construct($message, $code, $previous); + $this->request = $request; + $this->response = $response; + $this->handlerContext = $handlerContext; + } + + /** + * Wrap non-RequestExceptions with a RequestException + * + * @param RequestInterface $request + * @param \Exception $e + * + * @return RequestException + */ + public static function wrapException(RequestInterface $request, \Exception $e) + { + return $e instanceof RequestException + ? $e + : new RequestException($e->getMessage(), $request, null, $e); + } + + /** + * Factory method to create a new exception with a normalized error message + * + * @param RequestInterface $request Request + * @param ResponseInterface $response Response received + * @param \Exception $previous Previous exception + * @param array $ctx Optional handler context. + * + * @return self + */ + public static function create( + RequestInterface $request, + ResponseInterface $response = null, + \Exception $previous = null, + array $ctx = [] + ) { + if (!$response) { + return new self( + 'Error completing request', + $request, + null, + $previous, + $ctx + ); + } + + $level = (int) floor($response->getStatusCode() / 100); + if ($level === 4) { + $label = 'Client error'; + $className = ClientException::class; + } elseif ($level === 5) { + $label = 'Server error'; + $className = ServerException::class; + } else { + $label = 'Unsuccessful request'; + $className = __CLASS__; + } + + $uri = $request->getUri(); + $uri = static::obfuscateUri($uri); + + // Client Error: `GET /` resulted in a `404 Not Found` response: + // ... (truncated) + $message = sprintf( + '%s: `%s %s` resulted in a `%s %s` response', + $label, + $request->getMethod(), + $uri, + $response->getStatusCode(), + $response->getReasonPhrase() + ); + + $summary = static::getResponseBodySummary($response); + + if ($summary !== null) { + $message .= ":\n{$summary}\n"; + } + + return new $className($message, $request, $response, $previous, $ctx); + } + + /** + * Get a short summary of the response + * + * Will return `null` if the response is not printable. + * + * @param ResponseInterface $response + * + * @return string|null + */ + public static function getResponseBodySummary(ResponseInterface $response) + { + return \GuzzleHttp\Psr7\get_message_body_summary($response); + } + + /** + * Obfuscates URI if there is a username and a password present + * + * @param UriInterface $uri + * + * @return UriInterface + */ + private static function obfuscateUri(UriInterface $uri) + { + $userInfo = $uri->getUserInfo(); + + if (false !== ($pos = strpos($userInfo, ':'))) { + return $uri->withUserInfo(substr($userInfo, 0, $pos), '***'); + } + + return $uri; + } + + /** + * Get the request that caused the exception + * + * @return RequestInterface + */ + public function getRequest() + { + return $this->request; + } + + /** + * Get the associated response + * + * @return ResponseInterface|null + */ + public function getResponse() + { + return $this->response; + } + + /** + * Check if a response was received + * + * @return bool + */ + public function hasResponse() + { + return $this->response !== null; + } + + /** + * Get contextual information about the error from the underlying handler. + * + * The contents of this array will vary depending on which handler you are + * using. It may also be just an empty array. Relying on this data will + * couple you to a specific handler, but can give more debug information + * when needed. + * + * @return array + */ + public function getHandlerContext() + { + return $this->handlerContext; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php b/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php new file mode 100644 index 0000000..a77c289 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php @@ -0,0 +1,27 @@ +stream = $stream; + $msg = $msg ?: 'Could not seek the stream to position ' . $pos; + parent::__construct($msg); + } + + /** + * @return StreamInterface + */ + public function getStream() + { + return $this->stream; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php b/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php new file mode 100644 index 0000000..127094c --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php @@ -0,0 +1,9 @@ +maxHandles = $maxHandles; + } + + public function create(RequestInterface $request, array $options) + { + if (isset($options['curl']['body_as_string'])) { + $options['_body_as_string'] = $options['curl']['body_as_string']; + unset($options['curl']['body_as_string']); + } + + $easy = new EasyHandle; + $easy->request = $request; + $easy->options = $options; + $conf = $this->getDefaultConf($easy); + $this->applyMethod($easy, $conf); + $this->applyHandlerOptions($easy, $conf); + $this->applyHeaders($easy, $conf); + unset($conf['_headers']); + + // Add handler options from the request configuration options + if (isset($options['curl'])) { + $conf = array_replace($conf, $options['curl']); + } + + $conf[CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy); + $easy->handle = $this->handles + ? array_pop($this->handles) + : curl_init(); + curl_setopt_array($easy->handle, $conf); + + return $easy; + } + + public function release(EasyHandle $easy) + { + $resource = $easy->handle; + unset($easy->handle); + + if (count($this->handles) >= $this->maxHandles) { + curl_close($resource); + } else { + // Remove all callback functions as they can hold onto references + // and are not cleaned up by curl_reset. Using curl_setopt_array + // does not work for some reason, so removing each one + // individually. + curl_setopt($resource, CURLOPT_HEADERFUNCTION, null); + curl_setopt($resource, CURLOPT_READFUNCTION, null); + curl_setopt($resource, CURLOPT_WRITEFUNCTION, null); + curl_setopt($resource, CURLOPT_PROGRESSFUNCTION, null); + curl_reset($resource); + $this->handles[] = $resource; + } + } + + /** + * Completes a cURL transaction, either returning a response promise or a + * rejected promise. + * + * @param callable $handler + * @param EasyHandle $easy + * @param CurlFactoryInterface $factory Dictates how the handle is released + * + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public static function finish( + callable $handler, + EasyHandle $easy, + CurlFactoryInterface $factory + ) { + if (isset($easy->options['on_stats'])) { + self::invokeStats($easy); + } + + if (!$easy->response || $easy->errno) { + return self::finishError($handler, $easy, $factory); + } + + // Return the response if it is present and there is no error. + $factory->release($easy); + + // Rewind the body of the response if possible. + $body = $easy->response->getBody(); + if ($body->isSeekable()) { + $body->rewind(); + } + + return new FulfilledPromise($easy->response); + } + + private static function invokeStats(EasyHandle $easy) + { + $curlStats = curl_getinfo($easy->handle); + $curlStats['appconnect_time'] = curl_getinfo($easy->handle, CURLINFO_APPCONNECT_TIME); + $stats = new TransferStats( + $easy->request, + $easy->response, + $curlStats['total_time'], + $easy->errno, + $curlStats + ); + call_user_func($easy->options['on_stats'], $stats); + } + + private static function finishError( + callable $handler, + EasyHandle $easy, + CurlFactoryInterface $factory + ) { + // Get error information and release the handle to the factory. + $ctx = [ + 'errno' => $easy->errno, + 'error' => curl_error($easy->handle), + 'appconnect_time' => curl_getinfo($easy->handle, CURLINFO_APPCONNECT_TIME), + ] + curl_getinfo($easy->handle); + $ctx[self::CURL_VERSION_STR] = curl_version()['version']; + $factory->release($easy); + + // Retry when nothing is present or when curl failed to rewind. + if (empty($easy->options['_err_message']) + && (!$easy->errno || $easy->errno == 65) + ) { + return self::retryFailedRewind($handler, $easy, $ctx); + } + + return self::createRejection($easy, $ctx); + } + + private static function createRejection(EasyHandle $easy, array $ctx) + { + static $connectionErrors = [ + CURLE_OPERATION_TIMEOUTED => true, + CURLE_COULDNT_RESOLVE_HOST => true, + CURLE_COULDNT_CONNECT => true, + CURLE_SSL_CONNECT_ERROR => true, + CURLE_GOT_NOTHING => true, + ]; + + // If an exception was encountered during the onHeaders event, then + // return a rejected promise that wraps that exception. + if ($easy->onHeadersException) { + return \GuzzleHttp\Promise\rejection_for( + new RequestException( + 'An error was encountered during the on_headers event', + $easy->request, + $easy->response, + $easy->onHeadersException, + $ctx + ) + ); + } + if (version_compare($ctx[self::CURL_VERSION_STR], self::LOW_CURL_VERSION_NUMBER)) { + $message = sprintf( + 'cURL error %s: %s (%s)', + $ctx['errno'], + $ctx['error'], + 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html' + ); + } else { + $message = sprintf( + 'cURL error %s: %s (%s) for %s', + $ctx['errno'], + $ctx['error'], + 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html', + $easy->request->getUri() + ); + } + + // Create a connection exception if it was a specific error code. + $error = isset($connectionErrors[$easy->errno]) + ? new ConnectException($message, $easy->request, null, $ctx) + : new RequestException($message, $easy->request, $easy->response, null, $ctx); + + return \GuzzleHttp\Promise\rejection_for($error); + } + + private function getDefaultConf(EasyHandle $easy) + { + $conf = [ + '_headers' => $easy->request->getHeaders(), + CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(), + CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''), + CURLOPT_RETURNTRANSFER => false, + CURLOPT_HEADER => false, + CURLOPT_CONNECTTIMEOUT => 150, + ]; + + if (defined('CURLOPT_PROTOCOLS')) { + $conf[CURLOPT_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS; + } + + $version = $easy->request->getProtocolVersion(); + if ($version == 1.1) { + $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1; + } elseif ($version == 2.0) { + $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2_0; + } else { + $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0; + } + + return $conf; + } + + private function applyMethod(EasyHandle $easy, array &$conf) + { + $body = $easy->request->getBody(); + $size = $body->getSize(); + + if ($size === null || $size > 0) { + $this->applyBody($easy->request, $easy->options, $conf); + return; + } + + $method = $easy->request->getMethod(); + if ($method === 'PUT' || $method === 'POST') { + // See http://tools.ietf.org/html/rfc7230#section-3.3.2 + if (!$easy->request->hasHeader('Content-Length')) { + $conf[CURLOPT_HTTPHEADER][] = 'Content-Length: 0'; + } + } elseif ($method === 'HEAD') { + $conf[CURLOPT_NOBODY] = true; + unset( + $conf[CURLOPT_WRITEFUNCTION], + $conf[CURLOPT_READFUNCTION], + $conf[CURLOPT_FILE], + $conf[CURLOPT_INFILE] + ); + } + } + + private function applyBody(RequestInterface $request, array $options, array &$conf) + { + $size = $request->hasHeader('Content-Length') + ? (int) $request->getHeaderLine('Content-Length') + : null; + + // Send the body as a string if the size is less than 1MB OR if the + // [curl][body_as_string] request value is set. + if (($size !== null && $size < 1000000) || + !empty($options['_body_as_string']) + ) { + $conf[CURLOPT_POSTFIELDS] = (string) $request->getBody(); + // Don't duplicate the Content-Length header + $this->removeHeader('Content-Length', $conf); + $this->removeHeader('Transfer-Encoding', $conf); + } else { + $conf[CURLOPT_UPLOAD] = true; + if ($size !== null) { + $conf[CURLOPT_INFILESIZE] = $size; + $this->removeHeader('Content-Length', $conf); + } + $body = $request->getBody(); + if ($body->isSeekable()) { + $body->rewind(); + } + $conf[CURLOPT_READFUNCTION] = function ($ch, $fd, $length) use ($body) { + return $body->read($length); + }; + } + + // If the Expect header is not present, prevent curl from adding it + if (!$request->hasHeader('Expect')) { + $conf[CURLOPT_HTTPHEADER][] = 'Expect:'; + } + + // cURL sometimes adds a content-type by default. Prevent this. + if (!$request->hasHeader('Content-Type')) { + $conf[CURLOPT_HTTPHEADER][] = 'Content-Type:'; + } + } + + private function applyHeaders(EasyHandle $easy, array &$conf) + { + foreach ($conf['_headers'] as $name => $values) { + foreach ($values as $value) { + $value = (string) $value; + if ($value === '') { + // cURL requires a special format for empty headers. + // See https://github.com/guzzle/guzzle/issues/1882 for more details. + $conf[CURLOPT_HTTPHEADER][] = "$name;"; + } else { + $conf[CURLOPT_HTTPHEADER][] = "$name: $value"; + } + } + } + + // Remove the Accept header if one was not set + if (!$easy->request->hasHeader('Accept')) { + $conf[CURLOPT_HTTPHEADER][] = 'Accept:'; + } + } + + /** + * Remove a header from the options array. + * + * @param string $name Case-insensitive header to remove + * @param array $options Array of options to modify + */ + private function removeHeader($name, array &$options) + { + foreach (array_keys($options['_headers']) as $key) { + if (!strcasecmp($key, $name)) { + unset($options['_headers'][$key]); + return; + } + } + } + + private function applyHandlerOptions(EasyHandle $easy, array &$conf) + { + $options = $easy->options; + if (isset($options['verify'])) { + if ($options['verify'] === false) { + unset($conf[CURLOPT_CAINFO]); + $conf[CURLOPT_SSL_VERIFYHOST] = 0; + $conf[CURLOPT_SSL_VERIFYPEER] = false; + } else { + $conf[CURLOPT_SSL_VERIFYHOST] = 2; + $conf[CURLOPT_SSL_VERIFYPEER] = true; + if (is_string($options['verify'])) { + // Throw an error if the file/folder/link path is not valid or doesn't exist. + if (!file_exists($options['verify'])) { + throw new \InvalidArgumentException( + "SSL CA bundle not found: {$options['verify']}" + ); + } + // If it's a directory or a link to a directory use CURLOPT_CAPATH. + // If not, it's probably a file, or a link to a file, so use CURLOPT_CAINFO. + if (is_dir($options['verify']) || + (is_link($options['verify']) && is_dir(readlink($options['verify'])))) { + $conf[CURLOPT_CAPATH] = $options['verify']; + } else { + $conf[CURLOPT_CAINFO] = $options['verify']; + } + } + } + } + + if (!empty($options['decode_content'])) { + $accept = $easy->request->getHeaderLine('Accept-Encoding'); + if ($accept) { + $conf[CURLOPT_ENCODING] = $accept; + } else { + $conf[CURLOPT_ENCODING] = ''; + // Don't let curl send the header over the wire + $conf[CURLOPT_HTTPHEADER][] = 'Accept-Encoding:'; + } + } + + if (isset($options['sink'])) { + $sink = $options['sink']; + if (!is_string($sink)) { + $sink = \GuzzleHttp\Psr7\stream_for($sink); + } elseif (!is_dir(dirname($sink))) { + // Ensure that the directory exists before failing in curl. + throw new \RuntimeException(sprintf( + 'Directory %s does not exist for sink value of %s', + dirname($sink), + $sink + )); + } else { + $sink = new LazyOpenStream($sink, 'w+'); + } + $easy->sink = $sink; + $conf[CURLOPT_WRITEFUNCTION] = function ($ch, $write) use ($sink) { + return $sink->write($write); + }; + } else { + // Use a default temp stream if no sink was set. + $conf[CURLOPT_FILE] = fopen('php://temp', 'w+'); + $easy->sink = Psr7\stream_for($conf[CURLOPT_FILE]); + } + $timeoutRequiresNoSignal = false; + if (isset($options['timeout'])) { + $timeoutRequiresNoSignal |= $options['timeout'] < 1; + $conf[CURLOPT_TIMEOUT_MS] = $options['timeout'] * 1000; + } + + // CURL default value is CURL_IPRESOLVE_WHATEVER + if (isset($options['force_ip_resolve'])) { + if ('v4' === $options['force_ip_resolve']) { + $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V4; + } elseif ('v6' === $options['force_ip_resolve']) { + $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V6; + } + } + + if (isset($options['connect_timeout'])) { + $timeoutRequiresNoSignal |= $options['connect_timeout'] < 1; + $conf[CURLOPT_CONNECTTIMEOUT_MS] = $options['connect_timeout'] * 1000; + } + + if ($timeoutRequiresNoSignal && strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { + $conf[CURLOPT_NOSIGNAL] = true; + } + + if (isset($options['proxy'])) { + if (!is_array($options['proxy'])) { + $conf[CURLOPT_PROXY] = $options['proxy']; + } else { + $scheme = $easy->request->getUri()->getScheme(); + if (isset($options['proxy'][$scheme])) { + $host = $easy->request->getUri()->getHost(); + if (!isset($options['proxy']['no']) || + !\GuzzleHttp\is_host_in_noproxy($host, $options['proxy']['no']) + ) { + $conf[CURLOPT_PROXY] = $options['proxy'][$scheme]; + } + } + } + } + + if (isset($options['cert'])) { + $cert = $options['cert']; + if (is_array($cert)) { + $conf[CURLOPT_SSLCERTPASSWD] = $cert[1]; + $cert = $cert[0]; + } + if (!file_exists($cert)) { + throw new \InvalidArgumentException( + "SSL certificate not found: {$cert}" + ); + } + $conf[CURLOPT_SSLCERT] = $cert; + } + + if (isset($options['ssl_key'])) { + if (is_array($options['ssl_key'])) { + if (count($options['ssl_key']) === 2) { + list($sslKey, $conf[CURLOPT_SSLKEYPASSWD]) = $options['ssl_key']; + } else { + list($sslKey) = $options['ssl_key']; + } + } + + $sslKey = isset($sslKey) ? $sslKey: $options['ssl_key']; + + if (!file_exists($sslKey)) { + throw new \InvalidArgumentException( + "SSL private key not found: {$sslKey}" + ); + } + $conf[CURLOPT_SSLKEY] = $sslKey; + } + + if (isset($options['progress'])) { + $progress = $options['progress']; + if (!is_callable($progress)) { + throw new \InvalidArgumentException( + 'progress client option must be callable' + ); + } + $conf[CURLOPT_NOPROGRESS] = false; + $conf[CURLOPT_PROGRESSFUNCTION] = function () use ($progress) { + $args = func_get_args(); + // PHP 5.5 pushed the handle onto the start of the args + if (is_resource($args[0])) { + array_shift($args); + } + call_user_func_array($progress, $args); + }; + } + + if (!empty($options['debug'])) { + $conf[CURLOPT_STDERR] = \GuzzleHttp\debug_resource($options['debug']); + $conf[CURLOPT_VERBOSE] = true; + } + } + + /** + * This function ensures that a response was set on a transaction. If one + * was not set, then the request is retried if possible. This error + * typically means you are sending a payload, curl encountered a + * "Connection died, retrying a fresh connect" error, tried to rewind the + * stream, and then encountered a "necessary data rewind wasn't possible" + * error, causing the request to be sent through curl_multi_info_read() + * without an error status. + */ + private static function retryFailedRewind( + callable $handler, + EasyHandle $easy, + array $ctx + ) { + try { + // Only rewind if the body has been read from. + $body = $easy->request->getBody(); + if ($body->tell() > 0) { + $body->rewind(); + } + } catch (\RuntimeException $e) { + $ctx['error'] = 'The connection unexpectedly failed without ' + . 'providing an error. The request would have been retried, ' + . 'but attempting to rewind the request body failed. ' + . 'Exception: ' . $e; + return self::createRejection($easy, $ctx); + } + + // Retry no more than 3 times before giving up. + if (!isset($easy->options['_curl_retries'])) { + $easy->options['_curl_retries'] = 1; + } elseif ($easy->options['_curl_retries'] == 2) { + $ctx['error'] = 'The cURL request was retried 3 times ' + . 'and did not succeed. The most likely reason for the failure ' + . 'is that cURL was unable to rewind the body of the request ' + . 'and subsequent retries resulted in the same error. Turn on ' + . 'the debug option to see what went wrong. See ' + . 'https://bugs.php.net/bug.php?id=47204 for more information.'; + return self::createRejection($easy, $ctx); + } else { + $easy->options['_curl_retries']++; + } + + return $handler($easy->request, $easy->options); + } + + private function createHeaderFn(EasyHandle $easy) + { + if (isset($easy->options['on_headers'])) { + $onHeaders = $easy->options['on_headers']; + + if (!is_callable($onHeaders)) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + } else { + $onHeaders = null; + } + + return function ($ch, $h) use ( + $onHeaders, + $easy, + &$startingResponse + ) { + $value = trim($h); + if ($value === '') { + $startingResponse = true; + $easy->createResponse(); + if ($onHeaders !== null) { + try { + $onHeaders($easy->response); + } catch (\Exception $e) { + // Associate the exception with the handle and trigger + // a curl header write error by returning 0. + $easy->onHeadersException = $e; + return -1; + } + } + } elseif ($startingResponse) { + $startingResponse = false; + $easy->headers = [$value]; + } else { + $easy->headers[] = $value; + } + return strlen($h); + }; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php b/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php new file mode 100644 index 0000000..b0fc236 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php @@ -0,0 +1,27 @@ +factory = isset($options['handle_factory']) + ? $options['handle_factory'] + : new CurlFactory(3); + } + + public function __invoke(RequestInterface $request, array $options) + { + if (isset($options['delay'])) { + usleep($options['delay'] * 1000); + } + + $easy = $this->factory->create($request, $options); + curl_exec($easy->handle); + $easy->errno = curl_errno($easy->handle); + + return CurlFactory::finish($this, $easy, $this->factory); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php b/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php new file mode 100644 index 0000000..564c95f --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php @@ -0,0 +1,219 @@ +factory = isset($options['handle_factory']) + ? $options['handle_factory'] : new CurlFactory(50); + + if (isset($options['select_timeout'])) { + $this->selectTimeout = $options['select_timeout']; + } elseif ($selectTimeout = getenv('GUZZLE_CURL_SELECT_TIMEOUT')) { + $this->selectTimeout = $selectTimeout; + } else { + $this->selectTimeout = 1; + } + + $this->options = isset($options['options']) ? $options['options'] : []; + } + + public function __get($name) + { + if ($name === '_mh') { + $this->_mh = curl_multi_init(); + + foreach ($this->options as $option => $value) { + // A warning is raised in case of a wrong option. + curl_multi_setopt($this->_mh, $option, $value); + } + + // Further calls to _mh will return the value directly, without entering the + // __get() method at all. + return $this->_mh; + } + + throw new \BadMethodCallException(); + } + + public function __destruct() + { + if (isset($this->_mh)) { + curl_multi_close($this->_mh); + unset($this->_mh); + } + } + + public function __invoke(RequestInterface $request, array $options) + { + $easy = $this->factory->create($request, $options); + $id = (int) $easy->handle; + + $promise = new Promise( + [$this, 'execute'], + function () use ($id) { + return $this->cancel($id); + } + ); + + $this->addRequest(['easy' => $easy, 'deferred' => $promise]); + + return $promise; + } + + /** + * Ticks the curl event loop. + */ + public function tick() + { + // Add any delayed handles if needed. + if ($this->delays) { + $currentTime = Utils::currentTime(); + foreach ($this->delays as $id => $delay) { + if ($currentTime >= $delay) { + unset($this->delays[$id]); + curl_multi_add_handle( + $this->_mh, + $this->handles[$id]['easy']->handle + ); + } + } + } + + // Step through the task queue which may add additional requests. + P\queue()->run(); + + if ($this->active && + curl_multi_select($this->_mh, $this->selectTimeout) === -1 + ) { + // Perform a usleep if a select returns -1. + // See: https://bugs.php.net/bug.php?id=61141 + usleep(250); + } + + while (curl_multi_exec($this->_mh, $this->active) === CURLM_CALL_MULTI_PERFORM); + + $this->processMessages(); + } + + /** + * Runs until all outstanding connections have completed. + */ + public function execute() + { + $queue = P\queue(); + + while ($this->handles || !$queue->isEmpty()) { + // If there are no transfers, then sleep for the next delay + if (!$this->active && $this->delays) { + usleep($this->timeToNext()); + } + $this->tick(); + } + } + + private function addRequest(array $entry) + { + $easy = $entry['easy']; + $id = (int) $easy->handle; + $this->handles[$id] = $entry; + if (empty($easy->options['delay'])) { + curl_multi_add_handle($this->_mh, $easy->handle); + } else { + $this->delays[$id] = Utils::currentTime() + ($easy->options['delay'] / 1000); + } + } + + /** + * Cancels a handle from sending and removes references to it. + * + * @param int $id Handle ID to cancel and remove. + * + * @return bool True on success, false on failure. + */ + private function cancel($id) + { + // Cannot cancel if it has been processed. + if (!isset($this->handles[$id])) { + return false; + } + + $handle = $this->handles[$id]['easy']->handle; + unset($this->delays[$id], $this->handles[$id]); + curl_multi_remove_handle($this->_mh, $handle); + curl_close($handle); + + return true; + } + + private function processMessages() + { + while ($done = curl_multi_info_read($this->_mh)) { + $id = (int) $done['handle']; + curl_multi_remove_handle($this->_mh, $done['handle']); + + if (!isset($this->handles[$id])) { + // Probably was cancelled. + continue; + } + + $entry = $this->handles[$id]; + unset($this->handles[$id], $this->delays[$id]); + $entry['easy']->errno = $done['result']; + $entry['deferred']->resolve( + CurlFactory::finish( + $this, + $entry['easy'], + $this->factory + ) + ); + } + } + + private function timeToNext() + { + $currentTime = Utils::currentTime(); + $nextTime = PHP_INT_MAX; + foreach ($this->delays as $time) { + if ($time < $nextTime) { + $nextTime = $time; + } + } + + return max(0, $nextTime - $currentTime) * 1000000; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php b/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php new file mode 100644 index 0000000..7754e91 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php @@ -0,0 +1,92 @@ +headers)) { + throw new \RuntimeException('No headers have been received'); + } + + // HTTP-version SP status-code SP reason-phrase + $startLine = explode(' ', array_shift($this->headers), 3); + $headers = \GuzzleHttp\headers_from_lines($this->headers); + $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers); + + if (!empty($this->options['decode_content']) + && isset($normalizedKeys['content-encoding']) + ) { + $headers['x-encoded-content-encoding'] + = $headers[$normalizedKeys['content-encoding']]; + unset($headers[$normalizedKeys['content-encoding']]); + if (isset($normalizedKeys['content-length'])) { + $headers['x-encoded-content-length'] + = $headers[$normalizedKeys['content-length']]; + + $bodyLength = (int) $this->sink->getSize(); + if ($bodyLength) { + $headers[$normalizedKeys['content-length']] = $bodyLength; + } else { + unset($headers[$normalizedKeys['content-length']]); + } + } + } + + // Attach a response to the easy handle with the parsed headers. + $this->response = new Response( + $startLine[1], + $headers, + $this->sink, + substr($startLine[0], 5), + isset($startLine[2]) ? (string) $startLine[2] : null + ); + } + + public function __get($name) + { + $msg = $name === 'handle' + ? 'The EasyHandle has been released' + : 'Invalid property: ' . $name; + throw new \BadMethodCallException($msg); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php b/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php new file mode 100644 index 0000000..5b312bc --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php @@ -0,0 +1,195 @@ +onFulfilled = $onFulfilled; + $this->onRejected = $onRejected; + + if ($queue) { + call_user_func_array([$this, 'append'], $queue); + } + } + + public function __invoke(RequestInterface $request, array $options) + { + if (!$this->queue) { + throw new \OutOfBoundsException('Mock queue is empty'); + } + + if (isset($options['delay']) && is_numeric($options['delay'])) { + usleep($options['delay'] * 1000); + } + + $this->lastRequest = $request; + $this->lastOptions = $options; + $response = array_shift($this->queue); + + if (isset($options['on_headers'])) { + if (!is_callable($options['on_headers'])) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + try { + $options['on_headers']($response); + } catch (\Exception $e) { + $msg = 'An error was encountered during the on_headers event'; + $response = new RequestException($msg, $request, $response, $e); + } + } + + if (is_callable($response)) { + $response = call_user_func($response, $request, $options); + } + + $response = $response instanceof \Exception + ? \GuzzleHttp\Promise\rejection_for($response) + : \GuzzleHttp\Promise\promise_for($response); + + return $response->then( + function ($value) use ($request, $options) { + $this->invokeStats($request, $options, $value); + if ($this->onFulfilled) { + call_user_func($this->onFulfilled, $value); + } + if (isset($options['sink'])) { + $contents = (string) $value->getBody(); + $sink = $options['sink']; + + if (is_resource($sink)) { + fwrite($sink, $contents); + } elseif (is_string($sink)) { + file_put_contents($sink, $contents); + } elseif ($sink instanceof \Psr\Http\Message\StreamInterface) { + $sink->write($contents); + } + } + + return $value; + }, + function ($reason) use ($request, $options) { + $this->invokeStats($request, $options, null, $reason); + if ($this->onRejected) { + call_user_func($this->onRejected, $reason); + } + return \GuzzleHttp\Promise\rejection_for($reason); + } + ); + } + + /** + * Adds one or more variadic requests, exceptions, callables, or promises + * to the queue. + */ + public function append() + { + foreach (func_get_args() as $value) { + if ($value instanceof ResponseInterface + || $value instanceof \Exception + || $value instanceof PromiseInterface + || is_callable($value) + ) { + $this->queue[] = $value; + } else { + throw new \InvalidArgumentException('Expected a response or ' + . 'exception. Found ' . \GuzzleHttp\describe_type($value)); + } + } + } + + /** + * Get the last received request. + * + * @return RequestInterface + */ + public function getLastRequest() + { + return $this->lastRequest; + } + + /** + * Get the last received request options. + * + * @return array + */ + public function getLastOptions() + { + return $this->lastOptions; + } + + /** + * Returns the number of remaining items in the queue. + * + * @return int + */ + public function count() + { + return count($this->queue); + } + + public function reset() + { + $this->queue = []; + } + + private function invokeStats( + RequestInterface $request, + array $options, + ResponseInterface $response = null, + $reason = null + ) { + if (isset($options['on_stats'])) { + $transferTime = isset($options['transfer_time']) ? $options['transfer_time'] : 0; + $stats = new TransferStats($request, $response, $transferTime, $reason); + call_user_func($options['on_stats'], $stats); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php b/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php new file mode 100644 index 0000000..f8b00be --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php @@ -0,0 +1,55 @@ +withoutHeader('Expect'); + + // Append a content-length header if body size is zero to match + // cURL's behavior. + if (0 === $request->getBody()->getSize()) { + $request = $request->withHeader('Content-Length', '0'); + } + + return $this->createResponse( + $request, + $options, + $this->createStream($request, $options), + $startTime + ); + } catch (\InvalidArgumentException $e) { + throw $e; + } catch (\Exception $e) { + // Determine if the error was a networking error. + $message = $e->getMessage(); + // This list can probably get more comprehensive. + if (strpos($message, 'getaddrinfo') // DNS lookup failed + || strpos($message, 'Connection refused') + || strpos($message, "couldn't connect to host") // error on HHVM + || strpos($message, "connection attempt failed") + ) { + $e = new ConnectException($e->getMessage(), $request, $e); + } + $e = RequestException::wrapException($request, $e); + $this->invokeStats($options, $request, $startTime, null, $e); + + return \GuzzleHttp\Promise\rejection_for($e); + } + } + + private function invokeStats( + array $options, + RequestInterface $request, + $startTime, + ResponseInterface $response = null, + $error = null + ) { + if (isset($options['on_stats'])) { + $stats = new TransferStats( + $request, + $response, + Utils::currentTime() - $startTime, + $error, + [] + ); + call_user_func($options['on_stats'], $stats); + } + } + + private function createResponse( + RequestInterface $request, + array $options, + $stream, + $startTime + ) { + $hdrs = $this->lastHeaders; + $this->lastHeaders = []; + $parts = explode(' ', array_shift($hdrs), 3); + $ver = explode('/', $parts[0])[1]; + $status = $parts[1]; + $reason = isset($parts[2]) ? $parts[2] : null; + $headers = \GuzzleHttp\headers_from_lines($hdrs); + list($stream, $headers) = $this->checkDecode($options, $headers, $stream); + $stream = Psr7\stream_for($stream); + $sink = $stream; + + if (strcasecmp('HEAD', $request->getMethod())) { + $sink = $this->createSink($stream, $options); + } + + $response = new Psr7\Response($status, $headers, $sink, $ver, $reason); + + if (isset($options['on_headers'])) { + try { + $options['on_headers']($response); + } catch (\Exception $e) { + $msg = 'An error was encountered during the on_headers event'; + $ex = new RequestException($msg, $request, $response, $e); + return \GuzzleHttp\Promise\rejection_for($ex); + } + } + + // Do not drain when the request is a HEAD request because they have + // no body. + if ($sink !== $stream) { + $this->drain( + $stream, + $sink, + $response->getHeaderLine('Content-Length') + ); + } + + $this->invokeStats($options, $request, $startTime, $response, null); + + return new FulfilledPromise($response); + } + + private function createSink(StreamInterface $stream, array $options) + { + if (!empty($options['stream'])) { + return $stream; + } + + $sink = isset($options['sink']) + ? $options['sink'] + : fopen('php://temp', 'r+'); + + return is_string($sink) + ? new Psr7\LazyOpenStream($sink, 'w+') + : Psr7\stream_for($sink); + } + + private function checkDecode(array $options, array $headers, $stream) + { + // Automatically decode responses when instructed. + if (!empty($options['decode_content'])) { + $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers); + if (isset($normalizedKeys['content-encoding'])) { + $encoding = $headers[$normalizedKeys['content-encoding']]; + if ($encoding[0] === 'gzip' || $encoding[0] === 'deflate') { + $stream = new Psr7\InflateStream( + Psr7\stream_for($stream) + ); + $headers['x-encoded-content-encoding'] + = $headers[$normalizedKeys['content-encoding']]; + // Remove content-encoding header + unset($headers[$normalizedKeys['content-encoding']]); + // Fix content-length header + if (isset($normalizedKeys['content-length'])) { + $headers['x-encoded-content-length'] + = $headers[$normalizedKeys['content-length']]; + + $length = (int) $stream->getSize(); + if ($length === 0) { + unset($headers[$normalizedKeys['content-length']]); + } else { + $headers[$normalizedKeys['content-length']] = [$length]; + } + } + } + } + } + + return [$stream, $headers]; + } + + /** + * Drains the source stream into the "sink" client option. + * + * @param StreamInterface $source + * @param StreamInterface $sink + * @param string $contentLength Header specifying the amount of + * data to read. + * + * @return StreamInterface + * @throws \RuntimeException when the sink option is invalid. + */ + private function drain( + StreamInterface $source, + StreamInterface $sink, + $contentLength + ) { + // If a content-length header is provided, then stop reading once + // that number of bytes has been read. This can prevent infinitely + // reading from a stream when dealing with servers that do not honor + // Connection: Close headers. + Psr7\copy_to_stream( + $source, + $sink, + (strlen($contentLength) > 0 && (int) $contentLength > 0) ? (int) $contentLength : -1 + ); + + $sink->seek(0); + $source->close(); + + return $sink; + } + + /** + * Create a resource and check to ensure it was created successfully + * + * @param callable $callback Callable that returns stream resource + * + * @return resource + * @throws \RuntimeException on error + */ + private function createResource(callable $callback) + { + $errors = null; + set_error_handler(function ($_, $msg, $file, $line) use (&$errors) { + $errors[] = [ + 'message' => $msg, + 'file' => $file, + 'line' => $line + ]; + return true; + }); + + $resource = $callback(); + restore_error_handler(); + + if (!$resource) { + $message = 'Error creating resource: '; + foreach ($errors as $err) { + foreach ($err as $key => $value) { + $message .= "[$key] $value" . PHP_EOL; + } + } + throw new \RuntimeException(trim($message)); + } + + return $resource; + } + + private function createStream(RequestInterface $request, array $options) + { + static $methods; + if (!$methods) { + $methods = array_flip(get_class_methods(__CLASS__)); + } + + // HTTP/1.1 streams using the PHP stream wrapper require a + // Connection: close header + if ($request->getProtocolVersion() == '1.1' + && !$request->hasHeader('Connection') + ) { + $request = $request->withHeader('Connection', 'close'); + } + + // Ensure SSL is verified by default + if (!isset($options['verify'])) { + $options['verify'] = true; + } + + $params = []; + $context = $this->getDefaultContext($request); + + if (isset($options['on_headers']) && !is_callable($options['on_headers'])) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + + if (!empty($options)) { + foreach ($options as $key => $value) { + $method = "add_{$key}"; + if (isset($methods[$method])) { + $this->{$method}($request, $context, $value, $params); + } + } + } + + if (isset($options['stream_context'])) { + if (!is_array($options['stream_context'])) { + throw new \InvalidArgumentException('stream_context must be an array'); + } + $context = array_replace_recursive( + $context, + $options['stream_context'] + ); + } + + // Microsoft NTLM authentication only supported with curl handler + if (isset($options['auth']) + && is_array($options['auth']) + && isset($options['auth'][2]) + && 'ntlm' == $options['auth'][2] + ) { + throw new \InvalidArgumentException('Microsoft NTLM authentication only supported with curl handler'); + } + + $uri = $this->resolveHost($request, $options); + + $context = $this->createResource( + function () use ($context, $params) { + return stream_context_create($context, $params); + } + ); + + return $this->createResource( + function () use ($uri, &$http_response_header, $context, $options) { + $resource = fopen((string) $uri, 'r', null, $context); + $this->lastHeaders = $http_response_header; + + if (isset($options['read_timeout'])) { + $readTimeout = $options['read_timeout']; + $sec = (int) $readTimeout; + $usec = ($readTimeout - $sec) * 100000; + stream_set_timeout($resource, $sec, $usec); + } + + return $resource; + } + ); + } + + private function resolveHost(RequestInterface $request, array $options) + { + $uri = $request->getUri(); + + if (isset($options['force_ip_resolve']) && !filter_var($uri->getHost(), FILTER_VALIDATE_IP)) { + if ('v4' === $options['force_ip_resolve']) { + $records = dns_get_record($uri->getHost(), DNS_A); + if (!isset($records[0]['ip'])) { + throw new ConnectException( + sprintf( + "Could not resolve IPv4 address for host '%s'", + $uri->getHost() + ), + $request + ); + } + $uri = $uri->withHost($records[0]['ip']); + } elseif ('v6' === $options['force_ip_resolve']) { + $records = dns_get_record($uri->getHost(), DNS_AAAA); + if (!isset($records[0]['ipv6'])) { + throw new ConnectException( + sprintf( + "Could not resolve IPv6 address for host '%s'", + $uri->getHost() + ), + $request + ); + } + $uri = $uri->withHost('[' . $records[0]['ipv6'] . ']'); + } + } + + return $uri; + } + + private function getDefaultContext(RequestInterface $request) + { + $headers = ''; + foreach ($request->getHeaders() as $name => $value) { + foreach ($value as $val) { + $headers .= "$name: $val\r\n"; + } + } + + $context = [ + 'http' => [ + 'method' => $request->getMethod(), + 'header' => $headers, + 'protocol_version' => $request->getProtocolVersion(), + 'ignore_errors' => true, + 'follow_location' => 0, + ], + ]; + + $body = (string) $request->getBody(); + + if (!empty($body)) { + $context['http']['content'] = $body; + // Prevent the HTTP handler from adding a Content-Type header. + if (!$request->hasHeader('Content-Type')) { + $context['http']['header'] .= "Content-Type:\r\n"; + } + } + + $context['http']['header'] = rtrim($context['http']['header']); + + return $context; + } + + private function add_proxy(RequestInterface $request, &$options, $value, &$params) + { + if (!is_array($value)) { + $options['http']['proxy'] = $value; + } else { + $scheme = $request->getUri()->getScheme(); + if (isset($value[$scheme])) { + if (!isset($value['no']) + || !\GuzzleHttp\is_host_in_noproxy( + $request->getUri()->getHost(), + $value['no'] + ) + ) { + $options['http']['proxy'] = $value[$scheme]; + } + } + } + } + + private function add_timeout(RequestInterface $request, &$options, $value, &$params) + { + if ($value > 0) { + $options['http']['timeout'] = $value; + } + } + + private function add_verify(RequestInterface $request, &$options, $value, &$params) + { + if ($value === true) { + // PHP 5.6 or greater will find the system cert by default. When + // < 5.6, use the Guzzle bundled cacert. + if (PHP_VERSION_ID < 50600) { + $options['ssl']['cafile'] = \GuzzleHttp\default_ca_bundle(); + } + } elseif (is_string($value)) { + $options['ssl']['cafile'] = $value; + if (!file_exists($value)) { + throw new \RuntimeException("SSL CA bundle not found: $value"); + } + } elseif ($value === false) { + $options['ssl']['verify_peer'] = false; + $options['ssl']['verify_peer_name'] = false; + return; + } else { + throw new \InvalidArgumentException('Invalid verify request option'); + } + + $options['ssl']['verify_peer'] = true; + $options['ssl']['verify_peer_name'] = true; + $options['ssl']['allow_self_signed'] = false; + } + + private function add_cert(RequestInterface $request, &$options, $value, &$params) + { + if (is_array($value)) { + $options['ssl']['passphrase'] = $value[1]; + $value = $value[0]; + } + + if (!file_exists($value)) { + throw new \RuntimeException("SSL certificate not found: {$value}"); + } + + $options['ssl']['local_cert'] = $value; + } + + private function add_progress(RequestInterface $request, &$options, $value, &$params) + { + $this->addNotification( + $params, + function ($code, $a, $b, $c, $transferred, $total) use ($value) { + if ($code == STREAM_NOTIFY_PROGRESS) { + $value($total, $transferred, null, null); + } + } + ); + } + + private function add_debug(RequestInterface $request, &$options, $value, &$params) + { + if ($value === false) { + return; + } + + static $map = [ + STREAM_NOTIFY_CONNECT => 'CONNECT', + STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED', + STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT', + STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS', + STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS', + STREAM_NOTIFY_REDIRECTED => 'REDIRECTED', + STREAM_NOTIFY_PROGRESS => 'PROGRESS', + STREAM_NOTIFY_FAILURE => 'FAILURE', + STREAM_NOTIFY_COMPLETED => 'COMPLETED', + STREAM_NOTIFY_RESOLVE => 'RESOLVE', + ]; + static $args = ['severity', 'message', 'message_code', + 'bytes_transferred', 'bytes_max']; + + $value = \GuzzleHttp\debug_resource($value); + $ident = $request->getMethod() . ' ' . $request->getUri()->withFragment(''); + $this->addNotification( + $params, + function () use ($ident, $value, $map, $args) { + $passed = func_get_args(); + $code = array_shift($passed); + fprintf($value, '<%s> [%s] ', $ident, $map[$code]); + foreach (array_filter($passed) as $i => $v) { + fwrite($value, $args[$i] . ': "' . $v . '" '); + } + fwrite($value, "\n"); + } + ); + } + + private function addNotification(array &$params, callable $notify) + { + // Wrap the existing function if needed. + if (!isset($params['notification'])) { + $params['notification'] = $notify; + } else { + $params['notification'] = $this->callArray([ + $params['notification'], + $notify + ]); + } + } + + private function callArray(array $functions) + { + return function () use ($functions) { + $args = func_get_args(); + foreach ($functions as $fn) { + call_user_func_array($fn, $args); + } + }; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/HandlerStack.php b/vendor/guzzlehttp/guzzle/src/HandlerStack.php new file mode 100644 index 0000000..6a49cc0 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/HandlerStack.php @@ -0,0 +1,277 @@ +push(Middleware::httpErrors(), 'http_errors'); + $stack->push(Middleware::redirect(), 'allow_redirects'); + $stack->push(Middleware::cookies(), 'cookies'); + $stack->push(Middleware::prepareBody(), 'prepare_body'); + + return $stack; + } + + /** + * @param callable $handler Underlying HTTP handler. + */ + public function __construct(callable $handler = null) + { + $this->handler = $handler; + } + + /** + * Invokes the handler stack as a composed handler + * + * @param RequestInterface $request + * @param array $options + * + * @return ResponseInterface|PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) + { + $handler = $this->resolve(); + + return $handler($request, $options); + } + + /** + * Dumps a string representation of the stack. + * + * @return string + */ + public function __toString() + { + $depth = 0; + $stack = []; + if ($this->handler) { + $stack[] = "0) Handler: " . $this->debugCallable($this->handler); + } + + $result = ''; + foreach (array_reverse($this->stack) as $tuple) { + $depth++; + $str = "{$depth}) Name: '{$tuple[1]}', "; + $str .= "Function: " . $this->debugCallable($tuple[0]); + $result = "> {$str}\n{$result}"; + $stack[] = $str; + } + + foreach (array_keys($stack) as $k) { + $result .= "< {$stack[$k]}\n"; + } + + return $result; + } + + /** + * Set the HTTP handler that actually returns a promise. + * + * @param callable $handler Accepts a request and array of options and + * returns a Promise. + */ + public function setHandler(callable $handler) + { + $this->handler = $handler; + $this->cached = null; + } + + /** + * Returns true if the builder has a handler. + * + * @return bool + */ + public function hasHandler() + { + return (bool) $this->handler; + } + + /** + * Unshift a middleware to the bottom of the stack. + * + * @param callable $middleware Middleware function + * @param string $name Name to register for this middleware. + */ + public function unshift(callable $middleware, $name = null) + { + array_unshift($this->stack, [$middleware, $name]); + $this->cached = null; + } + + /** + * Push a middleware to the top of the stack. + * + * @param callable $middleware Middleware function + * @param string $name Name to register for this middleware. + */ + public function push(callable $middleware, $name = '') + { + $this->stack[] = [$middleware, $name]; + $this->cached = null; + } + + /** + * Add a middleware before another middleware by name. + * + * @param string $findName Middleware to find + * @param callable $middleware Middleware function + * @param string $withName Name to register for this middleware. + */ + public function before($findName, callable $middleware, $withName = '') + { + $this->splice($findName, $withName, $middleware, true); + } + + /** + * Add a middleware after another middleware by name. + * + * @param string $findName Middleware to find + * @param callable $middleware Middleware function + * @param string $withName Name to register for this middleware. + */ + public function after($findName, callable $middleware, $withName = '') + { + $this->splice($findName, $withName, $middleware, false); + } + + /** + * Remove a middleware by instance or name from the stack. + * + * @param callable|string $remove Middleware to remove by instance or name. + */ + public function remove($remove) + { + $this->cached = null; + $idx = is_callable($remove) ? 0 : 1; + $this->stack = array_values(array_filter( + $this->stack, + function ($tuple) use ($idx, $remove) { + return $tuple[$idx] !== $remove; + } + )); + } + + /** + * Compose the middleware and handler into a single callable function. + * + * @return callable + */ + public function resolve() + { + if (!$this->cached) { + if (!($prev = $this->handler)) { + throw new \LogicException('No handler has been specified'); + } + + foreach (array_reverse($this->stack) as $fn) { + $prev = $fn[0]($prev); + } + + $this->cached = $prev; + } + + return $this->cached; + } + + /** + * @param string $name + * @return int + */ + private function findByName($name) + { + foreach ($this->stack as $k => $v) { + if ($v[1] === $name) { + return $k; + } + } + + throw new \InvalidArgumentException("Middleware not found: $name"); + } + + /** + * Splices a function into the middleware list at a specific position. + * + * @param string $findName + * @param string $withName + * @param callable $middleware + * @param bool $before + */ + private function splice($findName, $withName, callable $middleware, $before) + { + $this->cached = null; + $idx = $this->findByName($findName); + $tuple = [$middleware, $withName]; + + if ($before) { + if ($idx === 0) { + array_unshift($this->stack, $tuple); + } else { + $replacement = [$tuple, $this->stack[$idx]]; + array_splice($this->stack, $idx, 1, $replacement); + } + } elseif ($idx === count($this->stack) - 1) { + $this->stack[] = $tuple; + } else { + $replacement = [$this->stack[$idx], $tuple]; + array_splice($this->stack, $idx, 1, $replacement); + } + } + + /** + * Provides a debug string for a given callable. + * + * @param array|callable $fn Function to write as a string. + * + * @return string + */ + private function debugCallable($fn) + { + if (is_string($fn)) { + return "callable({$fn})"; + } + + if (is_array($fn)) { + return is_string($fn[0]) + ? "callable({$fn[0]}::{$fn[1]})" + : "callable(['" . get_class($fn[0]) . "', '{$fn[1]}'])"; + } + + return 'callable(' . spl_object_hash($fn) . ')'; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/MessageFormatter.php b/vendor/guzzlehttp/guzzle/src/MessageFormatter.php new file mode 100644 index 0000000..dc36bb5 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/MessageFormatter.php @@ -0,0 +1,185 @@ +>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}"; + const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}'; + + /** @var string Template used to format log messages */ + private $template; + + /** + * @param string $template Log message template + */ + public function __construct($template = self::CLF) + { + $this->template = $template ?: self::CLF; + } + + /** + * Returns a formatted message string. + * + * @param RequestInterface $request Request that was sent + * @param ResponseInterface $response Response that was received + * @param \Exception $error Exception that was received + * + * @return string + */ + public function format( + RequestInterface $request, + ResponseInterface $response = null, + \Exception $error = null + ) { + $cache = []; + + return preg_replace_callback( + '/{\s*([A-Za-z_\-\.0-9]+)\s*}/', + function (array $matches) use ($request, $response, $error, &$cache) { + if (isset($cache[$matches[1]])) { + return $cache[$matches[1]]; + } + + $result = ''; + switch ($matches[1]) { + case 'request': + $result = Psr7\str($request); + break; + case 'response': + $result = $response ? Psr7\str($response) : ''; + break; + case 'req_headers': + $result = trim($request->getMethod() + . ' ' . $request->getRequestTarget()) + . ' HTTP/' . $request->getProtocolVersion() . "\r\n" + . $this->headers($request); + break; + case 'res_headers': + $result = $response ? + sprintf( + 'HTTP/%s %d %s', + $response->getProtocolVersion(), + $response->getStatusCode(), + $response->getReasonPhrase() + ) . "\r\n" . $this->headers($response) + : 'NULL'; + break; + case 'req_body': + $result = $request->getBody(); + break; + case 'res_body': + $result = $response ? $response->getBody() : 'NULL'; + break; + case 'ts': + case 'date_iso_8601': + $result = gmdate('c'); + break; + case 'date_common_log': + $result = date('d/M/Y:H:i:s O'); + break; + case 'method': + $result = $request->getMethod(); + break; + case 'version': + $result = $request->getProtocolVersion(); + break; + case 'uri': + case 'url': + $result = $request->getUri(); + break; + case 'target': + $result = $request->getRequestTarget(); + break; + case 'req_version': + $result = $request->getProtocolVersion(); + break; + case 'res_version': + $result = $response + ? $response->getProtocolVersion() + : 'NULL'; + break; + case 'host': + $result = $request->getHeaderLine('Host'); + break; + case 'hostname': + $result = gethostname(); + break; + case 'code': + $result = $response ? $response->getStatusCode() : 'NULL'; + break; + case 'phrase': + $result = $response ? $response->getReasonPhrase() : 'NULL'; + break; + case 'error': + $result = $error ? $error->getMessage() : 'NULL'; + break; + default: + // handle prefixed dynamic headers + if (strpos($matches[1], 'req_header_') === 0) { + $result = $request->getHeaderLine(substr($matches[1], 11)); + } elseif (strpos($matches[1], 'res_header_') === 0) { + $result = $response + ? $response->getHeaderLine(substr($matches[1], 11)) + : 'NULL'; + } + } + + $cache[$matches[1]] = $result; + return $result; + }, + $this->template + ); + } + + /** + * Get headers from message as string + * + * @return string + */ + private function headers(MessageInterface $message) + { + $result = ''; + foreach ($message->getHeaders() as $name => $values) { + $result .= $name . ': ' . implode(', ', $values) . "\r\n"; + } + + return trim($result); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Middleware.php b/vendor/guzzlehttp/guzzle/src/Middleware.php new file mode 100644 index 0000000..bffc197 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Middleware.php @@ -0,0 +1,254 @@ +withCookieHeader($request); + return $handler($request, $options) + ->then( + function ($response) use ($cookieJar, $request) { + $cookieJar->extractCookies($request, $response); + return $response; + } + ); + }; + }; + } + + /** + * Middleware that throws exceptions for 4xx or 5xx responses when the + * "http_error" request option is set to true. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function httpErrors() + { + return function (callable $handler) { + return function ($request, array $options) use ($handler) { + if (empty($options['http_errors'])) { + return $handler($request, $options); + } + return $handler($request, $options)->then( + function (ResponseInterface $response) use ($request) { + $code = $response->getStatusCode(); + if ($code < 400) { + return $response; + } + throw RequestException::create($request, $response); + } + ); + }; + }; + } + + /** + * Middleware that pushes history data to an ArrayAccess container. + * + * @param array|\ArrayAccess $container Container to hold the history (by reference). + * + * @return callable Returns a function that accepts the next handler. + * @throws \InvalidArgumentException if container is not an array or ArrayAccess. + */ + public static function history(&$container) + { + if (!is_array($container) && !$container instanceof \ArrayAccess) { + throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess'); + } + + return function (callable $handler) use (&$container) { + return function ($request, array $options) use ($handler, &$container) { + return $handler($request, $options)->then( + function ($value) use ($request, &$container, $options) { + $container[] = [ + 'request' => $request, + 'response' => $value, + 'error' => null, + 'options' => $options + ]; + return $value; + }, + function ($reason) use ($request, &$container, $options) { + $container[] = [ + 'request' => $request, + 'response' => null, + 'error' => $reason, + 'options' => $options + ]; + return \GuzzleHttp\Promise\rejection_for($reason); + } + ); + }; + }; + } + + /** + * Middleware that invokes a callback before and after sending a request. + * + * The provided listener cannot modify or alter the response. It simply + * "taps" into the chain to be notified before returning the promise. The + * before listener accepts a request and options array, and the after + * listener accepts a request, options array, and response promise. + * + * @param callable $before Function to invoke before forwarding the request. + * @param callable $after Function invoked after forwarding. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function tap(callable $before = null, callable $after = null) + { + return function (callable $handler) use ($before, $after) { + return function ($request, array $options) use ($handler, $before, $after) { + if ($before) { + $before($request, $options); + } + $response = $handler($request, $options); + if ($after) { + $after($request, $options, $response); + } + return $response; + }; + }; + } + + /** + * Middleware that handles request redirects. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function redirect() + { + return function (callable $handler) { + return new RedirectMiddleware($handler); + }; + } + + /** + * Middleware that retries requests based on the boolean result of + * invoking the provided "decider" function. + * + * If no delay function is provided, a simple implementation of exponential + * backoff will be utilized. + * + * @param callable $decider Function that accepts the number of retries, + * a request, [response], and [exception] and + * returns true if the request is to be retried. + * @param callable $delay Function that accepts the number of retries and + * returns the number of milliseconds to delay. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function retry(callable $decider, callable $delay = null) + { + return function (callable $handler) use ($decider, $delay) { + return new RetryMiddleware($decider, $handler, $delay); + }; + } + + /** + * Middleware that logs requests, responses, and errors using a message + * formatter. + * + * @param LoggerInterface $logger Logs messages. + * @param MessageFormatter $formatter Formatter used to create message strings. + * @param string $logLevel Level at which to log requests. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function log(LoggerInterface $logger, MessageFormatter $formatter, $logLevel = 'info' /* \Psr\Log\LogLevel::INFO */) + { + return function (callable $handler) use ($logger, $formatter, $logLevel) { + return function ($request, array $options) use ($handler, $logger, $formatter, $logLevel) { + return $handler($request, $options)->then( + function ($response) use ($logger, $request, $formatter, $logLevel) { + $message = $formatter->format($request, $response); + $logger->log($logLevel, $message); + return $response; + }, + function ($reason) use ($logger, $request, $formatter) { + $response = $reason instanceof RequestException + ? $reason->getResponse() + : null; + $message = $formatter->format($request, $response, $reason); + $logger->notice($message); + return \GuzzleHttp\Promise\rejection_for($reason); + } + ); + }; + }; + } + + /** + * This middleware adds a default content-type if possible, a default + * content-length or transfer-encoding header, and the expect header. + * + * @return callable + */ + public static function prepareBody() + { + return function (callable $handler) { + return new PrepareBodyMiddleware($handler); + }; + } + + /** + * Middleware that applies a map function to the request before passing to + * the next handler. + * + * @param callable $fn Function that accepts a RequestInterface and returns + * a RequestInterface. + * @return callable + */ + public static function mapRequest(callable $fn) + { + return function (callable $handler) use ($fn) { + return function ($request, array $options) use ($handler, $fn) { + return $handler($fn($request), $options); + }; + }; + } + + /** + * Middleware that applies a map function to the resolved promise's + * response. + * + * @param callable $fn Function that accepts a ResponseInterface and + * returns a ResponseInterface. + * @return callable + */ + public static function mapResponse(callable $fn) + { + return function (callable $handler) use ($fn) { + return function ($request, array $options) use ($handler, $fn) { + return $handler($request, $options)->then($fn); + }; + }; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Pool.php b/vendor/guzzlehttp/guzzle/src/Pool.php new file mode 100644 index 0000000..5838db4 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Pool.php @@ -0,0 +1,134 @@ + $rfn) { + if ($rfn instanceof RequestInterface) { + yield $key => $client->sendAsync($rfn, $opts); + } elseif (is_callable($rfn)) { + yield $key => $rfn($opts); + } else { + throw new \InvalidArgumentException('Each value yielded by ' + . 'the iterator must be a Psr7\Http\Message\RequestInterface ' + . 'or a callable that returns a promise that fulfills ' + . 'with a Psr7\Message\Http\ResponseInterface object.'); + } + } + }; + + $this->each = new EachPromise($requests(), $config); + } + + /** + * Get promise + * + * @return PromiseInterface + */ + public function promise() + { + return $this->each->promise(); + } + + /** + * Sends multiple requests concurrently and returns an array of responses + * and exceptions that uses the same ordering as the provided requests. + * + * IMPORTANT: This method keeps every request and response in memory, and + * as such, is NOT recommended when sending a large number or an + * indeterminate number of requests concurrently. + * + * @param ClientInterface $client Client used to send the requests + * @param array|\Iterator $requests Requests to send concurrently. + * @param array $options Passes through the options available in + * {@see GuzzleHttp\Pool::__construct} + * + * @return array Returns an array containing the response or an exception + * in the same order that the requests were sent. + * @throws \InvalidArgumentException if the event format is incorrect. + */ + public static function batch( + ClientInterface $client, + $requests, + array $options = [] + ) { + $res = []; + self::cmpCallback($options, 'fulfilled', $res); + self::cmpCallback($options, 'rejected', $res); + $pool = new static($client, $requests, $options); + $pool->promise()->wait(); + ksort($res); + + return $res; + } + + /** + * Execute callback(s) + * + * @return void + */ + private static function cmpCallback(array &$options, $name, array &$results) + { + if (!isset($options[$name])) { + $options[$name] = function ($v, $k) use (&$results) { + $results[$k] = $v; + }; + } else { + $currentFn = $options[$name]; + $options[$name] = function ($v, $k) use (&$results, $currentFn) { + $currentFn($v, $k); + $results[$k] = $v; + }; + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php b/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php new file mode 100644 index 0000000..568a1e9 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php @@ -0,0 +1,111 @@ +nextHandler = $nextHandler; + } + + /** + * @param RequestInterface $request + * @param array $options + * + * @return PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) + { + $fn = $this->nextHandler; + + // Don't do anything if the request has no body. + if ($request->getBody()->getSize() === 0) { + return $fn($request, $options); + } + + $modify = []; + + // Add a default content-type if possible. + if (!$request->hasHeader('Content-Type')) { + if ($uri = $request->getBody()->getMetadata('uri')) { + if ($type = Psr7\mimetype_from_filename($uri)) { + $modify['set_headers']['Content-Type'] = $type; + } + } + } + + // Add a default content-length or transfer-encoding header. + if (!$request->hasHeader('Content-Length') + && !$request->hasHeader('Transfer-Encoding') + ) { + $size = $request->getBody()->getSize(); + if ($size !== null) { + $modify['set_headers']['Content-Length'] = $size; + } else { + $modify['set_headers']['Transfer-Encoding'] = 'chunked'; + } + } + + // Add the expect header if needed. + $this->addExpectHeader($request, $options, $modify); + + return $fn(Psr7\modify_request($request, $modify), $options); + } + + /** + * Add expect header + * + * @return void + */ + private function addExpectHeader( + RequestInterface $request, + array $options, + array &$modify + ) { + // Determine if the Expect header should be used + if ($request->hasHeader('Expect')) { + return; + } + + $expect = isset($options['expect']) ? $options['expect'] : null; + + // Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0 + if ($expect === false || $request->getProtocolVersion() < 1.1) { + return; + } + + // The expect header is unconditionally enabled + if ($expect === true) { + $modify['set_headers']['Expect'] = '100-Continue'; + return; + } + + // By default, send the expect header when the payload is > 1mb + if ($expect === null) { + $expect = 1048576; + } + + // Always add if the body cannot be rewound, the size cannot be + // determined, or the size is greater than the cutoff threshold + $body = $request->getBody(); + $size = $body->getSize(); + + if ($size === null || $size >= (int) $expect || !$body->isSeekable()) { + $modify['set_headers']['Expect'] = '100-Continue'; + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php b/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php new file mode 100644 index 0000000..e4644b7 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php @@ -0,0 +1,255 @@ + 5, + 'protocols' => ['http', 'https'], + 'strict' => false, + 'referer' => false, + 'track_redirects' => false, + ]; + + /** @var callable */ + private $nextHandler; + + /** + * @param callable $nextHandler Next handler to invoke. + */ + public function __construct(callable $nextHandler) + { + $this->nextHandler = $nextHandler; + } + + /** + * @param RequestInterface $request + * @param array $options + * + * @return PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) + { + $fn = $this->nextHandler; + + if (empty($options['allow_redirects'])) { + return $fn($request, $options); + } + + if ($options['allow_redirects'] === true) { + $options['allow_redirects'] = self::$defaultSettings; + } elseif (!is_array($options['allow_redirects'])) { + throw new \InvalidArgumentException('allow_redirects must be true, false, or array'); + } else { + // Merge the default settings with the provided settings + $options['allow_redirects'] += self::$defaultSettings; + } + + if (empty($options['allow_redirects']['max'])) { + return $fn($request, $options); + } + + return $fn($request, $options) + ->then(function (ResponseInterface $response) use ($request, $options) { + return $this->checkRedirect($request, $options, $response); + }); + } + + /** + * @param RequestInterface $request + * @param array $options + * @param ResponseInterface $response + * + * @return ResponseInterface|PromiseInterface + */ + public function checkRedirect( + RequestInterface $request, + array $options, + ResponseInterface $response + ) { + if (substr($response->getStatusCode(), 0, 1) != '3' + || !$response->hasHeader('Location') + ) { + return $response; + } + + $this->guardMax($request, $options); + $nextRequest = $this->modifyRequest($request, $options, $response); + + if (isset($options['allow_redirects']['on_redirect'])) { + call_user_func( + $options['allow_redirects']['on_redirect'], + $request, + $response, + $nextRequest->getUri() + ); + } + + /** @var PromiseInterface|ResponseInterface $promise */ + $promise = $this($nextRequest, $options); + + // Add headers to be able to track history of redirects. + if (!empty($options['allow_redirects']['track_redirects'])) { + return $this->withTracking( + $promise, + (string) $nextRequest->getUri(), + $response->getStatusCode() + ); + } + + return $promise; + } + + /** + * Enable tracking on promise. + * + * @return PromiseInterface + */ + private function withTracking(PromiseInterface $promise, $uri, $statusCode) + { + return $promise->then( + function (ResponseInterface $response) use ($uri, $statusCode) { + // Note that we are pushing to the front of the list as this + // would be an earlier response than what is currently present + // in the history header. + $historyHeader = $response->getHeader(self::HISTORY_HEADER); + $statusHeader = $response->getHeader(self::STATUS_HISTORY_HEADER); + array_unshift($historyHeader, $uri); + array_unshift($statusHeader, $statusCode); + return $response->withHeader(self::HISTORY_HEADER, $historyHeader) + ->withHeader(self::STATUS_HISTORY_HEADER, $statusHeader); + } + ); + } + + /** + * Check for too many redirects + * + * @return void + * + * @throws TooManyRedirectsException Too many redirects. + */ + private function guardMax(RequestInterface $request, array &$options) + { + $current = isset($options['__redirect_count']) + ? $options['__redirect_count'] + : 0; + $options['__redirect_count'] = $current + 1; + $max = $options['allow_redirects']['max']; + + if ($options['__redirect_count'] > $max) { + throw new TooManyRedirectsException( + "Will not follow more than {$max} redirects", + $request + ); + } + } + + /** + * @param RequestInterface $request + * @param array $options + * @param ResponseInterface $response + * + * @return RequestInterface + */ + public function modifyRequest( + RequestInterface $request, + array $options, + ResponseInterface $response + ) { + // Request modifications to apply. + $modify = []; + $protocols = $options['allow_redirects']['protocols']; + + // Use a GET request if this is an entity enclosing request and we are + // not forcing RFC compliance, but rather emulating what all browsers + // would do. + $statusCode = $response->getStatusCode(); + if ($statusCode == 303 || + ($statusCode <= 302 && !$options['allow_redirects']['strict']) + ) { + $modify['method'] = 'GET'; + $modify['body'] = ''; + } + + $uri = $this->redirectUri($request, $response, $protocols); + if (isset($options['idn_conversion']) && ($options['idn_conversion'] !== false)) { + $idnOptions = ($options['idn_conversion'] === true) ? IDNA_DEFAULT : $options['idn_conversion']; + $uri = Utils::idnUriConvert($uri, $idnOptions); + } + + $modify['uri'] = $uri; + Psr7\rewind_body($request); + + // Add the Referer header if it is told to do so and only + // add the header if we are not redirecting from https to http. + if ($options['allow_redirects']['referer'] + && $modify['uri']->getScheme() === $request->getUri()->getScheme() + ) { + $uri = $request->getUri()->withUserInfo(''); + $modify['set_headers']['Referer'] = (string) $uri; + } else { + $modify['remove_headers'][] = 'Referer'; + } + + // Remove Authorization header if host is different. + if ($request->getUri()->getHost() !== $modify['uri']->getHost()) { + $modify['remove_headers'][] = 'Authorization'; + } + + return Psr7\modify_request($request, $modify); + } + + /** + * Set the appropriate URL on the request based on the location header + * + * @param RequestInterface $request + * @param ResponseInterface $response + * @param array $protocols + * + * @return UriInterface + */ + private function redirectUri( + RequestInterface $request, + ResponseInterface $response, + array $protocols + ) { + $location = Psr7\UriResolver::resolve( + $request->getUri(), + new Psr7\Uri($response->getHeaderLine('Location')) + ); + + // Ensure that the redirect URI is allowed based on the protocols. + if (!in_array($location->getScheme(), $protocols)) { + throw new BadResponseException( + sprintf( + 'Redirect URI, %s, does not use one of the allowed redirect protocols: %s', + $location, + implode(', ', $protocols) + ), + $request, + $response + ); + } + + return $location; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/RequestOptions.php b/vendor/guzzlehttp/guzzle/src/RequestOptions.php new file mode 100644 index 0000000..355f658 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/RequestOptions.php @@ -0,0 +1,263 @@ +decider = $decider; + $this->nextHandler = $nextHandler; + $this->delay = $delay ?: __CLASS__ . '::exponentialDelay'; + } + + /** + * Default exponential backoff delay function. + * + * @param int $retries + * + * @return int milliseconds. + */ + public static function exponentialDelay($retries) + { + return (int) pow(2, $retries - 1) * 1000; + } + + /** + * @param RequestInterface $request + * @param array $options + * + * @return PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) + { + if (!isset($options['retries'])) { + $options['retries'] = 0; + } + + $fn = $this->nextHandler; + return $fn($request, $options) + ->then( + $this->onFulfilled($request, $options), + $this->onRejected($request, $options) + ); + } + + /** + * Execute fulfilled closure + * + * @return mixed + */ + private function onFulfilled(RequestInterface $req, array $options) + { + return function ($value) use ($req, $options) { + if (!call_user_func( + $this->decider, + $options['retries'], + $req, + $value, + null + )) { + return $value; + } + return $this->doRetry($req, $options, $value); + }; + } + + /** + * Execute rejected closure + * + * @return callable + */ + private function onRejected(RequestInterface $req, array $options) + { + return function ($reason) use ($req, $options) { + if (!call_user_func( + $this->decider, + $options['retries'], + $req, + null, + $reason + )) { + return \GuzzleHttp\Promise\rejection_for($reason); + } + return $this->doRetry($req, $options); + }; + } + + /** + * @return self + */ + private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null) + { + $options['delay'] = call_user_func($this->delay, ++$options['retries'], $response); + + return $this($request, $options); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/TransferStats.php b/vendor/guzzlehttp/guzzle/src/TransferStats.php new file mode 100644 index 0000000..87fb3c0 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/TransferStats.php @@ -0,0 +1,126 @@ +request = $request; + $this->response = $response; + $this->transferTime = $transferTime; + $this->handlerErrorData = $handlerErrorData; + $this->handlerStats = $handlerStats; + } + + /** + * @return RequestInterface + */ + public function getRequest() + { + return $this->request; + } + + /** + * Returns the response that was received (if any). + * + * @return ResponseInterface|null + */ + public function getResponse() + { + return $this->response; + } + + /** + * Returns true if a response was received. + * + * @return bool + */ + public function hasResponse() + { + return $this->response !== null; + } + + /** + * Gets handler specific error data. + * + * This might be an exception, a integer representing an error code, or + * anything else. Relying on this value assumes that you know what handler + * you are using. + * + * @return mixed + */ + public function getHandlerErrorData() + { + return $this->handlerErrorData; + } + + /** + * Get the effective URI the request was sent to. + * + * @return UriInterface + */ + public function getEffectiveUri() + { + return $this->request->getUri(); + } + + /** + * Get the estimated time the request was being transferred by the handler. + * + * @return float|null Time in seconds. + */ + public function getTransferTime() + { + return $this->transferTime; + } + + /** + * Gets an array of all of the handler specific transfer data. + * + * @return array + */ + public function getHandlerStats() + { + return $this->handlerStats; + } + + /** + * Get a specific handler statistic from the handler by name. + * + * @param string $stat Handler specific transfer stat to retrieve. + * + * @return mixed|null + */ + public function getHandlerStat($stat) + { + return isset($this->handlerStats[$stat]) + ? $this->handlerStats[$stat] + : null; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/UriTemplate.php b/vendor/guzzlehttp/guzzle/src/UriTemplate.php new file mode 100644 index 0000000..96dcfd0 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/UriTemplate.php @@ -0,0 +1,237 @@ + ['prefix' => '', 'joiner' => ',', 'query' => false], + '+' => ['prefix' => '', 'joiner' => ',', 'query' => false], + '#' => ['prefix' => '#', 'joiner' => ',', 'query' => false], + '.' => ['prefix' => '.', 'joiner' => '.', 'query' => false], + '/' => ['prefix' => '/', 'joiner' => '/', 'query' => false], + ';' => ['prefix' => ';', 'joiner' => ';', 'query' => true], + '?' => ['prefix' => '?', 'joiner' => '&', 'query' => true], + '&' => ['prefix' => '&', 'joiner' => '&', 'query' => true] + ]; + + /** @var array Delimiters */ + private static $delims = [':', '/', '?', '#', '[', ']', '@', '!', '$', + '&', '\'', '(', ')', '*', '+', ',', ';', '=']; + + /** @var array Percent encoded delimiters */ + private static $delimsPct = ['%3A', '%2F', '%3F', '%23', '%5B', '%5D', + '%40', '%21', '%24', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C', + '%3B', '%3D']; + + public function expand($template, array $variables) + { + if (false === strpos($template, '{')) { + return $template; + } + + $this->template = $template; + $this->variables = $variables; + + return preg_replace_callback( + '/\{([^\}]+)\}/', + [$this, 'expandMatch'], + $this->template + ); + } + + /** + * Parse an expression into parts + * + * @param string $expression Expression to parse + * + * @return array Returns an associative array of parts + */ + private function parseExpression($expression) + { + $result = []; + + if (isset(self::$operatorHash[$expression[0]])) { + $result['operator'] = $expression[0]; + $expression = substr($expression, 1); + } else { + $result['operator'] = ''; + } + + foreach (explode(',', $expression) as $value) { + $value = trim($value); + $varspec = []; + if ($colonPos = strpos($value, ':')) { + $varspec['value'] = substr($value, 0, $colonPos); + $varspec['modifier'] = ':'; + $varspec['position'] = (int) substr($value, $colonPos + 1); + } elseif (substr($value, -1) === '*') { + $varspec['modifier'] = '*'; + $varspec['value'] = substr($value, 0, -1); + } else { + $varspec['value'] = (string) $value; + $varspec['modifier'] = ''; + } + $result['values'][] = $varspec; + } + + return $result; + } + + /** + * Process an expansion + * + * @param array $matches Matches met in the preg_replace_callback + * + * @return string Returns the replacement string + */ + private function expandMatch(array $matches) + { + static $rfc1738to3986 = ['+' => '%20', '%7e' => '~']; + + $replacements = []; + $parsed = self::parseExpression($matches[1]); + $prefix = self::$operatorHash[$parsed['operator']]['prefix']; + $joiner = self::$operatorHash[$parsed['operator']]['joiner']; + $useQuery = self::$operatorHash[$parsed['operator']]['query']; + + foreach ($parsed['values'] as $value) { + if (!isset($this->variables[$value['value']])) { + continue; + } + + $variable = $this->variables[$value['value']]; + $actuallyUseQuery = $useQuery; + $expanded = ''; + + if (is_array($variable)) { + $isAssoc = $this->isAssoc($variable); + $kvp = []; + foreach ($variable as $key => $var) { + if ($isAssoc) { + $key = rawurlencode($key); + $isNestedArray = is_array($var); + } else { + $isNestedArray = false; + } + + if (!$isNestedArray) { + $var = rawurlencode($var); + if ($parsed['operator'] === '+' || + $parsed['operator'] === '#' + ) { + $var = $this->decodeReserved($var); + } + } + + if ($value['modifier'] === '*') { + if ($isAssoc) { + if ($isNestedArray) { + // Nested arrays must allow for deeply nested + // structures. + $var = strtr( + http_build_query([$key => $var]), + $rfc1738to3986 + ); + } else { + $var = $key . '=' . $var; + } + } elseif ($key > 0 && $actuallyUseQuery) { + $var = $value['value'] . '=' . $var; + } + } + + $kvp[$key] = $var; + } + + if (empty($variable)) { + $actuallyUseQuery = false; + } elseif ($value['modifier'] === '*') { + $expanded = implode($joiner, $kvp); + if ($isAssoc) { + // Don't prepend the value name when using the explode + // modifier with an associative array. + $actuallyUseQuery = false; + } + } else { + if ($isAssoc) { + // When an associative array is encountered and the + // explode modifier is not set, then the result must be + // a comma separated list of keys followed by their + // respective values. + foreach ($kvp as $k => &$v) { + $v = $k . ',' . $v; + } + } + $expanded = implode(',', $kvp); + } + } else { + if ($value['modifier'] === ':') { + $variable = substr($variable, 0, $value['position']); + } + $expanded = rawurlencode($variable); + if ($parsed['operator'] === '+' || $parsed['operator'] === '#') { + $expanded = $this->decodeReserved($expanded); + } + } + + if ($actuallyUseQuery) { + if (!$expanded && $joiner !== '&') { + $expanded = $value['value']; + } else { + $expanded = $value['value'] . '=' . $expanded; + } + } + + $replacements[] = $expanded; + } + + $ret = implode($joiner, $replacements); + if ($ret && $prefix) { + return $prefix . $ret; + } + + return $ret; + } + + /** + * Determines if an array is associative. + * + * This makes the assumption that input arrays are sequences or hashes. + * This assumption is a tradeoff for accuracy in favor of speed, but it + * should work in almost every case where input is supplied for a URI + * template. + * + * @param array $array Array to check + * + * @return bool + */ + private function isAssoc(array $array) + { + return $array && array_keys($array)[0] !== 0; + } + + /** + * Removes percent encoding on reserved characters (used with + and # + * modifiers). + * + * @param string $string String to fix + * + * @return string + */ + private function decodeReserved($string) + { + return str_replace(self::$delimsPct, self::$delims, $string); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Utils.php b/vendor/guzzlehttp/guzzle/src/Utils.php new file mode 100644 index 0000000..c698acb --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Utils.php @@ -0,0 +1,92 @@ +getHost()) { + $asciiHost = self::idnToAsci($uri->getHost(), $options, $info); + if ($asciiHost === false) { + $errorBitSet = isset($info['errors']) ? $info['errors'] : 0; + + $errorConstants = array_filter(array_keys(get_defined_constants()), function ($name) { + return substr($name, 0, 11) === 'IDNA_ERROR_'; + }); + + $errors = []; + foreach ($errorConstants as $errorConstant) { + if ($errorBitSet & constant($errorConstant)) { + $errors[] = $errorConstant; + } + } + + $errorMessage = 'IDN conversion failed'; + if ($errors) { + $errorMessage .= ' (errors: ' . implode(', ', $errors) . ')'; + } + + throw new InvalidArgumentException($errorMessage); + } else { + if ($uri->getHost() !== $asciiHost) { + // Replace URI only if the ASCII version is different + $uri = $uri->withHost($asciiHost); + } + } + } + + return $uri; + } + + /** + * @param string $domain + * @param int $options + * @param array $info + * + * @return string|false + */ + private static function idnToAsci($domain, $options, &$info = []) + { + if (\preg_match('%^[ -~]+$%', $domain) === 1) { + return $domain; + } + + if (\extension_loaded('intl') && defined('INTL_IDNA_VARIANT_UTS46')) { + return \idn_to_ascii($domain, $options, INTL_IDNA_VARIANT_UTS46, $info); + } + + /* + * The Idn class is marked as @internal. Verify that class and method exists. + */ + if (method_exists(Idn::class, 'idn_to_ascii')) { + return Idn::idn_to_ascii($domain, $options, Idn::INTL_IDNA_VARIANT_UTS46, $info); + } + + throw new \RuntimeException('ext-intl or symfony/polyfill-intl-idn not loaded or too old'); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/functions.php b/vendor/guzzlehttp/guzzle/src/functions.php new file mode 100644 index 0000000..c2afd8c --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/functions.php @@ -0,0 +1,334 @@ +expand($template, $variables); +} + +/** + * Debug function used to describe the provided value type and class. + * + * @param mixed $input + * + * @return string Returns a string containing the type of the variable and + * if a class is provided, the class name. + */ +function describe_type($input) +{ + switch (gettype($input)) { + case 'object': + return 'object(' . get_class($input) . ')'; + case 'array': + return 'array(' . count($input) . ')'; + default: + ob_start(); + var_dump($input); + // normalize float vs double + return str_replace('double(', 'float(', rtrim(ob_get_clean())); + } +} + +/** + * Parses an array of header lines into an associative array of headers. + * + * @param iterable $lines Header lines array of strings in the following + * format: "Name: Value" + * @return array + */ +function headers_from_lines($lines) +{ + $headers = []; + + foreach ($lines as $line) { + $parts = explode(':', $line, 2); + $headers[trim($parts[0])][] = isset($parts[1]) + ? trim($parts[1]) + : null; + } + + return $headers; +} + +/** + * Returns a debug stream based on the provided variable. + * + * @param mixed $value Optional value + * + * @return resource + */ +function debug_resource($value = null) +{ + if (is_resource($value)) { + return $value; + } elseif (defined('STDOUT')) { + return STDOUT; + } + + return fopen('php://output', 'w'); +} + +/** + * Chooses and creates a default handler to use based on the environment. + * + * The returned handler is not wrapped by any default middlewares. + * + * @return callable Returns the best handler for the given system. + * @throws \RuntimeException if no viable Handler is available. + */ +function choose_handler() +{ + $handler = null; + if (function_exists('curl_multi_exec') && function_exists('curl_exec')) { + $handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler()); + } elseif (function_exists('curl_exec')) { + $handler = new CurlHandler(); + } elseif (function_exists('curl_multi_exec')) { + $handler = new CurlMultiHandler(); + } + + if (ini_get('allow_url_fopen')) { + $handler = $handler + ? Proxy::wrapStreaming($handler, new StreamHandler()) + : new StreamHandler(); + } elseif (!$handler) { + throw new \RuntimeException('GuzzleHttp requires cURL, the ' + . 'allow_url_fopen ini setting, or a custom HTTP handler.'); + } + + return $handler; +} + +/** + * Get the default User-Agent string to use with Guzzle + * + * @return string + */ +function default_user_agent() +{ + static $defaultAgent = ''; + + if (!$defaultAgent) { + $defaultAgent = 'GuzzleHttp/' . Client::VERSION; + if (extension_loaded('curl') && function_exists('curl_version')) { + $defaultAgent .= ' curl/' . \curl_version()['version']; + } + $defaultAgent .= ' PHP/' . PHP_VERSION; + } + + return $defaultAgent; +} + +/** + * Returns the default cacert bundle for the current system. + * + * First, the openssl.cafile and curl.cainfo php.ini settings are checked. + * If those settings are not configured, then the common locations for + * bundles found on Red Hat, CentOS, Fedora, Ubuntu, Debian, FreeBSD, OS X + * and Windows are checked. If any of these file locations are found on + * disk, they will be utilized. + * + * Note: the result of this function is cached for subsequent calls. + * + * @return string + * @throws \RuntimeException if no bundle can be found. + */ +function default_ca_bundle() +{ + static $cached = null; + static $cafiles = [ + // Red Hat, CentOS, Fedora (provided by the ca-certificates package) + '/etc/pki/tls/certs/ca-bundle.crt', + // Ubuntu, Debian (provided by the ca-certificates package) + '/etc/ssl/certs/ca-certificates.crt', + // FreeBSD (provided by the ca_root_nss package) + '/usr/local/share/certs/ca-root-nss.crt', + // SLES 12 (provided by the ca-certificates package) + '/var/lib/ca-certificates/ca-bundle.pem', + // OS X provided by homebrew (using the default path) + '/usr/local/etc/openssl/cert.pem', + // Google app engine + '/etc/ca-certificates.crt', + // Windows? + 'C:\\windows\\system32\\curl-ca-bundle.crt', + 'C:\\windows\\curl-ca-bundle.crt', + ]; + + if ($cached) { + return $cached; + } + + if ($ca = ini_get('openssl.cafile')) { + return $cached = $ca; + } + + if ($ca = ini_get('curl.cainfo')) { + return $cached = $ca; + } + + foreach ($cafiles as $filename) { + if (file_exists($filename)) { + return $cached = $filename; + } + } + + throw new \RuntimeException( + <<< EOT +No system CA bundle could be found in any of the the common system locations. +PHP versions earlier than 5.6 are not properly configured to use the system's +CA bundle by default. In order to verify peer certificates, you will need to +supply the path on disk to a certificate bundle to the 'verify' request +option: http://docs.guzzlephp.org/en/latest/clients.html#verify. If you do not +need a specific certificate bundle, then Mozilla provides a commonly used CA +bundle which can be downloaded here (provided by the maintainer of cURL): +https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt. Once +you have a CA bundle available on disk, you can set the 'openssl.cafile' PHP +ini setting to point to the path to the file, allowing you to omit the 'verify' +request option. See http://curl.haxx.se/docs/sslcerts.html for more +information. +EOT + ); +} + +/** + * Creates an associative array of lowercase header names to the actual + * header casing. + * + * @param array $headers + * + * @return array + */ +function normalize_header_keys(array $headers) +{ + $result = []; + foreach (array_keys($headers) as $key) { + $result[strtolower($key)] = $key; + } + + return $result; +} + +/** + * Returns true if the provided host matches any of the no proxy areas. + * + * This method will strip a port from the host if it is present. Each pattern + * can be matched with an exact match (e.g., "foo.com" == "foo.com") or a + * partial match: (e.g., "foo.com" == "baz.foo.com" and ".foo.com" == + * "baz.foo.com", but ".foo.com" != "foo.com"). + * + * Areas are matched in the following cases: + * 1. "*" (without quotes) always matches any hosts. + * 2. An exact match. + * 3. The area starts with "." and the area is the last part of the host. e.g. + * '.mit.edu' will match any host that ends with '.mit.edu'. + * + * @param string $host Host to check against the patterns. + * @param array $noProxyArray An array of host patterns. + * + * @return bool + */ +function is_host_in_noproxy($host, array $noProxyArray) +{ + if (strlen($host) === 0) { + throw new \InvalidArgumentException('Empty host provided'); + } + + // Strip port if present. + if (strpos($host, ':')) { + $host = explode($host, ':', 2)[0]; + } + + foreach ($noProxyArray as $area) { + // Always match on wildcards. + if ($area === '*') { + return true; + } elseif (empty($area)) { + // Don't match on empty values. + continue; + } elseif ($area === $host) { + // Exact matches. + return true; + } else { + // Special match if the area when prefixed with ".". Remove any + // existing leading "." and add a new leading ".". + $area = '.' . ltrim($area, '.'); + if (substr($host, -(strlen($area))) === $area) { + return true; + } + } + } + + return false; +} + +/** + * Wrapper for json_decode that throws when an error occurs. + * + * @param string $json JSON data to parse + * @param bool $assoc When true, returned objects will be converted + * into associative arrays. + * @param int $depth User specified recursion depth. + * @param int $options Bitmask of JSON decode options. + * + * @return mixed + * @throws Exception\InvalidArgumentException if the JSON cannot be decoded. + * @link http://www.php.net/manual/en/function.json-decode.php + */ +function json_decode($json, $assoc = false, $depth = 512, $options = 0) +{ + $data = \json_decode($json, $assoc, $depth, $options); + if (JSON_ERROR_NONE !== json_last_error()) { + throw new Exception\InvalidArgumentException( + 'json_decode error: ' . json_last_error_msg() + ); + } + + return $data; +} + +/** + * Wrapper for JSON encoding that throws when an error occurs. + * + * @param mixed $value The value being encoded + * @param int $options JSON encode option bitmask + * @param int $depth Set the maximum depth. Must be greater than zero. + * + * @return string + * @throws Exception\InvalidArgumentException if the JSON cannot be encoded. + * @link http://www.php.net/manual/en/function.json-encode.php + */ +function json_encode($value, $options = 0, $depth = 512) +{ + $json = \json_encode($value, $options, $depth); + if (JSON_ERROR_NONE !== json_last_error()) { + throw new Exception\InvalidArgumentException( + 'json_encode error: ' . json_last_error_msg() + ); + } + + return $json; +} diff --git a/vendor/guzzlehttp/guzzle/src/functions_include.php b/vendor/guzzlehttp/guzzle/src/functions_include.php new file mode 100644 index 0000000..a93393a --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/functions_include.php @@ -0,0 +1,6 @@ + + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/guzzlehttp/promises/Makefile b/vendor/guzzlehttp/promises/Makefile new file mode 100644 index 0000000..8d5b3ef --- /dev/null +++ b/vendor/guzzlehttp/promises/Makefile @@ -0,0 +1,13 @@ +all: clean test + +test: + vendor/bin/phpunit + +coverage: + vendor/bin/phpunit --coverage-html=artifacts/coverage + +view-coverage: + open artifacts/coverage/index.html + +clean: + rm -rf artifacts/* diff --git a/vendor/guzzlehttp/promises/README.md b/vendor/guzzlehttp/promises/README.md new file mode 100644 index 0000000..a95c605 --- /dev/null +++ b/vendor/guzzlehttp/promises/README.md @@ -0,0 +1,532 @@ +# Guzzle Promises + +[Promises/A+](https://promisesaplus.com/) implementation that handles promise +chaining and resolution iteratively, allowing for "infinite" promise chaining +while keeping the stack size constant. Read [this blog post](https://blog.domenic.me/youre-missing-the-point-of-promises/) +for a general introduction to promises. + +- [Features](#features) +- [Quick start](#quick-start) +- [Synchronous wait](#synchronous-wait) +- [Cancellation](#cancellation) +- [API](#api) + - [Promise](#promise) + - [FulfilledPromise](#fulfilledpromise) + - [RejectedPromise](#rejectedpromise) +- [Promise interop](#promise-interop) +- [Implementation notes](#implementation-notes) + + +# Features + +- [Promises/A+](https://promisesaplus.com/) implementation. +- Promise resolution and chaining is handled iteratively, allowing for + "infinite" promise chaining. +- Promises have a synchronous `wait` method. +- Promises can be cancelled. +- Works with any object that has a `then` function. +- C# style async/await coroutine promises using + `GuzzleHttp\Promise\Coroutine::of()`. + + +# Quick start + +A *promise* represents the eventual result of an asynchronous operation. The +primary way of interacting with a promise is through its `then` method, which +registers callbacks to receive either a promise's eventual value or the reason +why the promise cannot be fulfilled. + + +## Callbacks + +Callbacks are registered with the `then` method by providing an optional +`$onFulfilled` followed by an optional `$onRejected` function. + + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise->then( + // $onFulfilled + function ($value) { + echo 'The promise was fulfilled.'; + }, + // $onRejected + function ($reason) { + echo 'The promise was rejected.'; + } +); +``` + +*Resolving* a promise means that you either fulfill a promise with a *value* or +reject a promise with a *reason*. Resolving a promises triggers callbacks +registered with the promises's `then` method. These callbacks are triggered +only once and in the order in which they were added. + + +## Resolving a promise + +Promises are fulfilled using the `resolve($value)` method. Resolving a promise +with any value other than a `GuzzleHttp\Promise\RejectedPromise` will trigger +all of the onFulfilled callbacks (resolving a promise with a rejected promise +will reject the promise and trigger the `$onRejected` callbacks). + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise + ->then(function ($value) { + // Return a value and don't break the chain + return "Hello, " . $value; + }) + // This then is executed after the first then and receives the value + // returned from the first then. + ->then(function ($value) { + echo $value; + }); + +// Resolving the promise triggers the $onFulfilled callbacks and outputs +// "Hello, reader." +$promise->resolve('reader.'); +``` + + +## Promise forwarding + +Promises can be chained one after the other. Each then in the chain is a new +promise. The return value of a promise is what's forwarded to the next +promise in the chain. Returning a promise in a `then` callback will cause the +subsequent promises in the chain to only be fulfilled when the returned promise +has been fulfilled. The next promise in the chain will be invoked with the +resolved value of the promise. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$nextPromise = new Promise(); + +$promise + ->then(function ($value) use ($nextPromise) { + echo $value; + return $nextPromise; + }) + ->then(function ($value) { + echo $value; + }); + +// Triggers the first callback and outputs "A" +$promise->resolve('A'); +// Triggers the second callback and outputs "B" +$nextPromise->resolve('B'); +``` + +## Promise rejection + +When a promise is rejected, the `$onRejected` callbacks are invoked with the +rejection reason. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise->then(null, function ($reason) { + echo $reason; +}); + +$promise->reject('Error!'); +// Outputs "Error!" +``` + +## Rejection forwarding + +If an exception is thrown in an `$onRejected` callback, subsequent +`$onRejected` callbacks are invoked with the thrown exception as the reason. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise->then(null, function ($reason) { + throw new Exception($reason); +})->then(null, function ($reason) { + assert($reason->getMessage() === 'Error!'); +}); + +$promise->reject('Error!'); +``` + +You can also forward a rejection down the promise chain by returning a +`GuzzleHttp\Promise\RejectedPromise` in either an `$onFulfilled` or +`$onRejected` callback. + +```php +use GuzzleHttp\Promise\Promise; +use GuzzleHttp\Promise\RejectedPromise; + +$promise = new Promise(); +$promise->then(null, function ($reason) { + return new RejectedPromise($reason); +})->then(null, function ($reason) { + assert($reason === 'Error!'); +}); + +$promise->reject('Error!'); +``` + +If an exception is not thrown in a `$onRejected` callback and the callback +does not return a rejected promise, downstream `$onFulfilled` callbacks are +invoked using the value returned from the `$onRejected` callback. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise + ->then(null, function ($reason) { + return "It's ok"; + }) + ->then(function ($value) { + assert($value === "It's ok"); + }); + +$promise->reject('Error!'); +``` + +# Synchronous wait + +You can synchronously force promises to complete using a promise's `wait` +method. When creating a promise, you can provide a wait function that is used +to synchronously force a promise to complete. When a wait function is invoked +it is expected to deliver a value to the promise or reject the promise. If the +wait function does not deliver a value, then an exception is thrown. The wait +function provided to a promise constructor is invoked when the `wait` function +of the promise is called. + +```php +$promise = new Promise(function () use (&$promise) { + $promise->resolve('foo'); +}); + +// Calling wait will return the value of the promise. +echo $promise->wait(); // outputs "foo" +``` + +If an exception is encountered while invoking the wait function of a promise, +the promise is rejected with the exception and the exception is thrown. + +```php +$promise = new Promise(function () use (&$promise) { + throw new Exception('foo'); +}); + +$promise->wait(); // throws the exception. +``` + +Calling `wait` on a promise that has been fulfilled will not trigger the wait +function. It will simply return the previously resolved value. + +```php +$promise = new Promise(function () { die('this is not called!'); }); +$promise->resolve('foo'); +echo $promise->wait(); // outputs "foo" +``` + +Calling `wait` on a promise that has been rejected will throw an exception. If +the rejection reason is an instance of `\Exception` the reason is thrown. +Otherwise, a `GuzzleHttp\Promise\RejectionException` is thrown and the reason +can be obtained by calling the `getReason` method of the exception. + +```php +$promise = new Promise(); +$promise->reject('foo'); +$promise->wait(); +``` + +> PHP Fatal error: Uncaught exception 'GuzzleHttp\Promise\RejectionException' with message 'The promise was rejected with value: foo' + + +## Unwrapping a promise + +When synchronously waiting on a promise, you are joining the state of the +promise into the current state of execution (i.e., return the value of the +promise if it was fulfilled or throw an exception if it was rejected). This is +called "unwrapping" the promise. Waiting on a promise will by default unwrap +the promise state. + +You can force a promise to resolve and *not* unwrap the state of the promise +by passing `false` to the first argument of the `wait` function: + +```php +$promise = new Promise(); +$promise->reject('foo'); +// This will not throw an exception. It simply ensures the promise has +// been resolved. +$promise->wait(false); +``` + +When unwrapping a promise, the resolved value of the promise will be waited +upon until the unwrapped value is not a promise. This means that if you resolve +promise A with a promise B and unwrap promise A, the value returned by the +wait function will be the value delivered to promise B. + +**Note**: when you do not unwrap the promise, no value is returned. + + +# Cancellation + +You can cancel a promise that has not yet been fulfilled using the `cancel()` +method of a promise. When creating a promise you can provide an optional +cancel function that when invoked cancels the action of computing a resolution +of the promise. + + +# API + + +## Promise + +When creating a promise object, you can provide an optional `$waitFn` and +`$cancelFn`. `$waitFn` is a function that is invoked with no arguments and is +expected to resolve the promise. `$cancelFn` is a function with no arguments +that is expected to cancel the computation of a promise. It is invoked when the +`cancel()` method of a promise is called. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise( + function () use (&$promise) { + $promise->resolve('waited'); + }, + function () { + // do something that will cancel the promise computation (e.g., close + // a socket, cancel a database query, etc...) + } +); + +assert('waited' === $promise->wait()); +``` + +A promise has the following methods: + +- `then(callable $onFulfilled, callable $onRejected) : PromiseInterface` + + Appends fulfillment and rejection handlers to the promise, and returns a new promise resolving to the return value of the called handler. + +- `otherwise(callable $onRejected) : PromiseInterface` + + Appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled. + +- `wait($unwrap = true) : mixed` + + Synchronously waits on the promise to complete. + + `$unwrap` controls whether or not the value of the promise is returned for a + fulfilled promise or if an exception is thrown if the promise is rejected. + This is set to `true` by default. + +- `cancel()` + + Attempts to cancel the promise if possible. The promise being cancelled and + the parent most ancestor that has not yet been resolved will also be + cancelled. Any promises waiting on the cancelled promise to resolve will also + be cancelled. + +- `getState() : string` + + Returns the state of the promise. One of `pending`, `fulfilled`, or + `rejected`. + +- `resolve($value)` + + Fulfills the promise with the given `$value`. + +- `reject($reason)` + + Rejects the promise with the given `$reason`. + + +## FulfilledPromise + +A fulfilled promise can be created to represent a promise that has been +fulfilled. + +```php +use GuzzleHttp\Promise\FulfilledPromise; + +$promise = new FulfilledPromise('value'); + +// Fulfilled callbacks are immediately invoked. +$promise->then(function ($value) { + echo $value; +}); +``` + + +## RejectedPromise + +A rejected promise can be created to represent a promise that has been +rejected. + +```php +use GuzzleHttp\Promise\RejectedPromise; + +$promise = new RejectedPromise('Error'); + +// Rejected callbacks are immediately invoked. +$promise->then(null, function ($reason) { + echo $reason; +}); +``` + + +# Promise interop + +This library works with foreign promises that have a `then` method. This means +you can use Guzzle promises with [React promises](https://github.com/reactphp/promise) +for example. When a foreign promise is returned inside of a then method +callback, promise resolution will occur recursively. + +```php +// Create a React promise +$deferred = new React\Promise\Deferred(); +$reactPromise = $deferred->promise(); + +// Create a Guzzle promise that is fulfilled with a React promise. +$guzzlePromise = new GuzzleHttp\Promise\Promise(); +$guzzlePromise->then(function ($value) use ($reactPromise) { + // Do something something with the value... + // Return the React promise + return $reactPromise; +}); +``` + +Please note that wait and cancel chaining is no longer possible when forwarding +a foreign promise. You will need to wrap a third-party promise with a Guzzle +promise in order to utilize wait and cancel functions with foreign promises. + + +## Event Loop Integration + +In order to keep the stack size constant, Guzzle promises are resolved +asynchronously using a task queue. When waiting on promises synchronously, the +task queue will be automatically run to ensure that the blocking promise and +any forwarded promises are resolved. When using promises asynchronously in an +event loop, you will need to run the task queue on each tick of the loop. If +you do not run the task queue, then promises will not be resolved. + +You can run the task queue using the `run()` method of the global task queue +instance. + +```php +// Get the global task queue +$queue = GuzzleHttp\Promise\Utils::queue(); +$queue->run(); +``` + +For example, you could use Guzzle promises with React using a periodic timer: + +```php +$loop = React\EventLoop\Factory::create(); +$loop->addPeriodicTimer(0, [$queue, 'run']); +``` + +*TODO*: Perhaps adding a `futureTick()` on each tick would be faster? + + +# Implementation notes + + +## Promise resolution and chaining is handled iteratively + +By shuffling pending handlers from one owner to another, promises are +resolved iteratively, allowing for "infinite" then chaining. + +```php +then(function ($v) { + // The stack size remains constant (a good thing) + echo xdebug_get_stack_depth() . ', '; + return $v + 1; + }); +} + +$parent->resolve(0); +var_dump($p->wait()); // int(1000) + +``` + +When a promise is fulfilled or rejected with a non-promise value, the promise +then takes ownership of the handlers of each child promise and delivers values +down the chain without using recursion. + +When a promise is resolved with another promise, the original promise transfers +all of its pending handlers to the new promise. When the new promise is +eventually resolved, all of the pending handlers are delivered the forwarded +value. + + +## A promise is the deferred. + +Some promise libraries implement promises using a deferred object to represent +a computation and a promise object to represent the delivery of the result of +the computation. This is a nice separation of computation and delivery because +consumers of the promise cannot modify the value that will be eventually +delivered. + +One side effect of being able to implement promise resolution and chaining +iteratively is that you need to be able for one promise to reach into the state +of another promise to shuffle around ownership of handlers. In order to achieve +this without making the handlers of a promise publicly mutable, a promise is +also the deferred value, allowing promises of the same parent class to reach +into and modify the private properties of promises of the same type. While this +does allow consumers of the value to modify the resolution or rejection of the +deferred, it is a small price to pay for keeping the stack size constant. + +```php +$promise = new Promise(); +$promise->then(function ($value) { echo $value; }); +// The promise is the deferred value, so you can deliver a value to it. +$promise->resolve('foo'); +// prints "foo" +``` + + +## Upgrading from Function API + +A static API was first introduced in 1.4.0, in order to mitigate problems with functions conflicting between global and local copies of the package. The function API will be removed in 2.0.0. A migration table has been provided here for your convenience: + +| Original Function | Replacement Method | +|----------------|----------------| +| `queue` | `Utils::queue` | +| `task` | `Utils::task` | +| `promise_for` | `Create::promiseFor` | +| `rejection_for` | `Create::rejectionFor` | +| `exception_for` | `Create::exceptionFor` | +| `iter_for` | `Create::iterFor` | +| `inspect` | `Utils::inspect` | +| `inspect_all` | `Utils::inspectAll` | +| `unwrap` | `Utils::unwrap` | +| `all` | `Utils::all` | +| `some` | `Utils::some` | +| `any` | `Utils::any` | +| `settle` | `Utils::settle` | +| `each` | `Each::of` | +| `each_limit` | `Each::ofLimit` | +| `each_limit_all` | `Each::ofLimitAll` | +| `!is_fulfilled` | `Is::pending` | +| `is_fulfilled` | `Is::fulfilled` | +| `is_rejected` | `Is::rejected` | +| `is_settled` | `Is::settled` | +| `coroutine` | `Coroutine::of` | diff --git a/vendor/guzzlehttp/promises/composer.json b/vendor/guzzlehttp/promises/composer.json new file mode 100644 index 0000000..db44d9e --- /dev/null +++ b/vendor/guzzlehttp/promises/composer.json @@ -0,0 +1,39 @@ +{ + "name": "guzzlehttp/promises", + "description": "Guzzle promises library", + "keywords": ["promise"], + "license": "MIT", + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": ["src/functions_include.php"] + }, + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Promise\\Tests\\": "tests/" + } + }, + "scripts": { + "test": "vendor/bin/simple-phpunit", + "test-ci": "vendor/bin/simple-phpunit --coverage-text" + }, + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + } +} diff --git a/vendor/guzzlehttp/promises/src/AggregateException.php b/vendor/guzzlehttp/promises/src/AggregateException.php new file mode 100644 index 0000000..d2b5712 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/AggregateException.php @@ -0,0 +1,17 @@ +then(function ($v) { echo $v; }); + * + * @param callable $generatorFn Generator function to wrap into a promise. + * + * @return Promise + * + * @link https://github.com/petkaantonov/bluebird/blob/master/API.md#generators inspiration + */ +final class Coroutine implements PromiseInterface +{ + /** + * @var PromiseInterface|null + */ + private $currentPromise; + + /** + * @var Generator + */ + private $generator; + + /** + * @var Promise + */ + private $result; + + public function __construct(callable $generatorFn) + { + $this->generator = $generatorFn(); + $this->result = new Promise(function () { + while (isset($this->currentPromise)) { + $this->currentPromise->wait(); + } + }); + try { + $this->nextCoroutine($this->generator->current()); + } catch (\Exception $exception) { + $this->result->reject($exception); + } catch (Throwable $throwable) { + $this->result->reject($throwable); + } + } + + /** + * Create a new coroutine. + * + * @return self + */ + public static function of(callable $generatorFn) + { + return new self($generatorFn); + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ) { + return $this->result->then($onFulfilled, $onRejected); + } + + public function otherwise(callable $onRejected) + { + return $this->result->otherwise($onRejected); + } + + public function wait($unwrap = true) + { + return $this->result->wait($unwrap); + } + + public function getState() + { + return $this->result->getState(); + } + + public function resolve($value) + { + $this->result->resolve($value); + } + + public function reject($reason) + { + $this->result->reject($reason); + } + + public function cancel() + { + $this->currentPromise->cancel(); + $this->result->cancel(); + } + + private function nextCoroutine($yielded) + { + $this->currentPromise = Create::promiseFor($yielded) + ->then([$this, '_handleSuccess'], [$this, '_handleFailure']); + } + + /** + * @internal + */ + public function _handleSuccess($value) + { + unset($this->currentPromise); + try { + $next = $this->generator->send($value); + if ($this->generator->valid()) { + $this->nextCoroutine($next); + } else { + $this->result->resolve($value); + } + } catch (Exception $exception) { + $this->result->reject($exception); + } catch (Throwable $throwable) { + $this->result->reject($throwable); + } + } + + /** + * @internal + */ + public function _handleFailure($reason) + { + unset($this->currentPromise); + try { + $nextYield = $this->generator->throw(Create::exceptionFor($reason)); + // The throw was caught, so keep iterating on the coroutine + $this->nextCoroutine($nextYield); + } catch (Exception $exception) { + $this->result->reject($exception); + } catch (Throwable $throwable) { + $this->result->reject($throwable); + } + } +} diff --git a/vendor/guzzlehttp/promises/src/Create.php b/vendor/guzzlehttp/promises/src/Create.php new file mode 100644 index 0000000..8d038e9 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/Create.php @@ -0,0 +1,84 @@ +then([$promise, 'resolve'], [$promise, 'reject']); + return $promise; + } + + return new FulfilledPromise($value); + } + + /** + * Creates a rejected promise for a reason if the reason is not a promise. + * If the provided reason is a promise, then it is returned as-is. + * + * @param mixed $reason Promise or reason. + * + * @return PromiseInterface + */ + public static function rejectionFor($reason) + { + if ($reason instanceof PromiseInterface) { + return $reason; + } + + return new RejectedPromise($reason); + } + + /** + * Create an exception for a rejected promise value. + * + * @param mixed $reason + * + * @return \Exception|\Throwable + */ + public static function exceptionFor($reason) + { + if ($reason instanceof \Exception || $reason instanceof \Throwable) { + return $reason; + } + + return new RejectionException($reason); + } + + /** + * Returns an iterator for the given value. + * + * @param mixed $value + * + * @return \Iterator + */ + public static function iterFor($value) + { + if ($value instanceof \Iterator) { + return $value; + } + + if (is_array($value)) { + return new \ArrayIterator($value); + } + + return new \ArrayIterator([$value]); + } +} diff --git a/vendor/guzzlehttp/promises/src/Each.php b/vendor/guzzlehttp/promises/src/Each.php new file mode 100644 index 0000000..1dda354 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/Each.php @@ -0,0 +1,90 @@ + $onFulfilled, + 'rejected' => $onRejected + ]))->promise(); + } + + /** + * Like of, but only allows a certain number of outstanding promises at any + * given time. + * + * $concurrency may be an integer or a function that accepts the number of + * pending promises and returns a numeric concurrency limit value to allow + * for dynamic a concurrency size. + * + * @param mixed $iterable + * @param int|callable $concurrency + * @param callable $onFulfilled + * @param callable $onRejected + * + * @return PromiseInterface + */ + public static function ofLimit( + $iterable, + $concurrency, + callable $onFulfilled = null, + callable $onRejected = null + ) { + return (new EachPromise($iterable, [ + 'fulfilled' => $onFulfilled, + 'rejected' => $onRejected, + 'concurrency' => $concurrency + ]))->promise(); + } + + /** + * Like limit, but ensures that no promise in the given $iterable argument + * is rejected. If any promise is rejected, then the aggregate promise is + * rejected with the encountered rejection. + * + * @param mixed $iterable + * @param int|callable $concurrency + * @param callable $onFulfilled + * + * @return PromiseInterface + */ + public static function ofLimitAll( + $iterable, + $concurrency, + callable $onFulfilled = null + ) { + return each_limit( + $iterable, + $concurrency, + $onFulfilled, + function ($reason, $idx, PromiseInterface $aggregate) { + $aggregate->reject($reason); + } + ); + } +} diff --git a/vendor/guzzlehttp/promises/src/EachPromise.php b/vendor/guzzlehttp/promises/src/EachPromise.php new file mode 100644 index 0000000..b5cb103 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/EachPromise.php @@ -0,0 +1,254 @@ +iterable = Create::iterFor($iterable); + + if (isset($config['concurrency'])) { + $this->concurrency = $config['concurrency']; + } + + if (isset($config['fulfilled'])) { + $this->onFulfilled = $config['fulfilled']; + } + + if (isset($config['rejected'])) { + $this->onRejected = $config['rejected']; + } + } + + /** @psalm-suppress InvalidNullableReturnType */ + public function promise() + { + if ($this->aggregate) { + return $this->aggregate; + } + + try { + $this->createPromise(); + /** @psalm-assert Promise $this->aggregate */ + $this->iterable->rewind(); + if (!$this->checkIfFinished()) { + $this->refillPending(); + } + } catch (\Throwable $e) { + /** + * @psalm-suppress NullReference + * @phpstan-ignore-next-line + */ + $this->aggregate->reject($e); + } catch (\Exception $e) { + /** + * @psalm-suppress NullReference + * @phpstan-ignore-next-line + */ + $this->aggregate->reject($e); + } + + /** + * @psalm-suppress NullableReturnStatement + * @phpstan-ignore-next-line + */ + return $this->aggregate; + } + + private function createPromise() + { + $this->mutex = false; + $this->aggregate = new Promise(function () { + reset($this->pending); + // Consume a potentially fluctuating list of promises while + // ensuring that indexes are maintained (precluding array_shift). + while ($promise = current($this->pending)) { + next($this->pending); + $promise->wait(); + if (Is::settled($this->aggregate)) { + return; + } + } + }); + + // Clear the references when the promise is resolved. + $clearFn = function () { + $this->iterable = $this->concurrency = $this->pending = null; + $this->onFulfilled = $this->onRejected = null; + $this->nextPendingIndex = 0; + }; + + $this->aggregate->then($clearFn, $clearFn); + } + + private function refillPending() + { + if (!$this->concurrency) { + // Add all pending promises. + while ($this->addPending() && $this->advanceIterator()); + return; + } + + // Add only up to N pending promises. + $concurrency = is_callable($this->concurrency) + ? call_user_func($this->concurrency, count($this->pending)) + : $this->concurrency; + $concurrency = max($concurrency - count($this->pending), 0); + // Concurrency may be set to 0 to disallow new promises. + if (!$concurrency) { + return; + } + // Add the first pending promise. + $this->addPending(); + // Note this is special handling for concurrency=1 so that we do + // not advance the iterator after adding the first promise. This + // helps work around issues with generators that might not have the + // next value to yield until promise callbacks are called. + while (--$concurrency + && $this->advanceIterator() + && $this->addPending()); + } + + private function addPending() + { + if (!$this->iterable || !$this->iterable->valid()) { + return false; + } + + $promise = Create::promiseFor($this->iterable->current()); + $key = $this->iterable->key(); + + // Iterable keys may not be unique, so we use a counter to + // guarantee uniqueness + $idx = $this->nextPendingIndex++; + + $this->pending[$idx] = $promise->then( + function ($value) use ($idx, $key) { + if ($this->onFulfilled) { + call_user_func( + $this->onFulfilled, + $value, + $key, + $this->aggregate + ); + } + $this->step($idx); + }, + function ($reason) use ($idx, $key) { + if ($this->onRejected) { + call_user_func( + $this->onRejected, + $reason, + $key, + $this->aggregate + ); + } + $this->step($idx); + } + ); + + return true; + } + + private function advanceIterator() + { + // Place a lock on the iterator so that we ensure to not recurse, + // preventing fatal generator errors. + if ($this->mutex) { + return false; + } + + $this->mutex = true; + + try { + $this->iterable->next(); + $this->mutex = false; + return true; + } catch (\Throwable $e) { + $this->aggregate->reject($e); + $this->mutex = false; + return false; + } catch (\Exception $e) { + $this->aggregate->reject($e); + $this->mutex = false; + return false; + } + } + + private function step($idx) + { + // If the promise was already resolved, then ignore this step. + if (Is::settled($this->aggregate)) { + return; + } + + unset($this->pending[$idx]); + + // Only refill pending promises if we are not locked, preventing the + // EachPromise to recursively invoke the provided iterator, which + // cause a fatal error: "Cannot resume an already running generator" + if ($this->advanceIterator() && !$this->checkIfFinished()) { + // Add more pending promises if possible. + $this->refillPending(); + } + } + + private function checkIfFinished() + { + if (!$this->pending && !$this->iterable->valid()) { + // Resolve the promise if there's nothing left to do. + $this->aggregate->resolve(null); + return true; + } + + return false; + } +} diff --git a/vendor/guzzlehttp/promises/src/FulfilledPromise.php b/vendor/guzzlehttp/promises/src/FulfilledPromise.php new file mode 100644 index 0000000..98f72a6 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/FulfilledPromise.php @@ -0,0 +1,84 @@ +value = $value; + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ) { + // Return itself if there is no onFulfilled function. + if (!$onFulfilled) { + return $this; + } + + $queue = Utils::queue(); + $p = new Promise([$queue, 'run']); + $value = $this->value; + $queue->add(static function () use ($p, $value, $onFulfilled) { + if (Is::pending($p)) { + try { + $p->resolve($onFulfilled($value)); + } catch (\Throwable $e) { + $p->reject($e); + } catch (\Exception $e) { + $p->reject($e); + } + } + }); + + return $p; + } + + public function otherwise(callable $onRejected) + { + return $this->then(null, $onRejected); + } + + public function wait($unwrap = true, $defaultDelivery = null) + { + return $unwrap ? $this->value : null; + } + + public function getState() + { + return self::FULFILLED; + } + + public function resolve($value) + { + if ($value !== $this->value) { + throw new \LogicException("Cannot resolve a fulfilled promise"); + } + } + + public function reject($reason) + { + throw new \LogicException("Cannot reject a fulfilled promise"); + } + + public function cancel() + { + // pass + } +} diff --git a/vendor/guzzlehttp/promises/src/Is.php b/vendor/guzzlehttp/promises/src/Is.php new file mode 100644 index 0000000..c3ed8d0 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/Is.php @@ -0,0 +1,46 @@ +getState() === PromiseInterface::PENDING; + } + + /** + * Returns true if a promise is fulfilled or rejected. + * + * @return bool + */ + public static function settled(PromiseInterface $promise) + { + return $promise->getState() !== PromiseInterface::PENDING; + } + + /** + * Returns true if a promise is fulfilled. + * + * @return bool + */ + public static function fulfilled(PromiseInterface $promise) + { + return $promise->getState() === PromiseInterface::FULFILLED; + } + + /** + * Returns true if a promise is rejected. + * + * @return bool + */ + public static function rejected(PromiseInterface $promise) + { + return $promise->getState() === PromiseInterface::REJECTED; + } +} diff --git a/vendor/guzzlehttp/promises/src/Promise.php b/vendor/guzzlehttp/promises/src/Promise.php new file mode 100644 index 0000000..7593905 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/Promise.php @@ -0,0 +1,278 @@ +waitFn = $waitFn; + $this->cancelFn = $cancelFn; + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ) { + if ($this->state === self::PENDING) { + $p = new Promise(null, [$this, 'cancel']); + $this->handlers[] = [$p, $onFulfilled, $onRejected]; + $p->waitList = $this->waitList; + $p->waitList[] = $this; + return $p; + } + + // Return a fulfilled promise and immediately invoke any callbacks. + if ($this->state === self::FULFILLED) { + $promise = Create::promiseFor($this->result); + return $onFulfilled ? $promise->then($onFulfilled) : $promise; + } + + // It's either cancelled or rejected, so return a rejected promise + // and immediately invoke any callbacks. + $rejection = Create::rejectionFor($this->result); + return $onRejected ? $rejection->then(null, $onRejected) : $rejection; + } + + public function otherwise(callable $onRejected) + { + return $this->then(null, $onRejected); + } + + public function wait($unwrap = true) + { + $this->waitIfPending(); + + if ($this->result instanceof PromiseInterface) { + return $this->result->wait($unwrap); + } + if ($unwrap) { + if ($this->state === self::FULFILLED) { + return $this->result; + } + // It's rejected so "unwrap" and throw an exception. + throw Create::exceptionFor($this->result); + } + } + + public function getState() + { + return $this->state; + } + + public function cancel() + { + if ($this->state !== self::PENDING) { + return; + } + + $this->waitFn = $this->waitList = null; + + if ($this->cancelFn) { + $fn = $this->cancelFn; + $this->cancelFn = null; + try { + $fn(); + } catch (\Throwable $e) { + $this->reject($e); + } catch (\Exception $e) { + $this->reject($e); + } + } + + // Reject the promise only if it wasn't rejected in a then callback. + /** @psalm-suppress RedundantCondition */ + if ($this->state === self::PENDING) { + $this->reject(new CancellationException('Promise has been cancelled')); + } + } + + public function resolve($value) + { + $this->settle(self::FULFILLED, $value); + } + + public function reject($reason) + { + $this->settle(self::REJECTED, $reason); + } + + private function settle($state, $value) + { + if ($this->state !== self::PENDING) { + // Ignore calls with the same resolution. + if ($state === $this->state && $value === $this->result) { + return; + } + throw $this->state === $state + ? new \LogicException("The promise is already {$state}.") + : new \LogicException("Cannot change a {$this->state} promise to {$state}"); + } + + if ($value === $this) { + throw new \LogicException('Cannot fulfill or reject a promise with itself'); + } + + // Clear out the state of the promise but stash the handlers. + $this->state = $state; + $this->result = $value; + $handlers = $this->handlers; + $this->handlers = null; + $this->waitList = $this->waitFn = null; + $this->cancelFn = null; + + if (!$handlers) { + return; + } + + // If the value was not a settled promise or a thenable, then resolve + // it in the task queue using the correct ID. + if (!is_object($value) || !method_exists($value, 'then')) { + $id = $state === self::FULFILLED ? 1 : 2; + // It's a success, so resolve the handlers in the queue. + Utils::queue()->add(static function () use ($id, $value, $handlers) { + foreach ($handlers as $handler) { + self::callHandler($id, $value, $handler); + } + }); + } elseif ($value instanceof Promise && Is::pending($value)) { + // We can just merge our handlers onto the next promise. + $value->handlers = array_merge($value->handlers, $handlers); + } else { + // Resolve the handlers when the forwarded promise is resolved. + $value->then( + static function ($value) use ($handlers) { + foreach ($handlers as $handler) { + self::callHandler(1, $value, $handler); + } + }, + static function ($reason) use ($handlers) { + foreach ($handlers as $handler) { + self::callHandler(2, $reason, $handler); + } + } + ); + } + } + + /** + * Call a stack of handlers using a specific callback index and value. + * + * @param int $index 1 (resolve) or 2 (reject). + * @param mixed $value Value to pass to the callback. + * @param array $handler Array of handler data (promise and callbacks). + */ + private static function callHandler($index, $value, array $handler) + { + /** @var PromiseInterface $promise */ + $promise = $handler[0]; + + // The promise may have been cancelled or resolved before placing + // this thunk in the queue. + if (Is::settled($promise)) { + return; + } + + try { + if (isset($handler[$index])) { + /* + * If $f throws an exception, then $handler will be in the exception + * stack trace. Since $handler contains a reference to the callable + * itself we get a circular reference. We clear the $handler + * here to avoid that memory leak. + */ + $f = $handler[$index]; + unset($handler); + $promise->resolve($f($value)); + } elseif ($index === 1) { + // Forward resolution values as-is. + $promise->resolve($value); + } else { + // Forward rejections down the chain. + $promise->reject($value); + } + } catch (\Throwable $reason) { + $promise->reject($reason); + } catch (\Exception $reason) { + $promise->reject($reason); + } + } + + private function waitIfPending() + { + if ($this->state !== self::PENDING) { + return; + } elseif ($this->waitFn) { + $this->invokeWaitFn(); + } elseif ($this->waitList) { + $this->invokeWaitList(); + } else { + // If there's no wait function, then reject the promise. + $this->reject('Cannot wait on a promise that has ' + . 'no internal wait function. You must provide a wait ' + . 'function when constructing the promise to be able to ' + . 'wait on a promise.'); + } + + Utils::queue()->run(); + + /** @psalm-suppress RedundantCondition */ + if ($this->state === self::PENDING) { + $this->reject('Invoking the wait callback did not resolve the promise'); + } + } + + private function invokeWaitFn() + { + try { + $wfn = $this->waitFn; + $this->waitFn = null; + $wfn(true); + } catch (\Exception $reason) { + if ($this->state === self::PENDING) { + // The promise has not been resolved yet, so reject the promise + // with the exception. + $this->reject($reason); + } else { + // The promise was already resolved, so there's a problem in + // the application. + throw $reason; + } + } + } + + private function invokeWaitList() + { + $waitList = $this->waitList; + $this->waitList = null; + + foreach ($waitList as $result) { + do { + $result->waitIfPending(); + $result = $result->result; + } while ($result instanceof Promise); + + if ($result instanceof PromiseInterface) { + $result->wait(false); + } + } + } +} diff --git a/vendor/guzzlehttp/promises/src/PromiseInterface.php b/vendor/guzzlehttp/promises/src/PromiseInterface.php new file mode 100644 index 0000000..e598331 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/PromiseInterface.php @@ -0,0 +1,97 @@ +reason = $reason; + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ) { + // If there's no onRejected callback then just return self. + if (!$onRejected) { + return $this; + } + + $queue = Utils::queue(); + $reason = $this->reason; + $p = new Promise([$queue, 'run']); + $queue->add(static function () use ($p, $reason, $onRejected) { + if (Is::pending($p)) { + try { + // Return a resolved promise if onRejected does not throw. + $p->resolve($onRejected($reason)); + } catch (\Throwable $e) { + // onRejected threw, so return a rejected promise. + $p->reject($e); + } catch (\Exception $e) { + // onRejected threw, so return a rejected promise. + $p->reject($e); + } + } + }); + + return $p; + } + + public function otherwise(callable $onRejected) + { + return $this->then(null, $onRejected); + } + + public function wait($unwrap = true, $defaultDelivery = null) + { + if ($unwrap) { + throw Create::exceptionFor($this->reason); + } + + return null; + } + + public function getState() + { + return self::REJECTED; + } + + public function resolve($value) + { + throw new \LogicException("Cannot resolve a rejected promise"); + } + + public function reject($reason) + { + if ($reason !== $this->reason) { + throw new \LogicException("Cannot reject a rejected promise"); + } + } + + public function cancel() + { + // pass + } +} diff --git a/vendor/guzzlehttp/promises/src/RejectionException.php b/vendor/guzzlehttp/promises/src/RejectionException.php new file mode 100644 index 0000000..e2f1377 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/RejectionException.php @@ -0,0 +1,48 @@ +reason = $reason; + + $message = 'The promise was rejected'; + + if ($description) { + $message .= ' with reason: ' . $description; + } elseif (is_string($reason) + || (is_object($reason) && method_exists($reason, '__toString')) + ) { + $message .= ' with reason: ' . $this->reason; + } elseif ($reason instanceof \JsonSerializable) { + $message .= ' with reason: ' + . json_encode($this->reason, JSON_PRETTY_PRINT); + } + + parent::__construct($message); + } + + /** + * Returns the rejection reason. + * + * @return mixed + */ + public function getReason() + { + return $this->reason; + } +} diff --git a/vendor/guzzlehttp/promises/src/TaskQueue.php b/vendor/guzzlehttp/promises/src/TaskQueue.php new file mode 100644 index 0000000..f0fba2c --- /dev/null +++ b/vendor/guzzlehttp/promises/src/TaskQueue.php @@ -0,0 +1,67 @@ +run(); + */ +class TaskQueue implements TaskQueueInterface +{ + private $enableShutdown = true; + private $queue = []; + + public function __construct($withShutdown = true) + { + if ($withShutdown) { + register_shutdown_function(function () { + if ($this->enableShutdown) { + // Only run the tasks if an E_ERROR didn't occur. + $err = error_get_last(); + if (!$err || ($err['type'] ^ E_ERROR)) { + $this->run(); + } + } + }); + } + } + + public function isEmpty() + { + return !$this->queue; + } + + public function add(callable $task) + { + $this->queue[] = $task; + } + + public function run() + { + while ($task = array_shift($this->queue)) { + /** @var callable $task */ + $task(); + } + } + + /** + * The task queue will be run and exhausted by default when the process + * exits IFF the exit is not the result of a PHP E_ERROR error. + * + * You can disable running the automatic shutdown of the queue by calling + * this function. If you disable the task queue shutdown process, then you + * MUST either run the task queue (as a result of running your event loop + * or manually using the run() method) or wait on each outstanding promise. + * + * Note: This shutdown will occur before any destructors are triggered. + */ + public function disableShutdown() + { + $this->enableShutdown = false; + } +} diff --git a/vendor/guzzlehttp/promises/src/TaskQueueInterface.php b/vendor/guzzlehttp/promises/src/TaskQueueInterface.php new file mode 100644 index 0000000..723d4d5 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/TaskQueueInterface.php @@ -0,0 +1,24 @@ + + * while ($eventLoop->isRunning()) { + * GuzzleHttp\Promise\Utils::queue()->run(); + * } + * + * + * @param TaskQueueInterface $assign Optionally specify a new queue instance. + * + * @return TaskQueueInterface + */ + public static function queue(TaskQueueInterface $assign = null) + { + static $queue; + + if ($assign) { + $queue = $assign; + } elseif (!$queue) { + $queue = new TaskQueue(); + } + + return $queue; + } + + /** + * Adds a function to run in the task queue when it is next `run()` and + * returns a promise that is fulfilled or rejected with the result. + * + * @param callable $task Task function to run. + * + * @return PromiseInterface + */ + public static function task(callable $task) + { + $queue = self::queue(); + $promise = new Promise([$queue, 'run']); + $queue->add(function () use ($task, $promise) { + try { + $promise->resolve($task()); + } catch (\Throwable $e) { + $promise->reject($e); + } catch (\Exception $e) { + $promise->reject($e); + } + }); + + return $promise; + } + + /** + * Synchronously waits on a promise to resolve and returns an inspection + * state array. + * + * Returns a state associative array containing a "state" key mapping to a + * valid promise state. If the state of the promise is "fulfilled", the + * array will contain a "value" key mapping to the fulfilled value of the + * promise. If the promise is rejected, the array will contain a "reason" + * key mapping to the rejection reason of the promise. + * + * @param PromiseInterface $promise Promise or value. + * + * @return array + */ + public static function inspect(PromiseInterface $promise) + { + try { + return [ + 'state' => PromiseInterface::FULFILLED, + 'value' => $promise->wait() + ]; + } catch (RejectionException $e) { + return ['state' => PromiseInterface::REJECTED, 'reason' => $e->getReason()]; + } catch (\Throwable $e) { + return ['state' => PromiseInterface::REJECTED, 'reason' => $e]; + } catch (\Exception $e) { + return ['state' => PromiseInterface::REJECTED, 'reason' => $e]; + } + } + + /** + * Waits on all of the provided promises, but does not unwrap rejected + * promises as thrown exception. + * + * Returns an array of inspection state arrays. + * + * @see inspect for the inspection state array format. + * + * @param PromiseInterface[] $promises Traversable of promises to wait upon. + * + * @return array + */ + public static function inspectAll($promises) + { + $results = []; + foreach ($promises as $key => $promise) { + $results[$key] = inspect($promise); + } + + return $results; + } + + /** + * Waits on all of the provided promises and returns the fulfilled values. + * + * Returns an array that contains the value of each promise (in the same + * order the promises were provided). An exception is thrown if any of the + * promises are rejected. + * + * @param iterable $promises Iterable of PromiseInterface objects to wait on. + * + * @return array + * + * @throws \Exception on error + * @throws \Throwable on error in PHP >=7 + */ + public static function unwrap($promises) + { + $results = []; + foreach ($promises as $key => $promise) { + $results[$key] = $promise->wait(); + } + + return $results; + } + + /** + * Given an array of promises, return a promise that is fulfilled when all + * the items in the array are fulfilled. + * + * The promise's fulfillment value is an array with fulfillment values at + * respective positions to the original array. If any promise in the array + * rejects, the returned promise is rejected with the rejection reason. + * + * @param mixed $promises Promises or values. + * @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution. + * + * @return PromiseInterface + */ + public static function all($promises, $recursive = false) + { + $results = []; + $promise = Each::of( + $promises, + function ($value, $idx) use (&$results) { + $results[$idx] = $value; + }, + function ($reason, $idx, Promise $aggregate) { + $aggregate->reject($reason); + } + )->then(function () use (&$results) { + ksort($results); + return $results; + }); + + if (true === $recursive) { + $promise = $promise->then(function ($results) use ($recursive, &$promises) { + foreach ($promises as $promise) { + if (Is::pending($promise)) { + return self::all($promises, $recursive); + } + } + return $results; + }); + } + + return $promise; + } + + /** + * Initiate a competitive race between multiple promises or values (values + * will become immediately fulfilled promises). + * + * When count amount of promises have been fulfilled, the returned promise + * is fulfilled with an array that contains the fulfillment values of the + * winners in order of resolution. + * + * This promise is rejected with a {@see AggregateException} if the number + * of fulfilled promises is less than the desired $count. + * + * @param int $count Total number of promises. + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + */ + public static function some($count, $promises) + { + $results = []; + $rejections = []; + + return Each::of( + $promises, + function ($value, $idx, PromiseInterface $p) use (&$results, $count) { + if (Is::settled($p)) { + return; + } + $results[$idx] = $value; + if (count($results) >= $count) { + $p->resolve(null); + } + }, + function ($reason) use (&$rejections) { + $rejections[] = $reason; + } + )->then( + function () use (&$results, &$rejections, $count) { + if (count($results) !== $count) { + throw new AggregateException( + 'Not enough promises to fulfill count', + $rejections + ); + } + ksort($results); + return array_values($results); + } + ); + } + + /** + * Like some(), with 1 as count. However, if the promise fulfills, the + * fulfillment value is not an array of 1 but the value directly. + * + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + */ + public static function any($promises) + { + return self::some(1, $promises)->then(function ($values) { + return $values[0]; + }); + } + + /** + * Returns a promise that is fulfilled when all of the provided promises have + * been fulfilled or rejected. + * + * The returned promise is fulfilled with an array of inspection state arrays. + * + * @see inspect for the inspection state array format. + * + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + */ + public static function settle($promises) + { + $results = []; + + return Each::of( + $promises, + function ($value, $idx) use (&$results) { + $results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value]; + }, + function ($reason, $idx) use (&$results) { + $results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason]; + } + )->then(function () use (&$results) { + ksort($results); + return $results; + }); + } +} diff --git a/vendor/guzzlehttp/promises/src/functions.php b/vendor/guzzlehttp/promises/src/functions.php new file mode 100644 index 0000000..c03d39d --- /dev/null +++ b/vendor/guzzlehttp/promises/src/functions.php @@ -0,0 +1,363 @@ + + * while ($eventLoop->isRunning()) { + * GuzzleHttp\Promise\queue()->run(); + * } + * + * + * @param TaskQueueInterface $assign Optionally specify a new queue instance. + * + * @return TaskQueueInterface + * + * @deprecated queue will be removed in guzzlehttp/promises:2.0. Use Utils::queue instead. + */ +function queue(TaskQueueInterface $assign = null) +{ + return Utils::queue($assign); +} + +/** + * Adds a function to run in the task queue when it is next `run()` and returns + * a promise that is fulfilled or rejected with the result. + * + * @param callable $task Task function to run. + * + * @return PromiseInterface + * + * @deprecated task will be removed in guzzlehttp/promises:2.0. Use Utils::task instead. + */ +function task(callable $task) +{ + return Utils::task($task); +} + +/** + * Creates a promise for a value if the value is not a promise. + * + * @param mixed $value Promise or value. + * + * @return PromiseInterface + * + * @deprecated promise_for will be removed in guzzlehttp/promises:2.0. Use Create::promiseFor instead. + */ +function promise_for($value) +{ + return Create::promiseFor($value); +} + +/** + * Creates a rejected promise for a reason if the reason is not a promise. If + * the provided reason is a promise, then it is returned as-is. + * + * @param mixed $reason Promise or reason. + * + * @return PromiseInterface + * + * @deprecated rejection_for will be removed in guzzlehttp/promises:2.0. Use Create::rejectionFor instead. + */ +function rejection_for($reason) +{ + return Create::rejectionFor($reason); +} + +/** + * Create an exception for a rejected promise value. + * + * @param mixed $reason + * + * @return \Exception|\Throwable + * + * @deprecated exception_for will be removed in guzzlehttp/promises:2.0. Use Create::exceptionFor instead. + */ +function exception_for($reason) +{ + return Create::exceptionFor($reason); +} + +/** + * Returns an iterator for the given value. + * + * @param mixed $value + * + * @return \Iterator + * + * @deprecated iter_for will be removed in guzzlehttp/promises:2.0. Use Create::iterFor instead. + */ +function iter_for($value) +{ + return Create::iterFor($value); +} + +/** + * Synchronously waits on a promise to resolve and returns an inspection state + * array. + * + * Returns a state associative array containing a "state" key mapping to a + * valid promise state. If the state of the promise is "fulfilled", the array + * will contain a "value" key mapping to the fulfilled value of the promise. If + * the promise is rejected, the array will contain a "reason" key mapping to + * the rejection reason of the promise. + * + * @param PromiseInterface $promise Promise or value. + * + * @return array + * + * @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspect instead. + */ +function inspect(PromiseInterface $promise) +{ + return Utils::inspect($promise); +} + +/** + * Waits on all of the provided promises, but does not unwrap rejected promises + * as thrown exception. + * + * Returns an array of inspection state arrays. + * + * @see inspect for the inspection state array format. + * + * @param PromiseInterface[] $promises Traversable of promises to wait upon. + * + * @return array + * + * @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspectAll instead. + */ +function inspect_all($promises) +{ + return Utils::inspectAll($promises); +} + +/** + * Waits on all of the provided promises and returns the fulfilled values. + * + * Returns an array that contains the value of each promise (in the same order + * the promises were provided). An exception is thrown if any of the promises + * are rejected. + * + * @param iterable $promises Iterable of PromiseInterface objects to wait on. + * + * @return array + * + * @throws \Exception on error + * @throws \Throwable on error in PHP >=7 + * + * @deprecated unwrap will be removed in guzzlehttp/promises:2.0. Use Utils::unwrap instead. + */ +function unwrap($promises) +{ + return Utils::unwrap($promises); +} + +/** + * Given an array of promises, return a promise that is fulfilled when all the + * items in the array are fulfilled. + * + * The promise's fulfillment value is an array with fulfillment values at + * respective positions to the original array. If any promise in the array + * rejects, the returned promise is rejected with the rejection reason. + * + * @param mixed $promises Promises or values. + * @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution. + * + * @return PromiseInterface + * + * @deprecated all will be removed in guzzlehttp/promises:2.0. Use Utils::all instead. + */ +function all($promises, $recursive = false) +{ + return Utils::all($promises, $recursive); +} + +/** + * Initiate a competitive race between multiple promises or values (values will + * become immediately fulfilled promises). + * + * When count amount of promises have been fulfilled, the returned promise is + * fulfilled with an array that contains the fulfillment values of the winners + * in order of resolution. + * + * This promise is rejected with a {@see AggregateException} if the number of + * fulfilled promises is less than the desired $count. + * + * @param int $count Total number of promises. + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + * + * @deprecated some will be removed in guzzlehttp/promises:2.0. Use Utils::some instead. + */ +function some($count, $promises) +{ + return Utils::some($count, $promises); +} + +/** + * Like some(), with 1 as count. However, if the promise fulfills, the + * fulfillment value is not an array of 1 but the value directly. + * + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + * + * @deprecated any will be removed in guzzlehttp/promises:2.0. Use Utils::any instead. + */ +function any($promises) +{ + return Utils::any($promises); +} + +/** + * Returns a promise that is fulfilled when all of the provided promises have + * been fulfilled or rejected. + * + * The returned promise is fulfilled with an array of inspection state arrays. + * + * @see inspect for the inspection state array format. + * + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + * + * @deprecated settle will be removed in guzzlehttp/promises:2.0. Use Utils::settle instead. + */ +function settle($promises) +{ + return Utils::settle($promises); +} + +/** + * Given an iterator that yields promises or values, returns a promise that is + * fulfilled with a null value when the iterator has been consumed or the + * aggregate promise has been fulfilled or rejected. + * + * $onFulfilled is a function that accepts the fulfilled value, iterator index, + * and the aggregate promise. The callback can invoke any necessary side + * effects and choose to resolve or reject the aggregate if needed. + * + * $onRejected is a function that accepts the rejection reason, iterator index, + * and the aggregate promise. The callback can invoke any necessary side + * effects and choose to resolve or reject the aggregate if needed. + * + * @param mixed $iterable Iterator or array to iterate over. + * @param callable $onFulfilled + * @param callable $onRejected + * + * @return PromiseInterface + * + * @deprecated each will be removed in guzzlehttp/promises:2.0. Use Each::of instead. + */ +function each( + $iterable, + callable $onFulfilled = null, + callable $onRejected = null +) { + return Each::of($iterable, $onFulfilled, $onRejected); +} + +/** + * Like each, but only allows a certain number of outstanding promises at any + * given time. + * + * $concurrency may be an integer or a function that accepts the number of + * pending promises and returns a numeric concurrency limit value to allow for + * dynamic a concurrency size. + * + * @param mixed $iterable + * @param int|callable $concurrency + * @param callable $onFulfilled + * @param callable $onRejected + * + * @return PromiseInterface + * + * @deprecated each_limit will be removed in guzzlehttp/promises:2.0. Use Each::ofLimit instead. + */ +function each_limit( + $iterable, + $concurrency, + callable $onFulfilled = null, + callable $onRejected = null +) { + return Each::ofLimit($iterable, $concurrency, $onFulfilled, $onRejected); +} + +/** + * Like each_limit, but ensures that no promise in the given $iterable argument + * is rejected. If any promise is rejected, then the aggregate promise is + * rejected with the encountered rejection. + * + * @param mixed $iterable + * @param int|callable $concurrency + * @param callable $onFulfilled + * + * @return PromiseInterface + * + * @deprecated each_limit_all will be removed in guzzlehttp/promises:2.0. Use Each::ofLimitAll instead. + */ +function each_limit_all( + $iterable, + $concurrency, + callable $onFulfilled = null +) { + return Each::ofLimitAll($iterable, $concurrency, $onFulfilled); +} + +/** + * Returns true if a promise is fulfilled. + * + * @return bool + * + * @deprecated is_fulfilled will be removed in guzzlehttp/promises:2.0. Use Is::fulfilled instead. + */ +function is_fulfilled(PromiseInterface $promise) +{ + return Is::fulfilled($promise); +} + +/** + * Returns true if a promise is rejected. + * + * @return bool + * + * @deprecated is_rejected will be removed in guzzlehttp/promises:2.0. Use Is::rejected instead. + */ +function is_rejected(PromiseInterface $promise) +{ + return Is::rejected($promise); +} + +/** + * Returns true if a promise is fulfilled or rejected. + * + * @return bool + * + * @deprecated is_settled will be removed in guzzlehttp/promises:2.0. Use Is::settled instead. + */ +function is_settled(PromiseInterface $promise) +{ + return Is::settled($promise); +} + +/** + * Create a new coroutine. + * + * @see Coroutine + * + * @return PromiseInterface + * + * @deprecated coroutine will be removed in guzzlehttp/promises:2.0. Use Coroutine::of instead. + */ +function coroutine(callable $generatorFn) +{ + return Coroutine::of($generatorFn); +} diff --git a/vendor/guzzlehttp/promises/src/functions_include.php b/vendor/guzzlehttp/promises/src/functions_include.php new file mode 100644 index 0000000..34cd171 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/functions_include.php @@ -0,0 +1,6 @@ +setRiskyAllowed(true) + ->setRules([ + '@PSR2' => true, + 'array_syntax' => ['syntax' => 'short'], + 'concat_space' => ['spacing' => 'one'], + 'declare_strict_types' => false, + 'final_static_access' => true, + 'fully_qualified_strict_types' => true, + 'header_comment' => false, + 'is_null' => ['use_yoda_style' => true], + 'list_syntax' => ['syntax' => 'long'], + 'lowercase_cast' => true, + 'magic_method_casing' => true, + 'modernize_types_casting' => true, + 'multiline_comment_opening_closing' => true, + 'no_alias_functions' => true, + 'no_alternative_syntax' => true, + 'no_blank_lines_after_phpdoc' => true, + 'no_empty_comment' => true, + 'no_empty_phpdoc' => true, + 'no_empty_statement' => true, + 'no_extra_blank_lines' => true, + 'no_leading_import_slash' => true, + 'no_trailing_comma_in_singleline_array' => true, + 'no_unset_cast' => true, + 'no_unused_imports' => true, + 'no_whitespace_in_blank_line' => true, + 'ordered_imports' => true, + 'php_unit_ordered_covers' => true, + 'php_unit_test_annotation' => ['style' => 'prefix'], + 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], + 'phpdoc_align' => ['align' => 'vertical'], + 'phpdoc_no_useless_inheritdoc' => true, + 'phpdoc_scalar' => true, + 'phpdoc_separation' => true, + 'phpdoc_single_line_var_spacing' => true, + 'phpdoc_trim' => true, + 'phpdoc_trim_consecutive_blank_line_separation' => true, + 'phpdoc_types' => true, + 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], + 'phpdoc_var_without_name' => true, + 'single_trait_insert_per_statement' => true, + 'standardize_not_equals' => true, + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->in(__DIR__.'/src') + ->in(__DIR__.'/tests') + ->name('*.php') + ) +; + +return $config; diff --git a/vendor/guzzlehttp/psr7/CHANGELOG.md b/vendor/guzzlehttp/psr7/CHANGELOG.md new file mode 100644 index 0000000..cec8908 --- /dev/null +++ b/vendor/guzzlehttp/psr7/CHANGELOG.md @@ -0,0 +1,294 @@ +# Change Log + + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + + +## Unreleased + +## 1.8.2 - 2021-04-26 + +### Fixed + +- Handle possibly unset `url` in `stream_get_meta_data` + +## 1.8.1 - 2021-03-21 + +### Fixed + +- Issue parsing IPv6 URLs +- Issue modifying ServerRequest lost all its attributes + +## 1.8.0 - 2021-03-21 + +### Added + +- Locale independent URL parsing +- Most classes got a `@final` annotation to prepare for 2.0 + +### Fixed + +- Issue when creating stream from `php://input` and curl-ext is not installed +- Broken `Utils::tryFopen()` on PHP 8 + +## 1.7.0 - 2020-09-30 + +### Added + +- Replaced functions by static methods + +### Fixed + +- Converting a non-seekable stream to a string +- Handle multiple Set-Cookie correctly +- Ignore array keys in header values when merging +- Allow multibyte characters to be parsed in `Message:bodySummary()` + +### Changed + +- Restored partial HHVM 3 support + + +## [1.6.1] - 2019-07-02 + +### Fixed + +- Accept null and bool header values again + + +## [1.6.0] - 2019-06-30 + +### Added + +- Allowed version `^3.0` of `ralouphie/getallheaders` dependency (#244) +- Added MIME type for WEBP image format (#246) +- Added more validation of values according to PSR-7 and RFC standards, e.g. status code range (#250, #272) + +### Changed + +- Tests don't pass with HHVM 4.0, so HHVM support got dropped. Other libraries like composer have done the same. (#262) +- Accept port number 0 to be valid (#270) + +### Fixed + +- Fixed subsequent reads from `php://input` in ServerRequest (#247) +- Fixed readable/writable detection for certain stream modes (#248) +- Fixed encoding of special characters in the `userInfo` component of an URI (#253) + + +## [1.5.2] - 2018-12-04 + +### Fixed + +- Check body size when getting the message summary + + +## [1.5.1] - 2018-12-04 + +### Fixed + +- Get the summary of a body only if it is readable + + +## [1.5.0] - 2018-12-03 + +### Added + +- Response first-line to response string exception (fixes #145) +- A test for #129 behavior +- `get_message_body_summary` function in order to get the message summary +- `3gp` and `mkv` mime types + +### Changed + +- Clarify exception message when stream is detached + +### Deprecated + +- Deprecated parsing folded header lines as per RFC 7230 + +### Fixed + +- Fix `AppendStream::detach` to not close streams +- `InflateStream` preserves `isSeekable` attribute of the underlying stream +- `ServerRequest::getUriFromGlobals` to support URLs in query parameters + + +Several other fixes and improvements. + + +## [1.4.2] - 2017-03-20 + +### Fixed + +- Reverted BC break to `Uri::resolve` and `Uri::removeDotSegments` by removing + calls to `trigger_error` when deprecated methods are invoked. + + +## [1.4.1] - 2017-02-27 + +### Added + +- Rriggering of silenced deprecation warnings. + +### Fixed + +- Reverted BC break by reintroducing behavior to automagically fix a URI with a + relative path and an authority by adding a leading slash to the path. It's only + deprecated now. + + +## [1.4.0] - 2017-02-21 + +### Added + +- Added common URI utility methods based on RFC 3986 (see documentation in the readme): + - `Uri::isDefaultPort` + - `Uri::isAbsolute` + - `Uri::isNetworkPathReference` + - `Uri::isAbsolutePathReference` + - `Uri::isRelativePathReference` + - `Uri::isSameDocumentReference` + - `Uri::composeComponents` + - `UriNormalizer::normalize` + - `UriNormalizer::isEquivalent` + - `UriResolver::relativize` + +### Changed + +- Ensure `ServerRequest::getUriFromGlobals` returns a URI in absolute form. +- Allow `parse_response` to parse a response without delimiting space and reason. +- Ensure each URI modification results in a valid URI according to PSR-7 discussions. + Invalid modifications will throw an exception instead of returning a wrong URI or + doing some magic. + - `(new Uri)->withPath('foo')->withHost('example.com')` will throw an exception + because the path of a URI with an authority must start with a slash "/" or be empty + - `(new Uri())->withScheme('http')` will return `'http://localhost'` + +### Deprecated + +- `Uri::resolve` in favor of `UriResolver::resolve` +- `Uri::removeDotSegments` in favor of `UriResolver::removeDotSegments` + +### Fixed + +- `Stream::read` when length parameter <= 0. +- `copy_to_stream` reads bytes in chunks instead of `maxLen` into memory. +- `ServerRequest::getUriFromGlobals` when `Host` header contains port. +- Compatibility of URIs with `file` scheme and empty host. + + +## [1.3.1] - 2016-06-25 + +### Fixed + +- `Uri::__toString` for network path references, e.g. `//example.org`. +- Missing lowercase normalization for host. +- Handling of URI components in case they are `'0'` in a lot of places, + e.g. as a user info password. +- `Uri::withAddedHeader` to correctly merge headers with different case. +- Trimming of header values in `Uri::withAddedHeader`. Header values may + be surrounded by whitespace which should be ignored according to RFC 7230 + Section 3.2.4. This does not apply to header names. +- `Uri::withAddedHeader` with an array of header values. +- `Uri::resolve` when base path has no slash and handling of fragment. +- Handling of encoding in `Uri::with(out)QueryValue` so one can pass the + key/value both in encoded as well as decoded form to those methods. This is + consistent with withPath, withQuery etc. +- `ServerRequest::withoutAttribute` when attribute value is null. + + +## [1.3.0] - 2016-04-13 + +### Added + +- Remaining interfaces needed for full PSR7 compatibility + (ServerRequestInterface, UploadedFileInterface, etc.). +- Support for stream_for from scalars. + +### Changed + +- Can now extend Uri. + +### Fixed +- A bug in validating request methods by making it more permissive. + + +## [1.2.3] - 2016-02-18 + +### Fixed + +- Support in `GuzzleHttp\Psr7\CachingStream` for seeking forward on remote + streams, which can sometimes return fewer bytes than requested with `fread`. +- Handling of gzipped responses with FNAME headers. + + +## [1.2.2] - 2016-01-22 + +### Added + +- Support for URIs without any authority. +- Support for HTTP 451 'Unavailable For Legal Reasons.' +- Support for using '0' as a filename. +- Support for including non-standard ports in Host headers. + + +## [1.2.1] - 2015-11-02 + +### Changes + +- Now supporting negative offsets when seeking to SEEK_END. + + +## [1.2.0] - 2015-08-15 + +### Changed + +- Body as `"0"` is now properly added to a response. +- Now allowing forward seeking in CachingStream. +- Now properly parsing HTTP requests that contain proxy targets in + `parse_request`. +- functions.php is now conditionally required. +- user-info is no longer dropped when resolving URIs. + + +## [1.1.0] - 2015-06-24 + +### Changed + +- URIs can now be relative. +- `multipart/form-data` headers are now overridden case-insensitively. +- URI paths no longer encode the following characters because they are allowed + in URIs: "(", ")", "*", "!", "'" +- A port is no longer added to a URI when the scheme is missing and no port is + present. + + +## 1.0.0 - 2015-05-19 + +Initial release. + +Currently unsupported: + +- `Psr\Http\Message\ServerRequestInterface` +- `Psr\Http\Message\UploadedFileInterface` + + + +[1.6.0]: https://github.com/guzzle/psr7/compare/1.5.2...1.6.0 +[1.5.2]: https://github.com/guzzle/psr7/compare/1.5.1...1.5.2 +[1.5.1]: https://github.com/guzzle/psr7/compare/1.5.0...1.5.1 +[1.5.0]: https://github.com/guzzle/psr7/compare/1.4.2...1.5.0 +[1.4.2]: https://github.com/guzzle/psr7/compare/1.4.1...1.4.2 +[1.4.1]: https://github.com/guzzle/psr7/compare/1.4.0...1.4.1 +[1.4.0]: https://github.com/guzzle/psr7/compare/1.3.1...1.4.0 +[1.3.1]: https://github.com/guzzle/psr7/compare/1.3.0...1.3.1 +[1.3.0]: https://github.com/guzzle/psr7/compare/1.2.3...1.3.0 +[1.2.3]: https://github.com/guzzle/psr7/compare/1.2.2...1.2.3 +[1.2.2]: https://github.com/guzzle/psr7/compare/1.2.1...1.2.2 +[1.2.1]: https://github.com/guzzle/psr7/compare/1.2.0...1.2.1 +[1.2.0]: https://github.com/guzzle/psr7/compare/1.1.0...1.2.0 +[1.1.0]: https://github.com/guzzle/psr7/compare/1.0.0...1.1.0 diff --git a/vendor/guzzlehttp/psr7/LICENSE b/vendor/guzzlehttp/psr7/LICENSE new file mode 100644 index 0000000..581d95f --- /dev/null +++ b/vendor/guzzlehttp/psr7/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015 Michael Dowling, https://github.com/mtdowling + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/guzzlehttp/psr7/README.md b/vendor/guzzlehttp/psr7/README.md new file mode 100644 index 0000000..acfabfd --- /dev/null +++ b/vendor/guzzlehttp/psr7/README.md @@ -0,0 +1,809 @@ +# PSR-7 Message Implementation + +This repository contains a full [PSR-7](http://www.php-fig.org/psr/psr-7/) +message implementation, several stream decorators, and some helpful +functionality like query string parsing. + + +[![Build Status](https://travis-ci.org/guzzle/psr7.svg?branch=master)](https://travis-ci.org/guzzle/psr7) + + +# Stream implementation + +This package comes with a number of stream implementations and stream +decorators. + + +## AppendStream + +`GuzzleHttp\Psr7\AppendStream` + +Reads from multiple streams, one after the other. + +```php +use GuzzleHttp\Psr7; + +$a = Psr7\Utils::streamFor('abc, '); +$b = Psr7\Utils::streamFor('123.'); +$composed = new Psr7\AppendStream([$a, $b]); + +$composed->addStream(Psr7\Utils::streamFor(' Above all listen to me')); + +echo $composed; // abc, 123. Above all listen to me. +``` + + +## BufferStream + +`GuzzleHttp\Psr7\BufferStream` + +Provides a buffer stream that can be written to fill a buffer, and read +from to remove bytes from the buffer. + +This stream returns a "hwm" metadata value that tells upstream consumers +what the configured high water mark of the stream is, or the maximum +preferred size of the buffer. + +```php +use GuzzleHttp\Psr7; + +// When more than 1024 bytes are in the buffer, it will begin returning +// false to writes. This is an indication that writers should slow down. +$buffer = new Psr7\BufferStream(1024); +``` + + +## CachingStream + +The CachingStream is used to allow seeking over previously read bytes on +non-seekable streams. This can be useful when transferring a non-seekable +entity body fails due to needing to rewind the stream (for example, resulting +from a redirect). Data that is read from the remote stream will be buffered in +a PHP temp stream so that previously read bytes are cached first in memory, +then on disk. + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\Utils::streamFor(fopen('http://www.google.com', 'r')); +$stream = new Psr7\CachingStream($original); + +$stream->read(1024); +echo $stream->tell(); +// 1024 + +$stream->seek(0); +echo $stream->tell(); +// 0 +``` + + +## DroppingStream + +`GuzzleHttp\Psr7\DroppingStream` + +Stream decorator that begins dropping data once the size of the underlying +stream becomes too full. + +```php +use GuzzleHttp\Psr7; + +// Create an empty stream +$stream = Psr7\Utils::streamFor(); + +// Start dropping data when the stream has more than 10 bytes +$dropping = new Psr7\DroppingStream($stream, 10); + +$dropping->write('01234567890123456789'); +echo $stream; // 0123456789 +``` + + +## FnStream + +`GuzzleHttp\Psr7\FnStream` + +Compose stream implementations based on a hash of functions. + +Allows for easy testing and extension of a provided stream without needing +to create a concrete class for a simple extension point. + +```php + +use GuzzleHttp\Psr7; + +$stream = Psr7\Utils::streamFor('hi'); +$fnStream = Psr7\FnStream::decorate($stream, [ + 'rewind' => function () use ($stream) { + echo 'About to rewind - '; + $stream->rewind(); + echo 'rewound!'; + } +]); + +$fnStream->rewind(); +// Outputs: About to rewind - rewound! +``` + + +## InflateStream + +`GuzzleHttp\Psr7\InflateStream` + +Uses PHP's zlib.inflate filter to inflate deflate or gzipped content. + +This stream decorator skips the first 10 bytes of the given stream to remove +the gzip header, converts the provided stream to a PHP stream resource, +then appends the zlib.inflate filter. The stream is then converted back +to a Guzzle stream resource to be used as a Guzzle stream. + + +## LazyOpenStream + +`GuzzleHttp\Psr7\LazyOpenStream` + +Lazily reads or writes to a file that is opened only after an IO operation +take place on the stream. + +```php +use GuzzleHttp\Psr7; + +$stream = new Psr7\LazyOpenStream('/path/to/file', 'r'); +// The file has not yet been opened... + +echo $stream->read(10); +// The file is opened and read from only when needed. +``` + + +## LimitStream + +`GuzzleHttp\Psr7\LimitStream` + +LimitStream can be used to read a subset or slice of an existing stream object. +This can be useful for breaking a large file into smaller pieces to be sent in +chunks (e.g. Amazon S3's multipart upload API). + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\Utils::streamFor(fopen('/tmp/test.txt', 'r+')); +echo $original->getSize(); +// >>> 1048576 + +// Limit the size of the body to 1024 bytes and start reading from byte 2048 +$stream = new Psr7\LimitStream($original, 1024, 2048); +echo $stream->getSize(); +// >>> 1024 +echo $stream->tell(); +// >>> 0 +``` + + +## MultipartStream + +`GuzzleHttp\Psr7\MultipartStream` + +Stream that when read returns bytes for a streaming multipart or +multipart/form-data stream. + + +## NoSeekStream + +`GuzzleHttp\Psr7\NoSeekStream` + +NoSeekStream wraps a stream and does not allow seeking. + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\Utils::streamFor('foo'); +$noSeek = new Psr7\NoSeekStream($original); + +echo $noSeek->read(3); +// foo +var_export($noSeek->isSeekable()); +// false +$noSeek->seek(0); +var_export($noSeek->read(3)); +// NULL +``` + + +## PumpStream + +`GuzzleHttp\Psr7\PumpStream` + +Provides a read only stream that pumps data from a PHP callable. + +When invoking the provided callable, the PumpStream will pass the amount of +data requested to read to the callable. The callable can choose to ignore +this value and return fewer or more bytes than requested. Any extra data +returned by the provided callable is buffered internally until drained using +the read() function of the PumpStream. The provided callable MUST return +false when there is no more data to read. + + +## Implementing stream decorators + +Creating a stream decorator is very easy thanks to the +`GuzzleHttp\Psr7\StreamDecoratorTrait`. This trait provides methods that +implement `Psr\Http\Message\StreamInterface` by proxying to an underlying +stream. Just `use` the `StreamDecoratorTrait` and implement your custom +methods. + +For example, let's say we wanted to call a specific function each time the last +byte is read from a stream. This could be implemented by overriding the +`read()` method. + +```php +use Psr\Http\Message\StreamInterface; +use GuzzleHttp\Psr7\StreamDecoratorTrait; + +class EofCallbackStream implements StreamInterface +{ + use StreamDecoratorTrait; + + private $callback; + + public function __construct(StreamInterface $stream, callable $cb) + { + $this->stream = $stream; + $this->callback = $cb; + } + + public function read($length) + { + $result = $this->stream->read($length); + + // Invoke the callback when EOF is hit. + if ($this->eof()) { + call_user_func($this->callback); + } + + return $result; + } +} +``` + +This decorator could be added to any existing stream and used like so: + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\Utils::streamFor('foo'); + +$eofStream = new EofCallbackStream($original, function () { + echo 'EOF!'; +}); + +$eofStream->read(2); +$eofStream->read(1); +// echoes "EOF!" +$eofStream->seek(0); +$eofStream->read(3); +// echoes "EOF!" +``` + + +## PHP StreamWrapper + +You can use the `GuzzleHttp\Psr7\StreamWrapper` class if you need to use a +PSR-7 stream as a PHP stream resource. + +Use the `GuzzleHttp\Psr7\StreamWrapper::getResource()` method to create a PHP +stream from a PSR-7 stream. + +```php +use GuzzleHttp\Psr7\StreamWrapper; + +$stream = GuzzleHttp\Psr7\Utils::streamFor('hello!'); +$resource = StreamWrapper::getResource($stream); +echo fread($resource, 6); // outputs hello! +``` + + +# Static API + +There are various static methods available under the `GuzzleHttp\Psr7` namespace. + + +## `GuzzleHttp\Psr7\Message::toString` + +`public static function toString(MessageInterface $message): string` + +Returns the string representation of an HTTP message. + +```php +$request = new GuzzleHttp\Psr7\Request('GET', 'http://example.com'); +echo GuzzleHttp\Psr7\Message::toString($request); +``` + + +## `GuzzleHttp\Psr7\Message::bodySummary` + +`public static function bodySummary(MessageInterface $message, int $truncateAt = 120): string|null` + +Get a short summary of the message body. + +Will return `null` if the response is not printable. + + +## `GuzzleHttp\Psr7\Message::rewindBody` + +`public static function rewindBody(MessageInterface $message): void` + +Attempts to rewind a message body and throws an exception on failure. + +The body of the message will only be rewound if a call to `tell()` +returns a value other than `0`. + + +## `GuzzleHttp\Psr7\Message::parseMessage` + +`public static function parseMessage(string $message): array` + +Parses an HTTP message into an associative array. + +The array contains the "start-line" key containing the start line of +the message, "headers" key containing an associative array of header +array values, and a "body" key containing the body of the message. + + +## `GuzzleHttp\Psr7\Message::parseRequestUri` + +`public static function parseRequestUri(string $path, array $headers): string` + +Constructs a URI for an HTTP request message. + + +## `GuzzleHttp\Psr7\Message::parseRequest` + +`public static function parseRequest(string $message): Request` + +Parses a request message string into a request object. + + +## `GuzzleHttp\Psr7\Message::parseResponse` + +`public static function parseResponse(string $message): Response` + +Parses a response message string into a response object. + + +## `GuzzleHttp\Psr7\Header::parse` + +`public static function parse(string|array $header): array` + +Parse an array of header values containing ";" separated data into an +array of associative arrays representing the header key value pair data +of the header. When a parameter does not contain a value, but just +contains a key, this function will inject a key with a '' string value. + + +## `GuzzleHttp\Psr7\Header::normalize` + +`public static function normalize(string|array $header): array` + +Converts an array of header values that may contain comma separated +headers into an array of headers with no comma separated values. + + +## `GuzzleHttp\Psr7\Query::parse` + +`public static function parse(string $str, int|bool $urlEncoding = true): array` + +Parse a query string into an associative array. + +If multiple values are found for the same key, the value of that key +value pair will become an array. This function does not parse nested +PHP style arrays into an associative array (e.g., `foo[a]=1&foo[b]=2` +will be parsed into `['foo[a]' => '1', 'foo[b]' => '2'])`. + + +## `GuzzleHttp\Psr7\Query::build` + +`public static function build(array $params, int|false $encoding = PHP_QUERY_RFC3986): string` + +Build a query string from an array of key value pairs. + +This function can use the return value of `parse()` to build a query +string. This function does not modify the provided keys when an array is +encountered (like `http_build_query()` would). + + +## `GuzzleHttp\Psr7\Utils::caselessRemove` + +`public static function caselessRemove(iterable $keys, $keys, array $data): array` + +Remove the items given by the keys, case insensitively from the data. + + +## `GuzzleHttp\Psr7\Utils::copyToStream` + +`public static function copyToStream(StreamInterface $source, StreamInterface $dest, int $maxLen = -1): void` + +Copy the contents of a stream into another stream until the given number +of bytes have been read. + + +## `GuzzleHttp\Psr7\Utils::copyToString` + +`public static function copyToString(StreamInterface $stream, int $maxLen = -1): string` + +Copy the contents of a stream into a string until the given number of +bytes have been read. + + +## `GuzzleHttp\Psr7\Utils::hash` + +`public static function hash(StreamInterface $stream, string $algo, bool $rawOutput = false): string` + +Calculate a hash of a stream. + +This method reads the entire stream to calculate a rolling hash, based on +PHP's `hash_init` functions. + + +## `GuzzleHttp\Psr7\Utils::modifyRequest` + +`public static function modifyRequest(RequestInterface $request, array $changes): RequestInterface` + +Clone and modify a request with the given changes. + +This method is useful for reducing the number of clones needed to mutate +a message. + +- method: (string) Changes the HTTP method. +- set_headers: (array) Sets the given headers. +- remove_headers: (array) Remove the given headers. +- body: (mixed) Sets the given body. +- uri: (UriInterface) Set the URI. +- query: (string) Set the query string value of the URI. +- version: (string) Set the protocol version. + + +## `GuzzleHttp\Psr7\Utils::readLine` + +`public static function readLine(StreamInterface $stream, int $maxLength = null): string` + +Read a line from the stream up to the maximum allowed buffer length. + + +## `GuzzleHttp\Psr7\Utils::streamFor` + +`public static function streamFor(resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource = '', array $options = []): StreamInterface` + +Create a new stream based on the input type. + +Options is an associative array that can contain the following keys: + +- metadata: Array of custom metadata. +- size: Size of the stream. + +This method accepts the following `$resource` types: + +- `Psr\Http\Message\StreamInterface`: Returns the value as-is. +- `string`: Creates a stream object that uses the given string as the contents. +- `resource`: Creates a stream object that wraps the given PHP stream resource. +- `Iterator`: If the provided value implements `Iterator`, then a read-only + stream object will be created that wraps the given iterable. Each time the + stream is read from, data from the iterator will fill a buffer and will be + continuously called until the buffer is equal to the requested read size. + Subsequent read calls will first read from the buffer and then call `next` + on the underlying iterator until it is exhausted. +- `object` with `__toString()`: If the object has the `__toString()` method, + the object will be cast to a string and then a stream will be returned that + uses the string value. +- `NULL`: When `null` is passed, an empty stream object is returned. +- `callable` When a callable is passed, a read-only stream object will be + created that invokes the given callable. The callable is invoked with the + number of suggested bytes to read. The callable can return any number of + bytes, but MUST return `false` when there is no more data to return. The + stream object that wraps the callable will invoke the callable until the + number of requested bytes are available. Any additional bytes will be + buffered and used in subsequent reads. + +```php +$stream = GuzzleHttp\Psr7\Utils::streamFor('foo'); +$stream = GuzzleHttp\Psr7\Utils::streamFor(fopen('/path/to/file', 'r')); + +$generator = function ($bytes) { + for ($i = 0; $i < $bytes; $i++) { + yield ' '; + } +} + +$stream = GuzzleHttp\Psr7\Utils::streamFor($generator(100)); +``` + + +## `GuzzleHttp\Psr7\Utils::tryFopen` + +`public static function tryFopen(string $filename, string $mode): resource` + +Safely opens a PHP stream resource using a filename. + +When fopen fails, PHP normally raises a warning. This function adds an +error handler that checks for errors and throws an exception instead. + + +## `GuzzleHttp\Psr7\Utils::uriFor` + +`public static function uriFor(string|UriInterface $uri): UriInterface` + +Returns a UriInterface for the given value. + +This function accepts a string or UriInterface and returns a +UriInterface for the given value. If the value is already a +UriInterface, it is returned as-is. + + +## `GuzzleHttp\Psr7\MimeType::fromFilename` + +`public static function fromFilename(string $filename): string|null` + +Determines the mimetype of a file by looking at its extension. + + +## `GuzzleHttp\Psr7\MimeType::fromExtension` + +`public static function fromExtension(string $extension): string|null` + +Maps a file extensions to a mimetype. + + +## Upgrading from Function API + +The static API was first introduced in 1.7.0, in order to mitigate problems with functions conflicting between global and local copies of the package. The function API will be removed in 2.0.0. A migration table has been provided here for your convenience: + +| Original Function | Replacement Method | +|----------------|----------------| +| `str` | `Message::toString` | +| `uri_for` | `Utils::uriFor` | +| `stream_for` | `Utils::streamFor` | +| `parse_header` | `Header::parse` | +| `normalize_header` | `Header::normalize` | +| `modify_request` | `Utils::modifyRequest` | +| `rewind_body` | `Message::rewindBody` | +| `try_fopen` | `Utils::tryFopen` | +| `copy_to_string` | `Utils::copyToString` | +| `copy_to_stream` | `Utils::copyToStream` | +| `hash` | `Utils::hash` | +| `readline` | `Utils::readLine` | +| `parse_request` | `Message::parseRequest` | +| `parse_response` | `Message::parseResponse` | +| `parse_query` | `Query::parse` | +| `build_query` | `Query::build` | +| `mimetype_from_filename` | `MimeType::fromFilename` | +| `mimetype_from_extension` | `MimeType::fromExtension` | +| `_parse_message` | `Message::parseMessage` | +| `_parse_request_uri` | `Message::parseRequestUri` | +| `get_message_body_summary` | `Message::bodySummary` | +| `_caseless_remove` | `Utils::caselessRemove` | + + +# Additional URI Methods + +Aside from the standard `Psr\Http\Message\UriInterface` implementation in form of the `GuzzleHttp\Psr7\Uri` class, +this library also provides additional functionality when working with URIs as static methods. + +## URI Types + +An instance of `Psr\Http\Message\UriInterface` can either be an absolute URI or a relative reference. +An absolute URI has a scheme. A relative reference is used to express a URI relative to another URI, +the base URI. Relative references can be divided into several forms according to +[RFC 3986 Section 4.2](https://tools.ietf.org/html/rfc3986#section-4.2): + +- network-path references, e.g. `//example.com/path` +- absolute-path references, e.g. `/path` +- relative-path references, e.g. `subpath` + +The following methods can be used to identify the type of the URI. + +### `GuzzleHttp\Psr7\Uri::isAbsolute` + +`public static function isAbsolute(UriInterface $uri): bool` + +Whether the URI is absolute, i.e. it has a scheme. + +### `GuzzleHttp\Psr7\Uri::isNetworkPathReference` + +`public static function isNetworkPathReference(UriInterface $uri): bool` + +Whether the URI is a network-path reference. A relative reference that begins with two slash characters is +termed an network-path reference. + +### `GuzzleHttp\Psr7\Uri::isAbsolutePathReference` + +`public static function isAbsolutePathReference(UriInterface $uri): bool` + +Whether the URI is a absolute-path reference. A relative reference that begins with a single slash character is +termed an absolute-path reference. + +### `GuzzleHttp\Psr7\Uri::isRelativePathReference` + +`public static function isRelativePathReference(UriInterface $uri): bool` + +Whether the URI is a relative-path reference. A relative reference that does not begin with a slash character is +termed a relative-path reference. + +### `GuzzleHttp\Psr7\Uri::isSameDocumentReference` + +`public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool` + +Whether the URI is a same-document reference. A same-document reference refers to a URI that is, aside from its +fragment component, identical to the base URI. When no base URI is given, only an empty URI reference +(apart from its fragment) is considered a same-document reference. + +## URI Components + +Additional methods to work with URI components. + +### `GuzzleHttp\Psr7\Uri::isDefaultPort` + +`public static function isDefaultPort(UriInterface $uri): bool` + +Whether the URI has the default port of the current scheme. `Psr\Http\Message\UriInterface::getPort` may return null +or the standard port. This method can be used independently of the implementation. + +### `GuzzleHttp\Psr7\Uri::composeComponents` + +`public static function composeComponents($scheme, $authority, $path, $query, $fragment): string` + +Composes a URI reference string from its various components according to +[RFC 3986 Section 5.3](https://tools.ietf.org/html/rfc3986#section-5.3). Usually this method does not need to be called +manually but instead is used indirectly via `Psr\Http\Message\UriInterface::__toString`. + +### `GuzzleHttp\Psr7\Uri::fromParts` + +`public static function fromParts(array $parts): UriInterface` + +Creates a URI from a hash of [`parse_url`](http://php.net/manual/en/function.parse-url.php) components. + + +### `GuzzleHttp\Psr7\Uri::withQueryValue` + +`public static function withQueryValue(UriInterface $uri, $key, $value): UriInterface` + +Creates a new URI with a specific query string value. Any existing query string values that exactly match the +provided key are removed and replaced with the given key value pair. A value of null will set the query string +key without a value, e.g. "key" instead of "key=value". + +### `GuzzleHttp\Psr7\Uri::withQueryValues` + +`public static function withQueryValues(UriInterface $uri, array $keyValueArray): UriInterface` + +Creates a new URI with multiple query string values. It has the same behavior as `withQueryValue()` but for an +associative array of key => value. + +### `GuzzleHttp\Psr7\Uri::withoutQueryValue` + +`public static function withoutQueryValue(UriInterface $uri, $key): UriInterface` + +Creates a new URI with a specific query string value removed. Any existing query string values that exactly match the +provided key are removed. + +## Reference Resolution + +`GuzzleHttp\Psr7\UriResolver` provides methods to resolve a URI reference in the context of a base URI according +to [RFC 3986 Section 5](https://tools.ietf.org/html/rfc3986#section-5). This is for example also what web browsers +do when resolving a link in a website based on the current request URI. + +### `GuzzleHttp\Psr7\UriResolver::resolve` + +`public static function resolve(UriInterface $base, UriInterface $rel): UriInterface` + +Converts the relative URI into a new URI that is resolved against the base URI. + +### `GuzzleHttp\Psr7\UriResolver::removeDotSegments` + +`public static function removeDotSegments(string $path): string` + +Removes dot segments from a path and returns the new path according to +[RFC 3986 Section 5.2.4](https://tools.ietf.org/html/rfc3986#section-5.2.4). + +### `GuzzleHttp\Psr7\UriResolver::relativize` + +`public static function relativize(UriInterface $base, UriInterface $target): UriInterface` + +Returns the target URI as a relative reference from the base URI. This method is the counterpart to resolve(): + +```php +(string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) +``` + +One use-case is to use the current request URI as base URI and then generate relative links in your documents +to reduce the document size or offer self-contained downloadable document archives. + +```php +$base = new Uri('http://example.com/a/b/'); +echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. +echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. +echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. +echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. +``` + +## Normalization and Comparison + +`GuzzleHttp\Psr7\UriNormalizer` provides methods to normalize and compare URIs according to +[RFC 3986 Section 6](https://tools.ietf.org/html/rfc3986#section-6). + +### `GuzzleHttp\Psr7\UriNormalizer::normalize` + +`public static function normalize(UriInterface $uri, $flags = self::PRESERVING_NORMALIZATIONS): UriInterface` + +Returns a normalized URI. The scheme and host component are already normalized to lowercase per PSR-7 UriInterface. +This methods adds additional normalizations that can be configured with the `$flags` parameter which is a bitmask +of normalizations to apply. The following normalizations are available: + +- `UriNormalizer::PRESERVING_NORMALIZATIONS` + + Default normalizations which only include the ones that preserve semantics. + +- `UriNormalizer::CAPITALIZE_PERCENT_ENCODING` + + All letters within a percent-encoding triplet (e.g., "%3A") are case-insensitive, and should be capitalized. + + Example: `http://example.org/a%c2%b1b` → `http://example.org/a%C2%B1b` + +- `UriNormalizer::DECODE_UNRESERVED_CHARACTERS` + + Decodes percent-encoded octets of unreserved characters. For consistency, percent-encoded octets in the ranges of + ALPHA (%41–%5A and %61–%7A), DIGIT (%30–%39), hyphen (%2D), period (%2E), underscore (%5F), or tilde (%7E) should + not be created by URI producers and, when found in a URI, should be decoded to their corresponding unreserved + characters by URI normalizers. + + Example: `http://example.org/%7Eusern%61me/` → `http://example.org/~username/` + +- `UriNormalizer::CONVERT_EMPTY_PATH` + + Converts the empty path to "/" for http and https URIs. + + Example: `http://example.org` → `http://example.org/` + +- `UriNormalizer::REMOVE_DEFAULT_HOST` + + Removes the default host of the given URI scheme from the URI. Only the "file" scheme defines the default host + "localhost". All of `file:/myfile`, `file:///myfile`, and `file://localhost/myfile` are equivalent according to + RFC 3986. + + Example: `file://localhost/myfile` → `file:///myfile` + +- `UriNormalizer::REMOVE_DEFAULT_PORT` + + Removes the default port of the given URI scheme from the URI. + + Example: `http://example.org:80/` → `http://example.org/` + +- `UriNormalizer::REMOVE_DOT_SEGMENTS` + + Removes unnecessary dot-segments. Dot-segments in relative-path references are not removed as it would + change the semantics of the URI reference. + + Example: `http://example.org/../a/b/../c/./d.html` → `http://example.org/a/c/d.html` + +- `UriNormalizer::REMOVE_DUPLICATE_SLASHES` + + Paths which include two or more adjacent slashes are converted to one. Webservers usually ignore duplicate slashes + and treat those URIs equivalent. But in theory those URIs do not need to be equivalent. So this normalization + may change the semantics. Encoded slashes (%2F) are not removed. + + Example: `http://example.org//foo///bar.html` → `http://example.org/foo/bar.html` + +- `UriNormalizer::SORT_QUERY_PARAMETERS` + + Sort query parameters with their values in alphabetical order. However, the order of parameters in a URI may be + significant (this is not defined by the standard). So this normalization is not safe and may change the semantics + of the URI. + + Example: `?lang=en&article=fred` → `?article=fred&lang=en` + +### `GuzzleHttp\Psr7\UriNormalizer::isEquivalent` + +`public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS): bool` + +Whether two URIs can be considered equivalent. Both URIs are normalized automatically before comparison with the given +`$normalizations` bitmask. The method also accepts relative URI references and returns true when they are equivalent. +This of course assumes they will be resolved against the same base URI. If this is not the case, determination of +equivalence or difference of relative references does not mean anything. diff --git a/vendor/guzzlehttp/psr7/composer.json b/vendor/guzzlehttp/psr7/composer.json new file mode 100644 index 0000000..58dcb07 --- /dev/null +++ b/vendor/guzzlehttp/psr7/composer.json @@ -0,0 +1,49 @@ +{ + "name": "guzzlehttp/psr7", + "type": "library", + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": ["request", "response", "message", "stream", "http", "uri", "url", "psr-7"], + "license": "MIT", + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10", + "ext-zlib": "*" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": ["src/functions_include.php"] + }, + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Tests\\Psr7\\": "tests/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/AppendStream.php b/vendor/guzzlehttp/psr7/src/AppendStream.php new file mode 100644 index 0000000..d4e9e87 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/AppendStream.php @@ -0,0 +1,246 @@ +addStream($stream); + } + } + + public function __toString() + { + try { + $this->rewind(); + return $this->getContents(); + } catch (\Exception $e) { + return ''; + } + } + + /** + * Add a stream to the AppendStream + * + * @param StreamInterface $stream Stream to append. Must be readable. + * + * @throws \InvalidArgumentException if the stream is not readable + */ + public function addStream(StreamInterface $stream) + { + if (!$stream->isReadable()) { + throw new \InvalidArgumentException('Each stream must be readable'); + } + + // The stream is only seekable if all streams are seekable + if (!$stream->isSeekable()) { + $this->seekable = false; + } + + $this->streams[] = $stream; + } + + public function getContents() + { + return Utils::copyToString($this); + } + + /** + * Closes each attached stream. + * + * {@inheritdoc} + */ + public function close() + { + $this->pos = $this->current = 0; + $this->seekable = true; + + foreach ($this->streams as $stream) { + $stream->close(); + } + + $this->streams = []; + } + + /** + * Detaches each attached stream. + * + * Returns null as it's not clear which underlying stream resource to return. + * + * {@inheritdoc} + */ + public function detach() + { + $this->pos = $this->current = 0; + $this->seekable = true; + + foreach ($this->streams as $stream) { + $stream->detach(); + } + + $this->streams = []; + + return null; + } + + public function tell() + { + return $this->pos; + } + + /** + * Tries to calculate the size by adding the size of each stream. + * + * If any of the streams do not return a valid number, then the size of the + * append stream cannot be determined and null is returned. + * + * {@inheritdoc} + */ + public function getSize() + { + $size = 0; + + foreach ($this->streams as $stream) { + $s = $stream->getSize(); + if ($s === null) { + return null; + } + $size += $s; + } + + return $size; + } + + public function eof() + { + return !$this->streams || + ($this->current >= count($this->streams) - 1 && + $this->streams[$this->current]->eof()); + } + + public function rewind() + { + $this->seek(0); + } + + /** + * Attempts to seek to the given position. Only supports SEEK_SET. + * + * {@inheritdoc} + */ + public function seek($offset, $whence = SEEK_SET) + { + if (!$this->seekable) { + throw new \RuntimeException('This AppendStream is not seekable'); + } elseif ($whence !== SEEK_SET) { + throw new \RuntimeException('The AppendStream can only seek with SEEK_SET'); + } + + $this->pos = $this->current = 0; + + // Rewind each stream + foreach ($this->streams as $i => $stream) { + try { + $stream->rewind(); + } catch (\Exception $e) { + throw new \RuntimeException('Unable to seek stream ' + . $i . ' of the AppendStream', 0, $e); + } + } + + // Seek to the actual position by reading from each stream + while ($this->pos < $offset && !$this->eof()) { + $result = $this->read(min(8096, $offset - $this->pos)); + if ($result === '') { + break; + } + } + } + + /** + * Reads from all of the appended streams until the length is met or EOF. + * + * {@inheritdoc} + */ + public function read($length) + { + $buffer = ''; + $total = count($this->streams) - 1; + $remaining = $length; + $progressToNext = false; + + while ($remaining > 0) { + + // Progress to the next stream if needed. + if ($progressToNext || $this->streams[$this->current]->eof()) { + $progressToNext = false; + if ($this->current === $total) { + break; + } + $this->current++; + } + + $result = $this->streams[$this->current]->read($remaining); + + // Using a loose comparison here to match on '', false, and null + if ($result == null) { + $progressToNext = true; + continue; + } + + $buffer .= $result; + $remaining = $length - strlen($buffer); + } + + $this->pos += strlen($buffer); + + return $buffer; + } + + public function isReadable() + { + return true; + } + + public function isWritable() + { + return false; + } + + public function isSeekable() + { + return $this->seekable; + } + + public function write($string) + { + throw new \RuntimeException('Cannot write to an AppendStream'); + } + + public function getMetadata($key = null) + { + return $key ? null : []; + } +} diff --git a/vendor/guzzlehttp/psr7/src/BufferStream.php b/vendor/guzzlehttp/psr7/src/BufferStream.php new file mode 100644 index 0000000..21e8a99 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/BufferStream.php @@ -0,0 +1,142 @@ +hwm = $hwm; + } + + public function __toString() + { + return $this->getContents(); + } + + public function getContents() + { + $buffer = $this->buffer; + $this->buffer = ''; + + return $buffer; + } + + public function close() + { + $this->buffer = ''; + } + + public function detach() + { + $this->close(); + + return null; + } + + public function getSize() + { + return strlen($this->buffer); + } + + public function isReadable() + { + return true; + } + + public function isWritable() + { + return true; + } + + public function isSeekable() + { + return false; + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + throw new \RuntimeException('Cannot seek a BufferStream'); + } + + public function eof() + { + return strlen($this->buffer) === 0; + } + + public function tell() + { + throw new \RuntimeException('Cannot determine the position of a BufferStream'); + } + + /** + * Reads data from the buffer. + */ + public function read($length) + { + $currentLength = strlen($this->buffer); + + if ($length >= $currentLength) { + // No need to slice the buffer because we don't have enough data. + $result = $this->buffer; + $this->buffer = ''; + } else { + // Slice up the result to provide a subset of the buffer. + $result = substr($this->buffer, 0, $length); + $this->buffer = substr($this->buffer, $length); + } + + return $result; + } + + /** + * Writes data to the buffer. + */ + public function write($string) + { + $this->buffer .= $string; + + // TODO: What should happen here? + if (strlen($this->buffer) >= $this->hwm) { + return false; + } + + return strlen($string); + } + + public function getMetadata($key = null) + { + if ($key == 'hwm') { + return $this->hwm; + } + + return $key ? null : []; + } +} diff --git a/vendor/guzzlehttp/psr7/src/CachingStream.php b/vendor/guzzlehttp/psr7/src/CachingStream.php new file mode 100644 index 0000000..7000593 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/CachingStream.php @@ -0,0 +1,141 @@ +remoteStream = $stream; + $this->stream = $target ?: new Stream(Utils::tryFopen('php://temp', 'r+')); + } + + public function getSize() + { + return max($this->stream->getSize(), $this->remoteStream->getSize()); + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + if ($whence == SEEK_SET) { + $byte = $offset; + } elseif ($whence == SEEK_CUR) { + $byte = $offset + $this->tell(); + } elseif ($whence == SEEK_END) { + $size = $this->remoteStream->getSize(); + if ($size === null) { + $size = $this->cacheEntireStream(); + } + $byte = $size + $offset; + } else { + throw new \InvalidArgumentException('Invalid whence'); + } + + $diff = $byte - $this->stream->getSize(); + + if ($diff > 0) { + // Read the remoteStream until we have read in at least the amount + // of bytes requested, or we reach the end of the file. + while ($diff > 0 && !$this->remoteStream->eof()) { + $this->read($diff); + $diff = $byte - $this->stream->getSize(); + } + } else { + // We can just do a normal seek since we've already seen this byte. + $this->stream->seek($byte); + } + } + + public function read($length) + { + // Perform a regular read on any previously read data from the buffer + $data = $this->stream->read($length); + $remaining = $length - strlen($data); + + // More data was requested so read from the remote stream + if ($remaining) { + // If data was written to the buffer in a position that would have + // been filled from the remote stream, then we must skip bytes on + // the remote stream to emulate overwriting bytes from that + // position. This mimics the behavior of other PHP stream wrappers. + $remoteData = $this->remoteStream->read( + $remaining + $this->skipReadBytes + ); + + if ($this->skipReadBytes) { + $len = strlen($remoteData); + $remoteData = substr($remoteData, $this->skipReadBytes); + $this->skipReadBytes = max(0, $this->skipReadBytes - $len); + } + + $data .= $remoteData; + $this->stream->write($remoteData); + } + + return $data; + } + + public function write($string) + { + // When appending to the end of the currently read stream, you'll want + // to skip bytes from being read from the remote stream to emulate + // other stream wrappers. Basically replacing bytes of data of a fixed + // length. + $overflow = (strlen($string) + $this->tell()) - $this->remoteStream->tell(); + if ($overflow > 0) { + $this->skipReadBytes += $overflow; + } + + return $this->stream->write($string); + } + + public function eof() + { + return $this->stream->eof() && $this->remoteStream->eof(); + } + + /** + * Close both the remote stream and buffer stream + */ + public function close() + { + $this->remoteStream->close() && $this->stream->close(); + } + + private function cacheEntireStream() + { + $target = new FnStream(['write' => 'strlen']); + Utils::copyToStream($this, $target); + + return $this->tell(); + } +} diff --git a/vendor/guzzlehttp/psr7/src/DroppingStream.php b/vendor/guzzlehttp/psr7/src/DroppingStream.php new file mode 100644 index 0000000..680a697 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/DroppingStream.php @@ -0,0 +1,45 @@ +stream = $stream; + $this->maxLength = $maxLength; + } + + public function write($string) + { + $diff = $this->maxLength - $this->stream->getSize(); + + // Begin returning 0 when the underlying stream is too large. + if ($diff <= 0) { + return 0; + } + + // Write the stream or a subset of the stream if needed. + if (strlen($string) < $diff) { + return $this->stream->write($string); + } + + return $this->stream->write(substr($string, 0, $diff)); + } +} diff --git a/vendor/guzzlehttp/psr7/src/FnStream.php b/vendor/guzzlehttp/psr7/src/FnStream.php new file mode 100644 index 0000000..6c93a50 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/FnStream.php @@ -0,0 +1,163 @@ +methods = $methods; + + // Create the functions on the class + foreach ($methods as $name => $fn) { + $this->{'_fn_' . $name} = $fn; + } + } + + /** + * Lazily determine which methods are not implemented. + * + * @throws \BadMethodCallException + */ + public function __get($name) + { + throw new \BadMethodCallException(str_replace('_fn_', '', $name) + . '() is not implemented in the FnStream'); + } + + /** + * The close method is called on the underlying stream only if possible. + */ + public function __destruct() + { + if (isset($this->_fn_close)) { + call_user_func($this->_fn_close); + } + } + + /** + * An unserialize would allow the __destruct to run when the unserialized value goes out of scope. + * + * @throws \LogicException + */ + public function __wakeup() + { + throw new \LogicException('FnStream should never be unserialized'); + } + + /** + * Adds custom functionality to an underlying stream by intercepting + * specific method calls. + * + * @param StreamInterface $stream Stream to decorate + * @param array $methods Hash of method name to a closure + * + * @return FnStream + */ + public static function decorate(StreamInterface $stream, array $methods) + { + // If any of the required methods were not provided, then simply + // proxy to the decorated stream. + foreach (array_diff(self::$slots, array_keys($methods)) as $diff) { + $methods[$diff] = [$stream, $diff]; + } + + return new self($methods); + } + + public function __toString() + { + return call_user_func($this->_fn___toString); + } + + public function close() + { + return call_user_func($this->_fn_close); + } + + public function detach() + { + return call_user_func($this->_fn_detach); + } + + public function getSize() + { + return call_user_func($this->_fn_getSize); + } + + public function tell() + { + return call_user_func($this->_fn_tell); + } + + public function eof() + { + return call_user_func($this->_fn_eof); + } + + public function isSeekable() + { + return call_user_func($this->_fn_isSeekable); + } + + public function rewind() + { + call_user_func($this->_fn_rewind); + } + + public function seek($offset, $whence = SEEK_SET) + { + call_user_func($this->_fn_seek, $offset, $whence); + } + + public function isWritable() + { + return call_user_func($this->_fn_isWritable); + } + + public function write($string) + { + return call_user_func($this->_fn_write, $string); + } + + public function isReadable() + { + return call_user_func($this->_fn_isReadable); + } + + public function read($length) + { + return call_user_func($this->_fn_read, $length); + } + + public function getContents() + { + return call_user_func($this->_fn_getContents); + } + + public function getMetadata($key = null) + { + return call_user_func($this->_fn_getMetadata, $key); + } +} diff --git a/vendor/guzzlehttp/psr7/src/Header.php b/vendor/guzzlehttp/psr7/src/Header.php new file mode 100644 index 0000000..865d742 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Header.php @@ -0,0 +1,71 @@ +]+>|[^=]+/', $kvp, $matches)) { + $m = $matches[0]; + if (isset($m[1])) { + $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed); + } else { + $part[] = trim($m[0], $trimmed); + } + } + } + if ($part) { + $params[] = $part; + } + } + + return $params; + } + + /** + * Converts an array of header values that may contain comma separated + * headers into an array of headers with no comma separated values. + * + * @param string|array $header Header to normalize. + * + * @return array Returns the normalized header field values. + */ + public static function normalize($header) + { + if (!is_array($header)) { + return array_map('trim', explode(',', $header)); + } + + $result = []; + foreach ($header as $value) { + foreach ((array) $value as $v) { + if (strpos($v, ',') === false) { + $result[] = $v; + continue; + } + foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) { + $result[] = trim($vv); + } + } + } + + return $result; + } +} diff --git a/vendor/guzzlehttp/psr7/src/InflateStream.php b/vendor/guzzlehttp/psr7/src/InflateStream.php new file mode 100644 index 0000000..2066f9d --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/InflateStream.php @@ -0,0 +1,56 @@ +read(10); + $filenameHeaderLength = $this->getLengthOfPossibleFilenameHeader($stream, $header); + // Skip the header, that is 10 + length of filename + 1 (nil) bytes + $stream = new LimitStream($stream, -1, 10 + $filenameHeaderLength); + $resource = StreamWrapper::getResource($stream); + stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ); + $this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource)); + } + + /** + * @param StreamInterface $stream + * @param $header + * + * @return int + */ + private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header) + { + $filename_header_length = 0; + + if (substr(bin2hex($header), 6, 2) === '08') { + // we have a filename, read until nil + $filename_header_length = 1; + while ($stream->read(1) !== chr(0)) { + $filename_header_length++; + } + } + + return $filename_header_length; + } +} diff --git a/vendor/guzzlehttp/psr7/src/LazyOpenStream.php b/vendor/guzzlehttp/psr7/src/LazyOpenStream.php new file mode 100644 index 0000000..72ef6ff --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/LazyOpenStream.php @@ -0,0 +1,42 @@ +filename = $filename; + $this->mode = $mode; + } + + /** + * Creates the underlying stream lazily when required. + * + * @return StreamInterface + */ + protected function createStream() + { + return Utils::streamFor(Utils::tryFopen($this->filename, $this->mode)); + } +} diff --git a/vendor/guzzlehttp/psr7/src/LimitStream.php b/vendor/guzzlehttp/psr7/src/LimitStream.php new file mode 100644 index 0000000..26ef188 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/LimitStream.php @@ -0,0 +1,157 @@ +stream = $stream; + $this->setLimit($limit); + $this->setOffset($offset); + } + + public function eof() + { + // Always return true if the underlying stream is EOF + if ($this->stream->eof()) { + return true; + } + + // No limit and the underlying stream is not at EOF + if ($this->limit == -1) { + return false; + } + + return $this->stream->tell() >= $this->offset + $this->limit; + } + + /** + * Returns the size of the limited subset of data + * {@inheritdoc} + */ + public function getSize() + { + if (null === ($length = $this->stream->getSize())) { + return null; + } elseif ($this->limit == -1) { + return $length - $this->offset; + } else { + return min($this->limit, $length - $this->offset); + } + } + + /** + * Allow for a bounded seek on the read limited stream + * {@inheritdoc} + */ + public function seek($offset, $whence = SEEK_SET) + { + if ($whence !== SEEK_SET || $offset < 0) { + throw new \RuntimeException(sprintf( + 'Cannot seek to offset %s with whence %s', + $offset, + $whence + )); + } + + $offset += $this->offset; + + if ($this->limit !== -1) { + if ($offset > $this->offset + $this->limit) { + $offset = $this->offset + $this->limit; + } + } + + $this->stream->seek($offset); + } + + /** + * Give a relative tell() + * {@inheritdoc} + */ + public function tell() + { + return $this->stream->tell() - $this->offset; + } + + /** + * Set the offset to start limiting from + * + * @param int $offset Offset to seek to and begin byte limiting from + * + * @throws \RuntimeException if the stream cannot be seeked. + */ + public function setOffset($offset) + { + $current = $this->stream->tell(); + + if ($current !== $offset) { + // If the stream cannot seek to the offset position, then read to it + if ($this->stream->isSeekable()) { + $this->stream->seek($offset); + } elseif ($current > $offset) { + throw new \RuntimeException("Could not seek to stream offset $offset"); + } else { + $this->stream->read($offset - $current); + } + } + + $this->offset = $offset; + } + + /** + * Set the limit of bytes that the decorator allows to be read from the + * stream. + * + * @param int $limit Number of bytes to allow to be read from the stream. + * Use -1 for no limit. + */ + public function setLimit($limit) + { + $this->limit = $limit; + } + + public function read($length) + { + if ($this->limit == -1) { + return $this->stream->read($length); + } + + // Check if the current position is less than the total allowed + // bytes + original offset + $remaining = ($this->offset + $this->limit) - $this->stream->tell(); + if ($remaining > 0) { + // Only return the amount of requested data, ensuring that the byte + // limit is not exceeded + return $this->stream->read(min($remaining, $length)); + } + + return ''; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Message.php b/vendor/guzzlehttp/psr7/src/Message.php new file mode 100644 index 0000000..516d1cb --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Message.php @@ -0,0 +1,252 @@ +getMethod() . ' ' + . $message->getRequestTarget()) + . ' HTTP/' . $message->getProtocolVersion(); + if (!$message->hasHeader('host')) { + $msg .= "\r\nHost: " . $message->getUri()->getHost(); + } + } elseif ($message instanceof ResponseInterface) { + $msg = 'HTTP/' . $message->getProtocolVersion() . ' ' + . $message->getStatusCode() . ' ' + . $message->getReasonPhrase(); + } else { + throw new \InvalidArgumentException('Unknown message type'); + } + + foreach ($message->getHeaders() as $name => $values) { + if (strtolower($name) === 'set-cookie') { + foreach ($values as $value) { + $msg .= "\r\n{$name}: " . $value; + } + } else { + $msg .= "\r\n{$name}: " . implode(', ', $values); + } + } + + return "{$msg}\r\n\r\n" . $message->getBody(); + } + + /** + * Get a short summary of the message body. + * + * Will return `null` if the response is not printable. + * + * @param MessageInterface $message The message to get the body summary + * @param int $truncateAt The maximum allowed size of the summary + * + * @return string|null + */ + public static function bodySummary(MessageInterface $message, $truncateAt = 120) + { + $body = $message->getBody(); + + if (!$body->isSeekable() || !$body->isReadable()) { + return null; + } + + $size = $body->getSize(); + + if ($size === 0) { + return null; + } + + $summary = $body->read($truncateAt); + $body->rewind(); + + if ($size > $truncateAt) { + $summary .= ' (truncated...)'; + } + + // Matches any printable character, including unicode characters: + // letters, marks, numbers, punctuation, spacing, and separators. + if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary)) { + return null; + } + + return $summary; + } + + /** + * Attempts to rewind a message body and throws an exception on failure. + * + * The body of the message will only be rewound if a call to `tell()` + * returns a value other than `0`. + * + * @param MessageInterface $message Message to rewind + * + * @throws \RuntimeException + */ + public static function rewindBody(MessageInterface $message) + { + $body = $message->getBody(); + + if ($body->tell()) { + $body->rewind(); + } + } + + /** + * Parses an HTTP message into an associative array. + * + * The array contains the "start-line" key containing the start line of + * the message, "headers" key containing an associative array of header + * array values, and a "body" key containing the body of the message. + * + * @param string $message HTTP request or response to parse. + * + * @return array + */ + public static function parseMessage($message) + { + if (!$message) { + throw new \InvalidArgumentException('Invalid message'); + } + + $message = ltrim($message, "\r\n"); + + $messageParts = preg_split("/\r?\n\r?\n/", $message, 2); + + if ($messageParts === false || count($messageParts) !== 2) { + throw new \InvalidArgumentException('Invalid message: Missing header delimiter'); + } + + list($rawHeaders, $body) = $messageParts; + $rawHeaders .= "\r\n"; // Put back the delimiter we split previously + $headerParts = preg_split("/\r?\n/", $rawHeaders, 2); + + if ($headerParts === false || count($headerParts) !== 2) { + throw new \InvalidArgumentException('Invalid message: Missing status line'); + } + + list($startLine, $rawHeaders) = $headerParts; + + if (preg_match("/(?:^HTTP\/|^[A-Z]+ \S+ HTTP\/)(\d+(?:\.\d+)?)/i", $startLine, $matches) && $matches[1] === '1.0') { + // Header folding is deprecated for HTTP/1.1, but allowed in HTTP/1.0 + $rawHeaders = preg_replace(Rfc7230::HEADER_FOLD_REGEX, ' ', $rawHeaders); + } + + /** @var array[] $headerLines */ + $count = preg_match_all(Rfc7230::HEADER_REGEX, $rawHeaders, $headerLines, PREG_SET_ORDER); + + // If these aren't the same, then one line didn't match and there's an invalid header. + if ($count !== substr_count($rawHeaders, "\n")) { + // Folding is deprecated, see https://tools.ietf.org/html/rfc7230#section-3.2.4 + if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) { + throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding'); + } + + throw new \InvalidArgumentException('Invalid header syntax'); + } + + $headers = []; + + foreach ($headerLines as $headerLine) { + $headers[$headerLine[1]][] = $headerLine[2]; + } + + return [ + 'start-line' => $startLine, + 'headers' => $headers, + 'body' => $body, + ]; + } + + /** + * Constructs a URI for an HTTP request message. + * + * @param string $path Path from the start-line + * @param array $headers Array of headers (each value an array). + * + * @return string + */ + public static function parseRequestUri($path, array $headers) + { + $hostKey = array_filter(array_keys($headers), function ($k) { + return strtolower($k) === 'host'; + }); + + // If no host is found, then a full URI cannot be constructed. + if (!$hostKey) { + return $path; + } + + $host = $headers[reset($hostKey)][0]; + $scheme = substr($host, -4) === ':443' ? 'https' : 'http'; + + return $scheme . '://' . $host . '/' . ltrim($path, '/'); + } + + /** + * Parses a request message string into a request object. + * + * @param string $message Request message string. + * + * @return Request + */ + public static function parseRequest($message) + { + $data = self::parseMessage($message); + $matches = []; + if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) { + throw new \InvalidArgumentException('Invalid request string'); + } + $parts = explode(' ', $data['start-line'], 3); + $version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1'; + + $request = new Request( + $parts[0], + $matches[1] === '/' ? self::parseRequestUri($parts[1], $data['headers']) : $parts[1], + $data['headers'], + $data['body'], + $version + ); + + return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]); + } + + /** + * Parses a response message string into a response object. + * + * @param string $message Response message string. + * + * @return Response + */ + public static function parseResponse($message) + { + $data = self::parseMessage($message); + // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space + // between status-code and reason-phrase is required. But browsers accept + // responses without space and reason as well. + if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) { + throw new \InvalidArgumentException('Invalid response string: ' . $data['start-line']); + } + $parts = explode(' ', $data['start-line'], 3); + + return new Response( + (int) $parts[1], + $data['headers'], + $data['body'], + explode('/', $parts[0])[1], + isset($parts[2]) ? $parts[2] : null + ); + } +} diff --git a/vendor/guzzlehttp/psr7/src/MessageTrait.php b/vendor/guzzlehttp/psr7/src/MessageTrait.php new file mode 100644 index 0000000..99203bb --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/MessageTrait.php @@ -0,0 +1,214 @@ + array of values */ + private $headers = []; + + /** @var array Map of lowercase header name => original name at registration */ + private $headerNames = []; + + /** @var string */ + private $protocol = '1.1'; + + /** @var StreamInterface|null */ + private $stream; + + public function getProtocolVersion() + { + return $this->protocol; + } + + public function withProtocolVersion($version) + { + if ($this->protocol === $version) { + return $this; + } + + $new = clone $this; + $new->protocol = $version; + return $new; + } + + public function getHeaders() + { + return $this->headers; + } + + public function hasHeader($header) + { + return isset($this->headerNames[strtolower($header)]); + } + + public function getHeader($header) + { + $header = strtolower($header); + + if (!isset($this->headerNames[$header])) { + return []; + } + + $header = $this->headerNames[$header]; + + return $this->headers[$header]; + } + + public function getHeaderLine($header) + { + return implode(', ', $this->getHeader($header)); + } + + public function withHeader($header, $value) + { + $this->assertHeader($header); + $value = $this->normalizeHeaderValue($value); + $normalized = strtolower($header); + + $new = clone $this; + if (isset($new->headerNames[$normalized])) { + unset($new->headers[$new->headerNames[$normalized]]); + } + $new->headerNames[$normalized] = $header; + $new->headers[$header] = $value; + + return $new; + } + + public function withAddedHeader($header, $value) + { + $this->assertHeader($header); + $value = $this->normalizeHeaderValue($value); + $normalized = strtolower($header); + + $new = clone $this; + if (isset($new->headerNames[$normalized])) { + $header = $this->headerNames[$normalized]; + $new->headers[$header] = array_merge($this->headers[$header], $value); + } else { + $new->headerNames[$normalized] = $header; + $new->headers[$header] = $value; + } + + return $new; + } + + public function withoutHeader($header) + { + $normalized = strtolower($header); + + if (!isset($this->headerNames[$normalized])) { + return $this; + } + + $header = $this->headerNames[$normalized]; + + $new = clone $this; + unset($new->headers[$header], $new->headerNames[$normalized]); + + return $new; + } + + public function getBody() + { + if (!$this->stream) { + $this->stream = Utils::streamFor(''); + } + + return $this->stream; + } + + public function withBody(StreamInterface $body) + { + if ($body === $this->stream) { + return $this; + } + + $new = clone $this; + $new->stream = $body; + return $new; + } + + private function setHeaders(array $headers) + { + $this->headerNames = $this->headers = []; + foreach ($headers as $header => $value) { + if (is_int($header)) { + // Numeric array keys are converted to int by PHP but having a header name '123' is not forbidden by the spec + // and also allowed in withHeader(). So we need to cast it to string again for the following assertion to pass. + $header = (string) $header; + } + $this->assertHeader($header); + $value = $this->normalizeHeaderValue($value); + $normalized = strtolower($header); + if (isset($this->headerNames[$normalized])) { + $header = $this->headerNames[$normalized]; + $this->headers[$header] = array_merge($this->headers[$header], $value); + } else { + $this->headerNames[$normalized] = $header; + $this->headers[$header] = $value; + } + } + } + + private function normalizeHeaderValue($value) + { + if (!is_array($value)) { + return $this->trimHeaderValues([$value]); + } + + if (count($value) === 0) { + throw new \InvalidArgumentException('Header value can not be an empty array.'); + } + + return $this->trimHeaderValues($value); + } + + /** + * Trims whitespace from the header values. + * + * Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field. + * + * header-field = field-name ":" OWS field-value OWS + * OWS = *( SP / HTAB ) + * + * @param string[] $values Header values + * + * @return string[] Trimmed header values + * + * @see https://tools.ietf.org/html/rfc7230#section-3.2.4 + */ + private function trimHeaderValues(array $values) + { + return array_map(function ($value) { + if (!is_scalar($value) && null !== $value) { + throw new \InvalidArgumentException(sprintf( + 'Header value must be scalar or null but %s provided.', + is_object($value) ? get_class($value) : gettype($value) + )); + } + + return trim((string) $value, " \t"); + }, array_values($values)); + } + + private function assertHeader($header) + { + if (!is_string($header)) { + throw new \InvalidArgumentException(sprintf( + 'Header name must be a string but %s provided.', + is_object($header) ? get_class($header) : gettype($header) + )); + } + + if ($header === '') { + throw new \InvalidArgumentException('Header name can not be empty.'); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/MimeType.php b/vendor/guzzlehttp/psr7/src/MimeType.php new file mode 100644 index 0000000..205c7b1 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/MimeType.php @@ -0,0 +1,140 @@ + 'video/3gpp', + '7z' => 'application/x-7z-compressed', + 'aac' => 'audio/x-aac', + 'ai' => 'application/postscript', + 'aif' => 'audio/x-aiff', + 'asc' => 'text/plain', + 'asf' => 'video/x-ms-asf', + 'atom' => 'application/atom+xml', + 'avi' => 'video/x-msvideo', + 'bmp' => 'image/bmp', + 'bz2' => 'application/x-bzip2', + 'cer' => 'application/pkix-cert', + 'crl' => 'application/pkix-crl', + 'crt' => 'application/x-x509-ca-cert', + 'css' => 'text/css', + 'csv' => 'text/csv', + 'cu' => 'application/cu-seeme', + 'deb' => 'application/x-debian-package', + 'doc' => 'application/msword', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'dvi' => 'application/x-dvi', + 'eot' => 'application/vnd.ms-fontobject', + 'eps' => 'application/postscript', + 'epub' => 'application/epub+zip', + 'etx' => 'text/x-setext', + 'flac' => 'audio/flac', + 'flv' => 'video/x-flv', + 'gif' => 'image/gif', + 'gz' => 'application/gzip', + 'htm' => 'text/html', + 'html' => 'text/html', + 'ico' => 'image/x-icon', + 'ics' => 'text/calendar', + 'ini' => 'text/plain', + 'iso' => 'application/x-iso9660-image', + 'jar' => 'application/java-archive', + 'jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'js' => 'text/javascript', + 'json' => 'application/json', + 'latex' => 'application/x-latex', + 'log' => 'text/plain', + 'm4a' => 'audio/mp4', + 'm4v' => 'video/mp4', + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mov' => 'video/quicktime', + 'mkv' => 'video/x-matroska', + 'mp3' => 'audio/mpeg', + 'mp4' => 'video/mp4', + 'mp4a' => 'audio/mp4', + 'mp4v' => 'video/mp4', + 'mpe' => 'video/mpeg', + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpg4' => 'video/mp4', + 'oga' => 'audio/ogg', + 'ogg' => 'audio/ogg', + 'ogv' => 'video/ogg', + 'ogx' => 'application/ogg', + 'pbm' => 'image/x-portable-bitmap', + 'pdf' => 'application/pdf', + 'pgm' => 'image/x-portable-graymap', + 'png' => 'image/png', + 'pnm' => 'image/x-portable-anymap', + 'ppm' => 'image/x-portable-pixmap', + 'ppt' => 'application/vnd.ms-powerpoint', + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'ps' => 'application/postscript', + 'qt' => 'video/quicktime', + 'rar' => 'application/x-rar-compressed', + 'ras' => 'image/x-cmu-raster', + 'rss' => 'application/rss+xml', + 'rtf' => 'application/rtf', + 'sgm' => 'text/sgml', + 'sgml' => 'text/sgml', + 'svg' => 'image/svg+xml', + 'swf' => 'application/x-shockwave-flash', + 'tar' => 'application/x-tar', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'torrent' => 'application/x-bittorrent', + 'ttf' => 'application/x-font-ttf', + 'txt' => 'text/plain', + 'wav' => 'audio/x-wav', + 'webm' => 'video/webm', + 'webp' => 'image/webp', + 'wma' => 'audio/x-ms-wma', + 'wmv' => 'video/x-ms-wmv', + 'woff' => 'application/x-font-woff', + 'wsdl' => 'application/wsdl+xml', + 'xbm' => 'image/x-xbitmap', + 'xls' => 'application/vnd.ms-excel', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'xml' => 'application/xml', + 'xpm' => 'image/x-xpixmap', + 'xwd' => 'image/x-xwindowdump', + 'yaml' => 'text/yaml', + 'yml' => 'text/yaml', + 'zip' => 'application/zip', + ]; + + $extension = strtolower($extension); + + return isset($mimetypes[$extension]) + ? $mimetypes[$extension] + : null; + } +} diff --git a/vendor/guzzlehttp/psr7/src/MultipartStream.php b/vendor/guzzlehttp/psr7/src/MultipartStream.php new file mode 100644 index 0000000..eeba99c --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/MultipartStream.php @@ -0,0 +1,158 @@ +boundary = $boundary ?: sha1(uniqid('', true)); + $this->stream = $this->createStream($elements); + } + + /** + * Get the boundary + * + * @return string + */ + public function getBoundary() + { + return $this->boundary; + } + + public function isWritable() + { + return false; + } + + /** + * Get the headers needed before transferring the content of a POST file + */ + private function getHeaders(array $headers) + { + $str = ''; + foreach ($headers as $key => $value) { + $str .= "{$key}: {$value}\r\n"; + } + + return "--{$this->boundary}\r\n" . trim($str) . "\r\n\r\n"; + } + + /** + * Create the aggregate stream that will be used to upload the POST data + */ + protected function createStream(array $elements) + { + $stream = new AppendStream(); + + foreach ($elements as $element) { + $this->addElement($stream, $element); + } + + // Add the trailing boundary with CRLF + $stream->addStream(Utils::streamFor("--{$this->boundary}--\r\n")); + + return $stream; + } + + private function addElement(AppendStream $stream, array $element) + { + foreach (['contents', 'name'] as $key) { + if (!array_key_exists($key, $element)) { + throw new \InvalidArgumentException("A '{$key}' key is required"); + } + } + + $element['contents'] = Utils::streamFor($element['contents']); + + if (empty($element['filename'])) { + $uri = $element['contents']->getMetadata('uri'); + if (substr($uri, 0, 6) !== 'php://') { + $element['filename'] = $uri; + } + } + + list($body, $headers) = $this->createElement( + $element['name'], + $element['contents'], + isset($element['filename']) ? $element['filename'] : null, + isset($element['headers']) ? $element['headers'] : [] + ); + + $stream->addStream(Utils::streamFor($this->getHeaders($headers))); + $stream->addStream($body); + $stream->addStream(Utils::streamFor("\r\n")); + } + + /** + * @return array + */ + private function createElement($name, StreamInterface $stream, $filename, array $headers) + { + // Set a default content-disposition header if one was no provided + $disposition = $this->getHeader($headers, 'content-disposition'); + if (!$disposition) { + $headers['Content-Disposition'] = ($filename === '0' || $filename) + ? sprintf( + 'form-data; name="%s"; filename="%s"', + $name, + basename($filename) + ) + : "form-data; name=\"{$name}\""; + } + + // Set a default content-length header if one was no provided + $length = $this->getHeader($headers, 'content-length'); + if (!$length) { + if ($length = $stream->getSize()) { + $headers['Content-Length'] = (string) $length; + } + } + + // Set a default Content-Type if one was not supplied + $type = $this->getHeader($headers, 'content-type'); + if (!$type && ($filename === '0' || $filename)) { + if ($type = MimeType::fromFilename($filename)) { + $headers['Content-Type'] = $type; + } + } + + return [$stream, $headers]; + } + + private function getHeader(array $headers, $key) + { + $lowercaseHeader = strtolower($key); + foreach ($headers as $k => $v) { + if (strtolower($k) === $lowercaseHeader) { + return $v; + } + } + + return null; + } +} diff --git a/vendor/guzzlehttp/psr7/src/NoSeekStream.php b/vendor/guzzlehttp/psr7/src/NoSeekStream.php new file mode 100644 index 0000000..caf7131 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/NoSeekStream.php @@ -0,0 +1,25 @@ +source = $source; + $this->size = isset($options['size']) ? $options['size'] : null; + $this->metadata = isset($options['metadata']) ? $options['metadata'] : []; + $this->buffer = new BufferStream(); + } + + public function __toString() + { + try { + return Utils::copyToString($this); + } catch (\Exception $e) { + return ''; + } + } + + public function close() + { + $this->detach(); + } + + public function detach() + { + $this->tellPos = false; + $this->source = null; + + return null; + } + + public function getSize() + { + return $this->size; + } + + public function tell() + { + return $this->tellPos; + } + + public function eof() + { + return !$this->source; + } + + public function isSeekable() + { + return false; + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + throw new \RuntimeException('Cannot seek a PumpStream'); + } + + public function isWritable() + { + return false; + } + + public function write($string) + { + throw new \RuntimeException('Cannot write to a PumpStream'); + } + + public function isReadable() + { + return true; + } + + public function read($length) + { + $data = $this->buffer->read($length); + $readLen = strlen($data); + $this->tellPos += $readLen; + $remaining = $length - $readLen; + + if ($remaining) { + $this->pump($remaining); + $data .= $this->buffer->read($remaining); + $this->tellPos += strlen($data) - $readLen; + } + + return $data; + } + + public function getContents() + { + $result = ''; + while (!$this->eof()) { + $result .= $this->read(1000000); + } + + return $result; + } + + public function getMetadata($key = null) + { + if (!$key) { + return $this->metadata; + } + + return isset($this->metadata[$key]) ? $this->metadata[$key] : null; + } + + private function pump($length) + { + if ($this->source) { + do { + $data = call_user_func($this->source, $length); + if ($data === false || $data === null) { + $this->source = null; + return; + } + $this->buffer->write($data); + $length -= strlen($data); + } while ($length > 0); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/Query.php b/vendor/guzzlehttp/psr7/src/Query.php new file mode 100644 index 0000000..34eb273 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Query.php @@ -0,0 +1,113 @@ + '1', 'foo[b]' => '2'])`. + * + * @param string $str Query string to parse + * @param int|bool $urlEncoding How the query string is encoded + * + * @return array + */ + public static function parse($str, $urlEncoding = true) + { + $result = []; + + if ($str === '') { + return $result; + } + + if ($urlEncoding === true) { + $decoder = function ($value) { + return rawurldecode(str_replace('+', ' ', $value)); + }; + } elseif ($urlEncoding === PHP_QUERY_RFC3986) { + $decoder = 'rawurldecode'; + } elseif ($urlEncoding === PHP_QUERY_RFC1738) { + $decoder = 'urldecode'; + } else { + $decoder = function ($str) { + return $str; + }; + } + + foreach (explode('&', $str) as $kvp) { + $parts = explode('=', $kvp, 2); + $key = $decoder($parts[0]); + $value = isset($parts[1]) ? $decoder($parts[1]) : null; + if (!isset($result[$key])) { + $result[$key] = $value; + } else { + if (!is_array($result[$key])) { + $result[$key] = [$result[$key]]; + } + $result[$key][] = $value; + } + } + + return $result; + } + + /** + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + * + * @return string + */ + public static function build(array $params, $encoding = PHP_QUERY_RFC3986) + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function ($str) { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder($k); + if (!is_array($v)) { + $qs .= $k; + if ($v !== null) { + $qs .= '=' . $encoder($v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + if ($vv !== null) { + $qs .= '=' . $encoder($vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Request.php b/vendor/guzzlehttp/psr7/src/Request.php new file mode 100644 index 0000000..682585e --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Request.php @@ -0,0 +1,152 @@ +assertMethod($method); + if (!($uri instanceof UriInterface)) { + $uri = new Uri($uri); + } + + $this->method = strtoupper($method); + $this->uri = $uri; + $this->setHeaders($headers); + $this->protocol = $version; + + if (!isset($this->headerNames['host'])) { + $this->updateHostFromUri(); + } + + if ($body !== '' && $body !== null) { + $this->stream = Utils::streamFor($body); + } + } + + public function getRequestTarget() + { + if ($this->requestTarget !== null) { + return $this->requestTarget; + } + + $target = $this->uri->getPath(); + if ($target == '') { + $target = '/'; + } + if ($this->uri->getQuery() != '') { + $target .= '?' . $this->uri->getQuery(); + } + + return $target; + } + + public function withRequestTarget($requestTarget) + { + if (preg_match('#\s#', $requestTarget)) { + throw new InvalidArgumentException( + 'Invalid request target provided; cannot contain whitespace' + ); + } + + $new = clone $this; + $new->requestTarget = $requestTarget; + return $new; + } + + public function getMethod() + { + return $this->method; + } + + public function withMethod($method) + { + $this->assertMethod($method); + $new = clone $this; + $new->method = strtoupper($method); + return $new; + } + + public function getUri() + { + return $this->uri; + } + + public function withUri(UriInterface $uri, $preserveHost = false) + { + if ($uri === $this->uri) { + return $this; + } + + $new = clone $this; + $new->uri = $uri; + + if (!$preserveHost || !isset($this->headerNames['host'])) { + $new->updateHostFromUri(); + } + + return $new; + } + + private function updateHostFromUri() + { + $host = $this->uri->getHost(); + + if ($host == '') { + return; + } + + if (($port = $this->uri->getPort()) !== null) { + $host .= ':' . $port; + } + + if (isset($this->headerNames['host'])) { + $header = $this->headerNames['host']; + } else { + $header = 'Host'; + $this->headerNames['host'] = 'Host'; + } + // Ensure Host is the first header. + // See: http://tools.ietf.org/html/rfc7230#section-5.4 + $this->headers = [$header => [$host]] + $this->headers; + } + + private function assertMethod($method) + { + if (!is_string($method) || $method === '') { + throw new \InvalidArgumentException('Method must be a non-empty string.'); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/Response.php b/vendor/guzzlehttp/psr7/src/Response.php new file mode 100644 index 0000000..4d36826 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Response.php @@ -0,0 +1,155 @@ + 'Continue', + 101 => 'Switching Protocols', + 102 => 'Processing', + 200 => 'OK', + 201 => 'Created', + 202 => 'Accepted', + 203 => 'Non-Authoritative Information', + 204 => 'No Content', + 205 => 'Reset Content', + 206 => 'Partial Content', + 207 => 'Multi-status', + 208 => 'Already Reported', + 300 => 'Multiple Choices', + 301 => 'Moved Permanently', + 302 => 'Found', + 303 => 'See Other', + 304 => 'Not Modified', + 305 => 'Use Proxy', + 306 => 'Switch Proxy', + 307 => 'Temporary Redirect', + 400 => 'Bad Request', + 401 => 'Unauthorized', + 402 => 'Payment Required', + 403 => 'Forbidden', + 404 => 'Not Found', + 405 => 'Method Not Allowed', + 406 => 'Not Acceptable', + 407 => 'Proxy Authentication Required', + 408 => 'Request Time-out', + 409 => 'Conflict', + 410 => 'Gone', + 411 => 'Length Required', + 412 => 'Precondition Failed', + 413 => 'Request Entity Too Large', + 414 => 'Request-URI Too Large', + 415 => 'Unsupported Media Type', + 416 => 'Requested range not satisfiable', + 417 => 'Expectation Failed', + 418 => 'I\'m a teapot', + 422 => 'Unprocessable Entity', + 423 => 'Locked', + 424 => 'Failed Dependency', + 425 => 'Unordered Collection', + 426 => 'Upgrade Required', + 428 => 'Precondition Required', + 429 => 'Too Many Requests', + 431 => 'Request Header Fields Too Large', + 451 => 'Unavailable For Legal Reasons', + 500 => 'Internal Server Error', + 501 => 'Not Implemented', + 502 => 'Bad Gateway', + 503 => 'Service Unavailable', + 504 => 'Gateway Time-out', + 505 => 'HTTP Version not supported', + 506 => 'Variant Also Negotiates', + 507 => 'Insufficient Storage', + 508 => 'Loop Detected', + 511 => 'Network Authentication Required', + ]; + + /** @var string */ + private $reasonPhrase = ''; + + /** @var int */ + private $statusCode = 200; + + /** + * @param int $status Status code + * @param array $headers Response headers + * @param string|resource|StreamInterface|null $body Response body + * @param string $version Protocol version + * @param string|null $reason Reason phrase (when empty a default will be used based on the status code) + */ + public function __construct( + $status = 200, + array $headers = [], + $body = null, + $version = '1.1', + $reason = null + ) { + $this->assertStatusCodeIsInteger($status); + $status = (int) $status; + $this->assertStatusCodeRange($status); + + $this->statusCode = $status; + + if ($body !== '' && $body !== null) { + $this->stream = Utils::streamFor($body); + } + + $this->setHeaders($headers); + if ($reason == '' && isset(self::$phrases[$this->statusCode])) { + $this->reasonPhrase = self::$phrases[$this->statusCode]; + } else { + $this->reasonPhrase = (string) $reason; + } + + $this->protocol = $version; + } + + public function getStatusCode() + { + return $this->statusCode; + } + + public function getReasonPhrase() + { + return $this->reasonPhrase; + } + + public function withStatus($code, $reasonPhrase = '') + { + $this->assertStatusCodeIsInteger($code); + $code = (int) $code; + $this->assertStatusCodeRange($code); + + $new = clone $this; + $new->statusCode = $code; + if ($reasonPhrase == '' && isset(self::$phrases[$new->statusCode])) { + $reasonPhrase = self::$phrases[$new->statusCode]; + } + $new->reasonPhrase = (string) $reasonPhrase; + return $new; + } + + private function assertStatusCodeIsInteger($statusCode) + { + if (filter_var($statusCode, FILTER_VALIDATE_INT) === false) { + throw new \InvalidArgumentException('Status code must be an integer value.'); + } + } + + private function assertStatusCodeRange($statusCode) + { + if ($statusCode < 100 || $statusCode >= 600) { + throw new \InvalidArgumentException('Status code must be an integer value between 1xx and 5xx.'); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/Rfc7230.php b/vendor/guzzlehttp/psr7/src/Rfc7230.php new file mode 100644 index 0000000..33417c7 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Rfc7230.php @@ -0,0 +1,19 @@ +@,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m"; + const HEADER_FOLD_REGEX = "(\r?\n[ \t]++)"; +} diff --git a/vendor/guzzlehttp/psr7/src/ServerRequest.php b/vendor/guzzlehttp/psr7/src/ServerRequest.php new file mode 100644 index 0000000..0873e11 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/ServerRequest.php @@ -0,0 +1,379 @@ +serverParams = $serverParams; + + parent::__construct($method, $uri, $headers, $body, $version); + } + + /** + * Return an UploadedFile instance array. + * + * @param array $files A array which respect $_FILES structure + * + * @return array + * + * @throws InvalidArgumentException for unrecognized values + */ + public static function normalizeFiles(array $files) + { + $normalized = []; + + foreach ($files as $key => $value) { + if ($value instanceof UploadedFileInterface) { + $normalized[$key] = $value; + } elseif (is_array($value) && isset($value['tmp_name'])) { + $normalized[$key] = self::createUploadedFileFromSpec($value); + } elseif (is_array($value)) { + $normalized[$key] = self::normalizeFiles($value); + continue; + } else { + throw new InvalidArgumentException('Invalid value in files specification'); + } + } + + return $normalized; + } + + /** + * Create and return an UploadedFile instance from a $_FILES specification. + * + * If the specification represents an array of values, this method will + * delegate to normalizeNestedFileSpec() and return that return value. + * + * @param array $value $_FILES struct + * + * @return array|UploadedFileInterface + */ + private static function createUploadedFileFromSpec(array $value) + { + if (is_array($value['tmp_name'])) { + return self::normalizeNestedFileSpec($value); + } + + return new UploadedFile( + $value['tmp_name'], + (int) $value['size'], + (int) $value['error'], + $value['name'], + $value['type'] + ); + } + + /** + * Normalize an array of file specifications. + * + * Loops through all nested files and returns a normalized array of + * UploadedFileInterface instances. + * + * @param array $files + * + * @return UploadedFileInterface[] + */ + private static function normalizeNestedFileSpec(array $files = []) + { + $normalizedFiles = []; + + foreach (array_keys($files['tmp_name']) as $key) { + $spec = [ + 'tmp_name' => $files['tmp_name'][$key], + 'size' => $files['size'][$key], + 'error' => $files['error'][$key], + 'name' => $files['name'][$key], + 'type' => $files['type'][$key], + ]; + $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec); + } + + return $normalizedFiles; + } + + /** + * Return a ServerRequest populated with superglobals: + * $_GET + * $_POST + * $_COOKIE + * $_FILES + * $_SERVER + * + * @return ServerRequestInterface + */ + public static function fromGlobals() + { + $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET'; + $headers = getallheaders(); + $uri = self::getUriFromGlobals(); + $body = new CachingStream(new LazyOpenStream('php://input', 'r+')); + $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? str_replace('HTTP/', '', $_SERVER['SERVER_PROTOCOL']) : '1.1'; + + $serverRequest = new ServerRequest($method, $uri, $headers, $body, $protocol, $_SERVER); + + return $serverRequest + ->withCookieParams($_COOKIE) + ->withQueryParams($_GET) + ->withParsedBody($_POST) + ->withUploadedFiles(self::normalizeFiles($_FILES)); + } + + private static function extractHostAndPortFromAuthority($authority) + { + $uri = 'http://' . $authority; + $parts = parse_url($uri); + if (false === $parts) { + return [null, null]; + } + + $host = isset($parts['host']) ? $parts['host'] : null; + $port = isset($parts['port']) ? $parts['port'] : null; + + return [$host, $port]; + } + + /** + * Get a Uri populated with values from $_SERVER. + * + * @return UriInterface + */ + public static function getUriFromGlobals() + { + $uri = new Uri(''); + + $uri = $uri->withScheme(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http'); + + $hasPort = false; + if (isset($_SERVER['HTTP_HOST'])) { + list($host, $port) = self::extractHostAndPortFromAuthority($_SERVER['HTTP_HOST']); + if ($host !== null) { + $uri = $uri->withHost($host); + } + + if ($port !== null) { + $hasPort = true; + $uri = $uri->withPort($port); + } + } elseif (isset($_SERVER['SERVER_NAME'])) { + $uri = $uri->withHost($_SERVER['SERVER_NAME']); + } elseif (isset($_SERVER['SERVER_ADDR'])) { + $uri = $uri->withHost($_SERVER['SERVER_ADDR']); + } + + if (!$hasPort && isset($_SERVER['SERVER_PORT'])) { + $uri = $uri->withPort($_SERVER['SERVER_PORT']); + } + + $hasQuery = false; + if (isset($_SERVER['REQUEST_URI'])) { + $requestUriParts = explode('?', $_SERVER['REQUEST_URI'], 2); + $uri = $uri->withPath($requestUriParts[0]); + if (isset($requestUriParts[1])) { + $hasQuery = true; + $uri = $uri->withQuery($requestUriParts[1]); + } + } + + if (!$hasQuery && isset($_SERVER['QUERY_STRING'])) { + $uri = $uri->withQuery($_SERVER['QUERY_STRING']); + } + + return $uri; + } + + /** + * {@inheritdoc} + */ + public function getServerParams() + { + return $this->serverParams; + } + + /** + * {@inheritdoc} + */ + public function getUploadedFiles() + { + return $this->uploadedFiles; + } + + /** + * {@inheritdoc} + */ + public function withUploadedFiles(array $uploadedFiles) + { + $new = clone $this; + $new->uploadedFiles = $uploadedFiles; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getCookieParams() + { + return $this->cookieParams; + } + + /** + * {@inheritdoc} + */ + public function withCookieParams(array $cookies) + { + $new = clone $this; + $new->cookieParams = $cookies; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getQueryParams() + { + return $this->queryParams; + } + + /** + * {@inheritdoc} + */ + public function withQueryParams(array $query) + { + $new = clone $this; + $new->queryParams = $query; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getParsedBody() + { + return $this->parsedBody; + } + + /** + * {@inheritdoc} + */ + public function withParsedBody($data) + { + $new = clone $this; + $new->parsedBody = $data; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * {@inheritdoc} + */ + public function getAttribute($attribute, $default = null) + { + if (false === array_key_exists($attribute, $this->attributes)) { + return $default; + } + + return $this->attributes[$attribute]; + } + + /** + * {@inheritdoc} + */ + public function withAttribute($attribute, $value) + { + $new = clone $this; + $new->attributes[$attribute] = $value; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function withoutAttribute($attribute) + { + if (false === array_key_exists($attribute, $this->attributes)) { + return $this; + } + + $new = clone $this; + unset($new->attributes[$attribute]); + + return $new; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Stream.php b/vendor/guzzlehttp/psr7/src/Stream.php new file mode 100644 index 0000000..3865d6d --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Stream.php @@ -0,0 +1,270 @@ +size = $options['size']; + } + + $this->customMetadata = isset($options['metadata']) + ? $options['metadata'] + : []; + + $this->stream = $stream; + $meta = stream_get_meta_data($this->stream); + $this->seekable = $meta['seekable']; + $this->readable = (bool)preg_match(self::READABLE_MODES, $meta['mode']); + $this->writable = (bool)preg_match(self::WRITABLE_MODES, $meta['mode']); + $this->uri = $this->getMetadata('uri'); + } + + /** + * Closes the stream when the destructed + */ + public function __destruct() + { + $this->close(); + } + + public function __toString() + { + try { + if ($this->isSeekable()) { + $this->seek(0); + } + return $this->getContents(); + } catch (\Exception $e) { + return ''; + } + } + + public function getContents() + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + $contents = stream_get_contents($this->stream); + + if ($contents === false) { + throw new \RuntimeException('Unable to read stream contents'); + } + + return $contents; + } + + public function close() + { + if (isset($this->stream)) { + if (is_resource($this->stream)) { + fclose($this->stream); + } + $this->detach(); + } + } + + public function detach() + { + if (!isset($this->stream)) { + return null; + } + + $result = $this->stream; + unset($this->stream); + $this->size = $this->uri = null; + $this->readable = $this->writable = $this->seekable = false; + + return $result; + } + + public function getSize() + { + if ($this->size !== null) { + return $this->size; + } + + if (!isset($this->stream)) { + return null; + } + + // Clear the stat cache if the stream has a URI + if ($this->uri) { + clearstatcache(true, $this->uri); + } + + $stats = fstat($this->stream); + if (isset($stats['size'])) { + $this->size = $stats['size']; + return $this->size; + } + + return null; + } + + public function isReadable() + { + return $this->readable; + } + + public function isWritable() + { + return $this->writable; + } + + public function isSeekable() + { + return $this->seekable; + } + + public function eof() + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + return feof($this->stream); + } + + public function tell() + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + $result = ftell($this->stream); + + if ($result === false) { + throw new \RuntimeException('Unable to determine stream position'); + } + + return $result; + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + $whence = (int) $whence; + + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->seekable) { + throw new \RuntimeException('Stream is not seekable'); + } + if (fseek($this->stream, $offset, $whence) === -1) { + throw new \RuntimeException('Unable to seek to stream position ' + . $offset . ' with whence ' . var_export($whence, true)); + } + } + + public function read($length) + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->readable) { + throw new \RuntimeException('Cannot read from non-readable stream'); + } + if ($length < 0) { + throw new \RuntimeException('Length parameter cannot be negative'); + } + + if (0 === $length) { + return ''; + } + + $string = fread($this->stream, $length); + if (false === $string) { + throw new \RuntimeException('Unable to read from stream'); + } + + return $string; + } + + public function write($string) + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->writable) { + throw new \RuntimeException('Cannot write to a non-writable stream'); + } + + // We can't know the size after writing anything + $this->size = null; + $result = fwrite($this->stream, $string); + + if ($result === false) { + throw new \RuntimeException('Unable to write to stream'); + } + + return $result; + } + + public function getMetadata($key = null) + { + if (!isset($this->stream)) { + return $key ? null : []; + } elseif (!$key) { + return $this->customMetadata + stream_get_meta_data($this->stream); + } elseif (isset($this->customMetadata[$key])) { + return $this->customMetadata[$key]; + } + + $meta = stream_get_meta_data($this->stream); + + return isset($meta[$key]) ? $meta[$key] : null; + } +} diff --git a/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php b/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php new file mode 100644 index 0000000..98925e1 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php @@ -0,0 +1,152 @@ +stream = $stream; + } + + /** + * Magic method used to create a new stream if streams are not added in + * the constructor of a decorator (e.g., LazyOpenStream). + * + * @param string $name Name of the property (allows "stream" only). + * + * @return StreamInterface + */ + public function __get($name) + { + if ($name == 'stream') { + $this->stream = $this->createStream(); + return $this->stream; + } + + throw new \UnexpectedValueException("$name not found on class"); + } + + public function __toString() + { + try { + if ($this->isSeekable()) { + $this->seek(0); + } + return $this->getContents(); + } catch (\Exception $e) { + // Really, PHP? https://bugs.php.net/bug.php?id=53648 + trigger_error('StreamDecorator::__toString exception: ' + . (string) $e, E_USER_ERROR); + return ''; + } + } + + public function getContents() + { + return Utils::copyToString($this); + } + + /** + * Allow decorators to implement custom methods + * + * @param string $method Missing method name + * @param array $args Method arguments + * + * @return mixed + */ + public function __call($method, array $args) + { + $result = call_user_func_array([$this->stream, $method], $args); + + // Always return the wrapped object if the result is a return $this + return $result === $this->stream ? $this : $result; + } + + public function close() + { + $this->stream->close(); + } + + public function getMetadata($key = null) + { + return $this->stream->getMetadata($key); + } + + public function detach() + { + return $this->stream->detach(); + } + + public function getSize() + { + return $this->stream->getSize(); + } + + public function eof() + { + return $this->stream->eof(); + } + + public function tell() + { + return $this->stream->tell(); + } + + public function isReadable() + { + return $this->stream->isReadable(); + } + + public function isWritable() + { + return $this->stream->isWritable(); + } + + public function isSeekable() + { + return $this->stream->isSeekable(); + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + $this->stream->seek($offset, $whence); + } + + public function read($length) + { + return $this->stream->read($length); + } + + public function write($string) + { + return $this->stream->write($string); + } + + /** + * Implement in subclasses to dynamically create streams when requested. + * + * @return StreamInterface + * + * @throws \BadMethodCallException + */ + protected function createStream() + { + throw new \BadMethodCallException('Not implemented'); + } +} diff --git a/vendor/guzzlehttp/psr7/src/StreamWrapper.php b/vendor/guzzlehttp/psr7/src/StreamWrapper.php new file mode 100644 index 0000000..c36f2a9 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/StreamWrapper.php @@ -0,0 +1,165 @@ +isReadable()) { + $mode = $stream->isWritable() ? 'r+' : 'r'; + } elseif ($stream->isWritable()) { + $mode = 'w'; + } else { + throw new \InvalidArgumentException('The stream must be readable, ' + . 'writable, or both.'); + } + + return fopen('guzzle://stream', $mode, null, self::createStreamContext($stream)); + } + + /** + * Creates a stream context that can be used to open a stream as a php stream resource. + * + * @param StreamInterface $stream + * + * @return resource + */ + public static function createStreamContext(StreamInterface $stream) + { + return stream_context_create([ + 'guzzle' => ['stream' => $stream] + ]); + } + + /** + * Registers the stream wrapper if needed + */ + public static function register() + { + if (!in_array('guzzle', stream_get_wrappers())) { + stream_wrapper_register('guzzle', __CLASS__); + } + } + + public function stream_open($path, $mode, $options, &$opened_path) + { + $options = stream_context_get_options($this->context); + + if (!isset($options['guzzle']['stream'])) { + return false; + } + + $this->mode = $mode; + $this->stream = $options['guzzle']['stream']; + + return true; + } + + public function stream_read($count) + { + return $this->stream->read($count); + } + + public function stream_write($data) + { + return (int) $this->stream->write($data); + } + + public function stream_tell() + { + return $this->stream->tell(); + } + + public function stream_eof() + { + return $this->stream->eof(); + } + + public function stream_seek($offset, $whence) + { + $this->stream->seek($offset, $whence); + + return true; + } + + public function stream_cast($cast_as) + { + $stream = clone($this->stream); + + return $stream->detach(); + } + + public function stream_stat() + { + static $modeMap = [ + 'r' => 33060, + 'rb' => 33060, + 'r+' => 33206, + 'w' => 33188, + 'wb' => 33188 + ]; + + return [ + 'dev' => 0, + 'ino' => 0, + 'mode' => $modeMap[$this->mode], + 'nlink' => 0, + 'uid' => 0, + 'gid' => 0, + 'rdev' => 0, + 'size' => $this->stream->getSize() ?: 0, + 'atime' => 0, + 'mtime' => 0, + 'ctime' => 0, + 'blksize' => 0, + 'blocks' => 0 + ]; + } + + public function url_stat($path, $flags) + { + return [ + 'dev' => 0, + 'ino' => 0, + 'mode' => 0, + 'nlink' => 0, + 'uid' => 0, + 'gid' => 0, + 'rdev' => 0, + 'size' => 0, + 'atime' => 0, + 'mtime' => 0, + 'ctime' => 0, + 'blksize' => 0, + 'blocks' => 0 + ]; + } +} diff --git a/vendor/guzzlehttp/psr7/src/UploadedFile.php b/vendor/guzzlehttp/psr7/src/UploadedFile.php new file mode 100644 index 0000000..b6ffead --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/UploadedFile.php @@ -0,0 +1,328 @@ +setError($errorStatus); + $this->setSize($size); + $this->setClientFilename($clientFilename); + $this->setClientMediaType($clientMediaType); + + if ($this->isOk()) { + $this->setStreamOrFile($streamOrFile); + } + } + + /** + * Depending on the value set file or stream variable + * + * @param mixed $streamOrFile + * + * @throws InvalidArgumentException + */ + private function setStreamOrFile($streamOrFile) + { + if (is_string($streamOrFile)) { + $this->file = $streamOrFile; + } elseif (is_resource($streamOrFile)) { + $this->stream = new Stream($streamOrFile); + } elseif ($streamOrFile instanceof StreamInterface) { + $this->stream = $streamOrFile; + } else { + throw new InvalidArgumentException( + 'Invalid stream or file provided for UploadedFile' + ); + } + } + + /** + * @param int $error + * + * @throws InvalidArgumentException + */ + private function setError($error) + { + if (false === is_int($error)) { + throw new InvalidArgumentException( + 'Upload file error status must be an integer' + ); + } + + if (false === in_array($error, UploadedFile::$errors)) { + throw new InvalidArgumentException( + 'Invalid error status for UploadedFile' + ); + } + + $this->error = $error; + } + + /** + * @param int $size + * + * @throws InvalidArgumentException + */ + private function setSize($size) + { + if (false === is_int($size)) { + throw new InvalidArgumentException( + 'Upload file size must be an integer' + ); + } + + $this->size = $size; + } + + /** + * @param mixed $param + * + * @return bool + */ + private function isStringOrNull($param) + { + return in_array(gettype($param), ['string', 'NULL']); + } + + /** + * @param mixed $param + * + * @return bool + */ + private function isStringNotEmpty($param) + { + return is_string($param) && false === empty($param); + } + + /** + * @param string|null $clientFilename + * + * @throws InvalidArgumentException + */ + private function setClientFilename($clientFilename) + { + if (false === $this->isStringOrNull($clientFilename)) { + throw new InvalidArgumentException( + 'Upload file client filename must be a string or null' + ); + } + + $this->clientFilename = $clientFilename; + } + + /** + * @param string|null $clientMediaType + * + * @throws InvalidArgumentException + */ + private function setClientMediaType($clientMediaType) + { + if (false === $this->isStringOrNull($clientMediaType)) { + throw new InvalidArgumentException( + 'Upload file client media type must be a string or null' + ); + } + + $this->clientMediaType = $clientMediaType; + } + + /** + * Return true if there is no upload error + * + * @return bool + */ + private function isOk() + { + return $this->error === UPLOAD_ERR_OK; + } + + /** + * @return bool + */ + public function isMoved() + { + return $this->moved; + } + + /** + * @throws RuntimeException if is moved or not ok + */ + private function validateActive() + { + if (false === $this->isOk()) { + throw new RuntimeException('Cannot retrieve stream due to upload error'); + } + + if ($this->isMoved()) { + throw new RuntimeException('Cannot retrieve stream after it has already been moved'); + } + } + + /** + * {@inheritdoc} + * + * @throws RuntimeException if the upload was not successful. + */ + public function getStream() + { + $this->validateActive(); + + if ($this->stream instanceof StreamInterface) { + return $this->stream; + } + + return new LazyOpenStream($this->file, 'r+'); + } + + /** + * {@inheritdoc} + * + * @see http://php.net/is_uploaded_file + * @see http://php.net/move_uploaded_file + * + * @param string $targetPath Path to which to move the uploaded file. + * + * @throws RuntimeException if the upload was not successful. + * @throws InvalidArgumentException if the $path specified is invalid. + * @throws RuntimeException on any error during the move operation, or on + * the second or subsequent call to the method. + */ + public function moveTo($targetPath) + { + $this->validateActive(); + + if (false === $this->isStringNotEmpty($targetPath)) { + throw new InvalidArgumentException( + 'Invalid path provided for move operation; must be a non-empty string' + ); + } + + if ($this->file) { + $this->moved = php_sapi_name() == 'cli' + ? rename($this->file, $targetPath) + : move_uploaded_file($this->file, $targetPath); + } else { + Utils::copyToStream( + $this->getStream(), + new LazyOpenStream($targetPath, 'w') + ); + + $this->moved = true; + } + + if (false === $this->moved) { + throw new RuntimeException( + sprintf('Uploaded file could not be moved to %s', $targetPath) + ); + } + } + + /** + * {@inheritdoc} + * + * @return int|null The file size in bytes or null if unknown. + */ + public function getSize() + { + return $this->size; + } + + /** + * {@inheritdoc} + * + * @see http://php.net/manual/en/features.file-upload.errors.php + * + * @return int One of PHP's UPLOAD_ERR_XXX constants. + */ + public function getError() + { + return $this->error; + } + + /** + * {@inheritdoc} + * + * @return string|null The filename sent by the client or null if none + * was provided. + */ + public function getClientFilename() + { + return $this->clientFilename; + } + + /** + * {@inheritdoc} + */ + public function getClientMediaType() + { + return $this->clientMediaType; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Uri.php b/vendor/guzzlehttp/psr7/src/Uri.php new file mode 100644 index 0000000..75ee06b --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Uri.php @@ -0,0 +1,810 @@ + 80, + 'https' => 443, + 'ftp' => 21, + 'gopher' => 70, + 'nntp' => 119, + 'news' => 119, + 'telnet' => 23, + 'tn3270' => 23, + 'imap' => 143, + 'pop' => 110, + 'ldap' => 389, + ]; + + private static $charUnreserved = 'a-zA-Z0-9_\-\.~'; + private static $charSubDelims = '!\$&\'\(\)\*\+,;='; + private static $replaceQuery = ['=' => '%3D', '&' => '%26']; + + /** @var string Uri scheme. */ + private $scheme = ''; + + /** @var string Uri user info. */ + private $userInfo = ''; + + /** @var string Uri host. */ + private $host = ''; + + /** @var int|null Uri port. */ + private $port; + + /** @var string Uri path. */ + private $path = ''; + + /** @var string Uri query string. */ + private $query = ''; + + /** @var string Uri fragment. */ + private $fragment = ''; + + /** + * @param string $uri URI to parse + */ + public function __construct($uri = '') + { + // weak type check to also accept null until we can add scalar type hints + if ($uri != '') { + $parts = self::parse($uri); + if ($parts === false) { + throw new \InvalidArgumentException("Unable to parse URI: $uri"); + } + $this->applyParts($parts); + } + } + + /** + * UTF-8 aware \parse_url() replacement. + * + * The internal function produces broken output for non ASCII domain names + * (IDN) when used with locales other than "C". + * + * On the other hand, cURL understands IDN correctly only when UTF-8 locale + * is configured ("C.UTF-8", "en_US.UTF-8", etc.). + * + * @see https://bugs.php.net/bug.php?id=52923 + * @see https://www.php.net/manual/en/function.parse-url.php#114817 + * @see https://curl.haxx.se/libcurl/c/CURLOPT_URL.html#ENCODING + * + * @param string $url + * + * @return array|false + */ + private static function parse($url) + { + // If IPv6 + $prefix = ''; + if (preg_match('%^(.*://\[[0-9:a-f]+\])(.*?)$%', $url, $matches)) { + $prefix = $matches[1]; + $url = $matches[2]; + } + + $encodedUrl = preg_replace_callback( + '%[^:/@?&=#]+%usD', + static function ($matches) { + return urlencode($matches[0]); + }, + $url + ); + + $result = parse_url($prefix . $encodedUrl); + + if ($result === false) { + return false; + } + + return array_map('urldecode', $result); + } + + public function __toString() + { + return self::composeComponents( + $this->scheme, + $this->getAuthority(), + $this->path, + $this->query, + $this->fragment + ); + } + + /** + * Composes a URI reference string from its various components. + * + * Usually this method does not need to be called manually but instead is used indirectly via + * `Psr\Http\Message\UriInterface::__toString`. + * + * PSR-7 UriInterface treats an empty component the same as a missing component as + * getQuery(), getFragment() etc. always return a string. This explains the slight + * difference to RFC 3986 Section 5.3. + * + * Another adjustment is that the authority separator is added even when the authority is missing/empty + * for the "file" scheme. This is because PHP stream functions like `file_get_contents` only work with + * `file:///myfile` but not with `file:/myfile` although they are equivalent according to RFC 3986. But + * `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to + * that format). + * + * @param string $scheme + * @param string $authority + * @param string $path + * @param string $query + * @param string $fragment + * + * @return string + * + * @link https://tools.ietf.org/html/rfc3986#section-5.3 + */ + public static function composeComponents($scheme, $authority, $path, $query, $fragment) + { + $uri = ''; + + // weak type checks to also accept null until we can add scalar type hints + if ($scheme != '') { + $uri .= $scheme . ':'; + } + + if ($authority != ''|| $scheme === 'file') { + $uri .= '//' . $authority; + } + + $uri .= $path; + + if ($query != '') { + $uri .= '?' . $query; + } + + if ($fragment != '') { + $uri .= '#' . $fragment; + } + + return $uri; + } + + /** + * Whether the URI has the default port of the current scheme. + * + * `Psr\Http\Message\UriInterface::getPort` may return null or the standard port. This method can be used + * independently of the implementation. + * + * @param UriInterface $uri + * + * @return bool + */ + public static function isDefaultPort(UriInterface $uri) + { + return $uri->getPort() === null + || (isset(self::$defaultPorts[$uri->getScheme()]) && $uri->getPort() === self::$defaultPorts[$uri->getScheme()]); + } + + /** + * Whether the URI is absolute, i.e. it has a scheme. + * + * An instance of UriInterface can either be an absolute URI or a relative reference. This method returns true + * if it is the former. An absolute URI has a scheme. A relative reference is used to express a URI relative + * to another URI, the base URI. Relative references can be divided into several forms: + * - network-path references, e.g. '//example.com/path' + * - absolute-path references, e.g. '/path' + * - relative-path references, e.g. 'subpath' + * + * @param UriInterface $uri + * + * @return bool + * + * @see Uri::isNetworkPathReference + * @see Uri::isAbsolutePathReference + * @see Uri::isRelativePathReference + * @link https://tools.ietf.org/html/rfc3986#section-4 + */ + public static function isAbsolute(UriInterface $uri) + { + return $uri->getScheme() !== ''; + } + + /** + * Whether the URI is a network-path reference. + * + * A relative reference that begins with two slash characters is termed an network-path reference. + * + * @param UriInterface $uri + * + * @return bool + * + * @link https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isNetworkPathReference(UriInterface $uri) + { + return $uri->getScheme() === '' && $uri->getAuthority() !== ''; + } + + /** + * Whether the URI is a absolute-path reference. + * + * A relative reference that begins with a single slash character is termed an absolute-path reference. + * + * @param UriInterface $uri + * + * @return bool + * + * @link https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isAbsolutePathReference(UriInterface $uri) + { + return $uri->getScheme() === '' + && $uri->getAuthority() === '' + && isset($uri->getPath()[0]) + && $uri->getPath()[0] === '/'; + } + + /** + * Whether the URI is a relative-path reference. + * + * A relative reference that does not begin with a slash character is termed a relative-path reference. + * + * @param UriInterface $uri + * + * @return bool + * + * @link https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isRelativePathReference(UriInterface $uri) + { + return $uri->getScheme() === '' + && $uri->getAuthority() === '' + && (!isset($uri->getPath()[0]) || $uri->getPath()[0] !== '/'); + } + + /** + * Whether the URI is a same-document reference. + * + * A same-document reference refers to a URI that is, aside from its fragment + * component, identical to the base URI. When no base URI is given, only an empty + * URI reference (apart from its fragment) is considered a same-document reference. + * + * @param UriInterface $uri The URI to check + * @param UriInterface|null $base An optional base URI to compare against + * + * @return bool + * + * @link https://tools.ietf.org/html/rfc3986#section-4.4 + */ + public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null) + { + if ($base !== null) { + $uri = UriResolver::resolve($base, $uri); + + return ($uri->getScheme() === $base->getScheme()) + && ($uri->getAuthority() === $base->getAuthority()) + && ($uri->getPath() === $base->getPath()) + && ($uri->getQuery() === $base->getQuery()); + } + + return $uri->getScheme() === '' && $uri->getAuthority() === '' && $uri->getPath() === '' && $uri->getQuery() === ''; + } + + /** + * Removes dot segments from a path and returns the new path. + * + * @param string $path + * + * @return string + * + * @deprecated since version 1.4. Use UriResolver::removeDotSegments instead. + * @see UriResolver::removeDotSegments + */ + public static function removeDotSegments($path) + { + return UriResolver::removeDotSegments($path); + } + + /** + * Converts the relative URI into a new URI that is resolved against the base URI. + * + * @param UriInterface $base Base URI + * @param string|UriInterface $rel Relative URI + * + * @return UriInterface + * + * @deprecated since version 1.4. Use UriResolver::resolve instead. + * @see UriResolver::resolve + */ + public static function resolve(UriInterface $base, $rel) + { + if (!($rel instanceof UriInterface)) { + $rel = new self($rel); + } + + return UriResolver::resolve($base, $rel); + } + + /** + * Creates a new URI with a specific query string value removed. + * + * Any existing query string values that exactly match the provided key are + * removed. + * + * @param UriInterface $uri URI to use as a base. + * @param string $key Query string key to remove. + * + * @return UriInterface + */ + public static function withoutQueryValue(UriInterface $uri, $key) + { + $result = self::getFilteredQueryString($uri, [$key]); + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a new URI with a specific query string value. + * + * Any existing query string values that exactly match the provided key are + * removed and replaced with the given key value pair. + * + * A value of null will set the query string key without a value, e.g. "key" + * instead of "key=value". + * + * @param UriInterface $uri URI to use as a base. + * @param string $key Key to set. + * @param string|null $value Value to set + * + * @return UriInterface + */ + public static function withQueryValue(UriInterface $uri, $key, $value) + { + $result = self::getFilteredQueryString($uri, [$key]); + + $result[] = self::generateQueryString($key, $value); + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a new URI with multiple specific query string values. + * + * It has the same behavior as withQueryValue() but for an associative array of key => value. + * + * @param UriInterface $uri URI to use as a base. + * @param array $keyValueArray Associative array of key and values + * + * @return UriInterface + */ + public static function withQueryValues(UriInterface $uri, array $keyValueArray) + { + $result = self::getFilteredQueryString($uri, array_keys($keyValueArray)); + + foreach ($keyValueArray as $key => $value) { + $result[] = self::generateQueryString($key, $value); + } + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a URI from a hash of `parse_url` components. + * + * @param array $parts + * + * @return UriInterface + * + * @link http://php.net/manual/en/function.parse-url.php + * + * @throws \InvalidArgumentException If the components do not form a valid URI. + */ + public static function fromParts(array $parts) + { + $uri = new self(); + $uri->applyParts($parts); + $uri->validateState(); + + return $uri; + } + + public function getScheme() + { + return $this->scheme; + } + + public function getAuthority() + { + $authority = $this->host; + if ($this->userInfo !== '') { + $authority = $this->userInfo . '@' . $authority; + } + + if ($this->port !== null) { + $authority .= ':' . $this->port; + } + + return $authority; + } + + public function getUserInfo() + { + return $this->userInfo; + } + + public function getHost() + { + return $this->host; + } + + public function getPort() + { + return $this->port; + } + + public function getPath() + { + return $this->path; + } + + public function getQuery() + { + return $this->query; + } + + public function getFragment() + { + return $this->fragment; + } + + public function withScheme($scheme) + { + $scheme = $this->filterScheme($scheme); + + if ($this->scheme === $scheme) { + return $this; + } + + $new = clone $this; + $new->scheme = $scheme; + $new->removeDefaultPort(); + $new->validateState(); + + return $new; + } + + public function withUserInfo($user, $password = null) + { + $info = $this->filterUserInfoComponent($user); + if ($password !== null) { + $info .= ':' . $this->filterUserInfoComponent($password); + } + + if ($this->userInfo === $info) { + return $this; + } + + $new = clone $this; + $new->userInfo = $info; + $new->validateState(); + + return $new; + } + + public function withHost($host) + { + $host = $this->filterHost($host); + + if ($this->host === $host) { + return $this; + } + + $new = clone $this; + $new->host = $host; + $new->validateState(); + + return $new; + } + + public function withPort($port) + { + $port = $this->filterPort($port); + + if ($this->port === $port) { + return $this; + } + + $new = clone $this; + $new->port = $port; + $new->removeDefaultPort(); + $new->validateState(); + + return $new; + } + + public function withPath($path) + { + $path = $this->filterPath($path); + + if ($this->path === $path) { + return $this; + } + + $new = clone $this; + $new->path = $path; + $new->validateState(); + + return $new; + } + + public function withQuery($query) + { + $query = $this->filterQueryAndFragment($query); + + if ($this->query === $query) { + return $this; + } + + $new = clone $this; + $new->query = $query; + + return $new; + } + + public function withFragment($fragment) + { + $fragment = $this->filterQueryAndFragment($fragment); + + if ($this->fragment === $fragment) { + return $this; + } + + $new = clone $this; + $new->fragment = $fragment; + + return $new; + } + + /** + * Apply parse_url parts to a URI. + * + * @param array $parts Array of parse_url parts to apply. + */ + private function applyParts(array $parts) + { + $this->scheme = isset($parts['scheme']) + ? $this->filterScheme($parts['scheme']) + : ''; + $this->userInfo = isset($parts['user']) + ? $this->filterUserInfoComponent($parts['user']) + : ''; + $this->host = isset($parts['host']) + ? $this->filterHost($parts['host']) + : ''; + $this->port = isset($parts['port']) + ? $this->filterPort($parts['port']) + : null; + $this->path = isset($parts['path']) + ? $this->filterPath($parts['path']) + : ''; + $this->query = isset($parts['query']) + ? $this->filterQueryAndFragment($parts['query']) + : ''; + $this->fragment = isset($parts['fragment']) + ? $this->filterQueryAndFragment($parts['fragment']) + : ''; + if (isset($parts['pass'])) { + $this->userInfo .= ':' . $this->filterUserInfoComponent($parts['pass']); + } + + $this->removeDefaultPort(); + } + + /** + * @param string $scheme + * + * @return string + * + * @throws \InvalidArgumentException If the scheme is invalid. + */ + private function filterScheme($scheme) + { + if (!is_string($scheme)) { + throw new \InvalidArgumentException('Scheme must be a string'); + } + + return \strtr($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); + } + + /** + * @param string $component + * + * @return string + * + * @throws \InvalidArgumentException If the user info is invalid. + */ + private function filterUserInfoComponent($component) + { + if (!is_string($component)) { + throw new \InvalidArgumentException('User info must be a string'); + } + + return preg_replace_callback( + '/(?:[^%' . self::$charUnreserved . self::$charSubDelims . ']+|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $component + ); + } + + /** + * @param string $host + * + * @return string + * + * @throws \InvalidArgumentException If the host is invalid. + */ + private function filterHost($host) + { + if (!is_string($host)) { + throw new \InvalidArgumentException('Host must be a string'); + } + + return \strtr($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); + } + + /** + * @param int|null $port + * + * @return int|null + * + * @throws \InvalidArgumentException If the port is invalid. + */ + private function filterPort($port) + { + if ($port === null) { + return null; + } + + $port = (int) $port; + if (0 > $port || 0xffff < $port) { + throw new \InvalidArgumentException( + sprintf('Invalid port: %d. Must be between 0 and 65535', $port) + ); + } + + return $port; + } + + /** + * @param UriInterface $uri + * @param array $keys + * + * @return array + */ + private static function getFilteredQueryString(UriInterface $uri, array $keys) + { + $current = $uri->getQuery(); + + if ($current === '') { + return []; + } + + $decodedKeys = array_map('rawurldecode', $keys); + + return array_filter(explode('&', $current), function ($part) use ($decodedKeys) { + return !in_array(rawurldecode(explode('=', $part)[0]), $decodedKeys, true); + }); + } + + /** + * @param string $key + * @param string|null $value + * + * @return string + */ + private static function generateQueryString($key, $value) + { + // Query string separators ("=", "&") within the key or value need to be encoded + // (while preventing double-encoding) before setting the query string. All other + // chars that need percent-encoding will be encoded by withQuery(). + $queryString = strtr($key, self::$replaceQuery); + + if ($value !== null) { + $queryString .= '=' . strtr($value, self::$replaceQuery); + } + + return $queryString; + } + + private function removeDefaultPort() + { + if ($this->port !== null && self::isDefaultPort($this)) { + $this->port = null; + } + } + + /** + * Filters the path of a URI + * + * @param string $path + * + * @return string + * + * @throws \InvalidArgumentException If the path is invalid. + */ + private function filterPath($path) + { + if (!is_string($path)) { + throw new \InvalidArgumentException('Path must be a string'); + } + + return preg_replace_callback( + '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $path + ); + } + + /** + * Filters the query string or fragment of a URI. + * + * @param string $str + * + * @return string + * + * @throws \InvalidArgumentException If the query or fragment is invalid. + */ + private function filterQueryAndFragment($str) + { + if (!is_string($str)) { + throw new \InvalidArgumentException('Query and fragment must be a string'); + } + + return preg_replace_callback( + '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $str + ); + } + + private function rawurlencodeMatchZero(array $match) + { + return rawurlencode($match[0]); + } + + private function validateState() + { + if ($this->host === '' && ($this->scheme === 'http' || $this->scheme === 'https')) { + $this->host = self::HTTP_DEFAULT_HOST; + } + + if ($this->getAuthority() === '') { + if (0 === strpos($this->path, '//')) { + throw new \InvalidArgumentException('The path of a URI without an authority must not start with two slashes "//"'); + } + if ($this->scheme === '' && false !== strpos(explode('/', $this->path, 2)[0], ':')) { + throw new \InvalidArgumentException('A relative URI must not have a path beginning with a segment containing a colon'); + } + } elseif (isset($this->path[0]) && $this->path[0] !== '/') { + @trigger_error( + 'The path of a URI with an authority must start with a slash "/" or be empty. Automagically fixing the URI ' . + 'by adding a leading slash to the path is deprecated since version 1.4 and will throw an exception instead.', + E_USER_DEPRECATED + ); + $this->path = '/' . $this->path; + //throw new \InvalidArgumentException('The path of a URI with an authority must start with a slash "/" or be empty'); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/UriNormalizer.php b/vendor/guzzlehttp/psr7/src/UriNormalizer.php new file mode 100644 index 0000000..f5c093c --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/UriNormalizer.php @@ -0,0 +1,219 @@ +getPath() === '' && + ($uri->getScheme() === 'http' || $uri->getScheme() === 'https') + ) { + $uri = $uri->withPath('/'); + } + + if ($flags & self::REMOVE_DEFAULT_HOST && $uri->getScheme() === 'file' && $uri->getHost() === 'localhost') { + $uri = $uri->withHost(''); + } + + if ($flags & self::REMOVE_DEFAULT_PORT && $uri->getPort() !== null && Uri::isDefaultPort($uri)) { + $uri = $uri->withPort(null); + } + + if ($flags & self::REMOVE_DOT_SEGMENTS && !Uri::isRelativePathReference($uri)) { + $uri = $uri->withPath(UriResolver::removeDotSegments($uri->getPath())); + } + + if ($flags & self::REMOVE_DUPLICATE_SLASHES) { + $uri = $uri->withPath(preg_replace('#//++#', '/', $uri->getPath())); + } + + if ($flags & self::SORT_QUERY_PARAMETERS && $uri->getQuery() !== '') { + $queryKeyValues = explode('&', $uri->getQuery()); + sort($queryKeyValues); + $uri = $uri->withQuery(implode('&', $queryKeyValues)); + } + + return $uri; + } + + /** + * Whether two URIs can be considered equivalent. + * + * Both URIs are normalized automatically before comparison with the given $normalizations bitmask. The method also + * accepts relative URI references and returns true when they are equivalent. This of course assumes they will be + * resolved against the same base URI. If this is not the case, determination of equivalence or difference of + * relative references does not mean anything. + * + * @param UriInterface $uri1 An URI to compare + * @param UriInterface $uri2 An URI to compare + * @param int $normalizations A bitmask of normalizations to apply, see constants + * + * @return bool + * + * @link https://tools.ietf.org/html/rfc3986#section-6.1 + */ + public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS) + { + return (string) self::normalize($uri1, $normalizations) === (string) self::normalize($uri2, $normalizations); + } + + private static function capitalizePercentEncoding(UriInterface $uri) + { + $regex = '/(?:%[A-Fa-f0-9]{2})++/'; + + $callback = function (array $match) { + return strtoupper($match[0]); + }; + + return + $uri->withPath( + preg_replace_callback($regex, $callback, $uri->getPath()) + )->withQuery( + preg_replace_callback($regex, $callback, $uri->getQuery()) + ); + } + + private static function decodeUnreservedCharacters(UriInterface $uri) + { + $regex = '/%(?:2D|2E|5F|7E|3[0-9]|[46][1-9A-F]|[57][0-9A])/i'; + + $callback = function (array $match) { + return rawurldecode($match[0]); + }; + + return + $uri->withPath( + preg_replace_callback($regex, $callback, $uri->getPath()) + )->withQuery( + preg_replace_callback($regex, $callback, $uri->getQuery()) + ); + } + + private function __construct() + { + // cannot be instantiated + } +} diff --git a/vendor/guzzlehttp/psr7/src/UriResolver.php b/vendor/guzzlehttp/psr7/src/UriResolver.php new file mode 100644 index 0000000..540db52 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/UriResolver.php @@ -0,0 +1,222 @@ +getScheme() != '') { + return $rel->withPath(self::removeDotSegments($rel->getPath())); + } + + if ($rel->getAuthority() != '') { + $targetAuthority = $rel->getAuthority(); + $targetPath = self::removeDotSegments($rel->getPath()); + $targetQuery = $rel->getQuery(); + } else { + $targetAuthority = $base->getAuthority(); + if ($rel->getPath() === '') { + $targetPath = $base->getPath(); + $targetQuery = $rel->getQuery() != '' ? $rel->getQuery() : $base->getQuery(); + } else { + if ($rel->getPath()[0] === '/') { + $targetPath = $rel->getPath(); + } else { + if ($targetAuthority != '' && $base->getPath() === '') { + $targetPath = '/' . $rel->getPath(); + } else { + $lastSlashPos = strrpos($base->getPath(), '/'); + if ($lastSlashPos === false) { + $targetPath = $rel->getPath(); + } else { + $targetPath = substr($base->getPath(), 0, $lastSlashPos + 1) . $rel->getPath(); + } + } + } + $targetPath = self::removeDotSegments($targetPath); + $targetQuery = $rel->getQuery(); + } + } + + return new Uri(Uri::composeComponents( + $base->getScheme(), + $targetAuthority, + $targetPath, + $targetQuery, + $rel->getFragment() + )); + } + + /** + * Returns the target URI as a relative reference from the base URI. + * + * This method is the counterpart to resolve(): + * + * (string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) + * + * One use-case is to use the current request URI as base URI and then generate relative links in your documents + * to reduce the document size or offer self-contained downloadable document archives. + * + * $base = new Uri('http://example.com/a/b/'); + * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. + * echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. + * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. + * echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. + * + * This method also accepts a target that is already relative and will try to relativize it further. Only a + * relative-path reference will be returned as-is. + * + * echo UriResolver::relativize($base, new Uri('/a/b/c')); // prints 'c' as well + * + * @param UriInterface $base Base URI + * @param UriInterface $target Target URI + * + * @return UriInterface The relative URI reference + */ + public static function relativize(UriInterface $base, UriInterface $target) + { + if ($target->getScheme() !== '' && + ($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '') + ) { + return $target; + } + + if (Uri::isRelativePathReference($target)) { + // As the target is already highly relative we return it as-is. It would be possible to resolve + // the target with `$target = self::resolve($base, $target);` and then try make it more relative + // by removing a duplicate query. But let's not do that automatically. + return $target; + } + + if ($target->getAuthority() !== '' && $base->getAuthority() !== $target->getAuthority()) { + return $target->withScheme(''); + } + + // We must remove the path before removing the authority because if the path starts with two slashes, the URI + // would turn invalid. And we also cannot set a relative path before removing the authority, as that is also + // invalid. + $emptyPathUri = $target->withScheme('')->withPath('')->withUserInfo('')->withPort(null)->withHost(''); + + if ($base->getPath() !== $target->getPath()) { + return $emptyPathUri->withPath(self::getRelativePath($base, $target)); + } + + if ($base->getQuery() === $target->getQuery()) { + // Only the target fragment is left. And it must be returned even if base and target fragment are the same. + return $emptyPathUri->withQuery(''); + } + + // If the base URI has a query but the target has none, we cannot return an empty path reference as it would + // inherit the base query component when resolving. + if ($target->getQuery() === '') { + $segments = explode('/', $target->getPath()); + $lastSegment = end($segments); + + return $emptyPathUri->withPath($lastSegment === '' ? './' : $lastSegment); + } + + return $emptyPathUri; + } + + private static function getRelativePath(UriInterface $base, UriInterface $target) + { + $sourceSegments = explode('/', $base->getPath()); + $targetSegments = explode('/', $target->getPath()); + array_pop($sourceSegments); + $targetLastSegment = array_pop($targetSegments); + foreach ($sourceSegments as $i => $segment) { + if (isset($targetSegments[$i]) && $segment === $targetSegments[$i]) { + unset($sourceSegments[$i], $targetSegments[$i]); + } else { + break; + } + } + $targetSegments[] = $targetLastSegment; + $relativePath = str_repeat('../', count($sourceSegments)) . implode('/', $targetSegments); + + // A reference to am empty last segment or an empty first sub-segment must be prefixed with "./". + // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used + // as the first segment of a relative-path reference, as it would be mistaken for a scheme name. + if ('' === $relativePath || false !== strpos(explode('/', $relativePath, 2)[0], ':')) { + $relativePath = "./$relativePath"; + } elseif ('/' === $relativePath[0]) { + if ($base->getAuthority() != '' && $base->getPath() === '') { + // In this case an extra slash is added by resolve() automatically. So we must not add one here. + $relativePath = ".$relativePath"; + } else { + $relativePath = "./$relativePath"; + } + } + + return $relativePath; + } + + private function __construct() + { + // cannot be instantiated + } +} diff --git a/vendor/guzzlehttp/psr7/src/Utils.php b/vendor/guzzlehttp/psr7/src/Utils.php new file mode 100644 index 0000000..60ce6b9 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Utils.php @@ -0,0 +1,428 @@ + $keys + * + * @return array + */ + public static function caselessRemove($keys, array $data) + { + $result = []; + + foreach ($keys as &$key) { + $key = strtolower($key); + } + + foreach ($data as $k => $v) { + if (!in_array(strtolower($k), $keys)) { + $result[$k] = $v; + } + } + + return $result; + } + + /** + * Copy the contents of a stream into another stream until the given number + * of bytes have been read. + * + * @param StreamInterface $source Stream to read from + * @param StreamInterface $dest Stream to write to + * @param int $maxLen Maximum number of bytes to read. Pass -1 + * to read the entire stream. + * + * @throws \RuntimeException on error. + */ + public static function copyToStream(StreamInterface $source, StreamInterface $dest, $maxLen = -1) + { + $bufferSize = 8192; + + if ($maxLen === -1) { + while (!$source->eof()) { + if (!$dest->write($source->read($bufferSize))) { + break; + } + } + } else { + $remaining = $maxLen; + while ($remaining > 0 && !$source->eof()) { + $buf = $source->read(min($bufferSize, $remaining)); + $len = strlen($buf); + if (!$len) { + break; + } + $remaining -= $len; + $dest->write($buf); + } + } + } + + /** + * Copy the contents of a stream into a string until the given number of + * bytes have been read. + * + * @param StreamInterface $stream Stream to read + * @param int $maxLen Maximum number of bytes to read. Pass -1 + * to read the entire stream. + * + * @return string + * + * @throws \RuntimeException on error. + */ + public static function copyToString(StreamInterface $stream, $maxLen = -1) + { + $buffer = ''; + + if ($maxLen === -1) { + while (!$stream->eof()) { + $buf = $stream->read(1048576); + // Using a loose equality here to match on '' and false. + if ($buf == null) { + break; + } + $buffer .= $buf; + } + return $buffer; + } + + $len = 0; + while (!$stream->eof() && $len < $maxLen) { + $buf = $stream->read($maxLen - $len); + // Using a loose equality here to match on '' and false. + if ($buf == null) { + break; + } + $buffer .= $buf; + $len = strlen($buffer); + } + + return $buffer; + } + + /** + * Calculate a hash of a stream. + * + * This method reads the entire stream to calculate a rolling hash, based + * on PHP's `hash_init` functions. + * + * @param StreamInterface $stream Stream to calculate the hash for + * @param string $algo Hash algorithm (e.g. md5, crc32, etc) + * @param bool $rawOutput Whether or not to use raw output + * + * @return string Returns the hash of the stream + * + * @throws \RuntimeException on error. + */ + public static function hash(StreamInterface $stream, $algo, $rawOutput = false) + { + $pos = $stream->tell(); + + if ($pos > 0) { + $stream->rewind(); + } + + $ctx = hash_init($algo); + while (!$stream->eof()) { + hash_update($ctx, $stream->read(1048576)); + } + + $out = hash_final($ctx, (bool) $rawOutput); + $stream->seek($pos); + + return $out; + } + + /** + * Clone and modify a request with the given changes. + * + * This method is useful for reducing the number of clones needed to mutate + * a message. + * + * The changes can be one of: + * - method: (string) Changes the HTTP method. + * - set_headers: (array) Sets the given headers. + * - remove_headers: (array) Remove the given headers. + * - body: (mixed) Sets the given body. + * - uri: (UriInterface) Set the URI. + * - query: (string) Set the query string value of the URI. + * - version: (string) Set the protocol version. + * + * @param RequestInterface $request Request to clone and modify. + * @param array $changes Changes to apply. + * + * @return RequestInterface + */ + public static function modifyRequest(RequestInterface $request, array $changes) + { + if (!$changes) { + return $request; + } + + $headers = $request->getHeaders(); + + if (!isset($changes['uri'])) { + $uri = $request->getUri(); + } else { + // Remove the host header if one is on the URI + if ($host = $changes['uri']->getHost()) { + $changes['set_headers']['Host'] = $host; + + if ($port = $changes['uri']->getPort()) { + $standardPorts = ['http' => 80, 'https' => 443]; + $scheme = $changes['uri']->getScheme(); + if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) { + $changes['set_headers']['Host'] .= ':' . $port; + } + } + } + $uri = $changes['uri']; + } + + if (!empty($changes['remove_headers'])) { + $headers = self::caselessRemove($changes['remove_headers'], $headers); + } + + if (!empty($changes['set_headers'])) { + $headers = self::caselessRemove(array_keys($changes['set_headers']), $headers); + $headers = $changes['set_headers'] + $headers; + } + + if (isset($changes['query'])) { + $uri = $uri->withQuery($changes['query']); + } + + if ($request instanceof ServerRequestInterface) { + $new = (new ServerRequest( + isset($changes['method']) ? $changes['method'] : $request->getMethod(), + $uri, + $headers, + isset($changes['body']) ? $changes['body'] : $request->getBody(), + isset($changes['version']) + ? $changes['version'] + : $request->getProtocolVersion(), + $request->getServerParams() + )) + ->withParsedBody($request->getParsedBody()) + ->withQueryParams($request->getQueryParams()) + ->withCookieParams($request->getCookieParams()) + ->withUploadedFiles($request->getUploadedFiles()); + + foreach ($request->getAttributes() as $key => $value) { + $new = $new->withAttribute($key, $value); + } + + return $new; + } + + return new Request( + isset($changes['method']) ? $changes['method'] : $request->getMethod(), + $uri, + $headers, + isset($changes['body']) ? $changes['body'] : $request->getBody(), + isset($changes['version']) + ? $changes['version'] + : $request->getProtocolVersion() + ); + } + + /** + * Read a line from the stream up to the maximum allowed buffer length. + * + * @param StreamInterface $stream Stream to read from + * @param int|null $maxLength Maximum buffer length + * + * @return string + */ + public static function readLine(StreamInterface $stream, $maxLength = null) + { + $buffer = ''; + $size = 0; + + while (!$stream->eof()) { + // Using a loose equality here to match on '' and false. + if (null == ($byte = $stream->read(1))) { + return $buffer; + } + $buffer .= $byte; + // Break when a new line is found or the max length - 1 is reached + if ($byte === "\n" || ++$size === $maxLength - 1) { + break; + } + } + + return $buffer; + } + + /** + * Create a new stream based on the input type. + * + * Options is an associative array that can contain the following keys: + * - metadata: Array of custom metadata. + * - size: Size of the stream. + * + * This method accepts the following `$resource` types: + * - `Psr\Http\Message\StreamInterface`: Returns the value as-is. + * - `string`: Creates a stream object that uses the given string as the contents. + * - `resource`: Creates a stream object that wraps the given PHP stream resource. + * - `Iterator`: If the provided value implements `Iterator`, then a read-only + * stream object will be created that wraps the given iterable. Each time the + * stream is read from, data from the iterator will fill a buffer and will be + * continuously called until the buffer is equal to the requested read size. + * Subsequent read calls will first read from the buffer and then call `next` + * on the underlying iterator until it is exhausted. + * - `object` with `__toString()`: If the object has the `__toString()` method, + * the object will be cast to a string and then a stream will be returned that + * uses the string value. + * - `NULL`: When `null` is passed, an empty stream object is returned. + * - `callable` When a callable is passed, a read-only stream object will be + * created that invokes the given callable. The callable is invoked with the + * number of suggested bytes to read. The callable can return any number of + * bytes, but MUST return `false` when there is no more data to return. The + * stream object that wraps the callable will invoke the callable until the + * number of requested bytes are available. Any additional bytes will be + * buffered and used in subsequent reads. + * + * @param resource|string|int|float|bool|StreamInterface|callable|\Iterator|null $resource Entity body data + * @param array $options Additional options + * + * @return StreamInterface + * + * @throws \InvalidArgumentException if the $resource arg is not valid. + */ + public static function streamFor($resource = '', array $options = []) + { + if (is_scalar($resource)) { + $stream = self::tryFopen('php://temp', 'r+'); + if ($resource !== '') { + fwrite($stream, $resource); + fseek($stream, 0); + } + return new Stream($stream, $options); + } + + switch (gettype($resource)) { + case 'resource': + /* + * The 'php://input' is a special stream with quirks and inconsistencies. + * We avoid using that stream by reading it into php://temp + */ + $metaData = \stream_get_meta_data($resource); + if (isset($metaData['uri']) && $metaData['uri'] === 'php://input') { + $stream = self::tryFopen('php://temp', 'w+'); + fwrite($stream, stream_get_contents($resource)); + fseek($stream, 0); + $resource = $stream; + } + return new Stream($resource, $options); + case 'object': + if ($resource instanceof StreamInterface) { + return $resource; + } elseif ($resource instanceof \Iterator) { + return new PumpStream(function () use ($resource) { + if (!$resource->valid()) { + return false; + } + $result = $resource->current(); + $resource->next(); + return $result; + }, $options); + } elseif (method_exists($resource, '__toString')) { + return Utils::streamFor((string) $resource, $options); + } + break; + case 'NULL': + return new Stream(self::tryFopen('php://temp', 'r+'), $options); + } + + if (is_callable($resource)) { + return new PumpStream($resource, $options); + } + + throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource)); + } + + /** + * Safely opens a PHP stream resource using a filename. + * + * When fopen fails, PHP normally raises a warning. This function adds an + * error handler that checks for errors and throws an exception instead. + * + * @param string $filename File to open + * @param string $mode Mode used to open the file + * + * @return resource + * + * @throws \RuntimeException if the file cannot be opened + */ + public static function tryFopen($filename, $mode) + { + $ex = null; + set_error_handler(function () use ($filename, $mode, &$ex) { + $ex = new \RuntimeException(sprintf( + 'Unable to open "%s" using mode "%s": %s', + $filename, + $mode, + func_get_args()[1] + )); + + return true; + }); + + try { + $handle = fopen($filename, $mode); + } catch (\Throwable $e) { + $ex = new \RuntimeException(sprintf( + 'Unable to open "%s" using mode "%s": %s', + $filename, + $mode, + $e->getMessage() + ), 0, $e); + } + + restore_error_handler(); + + if ($ex) { + /** @var $ex \RuntimeException */ + throw $ex; + } + + return $handle; + } + + /** + * Returns a UriInterface for the given value. + * + * This function accepts a string or UriInterface and returns a + * UriInterface for the given value. If the value is already a + * UriInterface, it is returned as-is. + * + * @param string|UriInterface $uri + * + * @return UriInterface + * + * @throws \InvalidArgumentException + */ + public static function uriFor($uri) + { + if ($uri instanceof UriInterface) { + return $uri; + } + + if (is_string($uri)) { + return new Uri($uri); + } + + throw new \InvalidArgumentException('URI must be a string or UriInterface'); + } +} diff --git a/vendor/guzzlehttp/psr7/src/functions.php b/vendor/guzzlehttp/psr7/src/functions.php new file mode 100644 index 0000000..266e659 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/functions.php @@ -0,0 +1,422 @@ + '1', 'foo[b]' => '2'])`. + * + * @param string $str Query string to parse + * @param int|bool $urlEncoding How the query string is encoded + * + * @return array + * + * @deprecated parse_query will be removed in guzzlehttp/psr7:2.0. Use Query::parse instead. + */ +function parse_query($str, $urlEncoding = true) +{ + return Query::parse($str, $urlEncoding); +} + +/** + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse_query()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + * + * @return string + * + * @deprecated build_query will be removed in guzzlehttp/psr7:2.0. Use Query::build instead. + */ +function build_query(array $params, $encoding = PHP_QUERY_RFC3986) +{ + return Query::build($params, $encoding); +} + +/** + * Determines the mimetype of a file by looking at its extension. + * + * @param string $filename + * + * @return string|null + * + * @deprecated mimetype_from_filename will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromFilename instead. + */ +function mimetype_from_filename($filename) +{ + return MimeType::fromFilename($filename); +} + +/** + * Maps a file extensions to a mimetype. + * + * @param $extension string The file extension. + * + * @return string|null + * + * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types + * @deprecated mimetype_from_extension will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromExtension instead. + */ +function mimetype_from_extension($extension) +{ + return MimeType::fromExtension($extension); +} + +/** + * Parses an HTTP message into an associative array. + * + * The array contains the "start-line" key containing the start line of + * the message, "headers" key containing an associative array of header + * array values, and a "body" key containing the body of the message. + * + * @param string $message HTTP request or response to parse. + * + * @return array + * + * @internal + * + * @deprecated _parse_message will be removed in guzzlehttp/psr7:2.0. Use Message::parseMessage instead. + */ +function _parse_message($message) +{ + return Message::parseMessage($message); +} + +/** + * Constructs a URI for an HTTP request message. + * + * @param string $path Path from the start-line + * @param array $headers Array of headers (each value an array). + * + * @return string + * + * @internal + * + * @deprecated _parse_request_uri will be removed in guzzlehttp/psr7:2.0. Use Message::parseRequestUri instead. + */ +function _parse_request_uri($path, array $headers) +{ + return Message::parseRequestUri($path, $headers); +} + +/** + * Get a short summary of the message body. + * + * Will return `null` if the response is not printable. + * + * @param MessageInterface $message The message to get the body summary + * @param int $truncateAt The maximum allowed size of the summary + * + * @return string|null + * + * @deprecated get_message_body_summary will be removed in guzzlehttp/psr7:2.0. Use Message::bodySummary instead. + */ +function get_message_body_summary(MessageInterface $message, $truncateAt = 120) +{ + return Message::bodySummary($message, $truncateAt); +} + +/** + * Remove the items given by the keys, case insensitively from the data. + * + * @param iterable $keys + * + * @return array + * + * @internal + * + * @deprecated _caseless_remove will be removed in guzzlehttp/psr7:2.0. Use Utils::caselessRemove instead. + */ +function _caseless_remove($keys, array $data) +{ + return Utils::caselessRemove($keys, $data); +} diff --git a/vendor/guzzlehttp/psr7/src/functions_include.php b/vendor/guzzlehttp/psr7/src/functions_include.php new file mode 100644 index 0000000..96a4a83 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/functions_include.php @@ -0,0 +1,6 @@ +get($ipAddress)); + +// getWithPrefixLen returns an array containing the record and the +// associated prefix length for that record. +print_r($reader->getWithPrefixLen($ipAddress)); + +$reader->close(); +``` + +## Optional PHP C Extension ## + +MaxMind provides an optional C extension that is a drop-in replacement for +`MaxMind\Db\Reader`. In order to use this extension, you must install the +Reader API as described above and install the extension as described below. If +you are using an autoloader, no changes to your code should be necessary. + +### Installing Extension ### + +First install [libmaxminddb](https://github.com/maxmind/libmaxminddb) as +described in its [README.md +file](https://github.com/maxmind/libmaxminddb/blob/master/README.md#installing-from-a-tarball). +After successfully installing libmaxmindb, run the following commands from the +top-level directory of this distribution: + +``` +cd ext +phpize +./configure +make +make test +sudo make install +``` + +You then must load your extension. The recommend method is to add the +following to your `php.ini` file: + +``` +extension=maxminddb.so +``` + +Note: You may need to install the PHP development package on your OS such as +php5-dev for Debian-based systems or php-devel for RedHat/Fedora-based ones. + +## 128-bit Integer Support ## + +The MaxMind DB format includes 128-bit unsigned integer as a type. Although +no MaxMind-distributed database currently makes use of this type, both the +pure PHP reader and the C extension support this type. The pure PHP reader +requires gmp or bcmath to read databases with 128-bit unsigned integers. + +The integer is currently returned as a hexadecimal string (prefixed with "0x") +by the C extension and a decimal string (no prefix) by the pure PHP reader. +Any change to make the reader implementations always return either a +hexadecimal or decimal representation of the integer will NOT be considered a +breaking change. + +## Support ## + +Please report all issues with this code using the [GitHub issue tracker](https://github.com/maxmind/MaxMind-DB-Reader-php/issues). + +If you are having an issue with a MaxMind service that is not specific to the +client API, please see [our support page](https://www.maxmind.com/en/support). + +## Requirements ## + +This library requires PHP 5.6 or greater. + +The GMP or BCMath extension may be required to read some databases +using the pure PHP API. + +## Contributing ## + +Patches and pull requests are encouraged. All code should follow the PSR-1 and +PSR-2 style guidelines. Please include unit tests whenever possible. + +## Versioning ## + +The MaxMind DB Reader PHP API uses [Semantic Versioning](https://semver.org/). + +## Copyright and License ## + +This software is Copyright (c) 2014-2019 by MaxMind, Inc. + +This is free software, licensed under the Apache License, Version 2.0. diff --git a/vendor/maxmind-db/reader/autoload.php b/vendor/maxmind-db/reader/autoload.php new file mode 100644 index 0000000..c79126f --- /dev/null +++ b/vendor/maxmind-db/reader/autoload.php @@ -0,0 +1,45 @@ +class. + * + * @param string $class + * the name of the class to load + */ +function mmdb_autoload($class) +{ + /* + * A project-specific mapping between the namespaces and where + * they're located. By convention, we include the trailing + * slashes. The one-element array here simply makes things easy + * to extend in the future if (for example) the test classes + * begin to use one another. + */ + $namespace_map = ['MaxMind\\Db\\' => __DIR__ . '/src/MaxMind/Db/']; + + foreach ($namespace_map as $prefix => $dir) { + /* First swap out the namespace prefix with a directory... */ + $path = str_replace($prefix, $dir, $class); + + /* replace the namespace separator with a directory separator... */ + $path = str_replace('\\', '/', $path); + + /* and finally, add the PHP file extension to the result. */ + $path = $path . '.php'; + + /* $path should now contain the path to a PHP file defining $class */ + if (file_exists($path)) { + include $path; + } + } +} + +spl_autoload_register('mmdb_autoload'); diff --git a/vendor/maxmind-db/reader/composer.json b/vendor/maxmind-db/reader/composer.json new file mode 100644 index 0000000..d4debfb --- /dev/null +++ b/vendor/maxmind-db/reader/composer.json @@ -0,0 +1,44 @@ +{ + "name": "maxmind-db/reader", + "description": "MaxMind DB Reader API", + "keywords": ["database", "geoip", "geoip2", "geolocation", "maxmind"], + "homepage": "https://github.com/maxmind/MaxMind-DB-Reader-php", + "type": "library", + "license": "Apache-2.0", + "authors": [ + { + "name": "Gregory J. Oschwald", + "email": "goschwald@maxmind.com", + "homepage": "https://www.maxmind.com/" + } + ], + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-bcmath": "bcmath or gmp is required for decoding larger integers with the pure PHP decoder", + "ext-gmp": "bcmath or gmp is required for decoding larger integers with the pure PHP decoder", + "ext-maxminddb": "A C-based database decoder that provides significantly faster lookups" + }, + "conflict": { + "ext-maxminddb": "<1.10.1,>=2.0.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "*", + "phpunit/phpunit": ">=8.0.0,<10.0.0", + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpcov": ">=6.0.0", + "squizlabs/php_codesniffer": "3.*", + "phpstan/phpstan": "*" + }, + "autoload": { + "psr-4": { + "MaxMind\\Db\\": "src/MaxMind/Db" + } + }, + "autoload-dev": { + "psr-4": { + "MaxMind\\Db\\Test\\Reader\\": "tests/MaxMind/Db/Test/Reader" + } + } +} diff --git a/vendor/maxmind-db/reader/ext/config.m4 b/vendor/maxmind-db/reader/ext/config.m4 new file mode 100644 index 0000000..675e00c --- /dev/null +++ b/vendor/maxmind-db/reader/ext/config.m4 @@ -0,0 +1,40 @@ +PHP_ARG_WITH(maxminddb, + [Whether to enable the MaxMind DB Reader extension], + [ --with-maxminddb Enable MaxMind DB Reader extension support]) + +PHP_ARG_ENABLE(maxminddb-debug, for MaxMind DB debug support, + [ --enable-maxminddb-debug Enable enable MaxMind DB deubg support], no, no) + +if test $PHP_MAXMINDDB != "no"; then + + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + + AC_MSG_CHECKING(for libmaxminddb) + if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libmaxminddb; then + dnl retrieve build options from pkg-config + if $PKG_CONFIG libmaxminddb --atleast-version 1.0.0; then + LIBMAXMINDDB_INC=`$PKG_CONFIG libmaxminddb --cflags` + LIBMAXMINDDB_LIB=`$PKG_CONFIG libmaxminddb --libs` + LIBMAXMINDDB_VER=`$PKG_CONFIG libmaxminddb --modversion` + AC_MSG_RESULT(found version $LIBMAXMINDDB_VER) + else + AC_MSG_ERROR(system libmaxminddb must be upgraded to version >= 1.0.0) + fi + PHP_EVAL_LIBLINE($LIBMAXMINDDB_LIB, MAXMINDDB_SHARED_LIBADD) + PHP_EVAL_INCLINE($LIBMAXMINDDB_INC) + else + AC_MSG_RESULT(pkg-config information missing) + AC_MSG_WARN(will use libmaxmxinddb from compiler default path) + + PHP_CHECK_LIBRARY(maxminddb, MMDB_open) + PHP_ADD_LIBRARY(maxminddb, 1, MAXMINDDB_SHARED_LIBADD) + fi + + if test $PHP_MAXMINDDB_DEBUG != "no"; then + CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror" + fi + + PHP_SUBST(MAXMINDDB_SHARED_LIBADD) + + PHP_NEW_EXTENSION(maxminddb, maxminddb.c, $ext_shared) +fi diff --git a/vendor/maxmind-db/reader/ext/maxminddb.c b/vendor/maxmind-db/reader/ext/maxminddb.c new file mode 100644 index 0000000..2714608 --- /dev/null +++ b/vendor/maxmind-db/reader/ext/maxminddb.c @@ -0,0 +1,704 @@ +/* MaxMind, Inc., licenses this file to you under the Apache License, Version + * 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#include "php_maxminddb.h" + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include "Zend/zend_exceptions.h" +#include "ext/standard/info.h" +#include + +#ifdef ZTS +#include +#endif + +#define __STDC_FORMAT_MACROS +#include + +#define PHP_MAXMINDDB_NS ZEND_NS_NAME("MaxMind", "Db") +#define PHP_MAXMINDDB_READER_NS ZEND_NS_NAME(PHP_MAXMINDDB_NS, "Reader") +#define PHP_MAXMINDDB_READER_EX_NS \ + ZEND_NS_NAME(PHP_MAXMINDDB_READER_NS, "InvalidDatabaseException") + +#ifdef ZEND_ENGINE_3 +#define Z_MAXMINDDB_P(zv) php_maxminddb_fetch_object(Z_OBJ_P(zv)) +#define _ZVAL_STRING ZVAL_STRING +#define _ZVAL_STRINGL ZVAL_STRINGL +typedef size_t strsize_t; +typedef zend_object free_obj_t; +#else +#define Z_MAXMINDDB_P(zv) \ + (maxminddb_obj *)zend_object_store_get_object(zv TSRMLS_CC) +#define _ZVAL_STRING(a, b) ZVAL_STRING(a, b, 1) +#define _ZVAL_STRINGL(a, b, c) ZVAL_STRINGL(a, b, c, 1) +typedef int strsize_t; +typedef void free_obj_t; +#endif + +/* For PHP 8 compatibility */ +#ifndef TSRMLS_C +#define TSRMLS_C +#endif +#ifndef TSRMLS_CC +#define TSRMLS_CC +#endif +#ifndef TSRMLS_DC +#define TSRMLS_DC +#endif +#ifndef ZEND_ACC_CTOR +#define ZEND_ACC_CTOR 0 +#endif + +#ifdef ZEND_ENGINE_3 +typedef struct _maxminddb_obj { + MMDB_s *mmdb; + zend_object std; +} maxminddb_obj; +#else +typedef struct _maxminddb_obj { + zend_object std; + MMDB_s *mmdb; +} maxminddb_obj; +#endif + +PHP_FUNCTION(maxminddb); + +static int +get_record(INTERNAL_FUNCTION_PARAMETERS, zval *record, int *prefix_len); +static const MMDB_entry_data_list_s * +handle_entry_data_list(const MMDB_entry_data_list_s *entry_data_list, + zval *z_value TSRMLS_DC); +static const MMDB_entry_data_list_s * +handle_array(const MMDB_entry_data_list_s *entry_data_list, + zval *z_value TSRMLS_DC); +static const MMDB_entry_data_list_s * +handle_map(const MMDB_entry_data_list_s *entry_data_list, + zval *z_value TSRMLS_DC); +static void handle_uint128(const MMDB_entry_data_list_s *entry_data_list, + zval *z_value TSRMLS_DC); +static void handle_uint64(const MMDB_entry_data_list_s *entry_data_list, + zval *z_value TSRMLS_DC); +static void handle_uint32(const MMDB_entry_data_list_s *entry_data_list, + zval *z_value TSRMLS_DC); +static zend_class_entry *lookup_class(const char *name TSRMLS_DC); + +#define CHECK_ALLOCATED(val) \ + if (!val) { \ + zend_error(E_ERROR, "Out of memory"); \ + return; \ + } + +#define THROW_EXCEPTION(name, ...) \ + { \ + zend_class_entry *exception_ce = lookup_class(name TSRMLS_CC); \ + zend_throw_exception_ex(exception_ce, 0 TSRMLS_CC, __VA_ARGS__); \ + } + +#if PHP_VERSION_ID < 50399 +#define object_properties_init(zo, class_type) \ + { \ + zval *tmp; \ + zend_hash_copy((*zo).properties, \ + &class_type->default_properties, \ + (copy_ctor_func_t)zval_add_ref, \ + (void *)&tmp, \ + sizeof(zval *)); \ + } +#endif + +static zend_object_handlers maxminddb_obj_handlers; +static zend_class_entry *maxminddb_ce; + +static inline maxminddb_obj * +php_maxminddb_fetch_object(zend_object *obj TSRMLS_DC) { +#ifdef ZEND_ENGINE_3 + return (maxminddb_obj *)((char *)(obj)-XtOffsetOf(maxminddb_obj, std)); +#else + return (maxminddb_obj *)obj; +#endif +} + +ZEND_BEGIN_ARG_INFO_EX(arginfo_maxmindbreader_construct, 0, 0, 1) +ZEND_ARG_INFO(0, db_file) +ZEND_END_ARG_INFO() + +PHP_METHOD(MaxMind_Db_Reader, __construct) { + char *db_file = NULL; + strsize_t name_len; + zval *_this_zval = NULL; + + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, + getThis(), + "Os", + &_this_zval, + maxminddb_ce, + &db_file, + &name_len) == FAILURE) { + THROW_EXCEPTION("InvalidArgumentException", + "The constructor takes exactly one argument."); + return; + } + + if (0 != php_check_open_basedir(db_file TSRMLS_CC) || + 0 != access(db_file, R_OK)) { + THROW_EXCEPTION("InvalidArgumentException", + "The file \"%s\" does not exist or is not readable.", + db_file); + return; + } + + MMDB_s *mmdb = (MMDB_s *)ecalloc(1, sizeof(MMDB_s)); + uint16_t status = MMDB_open(db_file, MMDB_MODE_MMAP, mmdb); + + if (MMDB_SUCCESS != status) { + THROW_EXCEPTION(PHP_MAXMINDDB_READER_EX_NS, + "Error opening database file (%s). Is this a valid " + "MaxMind DB file?", + db_file); + efree(mmdb); + return; + } + + maxminddb_obj *mmdb_obj = Z_MAXMINDDB_P(getThis()); + mmdb_obj->mmdb = mmdb; +} + +ZEND_BEGIN_ARG_INFO_EX(arginfo_maxmindbreader_get, 0, 0, 1) +ZEND_ARG_INFO(0, ip_address) +ZEND_END_ARG_INFO() + +PHP_METHOD(MaxMind_Db_Reader, get) { + int prefix_len = 0; + get_record(INTERNAL_FUNCTION_PARAM_PASSTHRU, return_value, &prefix_len); +} + +PHP_METHOD(MaxMind_Db_Reader, getWithPrefixLen) { + zval *record, *z_prefix_len; +#ifdef ZEND_ENGINE_3 + zval _record, _z_prefix_len; + record = &_record; + z_prefix_len = &_z_prefix_len; +#else + ALLOC_INIT_ZVAL(record); + ALLOC_INIT_ZVAL(z_prefix_len); +#endif + + int prefix_len = 0; + if (get_record(INTERNAL_FUNCTION_PARAM_PASSTHRU, record, &prefix_len)) { + return; + } + + array_init(return_value); + add_next_index_zval(return_value, record); + + ZVAL_LONG(z_prefix_len, prefix_len); + add_next_index_zval(return_value, z_prefix_len); +} + +static int +get_record(INTERNAL_FUNCTION_PARAMETERS, zval *record, int *prefix_len) { + char *ip_address = NULL; + strsize_t name_len; + zval *_this_zval = NULL; + + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, + getThis(), + "Os", + &_this_zval, + maxminddb_ce, + &ip_address, + &name_len) == FAILURE) { + THROW_EXCEPTION("InvalidArgumentException", + "Method takes exactly one argument."); + return 1; + } + + const maxminddb_obj *mmdb_obj = (maxminddb_obj *)Z_MAXMINDDB_P(getThis()); + + MMDB_s *mmdb = mmdb_obj->mmdb; + + if (NULL == mmdb) { + THROW_EXCEPTION("BadMethodCallException", + "Attempt to read from a closed MaxMind DB."); + return 1; + } + + struct addrinfo hints = { + .ai_family = AF_UNSPEC, + .ai_flags = AI_NUMERICHOST, + // We set ai_socktype so that we only get one result back + .ai_socktype = SOCK_STREAM}; + + struct addrinfo *addresses = NULL; + int gai_status = getaddrinfo(ip_address, NULL, &hints, &addresses); + if (gai_status) { + THROW_EXCEPTION("InvalidArgumentException", + "The value \"%s\" is not a valid IP address.", + ip_address); + return 1; + } + if (!addresses || !addresses->ai_addr) { + THROW_EXCEPTION( + "InvalidArgumentException", + "getaddrinfo was successful but failed to set the addrinfo"); + return 1; + } + + int sa_family = addresses->ai_addr->sa_family; + + int mmdb_error = MMDB_SUCCESS; + MMDB_lookup_result_s result = + MMDB_lookup_sockaddr(mmdb, addresses->ai_addr, &mmdb_error); + + freeaddrinfo(addresses); + + if (MMDB_SUCCESS != mmdb_error) { + char *exception_name; + if (MMDB_IPV6_LOOKUP_IN_IPV4_DATABASE_ERROR == mmdb_error) { + exception_name = "InvalidArgumentException"; + } else { + exception_name = PHP_MAXMINDDB_READER_EX_NS; + } + THROW_EXCEPTION(exception_name, + "Error looking up %s. %s", + ip_address, + MMDB_strerror(mmdb_error)); + return 1; + } + + *prefix_len = result.netmask; + + if (sa_family == AF_INET && mmdb->metadata.ip_version == 6) { + // We return the prefix length given the IPv4 address. If there is + // no IPv4 subtree, we return a prefix length of 0. + *prefix_len = *prefix_len >= 96 ? *prefix_len - 96 : 0; + } + + if (!result.found_entry) { + ZVAL_NULL(record); + return 0; + } + + MMDB_entry_data_list_s *entry_data_list = NULL; + int status = MMDB_get_entry_data_list(&result.entry, &entry_data_list); + + if (MMDB_SUCCESS != status) { + THROW_EXCEPTION(PHP_MAXMINDDB_READER_EX_NS, + "Error while looking up data for %s. %s", + ip_address, + MMDB_strerror(status)); + MMDB_free_entry_data_list(entry_data_list); + return 1; + } else if (NULL == entry_data_list) { + THROW_EXCEPTION(PHP_MAXMINDDB_READER_EX_NS, + "Error while looking up data for %s. Your database may " + "be corrupt or you have found a bug in libmaxminddb.", + ip_address); + return 1; + } + + handle_entry_data_list(entry_data_list, record TSRMLS_CC); + MMDB_free_entry_data_list(entry_data_list); + return 0; +} + +ZEND_BEGIN_ARG_INFO_EX(arginfo_maxmindbreader_void, 0, 0, 0) +ZEND_END_ARG_INFO() + +PHP_METHOD(MaxMind_Db_Reader, metadata) { + if (ZEND_NUM_ARGS() != 0) { + THROW_EXCEPTION("InvalidArgumentException", + "Method takes no arguments."); + return; + } + + const maxminddb_obj *const mmdb_obj = + (maxminddb_obj *)Z_MAXMINDDB_P(getThis()); + + if (NULL == mmdb_obj->mmdb) { + THROW_EXCEPTION("BadMethodCallException", + "Attempt to read from a closed MaxMind DB."); + return; + } + + const char *const name = ZEND_NS_NAME(PHP_MAXMINDDB_READER_NS, "Metadata"); + zend_class_entry *metadata_ce = lookup_class(name TSRMLS_CC); + + object_init_ex(return_value, metadata_ce); + +#ifdef ZEND_ENGINE_3 + zval _metadata_array; + zval *metadata_array = &_metadata_array; + ZVAL_NULL(metadata_array); +#else + zval *metadata_array; + ALLOC_INIT_ZVAL(metadata_array); +#endif + + MMDB_entry_data_list_s *entry_data_list; + MMDB_get_metadata_as_entry_data_list(mmdb_obj->mmdb, &entry_data_list); + + handle_entry_data_list(entry_data_list, metadata_array TSRMLS_CC); + MMDB_free_entry_data_list(entry_data_list); +#if PHP_VERSION_ID >= 80000 + zend_call_method_with_1_params(Z_OBJ_P(return_value), + metadata_ce, + &metadata_ce->constructor, + ZEND_CONSTRUCTOR_FUNC_NAME, + NULL, + metadata_array); + zval_ptr_dtor(metadata_array); +#elif defined(ZEND_ENGINE_3) + zend_call_method_with_1_params(return_value, + metadata_ce, + &metadata_ce->constructor, + ZEND_CONSTRUCTOR_FUNC_NAME, + NULL, + metadata_array); + zval_ptr_dtor(metadata_array); +#else + zend_call_method_with_1_params(&return_value, + metadata_ce, + &metadata_ce->constructor, + ZEND_CONSTRUCTOR_FUNC_NAME, + NULL, + metadata_array); + zval_ptr_dtor(&metadata_array); +#endif +} + +PHP_METHOD(MaxMind_Db_Reader, close) { + if (ZEND_NUM_ARGS() != 0) { + THROW_EXCEPTION("InvalidArgumentException", + "Method takes no arguments."); + return; + } + + maxminddb_obj *mmdb_obj = (maxminddb_obj *)Z_MAXMINDDB_P(getThis()); + + if (NULL == mmdb_obj->mmdb) { + THROW_EXCEPTION("BadMethodCallException", + "Attempt to close a closed MaxMind DB."); + return; + } + MMDB_close(mmdb_obj->mmdb); + efree(mmdb_obj->mmdb); + mmdb_obj->mmdb = NULL; +} + +static const MMDB_entry_data_list_s * +handle_entry_data_list(const MMDB_entry_data_list_s *entry_data_list, + zval *z_value TSRMLS_DC) { + switch (entry_data_list->entry_data.type) { + case MMDB_DATA_TYPE_MAP: + return handle_map(entry_data_list, z_value TSRMLS_CC); + case MMDB_DATA_TYPE_ARRAY: + return handle_array(entry_data_list, z_value TSRMLS_CC); + case MMDB_DATA_TYPE_UTF8_STRING: + _ZVAL_STRINGL(z_value, + (char *)entry_data_list->entry_data.utf8_string, + entry_data_list->entry_data.data_size); + break; + case MMDB_DATA_TYPE_BYTES: + _ZVAL_STRINGL(z_value, + (char *)entry_data_list->entry_data.bytes, + entry_data_list->entry_data.data_size); + break; + case MMDB_DATA_TYPE_DOUBLE: + ZVAL_DOUBLE(z_value, entry_data_list->entry_data.double_value); + break; + case MMDB_DATA_TYPE_FLOAT: + ZVAL_DOUBLE(z_value, entry_data_list->entry_data.float_value); + break; + case MMDB_DATA_TYPE_UINT16: + ZVAL_LONG(z_value, entry_data_list->entry_data.uint16); + break; + case MMDB_DATA_TYPE_UINT32: + handle_uint32(entry_data_list, z_value TSRMLS_CC); + break; + case MMDB_DATA_TYPE_BOOLEAN: + ZVAL_BOOL(z_value, entry_data_list->entry_data.boolean); + break; + case MMDB_DATA_TYPE_UINT64: + handle_uint64(entry_data_list, z_value TSRMLS_CC); + break; + case MMDB_DATA_TYPE_UINT128: + handle_uint128(entry_data_list, z_value TSRMLS_CC); + break; + case MMDB_DATA_TYPE_INT32: + ZVAL_LONG(z_value, entry_data_list->entry_data.int32); + break; + default: + THROW_EXCEPTION(PHP_MAXMINDDB_READER_EX_NS, + "Invalid data type arguments: %d", + entry_data_list->entry_data.type); + return NULL; + } + return entry_data_list; +} + +static const MMDB_entry_data_list_s * +handle_map(const MMDB_entry_data_list_s *entry_data_list, + zval *z_value TSRMLS_DC) { + array_init(z_value); + const uint32_t map_size = entry_data_list->entry_data.data_size; + + uint i; + for (i = 0; i < map_size && entry_data_list; i++) { + entry_data_list = entry_data_list->next; + + char *key = estrndup((char *)entry_data_list->entry_data.utf8_string, + entry_data_list->entry_data.data_size); + if (NULL == key) { + THROW_EXCEPTION(PHP_MAXMINDDB_READER_EX_NS, + "Invalid data type arguments"); + return NULL; + } + + entry_data_list = entry_data_list->next; +#ifdef ZEND_ENGINE_3 + zval _new_value; + zval *new_value = &_new_value; + ZVAL_NULL(new_value); +#else + zval *new_value; + ALLOC_INIT_ZVAL(new_value); +#endif + entry_data_list = + handle_entry_data_list(entry_data_list, new_value TSRMLS_CC); + add_assoc_zval(z_value, key, new_value); + efree(key); + } + return entry_data_list; +} + +static const MMDB_entry_data_list_s * +handle_array(const MMDB_entry_data_list_s *entry_data_list, + zval *z_value TSRMLS_DC) { + const uint32_t size = entry_data_list->entry_data.data_size; + + array_init(z_value); + + uint i; + for (i = 0; i < size && entry_data_list; i++) { + entry_data_list = entry_data_list->next; +#ifdef ZEND_ENGINE_3 + zval _new_value; + zval *new_value = &_new_value; + ZVAL_NULL(new_value); +#else + zval *new_value; + ALLOC_INIT_ZVAL(new_value); +#endif + entry_data_list = + handle_entry_data_list(entry_data_list, new_value TSRMLS_CC); + add_next_index_zval(z_value, new_value); + } + return entry_data_list; +} + +static void handle_uint128(const MMDB_entry_data_list_s *entry_data_list, + zval *z_value TSRMLS_DC) { + uint64_t high = 0; + uint64_t low = 0; +#if MMDB_UINT128_IS_BYTE_ARRAY + int i; + for (i = 0; i < 8; i++) { + high = (high << 8) | entry_data_list->entry_data.uint128[i]; + } + + for (i = 8; i < 16; i++) { + low = (low << 8) | entry_data_list->entry_data.uint128[i]; + } +#else + high = entry_data_list->entry_data.uint128 >> 64; + low = (uint64_t)entry_data_list->entry_data.uint128; +#endif + + char *num_str; + spprintf(&num_str, 0, "0x%016" PRIX64 "%016" PRIX64, high, low); + CHECK_ALLOCATED(num_str); + + _ZVAL_STRING(z_value, num_str); + efree(num_str); +} + +static void handle_uint32(const MMDB_entry_data_list_s *entry_data_list, + zval *z_value TSRMLS_DC) { + uint32_t val = entry_data_list->entry_data.uint32; + +#if LONG_MAX >= UINT32_MAX + ZVAL_LONG(z_value, val); + return; +#else + if (val <= LONG_MAX) { + ZVAL_LONG(z_value, val); + return; + } + + char *int_str; + spprintf(&int_str, 0, "%" PRIu32, val); + CHECK_ALLOCATED(int_str); + + _ZVAL_STRING(z_value, int_str); + efree(int_str); +#endif +} + +static void handle_uint64(const MMDB_entry_data_list_s *entry_data_list, + zval *z_value TSRMLS_DC) { + uint64_t val = entry_data_list->entry_data.uint64; + +#if LONG_MAX >= UINT64_MAX + ZVAL_LONG(z_value, val); + return; +#else + if (val <= LONG_MAX) { + ZVAL_LONG(z_value, val); + return; + } + + char *int_str; + spprintf(&int_str, 0, "%" PRIu64, val); + CHECK_ALLOCATED(int_str); + + _ZVAL_STRING(z_value, int_str); + efree(int_str); +#endif +} + +static zend_class_entry *lookup_class(const char *name TSRMLS_DC) { +#ifdef ZEND_ENGINE_3 + zend_string *n = zend_string_init(name, strlen(name), 0); + zend_class_entry *ce = zend_lookup_class(n); + zend_string_release(n); + if (NULL == ce) { + zend_error(E_ERROR, "Class %s not found", name); + } + return ce; +#else + zend_class_entry **ce; + if (FAILURE == zend_lookup_class(name, strlen(name), &ce TSRMLS_CC)) { + zend_error(E_ERROR, "Class %s not found", name); + } + return *ce; +#endif +} + +static void maxminddb_free_storage(free_obj_t *object TSRMLS_DC) { + maxminddb_obj *obj = + php_maxminddb_fetch_object((zend_object *)object TSRMLS_CC); + if (obj->mmdb != NULL) { + MMDB_close(obj->mmdb); + efree(obj->mmdb); + } + + zend_object_std_dtor(&obj->std TSRMLS_CC); +#ifndef ZEND_ENGINE_3 + efree(object); +#endif +} + +#ifdef ZEND_ENGINE_3 +static zend_object *maxminddb_create_handler(zend_class_entry *type TSRMLS_DC) { + maxminddb_obj *obj = (maxminddb_obj *)ecalloc(1, sizeof(maxminddb_obj)); + zend_object_std_init(&obj->std, type TSRMLS_CC); + object_properties_init(&(obj->std), type); + + obj->std.handlers = &maxminddb_obj_handlers; + + return &obj->std; +} +#else +static zend_object_value +maxminddb_create_handler(zend_class_entry *type TSRMLS_DC) { + zend_object_value retval; + + maxminddb_obj *obj = (maxminddb_obj *)ecalloc(1, sizeof(maxminddb_obj)); + zend_object_std_init(&obj->std, type TSRMLS_CC); + object_properties_init(&(obj->std), type); + + retval.handle = zend_objects_store_put( + obj, NULL, maxminddb_free_storage, NULL TSRMLS_CC); + retval.handlers = &maxminddb_obj_handlers; + + return retval; +} +#endif + +// clang-format off +static zend_function_entry maxminddb_methods[] = { + PHP_ME(MaxMind_Db_Reader, __construct, arginfo_maxmindbreader_construct, + ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(MaxMind_Db_Reader, close, arginfo_maxmindbreader_void, ZEND_ACC_PUBLIC) + PHP_ME(MaxMind_Db_Reader, get, arginfo_maxmindbreader_get, ZEND_ACC_PUBLIC) + PHP_ME(MaxMind_Db_Reader, getWithPrefixLen, arginfo_maxmindbreader_get, ZEND_ACC_PUBLIC) + PHP_ME(MaxMind_Db_Reader, metadata, arginfo_maxmindbreader_void, ZEND_ACC_PUBLIC) + { NULL, NULL, NULL } +}; +// clang-format on + +PHP_MINIT_FUNCTION(maxminddb) { + zend_class_entry ce; + + INIT_CLASS_ENTRY(ce, PHP_MAXMINDDB_READER_NS, maxminddb_methods); + maxminddb_ce = zend_register_internal_class(&ce TSRMLS_CC); + maxminddb_ce->create_object = maxminddb_create_handler; + memcpy(&maxminddb_obj_handlers, + zend_get_std_object_handlers(), + sizeof(zend_object_handlers)); + maxminddb_obj_handlers.clone_obj = NULL; +#ifdef ZEND_ENGINE_3 + maxminddb_obj_handlers.offset = XtOffsetOf(maxminddb_obj, std); + maxminddb_obj_handlers.free_obj = maxminddb_free_storage; +#endif + zend_declare_class_constant_string(maxminddb_ce, + "MMDB_LIB_VERSION", + sizeof("MMDB_LIB_VERSION") - 1, + MMDB_lib_version() TSRMLS_CC); + + return SUCCESS; +} + +static PHP_MINFO_FUNCTION(maxminddb) { + php_info_print_table_start(); + + php_info_print_table_row(2, "MaxMind DB Reader", "enabled"); + php_info_print_table_row( + 2, "maxminddb extension version", PHP_MAXMINDDB_VERSION); + php_info_print_table_row( + 2, "libmaxminddb library version", MMDB_lib_version()); + + php_info_print_table_end(); +} + +zend_module_entry maxminddb_module_entry = {STANDARD_MODULE_HEADER, + PHP_MAXMINDDB_EXTNAME, + NULL, + PHP_MINIT(maxminddb), + NULL, + NULL, + NULL, + PHP_MINFO(maxminddb), + PHP_MAXMINDDB_VERSION, + STANDARD_MODULE_PROPERTIES}; + +#ifdef COMPILE_DL_MAXMINDDB +ZEND_GET_MODULE(maxminddb) +#endif diff --git a/vendor/maxmind-db/reader/ext/php_maxminddb.h b/vendor/maxmind-db/reader/ext/php_maxminddb.h new file mode 100644 index 0000000..b219777 --- /dev/null +++ b/vendor/maxmind-db/reader/ext/php_maxminddb.h @@ -0,0 +1,24 @@ +/* MaxMind, Inc., licenses this file to you under the Apache License, Version + * 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#include + +#ifndef PHP_MAXMINDDB_H +#define PHP_MAXMINDDB_H 1 +#define PHP_MAXMINDDB_VERSION "1.10.1" +#define PHP_MAXMINDDB_EXTNAME "maxminddb" + +extern zend_module_entry maxminddb_module_entry; +#define phpext_maxminddb_ptr &maxminddb_module_entry + +#endif diff --git a/vendor/maxmind-db/reader/ext/tests/001-load.phpt b/vendor/maxmind-db/reader/ext/tests/001-load.phpt new file mode 100644 index 0000000..09810ee --- /dev/null +++ b/vendor/maxmind-db/reader/ext/tests/001-load.phpt @@ -0,0 +1,12 @@ +--TEST-- +Check for maxminddb presence +--SKIPIF-- + +--FILE-- + +--EXPECT-- +maxminddb extension is available diff --git a/vendor/maxmind-db/reader/ext/tests/002-final.phpt b/vendor/maxmind-db/reader/ext/tests/002-final.phpt new file mode 100644 index 0000000..d91b7d0 --- /dev/null +++ b/vendor/maxmind-db/reader/ext/tests/002-final.phpt @@ -0,0 +1,13 @@ +--TEST-- +Check that Reader class is not final +--SKIPIF-- + +--FILE-- +isFinal()); +?> +--EXPECT-- +bool(false) diff --git a/vendor/maxmind-db/reader/ext/tests/003-open-basedir.phpt b/vendor/maxmind-db/reader/ext/tests/003-open-basedir.phpt new file mode 100644 index 0000000..26e9781 --- /dev/null +++ b/vendor/maxmind-db/reader/ext/tests/003-open-basedir.phpt @@ -0,0 +1,12 @@ +--TEST-- +openbase_dir is followed +--INI-- +open_basedir=/--dne-- +--FILE-- + +--EXPECTREGEX-- +.*open_basedir restriction in effect.* diff --git a/vendor/maxmind-db/reader/package.xml b/vendor/maxmind-db/reader/package.xml new file mode 100644 index 0000000..2beaf37 --- /dev/null +++ b/vendor/maxmind-db/reader/package.xml @@ -0,0 +1,63 @@ + + + + maxminddb + pecl.php.net + Reader for the MaxMind DB file format + This is the PHP extension for reading MaxMind DB files. MaxMind DB is a binary file format that stores data indexed by IP address subnets (IPv4 or IPv6). + + Greg Oschwald + oschwald + goschwald@maxmind.com + yes + + 2021-04-14 + + 1.10.1 + 1.10.1 + + + stable + stable + + Apache License 2.0 + * Fix a `TypeError` exception in the pure PHP reader when using large + databases on 32-bit PHP builds with the `bcmath` extension. Reported + by dodo1708. GitHub #124. + + + + + + + + + + + + + + + + + + + + + + + + + 7.2.0 + + + 1.10.0 + + + + maxminddb + + diff --git a/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php b/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php new file mode 100644 index 0000000..85457c5 --- /dev/null +++ b/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php @@ -0,0 +1,327 @@ +fileHandle = @fopen($database, 'rb'); + if ($this->fileHandle === false) { + throw new InvalidArgumentException( + "Error opening \"$database\"." + ); + } + $this->fileSize = @filesize($database); + if ($this->fileSize === false) { + throw new UnexpectedValueException( + "Error determining the size of \"$database\"." + ); + } + + $start = $this->findMetadataStart($database); + $metadataDecoder = new Decoder($this->fileHandle, $start); + list($metadataArray) = $metadataDecoder->decode($start); + $this->metadata = new Metadata($metadataArray); + $this->decoder = new Decoder( + $this->fileHandle, + $this->metadata->searchTreeSize + self::$DATA_SECTION_SEPARATOR_SIZE + ); + $this->ipV4Start = $this->ipV4StartNode(); + } + + /** + * Retrieves the record for the IP address. + * + * @param string $ipAddress + * the IP address to look up + * + * @throws BadMethodCallException if this method is called on a closed database + * @throws InvalidArgumentException if something other than a single IP address is passed to the method + * @throws InvalidDatabaseException + * if the database is invalid or there is an error reading + * from it + * + * @return mixed the record for the IP address + */ + public function get($ipAddress) + { + if (\func_num_args() !== 1) { + throw new InvalidArgumentException( + 'Method takes exactly one argument.' + ); + } + list($record) = $this->getWithPrefixLen($ipAddress); + + return $record; + } + + /** + * Retrieves the record for the IP address and its associated network prefix length. + * + * @param string $ipAddress + * the IP address to look up + * + * @throws BadMethodCallException if this method is called on a closed database + * @throws InvalidArgumentException if something other than a single IP address is passed to the method + * @throws InvalidDatabaseException + * if the database is invalid or there is an error reading + * from it + * + * @return array an array where the first element is the record and the + * second the network prefix length for the record + */ + public function getWithPrefixLen($ipAddress) + { + if (\func_num_args() !== 1) { + throw new InvalidArgumentException( + 'Method takes exactly one argument.' + ); + } + + if (!\is_resource($this->fileHandle)) { + throw new BadMethodCallException( + 'Attempt to read from a closed MaxMind DB.' + ); + } + + if (!filter_var($ipAddress, FILTER_VALIDATE_IP)) { + throw new InvalidArgumentException( + "The value \"$ipAddress\" is not a valid IP address." + ); + } + + list($pointer, $prefixLen) = $this->findAddressInTree($ipAddress); + if ($pointer === 0) { + return [null, $prefixLen]; + } + + return [$this->resolveDataPointer($pointer), $prefixLen]; + } + + private function findAddressInTree($ipAddress) + { + $rawAddress = unpack('C*', inet_pton($ipAddress)); + + $bitCount = \count($rawAddress) * 8; + + // The first node of the tree is always node 0, at the beginning of the + // value + $node = 0; + + $metadata = $this->metadata; + + // Check if we are looking up an IPv4 address in an IPv6 tree. If this + // is the case, we can skip over the first 96 nodes. + if ($metadata->ipVersion === 6) { + if ($bitCount === 32) { + $node = $this->ipV4Start; + } + } elseif ($metadata->ipVersion === 4 && $bitCount === 128) { + throw new InvalidArgumentException( + "Error looking up $ipAddress. You attempted to look up an" + . ' IPv6 address in an IPv4-only database.' + ); + } + + $nodeCount = $metadata->nodeCount; + + for ($i = 0; $i < $bitCount && $node < $nodeCount; ++$i) { + $tempBit = 0xFF & $rawAddress[($i >> 3) + 1]; + $bit = 1 & ($tempBit >> 7 - ($i % 8)); + + $node = $this->readNode($node, $bit); + } + if ($node === $nodeCount) { + // Record is empty + return [0, $i]; + } elseif ($node > $nodeCount) { + // Record is a data pointer + return [$node, $i]; + } + throw new InvalidDatabaseException('Something bad happened'); + } + + private function ipV4StartNode() + { + // If we have an IPv4 database, the start node is the first node + if ($this->metadata->ipVersion === 4) { + return 0; + } + + $node = 0; + + for ($i = 0; $i < 96 && $node < $this->metadata->nodeCount; ++$i) { + $node = $this->readNode($node, 0); + } + + return $node; + } + + private function readNode($nodeNumber, $index) + { + $baseOffset = $nodeNumber * $this->metadata->nodeByteSize; + + switch ($this->metadata->recordSize) { + case 24: + $bytes = Util::read($this->fileHandle, $baseOffset + $index * 3, 3); + list(, $node) = unpack('N', "\x00" . $bytes); + + return $node; + case 28: + $bytes = Util::read($this->fileHandle, $baseOffset + 3 * $index, 4); + if ($index === 0) { + $middle = (0xF0 & \ord($bytes[3])) >> 4; + } else { + $middle = 0x0F & \ord($bytes[0]); + } + list(, $node) = unpack('N', \chr($middle) . substr($bytes, $index, 3)); + + return $node; + case 32: + $bytes = Util::read($this->fileHandle, $baseOffset + $index * 4, 4); + list(, $node) = unpack('N', $bytes); + + return $node; + default: + throw new InvalidDatabaseException( + 'Unknown record size: ' + . $this->metadata->recordSize + ); + } + } + + private function resolveDataPointer($pointer) + { + $resolved = $pointer - $this->metadata->nodeCount + + $this->metadata->searchTreeSize; + if ($resolved >= $this->fileSize) { + throw new InvalidDatabaseException( + "The MaxMind DB file's search tree is corrupt" + ); + } + + list($data) = $this->decoder->decode($resolved); + + return $data; + } + + /* + * This is an extremely naive but reasonably readable implementation. There + * are much faster algorithms (e.g., Boyer-Moore) for this if speed is ever + * an issue, but I suspect it won't be. + */ + private function findMetadataStart($filename) + { + $handle = $this->fileHandle; + $fstat = fstat($handle); + $fileSize = $fstat['size']; + $marker = self::$METADATA_START_MARKER; + $markerLength = self::$METADATA_START_MARKER_LENGTH; + + $minStart = $fileSize - min(self::$METADATA_MAX_SIZE, $fileSize); + + for ($offset = $fileSize - $markerLength; $offset >= $minStart; --$offset) { + if (fseek($handle, $offset) !== 0) { + break; + } + + $value = fread($handle, $markerLength); + if ($value === $marker) { + return $offset + $markerLength; + } + } + throw new InvalidDatabaseException( + "Error opening database file ($filename). " . + 'Is this a valid MaxMind DB file?' + ); + } + + /** + * @throws InvalidArgumentException if arguments are passed to the method + * @throws BadMethodCallException if the database has been closed + * + * @return Metadata object for the database + */ + public function metadata() + { + if (\func_num_args()) { + throw new InvalidArgumentException( + 'Method takes no arguments.' + ); + } + + // Not technically required, but this makes it consistent with + // C extension and it allows us to change our implementation later. + if (!\is_resource($this->fileHandle)) { + throw new BadMethodCallException( + 'Attempt to read from a closed MaxMind DB.' + ); + } + + return $this->metadata; + } + + /** + * Closes the MaxMind DB and returns resources to the system. + * + * @throws Exception + * if an I/O error occurs + */ + public function close() + { + if (!\is_resource($this->fileHandle)) { + throw new BadMethodCallException( + 'Attempt to close a closed MaxMind DB.' + ); + } + fclose($this->fileHandle); + } +} diff --git a/vendor/maxmind-db/reader/src/MaxMind/Db/Reader/Decoder.php b/vendor/maxmind-db/reader/src/MaxMind/Db/Reader/Decoder.php new file mode 100644 index 0000000..8f451b8 --- /dev/null +++ b/vendor/maxmind-db/reader/src/MaxMind/Db/Reader/Decoder.php @@ -0,0 +1,381 @@ +fileStream = $fileStream; + $this->pointerBase = $pointerBase; + + $this->pointerBaseByteSize = $pointerBase > 0 ? log($pointerBase, 2) / 8 : 0; + $this->pointerTestHack = $pointerTestHack; + + $this->switchByteOrder = $this->isPlatformLittleEndian(); + } + + public function decode(int $offset): array + { + $ctrlByte = \ord(Util::read($this->fileStream, $offset, 1)); + ++$offset; + + $type = $ctrlByte >> 5; + + // Pointers are a special case, we don't read the next $size bytes, we + // use the size to determine the length of the pointer and then follow + // it. + if ($type === self::_POINTER) { + [$pointer, $offset] = $this->decodePointer($ctrlByte, $offset); + + // for unit testing + if ($this->pointerTestHack) { + return [$pointer]; + } + + [$result] = $this->decode($pointer); + + return [$result, $offset]; + } + + if ($type === self::_EXTENDED) { + $nextByte = \ord(Util::read($this->fileStream, $offset, 1)); + + $type = $nextByte + 7; + + if ($type < 8) { + throw new InvalidDatabaseException( + 'Something went horribly wrong in the decoder. An extended type ' + . 'resolved to a type number < 8 (' + . $type + . ')' + ); + } + + ++$offset; + } + + [$size, $offset] = $this->sizeFromCtrlByte($ctrlByte, $offset); + + return $this->decodeByType($type, $offset, $size); + } + + private function decodeByType(int $type, int $offset, int $size): array + { + switch ($type) { + case self::_MAP: + return $this->decodeMap($size, $offset); + + case self::_ARRAY: + return $this->decodeArray($size, $offset); + + case self::_BOOLEAN: + return [$this->decodeBoolean($size), $offset]; + } + + $newOffset = $offset + $size; + $bytes = Util::read($this->fileStream, $offset, $size); + + switch ($type) { + case self::_BYTES: + case self::_UTF8_STRING: + return [$bytes, $newOffset]; + + case self::_DOUBLE: + $this->verifySize(8, $size); + + return [$this->decodeDouble($bytes), $newOffset]; + + case self::_FLOAT: + $this->verifySize(4, $size); + + return [$this->decodeFloat($bytes), $newOffset]; + + case self::_INT32: + return [$this->decodeInt32($bytes, $size), $newOffset]; + + case self::_UINT16: + case self::_UINT32: + case self::_UINT64: + case self::_UINT128: + return [$this->decodeUint($bytes, $size), $newOffset]; + + default: + throw new InvalidDatabaseException( + 'Unknown or unexpected type: ' . $type + ); + } + } + + private function verifySize(int $expected, int $actual): void + { + if ($expected !== $actual) { + throw new InvalidDatabaseException( + "The MaxMind DB file's data section contains bad data (unknown data type or corrupt data)" + ); + } + } + + private function decodeArray(int $size, int $offset): array + { + $array = []; + + for ($i = 0; $i < $size; ++$i) { + [$value, $offset] = $this->decode($offset); + $array[] = $value; + } + + return [$array, $offset]; + } + + private function decodeBoolean(int $size): bool + { + return $size !== 0; + } + + private function decodeDouble(string $bytes): float + { + // This assumes IEEE 754 doubles, but most (all?) modern platforms + // use them. + [, $double] = unpack('E', $bytes); + + return $double; + } + + private function decodeFloat(string $bytes): float + { + // This assumes IEEE 754 floats, but most (all?) modern platforms + // use them. + [, $float] = unpack('G', $bytes); + + return $float; + } + + private function decodeInt32(string $bytes, int $size): int + { + switch ($size) { + case 0: + return 0; + + case 1: + case 2: + case 3: + $bytes = str_pad($bytes, 4, "\x00", \STR_PAD_LEFT); + + break; + + case 4: + break; + + default: + throw new InvalidDatabaseException( + "The MaxMind DB file's data section contains bad data (unknown data type or corrupt data)" + ); + } + + [, $int] = unpack('l', $this->maybeSwitchByteOrder($bytes)); + + return $int; + } + + private function decodeMap(int $size, int $offset): array + { + $map = []; + + for ($i = 0; $i < $size; ++$i) { + [$key, $offset] = $this->decode($offset); + [$value, $offset] = $this->decode($offset); + $map[$key] = $value; + } + + return [$map, $offset]; + } + + private function decodePointer(int $ctrlByte, int $offset): array + { + $pointerSize = (($ctrlByte >> 3) & 0x3) + 1; + + $buffer = Util::read($this->fileStream, $offset, $pointerSize); + $offset = $offset + $pointerSize; + + switch ($pointerSize) { + case 1: + $packed = \chr($ctrlByte & 0x7) . $buffer; + [, $pointer] = unpack('n', $packed); + $pointer += $this->pointerBase; + + break; + + case 2: + $packed = "\x00" . \chr($ctrlByte & 0x7) . $buffer; + [, $pointer] = unpack('N', $packed); + $pointer += $this->pointerBase + 2048; + + break; + + case 3: + $packed = \chr($ctrlByte & 0x7) . $buffer; + + // It is safe to use 'N' here, even on 32 bit machines as the + // first bit is 0. + [, $pointer] = unpack('N', $packed); + $pointer += $this->pointerBase + 526336; + + break; + + case 4: + // We cannot use unpack here as we might overflow on 32 bit + // machines + $pointerOffset = $this->decodeUint($buffer, $pointerSize); + + $pointerBase = $this->pointerBase; + + if (\PHP_INT_MAX - $pointerBase >= $pointerOffset) { + $pointer = $pointerOffset + $pointerBase; + } else { + throw new RuntimeException( + 'The database offset is too large to be represented on your platform.' + ); + } + + break; + + default: + throw new InvalidDatabaseException( + 'Unexpected pointer size ' . $pointerSize + ); + } + + return [$pointer, $offset]; + } + + // @phpstan-ignore-next-line + private function decodeUint(string $bytes, int $byteLength) + { + if ($byteLength === 0) { + return 0; + } + + $integer = 0; + + // PHP integers are signed. _MM_MAX_INT_BYTES is the number of + // complete bytes that can be converted to an integer. However, + // we can convert another byte if the leading bit is zero. + $useRealInts = $byteLength <= _MM_MAX_INT_BYTES + || ($byteLength === _MM_MAX_INT_BYTES + 1 && (\ord($bytes[0]) & 0x80) === 0); + + for ($i = 0; $i < $byteLength; ++$i) { + $part = \ord($bytes[$i]); + + // We only use gmp or bcmath if the final value is too big + if ($useRealInts) { + $integer = ($integer << 8) + $part; + } elseif (\extension_loaded('gmp')) { + $integer = gmp_strval(gmp_add(gmp_mul((string) $integer, '256'), $part)); + } elseif (\extension_loaded('bcmath')) { + $integer = bcadd(bcmul((string) $integer, '256'), (string) $part); + } else { + throw new RuntimeException( + 'The gmp or bcmath extension must be installed to read this database.' + ); + } + } + + return $integer; + } + + private function sizeFromCtrlByte(int $ctrlByte, int $offset): array + { + $size = $ctrlByte & 0x1f; + + if ($size < 29) { + return [$size, $offset]; + } + + $bytesToRead = $size - 28; + $bytes = Util::read($this->fileStream, $offset, $bytesToRead); + + if ($size === 29) { + $size = 29 + \ord($bytes); + } elseif ($size === 30) { + [, $adjust] = unpack('n', $bytes); + $size = 285 + $adjust; + } else { + [, $adjust] = unpack('N', "\x00" . $bytes); + $size = $adjust + 65821; + } + + return [$size, $offset + $bytesToRead]; + } + + private function maybeSwitchByteOrder(string $bytes): string + { + return $this->switchByteOrder ? strrev($bytes) : $bytes; + } + + private function isPlatformLittleEndian(): bool + { + $testint = 0x00FF; + $packed = pack('S', $testint); + + return $testint === current(unpack('v', $packed)); + } +} diff --git a/vendor/maxmind-db/reader/src/MaxMind/Db/Reader/InvalidDatabaseException.php b/vendor/maxmind-db/reader/src/MaxMind/Db/Reader/InvalidDatabaseException.php new file mode 100644 index 0000000..543fde4 --- /dev/null +++ b/vendor/maxmind-db/reader/src/MaxMind/Db/Reader/InvalidDatabaseException.php @@ -0,0 +1,12 @@ +binaryFormatMajorVersion = + $metadata['binary_format_major_version']; + $this->binaryFormatMinorVersion = + $metadata['binary_format_minor_version']; + $this->buildEpoch = $metadata['build_epoch']; + $this->databaseType = $metadata['database_type']; + $this->languages = $metadata['languages']; + $this->description = $metadata['description']; + $this->ipVersion = $metadata['ip_version']; + $this->nodeCount = $metadata['node_count']; + $this->recordSize = $metadata['record_size']; + $this->nodeByteSize = $this->recordSize / 4; + $this->searchTreeSize = $this->nodeCount * $this->nodeByteSize; + } + + public function __get($var) + { + return $this->$var; + } +} diff --git a/vendor/maxmind-db/reader/src/MaxMind/Db/Reader/Util.php b/vendor/maxmind-db/reader/src/MaxMind/Db/Reader/Util.php new file mode 100644 index 0000000..149a5c4 --- /dev/null +++ b/vendor/maxmind-db/reader/src/MaxMind/Db/Reader/Util.php @@ -0,0 +1,26 @@ +=5.6", + "composer/ca-bundle": "^1.0.3", + "ext-curl": "*", + "ext-json": "*" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "2.*", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0", + "squizlabs/php_codesniffer": "3.*" + }, + "autoload": { + "psr-4": { + "MaxMind\\Exception\\": "src/Exception", + "MaxMind\\WebService\\": "src/WebService" + } + } +} diff --git a/vendor/maxmind/web-service-common/dev-bin/release.sh b/vendor/maxmind/web-service-common/dev-bin/release.sh new file mode 100644 index 0000000..a5de030 --- /dev/null +++ b/vendor/maxmind/web-service-common/dev-bin/release.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +set -eu -o pipefail + + +changelog=$(cat CHANGELOG.md) + +regex=' +([0-9]+\.[0-9]+\.[0-9]+) \(([0-9]{4}-[0-9]{2}-[0-9]{2})\) +-* + +((.| +)*) +' + +if [[ ! $changelog =~ $regex ]]; then + echo "Could not find date line in change log!" + exit 1 +fi + +version="${BASH_REMATCH[1]}" +date="${BASH_REMATCH[2]}" +notes="$(echo "${BASH_REMATCH[3]}" | sed -n -E '/^[0-9]+\.[0-9]+\.[0-9]+/,$!p')" + +if [[ "$date" != $(date +"%Y-%m-%d") ]]; then + echo "$date is not today!" + exit 1 +fi + +tag="v$version" + +if [ -n "$(git status --porcelain)" ]; then + echo ". is not clean." >&2 + exit 1 +fi + +php composer.phar self-update +php composer.phar update + +./vendor/bin/phpunit + +echo "Release notes for $tag:" +echo "$notes" + +read -e -p "Commit changes and push to origin? " should_push + +if [ "$should_push" != "y" ]; then + echo "Aborting" + exit 1 +fi + +git push + +message="$version + +$notes" + +hub release create -m "$message" "$tag" + +git push --tags diff --git a/vendor/maxmind/web-service-common/src/Exception/AuthenticationException.php b/vendor/maxmind/web-service-common/src/Exception/AuthenticationException.php new file mode 100644 index 0000000..54258ca --- /dev/null +++ b/vendor/maxmind/web-service-common/src/Exception/AuthenticationException.php @@ -0,0 +1,10 @@ +uri = $uri; + parent::__construct($message, $httpStatus, $previous); + } + + public function getUri() + { + return $this->uri; + } + + public function getStatusCode() + { + return $this->getCode(); + } +} diff --git a/vendor/maxmind/web-service-common/src/Exception/InsufficientFundsException.php b/vendor/maxmind/web-service-common/src/Exception/InsufficientFundsException.php new file mode 100644 index 0000000..4d6b3be --- /dev/null +++ b/vendor/maxmind/web-service-common/src/Exception/InsufficientFundsException.php @@ -0,0 +1,10 @@ +error = $error; + parent::__construct($message, $httpStatus, $uri, $previous); + } + + public function getErrorCode() + { + return $this->error; + } +} diff --git a/vendor/maxmind/web-service-common/src/Exception/IpAddressNotFoundException.php b/vendor/maxmind/web-service-common/src/Exception/IpAddressNotFoundException.php new file mode 100644 index 0000000..1a743a1 --- /dev/null +++ b/vendor/maxmind/web-service-common/src/Exception/IpAddressNotFoundException.php @@ -0,0 +1,7 @@ +accountId = $accountId; + $this->licenseKey = $licenseKey; + + $this->httpRequestFactory = isset($options['httpRequestFactory']) + ? $options['httpRequestFactory'] + : new RequestFactory(); + + if (isset($options['host'])) { + $this->host = $options['host']; + } + if (isset($options['userAgent'])) { + $this->userAgentPrefix = $options['userAgent'] . ' '; + } + + $this->caBundle = isset($options['caBundle']) ? + $this->caBundle = $options['caBundle'] : $this->getCaBundle(); + + if (isset($options['connectTimeout'])) { + $this->connectTimeout = $options['connectTimeout']; + } + if (isset($options['timeout'])) { + $this->timeout = $options['timeout']; + } + + if (isset($options['proxy'])) { + $this->proxy = $options['proxy']; + } + } + + /** + * @param string $service name of the service querying + * @param string $path the URI path to use + * @param array $input the data to be posted as JSON + * + * @throws InvalidInputException when the request has missing or invalid + * data + * @throws AuthenticationException when there is an issue authenticating the + * request + * @throws InsufficientFundsException when your account is out of funds + * @throws InvalidRequestException when the request is invalid for some + * other reason, e.g., invalid JSON in the POST. + * @throws HttpException when an unexpected HTTP error occurs + * @throws WebServiceException when some other error occurs. This also + * serves as the base class for the above exceptions. + * + * @return array The decoded content of a successful response + */ + public function post($service, $path, $input) + { + $requestBody = json_encode($input); + if ($requestBody === false) { + throw new InvalidInputException( + 'Error encoding input as JSON: ' + . $this->jsonErrorDescription() + ); + } + + $request = $this->createRequest( + $path, + ['Content-Type: application/json'] + ); + + list($statusCode, $contentType, $responseBody) = $request->post($requestBody); + + return $this->handleResponse( + $statusCode, + $contentType, + $responseBody, + $service, + $path + ); + } + + public function get($service, $path) + { + $request = $this->createRequest($path); + + list($statusCode, $contentType, $responseBody) = $request->get(); + + return $this->handleResponse( + $statusCode, + $contentType, + $responseBody, + $service, + $path + ); + } + + private function userAgent() + { + $curlVersion = curl_version(); + + return $this->userAgentPrefix . 'MaxMind-WS-API/' . self::VERSION . ' PHP/' . PHP_VERSION . + ' curl/' . $curlVersion['version']; + } + + private function createRequest($path, $headers = []) + { + array_push( + $headers, + 'Authorization: Basic ' + . base64_encode($this->accountId . ':' . $this->licenseKey), + 'Accept: application/json' + ); + + return $this->httpRequestFactory->request( + $this->urlFor($path), + [ + 'caBundle' => $this->caBundle, + 'connectTimeout' => $this->connectTimeout, + 'headers' => $headers, + 'proxy' => $this->proxy, + 'timeout' => $this->timeout, + 'userAgent' => $this->userAgent(), + ] + ); + } + + /** + * @param int $statusCode the HTTP status code of the response + * @param string $contentType the Content-Type of the response + * @param string $responseBody the response body + * @param string $service the name of the service + * @param string $path the path used in the request + * + * @throws AuthenticationException when there is an issue authenticating the + * request + * @throws InsufficientFundsException when your account is out of funds + * @throws InvalidRequestException when the request is invalid for some + * other reason, e.g., invalid JSON in the POST. + * @throws HttpException when an unexpected HTTP error occurs + * @throws WebServiceException when some other error occurs. This also + * serves as the base class for the above exceptions + * + * @return array The decoded content of a successful response + */ + private function handleResponse( + $statusCode, + $contentType, + $responseBody, + $service, + $path + ) { + if ($statusCode >= 400 && $statusCode <= 499) { + $this->handle4xx($statusCode, $contentType, $responseBody, $service, $path); + } elseif ($statusCode >= 500) { + $this->handle5xx($statusCode, $service, $path); + } elseif ($statusCode !== 200 && $statusCode !== 204) { + $this->handleUnexpectedStatus($statusCode, $service, $path); + } + + return $this->handleSuccess($statusCode, $responseBody, $service); + } + + /** + * @return string describing the JSON error + */ + private function jsonErrorDescription() + { + $errno = json_last_error(); + switch ($errno) { + case JSON_ERROR_DEPTH: + return 'The maximum stack depth has been exceeded.'; + case JSON_ERROR_STATE_MISMATCH: + return 'Invalid or malformed JSON.'; + case JSON_ERROR_CTRL_CHAR: + return 'Control character error.'; + case JSON_ERROR_SYNTAX: + return 'Syntax error.'; + case JSON_ERROR_UTF8: + return 'Malformed UTF-8 characters.'; + default: + return "Other JSON error ($errno)."; + } + } + + /** + * @param string $path the path to use in the URL + * + * @return string the constructed URL + */ + private function urlFor($path) + { + return 'https://' . $this->host . $path; + } + + /** + * @param int $statusCode the HTTP status code + * @param string $contentType the response content-type + * @param string $body the response body + * @param string $service the service name + * @param string $path the path used in the request + * + * @throws AuthenticationException + * @throws HttpException + * @throws InsufficientFundsException + * @throws InvalidRequestException + */ + private function handle4xx( + $statusCode, + $contentType, + $body, + $service, + $path + ) { + if (\strlen($body) === 0) { + throw new HttpException( + "Received a $statusCode error for $service with no body", + $statusCode, + $this->urlFor($path) + ); + } + if (!strstr($contentType, 'json')) { + throw new HttpException( + "Received a $statusCode error for $service with " . + 'the following body: ' . $body, + $statusCode, + $this->urlFor($path) + ); + } + + $message = json_decode($body, true); + if ($message === null) { + throw new HttpException( + "Received a $statusCode error for $service but could " . + 'not decode the response as JSON: ' + . $this->jsonErrorDescription() . ' Body: ' . $body, + $statusCode, + $this->urlFor($path) + ); + } + + if (!isset($message['code']) || !isset($message['error'])) { + throw new HttpException( + 'Error response contains JSON but it does not ' . + 'specify code or error keys: ' . $body, + $statusCode, + $this->urlFor($path) + ); + } + + $this->handleWebServiceError( + $message['error'], + $message['code'], + $statusCode, + $path + ); + } + + /** + * @param string $message the error message from the web service + * @param string $code the error code from the web service + * @param int $statusCode the HTTP status code + * @param string $path the path used in the request + * + * @throws AuthenticationException + * @throws InvalidRequestException + * @throws InsufficientFundsException + */ + private function handleWebServiceError( + $message, + $code, + $statusCode, + $path + ) { + switch ($code) { + case 'IP_ADDRESS_NOT_FOUND': + case 'IP_ADDRESS_RESERVED': + throw new IpAddressNotFoundException( + $message, + $code, + $statusCode, + $this->urlFor($path) + ); + case 'ACCOUNT_ID_REQUIRED': + case 'ACCOUNT_ID_UNKNOWN': + case 'AUTHORIZATION_INVALID': + case 'LICENSE_KEY_REQUIRED': + case 'USER_ID_REQUIRED': + case 'USER_ID_UNKNOWN': + throw new AuthenticationException( + $message, + $code, + $statusCode, + $this->urlFor($path) + ); + case 'OUT_OF_QUERIES': + case 'INSUFFICIENT_FUNDS': + throw new InsufficientFundsException( + $message, + $code, + $statusCode, + $this->urlFor($path) + ); + case 'PERMISSION_REQUIRED': + throw new PermissionRequiredException( + $message, + $code, + $statusCode, + $this->urlFor($path) + ); + default: + throw new InvalidRequestException( + $message, + $code, + $statusCode, + $this->urlFor($path) + ); + } + } + + /** + * @param int $statusCode the HTTP status code + * @param string $service the service name + * @param string $path the URI path used in the request + * + * @throws HttpException + */ + private function handle5xx($statusCode, $service, $path) + { + throw new HttpException( + "Received a server error ($statusCode) for $service", + $statusCode, + $this->urlFor($path) + ); + } + + /** + * @param int $statusCode the HTTP status code + * @param string $service the service name + * @param string $path the URI path used in the request + * + * @throws HttpException + */ + private function handleUnexpectedStatus($statusCode, $service, $path) + { + throw new HttpException( + 'Received an unexpected HTTP status ' . + "($statusCode) for $service", + $statusCode, + $this->urlFor($path) + ); + } + + /** + * @param int $statusCode the HTTP status code + * @param string $body the successful request body + * @param string $service the service name + * + * @throws WebServiceException if a response body is included but not + * expected, or is not expected but not + * included, or is expected and included + * but cannot be decoded as JSON + * + * @return array the decoded request body + */ + private function handleSuccess($statusCode, $body, $service) + { + // A 204 should have no response body + if ($statusCode === 204) { + if (\strlen($body) !== 0) { + throw new WebServiceException( + "Received a 204 response for $service along with an " . + "unexpected HTTP body: $body" + ); + } + + return null; + } + + // A 200 should have a valid JSON body + if (\strlen($body) === 0) { + throw new WebServiceException( + "Received a 200 response for $service but did not " . + 'receive a HTTP body.' + ); + } + + $decodedContent = json_decode($body, true); + if ($decodedContent === null) { + throw new WebServiceException( + "Received a 200 response for $service but could " . + 'not decode the response as JSON: ' + . $this->jsonErrorDescription() . ' Body: ' . $body + ); + } + + return $decodedContent; + } + + private function getCaBundle() + { + $curlVersion = curl_version(); + + // On OS X, when the SSL version is "SecureTransport", the system's + // keychain will be used. + if ($curlVersion['ssl_version'] === 'SecureTransport') { + return null; + } + $cert = CaBundle::getSystemCaRootBundlePath(); + + // Check if the cert is inside a phar. If so, we need to copy the cert + // to a temp file so that curl can see it. + if (substr($cert, 0, 7) === 'phar://') { + $tempDir = sys_get_temp_dir(); + $newCert = tempnam($tempDir, 'geoip2-'); + if ($newCert === false) { + throw new \RuntimeException( + "Unable to create temporary file in $tempDir" + ); + } + if (!copy($cert, $newCert)) { + throw new \RuntimeException( + "Could not copy $cert to $newCert: " + . var_export(error_get_last(), true) + ); + } + + // We use a shutdown function rather than the destructor as the + // destructor isn't called on a fatal error such as an uncaught + // exception. + register_shutdown_function( + function () use ($newCert) { + unlink($newCert); + } + ); + $cert = $newCert; + } + if (!file_exists($cert)) { + throw new \RuntimeException("CA cert does not exist at $cert"); + } + + return $cert; + } +} diff --git a/vendor/maxmind/web-service-common/src/WebService/Http/CurlRequest.php b/vendor/maxmind/web-service-common/src/WebService/Http/CurlRequest.php new file mode 100644 index 0000000..501b2af --- /dev/null +++ b/vendor/maxmind/web-service-common/src/WebService/Http/CurlRequest.php @@ -0,0 +1,136 @@ +url = $url; + $this->options = $options; + $this->ch = $options['curlHandle']; + } + + /** + * @param string $body + * + * @throws HttpException + * + * @return array + */ + public function post($body) + { + $curl = $this->createCurl(); + + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, $body); + + return $this->execute($curl); + } + + public function get() + { + $curl = $this->createCurl(); + + curl_setopt($curl, CURLOPT_HTTPGET, true); + + return $this->execute($curl); + } + + /** + * @return resource + */ + private function createCurl() + { + curl_reset($this->ch); + + $opts = []; + $opts[CURLOPT_URL] = $this->url; + + if (!empty($this->options['caBundle'])) { + $opts[CURLOPT_CAINFO] = $this->options['caBundle']; + } + + $opts[CURLOPT_ENCODING] = ''; + $opts[CURLOPT_SSL_VERIFYHOST] = 2; + $opts[CURLOPT_FOLLOWLOCATION] = false; + $opts[CURLOPT_SSL_VERIFYPEER] = true; + $opts[CURLOPT_RETURNTRANSFER] = true; + + $opts[CURLOPT_HTTPHEADER] = $this->options['headers']; + $opts[CURLOPT_USERAGENT] = $this->options['userAgent']; + $opts[CURLOPT_PROXY] = $this->options['proxy']; + + // The defined()s are here as the *_MS opts are not available on older + // cURL versions + $connectTimeout = $this->options['connectTimeout']; + if (\defined('CURLOPT_CONNECTTIMEOUT_MS')) { + $opts[CURLOPT_CONNECTTIMEOUT_MS] = ceil($connectTimeout * 1000); + } else { + $opts[CURLOPT_CONNECTTIMEOUT] = ceil($connectTimeout); + } + + $timeout = $this->options['timeout']; + if (\defined('CURLOPT_TIMEOUT_MS')) { + $opts[CURLOPT_TIMEOUT_MS] = ceil($timeout * 1000); + } else { + $opts[CURLOPT_TIMEOUT] = ceil($timeout); + } + + curl_setopt_array($this->ch, $opts); + + return $this->ch; + } + + /** + * @param resource $curl + * + * @throws HttpException + * + * @return array + */ + private function execute($curl) + { + $body = curl_exec($curl); + if ($errno = curl_errno($curl)) { + $errorMessage = curl_error($curl); + + throw new HttpException( + "cURL error ({$errno}): {$errorMessage}", + 0, + $this->url + ); + } + + $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); + $contentType = curl_getinfo($curl, CURLINFO_CONTENT_TYPE); + + return [$statusCode, $contentType, $body]; + } +} diff --git a/vendor/maxmind/web-service-common/src/WebService/Http/Request.php b/vendor/maxmind/web-service-common/src/WebService/Http/Request.php new file mode 100644 index 0000000..283e05c --- /dev/null +++ b/vendor/maxmind/web-service-common/src/WebService/Http/Request.php @@ -0,0 +1,29 @@ +ch)) { + curl_close($this->ch); + } + } + + private function getCurlHandle() + { + if (empty($this->ch)) { + $this->ch = curl_init(); + } + + return $this->ch; + } + + /** + * @param string $url + * @param array $options + * + * @return Request + */ + public function request($url, $options) + { + $options['curlHandle'] = $this->getCurlHandle(); + + return new CurlRequest($url, $options); + } +} diff --git a/vendor/minishlink/web-push/LICENSE b/vendor/minishlink/web-push/LICENSE new file mode 100644 index 0000000..a775fc8 --- /dev/null +++ b/vendor/minishlink/web-push/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015 Louis Lagrange + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/minishlink/web-push/composer.json b/vendor/minishlink/web-push/composer.json new file mode 100644 index 0000000..c03a696 --- /dev/null +++ b/vendor/minishlink/web-push/composer.json @@ -0,0 +1,39 @@ +{ + "name": "minishlink/web-push", + "type": "library", + "description": "Web Push library for PHP", + "keywords": ["push", "notifications", "web", "WebPush", "Push API"], + "homepage": "https://github.com/web-push-libs/web-push-php", + "license": "MIT", + "authors": [ + { + "name": "Louis Lagrange", + "email": "lagrange.louis@gmail.com", + "homepage": "https://github.com/Minishlink" + } + ], + "scripts": { + "test:unit": "./vendor/bin/phpunit --color", + "test:typing": "./vendor/bin/phpstan analyse --level max src", + "test:syntax": "./vendor/bin/php-cs-fixer fix ./src --dry-run --stop-on-violation --using-cache=no" + }, + "require": { + "php": "^7.1", + "ext-json": "*", + "ext-gmp": "*", + "lib-openssl": "*", + "guzzlehttp/guzzle": "^6.2", + "web-token/jwt-signature": "^1.0", + "web-token/jwt-key-mgmt": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.0", + "phpstan/phpstan": "0.11.2", + "friendsofphp/php-cs-fixer": "^2.14" + }, + "autoload": { + "psr-4" : { + "Minishlink\\WebPush\\" : "src" + } + } +} diff --git a/vendor/minishlink/web-push/src/Encryption.php b/vendor/minishlink/web-push/src/Encryption.php new file mode 100644 index 0000000..e9fe1ac --- /dev/null +++ b/vendor/minishlink/web-push/src/Encryption.php @@ -0,0 +1,321 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Minishlink\WebPush; + +use Base64Url\Base64Url; +use Jose\Component\Core\Util\Ecc\NistCurve; +use Jose\Component\Core\Util\Ecc\Point; +use Jose\Component\Core\Util\Ecc\PrivateKey; +use Jose\Component\Core\Util\Ecc\PublicKey; + +class Encryption +{ + public const MAX_PAYLOAD_LENGTH = 4078; + public const MAX_COMPATIBILITY_PAYLOAD_LENGTH = 3052; + + /** + * @param string $payload + * @param int $maxLengthToPad + * @param string $contentEncoding + * @return string padded payload (plaintext) + * @throws \ErrorException + */ + public static function padPayload(string $payload, int $maxLengthToPad, string $contentEncoding): string + { + $payloadLen = Utils::safeStrlen($payload); + $padLen = $maxLengthToPad ? $maxLengthToPad - $payloadLen : 0; + + if ($contentEncoding === "aesgcm") { + return pack('n*', $padLen).str_pad($payload, $padLen + $payloadLen, chr(0), STR_PAD_LEFT); + } elseif ($contentEncoding === "aes128gcm") { + return str_pad($payload.chr(2), $padLen + $payloadLen, chr(0), STR_PAD_RIGHT); + } else { + throw new \ErrorException("This content encoding is not supported"); + } + } + + /** + * @param string $payload With padding + * @param string $userPublicKey Base 64 encoded (MIME or URL-safe) + * @param string $userAuthToken Base 64 encoded (MIME or URL-safe) + * @param string $contentEncoding + * @return array + * + * @throws \ErrorException + */ + public static function encrypt(string $payload, string $userPublicKey, string $userAuthToken, string $contentEncoding): array + { + return self::deterministicEncrypt( + $payload, + $userPublicKey, + $userAuthToken, + $contentEncoding, + self::createLocalKeyObject(), + random_bytes(16) + ); + } + + /** + * @param string $payload + * @param string $userPublicKey + * @param string $userAuthToken + * @param string $contentEncoding + * @param array $localKeyObject + * @param string $salt + * @return array + * + * @throws \ErrorException + */ + public static function deterministicEncrypt(string $payload, string $userPublicKey, string $userAuthToken, string $contentEncoding, array $localKeyObject, string $salt): array + { + $userPublicKey = Base64Url::decode($userPublicKey); + $userAuthToken = Base64Url::decode($userAuthToken); + + $curve = NistCurve::curve256(); + + // get local key pair + list($localPublicKeyObject, $localPrivateKeyObject) = $localKeyObject; + $localPublicKey = hex2bin(Utils::serializePublicKey($localPublicKeyObject)); + if (!$localPublicKey) { + throw new \ErrorException('Failed to convert local public key from hexadecimal to binary'); + } + + // get user public key object + [$userPublicKeyObjectX, $userPublicKeyObjectY] = Utils::unserializePublicKey($userPublicKey); + $userPublicKeyObject = $curve->getPublicKeyFrom( + gmp_init(bin2hex($userPublicKeyObjectX), 16), + gmp_init(bin2hex($userPublicKeyObjectY), 16) + ); + + // get shared secret from user public key and local private key + $sharedSecret = $curve->mul($userPublicKeyObject->getPoint(), $localPrivateKeyObject->getSecret())->getX(); + $sharedSecret = hex2bin(str_pad(gmp_strval($sharedSecret, 16), 64, '0', STR_PAD_LEFT)); + if (!$sharedSecret) { + throw new \ErrorException('Failed to convert shared secret from hexadecimal to binary'); + } + + // section 4.3 + $ikm = self::getIKM($userAuthToken, $userPublicKey, $localPublicKey, $sharedSecret, $contentEncoding); + + // section 4.2 + $context = self::createContext($userPublicKey, $localPublicKey, $contentEncoding); + + // derive the Content Encryption Key + $contentEncryptionKeyInfo = self::createInfo($contentEncoding, $context, $contentEncoding); + $contentEncryptionKey = self::hkdf($salt, $ikm, $contentEncryptionKeyInfo, 16); + + // section 3.3, derive the nonce + $nonceInfo = self::createInfo('nonce', $context, $contentEncoding); + $nonce = self::hkdf($salt, $ikm, $nonceInfo, 12); + + // encrypt + // "The additional data passed to each invocation of AEAD_AES_128_GCM is a zero-length octet sequence." + $tag = ''; + $encryptedText = openssl_encrypt($payload, 'aes-128-gcm', $contentEncryptionKey, OPENSSL_RAW_DATA, $nonce, $tag); + + // return values in url safe base64 + return [ + 'localPublicKey' => $localPublicKey, + 'salt' => $salt, + 'cipherText' => $encryptedText.$tag, + ]; + } + + public static function getContentCodingHeader($salt, $localPublicKey, $contentEncoding): string + { + if ($contentEncoding === "aes128gcm") { + return $salt + .pack('N*', 4096) + .pack('C*', Utils::safeStrlen($localPublicKey)) + .$localPublicKey; + } + + return ""; + } + + /** + * HMAC-based Extract-and-Expand Key Derivation Function (HKDF). + * + * This is used to derive a secure encryption key from a mostly-secure shared + * secret. + * + * This is a partial implementation of HKDF tailored to our specific purposes. + * In particular, for us the value of N will always be 1, and thus T always + * equals HMAC-Hash(PRK, info | 0x01). + * + * See {@link https://www.rfc-editor.org/rfc/rfc5869.txt} + * From {@link https://github.com/GoogleChrome/push-encryption-node/blob/master/src/encrypt.js} + * + * @param string $salt A non-secret random value + * @param string $ikm Input keying material + * @param string $info Application-specific context + * @param int $length The length (in bytes) of the required output key + * + * @return string + */ + private static function hkdf(string $salt, string $ikm, string $info, int $length): string + { + // extract + $prk = hash_hmac('sha256', $ikm, $salt, true); + + // expand + return mb_substr(hash_hmac('sha256', $info.chr(1), $prk, true), 0, $length, '8bit'); + } + + /** + * Creates a context for deriving encryption parameters. + * See section 4.2 of + * {@link https://tools.ietf.org/html/draft-ietf-httpbis-encryption-encoding-00} + * From {@link https://github.com/GoogleChrome/push-encryption-node/blob/master/src/encrypt.js}. + * + * @param string $clientPublicKey The client's public key + * @param string $serverPublicKey Our public key + * + * @return null|string + * + * @throws \ErrorException + */ + private static function createContext(string $clientPublicKey, string $serverPublicKey, $contentEncoding): ?string + { + if ($contentEncoding === "aes128gcm") { + return null; + } + + if (Utils::safeStrlen($clientPublicKey) !== 65) { + throw new \ErrorException('Invalid client public key length'); + } + + // This one should never happen, because it's our code that generates the key + if (Utils::safeStrlen($serverPublicKey) !== 65) { + throw new \ErrorException('Invalid server public key length'); + } + + $len = chr(0).'A'; // 65 as Uint16BE + + return chr(0).$len.$clientPublicKey.$len.$serverPublicKey; + } + + /** + * Returns an info record. See sections 3.2 and 3.3 of + * {@link https://tools.ietf.org/html/draft-ietf-httpbis-encryption-encoding-00} + * From {@link https://github.com/GoogleChrome/push-encryption-node/blob/master/src/encrypt.js}. + * + * @param string $type The type of the info record + * @param string|null $context The context for the record + * @param string $contentEncoding + * @return string + * + * @throws \ErrorException + */ + private static function createInfo(string $type, ?string $context, string $contentEncoding): string + { + if ($contentEncoding === "aesgcm") { + if (!$context) { + throw new \ErrorException('Context must exist'); + } + + if (Utils::safeStrlen($context) !== 135) { + throw new \ErrorException('Context argument has invalid size'); + } + + return 'Content-Encoding: '.$type.chr(0).'P-256'.$context; + } elseif ($contentEncoding === "aes128gcm") { + return 'Content-Encoding: '.$type.chr(0); + } + + throw new \ErrorException('This content encoding is not supported.'); + } + + /** + * @return array + */ + private static function createLocalKeyObject(): array + { + try { + return self::createLocalKeyObjectUsingOpenSSL(); + } catch (\Exception $e) { + return self::createLocalKeyObjectUsingPurePhpMethod(); + } + } + + /** + * @return array + */ + private static function createLocalKeyObjectUsingPurePhpMethod(): array + { + $curve = NistCurve::curve256(); + $privateKey = $curve->createPrivateKey(); + + return [ + $curve->createPublicKey($privateKey), + $privateKey, + ]; + } + + /** + * @return array + */ + private static function createLocalKeyObjectUsingOpenSSL(): array + { + $keyResource = openssl_pkey_new([ + 'curve_name' => 'prime256v1', + 'private_key_type' => OPENSSL_KEYTYPE_EC, + ]); + + if (!$keyResource) { + throw new \RuntimeException('Unable to create the key'); + } + + $details = openssl_pkey_get_details($keyResource); + openssl_pkey_free($keyResource); + + if (!$details) { + throw new \RuntimeException('Unable to get the key details'); + } + + return [ + PublicKey::create(Point::create( + gmp_init(bin2hex($details['ec']['x']), 16), + gmp_init(bin2hex($details['ec']['y']), 16) + )), + PrivateKey::create(gmp_init(bin2hex($details['ec']['d']), 16)) + ]; + } + + /** + * @param string $userAuthToken + * @param string $userPublicKey + * @param string $localPublicKey + * @param string $sharedSecret + * @param string $contentEncoding + * @return string + * @throws \ErrorException + */ + private static function getIKM(string $userAuthToken, string $userPublicKey, string $localPublicKey, string $sharedSecret, string $contentEncoding): string + { + if (!empty($userAuthToken)) { + if ($contentEncoding === "aesgcm") { + $info = 'Content-Encoding: auth'.chr(0); + } elseif ($contentEncoding === "aes128gcm") { + $info = "WebPush: info".chr(0).$userPublicKey.$localPublicKey; + } else { + throw new \ErrorException("This content encoding is not supported"); + } + + return self::hkdf($userAuthToken, $sharedSecret, $info, 32); + } + + return $sharedSecret; + } +} diff --git a/vendor/minishlink/web-push/src/MessageSentReport.php b/vendor/minishlink/web-push/src/MessageSentReport.php new file mode 100644 index 0000000..c569952 --- /dev/null +++ b/vendor/minishlink/web-push/src/MessageSentReport.php @@ -0,0 +1,181 @@ +request = $request; + $this->response = $response; + $this->success = $success; + $this->reason = $reason; + } + + /** + * @return bool + */ + public function isSuccess(): bool + { + return $this->success; + } + + /** + * @param bool $success + * + * @return MessageSentReport + */ + public function setSuccess(bool $success): MessageSentReport + { + $this->success = $success; + return $this; + } + + /** + * @return RequestInterface + */ + public function getRequest(): RequestInterface + { + return $this->request; + } + + /** + * @param RequestInterface $request + * + * @return MessageSentReport + */ + public function setRequest(RequestInterface $request): MessageSentReport + { + $this->request = $request; + return $this; + } + + /** + * @return ResponseInterface | null + */ + public function getResponse(): ?ResponseInterface + { + return $this->response; + } + + /** + * @param ResponseInterface $response + * + * @return MessageSentReport + */ + public function setResponse(ResponseInterface $response): MessageSentReport + { + $this->response = $response; + return $this; + } + + /** + * @return string + */ + public function getEndpoint(): string + { + return $this->request->getUri()->__toString(); + } + + /** + * @return bool + */ + public function isSubscriptionExpired(): bool + { + if (!$this->response) { + return false; + } + + return \in_array($this->response->getStatusCode(), [404, 410], true); + } + + /** + * @return string + */ + public function getReason(): string + { + return $this->reason; + } + + /** + * @param string $reason + * + * @return MessageSentReport + */ + public function setReason(string $reason): MessageSentReport + { + $this->reason = $reason; + return $this; + } + + /** + * @return string + */ + public function getRequestPayload(): string + { + return $this->request->getBody()->getContents(); + } + + /** + * @return string | null + */ + public function getResponseContent(): ?string + { + if (!$this->response) { + return null; + } + + return $this->response->getBody()->getContents(); + } + + /** + * @return array|mixed + */ + public function jsonSerialize() + { + return [ + 'success' => $this->isSuccess(), + 'expired' => $this->isSubscriptionExpired(), + 'reason' => $this->reason, + 'endpoint' => $this->getEndpoint(), + 'payload' => $this->request->getBody()->getContents(), + ]; + } +} diff --git a/vendor/minishlink/web-push/src/Notification.php b/vendor/minishlink/web-push/src/Notification.php new file mode 100644 index 0000000..1107404 --- /dev/null +++ b/vendor/minishlink/web-push/src/Notification.php @@ -0,0 +1,86 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Minishlink\WebPush; + +class Notification +{ + /** @var SubscriptionInterface */ + private $subscription; + + /** @var null|string */ + private $payload; + + /** @var array Options : TTL, urgency, topic */ + private $options; + + /** @var array Auth details : GCM, VAPID */ + private $auth; + + /** + * Notification constructor. + * + * @param SubscriptionInterface $subscription + * @param null|string $payload + * @param array $options + * @param array $auth + */ + public function __construct(SubscriptionInterface $subscription, ?string $payload, array $options, array $auth) + { + $this->subscription = $subscription; + $this->payload = $payload; + $this->options = $options; + $this->auth = $auth; + } + + /** + * @return SubscriptionInterface + */ + public function getSubscription(): SubscriptionInterface + { + return $this->subscription; + } + + /** + * @return null|string + */ + public function getPayload(): ?string + { + return $this->payload; + } + + /** + * @param array $defaultOptions + * + * @return array + */ + public function getOptions(array $defaultOptions = []): array + { + $options = $this->options; + $options['TTL'] = array_key_exists('TTL', $options) ? $options['TTL'] : $defaultOptions['TTL']; + $options['urgency'] = array_key_exists('urgency', $options) ? $options['urgency'] : $defaultOptions['urgency']; + $options['topic'] = array_key_exists('topic', $options) ? $options['topic'] : $defaultOptions['topic']; + + return $options; + } + + /** + * @param array $defaultAuth + * + * @return array + */ + public function getAuth(array $defaultAuth): array + { + return count($this->auth) > 0 ? $this->auth : $defaultAuth; + } +} diff --git a/vendor/minishlink/web-push/src/Subscription.php b/vendor/minishlink/web-push/src/Subscription.php new file mode 100644 index 0000000..1232893 --- /dev/null +++ b/vendor/minishlink/web-push/src/Subscription.php @@ -0,0 +1,122 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Minishlink\WebPush; + +class Subscription implements SubscriptionInterface +{ + /** @var string */ + private $endpoint; + + /** @var null|string */ + private $publicKey; + + /** @var null|string */ + private $authToken; + + /** @var null|string */ + private $contentEncoding; + + /** + * Subscription constructor. + * + * @param string $endpoint + * @param null|string $publicKey + * @param null|string $authToken + * @param string $contentEncoding (Optional) Must be "aesgcm" + * @throws \ErrorException + */ + public function __construct( + string $endpoint, + ?string $publicKey = null, + ?string $authToken = null, + ?string $contentEncoding = null + ) { + $this->endpoint = $endpoint; + + if ($publicKey || $authToken || $contentEncoding) { + $supportedContentEncodings = ['aesgcm', 'aes128gcm']; + if ($contentEncoding && !in_array($contentEncoding, $supportedContentEncodings)) { + throw new \ErrorException('This content encoding ('.$contentEncoding.') is not supported.'); + } + + $this->publicKey = $publicKey; + $this->authToken = $authToken; + $this->contentEncoding = $contentEncoding ?: "aesgcm"; + } + } + + /** + * Subscription factory. + * + * @param array $associativeArray (with keys endpoint, publicKey, authToken, contentEncoding) + * @return self + * @throws \ErrorException + */ + public static function create(array $associativeArray): self + { + if (array_key_exists('keys', $associativeArray) && is_array($associativeArray['keys'])) { + return new self( + $associativeArray['endpoint'], + $associativeArray['keys']['p256dh'] ?? null, + $associativeArray['keys']['auth'] ?? null, + $associativeArray['contentEncoding'] ?? "aesgcm" + ); + } + + if (array_key_exists('publicKey', $associativeArray) || array_key_exists('authToken', $associativeArray) || array_key_exists('contentEncoding', $associativeArray)) { + return new self( + $associativeArray['endpoint'], + $associativeArray['publicKey'] ?? null, + $associativeArray['authToken'] ?? null, + $associativeArray['contentEncoding'] ?? "aesgcm" + ); + } + + return new self( + $associativeArray['endpoint'] + ); + } + + /** + * {@inheritDoc} + */ + public function getEndpoint(): string + { + return $this->endpoint; + } + + /** + * {@inheritDoc} + */ + public function getPublicKey(): ?string + { + return $this->publicKey; + } + + /** + * {@inheritDoc} + */ + public function getAuthToken(): ?string + { + return $this->authToken; + } + + /** + * {@inheritDoc} + */ + public function getContentEncoding(): ?string + { + return $this->contentEncoding; + } +} diff --git a/vendor/minishlink/web-push/src/SubscriptionInterface.php b/vendor/minishlink/web-push/src/SubscriptionInterface.php new file mode 100644 index 0000000..e3f18d6 --- /dev/null +++ b/vendor/minishlink/web-push/src/SubscriptionInterface.php @@ -0,0 +1,40 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Minishlink\WebPush; + +/** + * @author Sergii Bondarenko + */ +interface SubscriptionInterface +{ + /** + * @return string + */ + public function getEndpoint(): string; + + /** + * @return null|string + */ + public function getPublicKey(): ?string; + + /** + * @return null|string + */ + public function getAuthToken(): ?string; + + /** + * @return null|string + */ + public function getContentEncoding(): ?string; +} diff --git a/vendor/minishlink/web-push/src/Utils.php b/vendor/minishlink/web-push/src/Utils.php new file mode 100644 index 0000000..30c2018 --- /dev/null +++ b/vendor/minishlink/web-push/src/Utils.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Minishlink\WebPush; + +use Jose\Component\Core\Util\Ecc\PublicKey; + +class Utils +{ + /** + * @param string $value + * + * @return int + */ + public static function safeStrlen(string $value): int + { + return mb_strlen($value, '8bit'); + } + + /** + * @param PublicKey $publicKey + * + * @return string + */ + public static function serializePublicKey(PublicKey $publicKey): string + { + $hexString = '04'; + $hexString .= str_pad(gmp_strval($publicKey->getPoint()->getX(), 16), 64, '0', STR_PAD_LEFT); + $hexString .= str_pad(gmp_strval($publicKey->getPoint()->getY(), 16), 64, '0', STR_PAD_LEFT); + + return $hexString; + } + + /** + * @param string $data + * + * @return array + */ + public static function unserializePublicKey(string $data): array + { + $data = bin2hex($data); + if (mb_substr($data, 0, 2, '8bit') !== '04') { + throw new \InvalidArgumentException('Invalid data: only uncompressed keys are supported.'); + } + $data = mb_substr($data, 2, null, '8bit'); + $dataLength = self::safeStrlen($data); + + return [ + hex2bin(mb_substr($data, 0, $dataLength / 2, '8bit')), + hex2bin(mb_substr($data, $dataLength / 2, null, '8bit')), + ]; + } +} diff --git a/vendor/minishlink/web-push/src/VAPID.php b/vendor/minishlink/web-push/src/VAPID.php new file mode 100644 index 0000000..c741ec9 --- /dev/null +++ b/vendor/minishlink/web-push/src/VAPID.php @@ -0,0 +1,197 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Minishlink\WebPush; + +use Base64Url\Base64Url; +use Jose\Component\Core\AlgorithmManager; +use Jose\Component\Core\Converter\StandardConverter; +use Jose\Component\Core\JWK; +use Jose\Component\Core\Util\Ecc\NistCurve; +use Jose\Component\Core\Util\Ecc\Point; +use Jose\Component\Core\Util\Ecc\PublicKey; +use Jose\Component\KeyManagement\JWKFactory; +use Jose\Component\Signature\Algorithm\ES256; +use Jose\Component\Signature\JWSBuilder; +use Jose\Component\Signature\Serializer\CompactSerializer; + +class VAPID +{ + private const PUBLIC_KEY_LENGTH = 65; + private const PRIVATE_KEY_LENGTH = 32; + + /** + * @param array $vapid + * + * @return array + * + * @throws \ErrorException + */ + public static function validate(array $vapid): array + { + if (!isset($vapid['subject'])) { + throw new \ErrorException('[VAPID] You must provide a subject that is either a mailto: or a URL.'); + } + + if (isset($vapid['pemFile'])) { + $vapid['pem'] = file_get_contents($vapid['pemFile']); + + if (!$vapid['pem']) { + throw new \ErrorException('Error loading PEM file.'); + } + } + + if (isset($vapid['pem'])) { + $jwk = JWKFactory::createFromKey($vapid['pem']); + if ($jwk->get('kty') !== 'EC' || !$jwk->has('d') || !$jwk->has('x') || !$jwk->has('y')) { + throw new \ErrorException('Invalid PEM data.'); + } + $publicKey = PublicKey::create(Point::create( + gmp_init(bin2hex(Base64Url::decode($jwk->get('x'))), 16), + gmp_init(bin2hex(Base64Url::decode($jwk->get('y'))), 16) + )); + + $binaryPublicKey = hex2bin(Utils::serializePublicKey($publicKey)); + if (!$binaryPublicKey) { + throw new \ErrorException('Failed to convert VAPID public key from hexadecimal to binary'); + } + $vapid['publicKey'] = base64_encode($binaryPublicKey); + $vapid['privateKey'] = base64_encode(str_pad(Base64Url::decode($jwk->get('d')), 2 * self::PRIVATE_KEY_LENGTH, '0', STR_PAD_LEFT)); + } + + if (!isset($vapid['publicKey'])) { + throw new \ErrorException('[VAPID] You must provide a public key.'); + } + + $publicKey = Base64Url::decode($vapid['publicKey']); + + if (Utils::safeStrlen($publicKey) !== self::PUBLIC_KEY_LENGTH) { + throw new \ErrorException('[VAPID] Public key should be 65 bytes long when decoded.'); + } + + if (!isset($vapid['privateKey'])) { + throw new \ErrorException('[VAPID] You must provide a private key.'); + } + + $privateKey = Base64Url::decode($vapid['privateKey']); + + if (Utils::safeStrlen($privateKey) !== self::PRIVATE_KEY_LENGTH) { + throw new \ErrorException('[VAPID] Private key should be 32 bytes long when decoded.'); + } + + return [ + 'subject' => $vapid['subject'], + 'publicKey' => $publicKey, + 'privateKey' => $privateKey, + ]; + } + + /** + * This method takes the required VAPID parameters and returns the required + * header to be added to a Web Push Protocol Request. + * + * @param string $audience This must be the origin of the push service + * @param string $subject This should be a URL or a 'mailto:' email address + * @param string $publicKey The decoded VAPID public key + * @param string $privateKey The decoded VAPID private key + * @param string $contentEncoding + * @param null|int $expiration The expiration of the VAPID JWT. (UNIX timestamp) + * + * @return array Returns an array with the 'Authorization' and 'Crypto-Key' values to be used as headers + * @throws \ErrorException + */ + public static function getVapidHeaders(string $audience, string $subject, string $publicKey, string $privateKey, string $contentEncoding, ?int $expiration = null) + { + $expirationLimit = time() + 43200; // equal margin of error between 0 and 24h + if (null === $expiration || $expiration > $expirationLimit) { + $expiration = $expirationLimit; + } + + $header = [ + 'typ' => 'JWT', + 'alg' => 'ES256', + ]; + + $jwtPayload = json_encode([ + 'aud' => $audience, + 'exp' => $expiration, + 'sub' => $subject, + ], JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK); + if (!$jwtPayload) { + throw new \ErrorException('Failed to encode JWT payload in JSON'); + } + + list($x, $y) = Utils::unserializePublicKey($publicKey); + $jwk = JWK::create([ + 'kty' => 'EC', + 'crv' => 'P-256', + 'x' => Base64Url::encode($x), + 'y' => Base64Url::encode($y), + 'd' => Base64Url::encode($privateKey), + ]); + + $jsonConverter = new StandardConverter(); + $jwsCompactSerializer = new CompactSerializer($jsonConverter); + $jwsBuilder = new JWSBuilder($jsonConverter, AlgorithmManager::create([new ES256()])); + $jws = $jwsBuilder + ->create() + ->withPayload($jwtPayload) + ->addSignature($jwk, $header) + ->build(); + + $jwt = $jwsCompactSerializer->serialize($jws, 0); + $encodedPublicKey = Base64Url::encode($publicKey); + + if ($contentEncoding === "aesgcm") { + return [ + 'Authorization' => 'WebPush '.$jwt, + 'Crypto-Key' => 'p256ecdsa='.$encodedPublicKey, + ]; + } elseif ($contentEncoding === 'aes128gcm') { + return [ + 'Authorization' => 'vapid t='.$jwt.', k='.$encodedPublicKey, + ]; + } + + throw new \ErrorException('This content encoding is not supported'); + } + + /** + * This method creates VAPID keys in case you would not be able to have a Linux bash. + * DO NOT create keys at each initialization! Save those keys and reuse them. + * + * @return array + * @throws \ErrorException + */ + public static function createVapidKeys(): array + { + $curve = NistCurve::curve256(); + $privateKey = $curve->createPrivateKey(); + $publicKey = $curve->createPublicKey($privateKey); + + $binaryPublicKey = hex2bin(Utils::serializePublicKey($publicKey)); + if (!$binaryPublicKey) { + throw new \ErrorException('Failed to convert VAPID public key from hexadecimal to binary'); + } + + $binaryPrivateKey = hex2bin(str_pad(gmp_strval($privateKey->getSecret(), 16), 2 * self::PRIVATE_KEY_LENGTH, '0', STR_PAD_LEFT)); + if (!$binaryPrivateKey) { + throw new \ErrorException('Failed to convert VAPID private key from hexadecimal to binary'); + } + + return [ + 'publicKey' => Base64Url::encode($binaryPublicKey), + 'privateKey' => Base64Url::encode($binaryPrivateKey) + ]; + } +} diff --git a/vendor/minishlink/web-push/src/WebPush.php b/vendor/minishlink/web-push/src/WebPush.php new file mode 100644 index 0000000..aaa9b4b --- /dev/null +++ b/vendor/minishlink/web-push/src/WebPush.php @@ -0,0 +1,412 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Minishlink\WebPush; + +use Base64Url\Base64Url; +use GuzzleHttp\Client; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\Request; +use Psr\Http\Message\ResponseInterface; + +class WebPush +{ + public const GCM_URL = 'https://android.googleapis.com/gcm/send'; + public const FCM_BASE_URL = 'https://fcm.googleapis.com'; + + /** + * @var Client + */ + private $client; + + /** + * @var array + */ + private $auth; + + /** + * @var null|array Array of array of Notifications + */ + private $notifications; + + /** + * @var array Default options : TTL, urgency, topic, batchSize + */ + private $defaultOptions; + + /** + * @var int Automatic padding of payloads, if disabled, trade security for bandwidth + */ + private $automaticPadding = Encryption::MAX_COMPATIBILITY_PAYLOAD_LENGTH; + + /** + * @var bool Reuse VAPID headers in the same flush session to improve performance + */ + private $reuseVAPIDHeaders = false; + + /** + * @var array Dictionary for VAPID headers cache + */ + private $vapidHeaders = []; + + /** + * WebPush constructor. + * + * @param array $auth Some servers needs authentication + * @param array $defaultOptions TTL, urgency, topic, batchSize + * @param int|null $timeout Timeout of POST request + * @param array $clientOptions + * + * @throws \ErrorException + */ + public function __construct(array $auth = [], array $defaultOptions = [], ?int $timeout = 30, array $clientOptions = []) + { + $extensions = [ + 'curl' => '[WebPush] curl extension is not loaded but is required. You can fix this in your php.ini.', + 'gmp' => '[WebPush] gmp extension is not loaded but is required for sending push notifications with payload or for VAPID authentication. You can fix this in your php.ini.', + 'mbstring' => '[WebPush] mbstring extension is not loaded but is required for sending push notifications with payload or for VAPID authentication. You can fix this in your php.ini.', + 'openssl' => '[WebPush] openssl extension is not loaded but is required for sending push notifications with payload or for VAPID authentication. You can fix this in your php.ini.', + ]; + foreach ($extensions as $extension => $message) { + if (!extension_loaded($extension)) { + trigger_error($message, E_USER_WARNING); + } + } + + if (ini_get('mbstring.func_overload') >= 2) { + trigger_error("[WebPush] mbstring.func_overload is enabled for str* functions. You must disable it if you want to send push notifications with payload or use VAPID. You can fix this in your php.ini.", E_USER_NOTICE); + } + + if (isset($auth['VAPID'])) { + $auth['VAPID'] = VAPID::validate($auth['VAPID']); + } + + $this->auth = $auth; + + $this->setDefaultOptions($defaultOptions); + + if (!array_key_exists('timeout', $clientOptions) && isset($timeout)) { + $clientOptions['timeout'] = $timeout; + } + $this->client = new Client($clientOptions); + } + + /** + * Send a notification. + * + * @param SubscriptionInterface $subscription + * @param string|null $payload If you want to send an array, json_encode it + * @param bool $flush If you want to flush directly (usually when you send only one notification) + * @param array $options Array with several options tied to this notification. If not set, will use the default options that you can set in the WebPush object + * @param array $auth Use this auth details instead of what you provided when creating WebPush + * + * @return \Generator|MessageSentReport[]|true Return an array of information if $flush is set to true and the queued requests has failed. + * Else return true + * + * @throws \ErrorException + */ + public function sendNotification(SubscriptionInterface $subscription, ?string $payload = null, bool $flush = false, array $options = [], array $auth = []) + { + if (isset($payload)) { + if (Utils::safeStrlen($payload) > Encryption::MAX_PAYLOAD_LENGTH) { + throw new \ErrorException('Size of payload must not be greater than '.Encryption::MAX_PAYLOAD_LENGTH.' octets.'); + } + + $contentEncoding = $subscription->getContentEncoding(); + if (!$contentEncoding) { + throw new \ErrorException('Subscription should have a content encoding'); + } + + $payload = Encryption::padPayload($payload, $this->automaticPadding, $contentEncoding); + } + + if (array_key_exists('VAPID', $auth)) { + $auth['VAPID'] = VAPID::validate($auth['VAPID']); + } + + $this->notifications[] = new Notification($subscription, $payload, $options, $auth); + + return false !== $flush ? $this->flush() : true; + } + + /** + * Flush notifications. Triggers the requests. + * + * @param null|int $batchSize Defaults the value defined in defaultOptions during instantiation (which defaults to 1000). + * + * @return \Generator|MessageSentReport[] + * @throws \ErrorException + */ + public function flush(?int $batchSize = null): \Generator + { + if (null === $this->notifications || empty($this->notifications)) { + yield from []; + return; + } + + if (null === $batchSize) { + $batchSize = $this->defaultOptions['batchSize']; + } + + $batches = array_chunk($this->notifications, $batchSize); + + // reset queue + $this->notifications = []; + + foreach ($batches as $batch) { + // for each endpoint server type + $requests = $this->prepare($batch); + + $promises = []; + + foreach ($requests as $request) { + $promises[] = $this->client->sendAsync($request) + ->then(function ($response) use ($request) { + /** @var ResponseInterface $response * */ + return new MessageSentReport($request, $response); + }) + ->otherwise(function ($reason) { + /** @var RequestException $reason **/ + return new MessageSentReport($reason->getRequest(), $reason->getResponse(), false, $reason->getMessage()); + }); + } + + foreach ($promises as $promise) { + yield $promise->wait(); + } + } + + if ($this->reuseVAPIDHeaders) { + $this->vapidHeaders = []; + } + } + + /** + * @param array $notifications + * + * @return array + * + * @throws \ErrorException + */ + private function prepare(array $notifications): array + { + $requests = []; + /** @var Notification $notification */ + foreach ($notifications as $notification) { + $subscription = $notification->getSubscription(); + $endpoint = $subscription->getEndpoint(); + $userPublicKey = $subscription->getPublicKey(); + $userAuthToken = $subscription->getAuthToken(); + $contentEncoding = $subscription->getContentEncoding(); + $payload = $notification->getPayload(); + $options = $notification->getOptions($this->getDefaultOptions()); + $auth = $notification->getAuth($this->auth); + + if (!empty($payload) && !empty($userPublicKey) && !empty($userAuthToken)) { + if (!$contentEncoding) { + throw new \ErrorException('Subscription should have a content encoding'); + } + + $encrypted = Encryption::encrypt($payload, $userPublicKey, $userAuthToken, $contentEncoding); + $cipherText = $encrypted['cipherText']; + $salt = $encrypted['salt']; + $localPublicKey = $encrypted['localPublicKey']; + + $headers = [ + 'Content-Type' => 'application/octet-stream', + 'Content-Encoding' => $contentEncoding, + ]; + + if ($contentEncoding === "aesgcm") { + $headers['Encryption'] = 'salt='.Base64Url::encode($salt); + $headers['Crypto-Key'] = 'dh='.Base64Url::encode($localPublicKey); + } + + $encryptionContentCodingHeader = Encryption::getContentCodingHeader($salt, $localPublicKey, $contentEncoding); + $content = $encryptionContentCodingHeader.$cipherText; + + $headers['Content-Length'] = Utils::safeStrlen($content); + } else { + $headers = [ + 'Content-Length' => 0, + ]; + + $content = ''; + } + + $headers['TTL'] = $options['TTL']; + + if (isset($options['urgency'])) { + $headers['Urgency'] = $options['urgency']; + } + + if (isset($options['topic'])) { + $headers['Topic'] = $options['topic']; + } + + // if GCM + if (substr($endpoint, 0, strlen(self::GCM_URL)) === self::GCM_URL) { + if (array_key_exists('GCM', $auth)) { + $headers['Authorization'] = 'key='.$auth['GCM']; + } else { + throw new \ErrorException('No GCM API Key specified.'); + } + } + // if VAPID (GCM doesn't support it but FCM does) + elseif (array_key_exists('VAPID', $auth) && $contentEncoding) { + $audience = parse_url($endpoint, PHP_URL_SCHEME).'://'.parse_url($endpoint, PHP_URL_HOST); + if (!parse_url($audience)) { + throw new \ErrorException('Audience "'.$audience.'"" could not be generated.'); + } + + $vapidHeaders = $this->getVAPIDHeaders($audience, $contentEncoding, $auth['VAPID']); + + $headers['Authorization'] = $vapidHeaders['Authorization']; + + if ($contentEncoding === 'aesgcm') { + if (array_key_exists('Crypto-Key', $headers)) { + $headers['Crypto-Key'] .= ';'.$vapidHeaders['Crypto-Key']; + } else { + $headers['Crypto-Key'] = $vapidHeaders['Crypto-Key']; + } + } + } + + $requests[] = new Request('POST', $endpoint, $headers, $content); + } + + return $requests; + } + + /** + * @return bool + */ + public function isAutomaticPadding(): bool + { + return $this->automaticPadding !== 0; + } + + /** + * @return int + */ + public function getAutomaticPadding() + { + return $this->automaticPadding; + } + + /** + * @param int|bool $automaticPadding Max padding length + * + * @return WebPush + * + * @throws \Exception + */ + public function setAutomaticPadding($automaticPadding): WebPush + { + if ($automaticPadding > Encryption::MAX_PAYLOAD_LENGTH) { + throw new \Exception('Automatic padding is too large. Max is '.Encryption::MAX_PAYLOAD_LENGTH.'. Recommended max is '.Encryption::MAX_COMPATIBILITY_PAYLOAD_LENGTH.' for compatibility reasons (see README).'); + } elseif ($automaticPadding < 0) { + throw new \Exception('Padding length should be positive or zero.'); + } elseif ($automaticPadding === true) { + $this->automaticPadding = Encryption::MAX_COMPATIBILITY_PAYLOAD_LENGTH; + } elseif ($automaticPadding === false) { + $this->automaticPadding = 0; + } else { + $this->automaticPadding = $automaticPadding; + } + + return $this; + } + + /** + * @return bool + */ + public function getReuseVAPIDHeaders() + { + return $this->reuseVAPIDHeaders; + } + + /** + * Reuse VAPID headers in the same flush session to improve performance + * @param bool $enabled + * + * @return WebPush + */ + public function setReuseVAPIDHeaders(bool $enabled) + { + $this->reuseVAPIDHeaders = $enabled; + + return $this; + } + + /** + * @return array + */ + public function getDefaultOptions(): array + { + return $this->defaultOptions; + } + + /** + * @param array $defaultOptions Keys 'TTL' (Time To Live, defaults 4 weeks), 'urgency', 'topic', 'batchSize' + * + * @return WebPush + */ + public function setDefaultOptions(array $defaultOptions) + { + $this->defaultOptions['TTL'] = isset($defaultOptions['TTL']) ? $defaultOptions['TTL'] : 2419200; + $this->defaultOptions['urgency'] = isset($defaultOptions['urgency']) ? $defaultOptions['urgency'] : null; + $this->defaultOptions['topic'] = isset($defaultOptions['topic']) ? $defaultOptions['topic'] : null; + $this->defaultOptions['batchSize'] = isset($defaultOptions['batchSize']) ? $defaultOptions['batchSize'] : 1000; + + return $this; + } + + /** + * @return int + */ + public function countPendingNotifications(): int + { + return null !== $this->notifications ? count($this->notifications) : 0; + } + + /** + * @param string $audience + * @param string $contentEncoding + * @param array $vapid + * @return array + * @throws \ErrorException + */ + private function getVAPIDHeaders(string $audience, string $contentEncoding, array $vapid) + { + $vapidHeaders = null; + + $cache_key = null; + if ($this->reuseVAPIDHeaders) { + $cache_key = implode('#', [$audience, $contentEncoding, crc32(serialize($vapid))]); + if (array_key_exists($cache_key, $this->vapidHeaders)) { + $vapidHeaders = $this->vapidHeaders[$cache_key]; + } + } + + if (!$vapidHeaders) { + $vapidHeaders = VAPID::getVapidHeaders($audience, $vapid['subject'], $vapid['publicKey'], $vapid['privateKey'], $contentEncoding); + } + + if ($this->reuseVAPIDHeaders) { + $this->vapidHeaders[$cache_key] = $vapidHeaders; + } + + return $vapidHeaders; + } +} diff --git a/vendor/paragonie/random_compat/LICENSE b/vendor/paragonie/random_compat/LICENSE new file mode 100644 index 0000000..45c7017 --- /dev/null +++ b/vendor/paragonie/random_compat/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Paragon Initiative Enterprises + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/vendor/paragonie/random_compat/build-phar.sh b/vendor/paragonie/random_compat/build-phar.sh new file mode 100644 index 0000000..b4a5ba3 --- /dev/null +++ b/vendor/paragonie/random_compat/build-phar.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +basedir=$( dirname $( readlink -f ${BASH_SOURCE[0]} ) ) + +php -dphar.readonly=0 "$basedir/other/build_phar.php" $* \ No newline at end of file diff --git a/vendor/paragonie/random_compat/composer.json b/vendor/paragonie/random_compat/composer.json new file mode 100644 index 0000000..1725089 --- /dev/null +++ b/vendor/paragonie/random_compat/composer.json @@ -0,0 +1,34 @@ +{ + "name": "paragonie/random_compat", + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "random", + "polyfill", + "pseudorandom" + ], + "license": "MIT", + "type": "library", + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "support": { + "issues": "https://github.com/paragonie/random_compat/issues", + "email": "info@paragonie.com", + "source": "https://github.com/paragonie/random_compat" + }, + "require": { + "php": ">= 7" + }, + "require-dev": { + "vimeo/psalm": "^1", + "phpunit/phpunit": "4.*|5.*" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + } +} diff --git a/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey b/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey new file mode 100644 index 0000000..eb50ebf --- /dev/null +++ b/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey @@ -0,0 +1,5 @@ +-----BEGIN PUBLIC KEY----- +MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEEd+wCqJDrx5B4OldM0dQE0ZMX+lx1ZWm +pui0SUqD4G29L3NGsz9UhJ/0HjBdbnkhIK5xviT0X5vtjacF6ajgcCArbTB+ds+p ++h7Q084NuSuIpNb6YPfoUFgC/CL9kAoc +-----END PUBLIC KEY----- diff --git a/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey.asc b/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey.asc new file mode 100644 index 0000000..6a1d7f3 --- /dev/null +++ b/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey.asc @@ -0,0 +1,11 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.22 (MingW32) + +iQEcBAABAgAGBQJWtW1hAAoJEGuXocKCZATaJf0H+wbZGgskK1dcRTsuVJl9IWip +QwGw/qIKI280SD6/ckoUMxKDCJiFuPR14zmqnS36k7N5UNPnpdTJTS8T11jttSpg +1LCmgpbEIpgaTah+cELDqFCav99fS+bEiAL5lWDAHBTE/XPjGVCqeehyPYref4IW +NDBIEsvnHPHPLsn6X5jq4+Yj5oUixgxaMPiR+bcO4Sh+RzOVB6i2D0upWfRXBFXA +NNnsg9/zjvoC7ZW73y9uSH+dPJTt/Vgfeiv52/v41XliyzbUyLalf02GNPY+9goV +JHG1ulEEBJOCiUD9cE1PUIJwHA/HqyhHIvV350YoEFiHl8iSwm7SiZu5kPjaq74= +=B6+8 +-----END PGP SIGNATURE----- diff --git a/vendor/paragonie/random_compat/lib/random.php b/vendor/paragonie/random_compat/lib/random.php new file mode 100644 index 0000000..c7731a5 --- /dev/null +++ b/vendor/paragonie/random_compat/lib/random.php @@ -0,0 +1,32 @@ +buildFromDirectory(dirname(__DIR__).'/lib'); +rename( + dirname(__DIR__).'/lib/index.php', + dirname(__DIR__).'/lib/random.php' +); + +/** + * If we pass an (optional) path to a private key as a second argument, we will + * sign the Phar with OpenSSL. + * + * If you leave this out, it will produce an unsigned .phar! + */ +if ($argc > 1) { + if (!@is_readable($argv[1])) { + echo 'Could not read the private key file:', $argv[1], "\n"; + exit(255); + } + $pkeyFile = file_get_contents($argv[1]); + + $private = openssl_get_privatekey($pkeyFile); + if ($private !== false) { + $pkey = ''; + openssl_pkey_export($private, $pkey); + $phar->setSignatureAlgorithm(Phar::OPENSSL, $pkey); + + /** + * Save the corresponding public key to the file + */ + if (!@is_readable($dist.'/random_compat.phar.pubkey')) { + $details = openssl_pkey_get_details($private); + file_put_contents( + $dist.'/random_compat.phar.pubkey', + $details['key'] + ); + } + } else { + echo 'An error occurred reading the private key from OpenSSL.', "\n"; + exit(255); + } +} diff --git a/vendor/paragonie/random_compat/psalm-autoload.php b/vendor/paragonie/random_compat/psalm-autoload.php new file mode 100644 index 0000000..d71d1b8 --- /dev/null +++ b/vendor/paragonie/random_compat/psalm-autoload.php @@ -0,0 +1,9 @@ + + + + + + + + + + + + + + + diff --git a/vendor/paragonie/sodium_compat/.github/workflows/ci.yml b/vendor/paragonie/sodium_compat/.github/workflows/ci.yml new file mode 100644 index 0000000..f570b84 --- /dev/null +++ b/vendor/paragonie/sodium_compat/.github/workflows/ci.yml @@ -0,0 +1,96 @@ +name: CI + +on: [push] + +jobs: + old: + name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: ['ubuntu-16.04'] + php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0'] + phpunit-versions: ['7.5.20'] + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: mbstring, intl + ini-values: post_max_size=256M, max_execution_time=180 + tools: psalm, phpunit:${{ matrix.phpunit-versions }} + + - name: Install dependencies + run: composer self-update --1; composer install + + - name: PHPUnit tests + uses: php-actions/phpunit@v2 + with: + memory_limit: 256M + + moderate: + name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: ['ubuntu-latest'] + php-versions: ['7.1', '7.2', '7.3'] + phpunit-versions: ['latest'] + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: mbstring, intl, sodium + ini-values: post_max_size=256M, max_execution_time=180 + tools: psalm, phpunit:${{ matrix.phpunit-versions }} + + - name: Install dependencies + run: composer install + + - name: PHPUnit tests + uses: php-actions/phpunit@v2 + timeout-minutes: 30 + with: + memory_limit: 256M + + modern: + name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: ['ubuntu-latest'] + php-versions: ['7.4', '8.0'] + phpunit-versions: ['latest'] + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: mbstring, intl, sodium + ini-values: post_max_size=256M, max_execution_time=180 + tools: psalm, phpunit:${{ matrix.phpunit-versions }} + + - name: Install dependencies + run: composer install + + - name: PHPUnit tests + uses: php-actions/phpunit@v2 + timeout-minutes: 30 + with: + memory_limit: 256M + + - name: Install Psalm + run: composer require --dev vimeo/psalm:^4; cp psalm-above-3.xml psalm.xml + + - name: Static Analysis + run: vendor/bin/psalm diff --git a/vendor/paragonie/sodium_compat/.gitignore b/vendor/paragonie/sodium_compat/.gitignore new file mode 100644 index 0000000..0df5a6d --- /dev/null +++ b/vendor/paragonie/sodium_compat/.gitignore @@ -0,0 +1,9 @@ +/.idea/ +/.php_cs.cache +/.phpunit.result.cache +/box/ +/dist/sodium-compat.phar +/dist/sodium-compat.phar.sig +/composer.lock +/vendor/ +/psalm.xml diff --git a/vendor/paragonie/sodium_compat/LICENSE b/vendor/paragonie/sodium_compat/LICENSE new file mode 100644 index 0000000..184e442 --- /dev/null +++ b/vendor/paragonie/sodium_compat/LICENSE @@ -0,0 +1,16 @@ +ISC License + +Copyright (c) 2016-2021, Paragon Initiative Enterprises +Copyright (c) 2013-2019, Frank Denis + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/vendor/paragonie/sodium_compat/README.md b/vendor/paragonie/sodium_compat/README.md new file mode 100644 index 0000000..a50508c --- /dev/null +++ b/vendor/paragonie/sodium_compat/README.md @@ -0,0 +1,347 @@ +# Sodium Compat + +[![Build Status](https://github.com/paragonie/sodium_compat/actions/workflows/ci.yml/badge.svg)](https://github.com/paragonie/sodium_compat/actions) +[![Windows Build Status](https://ci.appveyor.com/api/projects/status/itcx1vgmfqiawgbe?svg=true)](https://ci.appveyor.com/project/paragonie-scott/sodium-compat) +[![Latest Stable Version](https://poser.pugx.org/paragonie/sodium_compat/v/stable)](https://packagist.org/packages/paragonie/sodium_compat) +[![Latest Unstable Version](https://poser.pugx.org/paragonie/sodium_compat/v/unstable)](https://packagist.org/packages/paragonie/sodium_compat) +[![License](https://poser.pugx.org/paragonie/sodium_compat/license)](https://packagist.org/packages/paragonie/sodium_compat) +[![Downloads](https://img.shields.io/packagist/dt/paragonie/sodium_compat.svg)](https://packagist.org/packages/paragonie/sodium_compat) + +Sodium Compat is a pure PHP polyfill for the Sodium cryptography library +(libsodium), a core extension in PHP 7.2.0+ and otherwise [available in PECL](https://pecl.php.net/package/libsodium). + +This library tentativeley supports PHP 5.2.4 - 8.x (latest), but officially +only supports [non-EOL'd versions of PHP](https://secure.php.net/supported-versions.php). + +If you have the PHP extension installed, Sodium Compat will opportunistically +and transparently use the PHP extension instead of our implementation. + +## IMPORTANT! + +This cryptography library has not been formally audited by an independent third +party that specializes in cryptography or cryptanalysis. + +If you require such an audit before you can use sodium_compat in your projects +and have the funds for such an audit, please open an issue or contact +`security at paragonie dot com` so we can help get the ball rolling. + +However, sodium_compat has been adopted by high profile open source projects, +such as [Joomla!](https://github.com/joomla/joomla-cms/blob/459d74686d2a638ec51149d7c44ddab8075852be/composer.json#L40) +and [Magento](https://github.com/magento/magento2/blob/8fd89cfdf52c561ac0ca7bc20fd38ef688e201b0/composer.json#L44). +Furthermore, sodium_compat was developed by Paragon Initiative Enterprises, a +company that *specializes* in secure PHP development and PHP cryptography, and +has been informally reviewed by many other security experts who also specialize +in PHP. + +If you'd like to learn more about the defensive security measures we've taken +to prevent sodium_compat from being a source of vulnerability in your systems, +please read [*Cryptographically Secure PHP Development*](https://paragonie.com/blog/2017/02/cryptographically-secure-php-development). + +# Installing Sodium Compat + +If you're using Composer: + +```bash +composer require paragonie/sodium_compat +``` + +### Install From Source + +If you're not using Composer, download a [release tarball](https://github.com/paragonie/sodium_compat/releases) +(which should be signed with [our GnuPG public key](https://paragonie.com/static/gpg-public-key.txt)), extract +its contents, then include our `autoload.php` script in your project. + +```php + + gpg --fingerprint 7F52D5C61D1255C731362E826B97A1C2826404DA + if [ $? -ne 0 ]; then + echo -e "\033[31mCould not download PGP public key for verification\033[0m" + exit 1 + fi +fi + +# Verifying the PHP Archive +gpg --verify sodium-compat.phar.sig sodium-compat.phar +``` + +Now, simply include this .phar file in your application. + +```php +execute(); +} else { + // Defer to a cron job or other sort of asynchronous process + $process->enqueue(); +} +``` + +### Help, my PHP only has 32-Bit Integers! It's super slow! + +Some features of sodium_compat are ***incredibly slow* with PHP 5 on Windows** +(in particular: public-key cryptography (encryption and signatures) is +affected), and there is nothing we can do about that, due to platform +restrictions on integers. + +For acceptable performance, we highly recommend Windows users to version 1.0.6 +of the libsodium extension from PECL or, alternatively, simply upgrade to PHP 7 +and the slowdown will be greatly reduced. + +This is also true of non-Windows 32-bit operating systems, or if somehow PHP +was compiled where `PHP_INT_SIZE` equals `4` instead of `8` (i.e. Linux on i386). + +## Documentation + +First, you'll want to read the [Libsodium Quick Reference](https://paragonie.com/blog/2017/06/libsodium-quick-reference-quick-comparison-similar-functions-and-which-one-use). +It aims to answer, "Which function should I use for [common problem]?". + +If you don't find the answers in the Quick Reference page, check out +[*Using Libsodium in PHP Projects*](https://paragonie.com/book/pecl-libsodium). + +Finally, the [official libsodium documentation](https://download.libsodium.org/doc/) +(which was written for the C library, not the PHP library) also contains a lot of +insightful technical information you may find helpful. + +## API Coverage + +**Recommended reading:** [Libsodium Quick Reference](https://paragonie.com/blog/2017/06/libsodium-quick-reference-quick-comparison-similar-functions-and-which-one-use) + +* Mainline NaCl Features + * `crypto_auth()` + * `crypto_auth_verify()` + * `crypto_box()` + * `crypto_box_open()` + * `crypto_scalarmult()` + * `crypto_secretbox()` + * `crypto_secretbox_open()` + * `crypto_sign()` + * `crypto_sign_open()` +* PECL Libsodium Features + * `crypto_aead_aes256gcm_encrypt()` + * `crypto_aead_aes256gcm_decrypt()` + * `crypto_aead_chacha20poly1305_encrypt()` + * `crypto_aead_chacha20poly1305_decrypt()` + * `crypto_aead_chacha20poly1305_ietf_encrypt()` + * `crypto_aead_chacha20poly1305_ietf_decrypt()` + * `crypto_aead_xchacha20poly1305_ietf_encrypt()` + * `crypto_aead_xchacha20poly1305_ietf_decrypt()` + * `crypto_box_xchacha20poly1305()` + * `crypto_box_xchacha20poly1305_open()` + * `crypto_box_seal()` + * `crypto_box_seal_open()` + * `crypto_generichash()` + * `crypto_generichash_init()` + * `crypto_generichash_update()` + * `crypto_generichash_final()` + * `crypto_kx()` + * `crypto_secretbox_xchacha20poly1305()` + * `crypto_secretbox_xchacha20poly1305_open()` + * `crypto_shorthash()` + * `crypto_sign_detached()` + * `crypto_sign_ed25519_pk_to_curve25519()` + * `crypto_sign_ed25519_sk_to_curve25519()` + * `crypto_sign_verify_detached()` + * For advanced users only: + * `crypto_stream()` + * `crypto_stream_xor()` + * Other utilities (e.g. `crypto_*_keypair()`) + * `add()` + * `base642bin()` + * `bin2base64()` + * `bin2hex()` + * `hex2bin()` + * `crypto_kdf_derive_from_key()` + * `crypto_kx_client_session_keys()` + * `crypto_kx_server_session_keys()` + * `crypto_secretstream_xchacha20poly1305_init_push()` + * `crypto_secretstream_xchacha20poly1305_push()` + * `crypto_secretstream_xchacha20poly1305_init_pull()` + * `crypto_secretstream_xchacha20poly1305_pull()` + * `crypto_secretstream_xchacha20poly1305_rekey()` + * `pad()` + * `unpad()` + +### Cryptography Primitives Provided + +* **X25519** - Elliptic Curve Diffie Hellman over Curve25519 +* **Ed25519** - Edwards curve Digital Signature Algorithm over Curve25519 +* **Xsalsa20** - Extended-nonce Salsa20 stream cipher +* **ChaCha20** - Stream cipher +* **Xchacha20** - Extended-nonce ChaCha20 stream cipher +* **Poly1305** - Polynomial Evaluation Message Authentication Code modulo 2^130 - 5 +* **BLAKE2b** - Cryptographic Hash Function +* **SipHash-2-4** - Fast hash, but not collision-resistant; ideal for hash tables. + +### Features Excluded from this Polyfill + +* `\Sodium\memzero()` - Although we expose this API endpoint, we can't reliably + zero buffers from PHP. + + If you have the PHP extension installed, sodium_compat + will use the native implementation to zero out the string provided. Otherwise + it will throw a `SodiumException`. +* `\Sodium\crypto_pwhash()` - It's not feasible to polyfill scrypt or Argon2 + into PHP and get reasonable performance. Users would feel motivated to select + parameters that downgrade security to avoid denial of service (DoS) attacks. + + The only winning move is not to play. + + If ext/sodium or ext/libsodium is installed, these API methods will fallthrough + to the extension. Otherwise, our polyfill library will throw a `SodiumException`. + + To detect support for Argon2i at runtime, use + `ParagonIE_Sodium_Compat::crypto_pwhash_is_available()`, which returns a + boolean value (`TRUE` or `FALSE`). + +### PHPCompatibility Ruleset + +For sodium_compat users and that utilize [`PHPCompatibility`](https://github.com/PHPCompatibility/PHPCompatibility) +in their CI process, there is now a custom ruleset available which can be used +to prevent false positives being thrown by `PHPCompatibility` for the native +PHP functionality being polyfilled by this repo. + +You can find the repo for the `PHPCompatibilityParagonieSodiumCompat` ruleset +here [on Github](https://github.com/PHPCompatibility/PHPCompatibilityParagonie) +and [on Packagist](https://packagist.org/packages/phpcompatibility/phpcompatibility-paragonie). diff --git a/vendor/paragonie/sodium_compat/appveyor.yml b/vendor/paragonie/sodium_compat/appveyor.yml new file mode 100644 index 0000000..9621e9a --- /dev/null +++ b/vendor/paragonie/sodium_compat/appveyor.yml @@ -0,0 +1,27 @@ +build: false +shallow_clone: false +platform: + - x86 + - x64 +clone_folder: C:\projects\sodium_compat +image: Visual Studio 2017 + +install: + - cinst -y OpenSSL.Light + - SET PATH=C:\Program Files\OpenSSL;%PATH% + - sc config wuauserv start= auto + - net start wuauserv + - cinst -y php --version 5.6.30 + - cd c:\tools\php56 + - copy php.ini-production php.ini + - echo date.timezone="UTC" >> php.ini + - echo extension_dir=ext >> php.ini + - echo extension=php_openssl.dll >> php.ini + - cd C:\projects\sodium_compat + - SET PATH=C:\tools\php56;%PATH% + - php.exe -r "readfile('http://getcomposer.org/installer');" | php.exe + - php.exe composer.phar install --prefer-source --no-interaction + +test_script: + - cd C:\projects\sodium_compat + - vendor\bin\phpunit.bat tests/Windows32Test.php diff --git a/vendor/paragonie/sodium_compat/autoload-fast.php b/vendor/paragonie/sodium_compat/autoload-fast.php new file mode 100644 index 0000000..08724d1 --- /dev/null +++ b/vendor/paragonie/sodium_compat/autoload-fast.php @@ -0,0 +1,4 @@ += 50300) { + require_once (dirname(__FILE__) . '/tests/phpunit-shim.php'); +} +require_once (dirname(__FILE__) . '/autoload.php'); diff --git a/vendor/paragonie/sodium_compat/autoload.php b/vendor/paragonie/sodium_compat/autoload.php new file mode 100644 index 0000000..c5c23b4 --- /dev/null +++ b/vendor/paragonie/sodium_compat/autoload.php @@ -0,0 +1,72 @@ += 50300) { + // Namespaces didn't exist before 5.3.0, so don't even try to use this + // unless PHP >= 5.3.0 + require_once dirname(__FILE__) . '/lib/namespaced.php'; + require_once dirname(__FILE__) . '/lib/sodium_compat.php'; +} else { + require_once dirname(__FILE__) . '/src/PHP52/SplFixedArray.php'; +} +if (PHP_VERSION_ID < 70200 || !extension_loaded('sodium')) { + if (PHP_VERSION_ID >= 50300 && !defined('SODIUM_CRYPTO_SCALARMULT_BYTES')) { + require_once dirname(__FILE__) . '/lib/php72compat_const.php'; + } + if (PHP_VERSION_ID >= 70000) { + assert(class_exists('ParagonIE_Sodium_Compat'), 'Possible filesystem/autoloader bug?'); + } else { + assert(class_exists('ParagonIE_Sodium_Compat')); + } + require_once(dirname(__FILE__) . '/lib/php72compat.php'); +} elseif (!function_exists('sodium_crypto_stream_xchacha20_xor')) { + // Older versions of {PHP, ext/sodium} will not define these + require_once(dirname(__FILE__) . '/lib/php72compat.php'); +} +require_once(dirname(__FILE__) . '/lib/ristretto255.php'); diff --git a/vendor/paragonie/sodium_compat/build-phar.sh b/vendor/paragonie/sodium_compat/build-phar.sh new file mode 100644 index 0000000..380eee6 --- /dev/null +++ b/vendor/paragonie/sodium_compat/build-phar.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +curl -LSs https://box-project.github.io/box2/installer.php | php +mkdir ~/box +mv box.phar ~/box/box +PATH=$PATH:~/box/ make -C dist/ build-phar +# PATH=$PATH:~/box/ make -C dist/ sign-phar + diff --git a/vendor/paragonie/sodium_compat/composer-php52.json b/vendor/paragonie/sodium_compat/composer-php52.json new file mode 100644 index 0000000..9547d0d --- /dev/null +++ b/vendor/paragonie/sodium_compat/composer-php52.json @@ -0,0 +1,87 @@ +{ + "name": "paragonie/sodium_compat", + "description": "Pure PHP implementation of libsodium; uses the PHP extension if it exists", + "keywords": [ + "PHP", + "cryptography", + "elliptic curve", + "elliptic curve cryptography", + "Pure-PHP cryptography", + "side-channel resistant", + "Curve25519", + "X25519", + "ECDH", + "Elliptic Curve Diffie-Hellman", + "Ed25519", + "RFC 7748", + "RFC 8032", + "EdDSA", + "Edwards-curve Digital Signature Algorithm", + "ChaCha20", + "Salsa20", + "Xchacha20", + "Xsalsa20", + "Poly1305", + "BLAKE2b", + "public-key cryptography", + "secret-key cryptography", + "AEAD", + "Chapoly", + "Salpoly", + "ChaCha20-Poly1305", + "XSalsa20-Poly1305", + "XChaCha20-Poly1305", + "encryption", + "authentication", + "libsodium" + ], + "license": "ISC", + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com" + }, + { + "name": "Frank Denis", + "email": "jedisct1@pureftpd.org" + } + ], + "autoload": { + "files": ["autoload.php"] + }, + "repositories": [ + { + "type": "git", + "url": "https://github.com/garex/phpunit" + }, + { + "type": "git", + "url": "https://github.com/garex/phpunit-mock-objects" + } + ], + "require": { + "php": "^5.2.4|^5.3|^5.4|^5.5|^5.6|^7|^8", + "xrstf/composer-php52": "1.*", + "paragonie/random_compat": ">=1" + }, + "minimum-stability": "dev", + "require-dev": { + "phpunit/phpunit-php52": "dev-3.6.12-php52", + "phpunit/phpunit-mock-objects-php52": "dev-1.1.0-php52" + }, + "scripts": { + "post-install-cmd": [ + "xrstf\\Composer52\\Generator::onPostInstallCmd" + ], + "post-update-cmd": [ + "xrstf\\Composer52\\Generator::onPostInstallCmd" + ], + "post-autoload-dump": [ + "xrstf\\Composer52\\Generator::onPostInstallCmd" + ] + }, + "suggest": { + "ext-libsodium": "PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.", + "ext-sodium": "PHP >= 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security." + } +} diff --git a/vendor/paragonie/sodium_compat/composer.json b/vendor/paragonie/sodium_compat/composer.json new file mode 100644 index 0000000..09b9d84 --- /dev/null +++ b/vendor/paragonie/sodium_compat/composer.json @@ -0,0 +1,66 @@ +{ + "name": "paragonie/sodium_compat", + "description": "Pure PHP implementation of libsodium; uses the PHP extension if it exists", + "keywords": [ + "PHP", + "cryptography", + "elliptic curve", + "elliptic curve cryptography", + "Pure-PHP cryptography", + "side-channel resistant", + "Curve25519", + "X25519", + "ECDH", + "Elliptic Curve Diffie-Hellman", + "Ed25519", + "RFC 7748", + "RFC 8032", + "EdDSA", + "Edwards-curve Digital Signature Algorithm", + "ChaCha20", + "Salsa20", + "Xchacha20", + "Xsalsa20", + "Poly1305", + "BLAKE2b", + "public-key cryptography", + "secret-key cryptography", + "AEAD", + "Chapoly", + "Salpoly", + "ChaCha20-Poly1305", + "XSalsa20-Poly1305", + "XChaCha20-Poly1305", + "encryption", + "authentication", + "libsodium" + ], + "license": "ISC", + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com" + }, + { + "name": "Frank Denis", + "email": "jedisct1@pureftpd.org" + } + ], + "autoload": { + "files": ["autoload.php"] + }, + "require": { + "php": "^5.2.4|^5.3|^5.4|^5.5|^5.6|^7|^8", + "paragonie/random_compat": ">=1" + }, + "require-dev": { + "phpunit/phpunit": "^3|^4|^5|^6|^7|^8|^9" + }, + "scripts": { + "test": "phpunit" + }, + "suggest": { + "ext-libsodium": "PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.", + "ext-sodium": "PHP >= 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security." + } +} diff --git a/vendor/paragonie/sodium_compat/dist/Makefile b/vendor/paragonie/sodium_compat/dist/Makefile new file mode 100644 index 0000000..f30a25d --- /dev/null +++ b/vendor/paragonie/sodium_compat/dist/Makefile @@ -0,0 +1,39 @@ +# This builds sodium-compat.phar. To run this Makefile, `box` and `composer` +# must be installed and in your $PATH. Run it from inside the dist/ directory. + +box := $(shell which box) +composer := "composer" +gitcommit := $(shell git rev-parse HEAD) + +.PHONY: all +all: build-phar + +.PHONY: sign-phar +sign-phar: + gpg -u 7F52D5C61D1255C731362E826B97A1C2826404DA --armor --output sodium-compat.phar.sig --detach-sig sodium-compat.phar + +# ensure we run in clean tree. export git tree and run there. +.PHONY: build-phar +build-phar: + @echo "Creating .phar from revision $(shell git rev-parse HEAD)." + rm -rf worktree + install -d worktree + (cd $(CURDIR)/..; git archive HEAD) | tar -x -C worktree + $(MAKE) -f $(CURDIR)/Makefile -C worktree sodium-compat.phar + mv worktree/*.phar . + rm -rf worktree + +.PHONY: clean +clean: + rm -vf sodium-compat.phar sodium-compat.phar.sig + +# Inside workdir/: + +sodium-compat.phar: dist/box.json composer.lock + cp dist/box.json . + php -d phar.readonly=0 $(box) build -c box.json -v + +composer.lock: + $(composer) config autoloader-suffix $(gitcommit) + $(composer) install --no-dev + diff --git a/vendor/paragonie/sodium_compat/dist/box.json b/vendor/paragonie/sodium_compat/dist/box.json new file mode 100644 index 0000000..5f7827e --- /dev/null +++ b/vendor/paragonie/sodium_compat/dist/box.json @@ -0,0 +1,32 @@ +{ + "chmod": "0755", + "finder": [ + { + "in": "", + "name": "autoload.php" + }, + { + "in": "src", + "name": "*.php" + }, + { + "in": "lib", + "name": "*.php" + }, + { + "in": "vendor/composer", + "name": "*.php" + }, + { + "in": "vendor/paragonie", + "name": "*.php" + } + ], + "compactors": [ + "Herrera\\Box\\Compactor\\Php" + ], + "main": "vendor/autoload.php", + "output": "sodium-compat.phar", + "shebang": false, + "stub": true +} diff --git a/vendor/paragonie/sodium_compat/lib/constants.php b/vendor/paragonie/sodium_compat/lib/constants.php new file mode 100644 index 0000000..b6a120e --- /dev/null +++ b/vendor/paragonie/sodium_compat/lib/constants.php @@ -0,0 +1,52 @@ +getMessage() === 'Argument 2 must be CRYPTO_BOX_KEYPAIRBYTES long.') { + throw $ex; + } + return false; + } + } +} +if (!is_callable('sodium_crypto_box_secretkey')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_box_secretkey() + * @param string $keypair + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_box_secretkey($keypair) + { + return ParagonIE_Sodium_Compat::crypto_box_secretkey($keypair); + } +} +if (!is_callable('sodium_crypto_box_seed_keypair')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_box_seed_keypair() + * @param string $seed + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_box_seed_keypair($seed) + { + return ParagonIE_Sodium_Compat::crypto_box_seed_keypair($seed); + } +} +if (!is_callable('sodium_crypto_generichash')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_generichash() + * @param string $message + * @param string|null $key + * @param int $outLen + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_generichash($message, $key = null, $outLen = 32) + { + return ParagonIE_Sodium_Compat::crypto_generichash($message, $key, $outLen); + } +} +if (!is_callable('sodium_crypto_generichash_final')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_generichash_final() + * @param string|null $ctx + * @param int $outputLength + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_generichash_final(&$ctx, $outputLength = 32) + { + return ParagonIE_Sodium_Compat::crypto_generichash_final($ctx, $outputLength); + } +} +if (!is_callable('sodium_crypto_generichash_init')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_generichash_init() + * @param string|null $key + * @param int $outLen + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_generichash_init($key = null, $outLen = 32) + { + return ParagonIE_Sodium_Compat::crypto_generichash_init($key, $outLen); + } +} +if (!is_callable('sodium_crypto_generichash_keygen')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_generichash_keygen() + * @return string + * @throws Exception + */ + function sodium_crypto_generichash_keygen() + { + return ParagonIE_Sodium_Compat::crypto_generichash_keygen(); + } +} +if (!is_callable('sodium_crypto_generichash_update')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_generichash_update() + * @param string|null $ctx + * @param string $message + * @return void + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_generichash_update(&$ctx, $message = '') + { + ParagonIE_Sodium_Compat::crypto_generichash_update($ctx, $message); + } +} +if (!is_callable('sodium_crypto_kdf_keygen')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_kdf_keygen() + * @return string + * @throws Exception + */ + function sodium_crypto_kdf_keygen() + { + return ParagonIE_Sodium_Compat::crypto_kdf_keygen(); + } +} +if (!is_callable('sodium_crypto_kdf_derive_from_key')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_kdf_derive_from_key() + * @param int $subkey_len + * @param int $subkey_id + * @param string $context + * @param string $key + * @return string + * @throws Exception + */ + function sodium_crypto_kdf_derive_from_key($subkey_len, $subkey_id, $context, $key) + { + return ParagonIE_Sodium_Compat::crypto_kdf_derive_from_key( + $subkey_len, + $subkey_id, + $context, + $key + ); + } +} +if (!is_callable('sodium_crypto_kx')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_kx() + * @param string $my_secret + * @param string $their_public + * @param string $client_public + * @param string $server_public + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_kx($my_secret, $their_public, $client_public, $server_public) + { + return ParagonIE_Sodium_Compat::crypto_kx( + $my_secret, + $their_public, + $client_public, + $server_public + ); + } +} +if (!is_callable('sodium_crypto_kx_seed_keypair')) { + /** + * @param string $seed + * @return string + * @throws Exception + */ + function sodium_crypto_kx_seed_keypair($seed) + { + return ParagonIE_Sodium_Compat::crypto_kx_seed_keypair($seed); + } +} +if (!is_callable('sodium_crypto_kx_keypair')) { + /** + * @return string + * @throws Exception + */ + function sodium_crypto_kx_keypair() + { + return ParagonIE_Sodium_Compat::crypto_kx_keypair(); + } +} +if (!is_callable('sodium_crypto_kx_client_session_keys')) { + /** + * @param string $keypair + * @param string $serverPublicKey + * @return array{0: string, 1: string} + * @throws SodiumException + */ + function sodium_crypto_kx_client_session_keys($keypair, $serverPublicKey) + { + return ParagonIE_Sodium_Compat::crypto_kx_client_session_keys($keypair, $serverPublicKey); + } +} +if (!is_callable('sodium_crypto_kx_server_session_keys')) { + /** + * @param string $keypair + * @param string $clientPublicKey + * @return array{0: string, 1: string} + * @throws SodiumException + */ + function sodium_crypto_kx_server_session_keys($keypair, $clientPublicKey) + { + return ParagonIE_Sodium_Compat::crypto_kx_server_session_keys($keypair, $clientPublicKey); + } +} +if (!is_callable('sodium_crypto_kx_secretkey')) { + /** + * @param string $keypair + * @return string + * @throws Exception + */ + function sodium_crypto_kx_secretkey($keypair) + { + return ParagonIE_Sodium_Compat::crypto_kx_secretkey($keypair); + } +} +if (!is_callable('sodium_crypto_kx_publickey')) { + /** + * @param string $keypair + * @return string + * @throws Exception + */ + function sodium_crypto_kx_publickey($keypair) + { + return ParagonIE_Sodium_Compat::crypto_kx_publickey($keypair); + } +} +if (!is_callable('sodium_crypto_pwhash')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_pwhash() + * @param int $outlen + * @param string $passwd + * @param string $salt + * @param int $opslimit + * @param int $memlimit + * @param int|null $algo + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit, $algo = null) + { + return ParagonIE_Sodium_Compat::crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit, $algo); + } +} +if (!is_callable('sodium_crypto_pwhash_str')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_pwhash_str() + * @param string $passwd + * @param int $opslimit + * @param int $memlimit + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_pwhash_str($passwd, $opslimit, $memlimit) + { + return ParagonIE_Sodium_Compat::crypto_pwhash_str($passwd, $opslimit, $memlimit); + } +} +if (!is_callable('sodium_crypto_pwhash_str_needs_rehash')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_pwhash_str_needs_rehash() + * @param string $hash + * @param int $opslimit + * @param int $memlimit + * @return bool + * + * @throws SodiumException + */ + function sodium_crypto_pwhash_str_needs_rehash($hash, $opslimit, $memlimit) + { + return ParagonIE_Sodium_Compat::crypto_pwhash_str_needs_rehash($hash, $opslimit, $memlimit); + } +} +if (!is_callable('sodium_crypto_pwhash_str_verify')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_pwhash_str_verify() + * @param string $passwd + * @param string $hash + * @return bool + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_pwhash_str_verify($passwd, $hash) + { + return ParagonIE_Sodium_Compat::crypto_pwhash_str_verify($passwd, $hash); + } +} +if (!is_callable('sodium_crypto_pwhash_scryptsalsa208sha256')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256() + * @param int $outlen + * @param string $passwd + * @param string $salt + * @param int $opslimit + * @param int $memlimit + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit) + { + return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit); + } +} +if (!is_callable('sodium_crypto_pwhash_scryptsalsa208sha256_str')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str() + * @param string $passwd + * @param int $opslimit + * @param int $memlimit + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit) + { + return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit); + } +} +if (!is_callable('sodium_crypto_pwhash_scryptsalsa208sha256_str_verify')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str_verify() + * @param string $passwd + * @param string $hash + * @return bool + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash) + { + return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash); + } +} +if (!is_callable('sodium_crypto_scalarmult')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_scalarmult() + * @param string $n + * @param string $p + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_scalarmult($n, $p) + { + return ParagonIE_Sodium_Compat::crypto_scalarmult($n, $p); + } +} +if (!is_callable('sodium_crypto_scalarmult_base')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_scalarmult_base() + * @param string $n + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_scalarmult_base($n) + { + return ParagonIE_Sodium_Compat::crypto_scalarmult_base($n); + } +} +if (!is_callable('sodium_crypto_secretbox')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_secretbox() + * @param string $message + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_secretbox($message, $nonce, $key) + { + return ParagonIE_Sodium_Compat::crypto_secretbox($message, $nonce, $key); + } +} +if (!is_callable('sodium_crypto_secretbox_keygen')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_secretbox_keygen() + * @return string + * @throws Exception + */ + function sodium_crypto_secretbox_keygen() + { + return ParagonIE_Sodium_Compat::crypto_secretbox_keygen(); + } +} +if (!is_callable('sodium_crypto_secretbox_open')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_secretbox_open() + * @param string $message + * @param string $nonce + * @param string $key + * @return string|bool + */ + function sodium_crypto_secretbox_open($message, $nonce, $key) + { + try { + return ParagonIE_Sodium_Compat::crypto_secretbox_open($message, $nonce, $key); + } catch (Error $ex) { + return false; + } catch (Exception $ex) { + return false; + } + } +} +if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_init_push')) { + /** + * @param string $key + * @return array + * @throws SodiumException + */ + function sodium_crypto_secretstream_xchacha20poly1305_init_push($key) + { + return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_init_push($key); + } +} +if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_push')) { + /** + * @param string $state + * @param string $msg + * @param string $aad + * @param int $tag + * @return string + * @throws SodiumException + */ + function sodium_crypto_secretstream_xchacha20poly1305_push(&$state, $msg, $aad = '', $tag = 0) + { + return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_push($state, $msg, $aad, $tag); + } +} +if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_init_pull')) { + /** + * @param string $header + * @param string $key + * @return string + * @throws Exception + */ + function sodium_crypto_secretstream_xchacha20poly1305_init_pull($header, $key) + { + return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_init_pull($header, $key); + } +} +if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_pull')) { + /** + * @param string $state + * @param string $cipher + * @param string $aad + * @return bool|array{0: string, 1: int} + * @throws SodiumException + */ + function sodium_crypto_secretstream_xchacha20poly1305_pull(&$state, $cipher, $aad = '') + { + return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_pull($state, $cipher, $aad); + } +} +if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_rekey')) { + /** + * @param string $state + * @return void + * @throws SodiumException + */ + function sodium_crypto_secretstream_xchacha20poly1305_rekey(&$state) + { + ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_rekey($state); + } +} +if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_keygen')) { + /** + * @return string + * @throws Exception + */ + function sodium_crypto_secretstream_xchacha20poly1305_keygen() + { + return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_keygen(); + } +} +if (!is_callable('sodium_crypto_shorthash')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_shorthash() + * @param string $message + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_shorthash($message, $key = '') + { + return ParagonIE_Sodium_Compat::crypto_shorthash($message, $key); + } +} +if (!is_callable('sodium_crypto_shorthash_keygen')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_shorthash_keygen() + * @return string + * @throws Exception + */ + function sodium_crypto_shorthash_keygen() + { + return ParagonIE_Sodium_Compat::crypto_shorthash_keygen(); + } +} +if (!is_callable('sodium_crypto_sign')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_sign() + * @param string $message + * @param string $sk + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_sign($message, $sk) + { + return ParagonIE_Sodium_Compat::crypto_sign($message, $sk); + } +} +if (!is_callable('sodium_crypto_sign_detached')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_sign_detached() + * @param string $message + * @param string $sk + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_sign_detached($message, $sk) + { + return ParagonIE_Sodium_Compat::crypto_sign_detached($message, $sk); + } +} +if (!is_callable('sodium_crypto_sign_keypair_from_secretkey_and_publickey')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_sign_keypair_from_secretkey_and_publickey() + * @param string $sk + * @param string $pk + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_sign_keypair_from_secretkey_and_publickey($sk, $pk) + { + return ParagonIE_Sodium_Compat::crypto_sign_keypair_from_secretkey_and_publickey($sk, $pk); + } +} +if (!is_callable('sodium_crypto_sign_keypair')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_sign_keypair() + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_sign_keypair() + { + return ParagonIE_Sodium_Compat::crypto_sign_keypair(); + } +} +if (!is_callable('sodium_crypto_sign_open')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_sign_open() + * @param string $signedMessage + * @param string $pk + * @return string|bool + */ + function sodium_crypto_sign_open($signedMessage, $pk) + { + try { + return ParagonIE_Sodium_Compat::crypto_sign_open($signedMessage, $pk); + } catch (Error $ex) { + return false; + } catch (Exception $ex) { + return false; + } + } +} +if (!is_callable('sodium_crypto_sign_publickey')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_sign_publickey() + * @param string $keypair + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_sign_publickey($keypair) + { + return ParagonIE_Sodium_Compat::crypto_sign_publickey($keypair); + } +} +if (!is_callable('sodium_crypto_sign_publickey_from_secretkey')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_sign_publickey_from_secretkey() + * @param string $sk + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_sign_publickey_from_secretkey($sk) + { + return ParagonIE_Sodium_Compat::crypto_sign_publickey_from_secretkey($sk); + } +} +if (!is_callable('sodium_crypto_sign_secretkey')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_sign_secretkey() + * @param string $keypair + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_sign_secretkey($keypair) + { + return ParagonIE_Sodium_Compat::crypto_sign_secretkey($keypair); + } +} +if (!is_callable('sodium_crypto_sign_seed_keypair')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_sign_seed_keypair() + * @param string $seed + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_sign_seed_keypair($seed) + { + return ParagonIE_Sodium_Compat::crypto_sign_seed_keypair($seed); + } +} +if (!is_callable('sodium_crypto_sign_verify_detached')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_sign_verify_detached() + * @param string $signature + * @param string $message + * @param string $pk + * @return bool + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_sign_verify_detached($signature, $message, $pk) + { + return ParagonIE_Sodium_Compat::crypto_sign_verify_detached($signature, $message, $pk); + } +} +if (!is_callable('sodium_crypto_sign_ed25519_pk_to_curve25519')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_sign_ed25519_pk_to_curve25519() + * @param string $pk + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_sign_ed25519_pk_to_curve25519($pk) + { + return ParagonIE_Sodium_Compat::crypto_sign_ed25519_pk_to_curve25519($pk); + } +} +if (!is_callable('sodium_crypto_sign_ed25519_sk_to_curve25519')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_sign_ed25519_sk_to_curve25519() + * @param string $sk + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_sign_ed25519_sk_to_curve25519($sk) + { + return ParagonIE_Sodium_Compat::crypto_sign_ed25519_sk_to_curve25519($sk); + } +} +if (!is_callable('sodium_crypto_stream')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_stream() + * @param int $len + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_stream($len, $nonce, $key) + { + return ParagonIE_Sodium_Compat::crypto_stream($len, $nonce, $key); + } +} +if (!is_callable('sodium_crypto_stream_keygen')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_stream_keygen() + * @return string + * @throws Exception + */ + function sodium_crypto_stream_keygen() + { + return ParagonIE_Sodium_Compat::crypto_stream_keygen(); + } +} +if (!is_callable('sodium_crypto_stream_xor')) { + /** + * @see ParagonIE_Sodium_Compat::crypto_stream_xor() + * @param string $message + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_crypto_stream_xor($message, $nonce, $key) + { + return ParagonIE_Sodium_Compat::crypto_stream_xor($message, $nonce, $key); + } +} +require_once dirname(__FILE__) . '/stream-xchacha20.php'; +if (!is_callable('sodium_hex2bin')) { + /** + * @see ParagonIE_Sodium_Compat::hex2bin() + * @param string $string + * @return string + * @throws SodiumException + * @throws TypeError + */ + function sodium_hex2bin($string) + { + return ParagonIE_Sodium_Compat::hex2bin($string); + } +} +if (!is_callable('sodium_increment')) { + /** + * @see ParagonIE_Sodium_Compat::increment() + * @param string $string + * @return void + * @throws SodiumException + * @throws TypeError + */ + function sodium_increment(&$string) + { + ParagonIE_Sodium_Compat::increment($string); + } +} +if (!is_callable('sodium_library_version_major')) { + /** + * @see ParagonIE_Sodium_Compat::library_version_major() + * @return int + */ + function sodium_library_version_major() + { + return ParagonIE_Sodium_Compat::library_version_major(); + } +} +if (!is_callable('sodium_library_version_minor')) { + /** + * @see ParagonIE_Sodium_Compat::library_version_minor() + * @return int + */ + function sodium_library_version_minor() + { + return ParagonIE_Sodium_Compat::library_version_minor(); + } +} +if (!is_callable('sodium_version_string')) { + /** + * @see ParagonIE_Sodium_Compat::version_string() + * @return string + */ + function sodium_version_string() + { + return ParagonIE_Sodium_Compat::version_string(); + } +} +if (!is_callable('sodium_memcmp')) { + /** + * @see ParagonIE_Sodium_Compat::memcmp() + * @param string $a + * @param string $b + * @return int + * @throws SodiumException + * @throws TypeError + */ + function sodium_memcmp($a, $b) + { + return ParagonIE_Sodium_Compat::memcmp($a, $b); + } +} +if (!is_callable('sodium_memzero')) { + /** + * @see ParagonIE_Sodium_Compat::memzero() + * @param string $str + * @return void + * @throws SodiumException + * @throws TypeError + */ + function sodium_memzero(&$str) + { + ParagonIE_Sodium_Compat::memzero($str); + } +} +if (!is_callable('sodium_pad')) { + /** + * @see ParagonIE_Sodium_Compat::pad() + * @param string $unpadded + * @param int $blockSize + * @return int + * @throws SodiumException + * @throws TypeError + */ + function sodium_pad($unpadded, $blockSize) + { + return ParagonIE_Sodium_Compat::pad($unpadded, $blockSize, true); + } +} +if (!is_callable('sodium_unpad')) { + /** + * @see ParagonIE_Sodium_Compat::pad() + * @param string $padded + * @param int $blockSize + * @return int + * @throws SodiumException + * @throws TypeError + */ + function sodium_unpad($padded, $blockSize) + { + return ParagonIE_Sodium_Compat::unpad($padded, $blockSize, true); + } +} +if (!is_callable('sodium_randombytes_buf')) { + /** + * @see ParagonIE_Sodium_Compat::randombytes_buf() + * @param int $amount + * @return string + * @throws Exception + */ + function sodium_randombytes_buf($amount) + { + return ParagonIE_Sodium_Compat::randombytes_buf($amount); + } +} + +if (!is_callable('sodium_randombytes_uniform')) { + /** + * @see ParagonIE_Sodium_Compat::randombytes_uniform() + * @param int $upperLimit + * @return int + * @throws Exception + */ + function sodium_randombytes_uniform($upperLimit) + { + return ParagonIE_Sodium_Compat::randombytes_uniform($upperLimit); + } +} + +if (!is_callable('sodium_randombytes_random16')) { + /** + * @see ParagonIE_Sodium_Compat::randombytes_random16() + * @return int + * @throws Exception + */ + function sodium_randombytes_random16() + { + return ParagonIE_Sodium_Compat::randombytes_random16(); + } +} diff --git a/vendor/paragonie/sodium_compat/lib/php72compat_const.php b/vendor/paragonie/sodium_compat/lib/php72compat_const.php new file mode 100644 index 0000000..0a076ca --- /dev/null +++ b/vendor/paragonie/sodium_compat/lib/php72compat_const.php @@ -0,0 +1,92 @@ + + + + + ./src + + + + + ./tests/unit + + + ./tests/compat + + + diff --git a/vendor/paragonie/sodium_compat/psalm-above-3.xml b/vendor/paragonie/sodium_compat/psalm-above-3.xml new file mode 100644 index 0000000..63b8c80 --- /dev/null +++ b/vendor/paragonie/sodium_compat/psalm-above-3.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vendor/paragonie/sodium_compat/psalm-below-3.xml b/vendor/paragonie/sodium_compat/psalm-below-3.xml new file mode 100644 index 0000000..0da3cd9 --- /dev/null +++ b/vendor/paragonie/sodium_compat/psalm-below-3.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vendor/paragonie/sodium_compat/src/Compat.php b/vendor/paragonie/sodium_compat/src/Compat.php new file mode 100644 index 0000000..286d37e --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Compat.php @@ -0,0 +1,3947 @@ +>= 8; + } + $val = ParagonIE_Sodium_Core_Util::intArrayToString($A); + } + + /** + * @param string $encoded + * @param int $variant + * @param string $ignore + * @return string + * @throws SodiumException + */ + public static function base642bin($encoded, $variant, $ignore = '') + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($encoded, 'string', 1); + + /** @var string $encoded */ + $encoded = (string) $encoded; + if (ParagonIE_Sodium_Core_Util::strlen($encoded) === 0) { + return ''; + } + + // Just strip before decoding + if (!empty($ignore)) { + $encoded = str_replace($ignore, '', $encoded); + } + + try { + switch ($variant) { + case self::BASE64_VARIANT_ORIGINAL: + return ParagonIE_Sodium_Core_Base64_Original::decode($encoded, true); + case self::BASE64_VARIANT_ORIGINAL_NO_PADDING: + return ParagonIE_Sodium_Core_Base64_Original::decode($encoded, false); + case self::BASE64_VARIANT_URLSAFE: + return ParagonIE_Sodium_Core_Base64_UrlSafe::decode($encoded, true); + case self::BASE64_VARIANT_URLSAFE_NO_PADDING: + return ParagonIE_Sodium_Core_Base64_UrlSafe::decode($encoded, false); + default: + throw new SodiumException('invalid base64 variant identifier'); + } + } catch (Exception $ex) { + if ($ex instanceof SodiumException) { + throw $ex; + } + throw new SodiumException('invalid base64 string'); + } + } + + /** + * @param string $decoded + * @param int $variant + * @return string + * @throws SodiumException + */ + public static function bin2base64($decoded, $variant) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($decoded, 'string', 1); + /** @var string $decoded */ + $decoded = (string) $decoded; + if (ParagonIE_Sodium_Core_Util::strlen($decoded) === 0) { + return ''; + } + + switch ($variant) { + case self::BASE64_VARIANT_ORIGINAL: + return ParagonIE_Sodium_Core_Base64_Original::encode($decoded); + case self::BASE64_VARIANT_ORIGINAL_NO_PADDING: + return ParagonIE_Sodium_Core_Base64_Original::encodeUnpadded($decoded); + case self::BASE64_VARIANT_URLSAFE: + return ParagonIE_Sodium_Core_Base64_UrlSafe::encode($decoded); + case self::BASE64_VARIANT_URLSAFE_NO_PADDING: + return ParagonIE_Sodium_Core_Base64_UrlSafe::encodeUnpadded($decoded); + default: + throw new SodiumException('invalid base64 variant identifier'); + } + } + + /** + * Cache-timing-safe implementation of bin2hex(). + * + * @param string $string A string (probably raw binary) + * @return string A hexadecimal-encoded string + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function bin2hex($string) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($string, 'string', 1); + + if (self::useNewSodiumAPI()) { + return (string) sodium_bin2hex($string); + } + if (self::use_fallback('bin2hex')) { + return (string) call_user_func('\\Sodium\\bin2hex', $string); + } + return ParagonIE_Sodium_Core_Util::bin2hex($string); + } + + /** + * Compare two strings, in constant-time. + * Compared to memcmp(), compare() is more useful for sorting. + * + * @param string $left The left operand; must be a string + * @param string $right The right operand; must be a string + * @return int If < 0 if the left operand is less than the right + * If = 0 if both strings are equal + * If > 0 if the right operand is less than the left + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function compare($left, $right) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($left, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($right, 'string', 2); + + if (self::useNewSodiumAPI()) { + return (int) sodium_compare($left, $right); + } + if (self::use_fallback('compare')) { + return (int) call_user_func('\\Sodium\\compare', $left, $right); + } + return ParagonIE_Sodium_Core_Util::compare($left, $right); + } + + /** + * Is AES-256-GCM even available to use? + * + * @return bool + * @psalm-suppress UndefinedFunction + * @psalm-suppress MixedInferredReturnType + * @psalm-suppress MixedReturnStatement + */ + public static function crypto_aead_aes256gcm_is_available() + { + if (self::useNewSodiumAPI()) { + return sodium_crypto_aead_aes256gcm_is_available(); + } + if (self::use_fallback('crypto_aead_aes256gcm_is_available')) { + return call_user_func('\\Sodium\\crypto_aead_aes256gcm_is_available'); + } + if (PHP_VERSION_ID < 70100) { + // OpenSSL doesn't support AEAD before 7.1.0 + return false; + } + if (!is_callable('openssl_encrypt') || !is_callable('openssl_decrypt')) { + // OpenSSL isn't installed + return false; + } + return (bool) in_array('aes-256-gcm', openssl_get_cipher_methods()); + } + + /** + * Authenticated Encryption with Associated Data: Decryption + * + * Algorithm: + * AES-256-GCM + * + * This mode uses a 64-bit random nonce with a 64-bit counter. + * IETF mode uses a 96-bit random nonce with a 32-bit counter. + * + * @param string $ciphertext Encrypted message (with Poly1305 MAC appended) + * @param string $assocData Authenticated Associated Data (unencrypted) + * @param string $nonce Number to be used only Once; must be 8 bytes + * @param string $key Encryption key + * + * @return string|bool The original plaintext message + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedInferredReturnType + * @psalm-suppress MixedReturnStatement + */ + public static function crypto_aead_aes256gcm_decrypt( + $ciphertext = '', + $assocData = '', + $nonce = '', + $key = '' + ) { + if (!self::crypto_aead_aes256gcm_is_available()) { + throw new SodiumException('AES-256-GCM is not available'); + } + ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3); + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_AES256GCM_NPUBBYTES) { + throw new SodiumException('Nonce must be CRYPTO_AEAD_AES256GCM_NPUBBYTES long'); + } + if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_AES256GCM_KEYBYTES) { + throw new SodiumException('Key must be CRYPTO_AEAD_AES256GCM_KEYBYTES long'); + } + if (ParagonIE_Sodium_Core_Util::strlen($ciphertext) < self::CRYPTO_AEAD_AES256GCM_ABYTES) { + throw new SodiumException('Message must be at least CRYPTO_AEAD_AES256GCM_ABYTES long'); + } + if (!is_callable('openssl_decrypt')) { + throw new SodiumException('The OpenSSL extension is not installed, or openssl_decrypt() is not available'); + } + + /** @var string $ctext */ + $ctext = ParagonIE_Sodium_Core_Util::substr($ciphertext, 0, -self::CRYPTO_AEAD_AES256GCM_ABYTES); + /** @var string $authTag */ + $authTag = ParagonIE_Sodium_Core_Util::substr($ciphertext, -self::CRYPTO_AEAD_AES256GCM_ABYTES, 16); + return openssl_decrypt( + $ctext, + 'aes-256-gcm', + $key, + OPENSSL_RAW_DATA, + $nonce, + $authTag, + $assocData + ); + } + + /** + * Authenticated Encryption with Associated Data: Encryption + * + * Algorithm: + * AES-256-GCM + * + * @param string $plaintext Message to be encrypted + * @param string $assocData Authenticated Associated Data (unencrypted) + * @param string $nonce Number to be used only Once; must be 8 bytes + * @param string $key Encryption key + * + * @return string Ciphertext with a 16-byte GCM message + * authentication code appended + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_aead_aes256gcm_encrypt( + $plaintext = '', + $assocData = '', + $nonce = '', + $key = '' + ) { + if (!self::crypto_aead_aes256gcm_is_available()) { + throw new SodiumException('AES-256-GCM is not available'); + } + ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3); + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_AES256GCM_NPUBBYTES) { + throw new SodiumException('Nonce must be CRYPTO_AEAD_AES256GCM_NPUBBYTES long'); + } + if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_AES256GCM_KEYBYTES) { + throw new SodiumException('Key must be CRYPTO_AEAD_AES256GCM_KEYBYTES long'); + } + + if (!is_callable('openssl_encrypt')) { + throw new SodiumException('The OpenSSL extension is not installed, or openssl_encrypt() is not available'); + } + + $authTag = ''; + $ciphertext = openssl_encrypt( + $plaintext, + 'aes-256-gcm', + $key, + OPENSSL_RAW_DATA, + $nonce, + $authTag, + $assocData + ); + return $ciphertext . $authTag; + } + + /** + * Return a secure random key for use with the AES-256-GCM + * symmetric AEAD interface. + * + * @return string + * @throws Exception + * @throws Error + */ + public static function crypto_aead_aes256gcm_keygen() + { + return random_bytes(self::CRYPTO_AEAD_AES256GCM_KEYBYTES); + } + + /** + * Authenticated Encryption with Associated Data: Decryption + * + * Algorithm: + * ChaCha20-Poly1305 + * + * This mode uses a 64-bit random nonce with a 64-bit counter. + * IETF mode uses a 96-bit random nonce with a 32-bit counter. + * + * @param string $ciphertext Encrypted message (with Poly1305 MAC appended) + * @param string $assocData Authenticated Associated Data (unencrypted) + * @param string $nonce Number to be used only Once; must be 8 bytes + * @param string $key Encryption key + * + * @return string The original plaintext message + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedInferredReturnType + * @psalm-suppress MixedReturnStatement + */ + public static function crypto_aead_chacha20poly1305_decrypt( + $ciphertext = '', + $assocData = '', + $nonce = '', + $key = '' + ) { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3); + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES) { + throw new SodiumException('Nonce must be CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES long'); + } + if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES) { + throw new SodiumException('Key must be CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES long'); + } + if (ParagonIE_Sodium_Core_Util::strlen($ciphertext) < self::CRYPTO_AEAD_CHACHA20POLY1305_ABYTES) { + throw new SodiumException('Message must be at least CRYPTO_AEAD_CHACHA20POLY1305_ABYTES long'); + } + + if (self::useNewSodiumAPI()) { + /** + * @psalm-suppress InvalidReturnStatement + * @psalm-suppress FalsableReturnStatement + */ + return sodium_crypto_aead_chacha20poly1305_decrypt( + $ciphertext, + $assocData, + $nonce, + $key + ); + } + if (self::use_fallback('crypto_aead_chacha20poly1305_decrypt')) { + return call_user_func( + '\\Sodium\\crypto_aead_chacha20poly1305_decrypt', + $ciphertext, + $assocData, + $nonce, + $key + ); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::aead_chacha20poly1305_decrypt( + $ciphertext, + $assocData, + $nonce, + $key + ); + } + return ParagonIE_Sodium_Crypto::aead_chacha20poly1305_decrypt( + $ciphertext, + $assocData, + $nonce, + $key + ); + } + + /** + * Authenticated Encryption with Associated Data + * + * Algorithm: + * ChaCha20-Poly1305 + * + * This mode uses a 64-bit random nonce with a 64-bit counter. + * IETF mode uses a 96-bit random nonce with a 32-bit counter. + * + * @param string $plaintext Message to be encrypted + * @param string $assocData Authenticated Associated Data (unencrypted) + * @param string $nonce Number to be used only Once; must be 8 bytes + * @param string $key Encryption key + * + * @return string Ciphertext with a 16-byte Poly1305 message + * authentication code appended + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_aead_chacha20poly1305_encrypt( + $plaintext = '', + $assocData = '', + $nonce = '', + $key = '' + ) { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3); + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES) { + throw new SodiumException('Nonce must be CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES long'); + } + if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES) { + throw new SodiumException('Key must be CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES long'); + } + + if (self::useNewSodiumAPI()) { + return (string) sodium_crypto_aead_chacha20poly1305_encrypt( + $plaintext, + $assocData, + $nonce, + $key + ); + } + if (self::use_fallback('crypto_aead_chacha20poly1305_encrypt')) { + return (string) call_user_func( + '\\Sodium\\crypto_aead_chacha20poly1305_encrypt', + $plaintext, + $assocData, + $nonce, + $key + ); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::aead_chacha20poly1305_encrypt( + $plaintext, + $assocData, + $nonce, + $key + ); + } + return ParagonIE_Sodium_Crypto::aead_chacha20poly1305_encrypt( + $plaintext, + $assocData, + $nonce, + $key + ); + } + + /** + * Authenticated Encryption with Associated Data: Decryption + * + * Algorithm: + * ChaCha20-Poly1305 + * + * IETF mode uses a 96-bit random nonce with a 32-bit counter. + * Regular mode uses a 64-bit random nonce with a 64-bit counter. + * + * @param string $ciphertext Encrypted message (with Poly1305 MAC appended) + * @param string $assocData Authenticated Associated Data (unencrypted) + * @param string $nonce Number to be used only Once; must be 12 bytes + * @param string $key Encryption key + * + * @return string The original plaintext message + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedInferredReturnType + * @psalm-suppress MixedReturnStatement + */ + public static function crypto_aead_chacha20poly1305_ietf_decrypt( + $ciphertext = '', + $assocData = '', + $nonce = '', + $key = '' + ) { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3); + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES) { + throw new SodiumException('Nonce must be CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES long'); + } + if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES) { + throw new SodiumException('Key must be CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES long'); + } + if (ParagonIE_Sodium_Core_Util::strlen($ciphertext) < self::CRYPTO_AEAD_CHACHA20POLY1305_ABYTES) { + throw new SodiumException('Message must be at least CRYPTO_AEAD_CHACHA20POLY1305_ABYTES long'); + } + + if (self::useNewSodiumAPI()) { + /** + * @psalm-suppress InvalidReturnStatement + * @psalm-suppress FalsableReturnStatement + */ + return sodium_crypto_aead_chacha20poly1305_ietf_decrypt( + $ciphertext, + $assocData, + $nonce, + $key + ); + } + if (self::use_fallback('crypto_aead_chacha20poly1305_ietf_decrypt')) { + return call_user_func( + '\\Sodium\\crypto_aead_chacha20poly1305_ietf_decrypt', + $ciphertext, + $assocData, + $nonce, + $key + ); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::aead_chacha20poly1305_ietf_decrypt( + $ciphertext, + $assocData, + $nonce, + $key + ); + } + return ParagonIE_Sodium_Crypto::aead_chacha20poly1305_ietf_decrypt( + $ciphertext, + $assocData, + $nonce, + $key + ); + } + + /** + * Return a secure random key for use with the ChaCha20-Poly1305 + * symmetric AEAD interface. + * + * @return string + * @throws Exception + * @throws Error + */ + public static function crypto_aead_chacha20poly1305_keygen() + { + return random_bytes(self::CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES); + } + + /** + * Authenticated Encryption with Associated Data + * + * Algorithm: + * ChaCha20-Poly1305 + * + * IETF mode uses a 96-bit random nonce with a 32-bit counter. + * Regular mode uses a 64-bit random nonce with a 64-bit counter. + * + * @param string $plaintext Message to be encrypted + * @param string $assocData Authenticated Associated Data (unencrypted) + * @param string $nonce Number to be used only Once; must be 8 bytes + * @param string $key Encryption key + * + * @return string Ciphertext with a 16-byte Poly1305 message + * authentication code appended + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_aead_chacha20poly1305_ietf_encrypt( + $plaintext = '', + $assocData = '', + $nonce = '', + $key = '' + ) { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1); + if (!is_null($assocData)) { + ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2); + } + ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3); + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES) { + throw new SodiumException('Nonce must be CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES long'); + } + if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES) { + throw new SodiumException('Key must be CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES long'); + } + + if (self::useNewSodiumAPI()) { + return (string) sodium_crypto_aead_chacha20poly1305_ietf_encrypt( + $plaintext, + $assocData, + $nonce, + $key + ); + } + if (self::use_fallback('crypto_aead_chacha20poly1305_ietf_encrypt')) { + return (string) call_user_func( + '\\Sodium\\crypto_aead_chacha20poly1305_ietf_encrypt', + $plaintext, + $assocData, + $nonce, + $key + ); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::aead_chacha20poly1305_ietf_encrypt( + $plaintext, + $assocData, + $nonce, + $key + ); + } + return ParagonIE_Sodium_Crypto::aead_chacha20poly1305_ietf_encrypt( + $plaintext, + $assocData, + $nonce, + $key + ); + } + + /** + * Return a secure random key for use with the ChaCha20-Poly1305 + * symmetric AEAD interface. (IETF version) + * + * @return string + * @throws Exception + * @throws Error + */ + public static function crypto_aead_chacha20poly1305_ietf_keygen() + { + return random_bytes(self::CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES); + } + + /** + * Authenticated Encryption with Associated Data: Decryption + * + * Algorithm: + * XChaCha20-Poly1305 + * + * This mode uses a 64-bit random nonce with a 64-bit counter. + * IETF mode uses a 96-bit random nonce with a 32-bit counter. + * + * @param string $ciphertext Encrypted message (with Poly1305 MAC appended) + * @param string $assocData Authenticated Associated Data (unencrypted) + * @param string $nonce Number to be used only Once; must be 8 bytes + * @param string $key Encryption key + * @param bool $dontFallback Don't fallback to ext/sodium + * + * @return string|bool The original plaintext message + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_aead_xchacha20poly1305_ietf_decrypt( + $ciphertext = '', + $assocData = '', + $nonce = '', + $key = '', + $dontFallback = false + ) { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); + if (!is_null($assocData)) { + ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2); + } else { + $assocData = ''; + } + ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3); + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES) { + throw new SodiumException('Nonce must be CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES long'); + } + if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES) { + throw new SodiumException('Key must be CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES long'); + } + if (ParagonIE_Sodium_Core_Util::strlen($ciphertext) < self::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES) { + throw new SodiumException('Message must be at least CRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES long'); + } + if (self::useNewSodiumAPI() && !$dontFallback) { + if (is_callable('sodium_crypto_aead_xchacha20poly1305_ietf_decrypt')) { + return sodium_crypto_aead_xchacha20poly1305_ietf_decrypt( + $ciphertext, + $assocData, + $nonce, + $key + ); + } + } + + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::aead_xchacha20poly1305_ietf_decrypt( + $ciphertext, + $assocData, + $nonce, + $key + ); + } + return ParagonIE_Sodium_Crypto::aead_xchacha20poly1305_ietf_decrypt( + $ciphertext, + $assocData, + $nonce, + $key + ); + } + + /** + * Authenticated Encryption with Associated Data + * + * Algorithm: + * XChaCha20-Poly1305 + * + * This mode uses a 64-bit random nonce with a 64-bit counter. + * IETF mode uses a 96-bit random nonce with a 32-bit counter. + * + * @param string $plaintext Message to be encrypted + * @param string $assocData Authenticated Associated Data (unencrypted) + * @param string $nonce Number to be used only Once; must be 8 bytes + * @param string $key Encryption key + * @param bool $dontFallback Don't fallback to ext/sodium + * + * @return string Ciphertext with a 16-byte Poly1305 message + * authentication code appended + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_aead_xchacha20poly1305_ietf_encrypt( + $plaintext = '', + $assocData = '', + $nonce = '', + $key = '', + $dontFallback = false + ) { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1); + if (!is_null($assocData)) { + ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2); + } else { + $assocData = ''; + } + ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3); + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES) { + throw new SodiumException('Nonce must be CRYPTO_AEAD_XCHACHA20POLY1305_NPUBBYTES long'); + } + if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES) { + throw new SodiumException('Key must be CRYPTO_AEAD_XCHACHA20POLY1305_KEYBYTES long'); + } + if (self::useNewSodiumAPI() && !$dontFallback) { + if (is_callable('sodium_crypto_aead_xchacha20poly1305_ietf_encrypt')) { + return sodium_crypto_aead_xchacha20poly1305_ietf_encrypt( + $plaintext, + $assocData, + $nonce, + $key + ); + } + } + + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::aead_xchacha20poly1305_ietf_encrypt( + $plaintext, + $assocData, + $nonce, + $key + ); + } + return ParagonIE_Sodium_Crypto::aead_xchacha20poly1305_ietf_encrypt( + $plaintext, + $assocData, + $nonce, + $key + ); + } + + /** + * Return a secure random key for use with the XChaCha20-Poly1305 + * symmetric AEAD interface. + * + * @return string + * @throws Exception + * @throws Error + */ + public static function crypto_aead_xchacha20poly1305_ietf_keygen() + { + return random_bytes(self::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES); + } + + /** + * Authenticate a message. Uses symmetric-key cryptography. + * + * Algorithm: + * HMAC-SHA512-256. Which is HMAC-SHA-512 truncated to 256 bits. + * Not to be confused with HMAC-SHA-512/256 which would use the + * SHA-512/256 hash function (uses different initial parameters + * but still truncates to 256 bits to sidestep length-extension + * attacks). + * + * @param string $message Message to be authenticated + * @param string $key Symmetric authentication key + * @return string Message authentication code + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_auth($message, $key) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 2); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AUTH_KEYBYTES) { + throw new SodiumException('Argument 2 must be CRYPTO_AUTH_KEYBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + return (string) sodium_crypto_auth($message, $key); + } + if (self::use_fallback('crypto_auth')) { + return (string) call_user_func('\\Sodium\\crypto_auth', $message, $key); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::auth($message, $key); + } + return ParagonIE_Sodium_Crypto::auth($message, $key); + } + + /** + * @return string + * @throws Exception + * @throws Error + */ + public static function crypto_auth_keygen() + { + return random_bytes(self::CRYPTO_AUTH_KEYBYTES); + } + + /** + * Verify the MAC of a message previously authenticated with crypto_auth. + * + * @param string $mac Message authentication code + * @param string $message Message whose authenticity you are attempting to + * verify (with a given MAC and key) + * @param string $key Symmetric authentication key + * @return bool TRUE if authenticated, FALSE otherwise + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_auth_verify($mac, $message, $key) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($mac, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($mac) !== self::CRYPTO_AUTH_BYTES) { + throw new SodiumException('Argument 1 must be CRYPTO_AUTH_BYTES long.'); + } + if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AUTH_KEYBYTES) { + throw new SodiumException('Argument 3 must be CRYPTO_AUTH_KEYBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + return (bool) sodium_crypto_auth_verify($mac, $message, $key); + } + if (self::use_fallback('crypto_auth_verify')) { + return (bool) call_user_func('\\Sodium\\crypto_auth_verify', $mac, $message, $key); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::auth_verify($mac, $message, $key); + } + return ParagonIE_Sodium_Crypto::auth_verify($mac, $message, $key); + } + + /** + * Authenticated asymmetric-key encryption. Both the sender and recipient + * may decrypt messages. + * + * Algorithm: X25519-XSalsa20-Poly1305. + * X25519: Elliptic-Curve Diffie Hellman over Curve25519. + * XSalsa20: Extended-nonce variant of salsa20. + * Poyl1305: Polynomial MAC for one-time message authentication. + * + * @param string $plaintext The message to be encrypted + * @param string $nonce A Number to only be used Once; must be 24 bytes + * @param string $keypair Your secret key and your recipient's public key + * @return string Ciphertext with 16-byte Poly1305 MAC + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_box($plaintext, $nonce, $keypair) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 3); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_BOX_NONCEBYTES) { + throw new SodiumException('Argument 2 must be CRYPTO_BOX_NONCEBYTES long.'); + } + if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_BOX_KEYPAIRBYTES) { + throw new SodiumException('Argument 3 must be CRYPTO_BOX_KEYPAIRBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + return (string) sodium_crypto_box($plaintext, $nonce, $keypair); + } + if (self::use_fallback('crypto_box')) { + return (string) call_user_func('\\Sodium\\crypto_box', $plaintext, $nonce, $keypair); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::box($plaintext, $nonce, $keypair); + } + return ParagonIE_Sodium_Crypto::box($plaintext, $nonce, $keypair); + } + + /** + * Anonymous public-key encryption. Only the recipient may decrypt messages. + * + * Algorithm: X25519-XSalsa20-Poly1305, as with crypto_box. + * The sender's X25519 keypair is ephemeral. + * Nonce is generated from the BLAKE2b hash of both public keys. + * + * This provides ciphertext integrity. + * + * @param string $plaintext Message to be sealed + * @param string $publicKey Your recipient's public key + * @return string Sealed message that only your recipient can + * decrypt + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_box_seal($plaintext, $publicKey) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($publicKey, 'string', 2); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($publicKey) !== self::CRYPTO_BOX_PUBLICKEYBYTES) { + throw new SodiumException('Argument 2 must be CRYPTO_BOX_PUBLICKEYBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + return (string) sodium_crypto_box_seal($plaintext, $publicKey); + } + if (self::use_fallback('crypto_box_seal')) { + return (string) call_user_func('\\Sodium\\crypto_box_seal', $plaintext, $publicKey); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::box_seal($plaintext, $publicKey); + } + return ParagonIE_Sodium_Crypto::box_seal($plaintext, $publicKey); + } + + /** + * Opens a message encrypted with crypto_box_seal(). Requires + * the recipient's keypair (sk || pk) to decrypt successfully. + * + * This validates ciphertext integrity. + * + * @param string $ciphertext Sealed message to be opened + * @param string $keypair Your crypto_box keypair + * @return string The original plaintext message + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedInferredReturnType + * @psalm-suppress MixedReturnStatement + */ + public static function crypto_box_seal_open($ciphertext, $keypair) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 2); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_BOX_KEYPAIRBYTES) { + throw new SodiumException('Argument 2 must be CRYPTO_BOX_KEYPAIRBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + /** + * @psalm-suppress InvalidReturnStatement + * @psalm-suppress FalsableReturnStatement + */ + return sodium_crypto_box_seal_open($ciphertext, $keypair); + } + if (self::use_fallback('crypto_box_seal_open')) { + return call_user_func('\\Sodium\\crypto_box_seal_open', $ciphertext, $keypair); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::box_seal_open($ciphertext, $keypair); + } + return ParagonIE_Sodium_Crypto::box_seal_open($ciphertext, $keypair); + } + + /** + * Generate a new random X25519 keypair. + * + * @return string A 64-byte string; the first 32 are your secret key, while + * the last 32 are your public key. crypto_box_secretkey() + * and crypto_box_publickey() exist to separate them so you + * don't accidentally get them mixed up! + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_box_keypair() + { + if (self::useNewSodiumAPI()) { + return (string) sodium_crypto_box_keypair(); + } + if (self::use_fallback('crypto_box_keypair')) { + return (string) call_user_func('\\Sodium\\crypto_box_keypair'); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::box_keypair(); + } + return ParagonIE_Sodium_Crypto::box_keypair(); + } + + /** + * Combine two keys into a keypair for use in library methods that expect + * a keypair. This doesn't necessarily have to be the same person's keys. + * + * @param string $secretKey Secret key + * @param string $publicKey Public key + * @return string Keypair + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_box_keypair_from_secretkey_and_publickey($secretKey, $publicKey) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($publicKey, 'string', 2); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_BOX_SECRETKEYBYTES) { + throw new SodiumException('Argument 1 must be CRYPTO_BOX_SECRETKEYBYTES long.'); + } + if (ParagonIE_Sodium_Core_Util::strlen($publicKey) !== self::CRYPTO_BOX_PUBLICKEYBYTES) { + throw new SodiumException('Argument 2 must be CRYPTO_BOX_PUBLICKEYBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + return (string) sodium_crypto_box_keypair_from_secretkey_and_publickey($secretKey, $publicKey); + } + if (self::use_fallback('crypto_box_keypair_from_secretkey_and_publickey')) { + return (string) call_user_func('\\Sodium\\crypto_box_keypair_from_secretkey_and_publickey', $secretKey, $publicKey); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::box_keypair_from_secretkey_and_publickey($secretKey, $publicKey); + } + return ParagonIE_Sodium_Crypto::box_keypair_from_secretkey_and_publickey($secretKey, $publicKey); + } + + /** + * Decrypt a message previously encrypted with crypto_box(). + * + * @param string $ciphertext Encrypted message + * @param string $nonce Number to only be used Once; must be 24 bytes + * @param string $keypair Your secret key and the sender's public key + * @return string The original plaintext message + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedInferredReturnType + * @psalm-suppress MixedReturnStatement + */ + public static function crypto_box_open($ciphertext, $nonce, $keypair) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 3); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($ciphertext) < self::CRYPTO_BOX_MACBYTES) { + throw new SodiumException('Argument 1 must be at least CRYPTO_BOX_MACBYTES long.'); + } + if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_BOX_NONCEBYTES) { + throw new SodiumException('Argument 2 must be CRYPTO_BOX_NONCEBYTES long.'); + } + if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_BOX_KEYPAIRBYTES) { + throw new SodiumException('Argument 3 must be CRYPTO_BOX_KEYPAIRBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + /** + * @psalm-suppress InvalidReturnStatement + * @psalm-suppress FalsableReturnStatement + */ + return sodium_crypto_box_open($ciphertext, $nonce, $keypair); + } + if (self::use_fallback('crypto_box_open')) { + return call_user_func('\\Sodium\\crypto_box_open', $ciphertext, $nonce, $keypair); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::box_open($ciphertext, $nonce, $keypair); + } + return ParagonIE_Sodium_Crypto::box_open($ciphertext, $nonce, $keypair); + } + + /** + * Extract the public key from a crypto_box keypair. + * + * @param string $keypair Keypair containing secret and public key + * @return string Your crypto_box public key + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_box_publickey($keypair) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_BOX_KEYPAIRBYTES) { + throw new SodiumException('Argument 1 must be CRYPTO_BOX_KEYPAIRBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + return (string) sodium_crypto_box_publickey($keypair); + } + if (self::use_fallback('crypto_box_publickey')) { + return (string) call_user_func('\\Sodium\\crypto_box_publickey', $keypair); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::box_publickey($keypair); + } + return ParagonIE_Sodium_Crypto::box_publickey($keypair); + } + + /** + * Calculate the X25519 public key from a given X25519 secret key. + * + * @param string $secretKey Any X25519 secret key + * @return string The corresponding X25519 public key + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_box_publickey_from_secretkey($secretKey) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_BOX_SECRETKEYBYTES) { + throw new SodiumException('Argument 1 must be CRYPTO_BOX_SECRETKEYBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + return (string) sodium_crypto_box_publickey_from_secretkey($secretKey); + } + if (self::use_fallback('crypto_box_publickey_from_secretkey')) { + return (string) call_user_func('\\Sodium\\crypto_box_publickey_from_secretkey', $secretKey); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::box_publickey_from_secretkey($secretKey); + } + return ParagonIE_Sodium_Crypto::box_publickey_from_secretkey($secretKey); + } + + /** + * Extract the secret key from a crypto_box keypair. + * + * @param string $keypair + * @return string Your crypto_box secret key + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_box_secretkey($keypair) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_BOX_KEYPAIRBYTES) { + throw new SodiumException('Argument 1 must be CRYPTO_BOX_KEYPAIRBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + return (string) sodium_crypto_box_secretkey($keypair); + } + if (self::use_fallback('crypto_box_secretkey')) { + return (string) call_user_func('\\Sodium\\crypto_box_secretkey', $keypair); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::box_secretkey($keypair); + } + return ParagonIE_Sodium_Crypto::box_secretkey($keypair); + } + + /** + * Generate an X25519 keypair from a seed. + * + * @param string $seed + * @return string + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress UndefinedFunction + */ + public static function crypto_box_seed_keypair($seed) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($seed, 'string', 1); + + if (self::useNewSodiumAPI()) { + return (string) sodium_crypto_box_seed_keypair($seed); + } + if (self::use_fallback('crypto_box_seed_keypair')) { + return (string) call_user_func('\\Sodium\\crypto_box_seed_keypair', $seed); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::box_seed_keypair($seed); + } + return ParagonIE_Sodium_Crypto::box_seed_keypair($seed); + } + + /** + * Calculates a BLAKE2b hash, with an optional key. + * + * @param string $message The message to be hashed + * @param string|null $key If specified, must be a string between 16 + * and 64 bytes long + * @param int $length Output length in bytes; must be between 16 + * and 64 (default = 32) + * @return string Raw binary + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_generichash($message, $key = '', $length = self::CRYPTO_GENERICHASH_BYTES) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); + if (is_null($key)) { + $key = ''; + } + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($length, 'int', 3); + + /* Input validation: */ + if (!empty($key)) { + if (ParagonIE_Sodium_Core_Util::strlen($key) < self::CRYPTO_GENERICHASH_KEYBYTES_MIN) { + throw new SodiumException('Unsupported key size. Must be at least CRYPTO_GENERICHASH_KEYBYTES_MIN bytes long.'); + } + if (ParagonIE_Sodium_Core_Util::strlen($key) > self::CRYPTO_GENERICHASH_KEYBYTES_MAX) { + throw new SodiumException('Unsupported key size. Must be at most CRYPTO_GENERICHASH_KEYBYTES_MAX bytes long.'); + } + } + + if (self::useNewSodiumAPI()) { + return (string) sodium_crypto_generichash($message, $key, $length); + } + if (self::use_fallback('crypto_generichash')) { + return (string) call_user_func('\\Sodium\\crypto_generichash', $message, $key, $length); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::generichash($message, $key, $length); + } + return ParagonIE_Sodium_Crypto::generichash($message, $key, $length); + } + + /** + * Get the final BLAKE2b hash output for a given context. + * + * @param string $ctx BLAKE2 hashing context. Generated by crypto_generichash_init(). + * @param int $length Hash output size. + * @return string Final BLAKE2b hash. + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress ReferenceConstraintViolation + * @psalm-suppress ConflictingReferenceConstraint + */ + public static function crypto_generichash_final(&$ctx, $length = self::CRYPTO_GENERICHASH_BYTES) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($ctx, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($length, 'int', 2); + + if (self::useNewSodiumAPI()) { + return sodium_crypto_generichash_final($ctx, $length); + } + if (self::use_fallback('crypto_generichash_final')) { + $func = '\\Sodium\\crypto_generichash_final'; + return (string) $func($ctx, $length); + } + if ($length < 1) { + try { + self::memzero($ctx); + } catch (SodiumException $ex) { + unset($ctx); + } + return ''; + } + if (PHP_INT_SIZE === 4) { + $result = ParagonIE_Sodium_Crypto32::generichash_final($ctx, $length); + } else { + $result = ParagonIE_Sodium_Crypto::generichash_final($ctx, $length); + } + try { + self::memzero($ctx); + } catch (SodiumException $ex) { + unset($ctx); + } + return $result; + } + + /** + * Initialize a BLAKE2b hashing context, for use in a streaming interface. + * + * @param string|null $key If specified must be a string between 16 and 64 bytes + * @param int $length The size of the desired hash output + * @return string A BLAKE2 hashing context, encoded as a string + * (To be 100% compatible with ext/libsodium) + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_generichash_init($key = '', $length = self::CRYPTO_GENERICHASH_BYTES) + { + /* Type checks: */ + if (is_null($key)) { + $key = ''; + } + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($length, 'int', 2); + + /* Input validation: */ + if (!empty($key)) { + if (ParagonIE_Sodium_Core_Util::strlen($key) < self::CRYPTO_GENERICHASH_KEYBYTES_MIN) { + throw new SodiumException('Unsupported key size. Must be at least CRYPTO_GENERICHASH_KEYBYTES_MIN bytes long.'); + } + if (ParagonIE_Sodium_Core_Util::strlen($key) > self::CRYPTO_GENERICHASH_KEYBYTES_MAX) { + throw new SodiumException('Unsupported key size. Must be at most CRYPTO_GENERICHASH_KEYBYTES_MAX bytes long.'); + } + } + + if (self::useNewSodiumAPI()) { + return sodium_crypto_generichash_init($key, $length); + } + if (self::use_fallback('crypto_generichash_init')) { + return (string) call_user_func('\\Sodium\\crypto_generichash_init', $key, $length); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::generichash_init($key, $length); + } + return ParagonIE_Sodium_Crypto::generichash_init($key, $length); + } + + /** + * Initialize a BLAKE2b hashing context, for use in a streaming interface. + * + * @param string|null $key If specified must be a string between 16 and 64 bytes + * @param int $length The size of the desired hash output + * @param string $salt Salt (up to 16 bytes) + * @param string $personal Personalization string (up to 16 bytes) + * @return string A BLAKE2 hashing context, encoded as a string + * (To be 100% compatible with ext/libsodium) + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_generichash_init_salt_personal( + $key = '', + $length = self::CRYPTO_GENERICHASH_BYTES, + $salt = '', + $personal = '' + ) { + /* Type checks: */ + if (is_null($key)) { + $key = ''; + } + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($length, 'int', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($salt, 'string', 3); + ParagonIE_Sodium_Core_Util::declareScalarType($personal, 'string', 4); + $salt = str_pad($salt, 16, "\0", STR_PAD_RIGHT); + $personal = str_pad($personal, 16, "\0", STR_PAD_RIGHT); + + /* Input validation: */ + if (!empty($key)) { + /* + if (ParagonIE_Sodium_Core_Util::strlen($key) < self::CRYPTO_GENERICHASH_KEYBYTES_MIN) { + throw new SodiumException('Unsupported key size. Must be at least CRYPTO_GENERICHASH_KEYBYTES_MIN bytes long.'); + } + */ + if (ParagonIE_Sodium_Core_Util::strlen($key) > self::CRYPTO_GENERICHASH_KEYBYTES_MAX) { + throw new SodiumException('Unsupported key size. Must be at most CRYPTO_GENERICHASH_KEYBYTES_MAX bytes long.'); + } + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::generichash_init_salt_personal($key, $length, $salt, $personal); + } + return ParagonIE_Sodium_Crypto::generichash_init_salt_personal($key, $length, $salt, $personal); + } + + /** + * Update a BLAKE2b hashing context with additional data. + * + * @param string $ctx BLAKE2 hashing context. Generated by crypto_generichash_init(). + * $ctx is passed by reference and gets updated in-place. + * @param-out string $ctx + * @param string $message The message to append to the existing hash state. + * @return void + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress ReferenceConstraintViolation + */ + public static function crypto_generichash_update(&$ctx, $message) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($ctx, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 2); + + if (self::useNewSodiumAPI()) { + sodium_crypto_generichash_update($ctx, $message); + return; + } + if (self::use_fallback('crypto_generichash_update')) { + $func = '\\Sodium\\crypto_generichash_update'; + $func($ctx, $message); + return; + } + if (PHP_INT_SIZE === 4) { + $ctx = ParagonIE_Sodium_Crypto32::generichash_update($ctx, $message); + } else { + $ctx = ParagonIE_Sodium_Crypto::generichash_update($ctx, $message); + } + } + + /** + * @return string + * @throws Exception + * @throws Error + */ + public static function crypto_generichash_keygen() + { + return random_bytes(self::CRYPTO_GENERICHASH_KEYBYTES); + } + + /** + * @param int $subkey_len + * @param int $subkey_id + * @param string $context + * @param string $key + * @return string + * @throws SodiumException + */ + public static function crypto_kdf_derive_from_key( + $subkey_len, + $subkey_id, + $context, + $key + ) { + ParagonIE_Sodium_Core_Util::declareScalarType($subkey_len, 'int', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($subkey_id, 'int', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($context, 'string', 3); + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); + $subkey_id = (int) $subkey_id; + $subkey_len = (int) $subkey_len; + $context = (string) $context; + $key = (string) $key; + + if ($subkey_len < self::CRYPTO_KDF_BYTES_MIN) { + throw new SodiumException('subkey cannot be smaller than SODIUM_CRYPTO_KDF_BYTES_MIN'); + } + if ($subkey_len > self::CRYPTO_KDF_BYTES_MAX) { + throw new SodiumException('subkey cannot be larger than SODIUM_CRYPTO_KDF_BYTES_MAX'); + } + if ($subkey_id < 0) { + throw new SodiumException('subkey_id cannot be negative'); + } + if (ParagonIE_Sodium_Core_Util::strlen($context) !== self::CRYPTO_KDF_CONTEXTBYTES) { + throw new SodiumException('context should be SODIUM_CRYPTO_KDF_CONTEXTBYTES bytes'); + } + if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_KDF_KEYBYTES) { + throw new SodiumException('key should be SODIUM_CRYPTO_KDF_KEYBYTES bytes'); + } + + $salt = ParagonIE_Sodium_Core_Util::store64_le($subkey_id); + $state = self::crypto_generichash_init_salt_personal( + $key, + $subkey_len, + $salt, + $context + ); + return self::crypto_generichash_final($state, $subkey_len); + } + + /** + * @return string + * @throws Exception + * @throws Error + */ + public static function crypto_kdf_keygen() + { + return random_bytes(self::CRYPTO_KDF_KEYBYTES); + } + + /** + * Perform a key exchange, between a designated client and a server. + * + * Typically, you would designate one machine to be the client and the + * other to be the server. The first two keys are what you'd expect for + * scalarmult() below, but the latter two public keys don't swap places. + * + * | ALICE | BOB | + * | Client | Server | + * |--------------------------------|-------------------------------------| + * | shared = crypto_kx( | shared = crypto_kx( | + * | alice_sk, | bob_sk, | <- contextual + * | bob_pk, | alice_pk, | <- contextual + * | alice_pk, | alice_pk, | <----- static + * | bob_pk | bob_pk | <----- static + * | ) | ) | + * + * They are used along with the scalarmult product to generate a 256-bit + * BLAKE2b hash unique to the client and server keys. + * + * @param string $my_secret + * @param string $their_public + * @param string $client_public + * @param string $server_public + * @param bool $dontFallback + * @return string + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_kx($my_secret, $their_public, $client_public, $server_public, $dontFallback = false) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($my_secret, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($their_public, 'string', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($client_public, 'string', 3); + ParagonIE_Sodium_Core_Util::declareScalarType($server_public, 'string', 4); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($my_secret) !== self::CRYPTO_BOX_SECRETKEYBYTES) { + throw new SodiumException('Argument 1 must be CRYPTO_BOX_SECRETKEYBYTES long.'); + } + if (ParagonIE_Sodium_Core_Util::strlen($their_public) !== self::CRYPTO_BOX_PUBLICKEYBYTES) { + throw new SodiumException('Argument 2 must be CRYPTO_BOX_PUBLICKEYBYTES long.'); + } + if (ParagonIE_Sodium_Core_Util::strlen($client_public) !== self::CRYPTO_BOX_PUBLICKEYBYTES) { + throw new SodiumException('Argument 3 must be CRYPTO_BOX_PUBLICKEYBYTES long.'); + } + if (ParagonIE_Sodium_Core_Util::strlen($server_public) !== self::CRYPTO_BOX_PUBLICKEYBYTES) { + throw new SodiumException('Argument 4 must be CRYPTO_BOX_PUBLICKEYBYTES long.'); + } + + if (self::useNewSodiumAPI() && !$dontFallback) { + if (is_callable('sodium_crypto_kx')) { + return (string) sodium_crypto_kx( + $my_secret, + $their_public, + $client_public, + $server_public + ); + } + } + if (self::use_fallback('crypto_kx')) { + return (string) call_user_func( + '\\Sodium\\crypto_kx', + $my_secret, + $their_public, + $client_public, + $server_public + ); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::keyExchange( + $my_secret, + $their_public, + $client_public, + $server_public + ); + } + return ParagonIE_Sodium_Crypto::keyExchange( + $my_secret, + $their_public, + $client_public, + $server_public + ); + } + + /** + * @param string $seed + * @return string + * @throws SodiumException + */ + public static function crypto_kx_seed_keypair($seed) + { + ParagonIE_Sodium_Core_Util::declareScalarType($seed, 'string', 1); + + $seed = (string) $seed; + + if (ParagonIE_Sodium_Core_Util::strlen($seed) !== self::CRYPTO_KX_SEEDBYTES) { + throw new SodiumException('seed must be SODIUM_CRYPTO_KX_SEEDBYTES bytes'); + } + + $sk = self::crypto_generichash($seed, '', self::CRYPTO_KX_SECRETKEYBYTES); + $pk = self::crypto_scalarmult_base($sk); + return $sk . $pk; + } + + /** + * @return string + * @throws Exception + */ + public static function crypto_kx_keypair() + { + $sk = self::randombytes_buf(self::CRYPTO_KX_SECRETKEYBYTES); + $pk = self::crypto_scalarmult_base($sk); + return $sk . $pk; + } + + /** + * @param string $keypair + * @param string $serverPublicKey + * @return array{0: string, 1: string} + * @throws SodiumException + */ + public static function crypto_kx_client_session_keys($keypair, $serverPublicKey) + { + ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($serverPublicKey, 'string', 2); + + $keypair = (string) $keypair; + $serverPublicKey = (string) $serverPublicKey; + + if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_KX_KEYPAIRBYTES) { + throw new SodiumException('keypair should be SODIUM_CRYPTO_KX_KEYPAIRBYTES bytes'); + } + if (ParagonIE_Sodium_Core_Util::strlen($serverPublicKey) !== self::CRYPTO_KX_PUBLICKEYBYTES) { + throw new SodiumException('public keys must be SODIUM_CRYPTO_KX_PUBLICKEYBYTES bytes'); + } + + $sk = self::crypto_kx_secretkey($keypair); + $pk = self::crypto_kx_publickey($keypair); + $h = self::crypto_generichash_init(null, self::CRYPTO_KX_SESSIONKEYBYTES * 2); + self::crypto_generichash_update($h, self::crypto_scalarmult($sk, $serverPublicKey)); + self::crypto_generichash_update($h, $pk); + self::crypto_generichash_update($h, $serverPublicKey); + $sessionKeys = self::crypto_generichash_final($h, self::CRYPTO_KX_SESSIONKEYBYTES * 2); + return array( + ParagonIE_Sodium_Core_Util::substr( + $sessionKeys, + 0, + self::CRYPTO_KX_SESSIONKEYBYTES + ), + ParagonIE_Sodium_Core_Util::substr( + $sessionKeys, + self::CRYPTO_KX_SESSIONKEYBYTES, + self::CRYPTO_KX_SESSIONKEYBYTES + ) + ); + } + + /** + * @param string $keypair + * @param string $clientPublicKey + * @return array{0: string, 1: string} + * @throws SodiumException + */ + public static function crypto_kx_server_session_keys($keypair, $clientPublicKey) + { + ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($clientPublicKey, 'string', 2); + + $keypair = (string) $keypair; + $clientPublicKey = (string) $clientPublicKey; + + if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_KX_KEYPAIRBYTES) { + throw new SodiumException('keypair should be SODIUM_CRYPTO_KX_KEYPAIRBYTES bytes'); + } + if (ParagonIE_Sodium_Core_Util::strlen($clientPublicKey) !== self::CRYPTO_KX_PUBLICKEYBYTES) { + throw new SodiumException('public keys must be SODIUM_CRYPTO_KX_PUBLICKEYBYTES bytes'); + } + + $sk = self::crypto_kx_secretkey($keypair); + $pk = self::crypto_kx_publickey($keypair); + $h = self::crypto_generichash_init(null, self::CRYPTO_KX_SESSIONKEYBYTES * 2); + self::crypto_generichash_update($h, self::crypto_scalarmult($sk, $clientPublicKey)); + self::crypto_generichash_update($h, $clientPublicKey); + self::crypto_generichash_update($h, $pk); + $sessionKeys = self::crypto_generichash_final($h, self::CRYPTO_KX_SESSIONKEYBYTES * 2); + return array( + ParagonIE_Sodium_Core_Util::substr( + $sessionKeys, + self::CRYPTO_KX_SESSIONKEYBYTES, + self::CRYPTO_KX_SESSIONKEYBYTES + ), + ParagonIE_Sodium_Core_Util::substr( + $sessionKeys, + 0, + self::CRYPTO_KX_SESSIONKEYBYTES + ) + ); + } + + /** + * @param string $kp + * @return string + * @throws SodiumException + */ + public static function crypto_kx_secretkey($kp) + { + return ParagonIE_Sodium_Core_Util::substr( + $kp, + 0, + self::CRYPTO_KX_SECRETKEYBYTES + ); + } + + /** + * @param string $kp + * @return string + * @throws SodiumException + */ + public static function crypto_kx_publickey($kp) + { + return ParagonIE_Sodium_Core_Util::substr( + $kp, + self::CRYPTO_KX_SECRETKEYBYTES, + self::CRYPTO_KX_PUBLICKEYBYTES + ); + } + + /** + * @param int $outlen + * @param string $passwd + * @param string $salt + * @param int $opslimit + * @param int $memlimit + * @param int|null $alg + * @return string + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit, $alg = null) + { + ParagonIE_Sodium_Core_Util::declareScalarType($outlen, 'int', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($salt, 'string', 3); + ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 4); + ParagonIE_Sodium_Core_Util::declareScalarType($memlimit, 'int', 5); + + if (self::useNewSodiumAPI()) { + if (!is_null($alg)) { + ParagonIE_Sodium_Core_Util::declareScalarType($alg, 'int', 6); + return sodium_crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit, $alg); + } + return sodium_crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit); + } + if (self::use_fallback('crypto_pwhash')) { + return (string) call_user_func('\\Sodium\\crypto_pwhash', $outlen, $passwd, $salt, $opslimit, $memlimit); + } + // This is the best we can do. + throw new SodiumException( + 'This is not implemented, as it is not possible to implement Argon2i with acceptable performance in pure-PHP' + ); + } + + /** + * !Exclusive to sodium_compat! + * + * This returns TRUE if the native crypto_pwhash API is available by libsodium. + * This returns FALSE if only sodium_compat is available. + * + * @return bool + */ + public static function crypto_pwhash_is_available() + { + if (self::useNewSodiumAPI()) { + return true; + } + if (self::use_fallback('crypto_pwhash')) { + return true; + } + return false; + } + + /** + * @param string $passwd + * @param int $opslimit + * @param int $memlimit + * @return string + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_pwhash_str($passwd, $opslimit, $memlimit) + { + ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($memlimit, 'int', 3); + + if (self::useNewSodiumAPI()) { + return sodium_crypto_pwhash_str($passwd, $opslimit, $memlimit); + } + if (self::use_fallback('crypto_pwhash_str')) { + return (string) call_user_func('\\Sodium\\crypto_pwhash_str', $passwd, $opslimit, $memlimit); + } + // This is the best we can do. + throw new SodiumException( + 'This is not implemented, as it is not possible to implement Argon2i with acceptable performance in pure-PHP' + ); + } + + /** + * Do we need to rehash this password? + * + * @param string $hash + * @param int $opslimit + * @param int $memlimit + * @return bool + * @throws SodiumException + */ + public static function crypto_pwhash_str_needs_rehash($hash, $opslimit, $memlimit) + { + ParagonIE_Sodium_Core_Util::declareScalarType($hash, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($memlimit, 'int', 3); + + // Just grab the first 4 pieces. + $pieces = explode('$', (string) $hash); + $prefix = implode('$', array_slice($pieces, 0, 4)); + + // Rebuild the expected header. + /** @var int $ops */ + $ops = (int) $opslimit; + /** @var int $mem */ + $mem = (int) $memlimit >> 10; + $encoded = self::CRYPTO_PWHASH_STRPREFIX . 'v=19$m=' . $mem . ',t=' . $ops . ',p=1'; + + // Do they match? If so, we don't need to rehash, so return false. + return !ParagonIE_Sodium_Core_Util::hashEquals($encoded, $prefix); + } + + /** + * @param string $passwd + * @param string $hash + * @return bool + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_pwhash_str_verify($passwd, $hash) + { + ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($hash, 'string', 2); + + if (self::useNewSodiumAPI()) { + return (bool) sodium_crypto_pwhash_str_verify($passwd, $hash); + } + if (self::use_fallback('crypto_pwhash_str_verify')) { + return (bool) call_user_func('\\Sodium\\crypto_pwhash_str_verify', $passwd, $hash); + } + // This is the best we can do. + throw new SodiumException( + 'This is not implemented, as it is not possible to implement Argon2i with acceptable performance in pure-PHP' + ); + } + + /** + * @param int $outlen + * @param string $passwd + * @param string $salt + * @param int $opslimit + * @param int $memlimit + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit) + { + ParagonIE_Sodium_Core_Util::declareScalarType($outlen, 'int', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($salt, 'string', 3); + ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 4); + ParagonIE_Sodium_Core_Util::declareScalarType($memlimit, 'int', 5); + + if (self::useNewSodiumAPI()) { + return (string) sodium_crypto_pwhash_scryptsalsa208sha256( + (int) $outlen, + (string) $passwd, + (string) $salt, + (int) $opslimit, + (int) $memlimit + ); + } + if (self::use_fallback('crypto_pwhash_scryptsalsa208sha256')) { + return (string) call_user_func( + '\\Sodium\\crypto_pwhash_scryptsalsa208sha256', + (int) $outlen, + (string) $passwd, + (string) $salt, + (int) $opslimit, + (int) $memlimit + ); + } + // This is the best we can do. + throw new SodiumException( + 'This is not implemented, as it is not possible to implement Scrypt with acceptable performance in pure-PHP' + ); + } + + /** + * !Exclusive to sodium_compat! + * + * This returns TRUE if the native crypto_pwhash API is available by libsodium. + * This returns FALSE if only sodium_compat is available. + * + * @return bool + */ + public static function crypto_pwhash_scryptsalsa208sha256_is_available() + { + if (self::useNewSodiumAPI()) { + return true; + } + if (self::use_fallback('crypto_pwhash_scryptsalsa208sha256')) { + return true; + } + return false; + } + + /** + * @param string $passwd + * @param int $opslimit + * @param int $memlimit + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit) + { + ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($memlimit, 'int', 3); + + if (self::useNewSodiumAPI()) { + return (string) sodium_crypto_pwhash_scryptsalsa208sha256_str( + (string) $passwd, + (int) $opslimit, + (int) $memlimit + ); + } + if (self::use_fallback('crypto_pwhash_scryptsalsa208sha256_str')) { + return (string) call_user_func( + '\\Sodium\\crypto_pwhash_scryptsalsa208sha256_str', + (string) $passwd, + (int) $opslimit, + (int) $memlimit + ); + } + // This is the best we can do. + throw new SodiumException( + 'This is not implemented, as it is not possible to implement Scrypt with acceptable performance in pure-PHP' + ); + } + + /** + * @param string $passwd + * @param string $hash + * @return bool + * @throws SodiumException + * @throws TypeError + */ + public static function crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash) + { + ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($hash, 'string', 2); + + if (self::useNewSodiumAPI()) { + return (bool) sodium_crypto_pwhash_scryptsalsa208sha256_str_verify( + (string) $passwd, + (string) $hash + ); + } + if (self::use_fallback('crypto_pwhash_scryptsalsa208sha256_str_verify')) { + return (bool) call_user_func( + '\\Sodium\\crypto_pwhash_scryptsalsa208sha256_str_verify', + (string) $passwd, + (string) $hash + ); + } + // This is the best we can do. + throw new SodiumException( + 'This is not implemented, as it is not possible to implement Scrypt with acceptable performance in pure-PHP' + ); + } + + /** + * Calculate the shared secret between your secret key and your + * recipient's public key. + * + * Algorithm: X25519 (ECDH over Curve25519) + * + * @param string $secretKey + * @param string $publicKey + * @return string + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_scalarmult($secretKey, $publicKey) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($publicKey, 'string', 2); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_BOX_SECRETKEYBYTES) { + throw new SodiumException('Argument 1 must be CRYPTO_BOX_SECRETKEYBYTES long.'); + } + if (ParagonIE_Sodium_Core_Util::strlen($publicKey) !== self::CRYPTO_BOX_PUBLICKEYBYTES) { + throw new SodiumException('Argument 2 must be CRYPTO_BOX_PUBLICKEYBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + return sodium_crypto_scalarmult($secretKey, $publicKey); + } + if (self::use_fallback('crypto_scalarmult')) { + return (string) call_user_func('\\Sodium\\crypto_scalarmult', $secretKey, $publicKey); + } + + /* Output validation: Forbid all-zero keys */ + if (ParagonIE_Sodium_Core_Util::hashEquals($secretKey, str_repeat("\0", self::CRYPTO_BOX_SECRETKEYBYTES))) { + throw new SodiumException('Zero secret key is not allowed'); + } + if (ParagonIE_Sodium_Core_Util::hashEquals($publicKey, str_repeat("\0", self::CRYPTO_BOX_PUBLICKEYBYTES))) { + throw new SodiumException('Zero public key is not allowed'); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::scalarmult($secretKey, $publicKey); + } + return ParagonIE_Sodium_Crypto::scalarmult($secretKey, $publicKey); + } + + /** + * Calculate an X25519 public key from an X25519 secret key. + * + * @param string $secretKey + * @return string + * @throws SodiumException + * @throws TypeError + * @psalm-suppress TooFewArguments + * @psalm-suppress MixedArgument + */ + public static function crypto_scalarmult_base($secretKey) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_BOX_SECRETKEYBYTES) { + throw new SodiumException('Argument 1 must be CRYPTO_BOX_SECRETKEYBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + return sodium_crypto_scalarmult_base($secretKey); + } + if (self::use_fallback('crypto_scalarmult_base')) { + return (string) call_user_func('\\Sodium\\crypto_scalarmult_base', $secretKey); + } + if (ParagonIE_Sodium_Core_Util::hashEquals($secretKey, str_repeat("\0", self::CRYPTO_BOX_SECRETKEYBYTES))) { + throw new SodiumException('Zero secret key is not allowed'); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::scalarmult_base($secretKey); + } + return ParagonIE_Sodium_Crypto::scalarmult_base($secretKey); + } + + /** + * Authenticated symmetric-key encryption. + * + * Algorithm: XSalsa20-Poly1305 + * + * @param string $plaintext The message you're encrypting + * @param string $nonce A Number to be used Once; must be 24 bytes + * @param string $key Symmetric encryption key + * @return string Ciphertext with Poly1305 MAC + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_secretbox($plaintext, $nonce, $key) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_SECRETBOX_NONCEBYTES) { + throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_NONCEBYTES long.'); + } + if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_SECRETBOX_KEYBYTES) { + throw new SodiumException('Argument 3 must be CRYPTO_SECRETBOX_KEYBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + return sodium_crypto_secretbox($plaintext, $nonce, $key); + } + if (self::use_fallback('crypto_secretbox')) { + return (string) call_user_func('\\Sodium\\crypto_secretbox', $plaintext, $nonce, $key); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::secretbox($plaintext, $nonce, $key); + } + return ParagonIE_Sodium_Crypto::secretbox($plaintext, $nonce, $key); + } + + /** + * Decrypts a message previously encrypted with crypto_secretbox(). + * + * @param string $ciphertext Ciphertext with Poly1305 MAC + * @param string $nonce A Number to be used Once; must be 24 bytes + * @param string $key Symmetric encryption key + * @return string Original plaintext message + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedInferredReturnType + * @psalm-suppress MixedReturnStatement + */ + public static function crypto_secretbox_open($ciphertext, $nonce, $key) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_SECRETBOX_NONCEBYTES) { + throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_NONCEBYTES long.'); + } + if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_SECRETBOX_KEYBYTES) { + throw new SodiumException('Argument 3 must be CRYPTO_SECRETBOX_KEYBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + /** + * @psalm-suppress InvalidReturnStatement + * @psalm-suppress FalsableReturnStatement + */ + return sodium_crypto_secretbox_open($ciphertext, $nonce, $key); + } + if (self::use_fallback('crypto_secretbox_open')) { + return call_user_func('\\Sodium\\crypto_secretbox_open', $ciphertext, $nonce, $key); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::secretbox_open($ciphertext, $nonce, $key); + } + return ParagonIE_Sodium_Crypto::secretbox_open($ciphertext, $nonce, $key); + } + + /** + * Return a secure random key for use with crypto_secretbox + * + * @return string + * @throws Exception + * @throws Error + */ + public static function crypto_secretbox_keygen() + { + return random_bytes(self::CRYPTO_SECRETBOX_KEYBYTES); + } + + /** + * Authenticated symmetric-key encryption. + * + * Algorithm: XChaCha20-Poly1305 + * + * @param string $plaintext The message you're encrypting + * @param string $nonce A Number to be used Once; must be 24 bytes + * @param string $key Symmetric encryption key + * @return string Ciphertext with Poly1305 MAC + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_secretbox_xchacha20poly1305($plaintext, $nonce, $key) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_SECRETBOX_NONCEBYTES) { + throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_NONCEBYTES long.'); + } + if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_SECRETBOX_KEYBYTES) { + throw new SodiumException('Argument 3 must be CRYPTO_SECRETBOX_KEYBYTES long.'); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::secretbox_xchacha20poly1305($plaintext, $nonce, $key); + } + return ParagonIE_Sodium_Crypto::secretbox_xchacha20poly1305($plaintext, $nonce, $key); + } + /** + * Decrypts a message previously encrypted with crypto_secretbox_xchacha20poly1305(). + * + * @param string $ciphertext Ciphertext with Poly1305 MAC + * @param string $nonce A Number to be used Once; must be 24 bytes + * @param string $key Symmetric encryption key + * @return string Original plaintext message + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_secretbox_xchacha20poly1305_open($ciphertext, $nonce, $key) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_SECRETBOX_NONCEBYTES) { + throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_NONCEBYTES long.'); + } + if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_SECRETBOX_KEYBYTES) { + throw new SodiumException('Argument 3 must be CRYPTO_SECRETBOX_KEYBYTES long.'); + } + + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::secretbox_xchacha20poly1305_open($ciphertext, $nonce, $key); + } + return ParagonIE_Sodium_Crypto::secretbox_xchacha20poly1305_open($ciphertext, $nonce, $key); + } + + /** + * @param string $key + * @return array Returns a state and a header. + * @throws Exception + * @throws SodiumException + */ + public static function crypto_secretstream_xchacha20poly1305_init_push($key) + { + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_init_push($key); + } + return ParagonIE_Sodium_Crypto::secretstream_xchacha20poly1305_init_push($key); + } + + /** + * @param string $header + * @param string $key + * @return string Returns a state. + * @throws Exception + */ + public static function crypto_secretstream_xchacha20poly1305_init_pull($header, $key) + { + if (ParagonIE_Sodium_Core_Util::strlen($header) < self::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES) { + throw new SodiumException( + 'header size should be SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES bytes' + ); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_init_pull($key, $header); + } + return ParagonIE_Sodium_Crypto::secretstream_xchacha20poly1305_init_pull($key, $header); + } + + /** + * @param string $state + * @param string $msg + * @param string $aad + * @param int $tag + * @return string + * @throws SodiumException + */ + public static function crypto_secretstream_xchacha20poly1305_push(&$state, $msg, $aad = '', $tag = 0) + { + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_push( + $state, + $msg, + $aad, + $tag + ); + } + return ParagonIE_Sodium_Crypto::secretstream_xchacha20poly1305_push( + $state, + $msg, + $aad, + $tag + ); + } + + /** + * @param string $state + * @param string $msg + * @param string $aad + * @return bool|array{0: string, 1: int} + * @throws SodiumException + */ + public static function crypto_secretstream_xchacha20poly1305_pull(&$state, $msg, $aad = '') + { + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_pull( + $state, + $msg, + $aad + ); + } + return ParagonIE_Sodium_Crypto::secretstream_xchacha20poly1305_pull( + $state, + $msg, + $aad + ); + } + + /** + * @return string + * @throws Exception + */ + public static function crypto_secretstream_xchacha20poly1305_keygen() + { + return random_bytes(self::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES); + } + + /** + * @param string $state + * @return void + * @throws SodiumException + */ + public static function crypto_secretstream_xchacha20poly1305_rekey(&$state) + { + if (PHP_INT_SIZE === 4) { + ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_rekey($state); + } else { + ParagonIE_Sodium_Crypto::secretstream_xchacha20poly1305_rekey($state); + } + } + + /** + * Calculates a SipHash-2-4 hash of a message for a given key. + * + * @param string $message Input message + * @param string $key SipHash-2-4 key + * @return string Hash + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedInferredReturnType + * @psalm-suppress MixedReturnStatement + */ + public static function crypto_shorthash($message, $key) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 2); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_SHORTHASH_KEYBYTES) { + throw new SodiumException('Argument 2 must be CRYPTO_SHORTHASH_KEYBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + return sodium_crypto_shorthash($message, $key); + } + if (self::use_fallback('crypto_shorthash')) { + return (string) call_user_func('\\Sodium\\crypto_shorthash', $message, $key); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Core32_SipHash::sipHash24($message, $key); + } + return ParagonIE_Sodium_Core_SipHash::sipHash24($message, $key); + } + + /** + * Return a secure random key for use with crypto_shorthash + * + * @return string + * @throws Exception + * @throws Error + */ + public static function crypto_shorthash_keygen() + { + return random_bytes(self::CRYPTO_SHORTHASH_KEYBYTES); + } + + /** + * Returns a signed message. You probably want crypto_sign_detached() + * instead, which only returns the signature. + * + * Algorithm: Ed25519 (EdDSA over Curve25519) + * + * @param string $message Message to be signed. + * @param string $secretKey Secret signing key. + * @return string Signed message (signature is prefixed). + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedInferredReturnType + * @psalm-suppress MixedReturnStatement + */ + public static function crypto_sign($message, $secretKey) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 2); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_SIGN_SECRETKEYBYTES) { + throw new SodiumException('Argument 2 must be CRYPTO_SIGN_SECRETKEYBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + return sodium_crypto_sign($message, $secretKey); + } + if (self::use_fallback('crypto_sign')) { + return (string) call_user_func('\\Sodium\\crypto_sign', $message, $secretKey); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::sign($message, $secretKey); + } + return ParagonIE_Sodium_Crypto::sign($message, $secretKey); + } + + /** + * Validates a signed message then returns the message. + * + * @param string $signedMessage A signed message + * @param string $publicKey A public key + * @return string The original message (if the signature is + * valid for this public key) + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedInferredReturnType + * @psalm-suppress MixedReturnStatement + */ + public static function crypto_sign_open($signedMessage, $publicKey) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($signedMessage, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($publicKey, 'string', 2); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($signedMessage) < self::CRYPTO_SIGN_BYTES) { + throw new SodiumException('Argument 1 must be at least CRYPTO_SIGN_BYTES long.'); + } + if (ParagonIE_Sodium_Core_Util::strlen($publicKey) !== self::CRYPTO_SIGN_PUBLICKEYBYTES) { + throw new SodiumException('Argument 2 must be CRYPTO_SIGN_PUBLICKEYBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + /** + * @psalm-suppress InvalidReturnStatement + * @psalm-suppress FalsableReturnStatement + */ + return sodium_crypto_sign_open($signedMessage, $publicKey); + } + if (self::use_fallback('crypto_sign_open')) { + return call_user_func('\\Sodium\\crypto_sign_open', $signedMessage, $publicKey); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::sign_open($signedMessage, $publicKey); + } + return ParagonIE_Sodium_Crypto::sign_open($signedMessage, $publicKey); + } + + /** + * Generate a new random Ed25519 keypair. + * + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function crypto_sign_keypair() + { + if (self::useNewSodiumAPI()) { + return sodium_crypto_sign_keypair(); + } + if (self::use_fallback('crypto_sign_keypair')) { + return (string) call_user_func('\\Sodium\\crypto_sign_keypair'); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Core32_Ed25519::keypair(); + } + return ParagonIE_Sodium_Core_Ed25519::keypair(); + } + + /** + * @param string $sk + * @param string $pk + * @return string + * @throws SodiumException + */ + public static function crypto_sign_keypair_from_secretkey_and_publickey($sk, $pk) + { + ParagonIE_Sodium_Core_Util::declareScalarType($sk, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($pk, 'string', 1); + $sk = (string) $sk; + $pk = (string) $pk; + + if (ParagonIE_Sodium_Core_Util::strlen($sk) !== self::CRYPTO_SIGN_SECRETKEYBYTES) { + throw new SodiumException('secretkey should be SODIUM_CRYPTO_SIGN_SECRETKEYBYTES bytes'); + } + if (ParagonIE_Sodium_Core_Util::strlen($pk) !== self::CRYPTO_SIGN_PUBLICKEYBYTES) { + throw new SodiumException('publickey should be SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES bytes'); + } + + if (self::useNewSodiumAPI()) { + return sodium_crypto_sign_keypair_from_secretkey_and_publickey($sk, $pk); + } + return $sk . $pk; + } + + /** + * Generate an Ed25519 keypair from a seed. + * + * @param string $seed Input seed + * @return string Keypair + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_sign_seed_keypair($seed) + { + ParagonIE_Sodium_Core_Util::declareScalarType($seed, 'string', 1); + + if (self::useNewSodiumAPI()) { + return sodium_crypto_sign_seed_keypair($seed); + } + if (self::use_fallback('crypto_sign_keypair')) { + return (string) call_user_func('\\Sodium\\crypto_sign_seed_keypair', $seed); + } + $publicKey = ''; + $secretKey = ''; + if (PHP_INT_SIZE === 4) { + ParagonIE_Sodium_Core32_Ed25519::seed_keypair($publicKey, $secretKey, $seed); + } else { + ParagonIE_Sodium_Core_Ed25519::seed_keypair($publicKey, $secretKey, $seed); + } + return $secretKey . $publicKey; + } + + /** + * Extract an Ed25519 public key from an Ed25519 keypair. + * + * @param string $keypair Keypair + * @return string Public key + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_sign_publickey($keypair) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_SIGN_KEYPAIRBYTES) { + throw new SodiumException('Argument 1 must be CRYPTO_SIGN_KEYPAIRBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + return sodium_crypto_sign_publickey($keypair); + } + if (self::use_fallback('crypto_sign_publickey')) { + return (string) call_user_func('\\Sodium\\crypto_sign_publickey', $keypair); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Core32_Ed25519::publickey($keypair); + } + return ParagonIE_Sodium_Core_Ed25519::publickey($keypair); + } + + /** + * Calculate an Ed25519 public key from an Ed25519 secret key. + * + * @param string $secretKey Your Ed25519 secret key + * @return string The corresponding Ed25519 public key + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_sign_publickey_from_secretkey($secretKey) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_SIGN_SECRETKEYBYTES) { + throw new SodiumException('Argument 1 must be CRYPTO_SIGN_SECRETKEYBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + return sodium_crypto_sign_publickey_from_secretkey($secretKey); + } + if (self::use_fallback('crypto_sign_publickey_from_secretkey')) { + return (string) call_user_func('\\Sodium\\crypto_sign_publickey_from_secretkey', $secretKey); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Core32_Ed25519::publickey_from_secretkey($secretKey); + } + return ParagonIE_Sodium_Core_Ed25519::publickey_from_secretkey($secretKey); + } + + /** + * Extract an Ed25519 secret key from an Ed25519 keypair. + * + * @param string $keypair Keypair + * @return string Secret key + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_sign_secretkey($keypair) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_SIGN_KEYPAIRBYTES) { + throw new SodiumException('Argument 1 must be CRYPTO_SIGN_KEYPAIRBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + return sodium_crypto_sign_secretkey($keypair); + } + if (self::use_fallback('crypto_sign_secretkey')) { + return (string) call_user_func('\\Sodium\\crypto_sign_secretkey', $keypair); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Core32_Ed25519::secretkey($keypair); + } + return ParagonIE_Sodium_Core_Ed25519::secretkey($keypair); + } + + /** + * Calculate the Ed25519 signature of a message and return ONLY the signature. + * + * Algorithm: Ed25519 (EdDSA over Curve25519) + * + * @param string $message Message to be signed + * @param string $secretKey Secret signing key + * @return string Digital signature + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_sign_detached($message, $secretKey) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 2); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_SIGN_SECRETKEYBYTES) { + throw new SodiumException('Argument 2 must be CRYPTO_SIGN_SECRETKEYBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + return sodium_crypto_sign_detached($message, $secretKey); + } + if (self::use_fallback('crypto_sign_detached')) { + return (string) call_user_func('\\Sodium\\crypto_sign_detached', $message, $secretKey); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::sign_detached($message, $secretKey); + } + return ParagonIE_Sodium_Crypto::sign_detached($message, $secretKey); + } + + /** + * Verify the Ed25519 signature of a message. + * + * @param string $signature Digital sginature + * @param string $message Message to be verified + * @param string $publicKey Public key + * @return bool TRUE if this signature is good for this public key; + * FALSE otherwise + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_sign_verify_detached($signature, $message, $publicKey) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($signature, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($publicKey, 'string', 3); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($signature) !== self::CRYPTO_SIGN_BYTES) { + throw new SodiumException('Argument 1 must be CRYPTO_SIGN_BYTES long.'); + } + if (ParagonIE_Sodium_Core_Util::strlen($publicKey) !== self::CRYPTO_SIGN_PUBLICKEYBYTES) { + throw new SodiumException('Argument 3 must be CRYPTO_SIGN_PUBLICKEYBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + return sodium_crypto_sign_verify_detached($signature, $message, $publicKey); + } + if (self::use_fallback('crypto_sign_verify_detached')) { + return (bool) call_user_func( + '\\Sodium\\crypto_sign_verify_detached', + $signature, + $message, + $publicKey + ); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Crypto32::sign_verify_detached($signature, $message, $publicKey); + } + return ParagonIE_Sodium_Crypto::sign_verify_detached($signature, $message, $publicKey); + } + + /** + * Convert an Ed25519 public key to a Curve25519 public key + * + * @param string $pk + * @return string + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_sign_ed25519_pk_to_curve25519($pk) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($pk, 'string', 1); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($pk) < self::CRYPTO_SIGN_PUBLICKEYBYTES) { + throw new SodiumException('Argument 1 must be at least CRYPTO_SIGN_PUBLICKEYBYTES long.'); + } + if (self::useNewSodiumAPI()) { + if (is_callable('crypto_sign_ed25519_pk_to_curve25519')) { + return (string) sodium_crypto_sign_ed25519_pk_to_curve25519($pk); + } + } + if (self::use_fallback('crypto_sign_ed25519_pk_to_curve25519')) { + return (string) call_user_func('\\Sodium\\crypto_sign_ed25519_pk_to_curve25519', $pk); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Core32_Ed25519::pk_to_curve25519($pk); + } + return ParagonIE_Sodium_Core_Ed25519::pk_to_curve25519($pk); + } + + /** + * Convert an Ed25519 secret key to a Curve25519 secret key + * + * @param string $sk + * @return string + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_sign_ed25519_sk_to_curve25519($sk) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($sk, 'string', 1); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($sk) < self::CRYPTO_SIGN_SEEDBYTES) { + throw new SodiumException('Argument 1 must be at least CRYPTO_SIGN_SEEDBYTES long.'); + } + if (self::useNewSodiumAPI()) { + if (is_callable('crypto_sign_ed25519_sk_to_curve25519')) { + return sodium_crypto_sign_ed25519_sk_to_curve25519($sk); + } + } + if (self::use_fallback('crypto_sign_ed25519_sk_to_curve25519')) { + return (string) call_user_func('\\Sodium\\crypto_sign_ed25519_sk_to_curve25519', $sk); + } + + $h = hash('sha512', ParagonIE_Sodium_Core_Util::substr($sk, 0, 32), true); + $h[0] = ParagonIE_Sodium_Core_Util::intToChr( + ParagonIE_Sodium_Core_Util::chrToInt($h[0]) & 248 + ); + $h[31] = ParagonIE_Sodium_Core_Util::intToChr( + (ParagonIE_Sodium_Core_Util::chrToInt($h[31]) & 127) | 64 + ); + return ParagonIE_Sodium_Core_Util::substr($h, 0, 32); + } + + /** + * Expand a key and nonce into a keystream of pseudorandom bytes. + * + * @param int $len Number of bytes desired + * @param string $nonce Number to be used Once; must be 24 bytes + * @param string $key XSalsa20 key + * @return string Pseudorandom stream that can be XORed with messages + * to provide encryption (but not authentication; see + * Poly1305 or crypto_auth() for that, which is not + * optional for security) + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_stream($len, $nonce, $key) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($len, 'int', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_STREAM_NONCEBYTES) { + throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_NONCEBYTES long.'); + } + if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_STREAM_KEYBYTES) { + throw new SodiumException('Argument 3 must be CRYPTO_STREAM_KEYBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + return sodium_crypto_stream($len, $nonce, $key); + } + if (self::use_fallback('crypto_stream')) { + return (string) call_user_func('\\Sodium\\crypto_stream', $len, $nonce, $key); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Core32_XSalsa20::xsalsa20($len, $nonce, $key); + } + return ParagonIE_Sodium_Core_XSalsa20::xsalsa20($len, $nonce, $key); + } + + /** + * DANGER! UNAUTHENTICATED ENCRYPTION! + * + * Unless you are following expert advice, do not used this feature. + * + * Algorithm: XSalsa20 + * + * This DOES NOT provide ciphertext integrity. + * + * @param string $message Plaintext message + * @param string $nonce Number to be used Once; must be 24 bytes + * @param string $key Encryption key + * @return string Encrypted text which is vulnerable to chosen- + * ciphertext attacks unless you implement some + * other mitigation to the ciphertext (i.e. + * Encrypt then MAC) + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_stream_xor($message, $nonce, $key) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_STREAM_NONCEBYTES) { + throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_NONCEBYTES long.'); + } + if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_STREAM_KEYBYTES) { + throw new SodiumException('Argument 3 must be CRYPTO_SECRETBOX_KEYBYTES long.'); + } + + if (self::useNewSodiumAPI()) { + return sodium_crypto_stream_xor($message, $nonce, $key); + } + if (self::use_fallback('crypto_stream_xor')) { + return (string) call_user_func('\\Sodium\\crypto_stream_xor', $message, $nonce, $key); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Core32_XSalsa20::xsalsa20_xor($message, $nonce, $key); + } + return ParagonIE_Sodium_Core_XSalsa20::xsalsa20_xor($message, $nonce, $key); + } + + /** + * Return a secure random key for use with crypto_stream + * + * @return string + * @throws Exception + * @throws Error + */ + public static function crypto_stream_keygen() + { + return random_bytes(self::CRYPTO_STREAM_KEYBYTES); + } + + + /** + * Expand a key and nonce into a keystream of pseudorandom bytes. + * + * @param int $len Number of bytes desired + * @param string $nonce Number to be used Once; must be 24 bytes + * @param string $key XChaCha20 key + * @param bool $dontFallback + * @return string Pseudorandom stream that can be XORed with messages + * to provide encryption (but not authentication; see + * Poly1305 or crypto_auth() for that, which is not + * optional for security) + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_stream_xchacha20($len, $nonce, $key, $dontFallback = false) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($len, 'int', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_STREAM_XCHACHA20_NONCEBYTES) { + throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_XCHACHA20_NONCEBYTES long.'); + } + if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_STREAM_XCHACHA20_KEYBYTES) { + throw new SodiumException('Argument 3 must be CRYPTO_STREAM_XCHACHA20_KEYBYTES long.'); + } + + if (self::useNewSodiumAPI() && !$dontFallback) { + return sodium_crypto_stream_xchacha20($len, $nonce, $key); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Core32_XChaCha20::stream($len, $nonce, $key); + } + return ParagonIE_Sodium_Core_XChaCha20::stream($len, $nonce, $key); + } + + /** + * DANGER! UNAUTHENTICATED ENCRYPTION! + * + * Unless you are following expert advice, do not used this feature. + * + * Algorithm: XChaCha20 + * + * This DOES NOT provide ciphertext integrity. + * + * @param string $message Plaintext message + * @param string $nonce Number to be used Once; must be 24 bytes + * @param string $key Encryption key + * @return string Encrypted text which is vulnerable to chosen- + * ciphertext attacks unless you implement some + * other mitigation to the ciphertext (i.e. + * Encrypt then MAC) + * @param bool $dontFallback + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function crypto_stream_xchacha20_xor($message, $nonce, $key, $dontFallback = false) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2); + ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3); + + /* Input validation: */ + if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_STREAM_XCHACHA20_NONCEBYTES) { + throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_XCHACHA20_NONCEBYTES long.'); + } + if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_STREAM_XCHACHA20_KEYBYTES) { + throw new SodiumException('Argument 3 must be CRYPTO_SECRETBOX_XCHACHA20_KEYBYTES long.'); + } + + if (self::useNewSodiumAPI() && !$dontFallback) { + return sodium_crypto_stream_xchacha20_xor($message, $nonce, $key); + } + if (PHP_INT_SIZE === 4) { + return ParagonIE_Sodium_Core32_XChaCha20::streamXorIc($message, $nonce, $key); + } + return ParagonIE_Sodium_Core_XChaCha20::streamXorIc($message, $nonce, $key); + } + + /** + * Return a secure random key for use with crypto_stream_xchacha20 + * + * @return string + * @throws Exception + * @throws Error + */ + public static function crypto_stream_xchacha20_keygen() + { + return random_bytes(self::CRYPTO_STREAM_XCHACHA20_KEYBYTES); + } + + /** + * Cache-timing-safe implementation of hex2bin(). + * + * @param string $string Hexadecimal string + * @return string Raw binary string + * @throws SodiumException + * @throws TypeError + * @psalm-suppress TooFewArguments + * @psalm-suppress MixedArgument + */ + public static function hex2bin($string) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($string, 'string', 1); + + if (self::useNewSodiumAPI()) { + if (is_callable('sodium_hex2bin')) { + return (string) sodium_hex2bin($string); + } + } + if (self::use_fallback('hex2bin')) { + return (string) call_user_func('\\Sodium\\hex2bin', $string); + } + return ParagonIE_Sodium_Core_Util::hex2bin($string); + } + + /** + * Increase a string (little endian) + * + * @param string $var + * + * @return void + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function increment(&$var) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($var, 'string', 1); + + if (self::useNewSodiumAPI()) { + sodium_increment($var); + return; + } + if (self::use_fallback('increment')) { + $func = '\\Sodium\\increment'; + $func($var); + return; + } + + $len = ParagonIE_Sodium_Core_Util::strlen($var); + $c = 1; + $copy = ''; + for ($i = 0; $i < $len; ++$i) { + $c += ParagonIE_Sodium_Core_Util::chrToInt( + ParagonIE_Sodium_Core_Util::substr($var, $i, 1) + ); + $copy .= ParagonIE_Sodium_Core_Util::intToChr($c); + $c >>= 8; + } + $var = $copy; + } + + /** + * @param string $str + * @return bool + * + * @throws SodiumException + */ + public static function is_zero($str) + { + $d = 0; + for ($i = 0; $i < 32; ++$i) { + $d |= ParagonIE_Sodium_Core_Util::chrToInt($str[$i]); + } + return ((($d - 1) >> 31) & 1) === 1; + } + + /** + * The equivalent to the libsodium minor version we aim to be compatible + * with (sans pwhash and memzero). + * + * @return int + */ + public static function library_version_major() + { + if (self::useNewSodiumAPI() && defined('SODIUM_LIBRARY_MAJOR_VERSION')) { + return SODIUM_LIBRARY_MAJOR_VERSION; + } + if (self::use_fallback('library_version_major')) { + /** @psalm-suppress UndefinedFunction */ + return (int) call_user_func('\\Sodium\\library_version_major'); + } + return self::LIBRARY_VERSION_MAJOR; + } + + /** + * The equivalent to the libsodium minor version we aim to be compatible + * with (sans pwhash and memzero). + * + * @return int + */ + public static function library_version_minor() + { + if (self::useNewSodiumAPI() && defined('SODIUM_LIBRARY_MINOR_VERSION')) { + return SODIUM_LIBRARY_MINOR_VERSION; + } + if (self::use_fallback('library_version_minor')) { + /** @psalm-suppress UndefinedFunction */ + return (int) call_user_func('\\Sodium\\library_version_minor'); + } + return self::LIBRARY_VERSION_MINOR; + } + + /** + * Compare two strings. + * + * @param string $left + * @param string $right + * @return int + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + */ + public static function memcmp($left, $right) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($left, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($right, 'string', 2); + + if (self::useNewSodiumAPI()) { + return sodium_memcmp($left, $right); + } + if (self::use_fallback('memcmp')) { + return (int) call_user_func('\\Sodium\\memcmp', $left, $right); + } + /** @var string $left */ + /** @var string $right */ + return ParagonIE_Sodium_Core_Util::memcmp($left, $right); + } + + /** + * It's actually not possible to zero memory buffers in PHP. You need the + * native library for that. + * + * @param string|null $var + * @param-out string|null $var + * + * @return void + * @throws SodiumException (Unless libsodium is installed) + * @throws TypeError + * @psalm-suppress TooFewArguments + */ + public static function memzero(&$var) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($var, 'string', 1); + + if (self::useNewSodiumAPI()) { + /** @psalm-suppress MixedArgument */ + sodium_memzero($var); + return; + } + if (self::use_fallback('memzero')) { + $func = '\\Sodium\\memzero'; + $func($var); + if ($var === null) { + return; + } + } + // This is the best we can do. + throw new SodiumException( + 'This is not implemented in sodium_compat, as it is not possible to securely wipe memory from PHP. ' . + 'To fix this error, make sure libsodium is installed and the PHP extension is enabled.' + ); + } + + /** + * @param string $unpadded + * @param int $blockSize + * @param bool $dontFallback + * @return string + * @throws SodiumException + */ + public static function pad($unpadded, $blockSize, $dontFallback = false) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($unpadded, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($blockSize, 'int', 2); + + $unpadded = (string) $unpadded; + $blockSize = (int) $blockSize; + + if (self::useNewSodiumAPI() && !$dontFallback) { + return (string) sodium_pad($unpadded, $blockSize); + } + + if ($blockSize <= 0) { + throw new SodiumException( + 'block size cannot be less than 1' + ); + } + $unpadded_len = ParagonIE_Sodium_Core_Util::strlen($unpadded); + $xpadlen = ($blockSize - 1); + if (($blockSize & ($blockSize - 1)) === 0) { + $xpadlen -= $unpadded_len & ($blockSize - 1); + } else { + $xpadlen -= $unpadded_len % $blockSize; + } + + $xpadded_len = $unpadded_len + $xpadlen; + $padded = str_repeat("\0", $xpadded_len - 1); + if ($unpadded_len > 0) { + $st = 1; + $i = 0; + $k = $unpadded_len; + for ($j = 0; $j <= $xpadded_len; ++$j) { + $i = (int) $i; + $k = (int) $k; + $st = (int) $st; + if ($j >= $unpadded_len) { + $padded[$j] = "\0"; + } else { + $padded[$j] = $unpadded[$j]; + } + /** @var int $k */ + $k -= $st; + $st = (int) (~( + ( + ( + ($k >> 48) + | + ($k >> 32) + | + ($k >> 16) + | + $k + ) - 1 + ) >> 16 + ) + ) & 1; + $i += $st; + } + } + + $mask = 0; + $tail = $xpadded_len; + for ($i = 0; $i < $blockSize; ++$i) { + # barrier_mask = (unsigned char) + # (((i ^ xpadlen) - 1U) >> ((sizeof(size_t) - 1U) * CHAR_BIT)); + $barrier_mask = (($i ^ $xpadlen) -1) >> ((PHP_INT_SIZE << 3) - 1); + # tail[-i] = (tail[-i] & mask) | (0x80 & barrier_mask); + $padded[$tail - $i] = ParagonIE_Sodium_Core_Util::intToChr( + (ParagonIE_Sodium_Core_Util::chrToInt($padded[$tail - $i]) & $mask) + | + (0x80 & $barrier_mask) + ); + # mask |= barrier_mask; + $mask |= $barrier_mask; + } + return $padded; + } + + /** + * @param string $padded + * @param int $blockSize + * @param bool $dontFallback + * @return string + * @throws SodiumException + */ + public static function unpad($padded, $blockSize, $dontFallback = false) + { + /* Type checks: */ + ParagonIE_Sodium_Core_Util::declareScalarType($padded, 'string', 1); + ParagonIE_Sodium_Core_Util::declareScalarType($blockSize, 'int', 2); + + $padded = (string) $padded; + $blockSize = (int) $blockSize; + + if (self::useNewSodiumAPI() && !$dontFallback) { + return (string) sodium_unpad($padded, $blockSize); + } + if ($blockSize <= 0) { + throw new SodiumException('block size cannot be less than 1'); + } + $padded_len = ParagonIE_Sodium_Core_Util::strlen($padded); + if ($padded_len < $blockSize) { + throw new SodiumException('invalid padding'); + } + + # tail = &padded[padded_len - 1U]; + $tail = $padded_len - 1; + + $acc = 0; + $valid = 0; + $pad_len = 0; + + $found = 0; + for ($i = 0; $i < $blockSize; ++$i) { + # c = tail[-i]; + $c = ParagonIE_Sodium_Core_Util::chrToInt($padded[$tail - $i]); + + # is_barrier = + # (( (acc - 1U) & (pad_len - 1U) & ((c ^ 0x80) - 1U) ) >> 8) & 1U; + $is_barrier = ( + ( + ($acc - 1) & ($pad_len - 1) & (($c ^ 80) - 1) + ) >> 7 + ) & 1; + $is_barrier &= ~$found; + $found |= $is_barrier; + + # acc |= c; + $acc |= $c; + + # pad_len |= i & (1U + ~is_barrier); + $pad_len |= $i & (1 + ~$is_barrier); + + # valid |= (unsigned char) is_barrier; + $valid |= ($is_barrier & 0xff); + } + # unpadded_len = padded_len - 1U - pad_len; + $unpadded_len = $padded_len - 1 - $pad_len; + if ($valid !== 1) { + throw new SodiumException('invalid padding'); + } + return ParagonIE_Sodium_Core_Util::substr($padded, 0, $unpadded_len); + } + + /** + * Will sodium_compat run fast on the current hardware and PHP configuration? + * + * @return bool + */ + public static function polyfill_is_fast() + { + if (extension_loaded('sodium')) { + return true; + } + if (extension_loaded('libsodium')) { + return true; + } + return PHP_INT_SIZE === 8; + } + + /** + * Generate a string of bytes from the kernel's CSPRNG. + * Proudly uses /dev/urandom (if getrandom(2) is not available). + * + * @param int $numBytes + * @return string + * @throws Exception + * @throws TypeError + */ + public static function randombytes_buf($numBytes) + { + /* Type checks: */ + if (!is_int($numBytes)) { + if (is_numeric($numBytes)) { + $numBytes = (int) $numBytes; + } else { + throw new TypeError( + 'Argument 1 must be an integer, ' . gettype($numBytes) . ' given.' + ); + } + } + if (self::use_fallback('randombytes_buf')) { + return (string) call_user_func('\\Sodium\\randombytes_buf', $numBytes); + } + return random_bytes($numBytes); + } + + /** + * Generate an integer between 0 and $range (non-inclusive). + * + * @param int $range + * @return int + * @throws Exception + * @throws Error + * @throws TypeError + */ + public static function randombytes_uniform($range) + { + /* Type checks: */ + if (!is_int($range)) { + if (is_numeric($range)) { + $range = (int) $range; + } else { + throw new TypeError( + 'Argument 1 must be an integer, ' . gettype($range) . ' given.' + ); + } + } + if (self::use_fallback('randombytes_uniform')) { + return (int) call_user_func('\\Sodium\\randombytes_uniform', $range); + } + return random_int(0, $range - 1); + } + + /** + * Generate a random 16-bit integer. + * + * @return int + * @throws Exception + * @throws Error + * @throws TypeError + */ + public static function randombytes_random16() + { + if (self::use_fallback('randombytes_random16')) { + return (int) call_user_func('\\Sodium\\randombytes_random16'); + } + return random_int(0, 65535); + } + + /** + * @param string $p + * @param bool $dontFallback + * @return bool + * @throws SodiumException + */ + public static function ristretto255_is_valid_point($p, $dontFallback = false) + { + if (self::useNewSodiumAPI() && !$dontFallback) { + return sodium_crypto_core_ristretto255_is_valid_point($p); + } + try { + $r = ParagonIE_Sodium_Core_Ristretto255::ristretto255_frombytes($p); + return $r['res'] === 0 && + ParagonIE_Sodium_Core_Ristretto255::ristretto255_point_is_canonical($p) === 1; + } catch (SodiumException $ex) { + if ($ex->getMessage() === 'S is not canonical') { + return false; + } + throw $ex; + } + } + + /** + * @param string $p + * @param string $q + * @param bool $dontFallback + * @return string + * @throws SodiumException + */ + public static function ristretto255_add($p, $q, $dontFallback = false) + { + if (self::useNewSodiumAPI() && !$dontFallback) { + return sodium_crypto_core_ristretto255_add($p, $q); + } + return ParagonIE_Sodium_Core_Ristretto255::ristretto255_add($p, $q); + } + + /** + * @param string $p + * @param string $q + * @param bool $dontFallback + * @return string + * @throws SodiumException + */ + public static function ristretto255_sub($p, $q, $dontFallback = false) + { + if (self::useNewSodiumAPI() && !$dontFallback) { + return sodium_crypto_core_ristretto255_sub($p, $q); + } + return ParagonIE_Sodium_Core_Ristretto255::ristretto255_sub($p, $q); + } + + /** + * @param string $r + * @param bool $dontFallback + * @return string + * + * @throws SodiumException + */ + public static function ristretto255_from_hash($r, $dontFallback = false) + { + if (self::useNewSodiumAPI() && !$dontFallback) { + return sodium_crypto_core_ristretto255_from_hash($r); + } + return ParagonIE_Sodium_Core_Ristretto255::ristretto255_from_hash($r); + } + + /** + * @param bool $dontFallback + * @return string + * + * @throws SodiumException + */ + public static function ristretto255_random($dontFallback = false) + { + if (self::useNewSodiumAPI() && !$dontFallback) { + return sodium_crypto_core_ristretto255_random(); + } + return ParagonIE_Sodium_Core_Ristretto255::ristretto255_random(); + } + + /** + * @param bool $dontFallback + * @return string + * + * @throws SodiumException + */ + public static function ristretto255_scalar_random($dontFallback = false) + { + if (self::useNewSodiumAPI() && !$dontFallback) { + return sodium_crypto_core_ristretto255_scalar_random(); + } + return ParagonIE_Sodium_Core_Ristretto255::ristretto255_scalar_random(); + } + + /** + * @param string $s + * @param bool $dontFallback + * @return string + * @throws SodiumException + */ + public static function ristretto255_scalar_invert($s, $dontFallback = false) + { + if (self::useNewSodiumAPI() && !$dontFallback) { + return sodium_crypto_core_ristretto255_scalar_invert($s); + } + return ParagonIE_Sodium_Core_Ristretto255::ristretto255_scalar_invert($s); + } + /** + * @param string $s + * @param bool $dontFallback + * @return string + * @throws SodiumException + */ + public static function ristretto255_scalar_negate($s, $dontFallback = false) + { + if (self::useNewSodiumAPI() && !$dontFallback) { + return sodium_crypto_core_ristretto255_scalar_negate($s); + } + return ParagonIE_Sodium_Core_Ristretto255::ristretto255_scalar_negate($s); + } + + /** + * @param string $s + * @param bool $dontFallback + * @return string + * @throws SodiumException + */ + public static function ristretto255_scalar_complement($s, $dontFallback = false) + { + if (self::useNewSodiumAPI() && !$dontFallback) { + return sodium_crypto_core_ristretto255_scalar_complement($s); + } + return ParagonIE_Sodium_Core_Ristretto255::ristretto255_scalar_complement($s); + } + + /** + * @param string $x + * @param string $y + * @param bool $dontFallback + * @return string + * @throws SodiumException + */ + public static function ristretto255_scalar_add($x, $y, $dontFallback = false) + { + if (self::useNewSodiumAPI() && !$dontFallback) { + return sodium_crypto_core_ristretto255_scalar_add($x, $y); + } + return ParagonIE_Sodium_Core_Ristretto255::ristretto255_scalar_add($x, $y); + } + + /** + * @param string $x + * @param string $y + * @param bool $dontFallback + * @return string + * @throws SodiumException + */ + public static function ristretto255_scalar_sub($x, $y, $dontFallback = false) + { + if (self::useNewSodiumAPI() && !$dontFallback) { + return sodium_crypto_core_ristretto255_scalar_sub($x, $y); + } + return ParagonIE_Sodium_Core_Ristretto255::ristretto255_scalar_sub($x, $y); + } + + /** + * @param string $x + * @param string $y + * @param bool $dontFallback + * @return string + * @throws SodiumException + */ + public static function ristretto255_scalar_mul($x, $y, $dontFallback = false) + { + if (self::useNewSodiumAPI() && !$dontFallback) { + return sodium_crypto_core_ristretto255_scalar_mul($x, $y); + } + return ParagonIE_Sodium_Core_Ristretto255::ristretto255_scalar_mul($x, $y); + } + + /** + * @param string $n + * @param string $p + * @param bool $dontFallback + * @return string + * @throws SodiumException + */ + public static function scalarmult_ristretto255($n, $p, $dontFallback = false) + { + if (self::useNewSodiumAPI() && !$dontFallback) { + return sodium_crypto_scalarmult_ristretto255($n, $p); + } + return ParagonIE_Sodium_Core_Ristretto255::scalarmult_ristretto255($n, $p); + } + + /** + * @param string $n + * @param string $p + * @param bool $dontFallback + * @return string + * @throws SodiumException + */ + public static function scalarmult_ristretto255_base($n, $dontFallback = false) + { + if (self::useNewSodiumAPI() && !$dontFallback) { + return sodium_crypto_scalarmult_ristretto255_base($n); + } + return ParagonIE_Sodium_Core_Ristretto255::scalarmult_ristretto255_base($n); + } + + /** + * @param string $s + * @param bool $dontFallback + * @return string + * @throws SodiumException + */ + public static function ristretto255_scalar_reduce($s, $dontFallback = false) + { + if (self::useNewSodiumAPI() && !$dontFallback) { + return sodium_crypto_core_ristretto255_scalar_reduce($s); + } + return ParagonIE_Sodium_Core_Ristretto255::sc_reduce($s); + } + + /** + * Runtime testing method for 32-bit platforms. + * + * Usage: If runtime_speed_test() returns FALSE, then our 32-bit + * implementation is to slow to use safely without risking timeouts. + * If this happens, install sodium from PECL to get acceptable + * performance. + * + * @param int $iterations Number of multiplications to attempt + * @param int $maxTimeout Milliseconds + * @return bool TRUE if we're fast enough, FALSE is not + * @throws SodiumException + */ + public static function runtime_speed_test($iterations, $maxTimeout) + { + if (self::polyfill_is_fast()) { + return true; + } + /** @var float $end */ + $end = 0.0; + /** @var float $start */ + $start = microtime(true); + /** @var ParagonIE_Sodium_Core32_Int64 $a */ + $a = ParagonIE_Sodium_Core32_Int64::fromInt(random_int(3, 1 << 16)); + for ($i = 0; $i < $iterations; ++$i) { + /** @var ParagonIE_Sodium_Core32_Int64 $b */ + $b = ParagonIE_Sodium_Core32_Int64::fromInt(random_int(3, 1 << 16)); + $a->mulInt64($b); + } + /** @var float $end */ + $end = microtime(true); + /** @var int $diff */ + $diff = (int) ceil(($end - $start) * 1000); + return $diff < $maxTimeout; + } + + /** + * Add two numbers (little-endian unsigned), storing the value in the first + * parameter. + * + * This mutates $val. + * + * @param string $val + * @param string $addv + * @return void + * @throws SodiumException + */ + public static function sub(&$val, $addv) + { + $val_len = ParagonIE_Sodium_Core_Util::strlen($val); + $addv_len = ParagonIE_Sodium_Core_Util::strlen($addv); + if ($val_len !== $addv_len) { + throw new SodiumException('values must have the same length'); + } + $A = ParagonIE_Sodium_Core_Util::stringToIntArray($val); + $B = ParagonIE_Sodium_Core_Util::stringToIntArray($addv); + + $c = 0; + for ($i = 0; $i < $val_len; $i++) { + $c = ($A[$i] - $B[$i] - $c); + $A[$i] = ($c & 0xff); + $c = ($c >> 8) & 1; + } + $val = ParagonIE_Sodium_Core_Util::intArrayToString($A); + } + + /** + * This emulates libsodium's version_string() function, except ours is + * prefixed with 'polyfill-'. + * + * @return string + * @psalm-suppress MixedInferredReturnType + * @psalm-suppress UndefinedFunction + */ + public static function version_string() + { + if (self::useNewSodiumAPI()) { + return (string) sodium_version_string(); + } + if (self::use_fallback('version_string')) { + return (string) call_user_func('\\Sodium\\version_string'); + } + return (string) self::VERSION_STRING; + } + + /** + * Should we use the libsodium core function instead? + * This is always a good idea, if it's available. (Unless we're in the + * middle of running our unit test suite.) + * + * If ext/libsodium is available, use it. Return TRUE. + * Otherwise, we have to use the code provided herein. Return FALSE. + * + * @param string $sodium_func_name + * + * @return bool + */ + protected static function use_fallback($sodium_func_name = '') + { + static $res = null; + if ($res === null) { + $res = extension_loaded('libsodium') && PHP_VERSION_ID >= 50300; + } + if ($res === false) { + // No libsodium installed + return false; + } + if (self::$disableFallbackForUnitTests) { + // Don't fallback. Use the PHP implementation. + return false; + } + if (!empty($sodium_func_name)) { + return is_callable('\\Sodium\\' . $sodium_func_name); + } + return true; + } + + /** + * Libsodium as implemented in PHP 7.2 + * and/or ext/sodium (via PECL) + * + * @ref https://wiki.php.net/rfc/libsodium + * @return bool + */ + protected static function useNewSodiumAPI() + { + static $res = null; + if ($res === null) { + $res = PHP_VERSION_ID >= 70000 && extension_loaded('sodium'); + } + if (self::$disableFallbackForUnitTests) { + // Don't fallback. Use the PHP implementation. + return false; + } + return (bool) $res; + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/BLAKE2b.php b/vendor/paragonie/sodium_compat/src/Core/BLAKE2b.php new file mode 100644 index 0000000..99bae98 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/BLAKE2b.php @@ -0,0 +1,790 @@ +> + */ + protected static $sigma = array( + array( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15), + array( 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3), + array( 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4), + array( 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8), + array( 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13), + array( 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9), + array( 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11), + array( 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10), + array( 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5), + array( 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0), + array( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15), + array( 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3) + ); + + const BLOCKBYTES = 128; + const OUTBYTES = 64; + const KEYBYTES = 64; + + /** + * Turn two 32-bit integers into a fixed array representing a 64-bit integer. + * + * @internal You should not use this directly from another application + * + * @param int $high + * @param int $low + * @return SplFixedArray + * @psalm-suppress MixedAssignment + */ + public static function new64($high, $low) + { + $i64 = new SplFixedArray(2); + $i64[0] = $high & 0xffffffff; + $i64[1] = $low & 0xffffffff; + return $i64; + } + + /** + * Convert an arbitrary number into an SplFixedArray of two 32-bit integers + * that represents a 64-bit integer. + * + * @internal You should not use this directly from another application + * + * @param int $num + * @return SplFixedArray + */ + protected static function to64($num) + { + list($hi, $lo) = self::numericTo64BitInteger($num); + return self::new64($hi, $lo); + } + + /** + * Adds two 64-bit integers together, returning their sum as a SplFixedArray + * containing two 32-bit integers (representing a 64-bit integer). + * + * @internal You should not use this directly from another application + * + * @param SplFixedArray $x + * @param SplFixedArray $y + * @return SplFixedArray + * @psalm-suppress MixedArgument + * @psalm-suppress MixedAssignment + * @psalm-suppress MixedOperand + */ + protected static function add64($x, $y) + { + $l = ($x[1] + $y[1]) & 0xffffffff; + return self::new64( + (int) ($x[0] + $y[0] + ( + ($l < $x[1]) ? 1 : 0 + )), + (int) $l + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param SplFixedArray $x + * @param SplFixedArray $y + * @param SplFixedArray $z + * @return SplFixedArray + */ + protected static function add364($x, $y, $z) + { + return self::add64($x, self::add64($y, $z)); + } + + /** + * @internal You should not use this directly from another application + * + * @param SplFixedArray $x + * @param SplFixedArray $y + * @return SplFixedArray + * @throws SodiumException + * @throws TypeError + */ + protected static function xor64(SplFixedArray $x, SplFixedArray $y) + { + if (!is_numeric($x[0])) { + throw new SodiumException('x[0] is not an integer'); + } + if (!is_numeric($x[1])) { + throw new SodiumException('x[1] is not an integer'); + } + if (!is_numeric($y[0])) { + throw new SodiumException('y[0] is not an integer'); + } + if (!is_numeric($y[1])) { + throw new SodiumException('y[1] is not an integer'); + } + return self::new64( + (int) (($x[0] ^ $y[0]) & 0xffffffff), + (int) (($x[1] ^ $y[1]) & 0xffffffff) + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param SplFixedArray $x + * @param int $c + * @return SplFixedArray + * @psalm-suppress MixedAssignment + */ + public static function rotr64($x, $c) + { + if ($c >= 64) { + $c %= 64; + } + if ($c >= 32) { + /** @var int $tmp */ + $tmp = $x[0]; + $x[0] = $x[1]; + $x[1] = $tmp; + $c -= 32; + } + if ($c === 0) { + return $x; + } + + $l0 = 0; + $c = 64 - $c; + + if ($c < 32) { + /** @var int $h0 */ + $h0 = ((int) ($x[0]) << $c) | ( + ( + (int) ($x[1]) & ((1 << $c) - 1) + << + (32 - $c) + ) >> (32 - $c) + ); + /** @var int $l0 */ + $l0 = (int) ($x[1]) << $c; + } else { + /** @var int $h0 */ + $h0 = (int) ($x[1]) << ($c - 32); + } + + $h1 = 0; + $c1 = 64 - $c; + + if ($c1 < 32) { + /** @var int $h1 */ + $h1 = (int) ($x[0]) >> $c1; + /** @var int $l1 */ + $l1 = ((int) ($x[1]) >> $c1) | ((int) ($x[0]) & ((1 << $c1) - 1)) << (32 - $c1); + } else { + /** @var int $l1 */ + $l1 = (int) ($x[0]) >> ($c1 - 32); + } + + return self::new64($h0 | $h1, $l0 | $l1); + } + + /** + * @internal You should not use this directly from another application + * + * @param SplFixedArray $x + * @return int + * @psalm-suppress MixedOperand + */ + protected static function flatten64($x) + { + return (int) ($x[0] * 4294967296 + $x[1]); + } + + /** + * @internal You should not use this directly from another application + * + * @param SplFixedArray $x + * @param int $i + * @return SplFixedArray + * @psalm-suppress MixedArgument + * @psalm-suppress MixedArrayOffset + */ + protected static function load64(SplFixedArray $x, $i) + { + /** @var int $l */ + $l = (int) ($x[$i]) + | ((int) ($x[$i+1]) << 8) + | ((int) ($x[$i+2]) << 16) + | ((int) ($x[$i+3]) << 24); + /** @var int $h */ + $h = (int) ($x[$i+4]) + | ((int) ($x[$i+5]) << 8) + | ((int) ($x[$i+6]) << 16) + | ((int) ($x[$i+7]) << 24); + return self::new64($h, $l); + } + + /** + * @internal You should not use this directly from another application + * + * @param SplFixedArray $x + * @param int $i + * @param SplFixedArray $u + * @return void + * @psalm-suppress MixedAssignment + */ + protected static function store64(SplFixedArray $x, $i, SplFixedArray $u) + { + $maxLength = $x->getSize() - 1; + for ($j = 0; $j < 8; ++$j) { + /* + [0, 1, 2, 3, 4, 5, 6, 7] + ... becomes ... + [0, 0, 0, 0, 1, 1, 1, 1] + */ + /** @var int $uIdx */ + $uIdx = ((7 - $j) & 4) >> 2; + $x[$i] = ((int) ($u[$uIdx]) & 0xff); + if (++$i > $maxLength) { + return; + } + /** @psalm-suppress MixedOperand */ + $u[$uIdx] >>= 8; + } + } + + /** + * This just sets the $iv static variable. + * + * @internal You should not use this directly from another application + * + * @return void + */ + public static function pseudoConstructor() + { + static $called = false; + if ($called) { + return; + } + self::$iv = new SplFixedArray(8); + self::$iv[0] = self::new64(0x6a09e667, 0xf3bcc908); + self::$iv[1] = self::new64(0xbb67ae85, 0x84caa73b); + self::$iv[2] = self::new64(0x3c6ef372, 0xfe94f82b); + self::$iv[3] = self::new64(0xa54ff53a, 0x5f1d36f1); + self::$iv[4] = self::new64(0x510e527f, 0xade682d1); + self::$iv[5] = self::new64(0x9b05688c, 0x2b3e6c1f); + self::$iv[6] = self::new64(0x1f83d9ab, 0xfb41bd6b); + self::$iv[7] = self::new64(0x5be0cd19, 0x137e2179); + + $called = true; + } + + /** + * Returns a fresh BLAKE2 context. + * + * @internal You should not use this directly from another application + * + * @return SplFixedArray + * @psalm-suppress MixedAssignment + * @psalm-suppress MixedArrayAccess + * @psalm-suppress MixedArrayAssignment + */ + protected static function context() + { + $ctx = new SplFixedArray(6); + $ctx[0] = new SplFixedArray(8); // h + $ctx[1] = new SplFixedArray(2); // t + $ctx[2] = new SplFixedArray(2); // f + $ctx[3] = new SplFixedArray(256); // buf + $ctx[4] = 0; // buflen + $ctx[5] = 0; // last_node (uint8_t) + + for ($i = 8; $i--;) { + $ctx[0][$i] = self::$iv[$i]; + } + for ($i = 256; $i--;) { + $ctx[3][$i] = 0; + } + + $zero = self::new64(0, 0); + $ctx[1][0] = $zero; + $ctx[1][1] = $zero; + $ctx[2][0] = $zero; + $ctx[2][1] = $zero; + + return $ctx; + } + + /** + * @internal You should not use this directly from another application + * + * @param SplFixedArray $ctx + * @param SplFixedArray $buf + * @return void + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedAssignment + * @psalm-suppress MixedArrayAccess + * @psalm-suppress MixedArrayAssignment + * @psalm-suppress MixedArrayOffset + */ + protected static function compress(SplFixedArray $ctx, SplFixedArray $buf) + { + $m = new SplFixedArray(16); + $v = new SplFixedArray(16); + + for ($i = 16; $i--;) { + $m[$i] = self::load64($buf, $i << 3); + } + + for ($i = 8; $i--;) { + $v[$i] = $ctx[0][$i]; + } + + $v[ 8] = self::$iv[0]; + $v[ 9] = self::$iv[1]; + $v[10] = self::$iv[2]; + $v[11] = self::$iv[3]; + + $v[12] = self::xor64($ctx[1][0], self::$iv[4]); + $v[13] = self::xor64($ctx[1][1], self::$iv[5]); + $v[14] = self::xor64($ctx[2][0], self::$iv[6]); + $v[15] = self::xor64($ctx[2][1], self::$iv[7]); + + for ($r = 0; $r < 12; ++$r) { + $v = self::G($r, 0, 0, 4, 8, 12, $v, $m); + $v = self::G($r, 1, 1, 5, 9, 13, $v, $m); + $v = self::G($r, 2, 2, 6, 10, 14, $v, $m); + $v = self::G($r, 3, 3, 7, 11, 15, $v, $m); + $v = self::G($r, 4, 0, 5, 10, 15, $v, $m); + $v = self::G($r, 5, 1, 6, 11, 12, $v, $m); + $v = self::G($r, 6, 2, 7, 8, 13, $v, $m); + $v = self::G($r, 7, 3, 4, 9, 14, $v, $m); + } + + for ($i = 8; $i--;) { + $ctx[0][$i] = self::xor64( + $ctx[0][$i], self::xor64($v[$i], $v[$i+8]) + ); + } + } + + /** + * @internal You should not use this directly from another application + * + * @param int $r + * @param int $i + * @param int $a + * @param int $b + * @param int $c + * @param int $d + * @param SplFixedArray $v + * @param SplFixedArray $m + * @return SplFixedArray + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedArrayOffset + */ + public static function G($r, $i, $a, $b, $c, $d, SplFixedArray $v, SplFixedArray $m) + { + $v[$a] = self::add364($v[$a], $v[$b], $m[self::$sigma[$r][$i << 1]]); + $v[$d] = self::rotr64(self::xor64($v[$d], $v[$a]), 32); + $v[$c] = self::add64($v[$c], $v[$d]); + $v[$b] = self::rotr64(self::xor64($v[$b], $v[$c]), 24); + $v[$a] = self::add364($v[$a], $v[$b], $m[self::$sigma[$r][($i << 1) + 1]]); + $v[$d] = self::rotr64(self::xor64($v[$d], $v[$a]), 16); + $v[$c] = self::add64($v[$c], $v[$d]); + $v[$b] = self::rotr64(self::xor64($v[$b], $v[$c]), 63); + return $v; + } + + /** + * @internal You should not use this directly from another application + * + * @param SplFixedArray $ctx + * @param int $inc + * @return void + * @throws SodiumException + * @psalm-suppress MixedArgument + * @psalm-suppress MixedArrayAccess + * @psalm-suppress MixedArrayAssignment + */ + public static function increment_counter($ctx, $inc) + { + if ($inc < 0) { + throw new SodiumException('Increasing by a negative number makes no sense.'); + } + $t = self::to64($inc); + # S->t is $ctx[1] in our implementation + + # S->t[0] = ( uint64_t )( t >> 0 ); + $ctx[1][0] = self::add64($ctx[1][0], $t); + + # S->t[1] += ( S->t[0] < inc ); + if (self::flatten64($ctx[1][0]) < $inc) { + $ctx[1][1] = self::add64($ctx[1][1], self::to64(1)); + } + } + + /** + * @internal You should not use this directly from another application + * + * @param SplFixedArray $ctx + * @param SplFixedArray $p + * @param int $plen + * @return void + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedAssignment + * @psalm-suppress MixedArrayAccess + * @psalm-suppress MixedArrayAssignment + * @psalm-suppress MixedArrayOffset + * @psalm-suppress MixedOperand + */ + public static function update(SplFixedArray $ctx, SplFixedArray $p, $plen) + { + self::pseudoConstructor(); + + $offset = 0; + while ($plen > 0) { + $left = $ctx[4]; + $fill = 256 - $left; + + if ($plen > $fill) { + # memcpy( S->buf + left, in, fill ); /* Fill buffer */ + for ($i = $fill; $i--;) { + $ctx[3][$i + $left] = $p[$i + $offset]; + } + + # S->buflen += fill; + $ctx[4] += $fill; + + # blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES ); + self::increment_counter($ctx, 128); + + # blake2b_compress( S, S->buf ); /* Compress */ + self::compress($ctx, $ctx[3]); + + # memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, BLAKE2B_BLOCKBYTES ); /* Shift buffer left */ + for ($i = 128; $i--;) { + $ctx[3][$i] = $ctx[3][$i + 128]; + } + + # S->buflen -= BLAKE2B_BLOCKBYTES; + $ctx[4] -= 128; + + # in += fill; + $offset += $fill; + + # inlen -= fill; + $plen -= $fill; + } else { + for ($i = $plen; $i--;) { + $ctx[3][$i + $left] = $p[$i + $offset]; + } + $ctx[4] += $plen; + $offset += $plen; + $plen -= $plen; + } + } + } + + /** + * @internal You should not use this directly from another application + * + * @param SplFixedArray $ctx + * @param SplFixedArray $out + * @return SplFixedArray + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedAssignment + * @psalm-suppress MixedArrayAccess + * @psalm-suppress MixedArrayAssignment + * @psalm-suppress MixedArrayOffset + * @psalm-suppress MixedOperand + */ + public static function finish(SplFixedArray $ctx, SplFixedArray $out) + { + self::pseudoConstructor(); + if ($ctx[4] > 128) { + self::increment_counter($ctx, 128); + self::compress($ctx, $ctx[3]); + $ctx[4] -= 128; + if ($ctx[4] > 128) { + throw new SodiumException('Failed to assert that buflen <= 128 bytes'); + } + for ($i = $ctx[4]; $i--;) { + $ctx[3][$i] = $ctx[3][$i + 128]; + } + } + + self::increment_counter($ctx, $ctx[4]); + $ctx[2][0] = self::new64(0xffffffff, 0xffffffff); + + for ($i = 256 - $ctx[4]; $i--;) { + $ctx[3][$i+$ctx[4]] = 0; + } + + self::compress($ctx, $ctx[3]); + + $i = (int) (($out->getSize() - 1) / 8); + for (; $i >= 0; --$i) { + self::store64($out, $i << 3, $ctx[0][$i]); + } + return $out; + } + + /** + * @internal You should not use this directly from another application + * + * @param SplFixedArray|null $key + * @param int $outlen + * @param SplFixedArray|null $salt + * @param SplFixedArray|null $personal + * @return SplFixedArray + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedAssignment + * @psalm-suppress MixedArrayAccess + * @psalm-suppress MixedArrayAssignment + * @psalm-suppress MixedArrayOffset + */ + public static function init( + $key = null, + $outlen = 64, + $salt = null, + $personal = null + ) { + self::pseudoConstructor(); + $klen = 0; + + if ($key !== null) { + if (count($key) > 64) { + throw new SodiumException('Invalid key size'); + } + $klen = count($key); + } + + if ($outlen > 64) { + throw new SodiumException('Invalid output size'); + } + + $ctx = self::context(); + + $p = new SplFixedArray(64); + // Zero our param buffer... + for ($i = 64; --$i;) { + $p[$i] = 0; + } + + $p[0] = $outlen; // digest_length + $p[1] = $klen; // key_length + $p[2] = 1; // fanout + $p[3] = 1; // depth + + if ($salt instanceof SplFixedArray) { + // salt: [32] through [47] + for ($i = 0; $i < 16; ++$i) { + $p[32 + $i] = (int) $salt[$i]; + } + } + if ($personal instanceof SplFixedArray) { + // personal: [48] through [63] + for ($i = 0; $i < 16; ++$i) { + $p[48 + $i] = (int) $personal[$i]; + } + } + + $ctx[0][0] = self::xor64( + $ctx[0][0], + self::load64($p, 0) + ); + if ($salt instanceof SplFixedArray || $personal instanceof SplFixedArray) { + // We need to do what blake2b_init_param() does: + for ($i = 1; $i < 8; ++$i) { + $ctx[0][$i] = self::xor64( + $ctx[0][$i], + self::load64($p, $i << 3) + ); + } + } + + if ($klen > 0 && $key instanceof SplFixedArray) { + $block = new SplFixedArray(128); + for ($i = 128; $i--;) { + $block[$i] = 0; + } + for ($i = $klen; $i--;) { + $block[$i] = $key[$i]; + } + self::update($ctx, $block, 128); + $ctx[4] = 128; + } + + return $ctx; + } + + /** + * Convert a string into an SplFixedArray of integers + * + * @internal You should not use this directly from another application + * + * @param string $str + * @return SplFixedArray + * @psalm-suppress MixedArgumentTypeCoercion + */ + public static function stringToSplFixedArray($str = '') + { + $values = unpack('C*', $str); + return SplFixedArray::fromArray(array_values($values)); + } + + /** + * Convert an SplFixedArray of integers into a string + * + * @internal You should not use this directly from another application + * + * @param SplFixedArray $a + * @return string + * @throws TypeError + */ + public static function SplFixedArrayToString(SplFixedArray $a) + { + /** + * @var array $arr + */ + $arr = $a->toArray(); + $c = $a->count(); + array_unshift($arr, str_repeat('C', $c)); + return (string) (call_user_func_array('pack', $arr)); + } + + /** + * @internal You should not use this directly from another application + * + * @param SplFixedArray $ctx + * @return string + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedAssignment + * @psalm-suppress MixedArrayAccess + * @psalm-suppress MixedArrayAssignment + * @psalm-suppress MixedArrayOffset + * @psalm-suppress MixedMethodCall + */ + public static function contextToString(SplFixedArray $ctx) + { + $str = ''; + /** @var array> $ctxA */ + $ctxA = $ctx[0]->toArray(); + + # uint64_t h[8]; + for ($i = 0; $i < 8; ++$i) { + $str .= self::store32_le($ctxA[$i][1]); + $str .= self::store32_le($ctxA[$i][0]); + } + + # uint64_t t[2]; + # uint64_t f[2]; + for ($i = 1; $i < 3; ++$i) { + $ctxA = $ctx[$i]->toArray(); + $str .= self::store32_le($ctxA[0][1]); + $str .= self::store32_le($ctxA[0][0]); + $str .= self::store32_le($ctxA[1][1]); + $str .= self::store32_le($ctxA[1][0]); + } + + # uint8_t buf[2 * 128]; + $str .= self::SplFixedArrayToString($ctx[3]); + + /** @var int $ctx4 */ + $ctx4 = (int) $ctx[4]; + + # size_t buflen; + $str .= implode('', array( + self::intToChr($ctx4 & 0xff), + self::intToChr(($ctx4 >> 8) & 0xff), + self::intToChr(($ctx4 >> 16) & 0xff), + self::intToChr(($ctx4 >> 24) & 0xff), + self::intToChr(($ctx4 >> 32) & 0xff), + self::intToChr(($ctx4 >> 40) & 0xff), + self::intToChr(($ctx4 >> 48) & 0xff), + self::intToChr(($ctx4 >> 56) & 0xff) + )); + # uint8_t last_node; + return $str . self::intToChr($ctx[5]) . str_repeat("\x00", 23); + } + + /** + * Creates an SplFixedArray containing other SplFixedArray elements, from + * a string (compatible with \Sodium\crypto_generichash_{init, update, final}) + * + * @internal You should not use this directly from another application + * + * @param string $string + * @return SplFixedArray + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArrayAssignment + */ + public static function stringToContext($string) + { + $ctx = self::context(); + + # uint64_t h[8]; + for ($i = 0; $i < 8; ++$i) { + $ctx[0][$i] = SplFixedArray::fromArray( + array( + self::load_4( + self::substr($string, (($i << 3) + 4), 4) + ), + self::load_4( + self::substr($string, (($i << 3) + 0), 4) + ) + ) + ); + } + + # uint64_t t[2]; + # uint64_t f[2]; + for ($i = 1; $i < 3; ++$i) { + $ctx[$i][1] = SplFixedArray::fromArray( + array( + self::load_4(self::substr($string, 76 + (($i - 1) << 4), 4)), + self::load_4(self::substr($string, 72 + (($i - 1) << 4), 4)) + ) + ); + $ctx[$i][0] = SplFixedArray::fromArray( + array( + self::load_4(self::substr($string, 68 + (($i - 1) << 4), 4)), + self::load_4(self::substr($string, 64 + (($i - 1) << 4), 4)) + ) + ); + } + + # uint8_t buf[2 * 128]; + $ctx[3] = self::stringToSplFixedArray(self::substr($string, 96, 256)); + + # uint8_t buf[2 * 128]; + $int = 0; + for ($i = 0; $i < 8; ++$i) { + $int |= self::chrToInt($string[352 + $i]) << ($i << 3); + } + $ctx[4] = $int; + + return $ctx; + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/Base64/Common.php b/vendor/paragonie/sodium_compat/src/Core/Base64/Common.php new file mode 100644 index 0000000..94b2e8f --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/Base64/Common.php @@ -0,0 +1,213 @@ + $chunk */ + $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, 3)); + $b0 = $chunk[1]; + $b1 = $chunk[2]; + $b2 = $chunk[3]; + + $dest .= + self::encode6Bits( $b0 >> 2 ) . + self::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) . + self::encode6Bits((($b1 << 2) | ($b2 >> 6)) & 63) . + self::encode6Bits( $b2 & 63); + } + // The last chunk, which may have padding: + if ($i < $srcLen) { + /** @var array $chunk */ + $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, $srcLen - $i)); + $b0 = $chunk[1]; + if ($i + 1 < $srcLen) { + $b1 = $chunk[2]; + $dest .= + self::encode6Bits($b0 >> 2) . + self::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) . + self::encode6Bits(($b1 << 2) & 63); + if ($pad) { + $dest .= '='; + } + } else { + $dest .= + self::encode6Bits( $b0 >> 2) . + self::encode6Bits(($b0 << 4) & 63); + if ($pad) { + $dest .= '=='; + } + } + } + return $dest; + } + + /** + * decode from base64 into binary + * + * Base64 character set "./[A-Z][a-z][0-9]" + * + * @param string $src + * @param bool $strictPadding + * @return string + * @throws RangeException + * @throws TypeError + * @psalm-suppress RedundantCondition + */ + public static function decode($src, $strictPadding = false) + { + // Remove padding + $srcLen = ParagonIE_Sodium_Core_Util::strlen($src); + if ($srcLen === 0) { + return ''; + } + + if ($strictPadding) { + if (($srcLen & 3) === 0) { + if ($src[$srcLen - 1] === '=') { + $srcLen--; + if ($src[$srcLen - 1] === '=') { + $srcLen--; + } + } + } + if (($srcLen & 3) === 1) { + throw new RangeException( + 'Incorrect padding' + ); + } + if ($src[$srcLen - 1] === '=') { + throw new RangeException( + 'Incorrect padding' + ); + } + } else { + $src = rtrim($src, '='); + $srcLen = ParagonIE_Sodium_Core_Util::strlen($src); + } + + $err = 0; + $dest = ''; + // Main loop (no padding): + for ($i = 0; $i + 4 <= $srcLen; $i += 4) { + /** @var array $chunk */ + $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, 4)); + $c0 = self::decode6Bits($chunk[1]); + $c1 = self::decode6Bits($chunk[2]); + $c2 = self::decode6Bits($chunk[3]); + $c3 = self::decode6Bits($chunk[4]); + + $dest .= pack( + 'CCC', + ((($c0 << 2) | ($c1 >> 4)) & 0xff), + ((($c1 << 4) | ($c2 >> 2)) & 0xff), + ((($c2 << 6) | $c3 ) & 0xff) + ); + $err |= ($c0 | $c1 | $c2 | $c3) >> 8; + } + // The last chunk, which may have padding: + if ($i < $srcLen) { + /** @var array $chunk */ + $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, $srcLen - $i)); + $c0 = self::decode6Bits($chunk[1]); + + if ($i + 2 < $srcLen) { + $c1 = self::decode6Bits($chunk[2]); + $c2 = self::decode6Bits($chunk[3]); + $dest .= pack( + 'CC', + ((($c0 << 2) | ($c1 >> 4)) & 0xff), + ((($c1 << 4) | ($c2 >> 2)) & 0xff) + ); + $err |= ($c0 | $c1 | $c2) >> 8; + } elseif ($i + 1 < $srcLen) { + $c1 = self::decode6Bits($chunk[2]); + $dest .= pack( + 'C', + ((($c0 << 2) | ($c1 >> 4)) & 0xff) + ); + $err |= ($c0 | $c1) >> 8; + } elseif ($i < $srcLen && $strictPadding) { + $err |= 1; + } + } + /** @var bool $check */ + $check = ($err === 0); + if (!$check) { + throw new RangeException( + 'Base64::decode() only expects characters in the correct base64 alphabet' + ); + } + return $dest; + } + + /** + * Uses bitwise operators instead of table-lookups to turn 6-bit integers + * into 8-bit integers. + * + * Base64 character set: + * [A-Z] [a-z] [0-9] + / + * 0x41-0x5a, 0x61-0x7a, 0x30-0x39, 0x2b, 0x2f + * + * @param int $src + * @return int + */ + abstract protected static function decode6Bits($src); + + /** + * Uses bitwise operators instead of table-lookups to turn 8-bit integers + * into 6-bit integers. + * + * @param int $src + * @return string + */ + abstract protected static function encode6Bits($src); +} diff --git a/vendor/paragonie/sodium_compat/src/Core/Base64/Original.php b/vendor/paragonie/sodium_compat/src/Core/Base64/Original.php new file mode 100644 index 0000000..dc939ee --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/Base64/Original.php @@ -0,0 +1,248 @@ + $chunk */ + $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, 3)); + $b0 = $chunk[1]; + $b1 = $chunk[2]; + $b2 = $chunk[3]; + + $dest .= + self::encode6Bits( $b0 >> 2 ) . + self::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) . + self::encode6Bits((($b1 << 2) | ($b2 >> 6)) & 63) . + self::encode6Bits( $b2 & 63); + } + // The last chunk, which may have padding: + if ($i < $srcLen) { + /** @var array $chunk */ + $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, $srcLen - $i)); + $b0 = $chunk[1]; + if ($i + 1 < $srcLen) { + $b1 = $chunk[2]; + $dest .= + self::encode6Bits($b0 >> 2) . + self::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) . + self::encode6Bits(($b1 << 2) & 63); + if ($pad) { + $dest .= '='; + } + } else { + $dest .= + self::encode6Bits( $b0 >> 2) . + self::encode6Bits(($b0 << 4) & 63); + if ($pad) { + $dest .= '=='; + } + } + } + return $dest; + } + + /** + * decode from base64 into binary + * + * Base64 character set "./[A-Z][a-z][0-9]" + * + * @param string $src + * @param bool $strictPadding + * @return string + * @throws RangeException + * @throws TypeError + * @psalm-suppress RedundantCondition + */ + public static function decode($src, $strictPadding = false) + { + // Remove padding + $srcLen = ParagonIE_Sodium_Core_Util::strlen($src); + if ($srcLen === 0) { + return ''; + } + + if ($strictPadding) { + if (($srcLen & 3) === 0) { + if ($src[$srcLen - 1] === '=') { + $srcLen--; + if ($src[$srcLen - 1] === '=') { + $srcLen--; + } + } + } + if (($srcLen & 3) === 1) { + throw new RangeException( + 'Incorrect padding' + ); + } + if ($src[$srcLen - 1] === '=') { + throw new RangeException( + 'Incorrect padding' + ); + } + } else { + $src = rtrim($src, '='); + $srcLen = ParagonIE_Sodium_Core_Util::strlen($src); + } + + $err = 0; + $dest = ''; + // Main loop (no padding): + for ($i = 0; $i + 4 <= $srcLen; $i += 4) { + /** @var array $chunk */ + $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, 4)); + $c0 = self::decode6Bits($chunk[1]); + $c1 = self::decode6Bits($chunk[2]); + $c2 = self::decode6Bits($chunk[3]); + $c3 = self::decode6Bits($chunk[4]); + + $dest .= pack( + 'CCC', + ((($c0 << 2) | ($c1 >> 4)) & 0xff), + ((($c1 << 4) | ($c2 >> 2)) & 0xff), + ((($c2 << 6) | $c3) & 0xff) + ); + $err |= ($c0 | $c1 | $c2 | $c3) >> 8; + } + // The last chunk, which may have padding: + if ($i < $srcLen) { + /** @var array $chunk */ + $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, $srcLen - $i)); + $c0 = self::decode6Bits($chunk[1]); + + if ($i + 2 < $srcLen) { + $c1 = self::decode6Bits($chunk[2]); + $c2 = self::decode6Bits($chunk[3]); + $dest .= pack( + 'CC', + ((($c0 << 2) | ($c1 >> 4)) & 0xff), + ((($c1 << 4) | ($c2 >> 2)) & 0xff) + ); + $err |= ($c0 | $c1 | $c2) >> 8; + } elseif ($i + 1 < $srcLen) { + $c1 = self::decode6Bits($chunk[2]); + $dest .= pack( + 'C', + ((($c0 << 2) | ($c1 >> 4)) & 0xff) + ); + $err |= ($c0 | $c1) >> 8; + } elseif ($i < $srcLen && $strictPadding) { + $err |= 1; + } + } + /** @var bool $check */ + $check = ($err === 0); + if (!$check) { + throw new RangeException( + 'Base64::decode() only expects characters in the correct base64 alphabet' + ); + } + return $dest; + } + // COPY ParagonIE_Sodium_Core_Base64_Common ENDING HERE + + /** + * Uses bitwise operators instead of table-lookups to turn 6-bit integers + * into 8-bit integers. + * + * Base64 character set: + * [A-Z] [a-z] [0-9] + / + * 0x41-0x5a, 0x61-0x7a, 0x30-0x39, 0x2b, 0x2f + * + * @param int $src + * @return int + */ + protected static function decode6Bits($src) + { + $ret = -1; + + // if ($src > 0x40 && $src < 0x5b) $ret += $src - 0x41 + 1; // -64 + $ret += (((0x40 - $src) & ($src - 0x5b)) >> 8) & ($src - 64); + + // if ($src > 0x60 && $src < 0x7b) $ret += $src - 0x61 + 26 + 1; // -70 + $ret += (((0x60 - $src) & ($src - 0x7b)) >> 8) & ($src - 70); + + // if ($src > 0x2f && $src < 0x3a) $ret += $src - 0x30 + 52 + 1; // 5 + $ret += (((0x2f - $src) & ($src - 0x3a)) >> 8) & ($src + 5); + + // if ($src == 0x2b) $ret += 62 + 1; + $ret += (((0x2a - $src) & ($src - 0x2c)) >> 8) & 63; + + // if ($src == 0x2f) ret += 63 + 1; + $ret += (((0x2e - $src) & ($src - 0x30)) >> 8) & 64; + + return $ret; + } + + /** + * Uses bitwise operators instead of table-lookups to turn 8-bit integers + * into 6-bit integers. + * + * @param int $src + * @return string + */ + protected static function encode6Bits($src) + { + $diff = 0x41; + + // if ($src > 25) $diff += 0x61 - 0x41 - 26; // 6 + $diff += ((25 - $src) >> 8) & 6; + + // if ($src > 51) $diff += 0x30 - 0x61 - 26; // -75 + $diff -= ((51 - $src) >> 8) & 75; + + // if ($src > 61) $diff += 0x2b - 0x30 - 10; // -15 + $diff -= ((61 - $src) >> 8) & 15; + + // if ($src > 62) $diff += 0x2f - 0x2b - 1; // 3 + $diff += ((62 - $src) >> 8) & 3; + + return pack('C', $src + $diff); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/Base64/UrlSafe.php b/vendor/paragonie/sodium_compat/src/Core/Base64/UrlSafe.php new file mode 100644 index 0000000..64bf53b --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/Base64/UrlSafe.php @@ -0,0 +1,247 @@ + $chunk */ + $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, 3)); + $b0 = $chunk[1]; + $b1 = $chunk[2]; + $b2 = $chunk[3]; + + $dest .= + self::encode6Bits( $b0 >> 2 ) . + self::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) . + self::encode6Bits((($b1 << 2) | ($b2 >> 6)) & 63) . + self::encode6Bits( $b2 & 63); + } + // The last chunk, which may have padding: + if ($i < $srcLen) { + /** @var array $chunk */ + $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, $srcLen - $i)); + $b0 = $chunk[1]; + if ($i + 1 < $srcLen) { + $b1 = $chunk[2]; + $dest .= + self::encode6Bits($b0 >> 2) . + self::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) . + self::encode6Bits(($b1 << 2) & 63); + if ($pad) { + $dest .= '='; + } + } else { + $dest .= + self::encode6Bits( $b0 >> 2) . + self::encode6Bits(($b0 << 4) & 63); + if ($pad) { + $dest .= '=='; + } + } + } + return $dest; + } + + /** + * decode from base64 into binary + * + * Base64 character set "./[A-Z][a-z][0-9]" + * + * @param string $src + * @param bool $strictPadding + * @return string + * @throws RangeException + * @throws TypeError + * @psalm-suppress RedundantCondition + */ + public static function decode($src, $strictPadding = false) + { + // Remove padding + $srcLen = ParagonIE_Sodium_Core_Util::strlen($src); + if ($srcLen === 0) { + return ''; + } + + if ($strictPadding) { + if (($srcLen & 3) === 0) { + if ($src[$srcLen - 1] === '=') { + $srcLen--; + if ($src[$srcLen - 1] === '=') { + $srcLen--; + } + } + } + if (($srcLen & 3) === 1) { + throw new RangeException( + 'Incorrect padding' + ); + } + if ($src[$srcLen - 1] === '=') { + throw new RangeException( + 'Incorrect padding' + ); + } + } else { + $src = rtrim($src, '='); + $srcLen = ParagonIE_Sodium_Core_Util::strlen($src); + } + + $err = 0; + $dest = ''; + // Main loop (no padding): + for ($i = 0; $i + 4 <= $srcLen; $i += 4) { + /** @var array $chunk */ + $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, 4)); + $c0 = self::decode6Bits($chunk[1]); + $c1 = self::decode6Bits($chunk[2]); + $c2 = self::decode6Bits($chunk[3]); + $c3 = self::decode6Bits($chunk[4]); + + $dest .= pack( + 'CCC', + ((($c0 << 2) | ($c1 >> 4)) & 0xff), + ((($c1 << 4) | ($c2 >> 2)) & 0xff), + ((($c2 << 6) | $c3) & 0xff) + ); + $err |= ($c0 | $c1 | $c2 | $c3) >> 8; + } + // The last chunk, which may have padding: + if ($i < $srcLen) { + /** @var array $chunk */ + $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, $srcLen - $i)); + $c0 = self::decode6Bits($chunk[1]); + + if ($i + 2 < $srcLen) { + $c1 = self::decode6Bits($chunk[2]); + $c2 = self::decode6Bits($chunk[3]); + $dest .= pack( + 'CC', + ((($c0 << 2) | ($c1 >> 4)) & 0xff), + ((($c1 << 4) | ($c2 >> 2)) & 0xff) + ); + $err |= ($c0 | $c1 | $c2) >> 8; + } elseif ($i + 1 < $srcLen) { + $c1 = self::decode6Bits($chunk[2]); + $dest .= pack( + 'C', + ((($c0 << 2) | ($c1 >> 4)) & 0xff) + ); + $err |= ($c0 | $c1) >> 8; + } elseif ($i < $srcLen && $strictPadding) { + $err |= 1; + } + } + /** @var bool $check */ + $check = ($err === 0); + if (!$check) { + throw new RangeException( + 'Base64::decode() only expects characters in the correct base64 alphabet' + ); + } + return $dest; + } + // COPY ParagonIE_Sodium_Core_Base64_Common ENDING HERE + /** + * Uses bitwise operators instead of table-lookups to turn 6-bit integers + * into 8-bit integers. + * + * Base64 character set: + * [A-Z] [a-z] [0-9] + / + * 0x41-0x5a, 0x61-0x7a, 0x30-0x39, 0x2b, 0x2f + * + * @param int $src + * @return int + */ + protected static function decode6Bits($src) + { + $ret = -1; + + // if ($src > 0x40 && $src < 0x5b) $ret += $src - 0x41 + 1; // -64 + $ret += (((0x40 - $src) & ($src - 0x5b)) >> 8) & ($src - 64); + + // if ($src > 0x60 && $src < 0x7b) $ret += $src - 0x61 + 26 + 1; // -70 + $ret += (((0x60 - $src) & ($src - 0x7b)) >> 8) & ($src - 70); + + // if ($src > 0x2f && $src < 0x3a) $ret += $src - 0x30 + 52 + 1; // 5 + $ret += (((0x2f - $src) & ($src - 0x3a)) >> 8) & ($src + 5); + + // if ($src == 0x2c) $ret += 62 + 1; + $ret += (((0x2c - $src) & ($src - 0x2e)) >> 8) & 63; + + // if ($src == 0x5f) ret += 63 + 1; + $ret += (((0x5e - $src) & ($src - 0x60)) >> 8) & 64; + + return $ret; + } + + /** + * Uses bitwise operators instead of table-lookups to turn 8-bit integers + * into 6-bit integers. + * + * @param int $src + * @return string + */ + protected static function encode6Bits($src) + { + $diff = 0x41; + + // if ($src > 25) $diff += 0x61 - 0x41 - 26; // 6 + $diff += ((25 - $src) >> 8) & 6; + + // if ($src > 51) $diff += 0x30 - 0x61 - 26; // -75 + $diff -= ((51 - $src) >> 8) & 75; + + // if ($src > 61) $diff += 0x2d - 0x30 - 10; // -13 + $diff -= ((61 - $src) >> 8) & 13; + + // if ($src > 62) $diff += 0x5f - 0x2b - 1; // 3 + $diff += ((62 - $src) >> 8) & 49; + + return pack('C', $src + $diff); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/ChaCha20.php b/vendor/paragonie/sodium_compat/src/Core/ChaCha20.php new file mode 100644 index 0000000..806010c --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/ChaCha20.php @@ -0,0 +1,395 @@ +> (32 - $n)) + ) + ); + } + + /** + * The ChaCha20 quarter round function. Works on four 32-bit integers. + * + * @internal You should not use this directly from another application + * + * @param int $a + * @param int $b + * @param int $c + * @param int $d + * @return array + */ + protected static function quarterRound($a, $b, $c, $d) + { + # a = PLUS(a,b); d = ROTATE(XOR(d,a),16); + /** @var int $a */ + $a = ($a + $b) & 0xffffffff; + $d = self::rotate($d ^ $a, 16); + + # c = PLUS(c,d); b = ROTATE(XOR(b,c),12); + /** @var int $c */ + $c = ($c + $d) & 0xffffffff; + $b = self::rotate($b ^ $c, 12); + + # a = PLUS(a,b); d = ROTATE(XOR(d,a), 8); + /** @var int $a */ + $a = ($a + $b) & 0xffffffff; + $d = self::rotate($d ^ $a, 8); + + # c = PLUS(c,d); b = ROTATE(XOR(b,c), 7); + /** @var int $c */ + $c = ($c + $d) & 0xffffffff; + $b = self::rotate($b ^ $c, 7); + return array((int) $a, (int) $b, (int) $c, (int) $d); + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_ChaCha20_Ctx $ctx + * @param string $message + * + * @return string + * @throws TypeError + * @throws SodiumException + */ + public static function encryptBytes( + ParagonIE_Sodium_Core_ChaCha20_Ctx $ctx, + $message = '' + ) { + $bytes = self::strlen($message); + + /* + j0 = ctx->input[0]; + j1 = ctx->input[1]; + j2 = ctx->input[2]; + j3 = ctx->input[3]; + j4 = ctx->input[4]; + j5 = ctx->input[5]; + j6 = ctx->input[6]; + j7 = ctx->input[7]; + j8 = ctx->input[8]; + j9 = ctx->input[9]; + j10 = ctx->input[10]; + j11 = ctx->input[11]; + j12 = ctx->input[12]; + j13 = ctx->input[13]; + j14 = ctx->input[14]; + j15 = ctx->input[15]; + */ + $j0 = (int) $ctx[0]; + $j1 = (int) $ctx[1]; + $j2 = (int) $ctx[2]; + $j3 = (int) $ctx[3]; + $j4 = (int) $ctx[4]; + $j5 = (int) $ctx[5]; + $j6 = (int) $ctx[6]; + $j7 = (int) $ctx[7]; + $j8 = (int) $ctx[8]; + $j9 = (int) $ctx[9]; + $j10 = (int) $ctx[10]; + $j11 = (int) $ctx[11]; + $j12 = (int) $ctx[12]; + $j13 = (int) $ctx[13]; + $j14 = (int) $ctx[14]; + $j15 = (int) $ctx[15]; + + $c = ''; + for (;;) { + if ($bytes < 64) { + $message .= str_repeat("\x00", 64 - $bytes); + } + + $x0 = (int) $j0; + $x1 = (int) $j1; + $x2 = (int) $j2; + $x3 = (int) $j3; + $x4 = (int) $j4; + $x5 = (int) $j5; + $x6 = (int) $j6; + $x7 = (int) $j7; + $x8 = (int) $j8; + $x9 = (int) $j9; + $x10 = (int) $j10; + $x11 = (int) $j11; + $x12 = (int) $j12; + $x13 = (int) $j13; + $x14 = (int) $j14; + $x15 = (int) $j15; + + # for (i = 20; i > 0; i -= 2) { + for ($i = 20; $i > 0; $i -= 2) { + # QUARTERROUND( x0, x4, x8, x12) + list($x0, $x4, $x8, $x12) = self::quarterRound($x0, $x4, $x8, $x12); + + # QUARTERROUND( x1, x5, x9, x13) + list($x1, $x5, $x9, $x13) = self::quarterRound($x1, $x5, $x9, $x13); + + # QUARTERROUND( x2, x6, x10, x14) + list($x2, $x6, $x10, $x14) = self::quarterRound($x2, $x6, $x10, $x14); + + # QUARTERROUND( x3, x7, x11, x15) + list($x3, $x7, $x11, $x15) = self::quarterRound($x3, $x7, $x11, $x15); + + # QUARTERROUND( x0, x5, x10, x15) + list($x0, $x5, $x10, $x15) = self::quarterRound($x0, $x5, $x10, $x15); + + # QUARTERROUND( x1, x6, x11, x12) + list($x1, $x6, $x11, $x12) = self::quarterRound($x1, $x6, $x11, $x12); + + # QUARTERROUND( x2, x7, x8, x13) + list($x2, $x7, $x8, $x13) = self::quarterRound($x2, $x7, $x8, $x13); + + # QUARTERROUND( x3, x4, x9, x14) + list($x3, $x4, $x9, $x14) = self::quarterRound($x3, $x4, $x9, $x14); + } + /* + x0 = PLUS(x0, j0); + x1 = PLUS(x1, j1); + x2 = PLUS(x2, j2); + x3 = PLUS(x3, j3); + x4 = PLUS(x4, j4); + x5 = PLUS(x5, j5); + x6 = PLUS(x6, j6); + x7 = PLUS(x7, j7); + x8 = PLUS(x8, j8); + x9 = PLUS(x9, j9); + x10 = PLUS(x10, j10); + x11 = PLUS(x11, j11); + x12 = PLUS(x12, j12); + x13 = PLUS(x13, j13); + x14 = PLUS(x14, j14); + x15 = PLUS(x15, j15); + */ + /** @var int $x0 */ + $x0 = ($x0 & 0xffffffff) + $j0; + /** @var int $x1 */ + $x1 = ($x1 & 0xffffffff) + $j1; + /** @var int $x2 */ + $x2 = ($x2 & 0xffffffff) + $j2; + /** @var int $x3 */ + $x3 = ($x3 & 0xffffffff) + $j3; + /** @var int $x4 */ + $x4 = ($x4 & 0xffffffff) + $j4; + /** @var int $x5 */ + $x5 = ($x5 & 0xffffffff) + $j5; + /** @var int $x6 */ + $x6 = ($x6 & 0xffffffff) + $j6; + /** @var int $x7 */ + $x7 = ($x7 & 0xffffffff) + $j7; + /** @var int $x8 */ + $x8 = ($x8 & 0xffffffff) + $j8; + /** @var int $x9 */ + $x9 = ($x9 & 0xffffffff) + $j9; + /** @var int $x10 */ + $x10 = ($x10 & 0xffffffff) + $j10; + /** @var int $x11 */ + $x11 = ($x11 & 0xffffffff) + $j11; + /** @var int $x12 */ + $x12 = ($x12 & 0xffffffff) + $j12; + /** @var int $x13 */ + $x13 = ($x13 & 0xffffffff) + $j13; + /** @var int $x14 */ + $x14 = ($x14 & 0xffffffff) + $j14; + /** @var int $x15 */ + $x15 = ($x15 & 0xffffffff) + $j15; + + /* + x0 = XOR(x0, LOAD32_LE(m + 0)); + x1 = XOR(x1, LOAD32_LE(m + 4)); + x2 = XOR(x2, LOAD32_LE(m + 8)); + x3 = XOR(x3, LOAD32_LE(m + 12)); + x4 = XOR(x4, LOAD32_LE(m + 16)); + x5 = XOR(x5, LOAD32_LE(m + 20)); + x6 = XOR(x6, LOAD32_LE(m + 24)); + x7 = XOR(x7, LOAD32_LE(m + 28)); + x8 = XOR(x8, LOAD32_LE(m + 32)); + x9 = XOR(x9, LOAD32_LE(m + 36)); + x10 = XOR(x10, LOAD32_LE(m + 40)); + x11 = XOR(x11, LOAD32_LE(m + 44)); + x12 = XOR(x12, LOAD32_LE(m + 48)); + x13 = XOR(x13, LOAD32_LE(m + 52)); + x14 = XOR(x14, LOAD32_LE(m + 56)); + x15 = XOR(x15, LOAD32_LE(m + 60)); + */ + $x0 ^= self::load_4(self::substr($message, 0, 4)); + $x1 ^= self::load_4(self::substr($message, 4, 4)); + $x2 ^= self::load_4(self::substr($message, 8, 4)); + $x3 ^= self::load_4(self::substr($message, 12, 4)); + $x4 ^= self::load_4(self::substr($message, 16, 4)); + $x5 ^= self::load_4(self::substr($message, 20, 4)); + $x6 ^= self::load_4(self::substr($message, 24, 4)); + $x7 ^= self::load_4(self::substr($message, 28, 4)); + $x8 ^= self::load_4(self::substr($message, 32, 4)); + $x9 ^= self::load_4(self::substr($message, 36, 4)); + $x10 ^= self::load_4(self::substr($message, 40, 4)); + $x11 ^= self::load_4(self::substr($message, 44, 4)); + $x12 ^= self::load_4(self::substr($message, 48, 4)); + $x13 ^= self::load_4(self::substr($message, 52, 4)); + $x14 ^= self::load_4(self::substr($message, 56, 4)); + $x15 ^= self::load_4(self::substr($message, 60, 4)); + + /* + j12 = PLUSONE(j12); + if (!j12) { + j13 = PLUSONE(j13); + } + */ + ++$j12; + if ($j12 & 0xf0000000) { + throw new SodiumException('Overflow'); + } + + /* + STORE32_LE(c + 0, x0); + STORE32_LE(c + 4, x1); + STORE32_LE(c + 8, x2); + STORE32_LE(c + 12, x3); + STORE32_LE(c + 16, x4); + STORE32_LE(c + 20, x5); + STORE32_LE(c + 24, x6); + STORE32_LE(c + 28, x7); + STORE32_LE(c + 32, x8); + STORE32_LE(c + 36, x9); + STORE32_LE(c + 40, x10); + STORE32_LE(c + 44, x11); + STORE32_LE(c + 48, x12); + STORE32_LE(c + 52, x13); + STORE32_LE(c + 56, x14); + STORE32_LE(c + 60, x15); + */ + $block = self::store32_le((int) ($x0 & 0xffffffff)) . + self::store32_le((int) ($x1 & 0xffffffff)) . + self::store32_le((int) ($x2 & 0xffffffff)) . + self::store32_le((int) ($x3 & 0xffffffff)) . + self::store32_le((int) ($x4 & 0xffffffff)) . + self::store32_le((int) ($x5 & 0xffffffff)) . + self::store32_le((int) ($x6 & 0xffffffff)) . + self::store32_le((int) ($x7 & 0xffffffff)) . + self::store32_le((int) ($x8 & 0xffffffff)) . + self::store32_le((int) ($x9 & 0xffffffff)) . + self::store32_le((int) ($x10 & 0xffffffff)) . + self::store32_le((int) ($x11 & 0xffffffff)) . + self::store32_le((int) ($x12 & 0xffffffff)) . + self::store32_le((int) ($x13 & 0xffffffff)) . + self::store32_le((int) ($x14 & 0xffffffff)) . + self::store32_le((int) ($x15 & 0xffffffff)); + + /* Partial block */ + if ($bytes < 64) { + $c .= self::substr($block, 0, $bytes); + break; + } + + /* Full block */ + $c .= $block; + $bytes -= 64; + if ($bytes <= 0) { + break; + } + $message = self::substr($message, 64); + } + /* end for(;;) loop */ + + $ctx[12] = $j12; + $ctx[13] = $j13; + return $c; + } + + /** + * @internal You should not use this directly from another application + * + * @param int $len + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function stream($len = 64, $nonce = '', $key = '') + { + return self::encryptBytes( + new ParagonIE_Sodium_Core_ChaCha20_Ctx($key, $nonce), + str_repeat("\x00", $len) + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param int $len + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function ietfStream($len, $nonce = '', $key = '') + { + return self::encryptBytes( + new ParagonIE_Sodium_Core_ChaCha20_IetfCtx($key, $nonce), + str_repeat("\x00", $len) + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param string $message + * @param string $nonce + * @param string $key + * @param string $ic + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function ietfStreamXorIc($message, $nonce = '', $key = '', $ic = '') + { + return self::encryptBytes( + new ParagonIE_Sodium_Core_ChaCha20_IetfCtx($key, $nonce, $ic), + $message + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param string $message + * @param string $nonce + * @param string $key + * @param string $ic + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function streamXorIc($message, $nonce = '', $key = '', $ic = '') + { + return self::encryptBytes( + new ParagonIE_Sodium_Core_ChaCha20_Ctx($key, $nonce, $ic), + $message + ); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/ChaCha20/Ctx.php b/vendor/paragonie/sodium_compat/src/Core/ChaCha20/Ctx.php new file mode 100644 index 0000000..47a42b7 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/ChaCha20/Ctx.php @@ -0,0 +1,119 @@ + + */ + protected $container; + + /** + * ParagonIE_Sodium_Core_ChaCha20_Ctx constructor. + * + * @internal You should not use this directly from another application + * + * @param string $key ChaCha20 key. + * @param string $iv Initialization Vector (a.k.a. nonce). + * @param string $counter The initial counter value. + * Defaults to 8 0x00 bytes. + * @throws InvalidArgumentException + * @throws TypeError + */ + public function __construct($key = '', $iv = '', $counter = '') + { + if (self::strlen($key) !== 32) { + throw new InvalidArgumentException('ChaCha20 expects a 256-bit key.'); + } + if (self::strlen($iv) !== 8) { + throw new InvalidArgumentException('ChaCha20 expects a 64-bit nonce.'); + } + $this->container = new SplFixedArray(16); + + /* "expand 32-byte k" as per ChaCha20 spec */ + $this->container[0] = 0x61707865; + $this->container[1] = 0x3320646e; + $this->container[2] = 0x79622d32; + $this->container[3] = 0x6b206574; + $this->container[4] = self::load_4(self::substr($key, 0, 4)); + $this->container[5] = self::load_4(self::substr($key, 4, 4)); + $this->container[6] = self::load_4(self::substr($key, 8, 4)); + $this->container[7] = self::load_4(self::substr($key, 12, 4)); + $this->container[8] = self::load_4(self::substr($key, 16, 4)); + $this->container[9] = self::load_4(self::substr($key, 20, 4)); + $this->container[10] = self::load_4(self::substr($key, 24, 4)); + $this->container[11] = self::load_4(self::substr($key, 28, 4)); + + if (empty($counter)) { + $this->container[12] = 0; + $this->container[13] = 0; + } else { + $this->container[12] = self::load_4(self::substr($counter, 0, 4)); + $this->container[13] = self::load_4(self::substr($counter, 4, 4)); + } + $this->container[14] = self::load_4(self::substr($iv, 0, 4)); + $this->container[15] = self::load_4(self::substr($iv, 4, 4)); + } + + /** + * @internal You should not use this directly from another application + * + * @param int $offset + * @param int $value + * @return void + * @psalm-suppress MixedArrayOffset + */ + public function offsetSet($offset, $value) + { + if (!is_int($offset)) { + throw new InvalidArgumentException('Expected an integer'); + } + if (!is_int($value)) { + throw new InvalidArgumentException('Expected an integer'); + } + $this->container[$offset] = $value; + } + + /** + * @internal You should not use this directly from another application + * + * @param int $offset + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * @internal You should not use this directly from another application + * + * @param int $offset + * @return void + * @psalm-suppress MixedArrayOffset + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * @internal You should not use this directly from another application + * + * @param int $offset + * @return mixed|null + * @psalm-suppress MixedArrayOffset + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/ChaCha20/IetfCtx.php b/vendor/paragonie/sodium_compat/src/Core/ChaCha20/IetfCtx.php new file mode 100644 index 0000000..4d63b90 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/ChaCha20/IetfCtx.php @@ -0,0 +1,38 @@ +container[12] = self::load_4(self::substr($counter, 0, 4)); + } + $this->container[13] = self::load_4(self::substr($iv, 0, 4)); + $this->container[14] = self::load_4(self::substr($iv, 4, 4)); + $this->container[15] = self::load_4(self::substr($iv, 8, 4)); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/Curve25519.php b/vendor/paragonie/sodium_compat/src/Core/Curve25519.php new file mode 100644 index 0000000..f0b9c5f --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/Curve25519.php @@ -0,0 +1,4106 @@ + $arr */ + $arr = array(); + for ($i = 0; $i < 10; ++$i) { + $arr[$i] = (int) ($f[$i] + $g[$i]); + } + return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray($arr); + } + + /** + * Constant-time conditional move. + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Fe $f + * @param ParagonIE_Sodium_Core_Curve25519_Fe $g + * @param int $b + * @return ParagonIE_Sodium_Core_Curve25519_Fe + * @psalm-suppress MixedAssignment + */ + public static function fe_cmov( + ParagonIE_Sodium_Core_Curve25519_Fe $f, + ParagonIE_Sodium_Core_Curve25519_Fe $g, + $b = 0 + ) { + /** @var array $h */ + $h = array(); + $b *= -1; + for ($i = 0; $i < 10; ++$i) { + $x = (($f[$i] ^ $g[$i]) & $b); + $h[$i] = ($f[$i]) ^ $x; + } + return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray($h); + } + + /** + * Create a copy of a field element. + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Fe $f + * @return ParagonIE_Sodium_Core_Curve25519_Fe + */ + public static function fe_copy(ParagonIE_Sodium_Core_Curve25519_Fe $f) + { + $h = clone $f; + return $h; + } + + /** + * Give: 32-byte string. + * Receive: A field element object to use for internal calculations. + * + * @internal You should not use this directly from another application + * + * @param string $s + * @return ParagonIE_Sodium_Core_Curve25519_Fe + * @throws RangeException + * @throws TypeError + */ + public static function fe_frombytes($s) + { + if (self::strlen($s) !== 32) { + throw new RangeException('Expected a 32-byte string.'); + } + /** @var int $h0 */ + $h0 = self::load_4($s); + /** @var int $h1 */ + $h1 = self::load_3(self::substr($s, 4, 3)) << 6; + /** @var int $h2 */ + $h2 = self::load_3(self::substr($s, 7, 3)) << 5; + /** @var int $h3 */ + $h3 = self::load_3(self::substr($s, 10, 3)) << 3; + /** @var int $h4 */ + $h4 = self::load_3(self::substr($s, 13, 3)) << 2; + /** @var int $h5 */ + $h5 = self::load_4(self::substr($s, 16, 4)); + /** @var int $h6 */ + $h6 = self::load_3(self::substr($s, 20, 3)) << 7; + /** @var int $h7 */ + $h7 = self::load_3(self::substr($s, 23, 3)) << 5; + /** @var int $h8 */ + $h8 = self::load_3(self::substr($s, 26, 3)) << 4; + /** @var int $h9 */ + $h9 = (self::load_3(self::substr($s, 29, 3)) & 8388607) << 2; + + /** @var int $carry9 */ + $carry9 = ($h9 + (1 << 24)) >> 25; + $h0 += self::mul($carry9, 19, 5); + $h9 -= $carry9 << 25; + /** @var int $carry1 */ + $carry1 = ($h1 + (1 << 24)) >> 25; + $h2 += $carry1; + $h1 -= $carry1 << 25; + /** @var int $carry3 */ + $carry3 = ($h3 + (1 << 24)) >> 25; + $h4 += $carry3; + $h3 -= $carry3 << 25; + /** @var int $carry5 */ + $carry5 = ($h5 + (1 << 24)) >> 25; + $h6 += $carry5; + $h5 -= $carry5 << 25; + /** @var int $carry7 */ + $carry7 = ($h7 + (1 << 24)) >> 25; + $h8 += $carry7; + $h7 -= $carry7 << 25; + + /** @var int $carry0 */ + $carry0 = ($h0 + (1 << 25)) >> 26; + $h1 += $carry0; + $h0 -= $carry0 << 26; + /** @var int $carry2 */ + $carry2 = ($h2 + (1 << 25)) >> 26; + $h3 += $carry2; + $h2 -= $carry2 << 26; + /** @var int $carry4 */ + $carry4 = ($h4 + (1 << 25)) >> 26; + $h5 += $carry4; + $h4 -= $carry4 << 26; + /** @var int $carry6 */ + $carry6 = ($h6 + (1 << 25)) >> 26; + $h7 += $carry6; + $h6 -= $carry6 << 26; + /** @var int $carry8 */ + $carry8 = ($h8 + (1 << 25)) >> 26; + $h9 += $carry8; + $h8 -= $carry8 << 26; + + return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray( + array( + (int) $h0, + (int) $h1, + (int) $h2, + (int) $h3, + (int) $h4, + (int) $h5, + (int) $h6, + (int) $h7, + (int) $h8, + (int) $h9 + ) + ); + } + + /** + * Convert a field element to a byte string. + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Fe $h + * @return string + */ + public static function fe_tobytes(ParagonIE_Sodium_Core_Curve25519_Fe $h) + { + /** @var int $h0 */ + $h0 = (int) $h[0]; + /** @var int $h1 */ + $h1 = (int) $h[1]; + /** @var int $h2 */ + $h2 = (int) $h[2]; + /** @var int $h3 */ + $h3 = (int) $h[3]; + /** @var int $h4 */ + $h4 = (int) $h[4]; + /** @var int $h5 */ + $h5 = (int) $h[5]; + /** @var int $h6 */ + $h6 = (int) $h[6]; + /** @var int $h7 */ + $h7 = (int) $h[7]; + /** @var int $h8 */ + $h8 = (int) $h[8]; + /** @var int $h9 */ + $h9 = (int) $h[9]; + + /** @var int $q */ + $q = (self::mul($h9, 19, 5) + (1 << 24)) >> 25; + /** @var int $q */ + $q = ($h0 + $q) >> 26; + /** @var int $q */ + $q = ($h1 + $q) >> 25; + /** @var int $q */ + $q = ($h2 + $q) >> 26; + /** @var int $q */ + $q = ($h3 + $q) >> 25; + /** @var int $q */ + $q = ($h4 + $q) >> 26; + /** @var int $q */ + $q = ($h5 + $q) >> 25; + /** @var int $q */ + $q = ($h6 + $q) >> 26; + /** @var int $q */ + $q = ($h7 + $q) >> 25; + /** @var int $q */ + $q = ($h8 + $q) >> 26; + /** @var int $q */ + $q = ($h9 + $q) >> 25; + + $h0 += self::mul($q, 19, 5); + + /** @var int $carry0 */ + $carry0 = $h0 >> 26; + $h1 += $carry0; + $h0 -= $carry0 << 26; + /** @var int $carry1 */ + $carry1 = $h1 >> 25; + $h2 += $carry1; + $h1 -= $carry1 << 25; + /** @var int $carry2 */ + $carry2 = $h2 >> 26; + $h3 += $carry2; + $h2 -= $carry2 << 26; + /** @var int $carry3 */ + $carry3 = $h3 >> 25; + $h4 += $carry3; + $h3 -= $carry3 << 25; + /** @var int $carry4 */ + $carry4 = $h4 >> 26; + $h5 += $carry4; + $h4 -= $carry4 << 26; + /** @var int $carry5 */ + $carry5 = $h5 >> 25; + $h6 += $carry5; + $h5 -= $carry5 << 25; + /** @var int $carry6 */ + $carry6 = $h6 >> 26; + $h7 += $carry6; + $h6 -= $carry6 << 26; + /** @var int $carry7 */ + $carry7 = $h7 >> 25; + $h8 += $carry7; + $h7 -= $carry7 << 25; + /** @var int $carry8 */ + $carry8 = $h8 >> 26; + $h9 += $carry8; + $h8 -= $carry8 << 26; + /** @var int $carry9 */ + $carry9 = $h9 >> 25; + $h9 -= $carry9 << 25; + + /** + * @var array + */ + $s = array( + (int) (($h0 >> 0) & 0xff), + (int) (($h0 >> 8) & 0xff), + (int) (($h0 >> 16) & 0xff), + (int) ((($h0 >> 24) | ($h1 << 2)) & 0xff), + (int) (($h1 >> 6) & 0xff), + (int) (($h1 >> 14) & 0xff), + (int) ((($h1 >> 22) | ($h2 << 3)) & 0xff), + (int) (($h2 >> 5) & 0xff), + (int) (($h2 >> 13) & 0xff), + (int) ((($h2 >> 21) | ($h3 << 5)) & 0xff), + (int) (($h3 >> 3) & 0xff), + (int) (($h3 >> 11) & 0xff), + (int) ((($h3 >> 19) | ($h4 << 6)) & 0xff), + (int) (($h4 >> 2) & 0xff), + (int) (($h4 >> 10) & 0xff), + (int) (($h4 >> 18) & 0xff), + (int) (($h5 >> 0) & 0xff), + (int) (($h5 >> 8) & 0xff), + (int) (($h5 >> 16) & 0xff), + (int) ((($h5 >> 24) | ($h6 << 1)) & 0xff), + (int) (($h6 >> 7) & 0xff), + (int) (($h6 >> 15) & 0xff), + (int) ((($h6 >> 23) | ($h7 << 3)) & 0xff), + (int) (($h7 >> 5) & 0xff), + (int) (($h7 >> 13) & 0xff), + (int) ((($h7 >> 21) | ($h8 << 4)) & 0xff), + (int) (($h8 >> 4) & 0xff), + (int) (($h8 >> 12) & 0xff), + (int) ((($h8 >> 20) | ($h9 << 6)) & 0xff), + (int) (($h9 >> 2) & 0xff), + (int) (($h9 >> 10) & 0xff), + (int) (($h9 >> 18) & 0xff) + ); + return self::intArrayToString($s); + } + + /** + * Is a field element negative? (1 = yes, 0 = no. Used in calculations.) + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Fe $f + * @return int + * @throws SodiumException + * @throws TypeError + */ + public static function fe_isnegative(ParagonIE_Sodium_Core_Curve25519_Fe $f) + { + $str = self::fe_tobytes($f); + return (int) (self::chrToInt($str[0]) & 1); + } + + /** + * Returns 0 if this field element results in all NUL bytes. + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Fe $f + * @return bool + * @throws SodiumException + * @throws TypeError + */ + public static function fe_isnonzero(ParagonIE_Sodium_Core_Curve25519_Fe $f) + { + static $zero; + if ($zero === null) { + $zero = str_repeat("\x00", 32); + } + /** @var string $zero */ + /** @var string $str */ + $str = self::fe_tobytes($f); + return !self::verify_32($str, (string) $zero); + } + + /** + * Multiply two field elements + * + * h = f * g + * + * @internal You should not use this directly from another application + * + * @security Is multiplication a source of timing leaks? If so, can we do + * anything to prevent that from happening? + * + * @param ParagonIE_Sodium_Core_Curve25519_Fe $f + * @param ParagonIE_Sodium_Core_Curve25519_Fe $g + * @return ParagonIE_Sodium_Core_Curve25519_Fe + */ + public static function fe_mul( + ParagonIE_Sodium_Core_Curve25519_Fe $f, + ParagonIE_Sodium_Core_Curve25519_Fe $g + ) { + /** @var int $f0 */ + $f0 = $f[0]; + /** @var int $f1 */ + $f1 = $f[1]; + /** @var int $f2 */ + $f2 = $f[2]; + /** @var int $f3 */ + $f3 = $f[3]; + /** @var int $f4 */ + $f4 = $f[4]; + /** @var int $f5 */ + $f5 = $f[5]; + /** @var int $f6 */ + $f6 = $f[6]; + /** @var int $f7 */ + $f7 = $f[7]; + /** @var int $f8 */ + $f8 = $f[8]; + /** @var int $f9 */ + $f9 = $f[9]; + /** @var int $g0 */ + $g0 = $g[0]; + /** @var int $g1 */ + $g1 = $g[1]; + /** @var int $g2 */ + $g2 = $g[2]; + /** @var int $g3 */ + $g3 = $g[3]; + /** @var int $g4 */ + $g4 = $g[4]; + /** @var int $g5 */ + $g5 = $g[5]; + /** @var int $g6 */ + $g6 = $g[6]; + /** @var int $g7 */ + $g7 = $g[7]; + /** @var int $g8 */ + $g8 = $g[8]; + /** @var int $g9 */ + $g9 = $g[9]; + $g1_19 = self::mul($g1, 19, 5); + $g2_19 = self::mul($g2, 19, 5); + $g3_19 = self::mul($g3, 19, 5); + $g4_19 = self::mul($g4, 19, 5); + $g5_19 = self::mul($g5, 19, 5); + $g6_19 = self::mul($g6, 19, 5); + $g7_19 = self::mul($g7, 19, 5); + $g8_19 = self::mul($g8, 19, 5); + $g9_19 = self::mul($g9, 19, 5); + /** @var int $f1_2 */ + $f1_2 = $f1 << 1; + /** @var int $f3_2 */ + $f3_2 = $f3 << 1; + /** @var int $f5_2 */ + $f5_2 = $f5 << 1; + /** @var int $f7_2 */ + $f7_2 = $f7 << 1; + /** @var int $f9_2 */ + $f9_2 = $f9 << 1; + $f0g0 = self::mul($f0, $g0, 26); + $f0g1 = self::mul($f0, $g1, 25); + $f0g2 = self::mul($f0, $g2, 26); + $f0g3 = self::mul($f0, $g3, 25); + $f0g4 = self::mul($f0, $g4, 26); + $f0g5 = self::mul($f0, $g5, 25); + $f0g6 = self::mul($f0, $g6, 26); + $f0g7 = self::mul($f0, $g7, 25); + $f0g8 = self::mul($f0, $g8, 26); + $f0g9 = self::mul($f0, $g9, 26); + $f1g0 = self::mul($f1, $g0, 26); + $f1g1_2 = self::mul($f1_2, $g1, 25); + $f1g2 = self::mul($f1, $g2, 26); + $f1g3_2 = self::mul($f1_2, $g3, 25); + $f1g4 = self::mul($f1, $g4, 26); + $f1g5_2 = self::mul($f1_2, $g5, 25); + $f1g6 = self::mul($f1, $g6, 26); + $f1g7_2 = self::mul($f1_2, $g7, 25); + $f1g8 = self::mul($f1, $g8, 26); + $f1g9_38 = self::mul($g9_19, $f1_2, 26); + $f2g0 = self::mul($f2, $g0, 26); + $f2g1 = self::mul($f2, $g1, 25); + $f2g2 = self::mul($f2, $g2, 26); + $f2g3 = self::mul($f2, $g3, 25); + $f2g4 = self::mul($f2, $g4, 26); + $f2g5 = self::mul($f2, $g5, 25); + $f2g6 = self::mul($f2, $g6, 26); + $f2g7 = self::mul($f2, $g7, 25); + $f2g8_19 = self::mul($g8_19, $f2, 26); + $f2g9_19 = self::mul($g9_19, $f2, 26); + $f3g0 = self::mul($f3, $g0, 26); + $f3g1_2 = self::mul($f3_2, $g1, 25); + $f3g2 = self::mul($f3, $g2, 26); + $f3g3_2 = self::mul($f3_2, $g3, 25); + $f3g4 = self::mul($f3, $g4, 26); + $f3g5_2 = self::mul($f3_2, $g5, 25); + $f3g6 = self::mul($f3, $g6, 26); + $f3g7_38 = self::mul($g7_19, $f3_2, 26); + $f3g8_19 = self::mul($g8_19, $f3, 25); + $f3g9_38 = self::mul($g9_19, $f3_2, 26); + $f4g0 = self::mul($f4, $g0, 26); + $f4g1 = self::mul($f4, $g1, 25); + $f4g2 = self::mul($f4, $g2, 26); + $f4g3 = self::mul($f4, $g3, 25); + $f4g4 = self::mul($f4, $g4, 26); + $f4g5 = self::mul($f4, $g5, 25); + $f4g6_19 = self::mul($g6_19, $f4, 26); + $f4g7_19 = self::mul($g7_19, $f4, 26); + $f4g8_19 = self::mul($g8_19, $f4, 26); + $f4g9_19 = self::mul($g9_19, $f4, 26); + $f5g0 = self::mul($f5, $g0, 26); + $f5g1_2 = self::mul($f5_2, $g1, 25); + $f5g2 = self::mul($f5, $g2, 26); + $f5g3_2 = self::mul($f5_2, $g3, 25); + $f5g4 = self::mul($f5, $g4, 26); + $f5g5_38 = self::mul($g5_19, $f5_2, 26); + $f5g6_19 = self::mul($g6_19, $f5, 25); + $f5g7_38 = self::mul($g7_19, $f5_2, 26); + $f5g8_19 = self::mul($g8_19, $f5, 25); + $f5g9_38 = self::mul($g9_19, $f5_2, 26); + $f6g0 = self::mul($f6, $g0, 26); + $f6g1 = self::mul($f6, $g1, 25); + $f6g2 = self::mul($f6, $g2, 26); + $f6g3 = self::mul($f6, $g3, 25); + $f6g4_19 = self::mul($g4_19, $f6, 26); + $f6g5_19 = self::mul($g5_19, $f6, 26); + $f6g6_19 = self::mul($g6_19, $f6, 26); + $f6g7_19 = self::mul($g7_19, $f6, 26); + $f6g8_19 = self::mul($g8_19, $f6, 26); + $f6g9_19 = self::mul($g9_19, $f6, 26); + $f7g0 = self::mul($f7, $g0, 26); + $f7g1_2 = self::mul($f7_2, $g1, 25); + $f7g2 = self::mul($f7, $g2, 26); + $f7g3_38 = self::mul($g3_19, $f7_2, 26); + $f7g4_19 = self::mul($g4_19, $f7, 26); + $f7g5_38 = self::mul($g5_19, $f7_2, 26); + $f7g6_19 = self::mul($g6_19, $f7, 25); + $f7g7_38 = self::mul($g7_19, $f7_2, 26); + $f7g8_19 = self::mul($g8_19, $f7, 25); + $f7g9_38 = self::mul($g9_19,$f7_2, 26); + $f8g0 = self::mul($f8, $g0, 26); + $f8g1 = self::mul($f8, $g1, 25); + $f8g2_19 = self::mul($g2_19, $f8, 26); + $f8g3_19 = self::mul($g3_19, $f8, 26); + $f8g4_19 = self::mul($g4_19, $f8, 26); + $f8g5_19 = self::mul($g5_19, $f8, 26); + $f8g6_19 = self::mul($g6_19, $f8, 26); + $f8g7_19 = self::mul($g7_19, $f8, 26); + $f8g8_19 = self::mul($g8_19, $f8, 26); + $f8g9_19 = self::mul($g9_19, $f8, 26); + $f9g0 = self::mul($f9, $g0, 26); + $f9g1_38 = self::mul($g1_19, $f9_2, 26); + $f9g2_19 = self::mul($g2_19, $f9, 25); + $f9g3_38 = self::mul($g3_19, $f9_2, 26); + $f9g4_19 = self::mul($g4_19, $f9, 25); + $f9g5_38 = self::mul($g5_19, $f9_2, 26); + $f9g6_19 = self::mul($g6_19, $f9, 25); + $f9g7_38 = self::mul($g7_19, $f9_2, 26); + $f9g8_19 = self::mul($g8_19, $f9, 25); + $f9g9_38 = self::mul($g9_19, $f9_2, 26); + $h0 = $f0g0 + $f1g9_38 + $f2g8_19 + $f3g7_38 + $f4g6_19 + $f5g5_38 + $f6g4_19 + $f7g3_38 + $f8g2_19 + $f9g1_38; + $h1 = $f0g1 + $f1g0 + $f2g9_19 + $f3g8_19 + $f4g7_19 + $f5g6_19 + $f6g5_19 + $f7g4_19 + $f8g3_19 + $f9g2_19; + $h2 = $f0g2 + $f1g1_2 + $f2g0 + $f3g9_38 + $f4g8_19 + $f5g7_38 + $f6g6_19 + $f7g5_38 + $f8g4_19 + $f9g3_38; + $h3 = $f0g3 + $f1g2 + $f2g1 + $f3g0 + $f4g9_19 + $f5g8_19 + $f6g7_19 + $f7g6_19 + $f8g5_19 + $f9g4_19; + $h4 = $f0g4 + $f1g3_2 + $f2g2 + $f3g1_2 + $f4g0 + $f5g9_38 + $f6g8_19 + $f7g7_38 + $f8g6_19 + $f9g5_38; + $h5 = $f0g5 + $f1g4 + $f2g3 + $f3g2 + $f4g1 + $f5g0 + $f6g9_19 + $f7g8_19 + $f8g7_19 + $f9g6_19; + $h6 = $f0g6 + $f1g5_2 + $f2g4 + $f3g3_2 + $f4g2 + $f5g1_2 + $f6g0 + $f7g9_38 + $f8g8_19 + $f9g7_38; + $h7 = $f0g7 + $f1g6 + $f2g5 + $f3g4 + $f4g3 + $f5g2 + $f6g1 + $f7g0 + $f8g9_19 + $f9g8_19; + $h8 = $f0g8 + $f1g7_2 + $f2g6 + $f3g5_2 + $f4g4 + $f5g3_2 + $f6g2 + $f7g1_2 + $f8g0 + $f9g9_38; + $h9 = $f0g9 + $f1g8 + $f2g7 + $f3g6 + $f4g5 + $f5g4 + $f6g3 + $f7g2 + $f8g1 + $f9g0 ; + + /** @var int $carry0 */ + $carry0 = ($h0 + (1 << 25)) >> 26; + $h1 += $carry0; + $h0 -= $carry0 << 26; + /** @var int $carry4 */ + $carry4 = ($h4 + (1 << 25)) >> 26; + $h5 += $carry4; + $h4 -= $carry4 << 26; + + /** @var int $carry1 */ + $carry1 = ($h1 + (1 << 24)) >> 25; + $h2 += $carry1; + $h1 -= $carry1 << 25; + /** @var int $carry5 */ + $carry5 = ($h5 + (1 << 24)) >> 25; + $h6 += $carry5; + $h5 -= $carry5 << 25; + + /** @var int $carry2 */ + $carry2 = ($h2 + (1 << 25)) >> 26; + $h3 += $carry2; + $h2 -= $carry2 << 26; + /** @var int $carry6 */ + $carry6 = ($h6 + (1 << 25)) >> 26; + $h7 += $carry6; + $h6 -= $carry6 << 26; + + /** @var int $carry3 */ + $carry3 = ($h3 + (1 << 24)) >> 25; + $h4 += $carry3; + $h3 -= $carry3 << 25; + /** @var int $carry7 */ + $carry7 = ($h7 + (1 << 24)) >> 25; + $h8 += $carry7; + $h7 -= $carry7 << 25; + + /** @var int $carry4 */ + $carry4 = ($h4 + (1 << 25)) >> 26; + $h5 += $carry4; + $h4 -= $carry4 << 26; + /** @var int $carry8 */ + $carry8 = ($h8 + (1 << 25)) >> 26; + $h9 += $carry8; + $h8 -= $carry8 << 26; + + /** @var int $carry9 */ + $carry9 = ($h9 + (1 << 24)) >> 25; + $h0 += self::mul($carry9, 19, 5); + $h9 -= $carry9 << 25; + + /** @var int $carry0 */ + $carry0 = ($h0 + (1 << 25)) >> 26; + $h1 += $carry0; + $h0 -= $carry0 << 26; + + return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray( + array( + (int) $h0, + (int) $h1, + (int) $h2, + (int) $h3, + (int) $h4, + (int) $h5, + (int) $h6, + (int) $h7, + (int) $h8, + (int) $h9 + ) + ); + } + + /** + * Get the negative values for each piece of the field element. + * + * h = -f + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Fe $f + * @return ParagonIE_Sodium_Core_Curve25519_Fe + * @psalm-suppress MixedAssignment + */ + public static function fe_neg(ParagonIE_Sodium_Core_Curve25519_Fe $f) + { + $h = new ParagonIE_Sodium_Core_Curve25519_Fe(); + for ($i = 0; $i < 10; ++$i) { + $h[$i] = -$f[$i]; + } + return $h; + } + + /** + * Square a field element + * + * h = f * f + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Fe $f + * @return ParagonIE_Sodium_Core_Curve25519_Fe + */ + public static function fe_sq(ParagonIE_Sodium_Core_Curve25519_Fe $f) + { + $f0 = (int) $f[0]; + $f1 = (int) $f[1]; + $f2 = (int) $f[2]; + $f3 = (int) $f[3]; + $f4 = (int) $f[4]; + $f5 = (int) $f[5]; + $f6 = (int) $f[6]; + $f7 = (int) $f[7]; + $f8 = (int) $f[8]; + $f9 = (int) $f[9]; + + /** @var int $f0_2 */ + $f0_2 = $f0 << 1; + /** @var int $f1_2 */ + $f1_2 = $f1 << 1; + /** @var int $f2_2 */ + $f2_2 = $f2 << 1; + /** @var int $f3_2 */ + $f3_2 = $f3 << 1; + /** @var int $f4_2 */ + $f4_2 = $f4 << 1; + /** @var int $f5_2 */ + $f5_2 = $f5 << 1; + /** @var int $f6_2 */ + $f6_2 = $f6 << 1; + /** @var int $f7_2 */ + $f7_2 = $f7 << 1; + $f5_38 = self::mul($f5, 38, 6); + $f6_19 = self::mul($f6, 19, 5); + $f7_38 = self::mul($f7, 38, 6); + $f8_19 = self::mul($f8, 19, 5); + $f9_38 = self::mul($f9, 38, 6); + $f0f0 = self::mul($f0, $f0, 25); + $f0f1_2 = self::mul($f0_2, $f1, 24); + $f0f2_2 = self::mul($f0_2, $f2, 26); + $f0f3_2 = self::mul($f0_2, $f3, 24); + $f0f4_2 = self::mul($f0_2, $f4, 25); + $f0f5_2 = self::mul($f0_2, $f5, 25); + $f0f6_2 = self::mul($f0_2, $f6, 25); + $f0f7_2 = self::mul($f0_2, $f7, 24); + $f0f8_2 = self::mul($f0_2, $f8, 25); + $f0f9_2 = self::mul($f0_2, $f9, 25); + $f1f1_2 = self::mul($f1_2, $f1, 24); + $f1f2_2 = self::mul($f1_2, $f2, 26); + $f1f3_4 = self::mul($f1_2, $f3_2, 25); + $f1f4_2 = self::mul($f1_2, $f4, 25); + $f1f5_4 = self::mul($f1_2, $f5_2, 26); + $f1f6_2 = self::mul($f1_2, $f6, 25); + $f1f7_4 = self::mul($f1_2, $f7_2, 25); + $f1f8_2 = self::mul($f1_2, $f8, 25); + $f1f9_76 = self::mul($f9_38, $f1_2, 25); + $f2f2 = self::mul($f2, $f2, 26); + $f2f3_2 = self::mul($f2_2, $f3, 24); + $f2f4_2 = self::mul($f2_2, $f4, 25); + $f2f5_2 = self::mul($f2_2, $f5, 25); + $f2f6_2 = self::mul($f2_2, $f6, 25); + $f2f7_2 = self::mul($f2_2, $f7, 25); + $f2f8_38 = self::mul($f8_19, $f2_2, 27); + $f2f9_38 = self::mul($f9_38, $f2, 26); + $f3f3_2 = self::mul($f3_2, $f3, 25); + $f3f4_2 = self::mul($f3_2, $f4, 25); + $f3f5_4 = self::mul($f3_2, $f5_2, 26); + $f3f6_2 = self::mul($f3_2, $f6, 25); + $f3f7_76 = self::mul($f7_38, $f3_2, 25); + $f3f8_38 = self::mul($f8_19, $f3_2, 25); + $f3f9_76 = self::mul($f9_38, $f3_2, 25); + $f4f4 = self::mul($f4, $f4, 25); + $f4f5_2 = self::mul($f4_2, $f5, 25); + $f4f6_38 = self::mul($f6_19, $f4_2, 26); + $f4f7_38 = self::mul($f7_38, $f4, 25); + $f4f8_38 = self::mul($f8_19, $f4_2, 26); + $f4f9_38 = self::mul($f9_38, $f4, 25); + $f5f5_38 = self::mul($f5_38, $f5, 25); + $f5f6_38 = self::mul($f6_19, $f5_2, 26); + $f5f7_76 = self::mul($f7_38, $f5_2, 26); + $f5f8_38 = self::mul($f8_19, $f5_2, 26); + $f5f9_76 = self::mul($f9_38, $f5_2, 26); + $f6f6_19 = self::mul($f6_19, $f6, 25); + $f6f7_38 = self::mul($f7_38, $f6, 25); + $f6f8_38 = self::mul($f8_19, $f6_2, 26); + $f6f9_38 = self::mul($f9_38, $f6, 25); + $f7f7_38 = self::mul($f7_38, $f7, 24); + $f7f8_38 = self::mul($f8_19, $f7_2, 25); + $f7f9_76 = self::mul($f9_38, $f7_2, 25); + $f8f8_19 = self::mul($f8_19, $f8, 25); + $f8f9_38 = self::mul($f9_38, $f8, 25); + $f9f9_38 = self::mul($f9_38, $f9, 25); + $h0 = $f0f0 + $f1f9_76 + $f2f8_38 + $f3f7_76 + $f4f6_38 + $f5f5_38; + $h1 = $f0f1_2 + $f2f9_38 + $f3f8_38 + $f4f7_38 + $f5f6_38; + $h2 = $f0f2_2 + $f1f1_2 + $f3f9_76 + $f4f8_38 + $f5f7_76 + $f6f6_19; + $h3 = $f0f3_2 + $f1f2_2 + $f4f9_38 + $f5f8_38 + $f6f7_38; + $h4 = $f0f4_2 + $f1f3_4 + $f2f2 + $f5f9_76 + $f6f8_38 + $f7f7_38; + $h5 = $f0f5_2 + $f1f4_2 + $f2f3_2 + $f6f9_38 + $f7f8_38; + $h6 = $f0f6_2 + $f1f5_4 + $f2f4_2 + $f3f3_2 + $f7f9_76 + $f8f8_19; + $h7 = $f0f7_2 + $f1f6_2 + $f2f5_2 + $f3f4_2 + $f8f9_38; + $h8 = $f0f8_2 + $f1f7_4 + $f2f6_2 + $f3f5_4 + $f4f4 + $f9f9_38; + $h9 = $f0f9_2 + $f1f8_2 + $f2f7_2 + $f3f6_2 + $f4f5_2; + + /** @var int $carry0 */ + $carry0 = ($h0 + (1 << 25)) >> 26; + $h1 += $carry0; + $h0 -= $carry0 << 26; + /** @var int $carry4 */ + $carry4 = ($h4 + (1 << 25)) >> 26; + $h5 += $carry4; + $h4 -= $carry4 << 26; + + /** @var int $carry1 */ + $carry1 = ($h1 + (1 << 24)) >> 25; + $h2 += $carry1; + $h1 -= $carry1 << 25; + /** @var int $carry5 */ + $carry5 = ($h5 + (1 << 24)) >> 25; + $h6 += $carry5; + $h5 -= $carry5 << 25; + + /** @var int $carry2 */ + $carry2 = ($h2 + (1 << 25)) >> 26; + $h3 += $carry2; + $h2 -= $carry2 << 26; + /** @var int $carry6 */ + $carry6 = ($h6 + (1 << 25)) >> 26; + $h7 += $carry6; + $h6 -= $carry6 << 26; + + /** @var int $carry3 */ + $carry3 = ($h3 + (1 << 24)) >> 25; + $h4 += $carry3; + $h3 -= $carry3 << 25; + /** @var int $carry7 */ + $carry7 = ($h7 + (1 << 24)) >> 25; + $h8 += $carry7; + $h7 -= $carry7 << 25; + + /** @var int $carry4 */ + $carry4 = ($h4 + (1 << 25)) >> 26; + $h5 += $carry4; + $h4 -= $carry4 << 26; + /** @var int $carry8 */ + $carry8 = ($h8 + (1 << 25)) >> 26; + $h9 += $carry8; + $h8 -= $carry8 << 26; + + /** @var int $carry9 */ + $carry9 = ($h9 + (1 << 24)) >> 25; + $h0 += self::mul($carry9, 19, 5); + $h9 -= $carry9 << 25; + + /** @var int $carry0 */ + $carry0 = ($h0 + (1 << 25)) >> 26; + $h1 += $carry0; + $h0 -= $carry0 << 26; + + return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray( + array( + (int) $h0, + (int) $h1, + (int) $h2, + (int) $h3, + (int) $h4, + (int) $h5, + (int) $h6, + (int) $h7, + (int) $h8, + (int) $h9 + ) + ); + } + + + /** + * Square and double a field element + * + * h = 2 * f * f + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Fe $f + * @return ParagonIE_Sodium_Core_Curve25519_Fe + */ + public static function fe_sq2(ParagonIE_Sodium_Core_Curve25519_Fe $f) + { + $f0 = (int) $f[0]; + $f1 = (int) $f[1]; + $f2 = (int) $f[2]; + $f3 = (int) $f[3]; + $f4 = (int) $f[4]; + $f5 = (int) $f[5]; + $f6 = (int) $f[6]; + $f7 = (int) $f[7]; + $f8 = (int) $f[8]; + $f9 = (int) $f[9]; + + /** @var int $f0_2 */ + $f0_2 = $f0 << 1; + /** @var int $f1_2 */ + $f1_2 = $f1 << 1; + /** @var int $f2_2 */ + $f2_2 = $f2 << 1; + /** @var int $f3_2 */ + $f3_2 = $f3 << 1; + /** @var int $f4_2 */ + $f4_2 = $f4 << 1; + /** @var int $f5_2 */ + $f5_2 = $f5 << 1; + /** @var int $f6_2 */ + $f6_2 = $f6 << 1; + /** @var int $f7_2 */ + $f7_2 = $f7 << 1; + $f5_38 = self::mul($f5, 38, 6); /* 1.959375*2^30 */ + $f6_19 = self::mul($f6, 19, 5); /* 1.959375*2^30 */ + $f7_38 = self::mul($f7, 38, 6); /* 1.959375*2^30 */ + $f8_19 = self::mul($f8, 19, 5); /* 1.959375*2^30 */ + $f9_38 = self::mul($f9, 38, 6); /* 1.959375*2^30 */ + $f0f0 = self::mul($f0, $f0, 24); + $f0f1_2 = self::mul($f0_2, $f1, 24); + $f0f2_2 = self::mul($f0_2, $f2, 24); + $f0f3_2 = self::mul($f0_2, $f3, 24); + $f0f4_2 = self::mul($f0_2, $f4, 24); + $f0f5_2 = self::mul($f0_2, $f5, 24); + $f0f6_2 = self::mul($f0_2, $f6, 24); + $f0f7_2 = self::mul($f0_2, $f7, 24); + $f0f8_2 = self::mul($f0_2, $f8, 24); + $f0f9_2 = self::mul($f0_2, $f9, 24); + $f1f1_2 = self::mul($f1_2, $f1, 24); + $f1f2_2 = self::mul($f1_2, $f2, 24); + $f1f3_4 = self::mul($f1_2, $f3_2, 24); + $f1f4_2 = self::mul($f1_2, $f4, 24); + $f1f5_4 = self::mul($f1_2, $f5_2, 24); + $f1f6_2 = self::mul($f1_2, $f6, 24); + $f1f7_4 = self::mul($f1_2, $f7_2, 24); + $f1f8_2 = self::mul($f1_2, $f8, 24); + $f1f9_76 = self::mul($f9_38, $f1_2, 24); + $f2f2 = self::mul($f2, $f2, 24); + $f2f3_2 = self::mul($f2_2, $f3, 24); + $f2f4_2 = self::mul($f2_2, $f4, 24); + $f2f5_2 = self::mul($f2_2, $f5, 24); + $f2f6_2 = self::mul($f2_2, $f6, 24); + $f2f7_2 = self::mul($f2_2, $f7, 24); + $f2f8_38 = self::mul($f8_19, $f2_2, 25); + $f2f9_38 = self::mul($f9_38, $f2, 24); + $f3f3_2 = self::mul($f3_2, $f3, 24); + $f3f4_2 = self::mul($f3_2, $f4, 24); + $f3f5_4 = self::mul($f3_2, $f5_2, 24); + $f3f6_2 = self::mul($f3_2, $f6, 24); + $f3f7_76 = self::mul($f7_38, $f3_2, 24); + $f3f8_38 = self::mul($f8_19, $f3_2, 24); + $f3f9_76 = self::mul($f9_38, $f3_2, 24); + $f4f4 = self::mul($f4, $f4, 24); + $f4f5_2 = self::mul($f4_2, $f5, 24); + $f4f6_38 = self::mul($f6_19, $f4_2, 25); + $f4f7_38 = self::mul($f7_38, $f4, 24); + $f4f8_38 = self::mul($f8_19, $f4_2, 25); + $f4f9_38 = self::mul($f9_38, $f4, 24); + $f5f5_38 = self::mul($f5_38, $f5, 24); + $f5f6_38 = self::mul($f6_19, $f5_2, 24); + $f5f7_76 = self::mul($f7_38, $f5_2, 24); + $f5f8_38 = self::mul($f8_19, $f5_2, 24); + $f5f9_76 = self::mul($f9_38, $f5_2, 24); + $f6f6_19 = self::mul($f6_19, $f6, 24); + $f6f7_38 = self::mul($f7_38, $f6, 24); + $f6f8_38 = self::mul($f8_19, $f6_2, 25); + $f6f9_38 = self::mul($f9_38, $f6, 24); + $f7f7_38 = self::mul($f7_38, $f7, 24); + $f7f8_38 = self::mul($f8_19, $f7_2, 24); + $f7f9_76 = self::mul($f9_38, $f7_2, 24); + $f8f8_19 = self::mul($f8_19, $f8, 24); + $f8f9_38 = self::mul($f9_38, $f8, 24); + $f9f9_38 = self::mul($f9_38, $f9, 24); + + /** @var int $h0 */ + $h0 = (int) ($f0f0 + $f1f9_76 + $f2f8_38 + $f3f7_76 + $f4f6_38 + $f5f5_38) << 1; + /** @var int $h1 */ + $h1 = (int) ($f0f1_2 + $f2f9_38 + $f3f8_38 + $f4f7_38 + $f5f6_38) << 1; + /** @var int $h2 */ + $h2 = (int) ($f0f2_2 + $f1f1_2 + $f3f9_76 + $f4f8_38 + $f5f7_76 + $f6f6_19) << 1; + /** @var int $h3 */ + $h3 = (int) ($f0f3_2 + $f1f2_2 + $f4f9_38 + $f5f8_38 + $f6f7_38) << 1; + /** @var int $h4 */ + $h4 = (int) ($f0f4_2 + $f1f3_4 + $f2f2 + $f5f9_76 + $f6f8_38 + $f7f7_38) << 1; + /** @var int $h5 */ + $h5 = (int) ($f0f5_2 + $f1f4_2 + $f2f3_2 + $f6f9_38 + $f7f8_38) << 1; + /** @var int $h6 */ + $h6 = (int) ($f0f6_2 + $f1f5_4 + $f2f4_2 + $f3f3_2 + $f7f9_76 + $f8f8_19) << 1; + /** @var int $h7 */ + $h7 = (int) ($f0f7_2 + $f1f6_2 + $f2f5_2 + $f3f4_2 + $f8f9_38) << 1; + /** @var int $h8 */ + $h8 = (int) ($f0f8_2 + $f1f7_4 + $f2f6_2 + $f3f5_4 + $f4f4 + $f9f9_38) << 1; + /** @var int $h9 */ + $h9 = (int) ($f0f9_2 + $f1f8_2 + $f2f7_2 + $f3f6_2 + $f4f5_2) << 1; + + /** @var int $carry0 */ + $carry0 = ($h0 + (1 << 25)) >> 26; + $h1 += $carry0; + $h0 -= $carry0 << 26; + /** @var int $carry4 */ + $carry4 = ($h4 + (1 << 25)) >> 26; + $h5 += $carry4; + $h4 -= $carry4 << 26; + + /** @var int $carry1 */ + $carry1 = ($h1 + (1 << 24)) >> 25; + $h2 += $carry1; + $h1 -= $carry1 << 25; + /** @var int $carry5 */ + $carry5 = ($h5 + (1 << 24)) >> 25; + $h6 += $carry5; + $h5 -= $carry5 << 25; + + /** @var int $carry2 */ + $carry2 = ($h2 + (1 << 25)) >> 26; + $h3 += $carry2; + $h2 -= $carry2 << 26; + /** @var int $carry6 */ + $carry6 = ($h6 + (1 << 25)) >> 26; + $h7 += $carry6; + $h6 -= $carry6 << 26; + + /** @var int $carry3 */ + $carry3 = ($h3 + (1 << 24)) >> 25; + $h4 += $carry3; + $h3 -= $carry3 << 25; + /** @var int $carry7 */ + $carry7 = ($h7 + (1 << 24)) >> 25; + $h8 += $carry7; + $h7 -= $carry7 << 25; + + /** @var int $carry4 */ + $carry4 = ($h4 + (1 << 25)) >> 26; + $h5 += $carry4; + $h4 -= $carry4 << 26; + /** @var int $carry8 */ + $carry8 = ($h8 + (1 << 25)) >> 26; + $h9 += $carry8; + $h8 -= $carry8 << 26; + + /** @var int $carry9 */ + $carry9 = ($h9 + (1 << 24)) >> 25; + $h0 += self::mul($carry9, 19, 5); + $h9 -= $carry9 << 25; + + /** @var int $carry0 */ + $carry0 = ($h0 + (1 << 25)) >> 26; + $h1 += $carry0; + $h0 -= $carry0 << 26; + + return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray( + array( + (int) $h0, + (int) $h1, + (int) $h2, + (int) $h3, + (int) $h4, + (int) $h5, + (int) $h6, + (int) $h7, + (int) $h8, + (int) $h9 + ) + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Fe $Z + * @return ParagonIE_Sodium_Core_Curve25519_Fe + */ + public static function fe_invert(ParagonIE_Sodium_Core_Curve25519_Fe $Z) + { + $z = clone $Z; + $t0 = self::fe_sq($z); + $t1 = self::fe_sq($t0); + $t1 = self::fe_sq($t1); + $t1 = self::fe_mul($z, $t1); + $t0 = self::fe_mul($t0, $t1); + $t2 = self::fe_sq($t0); + $t1 = self::fe_mul($t1, $t2); + $t2 = self::fe_sq($t1); + for ($i = 1; $i < 5; ++$i) { + $t2 = self::fe_sq($t2); + } + $t1 = self::fe_mul($t2, $t1); + $t2 = self::fe_sq($t1); + for ($i = 1; $i < 10; ++$i) { + $t2 = self::fe_sq($t2); + } + $t2 = self::fe_mul($t2, $t1); + $t3 = self::fe_sq($t2); + for ($i = 1; $i < 20; ++$i) { + $t3 = self::fe_sq($t3); + } + $t2 = self::fe_mul($t3, $t2); + $t2 = self::fe_sq($t2); + for ($i = 1; $i < 10; ++$i) { + $t2 = self::fe_sq($t2); + } + $t1 = self::fe_mul($t2, $t1); + $t2 = self::fe_sq($t1); + for ($i = 1; $i < 50; ++$i) { + $t2 = self::fe_sq($t2); + } + $t2 = self::fe_mul($t2, $t1); + $t3 = self::fe_sq($t2); + for ($i = 1; $i < 100; ++$i) { + $t3 = self::fe_sq($t3); + } + $t2 = self::fe_mul($t3, $t2); + $t2 = self::fe_sq($t2); + for ($i = 1; $i < 50; ++$i) { + $t2 = self::fe_sq($t2); + } + $t1 = self::fe_mul($t2, $t1); + $t1 = self::fe_sq($t1); + for ($i = 1; $i < 5; ++$i) { + $t1 = self::fe_sq($t1); + } + return self::fe_mul($t1, $t0); + } + + /** + * @internal You should not use this directly from another application + * + * @ref https://github.com/jedisct1/libsodium/blob/68564326e1e9dc57ef03746f85734232d20ca6fb/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c#L1054-L1106 + * + * @param ParagonIE_Sodium_Core_Curve25519_Fe $z + * @return ParagonIE_Sodium_Core_Curve25519_Fe + */ + public static function fe_pow22523(ParagonIE_Sodium_Core_Curve25519_Fe $z) + { + # fe_sq(t0, z); + # fe_sq(t1, t0); + # fe_sq(t1, t1); + # fe_mul(t1, z, t1); + # fe_mul(t0, t0, t1); + # fe_sq(t0, t0); + # fe_mul(t0, t1, t0); + # fe_sq(t1, t0); + $t0 = self::fe_sq($z); + $t1 = self::fe_sq($t0); + $t1 = self::fe_sq($t1); + $t1 = self::fe_mul($z, $t1); + $t0 = self::fe_mul($t0, $t1); + $t0 = self::fe_sq($t0); + $t0 = self::fe_mul($t1, $t0); + $t1 = self::fe_sq($t0); + + # for (i = 1; i < 5; ++i) { + # fe_sq(t1, t1); + # } + for ($i = 1; $i < 5; ++$i) { + $t1 = self::fe_sq($t1); + } + + # fe_mul(t0, t1, t0); + # fe_sq(t1, t0); + $t0 = self::fe_mul($t1, $t0); + $t1 = self::fe_sq($t0); + + # for (i = 1; i < 10; ++i) { + # fe_sq(t1, t1); + # } + for ($i = 1; $i < 10; ++$i) { + $t1 = self::fe_sq($t1); + } + + # fe_mul(t1, t1, t0); + # fe_sq(t2, t1); + $t1 = self::fe_mul($t1, $t0); + $t2 = self::fe_sq($t1); + + # for (i = 1; i < 20; ++i) { + # fe_sq(t2, t2); + # } + for ($i = 1; $i < 20; ++$i) { + $t2 = self::fe_sq($t2); + } + + # fe_mul(t1, t2, t1); + # fe_sq(t1, t1); + $t1 = self::fe_mul($t2, $t1); + $t1 = self::fe_sq($t1); + + # for (i = 1; i < 10; ++i) { + # fe_sq(t1, t1); + # } + for ($i = 1; $i < 10; ++$i) { + $t1 = self::fe_sq($t1); + } + + # fe_mul(t0, t1, t0); + # fe_sq(t1, t0); + $t0 = self::fe_mul($t1, $t0); + $t1 = self::fe_sq($t0); + + # for (i = 1; i < 50; ++i) { + # fe_sq(t1, t1); + # } + for ($i = 1; $i < 50; ++$i) { + $t1 = self::fe_sq($t1); + } + + # fe_mul(t1, t1, t0); + # fe_sq(t2, t1); + $t1 = self::fe_mul($t1, $t0); + $t2 = self::fe_sq($t1); + + # for (i = 1; i < 100; ++i) { + # fe_sq(t2, t2); + # } + for ($i = 1; $i < 100; ++$i) { + $t2 = self::fe_sq($t2); + } + + # fe_mul(t1, t2, t1); + # fe_sq(t1, t1); + $t1 = self::fe_mul($t2, $t1); + $t1 = self::fe_sq($t1); + + # for (i = 1; i < 50; ++i) { + # fe_sq(t1, t1); + # } + for ($i = 1; $i < 50; ++$i) { + $t1 = self::fe_sq($t1); + } + + # fe_mul(t0, t1, t0); + # fe_sq(t0, t0); + # fe_sq(t0, t0); + # fe_mul(out, t0, z); + $t0 = self::fe_mul($t1, $t0); + $t0 = self::fe_sq($t0); + $t0 = self::fe_sq($t0); + return self::fe_mul($t0, $z); + } + + /** + * Subtract two field elements. + * + * h = f - g + * + * Preconditions: + * |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. + * |g| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. + * + * Postconditions: + * |h| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Fe $f + * @param ParagonIE_Sodium_Core_Curve25519_Fe $g + * @return ParagonIE_Sodium_Core_Curve25519_Fe + * @psalm-suppress MixedOperand + */ + public static function fe_sub(ParagonIE_Sodium_Core_Curve25519_Fe $f, ParagonIE_Sodium_Core_Curve25519_Fe $g) + { + return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray( + array( + (int) ($f[0] - $g[0]), + (int) ($f[1] - $g[1]), + (int) ($f[2] - $g[2]), + (int) ($f[3] - $g[3]), + (int) ($f[4] - $g[4]), + (int) ($f[5] - $g[5]), + (int) ($f[6] - $g[6]), + (int) ($f[7] - $g[7]), + (int) ($f[8] - $g[8]), + (int) ($f[9] - $g[9]) + ) + ); + } + + /** + * Add two group elements. + * + * r = p + q + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p + * @param ParagonIE_Sodium_Core_Curve25519_Ge_Cached $q + * @return ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 + */ + public static function ge_add( + ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p, + ParagonIE_Sodium_Core_Curve25519_Ge_Cached $q + ) { + $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P1p1(); + $r->X = self::fe_add($p->Y, $p->X); + $r->Y = self::fe_sub($p->Y, $p->X); + $r->Z = self::fe_mul($r->X, $q->YplusX); + $r->Y = self::fe_mul($r->Y, $q->YminusX); + $r->T = self::fe_mul($q->T2d, $p->T); + $r->X = self::fe_mul($p->Z, $q->Z); + $t0 = self::fe_add($r->X, $r->X); + $r->X = self::fe_sub($r->Z, $r->Y); + $r->Y = self::fe_add($r->Z, $r->Y); + $r->Z = self::fe_add($t0, $r->T); + $r->T = self::fe_sub($t0, $r->T); + return $r; + } + + /** + * @internal You should not use this directly from another application + * + * @ref https://github.com/jedisct1/libsodium/blob/157c4a80c13b117608aeae12178b2d38825f9f8f/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c#L1185-L1215 + * @param string $a + * @return array + * @throws SodiumException + * @throws TypeError + */ + public static function slide($a) + { + if (self::strlen($a) < 256) { + if (self::strlen($a) < 16) { + $a = str_pad($a, 256, '0', STR_PAD_RIGHT); + } + } + /** @var array $r */ + $r = array(); + + /** @var int $i */ + for ($i = 0; $i < 256; ++$i) { + $r[$i] = (int) ( + 1 & ( + self::chrToInt($a[(int) ($i >> 3)]) + >> + ($i & 7) + ) + ); + } + + for ($i = 0;$i < 256;++$i) { + if ($r[$i]) { + for ($b = 1;$b <= 6 && $i + $b < 256;++$b) { + if ($r[$i + $b]) { + if ($r[$i] + ($r[$i + $b] << $b) <= 15) { + $r[$i] += $r[$i + $b] << $b; + $r[$i + $b] = 0; + } elseif ($r[$i] - ($r[$i + $b] << $b) >= -15) { + $r[$i] -= $r[$i + $b] << $b; + for ($k = $i + $b; $k < 256; ++$k) { + if (!$r[$k]) { + $r[$k] = 1; + break; + } + $r[$k] = 0; + } + } else { + break; + } + } + } + } + } + return $r; + } + + /** + * @internal You should not use this directly from another application + * + * @param string $s + * @return ParagonIE_Sodium_Core_Curve25519_Ge_P3 + * @throws SodiumException + * @throws TypeError + */ + public static function ge_frombytes_negate_vartime($s) + { + static $d = null; + if (!$d) { + $d = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$d); + } + + # fe_frombytes(h->Y,s); + # fe_1(h->Z); + $h = new ParagonIE_Sodium_Core_Curve25519_Ge_P3( + self::fe_0(), + self::fe_frombytes($s), + self::fe_1() + ); + + # fe_sq(u,h->Y); + # fe_mul(v,u,d); + # fe_sub(u,u,h->Z); /* u = y^2-1 */ + # fe_add(v,v,h->Z); /* v = dy^2+1 */ + $u = self::fe_sq($h->Y); + /** @var ParagonIE_Sodium_Core_Curve25519_Fe $d */ + $v = self::fe_mul($u, $d); + $u = self::fe_sub($u, $h->Z); /* u = y^2 - 1 */ + $v = self::fe_add($v, $h->Z); /* v = dy^2 + 1 */ + + # fe_sq(v3,v); + # fe_mul(v3,v3,v); /* v3 = v^3 */ + # fe_sq(h->X,v3); + # fe_mul(h->X,h->X,v); + # fe_mul(h->X,h->X,u); /* x = uv^7 */ + $v3 = self::fe_sq($v); + $v3 = self::fe_mul($v3, $v); /* v3 = v^3 */ + $h->X = self::fe_sq($v3); + $h->X = self::fe_mul($h->X, $v); + $h->X = self::fe_mul($h->X, $u); /* x = uv^7 */ + + # fe_pow22523(h->X,h->X); /* x = (uv^7)^((q-5)/8) */ + # fe_mul(h->X,h->X,v3); + # fe_mul(h->X,h->X,u); /* x = uv^3(uv^7)^((q-5)/8) */ + $h->X = self::fe_pow22523($h->X); /* x = (uv^7)^((q-5)/8) */ + $h->X = self::fe_mul($h->X, $v3); + $h->X = self::fe_mul($h->X, $u); /* x = uv^3(uv^7)^((q-5)/8) */ + + # fe_sq(vxx,h->X); + # fe_mul(vxx,vxx,v); + # fe_sub(check,vxx,u); /* vx^2-u */ + $vxx = self::fe_sq($h->X); + $vxx = self::fe_mul($vxx, $v); + $check = self::fe_sub($vxx, $u); /* vx^2 - u */ + + # if (fe_isnonzero(check)) { + # fe_add(check,vxx,u); /* vx^2+u */ + # if (fe_isnonzero(check)) { + # return -1; + # } + # fe_mul(h->X,h->X,sqrtm1); + # } + if (self::fe_isnonzero($check)) { + $check = self::fe_add($vxx, $u); /* vx^2 + u */ + if (self::fe_isnonzero($check)) { + throw new RangeException('Internal check failed.'); + } + $h->X = self::fe_mul( + $h->X, + ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$sqrtm1) + ); + } + + # if (fe_isnegative(h->X) == (s[31] >> 7)) { + # fe_neg(h->X,h->X); + # } + $i = self::chrToInt($s[31]); + if (self::fe_isnegative($h->X) === ($i >> 7)) { + $h->X = self::fe_neg($h->X); + } + + # fe_mul(h->T,h->X,h->Y); + $h->T = self::fe_mul($h->X, $h->Y); + return $h; + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $R + * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p + * @param ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $q + * @return ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 + */ + public static function ge_madd( + ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $R, + ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p, + ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $q + ) { + $r = clone $R; + $r->X = self::fe_add($p->Y, $p->X); + $r->Y = self::fe_sub($p->Y, $p->X); + $r->Z = self::fe_mul($r->X, $q->yplusx); + $r->Y = self::fe_mul($r->Y, $q->yminusx); + $r->T = self::fe_mul($q->xy2d, $p->T); + $t0 = self::fe_add(clone $p->Z, clone $p->Z); + $r->X = self::fe_sub($r->Z, $r->Y); + $r->Y = self::fe_add($r->Z, $r->Y); + $r->Z = self::fe_add($t0, $r->T); + $r->T = self::fe_sub($t0, $r->T); + + return $r; + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $R + * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p + * @param ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $q + * @return ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 + */ + public static function ge_msub( + ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $R, + ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p, + ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $q + ) { + $r = clone $R; + + $r->X = self::fe_add($p->Y, $p->X); + $r->Y = self::fe_sub($p->Y, $p->X); + $r->Z = self::fe_mul($r->X, $q->yminusx); + $r->Y = self::fe_mul($r->Y, $q->yplusx); + $r->T = self::fe_mul($q->xy2d, $p->T); + $t0 = self::fe_add($p->Z, $p->Z); + $r->X = self::fe_sub($r->Z, $r->Y); + $r->Y = self::fe_add($r->Z, $r->Y); + $r->Z = self::fe_sub($t0, $r->T); + $r->T = self::fe_add($t0, $r->T); + + return $r; + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $p + * @return ParagonIE_Sodium_Core_Curve25519_Ge_P2 + */ + public static function ge_p1p1_to_p2(ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $p) + { + $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P2(); + $r->X = self::fe_mul($p->X, $p->T); + $r->Y = self::fe_mul($p->Y, $p->Z); + $r->Z = self::fe_mul($p->Z, $p->T); + return $r; + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $p + * @return ParagonIE_Sodium_Core_Curve25519_Ge_P3 + */ + public static function ge_p1p1_to_p3(ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $p) + { + $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P3(); + $r->X = self::fe_mul($p->X, $p->T); + $r->Y = self::fe_mul($p->Y, $p->Z); + $r->Z = self::fe_mul($p->Z, $p->T); + $r->T = self::fe_mul($p->X, $p->Y); + return $r; + } + + /** + * @internal You should not use this directly from another application + * + * @return ParagonIE_Sodium_Core_Curve25519_Ge_P2 + */ + public static function ge_p2_0() + { + return new ParagonIE_Sodium_Core_Curve25519_Ge_P2( + self::fe_0(), + self::fe_1(), + self::fe_1() + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Ge_P2 $p + * @return ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 + */ + public static function ge_p2_dbl(ParagonIE_Sodium_Core_Curve25519_Ge_P2 $p) + { + $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P1p1(); + + $r->X = self::fe_sq($p->X); + $r->Z = self::fe_sq($p->Y); + $r->T = self::fe_sq2($p->Z); + $r->Y = self::fe_add($p->X, $p->Y); + $t0 = self::fe_sq($r->Y); + $r->Y = self::fe_add($r->Z, $r->X); + $r->Z = self::fe_sub($r->Z, $r->X); + $r->X = self::fe_sub($t0, $r->Y); + $r->T = self::fe_sub($r->T, $r->Z); + + return $r; + } + + /** + * @internal You should not use this directly from another application + * + * @return ParagonIE_Sodium_Core_Curve25519_Ge_P3 + */ + public static function ge_p3_0() + { + return new ParagonIE_Sodium_Core_Curve25519_Ge_P3( + self::fe_0(), + self::fe_1(), + self::fe_1(), + self::fe_0() + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p + * @return ParagonIE_Sodium_Core_Curve25519_Ge_Cached + */ + public static function ge_p3_to_cached(ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p) + { + static $d2 = null; + if ($d2 === null) { + $d2 = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$d2); + } + /** @var ParagonIE_Sodium_Core_Curve25519_Fe $d2 */ + $r = new ParagonIE_Sodium_Core_Curve25519_Ge_Cached(); + $r->YplusX = self::fe_add($p->Y, $p->X); + $r->YminusX = self::fe_sub($p->Y, $p->X); + $r->Z = self::fe_copy($p->Z); + $r->T2d = self::fe_mul($p->T, $d2); + return $r; + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p + * @return ParagonIE_Sodium_Core_Curve25519_Ge_P2 + */ + public static function ge_p3_to_p2(ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p) + { + return new ParagonIE_Sodium_Core_Curve25519_Ge_P2( + self::fe_copy($p->X), + self::fe_copy($p->Y), + self::fe_copy($p->Z) + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $h + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function ge_p3_tobytes(ParagonIE_Sodium_Core_Curve25519_Ge_P3 $h) + { + $recip = self::fe_invert($h->Z); + $x = self::fe_mul($h->X, $recip); + $y = self::fe_mul($h->Y, $recip); + $s = self::fe_tobytes($y); + $s[31] = self::intToChr( + self::chrToInt($s[31]) ^ (self::fe_isnegative($x) << 7) + ); + return $s; + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p + * @return ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 + */ + public static function ge_p3_dbl(ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p) + { + $q = self::ge_p3_to_p2($p); + return self::ge_p2_dbl($q); + } + + /** + * @return ParagonIE_Sodium_Core_Curve25519_Ge_Precomp + */ + public static function ge_precomp_0() + { + return new ParagonIE_Sodium_Core_Curve25519_Ge_Precomp( + self::fe_1(), + self::fe_1(), + self::fe_0() + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param int $b + * @param int $c + * @return int + */ + public static function equal($b, $c) + { + return (int) ((($b ^ $c) - 1) >> 31) & 1; + } + + /** + * @internal You should not use this directly from another application + * + * @param int|string $char + * @return int (1 = yes, 0 = no) + * @throws SodiumException + * @throws TypeError + */ + public static function negative($char) + { + if (is_int($char)) { + return ($char >> 63) & 1; + } + $x = self::chrToInt(self::substr($char, 0, 1)); + return (int) ($x >> 63); + } + + /** + * Conditional move + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $t + * @param ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $u + * @param int $b + * @return ParagonIE_Sodium_Core_Curve25519_Ge_Precomp + */ + public static function cmov( + ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $t, + ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $u, + $b + ) { + if (!is_int($b)) { + throw new InvalidArgumentException('Expected an integer.'); + } + return new ParagonIE_Sodium_Core_Curve25519_Ge_Precomp( + self::fe_cmov($t->yplusx, $u->yplusx, $b), + self::fe_cmov($t->yminusx, $u->yminusx, $b), + self::fe_cmov($t->xy2d, $u->xy2d, $b) + ); + } + + /** + * @param ParagonIE_Sodium_Core_Curve25519_Ge_Cached $t + * @param ParagonIE_Sodium_Core_Curve25519_Ge_Cached $u + * @param int $b + * @return ParagonIE_Sodium_Core_Curve25519_Ge_Cached + */ + public static function ge_cmov_cached( + ParagonIE_Sodium_Core_Curve25519_Ge_Cached $t, + ParagonIE_Sodium_Core_Curve25519_Ge_Cached $u, + $b + ) { + $b &= 1; + $ret = new ParagonIE_Sodium_Core_Curve25519_Ge_Cached(); + $ret->YplusX = self::fe_cmov($t->YplusX, $u->YplusX, $b); + $ret->YminusX = self::fe_cmov($t->YminusX, $u->YminusX, $b); + $ret->Z = self::fe_cmov($t->Z, $u->Z, $b); + $ret->T2d = self::fe_cmov($t->T2d, $u->T2d, $b); + return $ret; + } + + /** + * @param ParagonIE_Sodium_Core_Curve25519_Ge_Cached[] $cached + * @param int $b + * @return ParagonIE_Sodium_Core_Curve25519_Ge_Cached + * @throws SodiumException + */ + public static function ge_cmov8_cached(array $cached, $b) + { + // const unsigned char bnegative = negative(b); + // const unsigned char babs = b - (((-bnegative) & b) * ((signed char) 1 << 1)); + $bnegative = self::negative($b); + $babs = $b - (((-$bnegative) & $b) << 1); + + // ge25519_cached_0(t); + $t = new ParagonIE_Sodium_Core_Curve25519_Ge_Cached( + self::fe_1(), + self::fe_1(), + self::fe_1(), + self::fe_0() + ); + + // ge25519_cmov_cached(t, &cached[0], equal(babs, 1)); + // ge25519_cmov_cached(t, &cached[1], equal(babs, 2)); + // ge25519_cmov_cached(t, &cached[2], equal(babs, 3)); + // ge25519_cmov_cached(t, &cached[3], equal(babs, 4)); + // ge25519_cmov_cached(t, &cached[4], equal(babs, 5)); + // ge25519_cmov_cached(t, &cached[5], equal(babs, 6)); + // ge25519_cmov_cached(t, &cached[6], equal(babs, 7)); + // ge25519_cmov_cached(t, &cached[7], equal(babs, 8)); + for ($x = 0; $x < 8; ++$x) { + $t = self::ge_cmov_cached($t, $cached[$x], self::equal($babs, $x + 1)); + } + + // fe25519_copy(minust.YplusX, t->YminusX); + // fe25519_copy(minust.YminusX, t->YplusX); + // fe25519_copy(minust.Z, t->Z); + // fe25519_neg(minust.T2d, t->T2d); + $minust = new ParagonIE_Sodium_Core_Curve25519_Ge_Cached( + self::fe_copy($t->YminusX), + self::fe_copy($t->YplusX), + self::fe_copy($t->Z), + self::fe_neg($t->T2d) + ); + return self::ge_cmov_cached($t, $minust, $bnegative); + } + + /** + * @internal You should not use this directly from another application + * + * @param int $pos + * @param int $b + * @return ParagonIE_Sodium_Core_Curve25519_Ge_Precomp + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedArrayAccess + * @psalm-suppress MixedArrayOffset + */ + public static function ge_select($pos = 0, $b = 0) + { + static $base = null; + if ($base === null) { + $base = array(); + /** @var int $i */ + foreach (self::$base as $i => $bas) { + for ($j = 0; $j < 8; ++$j) { + $base[$i][$j] = new ParagonIE_Sodium_Core_Curve25519_Ge_Precomp( + ParagonIE_Sodium_Core_Curve25519_Fe::fromArray($bas[$j][0]), + ParagonIE_Sodium_Core_Curve25519_Fe::fromArray($bas[$j][1]), + ParagonIE_Sodium_Core_Curve25519_Fe::fromArray($bas[$j][2]) + ); + } + } + } + /** @var array> $base */ + if (!is_int($pos)) { + throw new InvalidArgumentException('Position must be an integer'); + } + if ($pos < 0 || $pos > 31) { + throw new RangeException('Position is out of range [0, 31]'); + } + + /** @var int $bnegative */ + $bnegative = self::negative($b); + /** @var int $babs */ + $babs = $b - (((-$bnegative) & $b) << 1); + + $t = self::ge_precomp_0(); + for ($i = 0; $i < 8; ++$i) { + $t = self::cmov( + $t, + $base[$pos][$i], + self::equal($babs, $i + 1) + ); + } + $minusT = new ParagonIE_Sodium_Core_Curve25519_Ge_Precomp( + self::fe_copy($t->yminusx), + self::fe_copy($t->yplusx), + self::fe_neg($t->xy2d) + ); + return self::cmov($t, $minusT, $bnegative); + } + + /** + * Subtract two group elements. + * + * r = p - q + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p + * @param ParagonIE_Sodium_Core_Curve25519_Ge_Cached $q + * @return ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 + */ + public static function ge_sub( + ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p, + ParagonIE_Sodium_Core_Curve25519_Ge_Cached $q + ) { + $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P1p1(); + + $r->X = self::fe_add($p->Y, $p->X); + $r->Y = self::fe_sub($p->Y, $p->X); + $r->Z = self::fe_mul($r->X, $q->YminusX); + $r->Y = self::fe_mul($r->Y, $q->YplusX); + $r->T = self::fe_mul($q->T2d, $p->T); + $r->X = self::fe_mul($p->Z, $q->Z); + $t0 = self::fe_add($r->X, $r->X); + $r->X = self::fe_sub($r->Z, $r->Y); + $r->Y = self::fe_add($r->Z, $r->Y); + $r->Z = self::fe_sub($t0, $r->T); + $r->T = self::fe_add($t0, $r->T); + + return $r; + } + + /** + * Convert a group element to a byte string. + * + * @param ParagonIE_Sodium_Core_Curve25519_Ge_P2 $h + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function ge_tobytes(ParagonIE_Sodium_Core_Curve25519_Ge_P2 $h) + { + $recip = self::fe_invert($h->Z); + $x = self::fe_mul($h->X, $recip); + $y = self::fe_mul($h->Y, $recip); + $s = self::fe_tobytes($y); + $s[31] = self::intToChr( + self::chrToInt($s[31]) ^ (self::fe_isnegative($x) << 7) + ); + return $s; + } + + /** + * @internal You should not use this directly from another application + * + * @param string $a + * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A + * @param string $b + * @return ParagonIE_Sodium_Core_Curve25519_Ge_P2 + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedArrayAccess + */ + public static function ge_double_scalarmult_vartime( + $a, + ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A, + $b + ) { + /** @var array $Ai */ + $Ai = array(); + + /** @var array $Bi */ + static $Bi = array(); + if (!$Bi) { + for ($i = 0; $i < 8; ++$i) { + $Bi[$i] = new ParagonIE_Sodium_Core_Curve25519_Ge_Precomp( + ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$base2[$i][0]), + ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$base2[$i][1]), + ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$base2[$i][2]) + ); + } + } + for ($i = 0; $i < 8; ++$i) { + $Ai[$i] = new ParagonIE_Sodium_Core_Curve25519_Ge_Cached( + self::fe_0(), + self::fe_0(), + self::fe_0(), + self::fe_0() + ); + } + + # slide(aslide,a); + # slide(bslide,b); + /** @var array $aslide */ + $aslide = self::slide($a); + /** @var array $bslide */ + $bslide = self::slide($b); + + # ge_p3_to_cached(&Ai[0],A); + # ge_p3_dbl(&t,A); ge_p1p1_to_p3(&A2,&t); + $Ai[0] = self::ge_p3_to_cached($A); + $t = self::ge_p3_dbl($A); + $A2 = self::ge_p1p1_to_p3($t); + + # ge_add(&t,&A2,&Ai[0]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[1],&u); + # ge_add(&t,&A2,&Ai[1]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[2],&u); + # ge_add(&t,&A2,&Ai[2]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[3],&u); + # ge_add(&t,&A2,&Ai[3]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[4],&u); + # ge_add(&t,&A2,&Ai[4]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[5],&u); + # ge_add(&t,&A2,&Ai[5]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[6],&u); + # ge_add(&t,&A2,&Ai[6]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[7],&u); + for ($i = 0; $i < 7; ++$i) { + $t = self::ge_add($A2, $Ai[$i]); + $u = self::ge_p1p1_to_p3($t); + $Ai[$i + 1] = self::ge_p3_to_cached($u); + } + + # ge_p2_0(r); + $r = self::ge_p2_0(); + + # for (i = 255;i >= 0;--i) { + # if (aslide[i] || bslide[i]) break; + # } + $i = 255; + for (; $i >= 0; --$i) { + if ($aslide[$i] || $bslide[$i]) { + break; + } + } + + # for (;i >= 0;--i) { + for (; $i >= 0; --$i) { + # ge_p2_dbl(&t,r); + $t = self::ge_p2_dbl($r); + + # if (aslide[i] > 0) { + if ($aslide[$i] > 0) { + # ge_p1p1_to_p3(&u,&t); + # ge_add(&t,&u,&Ai[aslide[i]/2]); + $u = self::ge_p1p1_to_p3($t); + $t = self::ge_add( + $u, + $Ai[(int) floor($aslide[$i] / 2)] + ); + # } else if (aslide[i] < 0) { + } elseif ($aslide[$i] < 0) { + # ge_p1p1_to_p3(&u,&t); + # ge_sub(&t,&u,&Ai[(-aslide[i])/2]); + $u = self::ge_p1p1_to_p3($t); + $t = self::ge_sub( + $u, + $Ai[(int) floor(-$aslide[$i] / 2)] + ); + } + + # if (bslide[i] > 0) { + if ($bslide[$i] > 0) { + /** @var int $index */ + $index = (int) floor($bslide[$i] / 2); + # ge_p1p1_to_p3(&u,&t); + # ge_madd(&t,&u,&Bi[bslide[i]/2]); + $u = self::ge_p1p1_to_p3($t); + $t = self::ge_madd($t, $u, $Bi[$index]); + # } else if (bslide[i] < 0) { + } elseif ($bslide[$i] < 0) { + /** @var int $index */ + $index = (int) floor(-$bslide[$i] / 2); + # ge_p1p1_to_p3(&u,&t); + # ge_msub(&t,&u,&Bi[(-bslide[i])/2]); + $u = self::ge_p1p1_to_p3($t); + $t = self::ge_msub($t, $u, $Bi[$index]); + } + # ge_p1p1_to_p2(r,&t); + $r = self::ge_p1p1_to_p2($t); + } + return $r; + } + + /** + * @internal You should not use this directly from another application + * + * @param string $a + * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p + * @return ParagonIE_Sodium_Core_Curve25519_Ge_P3 + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedAssignment + * @psalm-suppress MixedOperand + */ + public static function ge_scalarmult($a, $p) + { + $e = array_fill(0, 64, 0); + + /** @var ParagonIE_Sodium_Core_Curve25519_Ge_Cached[] $pi */ + $pi = array(); + + // ge25519_p3_to_cached(&pi[1 - 1], p); /* p */ + $pi[0] = self::ge_p3_to_cached($p); + + // ge25519_p3_dbl(&t2, p); + // ge25519_p1p1_to_p3(&p2, &t2); + // ge25519_p3_to_cached(&pi[2 - 1], &p2); /* 2p = 2*p */ + $t2 = self::ge_p3_dbl($p); + $p2 = self::ge_p1p1_to_p3($t2); + $pi[1] = self::ge_p3_to_cached($p2); + + // ge25519_add_cached(&t3, p, &pi[2 - 1]); + // ge25519_p1p1_to_p3(&p3, &t3); + // ge25519_p3_to_cached(&pi[3 - 1], &p3); /* 3p = 2p+p */ + $t3 = self::ge_add($p, $pi[1]); + $p3 = self::ge_p1p1_to_p3($t3); + $pi[2] = self::ge_p3_to_cached($p3); + + // ge25519_p3_dbl(&t4, &p2); + // ge25519_p1p1_to_p3(&p4, &t4); + // ge25519_p3_to_cached(&pi[4 - 1], &p4); /* 4p = 2*2p */ + $t4 = self::ge_p3_dbl($p2); + $p4 = self::ge_p1p1_to_p3($t4); + $pi[3] = self::ge_p3_to_cached($p4); + + // ge25519_add_cached(&t5, p, &pi[4 - 1]); + // ge25519_p1p1_to_p3(&p5, &t5); + // ge25519_p3_to_cached(&pi[5 - 1], &p5); /* 5p = 4p+p */ + $t5 = self::ge_add($p, $pi[3]); + $p5 = self::ge_p1p1_to_p3($t5); + $pi[4] = self::ge_p3_to_cached($p5); + + // ge25519_p3_dbl(&t6, &p3); + // ge25519_p1p1_to_p3(&p6, &t6); + // ge25519_p3_to_cached(&pi[6 - 1], &p6); /* 6p = 2*3p */ + $t6 = self::ge_p3_dbl($p3); + $p6 = self::ge_p1p1_to_p3($t6); + $pi[5] = self::ge_p3_to_cached($p6); + + // ge25519_add_cached(&t7, p, &pi[6 - 1]); + // ge25519_p1p1_to_p3(&p7, &t7); + // ge25519_p3_to_cached(&pi[7 - 1], &p7); /* 7p = 6p+p */ + $t7 = self::ge_add($p, $pi[5]); + $p7 = self::ge_p1p1_to_p3($t7); + $pi[6] = self::ge_p3_to_cached($p7); + + // ge25519_p3_dbl(&t8, &p4); + // ge25519_p1p1_to_p3(&p8, &t8); + // ge25519_p3_to_cached(&pi[8 - 1], &p8); /* 8p = 2*4p */ + $t8 = self::ge_p3_dbl($p4); + $p8 = self::ge_p1p1_to_p3($t8); + $pi[7] = self::ge_p3_to_cached($p8); + + + // for (i = 0; i < 32; ++i) { + // e[2 * i + 0] = (a[i] >> 0) & 15; + // e[2 * i + 1] = (a[i] >> 4) & 15; + // } + for ($i = 0; $i < 32; ++$i) { + $e[($i << 1) ] = self::chrToInt($a[$i]) & 15; + $e[($i << 1) + 1] = (self::chrToInt($a[$i]) >> 4) & 15; + } + // /* each e[i] is between 0 and 15 */ + // /* e[63] is between 0 and 7 */ + + // carry = 0; + // for (i = 0; i < 63; ++i) { + // e[i] += carry; + // carry = e[i] + 8; + // carry >>= 4; + // e[i] -= carry * ((signed char) 1 << 4); + // } + $carry = 0; + for ($i = 0; $i < 64; ++$i) { + $e[$i] += $carry; + $carry = $e[$i] + 8; + $carry >>= 4; + $e[$i] -= $carry << 4; + } + // e[63] += carry; + // /* each e[i] is between -8 and 8 */ + $e[63] += $carry; + + // ge25519_p3_0(h); + $h = self::ge_p3_0(); + + // for (i = 63; i != 0; i--) { + for ($i = 63; $i != 0; --$i) { + // ge25519_cmov8_cached(&t, pi, e[i]); + $t = self::ge_cmov8_cached($pi, $e[$i]); + // ge25519_add_cached(&r, h, &t); + $r = self::ge_add($h, $t); + + // ge25519_p1p1_to_p2(&s, &r); + // ge25519_p2_dbl(&r, &s); + // ge25519_p1p1_to_p2(&s, &r); + // ge25519_p2_dbl(&r, &s); + // ge25519_p1p1_to_p2(&s, &r); + // ge25519_p2_dbl(&r, &s); + // ge25519_p1p1_to_p2(&s, &r); + // ge25519_p2_dbl(&r, &s); + $s = self::ge_p1p1_to_p2($r); + $r = self::ge_p2_dbl($s); + $s = self::ge_p1p1_to_p2($r); + $r = self::ge_p2_dbl($s); + $s = self::ge_p1p1_to_p2($r); + $r = self::ge_p2_dbl($s); + $s = self::ge_p1p1_to_p2($r); + $r = self::ge_p2_dbl($s); + + // ge25519_p1p1_to_p3(h, &r); /* *16 */ + $h = self::ge_p1p1_to_p3($r); /* *16 */ + } + + // ge25519_cmov8_cached(&t, pi, e[i]); + // ge25519_add_cached(&r, h, &t); + // ge25519_p1p1_to_p3(h, &r); + $t = self::ge_cmov8_cached($pi, $e[0]); + $r = self::ge_add($h, $t); + return self::ge_p1p1_to_p3($r); + } + + /** + * @internal You should not use this directly from another application + * + * @param string $a + * @return ParagonIE_Sodium_Core_Curve25519_Ge_P3 + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedAssignment + * @psalm-suppress MixedOperand + */ + public static function ge_scalarmult_base($a) + { + /** @var array $e */ + $e = array(); + $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P1p1(); + + for ($i = 0; $i < 32; ++$i) { + /** @var int $dbl */ + $dbl = (int) $i << 1; + $e[$dbl] = (int) self::chrToInt($a[$i]) & 15; + $e[$dbl + 1] = (int) (self::chrToInt($a[$i]) >> 4) & 15; + } + + /** @var int $carry */ + $carry = 0; + for ($i = 0; $i < 63; ++$i) { + $e[$i] += $carry; + /** @var int $carry */ + $carry = $e[$i] + 8; + /** @var int $carry */ + $carry >>= 4; + $e[$i] -= $carry << 4; + } + /** @var array $e */ + $e[63] += (int) $carry; + + $h = self::ge_p3_0(); + + for ($i = 1; $i < 64; $i += 2) { + $t = self::ge_select((int) floor($i / 2), (int) $e[$i]); + $r = self::ge_madd($r, $h, $t); + $h = self::ge_p1p1_to_p3($r); + } + + $r = self::ge_p3_dbl($h); + + $s = self::ge_p1p1_to_p2($r); + $r = self::ge_p2_dbl($s); + $s = self::ge_p1p1_to_p2($r); + $r = self::ge_p2_dbl($s); + $s = self::ge_p1p1_to_p2($r); + $r = self::ge_p2_dbl($s); + + $h = self::ge_p1p1_to_p3($r); + + for ($i = 0; $i < 64; $i += 2) { + $t = self::ge_select($i >> 1, (int) $e[$i]); + $r = self::ge_madd($r, $h, $t); + $h = self::ge_p1p1_to_p3($r); + } + return $h; + } + + /** + * Calculates (ab + c) mod l + * where l = 2^252 + 27742317777372353535851937790883648493 + * + * @internal You should not use this directly from another application + * + * @param string $a + * @param string $b + * @param string $c + * @return string + * @throws TypeError + */ + public static function sc_muladd($a, $b, $c) + { + /** @var int $a0 */ + $a0 = 2097151 & self::load_3(self::substr($a, 0, 3)); + /** @var int $a1 */ + $a1 = 2097151 & (self::load_4(self::substr($a, 2, 4)) >> 5); + /** @var int $a2 */ + $a2 = 2097151 & (self::load_3(self::substr($a, 5, 3)) >> 2); + /** @var int $a3 */ + $a3 = 2097151 & (self::load_4(self::substr($a, 7, 4)) >> 7); + /** @var int $a4 */ + $a4 = 2097151 & (self::load_4(self::substr($a, 10, 4)) >> 4); + /** @var int $a5 */ + $a5 = 2097151 & (self::load_3(self::substr($a, 13, 3)) >> 1); + /** @var int $a6 */ + $a6 = 2097151 & (self::load_4(self::substr($a, 15, 4)) >> 6); + /** @var int $a7 */ + $a7 = 2097151 & (self::load_3(self::substr($a, 18, 3)) >> 3); + /** @var int $a8 */ + $a8 = 2097151 & self::load_3(self::substr($a, 21, 3)); + /** @var int $a9 */ + $a9 = 2097151 & (self::load_4(self::substr($a, 23, 4)) >> 5); + /** @var int $a10 */ + $a10 = 2097151 & (self::load_3(self::substr($a, 26, 3)) >> 2); + /** @var int $a11 */ + $a11 = (self::load_4(self::substr($a, 28, 4)) >> 7); + + /** @var int $b0 */ + $b0 = 2097151 & self::load_3(self::substr($b, 0, 3)); + /** @var int $b1 */ + $b1 = 2097151 & (self::load_4(self::substr($b, 2, 4)) >> 5); + /** @var int $b2 */ + $b2 = 2097151 & (self::load_3(self::substr($b, 5, 3)) >> 2); + /** @var int $b3 */ + $b3 = 2097151 & (self::load_4(self::substr($b, 7, 4)) >> 7); + /** @var int $b4 */ + $b4 = 2097151 & (self::load_4(self::substr($b, 10, 4)) >> 4); + /** @var int $b5 */ + $b5 = 2097151 & (self::load_3(self::substr($b, 13, 3)) >> 1); + /** @var int $b6 */ + $b6 = 2097151 & (self::load_4(self::substr($b, 15, 4)) >> 6); + /** @var int $b7 */ + $b7 = 2097151 & (self::load_3(self::substr($b, 18, 3)) >> 3); + /** @var int $b8 */ + $b8 = 2097151 & self::load_3(self::substr($b, 21, 3)); + /** @var int $b9 */ + $b9 = 2097151 & (self::load_4(self::substr($b, 23, 4)) >> 5); + /** @var int $b10 */ + $b10 = 2097151 & (self::load_3(self::substr($b, 26, 3)) >> 2); + /** @var int $b11 */ + $b11 = (self::load_4(self::substr($b, 28, 4)) >> 7); + + /** @var int $c0 */ + $c0 = 2097151 & self::load_3(self::substr($c, 0, 3)); + /** @var int $c1 */ + $c1 = 2097151 & (self::load_4(self::substr($c, 2, 4)) >> 5); + /** @var int $c2 */ + $c2 = 2097151 & (self::load_3(self::substr($c, 5, 3)) >> 2); + /** @var int $c3 */ + $c3 = 2097151 & (self::load_4(self::substr($c, 7, 4)) >> 7); + /** @var int $c4 */ + $c4 = 2097151 & (self::load_4(self::substr($c, 10, 4)) >> 4); + /** @var int $c5 */ + $c5 = 2097151 & (self::load_3(self::substr($c, 13, 3)) >> 1); + /** @var int $c6 */ + $c6 = 2097151 & (self::load_4(self::substr($c, 15, 4)) >> 6); + /** @var int $c7 */ + $c7 = 2097151 & (self::load_3(self::substr($c, 18, 3)) >> 3); + /** @var int $c8 */ + $c8 = 2097151 & self::load_3(self::substr($c, 21, 3)); + /** @var int $c9 */ + $c9 = 2097151 & (self::load_4(self::substr($c, 23, 4)) >> 5); + /** @var int $c10 */ + $c10 = 2097151 & (self::load_3(self::substr($c, 26, 3)) >> 2); + /** @var int $c11 */ + $c11 = (self::load_4(self::substr($c, 28, 4)) >> 7); + + /* Can't really avoid the pyramid here: */ + $s0 = $c0 + self::mul($a0, $b0, 24); + $s1 = $c1 + self::mul($a0, $b1, 24) + self::mul($a1, $b0, 24); + $s2 = $c2 + self::mul($a0, $b2, 24) + self::mul($a1, $b1, 24) + self::mul($a2, $b0, 24); + $s3 = $c3 + self::mul($a0, $b3, 24) + self::mul($a1, $b2, 24) + self::mul($a2, $b1, 24) + self::mul($a3, $b0, 24); + $s4 = $c4 + self::mul($a0, $b4, 24) + self::mul($a1, $b3, 24) + self::mul($a2, $b2, 24) + self::mul($a3, $b1, 24) + + self::mul($a4, $b0, 24); + $s5 = $c5 + self::mul($a0, $b5, 24) + self::mul($a1, $b4, 24) + self::mul($a2, $b3, 24) + self::mul($a3, $b2, 24) + + self::mul($a4, $b1, 24) + self::mul($a5, $b0, 24); + $s6 = $c6 + self::mul($a0, $b6, 24) + self::mul($a1, $b5, 24) + self::mul($a2, $b4, 24) + self::mul($a3, $b3, 24) + + self::mul($a4, $b2, 24) + self::mul($a5, $b1, 24) + self::mul($a6, $b0, 24); + $s7 = $c7 + self::mul($a0, $b7, 24) + self::mul($a1, $b6, 24) + self::mul($a2, $b5, 24) + self::mul($a3, $b4, 24) + + self::mul($a4, $b3, 24) + self::mul($a5, $b2, 24) + self::mul($a6, $b1, 24) + self::mul($a7, $b0, 24); + $s8 = $c8 + self::mul($a0, $b8, 24) + self::mul($a1, $b7, 24) + self::mul($a2, $b6, 24) + self::mul($a3, $b5, 24) + + self::mul($a4, $b4, 24) + self::mul($a5, $b3, 24) + self::mul($a6, $b2, 24) + self::mul($a7, $b1, 24) + + self::mul($a8, $b0, 24); + $s9 = $c9 + self::mul($a0, $b9, 24) + self::mul($a1, $b8, 24) + self::mul($a2, $b7, 24) + self::mul($a3, $b6, 24) + + self::mul($a4, $b5, 24) + self::mul($a5, $b4, 24) + self::mul($a6, $b3, 24) + self::mul($a7, $b2, 24) + + self::mul($a8, $b1, 24) + self::mul($a9, $b0, 24); + $s10 = $c10 + self::mul($a0, $b10, 24) + self::mul($a1, $b9, 24) + self::mul($a2, $b8, 24) + self::mul($a3, $b7, 24) + + self::mul($a4, $b6, 24) + self::mul($a5, $b5, 24) + self::mul($a6, $b4, 24) + self::mul($a7, $b3, 24) + + self::mul($a8, $b2, 24) + self::mul($a9, $b1, 24) + self::mul($a10, $b0, 24); + $s11 = $c11 + self::mul($a0, $b11, 24) + self::mul($a1, $b10, 24) + self::mul($a2, $b9, 24) + self::mul($a3, $b8, 24) + + self::mul($a4, $b7, 24) + self::mul($a5, $b6, 24) + self::mul($a6, $b5, 24) + self::mul($a7, $b4, 24) + + self::mul($a8, $b3, 24) + self::mul($a9, $b2, 24) + self::mul($a10, $b1, 24) + self::mul($a11, $b0, 24); + $s12 = self::mul($a1, $b11, 24) + self::mul($a2, $b10, 24) + self::mul($a3, $b9, 24) + self::mul($a4, $b8, 24) + + self::mul($a5, $b7, 24) + self::mul($a6, $b6, 24) + self::mul($a7, $b5, 24) + self::mul($a8, $b4, 24) + + self::mul($a9, $b3, 24) + self::mul($a10, $b2, 24) + self::mul($a11, $b1, 24); + $s13 = self::mul($a2, $b11, 24) + self::mul($a3, $b10, 24) + self::mul($a4, $b9, 24) + self::mul($a5, $b8, 24) + + self::mul($a6, $b7, 24) + self::mul($a7, $b6, 24) + self::mul($a8, $b5, 24) + self::mul($a9, $b4, 24) + + self::mul($a10, $b3, 24) + self::mul($a11, $b2, 24); + $s14 = self::mul($a3, $b11, 24) + self::mul($a4, $b10, 24) + self::mul($a5, $b9, 24) + self::mul($a6, $b8, 24) + + self::mul($a7, $b7, 24) + self::mul($a8, $b6, 24) + self::mul($a9, $b5, 24) + self::mul($a10, $b4, 24) + + self::mul($a11, $b3, 24); + $s15 = self::mul($a4, $b11, 24) + self::mul($a5, $b10, 24) + self::mul($a6, $b9, 24) + self::mul($a7, $b8, 24) + + self::mul($a8, $b7, 24) + self::mul($a9, $b6, 24) + self::mul($a10, $b5, 24) + self::mul($a11, $b4, 24); + $s16 = self::mul($a5, $b11, 24) + self::mul($a6, $b10, 24) + self::mul($a7, $b9, 24) + self::mul($a8, $b8, 24) + + self::mul($a9, $b7, 24) + self::mul($a10, $b6, 24) + self::mul($a11, $b5, 24); + $s17 = self::mul($a6, $b11, 24) + self::mul($a7, $b10, 24) + self::mul($a8, $b9, 24) + self::mul($a9, $b8, 24) + + self::mul($a10, $b7, 24) + self::mul($a11, $b6, 24); + $s18 = self::mul($a7, $b11, 24) + self::mul($a8, $b10, 24) + self::mul($a9, $b9, 24) + self::mul($a10, $b8, 24) + + self::mul($a11, $b7, 24); + $s19 = self::mul($a8, $b11, 24) + self::mul($a9, $b10, 24) + self::mul($a10, $b9, 24) + self::mul($a11, $b8, 24); + $s20 = self::mul($a9, $b11, 24) + self::mul($a10, $b10, 24) + self::mul($a11, $b9, 24); + $s21 = self::mul($a10, $b11, 24) + self::mul($a11, $b10, 24); + $s22 = self::mul($a11, $b11, 24); + $s23 = 0; + + /** @var int $carry0 */ + $carry0 = ($s0 + (1 << 20)) >> 21; + $s1 += $carry0; + $s0 -= $carry0 << 21; + /** @var int $carry2 */ + $carry2 = ($s2 + (1 << 20)) >> 21; + $s3 += $carry2; + $s2 -= $carry2 << 21; + /** @var int $carry4 */ + $carry4 = ($s4 + (1 << 20)) >> 21; + $s5 += $carry4; + $s4 -= $carry4 << 21; + /** @var int $carry6 */ + $carry6 = ($s6 + (1 << 20)) >> 21; + $s7 += $carry6; + $s6 -= $carry6 << 21; + /** @var int $carry8 */ + $carry8 = ($s8 + (1 << 20)) >> 21; + $s9 += $carry8; + $s8 -= $carry8 << 21; + /** @var int $carry10 */ + $carry10 = ($s10 + (1 << 20)) >> 21; + $s11 += $carry10; + $s10 -= $carry10 << 21; + /** @var int $carry12 */ + $carry12 = ($s12 + (1 << 20)) >> 21; + $s13 += $carry12; + $s12 -= $carry12 << 21; + /** @var int $carry14 */ + $carry14 = ($s14 + (1 << 20)) >> 21; + $s15 += $carry14; + $s14 -= $carry14 << 21; + /** @var int $carry16 */ + $carry16 = ($s16 + (1 << 20)) >> 21; + $s17 += $carry16; + $s16 -= $carry16 << 21; + /** @var int $carry18 */ + $carry18 = ($s18 + (1 << 20)) >> 21; + $s19 += $carry18; + $s18 -= $carry18 << 21; + /** @var int $carry20 */ + $carry20 = ($s20 + (1 << 20)) >> 21; + $s21 += $carry20; + $s20 -= $carry20 << 21; + /** @var int $carry22 */ + $carry22 = ($s22 + (1 << 20)) >> 21; + $s23 += $carry22; + $s22 -= $carry22 << 21; + + /** @var int $carry1 */ + $carry1 = ($s1 + (1 << 20)) >> 21; + $s2 += $carry1; + $s1 -= $carry1 << 21; + /** @var int $carry3 */ + $carry3 = ($s3 + (1 << 20)) >> 21; + $s4 += $carry3; + $s3 -= $carry3 << 21; + /** @var int $carry5 */ + $carry5 = ($s5 + (1 << 20)) >> 21; + $s6 += $carry5; + $s5 -= $carry5 << 21; + /** @var int $carry7 */ + $carry7 = ($s7 + (1 << 20)) >> 21; + $s8 += $carry7; + $s7 -= $carry7 << 21; + /** @var int $carry9 */ + $carry9 = ($s9 + (1 << 20)) >> 21; + $s10 += $carry9; + $s9 -= $carry9 << 21; + /** @var int $carry11 */ + $carry11 = ($s11 + (1 << 20)) >> 21; + $s12 += $carry11; + $s11 -= $carry11 << 21; + /** @var int $carry13 */ + $carry13 = ($s13 + (1 << 20)) >> 21; + $s14 += $carry13; + $s13 -= $carry13 << 21; + /** @var int $carry15 */ + $carry15 = ($s15 + (1 << 20)) >> 21; + $s16 += $carry15; + $s15 -= $carry15 << 21; + /** @var int $carry17 */ + $carry17 = ($s17 + (1 << 20)) >> 21; + $s18 += $carry17; + $s17 -= $carry17 << 21; + /** @var int $carry19 */ + $carry19 = ($s19 + (1 << 20)) >> 21; + $s20 += $carry19; + $s19 -= $carry19 << 21; + /** @var int $carry21 */ + $carry21 = ($s21 + (1 << 20)) >> 21; + $s22 += $carry21; + $s21 -= $carry21 << 21; + + $s11 += self::mul($s23, 666643, 20); + $s12 += self::mul($s23, 470296, 19); + $s13 += self::mul($s23, 654183, 20); + $s14 -= self::mul($s23, 997805, 20); + $s15 += self::mul($s23, 136657, 18); + $s16 -= self::mul($s23, 683901, 20); + + $s10 += self::mul($s22, 666643, 20); + $s11 += self::mul($s22, 470296, 19); + $s12 += self::mul($s22, 654183, 20); + $s13 -= self::mul($s22, 997805, 20); + $s14 += self::mul($s22, 136657, 18); + $s15 -= self::mul($s22, 683901, 20); + + $s9 += self::mul($s21, 666643, 20); + $s10 += self::mul($s21, 470296, 19); + $s11 += self::mul($s21, 654183, 20); + $s12 -= self::mul($s21, 997805, 20); + $s13 += self::mul($s21, 136657, 18); + $s14 -= self::mul($s21, 683901, 20); + + $s8 += self::mul($s20, 666643, 20); + $s9 += self::mul($s20, 470296, 19); + $s10 += self::mul($s20, 654183, 20); + $s11 -= self::mul($s20, 997805, 20); + $s12 += self::mul($s20, 136657, 18); + $s13 -= self::mul($s20, 683901, 20); + + $s7 += self::mul($s19, 666643, 20); + $s8 += self::mul($s19, 470296, 19); + $s9 += self::mul($s19, 654183, 20); + $s10 -= self::mul($s19, 997805, 20); + $s11 += self::mul($s19, 136657, 18); + $s12 -= self::mul($s19, 683901, 20); + + $s6 += self::mul($s18, 666643, 20); + $s7 += self::mul($s18, 470296, 19); + $s8 += self::mul($s18, 654183, 20); + $s9 -= self::mul($s18, 997805, 20); + $s10 += self::mul($s18, 136657, 18); + $s11 -= self::mul($s18, 683901, 20); + + /** @var int $carry6 */ + $carry6 = ($s6 + (1 << 20)) >> 21; + $s7 += $carry6; + $s6 -= $carry6 << 21; + /** @var int $carry8 */ + $carry8 = ($s8 + (1 << 20)) >> 21; + $s9 += $carry8; + $s8 -= $carry8 << 21; + /** @var int $carry10 */ + $carry10 = ($s10 + (1 << 20)) >> 21; + $s11 += $carry10; + $s10 -= $carry10 << 21; + /** @var int $carry12 */ + $carry12 = ($s12 + (1 << 20)) >> 21; + $s13 += $carry12; + $s12 -= $carry12 << 21; + /** @var int $carry14 */ + $carry14 = ($s14 + (1 << 20)) >> 21; + $s15 += $carry14; + $s14 -= $carry14 << 21; + /** @var int $carry16 */ + $carry16 = ($s16 + (1 << 20)) >> 21; + $s17 += $carry16; + $s16 -= $carry16 << 21; + + /** @var int $carry7 */ + $carry7 = ($s7 + (1 << 20)) >> 21; + $s8 += $carry7; + $s7 -= $carry7 << 21; + /** @var int $carry9 */ + $carry9 = ($s9 + (1 << 20)) >> 21; + $s10 += $carry9; + $s9 -= $carry9 << 21; + /** @var int $carry11 */ + $carry11 = ($s11 + (1 << 20)) >> 21; + $s12 += $carry11; + $s11 -= $carry11 << 21; + /** @var int $carry13 */ + $carry13 = ($s13 + (1 << 20)) >> 21; + $s14 += $carry13; + $s13 -= $carry13 << 21; + /** @var int $carry15 */ + $carry15 = ($s15 + (1 << 20)) >> 21; + $s16 += $carry15; + $s15 -= $carry15 << 21; + + $s5 += self::mul($s17, 666643, 20); + $s6 += self::mul($s17, 470296, 19); + $s7 += self::mul($s17, 654183, 20); + $s8 -= self::mul($s17, 997805, 20); + $s9 += self::mul($s17, 136657, 18); + $s10 -= self::mul($s17, 683901, 20); + + $s4 += self::mul($s16, 666643, 20); + $s5 += self::mul($s16, 470296, 19); + $s6 += self::mul($s16, 654183, 20); + $s7 -= self::mul($s16, 997805, 20); + $s8 += self::mul($s16, 136657, 18); + $s9 -= self::mul($s16, 683901, 20); + + $s3 += self::mul($s15, 666643, 20); + $s4 += self::mul($s15, 470296, 19); + $s5 += self::mul($s15, 654183, 20); + $s6 -= self::mul($s15, 997805, 20); + $s7 += self::mul($s15, 136657, 18); + $s8 -= self::mul($s15, 683901, 20); + + $s2 += self::mul($s14, 666643, 20); + $s3 += self::mul($s14, 470296, 19); + $s4 += self::mul($s14, 654183, 20); + $s5 -= self::mul($s14, 997805, 20); + $s6 += self::mul($s14, 136657, 18); + $s7 -= self::mul($s14, 683901, 20); + + $s1 += self::mul($s13, 666643, 20); + $s2 += self::mul($s13, 470296, 19); + $s3 += self::mul($s13, 654183, 20); + $s4 -= self::mul($s13, 997805, 20); + $s5 += self::mul($s13, 136657, 18); + $s6 -= self::mul($s13, 683901, 20); + + $s0 += self::mul($s12, 666643, 20); + $s1 += self::mul($s12, 470296, 19); + $s2 += self::mul($s12, 654183, 20); + $s3 -= self::mul($s12, 997805, 20); + $s4 += self::mul($s12, 136657, 18); + $s5 -= self::mul($s12, 683901, 20); + $s12 = 0; + + /** @var int $carry0 */ + $carry0 = ($s0 + (1 << 20)) >> 21; + $s1 += $carry0; + $s0 -= $carry0 << 21; + /** @var int $carry2 */ + $carry2 = ($s2 + (1 << 20)) >> 21; + $s3 += $carry2; + $s2 -= $carry2 << 21; + /** @var int $carry4 */ + $carry4 = ($s4 + (1 << 20)) >> 21; + $s5 += $carry4; + $s4 -= $carry4 << 21; + /** @var int $carry6 */ + $carry6 = ($s6 + (1 << 20)) >> 21; + $s7 += $carry6; + $s6 -= $carry6 << 21; + /** @var int $carry8 */ + $carry8 = ($s8 + (1 << 20)) >> 21; + $s9 += $carry8; + $s8 -= $carry8 << 21; + /** @var int $carry10 */ + $carry10 = ($s10 + (1 << 20)) >> 21; + $s11 += $carry10; + $s10 -= $carry10 << 21; + + /** @var int $carry1 */ + $carry1 = ($s1 + (1 << 20)) >> 21; + $s2 += $carry1; + $s1 -= $carry1 << 21; + /** @var int $carry3 */ + $carry3 = ($s3 + (1 << 20)) >> 21; + $s4 += $carry3; + $s3 -= $carry3 << 21; + /** @var int $carry5 */ + $carry5 = ($s5 + (1 << 20)) >> 21; + $s6 += $carry5; + $s5 -= $carry5 << 21; + /** @var int $carry7 */ + $carry7 = ($s7 + (1 << 20)) >> 21; + $s8 += $carry7; + $s7 -= $carry7 << 21; + /** @var int $carry9 */ + $carry9 = ($s9 + (1 << 20)) >> 21; + $s10 += $carry9; + $s9 -= $carry9 << 21; + /** @var int $carry11 */ + $carry11 = ($s11 + (1 << 20)) >> 21; + $s12 += $carry11; + $s11 -= $carry11 << 21; + + $s0 += self::mul($s12, 666643, 20); + $s1 += self::mul($s12, 470296, 19); + $s2 += self::mul($s12, 654183, 20); + $s3 -= self::mul($s12, 997805, 20); + $s4 += self::mul($s12, 136657, 18); + $s5 -= self::mul($s12, 683901, 20); + $s12 = 0; + + /** @var int $carry0 */ + $carry0 = $s0 >> 21; + $s1 += $carry0; + $s0 -= $carry0 << 21; + /** @var int $carry1 */ + $carry1 = $s1 >> 21; + $s2 += $carry1; + $s1 -= $carry1 << 21; + /** @var int $carry2 */ + $carry2 = $s2 >> 21; + $s3 += $carry2; + $s2 -= $carry2 << 21; + /** @var int $carry3 */ + $carry3 = $s3 >> 21; + $s4 += $carry3; + $s3 -= $carry3 << 21; + /** @var int $carry4 */ + $carry4 = $s4 >> 21; + $s5 += $carry4; + $s4 -= $carry4 << 21; + /** @var int $carry5 */ + $carry5 = $s5 >> 21; + $s6 += $carry5; + $s5 -= $carry5 << 21; + /** @var int $carry6 */ + $carry6 = $s6 >> 21; + $s7 += $carry6; + $s6 -= $carry6 << 21; + /** @var int $carry7 */ + $carry7 = $s7 >> 21; + $s8 += $carry7; + $s7 -= $carry7 << 21; + /** @var int $carry8 */ + $carry8 = $s8 >> 21; + $s9 += $carry8; + $s8 -= $carry8 << 21; + /** @var int $carry9 */ + $carry9 = $s9 >> 21; + $s10 += $carry9; + $s9 -= $carry9 << 21; + /** @var int $carry10 */ + $carry10 = $s10 >> 21; + $s11 += $carry10; + $s10 -= $carry10 << 21; + /** @var int $carry11 */ + $carry11 = $s11 >> 21; + $s12 += $carry11; + $s11 -= $carry11 << 21; + + $s0 += self::mul($s12, 666643, 20); + $s1 += self::mul($s12, 470296, 19); + $s2 += self::mul($s12, 654183, 20); + $s3 -= self::mul($s12, 997805, 20); + $s4 += self::mul($s12, 136657, 18); + $s5 -= self::mul($s12, 683901, 20); + + /** @var int $carry0 */ + $carry0 = $s0 >> 21; + $s1 += $carry0; + $s0 -= $carry0 << 21; + /** @var int $carry1 */ + $carry1 = $s1 >> 21; + $s2 += $carry1; + $s1 -= $carry1 << 21; + /** @var int $carry2 */ + $carry2 = $s2 >> 21; + $s3 += $carry2; + $s2 -= $carry2 << 21; + /** @var int $carry3 */ + $carry3 = $s3 >> 21; + $s4 += $carry3; + $s3 -= $carry3 << 21; + /** @var int $carry4 */ + $carry4 = $s4 >> 21; + $s5 += $carry4; + $s4 -= $carry4 << 21; + /** @var int $carry5 */ + $carry5 = $s5 >> 21; + $s6 += $carry5; + $s5 -= $carry5 << 21; + /** @var int $carry6 */ + $carry6 = $s6 >> 21; + $s7 += $carry6; + $s6 -= $carry6 << 21; + /** @var int $carry7 */ + $carry7 = $s7 >> 21; + $s8 += $carry7; + $s7 -= $carry7 << 21; + /** @var int $carry8 */ + $carry8 = $s8 >> 21; + $s9 += $carry8; + $s8 -= $carry8 << 21; + /** @var int $carry9 */ + $carry9 = $s9 >> 21; + $s10 += $carry9; + $s9 -= $carry9 << 21; + /** @var int $carry10 */ + $carry10 = $s10 >> 21; + $s11 += $carry10; + $s10 -= $carry10 << 21; + + /** + * @var array + */ + $arr = array( + (int) (0xff & ($s0 >> 0)), + (int) (0xff & ($s0 >> 8)), + (int) (0xff & (($s0 >> 16) | $s1 << 5)), + (int) (0xff & ($s1 >> 3)), + (int) (0xff & ($s1 >> 11)), + (int) (0xff & (($s1 >> 19) | $s2 << 2)), + (int) (0xff & ($s2 >> 6)), + (int) (0xff & (($s2 >> 14) | $s3 << 7)), + (int) (0xff & ($s3 >> 1)), + (int) (0xff & ($s3 >> 9)), + (int) (0xff & (($s3 >> 17) | $s4 << 4)), + (int) (0xff & ($s4 >> 4)), + (int) (0xff & ($s4 >> 12)), + (int) (0xff & (($s4 >> 20) | $s5 << 1)), + (int) (0xff & ($s5 >> 7)), + (int) (0xff & (($s5 >> 15) | $s6 << 6)), + (int) (0xff & ($s6 >> 2)), + (int) (0xff & ($s6 >> 10)), + (int) (0xff & (($s6 >> 18) | $s7 << 3)), + (int) (0xff & ($s7 >> 5)), + (int) (0xff & ($s7 >> 13)), + (int) (0xff & ($s8 >> 0)), + (int) (0xff & ($s8 >> 8)), + (int) (0xff & (($s8 >> 16) | $s9 << 5)), + (int) (0xff & ($s9 >> 3)), + (int) (0xff & ($s9 >> 11)), + (int) (0xff & (($s9 >> 19) | $s10 << 2)), + (int) (0xff & ($s10 >> 6)), + (int) (0xff & (($s10 >> 14) | $s11 << 7)), + (int) (0xff & ($s11 >> 1)), + (int) (0xff & ($s11 >> 9)), + 0xff & ($s11 >> 17) + ); + return self::intArrayToString($arr); + } + + /** + * @internal You should not use this directly from another application + * + * @param string $s + * @return string + * @throws TypeError + */ + public static function sc_reduce($s) + { + /** @var int $s0 */ + $s0 = 2097151 & self::load_3(self::substr($s, 0, 3)); + /** @var int $s1 */ + $s1 = 2097151 & (self::load_4(self::substr($s, 2, 4)) >> 5); + /** @var int $s2 */ + $s2 = 2097151 & (self::load_3(self::substr($s, 5, 3)) >> 2); + /** @var int $s3 */ + $s3 = 2097151 & (self::load_4(self::substr($s, 7, 4)) >> 7); + /** @var int $s4 */ + $s4 = 2097151 & (self::load_4(self::substr($s, 10, 4)) >> 4); + /** @var int $s5 */ + $s5 = 2097151 & (self::load_3(self::substr($s, 13, 3)) >> 1); + /** @var int $s6 */ + $s6 = 2097151 & (self::load_4(self::substr($s, 15, 4)) >> 6); + /** @var int $s7 */ + $s7 = 2097151 & (self::load_3(self::substr($s, 18, 4)) >> 3); + /** @var int $s8 */ + $s8 = 2097151 & self::load_3(self::substr($s, 21, 3)); + /** @var int $s9 */ + $s9 = 2097151 & (self::load_4(self::substr($s, 23, 4)) >> 5); + /** @var int $s10 */ + $s10 = 2097151 & (self::load_3(self::substr($s, 26, 3)) >> 2); + /** @var int $s11 */ + $s11 = 2097151 & (self::load_4(self::substr($s, 28, 4)) >> 7); + /** @var int $s12 */ + $s12 = 2097151 & (self::load_4(self::substr($s, 31, 4)) >> 4); + /** @var int $s13 */ + $s13 = 2097151 & (self::load_3(self::substr($s, 34, 3)) >> 1); + /** @var int $s14 */ + $s14 = 2097151 & (self::load_4(self::substr($s, 36, 4)) >> 6); + /** @var int $s15 */ + $s15 = 2097151 & (self::load_3(self::substr($s, 39, 4)) >> 3); + /** @var int $s16 */ + $s16 = 2097151 & self::load_3(self::substr($s, 42, 3)); + /** @var int $s17 */ + $s17 = 2097151 & (self::load_4(self::substr($s, 44, 4)) >> 5); + /** @var int $s18 */ + $s18 = 2097151 & (self::load_3(self::substr($s, 47, 3)) >> 2); + /** @var int $s19 */ + $s19 = 2097151 & (self::load_4(self::substr($s, 49, 4)) >> 7); + /** @var int $s20 */ + $s20 = 2097151 & (self::load_4(self::substr($s, 52, 4)) >> 4); + /** @var int $s21 */ + $s21 = 2097151 & (self::load_3(self::substr($s, 55, 3)) >> 1); + /** @var int $s22 */ + $s22 = 2097151 & (self::load_4(self::substr($s, 57, 4)) >> 6); + /** @var int $s23 */ + $s23 = (self::load_4(self::substr($s, 60, 4)) >> 3); + + $s11 += self::mul($s23, 666643, 20); + $s12 += self::mul($s23, 470296, 19); + $s13 += self::mul($s23, 654183, 20); + $s14 -= self::mul($s23, 997805, 20); + $s15 += self::mul($s23, 136657, 18); + $s16 -= self::mul($s23, 683901, 20); + + $s10 += self::mul($s22, 666643, 20); + $s11 += self::mul($s22, 470296, 19); + $s12 += self::mul($s22, 654183, 20); + $s13 -= self::mul($s22, 997805, 20); + $s14 += self::mul($s22, 136657, 18); + $s15 -= self::mul($s22, 683901, 20); + + $s9 += self::mul($s21, 666643, 20); + $s10 += self::mul($s21, 470296, 19); + $s11 += self::mul($s21, 654183, 20); + $s12 -= self::mul($s21, 997805, 20); + $s13 += self::mul($s21, 136657, 18); + $s14 -= self::mul($s21, 683901, 20); + + $s8 += self::mul($s20, 666643, 20); + $s9 += self::mul($s20, 470296, 19); + $s10 += self::mul($s20, 654183, 20); + $s11 -= self::mul($s20, 997805, 20); + $s12 += self::mul($s20, 136657, 18); + $s13 -= self::mul($s20, 683901, 20); + + $s7 += self::mul($s19, 666643, 20); + $s8 += self::mul($s19, 470296, 19); + $s9 += self::mul($s19, 654183, 20); + $s10 -= self::mul($s19, 997805, 20); + $s11 += self::mul($s19, 136657, 18); + $s12 -= self::mul($s19, 683901, 20); + + $s6 += self::mul($s18, 666643, 20); + $s7 += self::mul($s18, 470296, 19); + $s8 += self::mul($s18, 654183, 20); + $s9 -= self::mul($s18, 997805, 20); + $s10 += self::mul($s18, 136657, 18); + $s11 -= self::mul($s18, 683901, 20); + + /** @var int $carry6 */ + $carry6 = ($s6 + (1 << 20)) >> 21; + $s7 += $carry6; + $s6 -= $carry6 << 21; + /** @var int $carry8 */ + $carry8 = ($s8 + (1 << 20)) >> 21; + $s9 += $carry8; + $s8 -= $carry8 << 21; + /** @var int $carry10 */ + $carry10 = ($s10 + (1 << 20)) >> 21; + $s11 += $carry10; + $s10 -= $carry10 << 21; + /** @var int $carry12 */ + $carry12 = ($s12 + (1 << 20)) >> 21; + $s13 += $carry12; + $s12 -= $carry12 << 21; + /** @var int $carry14 */ + $carry14 = ($s14 + (1 << 20)) >> 21; + $s15 += $carry14; + $s14 -= $carry14 << 21; + /** @var int $carry16 */ + $carry16 = ($s16 + (1 << 20)) >> 21; + $s17 += $carry16; + $s16 -= $carry16 << 21; + + /** @var int $carry7 */ + $carry7 = ($s7 + (1 << 20)) >> 21; + $s8 += $carry7; + $s7 -= $carry7 << 21; + /** @var int $carry9 */ + $carry9 = ($s9 + (1 << 20)) >> 21; + $s10 += $carry9; + $s9 -= $carry9 << 21; + /** @var int $carry11 */ + $carry11 = ($s11 + (1 << 20)) >> 21; + $s12 += $carry11; + $s11 -= $carry11 << 21; + /** @var int $carry13 */ + $carry13 = ($s13 + (1 << 20)) >> 21; + $s14 += $carry13; + $s13 -= $carry13 << 21; + /** @var int $carry15 */ + $carry15 = ($s15 + (1 << 20)) >> 21; + $s16 += $carry15; + $s15 -= $carry15 << 21; + + $s5 += self::mul($s17, 666643, 20); + $s6 += self::mul($s17, 470296, 19); + $s7 += self::mul($s17, 654183, 20); + $s8 -= self::mul($s17, 997805, 20); + $s9 += self::mul($s17, 136657, 18); + $s10 -= self::mul($s17, 683901, 20); + + $s4 += self::mul($s16, 666643, 20); + $s5 += self::mul($s16, 470296, 19); + $s6 += self::mul($s16, 654183, 20); + $s7 -= self::mul($s16, 997805, 20); + $s8 += self::mul($s16, 136657, 18); + $s9 -= self::mul($s16, 683901, 20); + + $s3 += self::mul($s15, 666643, 20); + $s4 += self::mul($s15, 470296, 19); + $s5 += self::mul($s15, 654183, 20); + $s6 -= self::mul($s15, 997805, 20); + $s7 += self::mul($s15, 136657, 18); + $s8 -= self::mul($s15, 683901, 20); + + $s2 += self::mul($s14, 666643, 20); + $s3 += self::mul($s14, 470296, 19); + $s4 += self::mul($s14, 654183, 20); + $s5 -= self::mul($s14, 997805, 20); + $s6 += self::mul($s14, 136657, 18); + $s7 -= self::mul($s14, 683901, 20); + + $s1 += self::mul($s13, 666643, 20); + $s2 += self::mul($s13, 470296, 19); + $s3 += self::mul($s13, 654183, 20); + $s4 -= self::mul($s13, 997805, 20); + $s5 += self::mul($s13, 136657, 18); + $s6 -= self::mul($s13, 683901, 20); + + $s0 += self::mul($s12, 666643, 20); + $s1 += self::mul($s12, 470296, 19); + $s2 += self::mul($s12, 654183, 20); + $s3 -= self::mul($s12, 997805, 20); + $s4 += self::mul($s12, 136657, 18); + $s5 -= self::mul($s12, 683901, 20); + $s12 = 0; + + /** @var int $carry0 */ + $carry0 = ($s0 + (1 << 20)) >> 21; + $s1 += $carry0; + $s0 -= $carry0 << 21; + /** @var int $carry2 */ + $carry2 = ($s2 + (1 << 20)) >> 21; + $s3 += $carry2; + $s2 -= $carry2 << 21; + /** @var int $carry4 */ + $carry4 = ($s4 + (1 << 20)) >> 21; + $s5 += $carry4; + $s4 -= $carry4 << 21; + /** @var int $carry6 */ + $carry6 = ($s6 + (1 << 20)) >> 21; + $s7 += $carry6; + $s6 -= $carry6 << 21; + /** @var int $carry8 */ + $carry8 = ($s8 + (1 << 20)) >> 21; + $s9 += $carry8; + $s8 -= $carry8 << 21; + /** @var int $carry10 */ + $carry10 = ($s10 + (1 << 20)) >> 21; + $s11 += $carry10; + $s10 -= $carry10 << 21; + + /** @var int $carry1 */ + $carry1 = ($s1 + (1 << 20)) >> 21; + $s2 += $carry1; + $s1 -= $carry1 << 21; + /** @var int $carry3 */ + $carry3 = ($s3 + (1 << 20)) >> 21; + $s4 += $carry3; + $s3 -= $carry3 << 21; + /** @var int $carry5 */ + $carry5 = ($s5 + (1 << 20)) >> 21; + $s6 += $carry5; + $s5 -= $carry5 << 21; + /** @var int $carry7 */ + $carry7 = ($s7 + (1 << 20)) >> 21; + $s8 += $carry7; + $s7 -= $carry7 << 21; + /** @var int $carry9 */ + $carry9 = ($s9 + (1 << 20)) >> 21; + $s10 += $carry9; + $s9 -= $carry9 << 21; + /** @var int $carry11 */ + $carry11 = ($s11 + (1 << 20)) >> 21; + $s12 += $carry11; + $s11 -= $carry11 << 21; + + $s0 += self::mul($s12, 666643, 20); + $s1 += self::mul($s12, 470296, 19); + $s2 += self::mul($s12, 654183, 20); + $s3 -= self::mul($s12, 997805, 20); + $s4 += self::mul($s12, 136657, 18); + $s5 -= self::mul($s12, 683901, 20); + $s12 = 0; + + /** @var int $carry0 */ + $carry0 = $s0 >> 21; + $s1 += $carry0; + $s0 -= $carry0 << 21; + /** @var int $carry1 */ + $carry1 = $s1 >> 21; + $s2 += $carry1; + $s1 -= $carry1 << 21; + /** @var int $carry2 */ + $carry2 = $s2 >> 21; + $s3 += $carry2; + $s2 -= $carry2 << 21; + /** @var int $carry3 */ + $carry3 = $s3 >> 21; + $s4 += $carry3; + $s3 -= $carry3 << 21; + /** @var int $carry4 */ + $carry4 = $s4 >> 21; + $s5 += $carry4; + $s4 -= $carry4 << 21; + /** @var int $carry5 */ + $carry5 = $s5 >> 21; + $s6 += $carry5; + $s5 -= $carry5 << 21; + /** @var int $carry6 */ + $carry6 = $s6 >> 21; + $s7 += $carry6; + $s6 -= $carry6 << 21; + /** @var int $carry7 */ + $carry7 = $s7 >> 21; + $s8 += $carry7; + $s7 -= $carry7 << 21; + /** @var int $carry8 */ + $carry8 = $s8 >> 21; + $s9 += $carry8; + $s8 -= $carry8 << 21; + /** @var int $carry9 */ + $carry9 = $s9 >> 21; + $s10 += $carry9; + $s9 -= $carry9 << 21; + /** @var int $carry10 */ + $carry10 = $s10 >> 21; + $s11 += $carry10; + $s10 -= $carry10 << 21; + /** @var int $carry11 */ + $carry11 = $s11 >> 21; + $s12 += $carry11; + $s11 -= $carry11 << 21; + + $s0 += self::mul($s12, 666643, 20); + $s1 += self::mul($s12, 470296, 19); + $s2 += self::mul($s12, 654183, 20); + $s3 -= self::mul($s12, 997805, 20); + $s4 += self::mul($s12, 136657, 18); + $s5 -= self::mul($s12, 683901, 20); + + /** @var int $carry0 */ + $carry0 = $s0 >> 21; + $s1 += $carry0; + $s0 -= $carry0 << 21; + /** @var int $carry1 */ + $carry1 = $s1 >> 21; + $s2 += $carry1; + $s1 -= $carry1 << 21; + /** @var int $carry2 */ + $carry2 = $s2 >> 21; + $s3 += $carry2; + $s2 -= $carry2 << 21; + /** @var int $carry3 */ + $carry3 = $s3 >> 21; + $s4 += $carry3; + $s3 -= $carry3 << 21; + /** @var int $carry4 */ + $carry4 = $s4 >> 21; + $s5 += $carry4; + $s4 -= $carry4 << 21; + /** @var int $carry5 */ + $carry5 = $s5 >> 21; + $s6 += $carry5; + $s5 -= $carry5 << 21; + /** @var int $carry6 */ + $carry6 = $s6 >> 21; + $s7 += $carry6; + $s6 -= $carry6 << 21; + /** @var int $carry7 */ + $carry7 = $s7 >> 21; + $s8 += $carry7; + $s7 -= $carry7 << 21; + /** @var int $carry8 */ + $carry8 = $s8 >> 21; + $s9 += $carry8; + $s8 -= $carry8 << 21; + /** @var int $carry9 */ + $carry9 = $s9 >> 21; + $s10 += $carry9; + $s9 -= $carry9 << 21; + /** @var int $carry10 */ + $carry10 = $s10 >> 21; + $s11 += $carry10; + $s10 -= $carry10 << 21; + + /** + * @var array + */ + $arr = array( + (int) ($s0 >> 0), + (int) ($s0 >> 8), + (int) (($s0 >> 16) | $s1 << 5), + (int) ($s1 >> 3), + (int) ($s1 >> 11), + (int) (($s1 >> 19) | $s2 << 2), + (int) ($s2 >> 6), + (int) (($s2 >> 14) | $s3 << 7), + (int) ($s3 >> 1), + (int) ($s3 >> 9), + (int) (($s3 >> 17) | $s4 << 4), + (int) ($s4 >> 4), + (int) ($s4 >> 12), + (int) (($s4 >> 20) | $s5 << 1), + (int) ($s5 >> 7), + (int) (($s5 >> 15) | $s6 << 6), + (int) ($s6 >> 2), + (int) ($s6 >> 10), + (int) (($s6 >> 18) | $s7 << 3), + (int) ($s7 >> 5), + (int) ($s7 >> 13), + (int) ($s8 >> 0), + (int) ($s8 >> 8), + (int) (($s8 >> 16) | $s9 << 5), + (int) ($s9 >> 3), + (int) ($s9 >> 11), + (int) (($s9 >> 19) | $s10 << 2), + (int) ($s10 >> 6), + (int) (($s10 >> 14) | $s11 << 7), + (int) ($s11 >> 1), + (int) ($s11 >> 9), + (int) $s11 >> 17 + ); + return self::intArrayToString($arr); + } + + /** + * multiply by the order of the main subgroup l = 2^252+27742317777372353535851937790883648493 + * + * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A + * @return ParagonIE_Sodium_Core_Curve25519_Ge_P3 + */ + public static function ge_mul_l(ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A) + { + /** @var array $aslide */ + $aslide = array( + 13, 0, 0, 0, 0, -1, 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0, + 0, 0, 0, -3, 0, 0, 0, 0, -13, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 3, 0, + 0, 0, 0, -13, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 11, 0, 0, 0, 0, -13, 0, 0, 0, 0, 0, 0, -3, 0, 0, 0, 0, 0, -1, + 0, 0, 0, 0, 3, 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, + 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 5, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 + ); + + /** @var array $Ai size 8 */ + $Ai = array(); + + # ge_p3_to_cached(&Ai[0], A); + $Ai[0] = self::ge_p3_to_cached($A); + # ge_p3_dbl(&t, A); + $t = self::ge_p3_dbl($A); + # ge_p1p1_to_p3(&A2, &t); + $A2 = self::ge_p1p1_to_p3($t); + + for ($i = 1; $i < 8; ++$i) { + # ge_add(&t, &A2, &Ai[0]); + $t = self::ge_add($A2, $Ai[$i - 1]); + # ge_p1p1_to_p3(&u, &t); + $u = self::ge_p1p1_to_p3($t); + # ge_p3_to_cached(&Ai[i], &u); + $Ai[$i] = self::ge_p3_to_cached($u); + } + + $r = self::ge_p3_0(); + for ($i = 252; $i >= 0; --$i) { + $t = self::ge_p3_dbl($r); + if ($aslide[$i] > 0) { + # ge_p1p1_to_p3(&u, &t); + $u = self::ge_p1p1_to_p3($t); + # ge_add(&t, &u, &Ai[aslide[i] / 2]); + $t = self::ge_add($u, $Ai[(int)($aslide[$i] / 2)]); + } elseif ($aslide[$i] < 0) { + # ge_p1p1_to_p3(&u, &t); + $u = self::ge_p1p1_to_p3($t); + # ge_sub(&t, &u, &Ai[(-aslide[i]) / 2]); + $t = self::ge_sub($u, $Ai[(int)(-$aslide[$i] / 2)]); + } + } + + # ge_p1p1_to_p3(r, &t); + return self::ge_p1p1_to_p3($t); + } + + /** + * @param string $a + * @param string $b + * @return string + */ + public static function sc25519_mul($a, $b) + { + // int64_t a0 = 2097151 & load_3(a); + // int64_t a1 = 2097151 & (load_4(a + 2) >> 5); + // int64_t a2 = 2097151 & (load_3(a + 5) >> 2); + // int64_t a3 = 2097151 & (load_4(a + 7) >> 7); + // int64_t a4 = 2097151 & (load_4(a + 10) >> 4); + // int64_t a5 = 2097151 & (load_3(a + 13) >> 1); + // int64_t a6 = 2097151 & (load_4(a + 15) >> 6); + // int64_t a7 = 2097151 & (load_3(a + 18) >> 3); + // int64_t a8 = 2097151 & load_3(a + 21); + // int64_t a9 = 2097151 & (load_4(a + 23) >> 5); + // int64_t a10 = 2097151 & (load_3(a + 26) >> 2); + // int64_t a11 = (load_4(a + 28) >> 7); + $a0 = 2097151 & self::load_3(self::substr($a, 0, 3)); + $a1 = 2097151 & (self::load_4(self::substr($a, 2, 4)) >> 5); + $a2 = 2097151 & (self::load_3(self::substr($a, 5, 3)) >> 2); + $a3 = 2097151 & (self::load_4(self::substr($a, 7, 4)) >> 7); + $a4 = 2097151 & (self::load_4(self::substr($a, 10, 4)) >> 4); + $a5 = 2097151 & (self::load_3(self::substr($a, 13, 3)) >> 1); + $a6 = 2097151 & (self::load_4(self::substr($a, 15, 4)) >> 6); + $a7 = 2097151 & (self::load_3(self::substr($a, 18, 3)) >> 3); + $a8 = 2097151 & self::load_3(self::substr($a, 21, 3)); + $a9 = 2097151 & (self::load_4(self::substr($a, 23, 4)) >> 5); + $a10 = 2097151 & (self::load_3(self::substr($a, 26, 3)) >> 2); + $a11 = (self::load_4(self::substr($a, 28, 4)) >> 7); + + // int64_t b0 = 2097151 & load_3(b); + // int64_t b1 = 2097151 & (load_4(b + 2) >> 5); + // int64_t b2 = 2097151 & (load_3(b + 5) >> 2); + // int64_t b3 = 2097151 & (load_4(b + 7) >> 7); + // int64_t b4 = 2097151 & (load_4(b + 10) >> 4); + // int64_t b5 = 2097151 & (load_3(b + 13) >> 1); + // int64_t b6 = 2097151 & (load_4(b + 15) >> 6); + // int64_t b7 = 2097151 & (load_3(b + 18) >> 3); + // int64_t b8 = 2097151 & load_3(b + 21); + // int64_t b9 = 2097151 & (load_4(b + 23) >> 5); + // int64_t b10 = 2097151 & (load_3(b + 26) >> 2); + // int64_t b11 = (load_4(b + 28) >> 7); + $b0 = 2097151 & self::load_3(self::substr($b, 0, 3)); + $b1 = 2097151 & (self::load_4(self::substr($b, 2, 4)) >> 5); + $b2 = 2097151 & (self::load_3(self::substr($b, 5, 3)) >> 2); + $b3 = 2097151 & (self::load_4(self::substr($b, 7, 4)) >> 7); + $b4 = 2097151 & (self::load_4(self::substr($b, 10, 4)) >> 4); + $b5 = 2097151 & (self::load_3(self::substr($b, 13, 3)) >> 1); + $b6 = 2097151 & (self::load_4(self::substr($b, 15, 4)) >> 6); + $b7 = 2097151 & (self::load_3(self::substr($b, 18, 3)) >> 3); + $b8 = 2097151 & self::load_3(self::substr($b, 21, 3)); + $b9 = 2097151 & (self::load_4(self::substr($b, 23, 4)) >> 5); + $b10 = 2097151 & (self::load_3(self::substr($b, 26, 3)) >> 2); + $b11 = (self::load_4(self::substr($b, 28, 4)) >> 7); + + // s0 = a0 * b0; + // s1 = a0 * b1 + a1 * b0; + // s2 = a0 * b2 + a1 * b1 + a2 * b0; + // s3 = a0 * b3 + a1 * b2 + a2 * b1 + a3 * b0; + // s4 = a0 * b4 + a1 * b3 + a2 * b2 + a3 * b1 + a4 * b0; + // s5 = a0 * b5 + a1 * b4 + a2 * b3 + a3 * b2 + a4 * b1 + a5 * b0; + // s6 = a0 * b6 + a1 * b5 + a2 * b4 + a3 * b3 + a4 * b2 + a5 * b1 + a6 * b0; + // s7 = a0 * b7 + a1 * b6 + a2 * b5 + a3 * b4 + a4 * b3 + a5 * b2 + + // a6 * b1 + a7 * b0; + // s8 = a0 * b8 + a1 * b7 + a2 * b6 + a3 * b5 + a4 * b4 + a5 * b3 + + // a6 * b2 + a7 * b1 + a8 * b0; + // s9 = a0 * b9 + a1 * b8 + a2 * b7 + a3 * b6 + a4 * b5 + a5 * b4 + + // a6 * b3 + a7 * b2 + a8 * b1 + a9 * b0; + // s10 = a0 * b10 + a1 * b9 + a2 * b8 + a3 * b7 + a4 * b6 + a5 * b5 + + // a6 * b4 + a7 * b3 + a8 * b2 + a9 * b1 + a10 * b0; + // s11 = a0 * b11 + a1 * b10 + a2 * b9 + a3 * b8 + a4 * b7 + a5 * b6 + + // a6 * b5 + a7 * b4 + a8 * b3 + a9 * b2 + a10 * b1 + a11 * b0; + // s12 = a1 * b11 + a2 * b10 + a3 * b9 + a4 * b8 + a5 * b7 + a6 * b6 + + // a7 * b5 + a8 * b4 + a9 * b3 + a10 * b2 + a11 * b1; + // s13 = a2 * b11 + a3 * b10 + a4 * b9 + a5 * b8 + a6 * b7 + a7 * b6 + + // a8 * b5 + a9 * b4 + a10 * b3 + a11 * b2; + // s14 = a3 * b11 + a4 * b10 + a5 * b9 + a6 * b8 + a7 * b7 + a8 * b6 + + // a9 * b5 + a10 * b4 + a11 * b3; + // s15 = a4 * b11 + a5 * b10 + a6 * b9 + a7 * b8 + a8 * b7 + a9 * b6 + + // a10 * b5 + a11 * b4; + // s16 = + // a5 * b11 + a6 * b10 + a7 * b9 + a8 * b8 + a9 * b7 + a10 * b6 + a11 * b5; + // s17 = a6 * b11 + a7 * b10 + a8 * b9 + a9 * b8 + a10 * b7 + a11 * b6; + // s18 = a7 * b11 + a8 * b10 + a9 * b9 + a10 * b8 + a11 * b7; + // s19 = a8 * b11 + a9 * b10 + a10 * b9 + a11 * b8; + // s20 = a9 * b11 + a10 * b10 + a11 * b9; + // s21 = a10 * b11 + a11 * b10; + // s22 = a11 * b11; + // s23 = 0; + $s0 = self::mul($a0, $b0, 22); + $s1 = self::mul($a0, $b1, 22) + self::mul($a1, $b0, 22); + $s2 = self::mul($a0, $b2, 22) + self::mul($a1, $b1, 22) + self::mul($a2, $b0, 22); + $s3 = self::mul($a0, $b3, 22) + self::mul($a1, $b2, 22) + self::mul($a2, $b1, 22) + self::mul($a3, $b0, 22); + $s4 = self::mul($a0, $b4, 22) + self::mul($a1, $b3, 22) + self::mul($a2, $b2, 22) + self::mul($a3, $b1, 22) + + self::mul($a4, $b0, 22); + $s5 = self::mul($a0, $b5, 22) + self::mul($a1, $b4, 22) + self::mul($a2, $b3, 22) + self::mul($a3, $b2, 22) + + self::mul($a4, $b1, 22) + self::mul($a5, $b0, 22); + $s6 = self::mul($a0, $b6, 22) + self::mul($a1, $b5, 22) + self::mul($a2, $b4, 22) + self::mul($a3, $b3, 22) + + self::mul($a4, $b2, 22) + self::mul($a5, $b1, 22) + self::mul($a6, $b0, 22); + $s7 = self::mul($a0, $b7, 22) + self::mul($a1, $b6, 22) + self::mul($a2, $b5, 22) + self::mul($a3, $b4, 22) + + self::mul($a4, $b3, 22) + self::mul($a5, $b2, 22) + self::mul($a6, $b1, 22) + self::mul($a7, $b0, 22); + $s8 = self::mul($a0, $b8, 22) + self::mul($a1, $b7, 22) + self::mul($a2, $b6, 22) + self::mul($a3, $b5, 22) + + self::mul($a4, $b4, 22) + self::mul($a5, $b3, 22) + self::mul($a6, $b2, 22) + self::mul($a7, $b1, 22) + + self::mul($a8, $b0, 22); + $s9 = self::mul($a0, $b9, 22) + self::mul($a1, $b8, 22) + self::mul($a2, $b7, 22) + self::mul($a3, $b6, 22) + + self::mul($a4, $b5, 22) + self::mul($a5, $b4, 22) + self::mul($a6, $b3, 22) + self::mul($a7, $b2, 22) + + self::mul($a8, $b1, 22) + self::mul($a9, $b0, 22); + $s10 = self::mul($a0, $b10, 22) + self::mul($a1, $b9, 22) + self::mul($a2, $b8, 22) + self::mul($a3, $b7, 22) + + self::mul($a4, $b6, 22) + self::mul($a5, $b5, 22) + self::mul($a6, $b4, 22) + self::mul($a7, $b3, 22) + + self::mul($a8, $b2, 22) + self::mul($a9, $b1, 22) + self::mul($a10, $b0, 22); + $s11 = self::mul($a0, $b11, 22) + self::mul($a1, $b10, 22) + self::mul($a2, $b9, 22) + self::mul($a3, $b8, 22) + + self::mul($a4, $b7, 22) + self::mul($a5, $b6, 22) + self::mul($a6, $b5, 22) + self::mul($a7, $b4, 22) + + self::mul($a8, $b3, 22) + self::mul($a9, $b2, 22) + self::mul($a10, $b1, 22) + self::mul($a11, $b0, 22); + $s12 = self::mul($a1, $b11, 22) + self::mul($a2, $b10, 22) + self::mul($a3, $b9, 22) + self::mul($a4, $b8, 22) + + self::mul($a5, $b7, 22) + self::mul($a6, $b6, 22) + self::mul($a7, $b5, 22) + self::mul($a8, $b4, 22) + + self::mul($a9, $b3, 22) + self::mul($a10, $b2, 22) + self::mul($a11, $b1, 22); + $s13 = self::mul($a2, $b11, 22) + self::mul($a3, $b10, 22) + self::mul($a4, $b9, 22) + self::mul($a5, $b8, 22) + + self::mul($a6, $b7, 22) + self::mul($a7, $b6, 22) + self::mul($a8, $b5, 22) + self::mul($a9, $b4, 22) + + self::mul($a10, $b3, 22) + self::mul($a11, $b2, 22); + $s14 = self::mul($a3, $b11, 22) + self::mul($a4, $b10, 22) + self::mul($a5, $b9, 22) + self::mul($a6, $b8, 22) + + self::mul($a7, $b7, 22) + self::mul($a8, $b6, 22) + self::mul($a9, $b5, 22) + self::mul($a10, $b4, 22) + + self::mul($a11, $b3, 22); + $s15 = self::mul($a4, $b11, 22) + self::mul($a5, $b10, 22) + self::mul($a6, $b9, 22) + self::mul($a7, $b8, 22) + + self::mul($a8, $b7, 22) + self::mul($a9, $b6, 22) + self::mul($a10, $b5, 22) + self::mul($a11, $b4, 22); + $s16 = + self::mul($a5, $b11, 22) + self::mul($a6, $b10, 22) + self::mul($a7, $b9, 22) + self::mul($a8, $b8, 22) + + self::mul($a9, $b7, 22) + self::mul($a10, $b6, 22) + self::mul($a11, $b5, 22); + $s17 = self::mul($a6, $b11, 22) + self::mul($a7, $b10, 22) + self::mul($a8, $b9, 22) + self::mul($a9, $b8, 22) + + self::mul($a10, $b7, 22) + self::mul($a11, $b6, 22); + $s18 = self::mul($a7, $b11, 22) + self::mul($a8, $b10, 22) + self::mul($a9, $b9, 22) + self::mul($a10, $b8, 22) + + self::mul($a11, $b7, 22); + $s19 = self::mul($a8, $b11, 22) + self::mul($a9, $b10, 22) + self::mul($a10, $b9, 22) + + self::mul($a11, $b8, 22); + $s20 = self::mul($a9, $b11, 22) + self::mul($a10, $b10, 22) + self::mul($a11, $b9, 22); + $s21 = self::mul($a10, $b11, 22) + self::mul($a11, $b10, 22); + $s22 = self::mul($a11, $b11, 22); + $s23 = 0; + + // carry0 = (s0 + (int64_t) (1L << 20)) >> 21; + // s1 += carry0; + // s0 -= carry0 * ((uint64_t) 1L << 21); + $carry0 = ($s0 + (1 << 20)) >> 21; + $s1 += $carry0; + $s0 -= $carry0 << 21; + // carry2 = (s2 + (int64_t) (1L << 20)) >> 21; + // s3 += carry2; + // s2 -= carry2 * ((uint64_t) 1L << 21); + $carry2 = ($s2 + (1 << 20)) >> 21; + $s3 += $carry2; + $s2 -= $carry2 << 21; + // carry4 = (s4 + (int64_t) (1L << 20)) >> 21; + // s5 += carry4; + // s4 -= carry4 * ((uint64_t) 1L << 21); + $carry4 = ($s4 + (1 << 20)) >> 21; + $s5 += $carry4; + $s4 -= $carry4 << 21; + // carry6 = (s6 + (int64_t) (1L << 20)) >> 21; + // s7 += carry6; + // s6 -= carry6 * ((uint64_t) 1L << 21); + $carry6 = ($s6 + (1 << 20)) >> 21; + $s7 += $carry6; + $s6 -= $carry6 << 21; + // carry8 = (s8 + (int64_t) (1L << 20)) >> 21; + // s9 += carry8; + // s8 -= carry8 * ((uint64_t) 1L << 21); + $carry8 = ($s8 + (1 << 20)) >> 21; + $s9 += $carry8; + $s8 -= $carry8 << 21; + // carry10 = (s10 + (int64_t) (1L << 20)) >> 21; + // s11 += carry10; + // s10 -= carry10 * ((uint64_t) 1L << 21); + $carry10 = ($s10 + (1 << 20)) >> 21; + $s11 += $carry10; + $s10 -= $carry10 << 21; + // carry12 = (s12 + (int64_t) (1L << 20)) >> 21; + // s13 += carry12; + // s12 -= carry12 * ((uint64_t) 1L << 21); + $carry12 = ($s12 + (1 << 20)) >> 21; + $s13 += $carry12; + $s12 -= $carry12 << 21; + // carry14 = (s14 + (int64_t) (1L << 20)) >> 21; + // s15 += carry14; + // s14 -= carry14 * ((uint64_t) 1L << 21); + $carry14 = ($s14 + (1 << 20)) >> 21; + $s15 += $carry14; + $s14 -= $carry14 << 21; + // carry16 = (s16 + (int64_t) (1L << 20)) >> 21; + // s17 += carry16; + // s16 -= carry16 * ((uint64_t) 1L << 21); + $carry16 = ($s16 + (1 << 20)) >> 21; + $s17 += $carry16; + $s16 -= $carry16 << 21; + // carry18 = (s18 + (int64_t) (1L << 20)) >> 21; + // s19 += carry18; + // s18 -= carry18 * ((uint64_t) 1L << 21); + $carry18 = ($s18 + (1 << 20)) >> 21; + $s19 += $carry18; + $s18 -= $carry18 << 21; + // carry20 = (s20 + (int64_t) (1L << 20)) >> 21; + // s21 += carry20; + // s20 -= carry20 * ((uint64_t) 1L << 21); + $carry20 = ($s20 + (1 << 20)) >> 21; + $s21 += $carry20; + $s20 -= $carry20 << 21; + // carry22 = (s22 + (int64_t) (1L << 20)) >> 21; + // s23 += carry22; + // s22 -= carry22 * ((uint64_t) 1L << 21); + $carry22 = ($s22 + (1 << 20)) >> 21; + $s23 += $carry22; + $s22 -= $carry22 << 21; + + // carry1 = (s1 + (int64_t) (1L << 20)) >> 21; + // s2 += carry1; + // s1 -= carry1 * ((uint64_t) 1L << 21); + $carry1 = ($s1 + (1 << 20)) >> 21; + $s2 += $carry1; + $s1 -= $carry1 << 21; + // carry3 = (s3 + (int64_t) (1L << 20)) >> 21; + // s4 += carry3; + // s3 -= carry3 * ((uint64_t) 1L << 21); + $carry3 = ($s3 + (1 << 20)) >> 21; + $s4 += $carry3; + $s3 -= $carry3 << 21; + // carry5 = (s5 + (int64_t) (1L << 20)) >> 21; + // s6 += carry5; + // s5 -= carry5 * ((uint64_t) 1L << 21); + $carry5 = ($s5 + (1 << 20)) >> 21; + $s6 += $carry5; + $s5 -= $carry5 << 21; + // carry7 = (s7 + (int64_t) (1L << 20)) >> 21; + // s8 += carry7; + // s7 -= carry7 * ((uint64_t) 1L << 21); + $carry7 = ($s7 + (1 << 20)) >> 21; + $s8 += $carry7; + $s7 -= $carry7 << 21; + // carry9 = (s9 + (int64_t) (1L << 20)) >> 21; + // s10 += carry9; + // s9 -= carry9 * ((uint64_t) 1L << 21); + $carry9 = ($s9 + (1 << 20)) >> 21; + $s10 += $carry9; + $s9 -= $carry9 << 21; + // carry11 = (s11 + (int64_t) (1L << 20)) >> 21; + // s12 += carry11; + // s11 -= carry11 * ((uint64_t) 1L << 21); + $carry11 = ($s11 + (1 << 20)) >> 21; + $s12 += $carry11; + $s11 -= $carry11 << 21; + // carry13 = (s13 + (int64_t) (1L << 20)) >> 21; + // s14 += carry13; + // s13 -= carry13 * ((uint64_t) 1L << 21); + $carry13 = ($s13 + (1 << 20)) >> 21; + $s14 += $carry13; + $s13 -= $carry13 << 21; + // carry15 = (s15 + (int64_t) (1L << 20)) >> 21; + // s16 += carry15; + // s15 -= carry15 * ((uint64_t) 1L << 21); + $carry15 = ($s15 + (1 << 20)) >> 21; + $s16 += $carry15; + $s15 -= $carry15 << 21; + // carry17 = (s17 + (int64_t) (1L << 20)) >> 21; + // s18 += carry17; + // s17 -= carry17 * ((uint64_t) 1L << 21); + $carry17 = ($s17 + (1 << 20)) >> 21; + $s18 += $carry17; + $s17 -= $carry17 << 21; + // carry19 = (s19 + (int64_t) (1L << 20)) >> 21; + // s20 += carry19; + // s19 -= carry19 * ((uint64_t) 1L << 21); + $carry19 = ($s19 + (1 << 20)) >> 21; + $s20 += $carry19; + $s19 -= $carry19 << 21; + // carry21 = (s21 + (int64_t) (1L << 20)) >> 21; + // s22 += carry21; + // s21 -= carry21 * ((uint64_t) 1L << 21); + $carry21 = ($s21 + (1 << 20)) >> 21; + $s22 += $carry21; + $s21 -= $carry21 << 21; + + // s11 += s23 * 666643; + // s12 += s23 * 470296; + // s13 += s23 * 654183; + // s14 -= s23 * 997805; + // s15 += s23 * 136657; + // s16 -= s23 * 683901; + $s11 += self::mul($s23, 666643, 20); + $s12 += self::mul($s23, 470296, 19); + $s13 += self::mul($s23, 654183, 20); + $s14 -= self::mul($s23, 997805, 20); + $s15 += self::mul($s23, 136657, 18); + $s16 -= self::mul($s23, 683901, 20); + + // s10 += s22 * 666643; + // s11 += s22 * 470296; + // s12 += s22 * 654183; + // s13 -= s22 * 997805; + // s14 += s22 * 136657; + // s15 -= s22 * 683901; + $s10 += self::mul($s22, 666643, 20); + $s11 += self::mul($s22, 470296, 19); + $s12 += self::mul($s22, 654183, 20); + $s13 -= self::mul($s22, 997805, 20); + $s14 += self::mul($s22, 136657, 18); + $s15 -= self::mul($s22, 683901, 20); + + // s9 += s21 * 666643; + // s10 += s21 * 470296; + // s11 += s21 * 654183; + // s12 -= s21 * 997805; + // s13 += s21 * 136657; + // s14 -= s21 * 683901; + $s9 += self::mul($s21, 666643, 20); + $s10 += self::mul($s21, 470296, 19); + $s11 += self::mul($s21, 654183, 20); + $s12 -= self::mul($s21, 997805, 20); + $s13 += self::mul($s21, 136657, 18); + $s14 -= self::mul($s21, 683901, 20); + + // s8 += s20 * 666643; + // s9 += s20 * 470296; + // s10 += s20 * 654183; + // s11 -= s20 * 997805; + // s12 += s20 * 136657; + // s13 -= s20 * 683901; + $s8 += self::mul($s20, 666643, 20); + $s9 += self::mul($s20, 470296, 19); + $s10 += self::mul($s20, 654183, 20); + $s11 -= self::mul($s20, 997805, 20); + $s12 += self::mul($s20, 136657, 18); + $s13 -= self::mul($s20, 683901, 20); + + // s7 += s19 * 666643; + // s8 += s19 * 470296; + // s9 += s19 * 654183; + // s10 -= s19 * 997805; + // s11 += s19 * 136657; + // s12 -= s19 * 683901; + $s7 += self::mul($s19, 666643, 20); + $s8 += self::mul($s19, 470296, 19); + $s9 += self::mul($s19, 654183, 20); + $s10 -= self::mul($s19, 997805, 20); + $s11 += self::mul($s19, 136657, 18); + $s12 -= self::mul($s19, 683901, 20); + + // s6 += s18 * 666643; + // s7 += s18 * 470296; + // s8 += s18 * 654183; + // s9 -= s18 * 997805; + // s10 += s18 * 136657; + // s11 -= s18 * 683901; + $s6 += self::mul($s18, 666643, 20); + $s7 += self::mul($s18, 470296, 19); + $s8 += self::mul($s18, 654183, 20); + $s9 -= self::mul($s18, 997805, 20); + $s10 += self::mul($s18, 136657, 18); + $s11 -= self::mul($s18, 683901, 20); + + // carry6 = (s6 + (int64_t) (1L << 20)) >> 21; + // s7 += carry6; + // s6 -= carry6 * ((uint64_t) 1L << 21); + $carry6 = ($s6 + (1 << 20)) >> 21; + $s7 += $carry6; + $s6 -= $carry6 << 21; + // carry8 = (s8 + (int64_t) (1L << 20)) >> 21; + // s9 += carry8; + // s8 -= carry8 * ((uint64_t) 1L << 21); + $carry8 = ($s8 + (1 << 20)) >> 21; + $s9 += $carry8; + $s8 -= $carry8 << 21; + // carry10 = (s10 + (int64_t) (1L << 20)) >> 21; + // s11 += carry10; + // s10 -= carry10 * ((uint64_t) 1L << 21); + $carry10 = ($s10 + (1 << 20)) >> 21; + $s11 += $carry10; + $s10 -= $carry10 << 21; + // carry12 = (s12 + (int64_t) (1L << 20)) >> 21; + // s13 += carry12; + // s12 -= carry12 * ((uint64_t) 1L << 21); + $carry12 = ($s12 + (1 << 20)) >> 21; + $s13 += $carry12; + $s12 -= $carry12 << 21; + // carry14 = (s14 + (int64_t) (1L << 20)) >> 21; + // s15 += carry14; + // s14 -= carry14 * ((uint64_t) 1L << 21); + $carry14 = ($s14 + (1 << 20)) >> 21; + $s15 += $carry14; + $s14 -= $carry14 << 21; + // carry16 = (s16 + (int64_t) (1L << 20)) >> 21; + // s17 += carry16; + // s16 -= carry16 * ((uint64_t) 1L << 21); + $carry16 = ($s16 + (1 << 20)) >> 21; + $s17 += $carry16; + $s16 -= $carry16 << 21; + + // carry7 = (s7 + (int64_t) (1L << 20)) >> 21; + // s8 += carry7; + // s7 -= carry7 * ((uint64_t) 1L << 21); + $carry7 = ($s7 + (1 << 20)) >> 21; + $s8 += $carry7; + $s7 -= $carry7 << 21; + // carry9 = (s9 + (int64_t) (1L << 20)) >> 21; + // s10 += carry9; + // s9 -= carry9 * ((uint64_t) 1L << 21); + $carry9 = ($s9 + (1 << 20)) >> 21; + $s10 += $carry9; + $s9 -= $carry9 << 21; + // carry11 = (s11 + (int64_t) (1L << 20)) >> 21; + // s12 += carry11; + // s11 -= carry11 * ((uint64_t) 1L << 21); + $carry11 = ($s11 + (1 << 20)) >> 21; + $s12 += $carry11; + $s11 -= $carry11 << 21; + // carry13 = (s13 + (int64_t) (1L << 20)) >> 21; + // s14 += carry13; + // s13 -= carry13 * ((uint64_t) 1L << 21); + $carry13 = ($s13 + (1 << 20)) >> 21; + $s14 += $carry13; + $s13 -= $carry13 << 21; + // carry15 = (s15 + (int64_t) (1L << 20)) >> 21; + // s16 += carry15; + // s15 -= carry15 * ((uint64_t) 1L << 21); + $carry15 = ($s15 + (1 << 20)) >> 21; + $s16 += $carry15; + $s15 -= $carry15 << 21; + + // s5 += s17 * 666643; + // s6 += s17 * 470296; + // s7 += s17 * 654183; + // s8 -= s17 * 997805; + // s9 += s17 * 136657; + // s10 -= s17 * 683901; + $s5 += self::mul($s17, 666643, 20); + $s6 += self::mul($s17, 470296, 19); + $s7 += self::mul($s17, 654183, 20); + $s8 -= self::mul($s17, 997805, 20); + $s9 += self::mul($s17, 136657, 18); + $s10 -= self::mul($s17, 683901, 20); + + // s4 += s16 * 666643; + // s5 += s16 * 470296; + // s6 += s16 * 654183; + // s7 -= s16 * 997805; + // s8 += s16 * 136657; + // s9 -= s16 * 683901; + $s4 += self::mul($s16, 666643, 20); + $s5 += self::mul($s16, 470296, 19); + $s6 += self::mul($s16, 654183, 20); + $s7 -= self::mul($s16, 997805, 20); + $s8 += self::mul($s16, 136657, 18); + $s9 -= self::mul($s16, 683901, 20); + + // s3 += s15 * 666643; + // s4 += s15 * 470296; + // s5 += s15 * 654183; + // s6 -= s15 * 997805; + // s7 += s15 * 136657; + // s8 -= s15 * 683901; + $s3 += self::mul($s15, 666643, 20); + $s4 += self::mul($s15, 470296, 19); + $s5 += self::mul($s15, 654183, 20); + $s6 -= self::mul($s15, 997805, 20); + $s7 += self::mul($s15, 136657, 18); + $s8 -= self::mul($s15, 683901, 20); + + // s2 += s14 * 666643; + // s3 += s14 * 470296; + // s4 += s14 * 654183; + // s5 -= s14 * 997805; + // s6 += s14 * 136657; + // s7 -= s14 * 683901; + $s2 += self::mul($s14, 666643, 20); + $s3 += self::mul($s14, 470296, 19); + $s4 += self::mul($s14, 654183, 20); + $s5 -= self::mul($s14, 997805, 20); + $s6 += self::mul($s14, 136657, 18); + $s7 -= self::mul($s14, 683901, 20); + + // s1 += s13 * 666643; + // s2 += s13 * 470296; + // s3 += s13 * 654183; + // s4 -= s13 * 997805; + // s5 += s13 * 136657; + // s6 -= s13 * 683901; + $s1 += self::mul($s13, 666643, 20); + $s2 += self::mul($s13, 470296, 19); + $s3 += self::mul($s13, 654183, 20); + $s4 -= self::mul($s13, 997805, 20); + $s5 += self::mul($s13, 136657, 18); + $s6 -= self::mul($s13, 683901, 20); + + // s0 += s12 * 666643; + // s1 += s12 * 470296; + // s2 += s12 * 654183; + // s3 -= s12 * 997805; + // s4 += s12 * 136657; + // s5 -= s12 * 683901; + // s12 = 0; + $s0 += self::mul($s12, 666643, 20); + $s1 += self::mul($s12, 470296, 19); + $s2 += self::mul($s12, 654183, 20); + $s3 -= self::mul($s12, 997805, 20); + $s4 += self::mul($s12, 136657, 18); + $s5 -= self::mul($s12, 683901, 20); + $s12 = 0; + + // carry0 = (s0 + (int64_t) (1L << 20)) >> 21; + // s1 += carry0; + // s0 -= carry0 * ((uint64_t) 1L << 21); + $carry0 = ($s0 + (1 << 20)) >> 21; + $s1 += $carry0; + $s0 -= $carry0 << 21; + // carry2 = (s2 + (int64_t) (1L << 20)) >> 21; + // s3 += carry2; + // s2 -= carry2 * ((uint64_t) 1L << 21); + $carry2 = ($s2 + (1 << 20)) >> 21; + $s3 += $carry2; + $s2 -= $carry2 << 21; + // carry4 = (s4 + (int64_t) (1L << 20)) >> 21; + // s5 += carry4; + // s4 -= carry4 * ((uint64_t) 1L << 21); + $carry4 = ($s4 + (1 << 20)) >> 21; + $s5 += $carry4; + $s4 -= $carry4 << 21; + // carry6 = (s6 + (int64_t) (1L << 20)) >> 21; + // s7 += carry6; + // s6 -= carry6 * ((uint64_t) 1L << 21); + $carry6 = ($s6 + (1 << 20)) >> 21; + $s7 += $carry6; + $s6 -= $carry6 << 21; + // carry8 = (s8 + (int64_t) (1L << 20)) >> 21; + // s9 += carry8; + // s8 -= carry8 * ((uint64_t) 1L << 21); + $carry8 = ($s8 + (1 << 20)) >> 21; + $s9 += $carry8; + $s8 -= $carry8 << 21; + // carry10 = (s10 + (int64_t) (1L << 20)) >> 21; + // s11 += carry10; + // s10 -= carry10 * ((uint64_t) 1L << 21); + $carry10 = ($s10 + (1 << 20)) >> 21; + $s11 += $carry10; + $s10 -= $carry10 << 21; + + // carry1 = (s1 + (int64_t) (1L << 20)) >> 21; + // s2 += carry1; + // s1 -= carry1 * ((uint64_t) 1L << 21); + $carry1 = ($s1 + (1 << 20)) >> 21; + $s2 += $carry1; + $s1 -= $carry1 << 21; + // carry3 = (s3 + (int64_t) (1L << 20)) >> 21; + // s4 += carry3; + // s3 -= carry3 * ((uint64_t) 1L << 21); + $carry3 = ($s3 + (1 << 20)) >> 21; + $s4 += $carry3; + $s3 -= $carry3 << 21; + // carry5 = (s5 + (int64_t) (1L << 20)) >> 21; + // s6 += carry5; + // s5 -= carry5 * ((uint64_t) 1L << 21); + $carry5 = ($s5 + (1 << 20)) >> 21; + $s6 += $carry5; + $s5 -= $carry5 << 21; + // carry7 = (s7 + (int64_t) (1L << 20)) >> 21; + // s8 += carry7; + // s7 -= carry7 * ((uint64_t) 1L << 21); + $carry7 = ($s7 + (1 << 20)) >> 21; + $s8 += $carry7; + $s7 -= $carry7 << 21; + // carry9 = (s9 + (int64_t) (1L << 20)) >> 21; + // s10 += carry9; + // s9 -= carry9 * ((uint64_t) 1L << 21); + $carry9 = ($s9 + (1 << 20)) >> 21; + $s10 += $carry9; + $s9 -= $carry9 << 21; + // carry11 = (s11 + (int64_t) (1L << 20)) >> 21; + // s12 += carry11; + // s11 -= carry11 * ((uint64_t) 1L << 21); + $carry11 = ($s11 + (1 << 20)) >> 21; + $s12 += $carry11; + $s11 -= $carry11 << 21; + + // s0 += s12 * 666643; + // s1 += s12 * 470296; + // s2 += s12 * 654183; + // s3 -= s12 * 997805; + // s4 += s12 * 136657; + // s5 -= s12 * 683901; + // s12 = 0; + $s0 += self::mul($s12, 666643, 20); + $s1 += self::mul($s12, 470296, 19); + $s2 += self::mul($s12, 654183, 20); + $s3 -= self::mul($s12, 997805, 20); + $s4 += self::mul($s12, 136657, 18); + $s5 -= self::mul($s12, 683901, 20); + $s12 = 0; + + // carry0 = s0 >> 21; + // s1 += carry0; + // s0 -= carry0 * ((uint64_t) 1L << 21); + $carry0 = $s0 >> 21; + $s1 += $carry0; + $s0 -= $carry0 << 21; + // carry1 = s1 >> 21; + // s2 += carry1; + // s1 -= carry1 * ((uint64_t) 1L << 21); + $carry1 = $s1 >> 21; + $s2 += $carry1; + $s1 -= $carry1 << 21; + // carry2 = s2 >> 21; + // s3 += carry2; + // s2 -= carry2 * ((uint64_t) 1L << 21); + $carry2 = $s2 >> 21; + $s3 += $carry2; + $s2 -= $carry2 << 21; + // carry3 = s3 >> 21; + // s4 += carry3; + // s3 -= carry3 * ((uint64_t) 1L << 21); + $carry3 = $s3 >> 21; + $s4 += $carry3; + $s3 -= $carry3 << 21; + // carry4 = s4 >> 21; + // s5 += carry4; + // s4 -= carry4 * ((uint64_t) 1L << 21); + $carry4 = $s4 >> 21; + $s5 += $carry4; + $s4 -= $carry4 << 21; + // carry5 = s5 >> 21; + // s6 += carry5; + // s5 -= carry5 * ((uint64_t) 1L << 21); + $carry5 = $s5 >> 21; + $s6 += $carry5; + $s5 -= $carry5 << 21; + // carry6 = s6 >> 21; + // s7 += carry6; + // s6 -= carry6 * ((uint64_t) 1L << 21); + $carry6 = $s6 >> 21; + $s7 += $carry6; + $s6 -= $carry6 << 21; + // carry7 = s7 >> 21; + // s8 += carry7; + // s7 -= carry7 * ((uint64_t) 1L << 21); + $carry7 = $s7 >> 21; + $s8 += $carry7; + $s7 -= $carry7 << 21; + // carry8 = s8 >> 21; + // s9 += carry8; + // s8 -= carry8 * ((uint64_t) 1L << 21); + $carry8 = $s8 >> 21; + $s9 += $carry8; + $s8 -= $carry8 << 21; + // carry9 = s9 >> 21; + // s10 += carry9; + // s9 -= carry9 * ((uint64_t) 1L << 21); + $carry9 = $s9 >> 21; + $s10 += $carry9; + $s9 -= $carry9 << 21; + // carry10 = s10 >> 21; + // s11 += carry10; + // s10 -= carry10 * ((uint64_t) 1L << 21); + $carry10 = $s10 >> 21; + $s11 += $carry10; + $s10 -= $carry10 << 21; + // carry11 = s11 >> 21; + // s12 += carry11; + // s11 -= carry11 * ((uint64_t) 1L << 21); + $carry11 = $s11 >> 21; + $s12 += $carry11; + $s11 -= $carry11 << 21; + + // s0 += s12 * 666643; + // s1 += s12 * 470296; + // s2 += s12 * 654183; + // s3 -= s12 * 997805; + // s4 += s12 * 136657; + // s5 -= s12 * 683901; + $s0 += self::mul($s12, 666643, 20); + $s1 += self::mul($s12, 470296, 19); + $s2 += self::mul($s12, 654183, 20); + $s3 -= self::mul($s12, 997805, 20); + $s4 += self::mul($s12, 136657, 18); + $s5 -= self::mul($s12, 683901, 20); + + // carry0 = s0 >> 21; + // s1 += carry0; + // s0 -= carry0 * ((uint64_t) 1L << 21); + $carry0 = $s0 >> 21; + $s1 += $carry0; + $s0 -= $carry0 << 21; + // carry1 = s1 >> 21; + // s2 += carry1; + // s1 -= carry1 * ((uint64_t) 1L << 21); + $carry1 = $s1 >> 21; + $s2 += $carry1; + $s1 -= $carry1 << 21; + // carry2 = s2 >> 21; + // s3 += carry2; + // s2 -= carry2 * ((uint64_t) 1L << 21); + $carry2 = $s2 >> 21; + $s3 += $carry2; + $s2 -= $carry2 << 21; + // carry3 = s3 >> 21; + // s4 += carry3; + // s3 -= carry3 * ((uint64_t) 1L << 21); + $carry3 = $s3 >> 21; + $s4 += $carry3; + $s3 -= $carry3 << 21; + // carry4 = s4 >> 21; + // s5 += carry4; + // s4 -= carry4 * ((uint64_t) 1L << 21); + $carry4 = $s4 >> 21; + $s5 += $carry4; + $s4 -= $carry4 << 21; + // carry5 = s5 >> 21; + // s6 += carry5; + // s5 -= carry5 * ((uint64_t) 1L << 21); + $carry5 = $s5 >> 21; + $s6 += $carry5; + $s5 -= $carry5 << 21; + // carry6 = s6 >> 21; + // s7 += carry6; + // s6 -= carry6 * ((uint64_t) 1L << 21); + $carry6 = $s6 >> 21; + $s7 += $carry6; + $s6 -= $carry6 << 21; + // carry7 = s7 >> 21; + // s8 += carry7; + // s7 -= carry7 * ((uint64_t) 1L << 21); + $carry7 = $s7 >> 21; + $s8 += $carry7; + $s7 -= $carry7 << 21; + // carry8 = s8 >> 21; + // s9 += carry8; + // s8 -= carry8 * ((uint64_t) 1L << 21); + $carry8 = $s8 >> 21; + $s9 += $carry8; + $s8 -= $carry8 << 21; + // carry9 = s9 >> 21; + // s10 += carry9; + // s9 -= carry9 * ((uint64_t) 1L << 21); + $carry9 = $s9 >> 21; + $s10 += $carry9; + $s9 -= $carry9 << 21; + // carry10 = s10 >> 21; + // s11 += carry10; + // s10 -= carry10 * ((uint64_t) 1L << 21); + $carry10 = $s10 >> 21; + $s11 += $carry10; + $s10 -= $carry10 << 21; + + $s = array_fill(0, 32, 0); + // s[0] = s0 >> 0; + $s[0] = $s0 >> 0; + // s[1] = s0 >> 8; + $s[1] = $s0 >> 8; + // s[2] = (s0 >> 16) | (s1 * ((uint64_t) 1 << 5)); + $s[2] = ($s0 >> 16) | ($s1 << 5); + // s[3] = s1 >> 3; + $s[3] = $s1 >> 3; + // s[4] = s1 >> 11; + $s[4] = $s1 >> 11; + // s[5] = (s1 >> 19) | (s2 * ((uint64_t) 1 << 2)); + $s[5] = ($s1 >> 19) | ($s2 << 2); + // s[6] = s2 >> 6; + $s[6] = $s2 >> 6; + // s[7] = (s2 >> 14) | (s3 * ((uint64_t) 1 << 7)); + $s[7] = ($s2 >> 14) | ($s3 << 7); + // s[8] = s3 >> 1; + $s[8] = $s3 >> 1; + // s[9] = s3 >> 9; + $s[9] = $s3 >> 9; + // s[10] = (s3 >> 17) | (s4 * ((uint64_t) 1 << 4)); + $s[10] = ($s3 >> 17) | ($s4 << 4); + // s[11] = s4 >> 4; + $s[11] = $s4 >> 4; + // s[12] = s4 >> 12; + $s[12] = $s4 >> 12; + // s[13] = (s4 >> 20) | (s5 * ((uint64_t) 1 << 1)); + $s[13] = ($s4 >> 20) | ($s5 << 1); + // s[14] = s5 >> 7; + $s[14] = $s5 >> 7; + // s[15] = (s5 >> 15) | (s6 * ((uint64_t) 1 << 6)); + $s[15] = ($s5 >> 15) | ($s6 << 6); + // s[16] = s6 >> 2; + $s[16] = $s6 >> 2; + // s[17] = s6 >> 10; + $s[17] = $s6 >> 10; + // s[18] = (s6 >> 18) | (s7 * ((uint64_t) 1 << 3)); + $s[18] = ($s6 >> 18) | ($s7 << 3); + // s[19] = s7 >> 5; + $s[19] = $s7 >> 5; + // s[20] = s7 >> 13; + $s[20] = $s7 >> 13; + // s[21] = s8 >> 0; + $s[21] = $s8 >> 0; + // s[22] = s8 >> 8; + $s[22] = $s8 >> 8; + // s[23] = (s8 >> 16) | (s9 * ((uint64_t) 1 << 5)); + $s[23] = ($s8 >> 16) | ($s9 << 5); + // s[24] = s9 >> 3; + $s[24] = $s9 >> 3; + // s[25] = s9 >> 11; + $s[25] = $s9 >> 11; + // s[26] = (s9 >> 19) | (s10 * ((uint64_t) 1 << 2)); + $s[26] = ($s9 >> 19) | ($s10 << 2); + // s[27] = s10 >> 6; + $s[27] = $s10 >> 6; + // s[28] = (s10 >> 14) | (s11 * ((uint64_t) 1 << 7)); + $s[28] = ($s10 >> 14) | ($s11 << 7); + // s[29] = s11 >> 1; + $s[29] = $s11 >> 1; + // s[30] = s11 >> 9; + $s[30] = $s11 >> 9; + // s[31] = s11 >> 17; + $s[31] = $s11 >> 17; + return self::intArrayToString($s); + } + + /** + * @param string $s + * @return string + */ + public static function sc25519_sq($s) + { + return self::sc25519_mul($s, $s); + } + + /** + * @param string $s + * @param int $n + * @param string $a + * @return string + */ + public static function sc25519_sqmul($s, $n, $a) + { + for ($i = 0; $i < $n; ++$i) { + $s = self::sc25519_sq($s); + } + return self::sc25519_mul($s, $a); + } + + /** + * @param string $s + * @return string + */ + public static function sc25519_invert($s) + { + $_10 = self::sc25519_sq($s); + $_11 = self::sc25519_mul($s, $_10); + $_100 = self::sc25519_mul($s, $_11); + $_1000 = self::sc25519_sq($_100); + $_1010 = self::sc25519_mul($_10, $_1000); + $_1011 = self::sc25519_mul($s, $_1010); + $_10000 = self::sc25519_sq($_1000); + $_10110 = self::sc25519_sq($_1011); + $_100000 = self::sc25519_mul($_1010, $_10110); + $_100110 = self::sc25519_mul($_10000, $_10110); + $_1000000 = self::sc25519_sq($_100000); + $_1010000 = self::sc25519_mul($_10000, $_1000000); + $_1010011 = self::sc25519_mul($_11, $_1010000); + $_1100011 = self::sc25519_mul($_10000, $_1010011); + $_1100111 = self::sc25519_mul($_100, $_1100011); + $_1101011 = self::sc25519_mul($_100, $_1100111); + $_10010011 = self::sc25519_mul($_1000000, $_1010011); + $_10010111 = self::sc25519_mul($_100, $_10010011); + $_10111101 = self::sc25519_mul($_100110, $_10010111); + $_11010011 = self::sc25519_mul($_10110, $_10111101); + $_11100111 = self::sc25519_mul($_1010000, $_10010111); + $_11101011 = self::sc25519_mul($_100, $_11100111); + $_11110101 = self::sc25519_mul($_1010, $_11101011); + + $recip = self::sc25519_mul($_1011, $_11110101); + $recip = self::sc25519_sqmul($recip, 126, $_1010011); + $recip = self::sc25519_sqmul($recip, 9, $_10); + $recip = self::sc25519_mul($recip, $_11110101); + $recip = self::sc25519_sqmul($recip, 7, $_1100111); + $recip = self::sc25519_sqmul($recip, 9, $_11110101); + $recip = self::sc25519_sqmul($recip, 11, $_10111101); + $recip = self::sc25519_sqmul($recip, 8, $_11100111); + $recip = self::sc25519_sqmul($recip, 9, $_1101011); + $recip = self::sc25519_sqmul($recip, 6, $_1011); + $recip = self::sc25519_sqmul($recip, 14, $_10010011); + $recip = self::sc25519_sqmul($recip, 10, $_1100011); + $recip = self::sc25519_sqmul($recip, 9, $_10010111); + $recip = self::sc25519_sqmul($recip, 10, $_11110101); + $recip = self::sc25519_sqmul($recip, 8, $_11010011); + return self::sc25519_sqmul($recip, 8, $_11101011); + } + + /** + * @param string $s + * @return string + */ + public static function clamp($s) + { + $s_ = self::stringToIntArray($s); + $s_[0] &= 248; + $s_[31] |= 64; + $s_[31] &= 128; + return self::intArrayToString($s_); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/Curve25519/Fe.php b/vendor/paragonie/sodium_compat/src/Core/Curve25519/Fe.php new file mode 100644 index 0000000..64c489a --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/Curve25519/Fe.php @@ -0,0 +1,123 @@ + + */ + protected $container = array(); + + /** + * @var int + */ + protected $size = 10; + + /** + * @internal You should not use this directly from another application + * + * @param array $array + * @param bool $save_indexes + * @return self + */ + public static function fromArray($array, $save_indexes = null) + { + $count = count($array); + if ($save_indexes) { + $keys = array_keys($array); + } else { + $keys = range(0, $count - 1); + } + $array = array_values($array); + /** @var array $keys */ + + $obj = new ParagonIE_Sodium_Core_Curve25519_Fe(); + if ($save_indexes) { + for ($i = 0; $i < $count; ++$i) { + $obj->offsetSet($keys[$i], $array[$i]); + } + } else { + for ($i = 0; $i < $count; ++$i) { + $obj->offsetSet($i, $array[$i]); + } + } + return $obj; + } + + /** + * @internal You should not use this directly from another application + * + * @param int|null $offset + * @param int $value + * @return void + * @psalm-suppress MixedArrayOffset + */ + public function offsetSet($offset, $value) + { + if (!is_int($value)) { + throw new InvalidArgumentException('Expected an integer'); + } + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * @internal You should not use this directly from another application + * + * @param int $offset + * @return bool + * @psalm-suppress MixedArrayOffset + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * @internal You should not use this directly from another application + * + * @param int $offset + * @return void + * @psalm-suppress MixedArrayOffset + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * @internal You should not use this directly from another application + * + * @param int $offset + * @return int + * @psalm-suppress MixedArrayOffset + */ + public function offsetGet($offset) + { + if (!isset($this->container[$offset])) { + $this->container[$offset] = 0; + } + return (int) ($this->container[$offset]); + } + + /** + * @internal You should not use this directly from another application + * + * @return array + */ + public function __debugInfo() + { + return array(implode(', ', $this->container)); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/Curve25519/Ge/Cached.php b/vendor/paragonie/sodium_compat/src/Core/Curve25519/Ge/Cached.php new file mode 100644 index 0000000..39bf897 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/Curve25519/Ge/Cached.php @@ -0,0 +1,65 @@ +YplusX = $YplusX; + if ($YminusX === null) { + $YminusX = new ParagonIE_Sodium_Core_Curve25519_Fe(); + } + $this->YminusX = $YminusX; + if ($Z === null) { + $Z = new ParagonIE_Sodium_Core_Curve25519_Fe(); + } + $this->Z = $Z; + if ($T2d === null) { + $T2d = new ParagonIE_Sodium_Core_Curve25519_Fe(); + } + $this->T2d = $T2d; + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/Curve25519/Ge/P1p1.php b/vendor/paragonie/sodium_compat/src/Core/Curve25519/Ge/P1p1.php new file mode 100644 index 0000000..a63d6ab --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/Curve25519/Ge/P1p1.php @@ -0,0 +1,64 @@ +X = $x; + if ($y === null) { + $y = new ParagonIE_Sodium_Core_Curve25519_Fe(); + } + $this->Y = $y; + if ($z === null) { + $z = new ParagonIE_Sodium_Core_Curve25519_Fe(); + } + $this->Z = $z; + if ($t === null) { + $t = new ParagonIE_Sodium_Core_Curve25519_Fe(); + } + $this->T = $t; + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/Curve25519/Ge/P2.php b/vendor/paragonie/sodium_compat/src/Core/Curve25519/Ge/P2.php new file mode 100644 index 0000000..aee4000 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/Curve25519/Ge/P2.php @@ -0,0 +1,54 @@ +X = $x; + if ($y === null) { + $y = new ParagonIE_Sodium_Core_Curve25519_Fe(); + } + $this->Y = $y; + if ($z === null) { + $z = new ParagonIE_Sodium_Core_Curve25519_Fe(); + } + $this->Z = $z; + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/Curve25519/Ge/P3.php b/vendor/paragonie/sodium_compat/src/Core/Curve25519/Ge/P3.php new file mode 100644 index 0000000..00f5b27 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/Curve25519/Ge/P3.php @@ -0,0 +1,65 @@ +X = $x; + if ($y === null) { + $y = new ParagonIE_Sodium_Core_Curve25519_Fe(); + } + $this->Y = $y; + if ($z === null) { + $z = new ParagonIE_Sodium_Core_Curve25519_Fe(); + } + $this->Z = $z; + if ($t === null) { + $t = new ParagonIE_Sodium_Core_Curve25519_Fe(); + } + $this->T = $t; + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/Curve25519/Ge/Precomp.php b/vendor/paragonie/sodium_compat/src/Core/Curve25519/Ge/Precomp.php new file mode 100644 index 0000000..59611c1 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/Curve25519/Ge/Precomp.php @@ -0,0 +1,54 @@ +yplusx = $yplusx; + if ($yminusx === null) { + $yminusx = new ParagonIE_Sodium_Core_Curve25519_Fe(); + } + $this->yminusx = $yminusx; + if ($xy2d === null) { + $xy2d = new ParagonIE_Sodium_Core_Curve25519_Fe(); + } + $this->xy2d = $xy2d; + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/Curve25519/H.php b/vendor/paragonie/sodium_compat/src/Core/Curve25519/H.php new file mode 100644 index 0000000..adab63e --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/Curve25519/H.php @@ -0,0 +1,1549 @@ +>>> Basically, int[32][8][3][10] + */ + protected static $base = array( + array( + array( + array(25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605), + array(-12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378), + array(-8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546), + ), + array( + array(-12815894, -12976347, -21581243, 11784320, -25355658, -2750717, -11717903, -3814571, -358445, -10211303), + array(-21703237, 6903825, 27185491, 6451973, -29577724, -9554005, -15616551, 11189268, -26829678, -5319081), + array(26966642, 11152617, 32442495, 15396054, 14353839, -12752335, -3128826, -9541118, -15472047, -4166697), + ), + array( + array(15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024), + array(16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574), + array(30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357), + ), + array( + array(-17036878, 13921892, 10945806, -6033431, 27105052, -16084379, -28926210, 15006023, 3284568, -6276540), + array(23599295, -8306047, -11193664, -7687416, 13236774, 10506355, 7464579, 9656445, 13059162, 10374397), + array(7798556, 16710257, 3033922, 2874086, 28997861, 2835604, 32406664, -3839045, -641708, -101325), + ), + array( + array(10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380), + array(4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306), + array(19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942), + ), + array( + array(-15371964, -12862754, 32573250, 4720197, -26436522, 5875511, -19188627, -15224819, -9818940, -12085777), + array(-8549212, 109983, 15149363, 2178705, 22900618, 4543417, 3044240, -15689887, 1762328, 14866737), + array(-18199695, -15951423, -10473290, 1707278, -17185920, 3916101, -28236412, 3959421, 27914454, 4383652), + ), + array( + array(5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766), + array(-30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701), + array(28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300), + ), + array( + array(14499471, -2729599, -33191113, -4254652, 28494862, 14271267, 30290735, 10876454, -33154098, 2381726), + array(-7195431, -2655363, -14730155, 462251, -27724326, 3941372, -6236617, 3696005, -32300832, 15351955), + array(27431194, 8222322, 16448760, -3907995, -18707002, 11938355, -32961401, -2970515, 29551813, 10109425), + ), + ), + array( + array( + array(-13657040, -13155431, -31283750, 11777098, 21447386, 6519384, -2378284, -1627556, 10092783, -4764171), + array(27939166, 14210322, 4677035, 16277044, -22964462, -12398139, -32508754, 12005538, -17810127, 12803510), + array(17228999, -15661624, -1233527, 300140, -1224870, -11714777, 30364213, -9038194, 18016357, 4397660), + ), + array( + array(-10958843, -7690207, 4776341, -14954238, 27850028, -15602212, -26619106, 14544525, -17477504, 982639), + array(29253598, 15796703, -2863982, -9908884, 10057023, 3163536, 7332899, -4120128, -21047696, 9934963), + array(5793303, 16271923, -24131614, -10116404, 29188560, 1206517, -14747930, 4559895, -30123922, -10897950), + ), + array( + array(-27643952, -11493006, 16282657, -11036493, 28414021, -15012264, 24191034, 4541697, -13338309, 5500568), + array(12650548, -1497113, 9052871, 11355358, -17680037, -8400164, -17430592, 12264343, 10874051, 13524335), + array(25556948, -3045990, 714651, 2510400, 23394682, -10415330, 33119038, 5080568, -22528059, 5376628), + ), + array( + array(-26088264, -4011052, -17013699, -3537628, -6726793, 1920897, -22321305, -9447443, 4535768, 1569007), + array(-2255422, 14606630, -21692440, -8039818, 28430649, 8775819, -30494562, 3044290, 31848280, 12543772), + array(-22028579, 2943893, -31857513, 6777306, 13784462, -4292203, -27377195, -2062731, 7718482, 14474653), + ), + array( + array(2385315, 2454213, -22631320, 46603, -4437935, -15680415, 656965, -7236665, 24316168, -5253567), + array(13741529, 10911568, -33233417, -8603737, -20177830, -1033297, 33040651, -13424532, -20729456, 8321686), + array(21060490, -2212744, 15712757, -4336099, 1639040, 10656336, 23845965, -11874838, -9984458, 608372), + ), + array( + array(-13672732, -15087586, -10889693, -7557059, -6036909, 11305547, 1123968, -6780577, 27229399, 23887), + array(-23244140, -294205, -11744728, 14712571, -29465699, -2029617, 12797024, -6440308, -1633405, 16678954), + array(-29500620, 4770662, -16054387, 14001338, 7830047, 9564805, -1508144, -4795045, -17169265, 4904953), + ), + array( + array(24059557, 14617003, 19037157, -15039908, 19766093, -14906429, 5169211, 16191880, 2128236, -4326833), + array(-16981152, 4124966, -8540610, -10653797, 30336522, -14105247, -29806336, 916033, -6882542, -2986532), + array(-22630907, 12419372, -7134229, -7473371, -16478904, 16739175, 285431, 2763829, 15736322, 4143876), + ), + array( + array(2379352, 11839345, -4110402, -5988665, 11274298, 794957, 212801, -14594663, 23527084, -16458268), + array(33431127, -11130478, -17838966, -15626900, 8909499, 8376530, -32625340, 4087881, -15188911, -14416214), + array(1767683, 7197987, -13205226, -2022635, -13091350, 448826, 5799055, 4357868, -4774191, -16323038), + ), + ), + array( + array( + array(6721966, 13833823, -23523388, -1551314, 26354293, -11863321, 23365147, -3949732, 7390890, 2759800), + array(4409041, 2052381, 23373853, 10530217, 7676779, -12885954, 21302353, -4264057, 1244380, -12919645), + array(-4421239, 7169619, 4982368, -2957590, 30256825, -2777540, 14086413, 9208236, 15886429, 16489664), + ), + array( + array(1996075, 10375649, 14346367, 13311202, -6874135, -16438411, -13693198, 398369, -30606455, -712933), + array(-25307465, 9795880, -2777414, 14878809, -33531835, 14780363, 13348553, 12076947, -30836462, 5113182), + array(-17770784, 11797796, 31950843, 13929123, -25888302, 12288344, -30341101, -7336386, 13847711, 5387222), + ), + array( + array(-18582163, -3416217, 17824843, -2340966, 22744343, -10442611, 8763061, 3617786, -19600662, 10370991), + array(20246567, -14369378, 22358229, -543712, 18507283, -10413996, 14554437, -8746092, 32232924, 16763880), + array(9648505, 10094563, 26416693, 14745928, -30374318, -6472621, 11094161, 15689506, 3140038, -16510092), + ), + array( + array(-16160072, 5472695, 31895588, 4744994, 8823515, 10365685, -27224800, 9448613, -28774454, 366295), + array(19153450, 11523972, -11096490, -6503142, -24647631, 5420647, 28344573, 8041113, 719605, 11671788), + array(8678025, 2694440, -6808014, 2517372, 4964326, 11152271, -15432916, -15266516, 27000813, -10195553), + ), + array( + array(-15157904, 7134312, 8639287, -2814877, -7235688, 10421742, 564065, 5336097, 6750977, -14521026), + array(11836410, -3979488, 26297894, 16080799, 23455045, 15735944, 1695823, -8819122, 8169720, 16220347), + array(-18115838, 8653647, 17578566, -6092619, -8025777, -16012763, -11144307, -2627664, -5990708, -14166033), + ), + array( + array(-23308498, -10968312, 15213228, -10081214, -30853605, -11050004, 27884329, 2847284, 2655861, 1738395), + array(-27537433, -14253021, -25336301, -8002780, -9370762, 8129821, 21651608, -3239336, -19087449, -11005278), + array(1533110, 3437855, 23735889, 459276, 29970501, 11335377, 26030092, 5821408, 10478196, 8544890), + ), + array( + array(32173121, -16129311, 24896207, 3921497, 22579056, -3410854, 19270449, 12217473, 17789017, -3395995), + array(-30552961, -2228401, -15578829, -10147201, 13243889, 517024, 15479401, -3853233, 30460520, 1052596), + array(-11614875, 13323618, 32618793, 8175907, -15230173, 12596687, 27491595, -4612359, 3179268, -9478891), + ), + array( + array(31947069, -14366651, -4640583, -15339921, -15125977, -6039709, -14756777, -16411740, 19072640, -9511060), + array(11685058, 11822410, 3158003, -13952594, 33402194, -4165066, 5977896, -5215017, 473099, 5040608), + array(-20290863, 8198642, -27410132, 11602123, 1290375, -2799760, 28326862, 1721092, -19558642, -3131606), + ), + ), + array( + array( + array(7881532, 10687937, 7578723, 7738378, -18951012, -2553952, 21820786, 8076149, -27868496, 11538389), + array(-19935666, 3899861, 18283497, -6801568, -15728660, -11249211, 8754525, 7446702, -5676054, 5797016), + array(-11295600, -3793569, -15782110, -7964573, 12708869, -8456199, 2014099, -9050574, -2369172, -5877341), + ), + array( + array(-22472376, -11568741, -27682020, 1146375, 18956691, 16640559, 1192730, -3714199, 15123619, 10811505), + array(14352098, -3419715, -18942044, 10822655, 32750596, 4699007, -70363, 15776356, -28886779, -11974553), + array(-28241164, -8072475, -4978962, -5315317, 29416931, 1847569, -20654173, -16484855, 4714547, -9600655), + ), + array( + array(15200332, 8368572, 19679101, 15970074, -31872674, 1959451, 24611599, -4543832, -11745876, 12340220), + array(12876937, -10480056, 33134381, 6590940, -6307776, 14872440, 9613953, 8241152, 15370987, 9608631), + array(-4143277, -12014408, 8446281, -391603, 4407738, 13629032, -7724868, 15866074, -28210621, -8814099), + ), + array( + array(26660628, -15677655, 8393734, 358047, -7401291, 992988, -23904233, 858697, 20571223, 8420556), + array(14620715, 13067227, -15447274, 8264467, 14106269, 15080814, 33531827, 12516406, -21574435, -12476749), + array(236881, 10476226, 57258, -14677024, 6472998, 2466984, 17258519, 7256740, 8791136, 15069930), + ), + array( + array(1276410, -9371918, 22949635, -16322807, -23493039, -5702186, 14711875, 4874229, -30663140, -2331391), + array(5855666, 4990204, -13711848, 7294284, -7804282, 1924647, -1423175, -7912378, -33069337, 9234253), + array(20590503, -9018988, 31529744, -7352666, -2706834, 10650548, 31559055, -11609587, 18979186, 13396066), + ), + array( + array(24474287, 4968103, 22267082, 4407354, 24063882, -8325180, -18816887, 13594782, 33514650, 7021958), + array(-11566906, -6565505, -21365085, 15928892, -26158305, 4315421, -25948728, -3916677, -21480480, 12868082), + array(-28635013, 13504661, 19988037, -2132761, 21078225, 6443208, -21446107, 2244500, -12455797, -8089383), + ), + array( + array(-30595528, 13793479, -5852820, 319136, -25723172, -6263899, 33086546, 8957937, -15233648, 5540521), + array(-11630176, -11503902, -8119500, -7643073, 2620056, 1022908, -23710744, -1568984, -16128528, -14962807), + array(23152971, 775386, 27395463, 14006635, -9701118, 4649512, 1689819, 892185, -11513277, -15205948), + ), + array( + array(9770129, 9586738, 26496094, 4324120, 1556511, -3550024, 27453819, 4763127, -19179614, 5867134), + array(-32765025, 1927590, 31726409, -4753295, 23962434, -16019500, 27846559, 5931263, -29749703, -16108455), + array(27461885, -2977536, 22380810, 1815854, -23033753, -3031938, 7283490, -15148073, -19526700, 7734629), + ), + ), + array( + array( + array(-8010264, -9590817, -11120403, 6196038, 29344158, -13430885, 7585295, -3176626, 18549497, 15302069), + array(-32658337, -6171222, -7672793, -11051681, 6258878, 13504381, 10458790, -6418461, -8872242, 8424746), + array(24687205, 8613276, -30667046, -3233545, 1863892, -1830544, 19206234, 7134917, -11284482, -828919), + ), + array( + array(11334899, -9218022, 8025293, 12707519, 17523892, -10476071, 10243738, -14685461, -5066034, 16498837), + array(8911542, 6887158, -9584260, -6958590, 11145641, -9543680, 17303925, -14124238, 6536641, 10543906), + array(-28946384, 15479763, -17466835, 568876, -1497683, 11223454, -2669190, -16625574, -27235709, 8876771), + ), + array( + array(-25742899, -12566864, -15649966, -846607, -33026686, -796288, -33481822, 15824474, -604426, -9039817), + array(10330056, 70051, 7957388, -9002667, 9764902, 15609756, 27698697, -4890037, 1657394, 3084098), + array(10477963, -7470260, 12119566, -13250805, 29016247, -5365589, 31280319, 14396151, -30233575, 15272409), + ), + array( + array(-12288309, 3169463, 28813183, 16658753, 25116432, -5630466, -25173957, -12636138, -25014757, 1950504), + array(-26180358, 9489187, 11053416, -14746161, -31053720, 5825630, -8384306, -8767532, 15341279, 8373727), + array(28685821, 7759505, -14378516, -12002860, -31971820, 4079242, 298136, -10232602, -2878207, 15190420), + ), + array( + array(-32932876, 13806336, -14337485, -15794431, -24004620, 10940928, 8669718, 2742393, -26033313, -6875003), + array(-1580388, -11729417, -25979658, -11445023, -17411874, -10912854, 9291594, -16247779, -12154742, 6048605), + array(-30305315, 14843444, 1539301, 11864366, 20201677, 1900163, 13934231, 5128323, 11213262, 9168384), + ), + array( + array(-26280513, 11007847, 19408960, -940758, -18592965, -4328580, -5088060, -11105150, 20470157, -16398701), + array(-23136053, 9282192, 14855179, -15390078, -7362815, -14408560, -22783952, 14461608, 14042978, 5230683), + array(29969567, -2741594, -16711867, -8552442, 9175486, -2468974, 21556951, 3506042, -5933891, -12449708), + ), + array( + array(-3144746, 8744661, 19704003, 4581278, -20430686, 6830683, -21284170, 8971513, -28539189, 15326563), + array(-19464629, 10110288, -17262528, -3503892, -23500387, 1355669, -15523050, 15300988, -20514118, 9168260), + array(-5353335, 4488613, -23803248, 16314347, 7780487, -15638939, -28948358, 9601605, 33087103, -9011387), + ), + array( + array(-19443170, -15512900, -20797467, -12445323, -29824447, 10229461, -27444329, -15000531, -5996870, 15664672), + array(23294591, -16632613, -22650781, -8470978, 27844204, 11461195, 13099750, -2460356, 18151676, 13417686), + array(-24722913, -4176517, -31150679, 5988919, -26858785, 6685065, 1661597, -12551441, 15271676, -15452665), + ), + ), + array( + array( + array(11433042, -13228665, 8239631, -5279517, -1985436, -725718, -18698764, 2167544, -6921301, -13440182), + array(-31436171, 15575146, 30436815, 12192228, -22463353, 9395379, -9917708, -8638997, 12215110, 12028277), + array(14098400, 6555944, 23007258, 5757252, -15427832, -12950502, 30123440, 4617780, -16900089, -655628), + ), + array( + array(-4026201, -15240835, 11893168, 13718664, -14809462, 1847385, -15819999, 10154009, 23973261, -12684474), + array(-26531820, -3695990, -1908898, 2534301, -31870557, -16550355, 18341390, -11419951, 32013174, -10103539), + array(-25479301, 10876443, -11771086, -14625140, -12369567, 1838104, 21911214, 6354752, 4425632, -837822), + ), + array( + array(-10433389, -14612966, 22229858, -3091047, -13191166, 776729, -17415375, -12020462, 4725005, 14044970), + array(19268650, -7304421, 1555349, 8692754, -21474059, -9910664, 6347390, -1411784, -19522291, -16109756), + array(-24864089, 12986008, -10898878, -5558584, -11312371, -148526, 19541418, 8180106, 9282262, 10282508), + ), + array( + array(-26205082, 4428547, -8661196, -13194263, 4098402, -14165257, 15522535, 8372215, 5542595, -10702683), + array(-10562541, 14895633, 26814552, -16673850, -17480754, -2489360, -2781891, 6993761, -18093885, 10114655), + array(-20107055, -929418, 31422704, 10427861, -7110749, 6150669, -29091755, -11529146, 25953725, -106158), + ), + array( + array(-4234397, -8039292, -9119125, 3046000, 2101609, -12607294, 19390020, 6094296, -3315279, 12831125), + array(-15998678, 7578152, 5310217, 14408357, -33548620, -224739, 31575954, 6326196, 7381791, -2421839), + array(-20902779, 3296811, 24736065, -16328389, 18374254, 7318640, 6295303, 8082724, -15362489, 12339664), + ), + array( + array(27724736, 2291157, 6088201, -14184798, 1792727, 5857634, 13848414, 15768922, 25091167, 14856294), + array(-18866652, 8331043, 24373479, 8541013, -701998, -9269457, 12927300, -12695493, -22182473, -9012899), + array(-11423429, -5421590, 11632845, 3405020, 30536730, -11674039, -27260765, 13866390, 30146206, 9142070), + ), + array( + array(3924129, -15307516, -13817122, -10054960, 12291820, -668366, -27702774, 9326384, -8237858, 4171294), + array(-15921940, 16037937, 6713787, 16606682, -21612135, 2790944, 26396185, 3731949, 345228, -5462949), + array(-21327538, 13448259, 25284571, 1143661, 20614966, -8849387, 2031539, -12391231, -16253183, -13582083), + ), + array( + array(31016211, -16722429, 26371392, -14451233, -5027349, 14854137, 17477601, 3842657, 28012650, -16405420), + array(-5075835, 9368966, -8562079, -4600902, -15249953, 6970560, -9189873, 16292057, -8867157, 3507940), + array(29439664, 3537914, 23333589, 6997794, -17555561, -11018068, -15209202, -15051267, -9164929, 6580396), + ), + ), + array( + array( + array(-12185861, -7679788, 16438269, 10826160, -8696817, -6235611, 17860444, -9273846, -2095802, 9304567), + array(20714564, -4336911, 29088195, 7406487, 11426967, -5095705, 14792667, -14608617, 5289421, -477127), + array(-16665533, -10650790, -6160345, -13305760, 9192020, -1802462, 17271490, 12349094, 26939669, -3752294), + ), + array( + array(-12889898, 9373458, 31595848, 16374215, 21471720, 13221525, -27283495, -12348559, -3698806, 117887), + array(22263325, -6560050, 3984570, -11174646, -15114008, -566785, 28311253, 5358056, -23319780, 541964), + array(16259219, 3261970, 2309254, -15534474, -16885711, -4581916, 24134070, -16705829, -13337066, -13552195), + ), + array( + array(9378160, -13140186, -22845982, -12745264, 28198281, -7244098, -2399684, -717351, 690426, 14876244), + array(24977353, -314384, -8223969, -13465086, 28432343, -1176353, -13068804, -12297348, -22380984, 6618999), + array(-1538174, 11685646, 12944378, 13682314, -24389511, -14413193, 8044829, -13817328, 32239829, -5652762), + ), + array( + array(-18603066, 4762990, -926250, 8885304, -28412480, -3187315, 9781647, -10350059, 32779359, 5095274), + array(-33008130, -5214506, -32264887, -3685216, 9460461, -9327423, -24601656, 14506724, 21639561, -2630236), + array(-16400943, -13112215, 25239338, 15531969, 3987758, -4499318, -1289502, -6863535, 17874574, 558605), + ), + array( + array(-13600129, 10240081, 9171883, 16131053, -20869254, 9599700, 33499487, 5080151, 2085892, 5119761), + array(-22205145, -2519528, -16381601, 414691, -25019550, 2170430, 30634760, -8363614, -31999993, -5759884), + array(-6845704, 15791202, 8550074, -1312654, 29928809, -12092256, 27534430, -7192145, -22351378, 12961482), + ), + array( + array(-24492060, -9570771, 10368194, 11582341, -23397293, -2245287, 16533930, 8206996, -30194652, -5159638), + array(-11121496, -3382234, 2307366, 6362031, -135455, 8868177, -16835630, 7031275, 7589640, 8945490), + array(-32152748, 8917967, 6661220, -11677616, -1192060, -15793393, 7251489, -11182180, 24099109, -14456170), + ), + array( + array(5019558, -7907470, 4244127, -14714356, -26933272, 6453165, -19118182, -13289025, -6231896, -10280736), + array(10853594, 10721687, 26480089, 5861829, -22995819, 1972175, -1866647, -10557898, -3363451, -6441124), + array(-17002408, 5906790, 221599, -6563147, 7828208, -13248918, 24362661, -2008168, -13866408, 7421392), + ), + array( + array(8139927, -6546497, 32257646, -5890546, 30375719, 1886181, -21175108, 15441252, 28826358, -4123029), + array(6267086, 9695052, 7709135, -16603597, -32869068, -1886135, 14795160, -7840124, 13746021, -1742048), + array(28584902, 7787108, -6732942, -15050729, 22846041, -7571236, -3181936, -363524, 4771362, -8419958), + ), + ), + array( + array( + array(24949256, 6376279, -27466481, -8174608, -18646154, -9930606, 33543569, -12141695, 3569627, 11342593), + array(26514989, 4740088, 27912651, 3697550, 19331575, -11472339, 6809886, 4608608, 7325975, -14801071), + array(-11618399, -14554430, -24321212, 7655128, -1369274, 5214312, -27400540, 10258390, -17646694, -8186692), + ), + array( + array(11431204, 15823007, 26570245, 14329124, 18029990, 4796082, -31446179, 15580664, 9280358, -3973687), + array(-160783, -10326257, -22855316, -4304997, -20861367, -13621002, -32810901, -11181622, -15545091, 4387441), + array(-20799378, 12194512, 3937617, -5805892, -27154820, 9340370, -24513992, 8548137, 20617071, -7482001), + ), + array( + array(-938825, -3930586, -8714311, 16124718, 24603125, -6225393, -13775352, -11875822, 24345683, 10325460), + array(-19855277, -1568885, -22202708, 8714034, 14007766, 6928528, 16318175, -1010689, 4766743, 3552007), + array(-21751364, -16730916, 1351763, -803421, -4009670, 3950935, 3217514, 14481909, 10988822, -3994762), + ), + array( + array(15564307, -14311570, 3101243, 5684148, 30446780, -8051356, 12677127, -6505343, -8295852, 13296005), + array(-9442290, 6624296, -30298964, -11913677, -4670981, -2057379, 31521204, 9614054, -30000824, 12074674), + array(4771191, -135239, 14290749, -13089852, 27992298, 14998318, -1413936, -1556716, 29832613, -16391035), + ), + array( + array(7064884, -7541174, -19161962, -5067537, -18891269, -2912736, 25825242, 5293297, -27122660, 13101590), + array(-2298563, 2439670, -7466610, 1719965, -27267541, -16328445, 32512469, -5317593, -30356070, -4190957), + array(-30006540, 10162316, -33180176, 3981723, -16482138, -13070044, 14413974, 9515896, 19568978, 9628812), + ), + array( + array(33053803, 199357, 15894591, 1583059, 27380243, -4580435, -17838894, -6106839, -6291786, 3437740), + array(-18978877, 3884493, 19469877, 12726490, 15913552, 13614290, -22961733, 70104, 7463304, 4176122), + array(-27124001, 10659917, 11482427, -16070381, 12771467, -6635117, -32719404, -5322751, 24216882, 5944158), + ), + array( + array(8894125, 7450974, -2664149, -9765752, -28080517, -12389115, 19345746, 14680796, 11632993, 5847885), + array(26942781, -2315317, 9129564, -4906607, 26024105, 11769399, -11518837, 6367194, -9727230, 4782140), + array(19916461, -4828410, -22910704, -11414391, 25606324, -5972441, 33253853, 8220911, 6358847, -1873857), + ), + array( + array(801428, -2081702, 16569428, 11065167, 29875704, 96627, 7908388, -4480480, -13538503, 1387155), + array(19646058, 5720633, -11416706, 12814209, 11607948, 12749789, 14147075, 15156355, -21866831, 11835260), + array(19299512, 1155910, 28703737, 14890794, 2925026, 7269399, 26121523, 15467869, -26560550, 5052483), + ), + ), + array( + array( + array(-3017432, 10058206, 1980837, 3964243, 22160966, 12322533, -6431123, -12618185, 12228557, -7003677), + array(32944382, 14922211, -22844894, 5188528, 21913450, -8719943, 4001465, 13238564, -6114803, 8653815), + array(22865569, -4652735, 27603668, -12545395, 14348958, 8234005, 24808405, 5719875, 28483275, 2841751), + ), + array( + array(-16420968, -1113305, -327719, -12107856, 21886282, -15552774, -1887966, -315658, 19932058, -12739203), + array(-11656086, 10087521, -8864888, -5536143, -19278573, -3055912, 3999228, 13239134, -4777469, -13910208), + array(1382174, -11694719, 17266790, 9194690, -13324356, 9720081, 20403944, 11284705, -14013818, 3093230), + ), + array( + array(16650921, -11037932, -1064178, 1570629, -8329746, 7352753, -302424, 16271225, -24049421, -6691850), + array(-21911077, -5927941, -4611316, -5560156, -31744103, -10785293, 24123614, 15193618, -21652117, -16739389), + array(-9935934, -4289447, -25279823, 4372842, 2087473, 10399484, 31870908, 14690798, 17361620, 11864968), + ), + array( + array(-11307610, 6210372, 13206574, 5806320, -29017692, -13967200, -12331205, -7486601, -25578460, -16240689), + array(14668462, -12270235, 26039039, 15305210, 25515617, 4542480, 10453892, 6577524, 9145645, -6443880), + array(5974874, 3053895, -9433049, -10385191, -31865124, 3225009, -7972642, 3936128, -5652273, -3050304), + ), + array( + array(30625386, -4729400, -25555961, -12792866, -20484575, 7695099, 17097188, -16303496, -27999779, 1803632), + array(-3553091, 9865099, -5228566, 4272701, -5673832, -16689700, 14911344, 12196514, -21405489, 7047412), + array(20093277, 9920966, -11138194, -5343857, 13161587, 12044805, -32856851, 4124601, -32343828, -10257566), + ), + array( + array(-20788824, 14084654, -13531713, 7842147, 19119038, -13822605, 4752377, -8714640, -21679658, 2288038), + array(-26819236, -3283715, 29965059, 3039786, -14473765, 2540457, 29457502, 14625692, -24819617, 12570232), + array(-1063558, -11551823, 16920318, 12494842, 1278292, -5869109, -21159943, -3498680, -11974704, 4724943), + ), + array( + array(17960970, -11775534, -4140968, -9702530, -8876562, -1410617, -12907383, -8659932, -29576300, 1903856), + array(23134274, -14279132, -10681997, -1611936, 20684485, 15770816, -12989750, 3190296, 26955097, 14109738), + array(15308788, 5320727, -30113809, -14318877, 22902008, 7767164, 29425325, -11277562, 31960942, 11934971), + ), + array( + array(-27395711, 8435796, 4109644, 12222639, -24627868, 14818669, 20638173, 4875028, 10491392, 1379718), + array(-13159415, 9197841, 3875503, -8936108, -1383712, -5879801, 33518459, 16176658, 21432314, 12180697), + array(-11787308, 11500838, 13787581, -13832590, -22430679, 10140205, 1465425, 12689540, -10301319, -13872883), + ), + ), + array( + array( + array(5414091, -15386041, -21007664, 9643570, 12834970, 1186149, -2622916, -1342231, 26128231, 6032912), + array(-26337395, -13766162, 32496025, -13653919, 17847801, -12669156, 3604025, 8316894, -25875034, -10437358), + array(3296484, 6223048, 24680646, -12246460, -23052020, 5903205, -8862297, -4639164, 12376617, 3188849), + ), + array( + array(29190488, -14659046, 27549113, -1183516, 3520066, -10697301, 32049515, -7309113, -16109234, -9852307), + array(-14744486, -9309156, 735818, -598978, -20407687, -5057904, 25246078, -15795669, 18640741, -960977), + array(-6928835, -16430795, 10361374, 5642961, 4910474, 12345252, -31638386, -494430, 10530747, 1053335), + ), + array( + array(-29265967, -14186805, -13538216, -12117373, -19457059, -10655384, -31462369, -2948985, 24018831, 15026644), + array(-22592535, -3145277, -2289276, 5953843, -13440189, 9425631, 25310643, 13003497, -2314791, -15145616), + array(-27419985, -603321, -8043984, -1669117, -26092265, 13987819, -27297622, 187899, -23166419, -2531735), + ), + array( + array(-21744398, -13810475, 1844840, 5021428, -10434399, -15911473, 9716667, 16266922, -5070217, 726099), + array(29370922, -6053998, 7334071, -15342259, 9385287, 2247707, -13661962, -4839461, 30007388, -15823341), + array(-936379, 16086691, 23751945, -543318, -1167538, -5189036, 9137109, 730663, 9835848, 4555336), + ), + array( + array(-23376435, 1410446, -22253753, -12899614, 30867635, 15826977, 17693930, 544696, -11985298, 12422646), + array(31117226, -12215734, -13502838, 6561947, -9876867, -12757670, -5118685, -4096706, 29120153, 13924425), + array(-17400879, -14233209, 19675799, -2734756, -11006962, -5858820, -9383939, -11317700, 7240931, -237388), + ), + array( + array(-31361739, -11346780, -15007447, -5856218, -22453340, -12152771, 1222336, 4389483, 3293637, -15551743), + array(-16684801, -14444245, 11038544, 11054958, -13801175, -3338533, -24319580, 7733547, 12796905, -6335822), + array(-8759414, -10817836, -25418864, 10783769, -30615557, -9746811, -28253339, 3647836, 3222231, -11160462), + ), + array( + array(18606113, 1693100, -25448386, -15170272, 4112353, 10045021, 23603893, -2048234, -7550776, 2484985), + array(9255317, -3131197, -12156162, -1004256, 13098013, -9214866, 16377220, -2102812, -19802075, -3034702), + array(-22729289, 7496160, -5742199, 11329249, 19991973, -3347502, -31718148, 9936966, -30097688, -10618797), + ), + array( + array(21878590, -5001297, 4338336, 13643897, -3036865, 13160960, 19708896, 5415497, -7360503, -4109293), + array(27736861, 10103576, 12500508, 8502413, -3413016, -9633558, 10436918, -1550276, -23659143, -8132100), + array(19492550, -12104365, -29681976, -852630, -3208171, 12403437, 30066266, 8367329, 13243957, 8709688), + ), + ), + array( + array( + array(12015105, 2801261, 28198131, 10151021, 24818120, -4743133, -11194191, -5645734, 5150968, 7274186), + array(2831366, -12492146, 1478975, 6122054, 23825128, -12733586, 31097299, 6083058, 31021603, -9793610), + array(-2529932, -2229646, 445613, 10720828, -13849527, -11505937, -23507731, 16354465, 15067285, -14147707), + ), + array( + array(7840942, 14037873, -33364863, 15934016, -728213, -3642706, 21403988, 1057586, -19379462, -12403220), + array(915865, -16469274, 15608285, -8789130, -24357026, 6060030, -17371319, 8410997, -7220461, 16527025), + array(32922597, -556987, 20336074, -16184568, 10903705, -5384487, 16957574, 52992, 23834301, 6588044), + ), + array( + array(32752030, 11232950, 3381995, -8714866, 22652988, -10744103, 17159699, 16689107, -20314580, -1305992), + array(-4689649, 9166776, -25710296, -10847306, 11576752, 12733943, 7924251, -2752281, 1976123, -7249027), + array(21251222, 16309901, -2983015, -6783122, 30810597, 12967303, 156041, -3371252, 12331345, -8237197), + ), + array( + array(8651614, -4477032, -16085636, -4996994, 13002507, 2950805, 29054427, -5106970, 10008136, -4667901), + array(31486080, 15114593, -14261250, 12951354, 14369431, -7387845, 16347321, -13662089, 8684155, -10532952), + array(19443825, 11385320, 24468943, -9659068, -23919258, 2187569, -26263207, -6086921, 31316348, 14219878), + ), + array( + array(-28594490, 1193785, 32245219, 11392485, 31092169, 15722801, 27146014, 6992409, 29126555, 9207390), + array(32382935, 1110093, 18477781, 11028262, -27411763, -7548111, -4980517, 10843782, -7957600, -14435730), + array(2814918, 7836403, 27519878, -7868156, -20894015, -11553689, -21494559, 8550130, 28346258, 1994730), + ), + array( + array(-19578299, 8085545, -14000519, -3948622, 2785838, -16231307, -19516951, 7174894, 22628102, 8115180), + array(-30405132, 955511, -11133838, -15078069, -32447087, -13278079, -25651578, 3317160, -9943017, 930272), + array(-15303681, -6833769, 28856490, 1357446, 23421993, 1057177, 24091212, -1388970, -22765376, -10650715), + ), + array( + array(-22751231, -5303997, -12907607, -12768866, -15811511, -7797053, -14839018, -16554220, -1867018, 8398970), + array(-31969310, 2106403, -4736360, 1362501, 12813763, 16200670, 22981545, -6291273, 18009408, -15772772), + array(-17220923, -9545221, -27784654, 14166835, 29815394, 7444469, 29551787, -3727419, 19288549, 1325865), + ), + array( + array(15100157, -15835752, -23923978, -1005098, -26450192, 15509408, 12376730, -3479146, 33166107, -8042750), + array(20909231, 13023121, -9209752, 16251778, -5778415, -8094914, 12412151, 10018715, 2213263, -13878373), + array(32529814, -11074689, 30361439, -16689753, -9135940, 1513226, 22922121, 6382134, -5766928, 8371348), + ), + ), + array( + array( + array(9923462, 11271500, 12616794, 3544722, -29998368, -1721626, 12891687, -8193132, -26442943, 10486144), + array(-22597207, -7012665, 8587003, -8257861, 4084309, -12970062, 361726, 2610596, -23921530, -11455195), + array(5408411, -1136691, -4969122, 10561668, 24145918, 14240566, 31319731, -4235541, 19985175, -3436086), + ), + array( + array(-13994457, 16616821, 14549246, 3341099, 32155958, 13648976, -17577068, 8849297, 65030, 8370684), + array(-8320926, -12049626, 31204563, 5839400, -20627288, -1057277, -19442942, 6922164, 12743482, -9800518), + array(-2361371, 12678785, 28815050, 4759974, -23893047, 4884717, 23783145, 11038569, 18800704, 255233), + ), + array( + array(-5269658, -1773886, 13957886, 7990715, 23132995, 728773, 13393847, 9066957, 19258688, -14753793), + array(-2936654, -10827535, -10432089, 14516793, -3640786, 4372541, -31934921, 2209390, -1524053, 2055794), + array(580882, 16705327, 5468415, -2683018, -30926419, -14696000, -7203346, -8994389, -30021019, 7394435), + ), + array( + array(23838809, 1822728, -15738443, 15242727, 8318092, -3733104, -21672180, -3492205, -4821741, 14799921), + array(13345610, 9759151, 3371034, -16137791, 16353039, 8577942, 31129804, 13496856, -9056018, 7402518), + array(2286874, -4435931, -20042458, -2008336, -13696227, 5038122, 11006906, -15760352, 8205061, 1607563), + ), + array( + array(14414086, -8002132, 3331830, -3208217, 22249151, -5594188, 18364661, -2906958, 30019587, -9029278), + array(-27688051, 1585953, -10775053, 931069, -29120221, -11002319, -14410829, 12029093, 9944378, 8024), + array(4368715, -3709630, 29874200, -15022983, -20230386, -11410704, -16114594, -999085, -8142388, 5640030), + ), + array( + array(10299610, 13746483, 11661824, 16234854, 7630238, 5998374, 9809887, -16694564, 15219798, -14327783), + array(27425505, -5719081, 3055006, 10660664, 23458024, 595578, -15398605, -1173195, -18342183, 9742717), + array(6744077, 2427284, 26042789, 2720740, -847906, 1118974, 32324614, 7406442, 12420155, 1994844), + ), + array( + array(14012521, -5024720, -18384453, -9578469, -26485342, -3936439, -13033478, -10909803, 24319929, -6446333), + array(16412690, -4507367, 10772641, 15929391, -17068788, -4658621, 10555945, -10484049, -30102368, -4739048), + array(22397382, -7767684, -9293161, -12792868, 17166287, -9755136, -27333065, 6199366, 21880021, -12250760), + ), + array( + array(-4283307, 5368523, -31117018, 8163389, -30323063, 3209128, 16557151, 8890729, 8840445, 4957760), + array(-15447727, 709327, -6919446, -10870178, -29777922, 6522332, -21720181, 12130072, -14796503, 5005757), + array(-2114751, -14308128, 23019042, 15765735, -25269683, 6002752, 10183197, -13239326, -16395286, -2176112), + ), + ), + array( + array( + array(-19025756, 1632005, 13466291, -7995100, -23640451, 16573537, -32013908, -3057104, 22208662, 2000468), + array(3065073, -1412761, -25598674, -361432, -17683065, -5703415, -8164212, 11248527, -3691214, -7414184), + array(10379208, -6045554, 8877319, 1473647, -29291284, -12507580, 16690915, 2553332, -3132688, 16400289), + ), + array( + array(15716668, 1254266, -18472690, 7446274, -8448918, 6344164, -22097271, -7285580, 26894937, 9132066), + array(24158887, 12938817, 11085297, -8177598, -28063478, -4457083, -30576463, 64452, -6817084, -2692882), + array(13488534, 7794716, 22236231, 5989356, 25426474, -12578208, 2350710, -3418511, -4688006, 2364226), + ), + array( + array(16335052, 9132434, 25640582, 6678888, 1725628, 8517937, -11807024, -11697457, 15445875, -7798101), + array(29004207, -7867081, 28661402, -640412, -12794003, -7943086, 31863255, -4135540, -278050, -15759279), + array(-6122061, -14866665, -28614905, 14569919, -10857999, -3591829, 10343412, -6976290, -29828287, -10815811), + ), + array( + array(27081650, 3463984, 14099042, -4517604, 1616303, -6205604, 29542636, 15372179, 17293797, 960709), + array(20263915, 11434237, -5765435, 11236810, 13505955, -10857102, -16111345, 6493122, -19384511, 7639714), + array(-2830798, -14839232, 25403038, -8215196, -8317012, -16173699, 18006287, -16043750, 29994677, -15808121), + ), + array( + array(9769828, 5202651, -24157398, -13631392, -28051003, -11561624, -24613141, -13860782, -31184575, 709464), + array(12286395, 13076066, -21775189, -1176622, -25003198, 4057652, -32018128, -8890874, 16102007, 13205847), + array(13733362, 5599946, 10557076, 3195751, -5557991, 8536970, -25540170, 8525972, 10151379, 10394400), + ), + array( + array(4024660, -16137551, 22436262, 12276534, -9099015, -2686099, 19698229, 11743039, -33302334, 8934414), + array(-15879800, -4525240, -8580747, -2934061, 14634845, -698278, -9449077, 3137094, -11536886, 11721158), + array(17555939, -5013938, 8268606, 2331751, -22738815, 9761013, 9319229, 8835153, -9205489, -1280045), + ), + array( + array(-461409, -7830014, 20614118, 16688288, -7514766, -4807119, 22300304, 505429, 6108462, -6183415), + array(-5070281, 12367917, -30663534, 3234473, 32617080, -8422642, 29880583, -13483331, -26898490, -7867459), + array(-31975283, 5726539, 26934134, 10237677, -3173717, -605053, 24199304, 3795095, 7592688, -14992079), + ), + array( + array(21594432, -14964228, 17466408, -4077222, 32537084, 2739898, 6407723, 12018833, -28256052, 4298412), + array(-20650503, -11961496, -27236275, 570498, 3767144, -1717540, 13891942, -1569194, 13717174, 10805743), + array(-14676630, -15644296, 15287174, 11927123, 24177847, -8175568, -796431, 14860609, -26938930, -5863836), + ), + ), + array( + array( + array(12962541, 5311799, -10060768, 11658280, 18855286, -7954201, 13286263, -12808704, -4381056, 9882022), + array(18512079, 11319350, -20123124, 15090309, 18818594, 5271736, -22727904, 3666879, -23967430, -3299429), + array(-6789020, -3146043, 16192429, 13241070, 15898607, -14206114, -10084880, -6661110, -2403099, 5276065), + ), + array( + array(30169808, -5317648, 26306206, -11750859, 27814964, 7069267, 7152851, 3684982, 1449224, 13082861), + array(10342826, 3098505, 2119311, 193222, 25702612, 12233820, 23697382, 15056736, -21016438, -8202000), + array(-33150110, 3261608, 22745853, 7948688, 19370557, -15177665, -26171976, 6482814, -10300080, -11060101), + ), + array( + array(32869458, -5408545, 25609743, 15678670, -10687769, -15471071, 26112421, 2521008, -22664288, 6904815), + array(29506923, 4457497, 3377935, -9796444, -30510046, 12935080, 1561737, 3841096, -29003639, -6657642), + array(10340844, -6630377, -18656632, -2278430, 12621151, -13339055, 30878497, -11824370, -25584551, 5181966), + ), + array( + array(25940115, -12658025, 17324188, -10307374, -8671468, 15029094, 24396252, -16450922, -2322852, -12388574), + array(-21765684, 9916823, -1300409, 4079498, -1028346, 11909559, 1782390, 12641087, 20603771, -6561742), + array(-18882287, -11673380, 24849422, 11501709, 13161720, -4768874, 1925523, 11914390, 4662781, 7820689), + ), + array( + array(12241050, -425982, 8132691, 9393934, 32846760, -1599620, 29749456, 12172924, 16136752, 15264020), + array(-10349955, -14680563, -8211979, 2330220, -17662549, -14545780, 10658213, 6671822, 19012087, 3772772), + array(3753511, -3421066, 10617074, 2028709, 14841030, -6721664, 28718732, -15762884, 20527771, 12988982), + ), + array( + array(-14822485, -5797269, -3707987, 12689773, -898983, -10914866, -24183046, -10564943, 3299665, -12424953), + array(-16777703, -15253301, -9642417, 4978983, 3308785, 8755439, 6943197, 6461331, -25583147, 8991218), + array(-17226263, 1816362, -1673288, -6086439, 31783888, -8175991, -32948145, 7417950, -30242287, 1507265), + ), + array( + array(29692663, 6829891, -10498800, 4334896, 20945975, -11906496, -28887608, 8209391, 14606362, -10647073), + array(-3481570, 8707081, 32188102, 5672294, 22096700, 1711240, -33020695, 9761487, 4170404, -2085325), + array(-11587470, 14855945, -4127778, -1531857, -26649089, 15084046, 22186522, 16002000, -14276837, -8400798), + ), + array( + array(-4811456, 13761029, -31703877, -2483919, -3312471, 7869047, -7113572, -9620092, 13240845, 10965870), + array(-7742563, -8256762, -14768334, -13656260, -23232383, 12387166, 4498947, 14147411, 29514390, 4302863), + array(-13413405, -12407859, 20757302, -13801832, 14785143, 8976368, -5061276, -2144373, 17846988, -13971927), + ), + ), + array( + array( + array(-2244452, -754728, -4597030, -1066309, -6247172, 1455299, -21647728, -9214789, -5222701, 12650267), + array(-9906797, -16070310, 21134160, 12198166, -27064575, 708126, 387813, 13770293, -19134326, 10958663), + array(22470984, 12369526, 23446014, -5441109, -21520802, -9698723, -11772496, -11574455, -25083830, 4271862), + ), + array( + array(-25169565, -10053642, -19909332, 15361595, -5984358, 2159192, 75375, -4278529, -32526221, 8469673), + array(15854970, 4148314, -8893890, 7259002, 11666551, 13824734, -30531198, 2697372, 24154791, -9460943), + array(15446137, -15806644, 29759747, 14019369, 30811221, -9610191, -31582008, 12840104, 24913809, 9815020), + ), + array( + array(-4709286, -5614269, -31841498, -12288893, -14443537, 10799414, -9103676, 13438769, 18735128, 9466238), + array(11933045, 9281483, 5081055, -5183824, -2628162, -4905629, -7727821, -10896103, -22728655, 16199064), + array(14576810, 379472, -26786533, -8317236, -29426508, -10812974, -102766, 1876699, 30801119, 2164795), + ), + array( + array(15995086, 3199873, 13672555, 13712240, -19378835, -4647646, -13081610, -15496269, -13492807, 1268052), + array(-10290614, -3659039, -3286592, 10948818, 23037027, 3794475, -3470338, -12600221, -17055369, 3565904), + array(29210088, -9419337, -5919792, -4952785, 10834811, -13327726, -16512102, -10820713, -27162222, -14030531), + ), + array( + array(-13161890, 15508588, 16663704, -8156150, -28349942, 9019123, -29183421, -3769423, 2244111, -14001979), + array(-5152875, -3800936, -9306475, -6071583, 16243069, 14684434, -25673088, -16180800, 13491506, 4641841), + array(10813417, 643330, -19188515, -728916, 30292062, -16600078, 27548447, -7721242, 14476989, -12767431), + ), + array( + array(10292079, 9984945, 6481436, 8279905, -7251514, 7032743, 27282937, -1644259, -27912810, 12651324), + array(-31185513, -813383, 22271204, 11835308, 10201545, 15351028, 17099662, 3988035, 21721536, -3148940), + array(10202177, -6545839, -31373232, -9574638, -32150642, -8119683, -12906320, 3852694, 13216206, 14842320), + ), + array( + array(-15815640, -10601066, -6538952, -7258995, -6984659, -6581778, -31500847, 13765824, -27434397, 9900184), + array(14465505, -13833331, -32133984, -14738873, -27443187, 12990492, 33046193, 15796406, -7051866, -8040114), + array(30924417, -8279620, 6359016, -12816335, 16508377, 9071735, -25488601, 15413635, 9524356, -7018878), + ), + array( + array(12274201, -13175547, 32627641, -1785326, 6736625, 13267305, 5237659, -5109483, 15663516, 4035784), + array(-2951309, 8903985, 17349946, 601635, -16432815, -4612556, -13732739, -15889334, -22258478, 4659091), + array(-16916263, -4952973, -30393711, -15158821, 20774812, 15897498, 5736189, 15026997, -2178256, -13455585), + ), + ), + array( + array( + array(-8858980, -2219056, 28571666, -10155518, -474467, -10105698, -3801496, 278095, 23440562, -290208), + array(10226241, -5928702, 15139956, 120818, -14867693, 5218603, 32937275, 11551483, -16571960, -7442864), + array(17932739, -12437276, -24039557, 10749060, 11316803, 7535897, 22503767, 5561594, -3646624, 3898661), + ), + array( + array(7749907, -969567, -16339731, -16464, -25018111, 15122143, -1573531, 7152530, 21831162, 1245233), + array(26958459, -14658026, 4314586, 8346991, -5677764, 11960072, -32589295, -620035, -30402091, -16716212), + array(-12165896, 9166947, 33491384, 13673479, 29787085, 13096535, 6280834, 14587357, -22338025, 13987525), + ), + array( + array(-24349909, 7778775, 21116000, 15572597, -4833266, -5357778, -4300898, -5124639, -7469781, -2858068), + array(9681908, -6737123, -31951644, 13591838, -6883821, 386950, 31622781, 6439245, -14581012, 4091397), + array(-8426427, 1470727, -28109679, -1596990, 3978627, -5123623, -19622683, 12092163, 29077877, -14741988), + ), + array( + array(5269168, -6859726, -13230211, -8020715, 25932563, 1763552, -5606110, -5505881, -20017847, 2357889), + array(32264008, -15407652, -5387735, -1160093, -2091322, -3946900, 23104804, -12869908, 5727338, 189038), + array(14609123, -8954470, -6000566, -16622781, -14577387, -7743898, -26745169, 10942115, -25888931, -14884697), + ), + array( + array(20513500, 5557931, -15604613, 7829531, 26413943, -2019404, -21378968, 7471781, 13913677, -5137875), + array(-25574376, 11967826, 29233242, 12948236, -6754465, 4713227, -8940970, 14059180, 12878652, 8511905), + array(-25656801, 3393631, -2955415, -7075526, -2250709, 9366908, -30223418, 6812974, 5568676, -3127656), + ), + array( + array(11630004, 12144454, 2116339, 13606037, 27378885, 15676917, -17408753, -13504373, -14395196, 8070818), + array(27117696, -10007378, -31282771, -5570088, 1127282, 12772488, -29845906, 10483306, -11552749, -1028714), + array(10637467, -5688064, 5674781, 1072708, -26343588, -6982302, -1683975, 9177853, -27493162, 15431203), + ), + array( + array(20525145, 10892566, -12742472, 12779443, -29493034, 16150075, -28240519, 14943142, -15056790, -7935931), + array(-30024462, 5626926, -551567, -9981087, 753598, 11981191, 25244767, -3239766, -3356550, 9594024), + array(-23752644, 2636870, -5163910, -10103818, 585134, 7877383, 11345683, -6492290, 13352335, -10977084), + ), + array( + array(-1931799, -5407458, 3304649, -12884869, 17015806, -4877091, -29783850, -7752482, -13215537, -319204), + array(20239939, 6607058, 6203985, 3483793, -18386976, -779229, -20723742, 15077870, -22750759, 14523817), + array(27406042, -6041657, 27423596, -4497394, 4996214, 10002360, -28842031, -4545494, -30172742, -4805667), + ), + ), + array( + array( + array(11374242, 12660715, 17861383, -12540833, 10935568, 1099227, -13886076, -9091740, -27727044, 11358504), + array(-12730809, 10311867, 1510375, 10778093, -2119455, -9145702, 32676003, 11149336, -26123651, 4985768), + array(-19096303, 341147, -6197485, -239033, 15756973, -8796662, -983043, 13794114, -19414307, -15621255), + ), + array( + array(6490081, 11940286, 25495923, -7726360, 8668373, -8751316, 3367603, 6970005, -1691065, -9004790), + array(1656497, 13457317, 15370807, 6364910, 13605745, 8362338, -19174622, -5475723, -16796596, -5031438), + array(-22273315, -13524424, -64685, -4334223, -18605636, -10921968, -20571065, -7007978, -99853, -10237333), + ), + array( + array(17747465, 10039260, 19368299, -4050591, -20630635, -16041286, 31992683, -15857976, -29260363, -5511971), + array(31932027, -4986141, -19612382, 16366580, 22023614, 88450, 11371999, -3744247, 4882242, -10626905), + array(29796507, 37186, 19818052, 10115756, -11829032, 3352736, 18551198, 3272828, -5190932, -4162409), + ), + array( + array(12501286, 4044383, -8612957, -13392385, -32430052, 5136599, -19230378, -3529697, 330070, -3659409), + array(6384877, 2899513, 17807477, 7663917, -2358888, 12363165, 25366522, -8573892, -271295, 12071499), + array(-8365515, -4042521, 25133448, -4517355, -6211027, 2265927, -32769618, 1936675, -5159697, 3829363), + ), + array( + array(28425966, -5835433, -577090, -4697198, -14217555, 6870930, 7921550, -6567787, 26333140, 14267664), + array(-11067219, 11871231, 27385719, -10559544, -4585914, -11189312, 10004786, -8709488, -21761224, 8930324), + array(-21197785, -16396035, 25654216, -1725397, 12282012, 11008919, 1541940, 4757911, -26491501, -16408940), + ), + array( + array(13537262, -7759490, -20604840, 10961927, -5922820, -13218065, -13156584, 6217254, -15943699, 13814990), + array(-17422573, 15157790, 18705543, 29619, 24409717, -260476, 27361681, 9257833, -1956526, -1776914), + array(-25045300, -10191966, 15366585, 15166509, -13105086, 8423556, -29171540, 12361135, -18685978, 4578290), + ), + array( + array(24579768, 3711570, 1342322, -11180126, -27005135, 14124956, -22544529, 14074919, 21964432, 8235257), + array(-6528613, -2411497, 9442966, -5925588, 12025640, -1487420, -2981514, -1669206, 13006806, 2355433), + array(-16304899, -13605259, -6632427, -5142349, 16974359, -10911083, 27202044, 1719366, 1141648, -12796236), + ), + array( + array(-12863944, -13219986, -8318266, -11018091, -6810145, -4843894, 13475066, -3133972, 32674895, 13715045), + array(11423335, -5468059, 32344216, 8962751, 24989809, 9241752, -13265253, 16086212, -28740881, -15642093), + array(-1409668, 12530728, -6368726, 10847387, 19531186, -14132160, -11709148, 7791794, -27245943, 4383347), + ), + ), + array( + array( + array(-28970898, 5271447, -1266009, -9736989, -12455236, 16732599, -4862407, -4906449, 27193557, 6245191), + array(-15193956, 5362278, -1783893, 2695834, 4960227, 12840725, 23061898, 3260492, 22510453, 8577507), + array(-12632451, 11257346, -32692994, 13548177, -721004, 10879011, 31168030, 13952092, -29571492, -3635906), + ), + array( + array(3877321, -9572739, 32416692, 5405324, -11004407, -13656635, 3759769, 11935320, 5611860, 8164018), + array(-16275802, 14667797, 15906460, 12155291, -22111149, -9039718, 32003002, -8832289, 5773085, -8422109), + array(-23788118, -8254300, 1950875, 8937633, 18686727, 16459170, -905725, 12376320, 31632953, 190926), + ), + array( + array(-24593607, -16138885, -8423991, 13378746, 14162407, 6901328, -8288749, 4508564, -25341555, -3627528), + array(8884438, -5884009, 6023974, 10104341, -6881569, -4941533, 18722941, -14786005, -1672488, 827625), + array(-32720583, -16289296, -32503547, 7101210, 13354605, 2659080, -1800575, -14108036, -24878478, 1541286), + ), + array( + array(2901347, -1117687, 3880376, -10059388, -17620940, -3612781, -21802117, -3567481, 20456845, -1885033), + array(27019610, 12299467, -13658288, -1603234, -12861660, -4861471, -19540150, -5016058, 29439641, 15138866), + array(21536104, -6626420, -32447818, -10690208, -22408077, 5175814, -5420040, -16361163, 7779328, 109896), + ), + array( + array(30279744, 14648750, -8044871, 6425558, 13639621, -743509, 28698390, 12180118, 23177719, -554075), + array(26572847, 3405927, -31701700, 12890905, -19265668, 5335866, -6493768, 2378492, 4439158, -13279347), + array(-22716706, 3489070, -9225266, -332753, 18875722, -1140095, 14819434, -12731527, -17717757, -5461437), + ), + array( + array(-5056483, 16566551, 15953661, 3767752, -10436499, 15627060, -820954, 2177225, 8550082, -15114165), + array(-18473302, 16596775, -381660, 15663611, 22860960, 15585581, -27844109, -3582739, -23260460, -8428588), + array(-32480551, 15707275, -8205912, -5652081, 29464558, 2713815, -22725137, 15860482, -21902570, 1494193), + ), + array( + array(-19562091, -14087393, -25583872, -9299552, 13127842, 759709, 21923482, 16529112, 8742704, 12967017), + array(-28464899, 1553205, 32536856, -10473729, -24691605, -406174, -8914625, -2933896, -29903758, 15553883), + array(21877909, 3230008, 9881174, 10539357, -4797115, 2841332, 11543572, 14513274, 19375923, -12647961), + ), + array( + array(8832269, -14495485, 13253511, 5137575, 5037871, 4078777, 24880818, -6222716, 2862653, 9455043), + array(29306751, 5123106, 20245049, -14149889, 9592566, 8447059, -2077124, -2990080, 15511449, 4789663), + array(-20679756, 7004547, 8824831, -9434977, -4045704, -3750736, -5754762, 108893, 23513200, 16652362), + ), + ), + array( + array( + array(-33256173, 4144782, -4476029, -6579123, 10770039, -7155542, -6650416, -12936300, -18319198, 10212860), + array(2756081, 8598110, 7383731, -6859892, 22312759, -1105012, 21179801, 2600940, -9988298, -12506466), + array(-24645692, 13317462, -30449259, -15653928, 21365574, -10869657, 11344424, 864440, -2499677, -16710063), + ), + array( + array(-26432803, 6148329, -17184412, -14474154, 18782929, -275997, -22561534, 211300, 2719757, 4940997), + array(-1323882, 3911313, -6948744, 14759765, -30027150, 7851207, 21690126, 8518463, 26699843, 5276295), + array(-13149873, -6429067, 9396249, 365013, 24703301, -10488939, 1321586, 149635, -15452774, 7159369), + ), + array( + array(9987780, -3404759, 17507962, 9505530, 9731535, -2165514, 22356009, 8312176, 22477218, -8403385), + array(18155857, -16504990, 19744716, 9006923, 15154154, -10538976, 24256460, -4864995, -22548173, 9334109), + array(2986088, -4911893, 10776628, -3473844, 10620590, -7083203, -21413845, 14253545, -22587149, 536906), + ), + array( + array(4377756, 8115836, 24567078, 15495314, 11625074, 13064599, 7390551, 10589625, 10838060, -15420424), + array(-19342404, 867880, 9277171, -3218459, -14431572, -1986443, 19295826, -15796950, 6378260, 699185), + array(7895026, 4057113, -7081772, -13077756, -17886831, -323126, -716039, 15693155, -5045064, -13373962), + ), + array( + array(-7737563, -5869402, -14566319, -7406919, 11385654, 13201616, 31730678, -10962840, -3918636, -9669325), + array(10188286, -15770834, -7336361, 13427543, 22223443, 14896287, 30743455, 7116568, -21786507, 5427593), + array(696102, 13206899, 27047647, -10632082, 15285305, -9853179, 10798490, -4578720, 19236243, 12477404), + ), + array( + array(-11229439, 11243796, -17054270, -8040865, -788228, -8167967, -3897669, 11180504, -23169516, 7733644), + array(17800790, -14036179, -27000429, -11766671, 23887827, 3149671, 23466177, -10538171, 10322027, 15313801), + array(26246234, 11968874, 32263343, -5468728, 6830755, -13323031, -15794704, -101982, -24449242, 10890804), + ), + array( + array(-31365647, 10271363, -12660625, -6267268, 16690207, -13062544, -14982212, 16484931, 25180797, -5334884), + array(-586574, 10376444, -32586414, -11286356, 19801893, 10997610, 2276632, 9482883, 316878, 13820577), + array(-9882808, -4510367, -2115506, 16457136, -11100081, 11674996, 30756178, -7515054, 30696930, -3712849), + ), + array( + array(32988917, -9603412, 12499366, 7910787, -10617257, -11931514, -7342816, -9985397, -32349517, 7392473), + array(-8855661, 15927861, 9866406, -3649411, -2396914, -16655781, -30409476, -9134995, 25112947, -2926644), + array(-2504044, -436966, 25621774, -5678772, 15085042, -5479877, -24884878, -13526194, 5537438, -13914319), + ), + ), + array( + array( + array(-11225584, 2320285, -9584280, 10149187, -33444663, 5808648, -14876251, -1729667, 31234590, 6090599), + array(-9633316, 116426, 26083934, 2897444, -6364437, -2688086, 609721, 15878753, -6970405, -9034768), + array(-27757857, 247744, -15194774, -9002551, 23288161, -10011936, -23869595, 6503646, 20650474, 1804084), + ), + array( + array(-27589786, 15456424, 8972517, 8469608, 15640622, 4439847, 3121995, -10329713, 27842616, -202328), + array(-15306973, 2839644, 22530074, 10026331, 4602058, 5048462, 28248656, 5031932, -11375082, 12714369), + array(20807691, -7270825, 29286141, 11421711, -27876523, -13868230, -21227475, 1035546, -19733229, 12796920), + ), + array( + array(12076899, -14301286, -8785001, -11848922, -25012791, 16400684, -17591495, -12899438, 3480665, -15182815), + array(-32361549, 5457597, 28548107, 7833186, 7303070, -11953545, -24363064, -15921875, -33374054, 2771025), + array(-21389266, 421932, 26597266, 6860826, 22486084, -6737172, -17137485, -4210226, -24552282, 15673397), + ), + array( + array(-20184622, 2338216, 19788685, -9620956, -4001265, -8740893, -20271184, 4733254, 3727144, -12934448), + array(6120119, 814863, -11794402, -622716, 6812205, -15747771, 2019594, 7975683, 31123697, -10958981), + array(30069250, -11435332, 30434654, 2958439, 18399564, -976289, 12296869, 9204260, -16432438, 9648165), + ), + array( + array(32705432, -1550977, 30705658, 7451065, -11805606, 9631813, 3305266, 5248604, -26008332, -11377501), + array(17219865, 2375039, -31570947, -5575615, -19459679, 9219903, 294711, 15298639, 2662509, -16297073), + array(-1172927, -7558695, -4366770, -4287744, -21346413, -8434326, 32087529, -1222777, 32247248, -14389861), + ), + array( + array(14312628, 1221556, 17395390, -8700143, -4945741, -8684635, -28197744, -9637817, -16027623, -13378845), + array(-1428825, -9678990, -9235681, 6549687, -7383069, -468664, 23046502, 9803137, 17597934, 2346211), + array(18510800, 15337574, 26171504, 981392, -22241552, 7827556, -23491134, -11323352, 3059833, -11782870), + ), + array( + array(10141598, 6082907, 17829293, -1947643, 9830092, 13613136, -25556636, -5544586, -33502212, 3592096), + array(33114168, -15889352, -26525686, -13343397, 33076705, 8716171, 1151462, 1521897, -982665, -6837803), + array(-32939165, -4255815, 23947181, -324178, -33072974, -12305637, -16637686, 3891704, 26353178, 693168), + ), + array( + array(30374239, 1595580, -16884039, 13186931, 4600344, 406904, 9585294, -400668, 31375464, 14369965), + array(-14370654, -7772529, 1510301, 6434173, -18784789, -6262728, 32732230, -13108839, 17901441, 16011505), + array(18171223, -11934626, -12500402, 15197122, -11038147, -15230035, -19172240, -16046376, 8764035, 12309598), + ), + ), + array( + array( + array(5975908, -5243188, -19459362, -9681747, -11541277, 14015782, -23665757, 1228319, 17544096, -10593782), + array(5811932, -1715293, 3442887, -2269310, -18367348, -8359541, -18044043, -15410127, -5565381, 12348900), + array(-31399660, 11407555, 25755363, 6891399, -3256938, 14872274, -24849353, 8141295, -10632534, -585479), + ), + array( + array(-12675304, 694026, -5076145, 13300344, 14015258, -14451394, -9698672, -11329050, 30944593, 1130208), + array(8247766, -6710942, -26562381, -7709309, -14401939, -14648910, 4652152, 2488540, 23550156, -271232), + array(17294316, -3788438, 7026748, 15626851, 22990044, 113481, 2267737, -5908146, -408818, -137719), + ), + array( + array(16091085, -16253926, 18599252, 7340678, 2137637, -1221657, -3364161, 14550936, 3260525, -7166271), + array(-4910104, -13332887, 18550887, 10864893, -16459325, -7291596, -23028869, -13204905, -12748722, 2701326), + array(-8574695, 16099415, 4629974, -16340524, -20786213, -6005432, -10018363, 9276971, 11329923, 1862132), + ), + array( + array(14763076, -15903608, -30918270, 3689867, 3511892, 10313526, -21951088, 12219231, -9037963, -940300), + array(8894987, -3446094, 6150753, 3013931, 301220, 15693451, -31981216, -2909717, -15438168, 11595570), + array(15214962, 3537601, -26238722, -14058872, 4418657, -15230761, 13947276, 10730794, -13489462, -4363670), + ), + array( + array(-2538306, 7682793, 32759013, 263109, -29984731, -7955452, -22332124, -10188635, 977108, 699994), + array(-12466472, 4195084, -9211532, 550904, -15565337, 12917920, 19118110, -439841, -30534533, -14337913), + array(31788461, -14507657, 4799989, 7372237, 8808585, -14747943, 9408237, -10051775, 12493932, -5409317), + ), + array( + array(-25680606, 5260744, -19235809, -6284470, -3695942, 16566087, 27218280, 2607121, 29375955, 6024730), + array(842132, -2794693, -4763381, -8722815, 26332018, -12405641, 11831880, 6985184, -9940361, 2854096), + array(-4847262, -7969331, 2516242, -5847713, 9695691, -7221186, 16512645, 960770, 12121869, 16648078), + ), + array( + array(-15218652, 14667096, -13336229, 2013717, 30598287, -464137, -31504922, -7882064, 20237806, 2838411), + array(-19288047, 4453152, 15298546, -16178388, 22115043, -15972604, 12544294, -13470457, 1068881, -12499905), + array(-9558883, -16518835, 33238498, 13506958, 30505848, -1114596, -8486907, -2630053, 12521378, 4845654), + ), + array( + array(-28198521, 10744108, -2958380, 10199664, 7759311, -13088600, 3409348, -873400, -6482306, -12885870), + array(-23561822, 6230156, -20382013, 10655314, -24040585, -11621172, 10477734, -1240216, -3113227, 13974498), + array(12966261, 15550616, -32038948, -1615346, 21025980, -629444, 5642325, 7188737, 18895762, 12629579), + ), + ), + array( + array( + array(14741879, -14946887, 22177208, -11721237, 1279741, 8058600, 11758140, 789443, 32195181, 3895677), + array(10758205, 15755439, -4509950, 9243698, -4879422, 6879879, -2204575, -3566119, -8982069, 4429647), + array(-2453894, 15725973, -20436342, -10410672, -5803908, -11040220, -7135870, -11642895, 18047436, -15281743), + ), + array( + array(-25173001, -11307165, 29759956, 11776784, -22262383, -15820455, 10993114, -12850837, -17620701, -9408468), + array(21987233, 700364, -24505048, 14972008, -7774265, -5718395, 32155026, 2581431, -29958985, 8773375), + array(-25568350, 454463, -13211935, 16126715, 25240068, 8594567, 20656846, 12017935, -7874389, -13920155), + ), + array( + array(6028182, 6263078, -31011806, -11301710, -818919, 2461772, -31841174, -5468042, -1721788, -2776725), + array(-12278994, 16624277, 987579, -5922598, 32908203, 1248608, 7719845, -4166698, 28408820, 6816612), + array(-10358094, -8237829, 19549651, -12169222, 22082623, 16147817, 20613181, 13982702, -10339570, 5067943), + ), + array( + array(-30505967, -3821767, 12074681, 13582412, -19877972, 2443951, -19719286, 12746132, 5331210, -10105944), + array(30528811, 3601899, -1957090, 4619785, -27361822, -15436388, 24180793, -12570394, 27679908, -1648928), + array(9402404, -13957065, 32834043, 10838634, -26580150, -13237195, 26653274, -8685565, 22611444, -12715406), + ), + array( + array(22190590, 1118029, 22736441, 15130463, -30460692, -5991321, 19189625, -4648942, 4854859, 6622139), + array(-8310738, -2953450, -8262579, -3388049, -10401731, -271929, 13424426, -3567227, 26404409, 13001963), + array(-31241838, -15415700, -2994250, 8939346, 11562230, -12840670, -26064365, -11621720, -15405155, 11020693), + ), + array( + array(1866042, -7949489, -7898649, -10301010, 12483315, 13477547, 3175636, -12424163, 28761762, 1406734), + array(-448555, -1777666, 13018551, 3194501, -9580420, -11161737, 24760585, -4347088, 25577411, -13378680), + array(-24290378, 4759345, -690653, -1852816, 2066747, 10693769, -29595790, 9884936, -9368926, 4745410), + ), + array( + array(-9141284, 6049714, -19531061, -4341411, -31260798, 9944276, -15462008, -11311852, 10931924, -11931931), + array(-16561513, 14112680, -8012645, 4817318, -8040464, -11414606, -22853429, 10856641, -20470770, 13434654), + array(22759489, -10073434, -16766264, -1871422, 13637442, -10168091, 1765144, -12654326, 28445307, -5364710), + ), + array( + array(29875063, 12493613, 2795536, -3786330, 1710620, 15181182, -10195717, -8788675, 9074234, 1167180), + array(-26205683, 11014233, -9842651, -2635485, -26908120, 7532294, -18716888, -9535498, 3843903, 9367684), + array(-10969595, -6403711, 9591134, 9582310, 11349256, 108879, 16235123, 8601684, -139197, 4242895), + ), + ), + array( + array( + array(22092954, -13191123, -2042793, -11968512, 32186753, -11517388, -6574341, 2470660, -27417366, 16625501), + array(-11057722, 3042016, 13770083, -9257922, 584236, -544855, -7770857, 2602725, -27351616, 14247413), + array(6314175, -10264892, -32772502, 15957557, -10157730, 168750, -8618807, 14290061, 27108877, -1180880), + ), + array( + array(-8586597, -7170966, 13241782, 10960156, -32991015, -13794596, 33547976, -11058889, -27148451, 981874), + array(22833440, 9293594, -32649448, -13618667, -9136966, 14756819, -22928859, -13970780, -10479804, -16197962), + array(-7768587, 3326786, -28111797, 10783824, 19178761, 14905060, 22680049, 13906969, -15933690, 3797899), + ), + array( + array(21721356, -4212746, -12206123, 9310182, -3882239, -13653110, 23740224, -2709232, 20491983, -8042152), + array(9209270, -15135055, -13256557, -6167798, -731016, 15289673, 25947805, 15286587, 30997318, -6703063), + array(7392032, 16618386, 23946583, -8039892, -13265164, -1533858, -14197445, -2321576, 17649998, -250080), + ), + array( + array(-9301088, -14193827, 30609526, -3049543, -25175069, -1283752, -15241566, -9525724, -2233253, 7662146), + array(-17558673, 1763594, -33114336, 15908610, -30040870, -12174295, 7335080, -8472199, -3174674, 3440183), + array(-19889700, -5977008, -24111293, -9688870, 10799743, -16571957, 40450, -4431835, 4862400, 1133), + ), + array( + array(-32856209, -7873957, -5422389, 14860950, -16319031, 7956142, 7258061, 311861, -30594991, -7379421), + array(-3773428, -1565936, 28985340, 7499440, 24445838, 9325937, 29727763, 16527196, 18278453, 15405622), + array(-4381906, 8508652, -19898366, -3674424, -5984453, 15149970, -13313598, 843523, -21875062, 13626197), + ), + array( + array(2281448, -13487055, -10915418, -2609910, 1879358, 16164207, -10783882, 3953792, 13340839, 15928663), + array(31727126, -7179855, -18437503, -8283652, 2875793, -16390330, -25269894, -7014826, -23452306, 5964753), + array(4100420, -5959452, -17179337, 6017714, -18705837, 12227141, -26684835, 11344144, 2538215, -7570755), + ), + array( + array(-9433605, 6123113, 11159803, -2156608, 30016280, 14966241, -20474983, 1485421, -629256, -15958862), + array(-26804558, 4260919, 11851389, 9658551, -32017107, 16367492, -20205425, -13191288, 11659922, -11115118), + array(26180396, 10015009, -30844224, -8581293, 5418197, 9480663, 2231568, -10170080, 33100372, -1306171), + ), + array( + array(15121113, -5201871, -10389905, 15427821, -27509937, -15992507, 21670947, 4486675, -5931810, -14466380), + array(16166486, -9483733, -11104130, 6023908, -31926798, -1364923, 2340060, -16254968, -10735770, -10039824), + array(28042865, -3557089, -12126526, 12259706, -3717498, -6945899, 6766453, -8689599, 18036436, 5803270), + ), + ), + array( + array( + array(-817581, 6763912, 11803561, 1585585, 10958447, -2671165, 23855391, 4598332, -6159431, -14117438), + array(-31031306, -14256194, 17332029, -2383520, 31312682, -5967183, 696309, 50292, -20095739, 11763584), + array(-594563, -2514283, -32234153, 12643980, 12650761, 14811489, 665117, -12613632, -19773211, -10713562), + ), + array( + array(30464590, -11262872, -4127476, -12734478, 19835327, -7105613, -24396175, 2075773, -17020157, 992471), + array(18357185, -6994433, 7766382, 16342475, -29324918, 411174, 14578841, 8080033, -11574335, -10601610), + array(19598397, 10334610, 12555054, 2555664, 18821899, -10339780, 21873263, 16014234, 26224780, 16452269), + ), + array( + array(-30223925, 5145196, 5944548, 16385966, 3976735, 2009897, -11377804, -7618186, -20533829, 3698650), + array(14187449, 3448569, -10636236, -10810935, -22663880, -3433596, 7268410, -10890444, 27394301, 12015369), + array(19695761, 16087646, 28032085, 12999827, 6817792, 11427614, 20244189, -1312777, -13259127, -3402461), + ), + array( + array(30860103, 12735208, -1888245, -4699734, -16974906, 2256940, -8166013, 12298312, -8550524, -10393462), + array(-5719826, -11245325, -1910649, 15569035, 26642876, -7587760, -5789354, -15118654, -4976164, 12651793), + array(-2848395, 9953421, 11531313, -5282879, 26895123, -12697089, -13118820, -16517902, 9768698, -2533218), + ), + array( + array(-24719459, 1894651, -287698, -4704085, 15348719, -8156530, 32767513, 12765450, 4940095, 10678226), + array(18860224, 15980149, -18987240, -1562570, -26233012, -11071856, -7843882, 13944024, -24372348, 16582019), + array(-15504260, 4970268, -29893044, 4175593, -20993212, -2199756, -11704054, 15444560, -11003761, 7989037), + ), + array( + array(31490452, 5568061, -2412803, 2182383, -32336847, 4531686, -32078269, 6200206, -19686113, -14800171), + array(-17308668, -15879940, -31522777, -2831, -32887382, 16375549, 8680158, -16371713, 28550068, -6857132), + array(-28126887, -5688091, 16837845, -1820458, -6850681, 12700016, -30039981, 4364038, 1155602, 5988841), + ), + array( + array(21890435, -13272907, -12624011, 12154349, -7831873, 15300496, 23148983, -4470481, 24618407, 8283181), + array(-33136107, -10512751, 9975416, 6841041, -31559793, 16356536, 3070187, -7025928, 1466169, 10740210), + array(-1509399, -15488185, -13503385, -10655916, 32799044, 909394, -13938903, -5779719, -32164649, -15327040), + ), + array( + array(3960823, -14267803, -28026090, -15918051, -19404858, 13146868, 15567327, 951507, -3260321, -573935), + array(24740841, 5052253, -30094131, 8961361, 25877428, 6165135, -24368180, 14397372, -7380369, -6144105), + array(-28888365, 3510803, -28103278, -1158478, -11238128, -10631454, -15441463, -14453128, -1625486, -6494814), + ), + ), + array( + array( + array(793299, -9230478, 8836302, -6235707, -27360908, -2369593, 33152843, -4885251, -9906200, -621852), + array(5666233, 525582, 20782575, -8038419, -24538499, 14657740, 16099374, 1468826, -6171428, -15186581), + array(-4859255, -3779343, -2917758, -6748019, 7778750, 11688288, -30404353, -9871238, -1558923, -9863646), + ), + array( + array(10896332, -7719704, 824275, 472601, -19460308, 3009587, 25248958, 14783338, -30581476, -15757844), + array(10566929, 12612572, -31944212, 11118703, -12633376, 12362879, 21752402, 8822496, 24003793, 14264025), + array(27713862, -7355973, -11008240, 9227530, 27050101, 2504721, 23886875, -13117525, 13958495, -5732453), + ), + array( + array(-23481610, 4867226, -27247128, 3900521, 29838369, -8212291, -31889399, -10041781, 7340521, -15410068), + array(4646514, -8011124, -22766023, -11532654, 23184553, 8566613, 31366726, -1381061, -15066784, -10375192), + array(-17270517, 12723032, -16993061, 14878794, 21619651, -6197576, 27584817, 3093888, -8843694, 3849921), + ), + array( + array(-9064912, 2103172, 25561640, -15125738, -5239824, 9582958, 32477045, -9017955, 5002294, -15550259), + array(-12057553, -11177906, 21115585, -13365155, 8808712, -12030708, 16489530, 13378448, -25845716, 12741426), + array(-5946367, 10645103, -30911586, 15390284, -3286982, -7118677, 24306472, 15852464, 28834118, -7646072), + ), + array( + array(-17335748, -9107057, -24531279, 9434953, -8472084, -583362, -13090771, 455841, 20461858, 5491305), + array(13669248, -16095482, -12481974, -10203039, -14569770, -11893198, -24995986, 11293807, -28588204, -9421832), + array(28497928, 6272777, -33022994, 14470570, 8906179, -1225630, 18504674, -14165166, 29867745, -8795943), + ), + array( + array(-16207023, 13517196, -27799630, -13697798, 24009064, -6373891, -6367600, -13175392, 22853429, -4012011), + array(24191378, 16712145, -13931797, 15217831, 14542237, 1646131, 18603514, -11037887, 12876623, -2112447), + array(17902668, 4518229, -411702, -2829247, 26878217, 5258055, -12860753, 608397, 16031844, 3723494), + ), + array( + array(-28632773, 12763728, -20446446, 7577504, 33001348, -13017745, 17558842, -7872890, 23896954, -4314245), + array(-20005381, -12011952, 31520464, 605201, 2543521, 5991821, -2945064, 7229064, -9919646, -8826859), + array(28816045, 298879, -28165016, -15920938, 19000928, -1665890, -12680833, -2949325, -18051778, -2082915), + ), + array( + array(16000882, -344896, 3493092, -11447198, -29504595, -13159789, 12577740, 16041268, -19715240, 7847707), + array(10151868, 10572098, 27312476, 7922682, 14825339, 4723128, -32855931, -6519018, -10020567, 3852848), + array(-11430470, 15697596, -21121557, -4420647, 5386314, 15063598, 16514493, -15932110, 29330899, -15076224), + ), + ), + array( + array( + array(-25499735, -4378794, -15222908, -6901211, 16615731, 2051784, 3303702, 15490, -27548796, 12314391), + array(15683520, -6003043, 18109120, -9980648, 15337968, -5997823, -16717435, 15921866, 16103996, -3731215), + array(-23169824, -10781249, 13588192, -1628807, -3798557, -1074929, -19273607, 5402699, -29815713, -9841101), + ), + array( + array(23190676, 2384583, -32714340, 3462154, -29903655, -1529132, -11266856, 8911517, -25205859, 2739713), + array(21374101, -3554250, -33524649, 9874411, 15377179, 11831242, -33529904, 6134907, 4931255, 11987849), + array(-7732, -2978858, -16223486, 7277597, 105524, -322051, -31480539, 13861388, -30076310, 10117930), + ), + array( + array(-29501170, -10744872, -26163768, 13051539, -25625564, 5089643, -6325503, 6704079, 12890019, 15728940), + array(-21972360, -11771379, -951059, -4418840, 14704840, 2695116, 903376, -10428139, 12885167, 8311031), + array(-17516482, 5352194, 10384213, -13811658, 7506451, 13453191, 26423267, 4384730, 1888765, -5435404), + ), + array( + array(-25817338, -3107312, -13494599, -3182506, 30896459, -13921729, -32251644, -12707869, -19464434, -3340243), + array(-23607977, -2665774, -526091, 4651136, 5765089, 4618330, 6092245, 14845197, 17151279, -9854116), + array(-24830458, -12733720, -15165978, 10367250, -29530908, -265356, 22825805, -7087279, -16866484, 16176525), + ), + array( + array(-23583256, 6564961, 20063689, 3798228, -4740178, 7359225, 2006182, -10363426, -28746253, -10197509), + array(-10626600, -4486402, -13320562, -5125317, 3432136, -6393229, 23632037, -1940610, 32808310, 1099883), + array(15030977, 5768825, -27451236, -2887299, -6427378, -15361371, -15277896, -6809350, 2051441, -15225865), + ), + array( + array(-3362323, -7239372, 7517890, 9824992, 23555850, 295369, 5148398, -14154188, -22686354, 16633660), + array(4577086, -16752288, 13249841, -15304328, 19958763, -14537274, 18559670, -10759549, 8402478, -9864273), + array(-28406330, -1051581, -26790155, -907698, -17212414, -11030789, 9453451, -14980072, 17983010, 9967138), + ), + array( + array(-25762494, 6524722, 26585488, 9969270, 24709298, 1220360, -1677990, 7806337, 17507396, 3651560), + array(-10420457, -4118111, 14584639, 15971087, -15768321, 8861010, 26556809, -5574557, -18553322, -11357135), + array(2839101, 14284142, 4029895, 3472686, 14402957, 12689363, -26642121, 8459447, -5605463, -7621941), + ), + array( + array(-4839289, -3535444, 9744961, 2871048, 25113978, 3187018, -25110813, -849066, 17258084, -7977739), + array(18164541, -10595176, -17154882, -1542417, 19237078, -9745295, 23357533, -15217008, 26908270, 12150756), + array(-30264870, -7647865, 5112249, -7036672, -1499807, -6974257, 43168, -5537701, -32302074, 16215819), + ), + ), + array( + array( + array(-6898905, 9824394, -12304779, -4401089, -31397141, -6276835, 32574489, 12532905, -7503072, -8675347), + array(-27343522, -16515468, -27151524, -10722951, 946346, 16291093, 254968, 7168080, 21676107, -1943028), + array(21260961, -8424752, -16831886, -11920822, -23677961, 3968121, -3651949, -6215466, -3556191, -7913075), + ), + array( + array(16544754, 13250366, -16804428, 15546242, -4583003, 12757258, -2462308, -8680336, -18907032, -9662799), + array(-2415239, -15577728, 18312303, 4964443, -15272530, -12653564, 26820651, 16690659, 25459437, -4564609), + array(-25144690, 11425020, 28423002, -11020557, -6144921, -15826224, 9142795, -2391602, -6432418, -1644817), + ), + array( + array(-23104652, 6253476, 16964147, -3768872, -25113972, -12296437, -27457225, -16344658, 6335692, 7249989), + array(-30333227, 13979675, 7503222, -12368314, -11956721, -4621693, -30272269, 2682242, 25993170, -12478523), + array(4364628, 5930691, 32304656, -10044554, -8054781, 15091131, 22857016, -10598955, 31820368, 15075278), + ), + array( + array(31879134, -8918693, 17258761, 90626, -8041836, -4917709, 24162788, -9650886, -17970238, 12833045), + array(19073683, 14851414, -24403169, -11860168, 7625278, 11091125, -19619190, 2074449, -9413939, 14905377), + array(24483667, -11935567, -2518866, -11547418, -1553130, 15355506, -25282080, 9253129, 27628530, -7555480), + ), + array( + array(17597607, 8340603, 19355617, 552187, 26198470, -3176583, 4593324, -9157582, -14110875, 15297016), + array(510886, 14337390, -31785257, 16638632, 6328095, 2713355, -20217417, -11864220, 8683221, 2921426), + array(18606791, 11874196, 27155355, -5281482, -24031742, 6265446, -25178240, -1278924, 4674690, 13890525), + ), + array( + array(13609624, 13069022, -27372361, -13055908, 24360586, 9592974, 14977157, 9835105, 4389687, 288396), + array(9922506, -519394, 13613107, 5883594, -18758345, -434263, -12304062, 8317628, 23388070, 16052080), + array(12720016, 11937594, -31970060, -5028689, 26900120, 8561328, -20155687, -11632979, -14754271, -10812892), + ), + array( + array(15961858, 14150409, 26716931, -665832, -22794328, 13603569, 11829573, 7467844, -28822128, 929275), + array(11038231, -11582396, -27310482, -7316562, -10498527, -16307831, -23479533, -9371869, -21393143, 2465074), + array(20017163, -4323226, 27915242, 1529148, 12396362, 15675764, 13817261, -9658066, 2463391, -4622140), + ), + array( + array(-16358878, -12663911, -12065183, 4996454, -1256422, 1073572, 9583558, 12851107, 4003896, 12673717), + array(-1731589, -15155870, -3262930, 16143082, 19294135, 13385325, 14741514, -9103726, 7903886, 2348101), + array(24536016, -16515207, 12715592, -3862155, 1511293, 10047386, -3842346, -7129159, -28377538, 10048127), + ), + ), + array( + array( + array(-12622226, -6204820, 30718825, 2591312, -10617028, 12192840, 18873298, -7297090, -32297756, 15221632), + array(-26478122, -11103864, 11546244, -1852483, 9180880, 7656409, -21343950, 2095755, 29769758, 6593415), + array(-31994208, -2907461, 4176912, 3264766, 12538965, -868111, 26312345, -6118678, 30958054, 8292160), + ), + array( + array(31429822, -13959116, 29173532, 15632448, 12174511, -2760094, 32808831, 3977186, 26143136, -3148876), + array(22648901, 1402143, -22799984, 13746059, 7936347, 365344, -8668633, -1674433, -3758243, -2304625), + array(-15491917, 8012313, -2514730, -12702462, -23965846, -10254029, -1612713, -1535569, -16664475, 8194478), + ), + array( + array(27338066, -7507420, -7414224, 10140405, -19026427, -6589889, 27277191, 8855376, 28572286, 3005164), + array(26287124, 4821776, 25476601, -4145903, -3764513, -15788984, -18008582, 1182479, -26094821, -13079595), + array(-7171154, 3178080, 23970071, 6201893, -17195577, -4489192, -21876275, -13982627, 32208683, -1198248), + ), + array( + array(-16657702, 2817643, -10286362, 14811298, 6024667, 13349505, -27315504, -10497842, -27672585, -11539858), + array(15941029, -9405932, -21367050, 8062055, 31876073, -238629, -15278393, -1444429, 15397331, -4130193), + array(8934485, -13485467, -23286397, -13423241, -32446090, 14047986, 31170398, -1441021, -27505566, 15087184), + ), + array( + array(-18357243, -2156491, 24524913, -16677868, 15520427, -6360776, -15502406, 11461896, 16788528, -5868942), + array(-1947386, 16013773, 21750665, 3714552, -17401782, -16055433, -3770287, -10323320, 31322514, -11615635), + array(21426655, -5650218, -13648287, -5347537, -28812189, -4920970, -18275391, -14621414, 13040862, -12112948), + ), + array( + array(11293895, 12478086, -27136401, 15083750, -29307421, 14748872, 14555558, -13417103, 1613711, 4896935), + array(-25894883, 15323294, -8489791, -8057900, 25967126, -13425460, 2825960, -4897045, -23971776, -11267415), + array(-15924766, -5229880, -17443532, 6410664, 3622847, 10243618, 20615400, 12405433, -23753030, -8436416), + ), + array( + array(-7091295, 12556208, -20191352, 9025187, -17072479, 4333801, 4378436, 2432030, 23097949, -566018), + array(4565804, -16025654, 20084412, -7842817, 1724999, 189254, 24767264, 10103221, -18512313, 2424778), + array(366633, -11976806, 8173090, -6890119, 30788634, 5745705, -7168678, 1344109, -3642553, 12412659), + ), + array( + array(-24001791, 7690286, 14929416, -168257, -32210835, -13412986, 24162697, -15326504, -3141501, 11179385), + array(18289522, -14724954, 8056945, 16430056, -21729724, 7842514, -6001441, -1486897, -18684645, -11443503), + array(476239, 6601091, -6152790, -9723375, 17503545, -4863900, 27672959, 13403813, 11052904, 5219329), + ), + ), + array( + array( + array(20678546, -8375738, -32671898, 8849123, -5009758, 14574752, 31186971, -3973730, 9014762, -8579056), + array(-13644050, -10350239, -15962508, 5075808, -1514661, -11534600, -33102500, 9160280, 8473550, -3256838), + array(24900749, 14435722, 17209120, -15292541, -22592275, 9878983, -7689309, -16335821, -24568481, 11788948), + ), + array( + array(-3118155, -11395194, -13802089, 14797441, 9652448, -6845904, -20037437, 10410733, -24568470, -1458691), + array(-15659161, 16736706, -22467150, 10215878, -9097177, 7563911, 11871841, -12505194, -18513325, 8464118), + array(-23400612, 8348507, -14585951, -861714, -3950205, -6373419, 14325289, 8628612, 33313881, -8370517), + ), + array( + array(-20186973, -4967935, 22367356, 5271547, -1097117, -4788838, -24805667, -10236854, -8940735, -5818269), + array(-6948785, -1795212, -32625683, -16021179, 32635414, -7374245, 15989197, -12838188, 28358192, -4253904), + array(-23561781, -2799059, -32351682, -1661963, -9147719, 10429267, -16637684, 4072016, -5351664, 5596589), + ), + array( + array(-28236598, -3390048, 12312896, 6213178, 3117142, 16078565, 29266239, 2557221, 1768301, 15373193), + array(-7243358, -3246960, -4593467, -7553353, -127927, -912245, -1090902, -4504991, -24660491, 3442910), + array(-30210571, 5124043, 14181784, 8197961, 18964734, -11939093, 22597931, 7176455, -18585478, 13365930), + ), + array( + array(-7877390, -1499958, 8324673, 4690079, 6261860, 890446, 24538107, -8570186, -9689599, -3031667), + array(25008904, -10771599, -4305031, -9638010, 16265036, 15721635, 683793, -11823784, 15723479, -15163481), + array(-9660625, 12374379, -27006999, -7026148, -7724114, -12314514, 11879682, 5400171, 519526, -1235876), + ), + array( + array(22258397, -16332233, -7869817, 14613016, -22520255, -2950923, -20353881, 7315967, 16648397, 7605640), + array(-8081308, -8464597, -8223311, 9719710, 19259459, -15348212, 23994942, -5281555, -9468848, 4763278), + array(-21699244, 9220969, -15730624, 1084137, -25476107, -2852390, 31088447, -7764523, -11356529, 728112), + ), + array( + array(26047220, -11751471, -6900323, -16521798, 24092068, 9158119, -4273545, -12555558, -29365436, -5498272), + array(17510331, -322857, 5854289, 8403524, 17133918, -3112612, -28111007, 12327945, 10750447, 10014012), + array(-10312768, 3936952, 9156313, -8897683, 16498692, -994647, -27481051, -666732, 3424691, 7540221), + ), + array( + array(30322361, -6964110, 11361005, -4143317, 7433304, 4989748, -7071422, -16317219, -9244265, 15258046), + array(13054562, -2779497, 19155474, 469045, -12482797, 4566042, 5631406, 2711395, 1062915, -5136345), + array(-19240248, -11254599, -29509029, -7499965, -5835763, 13005411, -6066489, 12194497, 32960380, 1459310), + ), + ), + array( + array( + array(19852034, 7027924, 23669353, 10020366, 8586503, -6657907, 394197, -6101885, 18638003, -11174937), + array(31395534, 15098109, 26581030, 8030562, -16527914, -5007134, 9012486, -7584354, -6643087, -5442636), + array(-9192165, -2347377, -1997099, 4529534, 25766844, 607986, -13222, 9677543, -32294889, -6456008), + ), + array( + array(-2444496, -149937, 29348902, 8186665, 1873760, 12489863, -30934579, -7839692, -7852844, -8138429), + array(-15236356, -15433509, 7766470, 746860, 26346930, -10221762, -27333451, 10754588, -9431476, 5203576), + array(31834314, 14135496, -770007, 5159118, 20917671, -16768096, -7467973, -7337524, 31809243, 7347066), + ), + array( + array(-9606723, -11874240, 20414459, 13033986, 13716524, -11691881, 19797970, -12211255, 15192876, -2087490), + array(-12663563, -2181719, 1168162, -3804809, 26747877, -14138091, 10609330, 12694420, 33473243, -13382104), + array(33184999, 11180355, 15832085, -11385430, -1633671, 225884, 15089336, -11023903, -6135662, 14480053), + ), + array( + array(31308717, -5619998, 31030840, -1897099, 15674547, -6582883, 5496208, 13685227, 27595050, 8737275), + array(-20318852, -15150239, 10933843, -16178022, 8335352, -7546022, -31008351, -12610604, 26498114, 66511), + array(22644454, -8761729, -16671776, 4884562, -3105614, -13559366, 30540766, -4286747, -13327787, -7515095), + ), + array( + array(-28017847, 9834845, 18617207, -2681312, -3401956, -13307506, 8205540, 13585437, -17127465, 15115439), + array(23711543, -672915, 31206561, -8362711, 6164647, -9709987, -33535882, -1426096, 8236921, 16492939), + array(-23910559, -13515526, -26299483, -4503841, 25005590, -7687270, 19574902, 10071562, 6708380, -6222424), + ), + array( + array(2101391, -4930054, 19702731, 2367575, -15427167, 1047675, 5301017, 9328700, 29955601, -11678310), + array(3096359, 9271816, -21620864, -15521844, -14847996, -7592937, -25892142, -12635595, -9917575, 6216608), + array(-32615849, 338663, -25195611, 2510422, -29213566, -13820213, 24822830, -6146567, -26767480, 7525079), + ), + array( + array(-23066649, -13985623, 16133487, -7896178, -3389565, 778788, -910336, -2782495, -19386633, 11994101), + array(21691500, -13624626, -641331, -14367021, 3285881, -3483596, -25064666, 9718258, -7477437, 13381418), + array(18445390, -4202236, 14979846, 11622458, -1727110, -3582980, 23111648, -6375247, 28535282, 15779576), + ), + array( + array(30098053, 3089662, -9234387, 16662135, -21306940, 11308411, -14068454, 12021730, 9955285, -16303356), + array(9734894, -14576830, -7473633, -9138735, 2060392, 11313496, -18426029, 9924399, 20194861, 13380996), + array(-26378102, -7965207, -22167821, 15789297, -18055342, -6168792, -1984914, 15707771, 26342023, 10146099), + ), + ), + array( + array( + array(-26016874, -219943, 21339191, -41388, 19745256, -2878700, -29637280, 2227040, 21612326, -545728), + array(-13077387, 1184228, 23562814, -5970442, -20351244, -6348714, 25764461, 12243797, -20856566, 11649658), + array(-10031494, 11262626, 27384172, 2271902, 26947504, -15997771, 39944, 6114064, 33514190, 2333242), + ), + array( + array(-21433588, -12421821, 8119782, 7219913, -21830522, -9016134, -6679750, -12670638, 24350578, -13450001), + array(-4116307, -11271533, -23886186, 4843615, -30088339, 690623, -31536088, -10406836, 8317860, 12352766), + array(18200138, -14475911, -33087759, -2696619, -23702521, -9102511, -23552096, -2287550, 20712163, 6719373), + ), + array( + array(26656208, 6075253, -7858556, 1886072, -28344043, 4262326, 11117530, -3763210, 26224235, -3297458), + array(-17168938, -14854097, -3395676, -16369877, -19954045, 14050420, 21728352, 9493610, 18620611, -16428628), + array(-13323321, 13325349, 11432106, 5964811, 18609221, 6062965, -5269471, -9725556, -30701573, -16479657), + ), + array( + array(-23860538, -11233159, 26961357, 1640861, -32413112, -16737940, 12248509, -5240639, 13735342, 1934062), + array(25089769, 6742589, 17081145, -13406266, 21909293, -16067981, -15136294, -3765346, -21277997, 5473616), + array(31883677, -7961101, 1083432, -11572403, 22828471, 13290673, -7125085, 12469656, 29111212, -5451014), + ), + array( + array(24244947, -15050407, -26262976, 2791540, -14997599, 16666678, 24367466, 6388839, -10295587, 452383), + array(-25640782, -3417841, 5217916, 16224624, 19987036, -4082269, -24236251, -5915248, 15766062, 8407814), + array(-20406999, 13990231, 15495425, 16395525, 5377168, 15166495, -8917023, -4388953, -8067909, 2276718), + ), + array( + array(30157918, 12924066, -17712050, 9245753, 19895028, 3368142, -23827587, 5096219, 22740376, -7303417), + array(2041139, -14256350, 7783687, 13876377, -25946985, -13352459, 24051124, 13742383, -15637599, 13295222), + array(33338237, -8505733, 12532113, 7977527, 9106186, -1715251, -17720195, -4612972, -4451357, -14669444), + ), + array( + array(-20045281, 5454097, -14346548, 6447146, 28862071, 1883651, -2469266, -4141880, 7770569, 9620597), + array(23208068, 7979712, 33071466, 8149229, 1758231, -10834995, 30945528, -1694323, -33502340, -14767970), + array(1439958, -16270480, -1079989, -793782, 4625402, 10647766, -5043801, 1220118, 30494170, -11440799), + ), + array( + array(-5037580, -13028295, -2970559, -3061767, 15640974, -6701666, -26739026, 926050, -1684339, -13333647), + array(13908495, -3549272, 30919928, -6273825, -21521863, 7989039, 9021034, 9078865, 3353509, 4033511), + array(-29663431, -15113610, 32259991, -344482, 24295849, -12912123, 23161163, 8839127, 27485041, 7356032), + ), + ), + array( + array( + array(9661027, 705443, 11980065, -5370154, -1628543, 14661173, -6346142, 2625015, 28431036, -16771834), + array(-23839233, -8311415, -25945511, 7480958, -17681669, -8354183, -22545972, 14150565, 15970762, 4099461), + array(29262576, 16756590, 26350592, -8793563, 8529671, -11208050, 13617293, -9937143, 11465739, 8317062), + ), + array( + array(-25493081, -6962928, 32500200, -9419051, -23038724, -2302222, 14898637, 3848455, 20969334, -5157516), + array(-20384450, -14347713, -18336405, 13884722, -33039454, 2842114, -21610826, -3649888, 11177095, 14989547), + array(-24496721, -11716016, 16959896, 2278463, 12066309, 10137771, 13515641, 2581286, -28487508, 9930240), + ), + array( + array(-17751622, -2097826, 16544300, -13009300, -15914807, -14949081, 18345767, -13403753, 16291481, -5314038), + array(-33229194, 2553288, 32678213, 9875984, 8534129, 6889387, -9676774, 6957617, 4368891, 9788741), + array(16660756, 7281060, -10830758, 12911820, 20108584, -8101676, -21722536, -8613148, 16250552, -11111103), + ), + array( + array(-19765507, 2390526, -16551031, 14161980, 1905286, 6414907, 4689584, 10604807, -30190403, 4782747), + array(-1354539, 14736941, -7367442, -13292886, 7710542, -14155590, -9981571, 4383045, 22546403, 437323), + array(31665577, -12180464, -16186830, 1491339, -18368625, 3294682, 27343084, 2786261, -30633590, -14097016), + ), + array( + array(-14467279, -683715, -33374107, 7448552, 19294360, 14334329, -19690631, 2355319, -19284671, -6114373), + array(15121312, -15796162, 6377020, -6031361, -10798111, -12957845, 18952177, 15496498, -29380133, 11754228), + array(-2637277, -13483075, 8488727, -14303896, 12728761, -1622493, 7141596, 11724556, 22761615, -10134141), + ), + array( + array(16918416, 11729663, -18083579, 3022987, -31015732, -13339659, -28741185, -12227393, 32851222, 11717399), + array(11166634, 7338049, -6722523, 4531520, -29468672, -7302055, 31474879, 3483633, -1193175, -4030831), + array(-185635, 9921305, 31456609, -13536438, -12013818, 13348923, 33142652, 6546660, -19985279, -3948376), + ), + array( + array(-32460596, 11266712, -11197107, -7899103, 31703694, 3855903, -8537131, -12833048, -30772034, -15486313), + array(-18006477, 12709068, 3991746, -6479188, -21491523, -10550425, -31135347, -16049879, 10928917, 3011958), + array(-6957757, -15594337, 31696059, 334240, 29576716, 14796075, -30831056, -12805180, 18008031, 10258577), + ), + array( + array(-22448644, 15655569, 7018479, -4410003, -30314266, -1201591, -1853465, 1367120, 25127874, 6671743), + array(29701166, -14373934, -10878120, 9279288, -17568, 13127210, 21382910, 11042292, 25838796, 4642684), + array(-20430234, 14955537, -24126347, 8124619, -5369288, -5990470, 30468147, -13900640, 18423289, 4177476), + ), + ) + ); + + /** + * See: libsodium's crypto_core/curve25519/ref10/base2.h + * + * @var array basically int[8][3] + */ + protected static $base2 = array( + array( + array(25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605), + array(-12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378), + array(-8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546), + ), + array( + array(15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024), + array(16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574), + array(30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357), + ), + array( + array(10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380), + array(4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306), + array(19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942), + ), + array( + array(5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766), + array(-30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701), + array(28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300), + ), + array( + array(-22518993, -6692182, 14201702, -8745502, -23510406, 8844726, 18474211, -1361450, -13062696, 13821877), + array(-6455177, -7839871, 3374702, -4740862, -27098617, -10571707, 31655028, -7212327, 18853322, -14220951), + array(4566830, -12963868, -28974889, -12240689, -7602672, -2830569, -8514358, -10431137, 2207753, -3209784), + ), + array( + array(-25154831, -4185821, 29681144, 7868801, -6854661, -9423865, -12437364, -663000, -31111463, -16132436), + array(25576264, -2703214, 7349804, -11814844, 16472782, 9300885, 3844789, 15725684, 171356, 6466918), + array(23103977, 13316479, 9739013, -16149481, 817875, -15038942, 8965339, -14088058, -30714912, 16193877), + ), + array( + array(-33521811, 3180713, -2394130, 14003687, -16903474, -16270840, 17238398, 4729455, -18074513, 9256800), + array(-25182317, -4174131, 32336398, 5036987, -21236817, 11360617, 22616405, 9761698, -19827198, 630305), + array(-13720693, 2639453, -24237460, -7406481, 9494427, -5774029, -6554551, -15960994, -2449256, -14291300), + ), + array( + array(-3151181, -5046075, 9282714, 6866145, -31907062, -863023, -18940575, 15033784, 25105118, -7894876), + array(-24326370, 15950226, -31801215, -14592823, -11662737, -5090925, 1573892, -2625887, 2198790, -15804619), + array(-3099351, 10324967, -2241613, 7453183, -5446979, -2735503, -13812022, -16236442, -32461234, -12290683), + ) + ); + + /** + * 37095705934669439343138083508754565189542113879843219016388785533085940283555 + * + * @var array + */ + protected static $d = array( + -10913610, + 13857413, + -15372611, + 6949391, + 114729, + -8787816, + -6275908, + -3247719, + -18696448, + -12055116 + ); + + /** + * 2 * d = 16295367250680780974490674513165176452449235426866156013048779062215315747161 + * + * @var array + */ + protected static $d2 = array( + -21827239, + -5839606, + -30745221, + 13898782, + 229458, + 15978800, + -12551817, + -6495438, + 29715968, + 9444199 + ); + + /** + * sqrt(-1) + * + * @var array + */ + protected static $sqrtm1 = array( + -32595792, + -7943725, + 9377950, + 3500415, + 12389472, + -272473, + -25146209, + -2005654, + 326686, + 11406482 + ); + + /** + * 1 / sqrt(a - d) + * + * @var array + */ + protected static $invsqrtamd = array( + 6111485, + 4156064, + -27798727, + 12243468, + -25904040, + 120897, + 20826367, + -7060776, + 6093568, + -1986012 + ); + + /** + * sqrt(ad - 1) with a = -1 (mod p) + * + * @var array + */ + protected static $sqrtadm1 = array( + 24849947, + -153582, + -23613485, + 6347715, + -21072328, + -667138, + -25271143, + -15367704, + -870347, + 14525639 + ); + + /** + * 1 - d ^ 2 + * + * @var array + */ + protected static $onemsqd = array( + 6275446, + -16617371, + -22938544, + -3773710, + 11667077, + 7397348, + -27922721, + 1766195, + -24433858, + 672203 + ); + + /** + * (d - 1) ^ 2 + * @var array + */ + protected static $sqdmone = array( + 15551795, + -11097455, + -13425098, + -10125071, + -11896535, + 10178284, + -26634327, + 4729244, + -5282110, + -10116402 + ); + + + /* + * 2^252+27742317777372353535851937790883648493 + static const unsigned char L[] = { + 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, + 0xa2, 0xde, 0xf9, 0xde, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10 + }; + */ + const L = "\xed\xd3\xf5\x5c\x1a\x63\x12\x58\xd6\x9c\xf7\xa2\xde\xf9\xde\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10"; +} diff --git a/vendor/paragonie/sodium_compat/src/Core/Curve25519/README.md b/vendor/paragonie/sodium_compat/src/Core/Curve25519/README.md new file mode 100644 index 0000000..e8097fa --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/Curve25519/README.md @@ -0,0 +1,3 @@ +# Curve25519 Data Structures + +These are PHP implementation of the [structs used in the ref10 curve25519 code](https://github.com/jedisct1/libsodium/blob/master/src/libsodium/include/sodium/private/curve25519_ref10.h). diff --git a/vendor/paragonie/sodium_compat/src/Core/Ed25519.php b/vendor/paragonie/sodium_compat/src/Core/Ed25519.php new file mode 100644 index 0000000..c29f493 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/Ed25519.php @@ -0,0 +1,551 @@ +X)) { + throw new SodiumException('Unexpected zero result'); + } + + # fe_1(one_minus_y); + # fe_sub(one_minus_y, one_minus_y, A.Y); + # fe_invert(one_minus_y, one_minus_y); + $one_minux_y = self::fe_invert( + self::fe_sub( + self::fe_1(), + $A->Y + ) + ); + + # fe_1(x); + # fe_add(x, x, A.Y); + # fe_mul(x, x, one_minus_y); + $x = self::fe_mul( + self::fe_add(self::fe_1(), $A->Y), + $one_minux_y + ); + + # fe_tobytes(curve25519_pk, x); + return self::fe_tobytes($x); + } + + /** + * @internal You should not use this directly from another application + * + * @param string $sk + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function sk_to_pk($sk) + { + return self::ge_p3_tobytes( + self::ge_scalarmult_base( + self::substr($sk, 0, 32) + ) + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param string $message + * @param string $sk + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function sign($message, $sk) + { + /** @var string $signature */ + $signature = self::sign_detached($message, $sk); + return $signature . $message; + } + + /** + * @internal You should not use this directly from another application + * + * @param string $message A signed message + * @param string $pk Public key + * @return string Message (without signature) + * @throws SodiumException + * @throws TypeError + */ + public static function sign_open($message, $pk) + { + /** @var string $signature */ + $signature = self::substr($message, 0, 64); + + /** @var string $message */ + $message = self::substr($message, 64); + + if (self::verify_detached($signature, $message, $pk)) { + return $message; + } + throw new SodiumException('Invalid signature'); + } + + /** + * @internal You should not use this directly from another application + * + * @param string $message + * @param string $sk + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function sign_detached($message, $sk) + { + # crypto_hash_sha512(az, sk, 32); + $az = hash('sha512', self::substr($sk, 0, 32), true); + + # az[0] &= 248; + # az[31] &= 63; + # az[31] |= 64; + $az[0] = self::intToChr(self::chrToInt($az[0]) & 248); + $az[31] = self::intToChr((self::chrToInt($az[31]) & 63) | 64); + + # crypto_hash_sha512_init(&hs); + # crypto_hash_sha512_update(&hs, az + 32, 32); + # crypto_hash_sha512_update(&hs, m, mlen); + # crypto_hash_sha512_final(&hs, nonce); + $hs = hash_init('sha512'); + hash_update($hs, self::substr($az, 32, 32)); + hash_update($hs, $message); + $nonceHash = hash_final($hs, true); + + # memmove(sig + 32, sk + 32, 32); + $pk = self::substr($sk, 32, 32); + + # sc_reduce(nonce); + # ge_scalarmult_base(&R, nonce); + # ge_p3_tobytes(sig, &R); + $nonce = self::sc_reduce($nonceHash) . self::substr($nonceHash, 32); + $sig = self::ge_p3_tobytes( + self::ge_scalarmult_base($nonce) + ); + + # crypto_hash_sha512_init(&hs); + # crypto_hash_sha512_update(&hs, sig, 64); + # crypto_hash_sha512_update(&hs, m, mlen); + # crypto_hash_sha512_final(&hs, hram); + $hs = hash_init('sha512'); + hash_update($hs, self::substr($sig, 0, 32)); + hash_update($hs, self::substr($pk, 0, 32)); + hash_update($hs, $message); + $hramHash = hash_final($hs, true); + + # sc_reduce(hram); + # sc_muladd(sig + 32, hram, az, nonce); + $hram = self::sc_reduce($hramHash); + $sigAfter = self::sc_muladd($hram, $az, $nonce); + $sig = self::substr($sig, 0, 32) . self::substr($sigAfter, 0, 32); + + try { + ParagonIE_Sodium_Compat::memzero($az); + } catch (SodiumException $ex) { + $az = null; + } + return $sig; + } + + /** + * @internal You should not use this directly from another application + * + * @param string $sig + * @param string $message + * @param string $pk + * @return bool + * @throws SodiumException + * @throws TypeError + */ + public static function verify_detached($sig, $message, $pk) + { + if (self::strlen($sig) < 64) { + throw new SodiumException('Signature is too short'); + } + if ((self::chrToInt($sig[63]) & 240) && self::check_S_lt_L(self::substr($sig, 32, 32))) { + throw new SodiumException('S < L - Invalid signature'); + } + if (self::small_order($sig)) { + throw new SodiumException('Signature is on too small of an order'); + } + if ((self::chrToInt($sig[63]) & 224) !== 0) { + throw new SodiumException('Invalid signature'); + } + $d = 0; + for ($i = 0; $i < 32; ++$i) { + $d |= self::chrToInt($pk[$i]); + } + if ($d === 0) { + throw new SodiumException('All zero public key'); + } + + /** @var bool The original value of ParagonIE_Sodium_Compat::$fastMult */ + $orig = ParagonIE_Sodium_Compat::$fastMult; + + // Set ParagonIE_Sodium_Compat::$fastMult to true to speed up verification. + ParagonIE_Sodium_Compat::$fastMult = true; + + /** @var ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A */ + $A = self::ge_frombytes_negate_vartime($pk); + + /** @var string $hDigest */ + $hDigest = hash( + 'sha512', + self::substr($sig, 0, 32) . + self::substr($pk, 0, 32) . + $message, + true + ); + + /** @var string $h */ + $h = self::sc_reduce($hDigest) . self::substr($hDigest, 32); + + /** @var ParagonIE_Sodium_Core_Curve25519_Ge_P2 $R */ + $R = self::ge_double_scalarmult_vartime( + $h, + $A, + self::substr($sig, 32) + ); + + /** @var string $rcheck */ + $rcheck = self::ge_tobytes($R); + + // Reset ParagonIE_Sodium_Compat::$fastMult to what it was before. + ParagonIE_Sodium_Compat::$fastMult = $orig; + + return self::verify_32($rcheck, self::substr($sig, 0, 32)); + } + + /** + * @internal You should not use this directly from another application + * + * @param string $S + * @return bool + * @throws SodiumException + * @throws TypeError + */ + public static function check_S_lt_L($S) + { + if (self::strlen($S) < 32) { + throw new SodiumException('Signature must be 32 bytes'); + } + $L = array( + 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, + 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10 + ); + $c = 0; + $n = 1; + $i = 32; + + /** @var array $L */ + do { + --$i; + $x = self::chrToInt($S[$i]); + $c |= ( + (($x - $L[$i]) >> 8) & $n + ); + $n &= ( + (($x ^ $L[$i]) - 1) >> 8 + ); + } while ($i !== 0); + + return $c === 0; + } + + /** + * @param string $R + * @return bool + * @throws SodiumException + * @throws TypeError + */ + public static function small_order($R) + { + /** @var array> $blocklist */ + $blocklist = array( + /* 0 (order 4) */ + array( + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + ), + /* 1 (order 1) */ + array( + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + ), + /* 2707385501144840649318225287225658788936804267575313519463743609750303402022 (order 8) */ + array( + 0x26, 0xe8, 0x95, 0x8f, 0xc2, 0xb2, 0x27, 0xb0, + 0x45, 0xc3, 0xf4, 0x89, 0xf2, 0xef, 0x98, 0xf0, + 0xd5, 0xdf, 0xac, 0x05, 0xd3, 0xc6, 0x33, 0x39, + 0xb1, 0x38, 0x02, 0x88, 0x6d, 0x53, 0xfc, 0x05 + ), + /* 55188659117513257062467267217118295137698188065244968500265048394206261417927 (order 8) */ + array( + 0xc7, 0x17, 0x6a, 0x70, 0x3d, 0x4d, 0xd8, 0x4f, + 0xba, 0x3c, 0x0b, 0x76, 0x0d, 0x10, 0x67, 0x0f, + 0x2a, 0x20, 0x53, 0xfa, 0x2c, 0x39, 0xcc, 0xc6, + 0x4e, 0xc7, 0xfd, 0x77, 0x92, 0xac, 0x03, 0x7a + ), + /* p-1 (order 2) */ + array( + 0x13, 0xe8, 0x95, 0x8f, 0xc2, 0xb2, 0x27, 0xb0, + 0x45, 0xc3, 0xf4, 0x89, 0xf2, 0xef, 0x98, 0xf0, + 0xd5, 0xdf, 0xac, 0x05, 0xd3, 0xc6, 0x33, 0x39, + 0xb1, 0x38, 0x02, 0x88, 0x6d, 0x53, 0xfc, 0x85 + ), + /* p (order 4) */ + array( + 0xb4, 0x17, 0x6a, 0x70, 0x3d, 0x4d, 0xd8, 0x4f, + 0xba, 0x3c, 0x0b, 0x76, 0x0d, 0x10, 0x67, 0x0f, + 0x2a, 0x20, 0x53, 0xfa, 0x2c, 0x39, 0xcc, 0xc6, + 0x4e, 0xc7, 0xfd, 0x77, 0x92, 0xac, 0x03, 0xfa + ), + /* p+1 (order 1) */ + array( + 0xec, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f + ), + /* p+2707385501144840649318225287225658788936804267575313519463743609750303402022 (order 8) */ + array( + 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f + ), + /* p+55188659117513257062467267217118295137698188065244968500265048394206261417927 (order 8) */ + array( + 0xee, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f + ), + /* 2p-1 (order 2) */ + array( + 0xd9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff + ), + /* 2p (order 4) */ + array( + 0xda, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff + ), + /* 2p+1 (order 1) */ + array( + 0xdb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff + ) + ); + /** @var int $countBlocklist */ + $countBlocklist = count($blocklist); + + for ($i = 0; $i < $countBlocklist; ++$i) { + $c = 0; + for ($j = 0; $j < 32; ++$j) { + $c |= self::chrToInt($R[$j]) ^ (int) $blocklist[$i][$j]; + } + if ($c === 0) { + return true; + } + } + return false; + } + + /** + * @param string $s + * @return string + * @throws SodiumException + */ + public static function scalar_complement($s) + { + $t_ = self::L . str_repeat("\x00", 32); + sodium_increment($t_); + $s_ = $s . str_repeat("\x00", 32); + ParagonIE_Sodium_Compat::sub($t_, $s_); + return self::sc_reduce($t_); + } + + /** + * @return string + * @throws SodiumException + */ + public static function scalar_random() + { + do { + $r = ParagonIE_Sodium_Compat::randombytes_buf(self::SCALAR_BYTES); + $r[self::SCALAR_BYTES - 1] = self::intToChr( + self::chrToInt($r[self::SCALAR_BYTES - 1]) & 0x1f + ); + } while ( + !self::check_S_lt_L($r) || ParagonIE_Sodium_Compat::is_zero($r) + ); + return $r; + } + + /** + * @param string $s + * @return string + * @throws SodiumException + */ + public static function scalar_negate($s) + { + $t_ = self::L . str_repeat("\x00", 32) ; + $s_ = $s . str_repeat("\x00", 32) ; + ParagonIE_Sodium_Compat::sub($t_, $s_); + return self::sc_reduce($t_); + } + + /** + * @param string $a + * @param string $b + * @return string + * @throws SodiumException + */ + public static function scalar_add($a, $b) + { + $a_ = $a . str_repeat("\x00", 32); + $b_ = $b . str_repeat("\x00", 32); + ParagonIE_Sodium_Compat::add($a_, $b_); + return self::sc_reduce($a_); + } + + /** + * @param string $x + * @param string $y + * @return string + * @throws SodiumException + */ + public static function scalar_sub($x, $y) + { + $yn = self::scalar_negate($y); + return self::scalar_add($x, $yn); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/HChaCha20.php b/vendor/paragonie/sodium_compat/src/Core/HChaCha20.php new file mode 100644 index 0000000..947df10 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/HChaCha20.php @@ -0,0 +1,108 @@ + 0; $i -= 2) { + $x4 ^= self::rotate($x0 + $x12, 7); + $x8 ^= self::rotate($x4 + $x0, 9); + $x12 ^= self::rotate($x8 + $x4, 13); + $x0 ^= self::rotate($x12 + $x8, 18); + $x9 ^= self::rotate($x5 + $x1, 7); + $x13 ^= self::rotate($x9 + $x5, 9); + $x1 ^= self::rotate($x13 + $x9, 13); + $x5 ^= self::rotate($x1 + $x13, 18); + $x14 ^= self::rotate($x10 + $x6, 7); + $x2 ^= self::rotate($x14 + $x10, 9); + $x6 ^= self::rotate($x2 + $x14, 13); + $x10 ^= self::rotate($x6 + $x2, 18); + $x3 ^= self::rotate($x15 + $x11, 7); + $x7 ^= self::rotate($x3 + $x15, 9); + $x11 ^= self::rotate($x7 + $x3, 13); + $x15 ^= self::rotate($x11 + $x7, 18); + $x1 ^= self::rotate($x0 + $x3, 7); + $x2 ^= self::rotate($x1 + $x0, 9); + $x3 ^= self::rotate($x2 + $x1, 13); + $x0 ^= self::rotate($x3 + $x2, 18); + $x6 ^= self::rotate($x5 + $x4, 7); + $x7 ^= self::rotate($x6 + $x5, 9); + $x4 ^= self::rotate($x7 + $x6, 13); + $x5 ^= self::rotate($x4 + $x7, 18); + $x11 ^= self::rotate($x10 + $x9, 7); + $x8 ^= self::rotate($x11 + $x10, 9); + $x9 ^= self::rotate($x8 + $x11, 13); + $x10 ^= self::rotate($x9 + $x8, 18); + $x12 ^= self::rotate($x15 + $x14, 7); + $x13 ^= self::rotate($x12 + $x15, 9); + $x14 ^= self::rotate($x13 + $x12, 13); + $x15 ^= self::rotate($x14 + $x13, 18); + } + + return self::store32_le($x0) . + self::store32_le($x5) . + self::store32_le($x10) . + self::store32_le($x15) . + self::store32_le($x6) . + self::store32_le($x7) . + self::store32_le($x8) . + self::store32_le($x9); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/Poly1305.php b/vendor/paragonie/sodium_compat/src/Core/Poly1305.php new file mode 100644 index 0000000..3301821 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/Poly1305.php @@ -0,0 +1,63 @@ +update($m) + ->finish(); + } + + /** + * @internal You should not use this directly from another application + * + * @param string $mac + * @param string $m + * @param string $key + * @return bool + * @throws SodiumException + * @throws TypeError + */ + public static function onetimeauth_verify($mac, $m, $key) + { + if (self::strlen($key) < 32) { + throw new InvalidArgumentException( + 'Key must be 32 bytes long.' + ); + } + $state = new ParagonIE_Sodium_Core_Poly1305_State( + self::substr($key, 0, 32) + ); + $calc = $state + ->update($m) + ->finish(); + return self::verify_16($calc, $mac); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/Poly1305/State.php b/vendor/paragonie/sodium_compat/src/Core/Poly1305/State.php new file mode 100644 index 0000000..4b64e04 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/Poly1305/State.php @@ -0,0 +1,445 @@ + + */ + protected $buffer = array(); + + /** + * @var bool + */ + protected $final = false; + + /** + * @var array + */ + public $h; + + /** + * @var int + */ + protected $leftover = 0; + + /** + * @var int[] + */ + public $r; + + /** + * @var int[] + */ + public $pad; + + /** + * ParagonIE_Sodium_Core_Poly1305_State constructor. + * + * @internal You should not use this directly from another application + * + * @param string $key + * @throws InvalidArgumentException + * @throws TypeError + */ + public function __construct($key = '') + { + if (self::strlen($key) < 32) { + throw new InvalidArgumentException( + 'Poly1305 requires a 32-byte key' + ); + } + /* r &= 0xffffffc0ffffffc0ffffffc0fffffff */ + $this->r = array( + (int) ((self::load_4(self::substr($key, 0, 4))) & 0x3ffffff), + (int) ((self::load_4(self::substr($key, 3, 4)) >> 2) & 0x3ffff03), + (int) ((self::load_4(self::substr($key, 6, 4)) >> 4) & 0x3ffc0ff), + (int) ((self::load_4(self::substr($key, 9, 4)) >> 6) & 0x3f03fff), + (int) ((self::load_4(self::substr($key, 12, 4)) >> 8) & 0x00fffff) + ); + + /* h = 0 */ + $this->h = array(0, 0, 0, 0, 0); + + /* save pad for later */ + $this->pad = array( + self::load_4(self::substr($key, 16, 4)), + self::load_4(self::substr($key, 20, 4)), + self::load_4(self::substr($key, 24, 4)), + self::load_4(self::substr($key, 28, 4)), + ); + + $this->leftover = 0; + $this->final = false; + } + + /** + * Zero internal buffer upon destruction + */ + public function __destruct() + { + $this->r[0] ^= $this->r[0]; + $this->r[1] ^= $this->r[1]; + $this->r[2] ^= $this->r[2]; + $this->r[3] ^= $this->r[3]; + $this->r[4] ^= $this->r[4]; + $this->h[0] ^= $this->h[0]; + $this->h[1] ^= $this->h[1]; + $this->h[2] ^= $this->h[2]; + $this->h[3] ^= $this->h[3]; + $this->h[4] ^= $this->h[4]; + $this->pad[0] ^= $this->pad[0]; + $this->pad[1] ^= $this->pad[1]; + $this->pad[2] ^= $this->pad[2]; + $this->pad[3] ^= $this->pad[3]; + $this->leftover = 0; + $this->final = true; + } + + /** + * @internal You should not use this directly from another application + * + * @param string $message + * @return self + * @throws SodiumException + * @throws TypeError + */ + public function update($message = '') + { + $bytes = self::strlen($message); + if ($bytes < 1) { + return $this; + } + + /* handle leftover */ + if ($this->leftover) { + $want = ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE - $this->leftover; + if ($want > $bytes) { + $want = $bytes; + } + for ($i = 0; $i < $want; ++$i) { + $mi = self::chrToInt($message[$i]); + $this->buffer[$this->leftover + $i] = $mi; + } + // We snip off the leftmost bytes. + $message = self::substr($message, $want); + $bytes = self::strlen($message); + $this->leftover += $want; + if ($this->leftover < ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE) { + // We still don't have enough to run $this->blocks() + return $this; + } + + $this->blocks( + self::intArrayToString($this->buffer), + ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE + ); + $this->leftover = 0; + } + + /* process full blocks */ + if ($bytes >= ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE) { + /** @var int $want */ + $want = $bytes & ~(ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE - 1); + if ($want >= ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE) { + $block = self::substr($message, 0, $want); + if (self::strlen($block) >= ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE) { + $this->blocks($block, $want); + $message = self::substr($message, $want); + $bytes = self::strlen($message); + } + } + } + + /* store leftover */ + if ($bytes) { + for ($i = 0; $i < $bytes; ++$i) { + $mi = self::chrToInt($message[$i]); + $this->buffer[$this->leftover + $i] = $mi; + } + $this->leftover = (int) $this->leftover + $bytes; + } + return $this; + } + + /** + * @internal You should not use this directly from another application + * + * @param string $message + * @param int $bytes + * @return self + * @throws TypeError + */ + public function blocks($message, $bytes) + { + if (self::strlen($message) < 16) { + $message = str_pad($message, 16, "\x00", STR_PAD_RIGHT); + } + /** @var int $hibit */ + $hibit = $this->final ? 0 : 1 << 24; /* 1 << 128 */ + $r0 = (int) $this->r[0]; + $r1 = (int) $this->r[1]; + $r2 = (int) $this->r[2]; + $r3 = (int) $this->r[3]; + $r4 = (int) $this->r[4]; + + $s1 = self::mul($r1, 5, 3); + $s2 = self::mul($r2, 5, 3); + $s3 = self::mul($r3, 5, 3); + $s4 = self::mul($r4, 5, 3); + + $h0 = $this->h[0]; + $h1 = $this->h[1]; + $h2 = $this->h[2]; + $h3 = $this->h[3]; + $h4 = $this->h[4]; + + while ($bytes >= ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE) { + /* h += m[i] */ + $h0 += self::load_4(self::substr($message, 0, 4)) & 0x3ffffff; + $h1 += (self::load_4(self::substr($message, 3, 4)) >> 2) & 0x3ffffff; + $h2 += (self::load_4(self::substr($message, 6, 4)) >> 4) & 0x3ffffff; + $h3 += (self::load_4(self::substr($message, 9, 4)) >> 6) & 0x3ffffff; + $h4 += (self::load_4(self::substr($message, 12, 4)) >> 8) | $hibit; + + /* h *= r */ + $d0 = ( + self::mul($h0, $r0, 25) + + self::mul($s4, $h1, 26) + + self::mul($s3, $h2, 26) + + self::mul($s2, $h3, 26) + + self::mul($s1, $h4, 26) + ); + + $d1 = ( + self::mul($h0, $r1, 25) + + self::mul($h1, $r0, 25) + + self::mul($s4, $h2, 26) + + self::mul($s3, $h3, 26) + + self::mul($s2, $h4, 26) + ); + + $d2 = ( + self::mul($h0, $r2, 25) + + self::mul($h1, $r1, 25) + + self::mul($h2, $r0, 25) + + self::mul($s4, $h3, 26) + + self::mul($s3, $h4, 26) + ); + + $d3 = ( + self::mul($h0, $r3, 25) + + self::mul($h1, $r2, 25) + + self::mul($h2, $r1, 25) + + self::mul($h3, $r0, 25) + + self::mul($s4, $h4, 26) + ); + + $d4 = ( + self::mul($h0, $r4, 25) + + self::mul($h1, $r3, 25) + + self::mul($h2, $r2, 25) + + self::mul($h3, $r1, 25) + + self::mul($h4, $r0, 25) + ); + + /* (partial) h %= p */ + /** @var int $c */ + $c = $d0 >> 26; + /** @var int $h0 */ + $h0 = $d0 & 0x3ffffff; + $d1 += $c; + + /** @var int $c */ + $c = $d1 >> 26; + /** @var int $h1 */ + $h1 = $d1 & 0x3ffffff; + $d2 += $c; + + /** @var int $c */ + $c = $d2 >> 26; + /** @var int $h2 */ + $h2 = $d2 & 0x3ffffff; + $d3 += $c; + + /** @var int $c */ + $c = $d3 >> 26; + /** @var int $h3 */ + $h3 = $d3 & 0x3ffffff; + $d4 += $c; + + /** @var int $c */ + $c = $d4 >> 26; + /** @var int $h4 */ + $h4 = $d4 & 0x3ffffff; + $h0 += (int) self::mul($c, 5, 3); + + /** @var int $c */ + $c = $h0 >> 26; + /** @var int $h0 */ + $h0 &= 0x3ffffff; + $h1 += $c; + + // Chop off the left 32 bytes. + $message = self::substr( + $message, + ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE + ); + $bytes -= ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE; + } + + $this->h = array( + (int) ($h0 & 0xffffffff), + (int) ($h1 & 0xffffffff), + (int) ($h2 & 0xffffffff), + (int) ($h3 & 0xffffffff), + (int) ($h4 & 0xffffffff) + ); + return $this; + } + + /** + * @internal You should not use this directly from another application + * + * @return string + * @throws TypeError + */ + public function finish() + { + /* process the remaining block */ + if ($this->leftover) { + $i = $this->leftover; + $this->buffer[$i++] = 1; + for (; $i < ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE; ++$i) { + $this->buffer[$i] = 0; + } + $this->final = true; + $this->blocks( + self::substr( + self::intArrayToString($this->buffer), + 0, + ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE + ), + ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE + ); + } + + $h0 = (int) $this->h[0]; + $h1 = (int) $this->h[1]; + $h2 = (int) $this->h[2]; + $h3 = (int) $this->h[3]; + $h4 = (int) $this->h[4]; + + /** @var int $c */ + $c = $h1 >> 26; + /** @var int $h1 */ + $h1 &= 0x3ffffff; + /** @var int $h2 */ + $h2 += $c; + /** @var int $c */ + $c = $h2 >> 26; + /** @var int $h2 */ + $h2 &= 0x3ffffff; + $h3 += $c; + /** @var int $c */ + $c = $h3 >> 26; + $h3 &= 0x3ffffff; + $h4 += $c; + /** @var int $c */ + $c = $h4 >> 26; + $h4 &= 0x3ffffff; + /** @var int $h0 */ + $h0 += self::mul($c, 5, 3); + /** @var int $c */ + $c = $h0 >> 26; + /** @var int $h0 */ + $h0 &= 0x3ffffff; + /** @var int $h1 */ + $h1 += $c; + + /* compute h + -p */ + /** @var int $g0 */ + $g0 = $h0 + 5; + /** @var int $c */ + $c = $g0 >> 26; + /** @var int $g0 */ + $g0 &= 0x3ffffff; + + /** @var int $g1 */ + $g1 = $h1 + $c; + /** @var int $c */ + $c = $g1 >> 26; + $g1 &= 0x3ffffff; + + /** @var int $g2 */ + $g2 = $h2 + $c; + /** @var int $c */ + $c = $g2 >> 26; + /** @var int $g2 */ + $g2 &= 0x3ffffff; + + /** @var int $g3 */ + $g3 = $h3 + $c; + /** @var int $c */ + $c = $g3 >> 26; + /** @var int $g3 */ + $g3 &= 0x3ffffff; + + /** @var int $g4 */ + $g4 = ($h4 + $c - (1 << 26)) & 0xffffffff; + + /* select h if h < p, or h + -p if h >= p */ + /** @var int $mask */ + $mask = ($g4 >> 31) - 1; + + $g0 &= $mask; + $g1 &= $mask; + $g2 &= $mask; + $g3 &= $mask; + $g4 &= $mask; + + /** @var int $mask */ + $mask = ~$mask & 0xffffffff; + /** @var int $h0 */ + $h0 = ($h0 & $mask) | $g0; + /** @var int $h1 */ + $h1 = ($h1 & $mask) | $g1; + /** @var int $h2 */ + $h2 = ($h2 & $mask) | $g2; + /** @var int $h3 */ + $h3 = ($h3 & $mask) | $g3; + /** @var int $h4 */ + $h4 = ($h4 & $mask) | $g4; + + /* h = h % (2^128) */ + /** @var int $h0 */ + $h0 = (($h0) | ($h1 << 26)) & 0xffffffff; + /** @var int $h1 */ + $h1 = (($h1 >> 6) | ($h2 << 20)) & 0xffffffff; + /** @var int $h2 */ + $h2 = (($h2 >> 12) | ($h3 << 14)) & 0xffffffff; + /** @var int $h3 */ + $h3 = (($h3 >> 18) | ($h4 << 8)) & 0xffffffff; + + /* mac = (h + pad) % (2^128) */ + $f = (int) ($h0 + $this->pad[0]); + $h0 = (int) $f; + $f = (int) ($h1 + $this->pad[1] + ($f >> 32)); + $h1 = (int) $f; + $f = (int) ($h2 + $this->pad[2] + ($f >> 32)); + $h2 = (int) $f; + $f = (int) ($h3 + $this->pad[3] + ($f >> 32)); + $h3 = (int) $f; + + return self::store32_le($h0 & 0xffffffff) . + self::store32_le($h1 & 0xffffffff) . + self::store32_le($h2 & 0xffffffff) . + self::store32_le($h3 & 0xffffffff); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/Ristretto255.php b/vendor/paragonie/sodium_compat/src/Core/Ristretto255.php new file mode 100644 index 0000000..27dbbaa --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/Ristretto255.php @@ -0,0 +1,707 @@ +> 31) & 1; + } + + + /** + * @param ParagonIE_Sodium_Core_Curve25519_Fe $u + * @param ParagonIE_Sodium_Core_Curve25519_Fe $v + * @return array{x: ParagonIE_Sodium_Core_Curve25519_Fe, nonsquare: int} + * + * @throws SodiumException + */ + public static function ristretto255_sqrt_ratio_m1( + ParagonIE_Sodium_Core_Curve25519_Fe $u, + ParagonIE_Sodium_Core_Curve25519_Fe $v + ) { + $sqrtm1 = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$sqrtm1); + + $v3 = self::fe_mul( + self::fe_sq($v), + $v + ); /* v3 = v^3 */ + $x = self::fe_mul( + self::fe_mul( + self::fe_sq($v3), + $u + ), + $v + ); /* x = uv^7 */ + + $x = self::fe_mul( + self::fe_mul( + self::fe_pow22523($x), /* x = (uv^7)^((q-5)/8) */ + $v3 + ), + $u + ); /* x = uv^3(uv^7)^((q-5)/8) */ + + $vxx = self::fe_mul( + self::fe_sq($x), + $v + ); /* vx^2 */ + + $m_root_check = self::fe_sub($vxx, $u); /* vx^2-u */ + $p_root_check = self::fe_add($vxx, $u); /* vx^2+u */ + $f_root_check = self::fe_mul($u, $sqrtm1); /* u*sqrt(-1) */ + $f_root_check = self::fe_add($vxx, $f_root_check); /* vx^2+u*sqrt(-1) */ + + $has_m_root = self::fe_iszero($m_root_check); + $has_p_root = self::fe_iszero($p_root_check); + $has_f_root = self::fe_iszero($f_root_check); + + $x_sqrtm1 = self::fe_mul($x, $sqrtm1); /* x*sqrt(-1) */ + + $x = self::fe_abs( + self::fe_cmov($x, $x_sqrtm1, $has_p_root | $has_f_root) + ); + return array( + 'x' => $x, + 'nonsquare' => $has_m_root | $has_p_root + ); + } + + /** + * @param string $s + * @return int + * @throws SodiumException + */ + public static function ristretto255_point_is_canonical($s) + { + $c = (self::chrToInt($s[31]) & 0x7f) ^ 0x7f; + for ($i = 30; $i > 0; --$i) { + $c |= self::chrToInt($s[$i]) ^ 0xff; + } + $c = ($c - 1) >> 8; + $d = (0xed - 1 - self::chrToInt($s[0])) >> 8; + $e = self::chrToInt($s[31]) >> 7; + + return 1 - ((($c & $d) | $e | self::chrToInt($s[0])) & 1); + } + + /** + * @param string $s + * @param bool $skipCanonicalCheck + * @return array{h: ParagonIE_Sodium_Core_Curve25519_Ge_P3, res: int} + * @throws SodiumException + */ + public static function ristretto255_frombytes($s, $skipCanonicalCheck = false) + { + if (!$skipCanonicalCheck) { + if (!self::ristretto255_point_is_canonical($s)) { + throw new SodiumException('S is not canonical'); + } + } + + $s_ = self::fe_frombytes($s); + $ss = self::fe_sq($s_); /* ss = s^2 */ + + $u1 = self::fe_sub(self::fe_1(), $ss); /* u1 = 1-ss */ + $u1u1 = self::fe_sq($u1); /* u1u1 = u1^2 */ + + $u2 = self::fe_add(self::fe_1(), $ss); /* u2 = 1+ss */ + $u2u2 = self::fe_sq($u2); /* u2u2 = u2^2 */ + + $v = self::fe_mul( + ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$d), + $u1u1 + ); /* v = d*u1^2 */ + $v = self::fe_neg($v); /* v = -d*u1^2 */ + $v = self::fe_sub($v, $u2u2); /* v = -(d*u1^2)-u2^2 */ + $v_u2u2 = self::fe_mul($v, $u2u2); /* v_u2u2 = v*u2^2 */ + + // fe25519_1(one); + // notsquare = ristretto255_sqrt_ratio_m1(inv_sqrt, one, v_u2u2); + $one = self::fe_1(); + $result = self::ristretto255_sqrt_ratio_m1($one, $v_u2u2); + $inv_sqrt = $result['x']; + $notsquare = $result['nonsquare']; + + $h = new ParagonIE_Sodium_Core_Curve25519_Ge_P3(); + + $h->X = self::fe_mul($inv_sqrt, $u2); + $h->Y = self::fe_mul(self::fe_mul($inv_sqrt, $h->X), $v); + + $h->X = self::fe_mul($h->X, $s_); + $h->X = self::fe_abs( + self::fe_add($h->X, $h->X) + ); + $h->Y = self::fe_mul($u1, $h->Y); + $h->Z = self::fe_1(); + $h->T = self::fe_mul($h->X, $h->Y); + + $res = - ((1 - $notsquare) | self::fe_isnegative($h->T) | self::fe_iszero($h->Y)); + return array('h' => $h, 'res' => $res); + } + + /** + * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $h + * @return string + * @throws SodiumException + */ + public static function ristretto255_p3_tobytes(ParagonIE_Sodium_Core_Curve25519_Ge_P3 $h) + { + $sqrtm1 = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$sqrtm1); + $invsqrtamd = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$invsqrtamd); + + $u1 = self::fe_add($h->Z, $h->Y); /* u1 = Z+Y */ + $zmy = self::fe_sub($h->Z, $h->Y); /* zmy = Z-Y */ + $u1 = self::fe_mul($u1, $zmy); /* u1 = (Z+Y)*(Z-Y) */ + $u2 = self::fe_mul($h->X, $h->Y); /* u2 = X*Y */ + + $u1_u2u2 = self::fe_mul(self::fe_sq($u2), $u1); /* u1_u2u2 = u1*u2^2 */ + $one = self::fe_1(); + + // fe25519_1(one); + // (void) ristretto255_sqrt_ratio_m1(inv_sqrt, one, u1_u2u2); + $result = self::ristretto255_sqrt_ratio_m1($one, $u1_u2u2); + $inv_sqrt = $result['x']; + + $den1 = self::fe_mul($inv_sqrt, $u1); /* den1 = inv_sqrt*u1 */ + $den2 = self::fe_mul($inv_sqrt, $u2); /* den2 = inv_sqrt*u2 */ + $z_inv = self::fe_mul($h->T, self::fe_mul($den1, $den2)); /* z_inv = den1*den2*T */ + + $ix = self::fe_mul($h->X, $sqrtm1); /* ix = X*sqrt(-1) */ + $iy = self::fe_mul($h->Y, $sqrtm1); /* iy = Y*sqrt(-1) */ + $eden = self::fe_mul($den1, $invsqrtamd); + + $t_z_inv = self::fe_mul($h->T, $z_inv); /* t_z_inv = T*z_inv */ + $rotate = self::fe_isnegative($t_z_inv); + + $x_ = self::fe_copy($h->X); + $y_ = self::fe_copy($h->Y); + $den_inv = self::fe_copy($den2); + + $x_ = self::fe_cmov($x_, $iy, $rotate); + $y_ = self::fe_cmov($y_, $ix, $rotate); + $den_inv = self::fe_cmov($den_inv, $eden, $rotate); + + $x_z_inv = self::fe_mul($x_, $z_inv); + $y_ = self::fe_cneg($y_, self::fe_isnegative($x_z_inv)); + + + // fe25519_sub(s_, h->Z, y_); + // fe25519_mul(s_, den_inv, s_); + // fe25519_abs(s_, s_); + // fe25519_tobytes(s, s_); + return self::fe_tobytes( + self::fe_abs( + self::fe_mul( + $den_inv, + self::fe_sub($h->Z, $y_) + ) + ) + ); + } + + /** + * @param ParagonIE_Sodium_Core_Curve25519_Fe $t + * @return ParagonIE_Sodium_Core_Curve25519_Ge_P3 + * + * @throws SodiumException + */ + public static function ristretto255_elligator(ParagonIE_Sodium_Core_Curve25519_Fe $t) + { + $sqrtm1 = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$sqrtm1); + $onemsqd = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$onemsqd); + $d = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$d); + $sqdmone = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$sqdmone); + $sqrtadm1 = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$sqrtadm1); + + $one = self::fe_1(); + $r = self::fe_mul($sqrtm1, self::fe_sq($t)); /* r = sqrt(-1)*t^2 */ + $u = self::fe_mul(self::fe_add($r, $one), $onemsqd); /* u = (r+1)*(1-d^2) */ + $c = self::fe_neg(self::fe_1()); /* c = -1 */ + $rpd = self::fe_add($r, $d); /* rpd = r+d */ + + $v = self::fe_mul( + self::fe_sub( + $c, + self::fe_mul($r, $d) + ), + $rpd + ); /* v = (c-r*d)*(r+d) */ + + $result = self::ristretto255_sqrt_ratio_m1($u, $v); + $s = $result['x']; + $wasnt_square = 1 - $result['nonsquare']; + + $s_prime = self::fe_neg( + self::fe_abs( + self::fe_mul($s, $t) + ) + ); /* s_prime = -|s*t| */ + $s = self::fe_cmov($s, $s_prime, $wasnt_square); + $c = self::fe_cmov($c, $r, $wasnt_square); + + // fe25519_sub(n, r, one); /* n = r-1 */ + // fe25519_mul(n, n, c); /* n = c*(r-1) */ + // fe25519_mul(n, n, ed25519_sqdmone); /* n = c*(r-1)*(d-1)^2 */ + // fe25519_sub(n, n, v); /* n = c*(r-1)*(d-1)^2-v */ + $n = self::fe_sub( + self::fe_mul( + self::fe_mul( + self::fe_sub($r, $one), + $c + ), + $sqdmone + ), + $v + ); /* n = c*(r-1)*(d-1)^2-v */ + + $w0 = self::fe_mul( + self::fe_add($s, $s), + $v + ); /* w0 = 2s*v */ + + $w1 = self::fe_mul($n, $sqrtadm1); /* w1 = n*sqrt(ad-1) */ + $ss = self::fe_sq($s); /* ss = s^2 */ + $w2 = self::fe_sub($one, $ss); /* w2 = 1-s^2 */ + $w3 = self::fe_add($one, $ss); /* w3 = 1+s^2 */ + + return new ParagonIE_Sodium_Core_Curve25519_Ge_P3( + self::fe_mul($w0, $w3), + self::fe_mul($w2, $w1), + self::fe_mul($w1, $w3), + self::fe_mul($w0, $w2) + ); + } + + /** + * @param string $h + * @return string + * @throws SodiumException + */ + public static function ristretto255_from_hash($h) + { + if (self::strlen($h) !== 64) { + throw new SodiumException('Hash must be 64 bytes'); + } + //fe25519_frombytes(r0, h); + //fe25519_frombytes(r1, h + 32); + $r0 = self::fe_frombytes(self::substr($h, 0, 32)); + $r1 = self::fe_frombytes(self::substr($h, 32, 32)); + + //ristretto255_elligator(&p0, r0); + //ristretto255_elligator(&p1, r1); + $p0 = self::ristretto255_elligator($r0); + $p1 = self::ristretto255_elligator($r1); + + //ge25519_p3_to_cached(&p1_cached, &p1); + //ge25519_add_cached(&p_p1p1, &p0, &p1_cached); + $p_p1p1 = self::ge_add( + $p0, + self::ge_p3_to_cached($p1) + ); + + //ge25519_p1p1_to_p3(&p, &p_p1p1); + //ristretto255_p3_tobytes(s, &p); + return self::ristretto255_p3_tobytes( + self::ge_p1p1_to_p3($p_p1p1) + ); + } + + /** + * @param string $p + * @return int + * @throws SodiumException + */ + public static function is_valid_point($p) + { + $result = self::ristretto255_frombytes($p); + if ($result['res'] !== 0) { + return 0; + } + return 1; + } + + /** + * @param string $p + * @param string $q + * @return string + * @throws SodiumException + */ + public static function ristretto255_add($p, $q) + { + $p_res = self::ristretto255_frombytes($p); + $q_res = self::ristretto255_frombytes($q); + if ($p_res['res'] !== 0 || $q_res['res'] !== 0) { + throw new SodiumException('Could not add points'); + } + $p_p3 = $p_res['h']; + $q_p3 = $q_res['h']; + $q_cached = self::ge_p3_to_cached($q_p3); + $r_p1p1 = self::ge_add($p_p3, $q_cached); + $r_p3 = self::ge_p1p1_to_p3($r_p1p1); + return self::ristretto255_p3_tobytes($r_p3); + } + + /** + * @param string $p + * @param string $q + * @return string + * @throws SodiumException + */ + public static function ristretto255_sub($p, $q) + { + $p_res = self::ristretto255_frombytes($p); + $q_res = self::ristretto255_frombytes($q); + if ($p_res['res'] !== 0 || $q_res['res'] !== 0) { + throw new SodiumException('Could not add points'); + } + $p_p3 = $p_res['h']; + $q_p3 = $q_res['h']; + $q_cached = self::ge_p3_to_cached($q_p3); + $r_p1p1 = self::ge_sub($p_p3, $q_cached); + $r_p3 = self::ge_p1p1_to_p3($r_p1p1); + return self::ristretto255_p3_tobytes($r_p3); + } + + + /** + * @param int $hLen + * @param ?string $ctx + * @param string $msg + * @return string + * @throws SodiumException + * @psalm-suppress PossiblyInvalidArgument hash API + */ + protected static function h2c_string_to_hash_sha256($hLen, $ctx, $msg) + { + $h = array_fill(0, $hLen, 0); + $ctx_len = !is_null($ctx) ? self::strlen($ctx) : 0; + if ($hLen > 0xff) { + throw new SodiumException('Hash must be less than 256 bytes'); + } + + if ($ctx_len > 0xff) { + $st = hash_init('sha256'); + self::hash_update($st, "H2C-OVERSIZE-DST-"); + self::hash_update($st, $ctx); + $ctx = hash_final($st, true); + $ctx_len = 32; + } + $t = array(0, $hLen, 0); + $ux = str_repeat("\0", 64); + $st = hash_init('sha256'); + self::hash_update($st, $ux); + self::hash_update($st, $msg); + self::hash_update($st, self::intArrayToString($t)); + self::hash_update($st, $ctx); + self::hash_update($st, self::intToChr($ctx_len)); + $u0 = hash_final($st, true); + + for ($i = 0; $i < $hLen; $i += 64) { + $ux = self::xorStrings($ux, $u0); + ++$t[2]; + $st = hash_init('sha256'); + self::hash_update($st, $ux); + self::hash_update($st, self::intToChr($t[2])); + self::hash_update($st, $ctx); + self::hash_update($st, self::intToChr($ctx_len)); + $ux = hash_final($st, true); + $amount = min($hLen - $i, 64); + for ($j = 0; $j < $amount; ++$j) { + $h[$i + $j] = self::chrToInt($ux[$i]); + } + } + return self::intArrayToString(array_slice($h, 0, $hLen)); + } + + /** + * @param int $hLen + * @param ?string $ctx + * @param string $msg + * @return string + * @throws SodiumException + * @psalm-suppress PossiblyInvalidArgument hash API + */ + protected static function h2c_string_to_hash_sha512($hLen, $ctx, $msg) + { + $h = array_fill(0, $hLen, 0); + $ctx_len = !is_null($ctx) ? self::strlen($ctx) : 0; + if ($hLen > 0xff) { + throw new SodiumException('Hash must be less than 256 bytes'); + } + + if ($ctx_len > 0xff) { + $st = hash_init('sha256'); + self::hash_update($st, "H2C-OVERSIZE-DST-"); + self::hash_update($st, $ctx); + $ctx = hash_final($st, true); + $ctx_len = 32; + } + $t = array(0, $hLen, 0); + $ux = str_repeat("\0", 128); + $st = hash_init('sha512'); + self::hash_update($st, $ux); + self::hash_update($st, $msg); + self::hash_update($st, self::intArrayToString($t)); + self::hash_update($st, $ctx); + self::hash_update($st, self::intToChr($ctx_len)); + $u0 = hash_final($st, true); + + for ($i = 0; $i < $hLen; $i += 128) { + $ux = self::xorStrings($ux, $u0); + ++$t[2]; + $st = hash_init('sha512'); + self::hash_update($st, $ux); + self::hash_update($st, self::intToChr($t[2])); + self::hash_update($st, $ctx); + self::hash_update($st, self::intToChr($ctx_len)); + $ux = hash_final($st, true); + $amount = min($hLen - $i, 128); + for ($j = 0; $j < $amount; ++$j) { + $h[$i + $j] = self::chrToInt($ux[$i]); + } + } + return self::intArrayToString(array_slice($h, 0, $hLen)); + } + + /** + * @param int $hLen + * @param ?string $ctx + * @param string $msg + * @param int $hash_alg + * @return string + * @throws SodiumException + */ + public static function h2c_string_to_hash($hLen, $ctx, $msg, $hash_alg) + { + switch ($hash_alg) { + case self::CORE_H2C_SHA256: + return self::h2c_string_to_hash_sha256($hLen, $ctx, $msg); + case self::CORE_H2C_SHA512: + return self::h2c_string_to_hash_sha512($hLen, $ctx, $msg); + default: + throw new SodiumException('Invalid H2C hash algorithm'); + } + } + + /** + * @param ?string $ctx + * @param string $msg + * @param int $hash_alg + * @return string + * @throws SodiumException + */ + protected static function _string_to_element($ctx, $msg, $hash_alg) + { + return self::ristretto255_from_hash( + self::h2c_string_to_hash(self::crypto_core_ristretto255_HASHBYTES, $ctx, $msg, $hash_alg) + ); + } + + /** + * @return string + * @throws SodiumException + * @throws Exception + */ + public static function ristretto255_random() + { + return self::ristretto255_from_hash( + ParagonIE_Sodium_Compat::randombytes_buf(self::crypto_core_ristretto255_HASHBYTES) + ); + } + + /** + * @return string + * @throws SodiumException + */ + public static function ristretto255_scalar_random() + { + return self::scalar_random(); + } + + /** + * @param string $s + * @return string + * @throws SodiumException + */ + public static function ristretto255_scalar_complement($s) + { + return self::scalar_complement($s); + } + + + /** + * @param string $s + * @return string + */ + public static function ristretto255_scalar_invert($s) + { + return self::sc25519_invert($s); + } + + /** + * @param string $s + * @return string + * @throws SodiumException + */ + public static function ristretto255_scalar_negate($s) + { + return self::scalar_negate($s); + } + + /** + * @param string $x + * @param string $y + * @return string + */ + public static function ristretto255_scalar_add($x, $y) + { + return self::scalar_add($x, $y); + } + + /** + * @param string $x + * @param string $y + * @return string + */ + public static function ristretto255_scalar_sub($x, $y) + { + return self::scalar_sub($x, $y); + } + + /** + * @param string $x + * @param string $y + * @return string + */ + public static function ristretto255_scalar_mul($x, $y) + { + return self::sc25519_mul($x, $y); + } + + /** + * @param string $ctx + * @param string $msg + * @param int $hash_alg + * @return string + * @throws SodiumException + */ + public static function ristretto255_scalar_from_string($ctx, $msg, $hash_alg) + { + $h = array_fill(0, 64, 0); + $h_be = self::stringToIntArray( + self::h2c_string_to_hash( + self::HASH_SC_L, $ctx, $msg, $hash_alg + ) + ); + + for ($i = 0; $i < self::HASH_SC_L; ++$i) { + $h[$i] = $h_be[self::HASH_SC_L - 1 - $i]; + } + return self::ristretto255_scalar_reduce(self::intArrayToString($h)); + } + + /** + * @param string $s + * @return string + */ + public static function ristretto255_scalar_reduce($s) + { + return self::sc_reduce($s); + } + + /** + * @param string $n + * @param string $p + * @return string + * @throws SodiumException + */ + public static function scalarmult_ristretto255($n, $p) + { + if (self::strlen($n) !== 32) { + throw new SodiumException('Scalar must be 32 bytes, ' . self::strlen($p) . ' given.'); + } + if (self::strlen($p) !== 32) { + throw new SodiumException('Point must be 32 bytes, ' . self::strlen($p) . ' given.'); + } + $result = self::ristretto255_frombytes($p); + if ($result['res'] !== 0) { + throw new SodiumException('Could not multiply points'); + } + $P = $result['h']; + + $t = self::stringToIntArray($n); + $t[31] &= 0x7f; + $Q = self::ge_scalarmult(self::intArrayToString($t), $P); + $q = self::ristretto255_p3_tobytes($Q); + if (ParagonIE_Sodium_Compat::is_zero($q)) { + throw new SodiumException('An unknown error has occurred'); + } + return $q; + } + + /** + * @param string $n + * @return string + * @throws SodiumException + */ + public static function scalarmult_ristretto255_base($n) + { + $t = self::stringToIntArray($n); + $t[31] &= 0x7f; + $Q = self::ge_scalarmult_base(self::intArrayToString($t)); + $q = self::ristretto255_p3_tobytes($Q); + if (ParagonIE_Sodium_Compat::is_zero($q)) { + throw new SodiumException('An unknown error has occurred'); + } + return $q; + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/Salsa20.php b/vendor/paragonie/sodium_compat/src/Core/Salsa20.php new file mode 100644 index 0000000..515ccad --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/Salsa20.php @@ -0,0 +1,273 @@ + 0; $i -= 2) { + $x4 ^= self::rotate($x0 + $x12, 7); + $x8 ^= self::rotate($x4 + $x0, 9); + $x12 ^= self::rotate($x8 + $x4, 13); + $x0 ^= self::rotate($x12 + $x8, 18); + + $x9 ^= self::rotate($x5 + $x1, 7); + $x13 ^= self::rotate($x9 + $x5, 9); + $x1 ^= self::rotate($x13 + $x9, 13); + $x5 ^= self::rotate($x1 + $x13, 18); + + $x14 ^= self::rotate($x10 + $x6, 7); + $x2 ^= self::rotate($x14 + $x10, 9); + $x6 ^= self::rotate($x2 + $x14, 13); + $x10 ^= self::rotate($x6 + $x2, 18); + + $x3 ^= self::rotate($x15 + $x11, 7); + $x7 ^= self::rotate($x3 + $x15, 9); + $x11 ^= self::rotate($x7 + $x3, 13); + $x15 ^= self::rotate($x11 + $x7, 18); + + $x1 ^= self::rotate($x0 + $x3, 7); + $x2 ^= self::rotate($x1 + $x0, 9); + $x3 ^= self::rotate($x2 + $x1, 13); + $x0 ^= self::rotate($x3 + $x2, 18); + + $x6 ^= self::rotate($x5 + $x4, 7); + $x7 ^= self::rotate($x6 + $x5, 9); + $x4 ^= self::rotate($x7 + $x6, 13); + $x5 ^= self::rotate($x4 + $x7, 18); + + $x11 ^= self::rotate($x10 + $x9, 7); + $x8 ^= self::rotate($x11 + $x10, 9); + $x9 ^= self::rotate($x8 + $x11, 13); + $x10 ^= self::rotate($x9 + $x8, 18); + + $x12 ^= self::rotate($x15 + $x14, 7); + $x13 ^= self::rotate($x12 + $x15, 9); + $x14 ^= self::rotate($x13 + $x12, 13); + $x15 ^= self::rotate($x14 + $x13, 18); + } + + $x0 += $j0; + $x1 += $j1; + $x2 += $j2; + $x3 += $j3; + $x4 += $j4; + $x5 += $j5; + $x6 += $j6; + $x7 += $j7; + $x8 += $j8; + $x9 += $j9; + $x10 += $j10; + $x11 += $j11; + $x12 += $j12; + $x13 += $j13; + $x14 += $j14; + $x15 += $j15; + + return self::store32_le($x0) . + self::store32_le($x1) . + self::store32_le($x2) . + self::store32_le($x3) . + self::store32_le($x4) . + self::store32_le($x5) . + self::store32_le($x6) . + self::store32_le($x7) . + self::store32_le($x8) . + self::store32_le($x9) . + self::store32_le($x10) . + self::store32_le($x11) . + self::store32_le($x12) . + self::store32_le($x13) . + self::store32_le($x14) . + self::store32_le($x15); + } + + /** + * @internal You should not use this directly from another application + * + * @param int $len + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function salsa20($len, $nonce, $key) + { + if (self::strlen($key) !== 32) { + throw new RangeException('Key must be 32 bytes long'); + } + $kcopy = '' . $key; + $in = self::substr($nonce, 0, 8) . str_repeat("\0", 8); + $c = ''; + while ($len >= 64) { + $c .= self::core_salsa20($in, $kcopy, null); + $u = 1; + // Internal counter. + for ($i = 8; $i < 16; ++$i) { + $u += self::chrToInt($in[$i]); + $in[$i] = self::intToChr($u & 0xff); + $u >>= 8; + } + $len -= 64; + } + if ($len > 0) { + $c .= self::substr( + self::core_salsa20($in, $kcopy, null), + 0, + $len + ); + } + try { + ParagonIE_Sodium_Compat::memzero($kcopy); + } catch (SodiumException $ex) { + $kcopy = null; + } + return $c; + } + + /** + * @internal You should not use this directly from another application + * + * @param string $m + * @param string $n + * @param int $ic + * @param string $k + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function salsa20_xor_ic($m, $n, $ic, $k) + { + $mlen = self::strlen($m); + if ($mlen < 1) { + return ''; + } + $kcopy = self::substr($k, 0, 32); + $in = self::substr($n, 0, 8); + // Initialize the counter + $in .= ParagonIE_Sodium_Core_Util::store64_le($ic); + + $c = ''; + while ($mlen >= 64) { + $block = self::core_salsa20($in, $kcopy, null); + $c .= self::xorStrings( + self::substr($m, 0, 64), + self::substr($block, 0, 64) + ); + $u = 1; + for ($i = 8; $i < 16; ++$i) { + $u += self::chrToInt($in[$i]); + $in[$i] = self::intToChr($u & 0xff); + $u >>= 8; + } + + $mlen -= 64; + $m = self::substr($m, 64); + } + + if ($mlen) { + $block = self::core_salsa20($in, $kcopy, null); + $c .= self::xorStrings( + self::substr($m, 0, $mlen), + self::substr($block, 0, $mlen) + ); + } + try { + ParagonIE_Sodium_Compat::memzero($block); + ParagonIE_Sodium_Compat::memzero($kcopy); + } catch (SodiumException $ex) { + $block = null; + $kcopy = null; + } + + return $c; + } + + /** + * @internal You should not use this directly from another application + * + * @param string $message + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function salsa20_xor($message, $nonce, $key) + { + return self::xorStrings( + $message, + self::salsa20( + self::strlen($message), + $nonce, + $key + ) + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param int $u + * @param int $c + * @return int + */ + public static function rotate($u, $c) + { + $u &= 0xffffffff; + $c %= 32; + return (int) (0xffffffff & ( + ($u << $c) + | + ($u >> (32 - $c)) + ) + ); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/SecretStream/State.php b/vendor/paragonie/sodium_compat/src/Core/SecretStream/State.php new file mode 100644 index 0000000..2412f65 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/SecretStream/State.php @@ -0,0 +1,163 @@ +key = $key; + $this->counter = 1; + if (is_null($nonce)) { + $nonce = str_repeat("\0", 12); + } + $this->nonce = str_pad($nonce, 12, "\0", STR_PAD_RIGHT);; + $this->_pad = str_repeat("\0", 4); + } + + /** + * @return self + */ + public function counterReset() + { + $this->counter = 1; + $this->_pad = str_repeat("\0", 4); + return $this; + } + + /** + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * @return string + */ + public function getCounter() + { + return ParagonIE_Sodium_Core_Util::store32_le($this->counter); + } + + /** + * @return string + */ + public function getNonce() + { + if (!is_string($this->nonce)) { + $this->nonce = str_repeat("\0", 12); + } + if (ParagonIE_Sodium_Core_Util::strlen($this->nonce) !== 12) { + $this->nonce = str_pad($this->nonce, 12, "\0", STR_PAD_RIGHT); + } + return $this->nonce; + } + + /** + * @return string + */ + public function getCombinedNonce() + { + return $this->getCounter() . + ParagonIE_Sodium_Core_Util::substr($this->getNonce(), 0, 8); + } + + /** + * @return self + */ + public function incrementCounter() + { + ++$this->counter; + return $this; + } + + /** + * @return bool + */ + public function needsRekey() + { + return ($this->counter & 0xffff) === 0; + } + + /** + * @param string $newKeyAndNonce + * @return self + */ + public function rekey($newKeyAndNonce) + { + $this->key = ParagonIE_Sodium_Core_Util::substr($newKeyAndNonce, 0, 32); + $this->nonce = str_pad( + ParagonIE_Sodium_Core_Util::substr($newKeyAndNonce, 32), + 12, + "\0", + STR_PAD_RIGHT + ); + return $this; + } + + /** + * @param string $str + * @return self + */ + public function xorNonce($str) + { + $this->nonce = ParagonIE_Sodium_Core_Util::xorStrings( + $this->getNonce(), + str_pad( + ParagonIE_Sodium_Core_Util::substr($str, 0, 8), + 12, + "\0", + STR_PAD_RIGHT + ) + ); + return $this; + } + + /** + * @param string $string + * @return self + */ + public static function fromString($string) + { + $state = new ParagonIE_Sodium_Core_SecretStream_State( + ParagonIE_Sodium_Core_Util::substr($string, 0, 32) + ); + $state->counter = ParagonIE_Sodium_Core_Util::load_4( + ParagonIE_Sodium_Core_Util::substr($string, 32, 4) + ); + $state->nonce = ParagonIE_Sodium_Core_Util::substr($string, 36, 12); + $state->_pad = ParagonIE_Sodium_Core_Util::substr($string, 48, 8); + return $state; + } + + /** + * @return string + */ + public function toString() + { + return $this->key . + $this->getCounter() . + $this->nonce . + $this->_pad; + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/SipHash.php b/vendor/paragonie/sodium_compat/src/Core/SipHash.php new file mode 100644 index 0000000..7667527 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/SipHash.php @@ -0,0 +1,306 @@ + + */ + public static function add(array $a, array $b) + { + /** @var int $x1 */ + $x1 = $a[1] + $b[1]; + /** @var int $c */ + $c = $x1 >> 32; // Carry if ($a + $b) > 0xffffffff + /** @var int $x0 */ + $x0 = $a[0] + $b[0] + $c; + return array( + $x0 & 0xffffffff, + $x1 & 0xffffffff + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param int $int0 + * @param int $int1 + * @param int $c + * @return array + */ + public static function rotl_64($int0, $int1, $c) + { + $int0 &= 0xffffffff; + $int1 &= 0xffffffff; + $c &= 63; + if ($c === 32) { + return array($int1, $int0); + } + if ($c > 31) { + $tmp = $int1; + $int1 = $int0; + $int0 = $tmp; + $c &= 31; + } + if ($c === 0) { + return array($int0, $int1); + } + return array( + 0xffffffff & ( + ($int0 << $c) + | + ($int1 >> (32 - $c)) + ), + 0xffffffff & ( + ($int1 << $c) + | + ($int0 >> (32 - $c)) + ), + ); + } + + /** + * Implements Siphash-2-4 using only 32-bit numbers. + * + * When we split an int into two, the higher bits go to the lower index. + * e.g. 0xDEADBEEFAB10C92D becomes [ + * 0 => 0xDEADBEEF, + * 1 => 0xAB10C92D + * ]. + * + * @internal You should not use this directly from another application + * + * @param string $in + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function sipHash24($in, $key) + { + $inlen = self::strlen($in); + + # /* "somepseudorandomlygeneratedbytes" */ + # u64 v0 = 0x736f6d6570736575ULL; + # u64 v1 = 0x646f72616e646f6dULL; + # u64 v2 = 0x6c7967656e657261ULL; + # u64 v3 = 0x7465646279746573ULL; + $v = array( + 0x736f6d65, // 0 + 0x70736575, // 1 + 0x646f7261, // 2 + 0x6e646f6d, // 3 + 0x6c796765, // 4 + 0x6e657261, // 5 + 0x74656462, // 6 + 0x79746573 // 7 + ); + // v0 => $v[0], $v[1] + // v1 => $v[2], $v[3] + // v2 => $v[4], $v[5] + // v3 => $v[6], $v[7] + + # u64 k0 = LOAD64_LE( k ); + # u64 k1 = LOAD64_LE( k + 8 ); + $k = array( + self::load_4(self::substr($key, 4, 4)), + self::load_4(self::substr($key, 0, 4)), + self::load_4(self::substr($key, 12, 4)), + self::load_4(self::substr($key, 8, 4)) + ); + // k0 => $k[0], $k[1] + // k1 => $k[2], $k[3] + + # b = ( ( u64 )inlen ) << 56; + $b = array( + $inlen << 24, + 0 + ); + // See docblock for why the 0th index gets the higher bits. + + # v3 ^= k1; + $v[6] ^= $k[2]; + $v[7] ^= $k[3]; + # v2 ^= k0; + $v[4] ^= $k[0]; + $v[5] ^= $k[1]; + # v1 ^= k1; + $v[2] ^= $k[2]; + $v[3] ^= $k[3]; + # v0 ^= k0; + $v[0] ^= $k[0]; + $v[1] ^= $k[1]; + + $left = $inlen; + # for ( ; in != end; in += 8 ) + while ($left >= 8) { + # m = LOAD64_LE( in ); + $m = array( + self::load_4(self::substr($in, 4, 4)), + self::load_4(self::substr($in, 0, 4)) + ); + + # v3 ^= m; + $v[6] ^= $m[0]; + $v[7] ^= $m[1]; + + # SIPROUND; + # SIPROUND; + $v = self::sipRound($v); + $v = self::sipRound($v); + + # v0 ^= m; + $v[0] ^= $m[0]; + $v[1] ^= $m[1]; + + $in = self::substr($in, 8); + $left -= 8; + } + + # switch( left ) + # { + # case 7: b |= ( ( u64 )in[ 6] ) << 48; + # case 6: b |= ( ( u64 )in[ 5] ) << 40; + # case 5: b |= ( ( u64 )in[ 4] ) << 32; + # case 4: b |= ( ( u64 )in[ 3] ) << 24; + # case 3: b |= ( ( u64 )in[ 2] ) << 16; + # case 2: b |= ( ( u64 )in[ 1] ) << 8; + # case 1: b |= ( ( u64 )in[ 0] ); break; + # case 0: break; + # } + switch ($left) { + case 7: + $b[0] |= self::chrToInt($in[6]) << 16; + case 6: + $b[0] |= self::chrToInt($in[5]) << 8; + case 5: + $b[0] |= self::chrToInt($in[4]); + case 4: + $b[1] |= self::chrToInt($in[3]) << 24; + case 3: + $b[1] |= self::chrToInt($in[2]) << 16; + case 2: + $b[1] |= self::chrToInt($in[1]) << 8; + case 1: + $b[1] |= self::chrToInt($in[0]); + case 0: + break; + } + // See docblock for why the 0th index gets the higher bits. + + # v3 ^= b; + $v[6] ^= $b[0]; + $v[7] ^= $b[1]; + + # SIPROUND; + # SIPROUND; + $v = self::sipRound($v); + $v = self::sipRound($v); + + # v0 ^= b; + $v[0] ^= $b[0]; + $v[1] ^= $b[1]; + + // Flip the lower 8 bits of v2 which is ($v[4], $v[5]) in our implementation + # v2 ^= 0xff; + $v[5] ^= 0xff; + + # SIPROUND; + # SIPROUND; + # SIPROUND; + # SIPROUND; + $v = self::sipRound($v); + $v = self::sipRound($v); + $v = self::sipRound($v); + $v = self::sipRound($v); + + # b = v0 ^ v1 ^ v2 ^ v3; + # STORE64_LE( out, b ); + return self::store32_le($v[1] ^ $v[3] ^ $v[5] ^ $v[7]) . + self::store32_le($v[0] ^ $v[2] ^ $v[4] ^ $v[6]); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/Util.php b/vendor/paragonie/sodium_compat/src/Core/Util.php new file mode 100644 index 0000000..865f544 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/Util.php @@ -0,0 +1,942 @@ +> $size) & 1); + return (int) ( + ($integer ^ $negative) + + + (($negative >> $realSize) & 1) + ); + } + + /** + * Convert a binary string into a hexadecimal string without cache-timing + * leaks + * + * @internal You should not use this directly from another application + * + * @param string $binaryString (raw binary) + * @return string + * @throws TypeError + */ + public static function bin2hex($binaryString) + { + /* Type checks: */ + if (!is_string($binaryString)) { + throw new TypeError('Argument 1 must be a string, ' . gettype($binaryString) . ' given.'); + } + + $hex = ''; + $len = self::strlen($binaryString); + for ($i = 0; $i < $len; ++$i) { + /** @var array $chunk */ + $chunk = unpack('C', $binaryString[$i]); + /** @var int $c */ + $c = $chunk[1] & 0xf; + /** @var int $b */ + $b = $chunk[1] >> 4; + $hex .= pack( + 'CC', + (87 + $b + ((($b - 10) >> 8) & ~38)), + (87 + $c + ((($c - 10) >> 8) & ~38)) + ); + } + return $hex; + } + + /** + * Convert a binary string into a hexadecimal string without cache-timing + * leaks, returning uppercase letters (as per RFC 4648) + * + * @internal You should not use this directly from another application + * + * @param string $bin_string (raw binary) + * @return string + * @throws TypeError + */ + public static function bin2hexUpper($bin_string) + { + $hex = ''; + $len = self::strlen($bin_string); + for ($i = 0; $i < $len; ++$i) { + /** @var array $chunk */ + $chunk = unpack('C', $bin_string[$i]); + /** + * Lower 16 bits + * + * @var int $c + */ + $c = $chunk[1] & 0xf; + + /** + * Upper 16 bits + * @var int $b + */ + $b = $chunk[1] >> 4; + + /** + * Use pack() and binary operators to turn the two integers + * into hexadecimal characters. We don't use chr() here, because + * it uses a lookup table internally and we want to avoid + * cache-timing side-channels. + */ + $hex .= pack( + 'CC', + (55 + $b + ((($b - 10) >> 8) & ~6)), + (55 + $c + ((($c - 10) >> 8) & ~6)) + ); + } + return $hex; + } + + /** + * Cache-timing-safe variant of ord() + * + * @internal You should not use this directly from another application + * + * @param string $chr + * @return int + * @throws SodiumException + * @throws TypeError + */ + public static function chrToInt($chr) + { + /* Type checks: */ + if (!is_string($chr)) { + throw new TypeError('Argument 1 must be a string, ' . gettype($chr) . ' given.'); + } + if (self::strlen($chr) !== 1) { + throw new SodiumException('chrToInt() expects a string that is exactly 1 character long'); + } + /** @var array $chunk */ + $chunk = unpack('C', $chr); + return (int) ($chunk[1]); + } + + /** + * Compares two strings. + * + * @internal You should not use this directly from another application + * + * @param string $left + * @param string $right + * @param int $len + * @return int + * @throws SodiumException + * @throws TypeError + */ + public static function compare($left, $right, $len = null) + { + $leftLen = self::strlen($left); + $rightLen = self::strlen($right); + if ($len === null) { + $len = max($leftLen, $rightLen); + $left = str_pad($left, $len, "\x00", STR_PAD_RIGHT); + $right = str_pad($right, $len, "\x00", STR_PAD_RIGHT); + } + + $gt = 0; + $eq = 1; + $i = $len; + while ($i !== 0) { + --$i; + $gt |= ((self::chrToInt($right[$i]) - self::chrToInt($left[$i])) >> 8) & $eq; + $eq &= ((self::chrToInt($right[$i]) ^ self::chrToInt($left[$i])) - 1) >> 8; + } + return ($gt + $gt + $eq) - 1; + } + + /** + * If a variable does not match a given type, throw a TypeError. + * + * @param mixed $mixedVar + * @param string $type + * @param int $argumentIndex + * @throws TypeError + * @throws SodiumException + * @return void + */ + public static function declareScalarType(&$mixedVar = null, $type = 'void', $argumentIndex = 0) + { + if (func_num_args() === 0) { + /* Tautology, by default */ + return; + } + if (func_num_args() === 1) { + throw new TypeError('Declared void, but passed a variable'); + } + $realType = strtolower(gettype($mixedVar)); + $type = strtolower($type); + switch ($type) { + case 'null': + if ($mixedVar !== null) { + throw new TypeError('Argument ' . $argumentIndex . ' must be null, ' . $realType . ' given.'); + } + break; + case 'integer': + case 'int': + $allow = array('int', 'integer'); + if (!in_array($type, $allow)) { + throw new TypeError('Argument ' . $argumentIndex . ' must be an integer, ' . $realType . ' given.'); + } + $mixedVar = (int) $mixedVar; + break; + case 'boolean': + case 'bool': + $allow = array('bool', 'boolean'); + if (!in_array($type, $allow)) { + throw new TypeError('Argument ' . $argumentIndex . ' must be a boolean, ' . $realType . ' given.'); + } + $mixedVar = (bool) $mixedVar; + break; + case 'string': + if (!is_string($mixedVar)) { + throw new TypeError('Argument ' . $argumentIndex . ' must be a string, ' . $realType . ' given.'); + } + $mixedVar = (string) $mixedVar; + break; + case 'decimal': + case 'double': + case 'float': + $allow = array('decimal', 'double', 'float'); + if (!in_array($type, $allow)) { + throw new TypeError('Argument ' . $argumentIndex . ' must be a float, ' . $realType . ' given.'); + } + $mixedVar = (float) $mixedVar; + break; + case 'object': + if (!is_object($mixedVar)) { + throw new TypeError('Argument ' . $argumentIndex . ' must be an object, ' . $realType . ' given.'); + } + break; + case 'array': + if (!is_array($mixedVar)) { + if (is_object($mixedVar)) { + if ($mixedVar instanceof ArrayAccess) { + return; + } + } + throw new TypeError('Argument ' . $argumentIndex . ' must be an array, ' . $realType . ' given.'); + } + break; + default: + throw new SodiumException('Unknown type (' . $realType .') does not match expect type (' . $type . ')'); + } + } + + /** + * Evaluate whether or not two strings are equal (in constant-time) + * + * @param string $left + * @param string $right + * @return bool + * @throws SodiumException + * @throws TypeError + */ + public static function hashEquals($left, $right) + { + /* Type checks: */ + if (!is_string($left)) { + throw new TypeError('Argument 1 must be a string, ' . gettype($left) . ' given.'); + } + if (!is_string($right)) { + throw new TypeError('Argument 2 must be a string, ' . gettype($right) . ' given.'); + } + + if (is_callable('hash_equals')) { + return hash_equals($left, $right); + } + $d = 0; + /** @var int $len */ + $len = self::strlen($left); + if ($len !== self::strlen($right)) { + return false; + } + for ($i = 0; $i < $len; ++$i) { + $d |= self::chrToInt($left[$i]) ^ self::chrToInt($right[$i]); + } + + if ($d !== 0) { + return false; + } + return $left === $right; + } + + /** + * Catch hash_update() failures and throw instead of silently proceding + * + * @param HashContext|resource &$hs + * @param string $data + * @return void + * @throws SodiumException + * @psalm-suppress PossiblyInvalidArgument + */ + protected static function hash_update(&$hs, $data) + { + if (!hash_update($hs, $data)) { + throw new SodiumException('hash_update() failed'); + } + } + + /** + * Convert a hexadecimal string into a binary string without cache-timing + * leaks + * + * @internal You should not use this directly from another application + * + * @param string $hexString + * @param bool $strictPadding + * @return string (raw binary) + * @throws RangeException + * @throws TypeError + */ + public static function hex2bin($hexString, $strictPadding = false) + { + /* Type checks: */ + if (!is_string($hexString)) { + throw new TypeError('Argument 1 must be a string, ' . gettype($hexString) . ' given.'); + } + + /** @var int $hex_pos */ + $hex_pos = 0; + /** @var string $bin */ + $bin = ''; + /** @var int $c_acc */ + $c_acc = 0; + /** @var int $hex_len */ + $hex_len = self::strlen($hexString); + /** @var int $state */ + $state = 0; + if (($hex_len & 1) !== 0) { + if ($strictPadding) { + throw new RangeException( + 'Expected an even number of hexadecimal characters' + ); + } else { + $hexString = '0' . $hexString; + ++$hex_len; + } + } + + $chunk = unpack('C*', $hexString); + while ($hex_pos < $hex_len) { + ++$hex_pos; + /** @var int $c */ + $c = $chunk[$hex_pos]; + /** @var int $c_num */ + $c_num = $c ^ 48; + /** @var int $c_num0 */ + $c_num0 = ($c_num - 10) >> 8; + /** @var int $c_alpha */ + $c_alpha = ($c & ~32) - 55; + /** @var int $c_alpha0 */ + $c_alpha0 = (($c_alpha - 10) ^ ($c_alpha - 16)) >> 8; + if (($c_num0 | $c_alpha0) === 0) { + throw new RangeException( + 'hex2bin() only expects hexadecimal characters' + ); + } + /** @var int $c_val */ + $c_val = ($c_num0 & $c_num) | ($c_alpha & $c_alpha0); + if ($state === 0) { + $c_acc = $c_val * 16; + } else { + $bin .= pack('C', $c_acc | $c_val); + } + $state ^= 1; + } + return $bin; + } + + /** + * Turn an array of integers into a string + * + * @internal You should not use this directly from another application + * + * @param array $ints + * @return string + */ + public static function intArrayToString(array $ints) + { + /** @var array $args */ + $args = $ints; + foreach ($args as $i => $v) { + $args[$i] = (int) ($v & 0xff); + } + array_unshift($args, str_repeat('C', count($ints))); + return (string) (call_user_func_array('pack', $args)); + } + + /** + * Cache-timing-safe variant of ord() + * + * @internal You should not use this directly from another application + * + * @param int $int + * @return string + * @throws TypeError + */ + public static function intToChr($int) + { + return pack('C', $int); + } + + /** + * Load a 3 character substring into an integer + * + * @internal You should not use this directly from another application + * + * @param string $string + * @return int + * @throws RangeException + * @throws TypeError + */ + public static function load_3($string) + { + /* Type checks: */ + if (!is_string($string)) { + throw new TypeError('Argument 1 must be a string, ' . gettype($string) . ' given.'); + } + + /* Input validation: */ + if (self::strlen($string) < 3) { + throw new RangeException( + 'String must be 3 bytes or more; ' . self::strlen($string) . ' given.' + ); + } + /** @var array $unpacked */ + $unpacked = unpack('V', $string . "\0"); + return (int) ($unpacked[1] & 0xffffff); + } + + /** + * Load a 4 character substring into an integer + * + * @internal You should not use this directly from another application + * + * @param string $string + * @return int + * @throws RangeException + * @throws TypeError + */ + public static function load_4($string) + { + /* Type checks: */ + if (!is_string($string)) { + throw new TypeError('Argument 1 must be a string, ' . gettype($string) . ' given.'); + } + + /* Input validation: */ + if (self::strlen($string) < 4) { + throw new RangeException( + 'String must be 4 bytes or more; ' . self::strlen($string) . ' given.' + ); + } + /** @var array $unpacked */ + $unpacked = unpack('V', $string); + return (int) ($unpacked[1] & 0xffffffff); + } + + /** + * Load a 8 character substring into an integer + * + * @internal You should not use this directly from another application + * + * @param string $string + * @return int + * @throws RangeException + * @throws SodiumException + * @throws TypeError + */ + public static function load64_le($string) + { + /* Type checks: */ + if (!is_string($string)) { + throw new TypeError('Argument 1 must be a string, ' . gettype($string) . ' given.'); + } + + /* Input validation: */ + if (self::strlen($string) < 4) { + throw new RangeException( + 'String must be 4 bytes or more; ' . self::strlen($string) . ' given.' + ); + } + if (PHP_VERSION_ID >= 50603 && PHP_INT_SIZE === 8) { + /** @var array $unpacked */ + $unpacked = unpack('P', $string); + return (int) $unpacked[1]; + } + + /** @var int $result */ + $result = (self::chrToInt($string[0]) & 0xff); + $result |= (self::chrToInt($string[1]) & 0xff) << 8; + $result |= (self::chrToInt($string[2]) & 0xff) << 16; + $result |= (self::chrToInt($string[3]) & 0xff) << 24; + $result |= (self::chrToInt($string[4]) & 0xff) << 32; + $result |= (self::chrToInt($string[5]) & 0xff) << 40; + $result |= (self::chrToInt($string[6]) & 0xff) << 48; + $result |= (self::chrToInt($string[7]) & 0xff) << 56; + return (int) $result; + } + + /** + * @internal You should not use this directly from another application + * + * @param string $left + * @param string $right + * @return int + * @throws SodiumException + * @throws TypeError + */ + public static function memcmp($left, $right) + { + if (self::hashEquals($left, $right)) { + return 0; + } + return -1; + } + + /** + * Multiply two integers in constant-time + * + * Micro-architecture timing side-channels caused by how your CPU + * implements multiplication are best prevented by never using the + * multiplication operators and ensuring that our code always takes + * the same number of operations to complete, regardless of the values + * of $a and $b. + * + * @internal You should not use this directly from another application + * + * @param int $a + * @param int $b + * @param int $size Limits the number of operations (useful for small, + * constant operands) + * @return int + */ + public static function mul($a, $b, $size = 0) + { + if (ParagonIE_Sodium_Compat::$fastMult) { + return (int) ($a * $b); + } + + static $defaultSize = null; + /** @var int $defaultSize */ + if (!$defaultSize) { + /** @var int $defaultSize */ + $defaultSize = (PHP_INT_SIZE << 3) - 1; + } + if ($size < 1) { + /** @var int $size */ + $size = $defaultSize; + } + /** @var int $size */ + + $c = 0; + + /** + * Mask is either -1 or 0. + * + * -1 in binary looks like 0x1111 ... 1111 + * 0 in binary looks like 0x0000 ... 0000 + * + * @var int + */ + $mask = -(($b >> ((int) $defaultSize)) & 1); + + /** + * Ensure $b is a positive integer, without creating + * a branching side-channel + * + * @var int $b + */ + $b = ($b & ~$mask) | ($mask & -$b); + + /** + * Unless $size is provided: + * + * This loop always runs 32 times when PHP_INT_SIZE is 4. + * This loop always runs 64 times when PHP_INT_SIZE is 8. + */ + for ($i = $size; $i >= 0; --$i) { + $c += (int) ($a & -($b & 1)); + $a <<= 1; + $b >>= 1; + } + + /** + * If $b was negative, we then apply the same value to $c here. + * It doesn't matter much if $a was negative; the $c += above would + * have produced a negative integer to begin with. But a negative $b + * makes $b >>= 1 never return 0, so we would end up with incorrect + * results. + * + * The end result is what we'd expect from integer multiplication. + */ + return (int) (($c & ~$mask) | ($mask & -$c)); + } + + /** + * Convert any arbitrary numbers into two 32-bit integers that represent + * a 64-bit integer. + * + * @internal You should not use this directly from another application + * + * @param int|float $num + * @return array + */ + public static function numericTo64BitInteger($num) + { + $high = 0; + /** @var int $low */ + $low = $num & 0xffffffff; + + if ((+(abs($num))) >= 1) { + if ($num > 0) { + /** @var int $high */ + $high = min((+(floor($num/4294967296))), 4294967295); + } else { + /** @var int $high */ + $high = ~~((+(ceil(($num - (+((~~($num)))))/4294967296)))); + } + } + return array((int) $high, (int) $low); + } + + /** + * Store a 24-bit integer into a string, treating it as big-endian. + * + * @internal You should not use this directly from another application + * + * @param int $int + * @return string + * @throws TypeError + */ + public static function store_3($int) + { + /* Type checks: */ + if (!is_int($int)) { + if (is_numeric($int)) { + $int = (int) $int; + } else { + throw new TypeError('Argument 1 must be an integer, ' . gettype($int) . ' given.'); + } + } + /** @var string $packed */ + $packed = pack('N', $int); + return self::substr($packed, 1, 3); + } + + /** + * Store a 32-bit integer into a string, treating it as little-endian. + * + * @internal You should not use this directly from another application + * + * @param int $int + * @return string + * @throws TypeError + */ + public static function store32_le($int) + { + /* Type checks: */ + if (!is_int($int)) { + if (is_numeric($int)) { + $int = (int) $int; + } else { + throw new TypeError('Argument 1 must be an integer, ' . gettype($int) . ' given.'); + } + } + + /** @var string $packed */ + $packed = pack('V', $int); + return $packed; + } + + /** + * Store a 32-bit integer into a string, treating it as big-endian. + * + * @internal You should not use this directly from another application + * + * @param int $int + * @return string + * @throws TypeError + */ + public static function store_4($int) + { + /* Type checks: */ + if (!is_int($int)) { + if (is_numeric($int)) { + $int = (int) $int; + } else { + throw new TypeError('Argument 1 must be an integer, ' . gettype($int) . ' given.'); + } + } + + /** @var string $packed */ + $packed = pack('N', $int); + return $packed; + } + + /** + * Stores a 64-bit integer as an string, treating it as little-endian. + * + * @internal You should not use this directly from another application + * + * @param int $int + * @return string + * @throws TypeError + */ + public static function store64_le($int) + { + /* Type checks: */ + if (!is_int($int)) { + if (is_numeric($int)) { + $int = (int) $int; + } else { + throw new TypeError('Argument 1 must be an integer, ' . gettype($int) . ' given.'); + } + } + + if (PHP_INT_SIZE === 8) { + if (PHP_VERSION_ID >= 50603) { + /** @var string $packed */ + $packed = pack('P', $int); + return $packed; + } + return self::intToChr($int & 0xff) . + self::intToChr(($int >> 8) & 0xff) . + self::intToChr(($int >> 16) & 0xff) . + self::intToChr(($int >> 24) & 0xff) . + self::intToChr(($int >> 32) & 0xff) . + self::intToChr(($int >> 40) & 0xff) . + self::intToChr(($int >> 48) & 0xff) . + self::intToChr(($int >> 56) & 0xff); + } + if ($int > PHP_INT_MAX) { + list($hiB, $int) = self::numericTo64BitInteger($int); + } else { + $hiB = 0; + } + return + self::intToChr(($int ) & 0xff) . + self::intToChr(($int >> 8) & 0xff) . + self::intToChr(($int >> 16) & 0xff) . + self::intToChr(($int >> 24) & 0xff) . + self::intToChr($hiB & 0xff) . + self::intToChr(($hiB >> 8) & 0xff) . + self::intToChr(($hiB >> 16) & 0xff) . + self::intToChr(($hiB >> 24) & 0xff); + } + + /** + * Safe string length + * + * @internal You should not use this directly from another application + * + * @ref mbstring.func_overload + * + * @param string $str + * @return int + * @throws TypeError + */ + public static function strlen($str) + { + /* Type checks: */ + if (!is_string($str)) { + throw new TypeError('String expected'); + } + + return (int) ( + self::isMbStringOverride() + ? mb_strlen($str, '8bit') + : strlen($str) + ); + } + + /** + * Turn a string into an array of integers + * + * @internal You should not use this directly from another application + * + * @param string $string + * @return array + * @throws TypeError + */ + public static function stringToIntArray($string) + { + if (!is_string($string)) { + throw new TypeError('String expected'); + } + /** + * @var array + */ + $values = array_values( + unpack('C*', $string) + ); + return $values; + } + + /** + * Safe substring + * + * @internal You should not use this directly from another application + * + * @ref mbstring.func_overload + * + * @param string $str + * @param int $start + * @param int $length + * @return string + * @throws TypeError + */ + public static function substr($str, $start = 0, $length = null) + { + /* Type checks: */ + if (!is_string($str)) { + throw new TypeError('String expected'); + } + + if ($length === 0) { + return ''; + } + + if (self::isMbStringOverride()) { + if (PHP_VERSION_ID < 50400 && $length === null) { + $length = self::strlen($str); + } + $sub = (string) mb_substr($str, $start, $length, '8bit'); + } elseif ($length === null) { + $sub = (string) substr($str, $start); + } else { + $sub = (string) substr($str, $start, $length); + } + if ($sub !== '') { + return $sub; + } + return ''; + } + + /** + * Compare a 16-character byte string in constant time. + * + * @internal You should not use this directly from another application + * + * @param string $a + * @param string $b + * @return bool + * @throws SodiumException + * @throws TypeError + */ + public static function verify_16($a, $b) + { + /* Type checks: */ + if (!is_string($a)) { + throw new TypeError('String expected'); + } + if (!is_string($b)) { + throw new TypeError('String expected'); + } + return self::hashEquals( + self::substr($a, 0, 16), + self::substr($b, 0, 16) + ); + } + + /** + * Compare a 32-character byte string in constant time. + * + * @internal You should not use this directly from another application + * + * @param string $a + * @param string $b + * @return bool + * @throws SodiumException + * @throws TypeError + */ + public static function verify_32($a, $b) + { + /* Type checks: */ + if (!is_string($a)) { + throw new TypeError('String expected'); + } + if (!is_string($b)) { + throw new TypeError('String expected'); + } + return self::hashEquals( + self::substr($a, 0, 32), + self::substr($b, 0, 32) + ); + } + + /** + * Calculate $a ^ $b for two strings. + * + * @internal You should not use this directly from another application + * + * @param string $a + * @param string $b + * @return string + * @throws TypeError + */ + public static function xorStrings($a, $b) + { + /* Type checks: */ + if (!is_string($a)) { + throw new TypeError('Argument 1 must be a string'); + } + if (!is_string($b)) { + throw new TypeError('Argument 2 must be a string'); + } + + return (string) ($a ^ $b); + } + + /** + * Returns whether or not mbstring.func_overload is in effect. + * + * @internal You should not use this directly from another application + * + * Note: MB_OVERLOAD_STRING === 2, but we don't reference the constant + * (for nuisance-free PHP 8 support) + * + * @return bool + */ + protected static function isMbStringOverride() + { + static $mbstring = null; + + if ($mbstring === null) { + $mbstring = extension_loaded('mbstring') + && defined('MB_OVERLOAD_STRING') + && + ((int) (ini_get('mbstring.func_overload')) & 2); + // MB_OVERLOAD_STRING === 2 + } + /** @var bool $mbstring */ + + return $mbstring; + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/X25519.php b/vendor/paragonie/sodium_compat/src/Core/X25519.php new file mode 100644 index 0000000..732bb65 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/X25519.php @@ -0,0 +1,327 @@ +> 25; + $h[0] += self::mul($carry9, 19, 5); + $h[9] -= $carry9 << 25; + /** @var int $carry1 */ + $carry1 = ($h[1] + (1 << 24)) >> 25; + $h[2] += $carry1; + $h[1] -= $carry1 << 25; + /** @var int $carry3 */ + $carry3 = ($h[3] + (1 << 24)) >> 25; + $h[4] += $carry3; + $h[3] -= $carry3 << 25; + /** @var int $carry5 */ + $carry5 = ($h[5] + (1 << 24)) >> 25; + $h[6] += $carry5; + $h[5] -= $carry5 << 25; + /** @var int $carry7 */ + $carry7 = ($h[7] + (1 << 24)) >> 25; + $h[8] += $carry7; + $h[7] -= $carry7 << 25; + + /** @var int $carry0 */ + $carry0 = ($h[0] + (1 << 25)) >> 26; + $h[1] += $carry0; + $h[0] -= $carry0 << 26; + /** @var int $carry2 */ + $carry2 = ($h[2] + (1 << 25)) >> 26; + $h[3] += $carry2; + $h[2] -= $carry2 << 26; + /** @var int $carry4 */ + $carry4 = ($h[4] + (1 << 25)) >> 26; + $h[5] += $carry4; + $h[4] -= $carry4 << 26; + /** @var int $carry6 */ + $carry6 = ($h[6] + (1 << 25)) >> 26; + $h[7] += $carry6; + $h[6] -= $carry6 << 26; + /** @var int $carry8 */ + $carry8 = ($h[8] + (1 << 25)) >> 26; + $h[9] += $carry8; + $h[8] -= $carry8 << 26; + + foreach ($h as $i => $value) { + $h[$i] = (int) $value; + } + return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray($h); + } + + /** + * @internal You should not use this directly from another application + * + * Inline comments preceded by # are from libsodium's ref10 code. + * + * @param string $n + * @param string $p + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function crypto_scalarmult_curve25519_ref10($n, $p) + { + # for (i = 0;i < 32;++i) e[i] = n[i]; + $e = '' . $n; + # e[0] &= 248; + $e[0] = self::intToChr( + self::chrToInt($e[0]) & 248 + ); + # e[31] &= 127; + # e[31] |= 64; + $e[31] = self::intToChr( + (self::chrToInt($e[31]) & 127) | 64 + ); + # fe_frombytes(x1,p); + $x1 = self::fe_frombytes($p); + # fe_1(x2); + $x2 = self::fe_1(); + # fe_0(z2); + $z2 = self::fe_0(); + # fe_copy(x3,x1); + $x3 = self::fe_copy($x1); + # fe_1(z3); + $z3 = self::fe_1(); + + # swap = 0; + /** @var int $swap */ + $swap = 0; + + # for (pos = 254;pos >= 0;--pos) { + for ($pos = 254; $pos >= 0; --$pos) { + # b = e[pos / 8] >> (pos & 7); + /** @var int $b */ + $b = self::chrToInt( + $e[(int) floor($pos / 8)] + ) >> ($pos & 7); + # b &= 1; + $b &= 1; + # swap ^= b; + $swap ^= $b; + # fe_cswap(x2,x3,swap); + self::fe_cswap($x2, $x3, $swap); + # fe_cswap(z2,z3,swap); + self::fe_cswap($z2, $z3, $swap); + # swap = b; + $swap = $b; + # fe_sub(tmp0,x3,z3); + $tmp0 = self::fe_sub($x3, $z3); + # fe_sub(tmp1,x2,z2); + $tmp1 = self::fe_sub($x2, $z2); + + # fe_add(x2,x2,z2); + $x2 = self::fe_add($x2, $z2); + + # fe_add(z2,x3,z3); + $z2 = self::fe_add($x3, $z3); + + # fe_mul(z3,tmp0,x2); + $z3 = self::fe_mul($tmp0, $x2); + + # fe_mul(z2,z2,tmp1); + $z2 = self::fe_mul($z2, $tmp1); + + # fe_sq(tmp0,tmp1); + $tmp0 = self::fe_sq($tmp1); + + # fe_sq(tmp1,x2); + $tmp1 = self::fe_sq($x2); + + # fe_add(x3,z3,z2); + $x3 = self::fe_add($z3, $z2); + + # fe_sub(z2,z3,z2); + $z2 = self::fe_sub($z3, $z2); + + # fe_mul(x2,tmp1,tmp0); + $x2 = self::fe_mul($tmp1, $tmp0); + + # fe_sub(tmp1,tmp1,tmp0); + $tmp1 = self::fe_sub($tmp1, $tmp0); + + # fe_sq(z2,z2); + $z2 = self::fe_sq($z2); + + # fe_mul121666(z3,tmp1); + $z3 = self::fe_mul121666($tmp1); + + # fe_sq(x3,x3); + $x3 = self::fe_sq($x3); + + # fe_add(tmp0,tmp0,z3); + $tmp0 = self::fe_add($tmp0, $z3); + + # fe_mul(z3,x1,z2); + $z3 = self::fe_mul($x1, $z2); + + # fe_mul(z2,tmp1,tmp0); + $z2 = self::fe_mul($tmp1, $tmp0); + } + + # fe_cswap(x2,x3,swap); + self::fe_cswap($x2, $x3, $swap); + + # fe_cswap(z2,z3,swap); + self::fe_cswap($z2, $z3, $swap); + + # fe_invert(z2,z2); + $z2 = self::fe_invert($z2); + + # fe_mul(x2,x2,z2); + $x2 = self::fe_mul($x2, $z2); + # fe_tobytes(q,x2); + return self::fe_tobytes($x2); + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core_Curve25519_Fe $edwardsY + * @param ParagonIE_Sodium_Core_Curve25519_Fe $edwardsZ + * @return ParagonIE_Sodium_Core_Curve25519_Fe + */ + public static function edwards_to_montgomery( + ParagonIE_Sodium_Core_Curve25519_Fe $edwardsY, + ParagonIE_Sodium_Core_Curve25519_Fe $edwardsZ + ) { + $tempX = self::fe_add($edwardsZ, $edwardsY); + $tempZ = self::fe_sub($edwardsZ, $edwardsY); + $tempZ = self::fe_invert($tempZ); + return self::fe_mul($tempX, $tempZ); + } + + /** + * @internal You should not use this directly from another application + * + * @param string $n + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function crypto_scalarmult_curve25519_ref10_base($n) + { + # for (i = 0;i < 32;++i) e[i] = n[i]; + $e = '' . $n; + + # e[0] &= 248; + $e[0] = self::intToChr( + self::chrToInt($e[0]) & 248 + ); + + # e[31] &= 127; + # e[31] |= 64; + $e[31] = self::intToChr( + (self::chrToInt($e[31]) & 127) | 64 + ); + + $A = self::ge_scalarmult_base($e); + if ( + !($A->Y instanceof ParagonIE_Sodium_Core_Curve25519_Fe) + || + !($A->Z instanceof ParagonIE_Sodium_Core_Curve25519_Fe) + ) { + throw new TypeError('Null points encountered'); + } + $pk = self::edwards_to_montgomery($A->Y, $A->Z); + return self::fe_tobytes($pk); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core/XChaCha20.php b/vendor/paragonie/sodium_compat/src/Core/XChaCha20.php new file mode 100644 index 0000000..39e717b --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core/XChaCha20.php @@ -0,0 +1,117 @@ +> + */ + public static $sigma = array( + array( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15), + array( 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3), + array( 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4), + array( 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8), + array( 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13), + array( 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9), + array( 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11), + array( 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10), + array( 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5), + array( 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0), + array( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15), + array( 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3) + ); + + const BLOCKBYTES = 128; + const OUTBYTES = 64; + const KEYBYTES = 64; + + /** + * Turn two 32-bit integers into a fixed array representing a 64-bit integer. + * + * @internal You should not use this directly from another application + * + * @param int $high + * @param int $low + * @return ParagonIE_Sodium_Core32_Int64 + * @throws SodiumException + * @throws TypeError + */ + public static function new64($high, $low) + { + return ParagonIE_Sodium_Core32_Int64::fromInts($low, $high); + } + + /** + * Convert an arbitrary number into an SplFixedArray of two 32-bit integers + * that represents a 64-bit integer. + * + * @internal You should not use this directly from another application + * + * @param int $num + * @return ParagonIE_Sodium_Core32_Int64 + * @throws SodiumException + * @throws TypeError + */ + protected static function to64($num) + { + list($hi, $lo) = self::numericTo64BitInteger($num); + return self::new64($hi, $lo); + } + + /** + * Adds two 64-bit integers together, returning their sum as a SplFixedArray + * containing two 32-bit integers (representing a 64-bit integer). + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Int64 $x + * @param ParagonIE_Sodium_Core32_Int64 $y + * @return ParagonIE_Sodium_Core32_Int64 + */ + protected static function add64($x, $y) + { + return $x->addInt64($y); + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Int64 $x + * @param ParagonIE_Sodium_Core32_Int64 $y + * @param ParagonIE_Sodium_Core32_Int64 $z + * @return ParagonIE_Sodium_Core32_Int64 + */ + public static function add364($x, $y, $z) + { + return $x->addInt64($y)->addInt64($z); + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Int64 $x + * @param ParagonIE_Sodium_Core32_Int64 $y + * @return ParagonIE_Sodium_Core32_Int64 + * @throws TypeError + */ + public static function xor64(ParagonIE_Sodium_Core32_Int64 $x, ParagonIE_Sodium_Core32_Int64 $y) + { + return $x->xorInt64($y); + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Int64 $x + * @param int $c + * @return ParagonIE_Sodium_Core32_Int64 + * @throws SodiumException + * @throws TypeError + */ + public static function rotr64(ParagonIE_Sodium_Core32_Int64 $x, $c) + { + return $x->rotateRight($c); + } + + /** + * @internal You should not use this directly from another application + * + * @param SplFixedArray $x + * @param int $i + * @return ParagonIE_Sodium_Core32_Int64 + * @throws SodiumException + * @throws TypeError + */ + public static function load64($x, $i) + { + /** @var int $l */ + $l = (int) ($x[$i]) + | ((int) ($x[$i+1]) << 8) + | ((int) ($x[$i+2]) << 16) + | ((int) ($x[$i+3]) << 24); + /** @var int $h */ + $h = (int) ($x[$i+4]) + | ((int) ($x[$i+5]) << 8) + | ((int) ($x[$i+6]) << 16) + | ((int) ($x[$i+7]) << 24); + return self::new64($h, $l); + } + + /** + * @internal You should not use this directly from another application + * + * @param SplFixedArray $x + * @param int $i + * @param ParagonIE_Sodium_Core32_Int64 $u + * @return void + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedAssignment + * @psalm-suppress MixedArrayAccess + * @psalm-suppress MixedArrayAssignment + * @psalm-suppress MixedArrayOffset + */ + public static function store64(SplFixedArray $x, $i, ParagonIE_Sodium_Core32_Int64 $u) + { + $v = clone $u; + $maxLength = $x->getSize() - 1; + for ($j = 0; $j < 8; ++$j) { + $k = 3 - ($j >> 1); + $x[$i] = $v->limbs[$k] & 0xff; + if (++$i > $maxLength) { + return; + } + $v->limbs[$k] >>= 8; + } + } + + /** + * This just sets the $iv static variable. + * + * @internal You should not use this directly from another application + * + * @return void + * @throws SodiumException + * @throws TypeError + */ + public static function pseudoConstructor() + { + static $called = false; + if ($called) { + return; + } + self::$iv = new SplFixedArray(8); + self::$iv[0] = self::new64(0x6a09e667, 0xf3bcc908); + self::$iv[1] = self::new64(0xbb67ae85, 0x84caa73b); + self::$iv[2] = self::new64(0x3c6ef372, 0xfe94f82b); + self::$iv[3] = self::new64(0xa54ff53a, 0x5f1d36f1); + self::$iv[4] = self::new64(0x510e527f, 0xade682d1); + self::$iv[5] = self::new64(0x9b05688c, 0x2b3e6c1f); + self::$iv[6] = self::new64(0x1f83d9ab, 0xfb41bd6b); + self::$iv[7] = self::new64(0x5be0cd19, 0x137e2179); + + $called = true; + } + + /** + * Returns a fresh BLAKE2 context. + * + * @internal You should not use this directly from another application + * + * @return SplFixedArray + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedAssignment + * @psalm-suppress MixedArrayAccess + * @psalm-suppress MixedArrayAssignment + * @psalm-suppress MixedArrayOffset + * @throws SodiumException + * @throws TypeError + */ + protected static function context() + { + $ctx = new SplFixedArray(6); + $ctx[0] = new SplFixedArray(8); // h + $ctx[1] = new SplFixedArray(2); // t + $ctx[2] = new SplFixedArray(2); // f + $ctx[3] = new SplFixedArray(256); // buf + $ctx[4] = 0; // buflen + $ctx[5] = 0; // last_node (uint8_t) + + for ($i = 8; $i--;) { + $ctx[0][$i] = self::$iv[$i]; + } + for ($i = 256; $i--;) { + $ctx[3][$i] = 0; + } + + $zero = self::new64(0, 0); + $ctx[1][0] = $zero; + $ctx[1][1] = $zero; + $ctx[2][0] = $zero; + $ctx[2][1] = $zero; + + return $ctx; + } + + /** + * @internal You should not use this directly from another application + * + * @param SplFixedArray $ctx + * @param SplFixedArray $buf + * @return void + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedArrayAccess + * @psalm-suppress MixedArrayAssignment + * @psalm-suppress MixedAssignment + */ + protected static function compress(SplFixedArray $ctx, SplFixedArray $buf) + { + $m = new SplFixedArray(16); + $v = new SplFixedArray(16); + + for ($i = 16; $i--;) { + $m[$i] = self::load64($buf, $i << 3); + } + + for ($i = 8; $i--;) { + $v[$i] = $ctx[0][$i]; + } + + $v[ 8] = self::$iv[0]; + $v[ 9] = self::$iv[1]; + $v[10] = self::$iv[2]; + $v[11] = self::$iv[3]; + + $v[12] = self::xor64($ctx[1][0], self::$iv[4]); + $v[13] = self::xor64($ctx[1][1], self::$iv[5]); + $v[14] = self::xor64($ctx[2][0], self::$iv[6]); + $v[15] = self::xor64($ctx[2][1], self::$iv[7]); + + for ($r = 0; $r < 12; ++$r) { + $v = self::G($r, 0, 0, 4, 8, 12, $v, $m); + $v = self::G($r, 1, 1, 5, 9, 13, $v, $m); + $v = self::G($r, 2, 2, 6, 10, 14, $v, $m); + $v = self::G($r, 3, 3, 7, 11, 15, $v, $m); + $v = self::G($r, 4, 0, 5, 10, 15, $v, $m); + $v = self::G($r, 5, 1, 6, 11, 12, $v, $m); + $v = self::G($r, 6, 2, 7, 8, 13, $v, $m); + $v = self::G($r, 7, 3, 4, 9, 14, $v, $m); + } + + for ($i = 8; $i--;) { + $ctx[0][$i] = self::xor64( + $ctx[0][$i], self::xor64($v[$i], $v[$i+8]) + ); + } + } + + /** + * @internal You should not use this directly from another application + * + * @param int $r + * @param int $i + * @param int $a + * @param int $b + * @param int $c + * @param int $d + * @param SplFixedArray $v + * @param SplFixedArray $m + * @return SplFixedArray + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedArrayOffset + */ + public static function G($r, $i, $a, $b, $c, $d, SplFixedArray $v, SplFixedArray $m) + { + $v[$a] = self::add364($v[$a], $v[$b], $m[self::$sigma[$r][$i << 1]]); + $v[$d] = self::rotr64(self::xor64($v[$d], $v[$a]), 32); + $v[$c] = self::add64($v[$c], $v[$d]); + $v[$b] = self::rotr64(self::xor64($v[$b], $v[$c]), 24); + $v[$a] = self::add364($v[$a], $v[$b], $m[self::$sigma[$r][($i << 1) + 1]]); + $v[$d] = self::rotr64(self::xor64($v[$d], $v[$a]), 16); + $v[$c] = self::add64($v[$c], $v[$d]); + $v[$b] = self::rotr64(self::xor64($v[$b], $v[$c]), 63); + return $v; + } + + /** + * @internal You should not use this directly from another application + * + * @param SplFixedArray $ctx + * @param int $inc + * @return void + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedArrayAccess + * @psalm-suppress MixedArrayAssignment + */ + public static function increment_counter($ctx, $inc) + { + if ($inc < 0) { + throw new SodiumException('Increasing by a negative number makes no sense.'); + } + $t = self::to64($inc); + # S->t is $ctx[1] in our implementation + + # S->t[0] = ( uint64_t )( t >> 0 ); + $ctx[1][0] = self::add64($ctx[1][0], $t); + + # S->t[1] += ( S->t[0] < inc ); + if (!($ctx[1][0] instanceof ParagonIE_Sodium_Core32_Int64)) { + throw new TypeError('Not an int64'); + } + /** @var ParagonIE_Sodium_Core32_Int64 $c*/ + $c = $ctx[1][0]; + if ($c->isLessThanInt($inc)) { + $ctx[1][1] = self::add64($ctx[1][1], self::to64(1)); + } + } + + /** + * @internal You should not use this directly from another application + * + * @param SplFixedArray $ctx + * @param SplFixedArray $p + * @param int $plen + * @return void + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedAssignment + * @psalm-suppress MixedArrayAccess + * @psalm-suppress MixedArrayAssignment + * @psalm-suppress MixedArrayOffset + * @psalm-suppress MixedMethodCall + * @psalm-suppress MixedOperand + */ + public static function update(SplFixedArray $ctx, SplFixedArray $p, $plen) + { + self::pseudoConstructor(); + + $offset = 0; + while ($plen > 0) { + $left = $ctx[4]; + $fill = 256 - $left; + + if ($plen > $fill) { + # memcpy( S->buf + left, in, fill ); /* Fill buffer */ + for ($i = $fill; $i--;) { + $ctx[3][$i + $left] = $p[$i + $offset]; + } + + # S->buflen += fill; + $ctx[4] += $fill; + + # blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES ); + self::increment_counter($ctx, 128); + + # blake2b_compress( S, S->buf ); /* Compress */ + self::compress($ctx, $ctx[3]); + + # memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, BLAKE2B_BLOCKBYTES ); /* Shift buffer left */ + for ($i = 128; $i--;) { + $ctx[3][$i] = $ctx[3][$i + 128]; + } + + # S->buflen -= BLAKE2B_BLOCKBYTES; + $ctx[4] -= 128; + + # in += fill; + $offset += $fill; + + # inlen -= fill; + $plen -= $fill; + } else { + for ($i = $plen; $i--;) { + $ctx[3][$i + $left] = $p[$i + $offset]; + } + $ctx[4] += $plen; + $offset += $plen; + $plen -= $plen; + } + } + } + + /** + * @internal You should not use this directly from another application + * + * @param SplFixedArray $ctx + * @param SplFixedArray $out + * @return SplFixedArray + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedAssignment + * @psalm-suppress MixedArrayAccess + * @psalm-suppress MixedArrayAssignment + * @psalm-suppress MixedArrayOffset + * @psalm-suppress MixedMethodCall + * @psalm-suppress MixedOperand + */ + public static function finish(SplFixedArray $ctx, SplFixedArray $out) + { + self::pseudoConstructor(); + if ($ctx[4] > 128) { + self::increment_counter($ctx, 128); + self::compress($ctx, $ctx[3]); + $ctx[4] -= 128; + if ($ctx[4] > 128) { + throw new SodiumException('Failed to assert that buflen <= 128 bytes'); + } + for ($i = $ctx[4]; $i--;) { + $ctx[3][$i] = $ctx[3][$i + 128]; + } + } + + self::increment_counter($ctx, $ctx[4]); + $ctx[2][0] = self::new64(0xffffffff, 0xffffffff); + + for ($i = 256 - $ctx[4]; $i--;) { + /** @var int $i */ + $ctx[3][$i + $ctx[4]] = 0; + } + + self::compress($ctx, $ctx[3]); + + $i = (int) (($out->getSize() - 1) / 8); + for (; $i >= 0; --$i) { + self::store64($out, $i << 3, $ctx[0][$i]); + } + return $out; + } + + /** + * @internal You should not use this directly from another application + * + * @param SplFixedArray|null $key + * @param int $outlen + * @param SplFixedArray|null $salt + * @param SplFixedArray|null $personal + * @return SplFixedArray + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedAssignment + * @psalm-suppress MixedArrayAccess + * @psalm-suppress MixedArrayAssignment + * @psalm-suppress MixedMethodCall + */ + public static function init( + $key = null, + $outlen = 64, + $salt = null, + $personal = null + ) { + self::pseudoConstructor(); + $klen = 0; + + if ($key !== null) { + if (count($key) > 64) { + throw new SodiumException('Invalid key size'); + } + $klen = count($key); + } + + if ($outlen > 64) { + throw new SodiumException('Invalid output size'); + } + + $ctx = self::context(); + + $p = new SplFixedArray(64); + // Zero our param buffer... + for ($i = 64; --$i;) { + $p[$i] = 0; + } + + $p[0] = $outlen; // digest_length + $p[1] = $klen; // key_length + $p[2] = 1; // fanout + $p[3] = 1; // depth + + if ($salt instanceof SplFixedArray) { + // salt: [32] through [47] + for ($i = 0; $i < 16; ++$i) { + $p[32 + $i] = (int) $salt[$i]; + } + } + if ($personal instanceof SplFixedArray) { + // personal: [48] through [63] + for ($i = 0; $i < 16; ++$i) { + $p[48 + $i] = (int) $personal[$i]; + } + } + + $ctx[0][0] = self::xor64( + $ctx[0][0], + self::load64($p, 0) + ); + + if ($salt instanceof SplFixedArray || $personal instanceof SplFixedArray) { + // We need to do what blake2b_init_param() does: + for ($i = 1; $i < 8; ++$i) { + $ctx[0][$i] = self::xor64( + $ctx[0][$i], + self::load64($p, $i << 3) + ); + } + } + + if ($klen > 0 && $key instanceof SplFixedArray) { + $block = new SplFixedArray(128); + for ($i = 128; $i--;) { + $block[$i] = 0; + } + for ($i = $klen; $i--;) { + $block[$i] = $key[$i]; + } + self::update($ctx, $block, 128); + $ctx[4] = 128; + } + + return $ctx; + } + + /** + * Convert a string into an SplFixedArray of integers + * + * @internal You should not use this directly from another application + * + * @param string $str + * @return SplFixedArray + * @psalm-suppress MixedArgumentTypeCoercion + */ + public static function stringToSplFixedArray($str = '') + { + $values = unpack('C*', $str); + return SplFixedArray::fromArray(array_values($values)); + } + + /** + * Convert an SplFixedArray of integers into a string + * + * @internal You should not use this directly from another application + * + * @param SplFixedArray $a + * @return string + */ + public static function SplFixedArrayToString(SplFixedArray $a) + { + /** + * @var array + */ + $arr = $a->toArray(); + $c = $a->count(); + array_unshift($arr, str_repeat('C', $c)); + return (string) (call_user_func_array('pack', $arr)); + } + + /** + * @internal You should not use this directly from another application + * + * @param SplFixedArray $ctx + * @return string + * @throws TypeError + * @psalm-suppress MixedArgument + * @psalm-suppress MixedArrayAccess + * @psalm-suppress MixedArrayAssignment + * @psalm-suppress MixedMethodCall + */ + public static function contextToString(SplFixedArray $ctx) + { + $str = ''; + /** @var array $ctxA */ + $ctxA = $ctx[0]->toArray(); + + # uint64_t h[8]; + for ($i = 0; $i < 8; ++$i) { + if (!($ctxA[$i] instanceof ParagonIE_Sodium_Core32_Int64)) { + throw new TypeError('Not an instance of Int64'); + } + /** @var ParagonIE_Sodium_Core32_Int64 $ctxAi */ + $ctxAi = $ctxA[$i]; + $str .= $ctxAi->toReverseString(); + } + + # uint64_t t[2]; + # uint64_t f[2]; + for ($i = 1; $i < 3; ++$i) { + /** @var array $ctxA */ + $ctxA = $ctx[$i]->toArray(); + /** @var ParagonIE_Sodium_Core32_Int64 $ctxA1 */ + $ctxA1 = $ctxA[0]; + /** @var ParagonIE_Sodium_Core32_Int64 $ctxA2 */ + $ctxA2 = $ctxA[1]; + + $str .= $ctxA1->toReverseString(); + $str .= $ctxA2->toReverseString(); + } + + # uint8_t buf[2 * 128]; + $str .= self::SplFixedArrayToString($ctx[3]); + + /** @var int $ctx4 */ + $ctx4 = $ctx[4]; + + # size_t buflen; + $str .= implode('', array( + self::intToChr($ctx4 & 0xff), + self::intToChr(($ctx4 >> 8) & 0xff), + self::intToChr(($ctx4 >> 16) & 0xff), + self::intToChr(($ctx4 >> 24) & 0xff), + "\x00\x00\x00\x00" + /* + self::intToChr(($ctx4 >> 32) & 0xff), + self::intToChr(($ctx4 >> 40) & 0xff), + self::intToChr(($ctx4 >> 48) & 0xff), + self::intToChr(($ctx4 >> 56) & 0xff) + */ + )); + # uint8_t last_node; + return $str . self::intToChr($ctx[5]) . str_repeat("\x00", 23); + } + + /** + * Creates an SplFixedArray containing other SplFixedArray elements, from + * a string (compatible with \Sodium\crypto_generichash_{init, update, final}) + * + * @internal You should not use this directly from another application + * + * @param string $string + * @return SplFixedArray + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArrayAccess + * @psalm-suppress MixedArrayAssignment + */ + public static function stringToContext($string) + { + $ctx = self::context(); + + # uint64_t h[8]; + for ($i = 0; $i < 8; ++$i) { + $ctx[0][$i] = ParagonIE_Sodium_Core32_Int64::fromReverseString( + self::substr($string, (($i << 3) + 0), 8) + ); + } + + # uint64_t t[2]; + # uint64_t f[2]; + for ($i = 1; $i < 3; ++$i) { + $ctx[$i][1] = ParagonIE_Sodium_Core32_Int64::fromReverseString( + self::substr($string, 72 + (($i - 1) << 4), 8) + ); + $ctx[$i][0] = ParagonIE_Sodium_Core32_Int64::fromReverseString( + self::substr($string, 64 + (($i - 1) << 4), 8) + ); + } + + # uint8_t buf[2 * 128]; + $ctx[3] = self::stringToSplFixedArray(self::substr($string, 96, 256)); + + # uint8_t buf[2 * 128]; + $int = 0; + for ($i = 0; $i < 8; ++$i) { + $int |= self::chrToInt($string[352 + $i]) << ($i << 3); + } + $ctx[4] = $int; + + return $ctx; + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/ChaCha20.php b/vendor/paragonie/sodium_compat/src/Core32/ChaCha20.php new file mode 100644 index 0000000..6f8c0bf --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/ChaCha20.php @@ -0,0 +1,400 @@ + + * @throws SodiumException + * @throws TypeError + */ + protected static function quarterRound( + ParagonIE_Sodium_Core32_Int32 $a, + ParagonIE_Sodium_Core32_Int32 $b, + ParagonIE_Sodium_Core32_Int32 $c, + ParagonIE_Sodium_Core32_Int32 $d + ) { + /** @var ParagonIE_Sodium_Core32_Int32 $a */ + /** @var ParagonIE_Sodium_Core32_Int32 $b */ + /** @var ParagonIE_Sodium_Core32_Int32 $c */ + /** @var ParagonIE_Sodium_Core32_Int32 $d */ + + # a = PLUS(a,b); d = ROTATE(XOR(d,a),16); + $a = $a->addInt32($b); + $d = $d->xorInt32($a)->rotateLeft(16); + + # c = PLUS(c,d); b = ROTATE(XOR(b,c),12); + $c = $c->addInt32($d); + $b = $b->xorInt32($c)->rotateLeft(12); + + # a = PLUS(a,b); d = ROTATE(XOR(d,a), 8); + $a = $a->addInt32($b); + $d = $d->xorInt32($a)->rotateLeft(8); + + # c = PLUS(c,d); b = ROTATE(XOR(b,c), 7); + $c = $c->addInt32($d); + $b = $b->xorInt32($c)->rotateLeft(7); + + return array($a, $b, $c, $d); + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_ChaCha20_Ctx $ctx + * @param string $message + * + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function encryptBytes( + ParagonIE_Sodium_Core32_ChaCha20_Ctx $ctx, + $message = '' + ) { + $bytes = self::strlen($message); + + /** @var ParagonIE_Sodium_Core32_Int32 $x0 */ + /** @var ParagonIE_Sodium_Core32_Int32 $x1 */ + /** @var ParagonIE_Sodium_Core32_Int32 $x2 */ + /** @var ParagonIE_Sodium_Core32_Int32 $x3 */ + /** @var ParagonIE_Sodium_Core32_Int32 $x4 */ + /** @var ParagonIE_Sodium_Core32_Int32 $x5 */ + /** @var ParagonIE_Sodium_Core32_Int32 $x6 */ + /** @var ParagonIE_Sodium_Core32_Int32 $x7 */ + /** @var ParagonIE_Sodium_Core32_Int32 $x8 */ + /** @var ParagonIE_Sodium_Core32_Int32 $x9 */ + /** @var ParagonIE_Sodium_Core32_Int32 $x10 */ + /** @var ParagonIE_Sodium_Core32_Int32 $x11 */ + /** @var ParagonIE_Sodium_Core32_Int32 $x12 */ + /** @var ParagonIE_Sodium_Core32_Int32 $x13 */ + /** @var ParagonIE_Sodium_Core32_Int32 $x14 */ + /** @var ParagonIE_Sodium_Core32_Int32 $x15 */ + + /* + j0 = ctx->input[0]; + j1 = ctx->input[1]; + j2 = ctx->input[2]; + j3 = ctx->input[3]; + j4 = ctx->input[4]; + j5 = ctx->input[5]; + j6 = ctx->input[6]; + j7 = ctx->input[7]; + j8 = ctx->input[8]; + j9 = ctx->input[9]; + j10 = ctx->input[10]; + j11 = ctx->input[11]; + j12 = ctx->input[12]; + j13 = ctx->input[13]; + j14 = ctx->input[14]; + j15 = ctx->input[15]; + */ + /** @var ParagonIE_Sodium_Core32_Int32 $j0 */ + $j0 = $ctx[0]; + /** @var ParagonIE_Sodium_Core32_Int32 $j1 */ + $j1 = $ctx[1]; + /** @var ParagonIE_Sodium_Core32_Int32 $j2 */ + $j2 = $ctx[2]; + /** @var ParagonIE_Sodium_Core32_Int32 $j3 */ + $j3 = $ctx[3]; + /** @var ParagonIE_Sodium_Core32_Int32 $j4 */ + $j4 = $ctx[4]; + /** @var ParagonIE_Sodium_Core32_Int32 $j5 */ + $j5 = $ctx[5]; + /** @var ParagonIE_Sodium_Core32_Int32 $j6 */ + $j6 = $ctx[6]; + /** @var ParagonIE_Sodium_Core32_Int32 $j7 */ + $j7 = $ctx[7]; + /** @var ParagonIE_Sodium_Core32_Int32 $j8 */ + $j8 = $ctx[8]; + /** @var ParagonIE_Sodium_Core32_Int32 $j9 */ + $j9 = $ctx[9]; + /** @var ParagonIE_Sodium_Core32_Int32 $j10 */ + $j10 = $ctx[10]; + /** @var ParagonIE_Sodium_Core32_Int32 $j11 */ + $j11 = $ctx[11]; + /** @var ParagonIE_Sodium_Core32_Int32 $j12 */ + $j12 = $ctx[12]; + /** @var ParagonIE_Sodium_Core32_Int32 $j13 */ + $j13 = $ctx[13]; + /** @var ParagonIE_Sodium_Core32_Int32 $j14 */ + $j14 = $ctx[14]; + /** @var ParagonIE_Sodium_Core32_Int32 $j15 */ + $j15 = $ctx[15]; + + $c = ''; + for (;;) { + if ($bytes < 64) { + $message .= str_repeat("\x00", 64 - $bytes); + } + + $x0 = clone $j0; + $x1 = clone $j1; + $x2 = clone $j2; + $x3 = clone $j3; + $x4 = clone $j4; + $x5 = clone $j5; + $x6 = clone $j6; + $x7 = clone $j7; + $x8 = clone $j8; + $x9 = clone $j9; + $x10 = clone $j10; + $x11 = clone $j11; + $x12 = clone $j12; + $x13 = clone $j13; + $x14 = clone $j14; + $x15 = clone $j15; + + # for (i = 20; i > 0; i -= 2) { + for ($i = 20; $i > 0; $i -= 2) { + # QUARTERROUND( x0, x4, x8, x12) + list($x0, $x4, $x8, $x12) = self::quarterRound($x0, $x4, $x8, $x12); + + # QUARTERROUND( x1, x5, x9, x13) + list($x1, $x5, $x9, $x13) = self::quarterRound($x1, $x5, $x9, $x13); + + # QUARTERROUND( x2, x6, x10, x14) + list($x2, $x6, $x10, $x14) = self::quarterRound($x2, $x6, $x10, $x14); + + # QUARTERROUND( x3, x7, x11, x15) + list($x3, $x7, $x11, $x15) = self::quarterRound($x3, $x7, $x11, $x15); + + # QUARTERROUND( x0, x5, x10, x15) + list($x0, $x5, $x10, $x15) = self::quarterRound($x0, $x5, $x10, $x15); + + # QUARTERROUND( x1, x6, x11, x12) + list($x1, $x6, $x11, $x12) = self::quarterRound($x1, $x6, $x11, $x12); + + # QUARTERROUND( x2, x7, x8, x13) + list($x2, $x7, $x8, $x13) = self::quarterRound($x2, $x7, $x8, $x13); + + # QUARTERROUND( x3, x4, x9, x14) + list($x3, $x4, $x9, $x14) = self::quarterRound($x3, $x4, $x9, $x14); + } + /* + x0 = PLUS(x0, j0); + x1 = PLUS(x1, j1); + x2 = PLUS(x2, j2); + x3 = PLUS(x3, j3); + x4 = PLUS(x4, j4); + x5 = PLUS(x5, j5); + x6 = PLUS(x6, j6); + x7 = PLUS(x7, j7); + x8 = PLUS(x8, j8); + x9 = PLUS(x9, j9); + x10 = PLUS(x10, j10); + x11 = PLUS(x11, j11); + x12 = PLUS(x12, j12); + x13 = PLUS(x13, j13); + x14 = PLUS(x14, j14); + x15 = PLUS(x15, j15); + */ + $x0 = $x0->addInt32($j0); + $x1 = $x1->addInt32($j1); + $x2 = $x2->addInt32($j2); + $x3 = $x3->addInt32($j3); + $x4 = $x4->addInt32($j4); + $x5 = $x5->addInt32($j5); + $x6 = $x6->addInt32($j6); + $x7 = $x7->addInt32($j7); + $x8 = $x8->addInt32($j8); + $x9 = $x9->addInt32($j9); + $x10 = $x10->addInt32($j10); + $x11 = $x11->addInt32($j11); + $x12 = $x12->addInt32($j12); + $x13 = $x13->addInt32($j13); + $x14 = $x14->addInt32($j14); + $x15 = $x15->addInt32($j15); + + /* + x0 = XOR(x0, LOAD32_LE(m + 0)); + x1 = XOR(x1, LOAD32_LE(m + 4)); + x2 = XOR(x2, LOAD32_LE(m + 8)); + x3 = XOR(x3, LOAD32_LE(m + 12)); + x4 = XOR(x4, LOAD32_LE(m + 16)); + x5 = XOR(x5, LOAD32_LE(m + 20)); + x6 = XOR(x6, LOAD32_LE(m + 24)); + x7 = XOR(x7, LOAD32_LE(m + 28)); + x8 = XOR(x8, LOAD32_LE(m + 32)); + x9 = XOR(x9, LOAD32_LE(m + 36)); + x10 = XOR(x10, LOAD32_LE(m + 40)); + x11 = XOR(x11, LOAD32_LE(m + 44)); + x12 = XOR(x12, LOAD32_LE(m + 48)); + x13 = XOR(x13, LOAD32_LE(m + 52)); + x14 = XOR(x14, LOAD32_LE(m + 56)); + x15 = XOR(x15, LOAD32_LE(m + 60)); + */ + $x0 = $x0->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 0, 4))); + $x1 = $x1->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 4, 4))); + $x2 = $x2->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 8, 4))); + $x3 = $x3->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 12, 4))); + $x4 = $x4->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 16, 4))); + $x5 = $x5->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 20, 4))); + $x6 = $x6->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 24, 4))); + $x7 = $x7->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 28, 4))); + $x8 = $x8->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 32, 4))); + $x9 = $x9->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 36, 4))); + $x10 = $x10->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 40, 4))); + $x11 = $x11->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 44, 4))); + $x12 = $x12->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 48, 4))); + $x13 = $x13->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 52, 4))); + $x14 = $x14->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 56, 4))); + $x15 = $x15->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 60, 4))); + + /* + j12 = PLUSONE(j12); + if (!j12) { + j13 = PLUSONE(j13); + } + */ + /** @var ParagonIE_Sodium_Core32_Int32 $j12 */ + $j12 = $j12->addInt(1); + if ($j12->limbs[0] === 0 && $j12->limbs[1] === 0) { + $j13 = $j13->addInt(1); + } + + /* + STORE32_LE(c + 0, x0); + STORE32_LE(c + 4, x1); + STORE32_LE(c + 8, x2); + STORE32_LE(c + 12, x3); + STORE32_LE(c + 16, x4); + STORE32_LE(c + 20, x5); + STORE32_LE(c + 24, x6); + STORE32_LE(c + 28, x7); + STORE32_LE(c + 32, x8); + STORE32_LE(c + 36, x9); + STORE32_LE(c + 40, x10); + STORE32_LE(c + 44, x11); + STORE32_LE(c + 48, x12); + STORE32_LE(c + 52, x13); + STORE32_LE(c + 56, x14); + STORE32_LE(c + 60, x15); + */ + + $block = $x0->toReverseString() . + $x1->toReverseString() . + $x2->toReverseString() . + $x3->toReverseString() . + $x4->toReverseString() . + $x5->toReverseString() . + $x6->toReverseString() . + $x7->toReverseString() . + $x8->toReverseString() . + $x9->toReverseString() . + $x10->toReverseString() . + $x11->toReverseString() . + $x12->toReverseString() . + $x13->toReverseString() . + $x14->toReverseString() . + $x15->toReverseString(); + + /* Partial block */ + if ($bytes < 64) { + $c .= self::substr($block, 0, $bytes); + break; + } + + /* Full block */ + $c .= $block; + $bytes -= 64; + if ($bytes <= 0) { + break; + } + $message = self::substr($message, 64); + } + /* end for(;;) loop */ + + $ctx[12] = $j12; + $ctx[13] = $j13; + return $c; + } + + /** + * @internal You should not use this directly from another application + * + * @param int $len + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function stream($len = 64, $nonce = '', $key = '') + { + return self::encryptBytes( + new ParagonIE_Sodium_Core32_ChaCha20_Ctx($key, $nonce), + str_repeat("\x00", $len) + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param int $len + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function ietfStream($len, $nonce = '', $key = '') + { + return self::encryptBytes( + new ParagonIE_Sodium_Core32_ChaCha20_IetfCtx($key, $nonce), + str_repeat("\x00", $len) + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param string $message + * @param string $nonce + * @param string $key + * @param string $ic + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function ietfStreamXorIc($message, $nonce = '', $key = '', $ic = '') + { + return self::encryptBytes( + new ParagonIE_Sodium_Core32_ChaCha20_IetfCtx($key, $nonce, $ic), + $message + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param string $message + * @param string $nonce + * @param string $key + * @param string $ic + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function streamXorIc($message, $nonce = '', $key = '', $ic = '') + { + return self::encryptBytes( + new ParagonIE_Sodium_Core32_ChaCha20_Ctx($key, $nonce, $ic), + $message + ); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/ChaCha20/Ctx.php b/vendor/paragonie/sodium_compat/src/Core32/ChaCha20/Ctx.php new file mode 100644 index 0000000..3f47d03 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/ChaCha20/Ctx.php @@ -0,0 +1,126 @@ + + */ + protected $container; + + /** + * ParagonIE_Sodium_Core_ChaCha20_Ctx constructor. + * + * @internal You should not use this directly from another application + * + * @param string $key ChaCha20 key. + * @param string $iv Initialization Vector (a.k.a. nonce). + * @param string $counter The initial counter value. + * Defaults to 8 0x00 bytes. + * @throws InvalidArgumentException + * @throws SodiumException + * @throws TypeError + */ + public function __construct($key = '', $iv = '', $counter = '') + { + if (self::strlen($key) !== 32) { + throw new InvalidArgumentException('ChaCha20 expects a 256-bit key.'); + } + if (self::strlen($iv) !== 8) { + throw new InvalidArgumentException('ChaCha20 expects a 64-bit nonce.'); + } + $this->container = new SplFixedArray(16); + + /* "expand 32-byte k" as per ChaCha20 spec */ + $this->container[0] = new ParagonIE_Sodium_Core32_Int32(array(0x6170, 0x7865)); + $this->container[1] = new ParagonIE_Sodium_Core32_Int32(array(0x3320, 0x646e)); + $this->container[2] = new ParagonIE_Sodium_Core32_Int32(array(0x7962, 0x2d32)); + $this->container[3] = new ParagonIE_Sodium_Core32_Int32(array(0x6b20, 0x6574)); + + $this->container[4] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 0, 4)); + $this->container[5] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 4, 4)); + $this->container[6] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 8, 4)); + $this->container[7] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 12, 4)); + $this->container[8] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 16, 4)); + $this->container[9] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 20, 4)); + $this->container[10] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 24, 4)); + $this->container[11] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 28, 4)); + + if (empty($counter)) { + $this->container[12] = new ParagonIE_Sodium_Core32_Int32(); + $this->container[13] = new ParagonIE_Sodium_Core32_Int32(); + } else { + $this->container[12] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($counter, 0, 4)); + $this->container[13] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($counter, 4, 4)); + } + $this->container[14] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 0, 4)); + $this->container[15] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 4, 4)); + } + + /** + * @internal You should not use this directly from another application + * + * @param int $offset + * @param int|ParagonIE_Sodium_Core32_Int32 $value + * @return void + */ + public function offsetSet($offset, $value) + { + if (!is_int($offset)) { + throw new InvalidArgumentException('Expected an integer'); + } + if ($value instanceof ParagonIE_Sodium_Core32_Int32) { + /* + } elseif (is_int($value)) { + $value = ParagonIE_Sodium_Core32_Int32::fromInt($value); + */ + } else { + throw new InvalidArgumentException('Expected an integer'); + } + $this->container[$offset] = $value; + } + + /** + * @internal You should not use this directly from another application + * + * @param int $offset + * @return bool + * @psalm-suppress MixedArrayOffset + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * @internal You should not use this directly from another application + * + * @param int $offset + * @return void + * @psalm-suppress MixedArrayOffset + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * @internal You should not use this directly from another application + * + * @param int $offset + * @return mixed|null + * @psalm-suppress MixedArrayOffset + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/ChaCha20/IetfCtx.php b/vendor/paragonie/sodium_compat/src/Core32/ChaCha20/IetfCtx.php new file mode 100644 index 0000000..eea08de --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/ChaCha20/IetfCtx.php @@ -0,0 +1,39 @@ +container[12] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($counter, 0, 4)); + } + $this->container[13] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 0, 4)); + $this->container[14] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 4, 4)); + $this->container[15] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 8, 4)); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/Curve25519.php b/vendor/paragonie/sodium_compat/src/Core32/Curve25519.php new file mode 100644 index 0000000..d6d700e --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/Curve25519.php @@ -0,0 +1,3196 @@ +addInt32($g[$i]); + } + /** @var array $arr */ + return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray($arr); + } + + /** + * Constant-time conditional move. + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f + * @param ParagonIE_Sodium_Core32_Curve25519_Fe $g + * @param int $b + * @return ParagonIE_Sodium_Core32_Curve25519_Fe + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedAssignment + * @psalm-suppress MixedMethodCall + */ + public static function fe_cmov( + ParagonIE_Sodium_Core32_Curve25519_Fe $f, + ParagonIE_Sodium_Core32_Curve25519_Fe $g, + $b = 0 + ) { + /** @var array $h */ + $h = array(); + for ($i = 0; $i < 10; ++$i) { + if (!($f[$i] instanceof ParagonIE_Sodium_Core32_Int32)) { + throw new TypeError('Expected Int32'); + } + if (!($g[$i] instanceof ParagonIE_Sodium_Core32_Int32)) { + throw new TypeError('Expected Int32'); + } + $h[$i] = $f[$i]->xorInt32( + $f[$i]->xorInt32($g[$i])->mask($b) + ); + } + /** @var array $h */ + return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray($h); + } + + /** + * Create a copy of a field element. + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f + * @return ParagonIE_Sodium_Core32_Curve25519_Fe + */ + public static function fe_copy(ParagonIE_Sodium_Core32_Curve25519_Fe $f) + { + $h = clone $f; + return $h; + } + + /** + * Give: 32-byte string. + * Receive: A field element object to use for internal calculations. + * + * @internal You should not use this directly from another application + * + * @param string $s + * @return ParagonIE_Sodium_Core32_Curve25519_Fe + * @throws RangeException + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedMethodCall + */ + public static function fe_frombytes($s) + { + if (self::strlen($s) !== 32) { + throw new RangeException('Expected a 32-byte string.'); + } + /** @var ParagonIE_Sodium_Core32_Int32 $h0 */ + $h0 = ParagonIE_Sodium_Core32_Int32::fromInt( + self::load_4($s) + ); + /** @var ParagonIE_Sodium_Core32_Int32 $h1 */ + $h1 = ParagonIE_Sodium_Core32_Int32::fromInt( + self::load_3(self::substr($s, 4, 3)) << 6 + ); + /** @var ParagonIE_Sodium_Core32_Int32 $h2 */ + $h2 = ParagonIE_Sodium_Core32_Int32::fromInt( + self::load_3(self::substr($s, 7, 3)) << 5 + ); + /** @var ParagonIE_Sodium_Core32_Int32 $h3 */ + $h3 = ParagonIE_Sodium_Core32_Int32::fromInt( + self::load_3(self::substr($s, 10, 3)) << 3 + ); + /** @var ParagonIE_Sodium_Core32_Int32 $h4 */ + $h4 = ParagonIE_Sodium_Core32_Int32::fromInt( + self::load_3(self::substr($s, 13, 3)) << 2 + ); + /** @var ParagonIE_Sodium_Core32_Int32 $h5 */ + $h5 = ParagonIE_Sodium_Core32_Int32::fromInt( + self::load_4(self::substr($s, 16, 4)) + ); + /** @var ParagonIE_Sodium_Core32_Int32 $h6 */ + $h6 = ParagonIE_Sodium_Core32_Int32::fromInt( + self::load_3(self::substr($s, 20, 3)) << 7 + ); + /** @var ParagonIE_Sodium_Core32_Int32 $h7 */ + $h7 = ParagonIE_Sodium_Core32_Int32::fromInt( + self::load_3(self::substr($s, 23, 3)) << 5 + ); + /** @var ParagonIE_Sodium_Core32_Int32 $h8 */ + $h8 = ParagonIE_Sodium_Core32_Int32::fromInt( + self::load_3(self::substr($s, 26, 3)) << 4 + ); + /** @var ParagonIE_Sodium_Core32_Int32 $h9 */ + $h9 = ParagonIE_Sodium_Core32_Int32::fromInt( + (self::load_3(self::substr($s, 29, 3)) & 8388607) << 2 + ); + + $carry9 = $h9->addInt(1 << 24)->shiftRight(25); + $h0 = $h0->addInt32($carry9->mulInt(19, 5)); + $h9 = $h9->subInt32($carry9->shiftLeft(25)); + + $carry1 = $h1->addInt(1 << 24)->shiftRight(25); + $h2 = $h2->addInt32($carry1); + $h1 = $h1->subInt32($carry1->shiftLeft(25)); + + $carry3 = $h3->addInt(1 << 24)->shiftRight(25); + $h4 = $h4->addInt32($carry3); + $h3 = $h3->subInt32($carry3->shiftLeft(25)); + + $carry5 = $h5->addInt(1 << 24)->shiftRight(25); + $h6 = $h6->addInt32($carry5); + $h5 = $h5->subInt32($carry5->shiftLeft(25)); + + $carry7 = $h7->addInt(1 << 24)->shiftRight(25); + $h8 = $h8->addInt32($carry7); + $h7 = $h7->subInt32($carry7->shiftLeft(25)); + + $carry0 = $h0->addInt(1 << 25)->shiftRight(26); + $h1 = $h1->addInt32($carry0); + $h0 = $h0->subInt32($carry0->shiftLeft(26)); + + $carry2 = $h2->addInt(1 << 25)->shiftRight(26); + $h3 = $h3->addInt32($carry2); + $h2 = $h2->subInt32($carry2->shiftLeft(26)); + + $carry4 = $h4->addInt(1 << 25)->shiftRight(26); + $h5 = $h5->addInt32($carry4); + $h4 = $h4->subInt32($carry4->shiftLeft(26)); + + $carry6 = $h6->addInt(1 << 25)->shiftRight(26); + $h7 = $h7->addInt32($carry6); + $h6 = $h6->subInt32($carry6->shiftLeft(26)); + + $carry8 = $h8->addInt(1 << 25)->shiftRight(26); + $h9 = $h9->addInt32($carry8); + $h8 = $h8->subInt32($carry8->shiftLeft(26)); + + return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( + array($h0, $h1, $h2,$h3, $h4, $h5, $h6, $h7, $h8, $h9) + ); + } + + /** + * Convert a field element to a byte string. + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Fe $h + * @return string + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedAssignment + * @psalm-suppress MixedMethodCall + */ + public static function fe_tobytes(ParagonIE_Sodium_Core32_Curve25519_Fe $h) + { + /** + * @var ParagonIE_Sodium_Core32_Int64[] $f + * @var ParagonIE_Sodium_Core32_Int64 $q + */ + $f = array(); + + for ($i = 0; $i < 10; ++$i) { + $f[$i] = $h[$i]->toInt64(); + } + + $q = $f[9]->mulInt(19, 5)->addInt(1 << 14)->shiftRight(25) + ->addInt64($f[0])->shiftRight(26) + ->addInt64($f[1])->shiftRight(25) + ->addInt64($f[2])->shiftRight(26) + ->addInt64($f[3])->shiftRight(25) + ->addInt64($f[4])->shiftRight(26) + ->addInt64($f[5])->shiftRight(25) + ->addInt64($f[6])->shiftRight(26) + ->addInt64($f[7])->shiftRight(25) + ->addInt64($f[8])->shiftRight(26) + ->addInt64($f[9])->shiftRight(25); + + $f[0] = $f[0]->addInt64($q->mulInt(19, 5)); + + $carry0 = $f[0]->shiftRight(26); + $f[1] = $f[1]->addInt64($carry0); + $f[0] = $f[0]->subInt64($carry0->shiftLeft(26)); + + $carry1 = $f[1]->shiftRight(25); + $f[2] = $f[2]->addInt64($carry1); + $f[1] = $f[1]->subInt64($carry1->shiftLeft(25)); + + $carry2 = $f[2]->shiftRight(26); + $f[3] = $f[3]->addInt64($carry2); + $f[2] = $f[2]->subInt64($carry2->shiftLeft(26)); + + $carry3 = $f[3]->shiftRight(25); + $f[4] = $f[4]->addInt64($carry3); + $f[3] = $f[3]->subInt64($carry3->shiftLeft(25)); + + $carry4 = $f[4]->shiftRight(26); + $f[5] = $f[5]->addInt64($carry4); + $f[4] = $f[4]->subInt64($carry4->shiftLeft(26)); + + $carry5 = $f[5]->shiftRight(25); + $f[6] = $f[6]->addInt64($carry5); + $f[5] = $f[5]->subInt64($carry5->shiftLeft(25)); + + $carry6 = $f[6]->shiftRight(26); + $f[7] = $f[7]->addInt64($carry6); + $f[6] = $f[6]->subInt64($carry6->shiftLeft(26)); + + $carry7 = $f[7]->shiftRight(25); + $f[8] = $f[8]->addInt64($carry7); + $f[7] = $f[7]->subInt64($carry7->shiftLeft(25)); + + $carry8 = $f[8]->shiftRight(26); + $f[9] = $f[9]->addInt64($carry8); + $f[8] = $f[8]->subInt64($carry8->shiftLeft(26)); + + $carry9 = $f[9]->shiftRight(25); + $f[9] = $f[9]->subInt64($carry9->shiftLeft(25)); + + /** @var int $h0 */ + $h0 = $f[0]->toInt32()->toInt(); + /** @var int $h1 */ + $h1 = $f[1]->toInt32()->toInt(); + /** @var int $h2 */ + $h2 = $f[2]->toInt32()->toInt(); + /** @var int $h3 */ + $h3 = $f[3]->toInt32()->toInt(); + /** @var int $h4 */ + $h4 = $f[4]->toInt32()->toInt(); + /** @var int $h5 */ + $h5 = $f[5]->toInt32()->toInt(); + /** @var int $h6 */ + $h6 = $f[6]->toInt32()->toInt(); + /** @var int $h7 */ + $h7 = $f[7]->toInt32()->toInt(); + /** @var int $h8 */ + $h8 = $f[8]->toInt32()->toInt(); + /** @var int $h9 */ + $h9 = $f[9]->toInt32()->toInt(); + + /** + * @var array + */ + $s = array( + (int) (($h0 >> 0) & 0xff), + (int) (($h0 >> 8) & 0xff), + (int) (($h0 >> 16) & 0xff), + (int) ((($h0 >> 24) | ($h1 << 2)) & 0xff), + (int) (($h1 >> 6) & 0xff), + (int) (($h1 >> 14) & 0xff), + (int) ((($h1 >> 22) | ($h2 << 3)) & 0xff), + (int) (($h2 >> 5) & 0xff), + (int) (($h2 >> 13) & 0xff), + (int) ((($h2 >> 21) | ($h3 << 5)) & 0xff), + (int) (($h3 >> 3) & 0xff), + (int) (($h3 >> 11) & 0xff), + (int) ((($h3 >> 19) | ($h4 << 6)) & 0xff), + (int) (($h4 >> 2) & 0xff), + (int) (($h4 >> 10) & 0xff), + (int) (($h4 >> 18) & 0xff), + (int) (($h5 >> 0) & 0xff), + (int) (($h5 >> 8) & 0xff), + (int) (($h5 >> 16) & 0xff), + (int) ((($h5 >> 24) | ($h6 << 1)) & 0xff), + (int) (($h6 >> 7) & 0xff), + (int) (($h6 >> 15) & 0xff), + (int) ((($h6 >> 23) | ($h7 << 3)) & 0xff), + (int) (($h7 >> 5) & 0xff), + (int) (($h7 >> 13) & 0xff), + (int) ((($h7 >> 21) | ($h8 << 4)) & 0xff), + (int) (($h8 >> 4) & 0xff), + (int) (($h8 >> 12) & 0xff), + (int) ((($h8 >> 20) | ($h9 << 6)) & 0xff), + (int) (($h9 >> 2) & 0xff), + (int) (($h9 >> 10) & 0xff), + (int) (($h9 >> 18) & 0xff) + ); + return self::intArrayToString($s); + } + + /** + * Is a field element negative? (1 = yes, 0 = no. Used in calculations.) + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f + * @return int + * @throws SodiumException + * @throws TypeError + */ + public static function fe_isnegative(ParagonIE_Sodium_Core32_Curve25519_Fe $f) + { + $str = self::fe_tobytes($f); + return (int) (self::chrToInt($str[0]) & 1); + } + + /** + * Returns 0 if this field element results in all NUL bytes. + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f + * @return bool + * @throws SodiumException + * @throws TypeError + */ + public static function fe_isnonzero(ParagonIE_Sodium_Core32_Curve25519_Fe $f) + { + static $zero; + if ($zero === null) { + $zero = str_repeat("\x00", 32); + } + /** @var string $str */ + $str = self::fe_tobytes($f); + /** @var string $zero */ + return !self::verify_32($str, $zero); + } + + /** + * Multiply two field elements + * + * h = f * g + * + * @internal You should not use this directly from another application + * + * @security Is multiplication a source of timing leaks? If so, can we do + * anything to prevent that from happening? + * + * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f + * @param ParagonIE_Sodium_Core32_Curve25519_Fe $g + * @return ParagonIE_Sodium_Core32_Curve25519_Fe + * @throws SodiumException + * @throws TypeError + */ + public static function fe_mul( + ParagonIE_Sodium_Core32_Curve25519_Fe $f, + ParagonIE_Sodium_Core32_Curve25519_Fe $g + ) { + /** + * @var ParagonIE_Sodium_Core32_Int32[] $f + * @var ParagonIE_Sodium_Core32_Int32[] $g + * @var ParagonIE_Sodium_Core32_Int64 $f0 + * @var ParagonIE_Sodium_Core32_Int64 $f1 + * @var ParagonIE_Sodium_Core32_Int64 $f2 + * @var ParagonIE_Sodium_Core32_Int64 $f3 + * @var ParagonIE_Sodium_Core32_Int64 $f4 + * @var ParagonIE_Sodium_Core32_Int64 $f5 + * @var ParagonIE_Sodium_Core32_Int64 $f6 + * @var ParagonIE_Sodium_Core32_Int64 $f7 + * @var ParagonIE_Sodium_Core32_Int64 $f8 + * @var ParagonIE_Sodium_Core32_Int64 $f9 + * @var ParagonIE_Sodium_Core32_Int64 $g0 + * @var ParagonIE_Sodium_Core32_Int64 $g1 + * @var ParagonIE_Sodium_Core32_Int64 $g2 + * @var ParagonIE_Sodium_Core32_Int64 $g3 + * @var ParagonIE_Sodium_Core32_Int64 $g4 + * @var ParagonIE_Sodium_Core32_Int64 $g5 + * @var ParagonIE_Sodium_Core32_Int64 $g6 + * @var ParagonIE_Sodium_Core32_Int64 $g7 + * @var ParagonIE_Sodium_Core32_Int64 $g8 + * @var ParagonIE_Sodium_Core32_Int64 $g9 + */ + $f0 = $f[0]->toInt64(); + $f1 = $f[1]->toInt64(); + $f2 = $f[2]->toInt64(); + $f3 = $f[3]->toInt64(); + $f4 = $f[4]->toInt64(); + $f5 = $f[5]->toInt64(); + $f6 = $f[6]->toInt64(); + $f7 = $f[7]->toInt64(); + $f8 = $f[8]->toInt64(); + $f9 = $f[9]->toInt64(); + $g0 = $g[0]->toInt64(); + $g1 = $g[1]->toInt64(); + $g2 = $g[2]->toInt64(); + $g3 = $g[3]->toInt64(); + $g4 = $g[4]->toInt64(); + $g5 = $g[5]->toInt64(); + $g6 = $g[6]->toInt64(); + $g7 = $g[7]->toInt64(); + $g8 = $g[8]->toInt64(); + $g9 = $g[9]->toInt64(); + $g1_19 = $g1->mulInt(19, 5); /* 2^4 <= 19 <= 2^5, but we only want 5 bits */ + $g2_19 = $g2->mulInt(19, 5); + $g3_19 = $g3->mulInt(19, 5); + $g4_19 = $g4->mulInt(19, 5); + $g5_19 = $g5->mulInt(19, 5); + $g6_19 = $g6->mulInt(19, 5); + $g7_19 = $g7->mulInt(19, 5); + $g8_19 = $g8->mulInt(19, 5); + $g9_19 = $g9->mulInt(19, 5); + /** @var ParagonIE_Sodium_Core32_Int64 $f1_2 */ + $f1_2 = $f1->shiftLeft(1); + /** @var ParagonIE_Sodium_Core32_Int64 $f3_2 */ + $f3_2 = $f3->shiftLeft(1); + /** @var ParagonIE_Sodium_Core32_Int64 $f5_2 */ + $f5_2 = $f5->shiftLeft(1); + /** @var ParagonIE_Sodium_Core32_Int64 $f7_2 */ + $f7_2 = $f7->shiftLeft(1); + /** @var ParagonIE_Sodium_Core32_Int64 $f9_2 */ + $f9_2 = $f9->shiftLeft(1); + $f0g0 = $f0->mulInt64($g0, 27); + $f0g1 = $f0->mulInt64($g1, 27); + $f0g2 = $f0->mulInt64($g2, 27); + $f0g3 = $f0->mulInt64($g3, 27); + $f0g4 = $f0->mulInt64($g4, 27); + $f0g5 = $f0->mulInt64($g5, 27); + $f0g6 = $f0->mulInt64($g6, 27); + $f0g7 = $f0->mulInt64($g7, 27); + $f0g8 = $f0->mulInt64($g8, 27); + $f0g9 = $f0->mulInt64($g9, 27); + $f1g0 = $f1->mulInt64($g0, 27); + $f1g1_2 = $f1_2->mulInt64($g1, 27); + $f1g2 = $f1->mulInt64($g2, 27); + $f1g3_2 = $f1_2->mulInt64($g3, 27); + $f1g4 = $f1->mulInt64($g4, 30); + $f1g5_2 = $f1_2->mulInt64($g5, 30); + $f1g6 = $f1->mulInt64($g6, 30); + $f1g7_2 = $f1_2->mulInt64($g7, 30); + $f1g8 = $f1->mulInt64($g8, 30); + $f1g9_38 = $g9_19->mulInt64($f1_2, 30); + $f2g0 = $f2->mulInt64($g0, 30); + $f2g1 = $f2->mulInt64($g1, 29); + $f2g2 = $f2->mulInt64($g2, 30); + $f2g3 = $f2->mulInt64($g3, 29); + $f2g4 = $f2->mulInt64($g4, 30); + $f2g5 = $f2->mulInt64($g5, 29); + $f2g6 = $f2->mulInt64($g6, 30); + $f2g7 = $f2->mulInt64($g7, 29); + $f2g8_19 = $g8_19->mulInt64($f2, 30); + $f2g9_19 = $g9_19->mulInt64($f2, 30); + $f3g0 = $f3->mulInt64($g0, 30); + $f3g1_2 = $f3_2->mulInt64($g1, 30); + $f3g2 = $f3->mulInt64($g2, 30); + $f3g3_2 = $f3_2->mulInt64($g3, 30); + $f3g4 = $f3->mulInt64($g4, 30); + $f3g5_2 = $f3_2->mulInt64($g5, 30); + $f3g6 = $f3->mulInt64($g6, 30); + $f3g7_38 = $g7_19->mulInt64($f3_2, 30); + $f3g8_19 = $g8_19->mulInt64($f3, 30); + $f3g9_38 = $g9_19->mulInt64($f3_2, 30); + $f4g0 = $f4->mulInt64($g0, 30); + $f4g1 = $f4->mulInt64($g1, 30); + $f4g2 = $f4->mulInt64($g2, 30); + $f4g3 = $f4->mulInt64($g3, 30); + $f4g4 = $f4->mulInt64($g4, 30); + $f4g5 = $f4->mulInt64($g5, 30); + $f4g6_19 = $g6_19->mulInt64($f4, 30); + $f4g7_19 = $g7_19->mulInt64($f4, 30); + $f4g8_19 = $g8_19->mulInt64($f4, 30); + $f4g9_19 = $g9_19->mulInt64($f4, 30); + $f5g0 = $f5->mulInt64($g0, 30); + $f5g1_2 = $f5_2->mulInt64($g1, 30); + $f5g2 = $f5->mulInt64($g2, 30); + $f5g3_2 = $f5_2->mulInt64($g3, 30); + $f5g4 = $f5->mulInt64($g4, 30); + $f5g5_38 = $g5_19->mulInt64($f5_2, 30); + $f5g6_19 = $g6_19->mulInt64($f5, 30); + $f5g7_38 = $g7_19->mulInt64($f5_2, 30); + $f5g8_19 = $g8_19->mulInt64($f5, 30); + $f5g9_38 = $g9_19->mulInt64($f5_2, 30); + $f6g0 = $f6->mulInt64($g0, 30); + $f6g1 = $f6->mulInt64($g1, 30); + $f6g2 = $f6->mulInt64($g2, 30); + $f6g3 = $f6->mulInt64($g3, 30); + $f6g4_19 = $g4_19->mulInt64($f6, 30); + $f6g5_19 = $g5_19->mulInt64($f6, 30); + $f6g6_19 = $g6_19->mulInt64($f6, 30); + $f6g7_19 = $g7_19->mulInt64($f6, 30); + $f6g8_19 = $g8_19->mulInt64($f6, 30); + $f6g9_19 = $g9_19->mulInt64($f6, 30); + $f7g0 = $f7->mulInt64($g0, 30); + $f7g1_2 = $g1->mulInt64($f7_2, 30); + $f7g2 = $f7->mulInt64($g2, 30); + $f7g3_38 = $g3_19->mulInt64($f7_2, 30); + $f7g4_19 = $g4_19->mulInt64($f7, 30); + $f7g5_38 = $g5_19->mulInt64($f7_2, 30); + $f7g6_19 = $g6_19->mulInt64($f7, 30); + $f7g7_38 = $g7_19->mulInt64($f7_2, 30); + $f7g8_19 = $g8_19->mulInt64($f7, 30); + $f7g9_38 = $g9_19->mulInt64($f7_2, 30); + $f8g0 = $f8->mulInt64($g0, 30); + $f8g1 = $f8->mulInt64($g1, 29); + $f8g2_19 = $g2_19->mulInt64($f8, 30); + $f8g3_19 = $g3_19->mulInt64($f8, 30); + $f8g4_19 = $g4_19->mulInt64($f8, 30); + $f8g5_19 = $g5_19->mulInt64($f8, 30); + $f8g6_19 = $g6_19->mulInt64($f8, 30); + $f8g7_19 = $g7_19->mulInt64($f8, 30); + $f8g8_19 = $g8_19->mulInt64($f8, 30); + $f8g9_19 = $g9_19->mulInt64($f8, 30); + $f9g0 = $f9->mulInt64($g0, 30); + $f9g1_38 = $g1_19->mulInt64($f9_2, 30); + $f9g2_19 = $g2_19->mulInt64($f9, 30); + $f9g3_38 = $g3_19->mulInt64($f9_2, 30); + $f9g4_19 = $g4_19->mulInt64($f9, 30); + $f9g5_38 = $g5_19->mulInt64($f9_2, 30); + $f9g6_19 = $g6_19->mulInt64($f9, 30); + $f9g7_38 = $g7_19->mulInt64($f9_2, 30); + $f9g8_19 = $g8_19->mulInt64($f9, 30); + $f9g9_38 = $g9_19->mulInt64($f9_2, 30); + + // $h0 = $f0g0 + $f1g9_38 + $f2g8_19 + $f3g7_38 + $f4g6_19 + $f5g5_38 + $f6g4_19 + $f7g3_38 + $f8g2_19 + $f9g1_38; + $h0 = $f0g0->addInt64($f1g9_38)->addInt64($f2g8_19)->addInt64($f3g7_38) + ->addInt64($f4g6_19)->addInt64($f5g5_38)->addInt64($f6g4_19) + ->addInt64($f7g3_38)->addInt64($f8g2_19)->addInt64($f9g1_38); + + // $h1 = $f0g1 + $f1g0 + $f2g9_19 + $f3g8_19 + $f4g7_19 + $f5g6_19 + $f6g5_19 + $f7g4_19 + $f8g3_19 + $f9g2_19; + $h1 = $f0g1->addInt64($f1g0)->addInt64($f2g9_19)->addInt64($f3g8_19) + ->addInt64($f4g7_19)->addInt64($f5g6_19)->addInt64($f6g5_19) + ->addInt64($f7g4_19)->addInt64($f8g3_19)->addInt64($f9g2_19); + + // $h2 = $f0g2 + $f1g1_2 + $f2g0 + $f3g9_38 + $f4g8_19 + $f5g7_38 + $f6g6_19 + $f7g5_38 + $f8g4_19 + $f9g3_38; + $h2 = $f0g2->addInt64($f1g1_2)->addInt64($f2g0)->addInt64($f3g9_38) + ->addInt64($f4g8_19)->addInt64($f5g7_38)->addInt64($f6g6_19) + ->addInt64($f7g5_38)->addInt64($f8g4_19)->addInt64($f9g3_38); + + // $h3 = $f0g3 + $f1g2 + $f2g1 + $f3g0 + $f4g9_19 + $f5g8_19 + $f6g7_19 + $f7g6_19 + $f8g5_19 + $f9g4_19; + $h3 = $f0g3->addInt64($f1g2)->addInt64($f2g1)->addInt64($f3g0) + ->addInt64($f4g9_19)->addInt64($f5g8_19)->addInt64($f6g7_19) + ->addInt64($f7g6_19)->addInt64($f8g5_19)->addInt64($f9g4_19); + + // $h4 = $f0g4 + $f1g3_2 + $f2g2 + $f3g1_2 + $f4g0 + $f5g9_38 + $f6g8_19 + $f7g7_38 + $f8g6_19 + $f9g5_38; + $h4 = $f0g4->addInt64($f1g3_2)->addInt64($f2g2)->addInt64($f3g1_2) + ->addInt64($f4g0)->addInt64($f5g9_38)->addInt64($f6g8_19) + ->addInt64($f7g7_38)->addInt64($f8g6_19)->addInt64($f9g5_38); + + // $h5 = $f0g5 + $f1g4 + $f2g3 + $f3g2 + $f4g1 + $f5g0 + $f6g9_19 + $f7g8_19 + $f8g7_19 + $f9g6_19; + $h5 = $f0g5->addInt64($f1g4)->addInt64($f2g3)->addInt64($f3g2) + ->addInt64($f4g1)->addInt64($f5g0)->addInt64($f6g9_19) + ->addInt64($f7g8_19)->addInt64($f8g7_19)->addInt64($f9g6_19); + + // $h6 = $f0g6 + $f1g5_2 + $f2g4 + $f3g3_2 + $f4g2 + $f5g1_2 + $f6g0 + $f7g9_38 + $f8g8_19 + $f9g7_38; + $h6 = $f0g6->addInt64($f1g5_2)->addInt64($f2g4)->addInt64($f3g3_2) + ->addInt64($f4g2)->addInt64($f5g1_2)->addInt64($f6g0) + ->addInt64($f7g9_38)->addInt64($f8g8_19)->addInt64($f9g7_38); + + // $h7 = $f0g7 + $f1g6 + $f2g5 + $f3g4 + $f4g3 + $f5g2 + $f6g1 + $f7g0 + $f8g9_19 + $f9g8_19; + $h7 = $f0g7->addInt64($f1g6)->addInt64($f2g5)->addInt64($f3g4) + ->addInt64($f4g3)->addInt64($f5g2)->addInt64($f6g1) + ->addInt64($f7g0)->addInt64($f8g9_19)->addInt64($f9g8_19); + + // $h8 = $f0g8 + $f1g7_2 + $f2g6 + $f3g5_2 + $f4g4 + $f5g3_2 + $f6g2 + $f7g1_2 + $f8g0 + $f9g9_38; + $h8 = $f0g8->addInt64($f1g7_2)->addInt64($f2g6)->addInt64($f3g5_2) + ->addInt64($f4g4)->addInt64($f5g3_2)->addInt64($f6g2) + ->addInt64($f7g1_2)->addInt64($f8g0)->addInt64($f9g9_38); + + // $h9 = $f0g9 + $f1g8 + $f2g7 + $f3g6 + $f4g5 + $f5g4 + $f6g3 + $f7g2 + $f8g1 + $f9g0 ; + $h9 = $f0g9->addInt64($f1g8)->addInt64($f2g7)->addInt64($f3g6) + ->addInt64($f4g5)->addInt64($f5g4)->addInt64($f6g3) + ->addInt64($f7g2)->addInt64($f8g1)->addInt64($f9g0); + + /** + * @var ParagonIE_Sodium_Core32_Int64 $h0 + * @var ParagonIE_Sodium_Core32_Int64 $h1 + * @var ParagonIE_Sodium_Core32_Int64 $h2 + * @var ParagonIE_Sodium_Core32_Int64 $h3 + * @var ParagonIE_Sodium_Core32_Int64 $h4 + * @var ParagonIE_Sodium_Core32_Int64 $h5 + * @var ParagonIE_Sodium_Core32_Int64 $h6 + * @var ParagonIE_Sodium_Core32_Int64 $h7 + * @var ParagonIE_Sodium_Core32_Int64 $h8 + * @var ParagonIE_Sodium_Core32_Int64 $h9 + * @var ParagonIE_Sodium_Core32_Int64 $carry0 + * @var ParagonIE_Sodium_Core32_Int64 $carry1 + * @var ParagonIE_Sodium_Core32_Int64 $carry2 + * @var ParagonIE_Sodium_Core32_Int64 $carry3 + * @var ParagonIE_Sodium_Core32_Int64 $carry4 + * @var ParagonIE_Sodium_Core32_Int64 $carry5 + * @var ParagonIE_Sodium_Core32_Int64 $carry6 + * @var ParagonIE_Sodium_Core32_Int64 $carry7 + * @var ParagonIE_Sodium_Core32_Int64 $carry8 + * @var ParagonIE_Sodium_Core32_Int64 $carry9 + */ + $carry0 = $h0->addInt(1 << 25)->shiftRight(26); + $h1 = $h1->addInt64($carry0); + $h0 = $h0->subInt64($carry0->shiftLeft(26)); + $carry4 = $h4->addInt(1 << 25)->shiftRight(26); + $h5 = $h5->addInt64($carry4); + $h4 = $h4->subInt64($carry4->shiftLeft(26)); + + $carry1 = $h1->addInt(1 << 24)->shiftRight(25); + $h2 = $h2->addInt64($carry1); + $h1 = $h1->subInt64($carry1->shiftLeft(25)); + $carry5 = $h5->addInt(1 << 24)->shiftRight(25); + $h6 = $h6->addInt64($carry5); + $h5 = $h5->subInt64($carry5->shiftLeft(25)); + + $carry2 = $h2->addInt(1 << 25)->shiftRight(26); + $h3 = $h3->addInt64($carry2); + $h2 = $h2->subInt64($carry2->shiftLeft(26)); + $carry6 = $h6->addInt(1 << 25)->shiftRight(26); + $h7 = $h7->addInt64($carry6); + $h6 = $h6->subInt64($carry6->shiftLeft(26)); + + $carry3 = $h3->addInt(1 << 24)->shiftRight(25); + $h4 = $h4->addInt64($carry3); + $h3 = $h3->subInt64($carry3->shiftLeft(25)); + $carry7 = $h7->addInt(1 << 24)->shiftRight(25); + $h8 = $h8->addInt64($carry7); + $h7 = $h7->subInt64($carry7->shiftLeft(25)); + + $carry4 = $h4->addInt(1 << 25)->shiftRight(26); + $h5 = $h5->addInt64($carry4); + $h4 = $h4->subInt64($carry4->shiftLeft(26)); + $carry8 = $h8->addInt(1 << 25)->shiftRight(26); + $h9 = $h9->addInt64($carry8); + $h8 = $h8->subInt64($carry8->shiftLeft(26)); + + $carry9 = $h9->addInt(1 << 24)->shiftRight(25); + $h0 = $h0->addInt64($carry9->mulInt(19, 5)); + $h9 = $h9->subInt64($carry9->shiftLeft(25)); + + $carry0 = $h0->addInt(1 << 25)->shiftRight(26); + $h1 = $h1->addInt64($carry0); + $h0 = $h0->subInt64($carry0->shiftLeft(26)); + + return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( + array( + $h0->toInt32(), + $h1->toInt32(), + $h2->toInt32(), + $h3->toInt32(), + $h4->toInt32(), + $h5->toInt32(), + $h6->toInt32(), + $h7->toInt32(), + $h8->toInt32(), + $h9->toInt32() + ) + ); + } + + /** + * Get the negative values for each piece of the field element. + * + * h = -f + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f + * @return ParagonIE_Sodium_Core32_Curve25519_Fe + * @psalm-suppress MixedAssignment + * @psalm-suppress MixedMethodCall + */ + public static function fe_neg(ParagonIE_Sodium_Core32_Curve25519_Fe $f) + { + $h = new ParagonIE_Sodium_Core32_Curve25519_Fe(); + for ($i = 0; $i < 10; ++$i) { + $h[$i] = $h[$i]->subInt32($f[$i]); + } + return $h; + } + + /** + * Square a field element + * + * h = f * f + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f + * @return ParagonIE_Sodium_Core32_Curve25519_Fe + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedMethodCall + */ + public static function fe_sq(ParagonIE_Sodium_Core32_Curve25519_Fe $f) + { + /** @var ParagonIE_Sodium_Core32_Int64 $f0 */ + $f0 = $f[0]->toInt64(); + /** @var ParagonIE_Sodium_Core32_Int64 $f1 */ + $f1 = $f[1]->toInt64(); + /** @var ParagonIE_Sodium_Core32_Int64 $f2 */ + $f2 = $f[2]->toInt64(); + /** @var ParagonIE_Sodium_Core32_Int64 $f3 */ + $f3 = $f[3]->toInt64(); + /** @var ParagonIE_Sodium_Core32_Int64 $f4 */ + $f4 = $f[4]->toInt64(); + /** @var ParagonIE_Sodium_Core32_Int64 $f5 */ + $f5 = $f[5]->toInt64(); + /** @var ParagonIE_Sodium_Core32_Int64 $f6 */ + $f6 = $f[6]->toInt64(); + /** @var ParagonIE_Sodium_Core32_Int64 $f7 */ + $f7 = $f[7]->toInt64(); + /** @var ParagonIE_Sodium_Core32_Int64 $f8 */ + $f8 = $f[8]->toInt64(); + /** @var ParagonIE_Sodium_Core32_Int64 $f9 */ + $f9 = $f[9]->toInt64(); + + /** @var ParagonIE_Sodium_Core32_Int64 $f0_2 */ + $f0_2 = $f0->shiftLeft(1); + $f1_2 = $f1->shiftLeft(1); + $f2_2 = $f2->shiftLeft(1); + $f3_2 = $f3->shiftLeft(1); + $f4_2 = $f4->shiftLeft(1); + $f5_2 = $f5->shiftLeft(1); + $f6_2 = $f6->shiftLeft(1); + $f7_2 = $f7->shiftLeft(1); + $f5_38 = $f5->mulInt(38, 6); + $f6_19 = $f6->mulInt(19, 5); + $f7_38 = $f7->mulInt(38, 6); + $f8_19 = $f8->mulInt(19, 5); + $f9_38 = $f9->mulInt(38, 6); + /** @var ParagonIE_Sodium_Core32_Int64 $f0f0*/ + $f0f0 = $f0->mulInt64($f0, 28); + $f0f1_2 = $f0_2->mulInt64($f1, 28); + $f0f2_2 = $f0_2->mulInt64($f2, 28); + $f0f3_2 = $f0_2->mulInt64($f3, 28); + $f0f4_2 = $f0_2->mulInt64($f4, 28); + $f0f5_2 = $f0_2->mulInt64($f5, 28); + $f0f6_2 = $f0_2->mulInt64($f6, 28); + $f0f7_2 = $f0_2->mulInt64($f7, 28); + $f0f8_2 = $f0_2->mulInt64($f8, 28); + $f0f9_2 = $f0_2->mulInt64($f9, 28); + + $f1f1_2 = $f1_2->mulInt64($f1, 28); + $f1f2_2 = $f1_2->mulInt64($f2, 28); + $f1f3_4 = $f1_2->mulInt64($f3_2, 28); + $f1f4_2 = $f1_2->mulInt64($f4, 28); + $f1f5_4 = $f1_2->mulInt64($f5_2, 30); + $f1f6_2 = $f1_2->mulInt64($f6, 28); + $f1f7_4 = $f1_2->mulInt64($f7_2, 28); + $f1f8_2 = $f1_2->mulInt64($f8, 28); + $f1f9_76 = $f9_38->mulInt64($f1_2, 30); + + $f2f2 = $f2->mulInt64($f2, 28); + $f2f3_2 = $f2_2->mulInt64($f3, 28); + $f2f4_2 = $f2_2->mulInt64($f4, 28); + $f2f5_2 = $f2_2->mulInt64($f5, 28); + $f2f6_2 = $f2_2->mulInt64($f6, 28); + $f2f7_2 = $f2_2->mulInt64($f7, 28); + $f2f8_38 = $f8_19->mulInt64($f2_2, 30); + $f2f9_38 = $f9_38->mulInt64($f2, 30); + + $f3f3_2 = $f3_2->mulInt64($f3, 28); + $f3f4_2 = $f3_2->mulInt64($f4, 28); + $f3f5_4 = $f3_2->mulInt64($f5_2, 30); + $f3f6_2 = $f3_2->mulInt64($f6, 28); + $f3f7_76 = $f7_38->mulInt64($f3_2, 30); + $f3f8_38 = $f8_19->mulInt64($f3_2, 30); + $f3f9_76 = $f9_38->mulInt64($f3_2, 30); + + $f4f4 = $f4->mulInt64($f4, 28); + $f4f5_2 = $f4_2->mulInt64($f5, 28); + $f4f6_38 = $f6_19->mulInt64($f4_2, 30); + $f4f7_38 = $f7_38->mulInt64($f4, 30); + $f4f8_38 = $f8_19->mulInt64($f4_2, 30); + $f4f9_38 = $f9_38->mulInt64($f4, 30); + + $f5f5_38 = $f5_38->mulInt64($f5, 30); + $f5f6_38 = $f6_19->mulInt64($f5_2, 30); + $f5f7_76 = $f7_38->mulInt64($f5_2, 30); + $f5f8_38 = $f8_19->mulInt64($f5_2, 30); + $f5f9_76 = $f9_38->mulInt64($f5_2, 30); + + $f6f6_19 = $f6_19->mulInt64($f6, 30); + $f6f7_38 = $f7_38->mulInt64($f6, 30); + $f6f8_38 = $f8_19->mulInt64($f6_2, 30); + $f6f9_38 = $f9_38->mulInt64($f6, 30); + + $f7f7_38 = $f7_38->mulInt64($f7, 28); + $f7f8_38 = $f8_19->mulInt64($f7_2, 30); + $f7f9_76 = $f9_38->mulInt64($f7_2, 30); + + $f8f8_19 = $f8_19->mulInt64($f8, 30); + $f8f9_38 = $f9_38->mulInt64($f8, 30); + + $f9f9_38 = $f9_38->mulInt64($f9, 28); + + $h0 = $f0f0->addInt64($f1f9_76)->addInt64($f2f8_38)->addInt64($f3f7_76)->addInt64($f4f6_38)->addInt64($f5f5_38); + $h1 = $f0f1_2->addInt64($f2f9_38)->addInt64($f3f8_38)->addInt64($f4f7_38)->addInt64($f5f6_38); + $h2 = $f0f2_2->addInt64($f1f1_2)->addInt64($f3f9_76)->addInt64($f4f8_38)->addInt64($f5f7_76)->addInt64($f6f6_19); + $h3 = $f0f3_2->addInt64($f1f2_2)->addInt64($f4f9_38)->addInt64($f5f8_38)->addInt64($f6f7_38); + $h4 = $f0f4_2->addInt64($f1f3_4)->addInt64($f2f2)->addInt64($f5f9_76)->addInt64($f6f8_38)->addInt64($f7f7_38); + $h5 = $f0f5_2->addInt64($f1f4_2)->addInt64($f2f3_2)->addInt64($f6f9_38)->addInt64($f7f8_38); + $h6 = $f0f6_2->addInt64($f1f5_4)->addInt64($f2f4_2)->addInt64($f3f3_2)->addInt64($f7f9_76)->addInt64($f8f8_19); + $h7 = $f0f7_2->addInt64($f1f6_2)->addInt64($f2f5_2)->addInt64($f3f4_2)->addInt64($f8f9_38); + $h8 = $f0f8_2->addInt64($f1f7_4)->addInt64($f2f6_2)->addInt64($f3f5_4)->addInt64($f4f4)->addInt64($f9f9_38); + $h9 = $f0f9_2->addInt64($f1f8_2)->addInt64($f2f7_2)->addInt64($f3f6_2)->addInt64($f4f5_2); + + /** + * @var ParagonIE_Sodium_Core32_Int64 $h0 + * @var ParagonIE_Sodium_Core32_Int64 $h1 + * @var ParagonIE_Sodium_Core32_Int64 $h2 + * @var ParagonIE_Sodium_Core32_Int64 $h3 + * @var ParagonIE_Sodium_Core32_Int64 $h4 + * @var ParagonIE_Sodium_Core32_Int64 $h5 + * @var ParagonIE_Sodium_Core32_Int64 $h6 + * @var ParagonIE_Sodium_Core32_Int64 $h7 + * @var ParagonIE_Sodium_Core32_Int64 $h8 + * @var ParagonIE_Sodium_Core32_Int64 $h9 + */ + + $carry0 = $h0->addInt(1 << 25)->shiftRight(26); + $h1 = $h1->addInt64($carry0); + $h0 = $h0->subInt64($carry0->shiftLeft(26)); + + $carry4 = $h4->addInt(1 << 25)->shiftRight(26); + $h5 = $h5->addInt64($carry4); + $h4 = $h4->subInt64($carry4->shiftLeft(26)); + + $carry1 = $h1->addInt(1 << 24)->shiftRight(25); + $h2 = $h2->addInt64($carry1); + $h1 = $h1->subInt64($carry1->shiftLeft(25)); + + $carry5 = $h5->addInt(1 << 24)->shiftRight(25); + $h6 = $h6->addInt64($carry5); + $h5 = $h5->subInt64($carry5->shiftLeft(25)); + + $carry2 = $h2->addInt(1 << 25)->shiftRight(26); + $h3 = $h3->addInt64($carry2); + $h2 = $h2->subInt64($carry2->shiftLeft(26)); + + $carry6 = $h6->addInt(1 << 25)->shiftRight(26); + $h7 = $h7->addInt64($carry6); + $h6 = $h6->subInt64($carry6->shiftLeft(26)); + + $carry3 = $h3->addInt(1 << 24)->shiftRight(25); + $h4 = $h4->addInt64($carry3); + $h3 = $h3->subInt64($carry3->shiftLeft(25)); + + $carry7 = $h7->addInt(1 << 24)->shiftRight(25); + $h8 = $h8->addInt64($carry7); + $h7 = $h7->subInt64($carry7->shiftLeft(25)); + + $carry4 = $h4->addInt(1 << 25)->shiftRight(26); + $h5 = $h5->addInt64($carry4); + $h4 = $h4->subInt64($carry4->shiftLeft(26)); + + $carry8 = $h8->addInt(1 << 25)->shiftRight(26); + $h9 = $h9->addInt64($carry8); + $h8 = $h8->subInt64($carry8->shiftLeft(26)); + + $carry9 = $h9->addInt(1 << 24)->shiftRight(25); + $h0 = $h0->addInt64($carry9->mulInt(19, 5)); + $h9 = $h9->subInt64($carry9->shiftLeft(25)); + + $carry0 = $h0->addInt(1 << 25)->shiftRight(26); + $h1 = $h1->addInt64($carry0); + $h0 = $h0->subInt64($carry0->shiftLeft(26)); + + return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( + array( + $h0->toInt32(), + $h1->toInt32(), + $h2->toInt32(), + $h3->toInt32(), + $h4->toInt32(), + $h5->toInt32(), + $h6->toInt32(), + $h7->toInt32(), + $h8->toInt32(), + $h9->toInt32() + ) + ); + } + + /** + * Square and double a field element + * + * h = 2 * f * f + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f + * @return ParagonIE_Sodium_Core32_Curve25519_Fe + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedMethodCall + */ + public static function fe_sq2(ParagonIE_Sodium_Core32_Curve25519_Fe $f) + { + /** @var ParagonIE_Sodium_Core32_Int64 $f0 */ + $f0 = $f[0]->toInt64(); + /** @var ParagonIE_Sodium_Core32_Int64 $f1 */ + $f1 = $f[1]->toInt64(); + /** @var ParagonIE_Sodium_Core32_Int64 $f2 */ + $f2 = $f[2]->toInt64(); + /** @var ParagonIE_Sodium_Core32_Int64 $f3 */ + $f3 = $f[3]->toInt64(); + /** @var ParagonIE_Sodium_Core32_Int64 $f4 */ + $f4 = $f[4]->toInt64(); + /** @var ParagonIE_Sodium_Core32_Int64 $f5 */ + $f5 = $f[5]->toInt64(); + /** @var ParagonIE_Sodium_Core32_Int64 $f6 */ + $f6 = $f[6]->toInt64(); + /** @var ParagonIE_Sodium_Core32_Int64 $f7 */ + $f7 = $f[7]->toInt64(); + /** @var ParagonIE_Sodium_Core32_Int64 $f8 */ + $f8 = $f[8]->toInt64(); + /** @var ParagonIE_Sodium_Core32_Int64 $f9 */ + $f9 = $f[9]->toInt64(); + + $f0_2 = $f0->shiftLeft(1); + $f1_2 = $f1->shiftLeft(1); + $f2_2 = $f2->shiftLeft(1); + $f3_2 = $f3->shiftLeft(1); + $f4_2 = $f4->shiftLeft(1); + $f5_2 = $f5->shiftLeft(1); + $f6_2 = $f6->shiftLeft(1); + $f7_2 = $f7->shiftLeft(1); + $f5_38 = $f5->mulInt(38, 6); /* 1.959375*2^30 */ + $f6_19 = $f6->mulInt(19, 5); /* 1.959375*2^30 */ + $f7_38 = $f7->mulInt(38, 6); /* 1.959375*2^30 */ + $f8_19 = $f8->mulInt(19, 5); /* 1.959375*2^30 */ + $f9_38 = $f9->mulInt(38, 6); /* 1.959375*2^30 */ + $f0f0 = $f0->mulInt64($f0, 28); + $f0f1_2 = $f0_2->mulInt64($f1, 28); + $f0f2_2 = $f0_2->mulInt64($f2, 28); + $f0f3_2 = $f0_2->mulInt64($f3, 28); + $f0f4_2 = $f0_2->mulInt64($f4, 28); + $f0f5_2 = $f0_2->mulInt64($f5, 28); + $f0f6_2 = $f0_2->mulInt64($f6, 28); + $f0f7_2 = $f0_2->mulInt64($f7, 28); + $f0f8_2 = $f0_2->mulInt64($f8, 28); + $f0f9_2 = $f0_2->mulInt64($f9, 28); + $f1f1_2 = $f1_2->mulInt64($f1, 28); + $f1f2_2 = $f1_2->mulInt64($f2, 28); + $f1f3_4 = $f1_2->mulInt64($f3_2, 29); + $f1f4_2 = $f1_2->mulInt64($f4, 28); + $f1f5_4 = $f1_2->mulInt64($f5_2, 29); + $f1f6_2 = $f1_2->mulInt64($f6, 28); + $f1f7_4 = $f1_2->mulInt64($f7_2, 29); + $f1f8_2 = $f1_2->mulInt64($f8, 28); + $f1f9_76 = $f9_38->mulInt64($f1_2, 29); + $f2f2 = $f2->mulInt64($f2, 28); + $f2f3_2 = $f2_2->mulInt64($f3, 28); + $f2f4_2 = $f2_2->mulInt64($f4, 28); + $f2f5_2 = $f2_2->mulInt64($f5, 28); + $f2f6_2 = $f2_2->mulInt64($f6, 28); + $f2f7_2 = $f2_2->mulInt64($f7, 28); + $f2f8_38 = $f8_19->mulInt64($f2_2, 29); + $f2f9_38 = $f9_38->mulInt64($f2, 29); + $f3f3_2 = $f3_2->mulInt64($f3, 28); + $f3f4_2 = $f3_2->mulInt64($f4, 28); + $f3f5_4 = $f3_2->mulInt64($f5_2, 28); + $f3f6_2 = $f3_2->mulInt64($f6, 28); + $f3f7_76 = $f7_38->mulInt64($f3_2, 29); + $f3f8_38 = $f8_19->mulInt64($f3_2, 29); + $f3f9_76 = $f9_38->mulInt64($f3_2, 29); + $f4f4 = $f4->mulInt64($f4, 28); + $f4f5_2 = $f4_2->mulInt64($f5, 28); + $f4f6_38 = $f6_19->mulInt64($f4_2, 29); + $f4f7_38 = $f7_38->mulInt64($f4, 29); + $f4f8_38 = $f8_19->mulInt64($f4_2, 29); + $f4f9_38 = $f9_38->mulInt64($f4, 29); + $f5f5_38 = $f5_38->mulInt64($f5, 29); + $f5f6_38 = $f6_19->mulInt64($f5_2, 29); + $f5f7_76 = $f7_38->mulInt64($f5_2, 29); + $f5f8_38 = $f8_19->mulInt64($f5_2, 29); + $f5f9_76 = $f9_38->mulInt64($f5_2, 29); + $f6f6_19 = $f6_19->mulInt64($f6, 29); + $f6f7_38 = $f7_38->mulInt64($f6, 29); + $f6f8_38 = $f8_19->mulInt64($f6_2, 29); + $f6f9_38 = $f9_38->mulInt64($f6, 29); + $f7f7_38 = $f7_38->mulInt64($f7, 29); + $f7f8_38 = $f8_19->mulInt64($f7_2, 29); + $f7f9_76 = $f9_38->mulInt64($f7_2, 29); + $f8f8_19 = $f8_19->mulInt64($f8, 29); + $f8f9_38 = $f9_38->mulInt64($f8, 29); + $f9f9_38 = $f9_38->mulInt64($f9, 29); + + $h0 = $f0f0->addInt64($f1f9_76)->addInt64($f2f8_38)->addInt64($f3f7_76)->addInt64($f4f6_38)->addInt64($f5f5_38); + $h1 = $f0f1_2->addInt64($f2f9_38)->addInt64($f3f8_38)->addInt64($f4f7_38)->addInt64($f5f6_38); + $h2 = $f0f2_2->addInt64($f1f1_2)->addInt64($f3f9_76)->addInt64($f4f8_38)->addInt64($f5f7_76)->addInt64($f6f6_19); + $h3 = $f0f3_2->addInt64($f1f2_2)->addInt64($f4f9_38)->addInt64($f5f8_38)->addInt64($f6f7_38); + $h4 = $f0f4_2->addInt64($f1f3_4)->addInt64($f2f2)->addInt64($f5f9_76)->addInt64($f6f8_38)->addInt64($f7f7_38); + $h5 = $f0f5_2->addInt64($f1f4_2)->addInt64($f2f3_2)->addInt64($f6f9_38)->addInt64($f7f8_38); + $h6 = $f0f6_2->addInt64($f1f5_4)->addInt64($f2f4_2)->addInt64($f3f3_2)->addInt64($f7f9_76)->addInt64($f8f8_19); + $h7 = $f0f7_2->addInt64($f1f6_2)->addInt64($f2f5_2)->addInt64($f3f4_2)->addInt64($f8f9_38); + $h8 = $f0f8_2->addInt64($f1f7_4)->addInt64($f2f6_2)->addInt64($f3f5_4)->addInt64($f4f4)->addInt64($f9f9_38); + $h9 = $f0f9_2->addInt64($f1f8_2)->addInt64($f2f7_2)->addInt64($f3f6_2)->addInt64($f4f5_2); + + /** + * @var ParagonIE_Sodium_Core32_Int64 $h0 + * @var ParagonIE_Sodium_Core32_Int64 $h1 + * @var ParagonIE_Sodium_Core32_Int64 $h2 + * @var ParagonIE_Sodium_Core32_Int64 $h3 + * @var ParagonIE_Sodium_Core32_Int64 $h4 + * @var ParagonIE_Sodium_Core32_Int64 $h5 + * @var ParagonIE_Sodium_Core32_Int64 $h6 + * @var ParagonIE_Sodium_Core32_Int64 $h7 + * @var ParagonIE_Sodium_Core32_Int64 $h8 + * @var ParagonIE_Sodium_Core32_Int64 $h9 + */ + $h0 = $h0->shiftLeft(1); + $h1 = $h1->shiftLeft(1); + $h2 = $h2->shiftLeft(1); + $h3 = $h3->shiftLeft(1); + $h4 = $h4->shiftLeft(1); + $h5 = $h5->shiftLeft(1); + $h6 = $h6->shiftLeft(1); + $h7 = $h7->shiftLeft(1); + $h8 = $h8->shiftLeft(1); + $h9 = $h9->shiftLeft(1); + + $carry0 = $h0->addInt(1 << 25)->shiftRight(26); + $h1 = $h1->addInt64($carry0); + $h0 = $h0->subInt64($carry0->shiftLeft(26)); + $carry4 = $h4->addInt(1 << 25)->shiftRight(26); + $h5 = $h5->addInt64($carry4); + $h4 = $h4->subInt64($carry4->shiftLeft(26)); + + $carry1 = $h1->addInt(1 << 24)->shiftRight(25); + $h2 = $h2->addInt64($carry1); + $h1 = $h1->subInt64($carry1->shiftLeft(25)); + $carry5 = $h5->addInt(1 << 24)->shiftRight(25); + $h6 = $h6->addInt64($carry5); + $h5 = $h5->subInt64($carry5->shiftLeft(25)); + + $carry2 = $h2->addInt(1 << 25)->shiftRight(26); + $h3 = $h3->addInt64($carry2); + $h2 = $h2->subInt64($carry2->shiftLeft(26)); + $carry6 = $h6->addInt(1 << 25)->shiftRight(26); + $h7 = $h7->addInt64($carry6); + $h6 = $h6->subInt64($carry6->shiftLeft(26)); + + $carry3 = $h3->addInt(1 << 24)->shiftRight(25); + $h4 = $h4->addInt64($carry3); + $h3 = $h3->subInt64($carry3->shiftLeft(25)); + $carry7 = $h7->addInt(1 << 24)->shiftRight(25); + $h8 = $h8->addInt64($carry7); + $h7 = $h7->subInt64($carry7->shiftLeft(25)); + + $carry4 = $h4->addInt(1 << 25)->shiftRight(26); + $h5 = $h5->addInt64($carry4); + $h4 = $h4->subInt64($carry4->shiftLeft(26)); + $carry8 = $h8->addInt(1 << 25)->shiftRight(26); + $h9 = $h9->addInt64($carry8); + $h8 = $h8->subInt64($carry8->shiftLeft(26)); + + $carry9 = $h9->addInt(1 << 24)->shiftRight(25); + $h0 = $h0->addInt64($carry9->mulInt(19, 5)); + $h9 = $h9->subInt64($carry9->shiftLeft(25)); + + $carry0 = $h0->addInt(1 << 25)->shiftRight(26); + $h1 = $h1->addInt64($carry0); + $h0 = $h0->subInt64($carry0->shiftLeft(26)); + + return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( + array( + $h0->toInt32(), + $h1->toInt32(), + $h2->toInt32(), + $h3->toInt32(), + $h4->toInt32(), + $h5->toInt32(), + $h6->toInt32(), + $h7->toInt32(), + $h8->toInt32(), + $h9->toInt32() + ) + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Fe $Z + * @return ParagonIE_Sodium_Core32_Curve25519_Fe + * @throws SodiumException + * @throws TypeError + */ + public static function fe_invert(ParagonIE_Sodium_Core32_Curve25519_Fe $Z) + { + $z = clone $Z; + $t0 = self::fe_sq($z); + $t1 = self::fe_sq($t0); + $t1 = self::fe_sq($t1); + $t1 = self::fe_mul($z, $t1); + $t0 = self::fe_mul($t0, $t1); + $t2 = self::fe_sq($t0); + $t1 = self::fe_mul($t1, $t2); + $t2 = self::fe_sq($t1); + for ($i = 1; $i < 5; ++$i) { + $t2 = self::fe_sq($t2); + } + $t1 = self::fe_mul($t2, $t1); + $t2 = self::fe_sq($t1); + for ($i = 1; $i < 10; ++$i) { + $t2 = self::fe_sq($t2); + } + $t2 = self::fe_mul($t2, $t1); + $t3 = self::fe_sq($t2); + for ($i = 1; $i < 20; ++$i) { + $t3 = self::fe_sq($t3); + } + $t2 = self::fe_mul($t3, $t2); + $t2 = self::fe_sq($t2); + for ($i = 1; $i < 10; ++$i) { + $t2 = self::fe_sq($t2); + } + $t1 = self::fe_mul($t2, $t1); + $t2 = self::fe_sq($t1); + for ($i = 1; $i < 50; ++$i) { + $t2 = self::fe_sq($t2); + } + $t2 = self::fe_mul($t2, $t1); + $t3 = self::fe_sq($t2); + for ($i = 1; $i < 100; ++$i) { + $t3 = self::fe_sq($t3); + } + $t2 = self::fe_mul($t3, $t2); + $t2 = self::fe_sq($t2); + for ($i = 1; $i < 50; ++$i) { + $t2 = self::fe_sq($t2); + } + $t1 = self::fe_mul($t2, $t1); + $t1 = self::fe_sq($t1); + for ($i = 1; $i < 5; ++$i) { + $t1 = self::fe_sq($t1); + } + return self::fe_mul($t1, $t0); + } + + /** + * @internal You should not use this directly from another application + * + * @ref https://github.com/jedisct1/libsodium/blob/68564326e1e9dc57ef03746f85734232d20ca6fb/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c#L1054-L1106 + * + * @param ParagonIE_Sodium_Core32_Curve25519_Fe $z + * @return ParagonIE_Sodium_Core32_Curve25519_Fe + * @throws SodiumException + * @throws TypeError + */ + public static function fe_pow22523(ParagonIE_Sodium_Core32_Curve25519_Fe $z) + { + # fe_sq(t0, z); + # fe_sq(t1, t0); + # fe_sq(t1, t1); + # fe_mul(t1, z, t1); + # fe_mul(t0, t0, t1); + # fe_sq(t0, t0); + # fe_mul(t0, t1, t0); + # fe_sq(t1, t0); + $t0 = self::fe_sq($z); + $t1 = self::fe_sq($t0); + $t1 = self::fe_sq($t1); + $t1 = self::fe_mul($z, $t1); + $t0 = self::fe_mul($t0, $t1); + $t0 = self::fe_sq($t0); + $t0 = self::fe_mul($t1, $t0); + $t1 = self::fe_sq($t0); + + # for (i = 1; i < 5; ++i) { + # fe_sq(t1, t1); + # } + for ($i = 1; $i < 5; ++$i) { + $t1 = self::fe_sq($t1); + } + + # fe_mul(t0, t1, t0); + # fe_sq(t1, t0); + $t0 = self::fe_mul($t1, $t0); + $t1 = self::fe_sq($t0); + + # for (i = 1; i < 10; ++i) { + # fe_sq(t1, t1); + # } + for ($i = 1; $i < 10; ++$i) { + $t1 = self::fe_sq($t1); + } + + # fe_mul(t1, t1, t0); + # fe_sq(t2, t1); + $t1 = self::fe_mul($t1, $t0); + $t2 = self::fe_sq($t1); + + # for (i = 1; i < 20; ++i) { + # fe_sq(t2, t2); + # } + for ($i = 1; $i < 20; ++$i) { + $t2 = self::fe_sq($t2); + } + + # fe_mul(t1, t2, t1); + # fe_sq(t1, t1); + $t1 = self::fe_mul($t2, $t1); + $t1 = self::fe_sq($t1); + + # for (i = 1; i < 10; ++i) { + # fe_sq(t1, t1); + # } + for ($i = 1; $i < 10; ++$i) { + $t1 = self::fe_sq($t1); + } + + # fe_mul(t0, t1, t0); + # fe_sq(t1, t0); + $t0 = self::fe_mul($t1, $t0); + $t1 = self::fe_sq($t0); + + # for (i = 1; i < 50; ++i) { + # fe_sq(t1, t1); + # } + for ($i = 1; $i < 50; ++$i) { + $t1 = self::fe_sq($t1); + } + + # fe_mul(t1, t1, t0); + # fe_sq(t2, t1); + $t1 = self::fe_mul($t1, $t0); + $t2 = self::fe_sq($t1); + + # for (i = 1; i < 100; ++i) { + # fe_sq(t2, t2); + # } + for ($i = 1; $i < 100; ++$i) { + $t2 = self::fe_sq($t2); + } + + # fe_mul(t1, t2, t1); + # fe_sq(t1, t1); + $t1 = self::fe_mul($t2, $t1); + $t1 = self::fe_sq($t1); + + # for (i = 1; i < 50; ++i) { + # fe_sq(t1, t1); + # } + for ($i = 1; $i < 50; ++$i) { + $t1 = self::fe_sq($t1); + } + + # fe_mul(t0, t1, t0); + # fe_sq(t0, t0); + # fe_sq(t0, t0); + # fe_mul(out, t0, z); + $t0 = self::fe_mul($t1, $t0); + $t0 = self::fe_sq($t0); + $t0 = self::fe_sq($t0); + return self::fe_mul($t0, $z); + } + + /** + * Subtract two field elements. + * + * h = f - g + * + * Preconditions: + * |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. + * |g| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. + * + * Postconditions: + * |h| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f + * @param ParagonIE_Sodium_Core32_Curve25519_Fe $g + * @return ParagonIE_Sodium_Core32_Curve25519_Fe + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedMethodCall + * @psalm-suppress MixedTypeCoercion + */ + public static function fe_sub(ParagonIE_Sodium_Core32_Curve25519_Fe $f, ParagonIE_Sodium_Core32_Curve25519_Fe $g) + { + return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( + array( + $f[0]->subInt32($g[0]), + $f[1]->subInt32($g[1]), + $f[2]->subInt32($g[2]), + $f[3]->subInt32($g[3]), + $f[4]->subInt32($g[4]), + $f[5]->subInt32($g[5]), + $f[6]->subInt32($g[6]), + $f[7]->subInt32($g[7]), + $f[8]->subInt32($g[8]), + $f[9]->subInt32($g[9]) + ) + ); + } + + /** + * Add two group elements. + * + * r = p + q + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_Cached $q + * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 + * @throws SodiumException + * @throws TypeError + */ + public static function ge_add( + ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p, + ParagonIE_Sodium_Core32_Curve25519_Ge_Cached $q + ) { + $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1(); + $r->X = self::fe_add($p->Y, $p->X); + $r->Y = self::fe_sub($p->Y, $p->X); + $r->Z = self::fe_mul($r->X, $q->YplusX); + $r->Y = self::fe_mul($r->Y, $q->YminusX); + $r->T = self::fe_mul($q->T2d, $p->T); + $r->X = self::fe_mul($p->Z, $q->Z); + $t0 = self::fe_add($r->X, $r->X); + $r->X = self::fe_sub($r->Z, $r->Y); + $r->Y = self::fe_add($r->Z, $r->Y); + $r->Z = self::fe_add($t0, $r->T); + $r->T = self::fe_sub($t0, $r->T); + return $r; + } + + /** + * @internal You should not use this directly from another application + * + * @ref https://github.com/jedisct1/libsodium/blob/157c4a80c13b117608aeae12178b2d38825f9f8f/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c#L1185-L1215 + * @param string $a + * @return array + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArrayOffset + */ + public static function slide($a) + { + if (self::strlen($a) < 256) { + if (self::strlen($a) < 16) { + $a = str_pad($a, 256, '0', STR_PAD_RIGHT); + } + } + /** @var array $r */ + $r = array(); + for ($i = 0; $i < 256; ++$i) { + $r[$i] = (int) (1 & + ( + self::chrToInt($a[$i >> 3]) + >> + ($i & 7) + ) + ); + } + + for ($i = 0;$i < 256;++$i) { + if ($r[$i]) { + for ($b = 1;$b <= 6 && $i + $b < 256;++$b) { + if ($r[$i + $b]) { + if ($r[$i] + ($r[$i + $b] << $b) <= 15) { + $r[$i] += $r[$i + $b] << $b; + $r[$i + $b] = 0; + } elseif ($r[$i] - ($r[$i + $b] << $b) >= -15) { + $r[$i] -= $r[$i + $b] << $b; + for ($k = $i + $b; $k < 256; ++$k) { + if (!$r[$k]) { + $r[$k] = 1; + break; + } + $r[$k] = 0; + } + } else { + break; + } + } + } + } + } + return $r; + } + + /** + * @internal You should not use this directly from another application + * + * @param string $s + * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P3 + * @throws SodiumException + * @throws TypeError + */ + public static function ge_frombytes_negate_vartime($s) + { + static $d = null; + if (!$d) { + /** @var ParagonIE_Sodium_Core32_Curve25519_Fe $d */ + $d = ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( + array( + ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[0]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[1]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[2]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[3]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[4]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[5]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[6]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[7]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[8]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[9]) + ) + ); + } + + # fe_frombytes(h->Y,s); + # fe_1(h->Z); + $h = new ParagonIE_Sodium_Core32_Curve25519_Ge_P3( + self::fe_0(), + self::fe_frombytes($s), + self::fe_1() + ); + + # fe_sq(u,h->Y); + # fe_mul(v,u,d); + # fe_sub(u,u,h->Z); /* u = y^2-1 */ + # fe_add(v,v,h->Z); /* v = dy^2+1 */ + $u = self::fe_sq($h->Y); + /** @var ParagonIE_Sodium_Core32_Curve25519_Fe $d */ + $v = self::fe_mul($u, $d); + $u = self::fe_sub($u, $h->Z); /* u = y^2 - 1 */ + $v = self::fe_add($v, $h->Z); /* v = dy^2 + 1 */ + + # fe_sq(v3,v); + # fe_mul(v3,v3,v); /* v3 = v^3 */ + # fe_sq(h->X,v3); + # fe_mul(h->X,h->X,v); + # fe_mul(h->X,h->X,u); /* x = uv^7 */ + $v3 = self::fe_sq($v); + $v3 = self::fe_mul($v3, $v); /* v3 = v^3 */ + $h->X = self::fe_sq($v3); + $h->X = self::fe_mul($h->X, $v); + $h->X = self::fe_mul($h->X, $u); /* x = uv^7 */ + + # fe_pow22523(h->X,h->X); /* x = (uv^7)^((q-5)/8) */ + # fe_mul(h->X,h->X,v3); + # fe_mul(h->X,h->X,u); /* x = uv^3(uv^7)^((q-5)/8) */ + $h->X = self::fe_pow22523($h->X); /* x = (uv^7)^((q-5)/8) */ + $h->X = self::fe_mul($h->X, $v3); + $h->X = self::fe_mul($h->X, $u); /* x = uv^3(uv^7)^((q-5)/8) */ + + # fe_sq(vxx,h->X); + # fe_mul(vxx,vxx,v); + # fe_sub(check,vxx,u); /* vx^2-u */ + $vxx = self::fe_sq($h->X); + $vxx = self::fe_mul($vxx, $v); + $check = self::fe_sub($vxx, $u); /* vx^2 - u */ + + # if (fe_isnonzero(check)) { + # fe_add(check,vxx,u); /* vx^2+u */ + # if (fe_isnonzero(check)) { + # return -1; + # } + # fe_mul(h->X,h->X,sqrtm1); + # } + if (self::fe_isnonzero($check)) { + $check = self::fe_add($vxx, $u); /* vx^2 + u */ + if (self::fe_isnonzero($check)) { + throw new RangeException('Internal check failed.'); + } + $h->X = self::fe_mul( + $h->X, + ParagonIE_Sodium_Core32_Curve25519_Fe::fromIntArray(self::$sqrtm1) + ); + } + + # if (fe_isnegative(h->X) == (s[31] >> 7)) { + # fe_neg(h->X,h->X); + # } + $i = self::chrToInt($s[31]); + if (self::fe_isnegative($h->X) === ($i >> 7)) { + $h->X = self::fe_neg($h->X); + } + + # fe_mul(h->T,h->X,h->Y); + $h->T = self::fe_mul($h->X, $h->Y); + return $h; + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $R + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $q + * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 + * @throws SodiumException + * @throws TypeError + */ + public static function ge_madd( + ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $R, + ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p, + ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $q + ) { + $r = clone $R; + $r->X = self::fe_add($p->Y, $p->X); + $r->Y = self::fe_sub($p->Y, $p->X); + $r->Z = self::fe_mul($r->X, $q->yplusx); + $r->Y = self::fe_mul($r->Y, $q->yminusx); + $r->T = self::fe_mul($q->xy2d, $p->T); + $t0 = self::fe_add(clone $p->Z, clone $p->Z); + $r->X = self::fe_sub($r->Z, $r->Y); + $r->Y = self::fe_add($r->Z, $r->Y); + $r->Z = self::fe_add($t0, $r->T); + $r->T = self::fe_sub($t0, $r->T); + + return $r; + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $R + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $q + * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 + * @throws SodiumException + * @throws TypeError + */ + public static function ge_msub( + ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $R, + ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p, + ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $q + ) { + $r = clone $R; + + $r->X = self::fe_add($p->Y, $p->X); + $r->Y = self::fe_sub($p->Y, $p->X); + $r->Z = self::fe_mul($r->X, $q->yminusx); + $r->Y = self::fe_mul($r->Y, $q->yplusx); + $r->T = self::fe_mul($q->xy2d, $p->T); + $t0 = self::fe_add($p->Z, $p->Z); + $r->X = self::fe_sub($r->Z, $r->Y); + $r->Y = self::fe_add($r->Z, $r->Y); + $r->Z = self::fe_sub($t0, $r->T); + $r->T = self::fe_add($t0, $r->T); + + return $r; + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $p + * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P2 + * @throws SodiumException + * @throws TypeError + */ + public static function ge_p1p1_to_p2(ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $p) + { + $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P2(); + $r->X = self::fe_mul($p->X, $p->T); + $r->Y = self::fe_mul($p->Y, $p->Z); + $r->Z = self::fe_mul($p->Z, $p->T); + return $r; + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $p + * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P3 + * @throws SodiumException + * @throws TypeError + */ + public static function ge_p1p1_to_p3(ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $p) + { + $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P3(); + $r->X = self::fe_mul($p->X, $p->T); + $r->Y = self::fe_mul($p->Y, $p->Z); + $r->Z = self::fe_mul($p->Z, $p->T); + $r->T = self::fe_mul($p->X, $p->Y); + return $r; + } + + /** + * @internal You should not use this directly from another application + * + * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P2 + * @throws SodiumException + * @throws TypeError + */ + public static function ge_p2_0() + { + return new ParagonIE_Sodium_Core32_Curve25519_Ge_P2( + self::fe_0(), + self::fe_1(), + self::fe_1() + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $p + * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 + * @throws SodiumException + * @throws TypeError + */ + public static function ge_p2_dbl(ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $p) + { + $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1(); + + $r->X = self::fe_sq($p->X); + $r->Z = self::fe_sq($p->Y); + $r->T = self::fe_sq2($p->Z); + $r->Y = self::fe_add($p->X, $p->Y); + $t0 = self::fe_sq($r->Y); + $r->Y = self::fe_add($r->Z, $r->X); + $r->Z = self::fe_sub($r->Z, $r->X); + $r->X = self::fe_sub($t0, $r->Y); + $r->T = self::fe_sub($r->T, $r->Z); + + return $r; + } + + /** + * @internal You should not use this directly from another application + * + * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P3 + * @throws SodiumException + * @throws TypeError + */ + public static function ge_p3_0() + { + return new ParagonIE_Sodium_Core32_Curve25519_Ge_P3( + self::fe_0(), + self::fe_1(), + self::fe_1(), + self::fe_0() + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p + * @return ParagonIE_Sodium_Core32_Curve25519_Ge_Cached + * @throws SodiumException + * @throws TypeError + */ + public static function ge_p3_to_cached(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p) + { + static $d2 = null; + if ($d2 === null) { + $d2 = ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( + array( + ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[0]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[1]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[2]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[3]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[4]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[5]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[6]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[7]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[8]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[9]) + ) + ); + } + /** @var ParagonIE_Sodium_Core32_Curve25519_Fe $d2 */ + $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_Cached(); + $r->YplusX = self::fe_add($p->Y, $p->X); + $r->YminusX = self::fe_sub($p->Y, $p->X); + $r->Z = self::fe_copy($p->Z); + $r->T2d = self::fe_mul($p->T, $d2); + return $r; + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p + * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P2 + */ + public static function ge_p3_to_p2(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p) + { + return new ParagonIE_Sodium_Core32_Curve25519_Ge_P2( + $p->X, + $p->Y, + $p->Z + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $h + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function ge_p3_tobytes(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $h) + { + $recip = self::fe_invert($h->Z); + $x = self::fe_mul($h->X, $recip); + $y = self::fe_mul($h->Y, $recip); + $s = self::fe_tobytes($y); + $s[31] = self::intToChr( + self::chrToInt($s[31]) ^ (self::fe_isnegative($x) << 7) + ); + return $s; + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p + * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 + * @throws SodiumException + * @throws TypeError + */ + public static function ge_p3_dbl(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p) + { + $q = self::ge_p3_to_p2($p); + return self::ge_p2_dbl($q); + } + + /** + * @return ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp + * @throws SodiumException + * @throws TypeError + */ + public static function ge_precomp_0() + { + return new ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp( + self::fe_1(), + self::fe_1(), + self::fe_0() + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param int $b + * @param int $c + * @return int + * @psalm-suppress MixedReturnStatement + */ + public static function equal($b, $c) + { + return (int) ((($b ^ $c) - 1 & 0xffffffff) >> 31); + } + + /** + * @internal You should not use this directly from another application + * + * @param string|int $char + * @return int (1 = yes, 0 = no) + * @throws SodiumException + * @throws TypeError + */ + public static function negative($char) + { + if (is_int($char)) { + return $char < 0 ? 1 : 0; + } + /** @var string $char */ + /** @var int $x */ + $x = self::chrToInt(self::substr($char, 0, 1)); + return (int) ($x >> 31); + } + + /** + * Conditional move + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $t + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $u + * @param int $b + * @return ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp + * @throws SodiumException + * @throws TypeError + */ + public static function cmov( + ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $t, + ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $u, + $b + ) { + if (!is_int($b)) { + throw new InvalidArgumentException('Expected an integer.'); + } + return new ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp( + self::fe_cmov($t->yplusx, $u->yplusx, $b), + self::fe_cmov($t->yminusx, $u->yminusx, $b), + self::fe_cmov($t->xy2d, $u->xy2d, $b) + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param int $pos + * @param int $b + * @return ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArrayAccess + * @psalm-suppress MixedArrayOffset + * @psalm-suppress MixedArgument + */ + public static function ge_select($pos = 0, $b = 0) + { + static $base = null; + if ($base === null) { + $base = array(); + foreach (self::$base as $i => $bas) { + for ($j = 0; $j < 8; ++$j) { + $base[$i][$j] = new ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp( + ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( + array( + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][0]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][1]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][2]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][3]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][4]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][5]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][6]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][7]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][8]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][9]) + ) + ), + ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( + array( + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][0]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][1]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][2]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][3]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][4]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][5]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][6]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][7]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][8]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][9]) + ) + ), + ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( + array( + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][0]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][1]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][2]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][3]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][4]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][5]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][6]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][7]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][8]), + ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][9]) + ) + ) + ); + } + } + } + if (!is_int($pos)) { + throw new InvalidArgumentException('Position must be an integer'); + } + if ($pos < 0 || $pos > 31) { + throw new RangeException('Position is out of range [0, 31]'); + } + + $bnegative = self::negative($b); + /** @var int $babs */ + $babs = $b - (((-$bnegative) & $b) << 1); + + $t = self::ge_precomp_0(); + for ($i = 0; $i < 8; ++$i) { + $t = self::cmov( + $t, + $base[$pos][$i], + self::equal($babs, $i + 1) + ); + } + $minusT = new ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp( + self::fe_copy($t->yminusx), + self::fe_copy($t->yplusx), + self::fe_neg($t->xy2d) + ); + return self::cmov($t, $minusT, -$bnegative); + } + + /** + * Subtract two group elements. + * + * r = p - q + * + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_Cached $q + * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 + * @throws SodiumException + * @throws TypeError + */ + public static function ge_sub( + ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p, + ParagonIE_Sodium_Core32_Curve25519_Ge_Cached $q + ) { + $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1(); + + $r->X = self::fe_add($p->Y, $p->X); + $r->Y = self::fe_sub($p->Y, $p->X); + $r->Z = self::fe_mul($r->X, $q->YminusX); + $r->Y = self::fe_mul($r->Y, $q->YplusX); + $r->T = self::fe_mul($q->T2d, $p->T); + $r->X = self::fe_mul($p->Z, $q->Z); + $t0 = self::fe_add($r->X, $r->X); + $r->X = self::fe_sub($r->Z, $r->Y); + $r->Y = self::fe_add($r->Z, $r->Y); + $r->Z = self::fe_sub($t0, $r->T); + $r->T = self::fe_add($t0, $r->T); + + return $r; + } + + /** + * Convert a group element to a byte string. + * + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $h + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function ge_tobytes(ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $h) + { + $recip = self::fe_invert($h->Z); + $x = self::fe_mul($h->X, $recip); + $y = self::fe_mul($h->Y, $recip); + $s = self::fe_tobytes($y); + $s[31] = self::intToChr( + self::chrToInt($s[31]) ^ (self::fe_isnegative($x) << 7) + ); + return $s; + } + + /** + * @internal You should not use this directly from another application + * + * @param string $a + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A + * @param string $b + * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P2 + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArrayAccess + */ + public static function ge_double_scalarmult_vartime( + $a, + ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A, + $b + ) { + /** @var array $Ai */ + $Ai = array(); + + static $Bi = array(); + /** @var array $Bi */ + if (!$Bi) { + for ($i = 0; $i < 8; ++$i) { + $Bi[$i] = new ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp( + ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( + array( + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][0]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][1]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][2]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][3]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][4]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][5]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][6]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][7]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][8]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][9]) + ) + ), + ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( + array( + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][0]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][1]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][2]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][3]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][4]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][5]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][6]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][7]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][8]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][9]) + ) + ), + ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( + array( + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][0]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][1]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][2]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][3]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][4]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][5]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][6]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][7]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][8]), + ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][9]) + ) + ) + ); + } + } + + for ($i = 0; $i < 8; ++$i) { + $Ai[$i] = new ParagonIE_Sodium_Core32_Curve25519_Ge_Cached( + self::fe_0(), + self::fe_0(), + self::fe_0(), + self::fe_0() + ); + } + /** @var array $Ai */ + + # slide(aslide,a); + # slide(bslide,b); + /** @var array $aslide */ + $aslide = self::slide($a); + /** @var array $bslide */ + $bslide = self::slide($b); + + # ge_p3_to_cached(&Ai[0],A); + # ge_p3_dbl(&t,A); ge_p1p1_to_p3(&A2,&t); + $Ai[0] = self::ge_p3_to_cached($A); + $t = self::ge_p3_dbl($A); + $A2 = self::ge_p1p1_to_p3($t); + + # ge_add(&t,&A2,&Ai[0]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[1],&u); + # ge_add(&t,&A2,&Ai[1]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[2],&u); + # ge_add(&t,&A2,&Ai[2]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[3],&u); + # ge_add(&t,&A2,&Ai[3]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[4],&u); + # ge_add(&t,&A2,&Ai[4]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[5],&u); + # ge_add(&t,&A2,&Ai[5]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[6],&u); + # ge_add(&t,&A2,&Ai[6]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[7],&u); + for ($i = 0; $i < 7; ++$i) { + $t = self::ge_add($A2, $Ai[$i]); + $u = self::ge_p1p1_to_p3($t); + $Ai[$i + 1] = self::ge_p3_to_cached($u); + } + + # ge_p2_0(r); + $r = self::ge_p2_0(); + + # for (i = 255;i >= 0;--i) { + # if (aslide[i] || bslide[i]) break; + # } + $i = 255; + for (; $i >= 0; --$i) { + if ($aslide[$i] || $bslide[$i]) { + break; + } + } + + # for (;i >= 0;--i) { + for (; $i >= 0; --$i) { + # ge_p2_dbl(&t,r); + $t = self::ge_p2_dbl($r); + + # if (aslide[i] > 0) { + if ($aslide[$i] > 0) { + # ge_p1p1_to_p3(&u,&t); + # ge_add(&t,&u,&Ai[aslide[i]/2]); + $u = self::ge_p1p1_to_p3($t); + $t = self::ge_add( + $u, + $Ai[(int) floor($aslide[$i] / 2)] + ); + # } else if (aslide[i] < 0) { + } elseif ($aslide[$i] < 0) { + # ge_p1p1_to_p3(&u,&t); + # ge_sub(&t,&u,&Ai[(-aslide[i])/2]); + $u = self::ge_p1p1_to_p3($t); + $t = self::ge_sub( + $u, + $Ai[(int) floor(-$aslide[$i] / 2)] + ); + } + /** @var array $Bi */ + + # if (bslide[i] > 0) { + if ($bslide[$i] > 0) { + # ge_p1p1_to_p3(&u,&t); + # ge_madd(&t,&u,&Bi[bslide[i]/2]); + $u = self::ge_p1p1_to_p3($t); + /** @var int $index */ + $index = (int) floor($bslide[$i] / 2); + /** @var ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $thisB */ + $thisB = $Bi[$index]; + $t = self::ge_madd($t, $u, $thisB); + # } else if (bslide[i] < 0) { + } elseif ($bslide[$i] < 0) { + # ge_p1p1_to_p3(&u,&t); + # ge_msub(&t,&u,&Bi[(-bslide[i])/2]); + $u = self::ge_p1p1_to_p3($t); + + /** @var int $index */ + $index = (int) floor(-$bslide[$i] / 2); + + /** @var ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $thisB */ + $thisB = $Bi[$index]; + $t = self::ge_msub($t, $u, $thisB); + } + # ge_p1p1_to_p2(r,&t); + $r = self::ge_p1p1_to_p2($t); + } + return $r; + } + + /** + * @internal You should not use this directly from another application + * + * @param string $a + * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P3 + * @psalm-suppress MixedAssignment + * @psalm-suppress MixedOperand + * @throws SodiumException + * @throws TypeError + */ + public static function ge_scalarmult_base($a) + { + /** @var array $e */ + $e = array(); + $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1(); + + for ($i = 0; $i < 32; ++$i) { + /** @var int $dbl */ + $dbl = (int) $i << 1; + $e[$dbl] = (int) self::chrToInt($a[$i]) & 15; + $e[$dbl + 1] = (int) (self::chrToInt($a[$i]) >> 4) & 15; + } + + /** @var int $carry */ + $carry = 0; + for ($i = 0; $i < 63; ++$i) { + $e[$i] += $carry; + /** @var int $carry */ + $carry = $e[$i] + 8; + /** @var int $carry */ + $carry >>= 4; + $e[$i] -= $carry << 4; + } + + /** @var array $e */ + $e[63] += (int) $carry; + + $h = self::ge_p3_0(); + + for ($i = 1; $i < 64; $i += 2) { + $t = self::ge_select((int) floor($i / 2), (int) $e[$i]); + $r = self::ge_madd($r, $h, $t); + $h = self::ge_p1p1_to_p3($r); + } + + $r = self::ge_p3_dbl($h); + + $s = self::ge_p1p1_to_p2($r); + $r = self::ge_p2_dbl($s); + $s = self::ge_p1p1_to_p2($r); + $r = self::ge_p2_dbl($s); + $s = self::ge_p1p1_to_p2($r); + $r = self::ge_p2_dbl($s); + + $h = self::ge_p1p1_to_p3($r); + + for ($i = 0; $i < 64; $i += 2) { + $t = self::ge_select($i >> 1, (int) $e[$i]); + $r = self::ge_madd($r, $h, $t); + $h = self::ge_p1p1_to_p3($r); + } + return $h; + } + + /** + * Calculates (ab + c) mod l + * where l = 2^252 + 27742317777372353535851937790883648493 + * + * @internal You should not use this directly from another application + * + * @param string $a + * @param string $b + * @param string $c + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function sc_muladd($a, $b, $c) + { + $a0 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($a, 0, 3))); + $a1 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($a, 2, 4)) >> 5)); + $a2 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($a, 5, 3)) >> 2)); + $a3 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($a, 7, 4)) >> 7)); + $a4 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($a, 10, 4)) >> 4)); + $a5 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($a, 13, 3)) >> 1)); + $a6 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($a, 15, 4)) >> 6)); + $a7 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($a, 18, 3)) >> 3)); + $a8 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($a, 21, 3))); + $a9 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($a, 23, 4)) >> 5)); + $a10 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($a, 26, 3)) >> 2)); + $a11 = ParagonIE_Sodium_Core32_Int64::fromInt(0x1fffffff & (self::load_4(self::substr($a, 28, 4)) >> 7)); + $b0 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($b, 0, 3))); + $b1 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($b, 2, 4)) >> 5)); + $b2 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($b, 5, 3)) >> 2)); + $b3 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($b, 7, 4)) >> 7)); + $b4 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($b, 10, 4)) >> 4)); + $b5 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($b, 13, 3)) >> 1)); + $b6 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($b, 15, 4)) >> 6)); + $b7 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($b, 18, 3)) >> 3)); + $b8 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($b, 21, 3))); + $b9 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($b, 23, 4)) >> 5)); + $b10 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($b, 26, 3)) >> 2)); + $b11 = ParagonIE_Sodium_Core32_Int64::fromInt(0x1fffffff & (self::load_4(self::substr($b, 28, 4)) >> 7)); + $c0 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($c, 0, 3))); + $c1 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($c, 2, 4)) >> 5)); + $c2 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($c, 5, 3)) >> 2)); + $c3 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($c, 7, 4)) >> 7)); + $c4 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($c, 10, 4)) >> 4)); + $c5 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($c, 13, 3)) >> 1)); + $c6 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($c, 15, 4)) >> 6)); + $c7 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($c, 18, 3)) >> 3)); + $c8 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($c, 21, 3))); + $c9 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($c, 23, 4)) >> 5)); + $c10 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($c, 26, 3)) >> 2)); + $c11 = ParagonIE_Sodium_Core32_Int64::fromInt(0x1fffffff & (self::load_4(self::substr($c, 28, 4)) >> 7)); + + /* Can't really avoid the pyramid here: */ + /** + * @var ParagonIE_Sodium_Core32_Int64 $s0 + * @var ParagonIE_Sodium_Core32_Int64 $s1 + * @var ParagonIE_Sodium_Core32_Int64 $s2 + * @var ParagonIE_Sodium_Core32_Int64 $s3 + * @var ParagonIE_Sodium_Core32_Int64 $s4 + * @var ParagonIE_Sodium_Core32_Int64 $s5 + * @var ParagonIE_Sodium_Core32_Int64 $s6 + * @var ParagonIE_Sodium_Core32_Int64 $s7 + * @var ParagonIE_Sodium_Core32_Int64 $s8 + * @var ParagonIE_Sodium_Core32_Int64 $s9 + * @var ParagonIE_Sodium_Core32_Int64 $s10 + * @var ParagonIE_Sodium_Core32_Int64 $s11 + * @var ParagonIE_Sodium_Core32_Int64 $s12 + * @var ParagonIE_Sodium_Core32_Int64 $s13 + * @var ParagonIE_Sodium_Core32_Int64 $s14 + * @var ParagonIE_Sodium_Core32_Int64 $s15 + * @var ParagonIE_Sodium_Core32_Int64 $s16 + * @var ParagonIE_Sodium_Core32_Int64 $s17 + * @var ParagonIE_Sodium_Core32_Int64 $s18 + * @var ParagonIE_Sodium_Core32_Int64 $s19 + * @var ParagonIE_Sodium_Core32_Int64 $s20 + * @var ParagonIE_Sodium_Core32_Int64 $s21 + * @var ParagonIE_Sodium_Core32_Int64 $s22 + * @var ParagonIE_Sodium_Core32_Int64 $s23 + */ + + $s0 = $c0->addInt64($a0->mulInt64($b0, 24)); + $s1 = $c1->addInt64($a0->mulInt64($b1, 24))->addInt64($a1->mulInt64($b0, 24)); + $s2 = $c2->addInt64($a0->mulInt64($b2, 24))->addInt64($a1->mulInt64($b1, 24))->addInt64($a2->mulInt64($b0, 24)); + $s3 = $c3->addInt64($a0->mulInt64($b3, 24))->addInt64($a1->mulInt64($b2, 24))->addInt64($a2->mulInt64($b1, 24)) + ->addInt64($a3->mulInt64($b0, 24)); + $s4 = $c4->addInt64($a0->mulInt64($b4, 24))->addInt64($a1->mulInt64($b3, 24))->addInt64($a2->mulInt64($b2, 24)) + ->addInt64($a3->mulInt64($b1, 24))->addInt64($a4->mulInt64($b0, 24)); + $s5 = $c5->addInt64($a0->mulInt64($b5, 24))->addInt64($a1->mulInt64($b4, 24))->addInt64($a2->mulInt64($b3, 24)) + ->addInt64($a3->mulInt64($b2, 24))->addInt64($a4->mulInt64($b1, 24))->addInt64($a5->mulInt64($b0, 24)); + $s6 = $c6->addInt64($a0->mulInt64($b6, 24))->addInt64($a1->mulInt64($b5, 24))->addInt64($a2->mulInt64($b4, 24)) + ->addInt64($a3->mulInt64($b3, 24))->addInt64($a4->mulInt64($b2, 24))->addInt64($a5->mulInt64($b1, 24)) + ->addInt64($a6->mulInt64($b0, 24)); + $s7 = $c7->addInt64($a0->mulInt64($b7, 24))->addInt64($a1->mulInt64($b6, 24))->addInt64($a2->mulInt64($b5, 24)) + ->addInt64($a3->mulInt64($b4, 24))->addInt64($a4->mulInt64($b3, 24))->addInt64($a5->mulInt64($b2, 24)) + ->addInt64($a6->mulInt64($b1, 24))->addInt64($a7->mulInt64($b0, 24)); + $s8 = $c8->addInt64($a0->mulInt64($b8, 24))->addInt64($a1->mulInt64($b7, 24))->addInt64($a2->mulInt64($b6, 24)) + ->addInt64($a3->mulInt64($b5, 24))->addInt64($a4->mulInt64($b4, 24))->addInt64($a5->mulInt64($b3, 24)) + ->addInt64($a6->mulInt64($b2, 24))->addInt64($a7->mulInt64($b1, 24))->addInt64($a8->mulInt64($b0, 24)); + $s9 = $c9->addInt64($a0->mulInt64($b9, 24))->addInt64($a1->mulInt64($b8, 24))->addInt64($a2->mulInt64($b7, 24)) + ->addInt64($a3->mulInt64($b6, 24))->addInt64($a4->mulInt64($b5, 24))->addInt64($a5->mulInt64($b4, 24)) + ->addInt64($a6->mulInt64($b3, 24))->addInt64($a7->mulInt64($b2, 24))->addInt64($a8->mulInt64($b1, 24)) + ->addInt64($a9->mulInt64($b0, 24)); + $s10 = $c10->addInt64($a0->mulInt64($b10, 24))->addInt64($a1->mulInt64($b9, 24))->addInt64($a2->mulInt64($b8, 24)) + ->addInt64($a3->mulInt64($b7, 24))->addInt64($a4->mulInt64($b6, 24))->addInt64($a5->mulInt64($b5, 24)) + ->addInt64($a6->mulInt64($b4, 24))->addInt64($a7->mulInt64($b3, 24))->addInt64($a8->mulInt64($b2, 24)) + ->addInt64($a9->mulInt64($b1, 24))->addInt64($a10->mulInt64($b0, 24)); + $s11 = $c11->addInt64($a0->mulInt64($b11, 24))->addInt64($a1->mulInt64($b10, 24))->addInt64($a2->mulInt64($b9, 24)) + ->addInt64($a3->mulInt64($b8, 24))->addInt64($a4->mulInt64($b7, 24))->addInt64($a5->mulInt64($b6, 24)) + ->addInt64($a6->mulInt64($b5, 24))->addInt64($a7->mulInt64($b4, 24))->addInt64($a8->mulInt64($b3, 24)) + ->addInt64($a9->mulInt64($b2, 24))->addInt64($a10->mulInt64($b1, 24))->addInt64($a11->mulInt64($b0, 24)); + $s12 = $a1->mulInt64($b11, 24)->addInt64($a2->mulInt64($b10, 24))->addInt64($a3->mulInt64($b9, 24)) + ->addInt64($a4->mulInt64($b8, 24))->addInt64($a5->mulInt64($b7, 24))->addInt64($a6->mulInt64($b6, 24)) + ->addInt64($a7->mulInt64($b5, 24))->addInt64($a8->mulInt64($b4, 24))->addInt64($a9->mulInt64($b3, 24)) + ->addInt64($a10->mulInt64($b2, 24))->addInt64($a11->mulInt64($b1, 24)); + $s13 = $a2->mulInt64($b11, 24)->addInt64($a3->mulInt64($b10, 24))->addInt64($a4->mulInt64($b9, 24)) + ->addInt64($a5->mulInt64($b8, 24))->addInt64($a6->mulInt64($b7, 24))->addInt64($a7->mulInt64($b6, 24)) + ->addInt64($a8->mulInt64($b5, 24))->addInt64($a9->mulInt64($b4, 24))->addInt64($a10->mulInt64($b3, 24)) + ->addInt64($a11->mulInt64($b2, 24)); + $s14 = $a3->mulInt64($b11, 24)->addInt64($a4->mulInt64($b10, 24))->addInt64($a5->mulInt64($b9, 24)) + ->addInt64($a6->mulInt64($b8, 24))->addInt64($a7->mulInt64($b7, 24))->addInt64($a8->mulInt64($b6, 24)) + ->addInt64($a9->mulInt64($b5, 24))->addInt64($a10->mulInt64($b4, 24))->addInt64($a11->mulInt64($b3, 24)); + $s15 = $a4->mulInt64($b11, 24)->addInt64($a5->mulInt64($b10, 24))->addInt64($a6->mulInt64($b9, 24)) + ->addInt64($a7->mulInt64($b8, 24))->addInt64($a8->mulInt64($b7, 24))->addInt64($a9->mulInt64($b6, 24)) + ->addInt64($a10->mulInt64($b5, 24))->addInt64($a11->mulInt64($b4, 24)); + $s16 = $a5->mulInt64($b11, 24)->addInt64($a6->mulInt64($b10, 24))->addInt64($a7->mulInt64($b9, 24)) + ->addInt64($a8->mulInt64($b8, 24))->addInt64($a9->mulInt64($b7, 24))->addInt64($a10->mulInt64($b6, 24)) + ->addInt64($a11->mulInt64($b5, 24)); + $s17 = $a6->mulInt64($b11, 24)->addInt64($a7->mulInt64($b10, 24))->addInt64($a8->mulInt64($b9, 24)) + ->addInt64($a9->mulInt64($b8, 24))->addInt64($a10->mulInt64($b7, 24))->addInt64($a11->mulInt64($b6, 24)); + $s18 = $a7->mulInt64($b11, 24)->addInt64($a8->mulInt64($b10, 24))->addInt64($a9->mulInt64($b9, 24)) + ->addInt64($a10->mulInt64($b8, 24))->addInt64($a11->mulInt64($b7, 24)); + $s19 = $a8->mulInt64($b11, 24)->addInt64($a9->mulInt64($b10, 24))->addInt64($a10->mulInt64($b9, 24)) + ->addInt64($a11->mulInt64($b8, 24)); + $s20 = $a9->mulInt64($b11, 24)->addInt64($a10->mulInt64($b10, 24))->addInt64($a11->mulInt64($b9, 24)); + $s21 = $a10->mulInt64($b11, 24)->addInt64($a11->mulInt64($b10, 24)); + $s22 = $a11->mulInt64($b11, 24); + $s23 = new ParagonIE_Sodium_Core32_Int64(); + + $carry0 = $s0->addInt(1 << 20)->shiftRight(21); + $s1 = $s1->addInt64($carry0); + $s0 = $s0->subInt64($carry0->shiftLeft(21)); + $carry2 = $s2->addInt(1 << 20)->shiftRight(21); + $s3 = $s3->addInt64($carry2); + $s2 = $s2->subInt64($carry2->shiftLeft(21)); + $carry4 = $s4->addInt(1 << 20)->shiftRight(21); + $s5 = $s5->addInt64($carry4); + $s4 = $s4->subInt64($carry4->shiftLeft(21)); + $carry6 = $s6->addInt(1 << 20)->shiftRight(21); + $s7 = $s7->addInt64($carry6); + $s6 = $s6->subInt64($carry6->shiftLeft(21)); + $carry8 = $s8->addInt(1 << 20)->shiftRight(21); + $s9 = $s9->addInt64($carry8); + $s8 = $s8->subInt64($carry8->shiftLeft(21)); + $carry10 = $s10->addInt(1 << 20)->shiftRight(21); + $s11 = $s11->addInt64($carry10); + $s10 = $s10->subInt64($carry10->shiftLeft(21)); + $carry12 = $s12->addInt(1 << 20)->shiftRight(21); + $s13 = $s13->addInt64($carry12); + $s12 = $s12->subInt64($carry12->shiftLeft(21)); + $carry14 = $s14->addInt(1 << 20)->shiftRight(21); + $s15 = $s15->addInt64($carry14); + $s14 = $s14->subInt64($carry14->shiftLeft(21)); + $carry16 = $s16->addInt(1 << 20)->shiftRight(21); + $s17 = $s17->addInt64($carry16); + $s16 = $s16->subInt64($carry16->shiftLeft(21)); + $carry18 = $s18->addInt(1 << 20)->shiftRight(21); + $s19 = $s19->addInt64($carry18); + $s18 = $s18->subInt64($carry18->shiftLeft(21)); + $carry20 = $s20->addInt(1 << 20)->shiftRight(21); + $s21 = $s21->addInt64($carry20); + $s20 = $s20->subInt64($carry20->shiftLeft(21)); + $carry22 = $s22->addInt(1 << 20)->shiftRight(21); + $s23 = $s23->addInt64($carry22); + $s22 = $s22->subInt64($carry22->shiftLeft(21)); + + $carry1 = $s1->addInt(1 << 20)->shiftRight(21); + $s2 = $s2->addInt64($carry1); + $s1 = $s1->subInt64($carry1->shiftLeft(21)); + $carry3 = $s3->addInt(1 << 20)->shiftRight(21); + $s4 = $s4->addInt64($carry3); + $s3 = $s3->subInt64($carry3->shiftLeft(21)); + $carry5 = $s5->addInt(1 << 20)->shiftRight(21); + $s6 = $s6->addInt64($carry5); + $s5 = $s5->subInt64($carry5->shiftLeft(21)); + $carry7 = $s7->addInt(1 << 20)->shiftRight(21); + $s8 = $s8->addInt64($carry7); + $s7 = $s7->subInt64($carry7->shiftLeft(21)); + $carry9 = $s9->addInt(1 << 20)->shiftRight(21); + $s10 = $s10->addInt64($carry9); + $s9 = $s9->subInt64($carry9->shiftLeft(21)); + $carry11 = $s11->addInt(1 << 20)->shiftRight(21); + $s12 = $s12->addInt64($carry11); + $s11 = $s11->subInt64($carry11->shiftLeft(21)); + $carry13 = $s13->addInt(1 << 20)->shiftRight(21); + $s14 = $s14->addInt64($carry13); + $s13 = $s13->subInt64($carry13->shiftLeft(21)); + $carry15 = $s15->addInt(1 << 20)->shiftRight(21); + $s16 = $s16->addInt64($carry15); + $s15 = $s15->subInt64($carry15->shiftLeft(21)); + $carry17 = $s17->addInt(1 << 20)->shiftRight(21); + $s18 = $s18->addInt64($carry17); + $s17 = $s17->subInt64($carry17->shiftLeft(21)); + $carry19 = $s19->addInt(1 << 20)->shiftRight(21); + $s20 = $s20->addInt64($carry19); + $s19 = $s19->subInt64($carry19->shiftLeft(21)); + $carry21 = $s21->addInt(1 << 20)->shiftRight(21); + $s22 = $s22->addInt64($carry21); + $s21 = $s21->subInt64($carry21->shiftLeft(21)); + + $s11 = $s11->addInt64($s23->mulInt(666643, 20)); + $s12 = $s12->addInt64($s23->mulInt(470296, 19)); + $s13 = $s13->addInt64($s23->mulInt(654183, 20)); + $s14 = $s14->subInt64($s23->mulInt(997805, 20)); + $s15 = $s15->addInt64($s23->mulInt(136657, 18)); + $s16 = $s16->subInt64($s23->mulInt(683901, 20)); + + $s10 = $s10->addInt64($s22->mulInt(666643, 20)); + $s11 = $s11->addInt64($s22->mulInt(470296, 19)); + $s12 = $s12->addInt64($s22->mulInt(654183, 20)); + $s13 = $s13->subInt64($s22->mulInt(997805, 20)); + $s14 = $s14->addInt64($s22->mulInt(136657, 18)); + $s15 = $s15->subInt64($s22->mulInt(683901, 20)); + + $s9 = $s9->addInt64($s21->mulInt(666643, 20)); + $s10 = $s10->addInt64($s21->mulInt(470296, 19)); + $s11 = $s11->addInt64($s21->mulInt(654183, 20)); + $s12 = $s12->subInt64($s21->mulInt(997805, 20)); + $s13 = $s13->addInt64($s21->mulInt(136657, 18)); + $s14 = $s14->subInt64($s21->mulInt(683901, 20)); + + $s8 = $s8->addInt64($s20->mulInt(666643, 20)); + $s9 = $s9->addInt64($s20->mulInt(470296, 19)); + $s10 = $s10->addInt64($s20->mulInt(654183, 20)); + $s11 = $s11->subInt64($s20->mulInt(997805, 20)); + $s12 = $s12->addInt64($s20->mulInt(136657, 18)); + $s13 = $s13->subInt64($s20->mulInt(683901, 20)); + + $s7 = $s7->addInt64($s19->mulInt(666643, 20)); + $s8 = $s8->addInt64($s19->mulInt(470296, 19)); + $s9 = $s9->addInt64($s19->mulInt(654183, 20)); + $s10 = $s10->subInt64($s19->mulInt(997805, 20)); + $s11 = $s11->addInt64($s19->mulInt(136657, 18)); + $s12 = $s12->subInt64($s19->mulInt(683901, 20)); + + $s6 = $s6->addInt64($s18->mulInt(666643, 20)); + $s7 = $s7->addInt64($s18->mulInt(470296, 19)); + $s8 = $s8->addInt64($s18->mulInt(654183, 20)); + $s9 = $s9->subInt64($s18->mulInt(997805, 20)); + $s10 = $s10->addInt64($s18->mulInt(136657, 18)); + $s11 = $s11->subInt64($s18->mulInt(683901, 20)); + + $carry6 = $s6->addInt(1 << 20)->shiftRight(21); + $s7 = $s7->addInt64($carry6); + $s6 = $s6->subInt64($carry6->shiftLeft(21)); + $carry8 = $s8->addInt(1 << 20)->shiftRight(21); + $s9 = $s9->addInt64($carry8); + $s8 = $s8->subInt64($carry8->shiftLeft(21)); + $carry10 = $s10->addInt(1 << 20)->shiftRight(21); + $s11 = $s11->addInt64($carry10); + $s10 = $s10->subInt64($carry10->shiftLeft(21)); + $carry12 = $s12->addInt(1 << 20)->shiftRight(21); + $s13 = $s13->addInt64($carry12); + $s12 = $s12->subInt64($carry12->shiftLeft(21)); + $carry14 = $s14->addInt(1 << 20)->shiftRight(21); + $s15 = $s15->addInt64($carry14); + $s14 = $s14->subInt64($carry14->shiftLeft(21)); + $carry16 = $s16->addInt(1 << 20)->shiftRight(21); + $s17 = $s17->addInt64($carry16); + $s16 = $s16->subInt64($carry16->shiftLeft(21)); + + $carry7 = $s7->addInt(1 << 20)->shiftRight(21); + $s8 = $s8->addInt64($carry7); + $s7 = $s7->subInt64($carry7->shiftLeft(21)); + $carry9 = $s9->addInt(1 << 20)->shiftRight(21); + $s10 = $s10->addInt64($carry9); + $s9 = $s9->subInt64($carry9->shiftLeft(21)); + $carry11 = $s11->addInt(1 << 20)->shiftRight(21); + $s12 = $s12->addInt64($carry11); + $s11 = $s11->subInt64($carry11->shiftLeft(21)); + $carry13 = $s13->addInt(1 << 20)->shiftRight(21); + $s14 = $s14->addInt64($carry13); + $s13 = $s13->subInt64($carry13->shiftLeft(21)); + $carry15 = $s15->addInt(1 << 20)->shiftRight(21); + $s16 = $s16->addInt64($carry15); + $s15 = $s15->subInt64($carry15->shiftLeft(21)); + + $s5 = $s5->addInt64($s17->mulInt(666643, 20)); + $s6 = $s6->addInt64($s17->mulInt(470296, 19)); + $s7 = $s7->addInt64($s17->mulInt(654183, 20)); + $s8 = $s8->subInt64($s17->mulInt(997805, 20)); + $s9 = $s9->addInt64($s17->mulInt(136657, 18)); + $s10 = $s10->subInt64($s17->mulInt(683901, 20)); + + $s4 = $s4->addInt64($s16->mulInt(666643, 20)); + $s5 = $s5->addInt64($s16->mulInt(470296, 19)); + $s6 = $s6->addInt64($s16->mulInt(654183, 20)); + $s7 = $s7->subInt64($s16->mulInt(997805, 20)); + $s8 = $s8->addInt64($s16->mulInt(136657, 18)); + $s9 = $s9->subInt64($s16->mulInt(683901, 20)); + + $s3 = $s3->addInt64($s15->mulInt(666643, 20)); + $s4 = $s4->addInt64($s15->mulInt(470296, 19)); + $s5 = $s5->addInt64($s15->mulInt(654183, 20)); + $s6 = $s6->subInt64($s15->mulInt(997805, 20)); + $s7 = $s7->addInt64($s15->mulInt(136657, 18)); + $s8 = $s8->subInt64($s15->mulInt(683901, 20)); + + $s2 = $s2->addInt64($s14->mulInt(666643, 20)); + $s3 = $s3->addInt64($s14->mulInt(470296, 19)); + $s4 = $s4->addInt64($s14->mulInt(654183, 20)); + $s5 = $s5->subInt64($s14->mulInt(997805, 20)); + $s6 = $s6->addInt64($s14->mulInt(136657, 18)); + $s7 = $s7->subInt64($s14->mulInt(683901, 20)); + + $s1 = $s1->addInt64($s13->mulInt(666643, 20)); + $s2 = $s2->addInt64($s13->mulInt(470296, 19)); + $s3 = $s3->addInt64($s13->mulInt(654183, 20)); + $s4 = $s4->subInt64($s13->mulInt(997805, 20)); + $s5 = $s5->addInt64($s13->mulInt(136657, 18)); + $s6 = $s6->subInt64($s13->mulInt(683901, 20)); + + $s0 = $s0->addInt64($s12->mulInt(666643, 20)); + $s1 = $s1->addInt64($s12->mulInt(470296, 19)); + $s2 = $s2->addInt64($s12->mulInt(654183, 20)); + $s3 = $s3->subInt64($s12->mulInt(997805, 20)); + $s4 = $s4->addInt64($s12->mulInt(136657, 18)); + $s5 = $s5->subInt64($s12->mulInt(683901, 20)); + $s12 = new ParagonIE_Sodium_Core32_Int64(); + + $carry0 = $s0->addInt(1 << 20)->shiftRight(21); + $s1 = $s1->addInt64($carry0); + $s0 = $s0->subInt64($carry0->shiftLeft(21)); + $carry2 = $s2->addInt(1 << 20)->shiftRight(21); + $s3 = $s3->addInt64($carry2); + $s2 = $s2->subInt64($carry2->shiftLeft(21)); + $carry4 = $s4->addInt(1 << 20)->shiftRight(21); + $s5 = $s5->addInt64($carry4); + $s4 = $s4->subInt64($carry4->shiftLeft(21)); + $carry6 = $s6->addInt(1 << 20)->shiftRight(21); + $s7 = $s7->addInt64($carry6); + $s6 = $s6->subInt64($carry6->shiftLeft(21)); + $carry8 = $s8->addInt(1 << 20)->shiftRight(21); + $s9 = $s9->addInt64($carry8); + $s8 = $s8->subInt64($carry8->shiftLeft(21)); + $carry10 = $s10->addInt(1 << 20)->shiftRight(21); + $s11 = $s11->addInt64($carry10); + $s10 = $s10->subInt64($carry10->shiftLeft(21)); + + $carry1 = $s1->addInt(1 << 20)->shiftRight(21); + $s2 = $s2->addInt64($carry1); + $s1 = $s1->subInt64($carry1->shiftLeft(21)); + $carry3 = $s3->addInt(1 << 20)->shiftRight(21); + $s4 = $s4->addInt64($carry3); + $s3 = $s3->subInt64($carry3->shiftLeft(21)); + $carry5 = $s5->addInt(1 << 20)->shiftRight(21); + $s6 = $s6->addInt64($carry5); + $s5 = $s5->subInt64($carry5->shiftLeft(21)); + $carry7 = $s7->addInt(1 << 20)->shiftRight(21); + $s8 = $s8->addInt64($carry7); + $s7 = $s7->subInt64($carry7->shiftLeft(21)); + $carry9 = $s9->addInt(1 << 20)->shiftRight(21); + $s10 = $s10->addInt64($carry9); + $s9 = $s9->subInt64($carry9->shiftLeft(21)); + $carry11 = $s11->addInt(1 << 20)->shiftRight(21); + $s12 = $s12->addInt64($carry11); + $s11 = $s11->subInt64($carry11->shiftLeft(21)); + + $s0 = $s0->addInt64($s12->mulInt(666643, 20)); + $s1 = $s1->addInt64($s12->mulInt(470296, 19)); + $s2 = $s2->addInt64($s12->mulInt(654183, 20)); + $s3 = $s3->subInt64($s12->mulInt(997805, 20)); + $s4 = $s4->addInt64($s12->mulInt(136657, 18)); + $s5 = $s5->subInt64($s12->mulInt(683901, 20)); + $s12 = new ParagonIE_Sodium_Core32_Int64(); + + $carry0 = $s0->shiftRight(21); + $s1 = $s1->addInt64($carry0); + $s0 = $s0->subInt64($carry0->shiftLeft(21)); + $carry1 = $s1->shiftRight(21); + $s2 = $s2->addInt64($carry1); + $s1 = $s1->subInt64($carry1->shiftLeft(21)); + $carry2 = $s2->shiftRight(21); + $s3 = $s3->addInt64($carry2); + $s2 = $s2->subInt64($carry2->shiftLeft(21)); + $carry3 = $s3->shiftRight(21); + $s4 = $s4->addInt64($carry3); + $s3 = $s3->subInt64($carry3->shiftLeft(21)); + $carry4 = $s4->shiftRight(21); + $s5 = $s5->addInt64($carry4); + $s4 = $s4->subInt64($carry4->shiftLeft(21)); + $carry5 = $s5->shiftRight(21); + $s6 = $s6->addInt64($carry5); + $s5 = $s5->subInt64($carry5->shiftLeft(21)); + $carry6 = $s6->shiftRight(21); + $s7 = $s7->addInt64($carry6); + $s6 = $s6->subInt64($carry6->shiftLeft(21)); + $carry7 = $s7->shiftRight(21); + $s8 = $s8->addInt64($carry7); + $s7 = $s7->subInt64($carry7->shiftLeft(21)); + $carry8 = $s8->shiftRight(21); + $s9 = $s9->addInt64($carry8); + $s8 = $s8->subInt64($carry8->shiftLeft(21)); + $carry9 = $s9->shiftRight(21); + $s10 = $s10->addInt64($carry9); + $s9 = $s9->subInt64($carry9->shiftLeft(21)); + $carry10 = $s10->shiftRight(21); + $s11 = $s11->addInt64($carry10); + $s10 = $s10->subInt64($carry10->shiftLeft(21)); + $carry11 = $s11->shiftRight(21); + $s12 = $s12->addInt64($carry11); + $s11 = $s11->subInt64($carry11->shiftLeft(21)); + + $s0 = $s0->addInt64($s12->mulInt(666643, 20)); + $s1 = $s1->addInt64($s12->mulInt(470296, 19)); + $s2 = $s2->addInt64($s12->mulInt(654183, 20)); + $s3 = $s3->subInt64($s12->mulInt(997805, 20)); + $s4 = $s4->addInt64($s12->mulInt(136657, 18)); + $s5 = $s5->subInt64($s12->mulInt(683901, 20)); + + $carry0 = $s0->shiftRight(21); + $s1 = $s1->addInt64($carry0); + $s0 = $s0->subInt64($carry0->shiftLeft(21)); + $carry1 = $s1->shiftRight(21); + $s2 = $s2->addInt64($carry1); + $s1 = $s1->subInt64($carry1->shiftLeft(21)); + $carry2 = $s2->shiftRight(21); + $s3 = $s3->addInt64($carry2); + $s2 = $s2->subInt64($carry2->shiftLeft(21)); + $carry3 = $s3->shiftRight(21); + $s4 = $s4->addInt64($carry3); + $s3 = $s3->subInt64($carry3->shiftLeft(21)); + $carry4 = $s4->shiftRight(21); + $s5 = $s5->addInt64($carry4); + $s4 = $s4->subInt64($carry4->shiftLeft(21)); + $carry5 = $s5->shiftRight(21); + $s6 = $s6->addInt64($carry5); + $s5 = $s5->subInt64($carry5->shiftLeft(21)); + $carry6 = $s6->shiftRight(21); + $s7 = $s7->addInt64($carry6); + $s6 = $s6->subInt64($carry6->shiftLeft(21)); + $carry7 = $s7->shiftRight(21); + $s8 = $s8->addInt64($carry7); + $s7 = $s7->subInt64($carry7->shiftLeft(21)); + $carry8 = $s10->shiftRight(21); + $s9 = $s9->addInt64($carry8); + $s8 = $s8->subInt64($carry8->shiftLeft(21)); + $carry9 = $s9->shiftRight(21); + $s10 = $s10->addInt64($carry9); + $s9 = $s9->subInt64($carry9->shiftLeft(21)); + $carry10 = $s10->shiftRight(21); + $s11 = $s11->addInt64($carry10); + $s10 = $s10->subInt64($carry10->shiftLeft(21)); + + $S0 = $s0->toInt(); + $S1 = $s1->toInt(); + $S2 = $s2->toInt(); + $S3 = $s3->toInt(); + $S4 = $s4->toInt(); + $S5 = $s5->toInt(); + $S6 = $s6->toInt(); + $S7 = $s7->toInt(); + $S8 = $s8->toInt(); + $S9 = $s9->toInt(); + $S10 = $s10->toInt(); + $S11 = $s11->toInt(); + + /** + * @var array + */ + $arr = array( + (int) (0xff & ($S0 >> 0)), + (int) (0xff & ($S0 >> 8)), + (int) (0xff & (($S0 >> 16) | ($S1 << 5))), + (int) (0xff & ($S1 >> 3)), + (int) (0xff & ($S1 >> 11)), + (int) (0xff & (($S1 >> 19) | ($S2 << 2))), + (int) (0xff & ($S2 >> 6)), + (int) (0xff & (($S2 >> 14) | ($S3 << 7))), + (int) (0xff & ($S3 >> 1)), + (int) (0xff & ($S3 >> 9)), + (int) (0xff & (($S3 >> 17) | ($S4 << 4))), + (int) (0xff & ($S4 >> 4)), + (int) (0xff & ($S4 >> 12)), + (int) (0xff & (($S4 >> 20) | ($S5 << 1))), + (int) (0xff & ($S5 >> 7)), + (int) (0xff & (($S5 >> 15) | ($S6 << 6))), + (int) (0xff & ($S6 >> 2)), + (int) (0xff & ($S6 >> 10)), + (int) (0xff & (($S6 >> 18) | ($S7 << 3))), + (int) (0xff & ($S7 >> 5)), + (int) (0xff & ($S7 >> 13)), + (int) (0xff & ($S8 >> 0)), + (int) (0xff & ($S8 >> 8)), + (int) (0xff & (($S8 >> 16) | ($S9 << 5))), + (int) (0xff & ($S9 >> 3)), + (int) (0xff & ($S9 >> 11)), + (int) (0xff & (($S9 >> 19) | ($S10 << 2))), + (int) (0xff & ($S10 >> 6)), + (int) (0xff & (($S10 >> 14) | ($S11 << 7))), + (int) (0xff & ($S11 >> 1)), + (int) (0xff & ($S11 >> 9)), + (int) (0xff & ($S11 >> 17)) + ); + return self::intArrayToString($arr); + } + + /** + * @internal You should not use this directly from another application + * + * @param string $s + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function sc_reduce($s) + { + /** + * @var ParagonIE_Sodium_Core32_Int64 $s0 + * @var ParagonIE_Sodium_Core32_Int64 $s1 + * @var ParagonIE_Sodium_Core32_Int64 $s2 + * @var ParagonIE_Sodium_Core32_Int64 $s3 + * @var ParagonIE_Sodium_Core32_Int64 $s4 + * @var ParagonIE_Sodium_Core32_Int64 $s5 + * @var ParagonIE_Sodium_Core32_Int64 $s6 + * @var ParagonIE_Sodium_Core32_Int64 $s7 + * @var ParagonIE_Sodium_Core32_Int64 $s8 + * @var ParagonIE_Sodium_Core32_Int64 $s9 + * @var ParagonIE_Sodium_Core32_Int64 $s10 + * @var ParagonIE_Sodium_Core32_Int64 $s11 + * @var ParagonIE_Sodium_Core32_Int64 $s12 + * @var ParagonIE_Sodium_Core32_Int64 $s13 + * @var ParagonIE_Sodium_Core32_Int64 $s14 + * @var ParagonIE_Sodium_Core32_Int64 $s15 + * @var ParagonIE_Sodium_Core32_Int64 $s16 + * @var ParagonIE_Sodium_Core32_Int64 $s17 + * @var ParagonIE_Sodium_Core32_Int64 $s18 + * @var ParagonIE_Sodium_Core32_Int64 $s19 + * @var ParagonIE_Sodium_Core32_Int64 $s20 + * @var ParagonIE_Sodium_Core32_Int64 $s21 + * @var ParagonIE_Sodium_Core32_Int64 $s22 + * @var ParagonIE_Sodium_Core32_Int64 $s23 + */ + $s0 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($s, 0, 3))); + $s1 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 2, 4)) >> 5)); + $s2 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 5, 3)) >> 2)); + $s3 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 7, 4)) >> 7)); + $s4 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 10, 4)) >> 4)); + $s5 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 13, 3)) >> 1)); + $s6 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 15, 4)) >> 6)); + $s7 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 18, 4)) >> 3)); + $s8 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($s, 21, 3))); + $s9 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 23, 4)) >> 5)); + $s10 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 26, 3)) >> 2)); + $s11 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 28, 4)) >> 7)); + $s12 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 31, 4)) >> 4)); + $s13 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 34, 3)) >> 1)); + $s14 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 36, 4)) >> 6)); + $s15 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 39, 4)) >> 3)); + $s16 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($s, 42, 3))); + $s17 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 44, 4)) >> 5)); + $s18 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 47, 3)) >> 2)); + $s19 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 49, 4)) >> 7)); + $s20 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 52, 4)) >> 4)); + $s21 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 55, 3)) >> 1)); + $s22 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 57, 4)) >> 6)); + $s23 = ParagonIE_Sodium_Core32_Int64::fromInt(0x1fffffff & (self::load_4(self::substr($s, 60, 4)) >> 3)); + + $s11 = $s11->addInt64($s23->mulInt(666643, 20)); + $s12 = $s12->addInt64($s23->mulInt(470296, 19)); + $s13 = $s13->addInt64($s23->mulInt(654183, 20)); + $s14 = $s14->subInt64($s23->mulInt(997805, 20)); + $s15 = $s15->addInt64($s23->mulInt(136657, 18)); + $s16 = $s16->subInt64($s23->mulInt(683901, 20)); + + $s10 = $s10->addInt64($s22->mulInt(666643, 20)); + $s11 = $s11->addInt64($s22->mulInt(470296, 19)); + $s12 = $s12->addInt64($s22->mulInt(654183, 20)); + $s13 = $s13->subInt64($s22->mulInt(997805, 20)); + $s14 = $s14->addInt64($s22->mulInt(136657, 18)); + $s15 = $s15->subInt64($s22->mulInt(683901, 20)); + + $s9 = $s9->addInt64($s21->mulInt(666643, 20)); + $s10 = $s10->addInt64($s21->mulInt(470296, 19)); + $s11 = $s11->addInt64($s21->mulInt(654183, 20)); + $s12 = $s12->subInt64($s21->mulInt(997805, 20)); + $s13 = $s13->addInt64($s21->mulInt(136657, 18)); + $s14 = $s14->subInt64($s21->mulInt(683901, 20)); + + $s8 = $s8->addInt64($s20->mulInt(666643, 20)); + $s9 = $s9->addInt64($s20->mulInt(470296, 19)); + $s10 = $s10->addInt64($s20->mulInt(654183, 20)); + $s11 = $s11->subInt64($s20->mulInt(997805, 20)); + $s12 = $s12->addInt64($s20->mulInt(136657, 18)); + $s13 = $s13->subInt64($s20->mulInt(683901, 20)); + + $s7 = $s7->addInt64($s19->mulInt(666643, 20)); + $s8 = $s8->addInt64($s19->mulInt(470296, 19)); + $s9 = $s9->addInt64($s19->mulInt(654183, 20)); + $s10 = $s10->subInt64($s19->mulInt(997805, 20)); + $s11 = $s11->addInt64($s19->mulInt(136657, 18)); + $s12 = $s12->subInt64($s19->mulInt(683901, 20)); + + $s6 = $s6->addInt64($s18->mulInt(666643, 20)); + $s7 = $s7->addInt64($s18->mulInt(470296, 19)); + $s8 = $s8->addInt64($s18->mulInt(654183, 20)); + $s9 = $s9->subInt64($s18->mulInt(997805, 20)); + $s10 = $s10->addInt64($s18->mulInt(136657, 18)); + $s11 = $s11->subInt64($s18->mulInt(683901, 20)); + + $carry6 = $s6->addInt(1 << 20)->shiftRight(21); + $s7 = $s7->addInt64($carry6); + $s6 = $s6->subInt64($carry6->shiftLeft(21)); + $carry8 = $s8->addInt(1 << 20)->shiftRight(21); + $s9 = $s9->addInt64($carry8); + $s8 = $s8->subInt64($carry8->shiftLeft(21)); + $carry10 = $s10->addInt(1 << 20)->shiftRight(21); + $s11 = $s11->addInt64($carry10); + $s10 = $s10->subInt64($carry10->shiftLeft(21)); + $carry12 = $s12->addInt(1 << 20)->shiftRight(21); + $s13 = $s13->addInt64($carry12); + $s12 = $s12->subInt64($carry12->shiftLeft(21)); + $carry14 = $s14->addInt(1 << 20)->shiftRight(21); + $s15 = $s15->addInt64($carry14); + $s14 = $s14->subInt64($carry14->shiftLeft(21)); + $carry16 = $s16->addInt(1 << 20)->shiftRight(21); + $s17 = $s17->addInt64($carry16); + $s16 = $s16->subInt64($carry16->shiftLeft(21)); + + $carry7 = $s7->addInt(1 << 20)->shiftRight(21); + $s8 = $s8->addInt64($carry7); + $s7 = $s7->subInt64($carry7->shiftLeft(21)); + $carry9 = $s9->addInt(1 << 20)->shiftRight(21); + $s10 = $s10->addInt64($carry9); + $s9 = $s9->subInt64($carry9->shiftLeft(21)); + $carry11 = $s11->addInt(1 << 20)->shiftRight(21); + $s12 = $s12->addInt64($carry11); + $s11 = $s11->subInt64($carry11->shiftLeft(21)); + $carry13 = $s13->addInt(1 << 20)->shiftRight(21); + $s14 = $s14->addInt64($carry13); + $s13 = $s13->subInt64($carry13->shiftLeft(21)); + $carry15 = $s15->addInt(1 << 20)->shiftRight(21); + $s16 = $s16->addInt64($carry15); + $s15 = $s15->subInt64($carry15->shiftLeft(21)); + + $s5 = $s5->addInt64($s17->mulInt(666643, 20)); + $s6 = $s6->addInt64($s17->mulInt(470296, 19)); + $s7 = $s7->addInt64($s17->mulInt(654183, 20)); + $s8 = $s8->subInt64($s17->mulInt(997805, 20)); + $s9 = $s9->addInt64($s17->mulInt(136657, 18)); + $s10 = $s10->subInt64($s17->mulInt(683901, 20)); + + $s4 = $s4->addInt64($s16->mulInt(666643, 20)); + $s5 = $s5->addInt64($s16->mulInt(470296, 19)); + $s6 = $s6->addInt64($s16->mulInt(654183, 20)); + $s7 = $s7->subInt64($s16->mulInt(997805, 20)); + $s8 = $s8->addInt64($s16->mulInt(136657, 18)); + $s9 = $s9->subInt64($s16->mulInt(683901, 20)); + + $s3 = $s3->addInt64($s15->mulInt(666643, 20)); + $s4 = $s4->addInt64($s15->mulInt(470296, 19)); + $s5 = $s5->addInt64($s15->mulInt(654183, 20)); + $s6 = $s6->subInt64($s15->mulInt(997805, 20)); + $s7 = $s7->addInt64($s15->mulInt(136657, 18)); + $s8 = $s8->subInt64($s15->mulInt(683901, 20)); + + $s2 = $s2->addInt64($s14->mulInt(666643, 20)); + $s3 = $s3->addInt64($s14->mulInt(470296, 19)); + $s4 = $s4->addInt64($s14->mulInt(654183, 20)); + $s5 = $s5->subInt64($s14->mulInt(997805, 20)); + $s6 = $s6->addInt64($s14->mulInt(136657, 18)); + $s7 = $s7->subInt64($s14->mulInt(683901, 20)); + + $s1 = $s1->addInt64($s13->mulInt(666643, 20)); + $s2 = $s2->addInt64($s13->mulInt(470296, 19)); + $s3 = $s3->addInt64($s13->mulInt(654183, 20)); + $s4 = $s4->subInt64($s13->mulInt(997805, 20)); + $s5 = $s5->addInt64($s13->mulInt(136657, 18)); + $s6 = $s6->subInt64($s13->mulInt(683901, 20)); + + $s0 = $s0->addInt64($s12->mulInt(666643, 20)); + $s1 = $s1->addInt64($s12->mulInt(470296, 19)); + $s2 = $s2->addInt64($s12->mulInt(654183, 20)); + $s3 = $s3->subInt64($s12->mulInt(997805, 20)); + $s4 = $s4->addInt64($s12->mulInt(136657, 18)); + $s5 = $s5->subInt64($s12->mulInt(683901, 20)); + $s12 = new ParagonIE_Sodium_Core32_Int64(); + + $carry0 = $s0->addInt(1 << 20)->shiftRight(21); + $s1 = $s1->addInt64($carry0); + $s0 = $s0->subInt64($carry0->shiftLeft(21)); + $carry2 = $s2->addInt(1 << 20)->shiftRight(21); + $s3 = $s3->addInt64($carry2); + $s2 = $s2->subInt64($carry2->shiftLeft(21)); + $carry4 = $s4->addInt(1 << 20)->shiftRight(21); + $s5 = $s5->addInt64($carry4); + $s4 = $s4->subInt64($carry4->shiftLeft(21)); + $carry6 = $s6->addInt(1 << 20)->shiftRight(21); + $s7 = $s7->addInt64($carry6); + $s6 = $s6->subInt64($carry6->shiftLeft(21)); + $carry8 = $s8->addInt(1 << 20)->shiftRight(21); + $s9 = $s9->addInt64($carry8); + $s8 = $s8->subInt64($carry8->shiftLeft(21)); + $carry10 = $s10->addInt(1 << 20)->shiftRight(21); + $s11 = $s11->addInt64($carry10); + $s10 = $s10->subInt64($carry10->shiftLeft(21)); + $carry1 = $s1->addInt(1 << 20)->shiftRight(21); + $s2 = $s2->addInt64($carry1); + $s1 = $s1->subInt64($carry1->shiftLeft(21)); + $carry3 = $s3->addInt(1 << 20)->shiftRight(21); + $s4 = $s4->addInt64($carry3); + $s3 = $s3->subInt64($carry3->shiftLeft(21)); + $carry5 = $s5->addInt(1 << 20)->shiftRight(21); + $s6 = $s6->addInt64($carry5); + $s5 = $s5->subInt64($carry5->shiftLeft(21)); + $carry7 = $s7->addInt(1 << 20)->shiftRight(21); + $s8 = $s8->addInt64($carry7); + $s7 = $s7->subInt64($carry7->shiftLeft(21)); + $carry9 = $s9->addInt(1 << 20)->shiftRight(21); + $s10 = $s10->addInt64($carry9); + $s9 = $s9->subInt64($carry9->shiftLeft(21)); + $carry11 = $s11->addInt(1 << 20)->shiftRight(21); + $s12 = $s12->addInt64($carry11); + $s11 = $s11->subInt64($carry11->shiftLeft(21)); + + $s0 = $s0->addInt64($s12->mulInt(666643, 20)); + $s1 = $s1->addInt64($s12->mulInt(470296, 19)); + $s2 = $s2->addInt64($s12->mulInt(654183, 20)); + $s3 = $s3->subInt64($s12->mulInt(997805, 20)); + $s4 = $s4->addInt64($s12->mulInt(136657, 18)); + $s5 = $s5->subInt64($s12->mulInt(683901, 20)); + $s12 = new ParagonIE_Sodium_Core32_Int64(); + + $carry0 = $s0->shiftRight(21); + $s1 = $s1->addInt64($carry0); + $s0 = $s0->subInt64($carry0->shiftLeft(21)); + $carry1 = $s1->shiftRight(21); + $s2 = $s2->addInt64($carry1); + $s1 = $s1->subInt64($carry1->shiftLeft(21)); + $carry2 = $s2->shiftRight(21); + $s3 = $s3->addInt64($carry2); + $s2 = $s2->subInt64($carry2->shiftLeft(21)); + $carry3 = $s3->shiftRight(21); + $s4 = $s4->addInt64($carry3); + $s3 = $s3->subInt64($carry3->shiftLeft(21)); + $carry4 = $s4->shiftRight(21); + $s5 = $s5->addInt64($carry4); + $s4 = $s4->subInt64($carry4->shiftLeft(21)); + $carry5 = $s5->shiftRight(21); + $s6 = $s6->addInt64($carry5); + $s5 = $s5->subInt64($carry5->shiftLeft(21)); + $carry6 = $s6->shiftRight(21); + $s7 = $s7->addInt64($carry6); + $s6 = $s6->subInt64($carry6->shiftLeft(21)); + $carry7 = $s7->shiftRight(21); + $s8 = $s8->addInt64($carry7); + $s7 = $s7->subInt64($carry7->shiftLeft(21)); + $carry8 = $s8->shiftRight(21); + $s9 = $s9->addInt64($carry8); + $s8 = $s8->subInt64($carry8->shiftLeft(21)); + $carry9 = $s9->shiftRight(21); + $s10 = $s10->addInt64($carry9); + $s9 = $s9->subInt64($carry9->shiftLeft(21)); + $carry10 = $s10->shiftRight(21); + $s11 = $s11->addInt64($carry10); + $s10 = $s10->subInt64($carry10->shiftLeft(21)); + $carry11 = $s11->shiftRight(21); + $s12 = $s12->addInt64($carry11); + $s11 = $s11->subInt64($carry11->shiftLeft(21)); + + $s0 = $s0->addInt64($s12->mulInt(666643, 20)); + $s1 = $s1->addInt64($s12->mulInt(470296, 19)); + $s2 = $s2->addInt64($s12->mulInt(654183, 20)); + $s3 = $s3->subInt64($s12->mulInt(997805, 20)); + $s4 = $s4->addInt64($s12->mulInt(136657, 18)); + $s5 = $s5->subInt64($s12->mulInt(683901, 20)); + + $carry0 = $s0->shiftRight(21); + $s1 = $s1->addInt64($carry0); + $s0 = $s0->subInt64($carry0->shiftLeft(21)); + $carry1 = $s1->shiftRight(21); + $s2 = $s2->addInt64($carry1); + $s1 = $s1->subInt64($carry1->shiftLeft(21)); + $carry2 = $s2->shiftRight(21); + $s3 = $s3->addInt64($carry2); + $s2 = $s2->subInt64($carry2->shiftLeft(21)); + $carry3 = $s3->shiftRight(21); + $s4 = $s4->addInt64($carry3); + $s3 = $s3->subInt64($carry3->shiftLeft(21)); + $carry4 = $s4->shiftRight(21); + $s5 = $s5->addInt64($carry4); + $s4 = $s4->subInt64($carry4->shiftLeft(21)); + $carry5 = $s5->shiftRight(21); + $s6 = $s6->addInt64($carry5); + $s5 = $s5->subInt64($carry5->shiftLeft(21)); + $carry6 = $s6->shiftRight(21); + $s7 = $s7->addInt64($carry6); + $s6 = $s6->subInt64($carry6->shiftLeft(21)); + $carry7 = $s7->shiftRight(21); + $s8 = $s8->addInt64($carry7); + $s7 = $s7->subInt64($carry7->shiftLeft(21)); + $carry8 = $s8->shiftRight(21); + $s9 = $s9->addInt64($carry8); + $s8 = $s8->subInt64($carry8->shiftLeft(21)); + $carry9 = $s9->shiftRight(21); + $s10 = $s10->addInt64($carry9); + $s9 = $s9->subInt64($carry9->shiftLeft(21)); + $carry10 = $s10->shiftRight(21); + $s11 = $s11->addInt64($carry10); + $s10 = $s10->subInt64($carry10->shiftLeft(21)); + + $S0 = $s0->toInt32()->toInt(); + $S1 = $s1->toInt32()->toInt(); + $S2 = $s2->toInt32()->toInt(); + $S3 = $s3->toInt32()->toInt(); + $S4 = $s4->toInt32()->toInt(); + $S5 = $s5->toInt32()->toInt(); + $S6 = $s6->toInt32()->toInt(); + $S7 = $s7->toInt32()->toInt(); + $S8 = $s8->toInt32()->toInt(); + $S9 = $s9->toInt32()->toInt(); + $S10 = $s10->toInt32()->toInt(); + $S11 = $s11->toInt32()->toInt(); + + /** + * @var array + */ + $arr = array( + (int) ($S0 >> 0), + (int) ($S0 >> 8), + (int) (($S0 >> 16) | ($S1 << 5)), + (int) ($S1 >> 3), + (int) ($S1 >> 11), + (int) (($S1 >> 19) | ($S2 << 2)), + (int) ($S2 >> 6), + (int) (($S2 >> 14) | ($S3 << 7)), + (int) ($S3 >> 1), + (int) ($S3 >> 9), + (int) (($S3 >> 17) | ($S4 << 4)), + (int) ($S4 >> 4), + (int) ($S4 >> 12), + (int) (($S4 >> 20) | ($S5 << 1)), + (int) ($S5 >> 7), + (int) (($S5 >> 15) | ($S6 << 6)), + (int) ($S6 >> 2), + (int) ($S6 >> 10), + (int) (($S6 >> 18) | ($S7 << 3)), + (int) ($S7 >> 5), + (int) ($S7 >> 13), + (int) ($S8 >> 0), + (int) ($S8 >> 8), + (int) (($S8 >> 16) | ($S9 << 5)), + (int) ($S9 >> 3), + (int) ($S9 >> 11), + (int) (($S9 >> 19) | ($S10 << 2)), + (int) ($S10 >> 6), + (int) (($S10 >> 14) | ($S11 << 7)), + (int) ($S11 >> 1), + (int) ($S11 >> 9), + (int) $S11 >> 17 + ); + return self::intArrayToString($arr); + } + + /** + * multiply by the order of the main subgroup l = 2^252+27742317777372353535851937790883648493 + * + * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A + * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P3 + * @throws SodiumException + * @throws TypeError + */ + public static function ge_mul_l(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A) + { + /** @var array $aslide */ + $aslide = array( + 13, 0, 0, 0, 0, -1, 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0, + 0, 0, 0, -3, 0, 0, 0, 0, -13, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 3, 0, + 0, 0, 0, -13, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 11, 0, 0, 0, 0, -13, 0, 0, 0, 0, 0, 0, -3, 0, 0, 0, 0, 0, -1, + 0, 0, 0, 0, 3, 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, + 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 5, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 + ); + + /** @var array $Ai size 8 */ + $Ai = array(); + + # ge_p3_to_cached(&Ai[0], A); + $Ai[0] = self::ge_p3_to_cached($A); + # ge_p3_dbl(&t, A); + $t = self::ge_p3_dbl($A); + # ge_p1p1_to_p3(&A2, &t); + $A2 = self::ge_p1p1_to_p3($t); + + for ($i = 1; $i < 8; ++$i) { + # ge_add(&t, &A2, &Ai[0]); + $t = self::ge_add($A2, $Ai[$i - 1]); + # ge_p1p1_to_p3(&u, &t); + $u = self::ge_p1p1_to_p3($t); + # ge_p3_to_cached(&Ai[i], &u); + $Ai[$i] = self::ge_p3_to_cached($u); + } + + $r = self::ge_p3_0(); + for ($i = 252; $i >= 0; --$i) { + $t = self::ge_p3_dbl($r); + if ($aslide[$i] > 0) { + # ge_p1p1_to_p3(&u, &t); + $u = self::ge_p1p1_to_p3($t); + # ge_add(&t, &u, &Ai[aslide[i] / 2]); + $t = self::ge_add($u, $Ai[(int)($aslide[$i] / 2)]); + } elseif ($aslide[$i] < 0) { + # ge_p1p1_to_p3(&u, &t); + $u = self::ge_p1p1_to_p3($t); + # ge_sub(&t, &u, &Ai[(-aslide[i]) / 2]); + $t = self::ge_sub($u, $Ai[(int)(-$aslide[$i] / 2)]); + } + } + # ge_p1p1_to_p3(r, &t); + return self::ge_p1p1_to_p3($t); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/Curve25519/Fe.php b/vendor/paragonie/sodium_compat/src/Core32/Curve25519/Fe.php new file mode 100644 index 0000000..5fe10f7 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/Curve25519/Fe.php @@ -0,0 +1,185 @@ + + */ + protected $container = array(); + + /** + * @var int + */ + protected $size = 10; + + /** + * @internal You should not use this directly from another application + * + * @param array $array + * @param bool $save_indexes + * @return self + * @throws SodiumException + * @throws TypeError + */ + public static function fromArray($array, $save_indexes = null) + { + $count = count($array); + if ($save_indexes) { + $keys = array_keys($array); + } else { + $keys = range(0, $count - 1); + } + $array = array_values($array); + + $obj = new ParagonIE_Sodium_Core32_Curve25519_Fe(); + if ($save_indexes) { + for ($i = 0; $i < $count; ++$i) { + $array[$i]->overflow = 0; + $obj->offsetSet($keys[$i], $array[$i]); + } + } else { + for ($i = 0; $i < $count; ++$i) { + $array[$i]->overflow = 0; + $obj->offsetSet($i, $array[$i]); + } + } + return $obj; + } + + /** + * @internal You should not use this directly from another application + * + * @param array $array + * @param bool $save_indexes + * @return self + * @throws SodiumException + * @throws TypeError + */ + public static function fromIntArray($array, $save_indexes = null) + { + $count = count($array); + if ($save_indexes) { + $keys = array_keys($array); + } else { + $keys = range(0, $count - 1); + } + $array = array_values($array); + $set = array(); + /** @var int $i */ + /** @var int $v */ + foreach ($array as $i => $v) { + $set[$i] = ParagonIE_Sodium_Core32_Int32::fromInt($v); + } + + $obj = new ParagonIE_Sodium_Core32_Curve25519_Fe(); + if ($save_indexes) { + for ($i = 0; $i < $count; ++$i) { + $set[$i]->overflow = 0; + $obj->offsetSet($keys[$i], $set[$i]); + } + } else { + for ($i = 0; $i < $count; ++$i) { + $set[$i]->overflow = 0; + $obj->offsetSet($i, $set[$i]); + } + } + return $obj; + } + + /** + * @internal You should not use this directly from another application + * + * @param mixed $offset + * @param mixed $value + * @return void + * @throws SodiumException + * @throws TypeError + */ + public function offsetSet($offset, $value) + { + if (!($value instanceof ParagonIE_Sodium_Core32_Int32)) { + throw new InvalidArgumentException('Expected an instance of ParagonIE_Sodium_Core32_Int32'); + } + if (is_null($offset)) { + $this->container[] = $value; + } else { + ParagonIE_Sodium_Core32_Util::declareScalarType($offset, 'int', 1); + $this->container[(int) $offset] = $value; + } + } + + /** + * @internal You should not use this directly from another application + * + * @param mixed $offset + * @return bool + * @psalm-suppress MixedArrayOffset + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * @internal You should not use this directly from another application + * + * @param mixed $offset + * @return void + * @psalm-suppress MixedArrayOffset + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * @internal You should not use this directly from another application + * + * @param mixed $offset + * @return ParagonIE_Sodium_Core32_Int32 + * @psalm-suppress MixedArrayOffset + */ + public function offsetGet($offset) + { + if (!isset($this->container[$offset])) { + $this->container[(int) $offset] = new ParagonIE_Sodium_Core32_Int32(); + } + /** @var ParagonIE_Sodium_Core32_Int32 $get */ + $get = $this->container[$offset]; + return $get; + } + + /** + * @internal You should not use this directly from another application + * + * @return array + */ + public function __debugInfo() + { + if (empty($this->container)) { + return array(); + } + $c = array( + (int) ($this->container[0]->toInt()), + (int) ($this->container[1]->toInt()), + (int) ($this->container[2]->toInt()), + (int) ($this->container[3]->toInt()), + (int) ($this->container[4]->toInt()), + (int) ($this->container[5]->toInt()), + (int) ($this->container[6]->toInt()), + (int) ($this->container[7]->toInt()), + (int) ($this->container[8]->toInt()), + (int) ($this->container[9]->toInt()) + ); + return array(implode(', ', $c)); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/Curve25519/Ge/Cached.php b/vendor/paragonie/sodium_compat/src/Core32/Curve25519/Ge/Cached.php new file mode 100644 index 0000000..970481f --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/Curve25519/Ge/Cached.php @@ -0,0 +1,65 @@ +YplusX = $YplusX; + if ($YminusX === null) { + $YminusX = new ParagonIE_Sodium_Core32_Curve25519_Fe(); + } + $this->YminusX = $YminusX; + if ($Z === null) { + $Z = new ParagonIE_Sodium_Core32_Curve25519_Fe(); + } + $this->Z = $Z; + if ($T2d === null) { + $T2d = new ParagonIE_Sodium_Core32_Curve25519_Fe(); + } + $this->T2d = $T2d; + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/Curve25519/Ge/P1p1.php b/vendor/paragonie/sodium_compat/src/Core32/Curve25519/Ge/P1p1.php new file mode 100644 index 0000000..ff10b1d --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/Curve25519/Ge/P1p1.php @@ -0,0 +1,67 @@ +X = $x; + if ($y === null) { + $y = ParagonIE_Sodium_Core32_Curve25519::fe_0(); + } + $this->Y = $y; + if ($z === null) { + $z = ParagonIE_Sodium_Core32_Curve25519::fe_0(); + } + $this->Z = $z; + if ($t === null) { + $t = ParagonIE_Sodium_Core32_Curve25519::fe_0(); + } + $this->T = $t; + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/Curve25519/Ge/P2.php b/vendor/paragonie/sodium_compat/src/Core32/Curve25519/Ge/P2.php new file mode 100644 index 0000000..8a45a91 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/Curve25519/Ge/P2.php @@ -0,0 +1,54 @@ +X = $x; + if ($y === null) { + $y = new ParagonIE_Sodium_Core32_Curve25519_Fe(); + } + $this->Y = $y; + if ($z === null) { + $z = new ParagonIE_Sodium_Core32_Curve25519_Fe(); + } + $this->Z = $z; + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/Curve25519/Ge/P3.php b/vendor/paragonie/sodium_compat/src/Core32/Curve25519/Ge/P3.php new file mode 100644 index 0000000..c9e4b16 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/Curve25519/Ge/P3.php @@ -0,0 +1,65 @@ +X = $x; + if ($y === null) { + $y = new ParagonIE_Sodium_Core32_Curve25519_Fe(); + } + $this->Y = $y; + if ($z === null) { + $z = new ParagonIE_Sodium_Core32_Curve25519_Fe(); + } + $this->Z = $z; + if ($t === null) { + $t = new ParagonIE_Sodium_Core32_Curve25519_Fe(); + } + $this->T = $t; + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/Curve25519/Ge/Precomp.php b/vendor/paragonie/sodium_compat/src/Core32/Curve25519/Ge/Precomp.php new file mode 100644 index 0000000..b590b75 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/Curve25519/Ge/Precomp.php @@ -0,0 +1,56 @@ +yplusx = $yplusx; + if ($yminusx === null) { + $yminusx = ParagonIE_Sodium_Core32_Curve25519::fe_0(); + } + $this->yminusx = $yminusx; + if ($xy2d === null) { + $xy2d = ParagonIE_Sodium_Core32_Curve25519::fe_0(); + } + $this->xy2d = $xy2d; + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/Curve25519/H.php b/vendor/paragonie/sodium_compat/src/Core32/Curve25519/H.php new file mode 100644 index 0000000..48c999a --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/Curve25519/H.php @@ -0,0 +1,1467 @@ +>>> Basically, int[32][8][3][10] + */ + protected static $base = array( + array( + array( + array(25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605), + array(-12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378), + array(-8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546), + ), + array( + array(-12815894, -12976347, -21581243, 11784320, -25355658, -2750717, -11717903, -3814571, -358445, -10211303), + array(-21703237, 6903825, 27185491, 6451973, -29577724, -9554005, -15616551, 11189268, -26829678, -5319081), + array(26966642, 11152617, 32442495, 15396054, 14353839, -12752335, -3128826, -9541118, -15472047, -4166697), + ), + array( + array(15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024), + array(16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574), + array(30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357), + ), + array( + array(-17036878, 13921892, 10945806, -6033431, 27105052, -16084379, -28926210, 15006023, 3284568, -6276540), + array(23599295, -8306047, -11193664, -7687416, 13236774, 10506355, 7464579, 9656445, 13059162, 10374397), + array(7798556, 16710257, 3033922, 2874086, 28997861, 2835604, 32406664, -3839045, -641708, -101325), + ), + array( + array(10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380), + array(4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306), + array(19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942), + ), + array( + array(-15371964, -12862754, 32573250, 4720197, -26436522, 5875511, -19188627, -15224819, -9818940, -12085777), + array(-8549212, 109983, 15149363, 2178705, 22900618, 4543417, 3044240, -15689887, 1762328, 14866737), + array(-18199695, -15951423, -10473290, 1707278, -17185920, 3916101, -28236412, 3959421, 27914454, 4383652), + ), + array( + array(5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766), + array(-30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701), + array(28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300), + ), + array( + array(14499471, -2729599, -33191113, -4254652, 28494862, 14271267, 30290735, 10876454, -33154098, 2381726), + array(-7195431, -2655363, -14730155, 462251, -27724326, 3941372, -6236617, 3696005, -32300832, 15351955), + array(27431194, 8222322, 16448760, -3907995, -18707002, 11938355, -32961401, -2970515, 29551813, 10109425), + ), + ), + array( + array( + array(-13657040, -13155431, -31283750, 11777098, 21447386, 6519384, -2378284, -1627556, 10092783, -4764171), + array(27939166, 14210322, 4677035, 16277044, -22964462, -12398139, -32508754, 12005538, -17810127, 12803510), + array(17228999, -15661624, -1233527, 300140, -1224870, -11714777, 30364213, -9038194, 18016357, 4397660), + ), + array( + array(-10958843, -7690207, 4776341, -14954238, 27850028, -15602212, -26619106, 14544525, -17477504, 982639), + array(29253598, 15796703, -2863982, -9908884, 10057023, 3163536, 7332899, -4120128, -21047696, 9934963), + array(5793303, 16271923, -24131614, -10116404, 29188560, 1206517, -14747930, 4559895, -30123922, -10897950), + ), + array( + array(-27643952, -11493006, 16282657, -11036493, 28414021, -15012264, 24191034, 4541697, -13338309, 5500568), + array(12650548, -1497113, 9052871, 11355358, -17680037, -8400164, -17430592, 12264343, 10874051, 13524335), + array(25556948, -3045990, 714651, 2510400, 23394682, -10415330, 33119038, 5080568, -22528059, 5376628), + ), + array( + array(-26088264, -4011052, -17013699, -3537628, -6726793, 1920897, -22321305, -9447443, 4535768, 1569007), + array(-2255422, 14606630, -21692440, -8039818, 28430649, 8775819, -30494562, 3044290, 31848280, 12543772), + array(-22028579, 2943893, -31857513, 6777306, 13784462, -4292203, -27377195, -2062731, 7718482, 14474653), + ), + array( + array(2385315, 2454213, -22631320, 46603, -4437935, -15680415, 656965, -7236665, 24316168, -5253567), + array(13741529, 10911568, -33233417, -8603737, -20177830, -1033297, 33040651, -13424532, -20729456, 8321686), + array(21060490, -2212744, 15712757, -4336099, 1639040, 10656336, 23845965, -11874838, -9984458, 608372), + ), + array( + array(-13672732, -15087586, -10889693, -7557059, -6036909, 11305547, 1123968, -6780577, 27229399, 23887), + array(-23244140, -294205, -11744728, 14712571, -29465699, -2029617, 12797024, -6440308, -1633405, 16678954), + array(-29500620, 4770662, -16054387, 14001338, 7830047, 9564805, -1508144, -4795045, -17169265, 4904953), + ), + array( + array(24059557, 14617003, 19037157, -15039908, 19766093, -14906429, 5169211, 16191880, 2128236, -4326833), + array(-16981152, 4124966, -8540610, -10653797, 30336522, -14105247, -29806336, 916033, -6882542, -2986532), + array(-22630907, 12419372, -7134229, -7473371, -16478904, 16739175, 285431, 2763829, 15736322, 4143876), + ), + array( + array(2379352, 11839345, -4110402, -5988665, 11274298, 794957, 212801, -14594663, 23527084, -16458268), + array(33431127, -11130478, -17838966, -15626900, 8909499, 8376530, -32625340, 4087881, -15188911, -14416214), + array(1767683, 7197987, -13205226, -2022635, -13091350, 448826, 5799055, 4357868, -4774191, -16323038), + ), + ), + array( + array( + array(6721966, 13833823, -23523388, -1551314, 26354293, -11863321, 23365147, -3949732, 7390890, 2759800), + array(4409041, 2052381, 23373853, 10530217, 7676779, -12885954, 21302353, -4264057, 1244380, -12919645), + array(-4421239, 7169619, 4982368, -2957590, 30256825, -2777540, 14086413, 9208236, 15886429, 16489664), + ), + array( + array(1996075, 10375649, 14346367, 13311202, -6874135, -16438411, -13693198, 398369, -30606455, -712933), + array(-25307465, 9795880, -2777414, 14878809, -33531835, 14780363, 13348553, 12076947, -30836462, 5113182), + array(-17770784, 11797796, 31950843, 13929123, -25888302, 12288344, -30341101, -7336386, 13847711, 5387222), + ), + array( + array(-18582163, -3416217, 17824843, -2340966, 22744343, -10442611, 8763061, 3617786, -19600662, 10370991), + array(20246567, -14369378, 22358229, -543712, 18507283, -10413996, 14554437, -8746092, 32232924, 16763880), + array(9648505, 10094563, 26416693, 14745928, -30374318, -6472621, 11094161, 15689506, 3140038, -16510092), + ), + array( + array(-16160072, 5472695, 31895588, 4744994, 8823515, 10365685, -27224800, 9448613, -28774454, 366295), + array(19153450, 11523972, -11096490, -6503142, -24647631, 5420647, 28344573, 8041113, 719605, 11671788), + array(8678025, 2694440, -6808014, 2517372, 4964326, 11152271, -15432916, -15266516, 27000813, -10195553), + ), + array( + array(-15157904, 7134312, 8639287, -2814877, -7235688, 10421742, 564065, 5336097, 6750977, -14521026), + array(11836410, -3979488, 26297894, 16080799, 23455045, 15735944, 1695823, -8819122, 8169720, 16220347), + array(-18115838, 8653647, 17578566, -6092619, -8025777, -16012763, -11144307, -2627664, -5990708, -14166033), + ), + array( + array(-23308498, -10968312, 15213228, -10081214, -30853605, -11050004, 27884329, 2847284, 2655861, 1738395), + array(-27537433, -14253021, -25336301, -8002780, -9370762, 8129821, 21651608, -3239336, -19087449, -11005278), + array(1533110, 3437855, 23735889, 459276, 29970501, 11335377, 26030092, 5821408, 10478196, 8544890), + ), + array( + array(32173121, -16129311, 24896207, 3921497, 22579056, -3410854, 19270449, 12217473, 17789017, -3395995), + array(-30552961, -2228401, -15578829, -10147201, 13243889, 517024, 15479401, -3853233, 30460520, 1052596), + array(-11614875, 13323618, 32618793, 8175907, -15230173, 12596687, 27491595, -4612359, 3179268, -9478891), + ), + array( + array(31947069, -14366651, -4640583, -15339921, -15125977, -6039709, -14756777, -16411740, 19072640, -9511060), + array(11685058, 11822410, 3158003, -13952594, 33402194, -4165066, 5977896, -5215017, 473099, 5040608), + array(-20290863, 8198642, -27410132, 11602123, 1290375, -2799760, 28326862, 1721092, -19558642, -3131606), + ), + ), + array( + array( + array(7881532, 10687937, 7578723, 7738378, -18951012, -2553952, 21820786, 8076149, -27868496, 11538389), + array(-19935666, 3899861, 18283497, -6801568, -15728660, -11249211, 8754525, 7446702, -5676054, 5797016), + array(-11295600, -3793569, -15782110, -7964573, 12708869, -8456199, 2014099, -9050574, -2369172, -5877341), + ), + array( + array(-22472376, -11568741, -27682020, 1146375, 18956691, 16640559, 1192730, -3714199, 15123619, 10811505), + array(14352098, -3419715, -18942044, 10822655, 32750596, 4699007, -70363, 15776356, -28886779, -11974553), + array(-28241164, -8072475, -4978962, -5315317, 29416931, 1847569, -20654173, -16484855, 4714547, -9600655), + ), + array( + array(15200332, 8368572, 19679101, 15970074, -31872674, 1959451, 24611599, -4543832, -11745876, 12340220), + array(12876937, -10480056, 33134381, 6590940, -6307776, 14872440, 9613953, 8241152, 15370987, 9608631), + array(-4143277, -12014408, 8446281, -391603, 4407738, 13629032, -7724868, 15866074, -28210621, -8814099), + ), + array( + array(26660628, -15677655, 8393734, 358047, -7401291, 992988, -23904233, 858697, 20571223, 8420556), + array(14620715, 13067227, -15447274, 8264467, 14106269, 15080814, 33531827, 12516406, -21574435, -12476749), + array(236881, 10476226, 57258, -14677024, 6472998, 2466984, 17258519, 7256740, 8791136, 15069930), + ), + array( + array(1276410, -9371918, 22949635, -16322807, -23493039, -5702186, 14711875, 4874229, -30663140, -2331391), + array(5855666, 4990204, -13711848, 7294284, -7804282, 1924647, -1423175, -7912378, -33069337, 9234253), + array(20590503, -9018988, 31529744, -7352666, -2706834, 10650548, 31559055, -11609587, 18979186, 13396066), + ), + array( + array(24474287, 4968103, 22267082, 4407354, 24063882, -8325180, -18816887, 13594782, 33514650, 7021958), + array(-11566906, -6565505, -21365085, 15928892, -26158305, 4315421, -25948728, -3916677, -21480480, 12868082), + array(-28635013, 13504661, 19988037, -2132761, 21078225, 6443208, -21446107, 2244500, -12455797, -8089383), + ), + array( + array(-30595528, 13793479, -5852820, 319136, -25723172, -6263899, 33086546, 8957937, -15233648, 5540521), + array(-11630176, -11503902, -8119500, -7643073, 2620056, 1022908, -23710744, -1568984, -16128528, -14962807), + array(23152971, 775386, 27395463, 14006635, -9701118, 4649512, 1689819, 892185, -11513277, -15205948), + ), + array( + array(9770129, 9586738, 26496094, 4324120, 1556511, -3550024, 27453819, 4763127, -19179614, 5867134), + array(-32765025, 1927590, 31726409, -4753295, 23962434, -16019500, 27846559, 5931263, -29749703, -16108455), + array(27461885, -2977536, 22380810, 1815854, -23033753, -3031938, 7283490, -15148073, -19526700, 7734629), + ), + ), + array( + array( + array(-8010264, -9590817, -11120403, 6196038, 29344158, -13430885, 7585295, -3176626, 18549497, 15302069), + array(-32658337, -6171222, -7672793, -11051681, 6258878, 13504381, 10458790, -6418461, -8872242, 8424746), + array(24687205, 8613276, -30667046, -3233545, 1863892, -1830544, 19206234, 7134917, -11284482, -828919), + ), + array( + array(11334899, -9218022, 8025293, 12707519, 17523892, -10476071, 10243738, -14685461, -5066034, 16498837), + array(8911542, 6887158, -9584260, -6958590, 11145641, -9543680, 17303925, -14124238, 6536641, 10543906), + array(-28946384, 15479763, -17466835, 568876, -1497683, 11223454, -2669190, -16625574, -27235709, 8876771), + ), + array( + array(-25742899, -12566864, -15649966, -846607, -33026686, -796288, -33481822, 15824474, -604426, -9039817), + array(10330056, 70051, 7957388, -9002667, 9764902, 15609756, 27698697, -4890037, 1657394, 3084098), + array(10477963, -7470260, 12119566, -13250805, 29016247, -5365589, 31280319, 14396151, -30233575, 15272409), + ), + array( + array(-12288309, 3169463, 28813183, 16658753, 25116432, -5630466, -25173957, -12636138, -25014757, 1950504), + array(-26180358, 9489187, 11053416, -14746161, -31053720, 5825630, -8384306, -8767532, 15341279, 8373727), + array(28685821, 7759505, -14378516, -12002860, -31971820, 4079242, 298136, -10232602, -2878207, 15190420), + ), + array( + array(-32932876, 13806336, -14337485, -15794431, -24004620, 10940928, 8669718, 2742393, -26033313, -6875003), + array(-1580388, -11729417, -25979658, -11445023, -17411874, -10912854, 9291594, -16247779, -12154742, 6048605), + array(-30305315, 14843444, 1539301, 11864366, 20201677, 1900163, 13934231, 5128323, 11213262, 9168384), + ), + array( + array(-26280513, 11007847, 19408960, -940758, -18592965, -4328580, -5088060, -11105150, 20470157, -16398701), + array(-23136053, 9282192, 14855179, -15390078, -7362815, -14408560, -22783952, 14461608, 14042978, 5230683), + array(29969567, -2741594, -16711867, -8552442, 9175486, -2468974, 21556951, 3506042, -5933891, -12449708), + ), + array( + array(-3144746, 8744661, 19704003, 4581278, -20430686, 6830683, -21284170, 8971513, -28539189, 15326563), + array(-19464629, 10110288, -17262528, -3503892, -23500387, 1355669, -15523050, 15300988, -20514118, 9168260), + array(-5353335, 4488613, -23803248, 16314347, 7780487, -15638939, -28948358, 9601605, 33087103, -9011387), + ), + array( + array(-19443170, -15512900, -20797467, -12445323, -29824447, 10229461, -27444329, -15000531, -5996870, 15664672), + array(23294591, -16632613, -22650781, -8470978, 27844204, 11461195, 13099750, -2460356, 18151676, 13417686), + array(-24722913, -4176517, -31150679, 5988919, -26858785, 6685065, 1661597, -12551441, 15271676, -15452665), + ), + ), + array( + array( + array(11433042, -13228665, 8239631, -5279517, -1985436, -725718, -18698764, 2167544, -6921301, -13440182), + array(-31436171, 15575146, 30436815, 12192228, -22463353, 9395379, -9917708, -8638997, 12215110, 12028277), + array(14098400, 6555944, 23007258, 5757252, -15427832, -12950502, 30123440, 4617780, -16900089, -655628), + ), + array( + array(-4026201, -15240835, 11893168, 13718664, -14809462, 1847385, -15819999, 10154009, 23973261, -12684474), + array(-26531820, -3695990, -1908898, 2534301, -31870557, -16550355, 18341390, -11419951, 32013174, -10103539), + array(-25479301, 10876443, -11771086, -14625140, -12369567, 1838104, 21911214, 6354752, 4425632, -837822), + ), + array( + array(-10433389, -14612966, 22229858, -3091047, -13191166, 776729, -17415375, -12020462, 4725005, 14044970), + array(19268650, -7304421, 1555349, 8692754, -21474059, -9910664, 6347390, -1411784, -19522291, -16109756), + array(-24864089, 12986008, -10898878, -5558584, -11312371, -148526, 19541418, 8180106, 9282262, 10282508), + ), + array( + array(-26205082, 4428547, -8661196, -13194263, 4098402, -14165257, 15522535, 8372215, 5542595, -10702683), + array(-10562541, 14895633, 26814552, -16673850, -17480754, -2489360, -2781891, 6993761, -18093885, 10114655), + array(-20107055, -929418, 31422704, 10427861, -7110749, 6150669, -29091755, -11529146, 25953725, -106158), + ), + array( + array(-4234397, -8039292, -9119125, 3046000, 2101609, -12607294, 19390020, 6094296, -3315279, 12831125), + array(-15998678, 7578152, 5310217, 14408357, -33548620, -224739, 31575954, 6326196, 7381791, -2421839), + array(-20902779, 3296811, 24736065, -16328389, 18374254, 7318640, 6295303, 8082724, -15362489, 12339664), + ), + array( + array(27724736, 2291157, 6088201, -14184798, 1792727, 5857634, 13848414, 15768922, 25091167, 14856294), + array(-18866652, 8331043, 24373479, 8541013, -701998, -9269457, 12927300, -12695493, -22182473, -9012899), + array(-11423429, -5421590, 11632845, 3405020, 30536730, -11674039, -27260765, 13866390, 30146206, 9142070), + ), + array( + array(3924129, -15307516, -13817122, -10054960, 12291820, -668366, -27702774, 9326384, -8237858, 4171294), + array(-15921940, 16037937, 6713787, 16606682, -21612135, 2790944, 26396185, 3731949, 345228, -5462949), + array(-21327538, 13448259, 25284571, 1143661, 20614966, -8849387, 2031539, -12391231, -16253183, -13582083), + ), + array( + array(31016211, -16722429, 26371392, -14451233, -5027349, 14854137, 17477601, 3842657, 28012650, -16405420), + array(-5075835, 9368966, -8562079, -4600902, -15249953, 6970560, -9189873, 16292057, -8867157, 3507940), + array(29439664, 3537914, 23333589, 6997794, -17555561, -11018068, -15209202, -15051267, -9164929, 6580396), + ), + ), + array( + array( + array(-12185861, -7679788, 16438269, 10826160, -8696817, -6235611, 17860444, -9273846, -2095802, 9304567), + array(20714564, -4336911, 29088195, 7406487, 11426967, -5095705, 14792667, -14608617, 5289421, -477127), + array(-16665533, -10650790, -6160345, -13305760, 9192020, -1802462, 17271490, 12349094, 26939669, -3752294), + ), + array( + array(-12889898, 9373458, 31595848, 16374215, 21471720, 13221525, -27283495, -12348559, -3698806, 117887), + array(22263325, -6560050, 3984570, -11174646, -15114008, -566785, 28311253, 5358056, -23319780, 541964), + array(16259219, 3261970, 2309254, -15534474, -16885711, -4581916, 24134070, -16705829, -13337066, -13552195), + ), + array( + array(9378160, -13140186, -22845982, -12745264, 28198281, -7244098, -2399684, -717351, 690426, 14876244), + array(24977353, -314384, -8223969, -13465086, 28432343, -1176353, -13068804, -12297348, -22380984, 6618999), + array(-1538174, 11685646, 12944378, 13682314, -24389511, -14413193, 8044829, -13817328, 32239829, -5652762), + ), + array( + array(-18603066, 4762990, -926250, 8885304, -28412480, -3187315, 9781647, -10350059, 32779359, 5095274), + array(-33008130, -5214506, -32264887, -3685216, 9460461, -9327423, -24601656, 14506724, 21639561, -2630236), + array(-16400943, -13112215, 25239338, 15531969, 3987758, -4499318, -1289502, -6863535, 17874574, 558605), + ), + array( + array(-13600129, 10240081, 9171883, 16131053, -20869254, 9599700, 33499487, 5080151, 2085892, 5119761), + array(-22205145, -2519528, -16381601, 414691, -25019550, 2170430, 30634760, -8363614, -31999993, -5759884), + array(-6845704, 15791202, 8550074, -1312654, 29928809, -12092256, 27534430, -7192145, -22351378, 12961482), + ), + array( + array(-24492060, -9570771, 10368194, 11582341, -23397293, -2245287, 16533930, 8206996, -30194652, -5159638), + array(-11121496, -3382234, 2307366, 6362031, -135455, 8868177, -16835630, 7031275, 7589640, 8945490), + array(-32152748, 8917967, 6661220, -11677616, -1192060, -15793393, 7251489, -11182180, 24099109, -14456170), + ), + array( + array(5019558, -7907470, 4244127, -14714356, -26933272, 6453165, -19118182, -13289025, -6231896, -10280736), + array(10853594, 10721687, 26480089, 5861829, -22995819, 1972175, -1866647, -10557898, -3363451, -6441124), + array(-17002408, 5906790, 221599, -6563147, 7828208, -13248918, 24362661, -2008168, -13866408, 7421392), + ), + array( + array(8139927, -6546497, 32257646, -5890546, 30375719, 1886181, -21175108, 15441252, 28826358, -4123029), + array(6267086, 9695052, 7709135, -16603597, -32869068, -1886135, 14795160, -7840124, 13746021, -1742048), + array(28584902, 7787108, -6732942, -15050729, 22846041, -7571236, -3181936, -363524, 4771362, -8419958), + ), + ), + array( + array( + array(24949256, 6376279, -27466481, -8174608, -18646154, -9930606, 33543569, -12141695, 3569627, 11342593), + array(26514989, 4740088, 27912651, 3697550, 19331575, -11472339, 6809886, 4608608, 7325975, -14801071), + array(-11618399, -14554430, -24321212, 7655128, -1369274, 5214312, -27400540, 10258390, -17646694, -8186692), + ), + array( + array(11431204, 15823007, 26570245, 14329124, 18029990, 4796082, -31446179, 15580664, 9280358, -3973687), + array(-160783, -10326257, -22855316, -4304997, -20861367, -13621002, -32810901, -11181622, -15545091, 4387441), + array(-20799378, 12194512, 3937617, -5805892, -27154820, 9340370, -24513992, 8548137, 20617071, -7482001), + ), + array( + array(-938825, -3930586, -8714311, 16124718, 24603125, -6225393, -13775352, -11875822, 24345683, 10325460), + array(-19855277, -1568885, -22202708, 8714034, 14007766, 6928528, 16318175, -1010689, 4766743, 3552007), + array(-21751364, -16730916, 1351763, -803421, -4009670, 3950935, 3217514, 14481909, 10988822, -3994762), + ), + array( + array(15564307, -14311570, 3101243, 5684148, 30446780, -8051356, 12677127, -6505343, -8295852, 13296005), + array(-9442290, 6624296, -30298964, -11913677, -4670981, -2057379, 31521204, 9614054, -30000824, 12074674), + array(4771191, -135239, 14290749, -13089852, 27992298, 14998318, -1413936, -1556716, 29832613, -16391035), + ), + array( + array(7064884, -7541174, -19161962, -5067537, -18891269, -2912736, 25825242, 5293297, -27122660, 13101590), + array(-2298563, 2439670, -7466610, 1719965, -27267541, -16328445, 32512469, -5317593, -30356070, -4190957), + array(-30006540, 10162316, -33180176, 3981723, -16482138, -13070044, 14413974, 9515896, 19568978, 9628812), + ), + array( + array(33053803, 199357, 15894591, 1583059, 27380243, -4580435, -17838894, -6106839, -6291786, 3437740), + array(-18978877, 3884493, 19469877, 12726490, 15913552, 13614290, -22961733, 70104, 7463304, 4176122), + array(-27124001, 10659917, 11482427, -16070381, 12771467, -6635117, -32719404, -5322751, 24216882, 5944158), + ), + array( + array(8894125, 7450974, -2664149, -9765752, -28080517, -12389115, 19345746, 14680796, 11632993, 5847885), + array(26942781, -2315317, 9129564, -4906607, 26024105, 11769399, -11518837, 6367194, -9727230, 4782140), + array(19916461, -4828410, -22910704, -11414391, 25606324, -5972441, 33253853, 8220911, 6358847, -1873857), + ), + array( + array(801428, -2081702, 16569428, 11065167, 29875704, 96627, 7908388, -4480480, -13538503, 1387155), + array(19646058, 5720633, -11416706, 12814209, 11607948, 12749789, 14147075, 15156355, -21866831, 11835260), + array(19299512, 1155910, 28703737, 14890794, 2925026, 7269399, 26121523, 15467869, -26560550, 5052483), + ), + ), + array( + array( + array(-3017432, 10058206, 1980837, 3964243, 22160966, 12322533, -6431123, -12618185, 12228557, -7003677), + array(32944382, 14922211, -22844894, 5188528, 21913450, -8719943, 4001465, 13238564, -6114803, 8653815), + array(22865569, -4652735, 27603668, -12545395, 14348958, 8234005, 24808405, 5719875, 28483275, 2841751), + ), + array( + array(-16420968, -1113305, -327719, -12107856, 21886282, -15552774, -1887966, -315658, 19932058, -12739203), + array(-11656086, 10087521, -8864888, -5536143, -19278573, -3055912, 3999228, 13239134, -4777469, -13910208), + array(1382174, -11694719, 17266790, 9194690, -13324356, 9720081, 20403944, 11284705, -14013818, 3093230), + ), + array( + array(16650921, -11037932, -1064178, 1570629, -8329746, 7352753, -302424, 16271225, -24049421, -6691850), + array(-21911077, -5927941, -4611316, -5560156, -31744103, -10785293, 24123614, 15193618, -21652117, -16739389), + array(-9935934, -4289447, -25279823, 4372842, 2087473, 10399484, 31870908, 14690798, 17361620, 11864968), + ), + array( + array(-11307610, 6210372, 13206574, 5806320, -29017692, -13967200, -12331205, -7486601, -25578460, -16240689), + array(14668462, -12270235, 26039039, 15305210, 25515617, 4542480, 10453892, 6577524, 9145645, -6443880), + array(5974874, 3053895, -9433049, -10385191, -31865124, 3225009, -7972642, 3936128, -5652273, -3050304), + ), + array( + array(30625386, -4729400, -25555961, -12792866, -20484575, 7695099, 17097188, -16303496, -27999779, 1803632), + array(-3553091, 9865099, -5228566, 4272701, -5673832, -16689700, 14911344, 12196514, -21405489, 7047412), + array(20093277, 9920966, -11138194, -5343857, 13161587, 12044805, -32856851, 4124601, -32343828, -10257566), + ), + array( + array(-20788824, 14084654, -13531713, 7842147, 19119038, -13822605, 4752377, -8714640, -21679658, 2288038), + array(-26819236, -3283715, 29965059, 3039786, -14473765, 2540457, 29457502, 14625692, -24819617, 12570232), + array(-1063558, -11551823, 16920318, 12494842, 1278292, -5869109, -21159943, -3498680, -11974704, 4724943), + ), + array( + array(17960970, -11775534, -4140968, -9702530, -8876562, -1410617, -12907383, -8659932, -29576300, 1903856), + array(23134274, -14279132, -10681997, -1611936, 20684485, 15770816, -12989750, 3190296, 26955097, 14109738), + array(15308788, 5320727, -30113809, -14318877, 22902008, 7767164, 29425325, -11277562, 31960942, 11934971), + ), + array( + array(-27395711, 8435796, 4109644, 12222639, -24627868, 14818669, 20638173, 4875028, 10491392, 1379718), + array(-13159415, 9197841, 3875503, -8936108, -1383712, -5879801, 33518459, 16176658, 21432314, 12180697), + array(-11787308, 11500838, 13787581, -13832590, -22430679, 10140205, 1465425, 12689540, -10301319, -13872883), + ), + ), + array( + array( + array(5414091, -15386041, -21007664, 9643570, 12834970, 1186149, -2622916, -1342231, 26128231, 6032912), + array(-26337395, -13766162, 32496025, -13653919, 17847801, -12669156, 3604025, 8316894, -25875034, -10437358), + array(3296484, 6223048, 24680646, -12246460, -23052020, 5903205, -8862297, -4639164, 12376617, 3188849), + ), + array( + array(29190488, -14659046, 27549113, -1183516, 3520066, -10697301, 32049515, -7309113, -16109234, -9852307), + array(-14744486, -9309156, 735818, -598978, -20407687, -5057904, 25246078, -15795669, 18640741, -960977), + array(-6928835, -16430795, 10361374, 5642961, 4910474, 12345252, -31638386, -494430, 10530747, 1053335), + ), + array( + array(-29265967, -14186805, -13538216, -12117373, -19457059, -10655384, -31462369, -2948985, 24018831, 15026644), + array(-22592535, -3145277, -2289276, 5953843, -13440189, 9425631, 25310643, 13003497, -2314791, -15145616), + array(-27419985, -603321, -8043984, -1669117, -26092265, 13987819, -27297622, 187899, -23166419, -2531735), + ), + array( + array(-21744398, -13810475, 1844840, 5021428, -10434399, -15911473, 9716667, 16266922, -5070217, 726099), + array(29370922, -6053998, 7334071, -15342259, 9385287, 2247707, -13661962, -4839461, 30007388, -15823341), + array(-936379, 16086691, 23751945, -543318, -1167538, -5189036, 9137109, 730663, 9835848, 4555336), + ), + array( + array(-23376435, 1410446, -22253753, -12899614, 30867635, 15826977, 17693930, 544696, -11985298, 12422646), + array(31117226, -12215734, -13502838, 6561947, -9876867, -12757670, -5118685, -4096706, 29120153, 13924425), + array(-17400879, -14233209, 19675799, -2734756, -11006962, -5858820, -9383939, -11317700, 7240931, -237388), + ), + array( + array(-31361739, -11346780, -15007447, -5856218, -22453340, -12152771, 1222336, 4389483, 3293637, -15551743), + array(-16684801, -14444245, 11038544, 11054958, -13801175, -3338533, -24319580, 7733547, 12796905, -6335822), + array(-8759414, -10817836, -25418864, 10783769, -30615557, -9746811, -28253339, 3647836, 3222231, -11160462), + ), + array( + array(18606113, 1693100, -25448386, -15170272, 4112353, 10045021, 23603893, -2048234, -7550776, 2484985), + array(9255317, -3131197, -12156162, -1004256, 13098013, -9214866, 16377220, -2102812, -19802075, -3034702), + array(-22729289, 7496160, -5742199, 11329249, 19991973, -3347502, -31718148, 9936966, -30097688, -10618797), + ), + array( + array(21878590, -5001297, 4338336, 13643897, -3036865, 13160960, 19708896, 5415497, -7360503, -4109293), + array(27736861, 10103576, 12500508, 8502413, -3413016, -9633558, 10436918, -1550276, -23659143, -8132100), + array(19492550, -12104365, -29681976, -852630, -3208171, 12403437, 30066266, 8367329, 13243957, 8709688), + ), + ), + array( + array( + array(12015105, 2801261, 28198131, 10151021, 24818120, -4743133, -11194191, -5645734, 5150968, 7274186), + array(2831366, -12492146, 1478975, 6122054, 23825128, -12733586, 31097299, 6083058, 31021603, -9793610), + array(-2529932, -2229646, 445613, 10720828, -13849527, -11505937, -23507731, 16354465, 15067285, -14147707), + ), + array( + array(7840942, 14037873, -33364863, 15934016, -728213, -3642706, 21403988, 1057586, -19379462, -12403220), + array(915865, -16469274, 15608285, -8789130, -24357026, 6060030, -17371319, 8410997, -7220461, 16527025), + array(32922597, -556987, 20336074, -16184568, 10903705, -5384487, 16957574, 52992, 23834301, 6588044), + ), + array( + array(32752030, 11232950, 3381995, -8714866, 22652988, -10744103, 17159699, 16689107, -20314580, -1305992), + array(-4689649, 9166776, -25710296, -10847306, 11576752, 12733943, 7924251, -2752281, 1976123, -7249027), + array(21251222, 16309901, -2983015, -6783122, 30810597, 12967303, 156041, -3371252, 12331345, -8237197), + ), + array( + array(8651614, -4477032, -16085636, -4996994, 13002507, 2950805, 29054427, -5106970, 10008136, -4667901), + array(31486080, 15114593, -14261250, 12951354, 14369431, -7387845, 16347321, -13662089, 8684155, -10532952), + array(19443825, 11385320, 24468943, -9659068, -23919258, 2187569, -26263207, -6086921, 31316348, 14219878), + ), + array( + array(-28594490, 1193785, 32245219, 11392485, 31092169, 15722801, 27146014, 6992409, 29126555, 9207390), + array(32382935, 1110093, 18477781, 11028262, -27411763, -7548111, -4980517, 10843782, -7957600, -14435730), + array(2814918, 7836403, 27519878, -7868156, -20894015, -11553689, -21494559, 8550130, 28346258, 1994730), + ), + array( + array(-19578299, 8085545, -14000519, -3948622, 2785838, -16231307, -19516951, 7174894, 22628102, 8115180), + array(-30405132, 955511, -11133838, -15078069, -32447087, -13278079, -25651578, 3317160, -9943017, 930272), + array(-15303681, -6833769, 28856490, 1357446, 23421993, 1057177, 24091212, -1388970, -22765376, -10650715), + ), + array( + array(-22751231, -5303997, -12907607, -12768866, -15811511, -7797053, -14839018, -16554220, -1867018, 8398970), + array(-31969310, 2106403, -4736360, 1362501, 12813763, 16200670, 22981545, -6291273, 18009408, -15772772), + array(-17220923, -9545221, -27784654, 14166835, 29815394, 7444469, 29551787, -3727419, 19288549, 1325865), + ), + array( + array(15100157, -15835752, -23923978, -1005098, -26450192, 15509408, 12376730, -3479146, 33166107, -8042750), + array(20909231, 13023121, -9209752, 16251778, -5778415, -8094914, 12412151, 10018715, 2213263, -13878373), + array(32529814, -11074689, 30361439, -16689753, -9135940, 1513226, 22922121, 6382134, -5766928, 8371348), + ), + ), + array( + array( + array(9923462, 11271500, 12616794, 3544722, -29998368, -1721626, 12891687, -8193132, -26442943, 10486144), + array(-22597207, -7012665, 8587003, -8257861, 4084309, -12970062, 361726, 2610596, -23921530, -11455195), + array(5408411, -1136691, -4969122, 10561668, 24145918, 14240566, 31319731, -4235541, 19985175, -3436086), + ), + array( + array(-13994457, 16616821, 14549246, 3341099, 32155958, 13648976, -17577068, 8849297, 65030, 8370684), + array(-8320926, -12049626, 31204563, 5839400, -20627288, -1057277, -19442942, 6922164, 12743482, -9800518), + array(-2361371, 12678785, 28815050, 4759974, -23893047, 4884717, 23783145, 11038569, 18800704, 255233), + ), + array( + array(-5269658, -1773886, 13957886, 7990715, 23132995, 728773, 13393847, 9066957, 19258688, -14753793), + array(-2936654, -10827535, -10432089, 14516793, -3640786, 4372541, -31934921, 2209390, -1524053, 2055794), + array(580882, 16705327, 5468415, -2683018, -30926419, -14696000, -7203346, -8994389, -30021019, 7394435), + ), + array( + array(23838809, 1822728, -15738443, 15242727, 8318092, -3733104, -21672180, -3492205, -4821741, 14799921), + array(13345610, 9759151, 3371034, -16137791, 16353039, 8577942, 31129804, 13496856, -9056018, 7402518), + array(2286874, -4435931, -20042458, -2008336, -13696227, 5038122, 11006906, -15760352, 8205061, 1607563), + ), + array( + array(14414086, -8002132, 3331830, -3208217, 22249151, -5594188, 18364661, -2906958, 30019587, -9029278), + array(-27688051, 1585953, -10775053, 931069, -29120221, -11002319, -14410829, 12029093, 9944378, 8024), + array(4368715, -3709630, 29874200, -15022983, -20230386, -11410704, -16114594, -999085, -8142388, 5640030), + ), + array( + array(10299610, 13746483, 11661824, 16234854, 7630238, 5998374, 9809887, -16694564, 15219798, -14327783), + array(27425505, -5719081, 3055006, 10660664, 23458024, 595578, -15398605, -1173195, -18342183, 9742717), + array(6744077, 2427284, 26042789, 2720740, -847906, 1118974, 32324614, 7406442, 12420155, 1994844), + ), + array( + array(14012521, -5024720, -18384453, -9578469, -26485342, -3936439, -13033478, -10909803, 24319929, -6446333), + array(16412690, -4507367, 10772641, 15929391, -17068788, -4658621, 10555945, -10484049, -30102368, -4739048), + array(22397382, -7767684, -9293161, -12792868, 17166287, -9755136, -27333065, 6199366, 21880021, -12250760), + ), + array( + array(-4283307, 5368523, -31117018, 8163389, -30323063, 3209128, 16557151, 8890729, 8840445, 4957760), + array(-15447727, 709327, -6919446, -10870178, -29777922, 6522332, -21720181, 12130072, -14796503, 5005757), + array(-2114751, -14308128, 23019042, 15765735, -25269683, 6002752, 10183197, -13239326, -16395286, -2176112), + ), + ), + array( + array( + array(-19025756, 1632005, 13466291, -7995100, -23640451, 16573537, -32013908, -3057104, 22208662, 2000468), + array(3065073, -1412761, -25598674, -361432, -17683065, -5703415, -8164212, 11248527, -3691214, -7414184), + array(10379208, -6045554, 8877319, 1473647, -29291284, -12507580, 16690915, 2553332, -3132688, 16400289), + ), + array( + array(15716668, 1254266, -18472690, 7446274, -8448918, 6344164, -22097271, -7285580, 26894937, 9132066), + array(24158887, 12938817, 11085297, -8177598, -28063478, -4457083, -30576463, 64452, -6817084, -2692882), + array(13488534, 7794716, 22236231, 5989356, 25426474, -12578208, 2350710, -3418511, -4688006, 2364226), + ), + array( + array(16335052, 9132434, 25640582, 6678888, 1725628, 8517937, -11807024, -11697457, 15445875, -7798101), + array(29004207, -7867081, 28661402, -640412, -12794003, -7943086, 31863255, -4135540, -278050, -15759279), + array(-6122061, -14866665, -28614905, 14569919, -10857999, -3591829, 10343412, -6976290, -29828287, -10815811), + ), + array( + array(27081650, 3463984, 14099042, -4517604, 1616303, -6205604, 29542636, 15372179, 17293797, 960709), + array(20263915, 11434237, -5765435, 11236810, 13505955, -10857102, -16111345, 6493122, -19384511, 7639714), + array(-2830798, -14839232, 25403038, -8215196, -8317012, -16173699, 18006287, -16043750, 29994677, -15808121), + ), + array( + array(9769828, 5202651, -24157398, -13631392, -28051003, -11561624, -24613141, -13860782, -31184575, 709464), + array(12286395, 13076066, -21775189, -1176622, -25003198, 4057652, -32018128, -8890874, 16102007, 13205847), + array(13733362, 5599946, 10557076, 3195751, -5557991, 8536970, -25540170, 8525972, 10151379, 10394400), + ), + array( + array(4024660, -16137551, 22436262, 12276534, -9099015, -2686099, 19698229, 11743039, -33302334, 8934414), + array(-15879800, -4525240, -8580747, -2934061, 14634845, -698278, -9449077, 3137094, -11536886, 11721158), + array(17555939, -5013938, 8268606, 2331751, -22738815, 9761013, 9319229, 8835153, -9205489, -1280045), + ), + array( + array(-461409, -7830014, 20614118, 16688288, -7514766, -4807119, 22300304, 505429, 6108462, -6183415), + array(-5070281, 12367917, -30663534, 3234473, 32617080, -8422642, 29880583, -13483331, -26898490, -7867459), + array(-31975283, 5726539, 26934134, 10237677, -3173717, -605053, 24199304, 3795095, 7592688, -14992079), + ), + array( + array(21594432, -14964228, 17466408, -4077222, 32537084, 2739898, 6407723, 12018833, -28256052, 4298412), + array(-20650503, -11961496, -27236275, 570498, 3767144, -1717540, 13891942, -1569194, 13717174, 10805743), + array(-14676630, -15644296, 15287174, 11927123, 24177847, -8175568, -796431, 14860609, -26938930, -5863836), + ), + ), + array( + array( + array(12962541, 5311799, -10060768, 11658280, 18855286, -7954201, 13286263, -12808704, -4381056, 9882022), + array(18512079, 11319350, -20123124, 15090309, 18818594, 5271736, -22727904, 3666879, -23967430, -3299429), + array(-6789020, -3146043, 16192429, 13241070, 15898607, -14206114, -10084880, -6661110, -2403099, 5276065), + ), + array( + array(30169808, -5317648, 26306206, -11750859, 27814964, 7069267, 7152851, 3684982, 1449224, 13082861), + array(10342826, 3098505, 2119311, 193222, 25702612, 12233820, 23697382, 15056736, -21016438, -8202000), + array(-33150110, 3261608, 22745853, 7948688, 19370557, -15177665, -26171976, 6482814, -10300080, -11060101), + ), + array( + array(32869458, -5408545, 25609743, 15678670, -10687769, -15471071, 26112421, 2521008, -22664288, 6904815), + array(29506923, 4457497, 3377935, -9796444, -30510046, 12935080, 1561737, 3841096, -29003639, -6657642), + array(10340844, -6630377, -18656632, -2278430, 12621151, -13339055, 30878497, -11824370, -25584551, 5181966), + ), + array( + array(25940115, -12658025, 17324188, -10307374, -8671468, 15029094, 24396252, -16450922, -2322852, -12388574), + array(-21765684, 9916823, -1300409, 4079498, -1028346, 11909559, 1782390, 12641087, 20603771, -6561742), + array(-18882287, -11673380, 24849422, 11501709, 13161720, -4768874, 1925523, 11914390, 4662781, 7820689), + ), + array( + array(12241050, -425982, 8132691, 9393934, 32846760, -1599620, 29749456, 12172924, 16136752, 15264020), + array(-10349955, -14680563, -8211979, 2330220, -17662549, -14545780, 10658213, 6671822, 19012087, 3772772), + array(3753511, -3421066, 10617074, 2028709, 14841030, -6721664, 28718732, -15762884, 20527771, 12988982), + ), + array( + array(-14822485, -5797269, -3707987, 12689773, -898983, -10914866, -24183046, -10564943, 3299665, -12424953), + array(-16777703, -15253301, -9642417, 4978983, 3308785, 8755439, 6943197, 6461331, -25583147, 8991218), + array(-17226263, 1816362, -1673288, -6086439, 31783888, -8175991, -32948145, 7417950, -30242287, 1507265), + ), + array( + array(29692663, 6829891, -10498800, 4334896, 20945975, -11906496, -28887608, 8209391, 14606362, -10647073), + array(-3481570, 8707081, 32188102, 5672294, 22096700, 1711240, -33020695, 9761487, 4170404, -2085325), + array(-11587470, 14855945, -4127778, -1531857, -26649089, 15084046, 22186522, 16002000, -14276837, -8400798), + ), + array( + array(-4811456, 13761029, -31703877, -2483919, -3312471, 7869047, -7113572, -9620092, 13240845, 10965870), + array(-7742563, -8256762, -14768334, -13656260, -23232383, 12387166, 4498947, 14147411, 29514390, 4302863), + array(-13413405, -12407859, 20757302, -13801832, 14785143, 8976368, -5061276, -2144373, 17846988, -13971927), + ), + ), + array( + array( + array(-2244452, -754728, -4597030, -1066309, -6247172, 1455299, -21647728, -9214789, -5222701, 12650267), + array(-9906797, -16070310, 21134160, 12198166, -27064575, 708126, 387813, 13770293, -19134326, 10958663), + array(22470984, 12369526, 23446014, -5441109, -21520802, -9698723, -11772496, -11574455, -25083830, 4271862), + ), + array( + array(-25169565, -10053642, -19909332, 15361595, -5984358, 2159192, 75375, -4278529, -32526221, 8469673), + array(15854970, 4148314, -8893890, 7259002, 11666551, 13824734, -30531198, 2697372, 24154791, -9460943), + array(15446137, -15806644, 29759747, 14019369, 30811221, -9610191, -31582008, 12840104, 24913809, 9815020), + ), + array( + array(-4709286, -5614269, -31841498, -12288893, -14443537, 10799414, -9103676, 13438769, 18735128, 9466238), + array(11933045, 9281483, 5081055, -5183824, -2628162, -4905629, -7727821, -10896103, -22728655, 16199064), + array(14576810, 379472, -26786533, -8317236, -29426508, -10812974, -102766, 1876699, 30801119, 2164795), + ), + array( + array(15995086, 3199873, 13672555, 13712240, -19378835, -4647646, -13081610, -15496269, -13492807, 1268052), + array(-10290614, -3659039, -3286592, 10948818, 23037027, 3794475, -3470338, -12600221, -17055369, 3565904), + array(29210088, -9419337, -5919792, -4952785, 10834811, -13327726, -16512102, -10820713, -27162222, -14030531), + ), + array( + array(-13161890, 15508588, 16663704, -8156150, -28349942, 9019123, -29183421, -3769423, 2244111, -14001979), + array(-5152875, -3800936, -9306475, -6071583, 16243069, 14684434, -25673088, -16180800, 13491506, 4641841), + array(10813417, 643330, -19188515, -728916, 30292062, -16600078, 27548447, -7721242, 14476989, -12767431), + ), + array( + array(10292079, 9984945, 6481436, 8279905, -7251514, 7032743, 27282937, -1644259, -27912810, 12651324), + array(-31185513, -813383, 22271204, 11835308, 10201545, 15351028, 17099662, 3988035, 21721536, -3148940), + array(10202177, -6545839, -31373232, -9574638, -32150642, -8119683, -12906320, 3852694, 13216206, 14842320), + ), + array( + array(-15815640, -10601066, -6538952, -7258995, -6984659, -6581778, -31500847, 13765824, -27434397, 9900184), + array(14465505, -13833331, -32133984, -14738873, -27443187, 12990492, 33046193, 15796406, -7051866, -8040114), + array(30924417, -8279620, 6359016, -12816335, 16508377, 9071735, -25488601, 15413635, 9524356, -7018878), + ), + array( + array(12274201, -13175547, 32627641, -1785326, 6736625, 13267305, 5237659, -5109483, 15663516, 4035784), + array(-2951309, 8903985, 17349946, 601635, -16432815, -4612556, -13732739, -15889334, -22258478, 4659091), + array(-16916263, -4952973, -30393711, -15158821, 20774812, 15897498, 5736189, 15026997, -2178256, -13455585), + ), + ), + array( + array( + array(-8858980, -2219056, 28571666, -10155518, -474467, -10105698, -3801496, 278095, 23440562, -290208), + array(10226241, -5928702, 15139956, 120818, -14867693, 5218603, 32937275, 11551483, -16571960, -7442864), + array(17932739, -12437276, -24039557, 10749060, 11316803, 7535897, 22503767, 5561594, -3646624, 3898661), + ), + array( + array(7749907, -969567, -16339731, -16464, -25018111, 15122143, -1573531, 7152530, 21831162, 1245233), + array(26958459, -14658026, 4314586, 8346991, -5677764, 11960072, -32589295, -620035, -30402091, -16716212), + array(-12165896, 9166947, 33491384, 13673479, 29787085, 13096535, 6280834, 14587357, -22338025, 13987525), + ), + array( + array(-24349909, 7778775, 21116000, 15572597, -4833266, -5357778, -4300898, -5124639, -7469781, -2858068), + array(9681908, -6737123, -31951644, 13591838, -6883821, 386950, 31622781, 6439245, -14581012, 4091397), + array(-8426427, 1470727, -28109679, -1596990, 3978627, -5123623, -19622683, 12092163, 29077877, -14741988), + ), + array( + array(5269168, -6859726, -13230211, -8020715, 25932563, 1763552, -5606110, -5505881, -20017847, 2357889), + array(32264008, -15407652, -5387735, -1160093, -2091322, -3946900, 23104804, -12869908, 5727338, 189038), + array(14609123, -8954470, -6000566, -16622781, -14577387, -7743898, -26745169, 10942115, -25888931, -14884697), + ), + array( + array(20513500, 5557931, -15604613, 7829531, 26413943, -2019404, -21378968, 7471781, 13913677, -5137875), + array(-25574376, 11967826, 29233242, 12948236, -6754465, 4713227, -8940970, 14059180, 12878652, 8511905), + array(-25656801, 3393631, -2955415, -7075526, -2250709, 9366908, -30223418, 6812974, 5568676, -3127656), + ), + array( + array(11630004, 12144454, 2116339, 13606037, 27378885, 15676917, -17408753, -13504373, -14395196, 8070818), + array(27117696, -10007378, -31282771, -5570088, 1127282, 12772488, -29845906, 10483306, -11552749, -1028714), + array(10637467, -5688064, 5674781, 1072708, -26343588, -6982302, -1683975, 9177853, -27493162, 15431203), + ), + array( + array(20525145, 10892566, -12742472, 12779443, -29493034, 16150075, -28240519, 14943142, -15056790, -7935931), + array(-30024462, 5626926, -551567, -9981087, 753598, 11981191, 25244767, -3239766, -3356550, 9594024), + array(-23752644, 2636870, -5163910, -10103818, 585134, 7877383, 11345683, -6492290, 13352335, -10977084), + ), + array( + array(-1931799, -5407458, 3304649, -12884869, 17015806, -4877091, -29783850, -7752482, -13215537, -319204), + array(20239939, 6607058, 6203985, 3483793, -18386976, -779229, -20723742, 15077870, -22750759, 14523817), + array(27406042, -6041657, 27423596, -4497394, 4996214, 10002360, -28842031, -4545494, -30172742, -4805667), + ), + ), + array( + array( + array(11374242, 12660715, 17861383, -12540833, 10935568, 1099227, -13886076, -9091740, -27727044, 11358504), + array(-12730809, 10311867, 1510375, 10778093, -2119455, -9145702, 32676003, 11149336, -26123651, 4985768), + array(-19096303, 341147, -6197485, -239033, 15756973, -8796662, -983043, 13794114, -19414307, -15621255), + ), + array( + array(6490081, 11940286, 25495923, -7726360, 8668373, -8751316, 3367603, 6970005, -1691065, -9004790), + array(1656497, 13457317, 15370807, 6364910, 13605745, 8362338, -19174622, -5475723, -16796596, -5031438), + array(-22273315, -13524424, -64685, -4334223, -18605636, -10921968, -20571065, -7007978, -99853, -10237333), + ), + array( + array(17747465, 10039260, 19368299, -4050591, -20630635, -16041286, 31992683, -15857976, -29260363, -5511971), + array(31932027, -4986141, -19612382, 16366580, 22023614, 88450, 11371999, -3744247, 4882242, -10626905), + array(29796507, 37186, 19818052, 10115756, -11829032, 3352736, 18551198, 3272828, -5190932, -4162409), + ), + array( + array(12501286, 4044383, -8612957, -13392385, -32430052, 5136599, -19230378, -3529697, 330070, -3659409), + array(6384877, 2899513, 17807477, 7663917, -2358888, 12363165, 25366522, -8573892, -271295, 12071499), + array(-8365515, -4042521, 25133448, -4517355, -6211027, 2265927, -32769618, 1936675, -5159697, 3829363), + ), + array( + array(28425966, -5835433, -577090, -4697198, -14217555, 6870930, 7921550, -6567787, 26333140, 14267664), + array(-11067219, 11871231, 27385719, -10559544, -4585914, -11189312, 10004786, -8709488, -21761224, 8930324), + array(-21197785, -16396035, 25654216, -1725397, 12282012, 11008919, 1541940, 4757911, -26491501, -16408940), + ), + array( + array(13537262, -7759490, -20604840, 10961927, -5922820, -13218065, -13156584, 6217254, -15943699, 13814990), + array(-17422573, 15157790, 18705543, 29619, 24409717, -260476, 27361681, 9257833, -1956526, -1776914), + array(-25045300, -10191966, 15366585, 15166509, -13105086, 8423556, -29171540, 12361135, -18685978, 4578290), + ), + array( + array(24579768, 3711570, 1342322, -11180126, -27005135, 14124956, -22544529, 14074919, 21964432, 8235257), + array(-6528613, -2411497, 9442966, -5925588, 12025640, -1487420, -2981514, -1669206, 13006806, 2355433), + array(-16304899, -13605259, -6632427, -5142349, 16974359, -10911083, 27202044, 1719366, 1141648, -12796236), + ), + array( + array(-12863944, -13219986, -8318266, -11018091, -6810145, -4843894, 13475066, -3133972, 32674895, 13715045), + array(11423335, -5468059, 32344216, 8962751, 24989809, 9241752, -13265253, 16086212, -28740881, -15642093), + array(-1409668, 12530728, -6368726, 10847387, 19531186, -14132160, -11709148, 7791794, -27245943, 4383347), + ), + ), + array( + array( + array(-28970898, 5271447, -1266009, -9736989, -12455236, 16732599, -4862407, -4906449, 27193557, 6245191), + array(-15193956, 5362278, -1783893, 2695834, 4960227, 12840725, 23061898, 3260492, 22510453, 8577507), + array(-12632451, 11257346, -32692994, 13548177, -721004, 10879011, 31168030, 13952092, -29571492, -3635906), + ), + array( + array(3877321, -9572739, 32416692, 5405324, -11004407, -13656635, 3759769, 11935320, 5611860, 8164018), + array(-16275802, 14667797, 15906460, 12155291, -22111149, -9039718, 32003002, -8832289, 5773085, -8422109), + array(-23788118, -8254300, 1950875, 8937633, 18686727, 16459170, -905725, 12376320, 31632953, 190926), + ), + array( + array(-24593607, -16138885, -8423991, 13378746, 14162407, 6901328, -8288749, 4508564, -25341555, -3627528), + array(8884438, -5884009, 6023974, 10104341, -6881569, -4941533, 18722941, -14786005, -1672488, 827625), + array(-32720583, -16289296, -32503547, 7101210, 13354605, 2659080, -1800575, -14108036, -24878478, 1541286), + ), + array( + array(2901347, -1117687, 3880376, -10059388, -17620940, -3612781, -21802117, -3567481, 20456845, -1885033), + array(27019610, 12299467, -13658288, -1603234, -12861660, -4861471, -19540150, -5016058, 29439641, 15138866), + array(21536104, -6626420, -32447818, -10690208, -22408077, 5175814, -5420040, -16361163, 7779328, 109896), + ), + array( + array(30279744, 14648750, -8044871, 6425558, 13639621, -743509, 28698390, 12180118, 23177719, -554075), + array(26572847, 3405927, -31701700, 12890905, -19265668, 5335866, -6493768, 2378492, 4439158, -13279347), + array(-22716706, 3489070, -9225266, -332753, 18875722, -1140095, 14819434, -12731527, -17717757, -5461437), + ), + array( + array(-5056483, 16566551, 15953661, 3767752, -10436499, 15627060, -820954, 2177225, 8550082, -15114165), + array(-18473302, 16596775, -381660, 15663611, 22860960, 15585581, -27844109, -3582739, -23260460, -8428588), + array(-32480551, 15707275, -8205912, -5652081, 29464558, 2713815, -22725137, 15860482, -21902570, 1494193), + ), + array( + array(-19562091, -14087393, -25583872, -9299552, 13127842, 759709, 21923482, 16529112, 8742704, 12967017), + array(-28464899, 1553205, 32536856, -10473729, -24691605, -406174, -8914625, -2933896, -29903758, 15553883), + array(21877909, 3230008, 9881174, 10539357, -4797115, 2841332, 11543572, 14513274, 19375923, -12647961), + ), + array( + array(8832269, -14495485, 13253511, 5137575, 5037871, 4078777, 24880818, -6222716, 2862653, 9455043), + array(29306751, 5123106, 20245049, -14149889, 9592566, 8447059, -2077124, -2990080, 15511449, 4789663), + array(-20679756, 7004547, 8824831, -9434977, -4045704, -3750736, -5754762, 108893, 23513200, 16652362), + ), + ), + array( + array( + array(-33256173, 4144782, -4476029, -6579123, 10770039, -7155542, -6650416, -12936300, -18319198, 10212860), + array(2756081, 8598110, 7383731, -6859892, 22312759, -1105012, 21179801, 2600940, -9988298, -12506466), + array(-24645692, 13317462, -30449259, -15653928, 21365574, -10869657, 11344424, 864440, -2499677, -16710063), + ), + array( + array(-26432803, 6148329, -17184412, -14474154, 18782929, -275997, -22561534, 211300, 2719757, 4940997), + array(-1323882, 3911313, -6948744, 14759765, -30027150, 7851207, 21690126, 8518463, 26699843, 5276295), + array(-13149873, -6429067, 9396249, 365013, 24703301, -10488939, 1321586, 149635, -15452774, 7159369), + ), + array( + array(9987780, -3404759, 17507962, 9505530, 9731535, -2165514, 22356009, 8312176, 22477218, -8403385), + array(18155857, -16504990, 19744716, 9006923, 15154154, -10538976, 24256460, -4864995, -22548173, 9334109), + array(2986088, -4911893, 10776628, -3473844, 10620590, -7083203, -21413845, 14253545, -22587149, 536906), + ), + array( + array(4377756, 8115836, 24567078, 15495314, 11625074, 13064599, 7390551, 10589625, 10838060, -15420424), + array(-19342404, 867880, 9277171, -3218459, -14431572, -1986443, 19295826, -15796950, 6378260, 699185), + array(7895026, 4057113, -7081772, -13077756, -17886831, -323126, -716039, 15693155, -5045064, -13373962), + ), + array( + array(-7737563, -5869402, -14566319, -7406919, 11385654, 13201616, 31730678, -10962840, -3918636, -9669325), + array(10188286, -15770834, -7336361, 13427543, 22223443, 14896287, 30743455, 7116568, -21786507, 5427593), + array(696102, 13206899, 27047647, -10632082, 15285305, -9853179, 10798490, -4578720, 19236243, 12477404), + ), + array( + array(-11229439, 11243796, -17054270, -8040865, -788228, -8167967, -3897669, 11180504, -23169516, 7733644), + array(17800790, -14036179, -27000429, -11766671, 23887827, 3149671, 23466177, -10538171, 10322027, 15313801), + array(26246234, 11968874, 32263343, -5468728, 6830755, -13323031, -15794704, -101982, -24449242, 10890804), + ), + array( + array(-31365647, 10271363, -12660625, -6267268, 16690207, -13062544, -14982212, 16484931, 25180797, -5334884), + array(-586574, 10376444, -32586414, -11286356, 19801893, 10997610, 2276632, 9482883, 316878, 13820577), + array(-9882808, -4510367, -2115506, 16457136, -11100081, 11674996, 30756178, -7515054, 30696930, -3712849), + ), + array( + array(32988917, -9603412, 12499366, 7910787, -10617257, -11931514, -7342816, -9985397, -32349517, 7392473), + array(-8855661, 15927861, 9866406, -3649411, -2396914, -16655781, -30409476, -9134995, 25112947, -2926644), + array(-2504044, -436966, 25621774, -5678772, 15085042, -5479877, -24884878, -13526194, 5537438, -13914319), + ), + ), + array( + array( + array(-11225584, 2320285, -9584280, 10149187, -33444663, 5808648, -14876251, -1729667, 31234590, 6090599), + array(-9633316, 116426, 26083934, 2897444, -6364437, -2688086, 609721, 15878753, -6970405, -9034768), + array(-27757857, 247744, -15194774, -9002551, 23288161, -10011936, -23869595, 6503646, 20650474, 1804084), + ), + array( + array(-27589786, 15456424, 8972517, 8469608, 15640622, 4439847, 3121995, -10329713, 27842616, -202328), + array(-15306973, 2839644, 22530074, 10026331, 4602058, 5048462, 28248656, 5031932, -11375082, 12714369), + array(20807691, -7270825, 29286141, 11421711, -27876523, -13868230, -21227475, 1035546, -19733229, 12796920), + ), + array( + array(12076899, -14301286, -8785001, -11848922, -25012791, 16400684, -17591495, -12899438, 3480665, -15182815), + array(-32361549, 5457597, 28548107, 7833186, 7303070, -11953545, -24363064, -15921875, -33374054, 2771025), + array(-21389266, 421932, 26597266, 6860826, 22486084, -6737172, -17137485, -4210226, -24552282, 15673397), + ), + array( + array(-20184622, 2338216, 19788685, -9620956, -4001265, -8740893, -20271184, 4733254, 3727144, -12934448), + array(6120119, 814863, -11794402, -622716, 6812205, -15747771, 2019594, 7975683, 31123697, -10958981), + array(30069250, -11435332, 30434654, 2958439, 18399564, -976289, 12296869, 9204260, -16432438, 9648165), + ), + array( + array(32705432, -1550977, 30705658, 7451065, -11805606, 9631813, 3305266, 5248604, -26008332, -11377501), + array(17219865, 2375039, -31570947, -5575615, -19459679, 9219903, 294711, 15298639, 2662509, -16297073), + array(-1172927, -7558695, -4366770, -4287744, -21346413, -8434326, 32087529, -1222777, 32247248, -14389861), + ), + array( + array(14312628, 1221556, 17395390, -8700143, -4945741, -8684635, -28197744, -9637817, -16027623, -13378845), + array(-1428825, -9678990, -9235681, 6549687, -7383069, -468664, 23046502, 9803137, 17597934, 2346211), + array(18510800, 15337574, 26171504, 981392, -22241552, 7827556, -23491134, -11323352, 3059833, -11782870), + ), + array( + array(10141598, 6082907, 17829293, -1947643, 9830092, 13613136, -25556636, -5544586, -33502212, 3592096), + array(33114168, -15889352, -26525686, -13343397, 33076705, 8716171, 1151462, 1521897, -982665, -6837803), + array(-32939165, -4255815, 23947181, -324178, -33072974, -12305637, -16637686, 3891704, 26353178, 693168), + ), + array( + array(30374239, 1595580, -16884039, 13186931, 4600344, 406904, 9585294, -400668, 31375464, 14369965), + array(-14370654, -7772529, 1510301, 6434173, -18784789, -6262728, 32732230, -13108839, 17901441, 16011505), + array(18171223, -11934626, -12500402, 15197122, -11038147, -15230035, -19172240, -16046376, 8764035, 12309598), + ), + ), + array( + array( + array(5975908, -5243188, -19459362, -9681747, -11541277, 14015782, -23665757, 1228319, 17544096, -10593782), + array(5811932, -1715293, 3442887, -2269310, -18367348, -8359541, -18044043, -15410127, -5565381, 12348900), + array(-31399660, 11407555, 25755363, 6891399, -3256938, 14872274, -24849353, 8141295, -10632534, -585479), + ), + array( + array(-12675304, 694026, -5076145, 13300344, 14015258, -14451394, -9698672, -11329050, 30944593, 1130208), + array(8247766, -6710942, -26562381, -7709309, -14401939, -14648910, 4652152, 2488540, 23550156, -271232), + array(17294316, -3788438, 7026748, 15626851, 22990044, 113481, 2267737, -5908146, -408818, -137719), + ), + array( + array(16091085, -16253926, 18599252, 7340678, 2137637, -1221657, -3364161, 14550936, 3260525, -7166271), + array(-4910104, -13332887, 18550887, 10864893, -16459325, -7291596, -23028869, -13204905, -12748722, 2701326), + array(-8574695, 16099415, 4629974, -16340524, -20786213, -6005432, -10018363, 9276971, 11329923, 1862132), + ), + array( + array(14763076, -15903608, -30918270, 3689867, 3511892, 10313526, -21951088, 12219231, -9037963, -940300), + array(8894987, -3446094, 6150753, 3013931, 301220, 15693451, -31981216, -2909717, -15438168, 11595570), + array(15214962, 3537601, -26238722, -14058872, 4418657, -15230761, 13947276, 10730794, -13489462, -4363670), + ), + array( + array(-2538306, 7682793, 32759013, 263109, -29984731, -7955452, -22332124, -10188635, 977108, 699994), + array(-12466472, 4195084, -9211532, 550904, -15565337, 12917920, 19118110, -439841, -30534533, -14337913), + array(31788461, -14507657, 4799989, 7372237, 8808585, -14747943, 9408237, -10051775, 12493932, -5409317), + ), + array( + array(-25680606, 5260744, -19235809, -6284470, -3695942, 16566087, 27218280, 2607121, 29375955, 6024730), + array(842132, -2794693, -4763381, -8722815, 26332018, -12405641, 11831880, 6985184, -9940361, 2854096), + array(-4847262, -7969331, 2516242, -5847713, 9695691, -7221186, 16512645, 960770, 12121869, 16648078), + ), + array( + array(-15218652, 14667096, -13336229, 2013717, 30598287, -464137, -31504922, -7882064, 20237806, 2838411), + array(-19288047, 4453152, 15298546, -16178388, 22115043, -15972604, 12544294, -13470457, 1068881, -12499905), + array(-9558883, -16518835, 33238498, 13506958, 30505848, -1114596, -8486907, -2630053, 12521378, 4845654), + ), + array( + array(-28198521, 10744108, -2958380, 10199664, 7759311, -13088600, 3409348, -873400, -6482306, -12885870), + array(-23561822, 6230156, -20382013, 10655314, -24040585, -11621172, 10477734, -1240216, -3113227, 13974498), + array(12966261, 15550616, -32038948, -1615346, 21025980, -629444, 5642325, 7188737, 18895762, 12629579), + ), + ), + array( + array( + array(14741879, -14946887, 22177208, -11721237, 1279741, 8058600, 11758140, 789443, 32195181, 3895677), + array(10758205, 15755439, -4509950, 9243698, -4879422, 6879879, -2204575, -3566119, -8982069, 4429647), + array(-2453894, 15725973, -20436342, -10410672, -5803908, -11040220, -7135870, -11642895, 18047436, -15281743), + ), + array( + array(-25173001, -11307165, 29759956, 11776784, -22262383, -15820455, 10993114, -12850837, -17620701, -9408468), + array(21987233, 700364, -24505048, 14972008, -7774265, -5718395, 32155026, 2581431, -29958985, 8773375), + array(-25568350, 454463, -13211935, 16126715, 25240068, 8594567, 20656846, 12017935, -7874389, -13920155), + ), + array( + array(6028182, 6263078, -31011806, -11301710, -818919, 2461772, -31841174, -5468042, -1721788, -2776725), + array(-12278994, 16624277, 987579, -5922598, 32908203, 1248608, 7719845, -4166698, 28408820, 6816612), + array(-10358094, -8237829, 19549651, -12169222, 22082623, 16147817, 20613181, 13982702, -10339570, 5067943), + ), + array( + array(-30505967, -3821767, 12074681, 13582412, -19877972, 2443951, -19719286, 12746132, 5331210, -10105944), + array(30528811, 3601899, -1957090, 4619785, -27361822, -15436388, 24180793, -12570394, 27679908, -1648928), + array(9402404, -13957065, 32834043, 10838634, -26580150, -13237195, 26653274, -8685565, 22611444, -12715406), + ), + array( + array(22190590, 1118029, 22736441, 15130463, -30460692, -5991321, 19189625, -4648942, 4854859, 6622139), + array(-8310738, -2953450, -8262579, -3388049, -10401731, -271929, 13424426, -3567227, 26404409, 13001963), + array(-31241838, -15415700, -2994250, 8939346, 11562230, -12840670, -26064365, -11621720, -15405155, 11020693), + ), + array( + array(1866042, -7949489, -7898649, -10301010, 12483315, 13477547, 3175636, -12424163, 28761762, 1406734), + array(-448555, -1777666, 13018551, 3194501, -9580420, -11161737, 24760585, -4347088, 25577411, -13378680), + array(-24290378, 4759345, -690653, -1852816, 2066747, 10693769, -29595790, 9884936, -9368926, 4745410), + ), + array( + array(-9141284, 6049714, -19531061, -4341411, -31260798, 9944276, -15462008, -11311852, 10931924, -11931931), + array(-16561513, 14112680, -8012645, 4817318, -8040464, -11414606, -22853429, 10856641, -20470770, 13434654), + array(22759489, -10073434, -16766264, -1871422, 13637442, -10168091, 1765144, -12654326, 28445307, -5364710), + ), + array( + array(29875063, 12493613, 2795536, -3786330, 1710620, 15181182, -10195717, -8788675, 9074234, 1167180), + array(-26205683, 11014233, -9842651, -2635485, -26908120, 7532294, -18716888, -9535498, 3843903, 9367684), + array(-10969595, -6403711, 9591134, 9582310, 11349256, 108879, 16235123, 8601684, -139197, 4242895), + ), + ), + array( + array( + array(22092954, -13191123, -2042793, -11968512, 32186753, -11517388, -6574341, 2470660, -27417366, 16625501), + array(-11057722, 3042016, 13770083, -9257922, 584236, -544855, -7770857, 2602725, -27351616, 14247413), + array(6314175, -10264892, -32772502, 15957557, -10157730, 168750, -8618807, 14290061, 27108877, -1180880), + ), + array( + array(-8586597, -7170966, 13241782, 10960156, -32991015, -13794596, 33547976, -11058889, -27148451, 981874), + array(22833440, 9293594, -32649448, -13618667, -9136966, 14756819, -22928859, -13970780, -10479804, -16197962), + array(-7768587, 3326786, -28111797, 10783824, 19178761, 14905060, 22680049, 13906969, -15933690, 3797899), + ), + array( + array(21721356, -4212746, -12206123, 9310182, -3882239, -13653110, 23740224, -2709232, 20491983, -8042152), + array(9209270, -15135055, -13256557, -6167798, -731016, 15289673, 25947805, 15286587, 30997318, -6703063), + array(7392032, 16618386, 23946583, -8039892, -13265164, -1533858, -14197445, -2321576, 17649998, -250080), + ), + array( + array(-9301088, -14193827, 30609526, -3049543, -25175069, -1283752, -15241566, -9525724, -2233253, 7662146), + array(-17558673, 1763594, -33114336, 15908610, -30040870, -12174295, 7335080, -8472199, -3174674, 3440183), + array(-19889700, -5977008, -24111293, -9688870, 10799743, -16571957, 40450, -4431835, 4862400, 1133), + ), + array( + array(-32856209, -7873957, -5422389, 14860950, -16319031, 7956142, 7258061, 311861, -30594991, -7379421), + array(-3773428, -1565936, 28985340, 7499440, 24445838, 9325937, 29727763, 16527196, 18278453, 15405622), + array(-4381906, 8508652, -19898366, -3674424, -5984453, 15149970, -13313598, 843523, -21875062, 13626197), + ), + array( + array(2281448, -13487055, -10915418, -2609910, 1879358, 16164207, -10783882, 3953792, 13340839, 15928663), + array(31727126, -7179855, -18437503, -8283652, 2875793, -16390330, -25269894, -7014826, -23452306, 5964753), + array(4100420, -5959452, -17179337, 6017714, -18705837, 12227141, -26684835, 11344144, 2538215, -7570755), + ), + array( + array(-9433605, 6123113, 11159803, -2156608, 30016280, 14966241, -20474983, 1485421, -629256, -15958862), + array(-26804558, 4260919, 11851389, 9658551, -32017107, 16367492, -20205425, -13191288, 11659922, -11115118), + array(26180396, 10015009, -30844224, -8581293, 5418197, 9480663, 2231568, -10170080, 33100372, -1306171), + ), + array( + array(15121113, -5201871, -10389905, 15427821, -27509937, -15992507, 21670947, 4486675, -5931810, -14466380), + array(16166486, -9483733, -11104130, 6023908, -31926798, -1364923, 2340060, -16254968, -10735770, -10039824), + array(28042865, -3557089, -12126526, 12259706, -3717498, -6945899, 6766453, -8689599, 18036436, 5803270), + ), + ), + array( + array( + array(-817581, 6763912, 11803561, 1585585, 10958447, -2671165, 23855391, 4598332, -6159431, -14117438), + array(-31031306, -14256194, 17332029, -2383520, 31312682, -5967183, 696309, 50292, -20095739, 11763584), + array(-594563, -2514283, -32234153, 12643980, 12650761, 14811489, 665117, -12613632, -19773211, -10713562), + ), + array( + array(30464590, -11262872, -4127476, -12734478, 19835327, -7105613, -24396175, 2075773, -17020157, 992471), + array(18357185, -6994433, 7766382, 16342475, -29324918, 411174, 14578841, 8080033, -11574335, -10601610), + array(19598397, 10334610, 12555054, 2555664, 18821899, -10339780, 21873263, 16014234, 26224780, 16452269), + ), + array( + array(-30223925, 5145196, 5944548, 16385966, 3976735, 2009897, -11377804, -7618186, -20533829, 3698650), + array(14187449, 3448569, -10636236, -10810935, -22663880, -3433596, 7268410, -10890444, 27394301, 12015369), + array(19695761, 16087646, 28032085, 12999827, 6817792, 11427614, 20244189, -1312777, -13259127, -3402461), + ), + array( + array(30860103, 12735208, -1888245, -4699734, -16974906, 2256940, -8166013, 12298312, -8550524, -10393462), + array(-5719826, -11245325, -1910649, 15569035, 26642876, -7587760, -5789354, -15118654, -4976164, 12651793), + array(-2848395, 9953421, 11531313, -5282879, 26895123, -12697089, -13118820, -16517902, 9768698, -2533218), + ), + array( + array(-24719459, 1894651, -287698, -4704085, 15348719, -8156530, 32767513, 12765450, 4940095, 10678226), + array(18860224, 15980149, -18987240, -1562570, -26233012, -11071856, -7843882, 13944024, -24372348, 16582019), + array(-15504260, 4970268, -29893044, 4175593, -20993212, -2199756, -11704054, 15444560, -11003761, 7989037), + ), + array( + array(31490452, 5568061, -2412803, 2182383, -32336847, 4531686, -32078269, 6200206, -19686113, -14800171), + array(-17308668, -15879940, -31522777, -2831, -32887382, 16375549, 8680158, -16371713, 28550068, -6857132), + array(-28126887, -5688091, 16837845, -1820458, -6850681, 12700016, -30039981, 4364038, 1155602, 5988841), + ), + array( + array(21890435, -13272907, -12624011, 12154349, -7831873, 15300496, 23148983, -4470481, 24618407, 8283181), + array(-33136107, -10512751, 9975416, 6841041, -31559793, 16356536, 3070187, -7025928, 1466169, 10740210), + array(-1509399, -15488185, -13503385, -10655916, 32799044, 909394, -13938903, -5779719, -32164649, -15327040), + ), + array( + array(3960823, -14267803, -28026090, -15918051, -19404858, 13146868, 15567327, 951507, -3260321, -573935), + array(24740841, 5052253, -30094131, 8961361, 25877428, 6165135, -24368180, 14397372, -7380369, -6144105), + array(-28888365, 3510803, -28103278, -1158478, -11238128, -10631454, -15441463, -14453128, -1625486, -6494814), + ), + ), + array( + array( + array(793299, -9230478, 8836302, -6235707, -27360908, -2369593, 33152843, -4885251, -9906200, -621852), + array(5666233, 525582, 20782575, -8038419, -24538499, 14657740, 16099374, 1468826, -6171428, -15186581), + array(-4859255, -3779343, -2917758, -6748019, 7778750, 11688288, -30404353, -9871238, -1558923, -9863646), + ), + array( + array(10896332, -7719704, 824275, 472601, -19460308, 3009587, 25248958, 14783338, -30581476, -15757844), + array(10566929, 12612572, -31944212, 11118703, -12633376, 12362879, 21752402, 8822496, 24003793, 14264025), + array(27713862, -7355973, -11008240, 9227530, 27050101, 2504721, 23886875, -13117525, 13958495, -5732453), + ), + array( + array(-23481610, 4867226, -27247128, 3900521, 29838369, -8212291, -31889399, -10041781, 7340521, -15410068), + array(4646514, -8011124, -22766023, -11532654, 23184553, 8566613, 31366726, -1381061, -15066784, -10375192), + array(-17270517, 12723032, -16993061, 14878794, 21619651, -6197576, 27584817, 3093888, -8843694, 3849921), + ), + array( + array(-9064912, 2103172, 25561640, -15125738, -5239824, 9582958, 32477045, -9017955, 5002294, -15550259), + array(-12057553, -11177906, 21115585, -13365155, 8808712, -12030708, 16489530, 13378448, -25845716, 12741426), + array(-5946367, 10645103, -30911586, 15390284, -3286982, -7118677, 24306472, 15852464, 28834118, -7646072), + ), + array( + array(-17335748, -9107057, -24531279, 9434953, -8472084, -583362, -13090771, 455841, 20461858, 5491305), + array(13669248, -16095482, -12481974, -10203039, -14569770, -11893198, -24995986, 11293807, -28588204, -9421832), + array(28497928, 6272777, -33022994, 14470570, 8906179, -1225630, 18504674, -14165166, 29867745, -8795943), + ), + array( + array(-16207023, 13517196, -27799630, -13697798, 24009064, -6373891, -6367600, -13175392, 22853429, -4012011), + array(24191378, 16712145, -13931797, 15217831, 14542237, 1646131, 18603514, -11037887, 12876623, -2112447), + array(17902668, 4518229, -411702, -2829247, 26878217, 5258055, -12860753, 608397, 16031844, 3723494), + ), + array( + array(-28632773, 12763728, -20446446, 7577504, 33001348, -13017745, 17558842, -7872890, 23896954, -4314245), + array(-20005381, -12011952, 31520464, 605201, 2543521, 5991821, -2945064, 7229064, -9919646, -8826859), + array(28816045, 298879, -28165016, -15920938, 19000928, -1665890, -12680833, -2949325, -18051778, -2082915), + ), + array( + array(16000882, -344896, 3493092, -11447198, -29504595, -13159789, 12577740, 16041268, -19715240, 7847707), + array(10151868, 10572098, 27312476, 7922682, 14825339, 4723128, -32855931, -6519018, -10020567, 3852848), + array(-11430470, 15697596, -21121557, -4420647, 5386314, 15063598, 16514493, -15932110, 29330899, -15076224), + ), + ), + array( + array( + array(-25499735, -4378794, -15222908, -6901211, 16615731, 2051784, 3303702, 15490, -27548796, 12314391), + array(15683520, -6003043, 18109120, -9980648, 15337968, -5997823, -16717435, 15921866, 16103996, -3731215), + array(-23169824, -10781249, 13588192, -1628807, -3798557, -1074929, -19273607, 5402699, -29815713, -9841101), + ), + array( + array(23190676, 2384583, -32714340, 3462154, -29903655, -1529132, -11266856, 8911517, -25205859, 2739713), + array(21374101, -3554250, -33524649, 9874411, 15377179, 11831242, -33529904, 6134907, 4931255, 11987849), + array(-7732, -2978858, -16223486, 7277597, 105524, -322051, -31480539, 13861388, -30076310, 10117930), + ), + array( + array(-29501170, -10744872, -26163768, 13051539, -25625564, 5089643, -6325503, 6704079, 12890019, 15728940), + array(-21972360, -11771379, -951059, -4418840, 14704840, 2695116, 903376, -10428139, 12885167, 8311031), + array(-17516482, 5352194, 10384213, -13811658, 7506451, 13453191, 26423267, 4384730, 1888765, -5435404), + ), + array( + array(-25817338, -3107312, -13494599, -3182506, 30896459, -13921729, -32251644, -12707869, -19464434, -3340243), + array(-23607977, -2665774, -526091, 4651136, 5765089, 4618330, 6092245, 14845197, 17151279, -9854116), + array(-24830458, -12733720, -15165978, 10367250, -29530908, -265356, 22825805, -7087279, -16866484, 16176525), + ), + array( + array(-23583256, 6564961, 20063689, 3798228, -4740178, 7359225, 2006182, -10363426, -28746253, -10197509), + array(-10626600, -4486402, -13320562, -5125317, 3432136, -6393229, 23632037, -1940610, 32808310, 1099883), + array(15030977, 5768825, -27451236, -2887299, -6427378, -15361371, -15277896, -6809350, 2051441, -15225865), + ), + array( + array(-3362323, -7239372, 7517890, 9824992, 23555850, 295369, 5148398, -14154188, -22686354, 16633660), + array(4577086, -16752288, 13249841, -15304328, 19958763, -14537274, 18559670, -10759549, 8402478, -9864273), + array(-28406330, -1051581, -26790155, -907698, -17212414, -11030789, 9453451, -14980072, 17983010, 9967138), + ), + array( + array(-25762494, 6524722, 26585488, 9969270, 24709298, 1220360, -1677990, 7806337, 17507396, 3651560), + array(-10420457, -4118111, 14584639, 15971087, -15768321, 8861010, 26556809, -5574557, -18553322, -11357135), + array(2839101, 14284142, 4029895, 3472686, 14402957, 12689363, -26642121, 8459447, -5605463, -7621941), + ), + array( + array(-4839289, -3535444, 9744961, 2871048, 25113978, 3187018, -25110813, -849066, 17258084, -7977739), + array(18164541, -10595176, -17154882, -1542417, 19237078, -9745295, 23357533, -15217008, 26908270, 12150756), + array(-30264870, -7647865, 5112249, -7036672, -1499807, -6974257, 43168, -5537701, -32302074, 16215819), + ), + ), + array( + array( + array(-6898905, 9824394, -12304779, -4401089, -31397141, -6276835, 32574489, 12532905, -7503072, -8675347), + array(-27343522, -16515468, -27151524, -10722951, 946346, 16291093, 254968, 7168080, 21676107, -1943028), + array(21260961, -8424752, -16831886, -11920822, -23677961, 3968121, -3651949, -6215466, -3556191, -7913075), + ), + array( + array(16544754, 13250366, -16804428, 15546242, -4583003, 12757258, -2462308, -8680336, -18907032, -9662799), + array(-2415239, -15577728, 18312303, 4964443, -15272530, -12653564, 26820651, 16690659, 25459437, -4564609), + array(-25144690, 11425020, 28423002, -11020557, -6144921, -15826224, 9142795, -2391602, -6432418, -1644817), + ), + array( + array(-23104652, 6253476, 16964147, -3768872, -25113972, -12296437, -27457225, -16344658, 6335692, 7249989), + array(-30333227, 13979675, 7503222, -12368314, -11956721, -4621693, -30272269, 2682242, 25993170, -12478523), + array(4364628, 5930691, 32304656, -10044554, -8054781, 15091131, 22857016, -10598955, 31820368, 15075278), + ), + array( + array(31879134, -8918693, 17258761, 90626, -8041836, -4917709, 24162788, -9650886, -17970238, 12833045), + array(19073683, 14851414, -24403169, -11860168, 7625278, 11091125, -19619190, 2074449, -9413939, 14905377), + array(24483667, -11935567, -2518866, -11547418, -1553130, 15355506, -25282080, 9253129, 27628530, -7555480), + ), + array( + array(17597607, 8340603, 19355617, 552187, 26198470, -3176583, 4593324, -9157582, -14110875, 15297016), + array(510886, 14337390, -31785257, 16638632, 6328095, 2713355, -20217417, -11864220, 8683221, 2921426), + array(18606791, 11874196, 27155355, -5281482, -24031742, 6265446, -25178240, -1278924, 4674690, 13890525), + ), + array( + array(13609624, 13069022, -27372361, -13055908, 24360586, 9592974, 14977157, 9835105, 4389687, 288396), + array(9922506, -519394, 13613107, 5883594, -18758345, -434263, -12304062, 8317628, 23388070, 16052080), + array(12720016, 11937594, -31970060, -5028689, 26900120, 8561328, -20155687, -11632979, -14754271, -10812892), + ), + array( + array(15961858, 14150409, 26716931, -665832, -22794328, 13603569, 11829573, 7467844, -28822128, 929275), + array(11038231, -11582396, -27310482, -7316562, -10498527, -16307831, -23479533, -9371869, -21393143, 2465074), + array(20017163, -4323226, 27915242, 1529148, 12396362, 15675764, 13817261, -9658066, 2463391, -4622140), + ), + array( + array(-16358878, -12663911, -12065183, 4996454, -1256422, 1073572, 9583558, 12851107, 4003896, 12673717), + array(-1731589, -15155870, -3262930, 16143082, 19294135, 13385325, 14741514, -9103726, 7903886, 2348101), + array(24536016, -16515207, 12715592, -3862155, 1511293, 10047386, -3842346, -7129159, -28377538, 10048127), + ), + ), + array( + array( + array(-12622226, -6204820, 30718825, 2591312, -10617028, 12192840, 18873298, -7297090, -32297756, 15221632), + array(-26478122, -11103864, 11546244, -1852483, 9180880, 7656409, -21343950, 2095755, 29769758, 6593415), + array(-31994208, -2907461, 4176912, 3264766, 12538965, -868111, 26312345, -6118678, 30958054, 8292160), + ), + array( + array(31429822, -13959116, 29173532, 15632448, 12174511, -2760094, 32808831, 3977186, 26143136, -3148876), + array(22648901, 1402143, -22799984, 13746059, 7936347, 365344, -8668633, -1674433, -3758243, -2304625), + array(-15491917, 8012313, -2514730, -12702462, -23965846, -10254029, -1612713, -1535569, -16664475, 8194478), + ), + array( + array(27338066, -7507420, -7414224, 10140405, -19026427, -6589889, 27277191, 8855376, 28572286, 3005164), + array(26287124, 4821776, 25476601, -4145903, -3764513, -15788984, -18008582, 1182479, -26094821, -13079595), + array(-7171154, 3178080, 23970071, 6201893, -17195577, -4489192, -21876275, -13982627, 32208683, -1198248), + ), + array( + array(-16657702, 2817643, -10286362, 14811298, 6024667, 13349505, -27315504, -10497842, -27672585, -11539858), + array(15941029, -9405932, -21367050, 8062055, 31876073, -238629, -15278393, -1444429, 15397331, -4130193), + array(8934485, -13485467, -23286397, -13423241, -32446090, 14047986, 31170398, -1441021, -27505566, 15087184), + ), + array( + array(-18357243, -2156491, 24524913, -16677868, 15520427, -6360776, -15502406, 11461896, 16788528, -5868942), + array(-1947386, 16013773, 21750665, 3714552, -17401782, -16055433, -3770287, -10323320, 31322514, -11615635), + array(21426655, -5650218, -13648287, -5347537, -28812189, -4920970, -18275391, -14621414, 13040862, -12112948), + ), + array( + array(11293895, 12478086, -27136401, 15083750, -29307421, 14748872, 14555558, -13417103, 1613711, 4896935), + array(-25894883, 15323294, -8489791, -8057900, 25967126, -13425460, 2825960, -4897045, -23971776, -11267415), + array(-15924766, -5229880, -17443532, 6410664, 3622847, 10243618, 20615400, 12405433, -23753030, -8436416), + ), + array( + array(-7091295, 12556208, -20191352, 9025187, -17072479, 4333801, 4378436, 2432030, 23097949, -566018), + array(4565804, -16025654, 20084412, -7842817, 1724999, 189254, 24767264, 10103221, -18512313, 2424778), + array(366633, -11976806, 8173090, -6890119, 30788634, 5745705, -7168678, 1344109, -3642553, 12412659), + ), + array( + array(-24001791, 7690286, 14929416, -168257, -32210835, -13412986, 24162697, -15326504, -3141501, 11179385), + array(18289522, -14724954, 8056945, 16430056, -21729724, 7842514, -6001441, -1486897, -18684645, -11443503), + array(476239, 6601091, -6152790, -9723375, 17503545, -4863900, 27672959, 13403813, 11052904, 5219329), + ), + ), + array( + array( + array(20678546, -8375738, -32671898, 8849123, -5009758, 14574752, 31186971, -3973730, 9014762, -8579056), + array(-13644050, -10350239, -15962508, 5075808, -1514661, -11534600, -33102500, 9160280, 8473550, -3256838), + array(24900749, 14435722, 17209120, -15292541, -22592275, 9878983, -7689309, -16335821, -24568481, 11788948), + ), + array( + array(-3118155, -11395194, -13802089, 14797441, 9652448, -6845904, -20037437, 10410733, -24568470, -1458691), + array(-15659161, 16736706, -22467150, 10215878, -9097177, 7563911, 11871841, -12505194, -18513325, 8464118), + array(-23400612, 8348507, -14585951, -861714, -3950205, -6373419, 14325289, 8628612, 33313881, -8370517), + ), + array( + array(-20186973, -4967935, 22367356, 5271547, -1097117, -4788838, -24805667, -10236854, -8940735, -5818269), + array(-6948785, -1795212, -32625683, -16021179, 32635414, -7374245, 15989197, -12838188, 28358192, -4253904), + array(-23561781, -2799059, -32351682, -1661963, -9147719, 10429267, -16637684, 4072016, -5351664, 5596589), + ), + array( + array(-28236598, -3390048, 12312896, 6213178, 3117142, 16078565, 29266239, 2557221, 1768301, 15373193), + array(-7243358, -3246960, -4593467, -7553353, -127927, -912245, -1090902, -4504991, -24660491, 3442910), + array(-30210571, 5124043, 14181784, 8197961, 18964734, -11939093, 22597931, 7176455, -18585478, 13365930), + ), + array( + array(-7877390, -1499958, 8324673, 4690079, 6261860, 890446, 24538107, -8570186, -9689599, -3031667), + array(25008904, -10771599, -4305031, -9638010, 16265036, 15721635, 683793, -11823784, 15723479, -15163481), + array(-9660625, 12374379, -27006999, -7026148, -7724114, -12314514, 11879682, 5400171, 519526, -1235876), + ), + array( + array(22258397, -16332233, -7869817, 14613016, -22520255, -2950923, -20353881, 7315967, 16648397, 7605640), + array(-8081308, -8464597, -8223311, 9719710, 19259459, -15348212, 23994942, -5281555, -9468848, 4763278), + array(-21699244, 9220969, -15730624, 1084137, -25476107, -2852390, 31088447, -7764523, -11356529, 728112), + ), + array( + array(26047220, -11751471, -6900323, -16521798, 24092068, 9158119, -4273545, -12555558, -29365436, -5498272), + array(17510331, -322857, 5854289, 8403524, 17133918, -3112612, -28111007, 12327945, 10750447, 10014012), + array(-10312768, 3936952, 9156313, -8897683, 16498692, -994647, -27481051, -666732, 3424691, 7540221), + ), + array( + array(30322361, -6964110, 11361005, -4143317, 7433304, 4989748, -7071422, -16317219, -9244265, 15258046), + array(13054562, -2779497, 19155474, 469045, -12482797, 4566042, 5631406, 2711395, 1062915, -5136345), + array(-19240248, -11254599, -29509029, -7499965, -5835763, 13005411, -6066489, 12194497, 32960380, 1459310), + ), + ), + array( + array( + array(19852034, 7027924, 23669353, 10020366, 8586503, -6657907, 394197, -6101885, 18638003, -11174937), + array(31395534, 15098109, 26581030, 8030562, -16527914, -5007134, 9012486, -7584354, -6643087, -5442636), + array(-9192165, -2347377, -1997099, 4529534, 25766844, 607986, -13222, 9677543, -32294889, -6456008), + ), + array( + array(-2444496, -149937, 29348902, 8186665, 1873760, 12489863, -30934579, -7839692, -7852844, -8138429), + array(-15236356, -15433509, 7766470, 746860, 26346930, -10221762, -27333451, 10754588, -9431476, 5203576), + array(31834314, 14135496, -770007, 5159118, 20917671, -16768096, -7467973, -7337524, 31809243, 7347066), + ), + array( + array(-9606723, -11874240, 20414459, 13033986, 13716524, -11691881, 19797970, -12211255, 15192876, -2087490), + array(-12663563, -2181719, 1168162, -3804809, 26747877, -14138091, 10609330, 12694420, 33473243, -13382104), + array(33184999, 11180355, 15832085, -11385430, -1633671, 225884, 15089336, -11023903, -6135662, 14480053), + ), + array( + array(31308717, -5619998, 31030840, -1897099, 15674547, -6582883, 5496208, 13685227, 27595050, 8737275), + array(-20318852, -15150239, 10933843, -16178022, 8335352, -7546022, -31008351, -12610604, 26498114, 66511), + array(22644454, -8761729, -16671776, 4884562, -3105614, -13559366, 30540766, -4286747, -13327787, -7515095), + ), + array( + array(-28017847, 9834845, 18617207, -2681312, -3401956, -13307506, 8205540, 13585437, -17127465, 15115439), + array(23711543, -672915, 31206561, -8362711, 6164647, -9709987, -33535882, -1426096, 8236921, 16492939), + array(-23910559, -13515526, -26299483, -4503841, 25005590, -7687270, 19574902, 10071562, 6708380, -6222424), + ), + array( + array(2101391, -4930054, 19702731, 2367575, -15427167, 1047675, 5301017, 9328700, 29955601, -11678310), + array(3096359, 9271816, -21620864, -15521844, -14847996, -7592937, -25892142, -12635595, -9917575, 6216608), + array(-32615849, 338663, -25195611, 2510422, -29213566, -13820213, 24822830, -6146567, -26767480, 7525079), + ), + array( + array(-23066649, -13985623, 16133487, -7896178, -3389565, 778788, -910336, -2782495, -19386633, 11994101), + array(21691500, -13624626, -641331, -14367021, 3285881, -3483596, -25064666, 9718258, -7477437, 13381418), + array(18445390, -4202236, 14979846, 11622458, -1727110, -3582980, 23111648, -6375247, 28535282, 15779576), + ), + array( + array(30098053, 3089662, -9234387, 16662135, -21306940, 11308411, -14068454, 12021730, 9955285, -16303356), + array(9734894, -14576830, -7473633, -9138735, 2060392, 11313496, -18426029, 9924399, 20194861, 13380996), + array(-26378102, -7965207, -22167821, 15789297, -18055342, -6168792, -1984914, 15707771, 26342023, 10146099), + ), + ), + array( + array( + array(-26016874, -219943, 21339191, -41388, 19745256, -2878700, -29637280, 2227040, 21612326, -545728), + array(-13077387, 1184228, 23562814, -5970442, -20351244, -6348714, 25764461, 12243797, -20856566, 11649658), + array(-10031494, 11262626, 27384172, 2271902, 26947504, -15997771, 39944, 6114064, 33514190, 2333242), + ), + array( + array(-21433588, -12421821, 8119782, 7219913, -21830522, -9016134, -6679750, -12670638, 24350578, -13450001), + array(-4116307, -11271533, -23886186, 4843615, -30088339, 690623, -31536088, -10406836, 8317860, 12352766), + array(18200138, -14475911, -33087759, -2696619, -23702521, -9102511, -23552096, -2287550, 20712163, 6719373), + ), + array( + array(26656208, 6075253, -7858556, 1886072, -28344043, 4262326, 11117530, -3763210, 26224235, -3297458), + array(-17168938, -14854097, -3395676, -16369877, -19954045, 14050420, 21728352, 9493610, 18620611, -16428628), + array(-13323321, 13325349, 11432106, 5964811, 18609221, 6062965, -5269471, -9725556, -30701573, -16479657), + ), + array( + array(-23860538, -11233159, 26961357, 1640861, -32413112, -16737940, 12248509, -5240639, 13735342, 1934062), + array(25089769, 6742589, 17081145, -13406266, 21909293, -16067981, -15136294, -3765346, -21277997, 5473616), + array(31883677, -7961101, 1083432, -11572403, 22828471, 13290673, -7125085, 12469656, 29111212, -5451014), + ), + array( + array(24244947, -15050407, -26262976, 2791540, -14997599, 16666678, 24367466, 6388839, -10295587, 452383), + array(-25640782, -3417841, 5217916, 16224624, 19987036, -4082269, -24236251, -5915248, 15766062, 8407814), + array(-20406999, 13990231, 15495425, 16395525, 5377168, 15166495, -8917023, -4388953, -8067909, 2276718), + ), + array( + array(30157918, 12924066, -17712050, 9245753, 19895028, 3368142, -23827587, 5096219, 22740376, -7303417), + array(2041139, -14256350, 7783687, 13876377, -25946985, -13352459, 24051124, 13742383, -15637599, 13295222), + array(33338237, -8505733, 12532113, 7977527, 9106186, -1715251, -17720195, -4612972, -4451357, -14669444), + ), + array( + array(-20045281, 5454097, -14346548, 6447146, 28862071, 1883651, -2469266, -4141880, 7770569, 9620597), + array(23208068, 7979712, 33071466, 8149229, 1758231, -10834995, 30945528, -1694323, -33502340, -14767970), + array(1439958, -16270480, -1079989, -793782, 4625402, 10647766, -5043801, 1220118, 30494170, -11440799), + ), + array( + array(-5037580, -13028295, -2970559, -3061767, 15640974, -6701666, -26739026, 926050, -1684339, -13333647), + array(13908495, -3549272, 30919928, -6273825, -21521863, 7989039, 9021034, 9078865, 3353509, 4033511), + array(-29663431, -15113610, 32259991, -344482, 24295849, -12912123, 23161163, 8839127, 27485041, 7356032), + ), + ), + array( + array( + array(9661027, 705443, 11980065, -5370154, -1628543, 14661173, -6346142, 2625015, 28431036, -16771834), + array(-23839233, -8311415, -25945511, 7480958, -17681669, -8354183, -22545972, 14150565, 15970762, 4099461), + array(29262576, 16756590, 26350592, -8793563, 8529671, -11208050, 13617293, -9937143, 11465739, 8317062), + ), + array( + array(-25493081, -6962928, 32500200, -9419051, -23038724, -2302222, 14898637, 3848455, 20969334, -5157516), + array(-20384450, -14347713, -18336405, 13884722, -33039454, 2842114, -21610826, -3649888, 11177095, 14989547), + array(-24496721, -11716016, 16959896, 2278463, 12066309, 10137771, 13515641, 2581286, -28487508, 9930240), + ), + array( + array(-17751622, -2097826, 16544300, -13009300, -15914807, -14949081, 18345767, -13403753, 16291481, -5314038), + array(-33229194, 2553288, 32678213, 9875984, 8534129, 6889387, -9676774, 6957617, 4368891, 9788741), + array(16660756, 7281060, -10830758, 12911820, 20108584, -8101676, -21722536, -8613148, 16250552, -11111103), + ), + array( + array(-19765507, 2390526, -16551031, 14161980, 1905286, 6414907, 4689584, 10604807, -30190403, 4782747), + array(-1354539, 14736941, -7367442, -13292886, 7710542, -14155590, -9981571, 4383045, 22546403, 437323), + array(31665577, -12180464, -16186830, 1491339, -18368625, 3294682, 27343084, 2786261, -30633590, -14097016), + ), + array( + array(-14467279, -683715, -33374107, 7448552, 19294360, 14334329, -19690631, 2355319, -19284671, -6114373), + array(15121312, -15796162, 6377020, -6031361, -10798111, -12957845, 18952177, 15496498, -29380133, 11754228), + array(-2637277, -13483075, 8488727, -14303896, 12728761, -1622493, 7141596, 11724556, 22761615, -10134141), + ), + array( + array(16918416, 11729663, -18083579, 3022987, -31015732, -13339659, -28741185, -12227393, 32851222, 11717399), + array(11166634, 7338049, -6722523, 4531520, -29468672, -7302055, 31474879, 3483633, -1193175, -4030831), + array(-185635, 9921305, 31456609, -13536438, -12013818, 13348923, 33142652, 6546660, -19985279, -3948376), + ), + array( + array(-32460596, 11266712, -11197107, -7899103, 31703694, 3855903, -8537131, -12833048, -30772034, -15486313), + array(-18006477, 12709068, 3991746, -6479188, -21491523, -10550425, -31135347, -16049879, 10928917, 3011958), + array(-6957757, -15594337, 31696059, 334240, 29576716, 14796075, -30831056, -12805180, 18008031, 10258577), + ), + array( + array(-22448644, 15655569, 7018479, -4410003, -30314266, -1201591, -1853465, 1367120, 25127874, 6671743), + array(29701166, -14373934, -10878120, 9279288, -17568, 13127210, 21382910, 11042292, 25838796, 4642684), + array(-20430234, 14955537, -24126347, 8124619, -5369288, -5990470, 30468147, -13900640, 18423289, 4177476), + ), + ) + ); + + /** + * See: libsodium's crypto_core/curve25519/ref10/base2.h + * + * @var array>> basically int[8][3] + */ + protected static $base2 = array( + array( + array(25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605), + array(-12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378), + array(-8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546), + ), + array( + array(15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024), + array(16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574), + array(30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357), + ), + array( + array(10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380), + array(4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306), + array(19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942), + ), + array( + array(5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766), + array(-30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701), + array(28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300), + ), + array( + array(-22518993, -6692182, 14201702, -8745502, -23510406, 8844726, 18474211, -1361450, -13062696, 13821877), + array(-6455177, -7839871, 3374702, -4740862, -27098617, -10571707, 31655028, -7212327, 18853322, -14220951), + array(4566830, -12963868, -28974889, -12240689, -7602672, -2830569, -8514358, -10431137, 2207753, -3209784), + ), + array( + array(-25154831, -4185821, 29681144, 7868801, -6854661, -9423865, -12437364, -663000, -31111463, -16132436), + array(25576264, -2703214, 7349804, -11814844, 16472782, 9300885, 3844789, 15725684, 171356, 6466918), + array(23103977, 13316479, 9739013, -16149481, 817875, -15038942, 8965339, -14088058, -30714912, 16193877), + ), + array( + array(-33521811, 3180713, -2394130, 14003687, -16903474, -16270840, 17238398, 4729455, -18074513, 9256800), + array(-25182317, -4174131, 32336398, 5036987, -21236817, 11360617, 22616405, 9761698, -19827198, 630305), + array(-13720693, 2639453, -24237460, -7406481, 9494427, -5774029, -6554551, -15960994, -2449256, -14291300), + ), + array( + array(-3151181, -5046075, 9282714, 6866145, -31907062, -863023, -18940575, 15033784, 25105118, -7894876), + array(-24326370, 15950226, -31801215, -14592823, -11662737, -5090925, 1573892, -2625887, 2198790, -15804619), + array(-3099351, 10324967, -2241613, 7453183, -5446979, -2735503, -13812022, -16236442, -32461234, -12290683), + ) + ); + + /** + * 37095705934669439343138083508754565189542113879843219016388785533085940283555 + * + * @var array + */ + protected static $d = array( + -10913610, + 13857413, + -15372611, + 6949391, + 114729, + -8787816, + -6275908, + -3247719, + -18696448, + -12055116 + ); + + /** + * 2 * d = 16295367250680780974490674513165176452449235426866156013048779062215315747161 + * + * @var array + */ + protected static $d2 = array( + -21827239, + -5839606, + -30745221, + 13898782, + 229458, + 15978800, + -12551817, + -6495438, + 29715968, + 9444199 + ); + + /** + * sqrt(-1) + * + * @var array + */ + protected static $sqrtm1 = array( + -32595792, + -7943725, + 9377950, + 3500415, + 12389472, + -272473, + -25146209, + -2005654, + 326686, + 11406482 + ); +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/Curve25519/README.md b/vendor/paragonie/sodium_compat/src/Core32/Curve25519/README.md new file mode 100644 index 0000000..e8097fa --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/Curve25519/README.md @@ -0,0 +1,3 @@ +# Curve25519 Data Structures + +These are PHP implementation of the [structs used in the ref10 curve25519 code](https://github.com/jedisct1/libsodium/blob/master/src/libsodium/include/sodium/private/curve25519_ref10.h). diff --git a/vendor/paragonie/sodium_compat/src/Core32/Ed25519.php b/vendor/paragonie/sodium_compat/src/Core32/Ed25519.php new file mode 100644 index 0000000..284ff14 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/Ed25519.php @@ -0,0 +1,482 @@ +X)) { + throw new SodiumException('Unexpected zero result'); + } + + # fe_1(one_minus_y); + # fe_sub(one_minus_y, one_minus_y, A.Y); + # fe_invert(one_minus_y, one_minus_y); + $one_minux_y = self::fe_invert( + self::fe_sub( + self::fe_1(), + $A->Y + ) + ); + + + # fe_1(x); + # fe_add(x, x, A.Y); + # fe_mul(x, x, one_minus_y); + $x = self::fe_mul( + self::fe_add(self::fe_1(), $A->Y), + $one_minux_y + ); + + # fe_tobytes(curve25519_pk, x); + return self::fe_tobytes($x); + } + + /** + * @internal You should not use this directly from another application + * + * @param string $sk + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function sk_to_pk($sk) + { + return self::ge_p3_tobytes( + self::ge_scalarmult_base( + self::substr($sk, 0, 32) + ) + ); + } + + /** + * @internal You should not use this directly from another application + * + * @param string $message + * @param string $sk + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function sign($message, $sk) + { + /** @var string $signature */ + $signature = self::sign_detached($message, $sk); + return $signature . $message; + } + + /** + * @internal You should not use this directly from another application + * + * @param string $message A signed message + * @param string $pk Public key + * @return string Message (without signature) + * @throws SodiumException + * @throws TypeError + */ + public static function sign_open($message, $pk) + { + /** @var string $signature */ + $signature = self::substr($message, 0, 64); + + /** @var string $message */ + $message = self::substr($message, 64); + + if (self::verify_detached($signature, $message, $pk)) { + return $message; + } + throw new SodiumException('Invalid signature'); + } + + /** + * @internal You should not use this directly from another application + * + * @param string $message + * @param string $sk + * @return string + * @throws SodiumException + * @throws TypeError + * @psalm-suppress PossiblyInvalidArgument + */ + public static function sign_detached($message, $sk) + { + # crypto_hash_sha512(az, sk, 32); + $az = hash('sha512', self::substr($sk, 0, 32), true); + + # az[0] &= 248; + # az[31] &= 63; + # az[31] |= 64; + $az[0] = self::intToChr(self::chrToInt($az[0]) & 248); + $az[31] = self::intToChr((self::chrToInt($az[31]) & 63) | 64); + + # crypto_hash_sha512_init(&hs); + # crypto_hash_sha512_update(&hs, az + 32, 32); + # crypto_hash_sha512_update(&hs, m, mlen); + # crypto_hash_sha512_final(&hs, nonce); + $hs = hash_init('sha512'); + self::hash_update($hs, self::substr($az, 32, 32)); + self::hash_update($hs, $message); + $nonceHash = hash_final($hs, true); + + # memmove(sig + 32, sk + 32, 32); + $pk = self::substr($sk, 32, 32); + + # sc_reduce(nonce); + # ge_scalarmult_base(&R, nonce); + # ge_p3_tobytes(sig, &R); + $nonce = self::sc_reduce($nonceHash) . self::substr($nonceHash, 32); + $sig = self::ge_p3_tobytes( + self::ge_scalarmult_base($nonce) + ); + + # crypto_hash_sha512_init(&hs); + # crypto_hash_sha512_update(&hs, sig, 64); + # crypto_hash_sha512_update(&hs, m, mlen); + # crypto_hash_sha512_final(&hs, hram); + $hs = hash_init('sha512'); + self::hash_update($hs, self::substr($sig, 0, 32)); + self::hash_update($hs, self::substr($pk, 0, 32)); + self::hash_update($hs, $message); + $hramHash = hash_final($hs, true); + + # sc_reduce(hram); + # sc_muladd(sig + 32, hram, az, nonce); + $hram = self::sc_reduce($hramHash); + $sigAfter = self::sc_muladd($hram, $az, $nonce); + $sig = self::substr($sig, 0, 32) . self::substr($sigAfter, 0, 32); + + try { + ParagonIE_Sodium_Compat::memzero($az); + } catch (SodiumException $ex) { + $az = null; + } + return $sig; + } + + /** + * @internal You should not use this directly from another application + * + * @param string $sig + * @param string $message + * @param string $pk + * @return bool + * @throws SodiumException + * @throws TypeError + */ + public static function verify_detached($sig, $message, $pk) + { + if (self::strlen($sig) < 64) { + throw new SodiumException('Signature is too short'); + } + if ((self::chrToInt($sig[63]) & 240) && self::check_S_lt_L(self::substr($sig, 32, 32))) { + throw new SodiumException('S < L - Invalid signature'); + } + if (self::small_order($sig)) { + throw new SodiumException('Signature is on too small of an order'); + } + if ((self::chrToInt($sig[63]) & 224) !== 0) { + throw new SodiumException('Invalid signature'); + } + $d = 0; + for ($i = 0; $i < 32; ++$i) { + $d |= self::chrToInt($pk[$i]); + } + if ($d === 0) { + throw new SodiumException('All zero public key'); + } + + /** @var bool The original value of ParagonIE_Sodium_Compat::$fastMult */ + $orig = ParagonIE_Sodium_Compat::$fastMult; + + // Set ParagonIE_Sodium_Compat::$fastMult to true to speed up verification. + ParagonIE_Sodium_Compat::$fastMult = true; + + /** @var ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A */ + $A = self::ge_frombytes_negate_vartime($pk); + + /** @var string $hDigest */ + $hDigest = hash( + 'sha512', + self::substr($sig, 0, 32) . + self::substr($pk, 0, 32) . + $message, + true + ); + + /** @var string $h */ + $h = self::sc_reduce($hDigest) . self::substr($hDigest, 32); + + /** @var ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $R */ + $R = self::ge_double_scalarmult_vartime( + $h, + $A, + self::substr($sig, 32) + ); + + /** @var string $rcheck */ + $rcheck = self::ge_tobytes($R); + + // Reset ParagonIE_Sodium_Compat::$fastMult to what it was before. + ParagonIE_Sodium_Compat::$fastMult = $orig; + + return self::verify_32($rcheck, self::substr($sig, 0, 32)); + } + + /** + * @internal You should not use this directly from another application + * + * @param string $S + * @return bool + * @throws SodiumException + * @throws TypeError + */ + public static function check_S_lt_L($S) + { + if (self::strlen($S) < 32) { + throw new SodiumException('Signature must be 32 bytes'); + } + static $L = array( + 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, + 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10 + ); + /** @var array $L */ + $c = 0; + $n = 1; + $i = 32; + + do { + --$i; + $x = self::chrToInt($S[$i]); + $c |= ( + (($x - $L[$i]) >> 8) & $n + ); + $n &= ( + (($x ^ $L[$i]) - 1) >> 8 + ); + } while ($i !== 0); + + return $c === 0; + } + + /** + * @param string $R + * @return bool + * @throws SodiumException + * @throws TypeError + */ + public static function small_order($R) + { + static $blocklist = array( + /* 0 (order 4) */ + array( + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + ), + /* 1 (order 1) */ + array( + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + ), + /* 2707385501144840649318225287225658788936804267575313519463743609750303402022 (order 8) */ + array( + 0x26, 0xe8, 0x95, 0x8f, 0xc2, 0xb2, 0x27, 0xb0, + 0x45, 0xc3, 0xf4, 0x89, 0xf2, 0xef, 0x98, 0xf0, + 0xd5, 0xdf, 0xac, 0x05, 0xd3, 0xc6, 0x33, 0x39, + 0xb1, 0x38, 0x02, 0x88, 0x6d, 0x53, 0xfc, 0x05 + ), + /* 55188659117513257062467267217118295137698188065244968500265048394206261417927 (order 8) */ + array( + 0xc7, 0x17, 0x6a, 0x70, 0x3d, 0x4d, 0xd8, 0x4f, + 0xba, 0x3c, 0x0b, 0x76, 0x0d, 0x10, 0x67, 0x0f, + 0x2a, 0x20, 0x53, 0xfa, 0x2c, 0x39, 0xcc, 0xc6, + 0x4e, 0xc7, 0xfd, 0x77, 0x92, 0xac, 0x03, 0x7a + ), + /* p-1 (order 2) */ + array( + 0x13, 0xe8, 0x95, 0x8f, 0xc2, 0xb2, 0x27, 0xb0, + 0x45, 0xc3, 0xf4, 0x89, 0xf2, 0xef, 0x98, 0xf0, + 0xd5, 0xdf, 0xac, 0x05, 0xd3, 0xc6, 0x33, 0x39, + 0xb1, 0x38, 0x02, 0x88, 0x6d, 0x53, 0xfc, 0x85 + ), + /* p (order 4) */ + array( + 0xb4, 0x17, 0x6a, 0x70, 0x3d, 0x4d, 0xd8, 0x4f, + 0xba, 0x3c, 0x0b, 0x76, 0x0d, 0x10, 0x67, 0x0f, + 0x2a, 0x20, 0x53, 0xfa, 0x2c, 0x39, 0xcc, 0xc6, + 0x4e, 0xc7, 0xfd, 0x77, 0x92, 0xac, 0x03, 0xfa + ), + /* p+1 (order 1) */ + array( + 0xec, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f + ), + /* p+2707385501144840649318225287225658788936804267575313519463743609750303402022 (order 8) */ + array( + 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f + ), + /* p+55188659117513257062467267217118295137698188065244968500265048394206261417927 (order 8) */ + array( + 0xee, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f + ), + /* 2p-1 (order 2) */ + array( + 0xd9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff + ), + /* 2p (order 4) */ + array( + 0xda, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff + ), + /* 2p+1 (order 1) */ + array( + 0xdb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff + ) + ); + /** @var array> $blocklist */ + $countBlocklist = count($blocklist); + + for ($i = 0; $i < $countBlocklist; ++$i) { + $c = 0; + for ($j = 0; $j < 32; ++$j) { + $c |= self::chrToInt($R[$j]) ^ $blocklist[$i][$j]; + } + if ($c === 0) { + return true; + } + } + return false; + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/HChaCha20.php b/vendor/paragonie/sodium_compat/src/Core32/HChaCha20.php new file mode 100644 index 0000000..551d995 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/HChaCha20.php @@ -0,0 +1,127 @@ +toReverseString() . + $x1->toReverseString() . + $x2->toReverseString() . + $x3->toReverseString() . + $x12->toReverseString() . + $x13->toReverseString() . + $x14->toReverseString() . + $x15->toReverseString(); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/HSalsa20.php b/vendor/paragonie/sodium_compat/src/Core32/HSalsa20.php new file mode 100644 index 0000000..39287f2 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/HSalsa20.php @@ -0,0 +1,141 @@ + 0; $i -= 2) { + $x4 = $x4->xorInt32($x0->addInt32($x12)->rotateLeft(7)); + $x8 = $x8->xorInt32($x4->addInt32($x0)->rotateLeft(9)); + $x12 = $x12->xorInt32($x8->addInt32($x4)->rotateLeft(13)); + $x0 = $x0->xorInt32($x12->addInt32($x8)->rotateLeft(18)); + + $x9 = $x9->xorInt32($x5->addInt32($x1)->rotateLeft(7)); + $x13 = $x13->xorInt32($x9->addInt32($x5)->rotateLeft(9)); + $x1 = $x1->xorInt32($x13->addInt32($x9)->rotateLeft(13)); + $x5 = $x5->xorInt32($x1->addInt32($x13)->rotateLeft(18)); + + $x14 = $x14->xorInt32($x10->addInt32($x6)->rotateLeft(7)); + $x2 = $x2->xorInt32($x14->addInt32($x10)->rotateLeft(9)); + $x6 = $x6->xorInt32($x2->addInt32($x14)->rotateLeft(13)); + $x10 = $x10->xorInt32($x6->addInt32($x2)->rotateLeft(18)); + + $x3 = $x3->xorInt32($x15->addInt32($x11)->rotateLeft(7)); + $x7 = $x7->xorInt32($x3->addInt32($x15)->rotateLeft(9)); + $x11 = $x11->xorInt32($x7->addInt32($x3)->rotateLeft(13)); + $x15 = $x15->xorInt32($x11->addInt32($x7)->rotateLeft(18)); + + $x1 = $x1->xorInt32($x0->addInt32($x3)->rotateLeft(7)); + $x2 = $x2->xorInt32($x1->addInt32($x0)->rotateLeft(9)); + $x3 = $x3->xorInt32($x2->addInt32($x1)->rotateLeft(13)); + $x0 = $x0->xorInt32($x3->addInt32($x2)->rotateLeft(18)); + + $x6 = $x6->xorInt32($x5->addInt32($x4)->rotateLeft(7)); + $x7 = $x7->xorInt32($x6->addInt32($x5)->rotateLeft(9)); + $x4 = $x4->xorInt32($x7->addInt32($x6)->rotateLeft(13)); + $x5 = $x5->xorInt32($x4->addInt32($x7)->rotateLeft(18)); + + $x11 = $x11->xorInt32($x10->addInt32($x9)->rotateLeft(7)); + $x8 = $x8->xorInt32($x11->addInt32($x10)->rotateLeft(9)); + $x9 = $x9->xorInt32($x8->addInt32($x11)->rotateLeft(13)); + $x10 = $x10->xorInt32($x9->addInt32($x8)->rotateLeft(18)); + + $x12 = $x12->xorInt32($x15->addInt32($x14)->rotateLeft(7)); + $x13 = $x13->xorInt32($x12->addInt32($x15)->rotateLeft(9)); + $x14 = $x14->xorInt32($x13->addInt32($x12)->rotateLeft(13)); + $x15 = $x15->xorInt32($x14->addInt32($x13)->rotateLeft(18)); + } + + return $x0->toReverseString() . + $x5->toReverseString() . + $x10->toReverseString() . + $x15->toReverseString() . + $x6->toReverseString() . + $x7->toReverseString() . + $x8->toReverseString() . + $x9->toReverseString(); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/Int32.php b/vendor/paragonie/sodium_compat/src/Core32/Int32.php new file mode 100644 index 0000000..c3a1790 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/Int32.php @@ -0,0 +1,871 @@ + - two 16-bit integers + * + * 0 is the higher 16 bits + * 1 is the lower 16 bits + */ + public $limbs = array(0, 0); + + /** + * @var int + */ + public $overflow = 0; + + /** + * @var bool + */ + public $unsignedInt = false; + + /** + * ParagonIE_Sodium_Core32_Int32 constructor. + * @param array $array + * @param bool $unsignedInt + */ + public function __construct($array = array(0, 0), $unsignedInt = false) + { + $this->limbs = array( + (int) $array[0], + (int) $array[1] + ); + $this->overflow = 0; + $this->unsignedInt = $unsignedInt; + } + + /** + * Adds two int32 objects + * + * @param ParagonIE_Sodium_Core32_Int32 $addend + * @return ParagonIE_Sodium_Core32_Int32 + */ + public function addInt32(ParagonIE_Sodium_Core32_Int32 $addend) + { + $i0 = $this->limbs[0]; + $i1 = $this->limbs[1]; + $j0 = $addend->limbs[0]; + $j1 = $addend->limbs[1]; + + $r1 = $i1 + ($j1 & 0xffff); + $carry = $r1 >> 16; + + $r0 = $i0 + ($j0 & 0xffff) + $carry; + $carry = $r0 >> 16; + + $r0 &= 0xffff; + $r1 &= 0xffff; + + $return = new ParagonIE_Sodium_Core32_Int32( + array($r0, $r1) + ); + $return->overflow = $carry; + $return->unsignedInt = $this->unsignedInt; + return $return; + } + + /** + * Adds a normal integer to an int32 object + * + * @param int $int + * @return ParagonIE_Sodium_Core32_Int32 + * @throws SodiumException + * @throws TypeError + */ + public function addInt($int) + { + ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1); + /** @var int $int */ + $int = (int) $int; + + $int = (int) $int; + + $i0 = $this->limbs[0]; + $i1 = $this->limbs[1]; + + $r1 = $i1 + ($int & 0xffff); + $carry = $r1 >> 16; + + $r0 = $i0 + (($int >> 16) & 0xffff) + $carry; + $carry = $r0 >> 16; + $r0 &= 0xffff; + $r1 &= 0xffff; + $return = new ParagonIE_Sodium_Core32_Int32( + array($r0, $r1) + ); + $return->overflow = $carry; + $return->unsignedInt = $this->unsignedInt; + return $return; + } + + /** + * @param int $b + * @return int + */ + public function compareInt($b = 0) + { + $gt = 0; + $eq = 1; + + $i = 2; + $j = 0; + while ($i > 0) { + --$i; + /** @var int $x1 */ + $x1 = $this->limbs[$i]; + /** @var int $x2 */ + $x2 = ($b >> ($j << 4)) & 0xffff; + /** @var int $gt */ + $gt |= (($x2 - $x1) >> 8) & $eq; + /** @var int $eq */ + $eq &= (($x2 ^ $x1) - 1) >> 8; + } + return ($gt + $gt - $eq) + 1; + } + + /** + * @param int $m + * @return ParagonIE_Sodium_Core32_Int32 + */ + public function mask($m = 0) + { + /** @var int $hi */ + $hi = ($m >> 16) & 0xffff; + /** @var int $lo */ + $lo = ($m & 0xffff); + return new ParagonIE_Sodium_Core32_Int32( + array( + (int) ($this->limbs[0] & $hi), + (int) ($this->limbs[1] & $lo) + ), + $this->unsignedInt + ); + } + + /** + * @param array $a + * @param array $b + * @param int $baseLog2 + * @return array + */ + public function multiplyLong(array $a, array $b, $baseLog2 = 16) + { + $a_l = count($a); + $b_l = count($b); + /** @var array $r */ + $r = array_fill(0, $a_l + $b_l + 1, 0); + $base = 1 << $baseLog2; + for ($i = 0; $i < $a_l; ++$i) { + $a_i = $a[$i]; + for ($j = 0; $j < $a_l; ++$j) { + $b_j = $b[$j]; + $product = ($a_i * $b_j) + $r[$i + $j]; + $carry = ($product >> $baseLog2 & 0xffff); + $r[$i + $j] = ($product - (int) ($carry * $base)) & 0xffff; + $r[$i + $j + 1] += $carry; + } + } + return array_slice($r, 0, 5); + } + + /** + * @param int $int + * @return ParagonIE_Sodium_Core32_Int32 + */ + public function mulIntFast($int) + { + // Handle negative numbers + $aNeg = ($this->limbs[0] >> 15) & 1; + $bNeg = ($int >> 31) & 1; + $a = array_reverse($this->limbs); + $b = array( + $int & 0xffff, + ($int >> 16) & 0xffff + ); + if ($aNeg) { + for ($i = 0; $i < 2; ++$i) { + $a[$i] = ($a[$i] ^ 0xffff) & 0xffff; + } + ++$a[0]; + } + if ($bNeg) { + for ($i = 0; $i < 2; ++$i) { + $b[$i] = ($b[$i] ^ 0xffff) & 0xffff; + } + ++$b[0]; + } + // Multiply + $res = $this->multiplyLong($a, $b); + + // Re-apply negation to results + if ($aNeg !== $bNeg) { + for ($i = 0; $i < 2; ++$i) { + $res[$i] = (0xffff ^ $res[$i]) & 0xffff; + } + // Handle integer overflow + $c = 1; + for ($i = 0; $i < 2; ++$i) { + $res[$i] += $c; + $c = $res[$i] >> 16; + $res[$i] &= 0xffff; + } + } + + // Return our values + $return = new ParagonIE_Sodium_Core32_Int32(); + $return->limbs = array( + $res[1] & 0xffff, + $res[0] & 0xffff + ); + if (count($res) > 2) { + $return->overflow = $res[2] & 0xffff; + } + $return->unsignedInt = $this->unsignedInt; + return $return; + } + + /** + * @param ParagonIE_Sodium_Core32_Int32 $right + * @return ParagonIE_Sodium_Core32_Int32 + */ + public function mulInt32Fast(ParagonIE_Sodium_Core32_Int32 $right) + { + $aNeg = ($this->limbs[0] >> 15) & 1; + $bNeg = ($right->limbs[0] >> 15) & 1; + + $a = array_reverse($this->limbs); + $b = array_reverse($right->limbs); + if ($aNeg) { + for ($i = 0; $i < 2; ++$i) { + $a[$i] = ($a[$i] ^ 0xffff) & 0xffff; + } + ++$a[0]; + } + if ($bNeg) { + for ($i = 0; $i < 2; ++$i) { + $b[$i] = ($b[$i] ^ 0xffff) & 0xffff; + } + ++$b[0]; + } + $res = $this->multiplyLong($a, $b); + if ($aNeg !== $bNeg) { + if ($aNeg !== $bNeg) { + for ($i = 0; $i < 2; ++$i) { + $res[$i] = ($res[$i] ^ 0xffff) & 0xffff; + } + $c = 1; + for ($i = 0; $i < 2; ++$i) { + $res[$i] += $c; + $c = $res[$i] >> 16; + $res[$i] &= 0xffff; + } + } + } + $return = new ParagonIE_Sodium_Core32_Int32(); + $return->limbs = array( + $res[1] & 0xffff, + $res[0] & 0xffff + ); + if (count($res) > 2) { + $return->overflow = $res[2]; + } + return $return; + } + + /** + * @param int $int + * @param int $size + * @return ParagonIE_Sodium_Core32_Int32 + * @throws SodiumException + * @throws TypeError + */ + public function mulInt($int = 0, $size = 0) + { + ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1); + ParagonIE_Sodium_Core32_Util::declareScalarType($size, 'int', 2); + if (ParagonIE_Sodium_Compat::$fastMult) { + return $this->mulIntFast((int) $int); + } + /** @var int $int */ + $int = (int) $int; + /** @var int $size */ + $size = (int) $size; + + if (!$size) { + $size = 31; + } + /** @var int $size */ + + $a = clone $this; + $return = new ParagonIE_Sodium_Core32_Int32(); + $return->unsignedInt = $this->unsignedInt; + + // Initialize: + $ret0 = 0; + $ret1 = 0; + $a0 = $a->limbs[0]; + $a1 = $a->limbs[1]; + + /** @var int $size */ + /** @var int $i */ + for ($i = $size; $i >= 0; --$i) { + $m = (int) (-($int & 1)); + $x0 = $a0 & $m; + $x1 = $a1 & $m; + + $ret1 += $x1; + $c = $ret1 >> 16; + + $ret0 += $x0 + $c; + + $ret0 &= 0xffff; + $ret1 &= 0xffff; + + $a1 = ($a1 << 1); + $x1 = $a1 >> 16; + $a0 = ($a0 << 1) | $x1; + $a0 &= 0xffff; + $a1 &= 0xffff; + $int >>= 1; + } + $return->limbs[0] = $ret0; + $return->limbs[1] = $ret1; + return $return; + } + + /** + * @param ParagonIE_Sodium_Core32_Int32 $int + * @param int $size + * @return ParagonIE_Sodium_Core32_Int32 + * @throws SodiumException + * @throws TypeError + */ + public function mulInt32(ParagonIE_Sodium_Core32_Int32 $int, $size = 0) + { + ParagonIE_Sodium_Core32_Util::declareScalarType($size, 'int', 2); + if (ParagonIE_Sodium_Compat::$fastMult) { + return $this->mulInt32Fast($int); + } + if (!$size) { + $size = 31; + } + /** @var int $size */ + + $a = clone $this; + $b = clone $int; + $return = new ParagonIE_Sodium_Core32_Int32(); + $return->unsignedInt = $this->unsignedInt; + + // Initialize: + $ret0 = 0; + $ret1 = 0; + $a0 = $a->limbs[0]; + $a1 = $a->limbs[1]; + $b0 = $b->limbs[0]; + $b1 = $b->limbs[1]; + + /** @var int $size */ + /** @var int $i */ + for ($i = $size; $i >= 0; --$i) { + $m = (int) (-($b1 & 1)); + $x0 = $a0 & $m; + $x1 = $a1 & $m; + + $ret1 += $x1; + $c = $ret1 >> 16; + + $ret0 += $x0 + $c; + + $ret0 &= 0xffff; + $ret1 &= 0xffff; + + $a1 = ($a1 << 1); + $x1 = $a1 >> 16; + $a0 = ($a0 << 1) | $x1; + $a0 &= 0xffff; + $a1 &= 0xffff; + + $x0 = ($b0 & 1) << 16; + $b0 = ($b0 >> 1); + $b1 = (($b1 | $x0) >> 1); + + $b0 &= 0xffff; + $b1 &= 0xffff; + + } + $return->limbs[0] = $ret0; + $return->limbs[1] = $ret1; + + return $return; + } + + /** + * OR this 32-bit integer with another. + * + * @param ParagonIE_Sodium_Core32_Int32 $b + * @return ParagonIE_Sodium_Core32_Int32 + */ + public function orInt32(ParagonIE_Sodium_Core32_Int32 $b) + { + $return = new ParagonIE_Sodium_Core32_Int32(); + $return->unsignedInt = $this->unsignedInt; + $return->limbs = array( + (int) ($this->limbs[0] | $b->limbs[0]), + (int) ($this->limbs[1] | $b->limbs[1]) + ); + /** @var int overflow */ + $return->overflow = $this->overflow | $b->overflow; + return $return; + } + + /** + * @param int $b + * @return bool + */ + public function isGreaterThan($b = 0) + { + return $this->compareInt($b) > 0; + } + + /** + * @param int $b + * @return bool + */ + public function isLessThanInt($b = 0) + { + return $this->compareInt($b) < 0; + } + + /** + * @param int $c + * @return ParagonIE_Sodium_Core32_Int32 + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArrayAccess + */ + public function rotateLeft($c = 0) + { + ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1); + /** @var int $c */ + $c = (int) $c; + + $return = new ParagonIE_Sodium_Core32_Int32(); + $return->unsignedInt = $this->unsignedInt; + $c &= 31; + if ($c === 0) { + // NOP, but we want a copy. + $return->limbs = $this->limbs; + } else { + /** @var int $c */ + + /** @var int $idx_shift */ + $idx_shift = ($c >> 4) & 1; + + /** @var int $sub_shift */ + $sub_shift = $c & 15; + + /** @var array $limbs */ + $limbs =& $return->limbs; + + /** @var array $myLimbs */ + $myLimbs =& $this->limbs; + + for ($i = 1; $i >= 0; --$i) { + /** @var int $j */ + $j = ($i + $idx_shift) & 1; + /** @var int $k */ + $k = ($i + $idx_shift + 1) & 1; + $limbs[$i] = (int) ( + ( + ((int) ($myLimbs[$j]) << $sub_shift) + | + ((int) ($myLimbs[$k]) >> (16 - $sub_shift)) + ) & 0xffff + ); + } + } + return $return; + } + + /** + * Rotate to the right + * + * @param int $c + * @return ParagonIE_Sodium_Core32_Int32 + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArrayAccess + */ + public function rotateRight($c = 0) + { + ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1); + /** @var int $c */ + $c = (int) $c; + + $return = new ParagonIE_Sodium_Core32_Int32(); + $return->unsignedInt = $this->unsignedInt; + $c &= 31; + /** @var int $c */ + if ($c === 0) { + // NOP, but we want a copy. + $return->limbs = $this->limbs; + } else { + /** @var int $c */ + + /** @var int $idx_shift */ + $idx_shift = ($c >> 4) & 1; + + /** @var int $sub_shift */ + $sub_shift = $c & 15; + + /** @var array $limbs */ + $limbs =& $return->limbs; + + /** @var array $myLimbs */ + $myLimbs =& $this->limbs; + + for ($i = 1; $i >= 0; --$i) { + /** @var int $j */ + $j = ($i - $idx_shift) & 1; + /** @var int $k */ + $k = ($i - $idx_shift - 1) & 1; + $limbs[$i] = (int) ( + ( + ((int) ($myLimbs[$j]) >> (int) ($sub_shift)) + | + ((int) ($myLimbs[$k]) << (16 - (int) ($sub_shift))) + ) & 0xffff + ); + } + } + return $return; + } + + /** + * @param bool $bool + * @return self + */ + public function setUnsignedInt($bool = false) + { + $this->unsignedInt = !empty($bool); + return $this; + } + + /** + * @param int $c + * @return ParagonIE_Sodium_Core32_Int32 + * @throws SodiumException + * @throws TypeError + */ + public function shiftLeft($c = 0) + { + ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1); + /** @var int $c */ + $c = (int) $c; + + $return = new ParagonIE_Sodium_Core32_Int32(); + $return->unsignedInt = $this->unsignedInt; + $c &= 63; + /** @var int $c */ + if ($c === 0) { + $return->limbs = $this->limbs; + } elseif ($c < 0) { + /** @var int $c */ + return $this->shiftRight(-$c); + } else { + /** @var int $c */ + /** @var int $tmp */ + $tmp = $this->limbs[1] << $c; + $return->limbs[1] = (int)($tmp & 0xffff); + /** @var int $carry */ + $carry = $tmp >> 16; + + /** @var int $tmp */ + $tmp = ($this->limbs[0] << $c) | ($carry & 0xffff); + $return->limbs[0] = (int) ($tmp & 0xffff); + } + return $return; + } + + /** + * @param int $c + * @return ParagonIE_Sodium_Core32_Int32 + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedAssignment + * @psalm-suppress MixedOperand + */ + public function shiftRight($c = 0) + { + ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1); + /** @var int $c */ + $c = (int) $c; + + $return = new ParagonIE_Sodium_Core32_Int32(); + $return->unsignedInt = $this->unsignedInt; + $c &= 63; + /** @var int $c */ + if ($c >= 16) { + $return->limbs = array( + (int) ($this->overflow & 0xffff), + (int) ($this->limbs[0]) + ); + $return->overflow = $this->overflow >> 16; + return $return->shiftRight($c & 15); + } + if ($c === 0) { + $return->limbs = $this->limbs; + } elseif ($c < 0) { + /** @var int $c */ + return $this->shiftLeft(-$c); + } else { + if (!is_int($c)) { + throw new TypeError(); + } + /** @var int $c */ + // $return->limbs[0] = (int) (($this->limbs[0] >> $c) & 0xffff); + $carryLeft = (int) ($this->overflow & ((1 << ($c + 1)) - 1)); + $return->limbs[0] = (int) ((($this->limbs[0] >> $c) | ($carryLeft << (16 - $c))) & 0xffff); + $carryRight = (int) ($this->limbs[0] & ((1 << ($c + 1)) - 1)); + $return->limbs[1] = (int) ((($this->limbs[1] >> $c) | ($carryRight << (16 - $c))) & 0xffff); + $return->overflow >>= $c; + } + return $return; + } + + /** + * Subtract a normal integer from an int32 object. + * + * @param int $int + * @return ParagonIE_Sodium_Core32_Int32 + * @throws SodiumException + * @throws TypeError + */ + public function subInt($int) + { + ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1); + /** @var int $int */ + $int = (int) $int; + + $return = new ParagonIE_Sodium_Core32_Int32(); + $return->unsignedInt = $this->unsignedInt; + + /** @var int $tmp */ + $tmp = $this->limbs[1] - ($int & 0xffff); + /** @var int $carry */ + $carry = $tmp >> 16; + $return->limbs[1] = (int) ($tmp & 0xffff); + + /** @var int $tmp */ + $tmp = $this->limbs[0] - (($int >> 16) & 0xffff) + $carry; + $return->limbs[0] = (int) ($tmp & 0xffff); + return $return; + } + + /** + * Subtract two int32 objects from each other + * + * @param ParagonIE_Sodium_Core32_Int32 $b + * @return ParagonIE_Sodium_Core32_Int32 + */ + public function subInt32(ParagonIE_Sodium_Core32_Int32 $b) + { + $return = new ParagonIE_Sodium_Core32_Int32(); + $return->unsignedInt = $this->unsignedInt; + + /** @var int $tmp */ + $tmp = $this->limbs[1] - ($b->limbs[1] & 0xffff); + /** @var int $carry */ + $carry = $tmp >> 16; + $return->limbs[1] = (int) ($tmp & 0xffff); + + /** @var int $tmp */ + $tmp = $this->limbs[0] - ($b->limbs[0] & 0xffff) + $carry; + $return->limbs[0] = (int) ($tmp & 0xffff); + return $return; + } + + /** + * XOR this 32-bit integer with another. + * + * @param ParagonIE_Sodium_Core32_Int32 $b + * @return ParagonIE_Sodium_Core32_Int32 + */ + public function xorInt32(ParagonIE_Sodium_Core32_Int32 $b) + { + $return = new ParagonIE_Sodium_Core32_Int32(); + $return->unsignedInt = $this->unsignedInt; + $return->limbs = array( + (int) ($this->limbs[0] ^ $b->limbs[0]), + (int) ($this->limbs[1] ^ $b->limbs[1]) + ); + return $return; + } + + /** + * @param int $signed + * @return self + * @throws SodiumException + * @throws TypeError + */ + public static function fromInt($signed) + { + ParagonIE_Sodium_Core32_Util::declareScalarType($signed, 'int', 1);; + /** @var int $signed */ + $signed = (int) $signed; + + return new ParagonIE_Sodium_Core32_Int32( + array( + (int) (($signed >> 16) & 0xffff), + (int) ($signed & 0xffff) + ) + ); + } + + /** + * @param string $string + * @return self + * @throws SodiumException + * @throws TypeError + */ + public static function fromString($string) + { + ParagonIE_Sodium_Core32_Util::declareScalarType($string, 'string', 1); + $string = (string) $string; + if (ParagonIE_Sodium_Core32_Util::strlen($string) !== 4) { + throw new RangeException( + 'String must be 4 bytes; ' . ParagonIE_Sodium_Core32_Util::strlen($string) . ' given.' + ); + } + $return = new ParagonIE_Sodium_Core32_Int32(); + + $return->limbs[0] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[0]) & 0xff) << 8); + $return->limbs[0] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[1]) & 0xff); + $return->limbs[1] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[2]) & 0xff) << 8); + $return->limbs[1] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[3]) & 0xff); + return $return; + } + + /** + * @param string $string + * @return self + * @throws SodiumException + * @throws TypeError + */ + public static function fromReverseString($string) + { + ParagonIE_Sodium_Core32_Util::declareScalarType($string, 'string', 1); + $string = (string) $string; + if (ParagonIE_Sodium_Core32_Util::strlen($string) !== 4) { + throw new RangeException( + 'String must be 4 bytes; ' . ParagonIE_Sodium_Core32_Util::strlen($string) . ' given.' + ); + } + $return = new ParagonIE_Sodium_Core32_Int32(); + + $return->limbs[0] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[3]) & 0xff) << 8); + $return->limbs[0] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[2]) & 0xff); + $return->limbs[1] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[1]) & 0xff) << 8); + $return->limbs[1] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[0]) & 0xff); + return $return; + } + + /** + * @return array + */ + public function toArray() + { + return array((int) ($this->limbs[0] << 16 | $this->limbs[1])); + } + + /** + * @return string + * @throws TypeError + */ + public function toString() + { + return + ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[0] >> 8) & 0xff) . + ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[0] & 0xff) . + ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[1] >> 8) & 0xff) . + ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[1] & 0xff); + } + + /** + * @return int + */ + public function toInt() + { + return (int) ( + (($this->limbs[0] & 0xffff) << 16) + | + ($this->limbs[1] & 0xffff) + ); + } + + /** + * @return ParagonIE_Sodium_Core32_Int32 + */ + public function toInt32() + { + $return = new ParagonIE_Sodium_Core32_Int32(); + $return->limbs[0] = (int) ($this->limbs[0] & 0xffff); + $return->limbs[1] = (int) ($this->limbs[1] & 0xffff); + $return->unsignedInt = $this->unsignedInt; + $return->overflow = (int) ($this->overflow & 0x7fffffff); + return $return; + } + + /** + * @return ParagonIE_Sodium_Core32_Int64 + */ + public function toInt64() + { + $return = new ParagonIE_Sodium_Core32_Int64(); + $return->unsignedInt = $this->unsignedInt; + if ($this->unsignedInt) { + $return->limbs[0] += (($this->overflow >> 16) & 0xffff); + $return->limbs[1] += (($this->overflow) & 0xffff); + } else { + $neg = -(($this->limbs[0] >> 15) & 1); + $return->limbs[0] = (int)($neg & 0xffff); + $return->limbs[1] = (int)($neg & 0xffff); + } + $return->limbs[2] = (int) ($this->limbs[0] & 0xffff); + $return->limbs[3] = (int) ($this->limbs[1] & 0xffff); + return $return; + } + + /** + * @return string + * @throws TypeError + */ + public function toReverseString() + { + return ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[1] & 0xff) . + ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[1] >> 8) & 0xff) . + ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[0] & 0xff) . + ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[0] >> 8) & 0xff); + } + + /** + * @return string + */ + public function __toString() + { + try { + return $this->toString(); + } catch (TypeError $ex) { + // PHP engine can't handle exceptions from __toString() + return ''; + } + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/Int64.php b/vendor/paragonie/sodium_compat/src/Core32/Int64.php new file mode 100644 index 0000000..dd06a3f --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/Int64.php @@ -0,0 +1,1066 @@ + - four 16-bit integers + */ + public $limbs = array(0, 0, 0, 0); + + /** + * @var int + */ + public $overflow = 0; + + /** + * @var bool + */ + public $unsignedInt = false; + + /** + * ParagonIE_Sodium_Core32_Int64 constructor. + * @param array $array + * @param bool $unsignedInt + */ + public function __construct($array = array(0, 0, 0, 0), $unsignedInt = false) + { + $this->limbs = array( + (int) $array[0], + (int) $array[1], + (int) $array[2], + (int) $array[3] + ); + $this->overflow = 0; + $this->unsignedInt = $unsignedInt; + } + + /** + * Adds two int64 objects + * + * @param ParagonIE_Sodium_Core32_Int64 $addend + * @return ParagonIE_Sodium_Core32_Int64 + */ + public function addInt64(ParagonIE_Sodium_Core32_Int64 $addend) + { + $i0 = $this->limbs[0]; + $i1 = $this->limbs[1]; + $i2 = $this->limbs[2]; + $i3 = $this->limbs[3]; + $j0 = $addend->limbs[0]; + $j1 = $addend->limbs[1]; + $j2 = $addend->limbs[2]; + $j3 = $addend->limbs[3]; + + $r3 = $i3 + ($j3 & 0xffff); + $carry = $r3 >> 16; + + $r2 = $i2 + ($j2 & 0xffff) + $carry; + $carry = $r2 >> 16; + + $r1 = $i1 + ($j1 & 0xffff) + $carry; + $carry = $r1 >> 16; + + $r0 = $i0 + ($j0 & 0xffff) + $carry; + $carry = $r0 >> 16; + + $r0 &= 0xffff; + $r1 &= 0xffff; + $r2 &= 0xffff; + $r3 &= 0xffff; + + $return = new ParagonIE_Sodium_Core32_Int64( + array($r0, $r1, $r2, $r3) + ); + $return->overflow = $carry; + $return->unsignedInt = $this->unsignedInt; + return $return; + } + + /** + * Adds a normal integer to an int64 object + * + * @param int $int + * @return ParagonIE_Sodium_Core32_Int64 + * @throws SodiumException + * @throws TypeError + */ + public function addInt($int) + { + ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1); + /** @var int $int */ + $int = (int) $int; + + $i0 = $this->limbs[0]; + $i1 = $this->limbs[1]; + $i2 = $this->limbs[2]; + $i3 = $this->limbs[3]; + + $r3 = $i3 + ($int & 0xffff); + $carry = $r3 >> 16; + + $r2 = $i2 + (($int >> 16) & 0xffff) + $carry; + $carry = $r2 >> 16; + + $r1 = $i1 + $carry; + $carry = $r1 >> 16; + + $r0 = $i0 + $carry; + $carry = $r0 >> 16; + + $r0 &= 0xffff; + $r1 &= 0xffff; + $r2 &= 0xffff; + $r3 &= 0xffff; + $return = new ParagonIE_Sodium_Core32_Int64( + array($r0, $r1, $r2, $r3) + ); + $return->overflow = $carry; + $return->unsignedInt = $this->unsignedInt; + return $return; + } + + /** + * @param int $b + * @return int + */ + public function compareInt($b = 0) + { + $gt = 0; + $eq = 1; + + $i = 4; + $j = 0; + while ($i > 0) { + --$i; + /** @var int $x1 */ + $x1 = $this->limbs[$i]; + /** @var int $x2 */ + $x2 = ($b >> ($j << 4)) & 0xffff; + /** int */ + $gt |= (($x2 - $x1) >> 8) & $eq; + /** int */ + $eq &= (($x2 ^ $x1) - 1) >> 8; + } + return ($gt + $gt - $eq) + 1; + } + + /** + * @param int $b + * @return bool + */ + public function isGreaterThan($b = 0) + { + return $this->compareInt($b) > 0; + } + + /** + * @param int $b + * @return bool + */ + public function isLessThanInt($b = 0) + { + return $this->compareInt($b) < 0; + } + + /** + * @param int $hi + * @param int $lo + * @return ParagonIE_Sodium_Core32_Int64 + */ + public function mask64($hi = 0, $lo = 0) + { + /** @var int $a */ + $a = ($hi >> 16) & 0xffff; + /** @var int $b */ + $b = ($hi) & 0xffff; + /** @var int $c */ + $c = ($lo >> 16) & 0xffff; + /** @var int $d */ + $d = ($lo & 0xffff); + return new ParagonIE_Sodium_Core32_Int64( + array( + $this->limbs[0] & $a, + $this->limbs[1] & $b, + $this->limbs[2] & $c, + $this->limbs[3] & $d + ), + $this->unsignedInt + ); + } + + /** + * @param int $int + * @param int $size + * @return ParagonIE_Sodium_Core32_Int64 + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedAssignment + */ + public function mulInt($int = 0, $size = 0) + { + if (ParagonIE_Sodium_Compat::$fastMult) { + return $this->mulIntFast($int); + } + ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1); + ParagonIE_Sodium_Core32_Util::declareScalarType($size, 'int', 2); + /** @var int $int */ + $int = (int) $int; + /** @var int $size */ + $size = (int) $size; + + if (!$size) { + $size = 63; + } + + $a = clone $this; + $return = new ParagonIE_Sodium_Core32_Int64(); + $return->unsignedInt = $this->unsignedInt; + + // Initialize: + $ret0 = 0; + $ret1 = 0; + $ret2 = 0; + $ret3 = 0; + $a0 = $a->limbs[0]; + $a1 = $a->limbs[1]; + $a2 = $a->limbs[2]; + $a3 = $a->limbs[3]; + + /** @var int $size */ + /** @var int $i */ + for ($i = $size; $i >= 0; --$i) { + $mask = -($int & 1); + $x0 = $a0 & $mask; + $x1 = $a1 & $mask; + $x2 = $a2 & $mask; + $x3 = $a3 & $mask; + + $ret3 += $x3; + $c = $ret3 >> 16; + + $ret2 += $x2 + $c; + $c = $ret2 >> 16; + + $ret1 += $x1 + $c; + $c = $ret1 >> 16; + + $ret0 += $x0 + $c; + + $ret0 &= 0xffff; + $ret1 &= 0xffff; + $ret2 &= 0xffff; + $ret3 &= 0xffff; + + $a3 = $a3 << 1; + $x3 = $a3 >> 16; + $a2 = ($a2 << 1) | $x3; + $x2 = $a2 >> 16; + $a1 = ($a1 << 1) | $x2; + $x1 = $a1 >> 16; + $a0 = ($a0 << 1) | $x1; + $a0 &= 0xffff; + $a1 &= 0xffff; + $a2 &= 0xffff; + $a3 &= 0xffff; + + $int >>= 1; + } + $return->limbs[0] = $ret0; + $return->limbs[1] = $ret1; + $return->limbs[2] = $ret2; + $return->limbs[3] = $ret3; + return $return; + } + + /** + * @param ParagonIE_Sodium_Core32_Int64 $A + * @param ParagonIE_Sodium_Core32_Int64 $B + * @return array + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedInferredReturnType + */ + public static function ctSelect( + ParagonIE_Sodium_Core32_Int64 $A, + ParagonIE_Sodium_Core32_Int64 $B + ) { + $a = clone $A; + $b = clone $B; + /** @var int $aNeg */ + $aNeg = ($a->limbs[0] >> 15) & 1; + /** @var int $bNeg */ + $bNeg = ($b->limbs[0] >> 15) & 1; + /** @var int $m */ + $m = (-($aNeg & $bNeg)) | 1; + /** @var int $swap */ + $swap = $bNeg & ~$aNeg; + /** @var int $d */ + $d = -$swap; + + /* + if ($bNeg && !$aNeg) { + $a = clone $int; + $b = clone $this; + } elseif($bNeg && $aNeg) { + $a = $this->mulInt(-1); + $b = $int->mulInt(-1); + } + */ + $x = $a->xorInt64($b)->mask64($d, $d); + return array( + $a->xorInt64($x)->mulInt($m), + $b->xorInt64($x)->mulInt($m) + ); + } + + /** + * @param array $a + * @param array $b + * @param int $baseLog2 + * @return array + */ + public function multiplyLong(array $a, array $b, $baseLog2 = 16) + { + $a_l = count($a); + $b_l = count($b); + /** @var array $r */ + $r = array_fill(0, $a_l + $b_l + 1, 0); + $base = 1 << $baseLog2; + for ($i = 0; $i < $a_l; ++$i) { + $a_i = $a[$i]; + for ($j = 0; $j < $a_l; ++$j) { + $b_j = $b[$j]; + $product = ($a_i * $b_j) + $r[$i + $j]; + $carry = ($product >> $baseLog2 & 0xffff); + $r[$i + $j] = ($product - (int) ($carry * $base)) & 0xffff; + $r[$i + $j + 1] += $carry; + } + } + return array_slice($r, 0, 5); + } + + /** + * @param int $int + * @return ParagonIE_Sodium_Core32_Int64 + */ + public function mulIntFast($int) + { + // Handle negative numbers + $aNeg = ($this->limbs[0] >> 15) & 1; + $bNeg = ($int >> 31) & 1; + $a = array_reverse($this->limbs); + $b = array( + $int & 0xffff, + ($int >> 16) & 0xffff, + -$bNeg & 0xffff, + -$bNeg & 0xffff + ); + if ($aNeg) { + for ($i = 0; $i < 4; ++$i) { + $a[$i] = ($a[$i] ^ 0xffff) & 0xffff; + } + ++$a[0]; + } + if ($bNeg) { + for ($i = 0; $i < 4; ++$i) { + $b[$i] = ($b[$i] ^ 0xffff) & 0xffff; + } + ++$b[0]; + } + // Multiply + $res = $this->multiplyLong($a, $b); + + // Re-apply negation to results + if ($aNeg !== $bNeg) { + for ($i = 0; $i < 4; ++$i) { + $res[$i] = (0xffff ^ $res[$i]) & 0xffff; + } + // Handle integer overflow + $c = 1; + for ($i = 0; $i < 4; ++$i) { + $res[$i] += $c; + $c = $res[$i] >> 16; + $res[$i] &= 0xffff; + } + } + + // Return our values + $return = new ParagonIE_Sodium_Core32_Int64(); + $return->limbs = array( + $res[3] & 0xffff, + $res[2] & 0xffff, + $res[1] & 0xffff, + $res[0] & 0xffff + ); + if (count($res) > 4) { + $return->overflow = $res[4] & 0xffff; + } + $return->unsignedInt = $this->unsignedInt; + return $return; + } + + /** + * @param ParagonIE_Sodium_Core32_Int64 $right + * @return ParagonIE_Sodium_Core32_Int64 + */ + public function mulInt64Fast(ParagonIE_Sodium_Core32_Int64 $right) + { + $aNeg = ($this->limbs[0] >> 15) & 1; + $bNeg = ($right->limbs[0] >> 15) & 1; + + $a = array_reverse($this->limbs); + $b = array_reverse($right->limbs); + if ($aNeg) { + for ($i = 0; $i < 4; ++$i) { + $a[$i] = ($a[$i] ^ 0xffff) & 0xffff; + } + ++$a[0]; + } + if ($bNeg) { + for ($i = 0; $i < 4; ++$i) { + $b[$i] = ($b[$i] ^ 0xffff) & 0xffff; + } + ++$b[0]; + } + $res = $this->multiplyLong($a, $b); + if ($aNeg !== $bNeg) { + if ($aNeg !== $bNeg) { + for ($i = 0; $i < 4; ++$i) { + $res[$i] = ($res[$i] ^ 0xffff) & 0xffff; + } + $c = 1; + for ($i = 0; $i < 4; ++$i) { + $res[$i] += $c; + $c = $res[$i] >> 16; + $res[$i] &= 0xffff; + } + } + } + $return = new ParagonIE_Sodium_Core32_Int64(); + $return->limbs = array( + $res[3] & 0xffff, + $res[2] & 0xffff, + $res[1] & 0xffff, + $res[0] & 0xffff + ); + if (count($res) > 4) { + $return->overflow = $res[4]; + } + return $return; + } + + /** + * @param ParagonIE_Sodium_Core32_Int64 $int + * @param int $size + * @return ParagonIE_Sodium_Core32_Int64 + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedAssignment + */ + public function mulInt64(ParagonIE_Sodium_Core32_Int64 $int, $size = 0) + { + if (ParagonIE_Sodium_Compat::$fastMult) { + return $this->mulInt64Fast($int); + } + ParagonIE_Sodium_Core32_Util::declareScalarType($size, 'int', 2); + if (!$size) { + $size = 63; + } + list($a, $b) = self::ctSelect($this, $int); + + $return = new ParagonIE_Sodium_Core32_Int64(); + $return->unsignedInt = $this->unsignedInt; + + // Initialize: + $ret0 = 0; + $ret1 = 0; + $ret2 = 0; + $ret3 = 0; + $a0 = $a->limbs[0]; + $a1 = $a->limbs[1]; + $a2 = $a->limbs[2]; + $a3 = $a->limbs[3]; + $b0 = $b->limbs[0]; + $b1 = $b->limbs[1]; + $b2 = $b->limbs[2]; + $b3 = $b->limbs[3]; + + /** @var int $size */ + /** @var int $i */ + for ($i = (int) $size; $i >= 0; --$i) { + $mask = -($b3 & 1); + $x0 = $a0 & $mask; + $x1 = $a1 & $mask; + $x2 = $a2 & $mask; + $x3 = $a3 & $mask; + + $ret3 += $x3; + $c = $ret3 >> 16; + + $ret2 += $x2 + $c; + $c = $ret2 >> 16; + + $ret1 += $x1 + $c; + $c = $ret1 >> 16; + + $ret0 += $x0 + $c; + + $ret0 &= 0xffff; + $ret1 &= 0xffff; + $ret2 &= 0xffff; + $ret3 &= 0xffff; + + $a3 = $a3 << 1; + $x3 = $a3 >> 16; + $a2 = ($a2 << 1) | $x3; + $x2 = $a2 >> 16; + $a1 = ($a1 << 1) | $x2; + $x1 = $a1 >> 16; + $a0 = ($a0 << 1) | $x1; + $a0 &= 0xffff; + $a1 &= 0xffff; + $a2 &= 0xffff; + $a3 &= 0xffff; + + $x0 = ($b0 & 1) << 16; + $x1 = ($b1 & 1) << 16; + $x2 = ($b2 & 1) << 16; + + $b0 = ($b0 >> 1); + $b1 = (($b1 | $x0) >> 1); + $b2 = (($b2 | $x1) >> 1); + $b3 = (($b3 | $x2) >> 1); + + $b0 &= 0xffff; + $b1 &= 0xffff; + $b2 &= 0xffff; + $b3 &= 0xffff; + + } + $return->limbs[0] = $ret0; + $return->limbs[1] = $ret1; + $return->limbs[2] = $ret2; + $return->limbs[3] = $ret3; + + return $return; + } + + /** + * OR this 64-bit integer with another. + * + * @param ParagonIE_Sodium_Core32_Int64 $b + * @return ParagonIE_Sodium_Core32_Int64 + */ + public function orInt64(ParagonIE_Sodium_Core32_Int64 $b) + { + $return = new ParagonIE_Sodium_Core32_Int64(); + $return->unsignedInt = $this->unsignedInt; + $return->limbs = array( + (int) ($this->limbs[0] | $b->limbs[0]), + (int) ($this->limbs[1] | $b->limbs[1]), + (int) ($this->limbs[2] | $b->limbs[2]), + (int) ($this->limbs[3] | $b->limbs[3]) + ); + return $return; + } + + /** + * @param int $c + * @return ParagonIE_Sodium_Core32_Int64 + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArrayAccess + */ + public function rotateLeft($c = 0) + { + ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1); + /** @var int $c */ + $c = (int) $c; + + $return = new ParagonIE_Sodium_Core32_Int64(); + $return->unsignedInt = $this->unsignedInt; + $c &= 63; + if ($c === 0) { + // NOP, but we want a copy. + $return->limbs = $this->limbs; + } else { + /** @var array $limbs */ + $limbs =& $return->limbs; + + /** @var array $myLimbs */ + $myLimbs =& $this->limbs; + + /** @var int $idx_shift */ + $idx_shift = ($c >> 4) & 3; + /** @var int $sub_shift */ + $sub_shift = $c & 15; + + for ($i = 3; $i >= 0; --$i) { + /** @var int $j */ + $j = ($i + $idx_shift) & 3; + /** @var int $k */ + $k = ($i + $idx_shift + 1) & 3; + $limbs[$i] = (int) ( + ( + ((int) ($myLimbs[$j]) << $sub_shift) + | + ((int) ($myLimbs[$k]) >> (16 - $sub_shift)) + ) & 0xffff + ); + } + } + return $return; + } + + /** + * Rotate to the right + * + * @param int $c + * @return ParagonIE_Sodium_Core32_Int64 + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedArrayAccess + */ + public function rotateRight($c = 0) + { + ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1); + /** @var int $c */ + $c = (int) $c; + + /** @var ParagonIE_Sodium_Core32_Int64 $return */ + $return = new ParagonIE_Sodium_Core32_Int64(); + $return->unsignedInt = $this->unsignedInt; + $c &= 63; + /** @var int $c */ + if ($c === 0) { + // NOP, but we want a copy. + $return->limbs = $this->limbs; + } else { + /** @var array $limbs */ + $limbs =& $return->limbs; + + /** @var array $myLimbs */ + $myLimbs =& $this->limbs; + + /** @var int $idx_shift */ + $idx_shift = ($c >> 4) & 3; + /** @var int $sub_shift */ + $sub_shift = $c & 15; + + for ($i = 3; $i >= 0; --$i) { + /** @var int $j */ + $j = ($i - $idx_shift) & 3; + /** @var int $k */ + $k = ($i - $idx_shift - 1) & 3; + $limbs[$i] = (int) ( + ( + ((int) ($myLimbs[$j]) >> (int) ($sub_shift)) + | + ((int) ($myLimbs[$k]) << (16 - (int) ($sub_shift))) + ) & 0xffff + ); + } + } + return $return; + } + /** + * @param int $c + * @return ParagonIE_Sodium_Core32_Int64 + * @throws SodiumException + * @throws TypeError + */ + public function shiftLeft($c = 0) + { + ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1); + /** @var int $c */ + $c = (int) $c; + + $return = new ParagonIE_Sodium_Core32_Int64(); + $return->unsignedInt = $this->unsignedInt; + $c &= 63; + + if ($c >= 16) { + if ($c >= 48) { + $return->limbs = array( + $this->limbs[3], 0, 0, 0 + ); + } elseif ($c >= 32) { + $return->limbs = array( + $this->limbs[2], $this->limbs[3], 0, 0 + ); + } else { + $return->limbs = array( + $this->limbs[1], $this->limbs[2], $this->limbs[3], 0 + ); + } + return $return->shiftLeft($c & 15); + } + if ($c === 0) { + $return->limbs = $this->limbs; + } elseif ($c < 0) { + /** @var int $c */ + return $this->shiftRight(-$c); + } else { + if (!is_int($c)) { + throw new TypeError(); + } + /** @var int $carry */ + $carry = 0; + for ($i = 3; $i >= 0; --$i) { + /** @var int $tmp */ + $tmp = ($this->limbs[$i] << $c) | ($carry & 0xffff); + $return->limbs[$i] = (int) ($tmp & 0xffff); + /** @var int $carry */ + $carry = $tmp >> 16; + } + } + return $return; + } + + /** + * @param int $c + * @return ParagonIE_Sodium_Core32_Int64 + * @throws SodiumException + * @throws TypeError + */ + public function shiftRight($c = 0) + { + ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1); + $c = (int) $c; + /** @var int $c */ + $return = new ParagonIE_Sodium_Core32_Int64(); + $return->unsignedInt = $this->unsignedInt; + $c &= 63; + + $negative = -(($this->limbs[0] >> 15) & 1); + if ($c >= 16) { + if ($c >= 48) { + $return->limbs = array( + (int) ($negative & 0xffff), + (int) ($negative & 0xffff), + (int) ($negative & 0xffff), + (int) $this->limbs[0] + ); + } elseif ($c >= 32) { + $return->limbs = array( + (int) ($negative & 0xffff), + (int) ($negative & 0xffff), + (int) $this->limbs[0], + (int) $this->limbs[1] + ); + } else { + $return->limbs = array( + (int) ($negative & 0xffff), + (int) $this->limbs[0], + (int) $this->limbs[1], + (int) $this->limbs[2] + ); + } + return $return->shiftRight($c & 15); + } + + if ($c === 0) { + $return->limbs = $this->limbs; + } elseif ($c < 0) { + return $this->shiftLeft(-$c); + } else { + if (!is_int($c)) { + throw new TypeError(); + } + /** @var int $carryRight */ + $carryRight = ($negative & 0xffff); + $mask = (int) (((1 << ($c + 1)) - 1) & 0xffff); + for ($i = 0; $i < 4; ++$i) { + $return->limbs[$i] = (int) ( + (($this->limbs[$i] >> $c) | ($carryRight << (16 - $c))) & 0xffff + ); + $carryRight = (int) ($this->limbs[$i] & $mask); + } + } + return $return; + } + + + /** + * Subtract a normal integer from an int64 object. + * + * @param int $int + * @return ParagonIE_Sodium_Core32_Int64 + * @throws SodiumException + * @throws TypeError + */ + public function subInt($int) + { + ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1); + $int = (int) $int; + + $return = new ParagonIE_Sodium_Core32_Int64(); + $return->unsignedInt = $this->unsignedInt; + + /** @var int $carry */ + $carry = 0; + for ($i = 3; $i >= 0; --$i) { + /** @var int $tmp */ + $tmp = $this->limbs[$i] - (($int >> 16) & 0xffff) + $carry; + /** @var int $carry */ + $carry = $tmp >> 16; + $return->limbs[$i] = (int) ($tmp & 0xffff); + } + return $return; + } + + /** + * The difference between two Int64 objects. + * + * @param ParagonIE_Sodium_Core32_Int64 $b + * @return ParagonIE_Sodium_Core32_Int64 + */ + public function subInt64(ParagonIE_Sodium_Core32_Int64 $b) + { + $return = new ParagonIE_Sodium_Core32_Int64(); + $return->unsignedInt = $this->unsignedInt; + /** @var int $carry */ + $carry = 0; + for ($i = 3; $i >= 0; --$i) { + /** @var int $tmp */ + $tmp = $this->limbs[$i] - $b->limbs[$i] + $carry; + /** @var int $carry */ + $carry = ($tmp >> 16); + $return->limbs[$i] = (int) ($tmp & 0xffff); + } + return $return; + } + + /** + * XOR this 64-bit integer with another. + * + * @param ParagonIE_Sodium_Core32_Int64 $b + * @return ParagonIE_Sodium_Core32_Int64 + */ + public function xorInt64(ParagonIE_Sodium_Core32_Int64 $b) + { + $return = new ParagonIE_Sodium_Core32_Int64(); + $return->unsignedInt = $this->unsignedInt; + $return->limbs = array( + (int) ($this->limbs[0] ^ $b->limbs[0]), + (int) ($this->limbs[1] ^ $b->limbs[1]), + (int) ($this->limbs[2] ^ $b->limbs[2]), + (int) ($this->limbs[3] ^ $b->limbs[3]) + ); + return $return; + } + + /** + * @param int $low + * @param int $high + * @return self + * @throws SodiumException + * @throws TypeError + */ + public static function fromInts($low, $high) + { + ParagonIE_Sodium_Core32_Util::declareScalarType($low, 'int', 1); + ParagonIE_Sodium_Core32_Util::declareScalarType($high, 'int', 2); + + $high = (int) $high; + $low = (int) $low; + return new ParagonIE_Sodium_Core32_Int64( + array( + (int) (($high >> 16) & 0xffff), + (int) ($high & 0xffff), + (int) (($low >> 16) & 0xffff), + (int) ($low & 0xffff) + ) + ); + } + + /** + * @param int $low + * @return self + * @throws SodiumException + * @throws TypeError + */ + public static function fromInt($low) + { + ParagonIE_Sodium_Core32_Util::declareScalarType($low, 'int', 1); + $low = (int) $low; + + return new ParagonIE_Sodium_Core32_Int64( + array( + 0, + 0, + (int) (($low >> 16) & 0xffff), + (int) ($low & 0xffff) + ) + ); + } + + /** + * @return int + */ + public function toInt() + { + return (int) ( + (($this->limbs[2] & 0xffff) << 16) + | + ($this->limbs[3] & 0xffff) + ); + } + + /** + * @param string $string + * @return self + * @throws SodiumException + * @throws TypeError + */ + public static function fromString($string) + { + ParagonIE_Sodium_Core32_Util::declareScalarType($string, 'string', 1); + $string = (string) $string; + if (ParagonIE_Sodium_Core32_Util::strlen($string) !== 8) { + throw new RangeException( + 'String must be 8 bytes; ' . ParagonIE_Sodium_Core32_Util::strlen($string) . ' given.' + ); + } + $return = new ParagonIE_Sodium_Core32_Int64(); + + $return->limbs[0] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[0]) & 0xff) << 8); + $return->limbs[0] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[1]) & 0xff); + $return->limbs[1] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[2]) & 0xff) << 8); + $return->limbs[1] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[3]) & 0xff); + $return->limbs[2] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[4]) & 0xff) << 8); + $return->limbs[2] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[5]) & 0xff); + $return->limbs[3] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[6]) & 0xff) << 8); + $return->limbs[3] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[7]) & 0xff); + return $return; + } + + /** + * @param string $string + * @return self + * @throws SodiumException + * @throws TypeError + */ + public static function fromReverseString($string) + { + ParagonIE_Sodium_Core32_Util::declareScalarType($string, 'string', 1); + $string = (string) $string; + if (ParagonIE_Sodium_Core32_Util::strlen($string) !== 8) { + throw new RangeException( + 'String must be 8 bytes; ' . ParagonIE_Sodium_Core32_Util::strlen($string) . ' given.' + ); + } + $return = new ParagonIE_Sodium_Core32_Int64(); + + $return->limbs[0] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[7]) & 0xff) << 8); + $return->limbs[0] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[6]) & 0xff); + $return->limbs[1] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[5]) & 0xff) << 8); + $return->limbs[1] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[4]) & 0xff); + $return->limbs[2] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[3]) & 0xff) << 8); + $return->limbs[2] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[2]) & 0xff); + $return->limbs[3] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[1]) & 0xff) << 8); + $return->limbs[3] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[0]) & 0xff); + return $return; + } + + /** + * @return array + */ + public function toArray() + { + return array( + (int) ((($this->limbs[0] & 0xffff) << 16) | ($this->limbs[1] & 0xffff)), + (int) ((($this->limbs[2] & 0xffff) << 16) | ($this->limbs[3] & 0xffff)) + ); + } + + /** + * @return ParagonIE_Sodium_Core32_Int32 + */ + public function toInt32() + { + $return = new ParagonIE_Sodium_Core32_Int32(); + $return->limbs[0] = (int) ($this->limbs[2]); + $return->limbs[1] = (int) ($this->limbs[3]); + $return->unsignedInt = $this->unsignedInt; + $return->overflow = (int) (ParagonIE_Sodium_Core32_Util::abs($this->limbs[1], 16) & 0xffff); + return $return; + } + + /** + * @return ParagonIE_Sodium_Core32_Int64 + */ + public function toInt64() + { + $return = new ParagonIE_Sodium_Core32_Int64(); + $return->limbs[0] = (int) ($this->limbs[0]); + $return->limbs[1] = (int) ($this->limbs[1]); + $return->limbs[2] = (int) ($this->limbs[2]); + $return->limbs[3] = (int) ($this->limbs[3]); + $return->unsignedInt = $this->unsignedInt; + $return->overflow = ParagonIE_Sodium_Core32_Util::abs($this->overflow); + return $return; + } + + /** + * @param bool $bool + * @return self + */ + public function setUnsignedInt($bool = false) + { + $this->unsignedInt = !empty($bool); + return $this; + } + + /** + * @return string + * @throws TypeError + */ + public function toString() + { + return ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[0] >> 8) & 0xff) . + ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[0] & 0xff) . + ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[1] >> 8) & 0xff) . + ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[1] & 0xff) . + ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[2] >> 8) & 0xff) . + ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[2] & 0xff) . + ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[3] >> 8) & 0xff) . + ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[3] & 0xff); + } + + /** + * @return string + * @throws TypeError + */ + public function toReverseString() + { + return ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[3] & 0xff) . + ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[3] >> 8) & 0xff) . + ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[2] & 0xff) . + ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[2] >> 8) & 0xff) . + ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[1] & 0xff) . + ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[1] >> 8) & 0xff) . + ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[0] & 0xff) . + ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[0] >> 8) & 0xff); + } + + /** + * @return string + */ + public function __toString() + { + try { + return $this->toString(); + } catch (TypeError $ex) { + // PHP engine can't handle exceptions from __toString() + return ''; + } + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/Poly1305.php b/vendor/paragonie/sodium_compat/src/Core32/Poly1305.php new file mode 100644 index 0000000..b9dfaf3 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/Poly1305.php @@ -0,0 +1,63 @@ +update($m) + ->finish(); + } + + /** + * @internal You should not use this directly from another application + * + * @param string $mac + * @param string $m + * @param string $key + * @return bool + * @throws SodiumException + * @throws TypeError + */ + public static function onetimeauth_verify($mac, $m, $key) + { + if (self::strlen($key) < 32) { + throw new InvalidArgumentException( + 'Key must be 32 bytes long.' + ); + } + $state = new ParagonIE_Sodium_Core32_Poly1305_State( + self::substr($key, 0, 32) + ); + $calc = $state + ->update($m) + ->finish(); + return self::verify_16($calc, $mac); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/Poly1305/State.php b/vendor/paragonie/sodium_compat/src/Core32/Poly1305/State.php new file mode 100644 index 0000000..d80e1ff --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/Poly1305/State.php @@ -0,0 +1,451 @@ + + */ + protected $buffer = array(); + + /** + * @var bool + */ + protected $final = false; + + /** + * @var array + */ + public $h; + + /** + * @var int + */ + protected $leftover = 0; + + /** + * @var array + */ + public $r; + + /** + * @var array + */ + public $pad; + + /** + * ParagonIE_Sodium_Core32_Poly1305_State constructor. + * + * @internal You should not use this directly from another application + * + * @param string $key + * @throws InvalidArgumentException + * @throws SodiumException + * @throws TypeError + */ + public function __construct($key = '') + { + if (self::strlen($key) < 32) { + throw new InvalidArgumentException( + 'Poly1305 requires a 32-byte key' + ); + } + /* r &= 0xffffffc0ffffffc0ffffffc0fffffff */ + $this->r = array( + // st->r[0] = ... + ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 0, 4)) + ->setUnsignedInt(true) + ->mask(0x3ffffff), + // st->r[1] = ... + ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 3, 4)) + ->setUnsignedInt(true) + ->shiftRight(2) + ->mask(0x3ffff03), + // st->r[2] = ... + ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 6, 4)) + ->setUnsignedInt(true) + ->shiftRight(4) + ->mask(0x3ffc0ff), + // st->r[3] = ... + ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 9, 4)) + ->setUnsignedInt(true) + ->shiftRight(6) + ->mask(0x3f03fff), + // st->r[4] = ... + ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 12, 4)) + ->setUnsignedInt(true) + ->shiftRight(8) + ->mask(0x00fffff) + ); + + /* h = 0 */ + $this->h = array( + new ParagonIE_Sodium_Core32_Int32(array(0, 0), true), + new ParagonIE_Sodium_Core32_Int32(array(0, 0), true), + new ParagonIE_Sodium_Core32_Int32(array(0, 0), true), + new ParagonIE_Sodium_Core32_Int32(array(0, 0), true), + new ParagonIE_Sodium_Core32_Int32(array(0, 0), true) + ); + + /* save pad for later */ + $this->pad = array( + ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 16, 4)) + ->setUnsignedInt(true)->toInt64(), + ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 20, 4)) + ->setUnsignedInt(true)->toInt64(), + ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 24, 4)) + ->setUnsignedInt(true)->toInt64(), + ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 28, 4)) + ->setUnsignedInt(true)->toInt64(), + ); + + $this->leftover = 0; + $this->final = false; + } + + /** + * @internal You should not use this directly from another application + * + * @param string $message + * @return self + * @throws SodiumException + * @throws TypeError + */ + public function update($message = '') + { + $bytes = self::strlen($message); + + /* handle leftover */ + if ($this->leftover) { + /** @var int $want */ + $want = ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE - $this->leftover; + if ($want > $bytes) { + $want = $bytes; + } + for ($i = 0; $i < $want; ++$i) { + $mi = self::chrToInt($message[$i]); + $this->buffer[$this->leftover + $i] = $mi; + } + // We snip off the leftmost bytes. + $message = self::substr($message, $want); + $bytes = self::strlen($message); + $this->leftover += $want; + if ($this->leftover < ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE) { + // We still don't have enough to run $this->blocks() + return $this; + } + + $this->blocks( + self::intArrayToString($this->buffer), + ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE + ); + $this->leftover = 0; + } + + /* process full blocks */ + if ($bytes >= ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE) { + /** @var int $want */ + $want = $bytes & ~(ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE - 1); + if ($want >= ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE) { + /** @var string $block */ + $block = self::substr($message, 0, $want); + if (self::strlen($block) >= ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE) { + $this->blocks($block, $want); + $message = self::substr($message, $want); + $bytes = self::strlen($message); + } + } + } + + /* store leftover */ + if ($bytes) { + for ($i = 0; $i < $bytes; ++$i) { + $mi = self::chrToInt($message[$i]); + $this->buffer[$this->leftover + $i] = $mi; + } + $this->leftover = (int) $this->leftover + $bytes; + } + return $this; + } + + /** + * @internal You should not use this directly from another application + * + * @param string $message + * @param int $bytes + * @return self + * @throws SodiumException + * @throws TypeError + */ + public function blocks($message, $bytes) + { + if (self::strlen($message) < 16) { + $message = str_pad($message, 16, "\x00", STR_PAD_RIGHT); + } + $hibit = ParagonIE_Sodium_Core32_Int32::fromInt((int) ($this->final ? 0 : 1 << 24)); /* 1 << 128 */ + $hibit->setUnsignedInt(true); + $zero = new ParagonIE_Sodium_Core32_Int64(array(0, 0, 0, 0), true); + /** + * @var ParagonIE_Sodium_Core32_Int64 $d0 + * @var ParagonIE_Sodium_Core32_Int64 $d1 + * @var ParagonIE_Sodium_Core32_Int64 $d2 + * @var ParagonIE_Sodium_Core32_Int64 $d3 + * @var ParagonIE_Sodium_Core32_Int64 $d4 + * @var ParagonIE_Sodium_Core32_Int64 $r0 + * @var ParagonIE_Sodium_Core32_Int64 $r1 + * @var ParagonIE_Sodium_Core32_Int64 $r2 + * @var ParagonIE_Sodium_Core32_Int64 $r3 + * @var ParagonIE_Sodium_Core32_Int64 $r4 + * + * @var ParagonIE_Sodium_Core32_Int32 $h0 + * @var ParagonIE_Sodium_Core32_Int32 $h1 + * @var ParagonIE_Sodium_Core32_Int32 $h2 + * @var ParagonIE_Sodium_Core32_Int32 $h3 + * @var ParagonIE_Sodium_Core32_Int32 $h4 + */ + $r0 = $this->r[0]->toInt64(); + $r1 = $this->r[1]->toInt64(); + $r2 = $this->r[2]->toInt64(); + $r3 = $this->r[3]->toInt64(); + $r4 = $this->r[4]->toInt64(); + + $s1 = $r1->toInt64()->mulInt(5, 3); + $s2 = $r2->toInt64()->mulInt(5, 3); + $s3 = $r3->toInt64()->mulInt(5, 3); + $s4 = $r4->toInt64()->mulInt(5, 3); + + $h0 = $this->h[0]; + $h1 = $this->h[1]; + $h2 = $this->h[2]; + $h3 = $this->h[3]; + $h4 = $this->h[4]; + + while ($bytes >= ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE) { + /* h += m[i] */ + $h0 = $h0->addInt32( + ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 0, 4)) + ->mask(0x3ffffff) + )->toInt64(); + $h1 = $h1->addInt32( + ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 3, 4)) + ->shiftRight(2) + ->mask(0x3ffffff) + )->toInt64(); + $h2 = $h2->addInt32( + ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 6, 4)) + ->shiftRight(4) + ->mask(0x3ffffff) + )->toInt64(); + $h3 = $h3->addInt32( + ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 9, 4)) + ->shiftRight(6) + ->mask(0x3ffffff) + )->toInt64(); + $h4 = $h4->addInt32( + ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 12, 4)) + ->shiftRight(8) + ->orInt32($hibit) + )->toInt64(); + + /* h *= r */ + $d0 = $zero + ->addInt64($h0->mulInt64($r0, 25)) + ->addInt64($s4->mulInt64($h1, 26)) + ->addInt64($s3->mulInt64($h2, 26)) + ->addInt64($s2->mulInt64($h3, 26)) + ->addInt64($s1->mulInt64($h4, 26)); + + $d1 = $zero + ->addInt64($h0->mulInt64($r1, 25)) + ->addInt64($h1->mulInt64($r0, 25)) + ->addInt64($s4->mulInt64($h2, 26)) + ->addInt64($s3->mulInt64($h3, 26)) + ->addInt64($s2->mulInt64($h4, 26)); + + $d2 = $zero + ->addInt64($h0->mulInt64($r2, 25)) + ->addInt64($h1->mulInt64($r1, 25)) + ->addInt64($h2->mulInt64($r0, 25)) + ->addInt64($s4->mulInt64($h3, 26)) + ->addInt64($s3->mulInt64($h4, 26)); + + $d3 = $zero + ->addInt64($h0->mulInt64($r3, 25)) + ->addInt64($h1->mulInt64($r2, 25)) + ->addInt64($h2->mulInt64($r1, 25)) + ->addInt64($h3->mulInt64($r0, 25)) + ->addInt64($s4->mulInt64($h4, 26)); + + $d4 = $zero + ->addInt64($h0->mulInt64($r4, 25)) + ->addInt64($h1->mulInt64($r3, 25)) + ->addInt64($h2->mulInt64($r2, 25)) + ->addInt64($h3->mulInt64($r1, 25)) + ->addInt64($h4->mulInt64($r0, 25)); + + /* (partial) h %= p */ + $c = $d0->shiftRight(26); + $h0 = $d0->toInt32()->mask(0x3ffffff); + $d1 = $d1->addInt64($c); + + $c = $d1->shiftRight(26); + $h1 = $d1->toInt32()->mask(0x3ffffff); + $d2 = $d2->addInt64($c); + + $c = $d2->shiftRight(26); + $h2 = $d2->toInt32()->mask(0x3ffffff); + $d3 = $d3->addInt64($c); + + $c = $d3->shiftRight(26); + $h3 = $d3->toInt32()->mask(0x3ffffff); + $d4 = $d4->addInt64($c); + + $c = $d4->shiftRight(26); + $h4 = $d4->toInt32()->mask(0x3ffffff); + $h0 = $h0->addInt32($c->toInt32()->mulInt(5, 3)); + + $c = $h0->shiftRight(26); + $h0 = $h0->mask(0x3ffffff); + $h1 = $h1->addInt32($c); + + // Chop off the left 32 bytes. + $message = self::substr( + $message, + ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE + ); + $bytes -= ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE; + } + + /** @var array $h */ + $this->h = array($h0, $h1, $h2, $h3, $h4); + return $this; + } + + /** + * @internal You should not use this directly from another application + * + * @return string + * @throws SodiumException + * @throws TypeError + */ + public function finish() + { + /* process the remaining block */ + if ($this->leftover) { + $i = $this->leftover; + $this->buffer[$i++] = 1; + for (; $i < ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE; ++$i) { + $this->buffer[$i] = 0; + } + $this->final = true; + $this->blocks( + self::substr( + self::intArrayToString($this->buffer), + 0, + ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE + ), + $b = ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE + ); + } + + /** + * @var ParagonIE_Sodium_Core32_Int32 $f + * @var ParagonIE_Sodium_Core32_Int32 $g0 + * @var ParagonIE_Sodium_Core32_Int32 $g1 + * @var ParagonIE_Sodium_Core32_Int32 $g2 + * @var ParagonIE_Sodium_Core32_Int32 $g3 + * @var ParagonIE_Sodium_Core32_Int32 $g4 + * @var ParagonIE_Sodium_Core32_Int32 $h0 + * @var ParagonIE_Sodium_Core32_Int32 $h1 + * @var ParagonIE_Sodium_Core32_Int32 $h2 + * @var ParagonIE_Sodium_Core32_Int32 $h3 + * @var ParagonIE_Sodium_Core32_Int32 $h4 + */ + $h0 = $this->h[0]; + $h1 = $this->h[1]; + $h2 = $this->h[2]; + $h3 = $this->h[3]; + $h4 = $this->h[4]; + + $c = $h1->shiftRight(26); # $c = $h1 >> 26; + $h1 = $h1->mask(0x3ffffff); # $h1 &= 0x3ffffff; + + $h2 = $h2->addInt32($c); # $h2 += $c; + $c = $h2->shiftRight(26); # $c = $h2 >> 26; + $h2 = $h2->mask(0x3ffffff); # $h2 &= 0x3ffffff; + + $h3 = $h3->addInt32($c); # $h3 += $c; + $c = $h3->shiftRight(26); # $c = $h3 >> 26; + $h3 = $h3->mask(0x3ffffff); # $h3 &= 0x3ffffff; + + $h4 = $h4->addInt32($c); # $h4 += $c; + $c = $h4->shiftRight(26); # $c = $h4 >> 26; + $h4 = $h4->mask(0x3ffffff); # $h4 &= 0x3ffffff; + + $h0 = $h0->addInt32($c->mulInt(5, 3)); # $h0 += self::mul($c, 5); + $c = $h0->shiftRight(26); # $c = $h0 >> 26; + $h0 = $h0->mask(0x3ffffff); # $h0 &= 0x3ffffff; + $h1 = $h1->addInt32($c); # $h1 += $c; + + /* compute h + -p */ + $g0 = $h0->addInt(5); + $c = $g0->shiftRight(26); + $g0 = $g0->mask(0x3ffffff); + $g1 = $h1->addInt32($c); + $c = $g1->shiftRight(26); + $g1 = $g1->mask(0x3ffffff); + $g2 = $h2->addInt32($c); + $c = $g2->shiftRight(26); + $g2 = $g2->mask(0x3ffffff); + $g3 = $h3->addInt32($c); + $c = $g3->shiftRight(26); + $g3 = $g3->mask(0x3ffffff); + $g4 = $h4->addInt32($c)->subInt(1 << 26); + + # $mask = ($g4 >> 31) - 1; + /* select h if h < p, or h + -p if h >= p */ + $mask = (int) (($g4->toInt() >> 31) + 1); + + $g0 = $g0->mask($mask); + $g1 = $g1->mask($mask); + $g2 = $g2->mask($mask); + $g3 = $g3->mask($mask); + $g4 = $g4->mask($mask); + + /** @var int $mask */ + $mask = (~$mask) & 0xffffffff; + + $h0 = $h0->mask($mask)->orInt32($g0); + $h1 = $h1->mask($mask)->orInt32($g1); + $h2 = $h2->mask($mask)->orInt32($g2); + $h3 = $h3->mask($mask)->orInt32($g3); + $h4 = $h4->mask($mask)->orInt32($g4); + + /* h = h % (2^128) */ + $h0 = $h0->orInt32($h1->shiftLeft(26)); + $h1 = $h1->shiftRight(6)->orInt32($h2->shiftLeft(20)); + $h2 = $h2->shiftRight(12)->orInt32($h3->shiftLeft(14)); + $h3 = $h3->shiftRight(18)->orInt32($h4->shiftLeft(8)); + + /* mac = (h + pad) % (2^128) */ + $f = $h0->toInt64()->addInt64($this->pad[0]); + $h0 = $f->toInt32(); + $f = $h1->toInt64()->addInt64($this->pad[1])->addInt($h0->overflow); + $h1 = $f->toInt32(); + $f = $h2->toInt64()->addInt64($this->pad[2])->addInt($h1->overflow); + $h2 = $f->toInt32(); + $f = $h3->toInt64()->addInt64($this->pad[3])->addInt($h2->overflow); + $h3 = $f->toInt32(); + + return $h0->toReverseString() . + $h1->toReverseString() . + $h2->toReverseString() . + $h3->toReverseString(); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/Salsa20.php b/vendor/paragonie/sodium_compat/src/Core32/Salsa20.php new file mode 100644 index 0000000..d8c8073 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/Salsa20.php @@ -0,0 +1,306 @@ + 0; $i -= 2) { + $x4 = $x4->xorInt32($x0->addInt32($x12)->rotateLeft(7)); + $x8 = $x8->xorInt32($x4->addInt32($x0)->rotateLeft(9)); + $x12 = $x12->xorInt32($x8->addInt32($x4)->rotateLeft(13)); + $x0 = $x0->xorInt32($x12->addInt32($x8)->rotateLeft(18)); + + $x9 = $x9->xorInt32($x5->addInt32($x1)->rotateLeft(7)); + $x13 = $x13->xorInt32($x9->addInt32($x5)->rotateLeft(9)); + $x1 = $x1->xorInt32($x13->addInt32($x9)->rotateLeft(13)); + $x5 = $x5->xorInt32($x1->addInt32($x13)->rotateLeft(18)); + + $x14 = $x14->xorInt32($x10->addInt32($x6)->rotateLeft(7)); + $x2 = $x2->xorInt32($x14->addInt32($x10)->rotateLeft(9)); + $x6 = $x6->xorInt32($x2->addInt32($x14)->rotateLeft(13)); + $x10 = $x10->xorInt32($x6->addInt32($x2)->rotateLeft(18)); + + $x3 = $x3->xorInt32($x15->addInt32($x11)->rotateLeft(7)); + $x7 = $x7->xorInt32($x3->addInt32($x15)->rotateLeft(9)); + $x11 = $x11->xorInt32($x7->addInt32($x3)->rotateLeft(13)); + $x15 = $x15->xorInt32($x11->addInt32($x7)->rotateLeft(18)); + + $x1 = $x1->xorInt32($x0->addInt32($x3)->rotateLeft(7)); + $x2 = $x2->xorInt32($x1->addInt32($x0)->rotateLeft(9)); + $x3 = $x3->xorInt32($x2->addInt32($x1)->rotateLeft(13)); + $x0 = $x0->xorInt32($x3->addInt32($x2)->rotateLeft(18)); + + $x6 = $x6->xorInt32($x5->addInt32($x4)->rotateLeft(7)); + $x7 = $x7->xorInt32($x6->addInt32($x5)->rotateLeft(9)); + $x4 = $x4->xorInt32($x7->addInt32($x6)->rotateLeft(13)); + $x5 = $x5->xorInt32($x4->addInt32($x7)->rotateLeft(18)); + + $x11 = $x11->xorInt32($x10->addInt32($x9)->rotateLeft(7)); + $x8 = $x8->xorInt32($x11->addInt32($x10)->rotateLeft(9)); + $x9 = $x9->xorInt32($x8->addInt32($x11)->rotateLeft(13)); + $x10 = $x10->xorInt32($x9->addInt32($x8)->rotateLeft(18)); + + $x12 = $x12->xorInt32($x15->addInt32($x14)->rotateLeft(7)); + $x13 = $x13->xorInt32($x12->addInt32($x15)->rotateLeft(9)); + $x14 = $x14->xorInt32($x13->addInt32($x12)->rotateLeft(13)); + $x15 = $x15->xorInt32($x14->addInt32($x13)->rotateLeft(18)); + } + + $x0 = $x0->addInt32($j0); + $x1 = $x1->addInt32($j1); + $x2 = $x2->addInt32($j2); + $x3 = $x3->addInt32($j3); + $x4 = $x4->addInt32($j4); + $x5 = $x5->addInt32($j5); + $x6 = $x6->addInt32($j6); + $x7 = $x7->addInt32($j7); + $x8 = $x8->addInt32($j8); + $x9 = $x9->addInt32($j9); + $x10 = $x10->addInt32($j10); + $x11 = $x11->addInt32($j11); + $x12 = $x12->addInt32($j12); + $x13 = $x13->addInt32($j13); + $x14 = $x14->addInt32($j14); + $x15 = $x15->addInt32($j15); + + return $x0->toReverseString() . + $x1->toReverseString() . + $x2->toReverseString() . + $x3->toReverseString() . + $x4->toReverseString() . + $x5->toReverseString() . + $x6->toReverseString() . + $x7->toReverseString() . + $x8->toReverseString() . + $x9->toReverseString() . + $x10->toReverseString() . + $x11->toReverseString() . + $x12->toReverseString() . + $x13->toReverseString() . + $x14->toReverseString() . + $x15->toReverseString(); + } + + /** + * @internal You should not use this directly from another application + * + * @param int $len + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function salsa20($len, $nonce, $key) + { + if (self::strlen($key) !== 32) { + throw new RangeException('Key must be 32 bytes long'); + } + $kcopy = '' . $key; + $in = self::substr($nonce, 0, 8) . str_repeat("\0", 8); + $c = ''; + while ($len >= 64) { + $c .= self::core_salsa20($in, $kcopy, null); + $u = 1; + // Internal counter. + for ($i = 8; $i < 16; ++$i) { + $u += self::chrToInt($in[$i]); + $in[$i] = self::intToChr($u & 0xff); + $u >>= 8; + } + $len -= 64; + } + if ($len > 0) { + $c .= self::substr( + self::core_salsa20($in, $kcopy, null), + 0, + $len + ); + } + try { + ParagonIE_Sodium_Compat::memzero($kcopy); + } catch (SodiumException $ex) { + $kcopy = null; + } + return $c; + } + + /** + * @internal You should not use this directly from another application + * + * @param string $m + * @param string $n + * @param int $ic + * @param string $k + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function salsa20_xor_ic($m, $n, $ic, $k) + { + $mlen = self::strlen($m); + if ($mlen < 1) { + return ''; + } + $kcopy = self::substr($k, 0, 32); + $in = self::substr($n, 0, 8); + // Initialize the counter + $in .= ParagonIE_Sodium_Core32_Util::store64_le($ic); + + $c = ''; + while ($mlen >= 64) { + $block = self::core_salsa20($in, $kcopy, null); + $c .= self::xorStrings( + self::substr($m, 0, 64), + self::substr($block, 0, 64) + ); + $u = 1; + for ($i = 8; $i < 16; ++$i) { + $u += self::chrToInt($in[$i]); + $in[$i] = self::intToChr($u & 0xff); + $u >>= 8; + } + + $mlen -= 64; + $m = self::substr($m, 64); + } + + if ($mlen) { + $block = self::core_salsa20($in, $kcopy, null); + $c .= self::xorStrings( + self::substr($m, 0, $mlen), + self::substr($block, 0, $mlen) + ); + } + try { + ParagonIE_Sodium_Compat::memzero($block); + ParagonIE_Sodium_Compat::memzero($kcopy); + } catch (SodiumException $ex) { + $block = null; + $kcopy = null; + } + + return $c; + } + + /** + * @internal You should not use this directly from another application + * + * @param string $message + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function salsa20_xor($message, $nonce, $key) + { + return self::xorStrings( + $message, + self::salsa20( + self::strlen($message), + $nonce, + $key + ) + ); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/SecretStream/State.php b/vendor/paragonie/sodium_compat/src/Core32/SecretStream/State.php new file mode 100644 index 0000000..6f20486 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/SecretStream/State.php @@ -0,0 +1,163 @@ +key = $key; + $this->counter = 1; + if (is_null($nonce)) { + $nonce = str_repeat("\0", 12); + } + $this->nonce = str_pad($nonce, 12, "\0", STR_PAD_RIGHT);; + $this->_pad = str_repeat("\0", 4); + } + + /** + * @return self + */ + public function counterReset() + { + $this->counter = 1; + $this->_pad = str_repeat("\0", 4); + return $this; + } + + /** + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * @return string + */ + public function getCounter() + { + return ParagonIE_Sodium_Core32_Util::store32_le($this->counter); + } + + /** + * @return string + */ + public function getNonce() + { + if (!is_string($this->nonce)) { + $this->nonce = str_repeat("\0", 12); + } + if (ParagonIE_Sodium_Core32_Util::strlen($this->nonce) !== 12) { + $this->nonce = str_pad($this->nonce, 12, "\0", STR_PAD_RIGHT); + } + return $this->nonce; + } + + /** + * @return string + */ + public function getCombinedNonce() + { + return $this->getCounter() . + ParagonIE_Sodium_Core32_Util::substr($this->getNonce(), 0, 8); + } + + /** + * @return self + */ + public function incrementCounter() + { + ++$this->counter; + return $this; + } + + /** + * @return bool + */ + public function needsRekey() + { + return ($this->counter & 0xffff) === 0; + } + + /** + * @param string $newKeyAndNonce + * @return self + */ + public function rekey($newKeyAndNonce) + { + $this->key = ParagonIE_Sodium_Core32_Util::substr($newKeyAndNonce, 0, 32); + $this->nonce = str_pad( + ParagonIE_Sodium_Core32_Util::substr($newKeyAndNonce, 32), + 12, + "\0", + STR_PAD_RIGHT + ); + return $this; + } + + /** + * @param string $str + * @return self + */ + public function xorNonce($str) + { + $this->nonce = ParagonIE_Sodium_Core32_Util::xorStrings( + $this->getNonce(), + str_pad( + ParagonIE_Sodium_Core32_Util::substr($str, 0, 8), + 12, + "\0", + STR_PAD_RIGHT + ) + ); + return $this; + } + + /** + * @param string $string + * @return self + */ + public static function fromString($string) + { + $state = new ParagonIE_Sodium_Core32_SecretStream_State( + ParagonIE_Sodium_Core32_Util::substr($string, 0, 32) + ); + $state->counter = ParagonIE_Sodium_Core32_Util::load_4( + ParagonIE_Sodium_Core32_Util::substr($string, 32, 4) + ); + $state->nonce = ParagonIE_Sodium_Core32_Util::substr($string, 36, 12); + $state->_pad = ParagonIE_Sodium_Core32_Util::substr($string, 48, 8); + return $state; + } + + /** + * @return string + */ + public function toString() + { + return $this->key . + $this->getCounter() . + $this->nonce . + $this->_pad; + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/SipHash.php b/vendor/paragonie/sodium_compat/src/Core32/SipHash.php new file mode 100644 index 0000000..079946d --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/SipHash.php @@ -0,0 +1,238 @@ + $v + * @return array + */ + public static function sipRound(array $v) + { + # v0 += v1; + $v[0] = $v[0]->addInt64($v[1]); + + # v1 = ROTL(v1, 13); + $v[1] = $v[1]->rotateLeft(13); + + # v1 ^= v0; + $v[1] = $v[1]->xorInt64($v[0]); + + # v0=ROTL(v0,32); + $v[0] = $v[0]->rotateLeft(32); + + # v2 += v3; + $v[2] = $v[2]->addInt64($v[3]); + + # v3=ROTL(v3,16); + $v[3] = $v[3]->rotateLeft(16); + + # v3 ^= v2; + $v[3] = $v[3]->xorInt64($v[2]); + + # v0 += v3; + $v[0] = $v[0]->addInt64($v[3]); + + # v3=ROTL(v3,21); + $v[3] = $v[3]->rotateLeft(21); + + # v3 ^= v0; + $v[3] = $v[3]->xorInt64($v[0]); + + # v2 += v1; + $v[2] = $v[2]->addInt64($v[1]); + + # v1=ROTL(v1,17); + $v[1] = $v[1]->rotateLeft(17); + + # v1 ^= v2; + $v[1] = $v[1]->xorInt64($v[2]); + + # v2=ROTL(v2,32) + $v[2] = $v[2]->rotateLeft(32); + + return $v; + } + + /** + * @internal You should not use this directly from another application + * + * @param string $in + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function sipHash24($in, $key) + { + $inlen = self::strlen($in); + + # /* "somepseudorandomlygeneratedbytes" */ + # u64 v0 = 0x736f6d6570736575ULL; + # u64 v1 = 0x646f72616e646f6dULL; + # u64 v2 = 0x6c7967656e657261ULL; + # u64 v3 = 0x7465646279746573ULL; + $v = array( + new ParagonIE_Sodium_Core32_Int64( + array(0x736f, 0x6d65, 0x7073, 0x6575) + ), + new ParagonIE_Sodium_Core32_Int64( + array(0x646f, 0x7261, 0x6e64, 0x6f6d) + ), + new ParagonIE_Sodium_Core32_Int64( + array(0x6c79, 0x6765, 0x6e65, 0x7261) + ), + new ParagonIE_Sodium_Core32_Int64( + array(0x7465, 0x6462, 0x7974, 0x6573) + ) + ); + + # u64 k0 = LOAD64_LE( k ); + # u64 k1 = LOAD64_LE( k + 8 ); + $k = array( + ParagonIE_Sodium_Core32_Int64::fromReverseString( + self::substr($key, 0, 8) + ), + ParagonIE_Sodium_Core32_Int64::fromReverseString( + self::substr($key, 8, 8) + ) + ); + + # b = ( ( u64 )inlen ) << 56; + $b = new ParagonIE_Sodium_Core32_Int64( + array(($inlen << 8) & 0xffff, 0, 0, 0) + ); + + # v3 ^= k1; + $v[3] = $v[3]->xorInt64($k[1]); + # v2 ^= k0; + $v[2] = $v[2]->xorInt64($k[0]); + # v1 ^= k1; + $v[1] = $v[1]->xorInt64($k[1]); + # v0 ^= k0; + $v[0] = $v[0]->xorInt64($k[0]); + + $left = $inlen; + # for ( ; in != end; in += 8 ) + while ($left >= 8) { + # m = LOAD64_LE( in ); + $m = ParagonIE_Sodium_Core32_Int64::fromReverseString( + self::substr($in, 0, 8) + ); + + # v3 ^= m; + $v[3] = $v[3]->xorInt64($m); + + # SIPROUND; + # SIPROUND; + $v = self::sipRound($v); + $v = self::sipRound($v); + + # v0 ^= m; + $v[0] = $v[0]->xorInt64($m); + + $in = self::substr($in, 8); + $left -= 8; + } + + # switch( left ) + # { + # case 7: b |= ( ( u64 )in[ 6] ) << 48; + # case 6: b |= ( ( u64 )in[ 5] ) << 40; + # case 5: b |= ( ( u64 )in[ 4] ) << 32; + # case 4: b |= ( ( u64 )in[ 3] ) << 24; + # case 3: b |= ( ( u64 )in[ 2] ) << 16; + # case 2: b |= ( ( u64 )in[ 1] ) << 8; + # case 1: b |= ( ( u64 )in[ 0] ); break; + # case 0: break; + # } + switch ($left) { + case 7: + $b = $b->orInt64( + ParagonIE_Sodium_Core32_Int64::fromInts( + 0, self::chrToInt($in[6]) << 16 + ) + ); + case 6: + $b = $b->orInt64( + ParagonIE_Sodium_Core32_Int64::fromInts( + 0, self::chrToInt($in[5]) << 8 + ) + ); + case 5: + $b = $b->orInt64( + ParagonIE_Sodium_Core32_Int64::fromInts( + 0, self::chrToInt($in[4]) + ) + ); + case 4: + $b = $b->orInt64( + ParagonIE_Sodium_Core32_Int64::fromInts( + self::chrToInt($in[3]) << 24, 0 + ) + ); + case 3: + $b = $b->orInt64( + ParagonIE_Sodium_Core32_Int64::fromInts( + self::chrToInt($in[2]) << 16, 0 + ) + ); + case 2: + $b = $b->orInt64( + ParagonIE_Sodium_Core32_Int64::fromInts( + self::chrToInt($in[1]) << 8, 0 + ) + ); + case 1: + $b = $b->orInt64( + ParagonIE_Sodium_Core32_Int64::fromInts( + self::chrToInt($in[0]), 0 + ) + ); + case 0: + break; + } + + # v3 ^= b; + $v[3] = $v[3]->xorInt64($b); + + # SIPROUND; + # SIPROUND; + $v = self::sipRound($v); + $v = self::sipRound($v); + + # v0 ^= b; + $v[0] = $v[0]->xorInt64($b); + + // Flip the lower 8 bits of v2 which is ($v[4], $v[5]) in our implementation + # v2 ^= 0xff; + $v[2]->limbs[3] ^= 0xff; + + # SIPROUND; + # SIPROUND; + # SIPROUND; + # SIPROUND; + $v = self::sipRound($v); + $v = self::sipRound($v); + $v = self::sipRound($v); + $v = self::sipRound($v); + + # b = v0 ^ v1 ^ v2 ^ v3; + # STORE64_LE( out, b ); + return $v[0] + ->xorInt64($v[1]) + ->xorInt64($v[2]) + ->xorInt64($v[3]) + ->toReverseString(); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/Util.php b/vendor/paragonie/sodium_compat/src/Core32/Util.php new file mode 100644 index 0000000..f32e5ad --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/Util.php @@ -0,0 +1,13 @@ +toInt(); + $f1 = (int) $f[1]->toInt(); + $f2 = (int) $f[2]->toInt(); + $f3 = (int) $f[3]->toInt(); + $f4 = (int) $f[4]->toInt(); + $f5 = (int) $f[5]->toInt(); + $f6 = (int) $f[6]->toInt(); + $f7 = (int) $f[7]->toInt(); + $f8 = (int) $f[8]->toInt(); + $f9 = (int) $f[9]->toInt(); + $g0 = (int) $g[0]->toInt(); + $g1 = (int) $g[1]->toInt(); + $g2 = (int) $g[2]->toInt(); + $g3 = (int) $g[3]->toInt(); + $g4 = (int) $g[4]->toInt(); + $g5 = (int) $g[5]->toInt(); + $g6 = (int) $g[6]->toInt(); + $g7 = (int) $g[7]->toInt(); + $g8 = (int) $g[8]->toInt(); + $g9 = (int) $g[9]->toInt(); + $b = -$b; + /** @var int $x0 */ + $x0 = ($f0 ^ $g0) & $b; + /** @var int $x1 */ + $x1 = ($f1 ^ $g1) & $b; + /** @var int $x2 */ + $x2 = ($f2 ^ $g2) & $b; + /** @var int $x3 */ + $x3 = ($f3 ^ $g3) & $b; + /** @var int $x4 */ + $x4 = ($f4 ^ $g4) & $b; + /** @var int $x5 */ + $x5 = ($f5 ^ $g5) & $b; + /** @var int $x6 */ + $x6 = ($f6 ^ $g6) & $b; + /** @var int $x7 */ + $x7 = ($f7 ^ $g7) & $b; + /** @var int $x8 */ + $x8 = ($f8 ^ $g8) & $b; + /** @var int $x9 */ + $x9 = ($f9 ^ $g9) & $b; + $f[0] = ParagonIE_Sodium_Core32_Int32::fromInt($f0 ^ $x0); + $f[1] = ParagonIE_Sodium_Core32_Int32::fromInt($f1 ^ $x1); + $f[2] = ParagonIE_Sodium_Core32_Int32::fromInt($f2 ^ $x2); + $f[3] = ParagonIE_Sodium_Core32_Int32::fromInt($f3 ^ $x3); + $f[4] = ParagonIE_Sodium_Core32_Int32::fromInt($f4 ^ $x4); + $f[5] = ParagonIE_Sodium_Core32_Int32::fromInt($f5 ^ $x5); + $f[6] = ParagonIE_Sodium_Core32_Int32::fromInt($f6 ^ $x6); + $f[7] = ParagonIE_Sodium_Core32_Int32::fromInt($f7 ^ $x7); + $f[8] = ParagonIE_Sodium_Core32_Int32::fromInt($f8 ^ $x8); + $f[9] = ParagonIE_Sodium_Core32_Int32::fromInt($f9 ^ $x9); + $g[0] = ParagonIE_Sodium_Core32_Int32::fromInt($g0 ^ $x0); + $g[1] = ParagonIE_Sodium_Core32_Int32::fromInt($g1 ^ $x1); + $g[2] = ParagonIE_Sodium_Core32_Int32::fromInt($g2 ^ $x2); + $g[3] = ParagonIE_Sodium_Core32_Int32::fromInt($g3 ^ $x3); + $g[4] = ParagonIE_Sodium_Core32_Int32::fromInt($g4 ^ $x4); + $g[5] = ParagonIE_Sodium_Core32_Int32::fromInt($g5 ^ $x5); + $g[6] = ParagonIE_Sodium_Core32_Int32::fromInt($g6 ^ $x6); + $g[7] = ParagonIE_Sodium_Core32_Int32::fromInt($g7 ^ $x7); + $g[8] = ParagonIE_Sodium_Core32_Int32::fromInt($g8 ^ $x8); + $g[9] = ParagonIE_Sodium_Core32_Int32::fromInt($g9 ^ $x9); + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f + * @return ParagonIE_Sodium_Core32_Curve25519_Fe + * @throws SodiumException + * @throws TypeError + * @psalm-suppress MixedAssignment + * @psalm-suppress MixedMethodCall + */ + public static function fe_mul121666(ParagonIE_Sodium_Core32_Curve25519_Fe $f) + { + /** @var array $h */ + $h = array(); + for ($i = 0; $i < 10; ++$i) { + $h[$i] = $f[$i]->toInt64()->mulInt(121666, 17); + } + + $carry9 = $h[9]->addInt(1 << 24)->shiftRight(25); + $h[0] = $h[0]->addInt64($carry9->mulInt(19, 5)); + $h[9] = $h[9]->subInt64($carry9->shiftLeft(25)); + + $carry1 = $h[1]->addInt(1 << 24)->shiftRight(25); + $h[2] = $h[2]->addInt64($carry1); + $h[1] = $h[1]->subInt64($carry1->shiftLeft(25)); + + $carry3 = $h[3]->addInt(1 << 24)->shiftRight(25); + $h[4] = $h[4]->addInt64($carry3); + $h[3] = $h[3]->subInt64($carry3->shiftLeft(25)); + + $carry5 = $h[5]->addInt(1 << 24)->shiftRight(25); + $h[6] = $h[6]->addInt64($carry5); + $h[5] = $h[5]->subInt64($carry5->shiftLeft(25)); + + $carry7 = $h[7]->addInt(1 << 24)->shiftRight(25); + $h[8] = $h[8]->addInt64($carry7); + $h[7] = $h[7]->subInt64($carry7->shiftLeft(25)); + + $carry0 = $h[0]->addInt(1 << 25)->shiftRight(26); + $h[1] = $h[1]->addInt64($carry0); + $h[0] = $h[0]->subInt64($carry0->shiftLeft(26)); + + $carry2 = $h[2]->addInt(1 << 25)->shiftRight(26); + $h[3] = $h[3]->addInt64($carry2); + $h[2] = $h[2]->subInt64($carry2->shiftLeft(26)); + + $carry4 = $h[4]->addInt(1 << 25)->shiftRight(26); + $h[5] = $h[5]->addInt64($carry4); + $h[4] = $h[4]->subInt64($carry4->shiftLeft(26)); + + $carry6 = $h[6]->addInt(1 << 25)->shiftRight(26); + $h[7] = $h[7]->addInt64($carry6); + $h[6] = $h[6]->subInt64($carry6->shiftLeft(26)); + + $carry8 = $h[8]->addInt(1 << 25)->shiftRight(26); + $h[9] = $h[9]->addInt64($carry8); + $h[8] = $h[8]->subInt64($carry8->shiftLeft(26)); + + for ($i = 0; $i < 10; ++$i) { + $h[$i] = $h[$i]->toInt32(); + } + /** @var array $h2 */ + $h2 = $h; + return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray($h2); + } + + /** + * @internal You should not use this directly from another application + * + * Inline comments preceded by # are from libsodium's ref10 code. + * + * @param string $n + * @param string $p + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function crypto_scalarmult_curve25519_ref10($n, $p) + { + # for (i = 0;i < 32;++i) e[i] = n[i]; + $e = '' . $n; + # e[0] &= 248; + $e[0] = self::intToChr( + self::chrToInt($e[0]) & 248 + ); + # e[31] &= 127; + # e[31] |= 64; + $e[31] = self::intToChr( + (self::chrToInt($e[31]) & 127) | 64 + ); + # fe_frombytes(x1,p); + $x1 = self::fe_frombytes($p); + # fe_1(x2); + $x2 = self::fe_1(); + # fe_0(z2); + $z2 = self::fe_0(); + # fe_copy(x3,x1); + $x3 = self::fe_copy($x1); + # fe_1(z3); + $z3 = self::fe_1(); + + # swap = 0; + /** @var int $swap */ + $swap = 0; + + # for (pos = 254;pos >= 0;--pos) { + for ($pos = 254; $pos >= 0; --$pos) { + # b = e[pos / 8] >> (pos & 7); + /** @var int $b */ + $b = self::chrToInt( + $e[(int) floor($pos / 8)] + ) >> ($pos & 7); + # b &= 1; + $b &= 1; + + # swap ^= b; + $swap ^= $b; + + # fe_cswap(x2,x3,swap); + self::fe_cswap($x2, $x3, $swap); + + # fe_cswap(z2,z3,swap); + self::fe_cswap($z2, $z3, $swap); + + # swap = b; + /** @var int $swap */ + $swap = $b; + + # fe_sub(tmp0,x3,z3); + $tmp0 = self::fe_sub($x3, $z3); + + # fe_sub(tmp1,x2,z2); + $tmp1 = self::fe_sub($x2, $z2); + + # fe_add(x2,x2,z2); + $x2 = self::fe_add($x2, $z2); + + # fe_add(z2,x3,z3); + $z2 = self::fe_add($x3, $z3); + + # fe_mul(z3,tmp0,x2); + $z3 = self::fe_mul($tmp0, $x2); + + # fe_mul(z2,z2,tmp1); + $z2 = self::fe_mul($z2, $tmp1); + + # fe_sq(tmp0,tmp1); + $tmp0 = self::fe_sq($tmp1); + + # fe_sq(tmp1,x2); + $tmp1 = self::fe_sq($x2); + + # fe_add(x3,z3,z2); + $x3 = self::fe_add($z3, $z2); + + # fe_sub(z2,z3,z2); + $z2 = self::fe_sub($z3, $z2); + + # fe_mul(x2,tmp1,tmp0); + $x2 = self::fe_mul($tmp1, $tmp0); + + # fe_sub(tmp1,tmp1,tmp0); + $tmp1 = self::fe_sub($tmp1, $tmp0); + + # fe_sq(z2,z2); + $z2 = self::fe_sq($z2); + + # fe_mul121666(z3,tmp1); + $z3 = self::fe_mul121666($tmp1); + + # fe_sq(x3,x3); + $x3 = self::fe_sq($x3); + + # fe_add(tmp0,tmp0,z3); + $tmp0 = self::fe_add($tmp0, $z3); + + # fe_mul(z3,x1,z2); + $z3 = self::fe_mul($x1, $z2); + + # fe_mul(z2,tmp1,tmp0); + $z2 = self::fe_mul($tmp1, $tmp0); + } + + # fe_cswap(x2,x3,swap); + self::fe_cswap($x2, $x3, $swap); + + # fe_cswap(z2,z3,swap); + self::fe_cswap($z2, $z3, $swap); + + # fe_invert(z2,z2); + $z2 = self::fe_invert($z2); + + # fe_mul(x2,x2,z2); + $x2 = self::fe_mul($x2, $z2); + # fe_tobytes(q,x2); + return (string) self::fe_tobytes($x2); + } + + /** + * @internal You should not use this directly from another application + * + * @param ParagonIE_Sodium_Core32_Curve25519_Fe $edwardsY + * @param ParagonIE_Sodium_Core32_Curve25519_Fe $edwardsZ + * @return ParagonIE_Sodium_Core32_Curve25519_Fe + * @throws SodiumException + * @throws TypeError + */ + public static function edwards_to_montgomery( + ParagonIE_Sodium_Core32_Curve25519_Fe $edwardsY, + ParagonIE_Sodium_Core32_Curve25519_Fe $edwardsZ + ) { + $tempX = self::fe_add($edwardsZ, $edwardsY); + $tempZ = self::fe_sub($edwardsZ, $edwardsY); + $tempZ = self::fe_invert($tempZ); + return self::fe_mul($tempX, $tempZ); + } + + /** + * @internal You should not use this directly from another application + * + * @param string $n + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function crypto_scalarmult_curve25519_ref10_base($n) + { + # for (i = 0;i < 32;++i) e[i] = n[i]; + $e = '' . $n; + + # e[0] &= 248; + $e[0] = self::intToChr( + self::chrToInt($e[0]) & 248 + ); + + # e[31] &= 127; + # e[31] |= 64; + $e[31] = self::intToChr( + (self::chrToInt($e[31]) & 127) | 64 + ); + + $A = self::ge_scalarmult_base($e); + if ( + !($A->Y instanceof ParagonIE_Sodium_Core32_Curve25519_Fe) + || + !($A->Z instanceof ParagonIE_Sodium_Core32_Curve25519_Fe) + ) { + throw new TypeError('Null points encountered'); + } + $pk = self::edwards_to_montgomery($A->Y, $A->Z); + return self::fe_tobytes($pk); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Core32/XChaCha20.php b/vendor/paragonie/sodium_compat/src/Core32/XChaCha20.php new file mode 100644 index 0000000..1dfc859 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Core32/XChaCha20.php @@ -0,0 +1,64 @@ +update($ad); + $state->update(ParagonIE_Sodium_Core_Util::store64_le($adlen)); + $state->update($ciphertext); + $state->update(ParagonIE_Sodium_Core_Util::store64_le($clen)); + $computed_mac = $state->finish(); + + /* Compare the given MAC with the recalculated MAC: */ + if (!ParagonIE_Sodium_Core_Util::verify_16($computed_mac, $mac)) { + throw new SodiumException('Invalid MAC'); + } + + // Here, we know that the MAC is valid, so we decrypt and return the plaintext + return ParagonIE_Sodium_Core_ChaCha20::streamXorIc( + $ciphertext, + $nonce, + $key, + ParagonIE_Sodium_Core_Util::store64_le(1) + ); + } + + /** + * AEAD Encryption with ChaCha20-Poly1305 + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string $ad + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function aead_chacha20poly1305_encrypt( + $message = '', + $ad = '', + $nonce = '', + $key = '' + ) { + /** @var int $len - Length of the plaintext message */ + $len = ParagonIE_Sodium_Core_Util::strlen($message); + + /** @var int $adlen - Length of the associated data */ + $adlen = ParagonIE_Sodium_Core_Util::strlen($ad); + + /** @var string The first block of the chacha20 keystream, used as a poly1305 key */ + $block0 = ParagonIE_Sodium_Core_ChaCha20::stream( + 32, + $nonce, + $key + ); + $state = new ParagonIE_Sodium_Core_Poly1305_State($block0); + try { + ParagonIE_Sodium_Compat::memzero($block0); + } catch (SodiumException $ex) { + $block0 = null; + } + + /** @var string $ciphertext - Raw encrypted data */ + $ciphertext = ParagonIE_Sodium_Core_ChaCha20::streamXorIc( + $message, + $nonce, + $key, + ParagonIE_Sodium_Core_Util::store64_le(1) + ); + + $state->update($ad); + $state->update(ParagonIE_Sodium_Core_Util::store64_le($adlen)); + $state->update($ciphertext); + $state->update(ParagonIE_Sodium_Core_Util::store64_le($len)); + return $ciphertext . $state->finish(); + } + + /** + * AEAD Decryption with ChaCha20-Poly1305, IETF mode (96-bit nonce) + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string $ad + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function aead_chacha20poly1305_ietf_decrypt( + $message = '', + $ad = '', + $nonce = '', + $key = '' + ) { + /** @var int $adlen - Length of associated data */ + $adlen = ParagonIE_Sodium_Core_Util::strlen($ad); + + /** @var int $len - Length of message (ciphertext + MAC) */ + $len = ParagonIE_Sodium_Core_Util::strlen($message); + + /** @var int $clen - Length of ciphertext */ + $clen = $len - self::aead_chacha20poly1305_IETF_ABYTES; + + /** @var string The first block of the chacha20 keystream, used as a poly1305 key */ + $block0 = ParagonIE_Sodium_Core_ChaCha20::ietfStream( + 32, + $nonce, + $key + ); + + /** @var string $mac - Message authentication code */ + $mac = ParagonIE_Sodium_Core_Util::substr( + $message, + $len - self::aead_chacha20poly1305_IETF_ABYTES, + self::aead_chacha20poly1305_IETF_ABYTES + ); + + /** @var string $ciphertext - The encrypted message (sans MAC) */ + $ciphertext = ParagonIE_Sodium_Core_Util::substr( + $message, + 0, + $len - self::aead_chacha20poly1305_IETF_ABYTES + ); + + /* Recalculate the Poly1305 authentication tag (MAC): */ + $state = new ParagonIE_Sodium_Core_Poly1305_State($block0); + try { + ParagonIE_Sodium_Compat::memzero($block0); + } catch (SodiumException $ex) { + $block0 = null; + } + $state->update($ad); + $state->update(str_repeat("\x00", ((0x10 - $adlen) & 0xf))); + $state->update($ciphertext); + $state->update(str_repeat("\x00", (0x10 - $clen) & 0xf)); + $state->update(ParagonIE_Sodium_Core_Util::store64_le($adlen)); + $state->update(ParagonIE_Sodium_Core_Util::store64_le($clen)); + $computed_mac = $state->finish(); + + /* Compare the given MAC with the recalculated MAC: */ + if (!ParagonIE_Sodium_Core_Util::verify_16($computed_mac, $mac)) { + throw new SodiumException('Invalid MAC'); + } + + // Here, we know that the MAC is valid, so we decrypt and return the plaintext + return ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc( + $ciphertext, + $nonce, + $key, + ParagonIE_Sodium_Core_Util::store64_le(1) + ); + } + + /** + * AEAD Encryption with ChaCha20-Poly1305, IETF mode (96-bit nonce) + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string $ad + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function aead_chacha20poly1305_ietf_encrypt( + $message = '', + $ad = '', + $nonce = '', + $key = '' + ) { + /** @var int $len - Length of the plaintext message */ + $len = ParagonIE_Sodium_Core_Util::strlen($message); + + /** @var int $adlen - Length of the associated data */ + $adlen = ParagonIE_Sodium_Core_Util::strlen($ad); + + /** @var string The first block of the chacha20 keystream, used as a poly1305 key */ + $block0 = ParagonIE_Sodium_Core_ChaCha20::ietfStream( + 32, + $nonce, + $key + ); + $state = new ParagonIE_Sodium_Core_Poly1305_State($block0); + try { + ParagonIE_Sodium_Compat::memzero($block0); + } catch (SodiumException $ex) { + $block0 = null; + } + + /** @var string $ciphertext - Raw encrypted data */ + $ciphertext = ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc( + $message, + $nonce, + $key, + ParagonIE_Sodium_Core_Util::store64_le(1) + ); + + $state->update($ad); + $state->update(str_repeat("\x00", ((0x10 - $adlen) & 0xf))); + $state->update($ciphertext); + $state->update(str_repeat("\x00", ((0x10 - $len) & 0xf))); + $state->update(ParagonIE_Sodium_Core_Util::store64_le($adlen)); + $state->update(ParagonIE_Sodium_Core_Util::store64_le($len)); + return $ciphertext . $state->finish(); + } + + /** + * AEAD Decryption with ChaCha20-Poly1305, IETF mode (96-bit nonce) + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string $ad + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function aead_xchacha20poly1305_ietf_decrypt( + $message = '', + $ad = '', + $nonce = '', + $key = '' + ) { + $subkey = ParagonIE_Sodium_Core_HChaCha20::hChaCha20( + ParagonIE_Sodium_Core_Util::substr($nonce, 0, 16), + $key + ); + $nonceLast = "\x00\x00\x00\x00" . + ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8); + + return self::aead_chacha20poly1305_ietf_decrypt($message, $ad, $nonceLast, $subkey); + } + + /** + * AEAD Encryption with ChaCha20-Poly1305, IETF mode (96-bit nonce) + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string $ad + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function aead_xchacha20poly1305_ietf_encrypt( + $message = '', + $ad = '', + $nonce = '', + $key = '' + ) { + $subkey = ParagonIE_Sodium_Core_HChaCha20::hChaCha20( + ParagonIE_Sodium_Core_Util::substr($nonce, 0, 16), + $key + ); + $nonceLast = "\x00\x00\x00\x00" . + ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8); + + return self::aead_chacha20poly1305_ietf_encrypt($message, $ad, $nonceLast, $subkey); + } + + /** + * HMAC-SHA-512-256 (a.k.a. the leftmost 256 bits of HMAC-SHA-512) + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string $key + * @return string + * @throws TypeError + */ + public static function auth($message, $key) + { + return ParagonIE_Sodium_Core_Util::substr( + hash_hmac('sha512', $message, $key, true), + 0, + 32 + ); + } + + /** + * HMAC-SHA-512-256 validation. Constant-time via hash_equals(). + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $mac + * @param string $message + * @param string $key + * @return bool + * @throws SodiumException + * @throws TypeError + */ + public static function auth_verify($mac, $message, $key) + { + return ParagonIE_Sodium_Core_Util::hashEquals( + $mac, + self::auth($message, $key) + ); + } + + /** + * X25519 key exchange followed by XSalsa20Poly1305 symmetric encryption + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $plaintext + * @param string $nonce + * @param string $keypair + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function box($plaintext, $nonce, $keypair) + { + $c = self::secretbox( + $plaintext, + $nonce, + self::box_beforenm( + self::box_secretkey($keypair), + self::box_publickey($keypair) + ) + ); + return $c; + } + + /** + * X25519-XSalsa20-Poly1305 with one ephemeral X25519 keypair. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string $publicKey + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function box_seal($message, $publicKey) + { + /** @var string $ephemeralKeypair */ + $ephemeralKeypair = self::box_keypair(); + + /** @var string $ephemeralSK */ + $ephemeralSK = self::box_secretkey($ephemeralKeypair); + + /** @var string $ephemeralPK */ + $ephemeralPK = self::box_publickey($ephemeralKeypair); + + /** @var string $nonce */ + $nonce = self::generichash( + $ephemeralPK . $publicKey, + '', + 24 + ); + + /** @var string $keypair - The combined keypair used in crypto_box() */ + $keypair = self::box_keypair_from_secretkey_and_publickey($ephemeralSK, $publicKey); + + /** @var string $ciphertext Ciphertext + MAC from crypto_box */ + $ciphertext = self::box($message, $nonce, $keypair); + try { + ParagonIE_Sodium_Compat::memzero($ephemeralKeypair); + ParagonIE_Sodium_Compat::memzero($ephemeralSK); + ParagonIE_Sodium_Compat::memzero($nonce); + } catch (SodiumException $ex) { + $ephemeralKeypair = null; + $ephemeralSK = null; + $nonce = null; + } + return $ephemeralPK . $ciphertext; + } + + /** + * Opens a message encrypted via box_seal(). + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string $keypair + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function box_seal_open($message, $keypair) + { + /** @var string $ephemeralPK */ + $ephemeralPK = ParagonIE_Sodium_Core_Util::substr($message, 0, 32); + + /** @var string $ciphertext (ciphertext + MAC) */ + $ciphertext = ParagonIE_Sodium_Core_Util::substr($message, 32); + + /** @var string $secretKey */ + $secretKey = self::box_secretkey($keypair); + + /** @var string $publicKey */ + $publicKey = self::box_publickey($keypair); + + /** @var string $nonce */ + $nonce = self::generichash( + $ephemeralPK . $publicKey, + '', + 24 + ); + + /** @var string $keypair */ + $keypair = self::box_keypair_from_secretkey_and_publickey($secretKey, $ephemeralPK); + + /** @var string $m */ + $m = self::box_open($ciphertext, $nonce, $keypair); + try { + ParagonIE_Sodium_Compat::memzero($secretKey); + ParagonIE_Sodium_Compat::memzero($ephemeralPK); + ParagonIE_Sodium_Compat::memzero($nonce); + } catch (SodiumException $ex) { + $secretKey = null; + $ephemeralPK = null; + $nonce = null; + } + return $m; + } + + /** + * Used by crypto_box() to get the crypto_secretbox() key. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $sk + * @param string $pk + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function box_beforenm($sk, $pk) + { + return ParagonIE_Sodium_Core_HSalsa20::hsalsa20( + str_repeat("\x00", 16), + self::scalarmult($sk, $pk) + ); + } + + /** + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @return string + * @throws Exception + * @throws SodiumException + * @throws TypeError + */ + public static function box_keypair() + { + $sKey = random_bytes(32); + $pKey = self::scalarmult_base($sKey); + return $sKey . $pKey; + } + + /** + * @param string $seed + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function box_seed_keypair($seed) + { + $sKey = ParagonIE_Sodium_Core_Util::substr( + hash('sha512', $seed, true), + 0, + 32 + ); + $pKey = self::scalarmult_base($sKey); + return $sKey . $pKey; + } + + /** + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $sKey + * @param string $pKey + * @return string + * @throws TypeError + */ + public static function box_keypair_from_secretkey_and_publickey($sKey, $pKey) + { + return ParagonIE_Sodium_Core_Util::substr($sKey, 0, 32) . + ParagonIE_Sodium_Core_Util::substr($pKey, 0, 32); + } + + /** + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $keypair + * @return string + * @throws RangeException + * @throws TypeError + */ + public static function box_secretkey($keypair) + { + if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== 64) { + throw new RangeException( + 'Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES bytes long.' + ); + } + return ParagonIE_Sodium_Core_Util::substr($keypair, 0, 32); + } + + /** + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $keypair + * @return string + * @throws RangeException + * @throws TypeError + */ + public static function box_publickey($keypair) + { + if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES) { + throw new RangeException( + 'Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES bytes long.' + ); + } + return ParagonIE_Sodium_Core_Util::substr($keypair, 32, 32); + } + + /** + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $sKey + * @return string + * @throws RangeException + * @throws SodiumException + * @throws TypeError + */ + public static function box_publickey_from_secretkey($sKey) + { + if (ParagonIE_Sodium_Core_Util::strlen($sKey) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_SECRETKEYBYTES) { + throw new RangeException( + 'Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_SECRETKEYBYTES bytes long.' + ); + } + return self::scalarmult_base($sKey); + } + + /** + * Decrypt a message encrypted with box(). + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $ciphertext + * @param string $nonce + * @param string $keypair + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function box_open($ciphertext, $nonce, $keypair) + { + return self::secretbox_open( + $ciphertext, + $nonce, + self::box_beforenm( + self::box_secretkey($keypair), + self::box_publickey($keypair) + ) + ); + } + + /** + * Calculate a BLAKE2b hash. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string|null $key + * @param int $outlen + * @return string + * @throws RangeException + * @throws SodiumException + * @throws TypeError + */ + public static function generichash($message, $key = '', $outlen = 32) + { + // This ensures that ParagonIE_Sodium_Core_BLAKE2b::$iv is initialized + ParagonIE_Sodium_Core_BLAKE2b::pseudoConstructor(); + + $k = null; + if (!empty($key)) { + /** @var SplFixedArray $k */ + $k = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($key); + if ($k->count() > ParagonIE_Sodium_Core_BLAKE2b::KEYBYTES) { + throw new RangeException('Invalid key size'); + } + } + + /** @var SplFixedArray $in */ + $in = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($message); + + /** @var SplFixedArray $ctx */ + $ctx = ParagonIE_Sodium_Core_BLAKE2b::init($k, $outlen); + ParagonIE_Sodium_Core_BLAKE2b::update($ctx, $in, $in->count()); + + /** @var SplFixedArray $out */ + $out = new SplFixedArray($outlen); + $out = ParagonIE_Sodium_Core_BLAKE2b::finish($ctx, $out); + + /** @var array */ + $outArray = $out->toArray(); + return ParagonIE_Sodium_Core_Util::intArrayToString($outArray); + } + + /** + * Finalize a BLAKE2b hashing context, returning the hash. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $ctx + * @param int $outlen + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function generichash_final($ctx, $outlen = 32) + { + if (!is_string($ctx)) { + throw new TypeError('Context must be a string'); + } + $out = new SplFixedArray($outlen); + + /** @var SplFixedArray $context */ + $context = ParagonIE_Sodium_Core_BLAKE2b::stringToContext($ctx); + + /** @var SplFixedArray $out */ + $out = ParagonIE_Sodium_Core_BLAKE2b::finish($context, $out); + + /** @var array */ + $outArray = $out->toArray(); + return ParagonIE_Sodium_Core_Util::intArrayToString($outArray); + } + + /** + * Initialize a hashing context for BLAKE2b. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $key + * @param int $outputLength + * @return string + * @throws RangeException + * @throws SodiumException + * @throws TypeError + */ + public static function generichash_init($key = '', $outputLength = 32) + { + // This ensures that ParagonIE_Sodium_Core_BLAKE2b::$iv is initialized + ParagonIE_Sodium_Core_BLAKE2b::pseudoConstructor(); + + $k = null; + if (!empty($key)) { + $k = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($key); + if ($k->count() > ParagonIE_Sodium_Core_BLAKE2b::KEYBYTES) { + throw new RangeException('Invalid key size'); + } + } + + /** @var SplFixedArray $ctx */ + $ctx = ParagonIE_Sodium_Core_BLAKE2b::init($k, $outputLength); + + return ParagonIE_Sodium_Core_BLAKE2b::contextToString($ctx); + } + + /** + * Initialize a hashing context for BLAKE2b. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $key + * @param int $outputLength + * @param string $salt + * @param string $personal + * @return string + * @throws RangeException + * @throws SodiumException + * @throws TypeError + */ + public static function generichash_init_salt_personal( + $key = '', + $outputLength = 32, + $salt = '', + $personal = '' + ) { + // This ensures that ParagonIE_Sodium_Core_BLAKE2b::$iv is initialized + ParagonIE_Sodium_Core_BLAKE2b::pseudoConstructor(); + + $k = null; + if (!empty($key)) { + $k = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($key); + if ($k->count() > ParagonIE_Sodium_Core_BLAKE2b::KEYBYTES) { + throw new RangeException('Invalid key size'); + } + } + if (!empty($salt)) { + $s = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($salt); + } else { + $s = null; + } + if (!empty($salt)) { + $p = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($personal); + } else { + $p = null; + } + + /** @var SplFixedArray $ctx */ + $ctx = ParagonIE_Sodium_Core_BLAKE2b::init($k, $outputLength, $s, $p); + + return ParagonIE_Sodium_Core_BLAKE2b::contextToString($ctx); + } + + /** + * Update a hashing context for BLAKE2b with $message + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $ctx + * @param string $message + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function generichash_update($ctx, $message) + { + // This ensures that ParagonIE_Sodium_Core_BLAKE2b::$iv is initialized + ParagonIE_Sodium_Core_BLAKE2b::pseudoConstructor(); + + /** @var SplFixedArray $context */ + $context = ParagonIE_Sodium_Core_BLAKE2b::stringToContext($ctx); + + /** @var SplFixedArray $in */ + $in = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($message); + + ParagonIE_Sodium_Core_BLAKE2b::update($context, $in, $in->count()); + + return ParagonIE_Sodium_Core_BLAKE2b::contextToString($context); + } + + /** + * Libsodium's crypto_kx(). + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $my_sk + * @param string $their_pk + * @param string $client_pk + * @param string $server_pk + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function keyExchange($my_sk, $their_pk, $client_pk, $server_pk) + { + return ParagonIE_Sodium_Compat::crypto_generichash( + ParagonIE_Sodium_Compat::crypto_scalarmult($my_sk, $their_pk) . + $client_pk . + $server_pk + ); + } + + /** + * ECDH over Curve25519 + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $sKey + * @param string $pKey + * @return string + * + * @throws SodiumException + * @throws TypeError + */ + public static function scalarmult($sKey, $pKey) + { + $q = ParagonIE_Sodium_Core_X25519::crypto_scalarmult_curve25519_ref10($sKey, $pKey); + self::scalarmult_throw_if_zero($q); + return $q; + } + + /** + * ECDH over Curve25519, using the basepoint. + * Used to get a secret key from a public key. + * + * @param string $secret + * @return string + * + * @throws SodiumException + * @throws TypeError + */ + public static function scalarmult_base($secret) + { + $q = ParagonIE_Sodium_Core_X25519::crypto_scalarmult_curve25519_ref10_base($secret); + self::scalarmult_throw_if_zero($q); + return $q; + } + + /** + * This throws an Error if a zero public key was passed to the function. + * + * @param string $q + * @return void + * @throws SodiumException + * @throws TypeError + */ + protected static function scalarmult_throw_if_zero($q) + { + $d = 0; + for ($i = 0; $i < self::box_curve25519xsalsa20poly1305_SECRETKEYBYTES; ++$i) { + $d |= ParagonIE_Sodium_Core_Util::chrToInt($q[$i]); + } + + /* branch-free variant of === 0 */ + if (-(1 & (($d - 1) >> 8))) { + throw new SodiumException('Zero public key is not allowed'); + } + } + + /** + * XSalsa20-Poly1305 authenticated symmetric-key encryption. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $plaintext + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function secretbox($plaintext, $nonce, $key) + { + /** @var string $subkey */ + $subkey = ParagonIE_Sodium_Core_HSalsa20::hsalsa20($nonce, $key); + + /** @var string $block0 */ + $block0 = str_repeat("\x00", 32); + + /** @var int $mlen - Length of the plaintext message */ + $mlen = ParagonIE_Sodium_Core_Util::strlen($plaintext); + $mlen0 = $mlen; + if ($mlen0 > 64 - self::secretbox_xsalsa20poly1305_ZEROBYTES) { + $mlen0 = 64 - self::secretbox_xsalsa20poly1305_ZEROBYTES; + } + $block0 .= ParagonIE_Sodium_Core_Util::substr($plaintext, 0, $mlen0); + + /** @var string $block0 */ + $block0 = ParagonIE_Sodium_Core_Salsa20::salsa20_xor( + $block0, + ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8), + $subkey + ); + + /** @var string $c */ + $c = ParagonIE_Sodium_Core_Util::substr( + $block0, + self::secretbox_xsalsa20poly1305_ZEROBYTES + ); + if ($mlen > $mlen0) { + $c .= ParagonIE_Sodium_Core_Salsa20::salsa20_xor_ic( + ParagonIE_Sodium_Core_Util::substr( + $plaintext, + self::secretbox_xsalsa20poly1305_ZEROBYTES + ), + ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8), + 1, + $subkey + ); + } + $state = new ParagonIE_Sodium_Core_Poly1305_State( + ParagonIE_Sodium_Core_Util::substr( + $block0, + 0, + self::onetimeauth_poly1305_KEYBYTES + ) + ); + try { + ParagonIE_Sodium_Compat::memzero($block0); + ParagonIE_Sodium_Compat::memzero($subkey); + } catch (SodiumException $ex) { + $block0 = null; + $subkey = null; + } + + $state->update($c); + + /** @var string $c - MAC || ciphertext */ + $c = $state->finish() . $c; + unset($state); + + return $c; + } + + /** + * Decrypt a ciphertext generated via secretbox(). + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $ciphertext + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function secretbox_open($ciphertext, $nonce, $key) + { + /** @var string $mac */ + $mac = ParagonIE_Sodium_Core_Util::substr( + $ciphertext, + 0, + self::secretbox_xsalsa20poly1305_MACBYTES + ); + + /** @var string $c */ + $c = ParagonIE_Sodium_Core_Util::substr( + $ciphertext, + self::secretbox_xsalsa20poly1305_MACBYTES + ); + + /** @var int $clen */ + $clen = ParagonIE_Sodium_Core_Util::strlen($c); + + /** @var string $subkey */ + $subkey = ParagonIE_Sodium_Core_HSalsa20::hsalsa20($nonce, $key); + + /** @var string $block0 */ + $block0 = ParagonIE_Sodium_Core_Salsa20::salsa20( + 64, + ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8), + $subkey + ); + $verified = ParagonIE_Sodium_Core_Poly1305::onetimeauth_verify( + $mac, + $c, + ParagonIE_Sodium_Core_Util::substr($block0, 0, 32) + ); + if (!$verified) { + try { + ParagonIE_Sodium_Compat::memzero($subkey); + } catch (SodiumException $ex) { + $subkey = null; + } + throw new SodiumException('Invalid MAC'); + } + + /** @var string $m - Decrypted message */ + $m = ParagonIE_Sodium_Core_Util::xorStrings( + ParagonIE_Sodium_Core_Util::substr($block0, self::secretbox_xsalsa20poly1305_ZEROBYTES), + ParagonIE_Sodium_Core_Util::substr($c, 0, self::secretbox_xsalsa20poly1305_ZEROBYTES) + ); + if ($clen > self::secretbox_xsalsa20poly1305_ZEROBYTES) { + // We had more than 1 block, so let's continue to decrypt the rest. + $m .= ParagonIE_Sodium_Core_Salsa20::salsa20_xor_ic( + ParagonIE_Sodium_Core_Util::substr( + $c, + self::secretbox_xsalsa20poly1305_ZEROBYTES + ), + ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8), + 1, + (string) $subkey + ); + } + return $m; + } + + /** + * XChaCha20-Poly1305 authenticated symmetric-key encryption. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $plaintext + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function secretbox_xchacha20poly1305($plaintext, $nonce, $key) + { + /** @var string $subkey */ + $subkey = ParagonIE_Sodium_Core_HChaCha20::hChaCha20( + ParagonIE_Sodium_Core_Util::substr($nonce, 0, 16), + $key + ); + $nonceLast = ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8); + + /** @var string $block0 */ + $block0 = str_repeat("\x00", 32); + + /** @var int $mlen - Length of the plaintext message */ + $mlen = ParagonIE_Sodium_Core_Util::strlen($plaintext); + $mlen0 = $mlen; + if ($mlen0 > 64 - self::secretbox_xchacha20poly1305_ZEROBYTES) { + $mlen0 = 64 - self::secretbox_xchacha20poly1305_ZEROBYTES; + } + $block0 .= ParagonIE_Sodium_Core_Util::substr($plaintext, 0, $mlen0); + + /** @var string $block0 */ + $block0 = ParagonIE_Sodium_Core_ChaCha20::streamXorIc( + $block0, + $nonceLast, + $subkey + ); + + /** @var string $c */ + $c = ParagonIE_Sodium_Core_Util::substr( + $block0, + self::secretbox_xchacha20poly1305_ZEROBYTES + ); + if ($mlen > $mlen0) { + $c .= ParagonIE_Sodium_Core_ChaCha20::streamXorIc( + ParagonIE_Sodium_Core_Util::substr( + $plaintext, + self::secretbox_xchacha20poly1305_ZEROBYTES + ), + $nonceLast, + $subkey, + ParagonIE_Sodium_Core_Util::store64_le(1) + ); + } + $state = new ParagonIE_Sodium_Core_Poly1305_State( + ParagonIE_Sodium_Core_Util::substr( + $block0, + 0, + self::onetimeauth_poly1305_KEYBYTES + ) + ); + try { + ParagonIE_Sodium_Compat::memzero($block0); + ParagonIE_Sodium_Compat::memzero($subkey); + } catch (SodiumException $ex) { + $block0 = null; + $subkey = null; + } + + $state->update($c); + + /** @var string $c - MAC || ciphertext */ + $c = $state->finish() . $c; + unset($state); + + return $c; + } + + /** + * Decrypt a ciphertext generated via secretbox_xchacha20poly1305(). + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $ciphertext + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function secretbox_xchacha20poly1305_open($ciphertext, $nonce, $key) + { + /** @var string $mac */ + $mac = ParagonIE_Sodium_Core_Util::substr( + $ciphertext, + 0, + self::secretbox_xchacha20poly1305_MACBYTES + ); + + /** @var string $c */ + $c = ParagonIE_Sodium_Core_Util::substr( + $ciphertext, + self::secretbox_xchacha20poly1305_MACBYTES + ); + + /** @var int $clen */ + $clen = ParagonIE_Sodium_Core_Util::strlen($c); + + /** @var string $subkey */ + $subkey = ParagonIE_Sodium_Core_HChaCha20::hchacha20($nonce, $key); + + /** @var string $block0 */ + $block0 = ParagonIE_Sodium_Core_ChaCha20::stream( + 64, + ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8), + $subkey + ); + $verified = ParagonIE_Sodium_Core_Poly1305::onetimeauth_verify( + $mac, + $c, + ParagonIE_Sodium_Core_Util::substr($block0, 0, 32) + ); + + if (!$verified) { + try { + ParagonIE_Sodium_Compat::memzero($subkey); + } catch (SodiumException $ex) { + $subkey = null; + } + throw new SodiumException('Invalid MAC'); + } + + /** @var string $m - Decrypted message */ + $m = ParagonIE_Sodium_Core_Util::xorStrings( + ParagonIE_Sodium_Core_Util::substr($block0, self::secretbox_xchacha20poly1305_ZEROBYTES), + ParagonIE_Sodium_Core_Util::substr($c, 0, self::secretbox_xchacha20poly1305_ZEROBYTES) + ); + + if ($clen > self::secretbox_xchacha20poly1305_ZEROBYTES) { + // We had more than 1 block, so let's continue to decrypt the rest. + $m .= ParagonIE_Sodium_Core_ChaCha20::streamXorIc( + ParagonIE_Sodium_Core_Util::substr( + $c, + self::secretbox_xchacha20poly1305_ZEROBYTES + ), + ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8), + (string) $subkey, + ParagonIE_Sodium_Core_Util::store64_le(1) + ); + } + return $m; + } + + /** + * @param string $key + * @return array Returns a state and a header. + * @throws Exception + * @throws SodiumException + */ + public static function secretstream_xchacha20poly1305_init_push($key) + { + # randombytes_buf(out, crypto_secretstream_xchacha20poly1305_HEADERBYTES); + $out = random_bytes(24); + + # crypto_core_hchacha20(state->k, out, k, NULL); + $subkey = ParagonIE_Sodium_Core_HChaCha20::hChaCha20($out, $key); + $state = new ParagonIE_Sodium_Core_SecretStream_State( + $subkey, + ParagonIE_Sodium_Core_Util::substr($out, 16, 8) . str_repeat("\0", 4) + ); + + # _crypto_secretstream_xchacha20poly1305_counter_reset(state); + $state->counterReset(); + + # memcpy(STATE_INONCE(state), out + crypto_core_hchacha20_INPUTBYTES, + # crypto_secretstream_xchacha20poly1305_INONCEBYTES); + # memset(state->_pad, 0, sizeof state->_pad); + return array( + $state->toString(), + $out + ); + } + + /** + * @param string $key + * @param string $header + * @return string Returns a state. + * @throws Exception + */ + public static function secretstream_xchacha20poly1305_init_pull($key, $header) + { + # crypto_core_hchacha20(state->k, in, k, NULL); + $subkey = ParagonIE_Sodium_Core_HChaCha20::hChaCha20( + ParagonIE_Sodium_Core_Util::substr($header, 0, 16), + $key + ); + $state = new ParagonIE_Sodium_Core_SecretStream_State( + $subkey, + ParagonIE_Sodium_Core_Util::substr($header, 16) + ); + $state->counterReset(); + # memcpy(STATE_INONCE(state), in + crypto_core_hchacha20_INPUTBYTES, + # crypto_secretstream_xchacha20poly1305_INONCEBYTES); + # memset(state->_pad, 0, sizeof state->_pad); + # return 0; + return $state->toString(); + } + + /** + * @param string $state + * @param string $msg + * @param string $aad + * @param int $tag + * @return string + * @throws SodiumException + */ + public static function secretstream_xchacha20poly1305_push(&$state, $msg, $aad = '', $tag = 0) + { + $st = ParagonIE_Sodium_Core_SecretStream_State::fromString($state); + # crypto_onetimeauth_poly1305_state poly1305_state; + # unsigned char block[64U]; + # unsigned char slen[8U]; + # unsigned char *c; + # unsigned char *mac; + + $msglen = ParagonIE_Sodium_Core_Util::strlen($msg); + $aadlen = ParagonIE_Sodium_Core_Util::strlen($aad); + + if ((($msglen + 63) >> 6) > 0xfffffffe) { + throw new SodiumException( + 'message cannot be larger than SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX bytes' + ); + } + + # if (outlen_p != NULL) { + # *outlen_p = 0U; + # } + # if (mlen > crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX) { + # sodium_misuse(); + # } + + # crypto_stream_chacha20_ietf(block, sizeof block, state->nonce, state->k); + # crypto_onetimeauth_poly1305_init(&poly1305_state, block); + # sodium_memzero(block, sizeof block); + $auth = new ParagonIE_Sodium_Core_Poly1305_State( + ParagonIE_Sodium_Core_ChaCha20::ietfStream(32, $st->getCombinedNonce(), $st->getKey()) + ); + + # crypto_onetimeauth_poly1305_update(&poly1305_state, ad, adlen); + $auth->update($aad); + + # crypto_onetimeauth_poly1305_update(&poly1305_state, _pad0, + # (0x10 - adlen) & 0xf); + $auth->update(str_repeat("\0", ((0x10 - $aadlen) & 0xf))); + + # memset(block, 0, sizeof block); + # block[0] = tag; + # crypto_stream_chacha20_ietf_xor_ic(block, block, sizeof block, + # state->nonce, 1U, state->k); + $block = ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc( + ParagonIE_Sodium_Core_Util::intToChr($tag) . str_repeat("\0", 63), + $st->getCombinedNonce(), + $st->getKey(), + ParagonIE_Sodium_Core_Util::store64_le(1) + ); + + # crypto_onetimeauth_poly1305_update(&poly1305_state, block, sizeof block); + $auth->update($block); + + # out[0] = block[0]; + $out = $block[0]; + # c = out + (sizeof tag); + # crypto_stream_chacha20_ietf_xor_ic(c, m, mlen, state->nonce, 2U, state->k); + $cipher = ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc( + $msg, + $st->getCombinedNonce(), + $st->getKey(), + ParagonIE_Sodium_Core_Util::store64_le(2) + ); + + # crypto_onetimeauth_poly1305_update(&poly1305_state, c, mlen); + $auth->update($cipher); + + $out .= $cipher; + unset($cipher); + + # crypto_onetimeauth_poly1305_update + # (&poly1305_state, _pad0, (0x10 - (sizeof block) + mlen) & 0xf); + $auth->update(str_repeat("\0", ((0x10 - 64 + $msglen) & 0xf))); + + # STORE64_LE(slen, (uint64_t) adlen); + $slen = ParagonIE_Sodium_Core_Util::store64_le($aadlen); + + # crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen); + $auth->update($slen); + + # STORE64_LE(slen, (sizeof block) + mlen); + $slen = ParagonIE_Sodium_Core_Util::store64_le(64 + $msglen); + + # crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen); + $auth->update($slen); + + # mac = c + mlen; + # crypto_onetimeauth_poly1305_final(&poly1305_state, mac); + $mac = $auth->finish(); + $out .= $mac; + + # sodium_memzero(&poly1305_state, sizeof poly1305_state); + unset($auth); + + + # XOR_BUF(STATE_INONCE(state), mac, + # crypto_secretstream_xchacha20poly1305_INONCEBYTES); + $st->xorNonce($mac); + + # sodium_increment(STATE_COUNTER(state), + # crypto_secretstream_xchacha20poly1305_COUNTERBYTES); + $st->incrementCounter(); + // Overwrite by reference: + $state = $st->toString(); + + /** @var bool $rekey */ + $rekey = ($tag & ParagonIE_Sodium_Compat::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY) !== 0; + # if ((tag & crypto_secretstream_xchacha20poly1305_TAG_REKEY) != 0 || + # sodium_is_zero(STATE_COUNTER(state), + # crypto_secretstream_xchacha20poly1305_COUNTERBYTES)) { + # crypto_secretstream_xchacha20poly1305_rekey(state); + # } + if ($rekey || $st->needsRekey()) { + // DO REKEY + self::secretstream_xchacha20poly1305_rekey($state); + } + # if (outlen_p != NULL) { + # *outlen_p = crypto_secretstream_xchacha20poly1305_ABYTES + mlen; + # } + return $out; + } + + /** + * @param string $state + * @param string $cipher + * @param string $aad + * @return bool|array{0: string, 1: int} + * @throws SodiumException + */ + public static function secretstream_xchacha20poly1305_pull(&$state, $cipher, $aad = '') + { + $st = ParagonIE_Sodium_Core_SecretStream_State::fromString($state); + + $cipherlen = ParagonIE_Sodium_Core_Util::strlen($cipher); + # mlen = inlen - crypto_secretstream_xchacha20poly1305_ABYTES; + $msglen = $cipherlen - ParagonIE_Sodium_Compat::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES; + $aadlen = ParagonIE_Sodium_Core_Util::strlen($aad); + + # if (mlen > crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX) { + # sodium_misuse(); + # } + if ((($msglen + 63) >> 6) > 0xfffffffe) { + throw new SodiumException( + 'message cannot be larger than SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX bytes' + ); + } + + # crypto_stream_chacha20_ietf(block, sizeof block, state->nonce, state->k); + # crypto_onetimeauth_poly1305_init(&poly1305_state, block); + # sodium_memzero(block, sizeof block); + $auth = new ParagonIE_Sodium_Core_Poly1305_State( + ParagonIE_Sodium_Core_ChaCha20::ietfStream(32, $st->getCombinedNonce(), $st->getKey()) + ); + + # crypto_onetimeauth_poly1305_update(&poly1305_state, ad, adlen); + $auth->update($aad); + + # crypto_onetimeauth_poly1305_update(&poly1305_state, _pad0, + # (0x10 - adlen) & 0xf); + $auth->update(str_repeat("\0", ((0x10 - $aadlen) & 0xf))); + + + # memset(block, 0, sizeof block); + # block[0] = in[0]; + # crypto_stream_chacha20_ietf_xor_ic(block, block, sizeof block, + # state->nonce, 1U, state->k); + $block = ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc( + $cipher[0] . str_repeat("\0", 63), + $st->getCombinedNonce(), + $st->getKey(), + ParagonIE_Sodium_Core_Util::store64_le(1) + ); + # tag = block[0]; + # block[0] = in[0]; + # crypto_onetimeauth_poly1305_update(&poly1305_state, block, sizeof block); + $tag = ParagonIE_Sodium_Core_Util::chrToInt($block[0]); + $block[0] = $cipher[0]; + $auth->update($block); + + + # c = in + (sizeof tag); + # crypto_onetimeauth_poly1305_update(&poly1305_state, c, mlen); + $auth->update(ParagonIE_Sodium_Core_Util::substr($cipher, 1, $msglen)); + + # crypto_onetimeauth_poly1305_update + # (&poly1305_state, _pad0, (0x10 - (sizeof block) + mlen) & 0xf); + $auth->update(str_repeat("\0", ((0x10 - 64 + $msglen) & 0xf))); + + # STORE64_LE(slen, (uint64_t) adlen); + # crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen); + $slen = ParagonIE_Sodium_Core_Util::store64_le($aadlen); + $auth->update($slen); + + # STORE64_LE(slen, (sizeof block) + mlen); + # crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen); + $slen = ParagonIE_Sodium_Core_Util::store64_le(64 + $msglen); + $auth->update($slen); + + # crypto_onetimeauth_poly1305_final(&poly1305_state, mac); + # sodium_memzero(&poly1305_state, sizeof poly1305_state); + $mac = $auth->finish(); + + # stored_mac = c + mlen; + # if (sodium_memcmp(mac, stored_mac, sizeof mac) != 0) { + # sodium_memzero(mac, sizeof mac); + # return -1; + # } + + $stored = ParagonIE_Sodium_Core_Util::substr($cipher, $msglen + 1, 16); + if (!ParagonIE_Sodium_Core_Util::hashEquals($mac, $stored)) { + return false; + } + + # crypto_stream_chacha20_ietf_xor_ic(m, c, mlen, state->nonce, 2U, state->k); + $out = ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc( + ParagonIE_Sodium_Core_Util::substr($cipher, 1, $msglen), + $st->getCombinedNonce(), + $st->getKey(), + ParagonIE_Sodium_Core_Util::store64_le(2) + ); + + # XOR_BUF(STATE_INONCE(state), mac, + # crypto_secretstream_xchacha20poly1305_INONCEBYTES); + $st->xorNonce($mac); + + # sodium_increment(STATE_COUNTER(state), + # crypto_secretstream_xchacha20poly1305_COUNTERBYTES); + $st->incrementCounter(); + + # if ((tag & crypto_secretstream_xchacha20poly1305_TAG_REKEY) != 0 || + # sodium_is_zero(STATE_COUNTER(state), + # crypto_secretstream_xchacha20poly1305_COUNTERBYTES)) { + # crypto_secretstream_xchacha20poly1305_rekey(state); + # } + + // Overwrite by reference: + $state = $st->toString(); + + /** @var bool $rekey */ + $rekey = ($tag & ParagonIE_Sodium_Compat::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY) !== 0; + if ($rekey || $st->needsRekey()) { + // DO REKEY + self::secretstream_xchacha20poly1305_rekey($state); + } + return array($out, $tag); + } + + /** + * @param string $state + * @return void + * @throws SodiumException + */ + public static function secretstream_xchacha20poly1305_rekey(&$state) + { + $st = ParagonIE_Sodium_Core_SecretStream_State::fromString($state); + # unsigned char new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES + + # crypto_secretstream_xchacha20poly1305_INONCEBYTES]; + # size_t i; + # for (i = 0U; i < crypto_stream_chacha20_ietf_KEYBYTES; i++) { + # new_key_and_inonce[i] = state->k[i]; + # } + $new_key_and_inonce = $st->getKey(); + + # for (i = 0U; i < crypto_secretstream_xchacha20poly1305_INONCEBYTES; i++) { + # new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES + i] = + # STATE_INONCE(state)[i]; + # } + $new_key_and_inonce .= ParagonIE_Sodium_Core_Util::substR($st->getNonce(), 0, 8); + + # crypto_stream_chacha20_ietf_xor(new_key_and_inonce, new_key_and_inonce, + # sizeof new_key_and_inonce, + # state->nonce, state->k); + + $st->rekey(ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc( + $new_key_and_inonce, + $st->getCombinedNonce(), + $st->getKey(), + ParagonIE_Sodium_Core_Util::store64_le(0) + )); + + # for (i = 0U; i < crypto_stream_chacha20_ietf_KEYBYTES; i++) { + # state->k[i] = new_key_and_inonce[i]; + # } + # for (i = 0U; i < crypto_secretstream_xchacha20poly1305_INONCEBYTES; i++) { + # STATE_INONCE(state)[i] = + # new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES + i]; + # } + # _crypto_secretstream_xchacha20poly1305_counter_reset(state); + $st->counterReset(); + + $state = $st->toString(); + } + + /** + * Detached Ed25519 signature. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string $sk + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function sign_detached($message, $sk) + { + return ParagonIE_Sodium_Core_Ed25519::sign_detached($message, $sk); + } + + /** + * Attached Ed25519 signature. (Returns a signed message.) + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string $sk + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function sign($message, $sk) + { + return ParagonIE_Sodium_Core_Ed25519::sign($message, $sk); + } + + /** + * Opens a signed message. If valid, returns the message. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $signedMessage + * @param string $pk + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function sign_open($signedMessage, $pk) + { + return ParagonIE_Sodium_Core_Ed25519::sign_open($signedMessage, $pk); + } + + /** + * Verify a detached signature of a given message and public key. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $signature + * @param string $message + * @param string $pk + * @return bool + * @throws SodiumException + * @throws TypeError + */ + public static function sign_verify_detached($signature, $message, $pk) + { + return ParagonIE_Sodium_Core_Ed25519::verify_detached($signature, $message, $pk); + } +} diff --git a/vendor/paragonie/sodium_compat/src/Crypto32.php b/vendor/paragonie/sodium_compat/src/Crypto32.php new file mode 100644 index 0000000..34c0d7a --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/Crypto32.php @@ -0,0 +1,1654 @@ +update($ad); + $state->update(ParagonIE_Sodium_Core32_Util::store64_le($adlen)); + $state->update($ciphertext); + $state->update(ParagonIE_Sodium_Core32_Util::store64_le($clen)); + $computed_mac = $state->finish(); + + /* Compare the given MAC with the recalculated MAC: */ + if (!ParagonIE_Sodium_Core32_Util::verify_16($computed_mac, $mac)) { + throw new SodiumException('Invalid MAC'); + } + + // Here, we know that the MAC is valid, so we decrypt and return the plaintext + return ParagonIE_Sodium_Core32_ChaCha20::streamXorIc( + $ciphertext, + $nonce, + $key, + ParagonIE_Sodium_Core32_Util::store64_le(1) + ); + } + + /** + * AEAD Encryption with ChaCha20-Poly1305 + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string $ad + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function aead_chacha20poly1305_encrypt( + $message = '', + $ad = '', + $nonce = '', + $key = '' + ) { + /** @var int $len - Length of the plaintext message */ + $len = ParagonIE_Sodium_Core32_Util::strlen($message); + + /** @var int $adlen - Length of the associated data */ + $adlen = ParagonIE_Sodium_Core32_Util::strlen($ad); + + /** @var string The first block of the chacha20 keystream, used as a poly1305 key */ + $block0 = ParagonIE_Sodium_Core32_ChaCha20::stream( + 32, + $nonce, + $key + ); + $state = new ParagonIE_Sodium_Core32_Poly1305_State($block0); + try { + ParagonIE_Sodium_Compat::memzero($block0); + } catch (SodiumException $ex) { + $block0 = null; + } + + /** @var string $ciphertext - Raw encrypted data */ + $ciphertext = ParagonIE_Sodium_Core32_ChaCha20::streamXorIc( + $message, + $nonce, + $key, + ParagonIE_Sodium_Core32_Util::store64_le(1) + ); + + $state->update($ad); + $state->update(ParagonIE_Sodium_Core32_Util::store64_le($adlen)); + $state->update($ciphertext); + $state->update(ParagonIE_Sodium_Core32_Util::store64_le($len)); + return $ciphertext . $state->finish(); + } + + /** + * AEAD Decryption with ChaCha20-Poly1305, IETF mode (96-bit nonce) + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string $ad + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function aead_chacha20poly1305_ietf_decrypt( + $message = '', + $ad = '', + $nonce = '', + $key = '' + ) { + /** @var int $adlen - Length of associated data */ + $adlen = ParagonIE_Sodium_Core32_Util::strlen($ad); + + /** @var int $len - Length of message (ciphertext + MAC) */ + $len = ParagonIE_Sodium_Core32_Util::strlen($message); + + /** @var int $clen - Length of ciphertext */ + $clen = $len - self::aead_chacha20poly1305_IETF_ABYTES; + + /** @var string The first block of the chacha20 keystream, used as a poly1305 key */ + $block0 = ParagonIE_Sodium_Core32_ChaCha20::ietfStream( + 32, + $nonce, + $key + ); + + /** @var string $mac - Message authentication code */ + $mac = ParagonIE_Sodium_Core32_Util::substr( + $message, + $len - self::aead_chacha20poly1305_IETF_ABYTES, + self::aead_chacha20poly1305_IETF_ABYTES + ); + + /** @var string $ciphertext - The encrypted message (sans MAC) */ + $ciphertext = ParagonIE_Sodium_Core32_Util::substr( + $message, + 0, + $len - self::aead_chacha20poly1305_IETF_ABYTES + ); + + /* Recalculate the Poly1305 authentication tag (MAC): */ + $state = new ParagonIE_Sodium_Core32_Poly1305_State($block0); + try { + ParagonIE_Sodium_Compat::memzero($block0); + } catch (SodiumException $ex) { + $block0 = null; + } + $state->update($ad); + $state->update(str_repeat("\x00", ((0x10 - $adlen) & 0xf))); + $state->update($ciphertext); + $state->update(str_repeat("\x00", (0x10 - $clen) & 0xf)); + $state->update(ParagonIE_Sodium_Core32_Util::store64_le($adlen)); + $state->update(ParagonIE_Sodium_Core32_Util::store64_le($clen)); + $computed_mac = $state->finish(); + + /* Compare the given MAC with the recalculated MAC: */ + if (!ParagonIE_Sodium_Core32_Util::verify_16($computed_mac, $mac)) { + throw new SodiumException('Invalid MAC'); + } + + // Here, we know that the MAC is valid, so we decrypt and return the plaintext + return ParagonIE_Sodium_Core32_ChaCha20::ietfStreamXorIc( + $ciphertext, + $nonce, + $key, + ParagonIE_Sodium_Core32_Util::store64_le(1) + ); + } + + /** + * AEAD Encryption with ChaCha20-Poly1305, IETF mode (96-bit nonce) + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string $ad + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function aead_chacha20poly1305_ietf_encrypt( + $message = '', + $ad = '', + $nonce = '', + $key = '' + ) { + /** @var int $len - Length of the plaintext message */ + $len = ParagonIE_Sodium_Core32_Util::strlen($message); + + /** @var int $adlen - Length of the associated data */ + $adlen = ParagonIE_Sodium_Core32_Util::strlen($ad); + + /** @var string The first block of the chacha20 keystream, used as a poly1305 key */ + $block0 = ParagonIE_Sodium_Core32_ChaCha20::ietfStream( + 32, + $nonce, + $key + ); + $state = new ParagonIE_Sodium_Core32_Poly1305_State($block0); + try { + ParagonIE_Sodium_Compat::memzero($block0); + } catch (SodiumException $ex) { + $block0 = null; + } + + /** @var string $ciphertext - Raw encrypted data */ + $ciphertext = ParagonIE_Sodium_Core32_ChaCha20::ietfStreamXorIc( + $message, + $nonce, + $key, + ParagonIE_Sodium_Core32_Util::store64_le(1) + ); + + $state->update($ad); + $state->update(str_repeat("\x00", ((0x10 - $adlen) & 0xf))); + $state->update($ciphertext); + $state->update(str_repeat("\x00", ((0x10 - $len) & 0xf))); + $state->update(ParagonIE_Sodium_Core32_Util::store64_le($adlen)); + $state->update(ParagonIE_Sodium_Core32_Util::store64_le($len)); + return $ciphertext . $state->finish(); + } + + /** + * AEAD Decryption with ChaCha20-Poly1305, IETF mode (96-bit nonce) + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string $ad + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function aead_xchacha20poly1305_ietf_decrypt( + $message = '', + $ad = '', + $nonce = '', + $key = '' + ) { + $subkey = ParagonIE_Sodium_Core32_HChaCha20::hChaCha20( + ParagonIE_Sodium_Core32_Util::substr($nonce, 0, 16), + $key + ); + $nonceLast = "\x00\x00\x00\x00" . + ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8); + + return self::aead_chacha20poly1305_ietf_decrypt($message, $ad, $nonceLast, $subkey); + } + + /** + * AEAD Encryption with ChaCha20-Poly1305, IETF mode (96-bit nonce) + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string $ad + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function aead_xchacha20poly1305_ietf_encrypt( + $message = '', + $ad = '', + $nonce = '', + $key = '' + ) { + $subkey = ParagonIE_Sodium_Core32_HChaCha20::hChaCha20( + ParagonIE_Sodium_Core32_Util::substr($nonce, 0, 16), + $key + ); + $nonceLast = "\x00\x00\x00\x00" . + ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8); + + return self::aead_chacha20poly1305_ietf_encrypt($message, $ad, $nonceLast, $subkey); + } + + /** + * HMAC-SHA-512-256 (a.k.a. the leftmost 256 bits of HMAC-SHA-512) + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string $key + * @return string + * @throws TypeError + */ + public static function auth($message, $key) + { + return ParagonIE_Sodium_Core32_Util::substr( + hash_hmac('sha512', $message, $key, true), + 0, + 32 + ); + } + + /** + * HMAC-SHA-512-256 validation. Constant-time via hash_equals(). + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $mac + * @param string $message + * @param string $key + * @return bool + * @throws SodiumException + * @throws TypeError + */ + public static function auth_verify($mac, $message, $key) + { + return ParagonIE_Sodium_Core32_Util::hashEquals( + $mac, + self::auth($message, $key) + ); + } + + /** + * X25519 key exchange followed by XSalsa20Poly1305 symmetric encryption + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $plaintext + * @param string $nonce + * @param string $keypair + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function box($plaintext, $nonce, $keypair) + { + return self::secretbox( + $plaintext, + $nonce, + self::box_beforenm( + self::box_secretkey($keypair), + self::box_publickey($keypair) + ) + ); + } + + /** + * X25519-XSalsa20-Poly1305 with one ephemeral X25519 keypair. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string $publicKey + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function box_seal($message, $publicKey) + { + /** @var string $ephemeralKeypair */ + $ephemeralKeypair = self::box_keypair(); + + /** @var string $ephemeralSK */ + $ephemeralSK = self::box_secretkey($ephemeralKeypair); + + /** @var string $ephemeralPK */ + $ephemeralPK = self::box_publickey($ephemeralKeypair); + + /** @var string $nonce */ + $nonce = self::generichash( + $ephemeralPK . $publicKey, + '', + 24 + ); + + /** @var string $keypair - The combined keypair used in crypto_box() */ + $keypair = self::box_keypair_from_secretkey_and_publickey($ephemeralSK, $publicKey); + + /** @var string $ciphertext Ciphertext + MAC from crypto_box */ + $ciphertext = self::box($message, $nonce, $keypair); + try { + ParagonIE_Sodium_Compat::memzero($ephemeralKeypair); + ParagonIE_Sodium_Compat::memzero($ephemeralSK); + ParagonIE_Sodium_Compat::memzero($nonce); + } catch (SodiumException $ex) { + $ephemeralKeypair = null; + $ephemeralSK = null; + $nonce = null; + } + return $ephemeralPK . $ciphertext; + } + + /** + * Opens a message encrypted via box_seal(). + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string $keypair + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function box_seal_open($message, $keypair) + { + /** @var string $ephemeralPK */ + $ephemeralPK = ParagonIE_Sodium_Core32_Util::substr($message, 0, 32); + + /** @var string $ciphertext (ciphertext + MAC) */ + $ciphertext = ParagonIE_Sodium_Core32_Util::substr($message, 32); + + /** @var string $secretKey */ + $secretKey = self::box_secretkey($keypair); + + /** @var string $publicKey */ + $publicKey = self::box_publickey($keypair); + + /** @var string $nonce */ + $nonce = self::generichash( + $ephemeralPK . $publicKey, + '', + 24 + ); + + /** @var string $keypair */ + $keypair = self::box_keypair_from_secretkey_and_publickey($secretKey, $ephemeralPK); + + /** @var string $m */ + $m = self::box_open($ciphertext, $nonce, $keypair); + try { + ParagonIE_Sodium_Compat::memzero($secretKey); + ParagonIE_Sodium_Compat::memzero($ephemeralPK); + ParagonIE_Sodium_Compat::memzero($nonce); + } catch (SodiumException $ex) { + $secretKey = null; + $ephemeralPK = null; + $nonce = null; + } + return $m; + } + + /** + * Used by crypto_box() to get the crypto_secretbox() key. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $sk + * @param string $pk + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function box_beforenm($sk, $pk) + { + return ParagonIE_Sodium_Core32_HSalsa20::hsalsa20( + str_repeat("\x00", 16), + self::scalarmult($sk, $pk) + ); + } + + /** + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @return string + * @throws Exception + * @throws SodiumException + * @throws TypeError + */ + public static function box_keypair() + { + $sKey = random_bytes(32); + $pKey = self::scalarmult_base($sKey); + return $sKey . $pKey; + } + + /** + * @param string $seed + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function box_seed_keypair($seed) + { + $sKey = ParagonIE_Sodium_Core32_Util::substr( + hash('sha512', $seed, true), + 0, + 32 + ); + $pKey = self::scalarmult_base($sKey); + return $sKey . $pKey; + } + + /** + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $sKey + * @param string $pKey + * @return string + * @throws TypeError + */ + public static function box_keypair_from_secretkey_and_publickey($sKey, $pKey) + { + return ParagonIE_Sodium_Core32_Util::substr($sKey, 0, 32) . + ParagonIE_Sodium_Core32_Util::substr($pKey, 0, 32); + } + + /** + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $keypair + * @return string + * @throws RangeException + * @throws TypeError + */ + public static function box_secretkey($keypair) + { + if (ParagonIE_Sodium_Core32_Util::strlen($keypair) !== 64) { + throw new RangeException( + 'Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES bytes long.' + ); + } + return ParagonIE_Sodium_Core32_Util::substr($keypair, 0, 32); + } + + /** + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $keypair + * @return string + * @throws RangeException + * @throws TypeError + */ + public static function box_publickey($keypair) + { + if (ParagonIE_Sodium_Core32_Util::strlen($keypair) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES) { + throw new RangeException( + 'Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES bytes long.' + ); + } + return ParagonIE_Sodium_Core32_Util::substr($keypair, 32, 32); + } + + /** + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $sKey + * @return string + * @throws RangeException + * @throws SodiumException + * @throws TypeError + */ + public static function box_publickey_from_secretkey($sKey) + { + if (ParagonIE_Sodium_Core32_Util::strlen($sKey) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_SECRETKEYBYTES) { + throw new RangeException( + 'Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_SECRETKEYBYTES bytes long.' + ); + } + return self::scalarmult_base($sKey); + } + + /** + * Decrypt a message encrypted with box(). + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $ciphertext + * @param string $nonce + * @param string $keypair + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function box_open($ciphertext, $nonce, $keypair) + { + return self::secretbox_open( + $ciphertext, + $nonce, + self::box_beforenm( + self::box_secretkey($keypair), + self::box_publickey($keypair) + ) + ); + } + + /** + * Calculate a BLAKE2b hash. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string|null $key + * @param int $outlen + * @return string + * @throws RangeException + * @throws SodiumException + * @throws TypeError + */ + public static function generichash($message, $key = '', $outlen = 32) + { + // This ensures that ParagonIE_Sodium_Core32_BLAKE2b::$iv is initialized + ParagonIE_Sodium_Core32_BLAKE2b::pseudoConstructor(); + + $k = null; + if (!empty($key)) { + /** @var SplFixedArray $k */ + $k = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($key); + if ($k->count() > ParagonIE_Sodium_Core32_BLAKE2b::KEYBYTES) { + throw new RangeException('Invalid key size'); + } + } + + /** @var SplFixedArray $in */ + $in = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($message); + + /** @var SplFixedArray $ctx */ + $ctx = ParagonIE_Sodium_Core32_BLAKE2b::init($k, $outlen); + ParagonIE_Sodium_Core32_BLAKE2b::update($ctx, $in, $in->count()); + + /** @var SplFixedArray $out */ + $out = new SplFixedArray($outlen); + $out = ParagonIE_Sodium_Core32_BLAKE2b::finish($ctx, $out); + + /** @var array */ + $outArray = $out->toArray(); + return ParagonIE_Sodium_Core32_Util::intArrayToString($outArray); + } + + /** + * Finalize a BLAKE2b hashing context, returning the hash. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $ctx + * @param int $outlen + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function generichash_final($ctx, $outlen = 32) + { + if (!is_string($ctx)) { + throw new TypeError('Context must be a string'); + } + $out = new SplFixedArray($outlen); + + /** @var SplFixedArray $context */ + $context = ParagonIE_Sodium_Core32_BLAKE2b::stringToContext($ctx); + + /** @var SplFixedArray $out */ + $out = ParagonIE_Sodium_Core32_BLAKE2b::finish($context, $out); + + /** @var array */ + $outArray = $out->toArray(); + return ParagonIE_Sodium_Core32_Util::intArrayToString($outArray); + } + + /** + * Initialize a hashing context for BLAKE2b. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $key + * @param int $outputLength + * @return string + * @throws RangeException + * @throws SodiumException + * @throws TypeError + */ + public static function generichash_init($key = '', $outputLength = 32) + { + // This ensures that ParagonIE_Sodium_Core32_BLAKE2b::$iv is initialized + ParagonIE_Sodium_Core32_BLAKE2b::pseudoConstructor(); + + $k = null; + if (!empty($key)) { + $k = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($key); + if ($k->count() > ParagonIE_Sodium_Core32_BLAKE2b::KEYBYTES) { + throw new RangeException('Invalid key size'); + } + } + + /** @var SplFixedArray $ctx */ + $ctx = ParagonIE_Sodium_Core32_BLAKE2b::init($k, $outputLength); + + return ParagonIE_Sodium_Core32_BLAKE2b::contextToString($ctx); + } + + /** + * Initialize a hashing context for BLAKE2b. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $key + * @param int $outputLength + * @param string $salt + * @param string $personal + * @return string + * @throws RangeException + * @throws SodiumException + * @throws TypeError + */ + public static function generichash_init_salt_personal( + $key = '', + $outputLength = 32, + $salt = '', + $personal = '' + ) { + // This ensures that ParagonIE_Sodium_Core32_BLAKE2b::$iv is initialized + ParagonIE_Sodium_Core32_BLAKE2b::pseudoConstructor(); + + $k = null; + if (!empty($key)) { + $k = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($key); + if ($k->count() > ParagonIE_Sodium_Core32_BLAKE2b::KEYBYTES) { + throw new RangeException('Invalid key size'); + } + } + if (!empty($salt)) { + $s = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($salt); + } else { + $s = null; + } + if (!empty($salt)) { + $p = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($personal); + } else { + $p = null; + } + + /** @var SplFixedArray $ctx */ + $ctx = ParagonIE_Sodium_Core32_BLAKE2b::init($k, $outputLength, $s, $p); + + return ParagonIE_Sodium_Core32_BLAKE2b::contextToString($ctx); + } + + /** + * Update a hashing context for BLAKE2b with $message + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $ctx + * @param string $message + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function generichash_update($ctx, $message) + { + // This ensures that ParagonIE_Sodium_Core32_BLAKE2b::$iv is initialized + ParagonIE_Sodium_Core32_BLAKE2b::pseudoConstructor(); + + /** @var SplFixedArray $context */ + $context = ParagonIE_Sodium_Core32_BLAKE2b::stringToContext($ctx); + + /** @var SplFixedArray $in */ + $in = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($message); + + ParagonIE_Sodium_Core32_BLAKE2b::update($context, $in, $in->count()); + + return ParagonIE_Sodium_Core32_BLAKE2b::contextToString($context); + } + + /** + * Libsodium's crypto_kx(). + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $my_sk + * @param string $their_pk + * @param string $client_pk + * @param string $server_pk + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function keyExchange($my_sk, $their_pk, $client_pk, $server_pk) + { + return self::generichash( + self::scalarmult($my_sk, $their_pk) . + $client_pk . + $server_pk + ); + } + + /** + * ECDH over Curve25519 + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $sKey + * @param string $pKey + * @return string + * + * @throws SodiumException + * @throws TypeError + */ + public static function scalarmult($sKey, $pKey) + { + $q = ParagonIE_Sodium_Core32_X25519::crypto_scalarmult_curve25519_ref10($sKey, $pKey); + self::scalarmult_throw_if_zero($q); + return $q; + } + + /** + * ECDH over Curve25519, using the basepoint. + * Used to get a secret key from a public key. + * + * @param string $secret + * @return string + * + * @throws SodiumException + * @throws TypeError + */ + public static function scalarmult_base($secret) + { + $q = ParagonIE_Sodium_Core32_X25519::crypto_scalarmult_curve25519_ref10_base($secret); + self::scalarmult_throw_if_zero($q); + return $q; + } + + /** + * This throws an Error if a zero public key was passed to the function. + * + * @param string $q + * @return void + * @throws SodiumException + * @throws TypeError + */ + protected static function scalarmult_throw_if_zero($q) + { + $d = 0; + for ($i = 0; $i < self::box_curve25519xsalsa20poly1305_SECRETKEYBYTES; ++$i) { + $d |= ParagonIE_Sodium_Core32_Util::chrToInt($q[$i]); + } + + /* branch-free variant of === 0 */ + if (-(1 & (($d - 1) >> 8))) { + throw new SodiumException('Zero public key is not allowed'); + } + } + + /** + * XSalsa20-Poly1305 authenticated symmetric-key encryption. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $plaintext + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function secretbox($plaintext, $nonce, $key) + { + /** @var string $subkey */ + $subkey = ParagonIE_Sodium_Core32_HSalsa20::hsalsa20($nonce, $key); + + /** @var string $block0 */ + $block0 = str_repeat("\x00", 32); + + /** @var int $mlen - Length of the plaintext message */ + $mlen = ParagonIE_Sodium_Core32_Util::strlen($plaintext); + $mlen0 = $mlen; + if ($mlen0 > 64 - self::secretbox_xsalsa20poly1305_ZEROBYTES) { + $mlen0 = 64 - self::secretbox_xsalsa20poly1305_ZEROBYTES; + } + $block0 .= ParagonIE_Sodium_Core32_Util::substr($plaintext, 0, $mlen0); + + /** @var string $block0 */ + $block0 = ParagonIE_Sodium_Core32_Salsa20::salsa20_xor( + $block0, + ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8), + $subkey + ); + + /** @var string $c */ + $c = ParagonIE_Sodium_Core32_Util::substr( + $block0, + self::secretbox_xsalsa20poly1305_ZEROBYTES + ); + if ($mlen > $mlen0) { + $c .= ParagonIE_Sodium_Core32_Salsa20::salsa20_xor_ic( + ParagonIE_Sodium_Core32_Util::substr( + $plaintext, + self::secretbox_xsalsa20poly1305_ZEROBYTES + ), + ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8), + 1, + $subkey + ); + } + $state = new ParagonIE_Sodium_Core32_Poly1305_State( + ParagonIE_Sodium_Core32_Util::substr( + $block0, + 0, + self::onetimeauth_poly1305_KEYBYTES + ) + ); + try { + ParagonIE_Sodium_Compat::memzero($block0); + ParagonIE_Sodium_Compat::memzero($subkey); + } catch (SodiumException $ex) { + $block0 = null; + $subkey = null; + } + + $state->update($c); + + /** @var string $c - MAC || ciphertext */ + $c = $state->finish() . $c; + unset($state); + + return $c; + } + + /** + * Decrypt a ciphertext generated via secretbox(). + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $ciphertext + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function secretbox_open($ciphertext, $nonce, $key) + { + /** @var string $mac */ + $mac = ParagonIE_Sodium_Core32_Util::substr( + $ciphertext, + 0, + self::secretbox_xsalsa20poly1305_MACBYTES + ); + + /** @var string $c */ + $c = ParagonIE_Sodium_Core32_Util::substr( + $ciphertext, + self::secretbox_xsalsa20poly1305_MACBYTES + ); + + /** @var int $clen */ + $clen = ParagonIE_Sodium_Core32_Util::strlen($c); + + /** @var string $subkey */ + $subkey = ParagonIE_Sodium_Core32_HSalsa20::hsalsa20($nonce, $key); + + /** @var string $block0 */ + $block0 = ParagonIE_Sodium_Core32_Salsa20::salsa20( + 64, + ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8), + $subkey + ); + $verified = ParagonIE_Sodium_Core32_Poly1305::onetimeauth_verify( + $mac, + $c, + ParagonIE_Sodium_Core32_Util::substr($block0, 0, 32) + ); + if (!$verified) { + try { + ParagonIE_Sodium_Compat::memzero($subkey); + } catch (SodiumException $ex) { + $subkey = null; + } + throw new SodiumException('Invalid MAC'); + } + + /** @var string $m - Decrypted message */ + $m = ParagonIE_Sodium_Core32_Util::xorStrings( + ParagonIE_Sodium_Core32_Util::substr($block0, self::secretbox_xsalsa20poly1305_ZEROBYTES), + ParagonIE_Sodium_Core32_Util::substr($c, 0, self::secretbox_xsalsa20poly1305_ZEROBYTES) + ); + if ($clen > self::secretbox_xsalsa20poly1305_ZEROBYTES) { + // We had more than 1 block, so let's continue to decrypt the rest. + $m .= ParagonIE_Sodium_Core32_Salsa20::salsa20_xor_ic( + ParagonIE_Sodium_Core32_Util::substr( + $c, + self::secretbox_xsalsa20poly1305_ZEROBYTES + ), + ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8), + 1, + (string) $subkey + ); + } + return $m; + } + + /** + * XChaCha20-Poly1305 authenticated symmetric-key encryption. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $plaintext + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function secretbox_xchacha20poly1305($plaintext, $nonce, $key) + { + /** @var string $subkey */ + $subkey = ParagonIE_Sodium_Core32_HChaCha20::hChaCha20( + ParagonIE_Sodium_Core32_Util::substr($nonce, 0, 16), + $key + ); + $nonceLast = ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8); + + /** @var string $block0 */ + $block0 = str_repeat("\x00", 32); + + /** @var int $mlen - Length of the plaintext message */ + $mlen = ParagonIE_Sodium_Core32_Util::strlen($plaintext); + $mlen0 = $mlen; + if ($mlen0 > 64 - self::secretbox_xchacha20poly1305_ZEROBYTES) { + $mlen0 = 64 - self::secretbox_xchacha20poly1305_ZEROBYTES; + } + $block0 .= ParagonIE_Sodium_Core32_Util::substr($plaintext, 0, $mlen0); + + /** @var string $block0 */ + $block0 = ParagonIE_Sodium_Core32_ChaCha20::streamXorIc( + $block0, + $nonceLast, + $subkey + ); + + /** @var string $c */ + $c = ParagonIE_Sodium_Core32_Util::substr( + $block0, + self::secretbox_xchacha20poly1305_ZEROBYTES + ); + if ($mlen > $mlen0) { + $c .= ParagonIE_Sodium_Core32_ChaCha20::streamXorIc( + ParagonIE_Sodium_Core32_Util::substr( + $plaintext, + self::secretbox_xchacha20poly1305_ZEROBYTES + ), + $nonceLast, + $subkey, + ParagonIE_Sodium_Core32_Util::store64_le(1) + ); + } + $state = new ParagonIE_Sodium_Core32_Poly1305_State( + ParagonIE_Sodium_Core32_Util::substr( + $block0, + 0, + self::onetimeauth_poly1305_KEYBYTES + ) + ); + try { + ParagonIE_Sodium_Compat::memzero($block0); + ParagonIE_Sodium_Compat::memzero($subkey); + } catch (SodiumException $ex) { + $block0 = null; + $subkey = null; + } + + $state->update($c); + + /** @var string $c - MAC || ciphertext */ + $c = $state->finish() . $c; + unset($state); + + return $c; + } + + /** + * Decrypt a ciphertext generated via secretbox_xchacha20poly1305(). + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $ciphertext + * @param string $nonce + * @param string $key + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function secretbox_xchacha20poly1305_open($ciphertext, $nonce, $key) + { + /** @var string $mac */ + $mac = ParagonIE_Sodium_Core32_Util::substr( + $ciphertext, + 0, + self::secretbox_xchacha20poly1305_MACBYTES + ); + + /** @var string $c */ + $c = ParagonIE_Sodium_Core32_Util::substr( + $ciphertext, + self::secretbox_xchacha20poly1305_MACBYTES + ); + + /** @var int $clen */ + $clen = ParagonIE_Sodium_Core32_Util::strlen($c); + + /** @var string $subkey */ + $subkey = ParagonIE_Sodium_Core32_HChaCha20::hchacha20($nonce, $key); + + /** @var string $block0 */ + $block0 = ParagonIE_Sodium_Core32_ChaCha20::stream( + 64, + ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8), + $subkey + ); + $verified = ParagonIE_Sodium_Core32_Poly1305::onetimeauth_verify( + $mac, + $c, + ParagonIE_Sodium_Core32_Util::substr($block0, 0, 32) + ); + + if (!$verified) { + try { + ParagonIE_Sodium_Compat::memzero($subkey); + } catch (SodiumException $ex) { + $subkey = null; + } + throw new SodiumException('Invalid MAC'); + } + + /** @var string $m - Decrypted message */ + $m = ParagonIE_Sodium_Core32_Util::xorStrings( + ParagonIE_Sodium_Core32_Util::substr($block0, self::secretbox_xchacha20poly1305_ZEROBYTES), + ParagonIE_Sodium_Core32_Util::substr($c, 0, self::secretbox_xchacha20poly1305_ZEROBYTES) + ); + + if ($clen > self::secretbox_xchacha20poly1305_ZEROBYTES) { + // We had more than 1 block, so let's continue to decrypt the rest. + $m .= ParagonIE_Sodium_Core32_ChaCha20::streamXorIc( + ParagonIE_Sodium_Core32_Util::substr( + $c, + self::secretbox_xchacha20poly1305_ZEROBYTES + ), + ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8), + (string) $subkey, + ParagonIE_Sodium_Core32_Util::store64_le(1) + ); + } + return $m; + } + + /** + * @param string $key + * @return array Returns a state and a header. + * @throws Exception + * @throws SodiumException + */ + public static function secretstream_xchacha20poly1305_init_push($key) + { + # randombytes_buf(out, crypto_secretstream_xchacha20poly1305_HEADERBYTES); + $out = random_bytes(24); + + # crypto_core_hchacha20(state->k, out, k, NULL); + $subkey = ParagonIE_Sodium_Core32_HChaCha20::hChaCha20($out, $key); + $state = new ParagonIE_Sodium_Core32_SecretStream_State( + $subkey, + ParagonIE_Sodium_Core32_Util::substr($out, 16, 8) . str_repeat("\0", 4) + ); + + # _crypto_secretstream_xchacha20poly1305_counter_reset(state); + $state->counterReset(); + + # memcpy(STATE_INONCE(state), out + crypto_core_hchacha20_INPUTBYTES, + # crypto_secretstream_xchacha20poly1305_INONCEBYTES); + # memset(state->_pad, 0, sizeof state->_pad); + return array( + $state->toString(), + $out + ); + } + + /** + * @param string $key + * @param string $header + * @return string Returns a state. + * @throws Exception + */ + public static function secretstream_xchacha20poly1305_init_pull($key, $header) + { + # crypto_core_hchacha20(state->k, in, k, NULL); + $subkey = ParagonIE_Sodium_Core32_HChaCha20::hChaCha20( + ParagonIE_Sodium_Core32_Util::substr($header, 0, 16), + $key + ); + $state = new ParagonIE_Sodium_Core32_SecretStream_State( + $subkey, + ParagonIE_Sodium_Core32_Util::substr($header, 16) + ); + $state->counterReset(); + # memcpy(STATE_INONCE(state), in + crypto_core_hchacha20_INPUTBYTES, + # crypto_secretstream_xchacha20poly1305_INONCEBYTES); + # memset(state->_pad, 0, sizeof state->_pad); + # return 0; + return $state->toString(); + } + + /** + * @param string $state + * @param string $msg + * @param string $aad + * @param int $tag + * @return string + * @throws SodiumException + */ + public static function secretstream_xchacha20poly1305_push(&$state, $msg, $aad = '', $tag = 0) + { + $st = ParagonIE_Sodium_Core32_SecretStream_State::fromString($state); + # crypto_onetimeauth_poly1305_state poly1305_state; + # unsigned char block[64U]; + # unsigned char slen[8U]; + # unsigned char *c; + # unsigned char *mac; + + $msglen = ParagonIE_Sodium_Core32_Util::strlen($msg); + $aadlen = ParagonIE_Sodium_Core32_Util::strlen($aad); + + if ((($msglen + 63) >> 6) > 0xfffffffe) { + throw new SodiumException( + 'message cannot be larger than SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX bytes' + ); + } + + # if (outlen_p != NULL) { + # *outlen_p = 0U; + # } + # if (mlen > crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX) { + # sodium_misuse(); + # } + + # crypto_stream_chacha20_ietf(block, sizeof block, state->nonce, state->k); + # crypto_onetimeauth_poly1305_init(&poly1305_state, block); + # sodium_memzero(block, sizeof block); + $auth = new ParagonIE_Sodium_Core32_Poly1305_State( + ParagonIE_Sodium_Core32_ChaCha20::ietfStream(32, $st->getCombinedNonce(), $st->getKey()) + ); + + # crypto_onetimeauth_poly1305_update(&poly1305_state, ad, adlen); + $auth->update($aad); + + # crypto_onetimeauth_poly1305_update(&poly1305_state, _pad0, + # (0x10 - adlen) & 0xf); + $auth->update(str_repeat("\0", ((0x10 - $aadlen) & 0xf))); + + # memset(block, 0, sizeof block); + # block[0] = tag; + # crypto_stream_chacha20_ietf_xor_ic(block, block, sizeof block, + # state->nonce, 1U, state->k); + $block = ParagonIE_Sodium_Core32_ChaCha20::ietfStreamXorIc( + ParagonIE_Sodium_Core32_Util::intToChr($tag) . str_repeat("\0", 63), + $st->getCombinedNonce(), + $st->getKey(), + ParagonIE_Sodium_Core32_Util::store64_le(1) + ); + + # crypto_onetimeauth_poly1305_update(&poly1305_state, block, sizeof block); + $auth->update($block); + + # out[0] = block[0]; + $out = $block[0]; + # c = out + (sizeof tag); + # crypto_stream_chacha20_ietf_xor_ic(c, m, mlen, state->nonce, 2U, state->k); + $cipher = ParagonIE_Sodium_Core32_ChaCha20::ietfStreamXorIc( + $msg, + $st->getCombinedNonce(), + $st->getKey(), + ParagonIE_Sodium_Core32_Util::store64_le(2) + ); + + # crypto_onetimeauth_poly1305_update(&poly1305_state, c, mlen); + $auth->update($cipher); + + $out .= $cipher; + unset($cipher); + + # crypto_onetimeauth_poly1305_update + # (&poly1305_state, _pad0, (0x10 - (sizeof block) + mlen) & 0xf); + $auth->update(str_repeat("\0", ((0x10 - 64 + $msglen) & 0xf))); + + # STORE64_LE(slen, (uint64_t) adlen); + $slen = ParagonIE_Sodium_Core32_Util::store64_le($aadlen); + + # crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen); + $auth->update($slen); + + # STORE64_LE(slen, (sizeof block) + mlen); + $slen = ParagonIE_Sodium_Core32_Util::store64_le(64 + $msglen); + + # crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen); + $auth->update($slen); + + # mac = c + mlen; + # crypto_onetimeauth_poly1305_final(&poly1305_state, mac); + $mac = $auth->finish(); + $out .= $mac; + + # sodium_memzero(&poly1305_state, sizeof poly1305_state); + unset($auth); + + + # XOR_BUF(STATE_INONCE(state), mac, + # crypto_secretstream_xchacha20poly1305_INONCEBYTES); + $st->xorNonce($mac); + + # sodium_increment(STATE_COUNTER(state), + # crypto_secretstream_xchacha20poly1305_COUNTERBYTES); + $st->incrementCounter(); + // Overwrite by reference: + $state = $st->toString(); + + /** @var bool $rekey */ + $rekey = ($tag & ParagonIE_Sodium_Compat::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY) !== 0; + # if ((tag & crypto_secretstream_xchacha20poly1305_TAG_REKEY) != 0 || + # sodium_is_zero(STATE_COUNTER(state), + # crypto_secretstream_xchacha20poly1305_COUNTERBYTES)) { + # crypto_secretstream_xchacha20poly1305_rekey(state); + # } + if ($rekey || $st->needsRekey()) { + // DO REKEY + self::secretstream_xchacha20poly1305_rekey($state); + } + # if (outlen_p != NULL) { + # *outlen_p = crypto_secretstream_xchacha20poly1305_ABYTES + mlen; + # } + return $out; + } + + /** + * @param string $state + * @param string $cipher + * @param string $aad + * @return bool|array{0: string, 1: int} + * @throws SodiumException + */ + public static function secretstream_xchacha20poly1305_pull(&$state, $cipher, $aad = '') + { + $st = ParagonIE_Sodium_Core32_SecretStream_State::fromString($state); + + $cipherlen = ParagonIE_Sodium_Core32_Util::strlen($cipher); + # mlen = inlen - crypto_secretstream_xchacha20poly1305_ABYTES; + $msglen = $cipherlen - ParagonIE_Sodium_Compat::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES; + $aadlen = ParagonIE_Sodium_Core32_Util::strlen($aad); + + # if (mlen > crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX) { + # sodium_misuse(); + # } + if ((($msglen + 63) >> 6) > 0xfffffffe) { + throw new SodiumException( + 'message cannot be larger than SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX bytes' + ); + } + + # crypto_stream_chacha20_ietf(block, sizeof block, state->nonce, state->k); + # crypto_onetimeauth_poly1305_init(&poly1305_state, block); + # sodium_memzero(block, sizeof block); + $auth = new ParagonIE_Sodium_Core32_Poly1305_State( + ParagonIE_Sodium_Core32_ChaCha20::ietfStream(32, $st->getCombinedNonce(), $st->getKey()) + ); + + # crypto_onetimeauth_poly1305_update(&poly1305_state, ad, adlen); + $auth->update($aad); + + # crypto_onetimeauth_poly1305_update(&poly1305_state, _pad0, + # (0x10 - adlen) & 0xf); + $auth->update(str_repeat("\0", ((0x10 - $aadlen) & 0xf))); + + + # memset(block, 0, sizeof block); + # block[0] = in[0]; + # crypto_stream_chacha20_ietf_xor_ic(block, block, sizeof block, + # state->nonce, 1U, state->k); + $block = ParagonIE_Sodium_Core32_ChaCha20::ietfStreamXorIc( + $cipher[0] . str_repeat("\0", 63), + $st->getCombinedNonce(), + $st->getKey(), + ParagonIE_Sodium_Core32_Util::store64_le(1) + ); + # tag = block[0]; + # block[0] = in[0]; + # crypto_onetimeauth_poly1305_update(&poly1305_state, block, sizeof block); + $tag = ParagonIE_Sodium_Core32_Util::chrToInt($block[0]); + $block[0] = $cipher[0]; + $auth->update($block); + + + # c = in + (sizeof tag); + # crypto_onetimeauth_poly1305_update(&poly1305_state, c, mlen); + $auth->update(ParagonIE_Sodium_Core32_Util::substr($cipher, 1, $msglen)); + + # crypto_onetimeauth_poly1305_update + # (&poly1305_state, _pad0, (0x10 - (sizeof block) + mlen) & 0xf); + $auth->update(str_repeat("\0", ((0x10 - 64 + $msglen) & 0xf))); + + # STORE64_LE(slen, (uint64_t) adlen); + # crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen); + $slen = ParagonIE_Sodium_Core32_Util::store64_le($aadlen); + $auth->update($slen); + + # STORE64_LE(slen, (sizeof block) + mlen); + # crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen); + $slen = ParagonIE_Sodium_Core32_Util::store64_le(64 + $msglen); + $auth->update($slen); + + # crypto_onetimeauth_poly1305_final(&poly1305_state, mac); + # sodium_memzero(&poly1305_state, sizeof poly1305_state); + $mac = $auth->finish(); + + # stored_mac = c + mlen; + # if (sodium_memcmp(mac, stored_mac, sizeof mac) != 0) { + # sodium_memzero(mac, sizeof mac); + # return -1; + # } + + $stored = ParagonIE_Sodium_Core32_Util::substr($cipher, $msglen + 1, 16); + if (!ParagonIE_Sodium_Core32_Util::hashEquals($mac, $stored)) { + return false; + } + + # crypto_stream_chacha20_ietf_xor_ic(m, c, mlen, state->nonce, 2U, state->k); + $out = ParagonIE_Sodium_Core32_ChaCha20::ietfStreamXorIc( + ParagonIE_Sodium_Core32_Util::substr($cipher, 1, $msglen), + $st->getCombinedNonce(), + $st->getKey(), + ParagonIE_Sodium_Core32_Util::store64_le(2) + ); + + # XOR_BUF(STATE_INONCE(state), mac, + # crypto_secretstream_xchacha20poly1305_INONCEBYTES); + $st->xorNonce($mac); + + # sodium_increment(STATE_COUNTER(state), + # crypto_secretstream_xchacha20poly1305_COUNTERBYTES); + $st->incrementCounter(); + + # if ((tag & crypto_secretstream_xchacha20poly1305_TAG_REKEY) != 0 || + # sodium_is_zero(STATE_COUNTER(state), + # crypto_secretstream_xchacha20poly1305_COUNTERBYTES)) { + # crypto_secretstream_xchacha20poly1305_rekey(state); + # } + + // Overwrite by reference: + $state = $st->toString(); + + /** @var bool $rekey */ + $rekey = ($tag & ParagonIE_Sodium_Compat::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY) !== 0; + if ($rekey || $st->needsRekey()) { + // DO REKEY + self::secretstream_xchacha20poly1305_rekey($state); + } + return array($out, $tag); + } + + /** + * @param string $state + * @return void + * @throws SodiumException + */ + public static function secretstream_xchacha20poly1305_rekey(&$state) + { + $st = ParagonIE_Sodium_Core32_SecretStream_State::fromString($state); + # unsigned char new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES + + # crypto_secretstream_xchacha20poly1305_INONCEBYTES]; + # size_t i; + # for (i = 0U; i < crypto_stream_chacha20_ietf_KEYBYTES; i++) { + # new_key_and_inonce[i] = state->k[i]; + # } + $new_key_and_inonce = $st->getKey(); + + # for (i = 0U; i < crypto_secretstream_xchacha20poly1305_INONCEBYTES; i++) { + # new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES + i] = + # STATE_INONCE(state)[i]; + # } + $new_key_and_inonce .= ParagonIE_Sodium_Core32_Util::substR($st->getNonce(), 0, 8); + + # crypto_stream_chacha20_ietf_xor(new_key_and_inonce, new_key_and_inonce, + # sizeof new_key_and_inonce, + # state->nonce, state->k); + + $st->rekey(ParagonIE_Sodium_Core32_ChaCha20::ietfStreamXorIc( + $new_key_and_inonce, + $st->getCombinedNonce(), + $st->getKey(), + ParagonIE_Sodium_Core32_Util::store64_le(0) + )); + + # for (i = 0U; i < crypto_stream_chacha20_ietf_KEYBYTES; i++) { + # state->k[i] = new_key_and_inonce[i]; + # } + # for (i = 0U; i < crypto_secretstream_xchacha20poly1305_INONCEBYTES; i++) { + # STATE_INONCE(state)[i] = + # new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES + i]; + # } + # _crypto_secretstream_xchacha20poly1305_counter_reset(state); + $st->counterReset(); + + $state = $st->toString(); + } + + /** + * Detached Ed25519 signature. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string $sk + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function sign_detached($message, $sk) + { + return ParagonIE_Sodium_Core32_Ed25519::sign_detached($message, $sk); + } + + /** + * Attached Ed25519 signature. (Returns a signed message.) + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $message + * @param string $sk + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function sign($message, $sk) + { + return ParagonIE_Sodium_Core32_Ed25519::sign($message, $sk); + } + + /** + * Opens a signed message. If valid, returns the message. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $signedMessage + * @param string $pk + * @return string + * @throws SodiumException + * @throws TypeError + */ + public static function sign_open($signedMessage, $pk) + { + return ParagonIE_Sodium_Core32_Ed25519::sign_open($signedMessage, $pk); + } + + /** + * Verify a detached signature of a given message and public key. + * + * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. + * + * @param string $signature + * @param string $message + * @param string $pk + * @return bool + * @throws SodiumException + * @throws TypeError + */ + public static function sign_verify_detached($signature, $message, $pk) + { + return ParagonIE_Sodium_Core32_Ed25519::verify_detached($signature, $message, $pk); + } +} diff --git a/vendor/paragonie/sodium_compat/src/File.php b/vendor/paragonie/sodium_compat/src/File.php new file mode 100644 index 0000000..2b22171 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/File.php @@ -0,0 +1,1560 @@ + ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_KEYBYTES_MAX) { + throw new TypeError('Argument 2 must be at most CRYPTO_GENERICHASH_KEYBYTES_MAX bytes'); + } + } + if ($outputLength < ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_BYTES_MIN) { + throw new SodiumException('Argument 3 must be at least CRYPTO_GENERICHASH_BYTES_MIN'); + } + if ($outputLength > ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_BYTES_MAX) { + throw new SodiumException('Argument 3 must be at least CRYPTO_GENERICHASH_BYTES_MAX'); + } + + /** @var int $size */ + $size = filesize($filePath); + if (!is_int($size)) { + throw new SodiumException('Could not obtain the file size'); + } + + /** @var resource $fp */ + $fp = fopen($filePath, 'rb'); + if (!is_resource($fp)) { + throw new SodiumException('Could not open input file for reading'); + } + $ctx = ParagonIE_Sodium_Compat::crypto_generichash_init($key, $outputLength); + while ($size > 0) { + $blockSize = $size > 64 + ? 64 + : $size; + $read = fread($fp, $blockSize); + if (!is_string($read)) { + throw new SodiumException('Could not read input file'); + } + ParagonIE_Sodium_Compat::crypto_generichash_update($ctx, $read); + $size -= $blockSize; + } + + fclose($fp); + return ParagonIE_Sodium_Compat::crypto_generichash_final($ctx, $outputLength); + } + + /** + * Encrypt a file (rather than a string). Uses less memory than + * ParagonIE_Sodium_Compat::crypto_secretbox(), but produces + * the same result. + * + * @param string $inputFile Absolute path to a file on the filesystem + * @param string $outputFile Absolute path to a file on the filesystem + * @param string $nonce Number to be used only once + * @param string $key Encryption key + * + * @return bool + * @throws SodiumException + * @throws TypeError + */ + public static function secretbox($inputFile, $outputFile, $nonce, $key) + { + /* Type checks: */ + if (!is_string($inputFile)) { + throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given..'); + } + if (!is_string($outputFile)) { + throw new TypeError('Argument 2 must be a string, ' . gettype($outputFile) . ' given.'); + } + if (!is_string($nonce)) { + throw new TypeError('Argument 3 must be a string, ' . gettype($nonce) . ' given.'); + } + + /* Input validation: */ + if (self::strlen($nonce) !== ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_NONCEBYTES) { + throw new TypeError('Argument 3 must be CRYPTO_SECRETBOX_NONCEBYTES bytes'); + } + if (!is_string($key)) { + throw new TypeError('Argument 4 must be a string, ' . gettype($key) . ' given.'); + } + if (self::strlen($key) !== ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_KEYBYTES) { + throw new TypeError('Argument 4 must be CRYPTO_SECRETBOX_KEYBYTES bytes'); + } + + /** @var int $size */ + $size = filesize($inputFile); + if (!is_int($size)) { + throw new SodiumException('Could not obtain the file size'); + } + + /** @var resource $ifp */ + $ifp = fopen($inputFile, 'rb'); + if (!is_resource($ifp)) { + throw new SodiumException('Could not open input file for reading'); + } + + /** @var resource $ofp */ + $ofp = fopen($outputFile, 'wb'); + if (!is_resource($ofp)) { + fclose($ifp); + throw new SodiumException('Could not open output file for writing'); + } + + $res = self::secretbox_encrypt($ifp, $ofp, $size, $nonce, $key); + fclose($ifp); + fclose($ofp); + return $res; + } + /** + * Seal a file (rather than a string). Uses less memory than + * ParagonIE_Sodium_Compat::crypto_secretbox_open(), but produces + * the same result. + * + * Warning: Does not protect against TOCTOU attacks. You should + * just load the file into memory and use crypto_secretbox_open() if + * you are worried about those. + * + * @param string $inputFile + * @param string $outputFile + * @param string $nonce + * @param string $key + * @return bool + * @throws SodiumException + * @throws TypeError + */ + public static function secretbox_open($inputFile, $outputFile, $nonce, $key) + { + /* Type checks: */ + if (!is_string($inputFile)) { + throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given.'); + } + if (!is_string($outputFile)) { + throw new TypeError('Argument 2 must be a string, ' . gettype($outputFile) . ' given.'); + } + if (!is_string($nonce)) { + throw new TypeError('Argument 3 must be a string, ' . gettype($nonce) . ' given.'); + } + if (!is_string($key)) { + throw new TypeError('Argument 4 must be a string, ' . gettype($key) . ' given.'); + } + + /* Input validation: */ + if (self::strlen($nonce) !== ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_NONCEBYTES) { + throw new TypeError('Argument 4 must be CRYPTO_SECRETBOX_NONCEBYTES bytes'); + } + if (self::strlen($key) !== ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_KEYBYTES) { + throw new TypeError('Argument 4 must be CRYPTO_SECRETBOXBOX_KEYBYTES bytes'); + } + + /** @var int $size */ + $size = filesize($inputFile); + if (!is_int($size)) { + throw new SodiumException('Could not obtain the file size'); + } + + /** @var resource $ifp */ + $ifp = fopen($inputFile, 'rb'); + if (!is_resource($ifp)) { + throw new SodiumException('Could not open input file for reading'); + } + + /** @var resource $ofp */ + $ofp = fopen($outputFile, 'wb'); + if (!is_resource($ofp)) { + fclose($ifp); + throw new SodiumException('Could not open output file for writing'); + } + + $res = self::secretbox_decrypt($ifp, $ofp, $size, $nonce, $key); + fclose($ifp); + fclose($ofp); + try { + ParagonIE_Sodium_Compat::memzero($key); + } catch (SodiumException $ex) { + /** @psalm-suppress PossiblyUndefinedVariable */ + unset($key); + } + return $res; + } + + /** + * Sign a file (rather than a string). Uses less memory than + * ParagonIE_Sodium_Compat::crypto_sign_detached(), but produces + * the same result. + * + * @param string $filePath Absolute path to a file on the filesystem + * @param string $secretKey Secret signing key + * + * @return string Ed25519 signature + * @throws SodiumException + * @throws TypeError + */ + public static function sign($filePath, $secretKey) + { + /* Type checks: */ + if (!is_string($filePath)) { + throw new TypeError('Argument 1 must be a string, ' . gettype($filePath) . ' given.'); + } + if (!is_string($secretKey)) { + throw new TypeError('Argument 2 must be a string, ' . gettype($secretKey) . ' given.'); + } + + /* Input validation: */ + if (self::strlen($secretKey) !== ParagonIE_Sodium_Compat::CRYPTO_SIGN_SECRETKEYBYTES) { + throw new TypeError('Argument 2 must be CRYPTO_SIGN_SECRETKEYBYTES bytes'); + } + if (PHP_INT_SIZE === 4) { + return self::sign_core32($filePath, $secretKey); + } + + /** @var int $size */ + $size = filesize($filePath); + if (!is_int($size)) { + throw new SodiumException('Could not obtain the file size'); + } + + /** @var resource $fp */ + $fp = fopen($filePath, 'rb'); + if (!is_resource($fp)) { + throw new SodiumException('Could not open input file for reading'); + } + + /** @var string $az */ + $az = hash('sha512', self::substr($secretKey, 0, 32), true); + + $az[0] = self::intToChr(self::chrToInt($az[0]) & 248); + $az[31] = self::intToChr((self::chrToInt($az[31]) & 63) | 64); + + $hs = hash_init('sha512'); + self::hash_update($hs, self::substr($az, 32, 32)); + /** @var resource $hs */ + $hs = self::updateHashWithFile($hs, $fp, $size); + + /** @var string $nonceHash */ + $nonceHash = hash_final($hs, true); + + /** @var string $pk */ + $pk = self::substr($secretKey, 32, 32); + + /** @var string $nonce */ + $nonce = ParagonIE_Sodium_Core_Ed25519::sc_reduce($nonceHash) . self::substr($nonceHash, 32); + + /** @var string $sig */ + $sig = ParagonIE_Sodium_Core_Ed25519::ge_p3_tobytes( + ParagonIE_Sodium_Core_Ed25519::ge_scalarmult_base($nonce) + ); + + $hs = hash_init('sha512'); + self::hash_update($hs, self::substr($sig, 0, 32)); + self::hash_update($hs, self::substr($pk, 0, 32)); + /** @var resource $hs */ + $hs = self::updateHashWithFile($hs, $fp, $size); + + /** @var string $hramHash */ + $hramHash = hash_final($hs, true); + + /** @var string $hram */ + $hram = ParagonIE_Sodium_Core_Ed25519::sc_reduce($hramHash); + + /** @var string $sigAfter */ + $sigAfter = ParagonIE_Sodium_Core_Ed25519::sc_muladd($hram, $az, $nonce); + + /** @var string $sig */ + $sig = self::substr($sig, 0, 32) . self::substr($sigAfter, 0, 32); + + try { + ParagonIE_Sodium_Compat::memzero($az); + } catch (SodiumException $ex) { + $az = null; + } + fclose($fp); + return $sig; + } + + /** + * Verify a file (rather than a string). Uses less memory than + * ParagonIE_Sodium_Compat::crypto_sign_verify_detached(), but + * produces the same result. + * + * @param string $sig Ed25519 signature + * @param string $filePath Absolute path to a file on the filesystem + * @param string $publicKey Signing public key + * + * @return bool + * @throws SodiumException + * @throws TypeError + * @throws Exception + */ + public static function verify($sig, $filePath, $publicKey) + { + /* Type checks: */ + if (!is_string($sig)) { + throw new TypeError('Argument 1 must be a string, ' . gettype($sig) . ' given.'); + } + if (!is_string($filePath)) { + throw new TypeError('Argument 2 must be a string, ' . gettype($filePath) . ' given.'); + } + if (!is_string($publicKey)) { + throw new TypeError('Argument 3 must be a string, ' . gettype($publicKey) . ' given.'); + } + + /* Input validation: */ + if (self::strlen($sig) !== ParagonIE_Sodium_Compat::CRYPTO_SIGN_BYTES) { + throw new TypeError('Argument 1 must be CRYPTO_SIGN_BYTES bytes'); + } + if (self::strlen($publicKey) !== ParagonIE_Sodium_Compat::CRYPTO_SIGN_PUBLICKEYBYTES) { + throw new TypeError('Argument 3 must be CRYPTO_SIGN_PUBLICKEYBYTES bytes'); + } + if (self::strlen($sig) < 64) { + throw new SodiumException('Signature is too short'); + } + + if (PHP_INT_SIZE === 4) { + return self::verify_core32($sig, $filePath, $publicKey); + } + + /* Security checks */ + if ( + (ParagonIE_Sodium_Core_Ed25519::chrToInt($sig[63]) & 240) + && + ParagonIE_Sodium_Core_Ed25519::check_S_lt_L(self::substr($sig, 32, 32)) + ) { + throw new SodiumException('S < L - Invalid signature'); + } + if (ParagonIE_Sodium_Core_Ed25519::small_order($sig)) { + throw new SodiumException('Signature is on too small of an order'); + } + if ((self::chrToInt($sig[63]) & 224) !== 0) { + throw new SodiumException('Invalid signature'); + } + $d = 0; + for ($i = 0; $i < 32; ++$i) { + $d |= self::chrToInt($publicKey[$i]); + } + if ($d === 0) { + throw new SodiumException('All zero public key'); + } + + /** @var int $size */ + $size = filesize($filePath); + if (!is_int($size)) { + throw new SodiumException('Could not obtain the file size'); + } + + /** @var resource $fp */ + $fp = fopen($filePath, 'rb'); + if (!is_resource($fp)) { + throw new SodiumException('Could not open input file for reading'); + } + + /** @var bool The original value of ParagonIE_Sodium_Compat::$fastMult */ + $orig = ParagonIE_Sodium_Compat::$fastMult; + + // Set ParagonIE_Sodium_Compat::$fastMult to true to speed up verification. + ParagonIE_Sodium_Compat::$fastMult = true; + + /** @var ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A */ + $A = ParagonIE_Sodium_Core_Ed25519::ge_frombytes_negate_vartime($publicKey); + + $hs = hash_init('sha512'); + self::hash_update($hs, self::substr($sig, 0, 32)); + self::hash_update($hs, self::substr($publicKey, 0, 32)); + /** @var resource $hs */ + $hs = self::updateHashWithFile($hs, $fp, $size); + /** @var string $hDigest */ + $hDigest = hash_final($hs, true); + + /** @var string $h */ + $h = ParagonIE_Sodium_Core_Ed25519::sc_reduce($hDigest) . self::substr($hDigest, 32); + + /** @var ParagonIE_Sodium_Core_Curve25519_Ge_P2 $R */ + $R = ParagonIE_Sodium_Core_Ed25519::ge_double_scalarmult_vartime( + $h, + $A, + self::substr($sig, 32) + ); + + /** @var string $rcheck */ + $rcheck = ParagonIE_Sodium_Core_Ed25519::ge_tobytes($R); + + // Close the file handle + fclose($fp); + + // Reset ParagonIE_Sodium_Compat::$fastMult to what it was before. + ParagonIE_Sodium_Compat::$fastMult = $orig; + return self::verify_32($rcheck, self::substr($sig, 0, 32)); + } + + /** + * @param resource $ifp + * @param resource $ofp + * @param int $mlen + * @param string $nonce + * @param string $boxKeypair + * @return bool + * @throws SodiumException + * @throws TypeError + */ + protected static function box_encrypt($ifp, $ofp, $mlen, $nonce, $boxKeypair) + { + if (PHP_INT_SIZE === 4) { + return self::secretbox_encrypt( + $ifp, + $ofp, + $mlen, + $nonce, + ParagonIE_Sodium_Crypto32::box_beforenm( + ParagonIE_Sodium_Crypto32::box_secretkey($boxKeypair), + ParagonIE_Sodium_Crypto32::box_publickey($boxKeypair) + ) + ); + } + return self::secretbox_encrypt( + $ifp, + $ofp, + $mlen, + $nonce, + ParagonIE_Sodium_Crypto::box_beforenm( + ParagonIE_Sodium_Crypto::box_secretkey($boxKeypair), + ParagonIE_Sodium_Crypto::box_publickey($boxKeypair) + ) + ); + } + + + /** + * @param resource $ifp + * @param resource $ofp + * @param int $mlen + * @param string $nonce + * @param string $boxKeypair + * @return bool + * @throws SodiumException + * @throws TypeError + */ + protected static function box_decrypt($ifp, $ofp, $mlen, $nonce, $boxKeypair) + { + if (PHP_INT_SIZE === 4) { + return self::secretbox_decrypt( + $ifp, + $ofp, + $mlen, + $nonce, + ParagonIE_Sodium_Crypto32::box_beforenm( + ParagonIE_Sodium_Crypto32::box_secretkey($boxKeypair), + ParagonIE_Sodium_Crypto32::box_publickey($boxKeypair) + ) + ); + } + return self::secretbox_decrypt( + $ifp, + $ofp, + $mlen, + $nonce, + ParagonIE_Sodium_Crypto::box_beforenm( + ParagonIE_Sodium_Crypto::box_secretkey($boxKeypair), + ParagonIE_Sodium_Crypto::box_publickey($boxKeypair) + ) + ); + } + + /** + * Encrypt a file + * + * @param resource $ifp + * @param resource $ofp + * @param int $mlen + * @param string $nonce + * @param string $key + * @return bool + * @throws SodiumException + * @throws TypeError + */ + protected static function secretbox_encrypt($ifp, $ofp, $mlen, $nonce, $key) + { + if (PHP_INT_SIZE === 4) { + return self::secretbox_encrypt_core32($ifp, $ofp, $mlen, $nonce, $key); + } + + $plaintext = fread($ifp, 32); + if (!is_string($plaintext)) { + throw new SodiumException('Could not read input file'); + } + $first32 = self::ftell($ifp); + + /** @var string $subkey */ + $subkey = ParagonIE_Sodium_Core_HSalsa20::hsalsa20($nonce, $key); + + /** @var string $realNonce */ + $realNonce = ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8); + + /** @var string $block0 */ + $block0 = str_repeat("\x00", 32); + + /** @var int $mlen - Length of the plaintext message */ + $mlen0 = $mlen; + if ($mlen0 > 64 - ParagonIE_Sodium_Crypto::secretbox_xsalsa20poly1305_ZEROBYTES) { + $mlen0 = 64 - ParagonIE_Sodium_Crypto::secretbox_xsalsa20poly1305_ZEROBYTES; + } + $block0 .= ParagonIE_Sodium_Core_Util::substr($plaintext, 0, $mlen0); + + /** @var string $block0 */ + $block0 = ParagonIE_Sodium_Core_Salsa20::salsa20_xor( + $block0, + $realNonce, + $subkey + ); + + $state = new ParagonIE_Sodium_Core_Poly1305_State( + ParagonIE_Sodium_Core_Util::substr( + $block0, + 0, + ParagonIE_Sodium_Crypto::onetimeauth_poly1305_KEYBYTES + ) + ); + + // Pre-write 16 blank bytes for the Poly1305 tag + $start = self::ftell($ofp); + fwrite($ofp, str_repeat("\x00", 16)); + + /** @var string $c */ + $cBlock = ParagonIE_Sodium_Core_Util::substr( + $block0, + ParagonIE_Sodium_Crypto::secretbox_xsalsa20poly1305_ZEROBYTES + ); + $state->update($cBlock); + fwrite($ofp, $cBlock); + $mlen -= 32; + + /** @var int $iter */ + $iter = 1; + + /** @var int $incr */ + $incr = self::BUFFER_SIZE >> 6; + + /* + * Set the cursor to the end of the first half-block. All future bytes will + * generated from salsa20_xor_ic, starting from 1 (second block). + */ + fseek($ifp, $first32, SEEK_SET); + + while ($mlen > 0) { + $blockSize = $mlen > self::BUFFER_SIZE + ? self::BUFFER_SIZE + : $mlen; + $plaintext = fread($ifp, $blockSize); + if (!is_string($plaintext)) { + throw new SodiumException('Could not read input file'); + } + $cBlock = ParagonIE_Sodium_Core_Salsa20::salsa20_xor_ic( + $plaintext, + $realNonce, + $iter, + $subkey + ); + fwrite($ofp, $cBlock, $blockSize); + $state->update($cBlock); + + $mlen -= $blockSize; + $iter += $incr; + } + try { + ParagonIE_Sodium_Compat::memzero($block0); + ParagonIE_Sodium_Compat::memzero($subkey); + } catch (SodiumException $ex) { + $block0 = null; + $subkey = null; + } + $end = self::ftell($ofp); + + /* + * Write the Poly1305 authentication tag that provides integrity + * over the ciphertext (encrypt-then-MAC) + */ + fseek($ofp, $start, SEEK_SET); + fwrite($ofp, $state->finish(), ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_MACBYTES); + fseek($ofp, $end, SEEK_SET); + unset($state); + + return true; + } + + /** + * Decrypt a file + * + * @param resource $ifp + * @param resource $ofp + * @param int $mlen + * @param string $nonce + * @param string $key + * @return bool + * @throws SodiumException + * @throws TypeError + */ + protected static function secretbox_decrypt($ifp, $ofp, $mlen, $nonce, $key) + { + if (PHP_INT_SIZE === 4) { + return self::secretbox_decrypt_core32($ifp, $ofp, $mlen, $nonce, $key); + } + $tag = fread($ifp, 16); + if (!is_string($tag)) { + throw new SodiumException('Could not read input file'); + } + + /** @var string $subkey */ + $subkey = ParagonIE_Sodium_Core_HSalsa20::hsalsa20($nonce, $key); + + /** @var string $realNonce */ + $realNonce = ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8); + + /** @var string $block0 */ + $block0 = ParagonIE_Sodium_Core_Salsa20::salsa20( + 64, + ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8), + $subkey + ); + + /* Verify the Poly1305 MAC -before- attempting to decrypt! */ + $state = new ParagonIE_Sodium_Core_Poly1305_State(self::substr($block0, 0, 32)); + if (!self::onetimeauth_verify($state, $ifp, $tag, $mlen)) { + throw new SodiumException('Invalid MAC'); + } + + /* + * Set the cursor to the end of the first half-block. All future bytes will + * generated from salsa20_xor_ic, starting from 1 (second block). + */ + $first32 = fread($ifp, 32); + if (!is_string($first32)) { + throw new SodiumException('Could not read input file'); + } + $first32len = self::strlen($first32); + fwrite( + $ofp, + self::xorStrings( + self::substr($block0, 32, $first32len), + self::substr($first32, 0, $first32len) + ) + ); + $mlen -= 32; + + /** @var int $iter */ + $iter = 1; + + /** @var int $incr */ + $incr = self::BUFFER_SIZE >> 6; + + /* Decrypts ciphertext, writes to output file. */ + while ($mlen > 0) { + $blockSize = $mlen > self::BUFFER_SIZE + ? self::BUFFER_SIZE + : $mlen; + $ciphertext = fread($ifp, $blockSize); + if (!is_string($ciphertext)) { + throw new SodiumException('Could not read input file'); + } + $pBlock = ParagonIE_Sodium_Core_Salsa20::salsa20_xor_ic( + $ciphertext, + $realNonce, + $iter, + $subkey + ); + fwrite($ofp, $pBlock, $blockSize); + $mlen -= $blockSize; + $iter += $incr; + } + return true; + } + + /** + * @param ParagonIE_Sodium_Core_Poly1305_State $state + * @param resource $ifp + * @param string $tag + * @param int $mlen + * @return bool + * @throws SodiumException + * @throws TypeError + */ + protected static function onetimeauth_verify( + ParagonIE_Sodium_Core_Poly1305_State $state, + $ifp, + $tag = '', + $mlen = 0 + ) { + /** @var int $pos */ + $pos = self::ftell($ifp); + + /** @var int $iter */ + $iter = 1; + + /** @var int $incr */ + $incr = self::BUFFER_SIZE >> 6; + + while ($mlen > 0) { + $blockSize = $mlen > self::BUFFER_SIZE + ? self::BUFFER_SIZE + : $mlen; + $ciphertext = fread($ifp, $blockSize); + if (!is_string($ciphertext)) { + throw new SodiumException('Could not read input file'); + } + $state->update($ciphertext); + $mlen -= $blockSize; + $iter += $incr; + } + $res = ParagonIE_Sodium_Core_Util::verify_16($tag, $state->finish()); + + fseek($ifp, $pos, SEEK_SET); + return $res; + } + + /** + * Update a hash context with the contents of a file, without + * loading the entire file into memory. + * + * @param resource|HashContext $hash + * @param resource $fp + * @param int $size + * @return resource|object Resource on PHP < 7.2, HashContext object on PHP >= 7.2 + * @throws SodiumException + * @throws TypeError + * @psalm-suppress PossiblyInvalidArgument + * PHP 7.2 changes from a resource to an object, + * which causes Psalm to complain about an error. + * @psalm-suppress TypeCoercion + * Ditto. + */ + public static function updateHashWithFile($hash, $fp, $size = 0) + { + /* Type checks: */ + if (PHP_VERSION_ID < 70200) { + if (!is_resource($hash)) { + throw new TypeError('Argument 1 must be a resource, ' . gettype($hash) . ' given.'); + } + } else { + if (!is_object($hash)) { + throw new TypeError('Argument 1 must be an object (PHP 7.2+), ' . gettype($hash) . ' given.'); + } + } + + if (!is_resource($fp)) { + throw new TypeError('Argument 2 must be a resource, ' . gettype($fp) . ' given.'); + } + if (!is_int($size)) { + throw new TypeError('Argument 3 must be an integer, ' . gettype($size) . ' given.'); + } + + /** @var int $originalPosition */ + $originalPosition = self::ftell($fp); + + // Move file pointer to beginning of file + fseek($fp, 0, SEEK_SET); + for ($i = 0; $i < $size; $i += self::BUFFER_SIZE) { + /** @var string|bool $message */ + $message = fread( + $fp, + ($size - $i) > self::BUFFER_SIZE + ? $size - $i + : self::BUFFER_SIZE + ); + if (!is_string($message)) { + throw new SodiumException('Unexpected error reading from file.'); + } + /** @var string $message */ + /** @psalm-suppress InvalidArgument */ + self::hash_update($hash, $message); + } + // Reset file pointer's position + fseek($fp, $originalPosition, SEEK_SET); + return $hash; + } + + /** + * Sign a file (rather than a string). Uses less memory than + * ParagonIE_Sodium_Compat::crypto_sign_detached(), but produces + * the same result. (32-bit) + * + * @param string $filePath Absolute path to a file on the filesystem + * @param string $secretKey Secret signing key + * + * @return string Ed25519 signature + * @throws SodiumException + * @throws TypeError + */ + private static function sign_core32($filePath, $secretKey) + { + /** @var int|bool $size */ + $size = filesize($filePath); + if (!is_int($size)) { + throw new SodiumException('Could not obtain the file size'); + } + /** @var int $size */ + + /** @var resource|bool $fp */ + $fp = fopen($filePath, 'rb'); + if (!is_resource($fp)) { + throw new SodiumException('Could not open input file for reading'); + } + /** @var resource $fp */ + + /** @var string $az */ + $az = hash('sha512', self::substr($secretKey, 0, 32), true); + + $az[0] = self::intToChr(self::chrToInt($az[0]) & 248); + $az[31] = self::intToChr((self::chrToInt($az[31]) & 63) | 64); + + $hs = hash_init('sha512'); + self::hash_update($hs, self::substr($az, 32, 32)); + /** @var resource $hs */ + $hs = self::updateHashWithFile($hs, $fp, $size); + + /** @var string $nonceHash */ + $nonceHash = hash_final($hs, true); + + /** @var string $pk */ + $pk = self::substr($secretKey, 32, 32); + + /** @var string $nonce */ + $nonce = ParagonIE_Sodium_Core32_Ed25519::sc_reduce($nonceHash) . self::substr($nonceHash, 32); + + /** @var string $sig */ + $sig = ParagonIE_Sodium_Core32_Ed25519::ge_p3_tobytes( + ParagonIE_Sodium_Core32_Ed25519::ge_scalarmult_base($nonce) + ); + + $hs = hash_init('sha512'); + self::hash_update($hs, self::substr($sig, 0, 32)); + self::hash_update($hs, self::substr($pk, 0, 32)); + /** @var resource $hs */ + $hs = self::updateHashWithFile($hs, $fp, $size); + + /** @var string $hramHash */ + $hramHash = hash_final($hs, true); + + /** @var string $hram */ + $hram = ParagonIE_Sodium_Core32_Ed25519::sc_reduce($hramHash); + + /** @var string $sigAfter */ + $sigAfter = ParagonIE_Sodium_Core32_Ed25519::sc_muladd($hram, $az, $nonce); + + /** @var string $sig */ + $sig = self::substr($sig, 0, 32) . self::substr($sigAfter, 0, 32); + + try { + ParagonIE_Sodium_Compat::memzero($az); + } catch (SodiumException $ex) { + $az = null; + } + fclose($fp); + return $sig; + } + + /** + * + * Verify a file (rather than a string). Uses less memory than + * ParagonIE_Sodium_Compat::crypto_sign_verify_detached(), but + * produces the same result. (32-bit) + * + * @param string $sig Ed25519 signature + * @param string $filePath Absolute path to a file on the filesystem + * @param string $publicKey Signing public key + * + * @return bool + * @throws SodiumException + * @throws Exception + */ + public static function verify_core32($sig, $filePath, $publicKey) + { + /* Security checks */ + if (ParagonIE_Sodium_Core32_Ed25519::check_S_lt_L(self::substr($sig, 32, 32))) { + throw new SodiumException('S < L - Invalid signature'); + } + if (ParagonIE_Sodium_Core32_Ed25519::small_order($sig)) { + throw new SodiumException('Signature is on too small of an order'); + } + if ((self::chrToInt($sig[63]) & 224) !== 0) { + throw new SodiumException('Invalid signature'); + } + $d = 0; + for ($i = 0; $i < 32; ++$i) { + $d |= self::chrToInt($publicKey[$i]); + } + if ($d === 0) { + throw new SodiumException('All zero public key'); + } + + /** @var int|bool $size */ + $size = filesize($filePath); + if (!is_int($size)) { + throw new SodiumException('Could not obtain the file size'); + } + /** @var int $size */ + + /** @var resource|bool $fp */ + $fp = fopen($filePath, 'rb'); + if (!is_resource($fp)) { + throw new SodiumException('Could not open input file for reading'); + } + /** @var resource $fp */ + + /** @var bool The original value of ParagonIE_Sodium_Compat::$fastMult */ + $orig = ParagonIE_Sodium_Compat::$fastMult; + + // Set ParagonIE_Sodium_Compat::$fastMult to true to speed up verification. + ParagonIE_Sodium_Compat::$fastMult = true; + + /** @var ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A */ + $A = ParagonIE_Sodium_Core32_Ed25519::ge_frombytes_negate_vartime($publicKey); + + $hs = hash_init('sha512'); + self::hash_update($hs, self::substr($sig, 0, 32)); + self::hash_update($hs, self::substr($publicKey, 0, 32)); + /** @var resource $hs */ + $hs = self::updateHashWithFile($hs, $fp, $size); + /** @var string $hDigest */ + $hDigest = hash_final($hs, true); + + /** @var string $h */ + $h = ParagonIE_Sodium_Core32_Ed25519::sc_reduce($hDigest) . self::substr($hDigest, 32); + + /** @var ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $R */ + $R = ParagonIE_Sodium_Core32_Ed25519::ge_double_scalarmult_vartime( + $h, + $A, + self::substr($sig, 32) + ); + + /** @var string $rcheck */ + $rcheck = ParagonIE_Sodium_Core32_Ed25519::ge_tobytes($R); + + // Close the file handle + fclose($fp); + + // Reset ParagonIE_Sodium_Compat::$fastMult to what it was before. + ParagonIE_Sodium_Compat::$fastMult = $orig; + return self::verify_32($rcheck, self::substr($sig, 0, 32)); + } + + /** + * Encrypt a file (32-bit) + * + * @param resource $ifp + * @param resource $ofp + * @param int $mlen + * @param string $nonce + * @param string $key + * @return bool + * @throws SodiumException + * @throws TypeError + */ + protected static function secretbox_encrypt_core32($ifp, $ofp, $mlen, $nonce, $key) + { + $plaintext = fread($ifp, 32); + if (!is_string($plaintext)) { + throw new SodiumException('Could not read input file'); + } + $first32 = self::ftell($ifp); + + /** @var string $subkey */ + $subkey = ParagonIE_Sodium_Core32_HSalsa20::hsalsa20($nonce, $key); + + /** @var string $realNonce */ + $realNonce = ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8); + + /** @var string $block0 */ + $block0 = str_repeat("\x00", 32); + + /** @var int $mlen - Length of the plaintext message */ + $mlen0 = $mlen; + if ($mlen0 > 64 - ParagonIE_Sodium_Crypto::secretbox_xsalsa20poly1305_ZEROBYTES) { + $mlen0 = 64 - ParagonIE_Sodium_Crypto::secretbox_xsalsa20poly1305_ZEROBYTES; + } + $block0 .= ParagonIE_Sodium_Core32_Util::substr($plaintext, 0, $mlen0); + + /** @var string $block0 */ + $block0 = ParagonIE_Sodium_Core32_Salsa20::salsa20_xor( + $block0, + $realNonce, + $subkey + ); + + $state = new ParagonIE_Sodium_Core32_Poly1305_State( + ParagonIE_Sodium_Core32_Util::substr( + $block0, + 0, + ParagonIE_Sodium_Crypto::onetimeauth_poly1305_KEYBYTES + ) + ); + + // Pre-write 16 blank bytes for the Poly1305 tag + $start = self::ftell($ofp); + fwrite($ofp, str_repeat("\x00", 16)); + + /** @var string $c */ + $cBlock = ParagonIE_Sodium_Core32_Util::substr( + $block0, + ParagonIE_Sodium_Crypto::secretbox_xsalsa20poly1305_ZEROBYTES + ); + $state->update($cBlock); + fwrite($ofp, $cBlock); + $mlen -= 32; + + /** @var int $iter */ + $iter = 1; + + /** @var int $incr */ + $incr = self::BUFFER_SIZE >> 6; + + /* + * Set the cursor to the end of the first half-block. All future bytes will + * generated from salsa20_xor_ic, starting from 1 (second block). + */ + fseek($ifp, $first32, SEEK_SET); + + while ($mlen > 0) { + $blockSize = $mlen > self::BUFFER_SIZE + ? self::BUFFER_SIZE + : $mlen; + $plaintext = fread($ifp, $blockSize); + if (!is_string($plaintext)) { + throw new SodiumException('Could not read input file'); + } + $cBlock = ParagonIE_Sodium_Core32_Salsa20::salsa20_xor_ic( + $plaintext, + $realNonce, + $iter, + $subkey + ); + fwrite($ofp, $cBlock, $blockSize); + $state->update($cBlock); + + $mlen -= $blockSize; + $iter += $incr; + } + try { + ParagonIE_Sodium_Compat::memzero($block0); + ParagonIE_Sodium_Compat::memzero($subkey); + } catch (SodiumException $ex) { + $block0 = null; + $subkey = null; + } + $end = self::ftell($ofp); + + /* + * Write the Poly1305 authentication tag that provides integrity + * over the ciphertext (encrypt-then-MAC) + */ + fseek($ofp, $start, SEEK_SET); + fwrite($ofp, $state->finish(), ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_MACBYTES); + fseek($ofp, $end, SEEK_SET); + unset($state); + + return true; + } + + /** + * Decrypt a file (32-bit) + * + * @param resource $ifp + * @param resource $ofp + * @param int $mlen + * @param string $nonce + * @param string $key + * @return bool + * @throws SodiumException + * @throws TypeError + */ + protected static function secretbox_decrypt_core32($ifp, $ofp, $mlen, $nonce, $key) + { + $tag = fread($ifp, 16); + if (!is_string($tag)) { + throw new SodiumException('Could not read input file'); + } + + /** @var string $subkey */ + $subkey = ParagonIE_Sodium_Core32_HSalsa20::hsalsa20($nonce, $key); + + /** @var string $realNonce */ + $realNonce = ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8); + + /** @var string $block0 */ + $block0 = ParagonIE_Sodium_Core32_Salsa20::salsa20( + 64, + ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8), + $subkey + ); + + /* Verify the Poly1305 MAC -before- attempting to decrypt! */ + $state = new ParagonIE_Sodium_Core32_Poly1305_State(self::substr($block0, 0, 32)); + if (!self::onetimeauth_verify_core32($state, $ifp, $tag, $mlen)) { + throw new SodiumException('Invalid MAC'); + } + + /* + * Set the cursor to the end of the first half-block. All future bytes will + * generated from salsa20_xor_ic, starting from 1 (second block). + */ + $first32 = fread($ifp, 32); + if (!is_string($first32)) { + throw new SodiumException('Could not read input file'); + } + $first32len = self::strlen($first32); + fwrite( + $ofp, + self::xorStrings( + self::substr($block0, 32, $first32len), + self::substr($first32, 0, $first32len) + ) + ); + $mlen -= 32; + + /** @var int $iter */ + $iter = 1; + + /** @var int $incr */ + $incr = self::BUFFER_SIZE >> 6; + + /* Decrypts ciphertext, writes to output file. */ + while ($mlen > 0) { + $blockSize = $mlen > self::BUFFER_SIZE + ? self::BUFFER_SIZE + : $mlen; + $ciphertext = fread($ifp, $blockSize); + if (!is_string($ciphertext)) { + throw new SodiumException('Could not read input file'); + } + $pBlock = ParagonIE_Sodium_Core32_Salsa20::salsa20_xor_ic( + $ciphertext, + $realNonce, + $iter, + $subkey + ); + fwrite($ofp, $pBlock, $blockSize); + $mlen -= $blockSize; + $iter += $incr; + } + return true; + } + + /** + * One-time message authentication for 32-bit systems + * + * @param ParagonIE_Sodium_Core32_Poly1305_State $state + * @param resource $ifp + * @param string $tag + * @param int $mlen + * @return bool + * @throws SodiumException + * @throws TypeError + */ + protected static function onetimeauth_verify_core32( + ParagonIE_Sodium_Core32_Poly1305_State $state, + $ifp, + $tag = '', + $mlen = 0 + ) { + /** @var int $pos */ + $pos = self::ftell($ifp); + + while ($mlen > 0) { + $blockSize = $mlen > self::BUFFER_SIZE + ? self::BUFFER_SIZE + : $mlen; + $ciphertext = fread($ifp, $blockSize); + if (!is_string($ciphertext)) { + throw new SodiumException('Could not read input file'); + } + $state->update($ciphertext); + $mlen -= $blockSize; + } + $res = ParagonIE_Sodium_Core32_Util::verify_16($tag, $state->finish()); + + fseek($ifp, $pos, SEEK_SET); + return $res; + } + + /** + * @param resource $resource + * @return int + * @throws SodiumException + */ + private static function ftell($resource) + { + $return = ftell($resource); + if (!is_int($return)) { + throw new SodiumException('ftell() returned false'); + } + return (int) $return; + } +} diff --git a/vendor/paragonie/sodium_compat/src/PHP52/SplFixedArray.php b/vendor/paragonie/sodium_compat/src/PHP52/SplFixedArray.php new file mode 100644 index 0000000..c333ad4 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/PHP52/SplFixedArray.php @@ -0,0 +1,189 @@ + */ + private $internalArray = array(); + + /** @var int $size */ + private $size = 0; + + /** + * SplFixedArray constructor. + * @param int $size + */ + public function __construct($size = 0) + { + $this->size = $size; + $this->internalArray = array(); + } + + /** + * @return int + */ + public function count() + { + return count($this->internalArray); + } + + /** + * @return array + */ + public function toArray() + { + ksort($this->internalArray); + return (array) $this->internalArray; + } + + /** + * @param array $array + * @param bool $save_indexes + * @return SplFixedArray + * @psalm-suppress MixedAssignment + */ + public static function fromArray(array $array, $save_indexes = true) + { + $self = new SplFixedArray(count($array)); + if($save_indexes) { + foreach($array as $key => $value) { + $self[(int) $key] = $value; + } + } else { + $i = 0; + foreach (array_values($array) as $value) { + $self[$i] = $value; + $i++; + } + } + return $self; + } + + /** + * @return int + */ + public function getSize() + { + return $this->size; + } + + /** + * @param int $size + * @return bool + */ + public function setSize($size) + { + $this->size = $size; + return true; + } + + /** + * @param string|int $index + * @return bool + */ + public function offsetExists($index) + { + return array_key_exists((int) $index, $this->internalArray); + } + + /** + * @param string|int $index + * @return mixed + */ + public function offsetGet($index) + { + /** @psalm-suppress MixedReturnStatement */ + return $this->internalArray[(int) $index]; + } + + /** + * @param string|int $index + * @param mixed $newval + * @psalm-suppress MixedAssignment + */ + public function offsetSet($index, $newval) + { + $this->internalArray[(int) $index] = $newval; + } + + /** + * @param string|int $index + */ + public function offsetUnset($index) + { + unset($this->internalArray[(int) $index]); + } + + /** + * Rewind iterator back to the start + * @link https://php.net/manual/en/splfixedarray.rewind.php + * @return void + * @since 5.3.0 + */ + public function rewind() + { + reset($this->internalArray); + } + + /** + * Return current array entry + * @link https://php.net/manual/en/splfixedarray.current.php + * @return mixed The current element value. + * @since 5.3.0 + */ + public function current() + { + /** @psalm-suppress MixedReturnStatement */ + return current($this->internalArray); + } + + /** + * Return current array index + * @return int The current array index. + */ + public function key() + { + return key($this->internalArray); + } + + /** + * @return void + */ + public function next() + { + next($this->internalArray); + } + + /** + * Check whether the array contains more elements + * @link https://php.net/manual/en/splfixedarray.valid.php + * @return bool true if the array contains any more elements, false otherwise. + */ + public function valid() + { + if (empty($this->internalArray)) { + return false; + } + $result = next($this->internalArray) !== false; + prev($this->internalArray); + return $result; + } + + /** + * Do nothing. + */ + public function __wakeup() + { + // NOP + } +} \ No newline at end of file diff --git a/vendor/paragonie/sodium_compat/src/SodiumException.php b/vendor/paragonie/sodium_compat/src/SodiumException.php new file mode 100644 index 0000000..a3176d7 --- /dev/null +++ b/vendor/paragonie/sodium_compat/src/SodiumException.php @@ -0,0 +1,11 @@ +Client ID and Secret from there. + +```php +require __DIR__ . '/vendor/autoload.php'; +use PayPalCheckoutSdk\Core\PayPalHttpClient; +use PayPalCheckoutSdk\Core\SandboxEnvironment; +// Creating an environment +$clientId = "<>"; +$clientSecret = "<>"; + +$environment = new SandboxEnvironment($clientId, $clientSecret); +$client = new PayPalHttpClient($environment); +``` + +## Examples +### Creating an Order +#### Code: +```php +// Construct a request object and set desired parameters +// Here, OrdersCreateRequest() creates a POST request to /v2/checkout/orders +use PayPalCheckoutSdk\Orders\OrdersCreateRequest; +$request = new OrdersCreateRequest(); +$request->prefer('return=representation'); +$request->body = [ + "intent" => "CAPTURE", + "purchase_units" => [[ + "reference_id" => "test_ref_id1", + "amount" => [ + "value" => "100.00", + "currency_code" => "USD" + ] + ]], + "application_context" => [ + "cancel_url" => "https://example.com/cancel", + "return_url" => "https://example.com/return" + ] + ]; + +try { + // Call API with your client and get a response for your call + $response = $client->execute($request); + + // If call returns body in response, you can get the deserialized version from the result attribute of the response + print_r($response); +}catch (HttpException $ex) { + echo $ex->statusCode; + print_r($ex->getMessage()); +} +``` +#### Example Output: +``` +Status Code: 201 +Id: 8GB67279RC051624C +Intent: CAPTURE +Gross_amount: + Currency_code: USD + Value: 100.00 +Purchase_units: + 1: + Amount: + Currency_code: USD + Value: 100.00 +Create_time: 2018-08-06T23:34:31Z +Links: + 1: + Href: https://api.sandbox.paypal.com/v2/checkout/orders/8GB67279RC051624C + Rel: self + Method: GET + 2: + Href: https://www.sandbox.paypal.com/checkoutnow?token=8GB67279RC051624C + Rel: approve + Method: GET + 3: + Href: https://api.sandbox.paypal.com/v2/checkout/orders/8GB67279RC051624C/capture + Rel: capture + Method: POST +Status: CREATED +``` + +## Capturing an Order +Before capture, Order should be approved by the buyer using the approval URL returned in the create order response. +### Code to Execute: +```php +use PayPalCheckoutSdk\Orders\OrdersCaptureRequest; +// Here, OrdersCaptureRequest() creates a POST request to /v2/checkout/orders +// $response->result->id gives the orderId of the order created above +$request = new OrdersCaptureRequest("APPROVED-ORDER-ID"); +$request->prefer('return=representation'); +try { + // Call API with your client and get a response for your call + $response = $client->execute($request); + + // If call returns body in response, you can get the deserialized version from the result attribute of the response + print_r($response); +}catch (HttpException $ex) { + echo $ex->statusCode; + print_r($ex->getMessage()); +} +``` + +#### Example Output: +``` +Status Code: 201 +Id: 8GB67279RC051624C +Create_time: 2018-08-06T23:39:11Z +Update_time: 2018-08-06T23:39:11Z +Payer: + Name: + Given_name: test + Surname: buyer + Email_address: test-buyer@paypal.com + Payer_id: KWADC7LXRRWCE + Phone: + Phone_number: + National_number: 408-411-2134 + Address: + Country_code: US +Links: + 1: + Href: https://api.sandbox.paypal.com/v2/checkout/orders/3L848818A2897925Y + Rel: self + Method: GET +Status: COMPLETED +``` + +## Running tests + +To run integration tests using your client id and secret, clone this repository and run the following command: +```sh +$ composer install +$ CLIENT_ID=YOUR_SANDBOX_CLIENT_ID CLIENT_SECRET=OUR_SANDBOX_CLIENT_SECRET composer integration +``` + +## Samples + +You can start off by trying out [creating and capturing an order](/samples/CaptureIntentExamples/RunAll.php) + +To try out different samples for both create and authorize intent check [this link](/samples) + +Note: Update the `PayPalClient.php` with your sandbox client credentials or pass your client credentials as environment variable whie executing the samples. + + +## License +Code released under [SDK LICENSE](LICENSE) diff --git a/vendor/paypal/paypal-checkout-sdk/composer.json b/vendor/paypal/paypal-checkout-sdk/composer.json new file mode 100644 index 0000000..0676fb4 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/composer.json @@ -0,0 +1,35 @@ +{ + "name": "paypal/paypal-checkout-sdk", + "description": "PayPal's PHP SDK for Checkout REST APIs", + "keywords": ["paypal", "payments", "rest", "sdk", "orders", "checkout"], + "type": "library", + "license": "https://github.com/paypal/Checkout-PHP-SDK/blob/master/LICENSE", + "homepage": "http://github.com/paypal/Checkout-PHP-SDK/", + "require": { + "paypal/paypalhttp": "1.0.0" + }, + "authors": [ + { + "name": "PayPal", + "homepage": "https://github.com/paypal/Checkout-PHP-SDK/contributors" + } + ], + "require-dev": { + "phpunit/phpunit": "^5.7" + }, + "autoload": { + "psr-4": { + "PayPalCheckoutSdk\\": "lib/PayPalCheckoutSdk", + "Sample\\":"samples/" + } + }, + "autoload-dev": { + "psr-4": { + "Test\\":"tests/" + } + }, + "scripts": { + "unit": "phpunit --testsuite unit", + "integration": "phpunit --testsuite integration" + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/composer.phar b/vendor/paypal/paypal-checkout-sdk/composer.phar new file mode 100644 index 0000000..801b9a9 Binary files /dev/null and b/vendor/paypal/paypal-checkout-sdk/composer.phar differ diff --git a/vendor/paypal/paypal-checkout-sdk/gen.yml b/vendor/paypal/paypal-checkout-sdk/gen.yml new file mode 100644 index 0000000..b6f3f79 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/gen.yml @@ -0,0 +1,6 @@ +--- +projectName: PayPalCheckoutSdk +language: php +sourcePath: lib/PayPalCheckoutSdk +testPath: tests +apiVersioning: false diff --git a/vendor/paypal/paypal-checkout-sdk/homepage.jpg b/vendor/paypal/paypal-checkout-sdk/homepage.jpg new file mode 100644 index 0000000..9b7aa61 Binary files /dev/null and b/vendor/paypal/paypal-checkout-sdk/homepage.jpg differ diff --git a/vendor/paypal/paypal-checkout-sdk/init b/vendor/paypal/paypal-checkout-sdk/init new file mode 100644 index 0000000..e69de29 diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessToken.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessToken.php new file mode 100644 index 0000000..b6f1d2d --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessToken.php @@ -0,0 +1,25 @@ +token = $token; + $this->tokenType = $tokenType; + $this->expiresIn = $expiresIn; + $this->createDate = time(); + } + + public function isExpired() + { + return time() >= $this->createDate + $this->expiresIn; + } +} \ No newline at end of file diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessTokenRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessTokenRequest.php new file mode 100644 index 0000000..5c3e26e --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessTokenRequest.php @@ -0,0 +1,27 @@ +headers["Authorization"] = "Basic " . $environment->authorizationString(); + $body = [ + "grant_type" => "client_credentials" + ]; + + if (!is_null($refreshToken)) + { + $body["grant_type"] = "refresh_token"; + $body["refresh_token"] = $refreshToken; + } + + $this->body = $body; + $this->headers["Content-Type"] = "application/x-www-form-urlencoded"; + } +} + diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AuthorizationInjector.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AuthorizationInjector.php new file mode 100644 index 0000000..0b38bba --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AuthorizationInjector.php @@ -0,0 +1,51 @@ +client = $client; + $this->environment = $environment; + $this->refreshToken = $refreshToken; + } + + public function inject($request) + { + if (!$this->hasAuthHeader($request) && !$this->isAuthRequest($request)) + { + if (is_null($this->accessToken) || $this->accessToken->isExpired()) + { + $this->accessToken = $this->fetchAccessToken(); + } + $request->headers['Authorization'] = 'Bearer ' . $this->accessToken->token; + } + } + + private function fetchAccessToken() + { + $accessTokenResponse = $this->client->execute(new AccessTokenRequest($this->environment, $this->refreshToken)); + $accessToken = $accessTokenResponse->result; + return new AccessToken($accessToken->access_token, $accessToken->token_type, $accessToken->expires_in); + } + + private function isAuthRequest($request) + { + return $request instanceof AccessTokenRequest || $request instanceof RefreshTokenRequest; + } + + private function hasAuthHeader(HttpRequest $request) + { + return array_key_exists("Authorization", $request->headers); + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/FPTIInstrumentationInjector.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/FPTIInstrumentationInjector.php new file mode 100644 index 0000000..898a750 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/FPTIInstrumentationInjector.php @@ -0,0 +1,16 @@ +headers["sdk_name"] = "Checkout SDK"; + $request->headers["sdk_version"] = "1.0.1"; + $request->headers["sdk_tech_stack"] = "PHP " . PHP_VERSION; + $request->headers["api_integration_type"] = "PAYPALSDK"; + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/GzipInjector.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/GzipInjector.php new file mode 100644 index 0000000..202b6b1 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/GzipInjector.php @@ -0,0 +1,14 @@ +headers["Accept-Encoding"] = "gzip"; + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/PayPalEnvironment.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/PayPalEnvironment.php new file mode 100644 index 0000000..252864b --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/PayPalEnvironment.php @@ -0,0 +1,23 @@ +clientId = $clientId; + $this->clientSecret = $clientSecret; + } + + public function authorizationString() + { + return base64_encode($this->clientId . ":" . $this->clientSecret); + } +} + diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/PayPalHttpClient.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/PayPalHttpClient.php new file mode 100644 index 0000000..3b3c205 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/PayPalHttpClient.php @@ -0,0 +1,27 @@ +refreshToken = $refreshToken; + $this->authInjector = new AuthorizationInjector($this, $environment, $refreshToken); + $this->addInjector($this->authInjector); + $this->addInjector(new GzipInjector()); + $this->addInjector(new FPTIInstrumentationInjector()); + } + + public function userAgent() + { + return UserAgent::getValue(); + } +} + diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/ProductionEnvironment.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/ProductionEnvironment.php new file mode 100644 index 0000000..20a47b2 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/ProductionEnvironment.php @@ -0,0 +1,16 @@ +headers["Authorization"] = "Basic " . $environment->authorizationString(); + $this->headers["Content-Type"] = "application/x-www-form-urlencoded"; + $this->body = [ + "grant_type" => "authorization_code", + "code" => $authorizationCode + ]; + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/SandboxEnvironment.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/SandboxEnvironment.php new file mode 100644 index 0000000..92c1f7a --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/SandboxEnvironment.php @@ -0,0 +1,16 @@ +path = str_replace("{order_id}", urlencode($orderId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + + public function payPalClientMetadataId($payPalClientMetadataId) + { + $this->headers["PayPal-Client-Metadata-Id"] = $payPalClientMetadataId; + } + public function payPalRequestId($payPalRequestId) + { + $this->headers["PayPal-Request-Id"] = $payPalRequestId; + } + public function prefer($prefer) + { + $this->headers["Prefer"] = $prefer; + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersCaptureRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersCaptureRequest.php new file mode 100644 index 0000000..8af8a60 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersCaptureRequest.php @@ -0,0 +1,37 @@ +path = str_replace("{order_id}", urlencode($orderId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + + public function payPalClientMetadataId($payPalClientMetadataId) + { + $this->headers["PayPal-Client-Metadata-Id"] = $payPalClientMetadataId; + } + public function payPalRequestId($payPalRequestId) + { + $this->headers["PayPal-Request-Id"] = $payPalRequestId; + } + public function prefer($prefer) + { + $this->headers["Prefer"] = $prefer; + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersCreateRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersCreateRequest.php new file mode 100644 index 0000000..0d9f5a9 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersCreateRequest.php @@ -0,0 +1,31 @@ +headers["Content-Type"] = "application/json"; + } + + + public function payPalPartnerAttributionId($payPalPartnerAttributionId) + { + $this->headers["PayPal-Partner-Attribution-Id"] = $payPalPartnerAttributionId; + } + public function prefer($prefer) + { + $this->headers["Prefer"] = $prefer; + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersGetRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersGetRequest.php new file mode 100644 index 0000000..3d1c8f1 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersGetRequest.php @@ -0,0 +1,26 @@ +path = str_replace("{order_id}", urlencode($orderId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + + +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersPatchRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersPatchRequest.php new file mode 100644 index 0000000..4313c42 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersPatchRequest.php @@ -0,0 +1,26 @@ +path = str_replace("{order_id}", urlencode($orderId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + + +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersValidateRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersValidateRequest.php new file mode 100644 index 0000000..0a68f90 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersValidateRequest.php @@ -0,0 +1,29 @@ +path = str_replace("{order_id}", urlencode($orderId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + + public function payPalClientMetadataId($payPalClientMetadataId) + { + $this->headers["PayPal-Client-Metadata-Id"] = $payPalClientMetadataId; + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsCaptureRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsCaptureRequest.php new file mode 100644 index 0000000..68d5e81 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsCaptureRequest.php @@ -0,0 +1,33 @@ +path = str_replace("{authorization_id}", urlencode($authorizationId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + + public function payPalRequestId($payPalRequestId) + { + $this->headers["PayPal-Request-Id"] = $payPalRequestId; + } + public function prefer($prefer) + { + $this->headers["Prefer"] = $prefer; + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsGetRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsGetRequest.php new file mode 100644 index 0000000..e088224 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsGetRequest.php @@ -0,0 +1,25 @@ +path = str_replace("{authorization_id}", urlencode($authorizationId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsReauthorizeRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsReauthorizeRequest.php new file mode 100644 index 0000000..7547ece --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsReauthorizeRequest.php @@ -0,0 +1,33 @@ +path = str_replace("{authorization_id}", urlencode($authorizationId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + + public function payPalRequestId($payPalRequestId) + { + $this->headers["PayPal-Request-Id"] = $payPalRequestId; + } + public function prefer($prefer) + { + $this->headers["Prefer"] = $prefer; + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsVoidRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsVoidRequest.php new file mode 100644 index 0000000..f5c0f74 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsVoidRequest.php @@ -0,0 +1,25 @@ +path = str_replace("{authorization_id}", urlencode($authorizationId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/CapturesGetRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/CapturesGetRequest.php new file mode 100644 index 0000000..5b9b335 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/CapturesGetRequest.php @@ -0,0 +1,25 @@ +path = str_replace("{capture_id}", urlencode($captureId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/CapturesRefundRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/CapturesRefundRequest.php new file mode 100644 index 0000000..7624c6b --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/CapturesRefundRequest.php @@ -0,0 +1,33 @@ +path = str_replace("{capture_id}", urlencode($captureId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + + public function payPalRequestId($payPalRequestId) + { + $this->headers["PayPal-Request-Id"] = $payPalRequestId; + } + public function prefer($prefer) + { + $this->headers["Prefer"] = $prefer; + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/RefundsGetRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/RefundsGetRequest.php new file mode 100644 index 0000000..cdf1b8a --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/RefundsGetRequest.php @@ -0,0 +1,25 @@ +path = str_replace("{refund_id}", urlencode($refundId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + +} diff --git a/vendor/paypal/paypal-checkout-sdk/phpunit.xml b/vendor/paypal/paypal-checkout-sdk/phpunit.xml new file mode 100644 index 0000000..4e64bcb --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/phpunit.xml @@ -0,0 +1,9 @@ + + + + + + ./tests/ + + + diff --git a/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/AuthorizeOrder.php b/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/AuthorizeOrder.php new file mode 100644 index 0000000..06cc775 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/AuthorizeOrder.php @@ -0,0 +1,61 @@ +body = self::buildRequestBody(); + + $client = PayPalClient::client(); + $response = $client->execute($request); + if ($debug) + { + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Order ID: {$response->result->id}\n"; + print "Authorization ID: {$response->result->purchase_units[0]->payments->authorizations[0]->id}\n"; + print "Links:\n"; + foreach($response->result->links as $link) + { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + print "Authorization Links:\n"; + foreach($response->result->purchase_units[0]->payments->authorizations[0]->links as $link) + { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } + return $response; + } +} + +/** + * This is an driver function which invokes authorize order. + */ +if (!count(debug_backtrace())) +{ + AuthorizeOrder::authorizeOrder('1U242387CB956380X', true); +} \ No newline at end of file diff --git a/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/CaptureOrder.php b/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/CaptureOrder.php new file mode 100644 index 0000000..9dffd38 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/CaptureOrder.php @@ -0,0 +1,55 @@ +body = self::buildRequestBody(); + $client = PayPalClient::client(); + $response = $client->execute($request); + + if ($debug) + { + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Capture ID: {$response->result->id}\n"; + print "Links:\n"; + foreach($response->result->links as $link) + { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } + return $response; + } +} + +/** + * Driver function for invoking the capture flow. + */ +if (!count(debug_backtrace())) +{ + CaptureOrder::captureOrder('18A38324BV5456924', true); +} \ No newline at end of file diff --git a/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/CreateOrder.php b/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/CreateOrder.php new file mode 100644 index 0000000..e8f96ce --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/CreateOrder.php @@ -0,0 +1,237 @@ + 'AUTHORIZE', + 'application_context' => + array( + 'return_url' => 'https://example.com/return', + 'cancel_url' => 'https://example.com/cancel', + 'brand_name' => 'EXAMPLE INC', + 'locale' => 'en-US', + 'landing_page' => 'BILLING', + 'shipping_preference' => 'SET_PROVIDED_ADDRESS', + 'user_action' => 'PAY_NOW', + ), + 'purchase_units' => + array( + 0 => + array( + 'reference_id' => 'PUHF', + 'description' => 'Sporting Goods', + 'custom_id' => 'CUST-HighFashions', + 'soft_descriptor' => 'HighFashions', + 'amount' => + array( + 'currency_code' => 'USD', + 'value' => '220.00', + 'breakdown' => + array( + 'item_total' => + array( + 'currency_code' => 'USD', + 'value' => '180.00', + ), + 'shipping' => + array( + 'currency_code' => 'USD', + 'value' => '20.00', + ), + 'handling' => + array( + 'currency_code' => 'USD', + 'value' => '10.00', + ), + 'tax_total' => + array( + 'currency_code' => 'USD', + 'value' => '20.00', + ), + 'shipping_discount' => + array( + 'currency_code' => 'USD', + 'value' => '10.00', + ), + ), + ), + 'items' => + array( + 0 => + array( + 'name' => 'T-Shirt', + 'description' => 'Green XL', + 'sku' => 'sku01', + 'unit_amount' => + array( + 'currency_code' => 'USD', + 'value' => '90.00', + ), + 'tax' => + array( + 'currency_code' => 'USD', + 'value' => '10.00', + ), + 'quantity' => '1', + 'category' => 'PHYSICAL_GOODS', + ), + 1 => + array( + 'name' => 'Shoes', + 'description' => 'Running, Size 10.5', + 'sku' => 'sku02', + 'unit_amount' => + array( + 'currency_code' => 'USD', + 'value' => '45.00', + ), + 'tax' => + array( + 'currency_code' => 'USD', + 'value' => '5.00', + ), + 'quantity' => '2', + 'category' => 'PHYSICAL_GOODS', + ), + ), + 'shipping' => + array( + 'method' => 'United States Postal Service', + 'name' => + array( + 'full_name' => 'John Doe', + ), + 'address' => + array( + 'address_line_1' => '123 Townsend St', + 'address_line_2' => 'Floor 6', + 'admin_area_2' => 'San Francisco', + 'admin_area_1' => 'CA', + 'postal_code' => '94107', + 'country_code' => 'US', + ), + ), + ), + ), + ); + } + + /** + * Setting up the JSON request body for creating the Order with minimum request body. The Intent in the + * request body should be set as "AUTHORIZE" for authorize intent flow. + * + */ + private static function buildMinimumRequestBody() + { + return array( + 'intent' => 'AUTHORIZE', + 'application_context' => + array( + 'return_url' => 'https://example.com/return', + 'cancel_url' => 'https://example.com/cancel' + ), + 'purchase_units' => + array( + 0 => + array( + 'amount' => + array( + 'currency_code' => 'USD', + 'value' => '220.00' + ) + ) + ) + ); + } + + /** + * This is the sample function which can be used to create an order. It uses the + * JSON body returned by buildRequestBody() to create an new Order. + */ + public static function createOrder($debug=false) + { + $request = new OrdersCreateRequest(); + $request->headers["prefer"] = "return=representation"; + $request->body = CreateOrder::buildRequestBody(); + + $client = PayPalClient::client(); + $response = $client->execute($request); + if ($debug) + { + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Order ID: {$response->result->id}\n"; + print "Intent: {$response->result->intent}\n"; + print "Links:\n"; + foreach($response->result->links as $link) + { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + + print "Gross Amount: {$response->result->purchase_units[0]->amount->currency_code} {$response->result->purchase_units[0]->amount->value}\n"; + + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } + + + return $response; + } + + /** + * This is the sample function which can be used to create an order. It uses the + * JSON body returned by buildMinimumRequestBody() to create an new Order. + */ + public static function createOrderWithMinimumBody($debug=false) + { + $request = new OrdersCreateRequest(); + $request->headers["prefer"] = "return=representation"; + $request->body = CreateOrder::buildMinimumRequestBody(); + + $client = PayPalClient::client(); + $response = $client->execute($request); + if ($debug) + { + print "Order With Minimum Body\n"; + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Order ID: {$response->result->id}\n"; + print "Intent: {$response->result->intent}\n"; + print "Links:\n"; + foreach($response->result->links as $link) + { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + + print "Gross Amount: {$response->result->purchase_units[0]->amount->currency_code} {$response->result->purchase_units[0]->amount->value}\n"; + + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } + + + return $response; + } +} + + + +if (!count(debug_backtrace())) +{ + CreateOrder::createOrder(true); + CreateOrder::createOrderWithMinimumBody(true); +} \ No newline at end of file diff --git a/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/RunAll.php b/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/RunAll.php new file mode 100644 index 0000000..708be9d --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/RunAll.php @@ -0,0 +1,82 @@ +statusCode == 201) +{ + $orderId = $order->result->id; + print "Links:\n"; + for ($i = 0; $i < count($order->result->links); ++$i) + { + $link = $order->result->links[$i]; + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + print "Created Successfully\n"; + print "Copy approve link and paste it in browser. Login with buyer account and follow the instructions.\nOnce approved hit enter...\n"; +} +else { + exit(1); +} + +$handle = fopen ("php://stdin","r"); +$line = fgets($handle); +fclose($handle); + +print "Authorizing Order...\n"; +$response = AuthorizeOrder::authorizeOrder($orderId); +$authId = ""; + +if ($response->statusCode == 201) +{ + print "Authorized Successfully\n"; + $authId = $response->result->purchase_units[0]->payments->authorizations[0]->id; +} +else { + exit(1); +} + +print "\nCapturing Order...\n"; +$response = CaptureOrder::captureOrder($authId); +if ($response->statusCode == 201) +{ + print "Captured Successfully\n"; + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + $captureId = $response->result->id; + print "Capture ID: {$captureId}\n"; + print "Links:\n"; + for ($i = 0; $i < count($response->result->links); ++$i){ + $link = $response->result->links[$i]; + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } +} +else { + exit(1); +} + +print "\nRefunding Order...\n"; +$response = RefundOrder::refundOrder($captureId); +if ($response->statusCode == 201) +{ + print "Refunded Successfully\n"; + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Refund ID: {$response->result->id}\n"; + print "Links:\n"; + for ($i = 0; $i < count($response->result->links); ++$i){ + $link = $response->result->links[$i]; + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } +} +else { + exit(1); +} diff --git a/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/CaptureOrder.php b/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/CaptureOrder.php new file mode 100644 index 0000000..931d5d9 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/CaptureOrder.php @@ -0,0 +1,60 @@ +execute($request); + if ($debug) + { + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Order ID: {$response->result->id}\n"; + print "Links:\n"; + foreach($response->result->links as $link) + { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + print "Capture Ids:\n"; + foreach($response->result->purchase_units as $purchase_unit) + { + foreach($purchase_unit->payments->captures as $capture) + { + print "\t{$capture->id}"; + } + } + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } + + return $response; + } +} + +/** + * This is the driver function which invokes the captureOrder function with + * Approved Order Id to capture the order payment. + */ +if (!count(debug_backtrace())) +{ + CaptureOrder::captureOrder('0F105083N67049335', true); +} \ No newline at end of file diff --git a/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/CreateOrder.php b/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/CreateOrder.php new file mode 100644 index 0000000..37a8e63 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/CreateOrder.php @@ -0,0 +1,178 @@ + 'CAPTURE', + 'application_context' => + array( + 'return_url' => 'https://example.com/return', + 'cancel_url' => 'https://example.com/cancel', + 'brand_name' => 'EXAMPLE INC', + 'locale' => 'en-US', + 'landing_page' => 'BILLING', + 'shipping_preference' => 'SET_PROVIDED_ADDRESS', + 'user_action' => 'PAY_NOW', + ), + 'purchase_units' => + array( + 0 => + array( + 'reference_id' => 'PUHF', + 'description' => 'Sporting Goods', + 'custom_id' => 'CUST-HighFashions', + 'soft_descriptor' => 'HighFashions', + 'amount' => + array( + 'currency_code' => 'USD', + 'value' => '220.00', + 'breakdown' => + array( + 'item_total' => + array( + 'currency_code' => 'USD', + 'value' => '180.00', + ), + 'shipping' => + array( + 'currency_code' => 'USD', + 'value' => '20.00', + ), + 'handling' => + array( + 'currency_code' => 'USD', + 'value' => '10.00', + ), + 'tax_total' => + array( + 'currency_code' => 'USD', + 'value' => '20.00', + ), + 'shipping_discount' => + array( + 'currency_code' => 'USD', + 'value' => '10.00', + ), + ), + ), + 'items' => + array( + 0 => + array( + 'name' => 'T-Shirt', + 'description' => 'Green XL', + 'sku' => 'sku01', + 'unit_amount' => + array( + 'currency_code' => 'USD', + 'value' => '90.00', + ), + 'tax' => + array( + 'currency_code' => 'USD', + 'value' => '10.00', + ), + 'quantity' => '1', + 'category' => 'PHYSICAL_GOODS', + ), + 1 => + array( + 'name' => 'Shoes', + 'description' => 'Running, Size 10.5', + 'sku' => 'sku02', + 'unit_amount' => + array( + 'currency_code' => 'USD', + 'value' => '45.00', + ), + 'tax' => + array( + 'currency_code' => 'USD', + 'value' => '5.00', + ), + 'quantity' => '2', + 'category' => 'PHYSICAL_GOODS', + ), + ), + 'shipping' => + array( + 'method' => 'United States Postal Service', + 'name' => + array( + 'full_name' => 'John Doe', + ), + 'address' => + array( + 'address_line_1' => '123 Townsend St', + 'address_line_2' => 'Floor 6', + 'admin_area_2' => 'San Francisco', + 'admin_area_1' => 'CA', + 'postal_code' => '94107', + 'country_code' => 'US', + ), + ), + ), + ), + ); + } + + /** + * This is the sample function which can be sued to create an order. It uses the + * JSON body returned by buildRequestBody() to create an new Order. + */ + public static function createOrder($debug=false) + { + $request = new OrdersCreateRequest(); + $request->headers["prefer"] = "return=representation"; + $request->body = self::buildRequestBody(); + + $client = PayPalClient::client(); + $response = $client->execute($request); + if ($debug) + { + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Order ID: {$response->result->id}\n"; + print "Intent: {$response->result->intent}\n"; + print "Links:\n"; + foreach($response->result->links as $link) + { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } + + + return $response; + } +} + + +/** + * This is the driver function which invokes the createOrder function to create + * an sample order. + */ +if (!count(debug_backtrace())) +{ + CreateOrder::createOrder(true); +} + + + diff --git a/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/RunAll.php b/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/RunAll.php new file mode 100644 index 0000000..e576ff0 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/RunAll.php @@ -0,0 +1,74 @@ +statusCode == 201) +{ + $orderId = $order->result->id; + print "Links:\n"; + for ($i = 0; $i < count($order->result->links); ++$i) + { + $link = $order->result->links[$i]; + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + print "Created Successfully\n"; + print "Copy approve link and paste it in browser. Login with buyer account and follow the instructions.\nOnce approved hit enter...\n"; +} +else { + exit(1); +} + +$handle = fopen ("php://stdin","r"); +$line = fgets($handle); +fclose($handle); + +print "Capturing Order...\n"; +$response = CaptureOrder::captureOrder($orderId); +if ($response->statusCode == 201) +{ + print "Captured Successfully\n"; + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Order ID: {$response->result->id}\n"; + print "Links:\n"; + for ($i = 0; $i < count($response->result->links); ++$i){ + $link = $response->result->links[$i]; + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + foreach($response->result->purchase_units as $purchase_unit) + { + foreach($purchase_unit->payments->captures as $capture) + { + $captureId = $capture->id; + } + } +} +else { + exit(1); +} + +print "\nRefunding Order...\n"; +$response = RefundOrder::refundOrder($captureId); +if ($response->statusCode == 201) +{ + print "Refunded Successfully\n"; + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Refund ID: {$response->result->id}\n"; + print "Links:\n"; + for ($i = 0; $i < count($response->result->links); ++$i){ + $link = $response->result->links[$i]; + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } +} +else { + exit(1); +} diff --git a/vendor/paypal/paypal-checkout-sdk/samples/ErrorSample.php b/vendor/paypal/paypal-checkout-sdk/samples/ErrorSample.php new file mode 100644 index 0000000..8daf96b --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/samples/ErrorSample.php @@ -0,0 +1,94 @@ + $val) + { + $pretty .= $pre . ucfirst($key) .": "; + if (strcmp(gettype($val), "array") == 0){ + $pretty .= "\n"; + $sno = 1; + foreach ($val as $value) + { + $pretty .= $pre . "\t" . $sno++ . ":\n"; + $pretty .= self::prettyPrint($value, $pre . "\t\t"); + } + } + else { + $pretty .= $val . "\n"; + } + } + return $pretty; + } + + /** + * Body has no required parameters (intent, purchase_units) + */ + public static function createError1() + { + $request = new OrdersCreateRequest(); + $request->body = "{}"; + print "Request Body: {}\n\n"; + + print "Response:\n"; + try{ + $client = PayPalClient::client(); + $response = $client->execute($request); + } + catch(HttpException $exception){ + $message = json_decode($exception->getMessage(), true); + print "Status Code: {$exception->statusCode}\n"; + print(self::prettyPrint($message)); + } + } + + /** + * Body has invalid parameter value for intent + */ + public static function createError2() + { + $request = new OrdersCreateRequest(); + $request->body = array ( + 'intent' => 'INVALID', + 'purchase_units' => + array ( + 0 => + array ( + 'amount' => + array ( + 'currency_code' => 'USD', + 'value' => '100.00', + ), + ), + ), + ); + print "Request Body:\n" . json_encode($request->body, JSON_PRETTY_PRINT) . "\n\n"; + + try{ + $client = PayPalClient::client(); + $response = $client->execute($request); + } + catch(HttpException $exception){ + print "Response:\n"; + $message = json_decode($exception->getMessage(), true); + print "Status Code: {$exception->statusCode}\n"; + print(self::prettyPrint($message)); + } + + } +} + +print "Calling createError1 (Body has no required parameters (intent, purchase_units))\n"; +ErrorSample::createError1(); + +print "\n\nCalling createError2 (Body has invalid parameter value for intent)\n"; +ErrorSample::createError2(); diff --git a/vendor/paypal/paypal-checkout-sdk/samples/GetOrder.php b/vendor/paypal/paypal-checkout-sdk/samples/GetOrder.php new file mode 100644 index 0000000..f89ac9d --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/samples/GetOrder.php @@ -0,0 +1,54 @@ +execute(new OrdersGetRequest($orderId)); + /** + * Enable below line to print complete response as JSON. + */ + //print json_encode($response->result); + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Order ID: {$response->result->id}\n"; + print "Intent: {$response->result->intent}\n"; + print "Links:\n"; + foreach($response->result->links as $link) + { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + + print "Gross Amount: {$response->result->purchase_units[0]->amount->currency_code} {$response->result->purchase_units[0]->amount->value}\n"; + + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } +} + +/** + * This is the driver function which invokes the getOrder function to retrieve + * an sample order. + * + * To get the correct Order id, we are using the createOrder to create new order + * and then we are using the newly created order id. + */ +if (!count(debug_backtrace())) +{ + $createdOrder = CreateOrder::createOrder()->result; + GetOrder::getOrder($createdOrder ->id); +} \ No newline at end of file diff --git a/vendor/paypal/paypal-checkout-sdk/samples/PatchOrder.php b/vendor/paypal/paypal-checkout-sdk/samples/PatchOrder.php new file mode 100644 index 0000000..cba8152 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/samples/PatchOrder.php @@ -0,0 +1,82 @@ + + array ( + 'op' => 'replace', + 'path' => '/intent', + 'value' => 'CAPTURE', + ), + 1 => + array ( + 'op' => 'replace', + 'path' => '/purchase_units/@reference_id==\'PUHF\'/amount', + 'value' => + array ( + 'currency_code' => 'USD', + 'value' => '200.00', + 'breakdown' => + array ( + 'item_total' => + array ( + 'currency_code' => 'USD', + 'value' => '180.00', + ), + 'tax_total' => + array ( + 'currency_code' => 'USD', + 'value' => '20.00', + ), + ), + ), + ), + ); + } + + public static function patchOrder($orderId) + { + + $client = PayPalClient::client(); + + $request = new OrdersPatchRequest($orderId); + $request->body = PatchOrder::buildRequestBody(); + $client->execute($request); + + $response = $client->execute(new OrdersGetRequest($orderId)); + + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Order ID: {$response->result->id}\n"; + print "Intent: {$response->result->intent}\n"; + print "Links:\n"; + foreach($response->result->links as $link) + { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + + print "Gross Amount: {$response->result->purchase_units[0]->amount->currency_code} {$response->result->purchase_units[0]->amount->value}\n"; + + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } +} + +if (!count(debug_backtrace())) +{ + print "Before PATCH:\n"; + $createdOrder = CreateOrder::createOrder(true)->result; + print "\nAfter PATCH (Changed Intent and Amount):\n"; + PatchOrder::patchOrder($createdOrder->id); +} \ No newline at end of file diff --git a/vendor/paypal/paypal-checkout-sdk/samples/PayPalClient.php b/vendor/paypal/paypal-checkout-sdk/samples/PayPalClient.php new file mode 100644 index 0000000..397b8d2 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/samples/PayPalClient.php @@ -0,0 +1,35 @@ +>"; + $clientSecret = getenv("CLIENT_SECRET") ?: "<>"; + return new SandboxEnvironment($clientId, $clientSecret); + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/samples/RefundOrder.php b/vendor/paypal/paypal-checkout-sdk/samples/RefundOrder.php new file mode 100644 index 0000000..fc9428f --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/samples/RefundOrder.php @@ -0,0 +1,60 @@ + + array( + 'value' => '20.00', + 'currency_code' => 'USD' + ) + ); + } + + /** + * This function can be used to preform refund on the capture. + */ + public static function refundOrder($captureId, $debug=false) + { + $request = new CapturesRefundRequest($captureId); + $request->body = self::buildRequestBody(); + $client = PayPalClient::client(); + $response = $client->execute($request); + + if ($debug) + { + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Order ID: {$response->result->id}\n"; + print "Links:\n"; + foreach($response->result->links as $link) + { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } + return $response; + } +} + +/** + * This is the driver function which invokes the refund capture function with + * Capture Id to perform refund on capture. + */ +if (!count(debug_backtrace())) +{ + RefundOrder::refundOrder('8XL09935J2224701N', true); +} diff --git a/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersAuthorizeTest.php b/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersAuthorizeTest.php new file mode 100644 index 0000000..981ce26 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersAuthorizeTest.php @@ -0,0 +1,26 @@ +markTestSkipped("Need an approved Order ID to execute this test."); + $request = new OrdersAuthorizeRequest('ORDER-ID'); + $request->body = $this->buildRequestBody(); + + $client = TestHarness::client(); + $response = $client->execute($request); + $this->assertEquals(201, $response->statusCode); + $this->assertNotNull($response->result); + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersCaptureTest.php b/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersCaptureTest.php new file mode 100644 index 0000000..683f70c --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersCaptureTest.php @@ -0,0 +1,26 @@ +markTestSkipped("Need an approved Order ID to execute this test."); + $request = new OrdersCaptureRequest('ORDER-ID'); + + $client = TestHarness::client(); + $response = $client->execute($request); + $this->assertEquals(201, $response->statusCode); + $this->assertNotNull($response->result); + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersCreateTest.php b/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersCreateTest.php new file mode 100644 index 0000000..d2d6dad --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersCreateTest.php @@ -0,0 +1,69 @@ + "CAPTURE", + "purchase_units" => [[ + "reference_id" => "test_ref_id1", + "amount" => [ + "value" => "100.00", + "currency_code" => "USD" + ] + ]], + "redirect_urls" => [ + "cancel_url" => "https://example.com/cancel", + "return_url" => "https://example.com/return" + ] + ]; + } + + public static function create($client) { + $request = new OrdersCreateRequest(); + $request->prefer("return=representation"); + $request->body = self::buildRequestBody(); + return $client->execute($request); + } + + public function testOrdersCreateRequest() + { + $client = TestHarness::client(); + $response = self::create($client); + $this->assertEquals(201, $response->statusCode); + $this->assertNotNull($response->result); + + $createdOrder = $response->result; + $this->assertNotNull($createdOrder->id); + $this->assertNotNull($createdOrder->purchase_units); + $this->assertEquals(1, count($createdOrder->purchase_units)); + $firstPurchaseUnit = $createdOrder->purchase_units[0]; + $this->assertEquals("test_ref_id1", $firstPurchaseUnit->reference_id); + $this->assertEquals("USD", $firstPurchaseUnit->amount->currency_code); + $this->assertEquals("100.00", $firstPurchaseUnit->amount->value); + + $this->assertNotNull($createdOrder->create_time); + $this->assertNotNull($createdOrder->links); + $foundApproveUrl = false; + foreach ($createdOrder->links as $link) { + if ("approve" === $link->rel) { + $foundApproveUrl = true; + $this->assertNotNull($link->href); + $this->assertEquals("GET", $link->method); + } + } + $this->assertTrue($foundApproveUrl); + $this->assertEquals("CREATED", $createdOrder->status); + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersGetTest.php b/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersGetTest.php new file mode 100644 index 0000000..12fb9b0 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersGetTest.php @@ -0,0 +1,48 @@ +result->id); + $response = $client->execute($request); + $this->assertEquals(200, $response->statusCode); + $this->assertNotNull($response->result); + + $createdOrder = $response->result; + $this->assertNotNull($createdOrder->id); + $this->assertNotNull($createdOrder->purchase_units); + $this->assertEquals(1, count($createdOrder->purchase_units)); + $firstPurchaseUnit = $createdOrder->purchase_units[0]; + $this->assertEquals("test_ref_id1", $firstPurchaseUnit->reference_id); + $this->assertEquals("USD", $firstPurchaseUnit->amount->currency_code); + $this->assertEquals("100.00", $firstPurchaseUnit->amount->value); + + $this->assertNotNull($createdOrder->create_time); + $this->assertNotNull($createdOrder->links); + $foundApproveUrl = false; + foreach ($createdOrder->links as $link) { + if ("approve" === $link->rel) { + $foundApproveUrl = true; + $this->assertNotNull($link->href); + $this->assertEquals("GET", $link->method); + } + } + $this->assertTrue($foundApproveUrl); + $this->assertEquals("CREATED", $createdOrder->status); + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersPatchTest.php b/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersPatchTest.php new file mode 100644 index 0000000..1eaa307 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersPatchTest.php @@ -0,0 +1,73 @@ + "add", + "path" => "/purchase_units/@reference_id=='test_ref_id1'/description", + "value" => "added_description" + ], + [ + "op" => "replace", + "path" => "/purchase_units/@reference_id=='test_ref_id1'/amount", + "value" => [ + "currency_code" => "USD", + "value" => "200.00" + ] + ] + ]; + } + + public function testOrdersPatchRequest() + { + $client = TestHarness::client(); + $createdOrder = OrdersCreateTest::create($client); + + $request = new OrdersPatchRequest($createdOrder->result->id); + $request->body = $this->buildRequestBody(); + $response = $client->execute($request); + $this->assertEquals(204, $response->statusCode); + + $request = new OrdersGetRequest($createdOrder->result->id); + $response = $client->execute($request); + $this->assertEquals(200, $response->statusCode); + $this->assertNotNull($response->result); + + $createdOrder = $response->result; + $this->assertNotNull($createdOrder->id); + $this->assertNotNull($createdOrder->purchase_units); + $this->assertEquals(1, count($createdOrder->purchase_units)); + $firstPurchaseUnit = $createdOrder->purchase_units[0]; + $this->assertEquals("test_ref_id1", $firstPurchaseUnit->reference_id); + $this->assertEquals("USD", $firstPurchaseUnit->amount->currency_code); + $this->assertEquals("200.00", $firstPurchaseUnit->amount->value); + $this->assertEquals("added_description", $firstPurchaseUnit->description); + + $this->assertNotNull($createdOrder->create_time); + $this->assertNotNull($createdOrder->links); + $foundApproveUrl = false; + foreach ($createdOrder->links as $link) { + if ("approve" === $link->rel) { + $foundApproveUrl = true; + $this->assertNotNull($link->href); + $this->assertEquals("GET", $link->method); + } + } + $this->assertTrue($foundApproveUrl); + $this->assertEquals("CREATED", $createdOrder->status); + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/tests/TestHarness.php b/vendor/paypal/paypal-checkout-sdk/tests/TestHarness.php new file mode 100644 index 0000000..66b4abe --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/tests/TestHarness.php @@ -0,0 +1,24 @@ +>"; + $clientSecret = getenv("CLIENT_SECRET") ?: "<>"; + return new SandboxEnvironment($clientId, $clientSecret); + } +} diff --git a/vendor/paypal/paypalhttp/.gitattributes b/vendor/paypal/paypalhttp/.gitattributes new file mode 100644 index 0000000..ec6c2f5 --- /dev/null +++ b/vendor/paypal/paypalhttp/.gitattributes @@ -0,0 +1,7 @@ +tests/ export-ignore +.idea/ export-ignore +.github/ export-ignore +.releasinator.rb export-ignore +Gemfile export-ignore +Gemfile.lock export-ignore + diff --git a/vendor/paypal/paypalhttp/.gitignore b/vendor/paypal/paypalhttp/.gitignore new file mode 100644 index 0000000..2efb91f --- /dev/null +++ b/vendor/paypal/paypalhttp/.gitignore @@ -0,0 +1,32 @@ +.DS_Store +/vendor/ +composer.phar +composer.lock + +# User-specific stuff: +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries + +.idea/codeStyles/Project.xml +.idea/codeStyles/codeStyleConfig.xml +.idea/* + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +## File-based project format: +*.iws +.idea/*.iml +.idea/vcs.xml +.idea/php.xml +.idea/php-test-framework.xml +.idea/modules.xml +__files/* +mappings/* diff --git a/vendor/paypal/paypalhttp/.travis.yml b/vendor/paypal/paypalhttp/.travis.yml new file mode 100644 index 0000000..4fddbb9 --- /dev/null +++ b/vendor/paypal/paypalhttp/.travis.yml @@ -0,0 +1,16 @@ +sudo: false +language: php +php: +- 5.6 +- 7.0 +- 7.1 +- hhvm +matrix: + allow_failures: + - php: hhvm + fast_finish: true +before_script: +- composer self-update +- composer install --dev +script: +- vendor/bin/phpunit diff --git a/vendor/paypal/paypalhttp/CHANGELOG.md b/vendor/paypal/paypalhttp/CHANGELOG.md new file mode 100644 index 0000000..f55b907 --- /dev/null +++ b/vendor/paypal/paypalhttp/CHANGELOG.md @@ -0,0 +1,2 @@ +## 1.0.0 +- First release diff --git a/vendor/paypal/paypalhttp/CONTRIBUTING.md b/vendor/paypal/paypalhttp/CONTRIBUTING.md new file mode 100644 index 0000000..3810a58 --- /dev/null +++ b/vendor/paypal/paypalhttp/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# Contribute to the PayPal PHP HttpClient + +### *Pull requests are welcome!* + +General Guidelines +------------------ + +* **Code style.** Please follow local code style. Ask if you're unsure. +* **No warnings.** All generated code must compile without warnings. + diff --git a/vendor/paypal/paypalhttp/LICENSE b/vendor/paypal/paypalhttp/LICENSE new file mode 100644 index 0000000..c689d74 --- /dev/null +++ b/vendor/paypal/paypalhttp/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2009-2016 PayPal, Inc. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + diff --git a/vendor/paypal/paypalhttp/README.md b/vendor/paypal/paypalhttp/README.md new file mode 100644 index 0000000..c4bc958 --- /dev/null +++ b/vendor/paypal/paypalhttp/README.md @@ -0,0 +1,76 @@ +## PayPal HttpClient + +PayPalHttp is a generic HTTP Client. + +In it's simplest form, an [`HttpClient`](lib/PayPalHttp/HttpClient.php) exposes an `execute` method which takes an [HTTP request](lib/PayPalHttp/HttpRequest.php), executes it against the domain described in an [Environment](lib/PayPalHttp/Environment.php), and returns an [HTTP response](lib/PayPalHttp/HttpResponse.php). + +### Environment + +An [`Environment`](./lib/PayPalHttp/environment.rb) describes a domain that hosts a REST API, against which an `HttpClient` will make requests. `Environment` is a simple interface that wraps one method, `baseUrl`. + +```php +$env = new Environment('https://example.com'); +``` + +### Requests + +HTTP requests contain all the information needed to make an HTTP request against the REST API. Specifically, one request describes a path, a verb, any path/query/form parameters, headers, attached files for upload, and body data. + +### Responses + +HTTP responses contain information returned by a server in response to a request as described above. They are simple objects which contain a status code, headers, and any data returned by the server. + +```php +$request = new HttpRequest("/path", "GET"); +$request->body[] = "some data"; + +$response = $client->execute($req); + +$statusCode = $response->statusCode; +$headers = $response->headers; +$data = $response->result; +``` + +### Injectors + +Injectors are blocks that can be used for executing arbitrary pre-flight logic, such as modifying a request or logging data. Injectors are attached to an `HttpClient` using the `addInjector` method. + +The `HttpClient` executes its injectors in a first-in, first-out order, before each request. + +```php +class LogInjector implements Injector +{ + public function inject($httpRequest) + { + // Do some logging here + } +} + +$logInjector = new LogInjector(); +$client = new HttpClient($environment); +$client->addInjector($logInjector); +... +``` + +### Error Handling + +`HttpClient#execute` may throw an `Exception` if something went wrong during the course of execution. If the server returned a non-200 response, [IOException](lib/PayPalHttp/IOException.php) will be thrown, that will contain a status code and headers you can use for debugging. + +```php +try +{ + $client->execute($req); +} +catch (HttpException $e) +{ + $statusCode = $e->response->statusCode; + $headers = $e->response->headers; + $body = $e->response->result; +} +``` + +## License +PayPalHttp-PHP is open source and available under the MIT license. See the [LICENSE](./LICENSE) file for more information. + +## Contributing +Pull requests and issues are welcome. Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for more details. diff --git a/vendor/paypal/paypalhttp/Rakefile b/vendor/paypal/paypalhttp/Rakefile new file mode 100644 index 0000000..33a443c --- /dev/null +++ b/vendor/paypal/paypalhttp/Rakefile @@ -0,0 +1,2 @@ +spec = Gem::Specification.find_by_name 'releasinator' +load "#{spec.gem_dir}/lib/tasks/releasinator.rake" diff --git a/vendor/paypal/paypalhttp/composer.json b/vendor/paypal/paypalhttp/composer.json new file mode 100644 index 0000000..05728a3 --- /dev/null +++ b/vendor/paypal/paypalhttp/composer.json @@ -0,0 +1,23 @@ +{ + "name": "paypal/paypalhttp", + "type": "library", + "license": "MIT", + "authors": [ + { + "name": "PayPal", + "homepage": "https://github.com/paypal/paypalhttp_php/contributors" + } + ], + "require": { + "ext-curl": "*" + }, + "require-dev": { + "phpunit/phpunit": "^5.7", + "wiremock-php/wiremock-php": "1.43.2" + }, + "autoload": { + "psr-4": { + "PayPalHttp\\": "lib/PayPalHttp" + } + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/Curl.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/Curl.php new file mode 100644 index 0000000..08e6eaf --- /dev/null +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/Curl.php @@ -0,0 +1,57 @@ +curl = $curl; + } + + public function setOpt($option, $value) + { + curl_setopt($this->curl, $option, $value); + return $this; + } + + public function close() + { + curl_close($this->curl); + return $this; + } + + public function exec() + { + return curl_exec($this->curl); + } + + public function errNo() + { + return curl_errno($this->curl); + } + + public function getInfo($option) + { + return curl_getinfo($this->curl, $option); + } + + public function error() + { + return curl_error($this->curl); + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/Encoder.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/Encoder.php new file mode 100644 index 0000000..b7158a7 --- /dev/null +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/Encoder.php @@ -0,0 +1,114 @@ +serializers[] = new Json(); + $this->serializers[] = new Text(); + $this->serializers[] = new Multipart(); + $this->serializers[] = new Form(); + } + + + + public function serializeRequest(HttpRequest $request) + { + if (!array_key_exists('content-type', $request->headers)) { + $message = "HttpRequest does not have Content-Type header set"; + echo $message; + throw new \Exception($message); + } + + $contentType = $request->headers['content-type']; + /** @var Serializer $serializer */ + $serializer = $this->serializer($contentType); + + if (is_null($serializer)) { + $message = sprintf("Unable to serialize request with Content-Type: %s. Supported encodings are: %s", $contentType, implode(", ", $this->supportedEncodings())); + echo $message; + throw new \Exception($message); + } + + if (!(is_string($request->body) || is_array($request->body))) { + $message = "Body must be either string or array"; + echo $message; + throw new \Exception($message); + } + + $serialized = $serializer->encode($request); + + if (array_key_exists("content-encoding", $request->headers) && $request->headers["content-encoding"] === "gzip") { + $serialized = gzencode($serialized); + } + return $serialized; + } + + + public function deserializeResponse($responseBody, $headers) + { + + if (!array_key_exists('content-type', $headers)) { + $message = "HTTP response does not have Content-Type header set"; + echo $message; + throw new \Exception($message); + } + + $contentType = $headers['content-type']; + /** @var Serializer $serializer */ + $serializer = $this->serializer($contentType); + + if (is_null($serializer)) { + throw new \Exception(sprintf("Unable to deserialize response with Content-Type: %s. Supported encodings are: %s", $contentType, implode(", ", $this->supportedEncodings()))); + } + + if (array_key_exists("content-encoding", $headers) && $headers["content-encoding"] === "gzip") { + $responseBody = gzdecode($responseBody); + } + + return $serializer->decode($responseBody); + } + + private function serializer($contentType) + { + /** @var Serializer $serializer */ + foreach ($this->serializers as $serializer) { + try { + if (preg_match($serializer->contentType(), $contentType) == 1) { + return $serializer; + } + } catch (\Exception $ex) { + $message = sprintf("Error while checking content type of %s: %s", get_class($serializer), $ex->getMessage()); + echo $message; + throw new \Exception($message, $ex->getCode(), $ex); + } + } + + return NULL; + } + + private function supportedEncodings() + { + $values = []; + /** @var Serializer $serializer */ + foreach ($this->serializers as $serializer) { + $values[] = $serializer->contentType(); + } + return $values; + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/Environment.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/Environment.php new file mode 100644 index 0000000..4eb0ce0 --- /dev/null +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/Environment.php @@ -0,0 +1,18 @@ +environment = $environment; + $this->encoder = new Encoder(); + $this->curlCls = Curl::class; + } + + /** + * Injectors are blocks that can be used for executing arbitrary pre-flight logic, such as modifying a request or logging data. + * Executed in first-in first-out order. + * + * @param Injector $inj + */ + public function addInjector(Injector $inj) + { + $this->injectors[] = $inj; + } + + /** + * The method that takes an HTTP request, serializes the request, makes a call to given environment, and deserialize response + * + * @param $httpRequest HttpRequest + * @return HttpResponse + */ + public function execute(HttpRequest $httpRequest) + { + $requestCpy = clone $httpRequest; + $curl = new Curl(); + + foreach ($this->injectors as $inj) { + $inj->inject($requestCpy); + } + + $url = $this->environment->baseUrl() . $requestCpy->path; + $formattedHeaders = $this->prepareHeaders($requestCpy->headers); + if (!array_key_exists("user-agent", $formattedHeaders)) { + $requestCpy->headers["user-agent"] = $this->userAgent(); + } + + $body = ""; + if (!is_null($requestCpy->body)) { + $rawHeaders = $requestCpy->headers; + $requestCpy->headers = $formattedHeaders; + $body = $this->encoder->serializeRequest($requestCpy); + $requestCpy->headers = $this->mapHeaders($rawHeaders,$requestCpy->headers); + } + + $curl->setOpt(CURLOPT_URL, $url); + $curl->setOpt(CURLOPT_CUSTOMREQUEST, $requestCpy->verb); + $curl->setOpt(CURLOPT_HTTPHEADER, $this->serializeHeaders($requestCpy->headers)); + $curl->setOpt(CURLOPT_RETURNTRANSFER, 1); + $curl->setOpt(CURLOPT_HEADER, 0); + + if (!is_null($requestCpy->body)) { + $curl->setOpt(CURLOPT_POSTFIELDS, $body); + } + + if (strpos($this->environment->baseUrl(), "https://") === 0) { + $curl->setOpt(CURLOPT_SSL_VERIFYPEER, true); + $curl->setOpt(CURLOPT_SSL_VERIFYHOST, 2); + } + + if ($caCertPath = $this->getCACertFilePath()) { + $curl->setOpt(CURLOPT_CAINFO, $caCertPath); + } + + $response = $this->parseResponse($curl); + $curl->close(); + + return $response; + } + + /** + * Returns an array representing headers with their keys + * to be lower case + * @param $headers + * @return array + */ + public function prepareHeaders($headers){ + return array_change_key_case($headers); + } + + /** + * Returns an array representing headers with their key in + * original cases and updated values + * @param $rawHeaders + * @param $formattedHeaders + * @return array + */ + public function mapHeaders($rawHeaders, $formattedHeaders){ + $rawHeadersKey = array_keys($rawHeaders); + foreach ($rawHeadersKey as $array_key) { + if(array_key_exists(strtolower($array_key), $formattedHeaders)){ + $rawHeaders[$array_key] = $formattedHeaders[strtolower($array_key)]; + } + } + return $rawHeaders; + } + + /** + * Returns default user-agent + * + * @return string + */ + public function userAgent() + { + return "PayPalHttp-PHP HTTP/1.1"; + } + + /** + * Return the filepath to your custom CA Cert if needed. + * @return string + */ + protected function getCACertFilePath() + { + return null; + } + + protected function setCurl(Curl $curl) + { + $this->curl = $curl; + } + + protected function setEncoder(Encoder $encoder) + { + $this->encoder = $encoder; + } + + private function serializeHeaders($headers) + { + $headerArray = []; + if ($headers) { + foreach ($headers as $key => $val) { + $headerArray[] = $key . ": " . $val; + } + } + + return $headerArray; + } + + private function parseResponse($curl) + { + $headers = []; + $curl->setOpt(CURLOPT_HEADERFUNCTION, + function($curl, $header) use (&$headers) + { + $len = strlen($header); + + $k = ""; + $v = ""; + + $this->deserializeHeader($header, $k, $v); + $headers[$k] = $v; + + return $len; + }); + + $responseData = $curl->exec(); + $statusCode = $curl->getInfo(CURLINFO_HTTP_CODE); + $errorCode = $curl->errNo(); + $error = $curl->error(); + + if ($errorCode > 0) { + throw new IOException($error, $errorCode); + } + + $body = $responseData; + + if ($statusCode >= 200 && $statusCode < 300) { + $responseBody = NULL; + + if (!empty($body)) { + $responseBody = $this->encoder->deserializeResponse($body, $this->prepareHeaders($headers)); + } + + return new HttpResponse( + $errorCode === 0 ? $statusCode : $errorCode, + $responseBody, + $headers + ); + } else { + throw new HttpException($body, $statusCode, $headers); + } + } + + private function deserializeHeader($header, &$key, &$value) + { + if (strlen($header) > 0) { + if (empty($header) || strpos($header, ':') === false) { + return NULL; + } + + list($k, $v) = explode(":", $header); + $key = trim($k); + $value = trim($v); + } + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpException.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpException.php new file mode 100644 index 0000000..5f4d2db --- /dev/null +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpException.php @@ -0,0 +1,23 @@ +statusCode = $statusCode; + $this->headers = $headers; + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpRequest.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpRequest.php new file mode 100644 index 0000000..89b7480 --- /dev/null +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpRequest.php @@ -0,0 +1,42 @@ +path = $path; + $this->verb = $verb; + $this->body = NULL; + $this->headers = []; + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpResponse.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpResponse.php new file mode 100644 index 0000000..ef8fb35 --- /dev/null +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpResponse.php @@ -0,0 +1,34 @@ +statusCode = $statusCode; + $this->headers = $headers; + $this->result = $body; + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/IOException.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/IOException.php new file mode 100644 index 0000000..7bfc91c --- /dev/null +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/IOException.php @@ -0,0 +1,13 @@ +body) || !$this->isAssociative($request->body)) + { + throw new \Exception("HttpRequest body must be an associative array when Content-Type is: " . $request->headers["Content-Type"]); + } + + return http_build_query($request->body); + } + + /** + * @param $body + * @return mixed + * @throws \Exception as multipart does not support deserialization. + */ + public function decode($body) + { + throw new \Exception("CurlSupported does not support deserialization"); + } + + private function isAssociative(array $array) + { + return array_values($array) !== $array; + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/FormPart.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/FormPart.php new file mode 100644 index 0000000..3779a9b --- /dev/null +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/FormPart.php @@ -0,0 +1,25 @@ +value = $value; + $this->headers = array_merge([], $headers); + } + + public function getValue() + { + return $this->value; + } + + public function getHeaders() + { + return $this->headers; + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Json.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Json.php new file mode 100644 index 0000000..3f66314 --- /dev/null +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Json.php @@ -0,0 +1,38 @@ +body; + if (is_string($body)) { + return $body; + } + if (is_array($body)) { + return json_encode($body); + } + throw new \Exception("Cannot serialize data. Unknown type"); + } + + public function decode($data) + { + return json_decode($data); + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Multipart.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Multipart.php new file mode 100644 index 0000000..a420205 --- /dev/null +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Multipart.php @@ -0,0 +1,134 @@ +body) || !$this->isAssociative($request->body)) + { + throw new \Exception("HttpRequest body must be an associative array when Content-Type is: " . $request->headers["content-type"]); + } + $boundary = "---------------------" . md5(mt_rand() . microtime()); + $contentTypeHeader = $request->headers["content-type"]; + $request->headers["content-type"] = "{$contentTypeHeader}; boundary={$boundary}"; + + $value_params = []; + $file_params = []; + + $disallow = ["\0", "\"", "\r", "\n"]; + + $body = []; + + foreach ($request->body as $k => $v) { + $k = str_replace($disallow, "_", $k); + if (is_resource($v)) { + $file_params[] = $this->prepareFilePart($k, $v, $boundary); + } else if ($v instanceof FormPart) { + $value_params[] = $this->prepareFormPart($k, $v, $boundary); + } else { + $value_params[] = $this->prepareFormField($k, $v, $boundary); + } + } + + $body = array_merge($value_params, $file_params); + + // add boundary for each parameters + array_walk($body, function (&$part) use ($boundary) { + $part = "--{$boundary}" . self::LINEFEED . "{$part}"; + }); + + // add final boundary + $body[] = "--{$boundary}--"; + $body[] = ""; + + return implode(self::LINEFEED, $body); + } + + public function decode($data) + { + throw new \Exception("Multipart does not support deserialization"); + } + + private function isAssociative(array $array) + { + return array_values($array) !== $array; + } + + private function prepareFormField($partName, $value, $boundary) + { + return implode(self::LINEFEED, [ + "Content-Disposition: form-data; name=\"{$partName}\"", + "", + filter_var($value), + ]); + } + + private function prepareFilePart($partName, $file, $boundary) + { + $fileInfo = new finfo(FILEINFO_MIME_TYPE); + $filePath = stream_get_meta_data($file)['uri']; + $data = file_get_contents($filePath); + $mimeType = $fileInfo->buffer($data); + + $splitFilePath = explode(DIRECTORY_SEPARATOR, $filePath); + $filePath = end($splitFilePath); + $disallow = ["\0", "\"", "\r", "\n"]; + $filePath = str_replace($disallow, "_", $filePath); + return implode(self::LINEFEED, [ + "Content-Disposition: form-data; name=\"{$partName}\"; filename=\"{$filePath}\"", + "Content-Type: {$mimeType}", + "", + $data, + ]); + } + + private function prepareFormPart($partName, $formPart, $boundary) + { + $contentDisposition = "Content-Disposition: form-data; name=\"{$partName}\""; + + $partHeaders = $formPart->getHeaders(); + $formattedheaders = array_change_key_case($partHeaders); + if (array_key_exists("content-type", $formattedheaders)) { + if ($formattedheaders["content-type"] === "application/json") { + $contentDisposition .= "; filename=\"{$partName}.json\""; + } + $tempRequest = new HttpRequest('/', 'POST'); + $tempRequest->headers = $formattedheaders; + $tempRequest->body = $formPart->getValue(); + $encoder = new Encoder(); + $partValue = $encoder->serializeRequest($tempRequest); + } else { + $partValue = $formPart->getValue(); + } + + $finalPartHeaders = []; + foreach ($partHeaders as $k => $v) { + $finalPartHeaders[] = "{$k}: {$v}"; + } + + $body = array_merge([$contentDisposition], $finalPartHeaders, [""], [$partValue]); + + return implode(self::LINEFEED, $body); + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Text.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Text.php new file mode 100644 index 0000000..e2ce0ca --- /dev/null +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Text.php @@ -0,0 +1,38 @@ +body; + if (is_string($body)) { + return $body; + } + if (is_array($body)) { + return json_encode($body); + } + return implode(" ", $body); + } + + public function decode($data) + { + return $data; + } +} diff --git a/vendor/paypal/paypalhttp/phpunit.xml b/vendor/paypal/paypalhttp/phpunit.xml new file mode 100644 index 0000000..ea84278 --- /dev/null +++ b/vendor/paypal/paypalhttp/phpunit.xml @@ -0,0 +1,10 @@ + + + + + + ./tests/unit + + + + diff --git a/vendor/phpmailer/phpmailer/COMMITMENT b/vendor/phpmailer/phpmailer/COMMITMENT new file mode 100644 index 0000000..a687e0d --- /dev/null +++ b/vendor/phpmailer/phpmailer/COMMITMENT @@ -0,0 +1,46 @@ +GPL Cooperation Commitment +Version 1.0 + +Before filing or continuing to prosecute any legal proceeding or claim +(other than a Defensive Action) arising from termination of a Covered +License, we commit to extend to the person or entity ('you') accused +of violating the Covered License the following provisions regarding +cure and reinstatement, taken from GPL version 3. As used here, the +term 'this License' refers to the specific Covered License being +enforced. + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly + and finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you + have received notice of violation of this License (for any work) + from that copyright holder, and you cure the violation prior to 30 + days after your receipt of the notice. + +We intend this Commitment to be irrevocable, and binding and +enforceable against us and assignees of or successors to our +copyrights. + +Definitions + +'Covered License' means the GNU General Public License, version 2 +(GPLv2), the GNU Lesser General Public License, version 2.1 +(LGPLv2.1), or the GNU Library General Public License, version 2 +(LGPLv2), all as published by the Free Software Foundation. + +'Defensive Action' means a legal proceeding or claim that We bring +against you in response to a prior proceeding or claim initiated by +you or your affiliate. + +'We' means each contributor to this repository as of the date of +inclusion of this file, including subsidiaries of a corporate +contributor. + +This work is available under a Creative Commons Attribution-ShareAlike +4.0 International license (https://creativecommons.org/licenses/by-sa/4.0/). diff --git a/vendor/phpmailer/phpmailer/LICENSE b/vendor/phpmailer/phpmailer/LICENSE new file mode 100644 index 0000000..f166cc5 --- /dev/null +++ b/vendor/phpmailer/phpmailer/LICENSE @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! \ No newline at end of file diff --git a/vendor/phpmailer/phpmailer/README.md b/vendor/phpmailer/phpmailer/README.md new file mode 100644 index 0000000..09a5ddb --- /dev/null +++ b/vendor/phpmailer/phpmailer/README.md @@ -0,0 +1,222 @@ +![PHPMailer](https://raw.github.com/PHPMailer/PHPMailer/master/examples/images/phpmailer.png) + +# PHPMailer – A full-featured email creation and transfer class for PHP + +[![Test status](https://github.com/PHPMailer/PHPMailer/workflows/Tests/badge.svg)](https://github.com/PHPMailer/PHPMailer/actions) [![Latest Stable Version](https://poser.pugx.org/phpmailer/phpmailer/v/stable.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![Total Downloads](https://poser.pugx.org/phpmailer/phpmailer/downloads)](https://packagist.org/packages/phpmailer/phpmailer) [![License](https://poser.pugx.org/phpmailer/phpmailer/license.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![API Docs](https://github.com/phpmailer/phpmailer/workflows/Docs/badge.svg)](https://phpmailer.github.io/PHPMailer/) + +## Features +- Probably the world's most popular code for sending email from PHP! +- Used by many open-source projects: WordPress, Drupal, 1CRM, SugarCRM, Yii, Joomla! and many more +- Integrated SMTP support – send without a local mail server +- Send emails with multiple To, CC, BCC and Reply-to addresses +- Multipart/alternative emails for mail clients that do not read HTML email +- Add attachments, including inline +- Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings +- SMTP authentication with LOGIN, PLAIN, CRAM-MD5, and XOAUTH2 mechanisms over SMTPS and SMTP+STARTTLS transports +- Validates email addresses automatically +- Protects against header injection attacks +- Error messages in over 50 languages! +- DKIM and S/MIME signing support +- Compatible with PHP 5.5 and later, including PHP 8.0 +- Namespaced to prevent name clashes +- Much more! + +## Why you might need it +Many PHP developers need to send email from their code. The only PHP function that supports this directly is [`mail()`](https://www.php.net/manual/en/function.mail.php). However, it does not provide any assistance for making use of popular features such as encryption, authentication, HTML messages, and attachments. + +Formatting email correctly is surprisingly difficult. There are myriad overlapping (and conflicting) standards, requiring tight adherence to horribly complicated formatting and encoding rules – the vast majority of code that you'll find online that uses the `mail()` function directly is just plain wrong, if not unsafe! + +The PHP `mail()` function usually sends via a local mail server, typically fronted by a `sendmail` binary on Linux, BSD, and macOS platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP client allows email sending on all platforms without needing a local mail server. Be aware though, that the `mail()` function should be avoided when possible; it's both faster and [safer](https://exploitbox.io/paper/Pwning-PHP-Mail-Function-For-Fun-And-RCE.html) to use SMTP to localhost. + +*Please* don't be tempted to do it yourself – if you don't use PHPMailer, there are many other excellent libraries that +you should look at before rolling your own. Try [SwiftMailer](https://swiftmailer.symfony.com/) +, [Laminas/Mail](https://docs.laminas.dev/laminas-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail) etc. + +## License +This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html) license, along with the [GPL Cooperation Commitment](https://gplcc.github.io/gplcc/). Please read [LICENSE](https://github.com/PHPMailer/PHPMailer/blob/master/LICENSE) for information on the software availability and distribution. + +## Installation & loading +PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file: + +```json +"phpmailer/phpmailer": "^6.2" +``` + +or run + +```sh +composer require phpmailer/phpmailer +``` + +Note that the `vendor` folder and the `vendor/autoload.php` script are generated by Composer; they are not part of PHPMailer. + +If you want to use the Gmail XOAUTH2 authentication class, you will also need to add a dependency on the `league/oauth2-client` package in your `composer.json`. + +Alternatively, if you're not using Composer, you +can [download PHPMailer as a zip file](https://github.com/PHPMailer/PHPMailer/archive/master.zip), (note that docs and examples are not included in the zip file), then copy the contents of the PHPMailer folder into one of the `include_path` directories specified in your PHP configuration and load each class file manually: + +```php +SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output + $mail->isSMTP(); //Send using SMTP + $mail->Host = 'smtp.example.com'; //Set the SMTP server to send through + $mail->SMTPAuth = true; //Enable SMTP authentication + $mail->Username = 'user@example.com'; //SMTP username + $mail->Password = 'secret'; //SMTP password + $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; //Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged + $mail->Port = 587; //TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above + + //Recipients + $mail->setFrom('from@example.com', 'Mailer'); + $mail->addAddress('joe@example.net', 'Joe User'); //Add a recipient + $mail->addAddress('ellen@example.com'); //Name is optional + $mail->addReplyTo('info@example.com', 'Information'); + $mail->addCC('cc@example.com'); + $mail->addBCC('bcc@example.com'); + + //Attachments + $mail->addAttachment('/var/tmp/file.tar.gz'); //Add attachments + $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); //Optional name + + //Content + $mail->isHTML(true); //Set email format to HTML + $mail->Subject = 'Here is the subject'; + $mail->Body = 'This is the HTML message body in bold!'; + $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; + + $mail->send(); + echo 'Message has been sent'; +} catch (Exception $e) { + echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; +} +``` + +You'll find plenty to play with in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder, which covers many common scenarios including sending through gmail, building contact forms, sending to mailing lists, and more. + +If you are re-using the instance (e.g. when sending to a mailing list), you may need to clear the recipient list to avoid sending duplicate messages. See [the mailing list example](https://github.com/PHPMailer/PHPMailer/blob/master/examples/mailing_list.phps) for further guidance. + +That's it. You should now be ready to use PHPMailer! + +## Localization +PHPMailer defaults to English, but in the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder you'll find many translations for PHPMailer error messages that you may encounter. Their filenames contain [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the translations, for example `fr` for French. To specify a language, you need to tell PHPMailer which one to use, like this: + +```php +//To load the French version +$mail->setLanguage('fr', '/optional/path/to/language/directory/'); +``` + +We welcome corrections and new languages – if you're looking for corrections, run the [PHPMailerLangTest.php](https://github.com/PHPMailer/PHPMailer/tree/master/test/PHPMailerLangTest.php) script in the tests folder and it will show any missing translations. + +## Documentation +Start reading at the [GitHub wiki](https://github.com/PHPMailer/PHPMailer/wiki). If you're having trouble, head for [the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting) as it's frequently updated. + +Examples of how to use PHPMailer for common scenarios can be found in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder. If you're looking for a good starting point, we recommend you start with [the Gmail example](https://github.com/PHPMailer/PHPMailer/tree/master/examples/gmail.phps). + +To reduce PHPMailer's deployed code footprint, examples are not included if you load PHPMailer via Composer or via [GitHub's zip file download](https://github.com/PHPMailer/PHPMailer/archive/master.zip), so you'll need to either clone the git repository or use the above links to get to the examples directly. + +Complete generated API documentation is [available online](https://phpmailer.github.io/PHPMailer/). + +You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](http://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/blob/master/test/PHPMailerTest.php) a good reference for how to do various operations such as encryption. + +If the documentation doesn't cover what you need, search the [many questions on Stack Overflow](http://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting). + +## Tests +[PHPMailer tests](https://github.com/PHPMailer/PHPMailer/tree/master/test/) use PHPUnit 9, with [a polyfill](https://github.com/Yoast/PHPUnit-Polyfills) to let 9-style tests run on older PHPUnit and PHP versions. + +[![Test status](https://github.com/PHPMailer/PHPMailer/workflows/Tests/badge.svg)](https://github.com/PHPMailer/PHPMailer/actions) + +If this isn't passing, is there something you can do to help? + +## Security +Please disclose any vulnerabilities found responsibly – report security issues to the maintainers privately. + +See [SECURITY](https://github.com/PHPMailer/PHPMailer/tree/master/SECURITY.md) and [PHPMailer's security advisories on GitHub](https://github.com/PHPMailer/PHPMailer/security). + +## Contributing +Please submit bug reports, suggestions and pull requests to the [GitHub issue tracker](https://github.com/PHPMailer/PHPMailer/issues). + +We're particularly interested in fixing edge-cases, expanding test coverage and updating translations. + +If you found a mistake in the docs, or want to add something, go ahead and amend the wiki – anyone can edit it. + +If you have git clones from prior to the move to the PHPMailer GitHub organisation, you'll need to update any remote URLs referencing the old GitHub location with a command like this from within your clone: + +```sh +git remote set-url upstream https://github.com/PHPMailer/PHPMailer.git +``` + +Please *don't* use the SourceForge or Google Code projects any more; they are obsolete and no longer maintained. + +## Sponsorship +Development time and resources for PHPMailer are provided by [Smartmessages.net](https://info.smartmessages.net/), the world's only privacy-first email marketing system. + +Smartmessages.net privacy-first email marketing logo + +Donations are very welcome, whether in beer 🍺, T-shirts 👕, or cold, hard cash 💰. Sponsorship through GitHub is a simple and convenient way to say "thank you" to PHPMailer's maintainers and contributors – just click the "Sponsor" button [on the project page](https://github.com/PHPMailer/PHPMailer). If your company uses PHPMailer, consider taking part in Tidelift's enterprise support programme. + +## PHPMailer For Enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of PHPMailer and thousands of other packages are working with Tidelift to deliver commercial +support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and +improve code health, while paying the maintainers of the exact packages you +use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-phpmailer-phpmailer?utm_source=packagist-phpmailer-phpmailer&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +## Changelog +See [changelog](changelog.md). + +## History +- PHPMailer was originally written in 2001 by Brent R. Matzelle as a [SourceForge project](http://sourceforge.net/projects/phpmailer/). +- [Marcus Bointon](https://github.com/Synchro) (`coolbru` on SF) and Andy Prevost (`codeworxtech`) took over the project in 2004. +- Became an Apache incubator project on Google Code in 2010, managed by Jim Jagielski. +- Marcus created [his fork on GitHub](https://github.com/Synchro/PHPMailer) in 2008. +- Jim and Marcus decide to join forces and use GitHub as the canonical and official repo for PHPMailer in 2013. +- PHPMailer moves to [the PHPMailer organisation](https://github.com/PHPMailer) on GitHub in 2013. + +### What's changed since moving from SourceForge? +- Official successor to the SourceForge and Google Code projects. +- Test suite. +- Continuous integration with Github Actions. +- Composer support. +- Public development. +- Additional languages and language strings. +- CRAM-MD5 authentication support. +- Preserves full repo history of authors, commits and branches from the original SourceForge project. diff --git a/vendor/phpmailer/phpmailer/SECURITY.md b/vendor/phpmailer/phpmailer/SECURITY.md new file mode 100644 index 0000000..5f545f2 --- /dev/null +++ b/vendor/phpmailer/phpmailer/SECURITY.md @@ -0,0 +1,37 @@ +# Security notices relating to PHPMailer + +Please disclose any security issues or vulnerabilities found through [Tidelift's coordinated disclosure system](https://tidelift.com/security) or to the maintainers privately. + +PHPMailer 6.4.1 and earlier contain a vulnerability that can result in untrusted code being called (if such code is injected into the host project's scope by other means). If the `$patternselect` parameter to `validateAddress()` is set to `'php'` (the default, defined by `PHPMailer::$validator`), and the global namespace contains a function called `php`, it will be called in preference to the built-in validator of the same name. Mitigated in PHPMailer 6.5.0 by denying the use of simple strings as validator function names. Recorded as [CVE-2021-3603](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-3603). Reported by [Vikrant Singh Chauhan](mailto:vi@hackberry.xyz) via [huntr.dev](https://www.huntr.dev/). + +PHPMailer versions 6.4.1 and earlier contain a possible remote code execution vulnerability through the `$lang_path` parameter of the `setLanguage()` method. If the `$lang_path` parameter is passed unfiltered from user input, it can be set to [a UNC path](https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats#unc-paths), and if an attacker is also able to persuade the server to load a file from that UNC path, a script file under their control may be executed. This vulnerability only applies to systems that resolve UNC paths, typically only Microsoft Windows. +PHPMailer 6.5.0 mitigates this by no longer treating translation files as PHP code, but by parsing their text content directly. This approach avoids the possibility of executing unknown code while retaining backward compatibility. This isn't ideal, so the current translation format is deprecated and will be replaced in the next major release. Recorded as [CVE-2021-34551](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-34551). Reported by [Jilin Diting Information Technology Co., Ltd](https://listensec.com) via Tidelift. + +PHPMailer versions between 6.1.8 and 6.4.0 contain a regression of the earlier CVE-2018-19296 object injection vulnerability as a result of [a fix for Windows UNC paths in 6.1.8](https://github.com/PHPMailer/PHPMailer/commit/e2e07a355ee8ff36aba21d0242c5950c56e4c6f9). Recorded as [CVE-2020-36326](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-36326). Reported by Fariskhi Vidyan via Tidelift. 6.4.1 fixes this issue, and also enforces stricter checks for URL schemes in local path contexts. + +PHPMailer versions 6.1.5 and earlier contain an output escaping bug that occurs in `Content-Type` and `Content-Disposition` when filenames passed into `addAttachment` and other methods that accept attachment names contain double quote characters, in contravention of RFC822 3.4.1. No specific vulnerability has been found relating to this, but it could allow file attachments to bypass attachment filters that are based on matching filename extensions. Recorded as [CVE-2020-13625](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-13625). Reported by Elar Lang of Clarified Security. + +PHPMailer versions prior to 6.0.6 and 5.2.27 are vulnerable to an object injection attack by passing `phar://` paths into `addAttachment()` and other functions that may receive unfiltered local paths, possibly leading to RCE. Recorded as [CVE-2018-19296](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2018-19296). See [this article](https://knasmueller.net/5-answers-about-php-phar-exploitation) for more info on this type of vulnerability. Mitigated by blocking the use of paths containing URL-protocol style prefixes such as `phar://`. Reported by Sehun Oh of cyberone.kr. + +PHPMailer versions prior to 5.2.24 (released July 26th 2017) have an XSS vulnerability in one of the code examples, [CVE-2017-11503](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11503). The `code_generator.phps` example did not filter user input prior to output. This file is distributed with a `.phps` extension, so it it not normally executable unless it is explicitly renamed, and the file is not included when PHPMailer is loaded through composer, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project. + +PHPMailer versions prior to 5.2.22 (released January 9th 2017) have a local file disclosure vulnerability, [CVE-2017-5223](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-5223). If content passed into `msgHTML()` is sourced from unfiltered user input, relative paths can map to absolute local file paths and added as attachments. Also note that `addAttachment` (just like `file_get_contents`, `passthru`, `unlink`, etc) should not be passed user-sourced params either! Reported by Yongxiang Li of Asiasecurity. + +PHPMailer versions prior to 5.2.20 (released December 28th 2016) are vulnerable to [CVE-2016-10045](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10045) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10045-Vuln-Patch-Bypass.html), and patched by Paul Buonopane (@Zenexer). + +PHPMailer versions prior to 5.2.18 (released December 2016) are vulnerable to [CVE-2016-10033](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10033) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](http://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html). + +PHPMailer versions prior to 5.2.14 (released November 2015) are vulnerable to [CVE-2015-8476](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-8476) an SMTP CRLF injection bug permitting arbitrary message sending. + +PHPMailer versions prior to 5.2.10 (released May 2015) are vulnerable to [CVE-2008-5619](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2008-5619), a remote code execution vulnerability in the bundled html2text library. This file was removed in 5.2.10, so if you are using a version prior to that and make use of the html2text function, it's vitally important that you upgrade and remove this file. + +PHPMailer versions prior to 2.0.7 and 2.2.1 are vulnerable to [CVE-2012-0796](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-0796), an email header injection attack. + +Joomla 1.6.0 uses PHPMailer in an unsafe way, allowing it to reveal local file paths, reported in [CVE-2011-3747](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-3747). + +PHPMailer didn't sanitise the `$lang_path` parameter in `SetLanguage`. This wasn't a problem in itself, but some apps (PHPClassifieds, ATutor) also failed to sanitise user-provided parameters passed to it, permitting semi-arbitrary local file inclusion, reported in [CVE-2010-4914](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-4914), [CVE-2007-2021](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-2021) and [CVE-2006-5734](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2006-5734). + +PHPMailer 1.7.2 and earlier contained a possible DDoS vulnerability reported in [CVE-2005-1807](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2005-1807). + +PHPMailer 1.7 and earlier (June 2003) have a possible vulnerability in the `SendmailSend` method where shell commands may not be sanitised. Reported in [CVE-2007-3215](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-3215). + diff --git a/vendor/phpmailer/phpmailer/VERSION b/vendor/phpmailer/phpmailer/VERSION new file mode 100644 index 0000000..4be2c72 --- /dev/null +++ b/vendor/phpmailer/phpmailer/VERSION @@ -0,0 +1 @@ +6.5.0 \ No newline at end of file diff --git a/vendor/phpmailer/phpmailer/composer.json b/vendor/phpmailer/phpmailer/composer.json new file mode 100644 index 0000000..560ed66 --- /dev/null +++ b/vendor/phpmailer/phpmailer/composer.json @@ -0,0 +1,65 @@ +{ + "name": "phpmailer/phpmailer", + "type": "library", + "description": "PHPMailer is a full-featured email creation and transfer class for PHP", + "authors": [ + { + "name": "Marcus Bointon", + "email": "phpmailer@synchromedia.co.uk" + }, + { + "name": "Jim Jagielski", + "email": "jimjag@gmail.com" + }, + { + "name": "Andy Prevost", + "email": "codeworxtech@users.sourceforge.net" + }, + { + "name": "Brent R. Matzelle" + } + ], + "funding": [ + { + "url": "https://github.com/Synchro", + "type": "github" + } + ], + "require": { + "php": ">=5.5.0", + "ext-ctype": "*", + "ext-filter": "*", + "ext-hash": "*" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.2", + "phpcompatibility/php-compatibility": "^9.3.5", + "roave/security-advisories": "dev-latest", + "squizlabs/php_codesniffer": "^3.5.6", + "yoast/phpunit-polyfills": "^0.2.0" + }, + "suggest": { + "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", + "league/oauth2-google": "Needed for Google XOAUTH2 authentication", + "psr/log": "For optional PSR-3 debug logging", + "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" + }, + "autoload": { + "psr-4": { + "PHPMailer\\PHPMailer\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "PHPMailer\\Test\\": "test/" + } + }, + "license": "LGPL-2.1-only", + "scripts": { + "check": "./vendor/bin/phpcs", + "test": "./vendor/bin/phpunit" + } +} diff --git a/vendor/phpmailer/phpmailer/get_oauth_token.php b/vendor/phpmailer/phpmailer/get_oauth_token.php new file mode 100644 index 0000000..85dde29 --- /dev/null +++ b/vendor/phpmailer/phpmailer/get_oauth_token.php @@ -0,0 +1,146 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2020 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Get an OAuth2 token from an OAuth2 provider. + * * Install this script on your server so that it's accessible + * as [https/http]:////get_oauth_token.php + * e.g.: http://localhost/phpmailer/get_oauth_token.php + * * Ensure dependencies are installed with 'composer install' + * * Set up an app in your Google/Yahoo/Microsoft account + * * Set the script address as the app's redirect URL + * If no refresh token is obtained when running this file, + * revoke access to your app and run the script again. + */ + +namespace PHPMailer\PHPMailer; + +/** + * Aliases for League Provider Classes + * Make sure you have added these to your composer.json and run `composer install` + * Plenty to choose from here: + * @see http://oauth2-client.thephpleague.com/providers/thirdparty/ + */ +//@see https://github.com/thephpleague/oauth2-google +use League\OAuth2\Client\Provider\Google; +//@see https://packagist.org/packages/hayageek/oauth2-yahoo +use Hayageek\OAuth2\Client\Provider\Yahoo; +//@see https://github.com/stevenmaguire/oauth2-microsoft +use Stevenmaguire\OAuth2\Client\Provider\Microsoft; + +if (!isset($_GET['code']) && !isset($_GET['provider'])) { + ?> + +Select Provider:
+Google
+Yahoo
+Microsoft/Outlook/Hotmail/Live/Office365
+ + + $clientId, + 'clientSecret' => $clientSecret, + 'redirectUri' => $redirectUri, + 'accessType' => 'offline' +]; + +$options = []; +$provider = null; + +switch ($providerName) { + case 'Google': + $provider = new Google($params); + $options = [ + 'scope' => [ + 'https://mail.google.com/' + ] + ]; + break; + case 'Yahoo': + $provider = new Yahoo($params); + break; + case 'Microsoft': + $provider = new Microsoft($params); + $options = [ + 'scope' => [ + 'wl.imap', + 'wl.offline_access' + ] + ]; + break; +} + +if (null === $provider) { + exit('Provider missing'); +} + +if (!isset($_GET['code'])) { + //If we don't have an authorization code then get one + $authUrl = $provider->getAuthorizationUrl($options); + $_SESSION['oauth2state'] = $provider->getState(); + header('Location: ' . $authUrl); + exit; + //Check given state against previously stored one to mitigate CSRF attack +} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { + unset($_SESSION['oauth2state']); + unset($_SESSION['provider']); + exit('Invalid state'); +} else { + unset($_SESSION['provider']); + //Try to get an access token (using the authorization code grant) + $token = $provider->getAccessToken( + 'authorization_code', + [ + 'code' => $_GET['code'] + ] + ); + //Use this to interact with an API on the users behalf + //Use this to get a new access token if the old one expires + echo 'Refresh Token: ', $token->getRefreshToken(); +} diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php new file mode 100644 index 0000000..0b2a72d --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'خطأ SMTP : لا يمكن تأكيد الهوية.'; +$PHPMAILER_LANG['connect_host'] = 'خطأ SMTP: لا يمكن الاتصال بالخادم SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'خطأ SMTP: لم يتم قبول المعلومات .'; +$PHPMAILER_LANG['empty_message'] = 'نص الرسالة فارغ'; +$PHPMAILER_LANG['encoding'] = 'ترميز غير معروف: '; +$PHPMAILER_LANG['execute'] = 'لا يمكن تنفيذ : '; +$PHPMAILER_LANG['file_access'] = 'لا يمكن الوصول للملف: '; +$PHPMAILER_LANG['file_open'] = 'خطأ في الملف: لا يمكن فتحه: '; +$PHPMAILER_LANG['from_failed'] = 'خطأ على مستوى عنوان المرسل : '; +$PHPMAILER_LANG['instantiate'] = 'لا يمكن توفير خدمة البريد.'; +$PHPMAILER_LANG['invalid_address'] = 'الإرسال غير ممكن لأن عنوان البريد الإلكتروني غير صالح: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' برنامج الإرسال غير مدعوم.'; +$PHPMAILER_LANG['provide_address'] = 'يجب توفير عنوان البريد الإلكتروني لمستلم واحد على الأقل.'; +$PHPMAILER_LANG['recipients_failed'] = 'خطأ SMTP: الأخطاء التالية فشل في الارسال لكل من : '; +$PHPMAILER_LANG['signing'] = 'خطأ في التوقيع: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() غير ممكن.'; +$PHPMAILER_LANG['smtp_error'] = 'خطأ على مستوى الخادم SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'لا يمكن تعيين أو إعادة تعيين متغير: '; +$PHPMAILER_LANG['extension_missing'] = 'الإضافة غير موجودة: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php new file mode 100644 index 0000000..552167e --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Greška: Neuspjela prijava.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Greška: Nije moguće spojiti se sa SMTP serverom.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Greška: Podatci nisu prihvaćeni.'; +$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; +$PHPMAILER_LANG['encoding'] = 'Nepoznata kriptografija: '; +$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: '; +$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: '; +$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: '; +$PHPMAILER_LANG['from_failed'] = 'SMTP Greška: Slanje sa navedenih e-mail adresa nije uspjelo: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Greška: Slanje na navedene e-mail adrese nije uspjelo: '; +$PHPMAILER_LANG['instantiate'] = 'Ne mogu pokrenuti mail funkcionalnost.'; +$PHPMAILER_LANG['invalid_address'] = 'E-mail nije poslan. Neispravna e-mail adresa: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nije podržan.'; +$PHPMAILER_LANG['provide_address'] = 'Definišite barem jednu adresu primaoca.'; +$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP server nije uspjelo.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP greška: '; +$PHPMAILER_LANG['variable_set'] = 'Nije moguće postaviti varijablu ili je vratiti nazad: '; +$PHPMAILER_LANG['extension_missing'] = 'Nedostaje ekstenzija: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php new file mode 100644 index 0000000..9e92dda --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Памылка SMTP: памылка ідэнтыфікацыі.'; +$PHPMAILER_LANG['connect_host'] = 'Памылка SMTP: нельга ўстанавіць сувязь з SMTP-серверам.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Памылка SMTP: звесткі непрынятыя.'; +$PHPMAILER_LANG['empty_message'] = 'Пустое паведамленне.'; +$PHPMAILER_LANG['encoding'] = 'Невядомая кадыроўка тэксту: '; +$PHPMAILER_LANG['execute'] = 'Нельга выканаць каманду: '; +$PHPMAILER_LANG['file_access'] = 'Няма доступу да файла: '; +$PHPMAILER_LANG['file_open'] = 'Нельга адкрыць файл: '; +$PHPMAILER_LANG['from_failed'] = 'Няправільны адрас адпраўніка: '; +$PHPMAILER_LANG['instantiate'] = 'Нельга прымяніць функцыю mail().'; +$PHPMAILER_LANG['invalid_address'] = 'Нельга даслаць паведамленне, няправільны email атрымальніка: '; +$PHPMAILER_LANG['provide_address'] = 'Запоўніце, калі ласка, правільны email атрымальніка.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' - паштовы сервер не падтрымліваецца.'; +$PHPMAILER_LANG['recipients_failed'] = 'Памылка SMTP: няправільныя атрымальнікі: '; +$PHPMAILER_LANG['signing'] = 'Памылка подпісу паведамлення: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Памылка сувязі з SMTP-серверам.'; +$PHPMAILER_LANG['smtp_error'] = 'Памылка SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Нельга ўстанавіць або перамяніць значэнне пераменнай: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php new file mode 100644 index 0000000..c41f675 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP грешка: Не може да се удостовери пред сървъра.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: Не може да се свърже с SMTP хоста.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: данните не са приети.'; +$PHPMAILER_LANG['empty_message'] = 'Съдържанието на съобщението е празно'; +$PHPMAILER_LANG['encoding'] = 'Неизвестно кодиране: '; +$PHPMAILER_LANG['execute'] = 'Не може да се изпълни: '; +$PHPMAILER_LANG['file_access'] = 'Няма достъп до файл: '; +$PHPMAILER_LANG['file_open'] = 'Файлова грешка: Не може да се отвори файл: '; +$PHPMAILER_LANG['from_failed'] = 'Следните адреси за подател са невалидни: '; +$PHPMAILER_LANG['instantiate'] = 'Не може да се инстанцира функцията mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Невалиден адрес: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' - пощенски сървър не се поддържа.'; +$PHPMAILER_LANG['provide_address'] = 'Трябва да предоставите поне един email адрес за получател.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP грешка: Следните адреси за Получател са невалидни: '; +$PHPMAILER_LANG['signing'] = 'Грешка при подписване: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP провален connect().'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP сървърна грешка: '; +$PHPMAILER_LANG['variable_set'] = 'Не може да се установи или възстанови променлива: '; +$PHPMAILER_LANG['extension_missing'] = 'Липсва разширение: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php new file mode 100644 index 0000000..3468485 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Error SMTP: No s’ha pogut autenticar.'; +$PHPMAILER_LANG['connect_host'] = 'Error SMTP: No es pot connectar al servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Dades no acceptades.'; +$PHPMAILER_LANG['empty_message'] = 'El cos del missatge està buit.'; +$PHPMAILER_LANG['encoding'] = 'Codificació desconeguda: '; +$PHPMAILER_LANG['execute'] = 'No es pot executar: '; +$PHPMAILER_LANG['file_access'] = 'No es pot accedir a l’arxiu: '; +$PHPMAILER_LANG['file_open'] = 'Error d’Arxiu: No es pot obrir l’arxiu: '; +$PHPMAILER_LANG['from_failed'] = 'La(s) següent(s) adreces de remitent han fallat: '; +$PHPMAILER_LANG['instantiate'] = 'No s’ha pogut crear una instància de la funció Mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Adreça d’email invalida: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no està suportat'; +$PHPMAILER_LANG['provide_address'] = 'S’ha de proveir almenys una adreça d’email com a destinatari.'; +$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Els següents destinataris han fallat: '; +$PHPMAILER_LANG['signing'] = 'Error al signar: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ha fallat el SMTP Connect().'; +$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'No s’ha pogut establir o restablir la variable: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php new file mode 100644 index 0000000..500c952 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:身份验证失败。'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 错误: 不能连接SMTP主机。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误: 数据不可接受。'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = '未知编码:'; +$PHPMAILER_LANG['execute'] = '不能执行: '; +$PHPMAILER_LANG['file_access'] = '不能访问文件:'; +$PHPMAILER_LANG['file_open'] = '文件错误:不能打开文件:'; +$PHPMAILER_LANG['from_failed'] = '下面的发送地址邮件发送失败了: '; +$PHPMAILER_LANG['instantiate'] = '不能实现mail方法。'; +//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' 您所选择的发送邮件的方法并不支持。'; +$PHPMAILER_LANG['provide_address'] = '您必须提供至少一个 收信人的email地址。'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误: 下面的 收件人失败了: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php new file mode 100644 index 0000000..e770a1a --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php @@ -0,0 +1,28 @@ + + * Rewrite and extension of the work by Mikael Stokkebro + * + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Login mislykkedes.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Forbindelse til SMTP serveren kunne ikke oprettes.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data blev ikke accepteret.'; +$PHPMAILER_LANG['empty_message'] = 'Meddelelsen er uden indhold'; +$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: '; +$PHPMAILER_LANG['execute'] = 'Kunne ikke afvikle: '; +$PHPMAILER_LANG['file_access'] = 'Kunne ikke tilgå filen: '; +$PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: '; +$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: '; +$PHPMAILER_LANG['instantiate'] = 'Email funktionen kunne ikke initialiseres.'; +$PHPMAILER_LANG['invalid_address'] = 'Udgyldig adresse: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.'; +$PHPMAILER_LANG['provide_address'] = 'Indtast mindst en modtagers email adresse.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: '; +$PHPMAILER_LANG['signing'] = 'Signeringsfejl: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fejlede.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP server fejl: '; +$PHPMAILER_LANG['variable_set'] = 'Kunne ikke definere eller nulstille variablen: '; +$PHPMAILER_LANG['extension_missing'] = 'Udvidelse mangler: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php new file mode 100644 index 0000000..e7e59d2 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php @@ -0,0 +1,28 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Error SMTP: Imposible autentificar.'; +$PHPMAILER_LANG['connect_host'] = 'Error SMTP: Imposible conectar al servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Datos no aceptados.'; +$PHPMAILER_LANG['empty_message'] = 'El cuerpo del mensaje está vacío.'; +$PHPMAILER_LANG['encoding'] = 'Codificación desconocida: '; +$PHPMAILER_LANG['execute'] = 'Imposible ejecutar: '; +$PHPMAILER_LANG['file_access'] = 'Imposible acceder al archivo: '; +$PHPMAILER_LANG['file_open'] = 'Error de Archivo: Imposible abrir el archivo: '; +$PHPMAILER_LANG['from_failed'] = 'La(s) siguiente(s) direcciones de remitente fallaron: '; +$PHPMAILER_LANG['instantiate'] = 'Imposible crear una instancia de la función Mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Imposible enviar: dirección de email inválido: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.'; +$PHPMAILER_LANG['provide_address'] = 'Debe proporcionar al menos una dirección de email de destino.'; +$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Los siguientes destinos fallaron: '; +$PHPMAILER_LANG['signing'] = 'Error al firmar: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falló.'; +$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'No se pudo configurar la variable: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php new file mode 100644 index 0000000..93addc9 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php @@ -0,0 +1,28 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Viga: Autoriseerimise viga.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Viga: Ei õnnestunud luua ühendust SMTP serveriga.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Viga: Vigased andmed.'; +$PHPMAILER_LANG['empty_message'] = 'Tühi kirja sisu'; +$PHPMAILER_LANG["encoding"] = 'Tundmatu kodeering: '; +$PHPMAILER_LANG['execute'] = 'Tegevus ebaõnnestus: '; +$PHPMAILER_LANG['file_access'] = 'Pole piisavalt õiguseid järgneva faili avamiseks: '; +$PHPMAILER_LANG['file_open'] = 'Faili Viga: Faili avamine ebaõnnestus: '; +$PHPMAILER_LANG['from_failed'] = 'Järgnev saatja e-posti aadress on vigane: '; +$PHPMAILER_LANG['instantiate'] = 'mail funktiooni käivitamine ebaõnnestus.'; +$PHPMAILER_LANG['invalid_address'] = 'Saatmine peatatud, e-posti address vigane: '; +$PHPMAILER_LANG['provide_address'] = 'Te peate määrama vähemalt ühe saaja e-posti aadressi.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' maileri tugi puudub.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Viga: Järgnevate saajate e-posti aadressid on vigased: '; +$PHPMAILER_LANG["signing"] = 'Viga allkirjastamisel: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() ebaõnnestus.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP serveri viga: '; +$PHPMAILER_LANG['variable_set'] = 'Ei õnnestunud määrata või lähtestada muutujat: '; +$PHPMAILER_LANG['extension_missing'] = 'Nõutud laiendus on puudu: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php new file mode 100644 index 0000000..295a47f --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php @@ -0,0 +1,28 @@ + + * @author Mohammad Hossein Mojtahedi + */ + +$PHPMAILER_LANG['authenticate'] = 'خطای SMTP: احراز هویت با شکست مواجه شد.'; +$PHPMAILER_LANG['connect_host'] = 'خطای SMTP: اتصال به سرور SMTP برقرار نشد.'; +$PHPMAILER_LANG['data_not_accepted'] = 'خطای SMTP: داده‌ها نا‌درست هستند.'; +$PHPMAILER_LANG['empty_message'] = 'بخش متن پیام خالی است.'; +$PHPMAILER_LANG['encoding'] = 'کد‌گذاری نا‌شناخته: '; +$PHPMAILER_LANG['execute'] = 'امکان اجرا وجود ندارد: '; +$PHPMAILER_LANG['file_access'] = 'امکان دسترسی به فایل وجود ندارد: '; +$PHPMAILER_LANG['file_open'] = 'خطای File: امکان بازکردن فایل وجود ندارد: '; +$PHPMAILER_LANG['from_failed'] = 'آدرس فرستنده اشتباه است: '; +$PHPMAILER_LANG['instantiate'] = 'امکان معرفی تابع ایمیل وجود ندارد.'; +$PHPMAILER_LANG['invalid_address'] = 'آدرس ایمیل معتبر نیست: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer پشتیبانی نمی‌شود.'; +$PHPMAILER_LANG['provide_address'] = 'باید حداقل یک آدرس گیرنده وارد کنید.'; +$PHPMAILER_LANG['recipients_failed'] = 'خطای SMTP: ارسال به آدرس گیرنده با خطا مواجه شد: '; +$PHPMAILER_LANG['signing'] = 'خطا در امضا: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'خطا در اتصال به SMTP.'; +$PHPMAILER_LANG['smtp_error'] = 'خطا در SMTP Server: '; +$PHPMAILER_LANG['variable_set'] = 'امکان ارسال یا ارسال مجدد متغیر‌ها وجود ندارد: '; +$PHPMAILER_LANG['extension_missing'] = 'افزونه موجود نیست: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php new file mode 100644 index 0000000..243c054 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php @@ -0,0 +1,28 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP feilur: Kundi ikki góðkenna.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP feilur: Kundi ikki knýta samband við SMTP vert.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP feilur: Data ikki góðkent.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Ókend encoding: '; +$PHPMAILER_LANG['execute'] = 'Kundi ikki útføra: '; +$PHPMAILER_LANG['file_access'] = 'Kundi ikki tilganga fílu: '; +$PHPMAILER_LANG['file_open'] = 'Fílu feilur: Kundi ikki opna fílu: '; +$PHPMAILER_LANG['from_failed'] = 'fylgjandi Frá/From adressa miseydnaðist: '; +$PHPMAILER_LANG['instantiate'] = 'Kuni ikki instantiera mail funktión.'; +//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' er ikki supporterað.'; +$PHPMAILER_LANG['provide_address'] = 'Tú skal uppgeva minst móttakara-emailadressu(r).'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Feilur: Fylgjandi móttakarar miseydnaðust: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php new file mode 100644 index 0000000..b57f0ec --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php @@ -0,0 +1,32 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Erro SMTP: Non puido ser autentificado.'; +$PHPMAILER_LANG['connect_host'] = 'Erro SMTP: Non puido conectar co servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Erro SMTP: Datos non aceptados.'; +$PHPMAILER_LANG['empty_message'] = 'Corpo da mensaxe vacía'; +$PHPMAILER_LANG['encoding'] = 'Codificación descoñecida: '; +$PHPMAILER_LANG['execute'] = 'Non puido ser executado: '; +$PHPMAILER_LANG['file_access'] = 'Nob puido acceder ó arquivo: '; +$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: No puido abrir o arquivo: '; +$PHPMAILER_LANG['from_failed'] = 'A(s) seguinte(s) dirección(s) de remitente(s) deron erro: '; +$PHPMAILER_LANG['instantiate'] = 'Non puido crear unha instancia da función Mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Non puido envia-lo correo: dirección de email inválida: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer non está soportado.'; +$PHPMAILER_LANG['provide_address'] = 'Debe engadir polo menos unha dirección de email coma destino.'; +$PHPMAILER_LANG['recipients_failed'] = 'Erro SMTP: Os seguintes destinos fallaron: '; +$PHPMAILER_LANG['signing'] = 'Erro ó firmar: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fallou.'; +$PHPMAILER_LANG['smtp_error'] = 'Erro do servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Non puidemos axustar ou reaxustar a variábel: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php new file mode 100644 index 0000000..b123aa5 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'שגיאת SMTP: פעולת האימות נכשלה.'; +$PHPMAILER_LANG['connect_host'] = 'שגיאת SMTP: לא הצלחתי להתחבר לשרת SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'שגיאת SMTP: מידע לא התקבל.'; +$PHPMAILER_LANG['empty_message'] = 'גוף ההודעה ריק'; +$PHPMAILER_LANG['invalid_address'] = 'כתובת שגויה: '; +$PHPMAILER_LANG['encoding'] = 'קידוד לא מוכר: '; +$PHPMAILER_LANG['execute'] = 'לא הצלחתי להפעיל את: '; +$PHPMAILER_LANG['file_access'] = 'לא ניתן לגשת לקובץ: '; +$PHPMAILER_LANG['file_open'] = 'שגיאת קובץ: לא ניתן לגשת לקובץ: '; +$PHPMAILER_LANG['from_failed'] = 'כתובות הנמענים הבאות נכשלו: '; +$PHPMAILER_LANG['instantiate'] = 'לא הצלחתי להפעיל את פונקציית המייל.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' אינה נתמכת.'; +$PHPMAILER_LANG['provide_address'] = 'חובה לספק לפחות כתובת אחת של מקבל המייל.'; +$PHPMAILER_LANG['recipients_failed'] = 'שגיאת SMTP: הנמענים הבאים נכשלו: '; +$PHPMAILER_LANG['signing'] = 'שגיאת חתימה: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +$PHPMAILER_LANG['smtp_error'] = 'שגיאת שרת SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'לא ניתן לקבוע או לשנות את המשתנה: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php new file mode 100644 index 0000000..d973a35 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। '; +$PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। '; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। '; +$PHPMAILER_LANG['empty_message'] = 'संदेश खाली है। '; +$PHPMAILER_LANG['encoding'] = 'अज्ञात एन्कोडिंग प्रकार। '; +$PHPMAILER_LANG['execute'] = 'आदेश को निष्पादित करने में विफल। '; +$PHPMAILER_LANG['file_access'] = 'फ़ाइल उपलब्ध नहीं है। '; +$PHPMAILER_LANG['file_open'] = 'फ़ाइल त्रुटि: फाइल को खोला नहीं जा सका। '; +$PHPMAILER_LANG['from_failed'] = 'प्रेषक का पता गलत है। '; +$PHPMAILER_LANG['instantiate'] = 'मेल फ़ंक्शन कॉल नहीं कर सकता है।'; +$PHPMAILER_LANG['invalid_address'] = 'पता गलत है। '; +$PHPMAILER_LANG['mailer_not_supported'] = 'मेल सर्वर के साथ काम नहीं करता है। '; +$PHPMAILER_LANG['provide_address'] = 'आपको कम से कम एक प्राप्तकर्ता का ई-मेल पता प्रदान करना होगा।'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP त्रुटि: निम्न प्राप्तकर्ताओं को पते भेजने में विफल। '; +$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि:। '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP का connect () फ़ंक्शन विफल हुआ। '; +$PHPMAILER_LANG['smtp_error'] = 'SMTP सर्वर त्रुटि। '; +$PHPMAILER_LANG['variable_set'] = 'चर को बना या संशोधित नहीं किया जा सकता। '; +$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php new file mode 100644 index 0000000..cacb6c3 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Greška: Neuspjela autentikacija.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Greška: Ne mogu se spojiti na SMTP poslužitelj.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Greška: Podatci nisu prihvaćeni.'; +$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; +$PHPMAILER_LANG['encoding'] = 'Nepoznati encoding: '; +$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: '; +$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: '; +$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: '; +$PHPMAILER_LANG['from_failed'] = 'SMTP Greška: Slanje s navedenih e-mail adresa nije uspjelo: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Greška: Slanje na navedenih e-mail adresa nije uspjelo: '; +$PHPMAILER_LANG['instantiate'] = 'Ne mogu pokrenuti mail funkcionalnost.'; +$PHPMAILER_LANG['invalid_address'] = 'E-mail nije poslan. Neispravna e-mail adresa: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nije podržan.'; +$PHPMAILER_LANG['provide_address'] = 'Definirajte barem jednu adresu primatelja.'; +$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP poslužitelj nije uspjelo.'; +$PHPMAILER_LANG['smtp_error'] = 'Greška SMTP poslužitelja: '; +$PHPMAILER_LANG['variable_set'] = 'Ne mogu postaviti varijablu niti ju vratiti nazad: '; +$PHPMAILER_LANG['extension_missing'] = 'Nedostaje proširenje: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php new file mode 100644 index 0000000..e6b58b0 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP -ի սխալ: չհաջողվեց ստուգել իսկությունը.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP -ի սխալ: չհաջողվեց կապ հաստատել SMTP սերվերի հետ.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP -ի սխալ: տվյալները ընդունված չեն.'; +$PHPMAILER_LANG['empty_message'] = 'Հաղորդագրությունը դատարկ է'; +$PHPMAILER_LANG['encoding'] = 'Կոդավորման անհայտ տեսակ: '; +$PHPMAILER_LANG['execute'] = 'Չհաջողվեց իրականացնել հրամանը: '; +$PHPMAILER_LANG['file_access'] = 'Ֆայլը հասանելի չէ: '; +$PHPMAILER_LANG['file_open'] = 'Ֆայլի սխալ: ֆայլը չհաջողվեց բացել: '; +$PHPMAILER_LANG['from_failed'] = 'Ուղարկողի հետևյալ հասցեն սխալ է: '; +$PHPMAILER_LANG['instantiate'] = 'Հնարավոր չէ կանչել mail ֆունկցիան.'; +$PHPMAILER_LANG['invalid_address'] = 'Հասցեն սխալ է: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' փոստային սերվերի հետ չի աշխատում.'; +$PHPMAILER_LANG['provide_address'] = 'Անհրաժեշտ է տրամադրել գոնե մեկ ստացողի e-mail հասցե.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP -ի սխալ: չի հաջողվել ուղարկել հետևյալ ստացողների հասցեներին: '; +$PHPMAILER_LANG['signing'] = 'Ստորագրման սխալ: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP -ի connect() ֆունկցիան չի հաջողվել'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP սերվերի սխալ: '; +$PHPMAILER_LANG['variable_set'] = 'Չի հաջողվում ստեղծել կամ վերափոխել փոփոխականը: '; +$PHPMAILER_LANG['extension_missing'] = 'Հավելվածը բացակայում է: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php new file mode 100644 index 0000000..212a11f --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php @@ -0,0 +1,31 @@ + + * @author @januridp + * @author Ian Mustafa + */ + +$PHPMAILER_LANG['authenticate'] = 'Kesalahan SMTP: Tidak dapat mengotentikasi.'; +$PHPMAILER_LANG['connect_host'] = 'Kesalahan SMTP: Tidak dapat terhubung ke host SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Kesalahan SMTP: Data tidak diterima.'; +$PHPMAILER_LANG['empty_message'] = 'Isi pesan kosong'; +$PHPMAILER_LANG['encoding'] = 'Pengkodean karakter tidak dikenali: '; +$PHPMAILER_LANG['execute'] = 'Tidak dapat menjalankan proses: '; +$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses berkas: '; +$PHPMAILER_LANG['file_open'] = 'Kesalahan Berkas: Berkas tidak dapat dibuka: '; +$PHPMAILER_LANG['from_failed'] = 'Alamat pengirim berikut mengakibatkan kesalahan: '; +$PHPMAILER_LANG['instantiate'] = 'Tidak dapat menginisialisasi fungsi surel.'; +$PHPMAILER_LANG['invalid_address'] = 'Gagal terkirim, alamat surel tidak sesuai: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Gagal terkirim, entri host tidak sesuai: '; +$PHPMAILER_LANG['invalid_host'] = 'Gagal terkirim, host tidak sesuai: '; +$PHPMAILER_LANG['provide_address'] = 'Harus tersedia minimal satu alamat tujuan'; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer tidak didukung'; +$PHPMAILER_LANG['recipients_failed'] = 'Kesalahan SMTP: Alamat tujuan berikut menyebabkan kesalahan: '; +$PHPMAILER_LANG['signing'] = 'Kesalahan dalam penandatangan SSL: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() gagal.'; +$PHPMAILER_LANG['smtp_error'] = 'Kesalahan pada pelayan SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Tidak dapat mengatur atau mengatur ulang variabel: '; +$PHPMAILER_LANG['extension_missing'] = 'Ekstensi PHP tidak tersedia: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php new file mode 100644 index 0000000..08a6b73 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php @@ -0,0 +1,28 @@ + + * @author Stefano Sabatini + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Impossibile autenticarsi.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Impossibile connettersi all\'host SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Dati non accettati dal server.'; +$PHPMAILER_LANG['empty_message'] = 'Il corpo del messaggio è vuoto'; +$PHPMAILER_LANG['encoding'] = 'Codifica dei caratteri sconosciuta: '; +$PHPMAILER_LANG['execute'] = 'Impossibile eseguire l\'operazione: '; +$PHPMAILER_LANG['file_access'] = 'Impossibile accedere al file: '; +$PHPMAILER_LANG['file_open'] = 'File Error: Impossibile aprire il file: '; +$PHPMAILER_LANG['from_failed'] = 'I seguenti indirizzi mittenti hanno generato errore: '; +$PHPMAILER_LANG['instantiate'] = 'Impossibile istanziare la funzione mail'; +$PHPMAILER_LANG['invalid_address'] = 'Impossibile inviare, l\'indirizzo email non è valido: '; +$PHPMAILER_LANG['provide_address'] = 'Deve essere fornito almeno un indirizzo ricevente'; +$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: I seguenti indirizzi destinatari hanno generato un errore: '; +$PHPMAILER_LANG['signing'] = 'Errore nella firma: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fallita.'; +$PHPMAILER_LANG['smtp_error'] = 'Errore del server SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Impossibile impostare o resettare la variabile: '; +$PHPMAILER_LANG['extension_missing'] = 'Estensione mancante: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php new file mode 100644 index 0000000..eee7989 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php @@ -0,0 +1,28 @@ + + * @author Yoshi Sakai + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。'; +$PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = '不明なエンコーディング: '; +$PHPMAILER_LANG['execute'] = '実行できませんでした: '; +$PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: '; +$PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: '; +$PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録する際にエラーが発生しました: '; +$PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。'; +//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; +$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。'; +$PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php new file mode 100644 index 0000000..51fe403 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP შეცდომა: ავტორიზაცია შეუძლებელია.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP შეცდომა: SMTP სერვერთან დაკავშირება შეუძლებელია.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP შეცდომა: მონაცემები არ იქნა მიღებული.'; +$PHPMAILER_LANG['encoding'] = 'კოდირების უცნობი ტიპი: '; +$PHPMAILER_LANG['execute'] = 'შეუძლებელია შემდეგი ბრძანების შესრულება: '; +$PHPMAILER_LANG['file_access'] = 'შეუძლებელია წვდომა ფაილთან: '; +$PHPMAILER_LANG['file_open'] = 'ფაილური სისტემის შეცდომა: არ იხსნება ფაილი: '; +$PHPMAILER_LANG['from_failed'] = 'გამგზავნის არასწორი მისამართი: '; +$PHPMAILER_LANG['instantiate'] = 'mail ფუნქციის გაშვება ვერ ხერხდება.'; +$PHPMAILER_LANG['provide_address'] = 'გთხოვთ მიუთითოთ ერთი ადრესატის e-mail მისამართი მაინც.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' - საფოსტო სერვერის მხარდაჭერა არ არის.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP შეცდომა: შემდეგ მისამართებზე გაგზავნა ვერ მოხერხდა: '; +$PHPMAILER_LANG['empty_message'] = 'შეტყობინება ცარიელია'; +$PHPMAILER_LANG['invalid_address'] = 'არ გაიგზავნა, e-mail მისამართის არასწორი ფორმატი: '; +$PHPMAILER_LANG['signing'] = 'ხელმოწერის შეცდომა: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'შეცდომა SMTP სერვერთან დაკავშირებისას'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP სერვერის შეცდომა: '; +$PHPMAILER_LANG['variable_set'] = 'შეუძლებელია შემდეგი ცვლადის შექმნა ან შეცვლა: '; +$PHPMAILER_LANG['extension_missing'] = 'ბიბლიოთეკა არ არსებობს: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php new file mode 100644 index 0000000..8c97dd9 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP 오류: 인증할 수 없습니다.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 오류: SMTP 호스트에 접속할 수 없습니다.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 오류: 데이터가 받아들여지지 않았습니다.'; +$PHPMAILER_LANG['empty_message'] = '메세지 내용이 없습니다'; +$PHPMAILER_LANG['encoding'] = '알 수 없는 인코딩: '; +$PHPMAILER_LANG['execute'] = '실행 불가: '; +$PHPMAILER_LANG['file_access'] = '파일 접근 불가: '; +$PHPMAILER_LANG['file_open'] = '파일 오류: 파일을 열 수 없습니다: '; +$PHPMAILER_LANG['from_failed'] = '다음 From 주소에서 오류가 발생했습니다: '; +$PHPMAILER_LANG['instantiate'] = 'mail 함수를 인스턴스화할 수 없습니다'; +$PHPMAILER_LANG['invalid_address'] = '잘못된 주소: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' 메일러는 지원되지 않습니다.'; +$PHPMAILER_LANG['provide_address'] = '적어도 한 개 이상의 수신자 메일 주소를 제공해야 합니다.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 오류: 다음 수신자에서 오류가 발생했습니다: '; +$PHPMAILER_LANG['signing'] = '서명 오류: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP 연결을 실패하였습니다.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP 서버 오류: '; +$PHPMAILER_LANG['variable_set'] = '변수 설정 및 초기화 불가: '; +$PHPMAILER_LANG['extension_missing'] = '확장자 없음: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php new file mode 100644 index 0000000..4f115b1 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP klaida: autentifikacija nepavyko.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP klaida: nepavyksta prisijungti prie SMTP stoties.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP klaida: duomenys nepriimti.'; +$PHPMAILER_LANG['empty_message'] = 'Laiško turinys tuščias'; +$PHPMAILER_LANG['encoding'] = 'Neatpažinta koduotė: '; +$PHPMAILER_LANG['execute'] = 'Nepavyko įvykdyti komandos: '; +$PHPMAILER_LANG['file_access'] = 'Byla nepasiekiama: '; +$PHPMAILER_LANG['file_open'] = 'Bylos klaida: Nepavyksta atidaryti: '; +$PHPMAILER_LANG['from_failed'] = 'Neteisingas siuntėjo adresas: '; +$PHPMAILER_LANG['instantiate'] = 'Nepavyko paleisti mail funkcijos.'; +$PHPMAILER_LANG['invalid_address'] = 'Neteisingas adresas: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' pašto stotis nepalaikoma.'; +$PHPMAILER_LANG['provide_address'] = 'Nurodykite bent vieną gavėjo adresą.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP klaida: nepavyko išsiųsti šiems gavėjams: '; +$PHPMAILER_LANG['signing'] = 'Prisijungimo klaida: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP susijungimo klaida'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP stoties klaida: '; +$PHPMAILER_LANG['variable_set'] = 'Nepavyko priskirti reikšmės kintamajam: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php new file mode 100644 index 0000000..679b18c --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP kļūda: Autorizācija neizdevās.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Kļūda: Nevar izveidot savienojumu ar SMTP serveri.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Kļūda: Nepieņem informāciju.'; +$PHPMAILER_LANG['empty_message'] = 'Ziņojuma teksts ir tukšs'; +$PHPMAILER_LANG['encoding'] = 'Neatpazīts kodējums: '; +$PHPMAILER_LANG['execute'] = 'Neizdevās izpildīt komandu: '; +$PHPMAILER_LANG['file_access'] = 'Fails nav pieejams: '; +$PHPMAILER_LANG['file_open'] = 'Faila kļūda: Nevar atvērt failu: '; +$PHPMAILER_LANG['from_failed'] = 'Nepareiza sūtītāja adrese: '; +$PHPMAILER_LANG['instantiate'] = 'Nevar palaist sūtīšanas funkciju.'; +$PHPMAILER_LANG['invalid_address'] = 'Nepareiza adrese: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' sūtītājs netiek atbalstīts.'; +$PHPMAILER_LANG['provide_address'] = 'Lūdzu, norādiet vismaz vienu adresātu.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP kļūda: neizdevās nosūtīt šādiem saņēmējiem: '; +$PHPMAILER_LANG['signing'] = 'Autorizācijas kļūda: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP savienojuma kļūda'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP servera kļūda: '; +$PHPMAILER_LANG['variable_set'] = 'Nevar piešķirt mainīgā vērtību: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php new file mode 100644 index 0000000..8a94f6a --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Hadisoana SMTP: Tsy nahomby ny fanamarinana.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Tsy afaka mampifandray amin\'ny mpampiantrano SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP diso: tsy voarakitra ny angona.'; +$PHPMAILER_LANG['empty_message'] = 'Tsy misy ny votoaty mailaka.'; +$PHPMAILER_LANG['encoding'] = 'Tsy fantatra encoding: '; +$PHPMAILER_LANG['execute'] = 'Tsy afaka manatanteraka ity baiko manaraka ity: '; +$PHPMAILER_LANG['file_access'] = 'Tsy nahomby ny fidirana amin\'ity rakitra ity: '; +$PHPMAILER_LANG['file_open'] = 'Hadisoana diso: Tsy afaka nanokatra ity file manaraka ity: '; +$PHPMAILER_LANG['from_failed'] = 'Ny adiresy iraka manaraka dia diso: '; +$PHPMAILER_LANG['instantiate'] = 'Tsy afaka nanomboka ny hetsika mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Tsy mety ny adiresy: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer tsy manohana.'; +$PHPMAILER_LANG['provide_address'] = 'Alefaso azafady iray adiresy iray farafahakeliny.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Tsy mety ireo mpanaraka ireto: '; +$PHPMAILER_LANG['signing'] = 'Error nandritra ny sonia:'; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Tsy nahomby ny fifandraisana tamin\'ny server SMTP.'; +$PHPMAILER_LANG['smtp_error'] = 'Fahadisoana tamin\'ny server SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Tsy azo atao ny mametraka na mamerina ny variable: '; +$PHPMAILER_LANG['extension_missing'] = 'Tsy hita ny ampahany: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php new file mode 100644 index 0000000..71db338 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Ralat SMTP: Tidak dapat pengesahan.'; +$PHPMAILER_LANG['connect_host'] = 'Ralat SMTP: Tidak dapat menghubungi hos pelayan SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Ralat SMTP: Data tidak diterima oleh pelayan.'; +$PHPMAILER_LANG['empty_message'] = 'Tiada isi untuk mesej'; +$PHPMAILER_LANG['encoding'] = 'Pengekodan tidak diketahui: '; +$PHPMAILER_LANG['execute'] = 'Tidak dapat melaksanakan: '; +$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses fail: '; +$PHPMAILER_LANG['file_open'] = 'Ralat Fail: Tidak dapat membuka fail: '; +$PHPMAILER_LANG['from_failed'] = 'Berikut merupakan ralat dari alamat e-mel: '; +$PHPMAILER_LANG['instantiate'] = 'Tidak dapat memberi contoh fungsi e-mel.'; +$PHPMAILER_LANG['invalid_address'] = 'Alamat emel tidak sah: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' jenis penghantar emel tidak disokong.'; +$PHPMAILER_LANG['provide_address'] = 'Anda perlu menyediakan sekurang-kurangnya satu alamat e-mel penerima.'; +$PHPMAILER_LANG['recipients_failed'] = 'Ralat SMTP: Penerima e-mel berikut telah gagal: '; +$PHPMAILER_LANG['signing'] = 'Ralat pada tanda tangan: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() telah gagal.'; +$PHPMAILER_LANG['smtp_error'] = 'Ralat pada pelayan SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Tidak boleh menetapkan atau menetapkan semula pembolehubah: '; +$PHPMAILER_LANG['extension_missing'] = 'Sambungan hilang: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php new file mode 100644 index 0000000..65793ce --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP-fout: authenticatie mislukt.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP-fout: kon niet verbinden met SMTP-host.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP-fout: data niet geaccepteerd.'; +$PHPMAILER_LANG['empty_message'] = 'Berichttekst is leeg'; +$PHPMAILER_LANG['encoding'] = 'Onbekende codering: '; +$PHPMAILER_LANG['execute'] = 'Kon niet uitvoeren: '; +$PHPMAILER_LANG['file_access'] = 'Kreeg geen toegang tot bestand: '; +$PHPMAILER_LANG['file_open'] = 'Bestandsfout: kon bestand niet openen: '; +$PHPMAILER_LANG['from_failed'] = 'Het volgende afzendersadres is mislukt: '; +$PHPMAILER_LANG['instantiate'] = 'Kon mailfunctie niet initialiseren.'; +$PHPMAILER_LANG['invalid_address'] = 'Ongeldig adres: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Ongeldige hostentry: '; +$PHPMAILER_LANG['invalid_host'] = 'Ongeldige host: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.'; +$PHPMAILER_LANG['provide_address'] = 'Er moet minstens één ontvanger worden opgegeven.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP-fout: de volgende ontvangers zijn mislukt: '; +$PHPMAILER_LANG['signing'] = 'Signeerfout: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Verbinding mislukt.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfout: '; +$PHPMAILER_LANG['variable_set'] = 'Kan de volgende variabele niet instellen of resetten: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensie afwezig: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php new file mode 100644 index 0000000..23caa71 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Erro do SMTP: Não foi possível realizar a autenticação.'; +$PHPMAILER_LANG['connect_host'] = 'Erro do SMTP: Não foi possível realizar ligação com o servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Erro do SMTP: Os dados foram rejeitados.'; +$PHPMAILER_LANG['empty_message'] = 'A mensagem no e-mail está vazia.'; +$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: '; +$PHPMAILER_LANG['execute'] = 'Não foi possível executar: '; +$PHPMAILER_LANG['file_access'] = 'Não foi possível aceder o ficheiro: '; +$PHPMAILER_LANG['file_open'] = 'Abertura do ficheiro: Não foi possível abrir o ficheiro: '; +$PHPMAILER_LANG['from_failed'] = 'Ocorreram falhas nos endereços dos seguintes remententes: '; +$PHPMAILER_LANG['instantiate'] = 'Não foi possível iniciar uma instância da função mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Não foi enviado nenhum e-mail para o endereço de e-mail inválido: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.'; +$PHPMAILER_LANG['provide_address'] = 'Tem de fornecer pelo menos um endereço como destinatário do e-mail.'; +$PHPMAILER_LANG['recipients_failed'] = 'Erro do SMTP: O endereço do seguinte destinatário falhou: '; +$PHPMAILER_LANG['signing'] = 'Erro ao assinar: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.'; +$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensão em falta: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php new file mode 100644 index 0000000..d863809 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php @@ -0,0 +1,30 @@ + + * @author Lucas Guimarães + * @author Phelipe Alves + * @author Fabio Beneditto + */ + +$PHPMAILER_LANG['authenticate'] = 'Erro de SMTP: Não foi possível autenticar.'; +$PHPMAILER_LANG['connect_host'] = 'Erro de SMTP: Não foi possível conectar ao servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Erro de SMTP: Dados rejeitados.'; +$PHPMAILER_LANG['empty_message'] = 'Mensagem vazia'; +$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: '; +$PHPMAILER_LANG['execute'] = 'Não foi possível executar: '; +$PHPMAILER_LANG['file_access'] = 'Não foi possível acessar o arquivo: '; +$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: Não foi possível abrir o arquivo: '; +$PHPMAILER_LANG['from_failed'] = 'Os seguintes remetentes falharam: '; +$PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Endereço de e-mail inválido: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.'; +$PHPMAILER_LANG['provide_address'] = 'Você deve informar pelo menos um destinatário.'; +$PHPMAILER_LANG['recipients_failed'] = 'Erro de SMTP: Os seguintes destinatários falharam: '; +$PHPMAILER_LANG['signing'] = 'Erro de Assinatura: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.'; +$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensão não existe: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php new file mode 100644 index 0000000..292ec1e --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Autentificarea a eșuat.'; +$PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Conectarea la serverul SMTP a eșuat.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Datele nu au fost acceptate.'; +$PHPMAILER_LANG['empty_message'] = 'Mesajul este gol.'; +$PHPMAILER_LANG['encoding'] = 'Encodare necunoscută: '; +$PHPMAILER_LANG['execute'] = 'Nu se poate executa următoarea comandă: '; +$PHPMAILER_LANG['file_access'] = 'Nu se poate accesa următorul fișier: '; +$PHPMAILER_LANG['file_open'] = 'Eroare fișier: Nu se poate deschide următorul fișier: '; +$PHPMAILER_LANG['from_failed'] = 'Următoarele adrese From au dat eroare: '; +$PHPMAILER_LANG['instantiate'] = 'Funcția mail nu a putut fi inițializată.'; +$PHPMAILER_LANG['invalid_address'] = 'Adresa de email nu este validă: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.'; +$PHPMAILER_LANG['provide_address'] = 'Trebuie să adăugați cel puțin o adresă de email.'; +$PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Următoarele adrese de email au eșuat: '; +$PHPMAILER_LANG['signing'] = 'A aparut o problemă la semnarea emailului. '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Conectarea la serverul SMTP a eșuat.'; +$PHPMAILER_LANG['smtp_error'] = 'Eroare server SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Nu se poate seta/reseta variabila. '; +$PHPMAILER_LANG['extension_missing'] = 'Lipsește extensia: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php new file mode 100644 index 0000000..8c8c5e8 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php @@ -0,0 +1,28 @@ + + * @author Foster Snowhill + */ + +$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.'; +$PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к SMTP-серверу.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.'; +$PHPMAILER_LANG['encoding'] = 'Неизвестная кодировка: '; +$PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: '; +$PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: '; +$PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удаётся открыть файл: '; +$PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: '; +$PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail().'; +$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один email-адрес получателя.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.'; +$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: не удалась отправка таким адресатам: '; +$PHPMAILER_LANG['empty_message'] = 'Пустое сообщение'; +$PHPMAILER_LANG['invalid_address'] = 'Не отправлено из-за неправильного формата email-адреса: '; +$PHPMAILER_LANG['signing'] = 'Ошибка подписи: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером'; +$PHPMAILER_LANG['smtp_error'] = 'Ошибка SMTP-сервера: '; +$PHPMAILER_LANG['variable_set'] = 'Невозможно установить или сбросить переменную: '; +$PHPMAILER_LANG['extension_missing'] = 'Расширение отсутствует: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php new file mode 100644 index 0000000..028f5bc --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php @@ -0,0 +1,30 @@ + + * @author Peter Orlický + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Chyba autentifikácie.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Nebolo možné nadviazať spojenie so SMTP serverom.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Dáta neboli prijaté'; +$PHPMAILER_LANG['empty_message'] = 'Prázdne telo správy.'; +$PHPMAILER_LANG['encoding'] = 'Neznáme kódovanie: '; +$PHPMAILER_LANG['execute'] = 'Nedá sa vykonať: '; +$PHPMAILER_LANG['file_access'] = 'Súbor nebol nájdený: '; +$PHPMAILER_LANG['file_open'] = 'File Error: Súbor sa otvoriť pre čítanie: '; +$PHPMAILER_LANG['from_failed'] = 'Následujúca adresa From je nesprávna: '; +$PHPMAILER_LANG['instantiate'] = 'Nedá sa vytvoriť inštancia emailovej funkcie.'; +$PHPMAILER_LANG['invalid_address'] = 'Neodoslané, emailová adresa je nesprávna: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Záznam hostiteľa je nesprávny: '; +$PHPMAILER_LANG['invalid_host'] = 'Hostiteľ je nesprávny: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' emailový klient nieje podporovaný.'; +$PHPMAILER_LANG['provide_address'] = 'Musíte zadať aspoň jednu emailovú adresu príjemcu.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy príjemcov niesu správne '; +$PHPMAILER_LANG['signing'] = 'Chyba prihlasovania: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() zlyhalo.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP chyba serveru: '; +$PHPMAILER_LANG['variable_set'] = 'Nemožno nastaviť alebo resetovať premennú: '; +$PHPMAILER_LANG['extension_missing'] = 'Chýba rozšírenie: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php new file mode 100644 index 0000000..c437a88 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php @@ -0,0 +1,31 @@ + + * @author Filip Š + * @author Blaž Oražem + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP napaka: Avtentikacija ni uspela.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP napaka: Vzpostavljanje povezave s SMTP gostiteljem ni uspelo.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP napaka: Strežnik zavrača podatke.'; +$PHPMAILER_LANG['empty_message'] = 'E-poštno sporočilo nima vsebine.'; +$PHPMAILER_LANG['encoding'] = 'Nepoznan tip kodiranja: '; +$PHPMAILER_LANG['execute'] = 'Operacija ni uspela: '; +$PHPMAILER_LANG['file_access'] = 'Nimam dostopa do datoteke: '; +$PHPMAILER_LANG['file_open'] = 'Ne morem odpreti datoteke: '; +$PHPMAILER_LANG['from_failed'] = 'Neveljaven e-naslov pošiljatelja: '; +$PHPMAILER_LANG['instantiate'] = 'Ne morem inicializirati mail funkcije.'; +$PHPMAILER_LANG['invalid_address'] = 'E-poštno sporočilo ni bilo poslano. E-naslov je neveljaven: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Neveljaven vnos gostitelja: '; +$PHPMAILER_LANG['invalid_host'] = 'Neveljaven gostitelj: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer ni podprt.'; +$PHPMAILER_LANG['provide_address'] = 'Prosimo, vnesite vsaj enega naslovnika.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP napaka: Sledeči naslovniki so neveljavni: '; +$PHPMAILER_LANG['signing'] = 'Napaka pri podpisovanju: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ne morem vzpostaviti povezave s SMTP strežnikom.'; +$PHPMAILER_LANG['smtp_error'] = 'Napaka SMTP strežnika: '; +$PHPMAILER_LANG['variable_set'] = 'Ne morem nastaviti oz. ponastaviti spremenljivke: '; +$PHPMAILER_LANG['extension_missing'] = 'Manjkajoča razširitev: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php new file mode 100644 index 0000000..0b5280f --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php @@ -0,0 +1,28 @@ + + * @author Miloš Milanović + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP грешка: аутентификација није успела.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: повезивање са SMTP сервером није успело.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: подаци нису прихваћени.'; +$PHPMAILER_LANG['empty_message'] = 'Садржај поруке је празан.'; +$PHPMAILER_LANG['encoding'] = 'Непознато кодирање: '; +$PHPMAILER_LANG['execute'] = 'Није могуће извршити наредбу: '; +$PHPMAILER_LANG['file_access'] = 'Није могуће приступити датотеци: '; +$PHPMAILER_LANG['file_open'] = 'Није могуће отворити датотеку: '; +$PHPMAILER_LANG['from_failed'] = 'SMTP грешка: слање са следећих адреса није успело: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP грешка: слање на следеће адресе није успело: '; +$PHPMAILER_LANG['instantiate'] = 'Није могуће покренути mail функцију.'; +$PHPMAILER_LANG['invalid_address'] = 'Порука није послата. Неисправна адреса: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' мејлер није подржан.'; +$PHPMAILER_LANG['provide_address'] = 'Дефинишите бар једну адресу примаоца.'; +$PHPMAILER_LANG['signing'] = 'Грешка приликом пријаве: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Повезивање са SMTP сервером није успело.'; +$PHPMAILER_LANG['smtp_error'] = 'Грешка SMTP сервера: '; +$PHPMAILER_LANG['variable_set'] = 'Није могуће задати нити ресетовати променљиву: '; +$PHPMAILER_LANG['extension_missing'] = 'Недостаје проширење: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php new file mode 100644 index 0000000..0e98a47 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php @@ -0,0 +1,28 @@ + + * @author Miloš Milanović + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP greška: autentifikacija nije uspela.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP greška: povezivanje sa SMTP serverom nije uspelo.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP greška: podaci nisu prihvaćeni.'; +$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; +$PHPMAILER_LANG['encoding'] = 'Nepoznato kodiranje: '; +$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: '; +$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: '; +$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: '; +$PHPMAILER_LANG['from_failed'] = 'SMTP greška: slanje sa sledećih adresa nije uspelo: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP greška: slanje na sledeće adrese nije uspelo: '; +$PHPMAILER_LANG['instantiate'] = 'Nije moguće pokrenuti mail funkciju.'; +$PHPMAILER_LANG['invalid_address'] = 'Poruka nije poslata. Neispravna adresa: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' majler nije podržan.'; +$PHPMAILER_LANG['provide_address'] = 'Definišite bar jednu adresu primaoca.'; +$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Povezivanje sa SMTP serverom nije uspelo.'; +$PHPMAILER_LANG['smtp_error'] = 'Greška SMTP servera: '; +$PHPMAILER_LANG['variable_set'] = 'Nije moguće zadati niti resetovati promenljivu: '; +$PHPMAILER_LANG['extension_missing'] = 'Nedostaje proširenje: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php new file mode 100644 index 0000000..9872c19 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP fel: Kunde inte autentisera.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP fel: Kunde inte ansluta till SMTP-server.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fel: Data accepterades inte.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Okänt encode-format: '; +$PHPMAILER_LANG['execute'] = 'Kunde inte köra: '; +$PHPMAILER_LANG['file_access'] = 'Ingen åtkomst till fil: '; +$PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: '; +$PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: '; +$PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.'; +$PHPMAILER_LANG['invalid_address'] = 'Felaktig adress: '; +$PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: '; +$PHPMAILER_LANG['signing'] = 'Signeringsfel: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() misslyckades.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP serverfel: '; +$PHPMAILER_LANG['variable_set'] = 'Kunde inte definiera eller återställa variabel: '; +$PHPMAILER_LANG['extension_missing'] = 'Tillägg ej tillgängligt: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php new file mode 100644 index 0000000..d15bed1 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php @@ -0,0 +1,28 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Hindi mapatotohanan.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Hindi makakonekta sa SMTP host.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Ang datos ay hindi naitanggap.'; +$PHPMAILER_LANG['empty_message'] = 'Walang laman ang mensahe'; +$PHPMAILER_LANG['encoding'] = 'Hindi alam ang encoding: '; +$PHPMAILER_LANG['execute'] = 'Hindi maisasagawa: '; +$PHPMAILER_LANG['file_access'] = 'Hindi ma-access ang file: '; +$PHPMAILER_LANG['file_open'] = 'File Error: Hindi mabuksan ang file: '; +$PHPMAILER_LANG['from_failed'] = 'Ang sumusunod na address ay nabigo: '; +$PHPMAILER_LANG['instantiate'] = 'Hindi maisimulan ang instance ng mail function.'; +$PHPMAILER_LANG['invalid_address'] = 'Hindi wasto ang address na naibigay: '; +$PHPMAILER_LANG['mailer_not_supported'] = 'Ang mailer ay hindi suportado.'; +$PHPMAILER_LANG['provide_address'] = 'Kailangan mong magbigay ng kahit isang email address na tatanggap.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Ang mga sumusunod na tatanggap ay nabigo: '; +$PHPMAILER_LANG['signing'] = 'Hindi ma-sign: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ang SMTP connect() ay nabigo.'; +$PHPMAILER_LANG['smtp_error'] = 'Ang server ng SMTP ay nabigo: '; +$PHPMAILER_LANG['variable_set'] = 'Hindi matatakda o ma-reset ang mga variables: '; +$PHPMAILER_LANG['extension_missing'] = 'Nawawala ang extension: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php new file mode 100644 index 0000000..f938f80 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php @@ -0,0 +1,31 @@ + + * @fixed by Boris Yurchenko + */ + +$PHPMAILER_LANG['authenticate'] = 'Помилка SMTP: помилка авторизації.'; +$PHPMAILER_LANG['connect_host'] = 'Помилка SMTP: не вдається під\'єднатися до SMTP-серверу.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Помилка SMTP: дані не прийнято.'; +$PHPMAILER_LANG['encoding'] = 'Невідоме кодування: '; +$PHPMAILER_LANG['execute'] = 'Неможливо виконати команду: '; +$PHPMAILER_LANG['file_access'] = 'Немає доступу до файлу: '; +$PHPMAILER_LANG['file_open'] = 'Помилка файлової системи: не вдається відкрити файл: '; +$PHPMAILER_LANG['from_failed'] = 'Невірна адреса відправника: '; +$PHPMAILER_LANG['instantiate'] = 'Неможливо запустити функцію mail().'; +$PHPMAILER_LANG['provide_address'] = 'Будь ласка, введіть хоча б одну email-адресу отримувача.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' - поштовий сервер не підтримується.'; +$PHPMAILER_LANG['recipients_failed'] = 'Помилка SMTP: не вдалося відправлення для таких отримувачів: '; +$PHPMAILER_LANG['empty_message'] = 'Пусте повідомлення'; +$PHPMAILER_LANG['invalid_address'] = 'Не відправлено через неправильний формат email-адреси: '; +$PHPMAILER_LANG['signing'] = 'Помилка підпису: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Помилка з\'єднання з SMTP-сервером'; +$PHPMAILER_LANG['smtp_error'] = 'Помилка SMTP-сервера: '; +$PHPMAILER_LANG['variable_set'] = 'Неможливо встановити або скинути змінну: '; +$PHPMAILER_LANG['extension_missing'] = 'Розширення відсутнє: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php new file mode 100644 index 0000000..d65576e --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Lỗi SMTP: Không thể xác thực.'; +$PHPMAILER_LANG['connect_host'] = 'Lỗi SMTP: Không thể kết nối máy chủ SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Lỗi SMTP: Dữ liệu không được chấp nhận.'; +$PHPMAILER_LANG['empty_message'] = 'Không có nội dung'; +$PHPMAILER_LANG['encoding'] = 'Mã hóa không xác định: '; +$PHPMAILER_LANG['execute'] = 'Không thực hiện được: '; +$PHPMAILER_LANG['file_access'] = 'Không thể truy cập tệp tin '; +$PHPMAILER_LANG['file_open'] = 'Lỗi Tập tin: Không thể mở tệp tin: '; +$PHPMAILER_LANG['from_failed'] = 'Lỗi địa chỉ gửi đi: '; +$PHPMAILER_LANG['instantiate'] = 'Không dùng được các hàm gửi thư.'; +$PHPMAILER_LANG['invalid_address'] = 'Đại chỉ emai không đúng: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' trình gửi thư không được hỗ trợ.'; +$PHPMAILER_LANG['provide_address'] = 'Bạn phải cung cấp ít nhất một địa chỉ người nhận.'; +$PHPMAILER_LANG['recipients_failed'] = 'Lỗi SMTP: lỗi địa chỉ người nhận: '; +$PHPMAILER_LANG['signing'] = 'Lỗi đăng nhập: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Lỗi kết nối với SMTP'; +$PHPMAILER_LANG['smtp_error'] = 'Lỗi máy chủ smtp '; +$PHPMAILER_LANG['variable_set'] = 'Không thể thiết lập hoặc thiết lập lại biến: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php new file mode 100644 index 0000000..35e4e70 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php @@ -0,0 +1,29 @@ + + * @author Peter Dave Hello <@PeterDaveHello/> + * @author Jason Chiang + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登入失敗。'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連線到 SMTP 主機。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:無法接受的資料。'; +$PHPMAILER_LANG['empty_message'] = '郵件內容為空'; +$PHPMAILER_LANG['encoding'] = '未知編碼: '; +$PHPMAILER_LANG['execute'] = '無法執行:'; +$PHPMAILER_LANG['file_access'] = '無法存取檔案:'; +$PHPMAILER_LANG['file_open'] = '檔案錯誤:無法開啟檔案:'; +$PHPMAILER_LANG['from_failed'] = '發送地址錯誤:'; +$PHPMAILER_LANG['instantiate'] = '未知函數呼叫。'; +$PHPMAILER_LANG['invalid_address'] = '因為電子郵件地址無效,無法傳送: '; +$PHPMAILER_LANG['mailer_not_supported'] = '不支援的發信客戶端。'; +$PHPMAILER_LANG['provide_address'] = '必須提供至少一個收件人地址。'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:以下收件人地址錯誤:'; +$PHPMAILER_LANG['signing'] = '電子簽章錯誤: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP 連線失敗'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP 伺服器錯誤: '; +$PHPMAILER_LANG['variable_set'] = '無法設定或重設變數: '; +$PHPMAILER_LANG['extension_missing'] = '遺失模組 Extension: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php new file mode 100644 index 0000000..728a499 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php @@ -0,0 +1,29 @@ + + * @author young + * @author Teddysun + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数据不被接受。'; +$PHPMAILER_LANG['empty_message'] = '邮件正文为空。'; +$PHPMAILER_LANG['encoding'] = '未知编码:'; +$PHPMAILER_LANG['execute'] = '无法执行:'; +$PHPMAILER_LANG['file_access'] = '无法访问文件:'; +$PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:'; +$PHPMAILER_LANG['from_failed'] = '发送地址错误:'; +$PHPMAILER_LANG['instantiate'] = '未知函数调用。'; +$PHPMAILER_LANG['invalid_address'] = '发送失败,电子邮箱地址是无效的:'; +$PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。'; +$PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:'; +$PHPMAILER_LANG['signing'] = '登录失败:'; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP服务器连接失败。'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP服务器出错:'; +$PHPMAILER_LANG['variable_set'] = '无法设置或重置变量:'; +$PHPMAILER_LANG['extension_missing'] = '丢失模块 Extension:'; diff --git a/vendor/phpmailer/phpmailer/phpunit.xml.dist b/vendor/phpmailer/phpmailer/phpunit.xml.dist new file mode 100644 index 0000000..c68df96 --- /dev/null +++ b/vendor/phpmailer/phpmailer/phpunit.xml.dist @@ -0,0 +1,35 @@ + + + + + ./test/ + + + + + + + + languages + pop3 + + + + + ./src + + + + + + + + diff --git a/vendor/phpmailer/phpmailer/src/Exception.php b/vendor/phpmailer/phpmailer/src/Exception.php new file mode 100644 index 0000000..a50a899 --- /dev/null +++ b/vendor/phpmailer/phpmailer/src/Exception.php @@ -0,0 +1,40 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2020 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * PHPMailer exception handler. + * + * @author Marcus Bointon + */ +class Exception extends \Exception +{ + /** + * Prettify error message output. + * + * @return string + */ + public function errorMessage() + { + return '' . htmlspecialchars($this->getMessage()) . "
\n"; + } +} diff --git a/vendor/phpmailer/phpmailer/src/OAuth.php b/vendor/phpmailer/phpmailer/src/OAuth.php new file mode 100644 index 0000000..c93d0be --- /dev/null +++ b/vendor/phpmailer/phpmailer/src/OAuth.php @@ -0,0 +1,139 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2020 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +use League\OAuth2\Client\Grant\RefreshToken; +use League\OAuth2\Client\Provider\AbstractProvider; +use League\OAuth2\Client\Token\AccessToken; + +/** + * OAuth - OAuth2 authentication wrapper class. + * Uses the oauth2-client package from the League of Extraordinary Packages. + * + * @see http://oauth2-client.thephpleague.com + * + * @author Marcus Bointon (Synchro/coolbru) + */ +class OAuth +{ + /** + * An instance of the League OAuth Client Provider. + * + * @var AbstractProvider + */ + protected $provider; + + /** + * The current OAuth access token. + * + * @var AccessToken + */ + protected $oauthToken; + + /** + * The user's email address, usually used as the login ID + * and also the from address when sending email. + * + * @var string + */ + protected $oauthUserEmail = ''; + + /** + * The client secret, generated in the app definition of the service you're connecting to. + * + * @var string + */ + protected $oauthClientSecret = ''; + + /** + * The client ID, generated in the app definition of the service you're connecting to. + * + * @var string + */ + protected $oauthClientId = ''; + + /** + * The refresh token, used to obtain new AccessTokens. + * + * @var string + */ + protected $oauthRefreshToken = ''; + + /** + * OAuth constructor. + * + * @param array $options Associative array containing + * `provider`, `userName`, `clientSecret`, `clientId` and `refreshToken` elements + */ + public function __construct($options) + { + $this->provider = $options['provider']; + $this->oauthUserEmail = $options['userName']; + $this->oauthClientSecret = $options['clientSecret']; + $this->oauthClientId = $options['clientId']; + $this->oauthRefreshToken = $options['refreshToken']; + } + + /** + * Get a new RefreshToken. + * + * @return RefreshToken + */ + protected function getGrant() + { + return new RefreshToken(); + } + + /** + * Get a new AccessToken. + * + * @return AccessToken + */ + protected function getToken() + { + return $this->provider->getAccessToken( + $this->getGrant(), + ['refresh_token' => $this->oauthRefreshToken] + ); + } + + /** + * Generate a base64-encoded OAuth token. + * + * @return string + */ + public function getOauth64() + { + //Get a new token if it's not available or has expired + if (null === $this->oauthToken || $this->oauthToken->hasExpired()) { + $this->oauthToken = $this->getToken(); + } + + return base64_encode( + 'user=' . + $this->oauthUserEmail . + "\001auth=Bearer " . + $this->oauthToken . + "\001\001" + ); + } +} diff --git a/vendor/phpmailer/phpmailer/src/PHPMailer.php b/vendor/phpmailer/phpmailer/src/PHPMailer.php new file mode 100644 index 0000000..2769e2c --- /dev/null +++ b/vendor/phpmailer/phpmailer/src/PHPMailer.php @@ -0,0 +1,4970 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2020 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * PHPMailer - PHP email creation and transport class. + * + * @author Marcus Bointon (Synchro/coolbru) + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + */ +class PHPMailer +{ + const CHARSET_ASCII = 'us-ascii'; + const CHARSET_ISO88591 = 'iso-8859-1'; + const CHARSET_UTF8 = 'utf-8'; + + const CONTENT_TYPE_PLAINTEXT = 'text/plain'; + const CONTENT_TYPE_TEXT_CALENDAR = 'text/calendar'; + const CONTENT_TYPE_TEXT_HTML = 'text/html'; + const CONTENT_TYPE_MULTIPART_ALTERNATIVE = 'multipart/alternative'; + const CONTENT_TYPE_MULTIPART_MIXED = 'multipart/mixed'; + const CONTENT_TYPE_MULTIPART_RELATED = 'multipart/related'; + + const ENCODING_7BIT = '7bit'; + const ENCODING_8BIT = '8bit'; + const ENCODING_BASE64 = 'base64'; + const ENCODING_BINARY = 'binary'; + const ENCODING_QUOTED_PRINTABLE = 'quoted-printable'; + + const ENCRYPTION_STARTTLS = 'tls'; + const ENCRYPTION_SMTPS = 'ssl'; + + const ICAL_METHOD_REQUEST = 'REQUEST'; + const ICAL_METHOD_PUBLISH = 'PUBLISH'; + const ICAL_METHOD_REPLY = 'REPLY'; + const ICAL_METHOD_ADD = 'ADD'; + const ICAL_METHOD_CANCEL = 'CANCEL'; + const ICAL_METHOD_REFRESH = 'REFRESH'; + const ICAL_METHOD_COUNTER = 'COUNTER'; + const ICAL_METHOD_DECLINECOUNTER = 'DECLINECOUNTER'; + + /** + * Email priority. + * Options: null (default), 1 = High, 3 = Normal, 5 = low. + * When null, the header is not set at all. + * + * @var int|null + */ + public $Priority; + + /** + * The character set of the message. + * + * @var string + */ + public $CharSet = self::CHARSET_ISO88591; + + /** + * The MIME Content-type of the message. + * + * @var string + */ + public $ContentType = self::CONTENT_TYPE_PLAINTEXT; + + /** + * The message encoding. + * Options: "8bit", "7bit", "binary", "base64", and "quoted-printable". + * + * @var string + */ + public $Encoding = self::ENCODING_8BIT; + + /** + * Holds the most recent mailer error message. + * + * @var string + */ + public $ErrorInfo = ''; + + /** + * The From email address for the message. + * + * @var string + */ + public $From = 'root@localhost'; + + /** + * The From name of the message. + * + * @var string + */ + public $FromName = 'Root User'; + + /** + * The envelope sender of the message. + * This will usually be turned into a Return-Path header by the receiver, + * and is the address that bounces will be sent to. + * If not empty, will be passed via `-f` to sendmail or as the 'MAIL FROM' value over SMTP. + * + * @var string + */ + public $Sender = ''; + + /** + * The Subject of the message. + * + * @var string + */ + public $Subject = ''; + + /** + * An HTML or plain text message body. + * If HTML then call isHTML(true). + * + * @var string + */ + public $Body = ''; + + /** + * The plain-text message body. + * This body can be read by mail clients that do not have HTML email + * capability such as mutt & Eudora. + * Clients that can read HTML will view the normal Body. + * + * @var string + */ + public $AltBody = ''; + + /** + * An iCal message part body. + * Only supported in simple alt or alt_inline message types + * To generate iCal event structures, use classes like EasyPeasyICS or iCalcreator. + * + * @see http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/ + * @see http://kigkonsult.se/iCalcreator/ + * + * @var string + */ + public $Ical = ''; + + /** + * Value-array of "method" in Contenttype header "text/calendar" + * + * @var string[] + */ + protected static $IcalMethods = [ + self::ICAL_METHOD_REQUEST, + self::ICAL_METHOD_PUBLISH, + self::ICAL_METHOD_REPLY, + self::ICAL_METHOD_ADD, + self::ICAL_METHOD_CANCEL, + self::ICAL_METHOD_REFRESH, + self::ICAL_METHOD_COUNTER, + self::ICAL_METHOD_DECLINECOUNTER, + ]; + + /** + * The complete compiled MIME message body. + * + * @var string + */ + protected $MIMEBody = ''; + + /** + * The complete compiled MIME message headers. + * + * @var string + */ + protected $MIMEHeader = ''; + + /** + * Extra headers that createHeader() doesn't fold in. + * + * @var string + */ + protected $mailHeader = ''; + + /** + * Word-wrap the message body to this number of chars. + * Set to 0 to not wrap. A useful value here is 78, for RFC2822 section 2.1.1 compliance. + * + * @see static::STD_LINE_LENGTH + * + * @var int + */ + public $WordWrap = 0; + + /** + * Which method to use to send mail. + * Options: "mail", "sendmail", or "smtp". + * + * @var string + */ + public $Mailer = 'mail'; + + /** + * The path to the sendmail program. + * + * @var string + */ + public $Sendmail = '/usr/sbin/sendmail'; + + /** + * Whether mail() uses a fully sendmail-compatible MTA. + * One which supports sendmail's "-oi -f" options. + * + * @var bool + */ + public $UseSendmailOptions = true; + + /** + * The email address that a reading confirmation should be sent to, also known as read receipt. + * + * @var string + */ + public $ConfirmReadingTo = ''; + + /** + * The hostname to use in the Message-ID header and as default HELO string. + * If empty, PHPMailer attempts to find one with, in order, + * $_SERVER['SERVER_NAME'], gethostname(), php_uname('n'), or the value + * 'localhost.localdomain'. + * + * @see PHPMailer::$Helo + * + * @var string + */ + public $Hostname = ''; + + /** + * An ID to be used in the Message-ID header. + * If empty, a unique id will be generated. + * You can set your own, but it must be in the format "", + * as defined in RFC5322 section 3.6.4 or it will be ignored. + * + * @see https://tools.ietf.org/html/rfc5322#section-3.6.4 + * + * @var string + */ + public $MessageID = ''; + + /** + * The message Date to be used in the Date header. + * If empty, the current date will be added. + * + * @var string + */ + public $MessageDate = ''; + + /** + * SMTP hosts. + * Either a single hostname or multiple semicolon-delimited hostnames. + * You can also specify a different port + * for each host by using this format: [hostname:port] + * (e.g. "smtp1.example.com:25;smtp2.example.com"). + * You can also specify encryption type, for example: + * (e.g. "tls://smtp1.example.com:587;ssl://smtp2.example.com:465"). + * Hosts will be tried in order. + * + * @var string + */ + public $Host = 'localhost'; + + /** + * The default SMTP server port. + * + * @var int + */ + public $Port = 25; + + /** + * The SMTP HELO/EHLO name used for the SMTP connection. + * Default is $Hostname. If $Hostname is empty, PHPMailer attempts to find + * one with the same method described above for $Hostname. + * + * @see PHPMailer::$Hostname + * + * @var string + */ + public $Helo = ''; + + /** + * What kind of encryption to use on the SMTP connection. + * Options: '', static::ENCRYPTION_STARTTLS, or static::ENCRYPTION_SMTPS. + * + * @var string + */ + public $SMTPSecure = ''; + + /** + * Whether to enable TLS encryption automatically if a server supports it, + * even if `SMTPSecure` is not set to 'tls'. + * Be aware that in PHP >= 5.6 this requires that the server's certificates are valid. + * + * @var bool + */ + public $SMTPAutoTLS = true; + + /** + * Whether to use SMTP authentication. + * Uses the Username and Password properties. + * + * @see PHPMailer::$Username + * @see PHPMailer::$Password + * + * @var bool + */ + public $SMTPAuth = false; + + /** + * Options array passed to stream_context_create when connecting via SMTP. + * + * @var array + */ + public $SMTPOptions = []; + + /** + * SMTP username. + * + * @var string + */ + public $Username = ''; + + /** + * SMTP password. + * + * @var string + */ + public $Password = ''; + + /** + * SMTP auth type. + * Options are CRAM-MD5, LOGIN, PLAIN, XOAUTH2, attempted in that order if not specified. + * + * @var string + */ + public $AuthType = ''; + + /** + * An instance of the PHPMailer OAuth class. + * + * @var OAuth + */ + protected $oauth; + + /** + * The SMTP server timeout in seconds. + * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2. + * + * @var int + */ + public $Timeout = 300; + + /** + * Comma separated list of DSN notifications + * 'NEVER' under no circumstances a DSN must be returned to the sender. + * If you use NEVER all other notifications will be ignored. + * 'SUCCESS' will notify you when your mail has arrived at its destination. + * 'FAILURE' will arrive if an error occurred during delivery. + * 'DELAY' will notify you if there is an unusual delay in delivery, but the actual + * delivery's outcome (success or failure) is not yet decided. + * + * @see https://tools.ietf.org/html/rfc3461 See section 4.1 for more information about NOTIFY + */ + public $dsn = ''; + + /** + * SMTP class debug output mode. + * Debug output level. + * Options: + * @see SMTP::DEBUG_OFF: No output + * @see SMTP::DEBUG_CLIENT: Client messages + * @see SMTP::DEBUG_SERVER: Client and server messages + * @see SMTP::DEBUG_CONNECTION: As SERVER plus connection status + * @see SMTP::DEBUG_LOWLEVEL: Noisy, low-level data output, rarely needed + * + * @see SMTP::$do_debug + * + * @var int + */ + public $SMTPDebug = 0; + + /** + * How to handle debug output. + * Options: + * * `echo` Output plain-text as-is, appropriate for CLI + * * `html` Output escaped, line breaks converted to `
`, appropriate for browser output + * * `error_log` Output to error log as configured in php.ini + * By default PHPMailer will use `echo` if run from a `cli` or `cli-server` SAPI, `html` otherwise. + * Alternatively, you can provide a callable expecting two params: a message string and the debug level: + * + * ```php + * $mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";}; + * ``` + * + * Alternatively, you can pass in an instance of a PSR-3 compatible logger, though only `debug` + * level output is used: + * + * ```php + * $mail->Debugoutput = new myPsr3Logger; + * ``` + * + * @see SMTP::$Debugoutput + * + * @var string|callable|\Psr\Log\LoggerInterface + */ + public $Debugoutput = 'echo'; + + /** + * Whether to keep the SMTP connection open after each message. + * If this is set to true then the connection will remain open after a send, + * and closing the connection will require an explicit call to smtpClose(). + * It's a good idea to use this if you are sending multiple messages as it reduces overhead. + * See the mailing list example for how to use it. + * + * @var bool + */ + public $SMTPKeepAlive = false; + + /** + * Whether to split multiple to addresses into multiple messages + * or send them all in one message. + * Only supported in `mail` and `sendmail` transports, not in SMTP. + * + * @var bool + * + * @deprecated 6.0.0 PHPMailer isn't a mailing list manager! + */ + public $SingleTo = false; + + /** + * Storage for addresses when SingleTo is enabled. + * + * @var array + */ + protected $SingleToArray = []; + + /** + * Whether to generate VERP addresses on send. + * Only applicable when sending via SMTP. + * + * @see https://en.wikipedia.org/wiki/Variable_envelope_return_path + * @see http://www.postfix.org/VERP_README.html Postfix VERP info + * + * @var bool + */ + public $do_verp = false; + + /** + * Whether to allow sending messages with an empty body. + * + * @var bool + */ + public $AllowEmpty = false; + + /** + * DKIM selector. + * + * @var string + */ + public $DKIM_selector = ''; + + /** + * DKIM Identity. + * Usually the email address used as the source of the email. + * + * @var string + */ + public $DKIM_identity = ''; + + /** + * DKIM passphrase. + * Used if your key is encrypted. + * + * @var string + */ + public $DKIM_passphrase = ''; + + /** + * DKIM signing domain name. + * + * @example 'example.com' + * + * @var string + */ + public $DKIM_domain = ''; + + /** + * DKIM Copy header field values for diagnostic use. + * + * @var bool + */ + public $DKIM_copyHeaderFields = true; + + /** + * DKIM Extra signing headers. + * + * @example ['List-Unsubscribe', 'List-Help'] + * + * @var array + */ + public $DKIM_extraHeaders = []; + + /** + * DKIM private key file path. + * + * @var string + */ + public $DKIM_private = ''; + + /** + * DKIM private key string. + * + * If set, takes precedence over `$DKIM_private`. + * + * @var string + */ + public $DKIM_private_string = ''; + + /** + * Callback Action function name. + * + * The function that handles the result of the send email action. + * It is called out by send() for each email sent. + * + * Value can be any php callable: http://www.php.net/is_callable + * + * Parameters: + * bool $result result of the send action + * array $to email addresses of the recipients + * array $cc cc email addresses + * array $bcc bcc email addresses + * string $subject the subject + * string $body the email body + * string $from email address of sender + * string $extra extra information of possible use + * "smtp_transaction_id' => last smtp transaction id + * + * @var string + */ + public $action_function = ''; + + /** + * What to put in the X-Mailer header. + * Options: An empty string for PHPMailer default, whitespace/null for none, or a string to use. + * + * @var string|null + */ + public $XMailer = ''; + + /** + * Which validator to use by default when validating email addresses. + * May be a callable to inject your own validator, but there are several built-in validators. + * The default validator uses PHP's FILTER_VALIDATE_EMAIL filter_var option. + * + * @see PHPMailer::validateAddress() + * + * @var string|callable + */ + public static $validator = 'php'; + + /** + * An instance of the SMTP sender class. + * + * @var SMTP + */ + protected $smtp; + + /** + * The array of 'to' names and addresses. + * + * @var array + */ + protected $to = []; + + /** + * The array of 'cc' names and addresses. + * + * @var array + */ + protected $cc = []; + + /** + * The array of 'bcc' names and addresses. + * + * @var array + */ + protected $bcc = []; + + /** + * The array of reply-to names and addresses. + * + * @var array + */ + protected $ReplyTo = []; + + /** + * An array of all kinds of addresses. + * Includes all of $to, $cc, $bcc. + * + * @see PHPMailer::$to + * @see PHPMailer::$cc + * @see PHPMailer::$bcc + * + * @var array + */ + protected $all_recipients = []; + + /** + * An array of names and addresses queued for validation. + * In send(), valid and non duplicate entries are moved to $all_recipients + * and one of $to, $cc, or $bcc. + * This array is used only for addresses with IDN. + * + * @see PHPMailer::$to + * @see PHPMailer::$cc + * @see PHPMailer::$bcc + * @see PHPMailer::$all_recipients + * + * @var array + */ + protected $RecipientsQueue = []; + + /** + * An array of reply-to names and addresses queued for validation. + * In send(), valid and non duplicate entries are moved to $ReplyTo. + * This array is used only for addresses with IDN. + * + * @see PHPMailer::$ReplyTo + * + * @var array + */ + protected $ReplyToQueue = []; + + /** + * The array of attachments. + * + * @var array + */ + protected $attachment = []; + + /** + * The array of custom headers. + * + * @var array + */ + protected $CustomHeader = []; + + /** + * The most recent Message-ID (including angular brackets). + * + * @var string + */ + protected $lastMessageID = ''; + + /** + * The message's MIME type. + * + * @var string + */ + protected $message_type = ''; + + /** + * The array of MIME boundary strings. + * + * @var array + */ + protected $boundary = []; + + /** + * The array of available languages. + * + * @var array + */ + protected $language = []; + + /** + * The number of errors encountered. + * + * @var int + */ + protected $error_count = 0; + + /** + * The S/MIME certificate file path. + * + * @var string + */ + protected $sign_cert_file = ''; + + /** + * The S/MIME key file path. + * + * @var string + */ + protected $sign_key_file = ''; + + /** + * The optional S/MIME extra certificates ("CA Chain") file path. + * + * @var string + */ + protected $sign_extracerts_file = ''; + + /** + * The S/MIME password for the key. + * Used only if the key is encrypted. + * + * @var string + */ + protected $sign_key_pass = ''; + + /** + * Whether to throw exceptions for errors. + * + * @var bool + */ + protected $exceptions = false; + + /** + * Unique ID used for message ID and boundaries. + * + * @var string + */ + protected $uniqueid = ''; + + /** + * The PHPMailer Version number. + * + * @var string + */ + const VERSION = '6.5.0'; + + /** + * Error severity: message only, continue processing. + * + * @var int + */ + const STOP_MESSAGE = 0; + + /** + * Error severity: message, likely ok to continue processing. + * + * @var int + */ + const STOP_CONTINUE = 1; + + /** + * Error severity: message, plus full stop, critical error reached. + * + * @var int + */ + const STOP_CRITICAL = 2; + + /** + * The SMTP standard CRLF line break. + * If you want to change line break format, change static::$LE, not this. + */ + const CRLF = "\r\n"; + + /** + * "Folding White Space" a white space string used for line folding. + */ + const FWS = ' '; + + /** + * SMTP RFC standard line ending; Carriage Return, Line Feed. + * + * @var string + */ + protected static $LE = self::CRLF; + + /** + * The maximum line length supported by mail(). + * + * Background: mail() will sometimes corrupt messages + * with headers headers longer than 65 chars, see #818. + * + * @var int + */ + const MAIL_MAX_LINE_LENGTH = 63; + + /** + * The maximum line length allowed by RFC 2822 section 2.1.1. + * + * @var int + */ + const MAX_LINE_LENGTH = 998; + + /** + * The lower maximum line length allowed by RFC 2822 section 2.1.1. + * This length does NOT include the line break + * 76 means that lines will be 77 or 78 chars depending on whether + * the line break format is LF or CRLF; both are valid. + * + * @var int + */ + const STD_LINE_LENGTH = 76; + + /** + * Constructor. + * + * @param bool $exceptions Should we throw external exceptions? + */ + public function __construct($exceptions = null) + { + if (null !== $exceptions) { + $this->exceptions = (bool) $exceptions; + } + //Pick an appropriate debug output format automatically + $this->Debugoutput = (strpos(PHP_SAPI, 'cli') !== false ? 'echo' : 'html'); + } + + /** + * Destructor. + */ + public function __destruct() + { + //Close any open SMTP connection nicely + $this->smtpClose(); + } + + /** + * Call mail() in a safe_mode-aware fashion. + * Also, unless sendmail_path points to sendmail (or something that + * claims to be sendmail), don't pass params (not a perfect fix, + * but it will do). + * + * @param string $to To + * @param string $subject Subject + * @param string $body Message Body + * @param string $header Additional Header(s) + * @param string|null $params Params + * + * @return bool + */ + private function mailPassthru($to, $subject, $body, $header, $params) + { + //Check overloading of mail function to avoid double-encoding + if (ini_get('mbstring.func_overload') & 1) { + $subject = $this->secureHeader($subject); + } else { + $subject = $this->encodeHeader($this->secureHeader($subject)); + } + //Calling mail() with null params breaks + $this->edebug('Sending with mail()'); + $this->edebug('Sendmail path: ' . ini_get('sendmail_path')); + $this->edebug("Envelope sender: {$this->Sender}"); + $this->edebug("To: {$to}"); + $this->edebug("Subject: {$subject}"); + $this->edebug("Headers: {$header}"); + if (!$this->UseSendmailOptions || null === $params) { + $result = @mail($to, $subject, $body, $header); + } else { + $this->edebug("Additional params: {$params}"); + $result = @mail($to, $subject, $body, $header, $params); + } + $this->edebug('Result: ' . ($result ? 'true' : 'false')); + return $result; + } + + /** + * Output debugging info via a user-defined method. + * Only generates output if debug output is enabled. + * + * @see PHPMailer::$Debugoutput + * @see PHPMailer::$SMTPDebug + * + * @param string $str + */ + protected function edebug($str) + { + if ($this->SMTPDebug <= 0) { + return; + } + //Is this a PSR-3 logger? + if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) { + $this->Debugoutput->debug($str); + + return; + } + //Avoid clash with built-in function names + if (is_callable($this->Debugoutput) && !in_array($this->Debugoutput, ['error_log', 'html', 'echo'])) { + call_user_func($this->Debugoutput, $str, $this->SMTPDebug); + + return; + } + switch ($this->Debugoutput) { + case 'error_log': + //Don't output, just log + /** @noinspection ForgottenDebugOutputInspection */ + error_log($str); + break; + case 'html': + //Cleans up output a bit for a better looking, HTML-safe output + echo htmlentities( + preg_replace('/[\r\n]+/', '', $str), + ENT_QUOTES, + 'UTF-8' + ), "
\n"; + break; + case 'echo': + default: + //Normalize line breaks + $str = preg_replace('/\r\n|\r/m', "\n", $str); + echo gmdate('Y-m-d H:i:s'), + "\t", + //Trim trailing space + trim( + //Indent for readability, except for trailing break + str_replace( + "\n", + "\n \t ", + trim($str) + ) + ), + "\n"; + } + } + + /** + * Sets message type to HTML or plain. + * + * @param bool $isHtml True for HTML mode + */ + public function isHTML($isHtml = true) + { + if ($isHtml) { + $this->ContentType = static::CONTENT_TYPE_TEXT_HTML; + } else { + $this->ContentType = static::CONTENT_TYPE_PLAINTEXT; + } + } + + /** + * Send messages using SMTP. + */ + public function isSMTP() + { + $this->Mailer = 'smtp'; + } + + /** + * Send messages using PHP's mail() function. + */ + public function isMail() + { + $this->Mailer = 'mail'; + } + + /** + * Send messages using $Sendmail. + */ + public function isSendmail() + { + $ini_sendmail_path = ini_get('sendmail_path'); + + if (false === stripos($ini_sendmail_path, 'sendmail')) { + $this->Sendmail = '/usr/sbin/sendmail'; + } else { + $this->Sendmail = $ini_sendmail_path; + } + $this->Mailer = 'sendmail'; + } + + /** + * Send messages using qmail. + */ + public function isQmail() + { + $ini_sendmail_path = ini_get('sendmail_path'); + + if (false === stripos($ini_sendmail_path, 'qmail')) { + $this->Sendmail = '/var/qmail/bin/qmail-inject'; + } else { + $this->Sendmail = $ini_sendmail_path; + } + $this->Mailer = 'qmail'; + } + + /** + * Add a "To" address. + * + * @param string $address The email address to send to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + public function addAddress($address, $name = '') + { + return $this->addOrEnqueueAnAddress('to', $address, $name); + } + + /** + * Add a "CC" address. + * + * @param string $address The email address to send to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + public function addCC($address, $name = '') + { + return $this->addOrEnqueueAnAddress('cc', $address, $name); + } + + /** + * Add a "BCC" address. + * + * @param string $address The email address to send to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + public function addBCC($address, $name = '') + { + return $this->addOrEnqueueAnAddress('bcc', $address, $name); + } + + /** + * Add a "Reply-To" address. + * + * @param string $address The email address to reply to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + public function addReplyTo($address, $name = '') + { + return $this->addOrEnqueueAnAddress('Reply-To', $address, $name); + } + + /** + * Add an address to one of the recipient arrays or to the ReplyTo array. Because PHPMailer + * can't validate addresses with an IDN without knowing the PHPMailer::$CharSet (that can still + * be modified after calling this function), addition of such addresses is delayed until send(). + * Addresses that have been added already return false, but do not throw exceptions. + * + * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo' + * @param string $address The email address to send, resp. to reply to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + protected function addOrEnqueueAnAddress($kind, $address, $name) + { + $address = trim($address); + $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim + $pos = strrpos($address, '@'); + if (false === $pos) { + //At-sign is missing. + $error_message = sprintf( + '%s (%s): %s', + $this->lang('invalid_address'), + $kind, + $address + ); + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new Exception($error_message); + } + + return false; + } + $params = [$kind, $address, $name]; + //Enqueue addresses with IDN until we know the PHPMailer::$CharSet. + if (static::idnSupported() && $this->has8bitChars(substr($address, ++$pos))) { + if ('Reply-To' !== $kind) { + if (!array_key_exists($address, $this->RecipientsQueue)) { + $this->RecipientsQueue[$address] = $params; + + return true; + } + } elseif (!array_key_exists($address, $this->ReplyToQueue)) { + $this->ReplyToQueue[$address] = $params; + + return true; + } + + return false; + } + + //Immediately add standard addresses without IDN. + return call_user_func_array([$this, 'addAnAddress'], $params); + } + + /** + * Add an address to one of the recipient arrays or to the ReplyTo array. + * Addresses that have been added already return false, but do not throw exceptions. + * + * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo' + * @param string $address The email address to send, resp. to reply to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + protected function addAnAddress($kind, $address, $name = '') + { + if (!in_array($kind, ['to', 'cc', 'bcc', 'Reply-To'])) { + $error_message = sprintf( + '%s: %s', + $this->lang('Invalid recipient kind'), + $kind + ); + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new Exception($error_message); + } + + return false; + } + if (!static::validateAddress($address)) { + $error_message = sprintf( + '%s (%s): %s', + $this->lang('invalid_address'), + $kind, + $address + ); + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new Exception($error_message); + } + + return false; + } + if ('Reply-To' !== $kind) { + if (!array_key_exists(strtolower($address), $this->all_recipients)) { + $this->{$kind}[] = [$address, $name]; + $this->all_recipients[strtolower($address)] = true; + + return true; + } + } elseif (!array_key_exists(strtolower($address), $this->ReplyTo)) { + $this->ReplyTo[strtolower($address)] = [$address, $name]; + + return true; + } + + return false; + } + + /** + * Parse and validate a string containing one or more RFC822-style comma-separated email addresses + * of the form "display name
" into an array of name/address pairs. + * Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available. + * Note that quotes in the name part are removed. + * + * @see http://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation + * + * @param string $addrstr The address list string + * @param bool $useimap Whether to use the IMAP extension to parse the list + * + * @return array + */ + public static function parseAddresses($addrstr, $useimap = true) + { + $addresses = []; + if ($useimap && function_exists('imap_rfc822_parse_adrlist')) { + //Use this built-in parser if it's available + $list = imap_rfc822_parse_adrlist($addrstr, ''); + foreach ($list as $address) { + if ( + ('.SYNTAX-ERROR.' !== $address->host) && static::validateAddress( + $address->mailbox . '@' . $address->host + ) + ) { + //Decode the name part if it's present and encoded + if ( + property_exists($address, 'personal') && + extension_loaded('mbstring') && + preg_match('/^=\?.*\?=$/', $address->personal) + ) { + $address->personal = mb_decode_mimeheader($address->personal); + } + + $addresses[] = [ + 'name' => (property_exists($address, 'personal') ? $address->personal : ''), + 'address' => $address->mailbox . '@' . $address->host, + ]; + } + } + } else { + //Use this simpler parser + $list = explode(',', $addrstr); + foreach ($list as $address) { + $address = trim($address); + //Is there a separate name part? + if (strpos($address, '<') === false) { + //No separate name, just use the whole thing + if (static::validateAddress($address)) { + $addresses[] = [ + 'name' => '', + 'address' => $address, + ]; + } + } else { + list($name, $email) = explode('<', $address); + $email = trim(str_replace('>', '', $email)); + $name = trim($name); + if (static::validateAddress($email)) { + //If this name is encoded, decode it + if (preg_match('/^=\?.*\?=$/', $name)) { + $name = mb_decode_mimeheader($name); + } + $addresses[] = [ + //Remove any surrounding quotes and spaces from the name + 'name' => trim($name, '\'" '), + 'address' => $email, + ]; + } + } + } + } + + return $addresses; + } + + /** + * Set the From and FromName properties. + * + * @param string $address + * @param string $name + * @param bool $auto Whether to also set the Sender address, defaults to true + * + * @throws Exception + * + * @return bool + */ + public function setFrom($address, $name = '', $auto = true) + { + $address = trim($address); + $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim + //Don't validate now addresses with IDN. Will be done in send(). + $pos = strrpos($address, '@'); + if ( + (false === $pos) + || ((!$this->has8bitChars(substr($address, ++$pos)) || !static::idnSupported()) + && !static::validateAddress($address)) + ) { + $error_message = sprintf( + '%s (From): %s', + $this->lang('invalid_address'), + $address + ); + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new Exception($error_message); + } + + return false; + } + $this->From = $address; + $this->FromName = $name; + if ($auto && empty($this->Sender)) { + $this->Sender = $address; + } + + return true; + } + + /** + * Return the Message-ID header of the last email. + * Technically this is the value from the last time the headers were created, + * but it's also the message ID of the last sent message except in + * pathological cases. + * + * @return string + */ + public function getLastMessageID() + { + return $this->lastMessageID; + } + + /** + * Check that a string looks like an email address. + * Validation patterns supported: + * * `auto` Pick best pattern automatically; + * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0; + * * `pcre` Use old PCRE implementation; + * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL; + * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements. + * * `noregex` Don't use a regex: super fast, really dumb. + * Alternatively you may pass in a callable to inject your own validator, for example: + * + * ```php + * PHPMailer::validateAddress('user@example.com', function($address) { + * return (strpos($address, '@') !== false); + * }); + * ``` + * + * You can also set the PHPMailer::$validator static to a callable, allowing built-in methods to use your validator. + * + * @param string $address The email address to check + * @param string|callable $patternselect Which pattern to use + * + * @return bool + */ + public static function validateAddress($address, $patternselect = null) + { + if (null === $patternselect) { + $patternselect = static::$validator; + } + //Don't allow strings as callables, see SECURITY.md and CVE-2021-3603 + if (is_callable($patternselect) && !is_string($patternselect)) { + return call_user_func($patternselect, $address); + } + //Reject line breaks in addresses; it's valid RFC5322, but not RFC5321 + if (strpos($address, "\n") !== false || strpos($address, "\r") !== false) { + return false; + } + switch ($patternselect) { + case 'pcre': //Kept for BC + case 'pcre8': + /* + * A more complex and more permissive version of the RFC5322 regex on which FILTER_VALIDATE_EMAIL + * is based. + * In addition to the addresses allowed by filter_var, also permits: + * * dotless domains: `a@b` + * * comments: `1234 @ local(blah) .machine .example` + * * quoted elements: `'"test blah"@example.org'` + * * numeric TLDs: `a@b.123` + * * unbracketed IPv4 literals: `a@192.168.0.1` + * * IPv6 literals: 'first.last@[IPv6:a1::]' + * Not all of these will necessarily work for sending! + * + * @see http://squiloople.com/2009/12/20/email-address-validation/ + * @copyright 2009-2010 Michael Rushton + * Feel free to use and redistribute this code. But please keep this copyright notice. + */ + return (bool) preg_match( + '/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)' . + '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)' . + '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)' . + '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*' . + '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' . + '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' . + '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' . + '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' . + '|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD', + $address + ); + case 'html5': + /* + * This is the pattern used in the HTML5 spec for validation of 'email' type form input elements. + * + * @see https://html.spec.whatwg.org/#e-mail-state-(type=email) + */ + return (bool) preg_match( + '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' . + '[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD', + $address + ); + case 'php': + default: + return filter_var($address, FILTER_VALIDATE_EMAIL) !== false; + } + } + + /** + * Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the + * `intl` and `mbstring` PHP extensions. + * + * @return bool `true` if required functions for IDN support are present + */ + public static function idnSupported() + { + return function_exists('idn_to_ascii') && function_exists('mb_convert_encoding'); + } + + /** + * Converts IDN in given email address to its ASCII form, also known as punycode, if possible. + * Important: Address must be passed in same encoding as currently set in PHPMailer::$CharSet. + * This function silently returns unmodified address if: + * - No conversion is necessary (i.e. domain name is not an IDN, or is already in ASCII form) + * - Conversion to punycode is impossible (e.g. required PHP functions are not available) + * or fails for any reason (e.g. domain contains characters not allowed in an IDN). + * + * @see PHPMailer::$CharSet + * + * @param string $address The email address to convert + * + * @return string The encoded address in ASCII form + */ + public function punyencodeAddress($address) + { + //Verify we have required functions, CharSet, and at-sign. + $pos = strrpos($address, '@'); + if ( + !empty($this->CharSet) && + false !== $pos && + static::idnSupported() + ) { + $domain = substr($address, ++$pos); + //Verify CharSet string is a valid one, and domain properly encoded in this CharSet. + if ($this->has8bitChars($domain) && @mb_check_encoding($domain, $this->CharSet)) { + //Convert the domain from whatever charset it's in to UTF-8 + $domain = mb_convert_encoding($domain, self::CHARSET_UTF8, $this->CharSet); + //Ignore IDE complaints about this line - method signature changed in PHP 5.4 + $errorcode = 0; + if (defined('INTL_IDNA_VARIANT_UTS46')) { + //Use the current punycode standard (appeared in PHP 7.2) + $punycode = idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_UTS46); + } elseif (defined('INTL_IDNA_VARIANT_2003')) { + //Fall back to this old, deprecated/removed encoding + $punycode = idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_2003); + } else { + //Fall back to a default we don't know about + $punycode = idn_to_ascii($domain, $errorcode); + } + if (false !== $punycode) { + return substr($address, 0, $pos) . $punycode; + } + } + } + + return $address; + } + + /** + * Create a message and send it. + * Uses the sending method specified by $Mailer. + * + * @throws Exception + * + * @return bool false on error - See the ErrorInfo property for details of the error + */ + public function send() + { + try { + if (!$this->preSend()) { + return false; + } + + return $this->postSend(); + } catch (Exception $exc) { + $this->mailHeader = ''; + $this->setError($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + + return false; + } + } + + /** + * Prepare a message for sending. + * + * @throws Exception + * + * @return bool + */ + public function preSend() + { + if ( + 'smtp' === $this->Mailer + || ('mail' === $this->Mailer && (\PHP_VERSION_ID >= 80000 || stripos(PHP_OS, 'WIN') === 0)) + ) { + //SMTP mandates RFC-compliant line endings + //and it's also used with mail() on Windows + static::setLE(self::CRLF); + } else { + //Maintain backward compatibility with legacy Linux command line mailers + static::setLE(PHP_EOL); + } + //Check for buggy PHP versions that add a header with an incorrect line break + if ( + 'mail' === $this->Mailer + && ((\PHP_VERSION_ID >= 70000 && \PHP_VERSION_ID < 70017) + || (\PHP_VERSION_ID >= 70100 && \PHP_VERSION_ID < 70103)) + && ini_get('mail.add_x_header') === '1' + && stripos(PHP_OS, 'WIN') === 0 + ) { + trigger_error( + 'Your version of PHP is affected by a bug that may result in corrupted messages.' . + ' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in' . + ' your php.ini, switch to MacOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.', + E_USER_WARNING + ); + } + + try { + $this->error_count = 0; //Reset errors + $this->mailHeader = ''; + + //Dequeue recipient and Reply-To addresses with IDN + foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) { + $params[1] = $this->punyencodeAddress($params[1]); + call_user_func_array([$this, 'addAnAddress'], $params); + } + if (count($this->to) + count($this->cc) + count($this->bcc) < 1) { + throw new Exception($this->lang('provide_address'), self::STOP_CRITICAL); + } + + //Validate From, Sender, and ConfirmReadingTo addresses + foreach (['From', 'Sender', 'ConfirmReadingTo'] as $address_kind) { + $this->$address_kind = trim($this->$address_kind); + if (empty($this->$address_kind)) { + continue; + } + $this->$address_kind = $this->punyencodeAddress($this->$address_kind); + if (!static::validateAddress($this->$address_kind)) { + $error_message = sprintf( + '%s (%s): %s', + $this->lang('invalid_address'), + $address_kind, + $this->$address_kind + ); + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new Exception($error_message); + } + + return false; + } + } + + //Set whether the message is multipart/alternative + if ($this->alternativeExists()) { + $this->ContentType = static::CONTENT_TYPE_MULTIPART_ALTERNATIVE; + } + + $this->setMessageType(); + //Refuse to send an empty message unless we are specifically allowing it + if (!$this->AllowEmpty && empty($this->Body)) { + throw new Exception($this->lang('empty_message'), self::STOP_CRITICAL); + } + + //Trim subject consistently + $this->Subject = trim($this->Subject); + //Create body before headers in case body makes changes to headers (e.g. altering transfer encoding) + $this->MIMEHeader = ''; + $this->MIMEBody = $this->createBody(); + //createBody may have added some headers, so retain them + $tempheaders = $this->MIMEHeader; + $this->MIMEHeader = $this->createHeader(); + $this->MIMEHeader .= $tempheaders; + + //To capture the complete message when using mail(), create + //an extra header list which createHeader() doesn't fold in + if ('mail' === $this->Mailer) { + if (count($this->to) > 0) { + $this->mailHeader .= $this->addrAppend('To', $this->to); + } else { + $this->mailHeader .= $this->headerLine('To', 'undisclosed-recipients:;'); + } + $this->mailHeader .= $this->headerLine( + 'Subject', + $this->encodeHeader($this->secureHeader($this->Subject)) + ); + } + + //Sign with DKIM if enabled + if ( + !empty($this->DKIM_domain) + && !empty($this->DKIM_selector) + && (!empty($this->DKIM_private_string) + || (!empty($this->DKIM_private) + && static::isPermittedPath($this->DKIM_private) + && file_exists($this->DKIM_private) + ) + ) + ) { + $header_dkim = $this->DKIM_Add( + $this->MIMEHeader . $this->mailHeader, + $this->encodeHeader($this->secureHeader($this->Subject)), + $this->MIMEBody + ); + $this->MIMEHeader = static::stripTrailingWSP($this->MIMEHeader) . static::$LE . + static::normalizeBreaks($header_dkim) . static::$LE; + } + + return true; + } catch (Exception $exc) { + $this->setError($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + + return false; + } + } + + /** + * Actually send a message via the selected mechanism. + * + * @throws Exception + * + * @return bool + */ + public function postSend() + { + try { + //Choose the mailer and send through it + switch ($this->Mailer) { + case 'sendmail': + case 'qmail': + return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody); + case 'smtp': + return $this->smtpSend($this->MIMEHeader, $this->MIMEBody); + case 'mail': + return $this->mailSend($this->MIMEHeader, $this->MIMEBody); + default: + $sendMethod = $this->Mailer . 'Send'; + if (method_exists($this, $sendMethod)) { + return $this->$sendMethod($this->MIMEHeader, $this->MIMEBody); + } + + return $this->mailSend($this->MIMEHeader, $this->MIMEBody); + } + } catch (Exception $exc) { + if ($this->Mailer === 'smtp' && $this->SMTPKeepAlive == true) { + $this->smtp->reset(); + } + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + } + + return false; + } + + /** + * Send mail using the $Sendmail program. + * + * @see PHPMailer::$Sendmail + * + * @param string $header The message headers + * @param string $body The message body + * + * @throws Exception + * + * @return bool + */ + protected function sendmailSend($header, $body) + { + if ($this->Mailer === 'qmail') { + $this->edebug('Sending with qmail'); + } else { + $this->edebug('Sending with sendmail'); + } + $header = static::stripTrailingWSP($header) . static::$LE . static::$LE; + //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver + //A space after `-f` is optional, but there is a long history of its presence + //causing problems, so we don't use one + //Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html + //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html + //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html + //Example problem: https://www.drupal.org/node/1057954 + if (empty($this->Sender) && !empty(ini_get('sendmail_from'))) { + //PHP config has a sender address we can use + $this->Sender = ini_get('sendmail_from'); + } + //CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. + if (!empty($this->Sender) && static::validateAddress($this->Sender) && self::isShellSafe($this->Sender)) { + if ($this->Mailer === 'qmail') { + $sendmailFmt = '%s -f%s'; + } else { + $sendmailFmt = '%s -oi -f%s -t'; + } + } else { + //allow sendmail to choose a default envelope sender. It may + //seem preferable to force it to use the From header as with + //SMTP, but that introduces new problems (see + //), and + //it has historically worked this way. + $sendmailFmt = '%s -oi -t'; + } + + $sendmail = sprintf($sendmailFmt, escapeshellcmd($this->Sendmail), $this->Sender); + $this->edebug('Sendmail path: ' . $this->Sendmail); + $this->edebug('Sendmail command: ' . $sendmail); + $this->edebug('Envelope sender: ' . $this->Sender); + $this->edebug("Headers: {$header}"); + + if ($this->SingleTo) { + foreach ($this->SingleToArray as $toAddr) { + $mail = @popen($sendmail, 'w'); + if (!$mail) { + throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + $this->edebug("To: {$toAddr}"); + fwrite($mail, 'To: ' . $toAddr . "\n"); + fwrite($mail, $header); + fwrite($mail, $body); + $result = pclose($mail); + $addrinfo = static::parseAddresses($toAddr); + $this->doCallback( + ($result === 0), + [[$addrinfo['address'], $addrinfo['name']]], + $this->cc, + $this->bcc, + $this->Subject, + $body, + $this->From, + [] + ); + $this->edebug("Result: " . ($result === 0 ? 'true' : 'false')); + if (0 !== $result) { + throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + } + } else { + $mail = @popen($sendmail, 'w'); + if (!$mail) { + throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + fwrite($mail, $header); + fwrite($mail, $body); + $result = pclose($mail); + $this->doCallback( + ($result === 0), + $this->to, + $this->cc, + $this->bcc, + $this->Subject, + $body, + $this->From, + [] + ); + $this->edebug("Result: " . ($result === 0 ? 'true' : 'false')); + if (0 !== $result) { + throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + } + + return true; + } + + /** + * Fix CVE-2016-10033 and CVE-2016-10045 by disallowing potentially unsafe shell characters. + * Note that escapeshellarg and escapeshellcmd are inadequate for our purposes, especially on Windows. + * + * @see https://github.com/PHPMailer/PHPMailer/issues/924 CVE-2016-10045 bug report + * + * @param string $string The string to be validated + * + * @return bool + */ + protected static function isShellSafe($string) + { + //Future-proof + if ( + escapeshellcmd($string) !== $string + || !in_array(escapeshellarg($string), ["'$string'", "\"$string\""]) + ) { + return false; + } + + $length = strlen($string); + + for ($i = 0; $i < $length; ++$i) { + $c = $string[$i]; + + //All other characters have a special meaning in at least one common shell, including = and +. + //Full stop (.) has a special meaning in cmd.exe, but its impact should be negligible here. + //Note that this does permit non-Latin alphanumeric characters based on the current locale. + if (!ctype_alnum($c) && strpos('@_-.', $c) === false) { + return false; + } + } + + return true; + } + + /** + * Check whether a file path is of a permitted type. + * Used to reject URLs and phar files from functions that access local file paths, + * such as addAttachment. + * + * @param string $path A relative or absolute path to a file + * + * @return bool + */ + protected static function isPermittedPath($path) + { + //Matches scheme definition from https://tools.ietf.org/html/rfc3986#section-3.1 + return !preg_match('#^[a-z][a-z\d+.-]*://#i', $path); + } + + /** + * Check whether a file path is safe, accessible, and readable. + * + * @param string $path A relative or absolute path to a file + * + * @return bool + */ + protected static function fileIsAccessible($path) + { + if (!static::isPermittedPath($path)) { + return false; + } + $readable = file_exists($path); + //If not a UNC path (expected to start with \\), check read permission, see #2069 + if (strpos($path, '\\\\') !== 0) { + $readable = $readable && is_readable($path); + } + return $readable; + } + + /** + * Send mail using the PHP mail() function. + * + * @see http://www.php.net/manual/en/book.mail.php + * + * @param string $header The message headers + * @param string $body The message body + * + * @throws Exception + * + * @return bool + */ + protected function mailSend($header, $body) + { + $header = static::stripTrailingWSP($header) . static::$LE . static::$LE; + + $toArr = []; + foreach ($this->to as $toaddr) { + $toArr[] = $this->addrFormat($toaddr); + } + $to = implode(', ', $toArr); + + $params = null; + //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver + //A space after `-f` is optional, but there is a long history of its presence + //causing problems, so we don't use one + //Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html + //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html + //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html + //Example problem: https://www.drupal.org/node/1057954 + //CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. + if (empty($this->Sender) && !empty(ini_get('sendmail_from'))) { + //PHP config has a sender address we can use + $this->Sender = ini_get('sendmail_from'); + } + if (!empty($this->Sender) && static::validateAddress($this->Sender)) { + if (self::isShellSafe($this->Sender)) { + $params = sprintf('-f%s', $this->Sender); + } + $old_from = ini_get('sendmail_from'); + ini_set('sendmail_from', $this->Sender); + } + $result = false; + if ($this->SingleTo && count($toArr) > 1) { + foreach ($toArr as $toAddr) { + $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params); + $addrinfo = static::parseAddresses($toAddr); + $this->doCallback( + $result, + [[$addrinfo['address'], $addrinfo['name']]], + $this->cc, + $this->bcc, + $this->Subject, + $body, + $this->From, + [] + ); + } + } else { + $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params); + $this->doCallback($result, $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From, []); + } + if (isset($old_from)) { + ini_set('sendmail_from', $old_from); + } + if (!$result) { + throw new Exception($this->lang('instantiate'), self::STOP_CRITICAL); + } + + return true; + } + + /** + * Get an instance to use for SMTP operations. + * Override this function to load your own SMTP implementation, + * or set one with setSMTPInstance. + * + * @return SMTP + */ + public function getSMTPInstance() + { + if (!is_object($this->smtp)) { + $this->smtp = new SMTP(); + } + + return $this->smtp; + } + + /** + * Provide an instance to use for SMTP operations. + * + * @return SMTP + */ + public function setSMTPInstance(SMTP $smtp) + { + $this->smtp = $smtp; + + return $this->smtp; + } + + /** + * Send mail via SMTP. + * Returns false if there is a bad MAIL FROM, RCPT, or DATA input. + * + * @see PHPMailer::setSMTPInstance() to use a different class. + * + * @uses \PHPMailer\PHPMailer\SMTP + * + * @param string $header The message headers + * @param string $body The message body + * + * @throws Exception + * + * @return bool + */ + protected function smtpSend($header, $body) + { + $header = static::stripTrailingWSP($header) . static::$LE . static::$LE; + $bad_rcpt = []; + if (!$this->smtpConnect($this->SMTPOptions)) { + throw new Exception($this->lang('smtp_connect_failed'), self::STOP_CRITICAL); + } + //Sender already validated in preSend() + if ('' === $this->Sender) { + $smtp_from = $this->From; + } else { + $smtp_from = $this->Sender; + } + if (!$this->smtp->mail($smtp_from)) { + $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError())); + throw new Exception($this->ErrorInfo, self::STOP_CRITICAL); + } + + $callbacks = []; + //Attempt to send to all recipients + foreach ([$this->to, $this->cc, $this->bcc] as $togroup) { + foreach ($togroup as $to) { + if (!$this->smtp->recipient($to[0], $this->dsn)) { + $error = $this->smtp->getError(); + $bad_rcpt[] = ['to' => $to[0], 'error' => $error['detail']]; + $isSent = false; + } else { + $isSent = true; + } + + $callbacks[] = ['issent' => $isSent, 'to' => $to[0], 'name' => $to[1]]; + } + } + + //Only send the DATA command if we have viable recipients + if ((count($this->all_recipients) > count($bad_rcpt)) && !$this->smtp->data($header . $body)) { + throw new Exception($this->lang('data_not_accepted'), self::STOP_CRITICAL); + } + + $smtp_transaction_id = $this->smtp->getLastTransactionID(); + + if ($this->SMTPKeepAlive) { + $this->smtp->reset(); + } else { + $this->smtp->quit(); + $this->smtp->close(); + } + + foreach ($callbacks as $cb) { + $this->doCallback( + $cb['issent'], + [[$cb['to'], $cb['name']]], + [], + [], + $this->Subject, + $body, + $this->From, + ['smtp_transaction_id' => $smtp_transaction_id] + ); + } + + //Create error message for any bad addresses + if (count($bad_rcpt) > 0) { + $errstr = ''; + foreach ($bad_rcpt as $bad) { + $errstr .= $bad['to'] . ': ' . $bad['error']; + } + throw new Exception($this->lang('recipients_failed') . $errstr, self::STOP_CONTINUE); + } + + return true; + } + + /** + * Initiate a connection to an SMTP server. + * Returns false if the operation failed. + * + * @param array $options An array of options compatible with stream_context_create() + * + * @throws Exception + * + * @uses \PHPMailer\PHPMailer\SMTP + * + * @return bool + */ + public function smtpConnect($options = null) + { + if (null === $this->smtp) { + $this->smtp = $this->getSMTPInstance(); + } + + //If no options are provided, use whatever is set in the instance + if (null === $options) { + $options = $this->SMTPOptions; + } + + //Already connected? + if ($this->smtp->connected()) { + return true; + } + + $this->smtp->setTimeout($this->Timeout); + $this->smtp->setDebugLevel($this->SMTPDebug); + $this->smtp->setDebugOutput($this->Debugoutput); + $this->smtp->setVerp($this->do_verp); + $hosts = explode(';', $this->Host); + $lastexception = null; + + foreach ($hosts as $hostentry) { + $hostinfo = []; + if ( + !preg_match( + '/^(?:(ssl|tls):\/\/)?(.+?)(?::(\d+))?$/', + trim($hostentry), + $hostinfo + ) + ) { + $this->edebug($this->lang('invalid_hostentry') . ' ' . trim($hostentry)); + //Not a valid host entry + continue; + } + //$hostinfo[1]: optional ssl or tls prefix + //$hostinfo[2]: the hostname + //$hostinfo[3]: optional port number + //The host string prefix can temporarily override the current setting for SMTPSecure + //If it's not specified, the default value is used + + //Check the host name is a valid name or IP address before trying to use it + if (!static::isValidHost($hostinfo[2])) { + $this->edebug($this->lang('invalid_host') . ' ' . $hostinfo[2]); + continue; + } + $prefix = ''; + $secure = $this->SMTPSecure; + $tls = (static::ENCRYPTION_STARTTLS === $this->SMTPSecure); + if ('ssl' === $hostinfo[1] || ('' === $hostinfo[1] && static::ENCRYPTION_SMTPS === $this->SMTPSecure)) { + $prefix = 'ssl://'; + $tls = false; //Can't have SSL and TLS at the same time + $secure = static::ENCRYPTION_SMTPS; + } elseif ('tls' === $hostinfo[1]) { + $tls = true; + //TLS doesn't use a prefix + $secure = static::ENCRYPTION_STARTTLS; + } + //Do we need the OpenSSL extension? + $sslext = defined('OPENSSL_ALGO_SHA256'); + if (static::ENCRYPTION_STARTTLS === $secure || static::ENCRYPTION_SMTPS === $secure) { + //Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled + if (!$sslext) { + throw new Exception($this->lang('extension_missing') . 'openssl', self::STOP_CRITICAL); + } + } + $host = $hostinfo[2]; + $port = $this->Port; + if ( + array_key_exists(3, $hostinfo) && + is_numeric($hostinfo[3]) && + $hostinfo[3] > 0 && + $hostinfo[3] < 65536 + ) { + $port = (int) $hostinfo[3]; + } + if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) { + try { + if ($this->Helo) { + $hello = $this->Helo; + } else { + $hello = $this->serverHostname(); + } + $this->smtp->hello($hello); + //Automatically enable TLS encryption if: + //* it's not disabled + //* we have openssl extension + //* we are not already using SSL + //* the server offers STARTTLS + if ($this->SMTPAutoTLS && $sslext && 'ssl' !== $secure && $this->smtp->getServerExt('STARTTLS')) { + $tls = true; + } + if ($tls) { + if (!$this->smtp->startTLS()) { + throw new Exception($this->lang('connect_host')); + } + //We must resend EHLO after TLS negotiation + $this->smtp->hello($hello); + } + if ( + $this->SMTPAuth && !$this->smtp->authenticate( + $this->Username, + $this->Password, + $this->AuthType, + $this->oauth + ) + ) { + throw new Exception($this->lang('authenticate')); + } + + return true; + } catch (Exception $exc) { + $lastexception = $exc; + $this->edebug($exc->getMessage()); + //We must have connected, but then failed TLS or Auth, so close connection nicely + $this->smtp->quit(); + } + } + } + //If we get here, all connection attempts have failed, so close connection hard + $this->smtp->close(); + //As we've caught all exceptions, just report whatever the last one was + if ($this->exceptions && null !== $lastexception) { + throw $lastexception; + } + + return false; + } + + /** + * Close the active SMTP session if one exists. + */ + public function smtpClose() + { + if ((null !== $this->smtp) && $this->smtp->connected()) { + $this->smtp->quit(); + $this->smtp->close(); + } + } + + /** + * Set the language for error messages. + * Returns false if it cannot load the language file. + * The default language is English. + * + * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr") + * @param string $lang_path Path to the language file directory, with trailing separator (slash).D + * Do not set this from user input! + * + * @return bool + */ + public function setLanguage($langcode = 'en', $lang_path = '') + { + //Backwards compatibility for renamed language codes + $renamed_langcodes = [ + 'br' => 'pt_br', + 'cz' => 'cs', + 'dk' => 'da', + 'no' => 'nb', + 'se' => 'sv', + 'rs' => 'sr', + 'tg' => 'tl', + 'am' => 'hy', + ]; + + if (array_key_exists($langcode, $renamed_langcodes)) { + $langcode = $renamed_langcodes[$langcode]; + } + + //Define full set of translatable strings in English + $PHPMAILER_LANG = [ + 'authenticate' => 'SMTP Error: Could not authenticate.', + 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', + 'data_not_accepted' => 'SMTP Error: data not accepted.', + 'empty_message' => 'Message body empty', + 'encoding' => 'Unknown encoding: ', + 'execute' => 'Could not execute: ', + 'file_access' => 'Could not access file: ', + 'file_open' => 'File Error: Could not open file: ', + 'from_failed' => 'The following From address failed: ', + 'instantiate' => 'Could not instantiate mail function.', + 'invalid_address' => 'Invalid address: ', + 'invalid_hostentry' => 'Invalid hostentry: ', + 'invalid_host' => 'Invalid host: ', + 'mailer_not_supported' => ' mailer is not supported.', + 'provide_address' => 'You must provide at least one recipient email address.', + 'recipients_failed' => 'SMTP Error: The following recipients failed: ', + 'signing' => 'Signing Error: ', + 'smtp_connect_failed' => 'SMTP connect() failed.', + 'smtp_error' => 'SMTP server error: ', + 'variable_set' => 'Cannot set or reset variable: ', + 'extension_missing' => 'Extension missing: ', + ]; + if (empty($lang_path)) { + //Calculate an absolute path so it can work if CWD is not here + $lang_path = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'language' . DIRECTORY_SEPARATOR; + } + //Validate $langcode + if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) { + $langcode = 'en'; + } + $foundlang = true; + $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php'; + //There is no English translation file + if ('en' !== $langcode) { + //Make sure language file path is readable + if (!static::fileIsAccessible($lang_file)) { + $foundlang = false; + } else { + //$foundlang = include $lang_file; + $lines = file($lang_file); + foreach ($lines as $line) { + //Translation file lines look like this: + //$PHPMAILER_LANG['authenticate'] = 'SMTP-Fehler: Authentifizierung fehlgeschlagen.'; + //These files are parsed as text and not PHP so as to avoid the possibility of code injection + //See https://blog.stevenlevithan.com/archives/match-quoted-string + $matches = []; + if ( + preg_match( + '/^\$PHPMAILER_LANG\[\'([a-z\d_]+)\'\]\s*=\s*(["\'])(.+)*?\2;/', + $line, + $matches + ) && + //Ignore unknown translation keys + array_key_exists($matches[1], $PHPMAILER_LANG) + ) { + //Overwrite language-specific strings so we'll never have missing translation keys. + $PHPMAILER_LANG[$matches[1]] = (string)$matches[3]; + } + } + } + } + $this->language = $PHPMAILER_LANG; + + return $foundlang; //Returns false if language not found + } + + /** + * Get the array of strings for the current language. + * + * @return array + */ + public function getTranslations() + { + return $this->language; + } + + /** + * Create recipient headers. + * + * @param string $type + * @param array $addr An array of recipients, + * where each recipient is a 2-element indexed array with element 0 containing an address + * and element 1 containing a name, like: + * [['joe@example.com', 'Joe User'], ['zoe@example.com', 'Zoe User']] + * + * @return string + */ + public function addrAppend($type, $addr) + { + $addresses = []; + foreach ($addr as $address) { + $addresses[] = $this->addrFormat($address); + } + + return $type . ': ' . implode(', ', $addresses) . static::$LE; + } + + /** + * Format an address for use in a message header. + * + * @param array $addr A 2-element indexed array, element 0 containing an address, element 1 containing a name like + * ['joe@example.com', 'Joe User'] + * + * @return string + */ + public function addrFormat($addr) + { + if (empty($addr[1])) { //No name provided + return $this->secureHeader($addr[0]); + } + + return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase') . + ' <' . $this->secureHeader($addr[0]) . '>'; + } + + /** + * Word-wrap message. + * For use with mailers that do not automatically perform wrapping + * and for quoted-printable encoded messages. + * Original written by philippe. + * + * @param string $message The message to wrap + * @param int $length The line length to wrap to + * @param bool $qp_mode Whether to run in Quoted-Printable mode + * + * @return string + */ + public function wrapText($message, $length, $qp_mode = false) + { + if ($qp_mode) { + $soft_break = sprintf(' =%s', static::$LE); + } else { + $soft_break = static::$LE; + } + //If utf-8 encoding is used, we will need to make sure we don't + //split multibyte characters when we wrap + $is_utf8 = static::CHARSET_UTF8 === strtolower($this->CharSet); + $lelen = strlen(static::$LE); + $crlflen = strlen(static::$LE); + + $message = static::normalizeBreaks($message); + //Remove a trailing line break + if (substr($message, -$lelen) === static::$LE) { + $message = substr($message, 0, -$lelen); + } + + //Split message into lines + $lines = explode(static::$LE, $message); + //Message will be rebuilt in here + $message = ''; + foreach ($lines as $line) { + $words = explode(' ', $line); + $buf = ''; + $firstword = true; + foreach ($words as $word) { + if ($qp_mode && (strlen($word) > $length)) { + $space_left = $length - strlen($buf) - $crlflen; + if (!$firstword) { + if ($space_left > 20) { + $len = $space_left; + if ($is_utf8) { + $len = $this->utf8CharBoundary($word, $len); + } elseif ('=' === substr($word, $len - 1, 1)) { + --$len; + } elseif ('=' === substr($word, $len - 2, 1)) { + $len -= 2; + } + $part = substr($word, 0, $len); + $word = substr($word, $len); + $buf .= ' ' . $part; + $message .= $buf . sprintf('=%s', static::$LE); + } else { + $message .= $buf . $soft_break; + } + $buf = ''; + } + while ($word !== '') { + if ($length <= 0) { + break; + } + $len = $length; + if ($is_utf8) { + $len = $this->utf8CharBoundary($word, $len); + } elseif ('=' === substr($word, $len - 1, 1)) { + --$len; + } elseif ('=' === substr($word, $len - 2, 1)) { + $len -= 2; + } + $part = substr($word, 0, $len); + $word = (string) substr($word, $len); + + if ($word !== '') { + $message .= $part . sprintf('=%s', static::$LE); + } else { + $buf = $part; + } + } + } else { + $buf_o = $buf; + if (!$firstword) { + $buf .= ' '; + } + $buf .= $word; + + if ('' !== $buf_o && strlen($buf) > $length) { + $message .= $buf_o . $soft_break; + $buf = $word; + } + } + $firstword = false; + } + $message .= $buf . static::$LE; + } + + return $message; + } + + /** + * Find the last character boundary prior to $maxLength in a utf-8 + * quoted-printable encoded string. + * Original written by Colin Brown. + * + * @param string $encodedText utf-8 QP text + * @param int $maxLength Find the last character boundary prior to this length + * + * @return int + */ + public function utf8CharBoundary($encodedText, $maxLength) + { + $foundSplitPos = false; + $lookBack = 3; + while (!$foundSplitPos) { + $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack); + $encodedCharPos = strpos($lastChunk, '='); + if (false !== $encodedCharPos) { + //Found start of encoded character byte within $lookBack block. + //Check the encoded byte value (the 2 chars after the '=') + $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2); + $dec = hexdec($hex); + if ($dec < 128) { + //Single byte character. + //If the encoded char was found at pos 0, it will fit + //otherwise reduce maxLength to start of the encoded char + if ($encodedCharPos > 0) { + $maxLength -= $lookBack - $encodedCharPos; + } + $foundSplitPos = true; + } elseif ($dec >= 192) { + //First byte of a multi byte character + //Reduce maxLength to split at start of character + $maxLength -= $lookBack - $encodedCharPos; + $foundSplitPos = true; + } elseif ($dec < 192) { + //Middle byte of a multi byte character, look further back + $lookBack += 3; + } + } else { + //No encoded character found + $foundSplitPos = true; + } + } + + return $maxLength; + } + + /** + * Apply word wrapping to the message body. + * Wraps the message body to the number of chars set in the WordWrap property. + * You should only do this to plain-text bodies as wrapping HTML tags may break them. + * This is called automatically by createBody(), so you don't need to call it yourself. + */ + public function setWordWrap() + { + if ($this->WordWrap < 1) { + return; + } + + switch ($this->message_type) { + case 'alt': + case 'alt_inline': + case 'alt_attach': + case 'alt_inline_attach': + $this->AltBody = $this->wrapText($this->AltBody, $this->WordWrap); + break; + default: + $this->Body = $this->wrapText($this->Body, $this->WordWrap); + break; + } + } + + /** + * Assemble message headers. + * + * @return string The assembled headers + */ + public function createHeader() + { + $result = ''; + + $result .= $this->headerLine('Date', '' === $this->MessageDate ? self::rfcDate() : $this->MessageDate); + + //The To header is created automatically by mail(), so needs to be omitted here + if ('mail' !== $this->Mailer) { + if ($this->SingleTo) { + foreach ($this->to as $toaddr) { + $this->SingleToArray[] = $this->addrFormat($toaddr); + } + } elseif (count($this->to) > 0) { + $result .= $this->addrAppend('To', $this->to); + } elseif (count($this->cc) === 0) { + $result .= $this->headerLine('To', 'undisclosed-recipients:;'); + } + } + $result .= $this->addrAppend('From', [[trim($this->From), $this->FromName]]); + + //sendmail and mail() extract Cc from the header before sending + if (count($this->cc) > 0) { + $result .= $this->addrAppend('Cc', $this->cc); + } + + //sendmail and mail() extract Bcc from the header before sending + if ( + ( + 'sendmail' === $this->Mailer || 'qmail' === $this->Mailer || 'mail' === $this->Mailer + ) + && count($this->bcc) > 0 + ) { + $result .= $this->addrAppend('Bcc', $this->bcc); + } + + if (count($this->ReplyTo) > 0) { + $result .= $this->addrAppend('Reply-To', $this->ReplyTo); + } + + //mail() sets the subject itself + if ('mail' !== $this->Mailer) { + $result .= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader($this->Subject))); + } + + //Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4 + //https://tools.ietf.org/html/rfc5322#section-3.6.4 + if ('' !== $this->MessageID && preg_match('/^<.*@.*>$/', $this->MessageID)) { + $this->lastMessageID = $this->MessageID; + } else { + $this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->serverHostname()); + } + $result .= $this->headerLine('Message-ID', $this->lastMessageID); + if (null !== $this->Priority) { + $result .= $this->headerLine('X-Priority', $this->Priority); + } + if ('' === $this->XMailer) { + $result .= $this->headerLine( + 'X-Mailer', + 'PHPMailer ' . self::VERSION . ' (https://github.com/PHPMailer/PHPMailer)' + ); + } else { + $myXmailer = trim($this->XMailer); + if ($myXmailer) { + $result .= $this->headerLine('X-Mailer', $myXmailer); + } + } + + if ('' !== $this->ConfirmReadingTo) { + $result .= $this->headerLine('Disposition-Notification-To', '<' . $this->ConfirmReadingTo . '>'); + } + + //Add custom headers + foreach ($this->CustomHeader as $header) { + $result .= $this->headerLine( + trim($header[0]), + $this->encodeHeader(trim($header[1])) + ); + } + if (!$this->sign_key_file) { + $result .= $this->headerLine('MIME-Version', '1.0'); + $result .= $this->getMailMIME(); + } + + return $result; + } + + /** + * Get the message MIME type headers. + * + * @return string + */ + public function getMailMIME() + { + $result = ''; + $ismultipart = true; + switch ($this->message_type) { + case 'inline': + $result .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_RELATED . ';'); + $result .= $this->textLine(' boundary="' . $this->boundary[1] . '"'); + break; + case 'attach': + case 'inline_attach': + case 'alt_attach': + case 'alt_inline_attach': + $result .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_MIXED . ';'); + $result .= $this->textLine(' boundary="' . $this->boundary[1] . '"'); + break; + case 'alt': + case 'alt_inline': + $result .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_ALTERNATIVE . ';'); + $result .= $this->textLine(' boundary="' . $this->boundary[1] . '"'); + break; + default: + //Catches case 'plain': and case '': + $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet); + $ismultipart = false; + break; + } + //RFC1341 part 5 says 7bit is assumed if not specified + if (static::ENCODING_7BIT !== $this->Encoding) { + //RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE + if ($ismultipart) { + if (static::ENCODING_8BIT === $this->Encoding) { + $result .= $this->headerLine('Content-Transfer-Encoding', static::ENCODING_8BIT); + } + //The only remaining alternatives are quoted-printable and base64, which are both 7bit compatible + } else { + $result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding); + } + } + + return $result; + } + + /** + * Returns the whole MIME message. + * Includes complete headers and body. + * Only valid post preSend(). + * + * @see PHPMailer::preSend() + * + * @return string + */ + public function getSentMIMEMessage() + { + return static::stripTrailingWSP($this->MIMEHeader . $this->mailHeader) . + static::$LE . static::$LE . $this->MIMEBody; + } + + /** + * Create a unique ID to use for boundaries. + * + * @return string + */ + protected function generateId() + { + $len = 32; //32 bytes = 256 bits + $bytes = ''; + if (function_exists('random_bytes')) { + try { + $bytes = random_bytes($len); + } catch (\Exception $e) { + //Do nothing + } + } elseif (function_exists('openssl_random_pseudo_bytes')) { + /** @noinspection CryptographicallySecureRandomnessInspection */ + $bytes = openssl_random_pseudo_bytes($len); + } + if ($bytes === '') { + //We failed to produce a proper random string, so make do. + //Use a hash to force the length to the same as the other methods + $bytes = hash('sha256', uniqid((string) mt_rand(), true), true); + } + + //We don't care about messing up base64 format here, just want a random string + return str_replace(['=', '+', '/'], '', base64_encode(hash('sha256', $bytes, true))); + } + + /** + * Assemble the message body. + * Returns an empty string on failure. + * + * @throws Exception + * + * @return string The assembled message body + */ + public function createBody() + { + $body = ''; + //Create unique IDs and preset boundaries + $this->uniqueid = $this->generateId(); + $this->boundary[1] = 'b1_' . $this->uniqueid; + $this->boundary[2] = 'b2_' . $this->uniqueid; + $this->boundary[3] = 'b3_' . $this->uniqueid; + + if ($this->sign_key_file) { + $body .= $this->getMailMIME() . static::$LE; + } + + $this->setWordWrap(); + + $bodyEncoding = $this->Encoding; + $bodyCharSet = $this->CharSet; + //Can we do a 7-bit downgrade? + if (static::ENCODING_8BIT === $bodyEncoding && !$this->has8bitChars($this->Body)) { + $bodyEncoding = static::ENCODING_7BIT; + //All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit + $bodyCharSet = static::CHARSET_ASCII; + } + //If lines are too long, and we're not already using an encoding that will shorten them, + //change to quoted-printable transfer encoding for the body part only + if (static::ENCODING_BASE64 !== $this->Encoding && static::hasLineLongerThanMax($this->Body)) { + $bodyEncoding = static::ENCODING_QUOTED_PRINTABLE; + } + + $altBodyEncoding = $this->Encoding; + $altBodyCharSet = $this->CharSet; + //Can we do a 7-bit downgrade? + if (static::ENCODING_8BIT === $altBodyEncoding && !$this->has8bitChars($this->AltBody)) { + $altBodyEncoding = static::ENCODING_7BIT; + //All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit + $altBodyCharSet = static::CHARSET_ASCII; + } + //If lines are too long, and we're not already using an encoding that will shorten them, + //change to quoted-printable transfer encoding for the alt body part only + if (static::ENCODING_BASE64 !== $altBodyEncoding && static::hasLineLongerThanMax($this->AltBody)) { + $altBodyEncoding = static::ENCODING_QUOTED_PRINTABLE; + } + //Use this as a preamble in all multipart message types + $mimepre = 'This is a multi-part message in MIME format.' . static::$LE . static::$LE; + switch ($this->message_type) { + case 'inline': + $body .= $mimepre; + $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= static::$LE; + $body .= $this->attachAll('inline', $this->boundary[1]); + break; + case 'attach': + $body .= $mimepre; + $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= static::$LE; + $body .= $this->attachAll('attachment', $this->boundary[1]); + break; + case 'inline_attach': + $body .= $mimepre; + $body .= $this->textLine('--' . $this->boundary[1]); + $body .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_RELATED . ';'); + $body .= $this->textLine(' boundary="' . $this->boundary[2] . '";'); + $body .= $this->textLine(' type="' . static::CONTENT_TYPE_TEXT_HTML . '"'); + $body .= static::$LE; + $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, '', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= static::$LE; + $body .= $this->attachAll('inline', $this->boundary[2]); + $body .= static::$LE; + $body .= $this->attachAll('attachment', $this->boundary[1]); + break; + case 'alt': + $body .= $mimepre; + $body .= $this->getBoundary( + $this->boundary[1], + $altBodyCharSet, + static::CONTENT_TYPE_PLAINTEXT, + $altBodyEncoding + ); + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); + $body .= static::$LE; + $body .= $this->getBoundary( + $this->boundary[1], + $bodyCharSet, + static::CONTENT_TYPE_TEXT_HTML, + $bodyEncoding + ); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= static::$LE; + if (!empty($this->Ical)) { + $method = static::ICAL_METHOD_REQUEST; + foreach (static::$IcalMethods as $imethod) { + if (stripos($this->Ical, 'METHOD:' . $imethod) !== false) { + $method = $imethod; + break; + } + } + $body .= $this->getBoundary( + $this->boundary[1], + '', + static::CONTENT_TYPE_TEXT_CALENDAR . '; method=' . $method, + '' + ); + $body .= $this->encodeString($this->Ical, $this->Encoding); + $body .= static::$LE; + } + $body .= $this->endBoundary($this->boundary[1]); + break; + case 'alt_inline': + $body .= $mimepre; + $body .= $this->getBoundary( + $this->boundary[1], + $altBodyCharSet, + static::CONTENT_TYPE_PLAINTEXT, + $altBodyEncoding + ); + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); + $body .= static::$LE; + $body .= $this->textLine('--' . $this->boundary[1]); + $body .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_RELATED . ';'); + $body .= $this->textLine(' boundary="' . $this->boundary[2] . '";'); + $body .= $this->textLine(' type="' . static::CONTENT_TYPE_TEXT_HTML . '"'); + $body .= static::$LE; + $body .= $this->getBoundary( + $this->boundary[2], + $bodyCharSet, + static::CONTENT_TYPE_TEXT_HTML, + $bodyEncoding + ); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= static::$LE; + $body .= $this->attachAll('inline', $this->boundary[2]); + $body .= static::$LE; + $body .= $this->endBoundary($this->boundary[1]); + break; + case 'alt_attach': + $body .= $mimepre; + $body .= $this->textLine('--' . $this->boundary[1]); + $body .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_ALTERNATIVE . ';'); + $body .= $this->textLine(' boundary="' . $this->boundary[2] . '"'); + $body .= static::$LE; + $body .= $this->getBoundary( + $this->boundary[2], + $altBodyCharSet, + static::CONTENT_TYPE_PLAINTEXT, + $altBodyEncoding + ); + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); + $body .= static::$LE; + $body .= $this->getBoundary( + $this->boundary[2], + $bodyCharSet, + static::CONTENT_TYPE_TEXT_HTML, + $bodyEncoding + ); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= static::$LE; + if (!empty($this->Ical)) { + $method = static::ICAL_METHOD_REQUEST; + foreach (static::$IcalMethods as $imethod) { + if (stripos($this->Ical, 'METHOD:' . $imethod) !== false) { + $method = $imethod; + break; + } + } + $body .= $this->getBoundary( + $this->boundary[2], + '', + static::CONTENT_TYPE_TEXT_CALENDAR . '; method=' . $method, + '' + ); + $body .= $this->encodeString($this->Ical, $this->Encoding); + } + $body .= $this->endBoundary($this->boundary[2]); + $body .= static::$LE; + $body .= $this->attachAll('attachment', $this->boundary[1]); + break; + case 'alt_inline_attach': + $body .= $mimepre; + $body .= $this->textLine('--' . $this->boundary[1]); + $body .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_ALTERNATIVE . ';'); + $body .= $this->textLine(' boundary="' . $this->boundary[2] . '"'); + $body .= static::$LE; + $body .= $this->getBoundary( + $this->boundary[2], + $altBodyCharSet, + static::CONTENT_TYPE_PLAINTEXT, + $altBodyEncoding + ); + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); + $body .= static::$LE; + $body .= $this->textLine('--' . $this->boundary[2]); + $body .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_RELATED . ';'); + $body .= $this->textLine(' boundary="' . $this->boundary[3] . '";'); + $body .= $this->textLine(' type="' . static::CONTENT_TYPE_TEXT_HTML . '"'); + $body .= static::$LE; + $body .= $this->getBoundary( + $this->boundary[3], + $bodyCharSet, + static::CONTENT_TYPE_TEXT_HTML, + $bodyEncoding + ); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= static::$LE; + $body .= $this->attachAll('inline', $this->boundary[3]); + $body .= static::$LE; + $body .= $this->endBoundary($this->boundary[2]); + $body .= static::$LE; + $body .= $this->attachAll('attachment', $this->boundary[1]); + break; + default: + //Catch case 'plain' and case '', applies to simple `text/plain` and `text/html` body content types + //Reset the `Encoding` property in case we changed it for line length reasons + $this->Encoding = $bodyEncoding; + $body .= $this->encodeString($this->Body, $this->Encoding); + break; + } + + if ($this->isError()) { + $body = ''; + if ($this->exceptions) { + throw new Exception($this->lang('empty_message'), self::STOP_CRITICAL); + } + } elseif ($this->sign_key_file) { + try { + if (!defined('PKCS7_TEXT')) { + throw new Exception($this->lang('extension_missing') . 'openssl'); + } + + $file = tempnam(sys_get_temp_dir(), 'srcsign'); + $signed = tempnam(sys_get_temp_dir(), 'mailsign'); + file_put_contents($file, $body); + + //Workaround for PHP bug https://bugs.php.net/bug.php?id=69197 + if (empty($this->sign_extracerts_file)) { + $sign = @openssl_pkcs7_sign( + $file, + $signed, + 'file://' . realpath($this->sign_cert_file), + ['file://' . realpath($this->sign_key_file), $this->sign_key_pass], + [] + ); + } else { + $sign = @openssl_pkcs7_sign( + $file, + $signed, + 'file://' . realpath($this->sign_cert_file), + ['file://' . realpath($this->sign_key_file), $this->sign_key_pass], + [], + PKCS7_DETACHED, + $this->sign_extracerts_file + ); + } + + @unlink($file); + if ($sign) { + $body = file_get_contents($signed); + @unlink($signed); + //The message returned by openssl contains both headers and body, so need to split them up + $parts = explode("\n\n", $body, 2); + $this->MIMEHeader .= $parts[0] . static::$LE . static::$LE; + $body = $parts[1]; + } else { + @unlink($signed); + throw new Exception($this->lang('signing') . openssl_error_string()); + } + } catch (Exception $exc) { + $body = ''; + if ($this->exceptions) { + throw $exc; + } + } + } + + return $body; + } + + /** + * Return the start of a message boundary. + * + * @param string $boundary + * @param string $charSet + * @param string $contentType + * @param string $encoding + * + * @return string + */ + protected function getBoundary($boundary, $charSet, $contentType, $encoding) + { + $result = ''; + if ('' === $charSet) { + $charSet = $this->CharSet; + } + if ('' === $contentType) { + $contentType = $this->ContentType; + } + if ('' === $encoding) { + $encoding = $this->Encoding; + } + $result .= $this->textLine('--' . $boundary); + $result .= sprintf('Content-Type: %s; charset=%s', $contentType, $charSet); + $result .= static::$LE; + //RFC1341 part 5 says 7bit is assumed if not specified + if (static::ENCODING_7BIT !== $encoding) { + $result .= $this->headerLine('Content-Transfer-Encoding', $encoding); + } + $result .= static::$LE; + + return $result; + } + + /** + * Return the end of a message boundary. + * + * @param string $boundary + * + * @return string + */ + protected function endBoundary($boundary) + { + return static::$LE . '--' . $boundary . '--' . static::$LE; + } + + /** + * Set the message type. + * PHPMailer only supports some preset message types, not arbitrary MIME structures. + */ + protected function setMessageType() + { + $type = []; + if ($this->alternativeExists()) { + $type[] = 'alt'; + } + if ($this->inlineImageExists()) { + $type[] = 'inline'; + } + if ($this->attachmentExists()) { + $type[] = 'attach'; + } + $this->message_type = implode('_', $type); + if ('' === $this->message_type) { + //The 'plain' message_type refers to the message having a single body element, not that it is plain-text + $this->message_type = 'plain'; + } + } + + /** + * Format a header line. + * + * @param string $name + * @param string|int $value + * + * @return string + */ + public function headerLine($name, $value) + { + return $name . ': ' . $value . static::$LE; + } + + /** + * Return a formatted mail line. + * + * @param string $value + * + * @return string + */ + public function textLine($value) + { + return $value . static::$LE; + } + + /** + * Add an attachment from a path on the filesystem. + * Never use a user-supplied path to a file! + * Returns false if the file could not be found or read. + * Explicitly *does not* support passing URLs; PHPMailer is not an HTTP client. + * If you need to do that, fetch the resource yourself and pass it in via a local file or string. + * + * @param string $path Path to the attachment + * @param string $name Overrides the attachment name + * @param string $encoding File encoding (see $Encoding) + * @param string $type MIME type, e.g. `image/jpeg`; determined automatically from $path if not specified + * @param string $disposition Disposition to use + * + * @throws Exception + * + * @return bool + */ + public function addAttachment( + $path, + $name = '', + $encoding = self::ENCODING_BASE64, + $type = '', + $disposition = 'attachment' + ) { + try { + if (!static::fileIsAccessible($path)) { + throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE); + } + + //If a MIME type is not specified, try to work it out from the file name + if ('' === $type) { + $type = static::filenameToType($path); + } + + $filename = (string) static::mb_pathinfo($path, PATHINFO_BASENAME); + if ('' === $name) { + $name = $filename; + } + if (!$this->validateEncoding($encoding)) { + throw new Exception($this->lang('encoding') . $encoding); + } + + $this->attachment[] = [ + 0 => $path, + 1 => $filename, + 2 => $name, + 3 => $encoding, + 4 => $type, + 5 => false, //isStringAttachment + 6 => $disposition, + 7 => $name, + ]; + } catch (Exception $exc) { + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + + return false; + } + + return true; + } + + /** + * Return the array of attachments. + * + * @return array + */ + public function getAttachments() + { + return $this->attachment; + } + + /** + * Attach all file, string, and binary attachments to the message. + * Returns an empty string on failure. + * + * @param string $disposition_type + * @param string $boundary + * + * @throws Exception + * + * @return string + */ + protected function attachAll($disposition_type, $boundary) + { + //Return text of body + $mime = []; + $cidUniq = []; + $incl = []; + + //Add all attachments + foreach ($this->attachment as $attachment) { + //Check if it is a valid disposition_filter + if ($attachment[6] === $disposition_type) { + //Check for string attachment + $string = ''; + $path = ''; + $bString = $attachment[5]; + if ($bString) { + $string = $attachment[0]; + } else { + $path = $attachment[0]; + } + + $inclhash = hash('sha256', serialize($attachment)); + if (in_array($inclhash, $incl, true)) { + continue; + } + $incl[] = $inclhash; + $name = $attachment[2]; + $encoding = $attachment[3]; + $type = $attachment[4]; + $disposition = $attachment[6]; + $cid = $attachment[7]; + if ('inline' === $disposition && array_key_exists($cid, $cidUniq)) { + continue; + } + $cidUniq[$cid] = true; + + $mime[] = sprintf('--%s%s', $boundary, static::$LE); + //Only include a filename property if we have one + if (!empty($name)) { + $mime[] = sprintf( + 'Content-Type: %s; name=%s%s', + $type, + static::quotedString($this->encodeHeader($this->secureHeader($name))), + static::$LE + ); + } else { + $mime[] = sprintf( + 'Content-Type: %s%s', + $type, + static::$LE + ); + } + //RFC1341 part 5 says 7bit is assumed if not specified + if (static::ENCODING_7BIT !== $encoding) { + $mime[] = sprintf('Content-Transfer-Encoding: %s%s', $encoding, static::$LE); + } + + //Only set Content-IDs on inline attachments + if ((string) $cid !== '' && $disposition === 'inline') { + $mime[] = 'Content-ID: <' . $this->encodeHeader($this->secureHeader($cid)) . '>' . static::$LE; + } + + //Allow for bypassing the Content-Disposition header + if (!empty($disposition)) { + $encoded_name = $this->encodeHeader($this->secureHeader($name)); + if (!empty($encoded_name)) { + $mime[] = sprintf( + 'Content-Disposition: %s; filename=%s%s', + $disposition, + static::quotedString($encoded_name), + static::$LE . static::$LE + ); + } else { + $mime[] = sprintf( + 'Content-Disposition: %s%s', + $disposition, + static::$LE . static::$LE + ); + } + } else { + $mime[] = static::$LE; + } + + //Encode as string attachment + if ($bString) { + $mime[] = $this->encodeString($string, $encoding); + } else { + $mime[] = $this->encodeFile($path, $encoding); + } + if ($this->isError()) { + return ''; + } + $mime[] = static::$LE; + } + } + + $mime[] = sprintf('--%s--%s', $boundary, static::$LE); + + return implode('', $mime); + } + + /** + * Encode a file attachment in requested format. + * Returns an empty string on failure. + * + * @param string $path The full path to the file + * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' + * + * @return string + */ + protected function encodeFile($path, $encoding = self::ENCODING_BASE64) + { + try { + if (!static::fileIsAccessible($path)) { + throw new Exception($this->lang('file_open') . $path, self::STOP_CONTINUE); + } + $file_buffer = file_get_contents($path); + if (false === $file_buffer) { + throw new Exception($this->lang('file_open') . $path, self::STOP_CONTINUE); + } + $file_buffer = $this->encodeString($file_buffer, $encoding); + + return $file_buffer; + } catch (Exception $exc) { + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + + return ''; + } + } + + /** + * Encode a string in requested format. + * Returns an empty string on failure. + * + * @param string $str The text to encode + * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' + * + * @throws Exception + * + * @return string + */ + public function encodeString($str, $encoding = self::ENCODING_BASE64) + { + $encoded = ''; + switch (strtolower($encoding)) { + case static::ENCODING_BASE64: + $encoded = chunk_split( + base64_encode($str), + static::STD_LINE_LENGTH, + static::$LE + ); + break; + case static::ENCODING_7BIT: + case static::ENCODING_8BIT: + $encoded = static::normalizeBreaks($str); + //Make sure it ends with a line break + if (substr($encoded, -(strlen(static::$LE))) !== static::$LE) { + $encoded .= static::$LE; + } + break; + case static::ENCODING_BINARY: + $encoded = $str; + break; + case static::ENCODING_QUOTED_PRINTABLE: + $encoded = $this->encodeQP($str); + break; + default: + $this->setError($this->lang('encoding') . $encoding); + if ($this->exceptions) { + throw new Exception($this->lang('encoding') . $encoding); + } + break; + } + + return $encoded; + } + + /** + * Encode a header value (not including its label) optimally. + * Picks shortest of Q, B, or none. Result includes folding if needed. + * See RFC822 definitions for phrase, comment and text positions. + * + * @param string $str The header value to encode + * @param string $position What context the string will be used in + * + * @return string + */ + public function encodeHeader($str, $position = 'text') + { + $matchcount = 0; + switch (strtolower($position)) { + case 'phrase': + if (!preg_match('/[\200-\377]/', $str)) { + //Can't use addslashes as we don't know the value of magic_quotes_sybase + $encoded = addcslashes($str, "\0..\37\177\\\""); + if (($str === $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { + return $encoded; + } + + return "\"$encoded\""; + } + $matchcount = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); + break; + /* @noinspection PhpMissingBreakStatementInspection */ + case 'comment': + $matchcount = preg_match_all('/[()"]/', $str, $matches); + //fallthrough + case 'text': + default: + $matchcount += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); + break; + } + + if ($this->has8bitChars($str)) { + $charset = $this->CharSet; + } else { + $charset = static::CHARSET_ASCII; + } + + //Q/B encoding adds 8 chars and the charset ("` =??[QB]??=`"). + $overhead = 8 + strlen($charset); + + if ('mail' === $this->Mailer) { + $maxlen = static::MAIL_MAX_LINE_LENGTH - $overhead; + } else { + $maxlen = static::MAX_LINE_LENGTH - $overhead; + } + + //Select the encoding that produces the shortest output and/or prevents corruption. + if ($matchcount > strlen($str) / 3) { + //More than 1/3 of the content needs encoding, use B-encode. + $encoding = 'B'; + } elseif ($matchcount > 0) { + //Less than 1/3 of the content needs encoding, use Q-encode. + $encoding = 'Q'; + } elseif (strlen($str) > $maxlen) { + //No encoding needed, but value exceeds max line length, use Q-encode to prevent corruption. + $encoding = 'Q'; + } else { + //No reformatting needed + $encoding = false; + } + + switch ($encoding) { + case 'B': + if ($this->hasMultiBytes($str)) { + //Use a custom function which correctly encodes and wraps long + //multibyte strings without breaking lines within a character + $encoded = $this->base64EncodeWrapMB($str, "\n"); + } else { + $encoded = base64_encode($str); + $maxlen -= $maxlen % 4; + $encoded = trim(chunk_split($encoded, $maxlen, "\n")); + } + $encoded = preg_replace('/^(.*)$/m', ' =?' . $charset . "?$encoding?\\1?=", $encoded); + break; + case 'Q': + $encoded = $this->encodeQ($str, $position); + $encoded = $this->wrapText($encoded, $maxlen, true); + $encoded = str_replace('=' . static::$LE, "\n", trim($encoded)); + $encoded = preg_replace('/^(.*)$/m', ' =?' . $charset . "?$encoding?\\1?=", $encoded); + break; + default: + return $str; + } + + return trim(static::normalizeBreaks($encoded)); + } + + /** + * Check if a string contains multi-byte characters. + * + * @param string $str multi-byte text to wrap encode + * + * @return bool + */ + public function hasMultiBytes($str) + { + if (function_exists('mb_strlen')) { + return strlen($str) > mb_strlen($str, $this->CharSet); + } + + //Assume no multibytes (we can't handle without mbstring functions anyway) + return false; + } + + /** + * Does a string contain any 8-bit chars (in any charset)? + * + * @param string $text + * + * @return bool + */ + public function has8bitChars($text) + { + return (bool) preg_match('/[\x80-\xFF]/', $text); + } + + /** + * Encode and wrap long multibyte strings for mail headers + * without breaking lines within a character. + * Adapted from a function by paravoid. + * + * @see http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283 + * + * @param string $str multi-byte text to wrap encode + * @param string $linebreak string to use as linefeed/end-of-line + * + * @return string + */ + public function base64EncodeWrapMB($str, $linebreak = null) + { + $start = '=?' . $this->CharSet . '?B?'; + $end = '?='; + $encoded = ''; + if (null === $linebreak) { + $linebreak = static::$LE; + } + + $mb_length = mb_strlen($str, $this->CharSet); + //Each line must have length <= 75, including $start and $end + $length = 75 - strlen($start) - strlen($end); + //Average multi-byte ratio + $ratio = $mb_length / strlen($str); + //Base64 has a 4:3 ratio + $avgLength = floor($length * $ratio * .75); + + $offset = 0; + for ($i = 0; $i < $mb_length; $i += $offset) { + $lookBack = 0; + do { + $offset = $avgLength - $lookBack; + $chunk = mb_substr($str, $i, $offset, $this->CharSet); + $chunk = base64_encode($chunk); + ++$lookBack; + } while (strlen($chunk) > $length); + $encoded .= $chunk . $linebreak; + } + + //Chomp the last linefeed + return substr($encoded, 0, -strlen($linebreak)); + } + + /** + * Encode a string in quoted-printable format. + * According to RFC2045 section 6.7. + * + * @param string $string The text to encode + * + * @return string + */ + public function encodeQP($string) + { + return static::normalizeBreaks(quoted_printable_encode($string)); + } + + /** + * Encode a string using Q encoding. + * + * @see http://tools.ietf.org/html/rfc2047#section-4.2 + * + * @param string $str the text to encode + * @param string $position Where the text is going to be used, see the RFC for what that means + * + * @return string + */ + public function encodeQ($str, $position = 'text') + { + //There should not be any EOL in the string + $pattern = ''; + $encoded = str_replace(["\r", "\n"], '', $str); + switch (strtolower($position)) { + case 'phrase': + //RFC 2047 section 5.3 + $pattern = '^A-Za-z0-9!*+\/ -'; + break; + /* + * RFC 2047 section 5.2. + * Build $pattern without including delimiters and [] + */ + /* @noinspection PhpMissingBreakStatementInspection */ + case 'comment': + $pattern = '\(\)"'; + /* Intentional fall through */ + case 'text': + default: + //RFC 2047 section 5.1 + //Replace every high ascii, control, =, ? and _ characters + $pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377' . $pattern; + break; + } + $matches = []; + if (preg_match_all("/[{$pattern}]/", $encoded, $matches)) { + //If the string contains an '=', make sure it's the first thing we replace + //so as to avoid double-encoding + $eqkey = array_search('=', $matches[0], true); + if (false !== $eqkey) { + unset($matches[0][$eqkey]); + array_unshift($matches[0], '='); + } + foreach (array_unique($matches[0]) as $char) { + $encoded = str_replace($char, '=' . sprintf('%02X', ord($char)), $encoded); + } + } + //Replace spaces with _ (more readable than =20) + //RFC 2047 section 4.2(2) + return str_replace(' ', '_', $encoded); + } + + /** + * Add a string or binary attachment (non-filesystem). + * This method can be used to attach ascii or binary data, + * such as a BLOB record from a database. + * + * @param string $string String attachment data + * @param string $filename Name of the attachment + * @param string $encoding File encoding (see $Encoding) + * @param string $type File extension (MIME) type + * @param string $disposition Disposition to use + * + * @throws Exception + * + * @return bool True on successfully adding an attachment + */ + public function addStringAttachment( + $string, + $filename, + $encoding = self::ENCODING_BASE64, + $type = '', + $disposition = 'attachment' + ) { + try { + //If a MIME type is not specified, try to work it out from the file name + if ('' === $type) { + $type = static::filenameToType($filename); + } + + if (!$this->validateEncoding($encoding)) { + throw new Exception($this->lang('encoding') . $encoding); + } + + //Append to $attachment array + $this->attachment[] = [ + 0 => $string, + 1 => $filename, + 2 => static::mb_pathinfo($filename, PATHINFO_BASENAME), + 3 => $encoding, + 4 => $type, + 5 => true, //isStringAttachment + 6 => $disposition, + 7 => 0, + ]; + } catch (Exception $exc) { + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + + return false; + } + + return true; + } + + /** + * Add an embedded (inline) attachment from a file. + * This can include images, sounds, and just about any other document type. + * These differ from 'regular' attachments in that they are intended to be + * displayed inline with the message, not just attached for download. + * This is used in HTML messages that embed the images + * the HTML refers to using the $cid value. + * Never use a user-supplied path to a file! + * + * @param string $path Path to the attachment + * @param string $cid Content ID of the attachment; Use this to reference + * the content when using an embedded image in HTML + * @param string $name Overrides the attachment name + * @param string $encoding File encoding (see $Encoding) + * @param string $type File MIME type + * @param string $disposition Disposition to use + * + * @throws Exception + * + * @return bool True on successfully adding an attachment + */ + public function addEmbeddedImage( + $path, + $cid, + $name = '', + $encoding = self::ENCODING_BASE64, + $type = '', + $disposition = 'inline' + ) { + try { + if (!static::fileIsAccessible($path)) { + throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE); + } + + //If a MIME type is not specified, try to work it out from the file name + if ('' === $type) { + $type = static::filenameToType($path); + } + + if (!$this->validateEncoding($encoding)) { + throw new Exception($this->lang('encoding') . $encoding); + } + + $filename = (string) static::mb_pathinfo($path, PATHINFO_BASENAME); + if ('' === $name) { + $name = $filename; + } + + //Append to $attachment array + $this->attachment[] = [ + 0 => $path, + 1 => $filename, + 2 => $name, + 3 => $encoding, + 4 => $type, + 5 => false, //isStringAttachment + 6 => $disposition, + 7 => $cid, + ]; + } catch (Exception $exc) { + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + + return false; + } + + return true; + } + + /** + * Add an embedded stringified attachment. + * This can include images, sounds, and just about any other document type. + * If your filename doesn't contain an extension, be sure to set the $type to an appropriate MIME type. + * + * @param string $string The attachment binary data + * @param string $cid Content ID of the attachment; Use this to reference + * the content when using an embedded image in HTML + * @param string $name A filename for the attachment. If this contains an extension, + * PHPMailer will attempt to set a MIME type for the attachment. + * For example 'file.jpg' would get an 'image/jpeg' MIME type. + * @param string $encoding File encoding (see $Encoding), defaults to 'base64' + * @param string $type MIME type - will be used in preference to any automatically derived type + * @param string $disposition Disposition to use + * + * @throws Exception + * + * @return bool True on successfully adding an attachment + */ + public function addStringEmbeddedImage( + $string, + $cid, + $name = '', + $encoding = self::ENCODING_BASE64, + $type = '', + $disposition = 'inline' + ) { + try { + //If a MIME type is not specified, try to work it out from the name + if ('' === $type && !empty($name)) { + $type = static::filenameToType($name); + } + + if (!$this->validateEncoding($encoding)) { + throw new Exception($this->lang('encoding') . $encoding); + } + + //Append to $attachment array + $this->attachment[] = [ + 0 => $string, + 1 => $name, + 2 => $name, + 3 => $encoding, + 4 => $type, + 5 => true, //isStringAttachment + 6 => $disposition, + 7 => $cid, + ]; + } catch (Exception $exc) { + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + + return false; + } + + return true; + } + + /** + * Validate encodings. + * + * @param string $encoding + * + * @return bool + */ + protected function validateEncoding($encoding) + { + return in_array( + $encoding, + [ + self::ENCODING_7BIT, + self::ENCODING_QUOTED_PRINTABLE, + self::ENCODING_BASE64, + self::ENCODING_8BIT, + self::ENCODING_BINARY, + ], + true + ); + } + + /** + * Check if an embedded attachment is present with this cid. + * + * @param string $cid + * + * @return bool + */ + protected function cidExists($cid) + { + foreach ($this->attachment as $attachment) { + if ('inline' === $attachment[6] && $cid === $attachment[7]) { + return true; + } + } + + return false; + } + + /** + * Check if an inline attachment is present. + * + * @return bool + */ + public function inlineImageExists() + { + foreach ($this->attachment as $attachment) { + if ('inline' === $attachment[6]) { + return true; + } + } + + return false; + } + + /** + * Check if an attachment (non-inline) is present. + * + * @return bool + */ + public function attachmentExists() + { + foreach ($this->attachment as $attachment) { + if ('attachment' === $attachment[6]) { + return true; + } + } + + return false; + } + + /** + * Check if this message has an alternative body set. + * + * @return bool + */ + public function alternativeExists() + { + return !empty($this->AltBody); + } + + /** + * Clear queued addresses of given kind. + * + * @param string $kind 'to', 'cc', or 'bcc' + */ + public function clearQueuedAddresses($kind) + { + $this->RecipientsQueue = array_filter( + $this->RecipientsQueue, + static function ($params) use ($kind) { + return $params[0] !== $kind; + } + ); + } + + /** + * Clear all To recipients. + */ + public function clearAddresses() + { + foreach ($this->to as $to) { + unset($this->all_recipients[strtolower($to[0])]); + } + $this->to = []; + $this->clearQueuedAddresses('to'); + } + + /** + * Clear all CC recipients. + */ + public function clearCCs() + { + foreach ($this->cc as $cc) { + unset($this->all_recipients[strtolower($cc[0])]); + } + $this->cc = []; + $this->clearQueuedAddresses('cc'); + } + + /** + * Clear all BCC recipients. + */ + public function clearBCCs() + { + foreach ($this->bcc as $bcc) { + unset($this->all_recipients[strtolower($bcc[0])]); + } + $this->bcc = []; + $this->clearQueuedAddresses('bcc'); + } + + /** + * Clear all ReplyTo recipients. + */ + public function clearReplyTos() + { + $this->ReplyTo = []; + $this->ReplyToQueue = []; + } + + /** + * Clear all recipient types. + */ + public function clearAllRecipients() + { + $this->to = []; + $this->cc = []; + $this->bcc = []; + $this->all_recipients = []; + $this->RecipientsQueue = []; + } + + /** + * Clear all filesystem, string, and binary attachments. + */ + public function clearAttachments() + { + $this->attachment = []; + } + + /** + * Clear all custom headers. + */ + public function clearCustomHeaders() + { + $this->CustomHeader = []; + } + + /** + * Add an error message to the error container. + * + * @param string $msg + */ + protected function setError($msg) + { + ++$this->error_count; + if ('smtp' === $this->Mailer && null !== $this->smtp) { + $lasterror = $this->smtp->getError(); + if (!empty($lasterror['error'])) { + $msg .= $this->lang('smtp_error') . $lasterror['error']; + if (!empty($lasterror['detail'])) { + $msg .= ' Detail: ' . $lasterror['detail']; + } + if (!empty($lasterror['smtp_code'])) { + $msg .= ' SMTP code: ' . $lasterror['smtp_code']; + } + if (!empty($lasterror['smtp_code_ex'])) { + $msg .= ' Additional SMTP info: ' . $lasterror['smtp_code_ex']; + } + } + } + $this->ErrorInfo = $msg; + } + + /** + * Return an RFC 822 formatted date. + * + * @return string + */ + public static function rfcDate() + { + //Set the time zone to whatever the default is to avoid 500 errors + //Will default to UTC if it's not set properly in php.ini + date_default_timezone_set(@date_default_timezone_get()); + + return date('D, j M Y H:i:s O'); + } + + /** + * Get the server hostname. + * Returns 'localhost.localdomain' if unknown. + * + * @return string + */ + protected function serverHostname() + { + $result = ''; + if (!empty($this->Hostname)) { + $result = $this->Hostname; + } elseif (isset($_SERVER) && array_key_exists('SERVER_NAME', $_SERVER)) { + $result = $_SERVER['SERVER_NAME']; + } elseif (function_exists('gethostname') && gethostname() !== false) { + $result = gethostname(); + } elseif (php_uname('n') !== false) { + $result = php_uname('n'); + } + if (!static::isValidHost($result)) { + return 'localhost.localdomain'; + } + + return $result; + } + + /** + * Validate whether a string contains a valid value to use as a hostname or IP address. + * IPv6 addresses must include [], e.g. `[::1]`, not just `::1`. + * + * @param string $host The host name or IP address to check + * + * @return bool + */ + public static function isValidHost($host) + { + //Simple syntax limits + if ( + empty($host) + || !is_string($host) + || strlen($host) > 256 + || !preg_match('/^([a-zA-Z\d.-]*|\[[a-fA-F\d:]+])$/', $host) + ) { + return false; + } + //Looks like a bracketed IPv6 address + if (strlen($host) > 2 && substr($host, 0, 1) === '[' && substr($host, -1, 1) === ']') { + return filter_var(substr($host, 1, -1), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false; + } + //If removing all the dots results in a numeric string, it must be an IPv4 address. + //Need to check this first because otherwise things like `999.0.0.0` are considered valid host names + if (is_numeric(str_replace('.', '', $host))) { + //Is it a valid IPv4 address? + return filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false; + } + if (filter_var('http://' . $host, FILTER_VALIDATE_URL) !== false) { + //Is it a syntactically valid hostname? + return true; + } + + return false; + } + + /** + * Get an error message in the current language. + * + * @param string $key + * + * @return string + */ + protected function lang($key) + { + if (count($this->language) < 1) { + $this->setLanguage(); //Set the default language + } + + if (array_key_exists($key, $this->language)) { + if ('smtp_connect_failed' === $key) { + //Include a link to troubleshooting docs on SMTP connection failure. + //This is by far the biggest cause of support questions + //but it's usually not PHPMailer's fault. + return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting'; + } + + return $this->language[$key]; + } + + //Return the key as a fallback + return $key; + } + + /** + * Check if an error occurred. + * + * @return bool True if an error did occur + */ + public function isError() + { + return $this->error_count > 0; + } + + /** + * Add a custom header. + * $name value can be overloaded to contain + * both header name and value (name:value). + * + * @param string $name Custom header name + * @param string|null $value Header value + * + * @throws Exception + */ + public function addCustomHeader($name, $value = null) + { + if (null === $value && strpos($name, ':') !== false) { + //Value passed in as name:value + list($name, $value) = explode(':', $name, 2); + } + $name = trim($name); + $value = trim($value); + //Ensure name is not empty, and that neither name nor value contain line breaks + if (empty($name) || strpbrk($name . $value, "\r\n") !== false) { + if ($this->exceptions) { + throw new Exception('Invalid header name or value'); + } + + return false; + } + $this->CustomHeader[] = [$name, $value]; + + return true; + } + + /** + * Returns all custom headers. + * + * @return array + */ + public function getCustomHeaders() + { + return $this->CustomHeader; + } + + /** + * Create a message body from an HTML string. + * Automatically inlines images and creates a plain-text version by converting the HTML, + * overwriting any existing values in Body and AltBody. + * Do not source $message content from user input! + * $basedir is prepended when handling relative URLs, e.g. and must not be empty + * will look for an image file in $basedir/images/a.png and convert it to inline. + * If you don't provide a $basedir, relative paths will be left untouched (and thus probably break in email) + * Converts data-uri images into embedded attachments. + * If you don't want to apply these transformations to your HTML, just set Body and AltBody directly. + * + * @param string $message HTML message string + * @param string $basedir Absolute path to a base directory to prepend to relative paths to images + * @param bool|callable $advanced Whether to use the internal HTML to text converter + * or your own custom converter + * @return string The transformed message body + * + * @throws Exception + * + * @see PHPMailer::html2text() + */ + public function msgHTML($message, $basedir = '', $advanced = false) + { + preg_match_all('/(? 1 && '/' !== substr($basedir, -1)) { + //Ensure $basedir has a trailing / + $basedir .= '/'; + } + foreach ($images[2] as $imgindex => $url) { + //Convert data URIs into embedded images + //e.g. "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" + $match = []; + if (preg_match('#^data:(image/(?:jpe?g|gif|png));?(base64)?,(.+)#', $url, $match)) { + if (count($match) === 4 && static::ENCODING_BASE64 === $match[2]) { + $data = base64_decode($match[3]); + } elseif ('' === $match[2]) { + $data = rawurldecode($match[3]); + } else { + //Not recognised so leave it alone + continue; + } + //Hash the decoded data, not the URL, so that the same data-URI image used in multiple places + //will only be embedded once, even if it used a different encoding + $cid = substr(hash('sha256', $data), 0, 32) . '@phpmailer.0'; //RFC2392 S 2 + + if (!$this->cidExists($cid)) { + $this->addStringEmbeddedImage( + $data, + $cid, + 'embed' . $imgindex, + static::ENCODING_BASE64, + $match[1] + ); + } + $message = str_replace( + $images[0][$imgindex], + $images[1][$imgindex] . '="cid:' . $cid . '"', + $message + ); + continue; + } + if ( + //Only process relative URLs if a basedir is provided (i.e. no absolute local paths) + !empty($basedir) + //Ignore URLs containing parent dir traversal (..) + && (strpos($url, '..') === false) + //Do not change urls that are already inline images + && 0 !== strpos($url, 'cid:') + //Do not change absolute URLs, including anonymous protocol + && !preg_match('#^[a-z][a-z0-9+.-]*:?//#i', $url) + ) { + $filename = static::mb_pathinfo($url, PATHINFO_BASENAME); + $directory = dirname($url); + if ('.' === $directory) { + $directory = ''; + } + //RFC2392 S 2 + $cid = substr(hash('sha256', $url), 0, 32) . '@phpmailer.0'; + if (strlen($basedir) > 1 && '/' !== substr($basedir, -1)) { + $basedir .= '/'; + } + if (strlen($directory) > 1 && '/' !== substr($directory, -1)) { + $directory .= '/'; + } + if ( + $this->addEmbeddedImage( + $basedir . $directory . $filename, + $cid, + $filename, + static::ENCODING_BASE64, + static::_mime_types((string) static::mb_pathinfo($filename, PATHINFO_EXTENSION)) + ) + ) { + $message = preg_replace( + '/' . $images[1][$imgindex] . '=["\']' . preg_quote($url, '/') . '["\']/Ui', + $images[1][$imgindex] . '="cid:' . $cid . '"', + $message + ); + } + } + } + } + $this->isHTML(); + //Convert all message body line breaks to LE, makes quoted-printable encoding work much better + $this->Body = static::normalizeBreaks($message); + $this->AltBody = static::normalizeBreaks($this->html2text($message, $advanced)); + if (!$this->alternativeExists()) { + $this->AltBody = 'This is an HTML-only message. To view it, activate HTML in your email application.' + . static::$LE; + } + + return $this->Body; + } + + /** + * Convert an HTML string into plain text. + * This is used by msgHTML(). + * Note - older versions of this function used a bundled advanced converter + * which was removed for license reasons in #232. + * Example usage: + * + * ```php + * //Use default conversion + * $plain = $mail->html2text($html); + * //Use your own custom converter + * $plain = $mail->html2text($html, function($html) { + * $converter = new MyHtml2text($html); + * return $converter->get_text(); + * }); + * ``` + * + * @param string $html The HTML text to convert + * @param bool|callable $advanced Any boolean value to use the internal converter, + * or provide your own callable for custom conversion + * + * @return string + */ + public function html2text($html, $advanced = false) + { + if (is_callable($advanced)) { + return call_user_func($advanced, $html); + } + + return html_entity_decode( + trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/si', '', $html))), + ENT_QUOTES, + $this->CharSet + ); + } + + /** + * Get the MIME type for a file extension. + * + * @param string $ext File extension + * + * @return string MIME type of file + */ + public static function _mime_types($ext = '') + { + $mimes = [ + 'xl' => 'application/excel', + 'js' => 'application/javascript', + 'hqx' => 'application/mac-binhex40', + 'cpt' => 'application/mac-compactpro', + 'bin' => 'application/macbinary', + 'doc' => 'application/msword', + 'word' => 'application/msword', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', + 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', + 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', + 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', + 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', + 'class' => 'application/octet-stream', + 'dll' => 'application/octet-stream', + 'dms' => 'application/octet-stream', + 'exe' => 'application/octet-stream', + 'lha' => 'application/octet-stream', + 'lzh' => 'application/octet-stream', + 'psd' => 'application/octet-stream', + 'sea' => 'application/octet-stream', + 'so' => 'application/octet-stream', + 'oda' => 'application/oda', + 'pdf' => 'application/pdf', + 'ai' => 'application/postscript', + 'eps' => 'application/postscript', + 'ps' => 'application/postscript', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'mif' => 'application/vnd.mif', + 'xls' => 'application/vnd.ms-excel', + 'ppt' => 'application/vnd.ms-powerpoint', + 'wbxml' => 'application/vnd.wap.wbxml', + 'wmlc' => 'application/vnd.wap.wmlc', + 'dcr' => 'application/x-director', + 'dir' => 'application/x-director', + 'dxr' => 'application/x-director', + 'dvi' => 'application/x-dvi', + 'gtar' => 'application/x-gtar', + 'php3' => 'application/x-httpd-php', + 'php4' => 'application/x-httpd-php', + 'php' => 'application/x-httpd-php', + 'phtml' => 'application/x-httpd-php', + 'phps' => 'application/x-httpd-php-source', + 'swf' => 'application/x-shockwave-flash', + 'sit' => 'application/x-stuffit', + 'tar' => 'application/x-tar', + 'tgz' => 'application/x-tar', + 'xht' => 'application/xhtml+xml', + 'xhtml' => 'application/xhtml+xml', + 'zip' => 'application/zip', + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mp2' => 'audio/mpeg', + 'mp3' => 'audio/mpeg', + 'm4a' => 'audio/mp4', + 'mpga' => 'audio/mpeg', + 'aif' => 'audio/x-aiff', + 'aifc' => 'audio/x-aiff', + 'aiff' => 'audio/x-aiff', + 'ram' => 'audio/x-pn-realaudio', + 'rm' => 'audio/x-pn-realaudio', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'ra' => 'audio/x-realaudio', + 'wav' => 'audio/x-wav', + 'mka' => 'audio/x-matroska', + 'bmp' => 'image/bmp', + 'gif' => 'image/gif', + 'jpeg' => 'image/jpeg', + 'jpe' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'png' => 'image/png', + 'tiff' => 'image/tiff', + 'tif' => 'image/tiff', + 'webp' => 'image/webp', + 'avif' => 'image/avif', + 'heif' => 'image/heif', + 'heifs' => 'image/heif-sequence', + 'heic' => 'image/heic', + 'heics' => 'image/heic-sequence', + 'eml' => 'message/rfc822', + 'css' => 'text/css', + 'html' => 'text/html', + 'htm' => 'text/html', + 'shtml' => 'text/html', + 'log' => 'text/plain', + 'text' => 'text/plain', + 'txt' => 'text/plain', + 'rtx' => 'text/richtext', + 'rtf' => 'text/rtf', + 'vcf' => 'text/vcard', + 'vcard' => 'text/vcard', + 'ics' => 'text/calendar', + 'xml' => 'text/xml', + 'xsl' => 'text/xml', + 'wmv' => 'video/x-ms-wmv', + 'mpeg' => 'video/mpeg', + 'mpe' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mp4' => 'video/mp4', + 'm4v' => 'video/mp4', + 'mov' => 'video/quicktime', + 'qt' => 'video/quicktime', + 'rv' => 'video/vnd.rn-realvideo', + 'avi' => 'video/x-msvideo', + 'movie' => 'video/x-sgi-movie', + 'webm' => 'video/webm', + 'mkv' => 'video/x-matroska', + ]; + $ext = strtolower($ext); + if (array_key_exists($ext, $mimes)) { + return $mimes[$ext]; + } + + return 'application/octet-stream'; + } + + /** + * Map a file name to a MIME type. + * Defaults to 'application/octet-stream', i.e.. arbitrary binary data. + * + * @param string $filename A file name or full path, does not need to exist as a file + * + * @return string + */ + public static function filenameToType($filename) + { + //In case the path is a URL, strip any query string before getting extension + $qpos = strpos($filename, '?'); + if (false !== $qpos) { + $filename = substr($filename, 0, $qpos); + } + $ext = static::mb_pathinfo($filename, PATHINFO_EXTENSION); + + return static::_mime_types($ext); + } + + /** + * Multi-byte-safe pathinfo replacement. + * Drop-in replacement for pathinfo(), but multibyte- and cross-platform-safe. + * + * @see http://www.php.net/manual/en/function.pathinfo.php#107461 + * + * @param string $path A filename or path, does not need to exist as a file + * @param int|string $options Either a PATHINFO_* constant, + * or a string name to return only the specified piece + * + * @return string|array + */ + public static function mb_pathinfo($path, $options = null) + { + $ret = ['dirname' => '', 'basename' => '', 'extension' => '', 'filename' => '']; + $pathinfo = []; + if (preg_match('#^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^.\\\\/]+?)|))[\\\\/.]*$#m', $path, $pathinfo)) { + if (array_key_exists(1, $pathinfo)) { + $ret['dirname'] = $pathinfo[1]; + } + if (array_key_exists(2, $pathinfo)) { + $ret['basename'] = $pathinfo[2]; + } + if (array_key_exists(5, $pathinfo)) { + $ret['extension'] = $pathinfo[5]; + } + if (array_key_exists(3, $pathinfo)) { + $ret['filename'] = $pathinfo[3]; + } + } + switch ($options) { + case PATHINFO_DIRNAME: + case 'dirname': + return $ret['dirname']; + case PATHINFO_BASENAME: + case 'basename': + return $ret['basename']; + case PATHINFO_EXTENSION: + case 'extension': + return $ret['extension']; + case PATHINFO_FILENAME: + case 'filename': + return $ret['filename']; + default: + return $ret; + } + } + + /** + * Set or reset instance properties. + * You should avoid this function - it's more verbose, less efficient, more error-prone and + * harder to debug than setting properties directly. + * Usage Example: + * `$mail->set('SMTPSecure', static::ENCRYPTION_STARTTLS);` + * is the same as: + * `$mail->SMTPSecure = static::ENCRYPTION_STARTTLS;`. + * + * @param string $name The property name to set + * @param mixed $value The value to set the property to + * + * @return bool + */ + public function set($name, $value = '') + { + if (property_exists($this, $name)) { + $this->$name = $value; + + return true; + } + $this->setError($this->lang('variable_set') . $name); + + return false; + } + + /** + * Strip newlines to prevent header injection. + * + * @param string $str + * + * @return string + */ + public function secureHeader($str) + { + return trim(str_replace(["\r", "\n"], '', $str)); + } + + /** + * Normalize line breaks in a string. + * Converts UNIX LF, Mac CR and Windows CRLF line breaks into a single line break format. + * Defaults to CRLF (for message bodies) and preserves consecutive breaks. + * + * @param string $text + * @param string $breaktype What kind of line break to use; defaults to static::$LE + * + * @return string + */ + public static function normalizeBreaks($text, $breaktype = null) + { + if (null === $breaktype) { + $breaktype = static::$LE; + } + //Normalise to \n + $text = str_replace([self::CRLF, "\r"], "\n", $text); + //Now convert LE as needed + if ("\n" !== $breaktype) { + $text = str_replace("\n", $breaktype, $text); + } + + return $text; + } + + /** + * Remove trailing breaks from a string. + * + * @param string $text + * + * @return string The text to remove breaks from + */ + public static function stripTrailingWSP($text) + { + return rtrim($text, " \r\n\t"); + } + + /** + * Return the current line break format string. + * + * @return string + */ + public static function getLE() + { + return static::$LE; + } + + /** + * Set the line break format string, e.g. "\r\n". + * + * @param string $le + */ + protected static function setLE($le) + { + static::$LE = $le; + } + + /** + * Set the public and private key files and password for S/MIME signing. + * + * @param string $cert_filename + * @param string $key_filename + * @param string $key_pass Password for private key + * @param string $extracerts_filename Optional path to chain certificate + */ + public function sign($cert_filename, $key_filename, $key_pass, $extracerts_filename = '') + { + $this->sign_cert_file = $cert_filename; + $this->sign_key_file = $key_filename; + $this->sign_key_pass = $key_pass; + $this->sign_extracerts_file = $extracerts_filename; + } + + /** + * Quoted-Printable-encode a DKIM header. + * + * @param string $txt + * + * @return string + */ + public function DKIM_QP($txt) + { + $line = ''; + $len = strlen($txt); + for ($i = 0; $i < $len; ++$i) { + $ord = ord($txt[$i]); + if (((0x21 <= $ord) && ($ord <= 0x3A)) || $ord === 0x3C || ((0x3E <= $ord) && ($ord <= 0x7E))) { + $line .= $txt[$i]; + } else { + $line .= '=' . sprintf('%02X', $ord); + } + } + + return $line; + } + + /** + * Generate a DKIM signature. + * + * @param string $signHeader + * + * @throws Exception + * + * @return string The DKIM signature value + */ + public function DKIM_Sign($signHeader) + { + if (!defined('PKCS7_TEXT')) { + if ($this->exceptions) { + throw new Exception($this->lang('extension_missing') . 'openssl'); + } + + return ''; + } + $privKeyStr = !empty($this->DKIM_private_string) ? + $this->DKIM_private_string : + file_get_contents($this->DKIM_private); + if ('' !== $this->DKIM_passphrase) { + $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase); + } else { + $privKey = openssl_pkey_get_private($privKeyStr); + } + if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) { + if (\PHP_MAJOR_VERSION < 8) { + openssl_pkey_free($privKey); + } + + return base64_encode($signature); + } + if (\PHP_MAJOR_VERSION < 8) { + openssl_pkey_free($privKey); + } + + return ''; + } + + /** + * Generate a DKIM canonicalization header. + * Uses the 'relaxed' algorithm from RFC6376 section 3.4.2. + * Canonicalized headers should *always* use CRLF, regardless of mailer setting. + * + * @see https://tools.ietf.org/html/rfc6376#section-3.4.2 + * + * @param string $signHeader Header + * + * @return string + */ + public function DKIM_HeaderC($signHeader) + { + //Normalize breaks to CRLF (regardless of the mailer) + $signHeader = static::normalizeBreaks($signHeader, self::CRLF); + //Unfold header lines + //Note PCRE \s is too broad a definition of whitespace; RFC5322 defines it as `[ \t]` + //@see https://tools.ietf.org/html/rfc5322#section-2.2 + //That means this may break if you do something daft like put vertical tabs in your headers. + $signHeader = preg_replace('/\r\n[ \t]+/', ' ', $signHeader); + //Break headers out into an array + $lines = explode(self::CRLF, $signHeader); + foreach ($lines as $key => $line) { + //If the header is missing a :, skip it as it's invalid + //This is likely to happen because the explode() above will also split + //on the trailing LE, leaving an empty line + if (strpos($line, ':') === false) { + continue; + } + list($heading, $value) = explode(':', $line, 2); + //Lower-case header name + $heading = strtolower($heading); + //Collapse white space within the value, also convert WSP to space + $value = preg_replace('/[ \t]+/', ' ', $value); + //RFC6376 is slightly unclear here - it says to delete space at the *end* of each value + //But then says to delete space before and after the colon. + //Net result is the same as trimming both ends of the value. + //By elimination, the same applies to the field name + $lines[$key] = trim($heading, " \t") . ':' . trim($value, " \t"); + } + + return implode(self::CRLF, $lines); + } + + /** + * Generate a DKIM canonicalization body. + * Uses the 'simple' algorithm from RFC6376 section 3.4.3. + * Canonicalized bodies should *always* use CRLF, regardless of mailer setting. + * + * @see https://tools.ietf.org/html/rfc6376#section-3.4.3 + * + * @param string $body Message Body + * + * @return string + */ + public function DKIM_BodyC($body) + { + if (empty($body)) { + return self::CRLF; + } + //Normalize line endings to CRLF + $body = static::normalizeBreaks($body, self::CRLF); + + //Reduce multiple trailing line breaks to a single one + return static::stripTrailingWSP($body) . self::CRLF; + } + + /** + * Create the DKIM header and body in a new message header. + * + * @param string $headers_line Header lines + * @param string $subject Subject + * @param string $body Body + * + * @throws Exception + * + * @return string + */ + public function DKIM_Add($headers_line, $subject, $body) + { + $DKIMsignatureType = 'rsa-sha256'; //Signature & hash algorithms + $DKIMcanonicalization = 'relaxed/simple'; //Canonicalization methods of header & body + $DKIMquery = 'dns/txt'; //Query method + $DKIMtime = time(); + //Always sign these headers without being asked + //Recommended list from https://tools.ietf.org/html/rfc6376#section-5.4.1 + $autoSignHeaders = [ + 'from', + 'to', + 'cc', + 'date', + 'subject', + 'reply-to', + 'message-id', + 'content-type', + 'mime-version', + 'x-mailer', + ]; + if (stripos($headers_line, 'Subject') === false) { + $headers_line .= 'Subject: ' . $subject . static::$LE; + } + $headerLines = explode(static::$LE, $headers_line); + $currentHeaderLabel = ''; + $currentHeaderValue = ''; + $parsedHeaders = []; + $headerLineIndex = 0; + $headerLineCount = count($headerLines); + foreach ($headerLines as $headerLine) { + $matches = []; + if (preg_match('/^([^ \t]*?)(?::[ \t]*)(.*)$/', $headerLine, $matches)) { + if ($currentHeaderLabel !== '') { + //We were previously in another header; This is the start of a new header, so save the previous one + $parsedHeaders[] = ['label' => $currentHeaderLabel, 'value' => $currentHeaderValue]; + } + $currentHeaderLabel = $matches[1]; + $currentHeaderValue = $matches[2]; + } elseif (preg_match('/^[ \t]+(.*)$/', $headerLine, $matches)) { + //This is a folded continuation of the current header, so unfold it + $currentHeaderValue .= ' ' . $matches[1]; + } + ++$headerLineIndex; + if ($headerLineIndex >= $headerLineCount) { + //This was the last line, so finish off this header + $parsedHeaders[] = ['label' => $currentHeaderLabel, 'value' => $currentHeaderValue]; + } + } + $copiedHeaders = []; + $headersToSignKeys = []; + $headersToSign = []; + foreach ($parsedHeaders as $header) { + //Is this header one that must be included in the DKIM signature? + if (in_array(strtolower($header['label']), $autoSignHeaders, true)) { + $headersToSignKeys[] = $header['label']; + $headersToSign[] = $header['label'] . ': ' . $header['value']; + if ($this->DKIM_copyHeaderFields) { + $copiedHeaders[] = $header['label'] . ':' . //Note no space after this, as per RFC + str_replace('|', '=7C', $this->DKIM_QP($header['value'])); + } + continue; + } + //Is this an extra custom header we've been asked to sign? + if (in_array($header['label'], $this->DKIM_extraHeaders, true)) { + //Find its value in custom headers + foreach ($this->CustomHeader as $customHeader) { + if ($customHeader[0] === $header['label']) { + $headersToSignKeys[] = $header['label']; + $headersToSign[] = $header['label'] . ': ' . $header['value']; + if ($this->DKIM_copyHeaderFields) { + $copiedHeaders[] = $header['label'] . ':' . //Note no space after this, as per RFC + str_replace('|', '=7C', $this->DKIM_QP($header['value'])); + } + //Skip straight to the next header + continue 2; + } + } + } + } + $copiedHeaderFields = ''; + if ($this->DKIM_copyHeaderFields && count($copiedHeaders) > 0) { + //Assemble a DKIM 'z' tag + $copiedHeaderFields = ' z='; + $first = true; + foreach ($copiedHeaders as $copiedHeader) { + if (!$first) { + $copiedHeaderFields .= static::$LE . ' |'; + } + //Fold long values + if (strlen($copiedHeader) > self::STD_LINE_LENGTH - 3) { + $copiedHeaderFields .= substr( + chunk_split($copiedHeader, self::STD_LINE_LENGTH - 3, static::$LE . self::FWS), + 0, + -strlen(static::$LE . self::FWS) + ); + } else { + $copiedHeaderFields .= $copiedHeader; + } + $first = false; + } + $copiedHeaderFields .= ';' . static::$LE; + } + $headerKeys = ' h=' . implode(':', $headersToSignKeys) . ';' . static::$LE; + $headerValues = implode(static::$LE, $headersToSign); + $body = $this->DKIM_BodyC($body); + //Base64 of packed binary SHA-256 hash of body + $DKIMb64 = base64_encode(pack('H*', hash('sha256', $body))); + $ident = ''; + if ('' !== $this->DKIM_identity) { + $ident = ' i=' . $this->DKIM_identity . ';' . static::$LE; + } + //The DKIM-Signature header is included in the signature *except for* the value of the `b` tag + //which is appended after calculating the signature + //https://tools.ietf.org/html/rfc6376#section-3.5 + $dkimSignatureHeader = 'DKIM-Signature: v=1;' . + ' d=' . $this->DKIM_domain . ';' . + ' s=' . $this->DKIM_selector . ';' . static::$LE . + ' a=' . $DKIMsignatureType . ';' . + ' q=' . $DKIMquery . ';' . + ' t=' . $DKIMtime . ';' . + ' c=' . $DKIMcanonicalization . ';' . static::$LE . + $headerKeys . + $ident . + $copiedHeaderFields . + ' bh=' . $DKIMb64 . ';' . static::$LE . + ' b='; + //Canonicalize the set of headers + $canonicalizedHeaders = $this->DKIM_HeaderC( + $headerValues . static::$LE . $dkimSignatureHeader + ); + $signature = $this->DKIM_Sign($canonicalizedHeaders); + $signature = trim(chunk_split($signature, self::STD_LINE_LENGTH - 3, static::$LE . self::FWS)); + + return static::normalizeBreaks($dkimSignatureHeader . $signature); + } + + /** + * Detect if a string contains a line longer than the maximum line length + * allowed by RFC 2822 section 2.1.1. + * + * @param string $str + * + * @return bool + */ + public static function hasLineLongerThanMax($str) + { + return (bool) preg_match('/^(.{' . (self::MAX_LINE_LENGTH + strlen(static::$LE)) . ',})/m', $str); + } + + /** + * If a string contains any "special" characters, double-quote the name, + * and escape any double quotes with a backslash. + * + * @param string $str + * + * @return string + * + * @see RFC822 3.4.1 + */ + public static function quotedString($str) + { + if (preg_match('/[ ()<>@,;:"\/\[\]?=]/', $str)) { + //If the string contains any of these chars, it must be double-quoted + //and any double quotes must be escaped with a backslash + return '"' . str_replace('"', '\\"', $str) . '"'; + } + + //Return the string untouched, it doesn't need quoting + return $str; + } + + /** + * Allows for public read access to 'to' property. + * Before the send() call, queued addresses (i.e. with IDN) are not yet included. + * + * @return array + */ + public function getToAddresses() + { + return $this->to; + } + + /** + * Allows for public read access to 'cc' property. + * Before the send() call, queued addresses (i.e. with IDN) are not yet included. + * + * @return array + */ + public function getCcAddresses() + { + return $this->cc; + } + + /** + * Allows for public read access to 'bcc' property. + * Before the send() call, queued addresses (i.e. with IDN) are not yet included. + * + * @return array + */ + public function getBccAddresses() + { + return $this->bcc; + } + + /** + * Allows for public read access to 'ReplyTo' property. + * Before the send() call, queued addresses (i.e. with IDN) are not yet included. + * + * @return array + */ + public function getReplyToAddresses() + { + return $this->ReplyTo; + } + + /** + * Allows for public read access to 'all_recipients' property. + * Before the send() call, queued addresses (i.e. with IDN) are not yet included. + * + * @return array + */ + public function getAllRecipientAddresses() + { + return $this->all_recipients; + } + + /** + * Perform a callback. + * + * @param bool $isSent + * @param array $to + * @param array $cc + * @param array $bcc + * @param string $subject + * @param string $body + * @param string $from + * @param array $extra + */ + protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from, $extra) + { + if (!empty($this->action_function) && is_callable($this->action_function)) { + call_user_func($this->action_function, $isSent, $to, $cc, $bcc, $subject, $body, $from, $extra); + } + } + + /** + * Get the OAuth instance. + * + * @return OAuth + */ + public function getOAuth() + { + return $this->oauth; + } + + /** + * Set an OAuth instance. + */ + public function setOAuth(OAuth $oauth) + { + $this->oauth = $oauth; + } +} diff --git a/vendor/phpmailer/phpmailer/src/POP3.php b/vendor/phpmailer/phpmailer/src/POP3.php new file mode 100644 index 0000000..183794d --- /dev/null +++ b/vendor/phpmailer/phpmailer/src/POP3.php @@ -0,0 +1,448 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2020 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * PHPMailer POP-Before-SMTP Authentication Class. + * Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication. + * 1) This class does not support APOP authentication. + * 2) Opening and closing lots of POP3 connections can be quite slow. If you need + * to send a batch of emails then just perform the authentication once at the start, + * and then loop through your mail sending script. Providing this process doesn't + * take longer than the verification period lasts on your POP3 server, you should be fine. + * 3) This is really ancient technology; you should only need to use it to talk to very old systems. + * 4) This POP3 class is deliberately lightweight and incomplete, implementing just + * enough to do authentication. + * If you want a more complete class there are other POP3 classes for PHP available. + * + * @author Richard Davey (original author) + * @author Marcus Bointon (Synchro/coolbru) + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + */ +class POP3 +{ + /** + * The POP3 PHPMailer Version number. + * + * @var string + */ + const VERSION = '6.5.0'; + + /** + * Default POP3 port number. + * + * @var int + */ + const DEFAULT_PORT = 110; + + /** + * Default timeout in seconds. + * + * @var int + */ + const DEFAULT_TIMEOUT = 30; + + /** + * POP3 class debug output mode. + * Debug output level. + * Options: + * @see POP3::DEBUG_OFF: No output + * @see POP3::DEBUG_SERVER: Server messages, connection/server errors + * @see POP3::DEBUG_CLIENT: Client and Server messages, connection/server errors + * + * @var int + */ + public $do_debug = self::DEBUG_OFF; + + /** + * POP3 mail server hostname. + * + * @var string + */ + public $host; + + /** + * POP3 port number. + * + * @var int + */ + public $port; + + /** + * POP3 Timeout Value in seconds. + * + * @var int + */ + public $tval; + + /** + * POP3 username. + * + * @var string + */ + public $username; + + /** + * POP3 password. + * + * @var string + */ + public $password; + + /** + * Resource handle for the POP3 connection socket. + * + * @var resource + */ + protected $pop_conn; + + /** + * Are we connected? + * + * @var bool + */ + protected $connected = false; + + /** + * Error container. + * + * @var array + */ + protected $errors = []; + + /** + * Line break constant. + */ + const LE = "\r\n"; + + /** + * Debug level for no output. + * + * @var int + */ + const DEBUG_OFF = 0; + + /** + * Debug level to show server -> client messages + * also shows clients connection errors or errors from server + * + * @var int + */ + const DEBUG_SERVER = 1; + + /** + * Debug level to show client -> server and server -> client messages. + * + * @var int + */ + const DEBUG_CLIENT = 2; + + /** + * Simple static wrapper for all-in-one POP before SMTP. + * + * @param string $host The hostname to connect to + * @param int|bool $port The port number to connect to + * @param int|bool $timeout The timeout value + * @param string $username + * @param string $password + * @param int $debug_level + * + * @return bool + */ + public static function popBeforeSmtp( + $host, + $port = false, + $timeout = false, + $username = '', + $password = '', + $debug_level = 0 + ) { + $pop = new self(); + + return $pop->authorise($host, $port, $timeout, $username, $password, $debug_level); + } + + /** + * Authenticate with a POP3 server. + * A connect, login, disconnect sequence + * appropriate for POP-before SMTP authorisation. + * + * @param string $host The hostname to connect to + * @param int|bool $port The port number to connect to + * @param int|bool $timeout The timeout value + * @param string $username + * @param string $password + * @param int $debug_level + * + * @return bool + */ + public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0) + { + $this->host = $host; + //If no port value provided, use default + if (false === $port) { + $this->port = static::DEFAULT_PORT; + } else { + $this->port = (int) $port; + } + //If no timeout value provided, use default + if (false === $timeout) { + $this->tval = static::DEFAULT_TIMEOUT; + } else { + $this->tval = (int) $timeout; + } + $this->do_debug = $debug_level; + $this->username = $username; + $this->password = $password; + //Reset the error log + $this->errors = []; + //Connect + $result = $this->connect($this->host, $this->port, $this->tval); + if ($result) { + $login_result = $this->login($this->username, $this->password); + if ($login_result) { + $this->disconnect(); + + return true; + } + } + //We need to disconnect regardless of whether the login succeeded + $this->disconnect(); + + return false; + } + + /** + * Connect to a POP3 server. + * + * @param string $host + * @param int|bool $port + * @param int $tval + * + * @return bool + */ + public function connect($host, $port = false, $tval = 30) + { + //Are we already connected? + if ($this->connected) { + return true; + } + + //On Windows this will raise a PHP Warning error if the hostname doesn't exist. + //Rather than suppress it with @fsockopen, capture it cleanly instead + set_error_handler([$this, 'catchWarning']); + + if (false === $port) { + $port = static::DEFAULT_PORT; + } + + //Connect to the POP3 server + $errno = 0; + $errstr = ''; + $this->pop_conn = fsockopen( + $host, //POP3 Host + $port, //Port # + $errno, //Error Number + $errstr, //Error Message + $tval + ); //Timeout (seconds) + //Restore the error handler + restore_error_handler(); + + //Did we connect? + if (false === $this->pop_conn) { + //It would appear not... + $this->setError( + "Failed to connect to server $host on port $port. errno: $errno; errstr: $errstr" + ); + + return false; + } + + //Increase the stream time-out + stream_set_timeout($this->pop_conn, $tval, 0); + + //Get the POP3 server response + $pop3_response = $this->getResponse(); + //Check for the +OK + if ($this->checkResponse($pop3_response)) { + //The connection is established and the POP3 server is talking + $this->connected = true; + + return true; + } + + return false; + } + + /** + * Log in to the POP3 server. + * Does not support APOP (RFC 2828, 4949). + * + * @param string $username + * @param string $password + * + * @return bool + */ + public function login($username = '', $password = '') + { + if (!$this->connected) { + $this->setError('Not connected to POP3 server'); + } + if (empty($username)) { + $username = $this->username; + } + if (empty($password)) { + $password = $this->password; + } + + //Send the Username + $this->sendString("USER $username" . static::LE); + $pop3_response = $this->getResponse(); + if ($this->checkResponse($pop3_response)) { + //Send the Password + $this->sendString("PASS $password" . static::LE); + $pop3_response = $this->getResponse(); + if ($this->checkResponse($pop3_response)) { + return true; + } + } + + return false; + } + + /** + * Disconnect from the POP3 server. + */ + public function disconnect() + { + $this->sendString('QUIT'); + //The QUIT command may cause the daemon to exit, which will kill our connection + //So ignore errors here + try { + @fclose($this->pop_conn); + } catch (Exception $e) { + //Do nothing + } + } + + /** + * Get a response from the POP3 server. + * + * @param int $size The maximum number of bytes to retrieve + * + * @return string + */ + protected function getResponse($size = 128) + { + $response = fgets($this->pop_conn, $size); + if ($this->do_debug >= self::DEBUG_SERVER) { + echo 'Server -> Client: ', $response; + } + + return $response; + } + + /** + * Send raw data to the POP3 server. + * + * @param string $string + * + * @return int + */ + protected function sendString($string) + { + if ($this->pop_conn) { + if ($this->do_debug >= self::DEBUG_CLIENT) { //Show client messages when debug >= 2 + echo 'Client -> Server: ', $string; + } + + return fwrite($this->pop_conn, $string, strlen($string)); + } + + return 0; + } + + /** + * Checks the POP3 server response. + * Looks for for +OK or -ERR. + * + * @param string $string + * + * @return bool + */ + protected function checkResponse($string) + { + if (strpos($string, '+OK') !== 0) { + $this->setError("Server reported an error: $string"); + + return false; + } + + return true; + } + + /** + * Add an error to the internal error store. + * Also display debug output if it's enabled. + * + * @param string $error + */ + protected function setError($error) + { + $this->errors[] = $error; + if ($this->do_debug >= self::DEBUG_SERVER) { + echo '
';
+            foreach ($this->errors as $e) {
+                print_r($e);
+            }
+            echo '
'; + } + } + + /** + * Get an array of error messages, if any. + * + * @return array + */ + public function getErrors() + { + return $this->errors; + } + + /** + * POP3 connection error handler. + * + * @param int $errno + * @param string $errstr + * @param string $errfile + * @param int $errline + */ + protected function catchWarning($errno, $errstr, $errfile, $errline) + { + $this->setError( + 'Connecting to the POP3 server raised a PHP warning:' . + "errno: $errno errstr: $errstr; errfile: $errfile; errline: $errline" + ); + } +} diff --git a/vendor/phpmailer/phpmailer/src/SMTP.php b/vendor/phpmailer/phpmailer/src/SMTP.php new file mode 100644 index 0000000..a1b09dc --- /dev/null +++ b/vendor/phpmailer/phpmailer/src/SMTP.php @@ -0,0 +1,1456 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2020 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * PHPMailer RFC821 SMTP email transport class. + * Implements RFC 821 SMTP commands and provides some utility methods for sending mail to an SMTP server. + * + * @author Chris Ryan + * @author Marcus Bointon + */ +class SMTP +{ + /** + * The PHPMailer SMTP version number. + * + * @var string + */ + const VERSION = '6.5.0'; + + /** + * SMTP line break constant. + * + * @var string + */ + const LE = "\r\n"; + + /** + * The SMTP port to use if one is not specified. + * + * @var int + */ + const DEFAULT_PORT = 25; + + /** + * The maximum line length allowed by RFC 5321 section 4.5.3.1.6, + * *excluding* a trailing CRLF break. + * + * @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.6 + * + * @var int + */ + const MAX_LINE_LENGTH = 998; + + /** + * The maximum line length allowed for replies in RFC 5321 section 4.5.3.1.5, + * *including* a trailing CRLF line break. + * + * @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.5 + * + * @var int + */ + const MAX_REPLY_LENGTH = 512; + + /** + * Debug level for no output. + * + * @var int + */ + const DEBUG_OFF = 0; + + /** + * Debug level to show client -> server messages. + * + * @var int + */ + const DEBUG_CLIENT = 1; + + /** + * Debug level to show client -> server and server -> client messages. + * + * @var int + */ + const DEBUG_SERVER = 2; + + /** + * Debug level to show connection status, client -> server and server -> client messages. + * + * @var int + */ + const DEBUG_CONNECTION = 3; + + /** + * Debug level to show all messages. + * + * @var int + */ + const DEBUG_LOWLEVEL = 4; + + /** + * Debug output level. + * Options: + * * self::DEBUG_OFF (`0`) No debug output, default + * * self::DEBUG_CLIENT (`1`) Client commands + * * self::DEBUG_SERVER (`2`) Client commands and server responses + * * self::DEBUG_CONNECTION (`3`) As DEBUG_SERVER plus connection status + * * self::DEBUG_LOWLEVEL (`4`) Low-level data output, all messages. + * + * @var int + */ + public $do_debug = self::DEBUG_OFF; + + /** + * How to handle debug output. + * Options: + * * `echo` Output plain-text as-is, appropriate for CLI + * * `html` Output escaped, line breaks converted to `
`, appropriate for browser output + * * `error_log` Output to error log as configured in php.ini + * Alternatively, you can provide a callable expecting two params: a message string and the debug level: + * + * ```php + * $smtp->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";}; + * ``` + * + * Alternatively, you can pass in an instance of a PSR-3 compatible logger, though only `debug` + * level output is used: + * + * ```php + * $mail->Debugoutput = new myPsr3Logger; + * ``` + * + * @var string|callable|\Psr\Log\LoggerInterface + */ + public $Debugoutput = 'echo'; + + /** + * Whether to use VERP. + * + * @see http://en.wikipedia.org/wiki/Variable_envelope_return_path + * @see http://www.postfix.org/VERP_README.html Info on VERP + * + * @var bool + */ + public $do_verp = false; + + /** + * The timeout value for connection, in seconds. + * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2. + * This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure. + * + * @see http://tools.ietf.org/html/rfc2821#section-4.5.3.2 + * + * @var int + */ + public $Timeout = 300; + + /** + * How long to wait for commands to complete, in seconds. + * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2. + * + * @var int + */ + public $Timelimit = 300; + + /** + * Patterns to extract an SMTP transaction id from reply to a DATA command. + * The first capture group in each regex will be used as the ID. + * MS ESMTP returns the message ID, which may not be correct for internal tracking. + * + * @var string[] + */ + protected $smtp_transaction_id_patterns = [ + 'exim' => '/[\d]{3} OK id=(.*)/', + 'sendmail' => '/[\d]{3} 2.0.0 (.*) Message/', + 'postfix' => '/[\d]{3} 2.0.0 Ok: queued as (.*)/', + 'Microsoft_ESMTP' => '/[0-9]{3} 2.[\d].0 (.*)@(?:.*) Queued mail for delivery/', + 'Amazon_SES' => '/[\d]{3} Ok (.*)/', + 'SendGrid' => '/[\d]{3} Ok: queued as (.*)/', + 'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/', + 'Haraka' => '/[\d]{3} Message Queued \((.*)\)/', + ]; + + /** + * The last transaction ID issued in response to a DATA command, + * if one was detected. + * + * @var string|bool|null + */ + protected $last_smtp_transaction_id; + + /** + * The socket for the server connection. + * + * @var ?resource + */ + protected $smtp_conn; + + /** + * Error information, if any, for the last SMTP command. + * + * @var array + */ + protected $error = [ + 'error' => '', + 'detail' => '', + 'smtp_code' => '', + 'smtp_code_ex' => '', + ]; + + /** + * The reply the server sent to us for HELO. + * If null, no HELO string has yet been received. + * + * @var string|null + */ + protected $helo_rply; + + /** + * The set of SMTP extensions sent in reply to EHLO command. + * Indexes of the array are extension names. + * Value at index 'HELO' or 'EHLO' (according to command that was sent) + * represents the server name. In case of HELO it is the only element of the array. + * Other values can be boolean TRUE or an array containing extension options. + * If null, no HELO/EHLO string has yet been received. + * + * @var array|null + */ + protected $server_caps; + + /** + * The most recent reply received from the server. + * + * @var string + */ + protected $last_reply = ''; + + /** + * Output debugging info via a user-selected method. + * + * @param string $str Debug string to output + * @param int $level The debug level of this message; see DEBUG_* constants + * + * @see SMTP::$Debugoutput + * @see SMTP::$do_debug + */ + protected function edebug($str, $level = 0) + { + if ($level > $this->do_debug) { + return; + } + //Is this a PSR-3 logger? + if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) { + $this->Debugoutput->debug($str); + + return; + } + //Avoid clash with built-in function names + if (is_callable($this->Debugoutput) && !in_array($this->Debugoutput, ['error_log', 'html', 'echo'])) { + call_user_func($this->Debugoutput, $str, $level); + + return; + } + switch ($this->Debugoutput) { + case 'error_log': + //Don't output, just log + error_log($str); + break; + case 'html': + //Cleans up output a bit for a better looking, HTML-safe output + echo gmdate('Y-m-d H:i:s'), ' ', htmlentities( + preg_replace('/[\r\n]+/', '', $str), + ENT_QUOTES, + 'UTF-8' + ), "
\n"; + break; + case 'echo': + default: + //Normalize line breaks + $str = preg_replace('/\r\n|\r/m', "\n", $str); + echo gmdate('Y-m-d H:i:s'), + "\t", + //Trim trailing space + trim( + //Indent for readability, except for trailing break + str_replace( + "\n", + "\n \t ", + trim($str) + ) + ), + "\n"; + } + } + + /** + * Connect to an SMTP server. + * + * @param string $host SMTP server IP or host name + * @param int $port The port number to connect to + * @param int $timeout How long to wait for the connection to open + * @param array $options An array of options for stream_context_create() + * + * @return bool + */ + public function connect($host, $port = null, $timeout = 30, $options = []) + { + //Clear errors to avoid confusion + $this->setError(''); + //Make sure we are __not__ connected + if ($this->connected()) { + //Already connected, generate error + $this->setError('Already connected to a server'); + + return false; + } + if (empty($port)) { + $port = self::DEFAULT_PORT; + } + //Connect to the SMTP server + $this->edebug( + "Connection: opening to $host:$port, timeout=$timeout, options=" . + (count($options) > 0 ? var_export($options, true) : 'array()'), + self::DEBUG_CONNECTION + ); + + $this->smtp_conn = $this->getSMTPConnection($host, $port, $timeout, $options); + + if ($this->smtp_conn === false) { + //Error info already set inside `getSMTPConnection()` + return false; + } + + $this->edebug('Connection: opened', self::DEBUG_CONNECTION); + + //Get any announcement + $this->last_reply = $this->get_lines(); + $this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER); + $responseCode = (int)substr($this->last_reply, 0, 3); + if ($responseCode === 220) { + return true; + } + //Anything other than a 220 response means something went wrong + //RFC 5321 says the server will wait for us to send a QUIT in response to a 554 error + //https://tools.ietf.org/html/rfc5321#section-3.1 + if ($responseCode === 554) { + $this->quit(); + } + //This will handle 421 responses which may not wait for a QUIT (e.g. if the server is being shut down) + $this->edebug('Connection: closing due to error', self::DEBUG_CONNECTION); + $this->close(); + return false; + } + + /** + * Create connection to the SMTP server. + * + * @param string $host SMTP server IP or host name + * @param int $port The port number to connect to + * @param int $timeout How long to wait for the connection to open + * @param array $options An array of options for stream_context_create() + * + * @return false|resource + */ + protected function getSMTPConnection($host, $port = null, $timeout = 30, $options = []) + { + static $streamok; + //This is enabled by default since 5.0.0 but some providers disable it + //Check this once and cache the result + if (null === $streamok) { + $streamok = function_exists('stream_socket_client'); + } + + $errno = 0; + $errstr = ''; + if ($streamok) { + $socket_context = stream_context_create($options); + set_error_handler([$this, 'errorHandler']); + $connection = stream_socket_client( + $host . ':' . $port, + $errno, + $errstr, + $timeout, + STREAM_CLIENT_CONNECT, + $socket_context + ); + restore_error_handler(); + } else { + //Fall back to fsockopen which should work in more places, but is missing some features + $this->edebug( + 'Connection: stream_socket_client not available, falling back to fsockopen', + self::DEBUG_CONNECTION + ); + set_error_handler([$this, 'errorHandler']); + $connection = fsockopen( + $host, + $port, + $errno, + $errstr, + $timeout + ); + restore_error_handler(); + } + + //Verify we connected properly + if (!is_resource($connection)) { + $this->setError( + 'Failed to connect to server', + '', + (string) $errno, + $errstr + ); + $this->edebug( + 'SMTP ERROR: ' . $this->error['error'] + . ": $errstr ($errno)", + self::DEBUG_CLIENT + ); + + return false; + } + + //SMTP server can take longer to respond, give longer timeout for first read + //Windows does not have support for this timeout function + if (strpos(PHP_OS, 'WIN') !== 0) { + $max = (int)ini_get('max_execution_time'); + //Don't bother if unlimited, or if set_time_limit is disabled + if (0 !== $max && $timeout > $max && strpos(ini_get('disable_functions'), 'set_time_limit') === false) { + @set_time_limit($timeout); + } + stream_set_timeout($connection, $timeout, 0); + } + + return $connection; + } + + /** + * Initiate a TLS (encrypted) session. + * + * @return bool + */ + public function startTLS() + { + if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) { + return false; + } + + //Allow the best TLS version(s) we can + $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT; + + //PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT + //so add them back in manually if we can + if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) { + $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; + $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; + } + + //Begin encrypted connection + set_error_handler([$this, 'errorHandler']); + $crypto_ok = stream_socket_enable_crypto( + $this->smtp_conn, + true, + $crypto_method + ); + restore_error_handler(); + + return (bool) $crypto_ok; + } + + /** + * Perform SMTP authentication. + * Must be run after hello(). + * + * @see hello() + * + * @param string $username The user name + * @param string $password The password + * @param string $authtype The auth type (CRAM-MD5, PLAIN, LOGIN, XOAUTH2) + * @param OAuth $OAuth An optional OAuth instance for XOAUTH2 authentication + * + * @return bool True if successfully authenticated + */ + public function authenticate( + $username, + $password, + $authtype = null, + $OAuth = null + ) { + if (!$this->server_caps) { + $this->setError('Authentication is not allowed before HELO/EHLO'); + + return false; + } + + if (array_key_exists('EHLO', $this->server_caps)) { + //SMTP extensions are available; try to find a proper authentication method + if (!array_key_exists('AUTH', $this->server_caps)) { + $this->setError('Authentication is not allowed at this stage'); + //'at this stage' means that auth may be allowed after the stage changes + //e.g. after STARTTLS + + return false; + } + + $this->edebug('Auth method requested: ' . ($authtype ?: 'UNSPECIFIED'), self::DEBUG_LOWLEVEL); + $this->edebug( + 'Auth methods available on the server: ' . implode(',', $this->server_caps['AUTH']), + self::DEBUG_LOWLEVEL + ); + + //If we have requested a specific auth type, check the server supports it before trying others + if (null !== $authtype && !in_array($authtype, $this->server_caps['AUTH'], true)) { + $this->edebug('Requested auth method not available: ' . $authtype, self::DEBUG_LOWLEVEL); + $authtype = null; + } + + if (empty($authtype)) { + //If no auth mechanism is specified, attempt to use these, in this order + //Try CRAM-MD5 first as it's more secure than the others + foreach (['CRAM-MD5', 'LOGIN', 'PLAIN', 'XOAUTH2'] as $method) { + if (in_array($method, $this->server_caps['AUTH'], true)) { + $authtype = $method; + break; + } + } + if (empty($authtype)) { + $this->setError('No supported authentication methods found'); + + return false; + } + $this->edebug('Auth method selected: ' . $authtype, self::DEBUG_LOWLEVEL); + } + + if (!in_array($authtype, $this->server_caps['AUTH'], true)) { + $this->setError("The requested authentication method \"$authtype\" is not supported by the server"); + + return false; + } + } elseif (empty($authtype)) { + $authtype = 'LOGIN'; + } + switch ($authtype) { + case 'PLAIN': + //Start authentication + if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) { + return false; + } + //Send encoded username and password + if ( + //Format from https://tools.ietf.org/html/rfc4616#section-2 + //We skip the first field (it's forgery), so the string starts with a null byte + !$this->sendCommand( + 'User & Password', + base64_encode("\0" . $username . "\0" . $password), + 235 + ) + ) { + return false; + } + break; + case 'LOGIN': + //Start authentication + if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) { + return false; + } + if (!$this->sendCommand('Username', base64_encode($username), 334)) { + return false; + } + if (!$this->sendCommand('Password', base64_encode($password), 235)) { + return false; + } + break; + case 'CRAM-MD5': + //Start authentication + if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) { + return false; + } + //Get the challenge + $challenge = base64_decode(substr($this->last_reply, 4)); + + //Build the response + $response = $username . ' ' . $this->hmac($challenge, $password); + + //send encoded credentials + return $this->sendCommand('Username', base64_encode($response), 235); + case 'XOAUTH2': + //The OAuth instance must be set up prior to requesting auth. + if (null === $OAuth) { + return false; + } + $oauth = $OAuth->getOauth64(); + + //Start authentication + if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) { + return false; + } + break; + default: + $this->setError("Authentication method \"$authtype\" is not supported"); + + return false; + } + + return true; + } + + /** + * Calculate an MD5 HMAC hash. + * Works like hash_hmac('md5', $data, $key) + * in case that function is not available. + * + * @param string $data The data to hash + * @param string $key The key to hash with + * + * @return string + */ + protected function hmac($data, $key) + { + if (function_exists('hash_hmac')) { + return hash_hmac('md5', $data, $key); + } + + //The following borrowed from + //http://php.net/manual/en/function.mhash.php#27225 + + //RFC 2104 HMAC implementation for php. + //Creates an md5 HMAC. + //Eliminates the need to install mhash to compute a HMAC + //by Lance Rushing + + $bytelen = 64; //byte length for md5 + if (strlen($key) > $bytelen) { + $key = pack('H*', md5($key)); + } + $key = str_pad($key, $bytelen, chr(0x00)); + $ipad = str_pad('', $bytelen, chr(0x36)); + $opad = str_pad('', $bytelen, chr(0x5c)); + $k_ipad = $key ^ $ipad; + $k_opad = $key ^ $opad; + + return md5($k_opad . pack('H*', md5($k_ipad . $data))); + } + + /** + * Check connection state. + * + * @return bool True if connected + */ + public function connected() + { + if (is_resource($this->smtp_conn)) { + $sock_status = stream_get_meta_data($this->smtp_conn); + if ($sock_status['eof']) { + //The socket is valid but we are not connected + $this->edebug( + 'SMTP NOTICE: EOF caught while checking if connected', + self::DEBUG_CLIENT + ); + $this->close(); + + return false; + } + + return true; //everything looks good + } + + return false; + } + + /** + * Close the socket and clean up the state of the class. + * Don't use this function without first trying to use QUIT. + * + * @see quit() + */ + public function close() + { + $this->setError(''); + $this->server_caps = null; + $this->helo_rply = null; + if (is_resource($this->smtp_conn)) { + //Close the connection and cleanup + fclose($this->smtp_conn); + $this->smtp_conn = null; //Makes for cleaner serialization + $this->edebug('Connection: closed', self::DEBUG_CONNECTION); + } + } + + /** + * Send an SMTP DATA command. + * Issues a data command and sends the msg_data to the server, + * finializing the mail transaction. $msg_data is the message + * that is to be send with the headers. Each header needs to be + * on a single line followed by a with the message headers + * and the message body being separated by an additional . + * Implements RFC 821: DATA . + * + * @param string $msg_data Message data to send + * + * @return bool + */ + public function data($msg_data) + { + //This will use the standard timelimit + if (!$this->sendCommand('DATA', 'DATA', 354)) { + return false; + } + + /* The server is ready to accept data! + * According to rfc821 we should not send more than 1000 characters on a single line (including the LE) + * so we will break the data up into lines by \r and/or \n then if needed we will break each of those into + * smaller lines to fit within the limit. + * We will also look for lines that start with a '.' and prepend an additional '.'. + * NOTE: this does not count towards line-length limit. + */ + + //Normalize line breaks before exploding + $lines = explode("\n", str_replace(["\r\n", "\r"], "\n", $msg_data)); + + /* To distinguish between a complete RFC822 message and a plain message body, we check if the first field + * of the first line (':' separated) does not contain a space then it _should_ be a header and we will + * process all lines before a blank line as headers. + */ + + $field = substr($lines[0], 0, strpos($lines[0], ':')); + $in_headers = false; + if (!empty($field) && strpos($field, ' ') === false) { + $in_headers = true; + } + + foreach ($lines as $line) { + $lines_out = []; + if ($in_headers && $line === '') { + $in_headers = false; + } + //Break this line up into several smaller lines if it's too long + //Micro-optimisation: isset($str[$len]) is faster than (strlen($str) > $len), + while (isset($line[self::MAX_LINE_LENGTH])) { + //Working backwards, try to find a space within the last MAX_LINE_LENGTH chars of the line to break on + //so as to avoid breaking in the middle of a word + $pos = strrpos(substr($line, 0, self::MAX_LINE_LENGTH), ' '); + //Deliberately matches both false and 0 + if (!$pos) { + //No nice break found, add a hard break + $pos = self::MAX_LINE_LENGTH - 1; + $lines_out[] = substr($line, 0, $pos); + $line = substr($line, $pos); + } else { + //Break at the found point + $lines_out[] = substr($line, 0, $pos); + //Move along by the amount we dealt with + $line = substr($line, $pos + 1); + } + //If processing headers add a LWSP-char to the front of new line RFC822 section 3.1.1 + if ($in_headers) { + $line = "\t" . $line; + } + } + $lines_out[] = $line; + + //Send the lines to the server + foreach ($lines_out as $line_out) { + //Dot-stuffing as per RFC5321 section 4.5.2 + //https://tools.ietf.org/html/rfc5321#section-4.5.2 + if (!empty($line_out) && $line_out[0] === '.') { + $line_out = '.' . $line_out; + } + $this->client_send($line_out . static::LE, 'DATA'); + } + } + + //Message data has been sent, complete the command + //Increase timelimit for end of DATA command + $savetimelimit = $this->Timelimit; + $this->Timelimit *= 2; + $result = $this->sendCommand('DATA END', '.', 250); + $this->recordLastTransactionID(); + //Restore timelimit + $this->Timelimit = $savetimelimit; + + return $result; + } + + /** + * Send an SMTP HELO or EHLO command. + * Used to identify the sending server to the receiving server. + * This makes sure that client and server are in a known state. + * Implements RFC 821: HELO + * and RFC 2821 EHLO. + * + * @param string $host The host name or IP to connect to + * + * @return bool + */ + public function hello($host = '') + { + //Try extended hello first (RFC 2821) + if ($this->sendHello('EHLO', $host)) { + return true; + } + + //Some servers shut down the SMTP service here (RFC 5321) + if (substr($this->helo_rply, 0, 3) == '421') { + return false; + } + + return $this->sendHello('HELO', $host); + } + + /** + * Send an SMTP HELO or EHLO command. + * Low-level implementation used by hello(). + * + * @param string $hello The HELO string + * @param string $host The hostname to say we are + * + * @return bool + * + * @see hello() + */ + protected function sendHello($hello, $host) + { + $noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250); + $this->helo_rply = $this->last_reply; + if ($noerror) { + $this->parseHelloFields($hello); + } else { + $this->server_caps = null; + } + + return $noerror; + } + + /** + * Parse a reply to HELO/EHLO command to discover server extensions. + * In case of HELO, the only parameter that can be discovered is a server name. + * + * @param string $type `HELO` or `EHLO` + */ + protected function parseHelloFields($type) + { + $this->server_caps = []; + $lines = explode("\n", $this->helo_rply); + + foreach ($lines as $n => $s) { + //First 4 chars contain response code followed by - or space + $s = trim(substr($s, 4)); + if (empty($s)) { + continue; + } + $fields = explode(' ', $s); + if (!empty($fields)) { + if (!$n) { + $name = $type; + $fields = $fields[0]; + } else { + $name = array_shift($fields); + switch ($name) { + case 'SIZE': + $fields = ($fields ? $fields[0] : 0); + break; + case 'AUTH': + if (!is_array($fields)) { + $fields = []; + } + break; + default: + $fields = true; + } + } + $this->server_caps[$name] = $fields; + } + } + } + + /** + * Send an SMTP MAIL command. + * Starts a mail transaction from the email address specified in + * $from. Returns true if successful or false otherwise. If True + * the mail transaction is started and then one or more recipient + * commands may be called followed by a data command. + * Implements RFC 821: MAIL FROM: . + * + * @param string $from Source address of this message + * + * @return bool + */ + public function mail($from) + { + $useVerp = ($this->do_verp ? ' XVERP' : ''); + + return $this->sendCommand( + 'MAIL FROM', + 'MAIL FROM:<' . $from . '>' . $useVerp, + 250 + ); + } + + /** + * Send an SMTP QUIT command. + * Closes the socket if there is no error or the $close_on_error argument is true. + * Implements from RFC 821: QUIT . + * + * @param bool $close_on_error Should the connection close if an error occurs? + * + * @return bool + */ + public function quit($close_on_error = true) + { + $noerror = $this->sendCommand('QUIT', 'QUIT', 221); + $err = $this->error; //Save any error + if ($noerror || $close_on_error) { + $this->close(); + $this->error = $err; //Restore any error from the quit command + } + + return $noerror; + } + + /** + * Send an SMTP RCPT command. + * Sets the TO argument to $toaddr. + * Returns true if the recipient was accepted false if it was rejected. + * Implements from RFC 821: RCPT TO: . + * + * @param string $address The address the message is being sent to + * @param string $dsn Comma separated list of DSN notifications. NEVER, SUCCESS, FAILURE + * or DELAY. If you specify NEVER all other notifications are ignored. + * + * @return bool + */ + public function recipient($address, $dsn = '') + { + if (empty($dsn)) { + $rcpt = 'RCPT TO:<' . $address . '>'; + } else { + $dsn = strtoupper($dsn); + $notify = []; + + if (strpos($dsn, 'NEVER') !== false) { + $notify[] = 'NEVER'; + } else { + foreach (['SUCCESS', 'FAILURE', 'DELAY'] as $value) { + if (strpos($dsn, $value) !== false) { + $notify[] = $value; + } + } + } + + $rcpt = 'RCPT TO:<' . $address . '> NOTIFY=' . implode(',', $notify); + } + + return $this->sendCommand( + 'RCPT TO', + $rcpt, + [250, 251] + ); + } + + /** + * Send an SMTP RSET command. + * Abort any transaction that is currently in progress. + * Implements RFC 821: RSET . + * + * @return bool True on success + */ + public function reset() + { + return $this->sendCommand('RSET', 'RSET', 250); + } + + /** + * Send a command to an SMTP server and check its return code. + * + * @param string $command The command name - not sent to the server + * @param string $commandstring The actual command to send + * @param int|array $expect One or more expected integer success codes + * + * @return bool True on success + */ + protected function sendCommand($command, $commandstring, $expect) + { + if (!$this->connected()) { + $this->setError("Called $command without being connected"); + + return false; + } + //Reject line breaks in all commands + if ((strpos($commandstring, "\n") !== false) || (strpos($commandstring, "\r") !== false)) { + $this->setError("Command '$command' contained line breaks"); + + return false; + } + $this->client_send($commandstring . static::LE, $command); + + $this->last_reply = $this->get_lines(); + //Fetch SMTP code and possible error code explanation + $matches = []; + if (preg_match('/^([\d]{3})[ -](?:([\d]\\.[\d]\\.[\d]{1,2}) )?/', $this->last_reply, $matches)) { + $code = (int) $matches[1]; + $code_ex = (count($matches) > 2 ? $matches[2] : null); + //Cut off error code from each response line + $detail = preg_replace( + "/{$code}[ -]" . + ($code_ex ? str_replace('.', '\\.', $code_ex) . ' ' : '') . '/m', + '', + $this->last_reply + ); + } else { + //Fall back to simple parsing if regex fails + $code = (int) substr($this->last_reply, 0, 3); + $code_ex = null; + $detail = substr($this->last_reply, 4); + } + + $this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER); + + if (!in_array($code, (array) $expect, true)) { + $this->setError( + "$command command failed", + $detail, + $code, + $code_ex + ); + $this->edebug( + 'SMTP ERROR: ' . $this->error['error'] . ': ' . $this->last_reply, + self::DEBUG_CLIENT + ); + + return false; + } + + $this->setError(''); + + return true; + } + + /** + * Send an SMTP SAML command. + * Starts a mail transaction from the email address specified in $from. + * Returns true if successful or false otherwise. If True + * the mail transaction is started and then one or more recipient + * commands may be called followed by a data command. This command + * will send the message to the users terminal if they are logged + * in and send them an email. + * Implements RFC 821: SAML FROM: . + * + * @param string $from The address the message is from + * + * @return bool + */ + public function sendAndMail($from) + { + return $this->sendCommand('SAML', "SAML FROM:$from", 250); + } + + /** + * Send an SMTP VRFY command. + * + * @param string $name The name to verify + * + * @return bool + */ + public function verify($name) + { + return $this->sendCommand('VRFY', "VRFY $name", [250, 251]); + } + + /** + * Send an SMTP NOOP command. + * Used to keep keep-alives alive, doesn't actually do anything. + * + * @return bool + */ + public function noop() + { + return $this->sendCommand('NOOP', 'NOOP', 250); + } + + /** + * Send an SMTP TURN command. + * This is an optional command for SMTP that this class does not support. + * This method is here to make the RFC821 Definition complete for this class + * and _may_ be implemented in future. + * Implements from RFC 821: TURN . + * + * @return bool + */ + public function turn() + { + $this->setError('The SMTP TURN command is not implemented'); + $this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT); + + return false; + } + + /** + * Send raw data to the server. + * + * @param string $data The data to send + * @param string $command Optionally, the command this is part of, used only for controlling debug output + * + * @return int|bool The number of bytes sent to the server or false on error + */ + public function client_send($data, $command = '') + { + //If SMTP transcripts are left enabled, or debug output is posted online + //it can leak credentials, so hide credentials in all but lowest level + if ( + self::DEBUG_LOWLEVEL > $this->do_debug && + in_array($command, ['User & Password', 'Username', 'Password'], true) + ) { + $this->edebug('CLIENT -> SERVER: [credentials hidden]', self::DEBUG_CLIENT); + } else { + $this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT); + } + set_error_handler([$this, 'errorHandler']); + $result = fwrite($this->smtp_conn, $data); + restore_error_handler(); + + return $result; + } + + /** + * Get the latest error. + * + * @return array + */ + public function getError() + { + return $this->error; + } + + /** + * Get SMTP extensions available on the server. + * + * @return array|null + */ + public function getServerExtList() + { + return $this->server_caps; + } + + /** + * Get metadata about the SMTP server from its HELO/EHLO response. + * The method works in three ways, dependent on argument value and current state: + * 1. HELO/EHLO has not been sent - returns null and populates $this->error. + * 2. HELO has been sent - + * $name == 'HELO': returns server name + * $name == 'EHLO': returns boolean false + * $name == any other string: returns null and populates $this->error + * 3. EHLO has been sent - + * $name == 'HELO'|'EHLO': returns the server name + * $name == any other string: if extension $name exists, returns True + * or its options (e.g. AUTH mechanisms supported). Otherwise returns False. + * + * @param string $name Name of SMTP extension or 'HELO'|'EHLO' + * + * @return string|bool|null + */ + public function getServerExt($name) + { + if (!$this->server_caps) { + $this->setError('No HELO/EHLO was sent'); + + return; + } + + if (!array_key_exists($name, $this->server_caps)) { + if ('HELO' === $name) { + return $this->server_caps['EHLO']; + } + if ('EHLO' === $name || array_key_exists('EHLO', $this->server_caps)) { + return false; + } + $this->setError('HELO handshake was used; No information about server extensions available'); + + return; + } + + return $this->server_caps[$name]; + } + + /** + * Get the last reply from the server. + * + * @return string + */ + public function getLastReply() + { + return $this->last_reply; + } + + /** + * Read the SMTP server's response. + * Either before eof or socket timeout occurs on the operation. + * With SMTP we can tell if we have more lines to read if the + * 4th character is '-' symbol. If it is a space then we don't + * need to read anything else. + * + * @return string + */ + protected function get_lines() + { + //If the connection is bad, give up straight away + if (!is_resource($this->smtp_conn)) { + return ''; + } + $data = ''; + $endtime = 0; + stream_set_timeout($this->smtp_conn, $this->Timeout); + if ($this->Timelimit > 0) { + $endtime = time() + $this->Timelimit; + } + $selR = [$this->smtp_conn]; + $selW = null; + while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) { + //Must pass vars in here as params are by reference + //solution for signals inspired by https://github.com/symfony/symfony/pull/6540 + set_error_handler([$this, 'errorHandler']); + $n = stream_select($selR, $selW, $selW, $this->Timelimit); + restore_error_handler(); + + if ($n === false) { + $message = $this->getError()['detail']; + + $this->edebug( + 'SMTP -> get_lines(): select failed (' . $message . ')', + self::DEBUG_LOWLEVEL + ); + + //stream_select returns false when the `select` system call is interrupted + //by an incoming signal, try the select again + if (stripos($message, 'interrupted system call') !== false) { + $this->edebug( + 'SMTP -> get_lines(): retrying stream_select', + self::DEBUG_LOWLEVEL + ); + $this->setError(''); + continue; + } + + break; + } + + if (!$n) { + $this->edebug( + 'SMTP -> get_lines(): select timed-out in (' . $this->Timelimit . ' sec)', + self::DEBUG_LOWLEVEL + ); + break; + } + + //Deliberate noise suppression - errors are handled afterwards + $str = @fgets($this->smtp_conn, self::MAX_REPLY_LENGTH); + $this->edebug('SMTP INBOUND: "' . trim($str) . '"', self::DEBUG_LOWLEVEL); + $data .= $str; + //If response is only 3 chars (not valid, but RFC5321 S4.2 says it must be handled), + //or 4th character is a space or a line break char, we are done reading, break the loop. + //String array access is a significant micro-optimisation over strlen + if (!isset($str[3]) || $str[3] === ' ' || $str[3] === "\r" || $str[3] === "\n") { + break; + } + //Timed-out? Log and break + $info = stream_get_meta_data($this->smtp_conn); + if ($info['timed_out']) { + $this->edebug( + 'SMTP -> get_lines(): stream timed-out (' . $this->Timeout . ' sec)', + self::DEBUG_LOWLEVEL + ); + break; + } + //Now check if reads took too long + if ($endtime && time() > $endtime) { + $this->edebug( + 'SMTP -> get_lines(): timelimit reached (' . + $this->Timelimit . ' sec)', + self::DEBUG_LOWLEVEL + ); + break; + } + } + + return $data; + } + + /** + * Enable or disable VERP address generation. + * + * @param bool $enabled + */ + public function setVerp($enabled = false) + { + $this->do_verp = $enabled; + } + + /** + * Get VERP address generation mode. + * + * @return bool + */ + public function getVerp() + { + return $this->do_verp; + } + + /** + * Set error messages and codes. + * + * @param string $message The error message + * @param string $detail Further detail on the error + * @param string $smtp_code An associated SMTP error code + * @param string $smtp_code_ex Extended SMTP code + */ + protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '') + { + $this->error = [ + 'error' => $message, + 'detail' => $detail, + 'smtp_code' => $smtp_code, + 'smtp_code_ex' => $smtp_code_ex, + ]; + } + + /** + * Set debug output method. + * + * @param string|callable $method The name of the mechanism to use for debugging output, or a callable to handle it + */ + public function setDebugOutput($method = 'echo') + { + $this->Debugoutput = $method; + } + + /** + * Get debug output method. + * + * @return string + */ + public function getDebugOutput() + { + return $this->Debugoutput; + } + + /** + * Set debug output level. + * + * @param int $level + */ + public function setDebugLevel($level = 0) + { + $this->do_debug = $level; + } + + /** + * Get debug output level. + * + * @return int + */ + public function getDebugLevel() + { + return $this->do_debug; + } + + /** + * Set SMTP timeout. + * + * @param int $timeout The timeout duration in seconds + */ + public function setTimeout($timeout = 0) + { + $this->Timeout = $timeout; + } + + /** + * Get SMTP timeout. + * + * @return int + */ + public function getTimeout() + { + return $this->Timeout; + } + + /** + * Reports an error number and string. + * + * @param int $errno The error number returned by PHP + * @param string $errmsg The error message returned by PHP + * @param string $errfile The file the error occurred in + * @param int $errline The line number the error occurred on + */ + protected function errorHandler($errno, $errmsg, $errfile = '', $errline = 0) + { + $notice = 'Connection failed.'; + $this->setError( + $notice, + $errmsg, + (string) $errno + ); + $this->edebug( + "$notice Error #$errno: $errmsg [$errfile line $errline]", + self::DEBUG_CONNECTION + ); + } + + /** + * Extract and return the ID of the last SMTP transaction based on + * a list of patterns provided in SMTP::$smtp_transaction_id_patterns. + * Relies on the host providing the ID in response to a DATA command. + * If no reply has been received yet, it will return null. + * If no pattern was matched, it will return false. + * + * @return bool|string|null + */ + protected function recordLastTransactionID() + { + $reply = $this->getLastReply(); + + if (empty($reply)) { + $this->last_smtp_transaction_id = null; + } else { + $this->last_smtp_transaction_id = false; + foreach ($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) { + $matches = []; + if (preg_match($smtp_transaction_id_pattern, $reply, $matches)) { + $this->last_smtp_transaction_id = trim($matches[1]); + break; + } + } + } + + return $this->last_smtp_transaction_id; + } + + /** + * Get the queue/transaction ID of the last SMTP transaction + * If no reply has been received yet, it will return null. + * If no pattern was matched, it will return false. + * + * @return bool|string|null + * + * @see recordLastTransactionID() + */ + public function getLastTransactionID() + { + return $this->last_smtp_transaction_id; + } +} diff --git a/vendor/psr/http-message/CHANGELOG.md b/vendor/psr/http-message/CHANGELOG.md new file mode 100644 index 0000000..74b1ef9 --- /dev/null +++ b/vendor/psr/http-message/CHANGELOG.md @@ -0,0 +1,36 @@ +# Changelog + +All notable changes to this project will be documented in this file, in reverse chronological order by release. + +## 1.0.1 - 2016-08-06 + +### Added + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Updated all `@return self` annotation references in interfaces to use + `@return static`, which more closelly follows the semantics of the + specification. +- Updated the `MessageInterface::getHeaders()` return annotation to use the + value `string[][]`, indicating the format is a nested array of strings. +- Updated the `@link` annotation for `RequestInterface::withRequestTarget()` + to point to the correct section of RFC 7230. +- Updated the `ServerRequestInterface::withUploadedFiles()` parameter annotation + to add the parameter name (`$uploadedFiles`). +- Updated a `@throws` annotation for the `UploadedFileInterface::moveTo()` + method to correctly reference the method parameter (it was referencing an + incorrect parameter name previously). + +## 1.0.0 - 2016-05-18 + +Initial stable release; reflects accepted PSR-7 specification. diff --git a/vendor/psr/http-message/LICENSE b/vendor/psr/http-message/LICENSE new file mode 100644 index 0000000..c2d8e45 --- /dev/null +++ b/vendor/psr/http-message/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014 PHP Framework Interoperability Group + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/psr/http-message/README.md b/vendor/psr/http-message/README.md new file mode 100644 index 0000000..2818533 --- /dev/null +++ b/vendor/psr/http-message/README.md @@ -0,0 +1,13 @@ +PSR Http Message +================ + +This repository holds all interfaces/classes/traits related to +[PSR-7](http://www.php-fig.org/psr/psr-7/). + +Note that this is not a HTTP message implementation of its own. It is merely an +interface that describes a HTTP message. See the specification for more details. + +Usage +----- + +We'll certainly need some stuff in here. \ No newline at end of file diff --git a/vendor/psr/http-message/composer.json b/vendor/psr/http-message/composer.json new file mode 100644 index 0000000..b0d2937 --- /dev/null +++ b/vendor/psr/http-message/composer.json @@ -0,0 +1,26 @@ +{ + "name": "psr/http-message", + "description": "Common interface for HTTP messages", + "keywords": ["psr", "psr-7", "http", "http-message", "request", "response"], + "homepage": "https://github.com/php-fig/http-message", + "license": "MIT", + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "require": { + "php": ">=5.3.0" + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + } +} diff --git a/vendor/psr/http-message/src/MessageInterface.php b/vendor/psr/http-message/src/MessageInterface.php new file mode 100644 index 0000000..dd46e5e --- /dev/null +++ b/vendor/psr/http-message/src/MessageInterface.php @@ -0,0 +1,187 @@ +getHeaders() as $name => $values) { + * echo $name . ": " . implode(", ", $values); + * } + * + * // Emit headers iteratively: + * foreach ($message->getHeaders() as $name => $values) { + * foreach ($values as $value) { + * header(sprintf('%s: %s', $name, $value), false); + * } + * } + * + * While header names are not case-sensitive, getHeaders() will preserve the + * exact case in which headers were originally specified. + * + * @return string[][] Returns an associative array of the message's headers. Each + * key MUST be a header name, and each value MUST be an array of strings + * for that header. + */ + public function getHeaders(); + + /** + * Checks if a header exists by the given case-insensitive name. + * + * @param string $name Case-insensitive header field name. + * @return bool Returns true if any header names match the given header + * name using a case-insensitive string comparison. Returns false if + * no matching header name is found in the message. + */ + public function hasHeader($name); + + /** + * Retrieves a message header value by the given case-insensitive name. + * + * This method returns an array of all the header values of the given + * case-insensitive header name. + * + * If the header does not appear in the message, this method MUST return an + * empty array. + * + * @param string $name Case-insensitive header field name. + * @return string[] An array of string values as provided for the given + * header. If the header does not appear in the message, this method MUST + * return an empty array. + */ + public function getHeader($name); + + /** + * Retrieves a comma-separated string of the values for a single header. + * + * This method returns all of the header values of the given + * case-insensitive header name as a string concatenated together using + * a comma. + * + * NOTE: Not all header values may be appropriately represented using + * comma concatenation. For such headers, use getHeader() instead + * and supply your own delimiter when concatenating. + * + * If the header does not appear in the message, this method MUST return + * an empty string. + * + * @param string $name Case-insensitive header field name. + * @return string A string of values as provided for the given header + * concatenated together using a comma. If the header does not appear in + * the message, this method MUST return an empty string. + */ + public function getHeaderLine($name); + + /** + * Return an instance with the provided value replacing the specified header. + * + * While header names are case-insensitive, the casing of the header will + * be preserved by this function, and returned from getHeaders(). + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * new and/or updated header and value. + * + * @param string $name Case-insensitive header field name. + * @param string|string[] $value Header value(s). + * @return static + * @throws \InvalidArgumentException for invalid header names or values. + */ + public function withHeader($name, $value); + + /** + * Return an instance with the specified header appended with the given value. + * + * Existing values for the specified header will be maintained. The new + * value(s) will be appended to the existing list. If the header did not + * exist previously, it will be added. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * new header and/or value. + * + * @param string $name Case-insensitive header field name to add. + * @param string|string[] $value Header value(s). + * @return static + * @throws \InvalidArgumentException for invalid header names or values. + */ + public function withAddedHeader($name, $value); + + /** + * Return an instance without the specified header. + * + * Header resolution MUST be done without case-sensitivity. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that removes + * the named header. + * + * @param string $name Case-insensitive header field name to remove. + * @return static + */ + public function withoutHeader($name); + + /** + * Gets the body of the message. + * + * @return StreamInterface Returns the body as a stream. + */ + public function getBody(); + + /** + * Return an instance with the specified message body. + * + * The body MUST be a StreamInterface object. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return a new instance that has the + * new body stream. + * + * @param StreamInterface $body Body. + * @return static + * @throws \InvalidArgumentException When the body is not valid. + */ + public function withBody(StreamInterface $body); +} diff --git a/vendor/psr/http-message/src/RequestInterface.php b/vendor/psr/http-message/src/RequestInterface.php new file mode 100644 index 0000000..a96d4fd --- /dev/null +++ b/vendor/psr/http-message/src/RequestInterface.php @@ -0,0 +1,129 @@ +getQuery()` + * or from the `QUERY_STRING` server param. + * + * @return array + */ + public function getQueryParams(); + + /** + * Return an instance with the specified query string arguments. + * + * These values SHOULD remain immutable over the course of the incoming + * request. They MAY be injected during instantiation, such as from PHP's + * $_GET superglobal, or MAY be derived from some other value such as the + * URI. In cases where the arguments are parsed from the URI, the data + * MUST be compatible with what PHP's parse_str() would return for + * purposes of how duplicate query parameters are handled, and how nested + * sets are handled. + * + * Setting query string arguments MUST NOT change the URI stored by the + * request, nor the values in the server params. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated query string arguments. + * + * @param array $query Array of query string arguments, typically from + * $_GET. + * @return static + */ + public function withQueryParams(array $query); + + /** + * Retrieve normalized file upload data. + * + * This method returns upload metadata in a normalized tree, with each leaf + * an instance of Psr\Http\Message\UploadedFileInterface. + * + * These values MAY be prepared from $_FILES or the message body during + * instantiation, or MAY be injected via withUploadedFiles(). + * + * @return array An array tree of UploadedFileInterface instances; an empty + * array MUST be returned if no data is present. + */ + public function getUploadedFiles(); + + /** + * Create a new instance with the specified uploaded files. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated body parameters. + * + * @param array $uploadedFiles An array tree of UploadedFileInterface instances. + * @return static + * @throws \InvalidArgumentException if an invalid structure is provided. + */ + public function withUploadedFiles(array $uploadedFiles); + + /** + * Retrieve any parameters provided in the request body. + * + * If the request Content-Type is either application/x-www-form-urlencoded + * or multipart/form-data, and the request method is POST, this method MUST + * return the contents of $_POST. + * + * Otherwise, this method may return any results of deserializing + * the request body content; as parsing returns structured content, the + * potential types MUST be arrays or objects only. A null value indicates + * the absence of body content. + * + * @return null|array|object The deserialized body parameters, if any. + * These will typically be an array or object. + */ + public function getParsedBody(); + + /** + * Return an instance with the specified body parameters. + * + * These MAY be injected during instantiation. + * + * If the request Content-Type is either application/x-www-form-urlencoded + * or multipart/form-data, and the request method is POST, use this method + * ONLY to inject the contents of $_POST. + * + * The data IS NOT REQUIRED to come from $_POST, but MUST be the results of + * deserializing the request body content. Deserialization/parsing returns + * structured data, and, as such, this method ONLY accepts arrays or objects, + * or a null value if nothing was available to parse. + * + * As an example, if content negotiation determines that the request data + * is a JSON payload, this method could be used to create a request + * instance with the deserialized parameters. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated body parameters. + * + * @param null|array|object $data The deserialized body data. This will + * typically be in an array or object. + * @return static + * @throws \InvalidArgumentException if an unsupported argument type is + * provided. + */ + public function withParsedBody($data); + + /** + * Retrieve attributes derived from the request. + * + * The request "attributes" may be used to allow injection of any + * parameters derived from the request: e.g., the results of path + * match operations; the results of decrypting cookies; the results of + * deserializing non-form-encoded message bodies; etc. Attributes + * will be application and request specific, and CAN be mutable. + * + * @return array Attributes derived from the request. + */ + public function getAttributes(); + + /** + * Retrieve a single derived request attribute. + * + * Retrieves a single derived request attribute as described in + * getAttributes(). If the attribute has not been previously set, returns + * the default value as provided. + * + * This method obviates the need for a hasAttribute() method, as it allows + * specifying a default value to return if the attribute is not found. + * + * @see getAttributes() + * @param string $name The attribute name. + * @param mixed $default Default value to return if the attribute does not exist. + * @return mixed + */ + public function getAttribute($name, $default = null); + + /** + * Return an instance with the specified derived request attribute. + * + * This method allows setting a single derived request attribute as + * described in getAttributes(). + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated attribute. + * + * @see getAttributes() + * @param string $name The attribute name. + * @param mixed $value The value of the attribute. + * @return static + */ + public function withAttribute($name, $value); + + /** + * Return an instance that removes the specified derived request attribute. + * + * This method allows removing a single derived request attribute as + * described in getAttributes(). + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that removes + * the attribute. + * + * @see getAttributes() + * @param string $name The attribute name. + * @return static + */ + public function withoutAttribute($name); +} diff --git a/vendor/psr/http-message/src/StreamInterface.php b/vendor/psr/http-message/src/StreamInterface.php new file mode 100644 index 0000000..f68f391 --- /dev/null +++ b/vendor/psr/http-message/src/StreamInterface.php @@ -0,0 +1,158 @@ + + * [user-info@]host[:port] + * + * + * If the port component is not set or is the standard port for the current + * scheme, it SHOULD NOT be included. + * + * @see https://tools.ietf.org/html/rfc3986#section-3.2 + * @return string The URI authority, in "[user-info@]host[:port]" format. + */ + public function getAuthority(); + + /** + * Retrieve the user information component of the URI. + * + * If no user information is present, this method MUST return an empty + * string. + * + * If a user is present in the URI, this will return that value; + * additionally, if the password is also present, it will be appended to the + * user value, with a colon (":") separating the values. + * + * The trailing "@" character is not part of the user information and MUST + * NOT be added. + * + * @return string The URI user information, in "username[:password]" format. + */ + public function getUserInfo(); + + /** + * Retrieve the host component of the URI. + * + * If no host is present, this method MUST return an empty string. + * + * The value returned MUST be normalized to lowercase, per RFC 3986 + * Section 3.2.2. + * + * @see http://tools.ietf.org/html/rfc3986#section-3.2.2 + * @return string The URI host. + */ + public function getHost(); + + /** + * Retrieve the port component of the URI. + * + * If a port is present, and it is non-standard for the current scheme, + * this method MUST return it as an integer. If the port is the standard port + * used with the current scheme, this method SHOULD return null. + * + * If no port is present, and no scheme is present, this method MUST return + * a null value. + * + * If no port is present, but a scheme is present, this method MAY return + * the standard port for that scheme, but SHOULD return null. + * + * @return null|int The URI port. + */ + public function getPort(); + + /** + * Retrieve the path component of the URI. + * + * The path can either be empty or absolute (starting with a slash) or + * rootless (not starting with a slash). Implementations MUST support all + * three syntaxes. + * + * Normally, the empty path "" and absolute path "/" are considered equal as + * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically + * do this normalization because in contexts with a trimmed base path, e.g. + * the front controller, this difference becomes significant. It's the task + * of the user to handle both "" and "/". + * + * The value returned MUST be percent-encoded, but MUST NOT double-encode + * any characters. To determine what characters to encode, please refer to + * RFC 3986, Sections 2 and 3.3. + * + * As an example, if the value should include a slash ("/") not intended as + * delimiter between path segments, that value MUST be passed in encoded + * form (e.g., "%2F") to the instance. + * + * @see https://tools.ietf.org/html/rfc3986#section-2 + * @see https://tools.ietf.org/html/rfc3986#section-3.3 + * @return string The URI path. + */ + public function getPath(); + + /** + * Retrieve the query string of the URI. + * + * If no query string is present, this method MUST return an empty string. + * + * The leading "?" character is not part of the query and MUST NOT be + * added. + * + * The value returned MUST be percent-encoded, but MUST NOT double-encode + * any characters. To determine what characters to encode, please refer to + * RFC 3986, Sections 2 and 3.4. + * + * As an example, if a value in a key/value pair of the query string should + * include an ampersand ("&") not intended as a delimiter between values, + * that value MUST be passed in encoded form (e.g., "%26") to the instance. + * + * @see https://tools.ietf.org/html/rfc3986#section-2 + * @see https://tools.ietf.org/html/rfc3986#section-3.4 + * @return string The URI query string. + */ + public function getQuery(); + + /** + * Retrieve the fragment component of the URI. + * + * If no fragment is present, this method MUST return an empty string. + * + * The leading "#" character is not part of the fragment and MUST NOT be + * added. + * + * The value returned MUST be percent-encoded, but MUST NOT double-encode + * any characters. To determine what characters to encode, please refer to + * RFC 3986, Sections 2 and 3.5. + * + * @see https://tools.ietf.org/html/rfc3986#section-2 + * @see https://tools.ietf.org/html/rfc3986#section-3.5 + * @return string The URI fragment. + */ + public function getFragment(); + + /** + * Return an instance with the specified scheme. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified scheme. + * + * Implementations MUST support the schemes "http" and "https" case + * insensitively, and MAY accommodate other schemes if required. + * + * An empty scheme is equivalent to removing the scheme. + * + * @param string $scheme The scheme to use with the new instance. + * @return static A new instance with the specified scheme. + * @throws \InvalidArgumentException for invalid or unsupported schemes. + */ + public function withScheme($scheme); + + /** + * Return an instance with the specified user information. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified user information. + * + * Password is optional, but the user information MUST include the + * user; an empty string for the user is equivalent to removing user + * information. + * + * @param string $user The user name to use for authority. + * @param null|string $password The password associated with $user. + * @return static A new instance with the specified user information. + */ + public function withUserInfo($user, $password = null); + + /** + * Return an instance with the specified host. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified host. + * + * An empty host value is equivalent to removing the host. + * + * @param string $host The hostname to use with the new instance. + * @return static A new instance with the specified host. + * @throws \InvalidArgumentException for invalid hostnames. + */ + public function withHost($host); + + /** + * Return an instance with the specified port. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified port. + * + * Implementations MUST raise an exception for ports outside the + * established TCP and UDP port ranges. + * + * A null value provided for the port is equivalent to removing the port + * information. + * + * @param null|int $port The port to use with the new instance; a null value + * removes the port information. + * @return static A new instance with the specified port. + * @throws \InvalidArgumentException for invalid ports. + */ + public function withPort($port); + + /** + * Return an instance with the specified path. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified path. + * + * The path can either be empty or absolute (starting with a slash) or + * rootless (not starting with a slash). Implementations MUST support all + * three syntaxes. + * + * If the path is intended to be domain-relative rather than path relative then + * it must begin with a slash ("/"). Paths not starting with a slash ("/") + * are assumed to be relative to some base path known to the application or + * consumer. + * + * Users can provide both encoded and decoded path characters. + * Implementations ensure the correct encoding as outlined in getPath(). + * + * @param string $path The path to use with the new instance. + * @return static A new instance with the specified path. + * @throws \InvalidArgumentException for invalid paths. + */ + public function withPath($path); + + /** + * Return an instance with the specified query string. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified query string. + * + * Users can provide both encoded and decoded query characters. + * Implementations ensure the correct encoding as outlined in getQuery(). + * + * An empty query string value is equivalent to removing the query string. + * + * @param string $query The query string to use with the new instance. + * @return static A new instance with the specified query string. + * @throws \InvalidArgumentException for invalid query strings. + */ + public function withQuery($query); + + /** + * Return an instance with the specified URI fragment. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified URI fragment. + * + * Users can provide both encoded and decoded fragment characters. + * Implementations ensure the correct encoding as outlined in getFragment(). + * + * An empty fragment value is equivalent to removing the fragment. + * + * @param string $fragment The fragment to use with the new instance. + * @return static A new instance with the specified fragment. + */ + public function withFragment($fragment); + + /** + * Return the string representation as a URI reference. + * + * Depending on which components of the URI are present, the resulting + * string is either a full URI or relative reference according to RFC 3986, + * Section 4.1. The method concatenates the various components of the URI, + * using the appropriate delimiters: + * + * - If a scheme is present, it MUST be suffixed by ":". + * - If an authority is present, it MUST be prefixed by "//". + * - The path can be concatenated without delimiters. But there are two + * cases where the path has to be adjusted to make the URI reference + * valid as PHP does not allow to throw an exception in __toString(): + * - If the path is rootless and an authority is present, the path MUST + * be prefixed by "/". + * - If the path is starting with more than one "/" and no authority is + * present, the starting slashes MUST be reduced to one. + * - If a query is present, it MUST be prefixed by "?". + * - If a fragment is present, it MUST be prefixed by "#". + * + * @see http://tools.ietf.org/html/rfc3986#section-4.1 + * @return string + */ + public function __toString(); +} diff --git a/vendor/ralouphie/getallheaders/LICENSE b/vendor/ralouphie/getallheaders/LICENSE new file mode 100644 index 0000000..be5540c --- /dev/null +++ b/vendor/ralouphie/getallheaders/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Ralph Khattar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/ralouphie/getallheaders/README.md b/vendor/ralouphie/getallheaders/README.md new file mode 100644 index 0000000..9430d76 --- /dev/null +++ b/vendor/ralouphie/getallheaders/README.md @@ -0,0 +1,27 @@ +getallheaders +============= + +PHP `getallheaders()` polyfill. Compatible with PHP >= 5.3. + +[![Build Status](https://travis-ci.org/ralouphie/getallheaders.svg?branch=master)](https://travis-ci.org/ralouphie/getallheaders) +[![Coverage Status](https://coveralls.io/repos/ralouphie/getallheaders/badge.png?branch=master)](https://coveralls.io/r/ralouphie/getallheaders?branch=master) +[![Latest Stable Version](https://poser.pugx.org/ralouphie/getallheaders/v/stable.png)](https://packagist.org/packages/ralouphie/getallheaders) +[![Latest Unstable Version](https://poser.pugx.org/ralouphie/getallheaders/v/unstable.png)](https://packagist.org/packages/ralouphie/getallheaders) +[![License](https://poser.pugx.org/ralouphie/getallheaders/license.png)](https://packagist.org/packages/ralouphie/getallheaders) + + +This is a simple polyfill for [`getallheaders()`](http://www.php.net/manual/en/function.getallheaders.php). + +## Install + +For PHP version **`>= 5.6`**: + +``` +composer require ralouphie/getallheaders +``` + +For PHP version **`< 5.6`**: + +``` +composer require ralouphie/getallheaders "^2" +``` diff --git a/vendor/ralouphie/getallheaders/composer.json b/vendor/ralouphie/getallheaders/composer.json new file mode 100644 index 0000000..de8ce62 --- /dev/null +++ b/vendor/ralouphie/getallheaders/composer.json @@ -0,0 +1,26 @@ +{ + "name": "ralouphie/getallheaders", + "description": "A polyfill for getallheaders.", + "license": "MIT", + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "require": { + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "^5 || ^6.5", + "php-coveralls/php-coveralls": "^2.1" + }, + "autoload": { + "files": ["src/getallheaders.php"] + }, + "autoload-dev": { + "psr-4": { + "getallheaders\\Tests\\": "tests/" + } + } +} diff --git a/vendor/ralouphie/getallheaders/src/getallheaders.php b/vendor/ralouphie/getallheaders/src/getallheaders.php new file mode 100644 index 0000000..c7285a5 --- /dev/null +++ b/vendor/ralouphie/getallheaders/src/getallheaders.php @@ -0,0 +1,46 @@ + 'Content-Type', + 'CONTENT_LENGTH' => 'Content-Length', + 'CONTENT_MD5' => 'Content-Md5', + ); + + foreach ($_SERVER as $key => $value) { + if (substr($key, 0, 5) === 'HTTP_') { + $key = substr($key, 5); + if (!isset($copy_server[$key]) || !isset($_SERVER[$key])) { + $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $key)))); + $headers[$key] = $value; + } + } elseif (isset($copy_server[$key])) { + $headers[$copy_server[$key]] = $value; + } + } + + if (!isset($headers['Authorization'])) { + if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) { + $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; + } elseif (isset($_SERVER['PHP_AUTH_USER'])) { + $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; + $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass); + } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) { + $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST']; + } + } + + return $headers; + } + +} diff --git a/vendor/sonata-project/google-authenticator/LICENSE b/vendor/sonata-project/google-authenticator/LICENSE new file mode 100644 index 0000000..0135e0b --- /dev/null +++ b/vendor/sonata-project/google-authenticator/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2010 Thomas Rabaix + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/sonata-project/google-authenticator/composer.json b/vendor/sonata-project/google-authenticator/composer.json new file mode 100644 index 0000000..4bd395c --- /dev/null +++ b/vendor/sonata-project/google-authenticator/composer.json @@ -0,0 +1,50 @@ +{ + "name": "sonata-project/google-authenticator", + "type": "library", + "description": "Library to integrate Google Authenticator into a PHP project", + "keywords": [ + "google authenticator" + ], + "homepage": "https://github.com/sonata-project/GoogleAuthenticator", + "license": "MIT", + "authors": [ + { + "name": "Thomas Rabaix", + "email": "thomas.rabaix@gmail.com" + }, + { + "name": "Christian Stocker", + "email": "me@chregu.tv" + }, + { + "name": "Andre DeMarre", + "homepage": "http://www.devnetwork.net/viewtopic.php?f=50&t=94989" + } + ], + "require": { + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^5.1.8" + }, + "config": { + "sort-packages": true + }, + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Google\\Authenticator\\": "src/", + "Sonata\\GoogleAuthenticator\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Google\\Authenticator\\Tests\\": "tests/", + "Sonata\\GoogleAuthenticator\\Tests\\": "tests/" + } + } +} diff --git a/vendor/sonata-project/google-authenticator/sample/example.php b/vendor/sonata-project/google-authenticator/sample/example.php new file mode 100644 index 0000000..50366d2 --- /dev/null +++ b/vendor/sonata-project/google-authenticator/sample/example.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +include_once __DIR__.'/../src/FixedBitNotation.php'; +include_once __DIR__.'/../src/GoogleAuthenticator.php'; +include_once __DIR__.'/../src/GoogleQrUrl.php'; + +$secret = 'XVQ2UIGO75XRUKJO'; +$code = '846474'; + +$g = new \Sonata\GoogleAuthenticator\GoogleAuthenticator(); + +echo 'Current Code is: '; +echo $g->getCode($secret); + +echo "\n"; + +echo "Check if $code is valid: "; + +if ($g->checkCode($secret, $code)) { + echo "YES \n"; +} else { + echo "NO \n"; +} + +$secret = $g->generateSecret(); +echo "Get a new Secret: $secret \n"; +echo "The QR Code for this secret (to scan with the Google Authenticator App: \n"; + +echo \Sonata\GoogleAuthenticator\GoogleQrUrl::generate('chregu', $secret, 'GoogleAuthenticatorExample'); +echo "\n"; diff --git a/vendor/sonata-project/google-authenticator/sample/tmpl/ask-for-otp.php b/vendor/sonata-project/google-authenticator/sample/tmpl/ask-for-otp.php new file mode 100644 index 0000000..f3e06d4 --- /dev/null +++ b/vendor/sonata-project/google-authenticator/sample/tmpl/ask-for-otp.php @@ -0,0 +1,23 @@ + +

please otp

+

+

+ +
+ (Set $debug in index.php to false, if you don't want to have the OTP prefilled (for real life application, for example ;))
+ + +otp:
+
+ + +
diff --git a/vendor/sonata-project/google-authenticator/sample/tmpl/loggedin.php b/vendor/sonata-project/google-authenticator/sample/tmpl/loggedin.php new file mode 100644 index 0000000..2a19032 --- /dev/null +++ b/vendor/sonata-project/google-authenticator/sample/tmpl/loggedin.php @@ -0,0 +1,19 @@ + +

+Hello getUsername(); ?> +

+ + +

+Show QR Code +

+ + + +

+Logout +

diff --git a/vendor/sonata-project/google-authenticator/sample/tmpl/login-error.php b/vendor/sonata-project/google-authenticator/sample/tmpl/login-error.php new file mode 100644 index 0000000..8d23fd3 --- /dev/null +++ b/vendor/sonata-project/google-authenticator/sample/tmpl/login-error.php @@ -0,0 +1,6 @@ +

+Wrong username or password or token. +

+

+try again +

diff --git a/vendor/sonata-project/google-authenticator/sample/tmpl/login.php b/vendor/sonata-project/google-authenticator/sample/tmpl/login.php new file mode 100644 index 0000000..fd81623 --- /dev/null +++ b/vendor/sonata-project/google-authenticator/sample/tmpl/login.php @@ -0,0 +1,8 @@ + +

please login

+

+

+username:
+password:
+ +
diff --git a/vendor/sonata-project/google-authenticator/sample/tmpl/show-qr.php b/vendor/sonata-project/google-authenticator/sample/tmpl/show-qr.php new file mode 100644 index 0000000..774a298 --- /dev/null +++ b/vendor/sonata-project/google-authenticator/sample/tmpl/show-qr.php @@ -0,0 +1,11 @@ +

Please scan this

+ +

with the Google Authenticator App

+ +

+getUsername(), $secret, 'GoogleAuthenticatorExample'); +?> + + +

diff --git a/vendor/sonata-project/google-authenticator/sample/users.dat b/vendor/sonata-project/google-authenticator/sample/users.dat new file mode 100644 index 0000000..fdcc130 --- /dev/null +++ b/vendor/sonata-project/google-authenticator/sample/users.dat @@ -0,0 +1 @@ +{"chregu":{"password":"foobar"}} \ No newline at end of file diff --git a/vendor/sonata-project/google-authenticator/sample/web/Users.php b/vendor/sonata-project/google-authenticator/sample/web/Users.php new file mode 100644 index 0000000..410ed48 --- /dev/null +++ b/vendor/sonata-project/google-authenticator/sample/web/Users.php @@ -0,0 +1,155 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +class Users +{ + public function __construct(string $file = '../users.dat') + { + $this->userFile = $file; + + $this->users = json_decode(file_get_contents($file), true); + } + + public function hasSession() + { + session_start(); + if (isset($_SESSION['username'])) { + return $_SESSION['username']; + } + + return false; + } + + public function storeData(User $user): void + { + $this->users[$user->getUsername()] = $user->getData(); + file_put_contents($this->userFile, json_encode($this->users)); + } + + public function loadUser($name) + { + if (isset($this->users[$name])) { + return new User($name, $this->users[$name]); + } + + return false; + } +} + +class User +{ + public function __construct($user, $data) + { + $this->data = $data; + $this->user = $user; + } + + public function auth($pass) + { + if ($this->data['password'] === $pass) { + return true; + } + + return false; + } + + public function startSession(): void + { + $_SESSION['username'] = $this->user; + } + + public function doLogin(): void + { + session_regenerate_id(); + $_SESSION['loggedin'] = true; + $_SESSION['ua'] = $_SERVER['HTTP_USER_AGENT']; + } + + public function doOTP(): void + { + $_SESSION['OTP'] = true; + } + + public function isOTP() + { + if (isset($_SESSION['OTP']) && true === $_SESSION['OTP']) { + return true; + } + + return false; + } + + public function isLoggedIn() + { + if (isset($_SESSION['loggedin']) && true === $_SESSION['loggedin'] && + isset($_SESSION['ua']) && $_SESSION['ua'] === $_SERVER['HTTP_USER_AGENT'] + ) { + return $_SESSION['username']; + } + + return false; + } + + public function getUsername() + { + return $this->user; + } + + public function getSecret() + { + if (isset($this->data['secret'])) { + return $this->data['secret']; + } + + return false; + } + + public function generateSecret() + { + $g = new \Sonata\GoogleAuthenticator\GoogleAuthenticator(); + $secret = $g->generateSecret(); + $this->data['secret'] = $secret; + + return $secret; + } + + public function getData() + { + return $this->data; + } + + public function setOTPCookie(): void + { + $time = floor(time() / (3600 * 24)); // get day number + //about using the user agent: It's easy to fake it, but it increases the barrier for stealing and reusing cookies nevertheless + // and it doesn't do any harm (except that it's invalid after a browser upgrade, but that may be even intented) + $cookie = $time.':'.hash_hmac('sha1', $this->getUsername().':'.$time.':'.$_SERVER['HTTP_USER_AGENT'], $this->getSecret()); + setcookie('otp', $cookie, time() + (30 * 24 * 3600), null, null, null, true); + } + + public function hasValidOTPCookie() + { + // 0 = tomorrow it is invalid + $daysUntilInvalid = 0; + $time = (string) floor((time() / (3600 * 24))); // get day number + if (isset($_COOKIE['otp'])) { + [$otpday, $hash] = explode(':', $_COOKIE['otp']); + + if ($otpday >= $time - $daysUntilInvalid && $hash === hash_hmac('sha1', $this->getUsername().':'.$otpday.':'.$_SERVER['HTTP_USER_AGENT'], $this->getSecret())) { + return true; + } + } + + return false; + } +} diff --git a/vendor/sonata-project/google-authenticator/sample/web/index.php b/vendor/sonata-project/google-authenticator/sample/web/index.php new file mode 100644 index 0000000..626383f --- /dev/null +++ b/vendor/sonata-project/google-authenticator/sample/web/index.php @@ -0,0 +1,119 @@ + + + + + Google Authenticator in PHP demo + + +hasSession()) { + //load the user data from the json storage. + $user = $users->loadUser($username); + //if he clicked logout, destroy the session and redirect to the startscreen. + if (isset($_GET['logout'])) { + session_destroy(); + header('Location: ./'); + } + // check if the user is logged in. + if ($user->isLoggedIn()) { + include __DIR__.'/../tmpl/loggedin.php'; + //show the QR code if whished so + if (isset($_GET['showqr'])) { + $secret = $user->getSecret(); + include __DIR__.'/../tmpl/show-qr.php'; + } + } + //if the user is in the OTP phase and submit the OTP. + else { + if ($user->isOTP() && isset($_POST['otp'])) { + $g = new \Google\Authenticator\GoogleAuthenticator(); + // check if the submitted token is the right one and log in + if ($g->checkCode($user->getSecret(), $_POST['otp'])) { + // do log-in the user + $user->doLogin(); + //if the user clicked the "remember the token" checkbox, set the cookie + if (isset($_POST['remember']) && $_POST['remember']) { + $user->setOTPCookie(); + } + include __DIR__.'/../tmpl/loggedin.php'; + } + //if the OTP is wrong, destroy the session and tell the user to try again + else { + session_destroy(); + include __DIR__.'/../tmpl/login-error.php'; + } + } + // if the user is neither logged in nor in the OTP phase, show the login form + else { + session_destroy(); + include __DIR__.'/../tmpl/login.php'; + } + } + exit(); +} + //if the username is set in _POST, then we assume the user filled in the login form. + + if (isset($_POST['username'])) { + // check if we can load the user (ie. the user exists in our db) + $user = $users->loadUser($_POST['username']); + if ($user) { + //try to authenticate the password and start the session if it's correct. + if ($user->auth($_POST['password'])) { + $user->startSession(); + //check if the user has a valid OTP cookie, so we don't have to + // ask for the current token and can directly log in + if ($user->hasValidOTPCookie()) { + include __DIR__.'/../tmpl/loggedin.php'; + $user->doLogin(); + } + // try to get the users' secret from the db, + // if he doesn't have one, generate one, store it and show it. + else { + if (!$user->getSecret()) { + include __DIR__.'/../tmpl/loggedin.php'; + + $secret = $user->generateSecret(); + $users->storeData($user); + $user->doLogin(); + include __DIR__.'/../tmpl/show-qr.php'; + } + // if the user neither has a valid OTP cookie nor it's the first login + // ask for the OTP + else { + $user->doOTP(); + include __DIR__.'/../tmpl/ask-for-otp.php'; + } + } + + exit(); + } + } + // if we're here, something went wrong, destroy the session and show a login error + session_destroy(); + + include __DIR__.'/../tmpl/login-error.php'; + exit(); + } + +// if neither a session nor tried to submit the login credentials -> login screen +include __DIR__.'/../tmpl/login.php'; + +?> + + diff --git a/vendor/sonata-project/google-authenticator/src/FixedBitNotation.php b/vendor/sonata-project/google-authenticator/src/FixedBitNotation.php new file mode 100644 index 0000000..5676dd3 --- /dev/null +++ b/vendor/sonata-project/google-authenticator/src/FixedBitNotation.php @@ -0,0 +1,292 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Sonata\GoogleAuthenticator; + +/** + * FixedBitNotation. + * + * The FixedBitNotation class is for binary to text conversion. It + * can handle many encoding schemes, formally defined or not, that + * use a fixed number of bits to encode each character. + * + * @author Andre DeMarre + */ +final class FixedBitNotation +{ + /** + * @var string + */ + private $chars; + + /** + * @var int + */ + private $bitsPerCharacter; + + /** + * @var int + */ + private $radix; + + /** + * @var bool + */ + private $rightPadFinalBits; + + /** + * @var bool + */ + private $padFinalGroup; + + /** + * @var string + */ + private $padCharacter; + + /** + * @var string[] + */ + private $charmap; + + /** + * @param int $bitsPerCharacter Bits to use for each encoded character + * @param string $chars Base character alphabet + * @param bool $rightPadFinalBits How to encode last character + * @param bool $padFinalGroup Add padding to end of encoded output + * @param string $padCharacter Character to use for padding + */ + public function __construct(int $bitsPerCharacter, ?string $chars = null, bool $rightPadFinalBits = false, bool $padFinalGroup = false, string $padCharacter = '=') + { + // Ensure validity of $chars + if (!\is_string($chars) || ($charLength = \strlen($chars)) < 2) { + $chars = + '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-,'; + $charLength = 64; + } + + // Ensure validity of $bitsPerCharacter + if ($bitsPerCharacter < 1) { + // $bitsPerCharacter must be at least 1 + $bitsPerCharacter = 1; + $radix = 2; + } elseif ($charLength < 1 << $bitsPerCharacter) { + // Character length of $chars is too small for $bitsPerCharacter + // Set $bitsPerCharacter to greatest acceptable value + $bitsPerCharacter = 1; + $radix = 2; + + while ($charLength >= ($radix <<= 1) && $bitsPerCharacter < 8) { + ++$bitsPerCharacter; + } + + $radix >>= 1; + } elseif ($bitsPerCharacter > 8) { + // $bitsPerCharacter must not be greater than 8 + $bitsPerCharacter = 8; + $radix = 256; + } else { + $radix = 1 << $bitsPerCharacter; + } + + $this->chars = $chars; + $this->bitsPerCharacter = $bitsPerCharacter; + $this->radix = $radix; + $this->rightPadFinalBits = $rightPadFinalBits; + $this->padFinalGroup = $padFinalGroup; + $this->padCharacter = $padCharacter[0]; + } + + /** + * Encode a string. + * + * @param string $rawString Binary data to encode + */ + public function encode($rawString): string + { + // Unpack string into an array of bytes + $bytes = unpack('C*', $rawString); + $byteCount = \count($bytes); + + $encodedString = ''; + $byte = array_shift($bytes); + $bitsRead = 0; + + $chars = $this->chars; + $bitsPerCharacter = $this->bitsPerCharacter; + $rightPadFinalBits = $this->rightPadFinalBits; + $padFinalGroup = $this->padFinalGroup; + $padCharacter = $this->padCharacter; + + // Generate encoded output; + // each loop produces one encoded character + for ($c = 0; $c < $byteCount * 8 / $bitsPerCharacter; ++$c) { + // Get the bits needed for this encoded character + if ($bitsRead + $bitsPerCharacter > 8) { + // Not enough bits remain in this byte for the current + // character + // Save the remaining bits before getting the next byte + $oldBitCount = 8 - $bitsRead; + $oldBits = $byte ^ ($byte >> $oldBitCount << $oldBitCount); + $newBitCount = $bitsPerCharacter - $oldBitCount; + + if (!$bytes) { + // Last bits; match final character and exit loop + if ($rightPadFinalBits) { + $oldBits <<= $newBitCount; + } + $encodedString .= $chars[$oldBits]; + + if ($padFinalGroup) { + // Array of the lowest common multiples of + // $bitsPerCharacter and 8, divided by 8 + $lcmMap = [1 => 1, 2 => 1, 3 => 3, 4 => 1, 5 => 5, 6 => 3, 7 => 7, 8 => 1]; + $bytesPerGroup = $lcmMap[$bitsPerCharacter]; + $pads = (int) ($bytesPerGroup * 8 / $bitsPerCharacter + - ceil((\strlen($rawString) % $bytesPerGroup) + * 8 / $bitsPerCharacter)); + $encodedString .= str_repeat($padCharacter[0], $pads); + } + + break; + } + + // Get next byte + $byte = array_shift($bytes); + $bitsRead = 0; + } else { + $oldBitCount = 0; + $newBitCount = $bitsPerCharacter; + } + + // Read only the needed bits from this byte + $bits = $byte >> 8 - ($bitsRead + $newBitCount); + $bits ^= $bits >> $newBitCount << $newBitCount; + $bitsRead += $newBitCount; + + if ($oldBitCount) { + // Bits come from seperate bytes, add $oldBits to $bits + $bits = ($oldBits << $newBitCount) | $bits; + } + + $encodedString .= $chars[$bits]; + } + + return $encodedString; + } + + /** + * Decode a string. + * + * @param string $encodedString Data to decode + * @param bool $caseSensitive + * @param bool $strict Returns null if $encodedString contains + * an undecodable character + */ + public function decode($encodedString, $caseSensitive = true, $strict = false): string + { + if (!$encodedString || !\is_string($encodedString)) { + // Empty string, nothing to decode + return ''; + } + + $chars = $this->chars; + $bitsPerCharacter = $this->bitsPerCharacter; + $radix = $this->radix; + $rightPadFinalBits = $this->rightPadFinalBits; + $padCharacter = $this->padCharacter; + + // Get index of encoded characters + if ($this->charmap) { + $charmap = $this->charmap; + } else { + $charmap = []; + + for ($i = 0; $i < $radix; ++$i) { + $charmap[$chars[$i]] = $i; + } + + $this->charmap = $charmap; + } + + // The last encoded character is $encodedString[$lastNotatedIndex] + $lastNotatedIndex = \strlen($encodedString) - 1; + + // Remove trailing padding characters + while ($encodedString[$lastNotatedIndex] === $padCharacter[0]) { + $encodedString = substr($encodedString, 0, $lastNotatedIndex); + --$lastNotatedIndex; + } + + $rawString = ''; + $byte = 0; + $bitsWritten = 0; + + // Convert each encoded character to a series of unencoded bits + for ($c = 0; $c <= $lastNotatedIndex; ++$c) { + if (!isset($charmap[$encodedString[$c]]) && !$caseSensitive) { + // Encoded character was not found; try other case + if (isset($charmap[$cUpper = strtoupper($encodedString[$c])])) { + $charmap[$encodedString[$c]] = $charmap[$cUpper]; + } elseif (isset($charmap[$cLower = strtolower($encodedString[$c])])) { + $charmap[$encodedString[$c]] = $charmap[$cLower]; + } + } + + if (isset($charmap[$encodedString[$c]])) { + $bitsNeeded = 8 - $bitsWritten; + $unusedBitCount = $bitsPerCharacter - $bitsNeeded; + + // Get the new bits ready + if ($bitsNeeded > $bitsPerCharacter) { + // New bits aren't enough to complete a byte; shift them + // left into position + $newBits = $charmap[$encodedString[$c]] << $bitsNeeded + - $bitsPerCharacter; + $bitsWritten += $bitsPerCharacter; + } elseif ($c !== $lastNotatedIndex || $rightPadFinalBits) { + // Zero or more too many bits to complete a byte; + // shift right + $newBits = $charmap[$encodedString[$c]] >> $unusedBitCount; + $bitsWritten = 8; //$bitsWritten += $bitsNeeded; + } else { + // Final bits don't need to be shifted + $newBits = $charmap[$encodedString[$c]]; + $bitsWritten = 8; + } + + $byte |= $newBits; + + if (8 === $bitsWritten || $c === $lastNotatedIndex) { + // Byte is ready to be written + $rawString .= pack('C', $byte); + + if ($c !== $lastNotatedIndex) { + // Start the next byte + $bitsWritten = $unusedBitCount; + $byte = ($charmap[$encodedString[$c]] + ^ ($newBits << $unusedBitCount)) << 8 - $bitsWritten; + } + } + } elseif ($strict) { + // Unable to decode character; abort + return null; + } + } + + return $rawString; + } +} + +// NEXT_MAJOR: Remove class alias +class_alias('Sonata\GoogleAuthenticator\FixedBitNotation', 'Google\Authenticator\FixedBitNotation', false); diff --git a/vendor/sonata-project/google-authenticator/src/GoogleAuthenticator.php b/vendor/sonata-project/google-authenticator/src/GoogleAuthenticator.php new file mode 100644 index 0000000..52f0598 --- /dev/null +++ b/vendor/sonata-project/google-authenticator/src/GoogleAuthenticator.php @@ -0,0 +1,178 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Sonata\GoogleAuthenticator; + +/** + * @see https://github.com/google/google-authenticator/wiki/Key-Uri-Format + */ +final class GoogleAuthenticator implements GoogleAuthenticatorInterface +{ + /** + * @var int + */ + private $passCodeLength; + + /** + * @var int + */ + private $secretLength; + + /** + * @var int + */ + private $pinModulo; + + /** + * @var \DateTimeInterface + */ + private $instanceTime; + + /** + * @var int + */ + private $codePeriod; + + /** + * @var int + */ + private $periodSize = 30; + + public function __construct(int $passCodeLength = 6, int $secretLength = 10, ?\DateTimeInterface $instanceTime = null, int $codePeriod = 30) + { + /* + * codePeriod is the duration in seconds that the code is valid. + * periodSize is the length of a period to calculate periods since Unix epoch. + * periodSize cannot be larger than the codePeriod. + */ + + $this->passCodeLength = $passCodeLength; + $this->secretLength = $secretLength; + $this->codePeriod = $codePeriod; + $this->periodSize = $codePeriod < $this->periodSize ? $codePeriod : $this->periodSize; + $this->pinModulo = 10 ** $passCodeLength; + $this->instanceTime = $instanceTime ?? new \DateTimeImmutable(); + } + + /** + * @param string $secret + * @param string $code + * @param int $discrepancy + */ + public function checkCode($secret, $code, $discrepancy = 1): bool + { + /** + * Discrepancy is the factor of periodSize ($discrepancy * $periodSize) allowed on either side of the + * given codePeriod. For example, if a code with codePeriod = 60 is generated at 10:00:00, a discrepancy + * of 1 will allow a periodSize of 30 seconds on either side of the codePeriod resulting in a valid code + * from 09:59:30 to 10:00:29. + * + * The result of each comparison is stored as a timestamp here instead of using a guard clause + * (https://refactoring.com/catalog/replaceNestedConditionalWithGuardClauses.html). This is to implement + * constant time comparison to make side-channel attacks harder. See + * https://cryptocoding.net/index.php/Coding_rules#Compare_secret_strings_in_constant_time for details. + * Each comparison uses hash_equals() instead of an operator to implement constant time equality comparison + * for each code. + */ + $periods = floor($this->codePeriod / $this->periodSize); + + $result = 0; + for ($i = -$discrepancy; $i < $periods + $discrepancy; ++$i) { + $dateTime = new \DateTimeImmutable('@'.($this->instanceTime->getTimestamp() - ($i * $this->periodSize))); + $result = hash_equals($this->getCode($secret, $dateTime), $code) ? $dateTime->getTimestamp() : $result; + } + + return $result > 0; + } + + /** + * NEXT_MAJOR: add the interface typehint to $time and remove deprecation. + * + * @param string $secret + * @param float|string|int|\DateTimeInterface|null $time + */ + public function getCode($secret, /* \DateTimeInterface */ $time = null): string + { + if (null === $time) { + $time = $this->instanceTime; + } + + if ($time instanceof \DateTimeInterface) { + $timeForCode = floor($time->getTimestamp() / $this->periodSize); + } else { + @trigger_error( + 'Passing anything other than null or a DateTimeInterface to $time is deprecated as of 2.0 '. + 'and will not be possible as of 3.0.', + \E_USER_DEPRECATED + ); + $timeForCode = $time; + } + + $base32 = new FixedBitNotation(5, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', true, true); + $secret = $base32->decode($secret); + + $timeForCode = str_pad(pack('N', $timeForCode), 8, \chr(0), \STR_PAD_LEFT); + + $hash = hash_hmac('sha1', $timeForCode, $secret, true); + $offset = \ord(substr($hash, -1)); + $offset &= 0xF; + + $truncatedHash = $this->hashToInt($hash, $offset) & 0x7FFFFFFF; + + return str_pad((string) ($truncatedHash % $this->pinModulo), $this->passCodeLength, '0', \STR_PAD_LEFT); + } + + /** + * NEXT_MAJOR: Remove this method. + * + * @param string $user + * @param string $hostname + * @param string $secret + * + * @deprecated deprecated as of 2.1 and will be removed in 3.0. Use Sonata\GoogleAuthenticator\GoogleQrUrl::generate() instead. + */ + public function getUrl($user, $hostname, $secret): string + { + @trigger_error(sprintf( + 'Using %s() is deprecated as of 2.1 and will be removed in 3.0. '. + 'Use Sonata\GoogleAuthenticator\GoogleQrUrl::generate() instead.', + __METHOD__ + ), \E_USER_DEPRECATED); + + $issuer = \func_get_args()[3] ?? null; + $accountName = sprintf('%s@%s', $user, $hostname); + + // manually concat the issuer to avoid a change in URL + $url = GoogleQrUrl::generate($accountName, $secret); + + if ($issuer) { + $url .= '%26issuer%3D'.$issuer; + } + + return $url; + } + + public function generateSecret(): string + { + return (new FixedBitNotation(5, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', true, true)) + ->encode(random_bytes($this->secretLength)); + } + + private function hashToInt(string $bytes, int $start): int + { + return unpack('N', substr(substr($bytes, $start), 0, 4))[1]; + } +} + +// NEXT_MAJOR: Remove class alias +class_alias('Sonata\GoogleAuthenticator\GoogleAuthenticator', 'Google\Authenticator\GoogleAuthenticator', false); diff --git a/vendor/sonata-project/google-authenticator/src/GoogleAuthenticatorInterface.php b/vendor/sonata-project/google-authenticator/src/GoogleAuthenticatorInterface.php new file mode 100644 index 0000000..b3144fd --- /dev/null +++ b/vendor/sonata-project/google-authenticator/src/GoogleAuthenticatorInterface.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Sonata\GoogleAuthenticator; + +interface GoogleAuthenticatorInterface +{ + /** + * @param string $secret + * @param string $code + */ + public function checkCode($secret, $code, $discrepancy = 1): bool; + + /** + * NEXT_MAJOR: add the interface typehint to $time and remove deprecation. + * + * @param string $secret + * @param float|string|int|\DateTimeInterface|null $time + */ + public function getCode($secret, /* \DateTimeInterface */ $time = null): string; + + /** + * NEXT_MAJOR: Remove this method. + * + * @param string $user + * @param string $hostname + * @param string $secret + * + * @deprecated deprecated as of 2.1 and will be removed in 3.0. Use Sonata\GoogleAuthenticator\GoogleQrUrl::generate() instead. + */ + public function getUrl($user, $hostname, $secret): string; + + public function generateSecret(): string; +} diff --git a/vendor/sonata-project/google-authenticator/src/GoogleQrUrl.php b/vendor/sonata-project/google-authenticator/src/GoogleQrUrl.php new file mode 100644 index 0000000..413d226 --- /dev/null +++ b/vendor/sonata-project/google-authenticator/src/GoogleQrUrl.php @@ -0,0 +1,93 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Sonata\GoogleAuthenticator; + +/** + * Responsible for QR image url generation. + * + * @see http://goqr.me/api/ + * @see http://goqr.me/api/doc/ + * @see https://github.com/google/google-authenticator/wiki/Key-Uri-Format + * + * @author Iltar van der Berg + */ +final class GoogleQrUrl +{ + /** + * Private by design. + */ + private function __construct() + { + } + + /** + * Generates a URL that is used to show a QR code. + * + * Account names may not contain a double colon (:). Valid account name + * examples: + * - "John.Doe@gmail.com" + * - "John Doe" + * - "John_Doe_976" + * + * The Issuer may not contain a double colon (:). The issuer is recommended + * to pass along. If used, it will also be appended before the accountName. + * + * The previous examples with the issuer "Acme inc" would result in label: + * - "Acme inc:John.Doe@gmail.com" + * - "Acme inc:John Doe" + * - "Acme inc:John_Doe_976" + * + * The contents of the label, issuer and secret will be encoded to generate + * a valid URL. + * + * @param string $accountName The account name to show and identify + * @param string $secret The secret is the generated secret unique to that user + * @param string|null $issuer Where you log in to + * @param int $size Image size in pixels, 200 will make it 200x200 + */ + public static function generate(string $accountName, string $secret, ?string $issuer = null, int $size = 200): string + { + if ('' === $accountName || false !== strpos($accountName, ':')) { + throw RuntimeException::InvalidAccountName($accountName); + } + + if ('' === $secret) { + throw RuntimeException::InvalidSecret(); + } + + $label = $accountName; + $otpauthString = 'otpauth://totp/%s?secret=%s'; + + if (null !== $issuer) { + if ('' === $issuer || false !== strpos($issuer, ':')) { + throw RuntimeException::InvalidIssuer($issuer); + } + + // use both the issuer parameter and label prefix as recommended by Google for BC reasons + $label = $issuer.':'.$label; + $otpauthString .= '&issuer=%s'; + } + + $otpauthString = rawurlencode(sprintf($otpauthString, $label, $secret, $issuer)); + + return sprintf( + 'https://api.qrserver.com/v1/create-qr-code/?size=%1$dx%1$d&data=%2$s&ecc=M', + $size, + $otpauthString + ); + } +} + +// NEXT_MAJOR: Remove class alias +class_alias('Sonata\GoogleAuthenticator\GoogleQrUrl', 'Google\Authenticator\GoogleQrUrl', false); diff --git a/vendor/sonata-project/google-authenticator/src/RuntimeException.php b/vendor/sonata-project/google-authenticator/src/RuntimeException.php new file mode 100644 index 0000000..4d3cf5f --- /dev/null +++ b/vendor/sonata-project/google-authenticator/src/RuntimeException.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Sonata\GoogleAuthenticator; + +/** + * Contains runtime exception templates. + * + * @author Iltar van der Berg + */ +final class RuntimeException extends \RuntimeException +{ + public static function InvalidAccountName(string $accountName): self + { + return new self(sprintf( + 'The account name may not contain a double colon (:) and may not be an empty string. Given "%s".', + $accountName + )); + } + + public static function InvalidIssuer(string $issuer): self + { + return new self(sprintf( + 'The issuer name may not contain a double colon (:) and may not be an empty string. Given "%s".', + $issuer + )); + } + + public static function InvalidSecret(): self + { + return new self('The secret name may not be an empty string.'); + } +} + +// NEXT_MAJOR: Remove class alias +class_alias('Sonata\GoogleAuthenticator\RuntimeException', 'Google\Authenticator\RuntimeException', false); diff --git a/vendor/spomky-labs/base64url/.github/FUNDING.yml b/vendor/spomky-labs/base64url/.github/FUNDING.yml new file mode 100644 index 0000000..d3d1e7c --- /dev/null +++ b/vendor/spomky-labs/base64url/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/vendor/spomky-labs/base64url/LICENSE b/vendor/spomky-labs/base64url/LICENSE new file mode 100644 index 0000000..506ff48 --- /dev/null +++ b/vendor/spomky-labs/base64url/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2014-2018 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/vendor/spomky-labs/base64url/composer.json b/vendor/spomky-labs/base64url/composer.json new file mode 100644 index 0000000..dcaefe7 --- /dev/null +++ b/vendor/spomky-labs/base64url/composer.json @@ -0,0 +1,35 @@ +{ + "name": "spomky-labs/base64url", + "description": "Base 64 URL Safe Encoding/Decoding PHP Library", + "type": "library", + "license": "MIT", + "keywords": ["Base64", "URL", "Safe", "RFC4648"], + "homepage": "https://github.com/Spomky-Labs/base64url", + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky-Labs/base64url/contributors" + } + ], + "autoload": { + "psr-4": { + "Base64Url\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Base64Url\\Test\\": "tests/" + } + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.11|^0.12", + "phpstan/phpstan-beberlei-assert": "^0.11|^0.12", + "phpstan/phpstan-deprecation-rules": "^0.11|^0.12", + "phpstan/phpstan-phpunit": "^0.11|^0.12", + "phpstan/phpstan-strict-rules": "^0.11|^0.12" + } +} diff --git a/vendor/spomky-labs/base64url/src/Base64Url.php b/vendor/spomky-labs/base64url/src/Base64Url.php new file mode 100644 index 0000000..260215a --- /dev/null +++ b/vendor/spomky-labs/base64url/src/Base64Url.php @@ -0,0 +1,56 @@ +setRiskyAllowed(true) + ->setRules([ + // Rulesets + '@PSR2' => true, + '@PhpCsFixer' => true, + '@PhpCsFixer:risky' => true, + '@PHP56Migration:risky' => true, + '@PHPUnit57Migration:risky' => true, + + // Additional rules + 'fopen_flags' => true, + 'linebreak_after_opening_tag' => true, + 'native_constant_invocation' => true, + 'native_function_invocation' => true, + + // --- Diffs from @PhpCsFixer / @PhpCsFixer:risky --- + + // This is the same as the default for the @PhpCsFixer ruleset, minus + // the following values: ['include', 'include_once', 'require', + // 'require_once']. We could enable them and remove this line after + // updating codegen for the `init.php` file to be compliant. + 'blank_line_before_statement' => ['statements' => ['break', 'case', 'continue', 'declare', 'default', 'exit', 'goto', 'return', 'switch', 'throw', 'try']], + + // This is just prettier / easier to read. + 'concat_space' => ['spacing' => 'one'], + + // This causes strange ordering with codegen'd classes. We might be + // able to enable this if we update codegen to output class elements + // in the correct order. + 'ordered_class_elements' => false, + + // Keep this disabled to avoid unnecessary diffs in PHPDoc comments of + // codegen'd classes. + 'phpdoc_align' => false, + + // This is a "risky" rule that causes a bug in our codebase. + // Specifically, in `StripeObject.updateAttributes` we construct new + // `StripeObject`s for metadata. We can't use `self` there because it + // needs to be a raw `StripeObject`. + 'self_accessor' => false, + ]) +; diff --git a/vendor/stripe/stripe-php/CHANGELOG.md b/vendor/stripe/stripe-php/CHANGELOG.md new file mode 100644 index 0000000..1c0e8b9 --- /dev/null +++ b/vendor/stripe/stripe-php/CHANGELOG.md @@ -0,0 +1,1411 @@ +# Changelog + +## 7.87.0 - 2021-06-30 +* [#1149](https://github.com/stripe/stripe-php/pull/1149) API Updates + * Add support for `wechat_pay` on `PaymentMethod` +* [#1143](https://github.com/stripe/stripe-php/pull/1143) Streaming requests +* [#1138](https://github.com/stripe/stripe-php/pull/1138) Deprecate travis + +## 7.86.0 - 2021-06-25 +* [#1145](https://github.com/stripe/stripe-php/pull/1145) API Updates + * Add support for `boleto` on `PaymentMethod`. + * Add support for `il_vat` as a member of the `TaxID.Type` enum. + +## 7.85.0 - 2021-06-18 +* [#1142](https://github.com/stripe/stripe-php/pull/1142) API Updates + * Add support for new TaxId types: `ca_pst_mb`, `ca_pst_bc`, `ca_gst_hst`, and `ca_pst_sk`. + +## 7.84.0 - 2021-06-16 +* [#1141](https://github.com/stripe/stripe-php/pull/1141) Update PHPDocs + * Add support for `url` on `Checkout\Session` + + +## 7.83.0 - 2021-06-07 +* [#1140](https://github.com/stripe/stripe-php/pull/1140) API Updates + * Added support for `tax_id_collection` on `Checkout\Session` and `Checkout\Session#create` + * Update `Location` to be expandable on `Terminal\Reader` + +## 7.82.0 - 2021-06-04 +* [#1136](https://github.com/stripe/stripe-php/pull/1136) Update PHPDocs + * Add support for `controller` on `Account`. + +## 7.81.0 - 2021-06-04 +* [#1135](https://github.com/stripe/stripe-php/pull/1135) API Updates + * Add support for new resource `TaxCode` + * Add support for `automatic_tax` `Invoice` and`Checkout.Session`. + * Add support for `tax_behavior` on `Price` + * Add support for `tax_code` on `Product` + * Add support for `tax` on `Customer` + * Add support for `tax_type` enum on `TaxRate` + +## 7.80.0 - 2021-05-26 +* [#1130](https://github.com/stripe/stripe-php/pull/1130) Update PHPDocs + +## 7.79.0 - 2021-05-19 +* [#1126](https://github.com/stripe/stripe-php/pull/1126) API Updates + * Added support for new resource `Identity.VerificationReport` + * Added support for new resource `Identity.VerificationSession` + * `File#list.purpose` and `File.purpose` added new enum members: `identity_document_downloadable` and `selfie`. + +## 7.78.0 - 2021-05-05 +* [#1120](https://github.com/stripe/stripe-php/pull/1120) Update PHPDocs + * Add support for `Radar.EarlyFraudWarning.payment_intent` + +## 7.77.0 - 2021-04-12 +* [#1110](https://github.com/stripe/stripe-php/pull/1110) Update PHPDocs + * Add support for `acss_debit` on `PaymentMethod` + * Add support for `payment_method_options` on `Checkout\Session` +* [#1107](https://github.com/stripe/stripe-php/pull/1107) Remove duplicate object phpdoc + +## 7.76.0 - 2021-03-22 +* [#1100](https://github.com/stripe/stripe-php/pull/1100) Update PHPDocs + * Added support for `amount_shipping` on `Checkout.Session.total_details` +* [#1088](https://github.com/stripe/stripe-php/pull/1088) Make possibility to extend CurlClient + +## 7.75.0 - 2021-02-22 +* [#1094](https://github.com/stripe/stripe-php/pull/1094) Add support for Billing Portal Configuration API + +## 7.74.0 - 2021-02-17 +* [#1093](https://github.com/stripe/stripe-php/pull/1093) Update PHPDocs + * Add support for on_behalf_of to Invoice + +## 7.73.0 - 2021-02-16 +* [#1091](https://github.com/stripe/stripe-php/pull/1091) Update PHPDocs + * Add support for `afterpay_clearpay` on `PaymentMethod`. + +## 7.72.0 - 2021-02-08 +* [#1089](https://github.com/stripe/stripe-php/pull/1089) Update PHPDocs + * Add support for `afterpay_clearpay_payments` on `Account.capabilities` + * Add support for `payment_settings` on `Invoice` + +## 7.71.0 - 2021-02-05 +* [#1087](https://github.com/stripe/stripe-php/pull/1087) Update PHPDocs +* [#1086](https://github.com/stripe/stripe-php/pull/1086) Update CA cert bundle URL + +## 7.70.0 - 2021-02-03 +* [#1085](https://github.com/stripe/stripe-php/pull/1085) Update PHPDocs + * Add support for `nationality` on `Person` + * Add member `gb_vat` of `TaxID` enum + + +## 7.69.0 - 2021-01-21 +* [#1079](https://github.com/stripe/stripe-php/pull/1079) Update PHPDocs + +## 7.68.0 - 2021-01-14 +* [#1063](https://github.com/stripe/stripe-php/pull/1063) Multiple API changes +* [#1061](https://github.com/stripe/stripe-php/pull/1061) Bump phpDocumentor to 3.0.0 + +## 7.67.0 - 2020-12-09 +* [#1060](https://github.com/stripe/stripe-php/pull/1060) Improve PHPDocs for `Discount` +* [#1059](https://github.com/stripe/stripe-php/pull/1059) Upgrade PHPStan to 0.12.59 +* [#1057](https://github.com/stripe/stripe-php/pull/1057) Bump PHP-CS-Fixer and update code + +## 7.66.1 - 2020-12-01 +* [#1054](https://github.com/stripe/stripe-php/pull/1054) Improve error message for invalid keys in StripeClient + +## 7.66.0 - 2020-11-24 +* [#1053](https://github.com/stripe/stripe-php/pull/1053) Update PHPDocs + +## 7.65.0 - 2020-11-19 +* [#1050](https://github.com/stripe/stripe-php/pull/1050) Added constants for `proration_behavior` on `Subscription` + +## 7.64.0 - 2020-11-18 +* [#1049](https://github.com/stripe/stripe-php/pull/1049) Update PHPDocs + +## 7.63.0 - 2020-11-17 +* [#1048](https://github.com/stripe/stripe-php/pull/1048) Update PHPDocs +* [#1046](https://github.com/stripe/stripe-php/pull/1046) Force IPv4 resolving + +## 7.62.0 - 2020-11-09 +* [#1041](https://github.com/stripe/stripe-php/pull/1041) Add missing constants on `Event` +* [#1038](https://github.com/stripe/stripe-php/pull/1038) Update PHPDocs + +## 7.61.0 - 2020-10-20 +* [#1030](https://github.com/stripe/stripe-php/pull/1030) Add support for `jp_rn` and `ru_kpp` as a `type` on `TaxId` + +## 7.60.0 - 2020-10-15 +* [#1027](https://github.com/stripe/stripe-php/pull/1027) Warn if opts are in params + +## 7.58.0 - 2020-10-14 +* [#1026](https://github.com/stripe/stripe-php/pull/1026) Add support for the Payout Reverse API + +## 7.57.0 - 2020-09-29 +* [#1020](https://github.com/stripe/stripe-php/pull/1020) Add support for the `SetupAttempt` resource and List API + +## 7.56.0 - 2020-09-25 +* [#1019](https://github.com/stripe/stripe-php/pull/1019) Update PHPDocs + +## 7.55.0 - 2020-09-24 +* [#1018](https://github.com/stripe/stripe-php/pull/1018) Multiple API changes + * Updated PHPDocs + * Added `TYPE_CONTRIBUTION` as a constant on `BalanceTransaction` + +## 7.54.0 - 2020-09-23 +* [#1017](https://github.com/stripe/stripe-php/pull/1017) Updated PHPDoc + +## 7.53.1 - 2020-09-22 +* [#1015](https://github.com/stripe/stripe-php/pull/1015) Bugfix: don't error on systems with php_uname in disablefunctions with whitespace + +## 7.53.0 - 2020-09-21 +* [#1016](https://github.com/stripe/stripe-php/pull/1016) Updated PHPDocs + +## 7.52.0 - 2020-09-08 +* [#1010](https://github.com/stripe/stripe-php/pull/1010) Update PHPDocs + +## 7.51.0 - 2020-09-02 +* [#1007](https://github.com/stripe/stripe-php/pull/1007) Multiple API changes + * Add support for the Issuing Dispute Submit API + * Add constants for `payment_status` on Checkout `Session` +* [#1003](https://github.com/stripe/stripe-php/pull/1003) Add trim to getSignatures to allow for leading whitespace. + +## 7.50.0 - 2020-08-28 +* [#1005](https://github.com/stripe/stripe-php/pull/1005) Updated PHPDocs + +## 7.49.0 - 2020-08-19 +* [#998](https://github.com/stripe/stripe-php/pull/998) PHPDocs updated + +## 7.48.0 - 2020-08-17 +* [#997](https://github.com/stripe/stripe-php/pull/997) PHPDocs updated +* [#996](https://github.com/stripe/stripe-php/pull/996) Fixing telemetry + +## 7.47.0 - 2020-08-13 +* [#994](https://github.com/stripe/stripe-php/pull/994) Nullable balance_transactions on issuing disputes +* [#991](https://github.com/stripe/stripe-php/pull/991) Fix invalid return types in OAuthService + +## 7.46.1 - 2020-08-07 +* [#990](https://github.com/stripe/stripe-php/pull/990) PHPdoc changes + +## 7.46.0 - 2020-08-05 +* [#989](https://github.com/stripe/stripe-php/pull/989) Add support for the `PromotionCode` resource and APIs + +## 7.45.0 - 2020-07-28 +* [#981](https://github.com/stripe/stripe-php/pull/981) PHPdoc updates + +## 7.44.0 - 2020-07-20 +* [#948](https://github.com/stripe/stripe-php/pull/948) Add `first()` and `last()` functions to `Collection` + +## 7.43.0 - 2020-07-17 +* [#975](https://github.com/stripe/stripe-php/pull/975) Add support for `political_exposure` on `Person` + +## 7.42.0 - 2020-07-15 +* [#974](https://github.com/stripe/stripe-php/pull/974) Add new constants for `purpose` on `File` + +## 7.41.1 - 2020-07-15 +* [#973](https://github.com/stripe/stripe-php/pull/973) Multiple PHPDoc fixes + +## 7.41.0 - 2020-07-14 +* [#971](https://github.com/stripe/stripe-php/pull/971) Adds enum values for `billing_address_collection` on Checkout `Session` + +## 7.40.0 - 2020-07-06 +* [#964](https://github.com/stripe/stripe-php/pull/964) Add OAuthService + +## 7.39.0 - 2020-06-25 +* [#960](https://github.com/stripe/stripe-php/pull/960) Add constants for `payment_behavior` on `Subscription` + +## 7.38.0 - 2020-06-24 +* [#959](https://github.com/stripe/stripe-php/pull/959) Add multiple constants missing for `Event` + +## 7.37.2 - 2020-06-23 +* [#957](https://github.com/stripe/stripe-php/pull/957) Updated PHPDocs + +## 7.37.1 - 2020-06-11 +* [#952](https://github.com/stripe/stripe-php/pull/952) Improve PHPDoc + +## 7.37.0 - 2020-06-09 +* [#950](https://github.com/stripe/stripe-php/pull/950) Add support for `id_npwp` and `my_frp` as `type` on `TaxId` + +## 7.36.2 - 2020-06-03 +* [#946](https://github.com/stripe/stripe-php/pull/946) Update PHPDoc + +## 7.36.1 - 2020-05-28 +* [#938](https://github.com/stripe/stripe-php/pull/938) Remove extra array_keys() call. +* [#942](https://github.com/stripe/stripe-php/pull/942) fix autopagination for service methods + +## 7.36.0 - 2020-05-21 +* [#937](https://github.com/stripe/stripe-php/pull/937) Add support for `ae_trn`, `cl_tin` and `sa_vat` as `type` on `TaxId` + +## 7.35.0 - 2020-05-20 +* [#936](https://github.com/stripe/stripe-php/pull/936) Add `anticipation_repayment` as a `type` on `BalanceTransaction` + +## 7.34.0 - 2020-05-18 +* [#934](https://github.com/stripe/stripe-php/pull/934) Add support for `issuing_dispute` as a `type` on `BalanceTransaction` + +## 7.33.1 - 2020-05-15 +* [#933](https://github.com/stripe/stripe-php/pull/933) Services bugfix: convert nested null params to empty strings + +## 7.33.0 - 2020-05-14 +* [#771](https://github.com/stripe/stripe-php/pull/771) Introduce client/services API. The [migration guide](https://github.com/stripe/stripe-php/wiki/Migration-to-StripeClient-and-services-in-7.33.0) contains before & after examples of the backwards-compatible changes. + +## 7.32.1 - 2020-05-13 +* [#932](https://github.com/stripe/stripe-php/pull/932) Fix multiple PHPDoc + +## 7.32.0 - 2020-05-11 +* [#931](https://github.com/stripe/stripe-php/pull/931) Add support for the `LineItem` resource and APIs + +## 7.31.0 - 2020-05-01 +* [#927](https://github.com/stripe/stripe-php/pull/927) Add support for new tax IDs + +## 7.30.0 - 2020-04-29 +* [#924](https://github.com/stripe/stripe-php/pull/924) Add support for the `Price` resource and APIs + +## 7.29.0 - 2020-04-22 +* [#920](https://github.com/stripe/stripe-php/pull/920) Add support for the `Session` resource and APIs on the `BillingPortal` namespace + +## 7.28.1 - 2020-04-10 +* [#915](https://github.com/stripe/stripe-php/pull/915) Improve PHPdocs for many classes + +## 7.28.0 - 2020-04-03 +* [#912](https://github.com/stripe/stripe-php/pull/912) Preserve backwards compatibility for typoed `TYPE_ADJUSTEMENT` enum. +* [#911](https://github.com/stripe/stripe-php/pull/911) Codegenerated PHPDoc for nested resources +* [#902](https://github.com/stripe/stripe-php/pull/902) Update docstrings for nested resources + +## 7.27.3 - 2020-03-18 +* [#899](https://github.com/stripe/stripe-php/pull/899) Convert keys to strings in `StripeObject::toArray()` + +## 7.27.2 - 2020-03-13 +* [#894](https://github.com/stripe/stripe-php/pull/894) Multiple PHPDocs changes + +## 7.27.1 - 2020-03-03 +* [#890](https://github.com/stripe/stripe-php/pull/890) Update PHPdoc + +## 7.27.0 - 2020-02-28 +* [#889](https://github.com/stripe/stripe-php/pull/889) Add new constants for `type` on `TaxId` + +## 7.26.0 - 2020-02-26 +* [#886](https://github.com/stripe/stripe-php/pull/886) Add support for listing Checkout `Session` +* [#883](https://github.com/stripe/stripe-php/pull/883) Add PHPDoc class descriptions + +## 7.25.0 - 2020-02-14 +* [#879](https://github.com/stripe/stripe-php/pull/879) Make `\Stripe\Collection` implement `\Countable` +* [#875](https://github.com/stripe/stripe-php/pull/875) Last set of PHP-CS-Fixer updates +* [#874](https://github.com/stripe/stripe-php/pull/874) Enable php_unit_internal_class rule +* [#873](https://github.com/stripe/stripe-php/pull/873) Add support for phpDocumentor in Makefile +* [#872](https://github.com/stripe/stripe-php/pull/872) Another batch of PHP-CS-Fixer rule updates +* [#871](https://github.com/stripe/stripe-php/pull/871) Fix a few PHPDoc comments +* [#870](https://github.com/stripe/stripe-php/pull/870) More PHP-CS-Fixer tweaks + +## 7.24.0 - 2020-02-10 +* [#862](https://github.com/stripe/stripe-php/pull/862) Better PHPDoc +* [#865](https://github.com/stripe/stripe-php/pull/865) Get closer to `@PhpCsFixer` standard ruleset + +## 7.23.0 - 2020-02-05 +* [#860](https://github.com/stripe/stripe-php/pull/860) Add PHPDoc types for expandable fields +* [#858](https://github.com/stripe/stripe-php/pull/858) Use `native_function_invocation` PHPStan rule +* [#857](https://github.com/stripe/stripe-php/pull/857) Update PHPDoc on nested resources +* [#855](https://github.com/stripe/stripe-php/pull/855) PHPDoc: `StripeObject` -> `ErrorObject` where appropriate +* [#837](https://github.com/stripe/stripe-php/pull/837) Autogen diff +* [#854](https://github.com/stripe/stripe-php/pull/854) Upgrade PHPStan and fix settings +* [#850](https://github.com/stripe/stripe-php/pull/850) Yet more PHPDoc updates + +## 7.22.0 - 2020-01-31 +* [#849](https://github.com/stripe/stripe-php/pull/849) Add new constants for `type` on `TaxId` +* [#843](https://github.com/stripe/stripe-php/pull/843) Even more PHPDoc fixes +* [#841](https://github.com/stripe/stripe-php/pull/841) More PHPDoc fixes + +## 7.21.1 - 2020-01-29 +* [#840](https://github.com/stripe/stripe-php/pull/840) Update phpdocs across multiple resources. + +## 7.21.0 - 2020-01-28 +* [#839](https://github.com/stripe/stripe-php/pull/839) Add support for `TYPE_ES_CIF` on `TaxId` + +## 7.20.0 - 2020-01-23 +* [#836](https://github.com/stripe/stripe-php/pull/836) Add new type values for `TaxId` + +## 7.19.1 - 2020-01-14 +* [#831](https://github.com/stripe/stripe-php/pull/831) Fix incorrect `UnexpectedValueException` instantiation + +## 7.19.0 - 2020-01-14 +* [#830](https://github.com/stripe/stripe-php/pull/830) Add support for `CreditNoteLineItem` + +## 7.18.0 - 2020-01-13 +* [#829](https://github.com/stripe/stripe-php/pull/829) Don't call php_uname function if disabled by php.ini + +## 7.17.0 - 2020-01-08 +* [#821](https://github.com/stripe/stripe-php/pull/821) Improve PHPDoc types for `ApiErrorException.get/setJsonBody()` methods + +## 7.16.0 - 2020-01-06 +* [#826](https://github.com/stripe/stripe-php/pull/826) Rename remaining `$options` to `$opts` +* [#825](https://github.com/stripe/stripe-php/pull/825) Update PHPDoc + +## 7.15.0 - 2020-01-06 +* [#824](https://github.com/stripe/stripe-php/pull/824) Add constant `TYPE_SG_UEN` to `TaxId` + +## 7.14.2 - 2019-12-04 +* [#816](https://github.com/stripe/stripe-php/pull/816) Disable autoloader when checking for `Throwable` + +## 7.14.1 - 2019-11-26 +* [#812](https://github.com/stripe/stripe-php/pull/812) Fix invalid PHPdoc on `Subscription` + +## 7.14.0 - 2019-11-26 +* [#811](https://github.com/stripe/stripe-php/pull/811) Add support for `CreditNote` preview. + +## 7.13.0 - 2019-11-19 +* [#808](https://github.com/stripe/stripe-php/pull/808) Add support for listing lines on an Invoice directly via `Invoice::allLines()` + +## 7.12.0 - 2019-11-08 + +- [#805](https://github.com/stripe/stripe-php/pull/805) Add Source::allSourceTransactions and SubscriptionItem::allUsageRecordSummaries +- [#798](https://github.com/stripe/stripe-php/pull/798) The argument of `array_key_exists` cannot be `null` +- [#803](https://github.com/stripe/stripe-php/pull/803) Removed unwanted got + +## 7.11.0 - 2019-11-06 + +- [#797](https://github.com/stripe/stripe-php/pull/797) Add support for reverse pagination + +## 7.10.0 - 2019-11-05 + +- [#795](https://github.com/stripe/stripe-php/pull/795) Add support for `Mandate` + +## 7.9.0 - 2019-11-05 + +- [#794](https://github.com/stripe/stripe-php/pull/794) Add PHPDoc to `ApiResponse` +- [#792](https://github.com/stripe/stripe-php/pull/792) Use single quotes for `OBJECT_NAME` constants + +## 7.8.0 - 2019-11-05 + +- [#790](https://github.com/stripe/stripe-php/pull/790) Mark nullable fields in PHPDoc +- [#788](https://github.com/stripe/stripe-php/pull/788) Early codegen fixes +- [#787](https://github.com/stripe/stripe-php/pull/787) Use PHPStan in Travis CI + +## 7.7.1 - 2019-10-25 + +- [#781](https://github.com/stripe/stripe-php/pull/781) Fix telemetry header +- [#780](https://github.com/stripe/stripe-php/pull/780) Contributor Convenant + +## 7.7.0 - 2019-10-23 + +- [#776](https://github.com/stripe/stripe-php/pull/776) Add `CAPABILITY_TRANSFERS` to `Account` +- [#778](https://github.com/stripe/stripe-php/pull/778) Add support for `TYPE_MX_RFC` type on `TaxId` + +## 7.6.0 - 2019-10-22 + +- [#770](https://github.com/stripe/stripe-php/pull/770) Add missing constants for Customer's `TaxId` + +## 7.5.0 - 2019-10-18 + +- [#768](https://github.com/stripe/stripe-php/pull/768) Redact API key in `RequestOptions` debug info + +## 7.4.0 - 2019-10-15 + +- [#764](https://github.com/stripe/stripe-php/pull/764) Add support for HTTP request monitoring callback + +## 7.3.1 - 2019-10-07 + +- [#755](https://github.com/stripe/stripe-php/pull/755) Respect Stripe-Should-Retry and Retry-After headers + +## 7.3.0 - 2019-10-02 + +- [#752](https://github.com/stripe/stripe-php/pull/752) Add `payment_intent.canceled` and `setup_intent.canceled` events +- [#749](https://github.com/stripe/stripe-php/pull/749) Call `toArray()` on objects only + +## 7.2.2 - 2019-09-24 + +- [#746](https://github.com/stripe/stripe-php/pull/746) Add missing decline codes + +## 7.2.1 - 2019-09-23 + +- [#744](https://github.com/stripe/stripe-php/pull/744) Added new PHPDoc + +## 7.2.0 - 2019-09-17 + +- [#738](https://github.com/stripe/stripe-php/pull/738) Added missing constants for `SetupIntent` events + +## 7.1.1 - 2019-09-16 + +- [#737](https://github.com/stripe/stripe-php/pull/737) Added new PHPDoc + +## 7.1.0 - 2019-09-13 + +- [#736](https://github.com/stripe/stripe-php/pull/736) Make `CaseInsensitiveArray` countable and traversable + +## 7.0.2 - 2019-09-06 + +- [#729](https://github.com/stripe/stripe-php/pull/729) Fix usage of `SignatureVerificationException` in PHPDoc blocks + +## 7.0.1 - 2019-09-05 + +- [#728](https://github.com/stripe/stripe-php/pull/728) Clean up Collection + +## 7.0.0 - 2019-09-03 + +Major version release. The [migration guide](https://github.com/stripe/stripe-php/wiki/Migration-guide-for-v7) contains a detailed list of backwards-incompatible changes with upgrade instructions. + +Pull requests included in this release (cf. [#552](https://github.com/stripe/stripe-php/pull/552)) (⚠️ = breaking changes): + +- ⚠️ Drop support for PHP 5.4 ([#551](https://github.com/stripe/stripe-php/pull/551)) +- ⚠️ Drop support for PHP 5.5 ([#554](https://github.com/stripe/stripe-php/pull/554)) +- Bump dependencies ([#553](https://github.com/stripe/stripe-php/pull/553)) +- Remove `CURLFile` check ([#555](https://github.com/stripe/stripe-php/pull/555)) +- Update constant definitions for PHP >= 5.6 ([#556](https://github.com/stripe/stripe-php/pull/556)) +- ⚠️ Remove `FileUpload` alias ([#557](https://github.com/stripe/stripe-php/pull/557)) +- Remove `curl_reset` check ([#570](https://github.com/stripe/stripe-php/pull/570)) +- Use `\Stripe\::class` constant instead of strings ([#643](https://github.com/stripe/stripe-php/pull/643)) +- Use `array_column` to flatten params ([#686](https://github.com/stripe/stripe-php/pull/686)) +- ⚠️ Remove deprecated methods ([#692](https://github.com/stripe/stripe-php/pull/692)) +- ⚠️ Remove `IssuerFraudRecord` ([#696](https://github.com/stripe/stripe-php/pull/696)) +- Update constructors of Stripe exception classes ([#559](https://github.com/stripe/stripe-php/pull/559)) +- Fix remaining TODOs ([#700](https://github.com/stripe/stripe-php/pull/700)) +- Use yield for autopagination ([#703](https://github.com/stripe/stripe-php/pull/703)) +- ⚠️ Rename fake magic methods and rewrite array conversion ([#704](https://github.com/stripe/stripe-php/pull/704)) +- Add `ErrorObject` to Stripe exceptions ([#705](https://github.com/stripe/stripe-php/pull/705)) +- Start using PHP CS Fixer ([#706](https://github.com/stripe/stripe-php/pull/706)) +- Update error messages for nested resource operations ([#708](https://github.com/stripe/stripe-php/pull/708)) +- Upgrade retry logic ([#707](https://github.com/stripe/stripe-php/pull/707)) +- ⚠️ `Collection` improvements / fixes ([#715](https://github.com/stripe/stripe-php/pull/715)) +- ⚠️ Modernize exceptions ([#709](https://github.com/stripe/stripe-php/pull/709)) +- Add constants for error codes ([#716](https://github.com/stripe/stripe-php/pull/716)) +- Update certificate bundle ([#717](https://github.com/stripe/stripe-php/pull/717)) +- Retry requests on a 429 that's a lock timeout ([#718](https://github.com/stripe/stripe-php/pull/718)) +- Fix `toArray()` calls ([#719](https://github.com/stripe/stripe-php/pull/719)) +- Couple of fixes for PHP 7.4 ([#725](https://github.com/stripe/stripe-php/pull/725)) + +## 6.43.1 - 2019-08-29 + +- [#722](https://github.com/stripe/stripe-php/pull/722) Make `LoggerInterface::error` compatible with its PSR-3 counterpart +- [#714](https://github.com/stripe/stripe-php/pull/714) Add `pending_setup_intent` property in `Subscription` +- [#713](https://github.com/stripe/stripe-php/pull/713) Add typehint to `ApiResponse` +- [#712](https://github.com/stripe/stripe-php/pull/712) Fix comment +- [#701](https://github.com/stripe/stripe-php/pull/701) Start testing PHP 7.3 + +## 6.43.0 - 2019-08-09 + +- [#694](https://github.com/stripe/stripe-php/pull/694) Add `SubscriptionItem::createUsageRecord` method + +## 6.42.0 - 2019-08-09 + +- [#688](https://github.com/stripe/stripe-php/pull/688) Remove `SubscriptionScheduleRevision` + - Note that this is technically a breaking change, however we've chosen to release it as a minor version in light of the fact that this resource and its API methods were virtually unused. + +## 6.41.0 - 2019-07-31 + +- [#683](https://github.com/stripe/stripe-php/pull/683) Move the List Balance History API to `/v1/balance_transactions` + +## 6.40.0 - 2019-06-27 + +- [#675](https://github.com/stripe/stripe-php/pull/675) Add support for `SetupIntent` resource and APIs + +## 6.39.2 - 2019-06-26 + +- [#676](https://github.com/stripe/stripe-php/pull/676) Fix exception message in `CustomerBalanceTransaction::update()` + +## 6.39.1 - 2019-06-25 + +- [#674](https://github.com/stripe/stripe-php/pull/674) Add new constants for `collection_method` on `Invoice` + +## 6.39.0 - 2019-06-24 + +- [#673](https://github.com/stripe/stripe-php/pull/673) Enable request latency telemetry by default + +## 6.38.0 - 2019-06-17 + +- [#649](https://github.com/stripe/stripe-php/pull/649) Add support for `CustomerBalanceTransaction` resource and APIs + +## 6.37.2 - 2019-06-17 + +- [#671](https://github.com/stripe/stripe-php/pull/671) Add new PHPDoc +- [#672](https://github.com/stripe/stripe-php/pull/672) Add constants for `submit_type` on Checkout `Session` + +## 6.37.1 - 2019-06-14 + +- [#670](https://github.com/stripe/stripe-php/pull/670) Add new PHPDoc + +## 6.37.0 - 2019-05-23 + +- [#663](https://github.com/stripe/stripe-php/pull/663) Add support for `radar.early_fraud_warning` resource + +## 6.36.0 - 2019-05-22 + +- [#661](https://github.com/stripe/stripe-php/pull/661) Add constants for new TaxId types +- [#662](https://github.com/stripe/stripe-php/pull/662) Add constants for BalanceTransaction types + +## 6.35.2 - 2019-05-20 + +- [#655](https://github.com/stripe/stripe-php/pull/655) Add constants for payment intent statuses +- [#659](https://github.com/stripe/stripe-php/pull/659) Fix PHPDoc for various nested Account actions +- [#660](https://github.com/stripe/stripe-php/pull/660) Fix various PHPDoc + +## 6.35.1 - 2019-05-20 + +- [#658](https://github.com/stripe/stripe-php/pull/658) Use absolute value when checking timestamp tolerance + +## 6.35.0 - 2019-05-14 + +- [#651](https://github.com/stripe/stripe-php/pull/651) Add support for the Capability resource and APIs + +## 6.34.6 - 2019-05-13 + +- [#654](https://github.com/stripe/stripe-php/pull/654) Fix typo in definition of `Event::PAYMENT_METHOD_ATTACHED` constant + +## 6.34.5 - 2019-05-06 + +- [#647](https://github.com/stripe/stripe-php/pull/647) Set the return type to static for more operations + +## 6.34.4 - 2019-05-06 + +- [#650](https://github.com/stripe/stripe-php/pull/650) Add missing constants for Event types + +## 6.34.3 - 2019-05-01 + +- [#644](https://github.com/stripe/stripe-php/pull/644) Update return type to `static` to improve static analysis +- [#645](https://github.com/stripe/stripe-php/pull/645) Fix constant for `payment_intent.payment_failed` + +## 6.34.2 - 2019-04-26 + +- [#642](https://github.com/stripe/stripe-php/pull/642) Fix an issue where existing idempotency keys would be overwritten when using automatic retries + +## 6.34.1 - 2019-04-25 + +- [#640](https://github.com/stripe/stripe-php/pull/640) Add missing phpdocs + +## 6.34.0 - 2019-04-24 + +- [#626](https://github.com/stripe/stripe-php/pull/626) Add support for the `TaxRate` resource and APIs +- [#639](https://github.com/stripe/stripe-php/pull/639) Fix multiple phpdoc issues + +## 6.33.0 - 2019-04-22 + +- [#630](https://github.com/stripe/stripe-php/pull/630) Add support for the `TaxId` resource and APIs + +## 6.32.1 - 2019-04-19 + +- [#636](https://github.com/stripe/stripe-php/pull/636) Correct type of `$personId` in PHPDoc + +## 6.32.0 - 2019-04-18 + +- [#621](https://github.com/stripe/stripe-php/pull/621) Add support for `CreditNote` + +## 6.31.5 - 2019-04-12 + +- [#628](https://github.com/stripe/stripe-php/pull/628) Add constants for `person.*` event types +- [#628](https://github.com/stripe/stripe-php/pull/628) Add missing constants for `Account` and `Person` + +## 6.31.4 - 2019-04-05 + +- [#624](https://github.com/stripe/stripe-php/pull/624) Fix encoding of nested parameters in multipart requests + +## 6.31.3 - 2019-04-02 + +- [#623](https://github.com/stripe/stripe-php/pull/623) Only use HTTP/2 with curl >= 7.60.0 + +## 6.31.2 - 2019-03-25 + +- [#619](https://github.com/stripe/stripe-php/pull/619) Fix PHPDoc return types for list methods for nested resources + +## 6.31.1 - 2019-03-22 + +- [#612](https://github.com/stripe/stripe-php/pull/612) Add a lot of constants +- [#614](https://github.com/stripe/stripe-php/pull/614) Add missing subscription status constants + +## 6.31.0 - 2019-03-18 + +- [#600](https://github.com/stripe/stripe-php/pull/600) Add support for the `PaymentMethod` resource and APIs +- [#606](https://github.com/stripe/stripe-php/pull/606) Add support for retrieving a Checkout `Session` +- [#611](https://github.com/stripe/stripe-php/pull/611) Add support for deleting a Terminal `Location` and `Reader` + +## 6.30.5 - 2019-03-11 + +- [#607](https://github.com/stripe/stripe-php/pull/607) Correctly handle case where a metadata key is called `metadata` + +## 6.30.4 - 2019-02-27 + +- [#602](https://github.com/stripe/stripe-php/pull/602) Add `subscription_schedule` to `Subscription` for PHPDoc. + +## 6.30.3 - 2019-02-26 + +- [#603](https://github.com/stripe/stripe-php/pull/603) Improve PHPDoc on the `Source` object to cover all types of Sources currently supported. + +## 6.30.2 - 2019-02-25 + +- [#601](https://github.com/stripe/stripe-php/pull/601) Fix PHPDoc across multiple resources and add support for new events. + +## 6.30.1 - 2019-02-16 + +- [#599](https://github.com/stripe/stripe-php/pull/599) Fix PHPDoc for `SubscriptionSchedule` and `SubscriptionScheduleRevision` + +## 6.30.0 - 2019-02-12 + +- [#590](https://github.com/stripe/stripe-php/pull/590) Add support for `SubscriptionSchedule` and `SubscriptionScheduleRevision` + +## 6.29.3 - 2019-01-31 + +- [#592](https://github.com/stripe/stripe-php/pull/592) Some more PHPDoc fixes + +## 6.29.2 - 2019-01-31 + +- [#591](https://github.com/stripe/stripe-php/pull/591) Fix PHPDoc for nested resources + +## 6.29.1 - 2019-01-25 + +- [#566](https://github.com/stripe/stripe-php/pull/566) Fix dangling message contents +- [#586](https://github.com/stripe/stripe-php/pull/586) Don't overwrite `CURLOPT_HTTP_VERSION` option + +## 6.29.0 - 2019-01-23 + +- [#579](https://github.com/stripe/stripe-php/pull/579) Rename `CheckoutSession` to `Session` and move it under the `Checkout` namespace. This is a breaking change, but we've reached out to affected merchants and all new merchants would use the new approach. + +## 6.28.1 - 2019-01-21 + +- [#580](https://github.com/stripe/stripe-php/pull/580) Properly serialize `individual` on `Account` objects + +## 6.28.0 - 2019-01-03 + +- [#576](https://github.com/stripe/stripe-php/pull/576) Add support for iterating directly over `Collection` instances + +## 6.27.0 - 2018-12-21 + +- [#571](https://github.com/stripe/stripe-php/pull/571) Add support for the `CheckoutSession` resource + +## 6.26.0 - 2018-12-11 + +- [#568](https://github.com/stripe/stripe-php/pull/568) Enable persistent connections + +## 6.25.0 - 2018-12-10 + +- [#567](https://github.com/stripe/stripe-php/pull/567) Add support for account links + +## 6.24.0 - 2018-11-28 + +- [#562](https://github.com/stripe/stripe-php/pull/562) Add support for the Review resource +- [#564](https://github.com/stripe/stripe-php/pull/564) Add event name constants for subscription schedule aborted/expiring + +## 6.23.0 - 2018-11-27 + +- [#542](https://github.com/stripe/stripe-php/pull/542) Add support for `ValueList` and `ValueListItem` for Radar + +## 6.22.1 - 2018-11-20 + +- [#561](https://github.com/stripe/stripe-php/pull/561) Add cast and some docs to telemetry introduced in 6.22.0/549 + +## 6.22.0 - 2018-11-15 + +- [#549](https://github.com/stripe/stripe-php/pull/549) Add support for client telemetry + +## 6.21.1 - 2018-11-12 + +- [#548](https://github.com/stripe/stripe-php/pull/548) Don't mutate `Exception` class properties from `OAuthBase` error + +## 6.21.0 - 2018-11-08 + +- [#537](https://github.com/stripe/stripe-php/pull/537) Add new API endpoints for the `Invoice` resource. + +## 6.20.1 - 2018-11-07 + +- [#546](https://github.com/stripe/stripe-php/pull/546) Drop files from the Composer package that aren't needed in the release + +## 6.20.0 - 2018-10-30 + +- [#536](https://github.com/stripe/stripe-php/pull/536) Add support for the `Person` resource +- [#541](https://github.com/stripe/stripe-php/pull/541) Add support for the `WebhookEndpoint` resource + +## 6.19.5 - 2018-10-17 + +- [#539](https://github.com/stripe/stripe-php/pull/539) Fix methods on `\Stripe\PaymentIntent` to properly pass arguments to the API. + +## 6.19.4 - 2018-10-11 + +- [#534](https://github.com/stripe/stripe-php/pull/534) Fix PSR-4 autoloading for `\Stripe\FileUpload` class alias + +## 6.19.3 - 2018-10-09 + +- [#530](https://github.com/stripe/stripe-php/pull/530) Add constants for `flow` (`FLOW_*`), `status` (`STATUS_*`) and `usage` (`USAGE_*`) on `\Stripe\Source` + +## 6.19.2 - 2018-10-08 + +- [#531](https://github.com/stripe/stripe-php/pull/531) Store HTTP response headers in case-insensitive array + +## 6.19.1 - 2018-09-25 + +- [#526](https://github.com/stripe/stripe-php/pull/526) Ignore null values in request parameters + +## 6.19.0 - 2018-09-24 + +- [#523](https://github.com/stripe/stripe-php/pull/523) Add support for Stripe Terminal + +## 6.18.0 - 2018-09-24 + +- [#520](https://github.com/stripe/stripe-php/pull/520) Rename `\Stripe\FileUpload` to `\Stripe\File` + +## 6.17.2 - 2018-09-18 + +- [#522](https://github.com/stripe/stripe-php/pull/522) Fix warning when adding a new additional owner to an existing array + +## 6.17.1 - 2018-09-14 + +- [#517](https://github.com/stripe/stripe-php/pull/517) Integer-index encode all sequential arrays + +## 6.17.0 - 2018-09-05 + +- [#514](https://github.com/stripe/stripe-php/pull/514) Add support for reporting resources + +## 6.16.0 - 2018-08-23 + +- [#509](https://github.com/stripe/stripe-php/pull/509) Add support for usage record summaries + +## 6.15.0 - 2018-08-03 + +- [#504](https://github.com/stripe/stripe-php/pull/504) Add cancel support for topups + +## 6.14.0 - 2018-08-02 + +- [#505](https://github.com/stripe/stripe-php/pull/505) Add support for file links + +## 6.13.0 - 2018-07-31 + +- [#502](https://github.com/stripe/stripe-php/pull/502) Add `isDeleted()` method to `\Stripe\StripeObject` + +## 6.12.0 - 2018-07-28 + +- [#501](https://github.com/stripe/stripe-php/pull/501) Add support for scheduled query runs (`\Stripe\Sigma\ScheduledQueryRun`) for Sigma + +## 6.11.0 - 2018-07-26 + +- [#500](https://github.com/stripe/stripe-php/pull/500) Add support for Stripe Issuing + +## 6.10.4 - 2018-07-19 + +- [#498](https://github.com/stripe/stripe-php/pull/498) Internal improvements to the `\Stripe\ApiResource.classUrl()` method + +## 6.10.3 - 2018-07-16 + +- [#497](https://github.com/stripe/stripe-php/pull/497) Use HTTP/2 only for HTTPS requests + +## 6.10.2 - 2018-07-11 + +- [#494](https://github.com/stripe/stripe-php/pull/494) Enable HTTP/2 support + +## 6.10.1 - 2018-07-10 + +- [#493](https://github.com/stripe/stripe-php/pull/493) Add PHPDoc for `auto_advance` on `\Stripe\Invoice` + +## 6.10.0 - 2018-06-28 + +- [#488](https://github.com/stripe/stripe-php/pull/488) Add support for `$appPartnerId` to `Stripe::setAppInfo()` + +## 6.9.0 - 2018-06-28 + +- [#487](https://github.com/stripe/stripe-php/pull/487) Add support for payment intents + +## 6.8.2 - 2018-06-24 + +- [#486](https://github.com/stripe/stripe-php/pull/486) Make `Account.deauthorize()` return the `StripeObject` from the API + +## 6.8.1 - 2018-06-13 + +- [#472](https://github.com/stripe/stripe-php/pull/472) Added phpDoc for `ApiRequestor` and others, especially regarding thrown errors + +## 6.8.0 - 2018-06-13 + +- [#481](https://github.com/stripe/stripe-php/pull/481) Add new `\Stripe\Discount` and `\Stripe\OrderItem` classes, add more PHPDoc describing object attributes + +## 6.7.4 - 2018-05-29 + +- [#480](https://github.com/stripe/stripe-php/pull/480) PHPDoc changes for API version 2018-05-21 and the addition of the new `CHARGE_EXPIRED` event type + +## 6.7.3 - 2018-05-28 + +- [#479](https://github.com/stripe/stripe-php/pull/479) Fix unnecessary traits on `\Stripe\InvoiceLineItem` + +## 6.7.2 - 2018-05-28 + +- [#471](https://github.com/stripe/stripe-php/pull/471) Add `OBJECT_NAME` constant to all API resource classes, add `\Stripe\InvoiceLineItem` class + +## 6.7.1 - 2018-05-13 + +- [#468](https://github.com/stripe/stripe-php/pull/468) Update fields in PHP docs for accuracy + +## 6.7.0 - 2018-05-09 + +- [#466](https://github.com/stripe/stripe-php/pull/466) Add support for issuer fraud records + +## 6.6.0 - 2018-04-11 + +- [#460](https://github.com/stripe/stripe-php/pull/460) Add support for flexible billing primitives + +## 6.5.0 - 2018-04-05 + +- [#461](https://github.com/stripe/stripe-php/pull/461) Don't zero keys on non-`metadata` subobjects + +## 6.4.2 - 2018-03-17 + +- [#458](https://github.com/stripe/stripe-php/pull/458) Add PHPDoc for `account` on `\Stripe\Event` + +## 6.4.1 - 2018-03-02 + +- [#455](https://github.com/stripe/stripe-php/pull/455) Fix namespaces in PHPDoc +- [#456](https://github.com/stripe/stripe-php/pull/456) Fix namespaces for some exceptions + +## 6.4.0 - 2018-02-28 + +- [#453](https://github.com/stripe/stripe-php/pull/453) Add constants for `reason` (`REASON_*`) and `status` (`STATUS_*`) on `\Stripe\Dispute` + +## 6.3.2 - 2018-02-27 + +- [#452](https://github.com/stripe/stripe-php/pull/452) Add PHPDoc for `amount_paid` and `amount_remaining` on `\Stripe\Invoice` + +## 6.3.1 - 2018-02-26 + +- [#443](https://github.com/stripe/stripe-php/pull/443) Add event types as constants to `\Stripe\Event` class + +## 6.3.0 - 2018-02-23 + +- [#450](https://github.com/stripe/stripe-php/pull/450) Add support for `code` attribute on all Stripe exceptions + +## 6.2.0 - 2018-02-21 + +- [#440](https://github.com/stripe/stripe-php/pull/440) Add support for topups +- [#442](https://github.com/stripe/stripe-php/pull/442) Fix PHPDoc for `\Stripe\Error\SignatureVerification` + +## 6.1.0 - 2018-02-12 + +- [#435](https://github.com/stripe/stripe-php/pull/435) Fix header persistence on `Collection` objects +- [#436](https://github.com/stripe/stripe-php/pull/436) Introduce new `Idempotency` error class + +## 6.0.0 - 2018-02-07 + +Major version release. List of backwards incompatible changes to watch out for: + +- The minimum PHP version is now 5.4.0. If you're using PHP 5.3 or older, consider upgrading to a more recent version. + +* `\Stripe\AttachedObject` no longer exists. Attributes that used to be instances of `\Stripe\AttachedObject` (such as `metadata`) are now instances of `\Stripe\StripeObject`. + +- Attributes that used to be PHP arrays (such as `legal_entity->additional_owners` on `\Stripe\Account` instances) are now instances of `\Stripe\StripeObject`, except when they are empty. `\Stripe\StripeObject` has array semantics so this should not be an issue unless you are actively checking types. + +* `\Stripe\Collection` now derives from `\Stripe\StripeObject` rather than from `\Stripe\ApiResource`. + +Pull requests included in this release: + +- [#410](https://github.com/stripe/stripe-php/pull/410) Drop support for PHP 5.3 +- [#411](https://github.com/stripe/stripe-php/pull/411) Use traits for common API operations +- [#414](https://github.com/stripe/stripe-php/pull/414) Use short array syntax +- [#404](https://github.com/stripe/stripe-php/pull/404) Fix serialization logic +- [#417](https://github.com/stripe/stripe-php/pull/417) Remove `ExternalAccount` class +- [#418](https://github.com/stripe/stripe-php/pull/418) Increase test coverage +- [#421](https://github.com/stripe/stripe-php/pull/421) Update CA bundle and add script for future updates +- [#422](https://github.com/stripe/stripe-php/pull/422) Use vendored CA bundle for all requests +- [#428](https://github.com/stripe/stripe-php/pull/428) Support for automatic request retries + +## 5.9.2 - 2018-02-07 + +- [#431](https://github.com/stripe/stripe-php/pull/431) Update PHPDoc @property tags for latest API version + +## 5.9.1 - 2018-02-06 + +- [#427](https://github.com/stripe/stripe-php/pull/427) Add and update PHPDoc @property tags on all API resources + +## 5.9.0 - 2018-01-17 + +- [#421](https://github.com/stripe/stripe-php/pull/421) Updated bundled CA certificates +- [#423](https://github.com/stripe/stripe-php/pull/423) Escape unsanitized input in OAuth example + +## 5.8.0 - 2017-12-20 + +- [#403](https://github.com/stripe/stripe-php/pull/403) Add `__debugInfo()` magic method to `StripeObject` + +## 5.7.0 - 2017-11-28 + +- [#390](https://github.com/stripe/stripe-php/pull/390) Remove some unsupported API methods +- [#391](https://github.com/stripe/stripe-php/pull/391) Alphabetize the list of API resources in `Util::convertToStripeObject()` and add missing resources +- [#393](https://github.com/stripe/stripe-php/pull/393) Fix expiry date update for card sources + +## 5.6.0 - 2017-10-31 + +- [#386](https://github.com/stripe/stripe-php/pull/386) Support for exchange rates APIs + +## 5.5.1 - 2017-10-30 + +- [#387](https://github.com/stripe/stripe-php/pull/387) Allow `personal_address_kana` and `personal_address_kanji` to be updated on an account + +## 5.5.0 - 2017-10-27 + +- [#385](https://github.com/stripe/stripe-php/pull/385) Support for listing source transactions + +## 5.4.0 - 2017-10-24 + +- [#383](https://github.com/stripe/stripe-php/pull/383) Add static methods to manipulate resources from parent + - `Account` gains methods for external accounts and login links (e.g. `createExternalAccount`, `createLoginLink`) + - `ApplicationFee` gains methods for refunds + - `Customer` gains methods for sources + - `Transfer` gains methods for reversals + +## 5.3.0 - 2017-10-11 + +- [#378](https://github.com/stripe/stripe-php/pull/378) Rename source `delete` to `detach` (and deprecate the former) + +## 5.2.3 - 2017-09-27 + +- Add PHPDoc for `Card` + +## 5.2.2 - 2017-09-20 + +- Fix deserialization mapping of `FileUpload` objects + +## 5.2.1 - 2017-09-14 + +- Serialized `shipping` nested attribute + +## 5.2.0 - 2017-08-29 + +- Add support for `InvalidClient` OAuth error + +## 5.1.3 - 2017-08-14 + +- Allow `address_kana` and `address_kanji` to be updated for custom accounts + +## 5.1.2 - 2017-08-01 + +- Fix documented return type of `autoPagingIterator()` (was missing namespace) + +## 5.1.1 - 2017-07-03 + +- Fix order returns to use the right URL `/v1/order_returns` + +## 5.1.0 - 2017-06-30 + +- Add support for OAuth + +## 5.0.0 - 2017-06-27 + +- `pay` on invoice now takes params as well as opts + +## 4.13.0 - 2017-06-19 + +- Add support for ephemeral keys + +## 4.12.0 - 2017-06-05 + +- Clients can implement `getUserAgentInfo()` to add additional user agent information + +## 4.11.0 - 2017-06-05 + +- Implement `Countable` for `AttachedObject` (`metadata` and `additional_owners`) + +## 4.10.0 - 2017-05-25 + +- Add support for login links + +## 4.9.1 - 2017-05-10 + +- Fix docs to include arrays on `$id` parameter for retrieve methods + +## 4.9.0 - 2017-04-28 + +- Support for checking webhook signatures + +## 4.8.1 - 2017-04-24 + +- Allow nested field `payout_schedule` to be updated + +## 4.8.0 - 2017-04-20 + +- Add `\Stripe\Stripe::setLogger()` to support an external PSR-3 compatible logger + +## 4.7.0 - 2017-04-10 + +- Add support for payouts and recipient transfers + +## 4.6.0 - 2017-04-06 + +- Please see 4.7.0 instead (no-op release) + +## 4.5.1 - 2017-03-22 + +- Remove hard dependency on cURL + +## 4.5.0 - 2017-03-20 + +- Support for detaching sources from customers + +## 4.4.2 - 2017-02-27 + +- Correct handling of `owner` parameter when updating sources + +## 4.4.1 - 2017-02-24 + +- Correct the error check on a bad JSON decoding + +## 4.4.0 - 2017-01-18 + +- Add support for updating sources + +## 4.3.0 - 2016-11-30 + +- Add support for verifying sources + +## 4.2.0 - 2016-11-21 + +- Add retrieve method for 3-D Secure resources + +## 4.1.1 - 2016-10-21 + +- Add docblock with model properties for `Plan` + +## 4.1.0 - 2016-10-18 + +- Support for 403 status codes (permission denied) + +## 4.0.1 - 2016-10-17 + +- Fix transfer reversal materialization +- Fixes for some property definitions in docblocks + +## 4.0.0 - 2016-09-28 + +- Support for subscription items +- Drop attempt to force TLS 1.2: please note that this could be breaking if you're using old OS distributions or packages and upgraded recently (so please make sure to test your integration!) + +## 3.23.0 - 2016-09-15 + +- Add support for Apple Pay domains + +## 3.22.0 - 2016-09-13 + +- Add `Stripe::setAppInfo` to allow plugins to register user agent information + +## 3.21.0 - 2016-08-25 + +- Add `Source` model for generic payment sources + +## 3.20.0 - 2016-08-08 + +- Add `getDeclineCode` to card errors + +## 3.19.0 - 2016-07-29 + +- Opt requests directly into TLS 1.2 where OpenSSL >= 1.0.1 (see #277 for context) + +## 3.18.0 - 2016-07-28 + +- Add new `STATUS_` constants for subscriptions + +## 3.17.1 - 2016-07-28 + +- Fix auto-paging iterator so that it plays nicely with `iterator_to_array` + +## 3.17.0 - 2016-07-14 + +- Add field annotations to model classes for better editor hinting + +## 3.16.0 - 2016-07-12 + +- Add `ThreeDSecure` model for 3-D secure payments + +## 3.15.0 - 2016-06-29 + +- Add static `update` method to all resources that can be changed. + +## 3.14.3 - 2016-06-20 + +- Make sure that cURL never sends `Expects: 100-continue`, even on large request bodies + +## 3.14.2 - 2016-06-03 + +- Add `inventory` under `SKU` to list of keys that have nested data and can be updated + +## 3.14.1 - 2016-05-27 + +- Fix some inconsistencies in PHPDoc + +## 3.14.0 - 2016-05-25 + +- Add support for returning Relay orders + +## 3.13.0 - 2016-05-04 + +- Add `list`, `create`, `update`, `retrieve`, and `delete` methods to the Subscription class + +## 3.12.1 - 2016-04-07 + +- Additional check on value arrays for some extra safety + +## 3.12.0 - 2016-03-31 + +- Fix bug `refreshFrom` on `StripeObject` would not take an `$opts` array +- Fix bug where `$opts` not passed to parent `save` method in `Account` +- Fix bug where non-existent variable was referenced in `reverse` in `Transfer` +- Update CA cert bundle for compatibility with OpenSSL versions below 1.0.1 + +## 3.11.0 - 2016-03-22 + +- Allow `CurlClient` to be initialized with default `CURLOPT_*` options + +## 3.10.1 - 2016-03-22 + +- Fix bug where request params and options were ignored in `ApplicationFee`'s `refund.` + +## 3.10.0 - 2016-03-15 + +- Add `reject` on `Account` to support the new API feature + +## 3.9.2 - 2016-03-04 + +- Fix error when an object's metadata is set more than once + +## 3.9.1 - 2016-02-24 + +- Fix encoding behavior of nested arrays for requests (see #227) + +## 3.9.0 - 2016-02-09 + +- Add automatic pagination mechanism with `autoPagingIterator()` +- Allow global account ID to be set with `Stripe::setAccountId()` + +## 3.8.0 - 2016-02-08 + +- Add `CountrySpec` model for looking up country payment information + +## 3.7.1 - 2016-02-01 + +- Update bundled CA certs + +## 3.7.0 - 2016-01-27 + +- Support deleting Relay products and SKUs + +## 3.6.0 - 2016-01-05 + +- Allow configuration of HTTP client timeouts + +## 3.5.0 - 2015-12-01 + +- Add a verification routine for external accounts + +## 3.4.0 - 2015-09-14 + +- Products, SKUs, and Orders -- https://stripe.com/relay + +## 3.3.0 - 2015-09-11 + +- Add support for 429 Rate Limit response + +## 3.2.0 - 2015-08-17 + +- Add refund listing and retrieval without an associated charge + +## 3.1.0 - 2015-08-03 + +- Add dispute listing and retrieval +- Add support for manage account deletion + +## 3.0.0 - 2015-07-28 + +- Rename `\Stripe\Object` to `\Stripe\StripeObject` (PHP 7 compatibility) +- Rename `getCode` and `getParam` in exceptions to `getStripeCode` and `getStripeParam` +- Add support for calling `json_encode` on Stripe objects in PHP 5.4+ +- Start supporting/testing PHP 7 + +## 2.3.0 - 2015-07-06 + +- Add request ID to all Stripe exceptions + +## 2.2.0 - 2015-06-01 + +- Add support for Alipay accounts as sources +- Add support for bank accounts as sources (private beta) +- Add support for bank accounts and cards as external_accounts on Account objects + +## 2.1.4 - 2015-05-13 + +- Fix CA certificate file path (thanks @lphilps & @matthewarkin) + +## 2.1.3 - 2015-05-12 + +- Fix to account updating to permit `tos_acceptance` and `personal_address` to be set properly +- Fix to Transfer reversal creation (thanks @neatness!) +- Network requests are now done through a swappable class for easier mocking + +## 2.1.2 - 2015-04-10 + +- Remove SSL cert revokation checking (all pre-Heartbleed certs have expired) +- Bug fixes to account updating + +## 2.1.1 - 2015-02-27 + +- Support transfer reversals + +## 2.1.0 - 2015-02-19 + +- Support new API version (2015-02-18) +- Added Bitcoin Receiever update and delete actions +- Edited tests to prefer "source" over "card" as per new API version + +## 2.0.1 - 2015-02-16 + +- Fix to fetching endpoints that use a non-default baseUrl (`FileUpload`) + +## 2.0.0 - 2015-02-14 + +- Bumped minimum version to 5.3.3 +- Switched to Stripe namespace instead of Stripe\_ class name prefiexes (thanks @chadicus!) +- Switched tests to PHPUnit (thanks @chadicus!) +- Switched style guide to PSR2 (thanks @chadicus!) +- Added \$opts hash to the end of most methods: this permits passing 'idempotency_key', 'stripe_account', or 'stripe_version'. The last 2 will persist across multiple object loads. +- Added support for retrieving Account by ID + +## 1.18.0 - 2015-01-21 + +- Support making bitcoin charges through BitcoinReceiver source object + +## 1.17.5 - 2014-12-23 + +- Adding support for creating file uploads. + +## 1.17.4 - 2014-12-15 + +- Saving objects fetched with a custom key now works (thanks @JustinHook & @jpasilan) +- Added methods for reporting charges as safe or fraudulent and for specifying the reason for refunds + +## 1.17.3 - 2014-11-06 + +- Better handling of HHVM support for SSL certificate blacklist checking. + +## 1.17.2 - 2014-09-23 + +- Coupons now are backed by a `Stripe_Coupon` instead of `Stripe_Object`, and support updating metadata +- Running operations (`create`, `retrieve`, `all`) on upcoming invoice items now works + +## 1.17.1 - 2014-07-31 + +- Requests now send Content-Type header + +## 1.17.0 - 2014-07-29 + +- Application Fee refunds now a list instead of array +- HHVM now works +- Small bug fixes (thanks @bencromwell & @fastest963) +- `__toString` now returns the name of the object in addition to its JSON representation + +## 1.16.0 - 2014-06-17 + +- Add metadata for refunds and disputes + +## 1.15.0 - 2014-05-28 + +- Support canceling transfers + +## 1.14.1 - 2014-05-21 + +- Support cards for recipients. + +## 1.13.1 - 2014-05-15 + +- Fix bug in account resource where `id` wasn't in the result + +## 1.13.0 - 2014-04-10 + +- Add support for certificate blacklisting +- Update ca bundle +- Drop support for HHVM (Temporarily) + +## 1.12.0 - 2014-04-01 + +- Add Stripe_RateLimitError for catching rate limit errors. +- Update to Zend coding style (thanks, @jpiasetz) + +## 1.11.0 - 2014-01-29 + +- Add support for multiple subscriptions per customer + +## 1.10.1 - 2013-12-02 + +- Add new ApplicationFee + +## 1.9.1 - 2013-11-08 + +- Fix a bug where a null nestable object causes warnings to fire. + +## 1.9.0 - 2013-10-16 + +- Add support for metadata API. + +## 1.8.4 - 2013-09-18 + +- Add support for closing disputes. + +## 1.8.3 - 2013-08-13 + +- Add new Balance and BalanceTransaction + +## 1.8.2 - 2013-08-12 + +- Add support for unsetting attributes by updating to NULL. Setting properties to a blank string is now an error. + +## 1.8.1 - 2013-07-12 + +- Add support for multiple cards API (Stripe API version 2013-07-12: https://stripe.com/docs/upgrades#2013-07-05) + +## 1.8.0 - 2013-04-11 + +- Allow Transfers to be creatable +- Add new Recipient resource + +## 1.7.15 - 2013-02-21 + +- Add 'id' to the list of permanent object attributes + +## 1.7.14 - 2013-02-20 + +- Don't re-encode strings that are already encoded in UTF-8. If you were previously using plan or coupon objects with UTF-8 IDs, they may have been treated as ISO-8859-1 (Latin-1) and encoded to UTF-8 a 2nd time. You may now need to pass the IDs to utf8_encode before passing them to Stripe_Plan::retrieve or Stripe_Coupon::retrieve. +- Ensure that all input is encoded in UTF-8 before submitting it to Stripe's servers. (github issue #27) + +## 1.7.13 - 2013-02-01 + +- Add support for passing options when retrieving Stripe objects e.g., Stripe_Charge::retrieve(array("id"=>"foo", "expand" => array("customer"))); Stripe_Charge::retrieve("foo") will continue to work + +## 1.7.12 - 2013-01-15 + +- Add support for setting a Stripe API version override + +## 1.7.11 - 2012-12-30 + +- Version bump to cleanup constants and such (fix issue #26) + +## 1.7.10 - 2012-11-08 + +- Add support for updating charge disputes. +- Fix bug preventing retrieval of null attributes + +## 1.7.9 - 2012-11-08 + +- Fix usage under autoloaders such as the one generated by composer (fix issue #22) + +## 1.7.8 - 2012-10-30 + +- Add support for creating invoices. +- Add support for new invoice lines return format +- Add support for new list objects + +## 1.7.7 - 2012-09-14 + +- Get all of the various version numbers in the repo in sync (no other changes) + +## 1.7.6 - 2012-08-31 + +- Add update and pay methods to Invoice resource + +## 1.7.5 - 2012-08-23 + +- Change internal function names so that Stripe_SingletonApiRequest is E_STRICT-clean (github issue #16) + +## 1.7.4 - 2012-08-21 + +- Bugfix so that Stripe objects (e.g. Customer, Charge objects) used in API calls are transparently converted to their object IDs + +## 1.7.3 - 2012-08-15 + +- Add new Account resource + +## 1.7.2 - 2012-06-26 + +- Make clearer that you should be including lib/Stripe.php, not test/Stripe.php (github issue #14) + +## 1.7.1 - 2012-05-24 + +- Add missing argument to Stripe_InvalidRequestError constructor in Stripe_ApiResource::instanceUrl. Fixes a warning when Stripe_ApiResource::instanceUrl is called on a resource with no ID (fix issue #12) + +## 1.7.0 - 2012-05-17 + +- Support Composer and Packagist (github issue #9) +- Add new deleteDiscount method to Stripe_Customer +- Add new Transfer resource +- Switch from using HTTP Basic auth to Bearer auth. (Note: Stripe will support Basic auth for the indefinite future, but recommends Bearer auth when possible going forward) +- Numerous test suite improvements diff --git a/vendor/stripe/stripe-php/CODE_OF_CONDUCT.md b/vendor/stripe/stripe-php/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..349f5a0 --- /dev/null +++ b/vendor/stripe/stripe-php/CODE_OF_CONDUCT.md @@ -0,0 +1,77 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to make participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies within all project spaces, and it also applies when +an individual is representing the project or its community in public spaces. +Examples of representing a project or community include using an official +project e-mail address, posting via an official social media account, or acting +as an appointed representative at an online or offline event. Representation of +a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at conduct@stripe.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq + diff --git a/vendor/stripe/stripe-php/LICENSE b/vendor/stripe/stripe-php/LICENSE new file mode 100644 index 0000000..847c705 --- /dev/null +++ b/vendor/stripe/stripe-php/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2010-2019 Stripe, Inc. (https://stripe.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/stripe/stripe-php/Makefile b/vendor/stripe/stripe-php/Makefile new file mode 100644 index 0000000..61b6de5 --- /dev/null +++ b/vendor/stripe/stripe-php/Makefile @@ -0,0 +1,36 @@ +export PHPDOCUMENTOR_VERSION := v3.0.0 +export PHPSTAN_VERSION := 0.12.59 + +vendor: composer.json + composer install + +vendor/bin/phpstan: vendor + curl -sfL https://github.com/phpstan/phpstan/releases/download/$(PHPSTAN_VERSION)/phpstan.phar -o vendor/bin/phpstan + chmod +x vendor/bin/phpstan + +vendor/bin/phpdoc: vendor + curl -sfL https://github.com/phpDocumentor/phpDocumentor/releases/download/$(PHPDOCUMENTOR_VERSION)/phpDocumentor.phar -o vendor/bin/phpdoc + chmod +x vendor/bin/phpdoc + +test: vendor + vendor/bin/phpunit +.PHONY: test + +fmt: vendor + vendor/bin/php-cs-fixer fix -v --using-cache=no . +.PHONY: fmt + +fmtcheck: vendor + vendor/bin/php-cs-fixer fix -v --dry-run --using-cache=no . +.PHONY: fmtcheck + +phpdoc: vendor/bin/phpdoc + vendor/bin/phpdoc + +phpstan: vendor/bin/phpstan + php -d memory_limit=512M vendor/bin/phpstan analyse lib tests +.PHONY: phpstan + +phpstan-baseline: vendor/bin/phpstan + php -d memory_limit=512M vendor/bin/phpstan analyse lib tests --generate-baseline +.PHONY: phpstan-baseline diff --git a/vendor/stripe/stripe-php/README.md b/vendor/stripe/stripe-php/README.md new file mode 100644 index 0000000..a3558e9 --- /dev/null +++ b/vendor/stripe/stripe-php/README.md @@ -0,0 +1,269 @@ +# Stripe PHP bindings + +[![Build Status](https://travis-ci.org/stripe/stripe-php.svg?branch=master)](https://travis-ci.org/stripe/stripe-php) +[![Latest Stable Version](https://poser.pugx.org/stripe/stripe-php/v/stable.svg)](https://packagist.org/packages/stripe/stripe-php) +[![Total Downloads](https://poser.pugx.org/stripe/stripe-php/downloads.svg)](https://packagist.org/packages/stripe/stripe-php) +[![License](https://poser.pugx.org/stripe/stripe-php/license.svg)](https://packagist.org/packages/stripe/stripe-php) +[![Code Coverage](https://coveralls.io/repos/stripe/stripe-php/badge.svg?branch=master)](https://coveralls.io/r/stripe/stripe-php?branch=master) + +The Stripe PHP library provides convenient access to the Stripe API from +applications written in the PHP language. It includes a pre-defined set of +classes for API resources that initialize themselves dynamically from API +responses which makes it compatible with a wide range of versions of the Stripe +API. + +## Requirements + +PHP 5.6.0 and later. + +## Composer + +You can install the bindings via [Composer](http://getcomposer.org/). Run the following command: + +```bash +composer require stripe/stripe-php +``` + +To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading): + +```php +require_once('vendor/autoload.php'); +``` + +## Manual Installation + +If you do not wish to use Composer, you can download the [latest release](https://github.com/stripe/stripe-php/releases). Then, to use the bindings, include the `init.php` file. + +```php +require_once('/path/to/stripe-php/init.php'); +``` + +## Dependencies + +The bindings require the following extensions in order to work properly: + +- [`curl`](https://secure.php.net/manual/en/book.curl.php), although you can use your own non-cURL client if you prefer +- [`json`](https://secure.php.net/manual/en/book.json.php) +- [`mbstring`](https://secure.php.net/manual/en/book.mbstring.php) (Multibyte String) + +If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available. + +## Getting Started + +Simple usage looks like: + +```php +$stripe = new \Stripe\StripeClient('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); +$customer = $stripe->customers->create([ + 'description' => 'example customer', + 'email' => 'email@example.com', + 'payment_method' => 'pm_card_visa', +]); +echo $customer; +``` + +### Client/service patterns vs legacy patterns + +You can continue to use the legacy integration patterns used prior to version [7.33.0](https://github.com/stripe/stripe-php/blob/master/CHANGELOG.md#7330---2020-05-14). Review the [migration guide](https://github.com/stripe/stripe-php/wiki/Migration-to-StripeClient-and-services-in-7.33.0) for the backwards-compatible client/services pattern changes. + +## Documentation + +See the [PHP API docs](https://stripe.com/docs/api/php#intro). + +See [video demonstrations][youtube-playlist] covering how to use the library. + +## Legacy Version Support + +### PHP 5.4 & 5.5 + +If you are using PHP 5.4 or 5.5, you can download v6.21.1 ([zip](https://github.com/stripe/stripe-php/archive/v6.21.1.zip), [tar.gz](https://github.com/stripe/stripe-php/archive/v6.21.1.tar.gz)) from our [releases page](https://github.com/stripe/stripe-php/releases). This version will continue to work with new versions of the Stripe API for all common uses. + +### PHP 5.3 + +If you are using PHP 5.3, you can download v5.9.2 ([zip](https://github.com/stripe/stripe-php/archive/v5.9.2.zip), [tar.gz](https://github.com/stripe/stripe-php/archive/v5.9.2.tar.gz)) from our [releases page](https://github.com/stripe/stripe-php/releases). This version will continue to work with new versions of the Stripe API for all common uses. + +## Custom Request Timeouts + +_NOTE:_ We do not recommend decreasing the timeout for non-read-only calls (e.g. charge creation), since even if you locally timeout, the request on Stripe's side can still complete. If you are decreasing timeouts on these calls, make sure to use [idempotency tokens](https://stripe.com/docs/api/php#idempotent_requests) to avoid executing the same transaction twice as a result of timeout retry logic. + +To modify request timeouts (connect or total, in seconds) you'll need to tell the API client to use a CurlClient other than its default. You'll set the timeouts in that CurlClient. + +```php +// set up your tweaked Curl client +$curl = new \Stripe\HttpClient\CurlClient(); +$curl->setTimeout(10); // default is \Stripe\HttpClient\CurlClient::DEFAULT_TIMEOUT +$curl->setConnectTimeout(5); // default is \Stripe\HttpClient\CurlClient::DEFAULT_CONNECT_TIMEOUT + +echo $curl->getTimeout(); // 10 +echo $curl->getConnectTimeout(); // 5 + +// tell Stripe to use the tweaked client +\Stripe\ApiRequestor::setHttpClient($curl); + +// use the Stripe API client as you normally would +``` + +## Custom cURL Options (e.g. proxies) + +Need to set a proxy for your requests? Pass in the requisite `CURLOPT_*` array to the CurlClient constructor, using the same syntax as `curl_stopt_array()`. This will set the default cURL options for each HTTP request made by the SDK, though many more common options (e.g. timeouts; see above on how to set those) will be overridden by the client even if set here. + +```php +// set up your tweaked Curl client +$curl = new \Stripe\HttpClient\CurlClient([CURLOPT_PROXY => 'proxy.local:80']); +// tell Stripe to use the tweaked client +\Stripe\ApiRequestor::setHttpClient($curl); +``` + +Alternately, a callable can be passed to the CurlClient constructor that returns the above array based on request inputs. See `testDefaultOptions()` in `tests/CurlClientTest.php` for an example of this behavior. Note that the callable is called at the beginning of every API request, before the request is sent. + +### Configuring a Logger + +The library does minimal logging, but it can be configured +with a [`PSR-3` compatible logger][psr3] so that messages +end up there instead of `error_log`: + +```php +\Stripe\Stripe::setLogger($logger); +``` + +### Accessing response data + +You can access the data from the last API response on any object via `getLastResponse()`. + +```php +$customer = $stripe->customers->create([ + 'description' => 'example customer', +]); +echo $customer->getLastResponse()->headers['Request-Id']; +``` + +### SSL / TLS compatibility issues + +Stripe's API now requires that [all connections use TLS 1.2](https://stripe.com/blog/upgrading-tls). Some systems (most notably some older CentOS and RHEL versions) are capable of using TLS 1.2 but will use TLS 1.0 or 1.1 by default. In this case, you'd get an `invalid_request_error` with the following error message: "Stripe no longer supports API requests made with TLS 1.0. Please initiate HTTPS connections with TLS 1.2 or later. You can learn more about this at [https://stripe.com/blog/upgrading-tls](https://stripe.com/blog/upgrading-tls).". + +The recommended course of action is to [upgrade your cURL and OpenSSL packages](https://support.stripe.com/questions/how-do-i-upgrade-my-stripe-integration-from-tls-1-0-to-tls-1-2#php) so that TLS 1.2 is used by default, but if that is not possible, you might be able to solve the issue by setting the `CURLOPT_SSLVERSION` option to either `CURL_SSLVERSION_TLSv1` or `CURL_SSLVERSION_TLSv1_2`: + +```php +$curl = new \Stripe\HttpClient\CurlClient([CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1]); +\Stripe\ApiRequestor::setHttpClient($curl); +``` + +### Per-request Configuration + +For apps that need to use multiple keys during the lifetime of a process, like +one that uses [Stripe Connect][connect], it's also possible to set a +per-request key and/or account: + +```php +$customers = $stripe->customers->all([],[ + 'api_key' => 'sk_test_...', + 'stripe_account' => 'acct_...' +]); + +$stripe->customers->retrieve('cus_123456789', [], [ + 'api_key' => 'sk_test_...', + 'stripe_account' => 'acct_...' +]); +``` + +### Configuring CA Bundles + +By default, the library will use its own internal bundle of known CA +certificates, but it's possible to configure your own: + +```php +\Stripe\Stripe::setCABundlePath("path/to/ca/bundle"); +``` + +### Configuring Automatic Retries + +The library can be configured to automatically retry requests that fail due to +an intermittent network problem: + +```php +\Stripe\Stripe::setMaxNetworkRetries(2); +``` + +[Idempotency keys][idempotency-keys] are added to requests to guarantee that +retries are safe. + +### Request latency telemetry + +By default, the library sends request latency telemetry to Stripe. These +numbers help Stripe improve the overall latency of its API for all users. + +You can disable this behavior if you prefer: + +```php +\Stripe\Stripe::setEnableTelemetry(false); +``` + +## Development + +Get [Composer][composer]. For example, on Mac OS: + +```bash +brew install composer +``` + +Install dependencies: + +```bash +composer install +``` + +The test suite depends on [stripe-mock], so make sure to fetch and run it from a +background terminal ([stripe-mock's README][stripe-mock] also contains +instructions for installing via Homebrew and other methods): + +```bash +go get -u github.com/stripe/stripe-mock +stripe-mock +``` + +Install dependencies as mentioned above (which will resolve [PHPUnit](http://packagist.org/packages/phpunit/phpunit)), then you can run the test suite: + +```bash +./vendor/bin/phpunit +``` + +Or to run an individual test file: + +```bash +./vendor/bin/phpunit tests/Stripe/UtilTest.php +``` + +Update bundled CA certificates from the [Mozilla cURL release][curl]: + +```bash +./update_certs.php +``` + +The library uses [PHP CS Fixer][php-cs-fixer] for code formatting. Code must be formatted before PRs are submitted, otherwise CI will fail. Run the formatter with: + +```bash +./vendor/bin/php-cs-fixer fix -v . +``` + +## Attention plugin developers + +Are you writing a plugin that integrates Stripe and embeds our library? Then please use the `setAppInfo` function to identify your plugin. For example: + +```php +\Stripe\Stripe::setAppInfo("MyAwesomePlugin", "1.2.34", "https://myawesomeplugin.info"); +``` + +The method should be called once, before any request is sent to the API. The second and third parameters are optional. + +### SSL / TLS configuration option + +See the "SSL / TLS compatibility issues" paragraph above for full context. If you want to ensure that your plugin can be used on all systems, you should add a configuration option to let your users choose between different values for `CURLOPT_SSLVERSION`: none (default), `CURL_SSLVERSION_TLSv1` and `CURL_SSLVERSION_TLSv1_2`. + +[composer]: https://getcomposer.org/ +[connect]: https://stripe.com/connect +[curl]: http://curl.haxx.se/docs/caextract.html +[idempotency-keys]: https://stripe.com/docs/api/php#idempotent_requests +[php-cs-fixer]: https://github.com/FriendsOfPHP/PHP-CS-Fixer +[psr3]: http://www.php-fig.org/psr/psr-3/ +[stripe-mock]: https://github.com/stripe/stripe-mock +[youtube-playlist]: https://www.youtube.com/playlist?list=PLy1nL-pvL2M6cUbiHrfMkXxZ9j9SGBxFE diff --git a/vendor/stripe/stripe-php/VERSION b/vendor/stripe/stripe-php/VERSION new file mode 100644 index 0000000..4ed8101 --- /dev/null +++ b/vendor/stripe/stripe-php/VERSION @@ -0,0 +1 @@ +7.87.0 diff --git a/vendor/stripe/stripe-php/build.php b/vendor/stripe/stripe-php/build.php new file mode 100644 index 0000000..37360ff --- /dev/null +++ b/vendor/stripe/stripe-php/build.php @@ -0,0 +1,25 @@ +#!/usr/bin/env php +=5.6.0", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*" + }, + "require-dev": { + "phpunit/phpunit": "^5.7", + "php-coveralls/php-coveralls": "^2.1", + "squizlabs/php_codesniffer": "^3.3", + "symfony/process": "~3.4", + "friendsofphp/php-cs-fixer": "2.17.1" + }, + "autoload": { + "psr-4": { + "Stripe\\": "lib/" + } + }, + "autoload-dev": { + "psr-4": { + "Stripe\\": [ + "tests/", + "tests/Stripe/" + ] + } + }, + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + } +} diff --git a/vendor/stripe/stripe-php/data/ca-certificates.crt b/vendor/stripe/stripe-php/data/ca-certificates.crt new file mode 100644 index 0000000..65be218 --- /dev/null +++ b/vendor/stripe/stripe-php/data/ca-certificates.crt @@ -0,0 +1,3476 @@ +## +## Bundle of CA Root Certificates +## +## Certificate data from Mozilla as of: Wed Aug 28 03:12:10 2019 GMT +## +## This is a bundle of X.509 certificates of public Certificate Authorities +## (CA). These were automatically extracted from Mozilla's root certificates +## file (certdata.txt). This file can be found in the mozilla source tree: +## https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt +## +## It contains the certificates in PEM format and therefore +## can be directly used with curl / libcurl / php_curl, or with +## an Apache+mod_ssl webserver for SSL client authentication. +## Just configure this file as the SSLCACertificateFile. +## +## Conversion done with mk-ca-bundle.pl version 1.27. +## SHA256: fffa309937c3be940649293f749b8207fabc6eb224e50e4bb3f2c5e44e0d6a6b +## + + +GlobalSign Root CA +================== +-----BEGIN CERTIFICATE----- +MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx +GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds +b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV +BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD +VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa +DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc +THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb +Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP +c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX +gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF +AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj +Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG +j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH +hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC +X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== +-----END CERTIFICATE----- + +GlobalSign Root CA - R2 +======================= +-----BEGIN CERTIFICATE----- +MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMXR2xv +YmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh +bFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1MD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slQIxq/H5COEBkEveegeGTLg== +-----END CERTIFICATE----- + +Verisign Class 3 Public Primary Certification Authority - G3 +============================================================ +-----BEGIN CERTIFICATE----- +MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV +UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv +cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl +IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy +dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1 +EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc +cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw +EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj +055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA +ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f +j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC +/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0 +xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa +t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== +-----END CERTIFICATE----- + +Entrust.net Premium 2048 Secure Server CA +========================================= +-----BEGIN CERTIFICATE----- +MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u +ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp +bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV +BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx +NzUwNTFaFw0yOTA3MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3 +d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl +MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u +ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL +Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr +hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW +nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi +VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo0IwQDAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJ +KoZIhvcNAQEFBQADggEBADubj1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPy +T/4xmf3IDExoU8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf +zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5bu/8j72gZyxKT +J1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+bYQLCIt+jerXmCHG8+c8eS9e +nNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/ErfF6adulZkMV8gzURZVE= +-----END CERTIFICATE----- + +Baltimore CyberTrust Root +========================= +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE +ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQ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ICATE----- + +AddTrust External Root +====================== +-----BEGIN CERTIFICATE----- +MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYD +VQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEw +NDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRU +cnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0Eg +Um9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvtH7xsD821 ++iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9uMq/NzgtHj6RQa1wVsfw +Tz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzXmk6vBbOmcZSccbNQYArHE504B4YCqOmo +aSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy +2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv7 +7+ldU9U0WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0P +BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6xCZU7wO94CTL +VBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRk +VHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENB +IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZl +j7DYd7usQWxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 +6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355 +e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u +G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= +-----END CERTIFICATE----- + +Entrust Root Certification Authority +==================================== +-----BEGIN CERTIFICATE----- +MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAUBgNV +BAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0Lm5ldC9DUFMgaXMgaW5jb3Jw +b3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMWKGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsG +A1UEAxMkRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0 +MloXDTI2MTEyNzIwNTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMu +MTkwNwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSByZWZlcmVu +Y2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNVBAMTJEVudHJ1c3QgUm9v +dCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJ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p06drE57xNNB6p +XE0zX5IJL4hmXXeXxx12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvm +Mw== +-----END CERTIFICATE----- + +GeoTrust Universal CA +===================== +-----BEGIN CERTIFICATE----- +MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN +R2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVyc2FsIENBMB4XDTA0MDMwNDA1 +MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IElu +Yy4xHjAcBgNVBAMTFUdlb1RydXN0IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAKYVVaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9t +JPi8cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTTQjOgNB0e +RXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFhF7em6fgemdtzbvQKoiFs +7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2vc7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d +8Lsrlh/eezJS/R27tQahsiFepdaVaH/wmZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7V +qnJNk22CDtucvc+081xdVHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3Cga +Rr0BHdCXteGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZf9hB +Z3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfReBi9Fi1jUIxaS5BZu +KGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+nhutxx9z3SxPGWX9f5NAEC7S8O08 +ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0 +XG0D08DYj3rWMB8GA1UdIwQYMBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIB +hjANBgkqhkiG9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc +aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fXIwjhmF7DWgh2 +qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzynANXH/KttgCJwpQzgXQQpAvvL +oJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0zuzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsK +xr2EoyNB3tZ3b4XUhRxQ4K5RirqNPnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxF +KyDuSN/n3QmOGKjaQI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2 +DFKWkoRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9ER/frslK +xfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQtDF4JbAiXfKM9fJP/P6EU +p8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/SfuvmbJxPgWp6ZKy7PtXny3YuxadIwVyQD8vI +P/rmMuGNG2+k5o7Y+SlIis5z/iw= +-----END CERTIFICATE----- + +GeoTrust Universal CA 2 +======================= +-----BEGIN CERTIFICATE----- +MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEWMBQGA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+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8E +BAMCAYYwDQYJKoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z +dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQL1EuxBRa3ugZ +4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgrFg5fNuH8KrUwJM/gYwx7WBr+ +mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSoag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpq +A1Ihn0CoZ1Dy81of398j9tx4TuaYT1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpg +Y+RdM4kX2TGq2tbzGDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiP +pm8m1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJVOCiNUW7d +FGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH6aLcr34YEoP9VhdBLtUp +gn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwXQMAJKOSLakhT2+zNVVXxxvjpoixMptEm +X36vWkzaH6byHCx+rgIW0lbQL1dTR+iS +-----END CERTIFICATE----- + +Comodo AAA Services root +======================== +-----BEGIN CERTIFICATE----- +MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS +R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg +TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw +MFoXDTI4MTIzMTIzNTk1OV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xp7Z +8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsil2D4kF501KKaU73yqWjgom7C +12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== +-----END CERTIFICATE----- + +QuoVadis Root CA +================ +-----BEGIN CERTIFICATE----- +MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJCTTEZMBcGA1UE +ChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 +eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAz +MTkxODMzMzNaFw0yMTAzMTcxODMzMzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRp +cyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQD +EyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Ypli4kVEAkOPcahdxYTMuk +J0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2DrOpm2RgbaIr1VxqYuvXtdj182d6UajtL +F8HVj71lODqV0D1VNk7feVcxKh7YWWVJWCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeL +YzcS19Dsw3sgQUSj7cugF+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWen +AScOospUxbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCCAk4w +PQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUF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sfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi +5nrQNiOKSnQ2+Q== +-----END CERTIFICATE----- + +QuoVadis Root CA 2 +================== +-----BEGIN CERTIFICATE----- +MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT +EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMjAeFw0wNjExMjQx +ODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM +aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4IC +DwAwggIKAoICAQCaGMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6 +XJxgFyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55JWpzmM+Yk +lvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bBrrcCaoF6qUWD4gXmuVbB +lDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp+ARz8un+XJiM9XOva7R+zdRcAitMOeGy +lZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt +66/3FsvbzSUr5R/7mp/iUcw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1Jdxn +wQ5hYIizPtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og/zOh +D7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UHoycR7hYQe7xFSkyy +BNKr79X9DFHOUGoIMfmR2gyPZFwDwz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IdiP4b0jWy10QJLZYxkNc91p +vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr +qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto= +-----END CERTIFICATE----- + +Security Communication Root CA +============================== +-----BEGIN CERTIFICATE----- +MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP +U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw +HhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP +U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw +8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJDKaVv0uM +DPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9Ms+k2Y7CI9eNqPPYJayX +5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/NQV3Is00qVUarH9oe4kA92819uZKAnDfd +DJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2 +JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYw +DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g +0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+a +mCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJ +s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ +6rBK+1YWc26sTfcioU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAi +FL39vmwLAw== +-----END CERTIFICATE----- + +Sonera Class 2 Root CA +====================== +-----BEGIN CERTIFICATE----- +MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG +U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoXDTIxMDQw +NjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh +IENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3 +/Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybT +dXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s3TmVToMG +f+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2EjvOr7nQKV0ba5cTppCD8P +tOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu8nYybieDwnPz3BjotJPqdURrBGAgcVeH +nfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITT +XjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt +0jSv9zilzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEI +cbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavph +Oe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSx +EtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLH +llpwrN9M +-----END CERTIFICATE----- + +XRamp Global CA Root +==================== +-----BEGIN CERTIFICATE----- +MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UE +BhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2Vj +dXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwHhcNMDQxMTAxMTcxNDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMx +HjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkg +U2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3Jp +dHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS638eMpSe2OAtp87ZOqCwu +IR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCPKZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMx +foArtYzAQDsRhtDLooY2YKTVMIJ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zZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI +Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b +vZ8= +-----END CERTIFICATE----- + +Starfield Class 2 CA +==================== +-----BEGIN CERTIFICATE----- +MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc +U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBo +MQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAG +A1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqG +SIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf8MOh2tTY +bitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN+lq2cwQlZut3f+dZxkqZ +JRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVm +epsZGD3/cVE8MC5fvj13c7JdBmzDI1aaK4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSN +F4Azbl5KXZnJHoe0nRrA1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HF +MIHCMB0GA1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fRzt0f +hvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNo +bm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBDbGFzcyAyIENlcnRpZmljYXRpb24g +QXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGs +afPzWdqbAYcaT1epoXkJKtv3L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLM +PUxA2IGvd56Deruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl +xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJD +KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3 +QBFGmh95DmK/D5fs4C8fF5Q= +-----END CERTIFICATE----- + +Taiwan GRCA +=========== +-----BEGIN CERTIFICATE----- +MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQG +EwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4X +DTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1owPzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dv +dmVybm1lbnQgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBAJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qN +w8XRIePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1qgQdW8or5 +BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKyyhwOeYHWtXBiCAEuTk8O +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CCDTb+Hbk +Z6MmnD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WXudpVBrkk +7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44VbnzssQwmSNOXfJIoRIM3BKQ +CZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDeLMDDav7v3Aun+kbfYNucpllQdSNpc5Oy ++fwC00fmcc4QAu4njIT/rEUNE1yDMuAlpYYsfPQS +-----END CERTIFICATE----- + +DigiCert Assured ID Root CA +=========================== +-----BEGIN CERTIFICATE----- +MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw +IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzEx +MTEwMDAwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL +ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0Ew +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7cJpSIqvTO +9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYPmDI2dsze3Tyoou9q+yHy +UmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW +/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpy +oeb6pNnVFzF1roV9Iq4/AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whf +GHdPAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRF +66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq +hkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRCdWKuh+vy1dneVrOfzM4UKLkNl2Bc +EkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTffwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38Fn +SbNd67IJKusm7Xi+fT8r87cmNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i +8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe ++o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== +-----END CERTIFICATE----- + +DigiCert Global Root CA +======================= +-----BEGIN CERTIFICATE----- +MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw +HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw +MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 +dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn +TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5 +BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H +4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y +7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB +o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm +8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF +BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr +EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt +tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886 +UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk +CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= +-----END CERTIFICATE----- + +DigiCert High Assurance EV Root CA +================================== +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw +KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3V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HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K +-----END CERTIFICATE----- + +Certplus Class 2 Primary CA +=========================== +-----BEGIN CERTIFICATE----- +MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAwPTELMAkGA1UE +BhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFzcyAyIFByaW1hcnkgQ0EwHhcN +OTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2Vy +dHBsdXMxGzAZBgNVBAMTEkNsYXNzIDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBANxQltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR +5aiRVhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyLkcAbmXuZ +Vg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCdEgETjdyAYveVqUSISnFO +YFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yasH7WLO7dDWWuwJKZtkIvEcupdM5i3y95e +e++U8Rs+yskhwcWYAqqi9lt3m/V+llU0HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRME +CDAGAQH/AgEKMAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJ +YIZIAYb4QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMuY29t +L0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/AN9WM2K191EBkOvD +P9GIROkkXe/nFL0gt5o8AP5tn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YwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQ +MA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikug +dB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjE +GB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bw +RLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubS +fZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ +-----END CERTIFICATE----- + +SwissSign Gold CA - G2 +====================== +-----BEGIN CERTIFICATE----- +MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAkNIMRUw +EwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2lnbiBHb2xkIENBIC0gRzIwHhcN +MDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBFMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dp +c3NTaWduIEFHMR8wHQYDVQQDExZTd2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUq +t2/876LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+bbqBHH5C +jCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c6bM8K8vzARO/Ws/BtQpg +vd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqEemA8atufK+ze3gE/bk3l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z/EbMFYOkrCChdiDyyJk +vC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid392qgQmwLOM7XdVAyksLf +KzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEppLd6leNcG2mqeSz53OiATIgHQv2ieY2Br +NU0LbbqhPcCT4H8js1WtciVORvnSFu+wZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6Lqj +viOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ +-----END CERTIFICATE----- + +SwissSign Silver CA - G2 +======================== +-----BEGIN CERTIFICATE----- +MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gxFTAT +BgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMB4X +DTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0NlowRzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3 +aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG +9w0BAQEFAAOCAg8AMIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644 +N0MvFz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7brYT7QbNHm ++/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieFnbAVlDLaYQ1HTWBCrpJH +6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH6ATK72oxh9TAtvmUcXtnZLi2kUpCe2Uu +MGoM9ZDulebyzYLs2aFK7PayS+VFheZteJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5h +qAaEuSh6XzjZG6k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zFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJ +DIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ub +DgEj8Z+7fNzcbBGXJbLytGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u +-----END CERTIFICATE----- + +GeoTrust Primary Certification Authority +======================================== +-----BEGIN CERTIFICATE----- +MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQG +EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMoR2VvVHJ1c3QgUHJpbWFyeSBD +ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgx +CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQ +cmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9AWbK7hWN +b6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjAZIVcFU2Ix7e64HXprQU9 +nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE07e9GceBrAqg1cmuXm2bgyxx5X9gaBGge +RwLmnWDiNpcB3841kt++Z8dtd1k7j53WkBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGt +tm/81w7a4DSwDRp35+MImO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD +AQH/MA4GA1UdDwEB/wQEAwIB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SqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCs +oPD7gFnUnMekz52hWXMJEEUMDSxuaPFsW0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ +1CRfBsDMRJSUjQJib+ta3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGc +q/gcfomk6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6Sk/K +aAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94JNqR32HuHUETVPm4p +afs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYD +VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XPr87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUF +AAOCAQEAeRHAS7ORtvzw6WfUDW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeE +uzLlQRHAd9mzYJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX +xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2/qxAeeWsEG89 +jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/LHbTY5xZ3Y+m4Q6gLkH3LpVH +z7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7jVaMaA== +-----END CERTIFICATE----- + +VeriSign Class 3 Public Primary Certification Authority - G5 +============================================================ +-----BEGIN CERTIFICATE----- +MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE +BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCB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YXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwg +Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jx +YDiJiQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa/FHtaMbQ +bqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJjnIFHovdRIWCQtBJwB1g +8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnIHmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYV +HDGA76oYa8J719rO+TMg1fW9ajMtgQT7sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi +0XPnj3pDAgMBAAGjgZ0wgZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud +EwEB/wQFMAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCswKaAn +oCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsGAQQBgjcVAQQDAgEA +MA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0LURYD7xh8yOOvaliTFGCRsoTciE6+ +OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXOH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cn +CDpOGR86p1hcF895P4vkp9MmI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/5 +3CYNv6ZHdAbYiNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc +f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW +-----END CERTIFICATE----- + +COMODO Certification Authority +============================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XV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOC +AQEAPpiem/Yb6dc5t3iuHXIYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CP +OGEIqB6BCsAvIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ +RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmc +IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN ++8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ== +-----END CERTIFICATE----- + +Network Solutions Certificate Authority +======================================= +-----BEGIN CERTIFICATE----- +MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG +EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr +IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMx +MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu +MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwzc7MEL7xx +jOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPPOCwGJgl6cvf6UDL4wpPT +aaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rlmGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXT +crA/vGp97Eh/jcOrqnErU2lBUzS1sLnFBgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc +/Qzpf14Dl847ABSHJ3A4qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMB +AAGjgZcwgZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIBBjAP +BgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwubmV0c29sc3NsLmNv +bS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3JpdHkuY3JsMA0GCSqGSIb3DQEBBQUA +A4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc86fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q +4LqILPxFzBiwmZVRDuwduIj/h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/ +GGUsyfJj4akH/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv +wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD +ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey +-----END CERTIFICATE----- + +COMODO ECC Certification Authority +================================== +-----BEGIN CERTIFICATE----- +MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UEBhMC +R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE +ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0Ix +GzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR +Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRo +b3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSRFtSrYpn1PlILBs5BAH+X +4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0JcfRK9ChQtP6IHG4/bC8vCVlbpVsLM5ni +wz2J+Wos77LTBumjQjBAMB0GA1UdDgQWBBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VG +FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA +U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= +-----END CERTIFICATE----- + +OISTE WISeKey Global Root GA CA +=============================== +-----BEGIN CERTIFICATE----- +MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UE +BhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHlyaWdodCAoYykgMjAwNTEiMCAG +A1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBH +bG9iYWwgUm9vdCBHQSBDQTAeFw0wNTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYD +VQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIw +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EQCYsuuHWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY +1gkIl2PlwS6wt0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw +WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== +-----END CERTIFICATE----- + +Deutsche Telekom Root CA 2 +========================== +-----BEGIN CERTIFICATE----- +MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMT +RGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEG +A1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENBIDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5 +MjM1OTAwWjBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0G +A1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBS +b290IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEUha88EOQ5 +bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhCQN/Po7qCWWqSG6wcmtoI +KyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1MjwrrFDa1sPeg5TKqAyZMg4ISFZbavva4VhY +AUlfckE8FQYBjl2tqriTtM2e66foai1SNNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aK +Se5TBY8ZTNXeWHmb0mocQqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTV +jlsB9WoHtxa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAPBgNV +HRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAlGRZrTlk5ynr +E/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756AbrsptJh6sTtU6zkXR34ajgv8HzFZMQSy +zhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpaIzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8 +rZ7/gFnkm0W09juwzTkZmDLl6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4G +dyd1Lx+4ivn+xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU +Cm26OWMohpLzGITY+9HPBVZkVw== +-----END CERTIFICATE----- + +Cybertrust Global Root +====================== +-----BEGIN CERTIFICATE----- +MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYGA1UEChMPQ3li +ZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBSb290MB4XDTA2MTIxNTA4 +MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQD +ExZDeWJlcnRydXN0IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA ++Mi8vRRQZhP/8NN57CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW +0ozSJ8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2yHLtgwEZL +AfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iPt3sMpTjr3kfb1V05/Iin +89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNzFtApD0mpSPCzqrdsxacwOUBdrsTiXSZT +8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAYXSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAP +BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2 +MDSgMqAwhi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3JsMB8G +A1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUAA4IBAQBW7wojoFRO +lZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMjWqd8BfP9IjsO0QbE2zZMcwSO5bAi +5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUxXOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2 +hO0j9n0Hq0V+09+zv+mKts2oomcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+T +X3EJIrduPuocA06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW +WL1WMRJOEcgh4LMRkWXbtKaIOM5V +-----END CERTIFICATE----- + +ePKI Root Certification Authority +================================= +-----BEGIN CERTIFICATE----- +MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG +EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg +Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx +MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq +MCgGA1UECwwhZVBLSSBSb290IENlc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W1P2WT+DZdjo2NQCCHGervJ8A9tDkPJXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdV +xrsStZf0X4OFunHB2WyBEXYKCrC/gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEP +NXubrjlpC2JgQCA2j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+r +GNm65ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUBo2M3IUxE +xJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS/jQ6fbjpKdx2qcgw+BRx +gMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2zGp1iro2C6pSe3VkQw63d4k3jMdXH7Ojy +sP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmOD +BCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4EZw= +-----END CERTIFICATE----- + +certSIGN ROOT CA +================ +-----BEGIN CERTIFICATE----- +MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYTAlJPMREwDwYD +VQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTAeFw0wNjA3MDQxNzIwMDRa +Fw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UE +CxMQY2VydFNJR04gUk9PVCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7I +JUqOtdu0KBuqV5Do0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHH +rfAQUySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5dRdY4zTW2 +ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQOA7+j0xbm0bqQfWwCHTD +0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwvJoIQ4uNllAoEwF73XVv4EOLQunpL+943 +AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8B +Af8EBAMCAcYwHQYDVR0OBBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IB +AQA+0hyJLjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecYMnQ8 +SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ44gx+FkagQnIl6Z0 +x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6IJd1hJyMctTEHBDa0GpC9oHRxUIlt +vBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7Nz +TogVZ96edhBiIL5VaZVDADlN9u6wWk5JRFRYX0KD +-----END CERTIFICATE----- + +GeoTrust Primary Certification Authority - G3 +============================================= +-----BEGIN CERTIFICATE----- +MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UE +BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA4IEdlb1RydXN0 +IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFy +eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIz +NTk1OVowgZgxCzAJB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A - G2 +=========================== +-----BEGIN CERTIFICATE----- +MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDELMAkGA1UEBhMC +VVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMpIDIwMDcgdGhhd3RlLCBJbmMu +IC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3Qg +Q0EgLSBHMjAeFw0wNzExMDUwMDAwMDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEV +MBMGA1UEChMMdGhhd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBG +b3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAt +IEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/BebfowJPDQfGAFG6DAJS +LSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6papu+7qzcMBniKI11KOasf2twu8x+qi5 +8/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU +mtgAMADna3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUN +G4k8VIZ3KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41oxXZ3K +rr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg== +-----END CERTIFICATE----- + +thawte Primary Root CA - G3 +=========================== +-----BEGIN CERTIFICATE----- +MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCBrjELMAkGA1UE +BhMCVVMxFTATBgNVBA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HqKweK +A3rD6z8KLFIWoCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu +t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7cKUGRIjxpp7sC +8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fMm7v/OeZWYdMKp8RcTGB7BXcm +er/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZuMdRAGmI0Nj81Aa6sY6A= +-----END CERTIFICATE----- + +GeoTrust Primary Certification Authority - G2 +============================================= +-----BEGIN CERTIFICATE----- +MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDELMAkGA1UEBhMC +VVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA3IEdlb1RydXN0IElu +Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBD +ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1 +OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg +MjAwNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMTLUdl +b1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjB2MBAGByqGSM49AgEG +BSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcLSo17VDs6bl8VAsBQps8lL33KSLjHUGMc +KiEIfJo22Av+0SbFWDEwKCXzXV2juLaltJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYD +VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+ +EVXVMAoGCCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGTqQ7m +ndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBuczrD6ogRLQy7rQkgu2 +npaqBA+K +-----END CERTIFICATE----- + +VeriSign Universal Root Certification Authority +=============================================== +-----BEGIN CERTIFICATE----- +MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE +BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO +ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk +IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u +IEF1dGhvcml0eTAeFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJV +UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv +cmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl +IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj +1mCOkdeQmIN65lgZOIzF9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGP +MiJhgsWHH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+HLL72 +9fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN/BMReYTtXlT2NJ8I +AfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPTrJ9VAMf2CGqUuV/c4DPxhGD5WycR +tPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0G +CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O +a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud +DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3 +Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx +Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx +P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P +wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4 +mJO37M2CYfE45k+XmCpajQ== +-----END CERTIFICATE----- + +VeriSign Class 3 Public Primary Certification Authority - G4 +============================================================ +-----BEGIN CERTIFICATE----- +MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC +VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmM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SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== +-----END CERTIFICATE----- + +NetLock Arany (Class Gold) Főtanúsítvány +======================================== +-----BEGIN CERTIFICATE----- +MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTERMA8G +A1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3MDUGA1UECwwuVGFuw7pzw610 +dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBB +cmFueSAoQ2xhc3MgR29sZCkgRsWRdGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgx +MjA2MTUwODIxWjCBpzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxO +ZXRMb2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlmaWNhdGlv +biBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNzIEdvbGQpIEbFkXRhbsO6 +c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxCRec75LbRTDofTjl5Bu +0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrTlF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw +/HpYzY6b7cNGbIRwXdrzAZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAk +H3B5r9s5VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRGILdw +fzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2BJtr+UBdADTHLpl1 +neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAGAQH/AgEEMA4GA1UdDwEB/wQEAwIB +BjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2MU9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwW +qZw8UQCgwBEIBaeZ5m8BiFRhbvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTta +YtOUZcTh5m2C+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC +bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2FuLjbvrW5Kfna +NwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu +dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E= +-----END CERTIFICATE----- + +Staat der Nederlanden Root CA - G2 +================================== +-----BEGIN CERTIFICATE----- +MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE +CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g +Um9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oXDTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMC +TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l +ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ +5291qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8SpuOUfiUtn +vWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fN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HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfk +CpYL+63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxLvJxxcypF +URmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkmbEgeqmiSBeGCc1qb3Adb +CG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvkN1trSt8sV4pAWja63XVECDdCcAz+3F4h +oKOKwJCcaNpQ5kUQR3i2TtJlycM33+FCY7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoV +IPVVYpbtbZNQvOSqeK3Zywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm +66+KAQ== +-----END CERTIFICATE----- + +Hongkong Post Root CA 1 +======================= +-----BEGIN CERTIFICATE----- +MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoT +DUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMB4XDTAzMDUx +NTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25n +IFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1 +ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEnPzlTCeqr +auh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjhZY4bXSNmO7ilMlHIhqqh +qZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9nnV0ttgCXjqQesBCNnLsak3c78QA3xMY +V18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNV +HRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7i +h9legYsCmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37pio +l7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5Lmei +IAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88ps +T/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilT +c4afU9hDDl3WY4JxHYB0yvbiAmvZWg== +-----END CERTIFICATE----- + +SecureSign RootCA11 +=================== +-----BEGIN CERTIFICATE----- +MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDErMCkGA1UEChMi +SmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoGA1UEAxMTU2VjdXJlU2lnbiBS +b290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSsw +KQYDVQQKEyJKYXBhbiBDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1 +cmVTaWduIFJvb3RDQTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvL +TJszi1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8h9uuywGO +wvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOVMdrAG/LuYpmGYz+/3ZMq +g6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rP +O7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitA +bpSACW22s293bzUIUPsCh8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZX +t94wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAKCh +OBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xmKbabfSVSSUOrTC4r +bnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQX5Ucv+2rIrVls4W6ng+4reV6G4pQ +Oh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWrQbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01 +y8hSyn+B/tlr0/cR7SXf+Of5pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061 +lgeLKBObjBmNQSdJQO7e5iNEOdyhIta6A/I= +-----END CERTIFICATE----- + +Microsec e-Szigno Root CA 2009 +============================== +-----BEGIN CERTIFICATE----- +MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYDVQQGEwJIVTER +MA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jv +c2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o +dTAeFw0wOTA2MTYxMTMwMThaFw0yOTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8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1Rq41Bab2XD0h7lbwyYIi +LXpUq3DDfSJlgnCW +-----END CERTIFICATE----- + +GlobalSign Root CA - R3 +======================= +-----BEGIN CERTIFICATE----- +MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UECxMXR2xv +YmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh +bFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT +aWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln +bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWt +iHL8RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsTgHeMCOFJ +0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmmKPZpO/bLyCiR5Z2KYVc3 +rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zdQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjl +OCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2 +xmmFghcCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE +FI/wS3+oLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZURUm7 +lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMpjjM5RcOO5LlXbKr8 +EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK6fBdRoyV3XpYKBovHd7NADdBj+1E +bddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQXmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18 +YIvDQVETI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7r +kpeDMdmztcpHWD9f +-----END CERTIFICATE----- + +Autoridad de Certificacion Firmaprofesional CIF A62634068 +========================================================= +-----BEGIN CERTIFICATE----- +MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UEBhMCRVMxQjBA +BgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2 +MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEyMzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIw +QAYDVQQDDDlBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBB +NjI2MzQwNjgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDD +Utd9thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQMcas9UX4P +B99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefGL9ItWY16Ck6WaVICqjaY +7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15iNA9wBj4gGFrO93IbJWyTdBSTo3OxDqqH +ECNZXyAFGUftaI6SEspd/NYrspI8IM/hX68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyI +plD9amML9ZMWGxmPsu2bm8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctX +MbScyJCyZ/QYFpM6/EfY0XiWMR+6KwxfXZm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4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoR +saS8I8nkvof/uZS2+F0gStRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTD +KCOM/iczQ0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQBjLMi +6Et8Vcad+qMUu2WFbm5PEn4KPJ2V +-----END CERTIFICATE----- + +Izenpe.com +========== +-----BEGIN CERTIFICATE----- +MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4MQswCQYDVQQG +EwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wHhcNMDcxMjEz +MTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMu +QS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ +03rKDx6sp4boFmVqscIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAK +ClaOxdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6HLmYRY2xU ++zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFXuaOKmMPsOzTFlUFpfnXC +PCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQDyCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxT +OTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+JrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbK +F7jJeodWLBoBHmy+E60QrLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK +0GqfvEyNBjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57C9sa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QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZo +Q0iy2+tzJOeRf1SktoA+naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1Z +WrOZyGlsQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== +-----END CERTIFICATE----- + +Chambers of Commerce Root - 2008 +================================ +-----BEGIN CERTIFICATE----- +MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYDVQQGEwJFVTFD +MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv +bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu +QS4xKTAnBgNVBAMTIENoYW1iZXJzIG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEy +Mjk1MFoXDTM4MDczMTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNl +ZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQF +EwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJl +cnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW928sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKA +XuFixrYp4YFs8r/lfTJqVKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorj +h40G072QDuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1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wWPJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH +3qLPaYRgM+gQDROpI9CF5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbU +RWpGqOt1glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaHFoI6 +M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2pSB7+R5KBWIBpih1 +YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MDxvbxrN8y8NmBGuScvfaAFPDRLLmF +9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QGtjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcK +zBIKinmwPQN/aUv0NCB9szTqjktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvG +nrDQWzilm1DefhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg +OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZd0jQ +-----END CERTIFICATE----- + +Global Chambersign Root - 2008 +============================== +-----BEGIN CERTIFICATE----- +MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYDVQQGEwJFVTFD +MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv +bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu +QS4xJzAlBgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMx +NDBaFw0zODA3MzExMjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6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MB0gNELQp/B +-----END CERTIFICATE----- + +Go Daddy Root Certificate Authority - G2 +======================================== +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoTEUdvRGFkZHkuY29tLCBJbmMu +MTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 +MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 +b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8G +A1UEAxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKDE6bFIEMBO4Tx5oVJnyfq +9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD ++qK+ihVqf94Lw7YZFAXK6sOoBJQ7RnwyDfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutd +fMh8+7ArU6SSYmlRJQVhGkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMl +NAJWJwGRtDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFDqahQcQZyi27/a9 +BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmXWWcDYfF+OwYxdS2hII5PZYe096ac +vNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r +5N9ss4UXnT3ZJE95kTXWXwTrgIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYV +N8Gb5DKj7Tjo2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO +LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI4uJEvlz36hz1 +-----END CERTIFICATE----- + +Starfield Root Certificate Authority - G2 +========================================= +-----BEGIN CERTIFICATE----- +MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s +b2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVsZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0 +eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAw +DgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQg +VGVjaG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZpY2F0ZSBB +dXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL3twQP89o/8ArFv +W59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMgnLRJdzIpVv257IzdIvpy3Cdhl+72WoTs +bhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNk +N3mSwOxGXn/hbVNMYq/NHwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7Nf +ZTD4p7dNdloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0HZbU +JtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0GCSqGSIb3DQEBCwUAA4IBAQARWfol +TwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjUsHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx +4mcujJUDJi5DnUox9g61DLu34jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUw +F5okxBDgBPfg8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K +pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1mMpYjn0q7pBZ +c2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 +-----END CERTIFICATE----- + +Starfield Services Root Certificate Authority - G2 +================================================== +-----BEGIN CERTIFICATE----- +MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s +b2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVsZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRl +IEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNV +BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxT +dGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2VydmljZXMg +Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20pOsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2 +h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm28xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4Pa +hHQUw2eeBGg6345AWh1KTs9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLP +LJGmpufehRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk6mFB +rMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAwDwYDVR0TAQH/BAUw +AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+qAdcwKziIorhtSpzyEZGDMA0GCSqG +SIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMIbw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPP +E95Dz+I0swSdHynVv/heyNXBve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTy +xQGjhdByPq1zqwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd +iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn0q23KXB56jza +YyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCNsSi6 +-----END CERTIFICATE----- + +AffirmTrust Commercial +====================== +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhv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bAW8b8Angc6F2S1BLUjIZkKlTuXfO8= +-----END CERTIFICATE----- + +AffirmTrust Networking +====================== +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UEBhMCVVMxFDAS +BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMB4XDTEw +MDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly +bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SE +Hi3yYJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbuakCNrmreI +dIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRLQESxG9fhwoXA3hA/Pe24 +/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gb +h+0t+nvujArjqWaJGctB+d1ENmHP4ndGyH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNV +HQ4EFgQUBx/S55zawm6iQLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwDQYJKoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfOtDIu +UFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzuQY0x2+c06lkh1QF6 +12S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZLgo/bNjR9e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6uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4IaC1nEWTJ3s7xgaVY5 +/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TXOwF0lkLgAOIua+rF7nKsu7/+6qqo ++Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYEFJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB +/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByv +MiPIs0laUZx2KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg +Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B8OWycvpEgjNC +6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQMKSOyARiqcTtNd56l+0OOF6S +L5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK ++4w1IX2COPKpVJEZNZOUbWo6xbLQu4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmV +BtWVyuEklut89pMFu+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFg +IxpHYoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8GKa1qF60 +g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaORtGdFNrHF+QFlozEJLUb +zxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6eKeC2uAloGRwYQw== +-----END CERTIFICATE----- + +AffirmTrust Premium ECC +======================= +-----BEGIN CERTIFICATE----- +MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMCVVMxFDASBgNV +BAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQcmVtaXVtIEVDQzAeFw0xMDAx +MjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1U +cnVzdDEgMB4GA1UEAwwXQWZmaXJtVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQA +IgNiAAQNMF4bFZ0D0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQ +N8O9ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0GA1UdDgQW +BBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAK +BggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/VsaobgxCd05DhT1wV/GzTjxi+zygk8N53X +57hG8f2h4nECMEJZh0PUUd+60wkyWs6Iflc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKM +eQ== +-----END CERTIFICATE----- + +Certum Trusted Network CA +========================= +-----BEGIN CERTIFICATE----- +MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBMMSIwIAYDVQQK +ExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBUcnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIy +MTIwNzM3WhcNMjkxMjMxMTIwNzM3WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBU +ZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rHUV+rpDKmYYe2bg+G0jAC +l/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LMTXPb865Px1bVWqeWifrzq2jUI4ZZJ88J +J7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVUBBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4 +fOQtf/WsX+sWn7Et0brMkUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0 +cvW0QM8xAcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNVHRMB +Af8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNVHQ8BAf8EBAMCAQYw +DQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15ysHhE49wcrwn9I0j6vSrEuVUEtRCj +jSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfLI9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1 +mS1FhIrlQgnXdAIv94nYmem8J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5aj +Zt3hrvJBW8qYVoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI +03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= +-----END CERTIFICATE----- + +TWCA Root Certification Authority +================================= +-----BEGIN CERTIFICATE----- +MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDV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eO4pz3N/GCUzf7Nr/1FNCocny +Yh0igzyXxfkZYiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== +-----END CERTIFICATE----- + +Security Communication RootCA2 +============================== +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDElMCMGA1UEChMc +U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMeU2VjdXJpdHkgQ29tbXVuaWNh +dGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoXDTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMC +SlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3Vy +aXR5IENvbW11bmljYXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +ANAVOVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGrzbl+dp++ ++T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVMVAX3NuRFg3sUZdbcDE3R +3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQhNBqyjoGADdH5H5XTz+L62e4iKrFvlNV +spHEfbmwhRkGeC7bYRr6hfVKkaHnFtWOojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1K +EOtOghY6rCcMU/Gt1SSwawNQwS08Ft1ENCcadfsCAwEAAaNCMEAwHQYDVR0OBBYEFAqFqXdlBZh8 +QIH4D5csOPEK7DzPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEB +CwUAA4IBAQBMOqNErLlFsceTfsgLCkLfZOoc7llsCLqJX2rKSpWeeo8HxdpFcoJxDjrSzG+ntKEj +u/Ykn8sX/oymzsLS28yN/HH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PIhpDGQh2xlnJ2lYJU6Un/10asIbvPuW/mIPX64b24D +5EI= +-----END CERTIFICATE----- + +Hellenic Academic and Research Institutions RootCA 2011 +======================================================= +-----BEGIN CERTIFICATE----- +MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1IxRDBCBgNVBAoT +O0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9y +aXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z +IFJvb3RDQSAyMDExMB4XDTExMTIwNjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYT +AkdSMUQwQgYDVQQKEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z +IENlcnQuIEF1dGhvcml0eTFAMD4GA1UEAxM3SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNo +IEluc3RpdHV0aW9ucyBSb290Q0EgMjAxMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AKlTAOMupvaO+mDYLZU++CwqVE7NuYRhlFhPjz2L5EPzdYmNUeTDN9KKiE15HrcS3UN4SoqS5tdI +1Q+kOilENbgH9mgdVc04UfCMJDGFr4PJfel3r+0ae50X+bOdOFAPplp5kYCvN66m0zH7tSYJnTxa +71HFK9+WXesyHgLacEnsbgzImjeN9/E2YEsmLIKe0HjzDQ9jpFEw4fkrJxIH2Oq9GGKYsFk3fb7u +8yBRQlqD75O6aRXxYp2fmTmCobd0LovUxQt7L/DICto9eQqakxylKHJzkUOap9FNhYS5qXSPFEDH +3N6sQWRstBmbAmNtJGSPRLIl6s5ddAxjMlyNh+UCAwEAAaOBiTCBhjAPBgNVHRMBAf8EBTADAQH/ +MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp5dgTBCPuQSUwRwYDVR0eBEAwPqA8 +MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQub3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQu +b3JnMA0GCSqGSIb3DQEBBQUAA4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVt +XdMiKahsog2p6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8 +TqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7dIsXRSZMFpGD +/md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8AcysNnq/onN694/BtZqhFLKPM58N +7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXIl7WdmplNsDz4SgCbZN2fOUvRJ9e4 +-----END CERTIFICATE----- + +Actalis Authentication Root CA +============================== +-----BEGIN CERTIFICATE----- +MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UEBhMCSVQxDjAM +BgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UE +AwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDky +MjExMjIwMlowazELMAkGA1UEBhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlz +IFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290 +IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNvUTufClrJ +wkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX4ay8IMKx4IN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Jlh0wcBzIm2Tlf05fbsq4/aC +4yyXX04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+OkfcvHlXHo +2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7RK4X9p2jIugErsWx0Hbhz +lefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btUZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXem +OR/qnuOf0GZvBeyqdn6/axag67XH/JJULysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9 +vwGYT7JZVEc+NHt4bVaTLnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg== +-----END CERTIFICATE----- + +Trustis FPS Root CA +=================== +-----BEGIN CERTIFICATE----- +MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQG +EwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQLExNUcnVzdGlzIEZQUyBSb290 +IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTExMzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNV +BAoTD1RydXN0aXMgTGltaXRlZDEcMBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQ +RUN+AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihHiTHcDnlk +H5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjjvSkCqPoc4Vu5g6hBSLwa +cY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zt +o3Lmr2NNL4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MX6OBE1/yWD +LfJ6v9r9jv6ly0UsH8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0 +oyLQI+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK75t98biGC +wWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h3PFaTWwyI0PurKju7koS +CTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPzY11aWOIv4x3kqdbQCtCev9eBCfHJxyYN +rJgWVqA= +-----END CERTIFICATE----- + +Buypass Class 3 Root CA +======================= +-----BEGIN CERTIFICATE----- +MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU +QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMyBSb290IENBMB4X +DTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFowTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1 +eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIw +DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRH +sJ8YZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3EN3coTRiR +5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9tznDDgFHmV0ST9tD+leh +7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX0DJq1l1sDPGzbjniazEuOQAnFN44wOwZ +ZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c/3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFF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JOxqDDPDe +eOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq4/g7u9xN12TyUb7mqqta6THuBrxzvxNi +Cp/HuZc= +-----END CERTIFICATE----- + +T-TeleSec GlobalRoot Class 3 +============================ +-----BEGIN CERTIFICATE----- +MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM +IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU +cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwHhcNMDgx +MDAxMTAyOTU2WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz +dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD +ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQC9dZPwYiJvJK7genasfb3ZJNW4t/zN8ELg63iIVl6bmlQdTQyK +9tPPcPRStdiTBONGhnFBSivwKixVA9ZIw+A5OO3yXDw/RLyTPWGrTs0NvvAgJ1gORH8EGoel15YU +NpDQSXuhdfsaa3Ox+M6pCSzyU9XDFES4hqX2iys52qMzVNn6chr3IhUciJFrf2blw2qAsCTz34ZF +iP0Zf3WHHx+xGwpzJFu5ZeAsVMhg02YXP+HMVDNzkQI6pn97djmiH5a2OK61yJN0HZ65tOVgnS9W +0eDrXltMEnAMbEQgqxHY9Bn20pxSN+f6tsIxO0rUFJmtxxr1XV/6B7h8DR/Wgx6zAgMBAAGjQjBA +MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS1A/d2O2GCahKqGFPr +AyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOyWL6ukK2YJ5f+AbGwUgC4TeQbIXQb +fsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzT +ucpH9sry9uetuUg/vBa3wW306gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7h +P0HHRwA11fXT91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml +e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4pTpPDpFQUWw== +-----END CERTIFICATE----- + +EE Certification Centre Root CA +=============================== +-----BEGIN CERTIFICATE----- +MIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQG +EwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1czEoMCYGA1UEAwwfRUUgQ2Vy +dGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYGCSqGSIb3DQEJARYJcGtpQHNrLmVlMCIYDzIw +MTAxMDMwMTAxMDMwWhgPMjAzMDEyMTcyMzU5NTlaMHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlB +UyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRy +ZSBSb290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWUwggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQDIIMDs4MVLqwd4lfNE7vsLDP90jmG7sWLqI9iroWUyeuuOF0+W2Ap7kaJjbMeM +TC55v6kF/GlclY1i+blw7cNRfdCT5mzrMEvhvH2/UpvObntl8jixwKIy72KyaOBhU8E2lf/slLo2 +rpwcpzIP5Xy0xm90/XsY6KxX7QYgSzIwWFv9zajmofxwvI6Sc9uXp3whrj3B9UiHbCe9nyV0gVWw +93X2PaRka9ZP585ArQ/dMtO8ihJTmMmJ+xAdTX7Nfh9WDSFwhfYggx/2uh8Ej+p3iDXE/+pOoYtN +P2MbRMNE1CV2yreN1x5KZmTNXMWcg+HCCIia7E6j8T4cLNlsHaFLAgMBAAGjgYowgYcwDwYDVR0T +AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBLyWj7qVhy/zQas8fElyalL1BSZ +MEUGA1UdJQQ+MDwGCCsGAQUFBwMCBggrBgEFBQcDAQYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEF +BQcDCAYIKwYBBQUHAwkwDQYJKoZIhvcNAQEFBQADggEBAHv25MANqhlHt01Xo/6tu7Fq1Q+e2+Rj +xY6hUFaTlrg4wCQiZrxTFGGVv9DHKpY5P30osxBAIWrEr7BSdxjhlthWXePdNl4dp1BUoMUq5KqM +lIpPnTX/dqQGE5Gion0ARD9V04I8GtVbvFZMIi5GQ4okQC3zErg7cBqklrkar4dBGmoYDQZPxz5u +uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIWiAYLtqZLICjU +3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/vGVCJYMzpJJUPwssd8m92kMfM +dcGWxZ0= +-----END CERTIFICATE----- + +D-TRUST Root Class 3 CA 2 2009 +============================== +-----BEGIN CERTIFICATE----- +MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQK +DAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTAe +Fw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NThaME0xCzAJBgNVBAYTAkRF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51xY/GXUl77M/C4KzCUqNQT4YJEV +dT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8PIWmawomDeCTmGCufsYkl4ph +X5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3YJohw1+qRzT65ysCQblrGXnRl11z+o+I= +-----END CERTIFICATE----- + +D-TRUST Root Class 3 CA 2 EV 2009 +================================= +-----BEGIN CERTIFICATE----- +MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK +DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw +OTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUwNDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK +DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw +OTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfS +egpnljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM03TP1YtHh +zRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6ZqQTMFexgaDbtCHu39b+T +7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lRp75mpoo6Kr3HGrHhFPC+Oh25z1uxav60 +sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8HgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure35 +11H3a6UCAwEAAaOCASQwggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyv +cop9NteaHNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGHoIGEoIG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Ny/MGz19qCkKxHh53L46g5pIOBvwFItIm4TFRfTLcDwIDAQABoyMwITAOBgNVHQ8BAf8EBAMC +AQYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEAXzSBdu+WHdXltdkCY4QWwa6g +cFGn90xHNcgL1yg9iXHZqjNB6hQbbCEAwGxCGX6faVsgQt+i0trEfJdLjbDorMjupWkEmQqSpqsn +LhpNgb+E1HAerUf+/UqdM+DyucRFCCEK2mlpc3INvjT+lIutwx4116KD7+U4x6WFH6vPNOw/KP4M +8VeGTslV9xzU2KV9Bnpv1d8Q34FOIWWxtuEXeZVFBs5fzNxGiWNoRI2T9GRwoD2dKAXDOXC4Ynsg +/eTb6QihuJ49CcdP+yz4k3ZB3lLg4VfSnQO8d57+nile98FRYB/e2guyLXW3Q0iT5/Z5xoRdgFlg +lPx4mI88k1HtQJAH32RjJMtOcQWh15QaiDLxInQirqWm2BJpTGCjAu4r7NRjkgtevi92a6O2JryP +A9gK8kxkRr05YuWW6zRjESjMlfGt7+/cgFhI6Uu46mWs6fyAtbXIRfmswZ/ZuepiiI7E8UuDEq3m +i4TWnsLrgxifarsbJGAzcMzs9zLzXNl5fe+epP7JI8Mk7hWSsT2RTyaGvWZzJBPqpK5jwa19hAM8 +EHiGG3njxPPyBJUgriOCxLM6AGK/5jYk4Ve6xx6QddVfP5VhK8E7zeWzaGHQRiapIVJpLesux+t3 +zqY6tQMzT3bR51xUAV3LePTJDL/PEo4XLSNolOer/qmyKwbQBM0= +-----END CERTIFICATE----- + +TeliaSonera Root CA v1 +====================== +-----BEGIN CERTIFICATE----- +MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIhvcNAQEFBQAwNzEUMBIGA1UE +CgwLVGVsaWFTb25lcmExHzAdBgNVBAMMFlRlbGlhU29uZXJhIFJvb3QgQ0EgdjEwHhcNMDcxMDE4 +MTIwMDUwWhcNMzIxMDE4MTIwMDUwWjA3MRQwEgYDV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nyQ1Q6g2EdvZR74NTxnr/DlZJLo961gzmJ1TjTQpgcmLNkQfW +pb/ImWvtxBnmq0wROMVvMeJuScg/doAmAyYp4Db29iBT4xdwNBedY2gea+zDTYa4EzAvXUYNR0PV +G6pZDrlcjQZIrXSHX8f8MVRBE+LHIQ6e4B4N4cB7Q4WQxYpYxmUKeFfyxiMPAdkgS94P+5KFdSpc +c41teyWRyu5FrgZLAMzTsVlQ2jqIOylDRl6XK1TOU2+NSueW+r9xDkKLfP0ooNBIytrEgUy7onOT +JsjrDNYmiLbAJM+7vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2 +qReWt88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcnHL/EVlP6 +Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVxSK236thZiNSQvxaz2ems +WWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY= +-----END CERTIFICATE----- + +E-Tugra Certification Authority +=============================== +-----BEGIN CERTIFICATE----- +MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNVBAYTAlRSMQ8w +DQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamls +ZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBN +ZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMw +NTEyMDk0OFoXDTIzMDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmEx +QDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhpem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Qk2Xz8lkGpD4eKexd0dCrfOAK +kEh47U6YA5n+KGCRHTAduGN8qOY1tfrTYXbm1gdLymmasoR6d5NFFxWfJNCYExL/u6Au/U5Mh/jO +XKqYGwXgAEZKgoClM4so3O0409/lPun++1ndYYRP0lSWE2ETPo+Aab6TR7U1Q9Jauz1c77NCR807 +VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3+GbHeJAAFS6LrVE1Uweo +a2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WKvJUawSg5TB9D0pH0clmKuVb8P7Sd2nCc +dlqMQ1DujjByTd//SffGqWfZbawCEeI6FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEV +KV0jq9BgoRJP3vQXzTLlyb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gT +Dx4JnW2PAJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpDy4Q0 +8ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8dNL/+I5c30jn6PQ0G +C7TbO6Orb1wdtn7os4I07QZcJA== +-----END CERTIFICATE----- + +T-TeleSec GlobalRoot Class 2 +============================ +-----BEGIN CERTIFICATE----- +MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM +IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU +cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwHhcNMDgx +MDAxMTA0MDE0WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz +dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD +ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQCqX9obX+hzkeXaXPSi5kfl82hVYAUdAqSzm1nzHoqvNK38DcLZ +SBnuaY/JIPwhqgcZ7bBcrGXHX+0CfHt8LRvWurmAwhiCFoT6ZrAIxlQjgeTNuUk/9k9uN0goOA/F +vudocP05l03Sx5iRUKrERLMjfTlH6VJi1hKTXrcxlkIF+3anHqP1wvzpesVsqXFP6st4vGCvx970 +2cu+fjOlbpSD8DT6IavqjnKgP6TeMFvvhk1qlVtDRKgQFRzlAVfFmPHmBiiRqiDFt1MmUUOyCxGV +WOHAD3bZwI18gfNycJ5v/hqO2V81xrJvNHy+SE/iWjnX2J14np+GPgNeGYtEotXHAgMBAAGjQjBA +MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS/WSA2AHmgoCJrjNXy +YdK4LMuCSjANBgkqhkiG9w0BAQsFAAOCAQEAMQOiYQsfdOhyNsZt+U2e+iKo4YFWz827n+qrkRk4 +r6p8FU3ztqONpfSO9kSpp+ghla0+AGIWiPACuvxhI+YzmzB6azZie60EI4RYZeLbK4rnJVM3YlNf +vNoBYimipidx5joifsFvHZVwIEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR +3p1m0IvVVGb6g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN +9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlPBSeOE6Fuwg== +-----END CERTIFICATE----- + +Atos TrustedRoot 2011 +===================== +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcNAQELBQAw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bGL0eUQMk1f +iyA6PEkfM4VZDdvLCXVDaXP7a3F98N/ETH3Goy7IlXnLc6KOTk0k+17kBL5yG6YnLUlamXrXXAkg +t3+UuU/xDRxeiEIbEbfnkduebPRq34wGmAOtzCjvpUfzUwIDAQABo0IwQDAPBgNVHRMBAf8EBTAD +AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUo5fW816iEOGrRZ88F2Q87gFwnMwwDQYJKoZI +hvcNAQELBQADggIBABj6W3X8PnrHX3fHyt/PX8MSxEBd1DKquGrX1RUVRpgjpeaQWxiZTOOtQqOC +MTaIzen7xASWSIsBx40Bz1szBpZGZnQdT+3Btrm0DWHMY37XLneMlhwqI2hrhVd2cDMT/uFPpiN3 +GPoajOi9ZcnPP/TJF9zrx7zABC4tRi9pZsMbj/7sPtPKlL92CiUNqXsCHKnQO18LwIE6PWThv6ct +Tr1NxNgpxiIY0MWscgKCP6o6ojoilzHdCGPDdRS5YCgtW2jgFqlmgiNR9etT2DGbe+m3nUvriBbP ++V04ikkwj+3x6xn0dxoxGE1nVGwvb2X52z3sIexe9PSLymBlVNFxZPT5pqOBMzYzcfCkeF9OrYMh +3jRJjehZrJ3ydlo28hP0r+AJx2EqbPfgna67hkooby7utHnNkDPDs3b69fBsnQGQ+p6Q9pxyz0fa +wx/kNSBT8lTR32GDpgLiJTjehTItXnOQUl1CxM49S+H5GYQd1aJQzEH7QRTDvdbJWqNjZgKAvQU6 +O0ec7AAmTPWIUb+oI38YB7AL7YsmoWTTYUrrXJ/es69nA7Mf3W1daWhpq1467HxpvMc7hU6eFbm0 +FU/DlXpY18ls6Wy58yljXrQs8C097Vpl4KlbQMJImYFtnh8GKjwStIsPm6Ik8KaN1nrgS7ZklmOV +hMJKzRwuJIczYOXD +-----END CERTIFICATE----- + +QuoVadis Root CA 2 G3 +===================== +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIURFc0JFuBiZs18s64KztbpybwdSgwDQYJKoZIhvcNAQELBQAw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nQT5WvvoxXqA/4Ti2Tk08HS6IT7SdEQ +TXlm66r99I0xHnAUrdzeZxNMgRVhvLfZkXdxGYFgu/BYpbWcC/ePIlUnwEsBbTuZDdQdm2NnL9Du +DcpmvJRPpq3t/O5jrFc/ZSXPsoaP0Aj/uHYUbt7lJ+yreLVTubY/6CD50qi+YUbKh4yE8/nxoGib +Ih6BJpsQBJFxwAYf3KDTuVan45gtf4Od34wrnDKOMpTwATwiKp9Dwi7DmDkHOHv8XgBCH/MyJnmD +hPbl8MFREsALHgQjDFSlTC9JxUrRtm5gDWv8a4uFJGS3iQ6rJUdbPM9+Sb3H6QrG2vd+DhcI00iX +0HGS8A85PjRqHH3Y8iKuu2n0M7SmSFXRDw4m6Oy2Cy2nhTXN/VnIn9HNPlopNLk9hM6xZdRZkZFW +dSHBd575euFgndOtBBj0fOtek49TSiIp+EgrPk2GrFt/ywaZWWDYWGWVjUTR939+J399roD1B0y2 +PpxxVJkES/1Y+Zj0 +-----END CERTIFICATE----- + +DigiCert Assured ID Root G2 +=========================== +-----BEGIN CERTIFICATE----- +MIIDljCCAn6gAwIBAgIQC5McOtY5Z+pnI7/Dr5r0SzANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw +IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIwHhcNMTMwODAxMTIwMDAwWhcNMzgw +MTE1MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL +ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZ5ygvUj82ckmIkzTz+GoeMVSAn61UQbVH +35ao1K+ALbkKz3X9iaV9JPrjIgwrvJUXCzO/GU1BBpAAvQxNEP4HteccbiJVMWWXvdMX0h5i89vq +bFCMP4QMls+3ywPgym2hFEwbid3tALBSfK+RbLE4E9HpEgjAALAcKxHad3A2m67OeYfcgnDmCXRw +VWmvo2ifv922ebPynXApVfSr/5Vh88lAbx3RvpO704gqu52/clpWcTs/1PPRCv4o76Pu2ZmvA9OP +YLfykqGxvYmJHzDNw6YuYjOuFgJ3RFrngQo8p0Quebg/BLxcoIfhG69Rjs3sLPr4/m3wOnyqi+Rn +lTGNAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTO +w0q5mVXyuNtgv6l+vVa1lzan1jANBgkqhkiG9w0BAQsFAAOCAQEAyqVVjOPIQW5pJ6d1Ee88hjZv +0p3GeDgdaZaikmkuOGybfQTUiaWxMTeKySHMq2zNixya1r9I0jJmwYrA8y8678Dj1JGG0VDjA9tz +d29KOVPt3ibHtX2vK0LRdWLjSisCx1BL4GnilmwORGYQRI+tBev4eaymG+g3NJ1TyWGqolKvSnAW +hsI6yLETcDbYz+70CjTVW0z9B5yiutkBclzzTcHdDrEcDcRjvq30FPuJ7KJBDkzMyFdA0G4Dqs0M +jomZmWzwPDCvON9vvKO+KSAnq3T/EyJ43pdSVR6DtVQgA+6uwE9W3jfMw3+qBCe703e4YtsXfJwo +IhNzbM8m9Yop5w== +-----END CERTIFICATE----- + +DigiCert Assured ID Root G3 +=========================== +-----BEGIN CERTIFICATE----- +MIICRjCCAc2gAwIBAgIQC6Fa+h3foLVJRK/NJKBs7DAKBggqhkjOPQQDAzBlMQswCQYDVQQGEwJV +UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQwIgYD +VQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1 +MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwdjAQ +BgcqhkjOPQIBBgUrgQQAIgNiAAQZ57ysRGXtzbg/WPuNsVepRC0FFfLvC/8QdJ+1YlJfZn4f5dwb +RXkLzMZTCp2NXQLZqVneAlr2lSoOjThKiknGvMYDOAdfVdp+CW7if17QRSAPWXYQ1qAk8C3eNvJs +KTmjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTL0L2p4ZgF +UaFNN6KDec6NHSrkhDAKBggqhkjOPQQDAwNnADBkAjAlpIFFAmsSS3V0T8gj43DydXLefInwz5Fy +YZ5eEJJZVrmDxxDnOOlYJjZ91eQ0hjkCMHw2U/Aw5WJjOpnitqM7mzT6HtoQknFekROn3aRukswy +1vUhZscv6pZjamVFkpUBtA== +-----END CERTIFICATE----- + +DigiCert Global Root G2 +======================= +-----BEGIN CERTIFICATE----- +MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw +HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUx +MjAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 +dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkq +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI2/Ou8jqJ +kTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx1x7e/dfgy5SDN67sH0NO +3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQq2EGnI/yuum06ZIya7XzV+hdG82MHauV +BJVJ8zUtluNJbd134/tJS7SsVQepj5WztCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyM +UNGPHgm+F6HmIcr9g+UQvIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQAB +o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV5uNu +5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY1Yl9PMWLSn/pvtsr +F9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4NeF22d+mQrvHRAiGfzZ0JFrabA0U +WTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NGFdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBH +QRFXGU7Aj64GxJUTFy8bJZ918rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/ +iyK5S9kJRaTepLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl +MrY= +-----END CERTIFICATE----- + +DigiCert Global Root G3 +======================= +-----BEGIN CERTIFICATE----- +MIICPzCCAcWgAwIBAgIQBVVWvPJepDU1w6QP1atFcjAKBggqhkjOPQQDAzBhMQswCQYDVQQGEwJV +UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAwHgYD +VQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMzAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAw +MDBaMGExCzAJBgNVBAYT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gQdfRnGTZ6iah +ixTXTBmyUEFxPT9NcCOGDErcgdLMMpSEDQgJlxxPwO5rIHQw0uA5NBCFIRUBCOhVMt5xSdkoF1BN +5r5N0XWs0Mr7QbhDparTwwVETyw2m+L64kW4I1NsBm9nVX9GtUw/bihaeSbSpKhil9Ie4u1Ki7wb +/UdKDd9nZn6yW0HQO+T0O/QEY+nvwlQAUaCKKsnOeMzV6ocEGLPOr0mIr/OSmbaz5mEP0oUA51Aa +5BuVnRmhuZyxm7EAHu/QD09CbMkKvO5D+jpxpchNJqU1/YldvIViHTLSoCtU7ZpXwdv6EM8Zt4tK +G48BtieVU+i2iW1bvGjUI+iLUaJW+fCmgKDWHrO8Dw9TdSmq6hN35N6MgSGtBxBHEa2HPQfRdbzP +82Z+ +-----END CERTIFICATE----- + +COMODO RSA Certification Authority +================================== +-----BEGIN CERTIFICATE----- +MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCBhTELMAkGA1UE +BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG +A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkwHhcNMTAwMTE5MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMC +R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE +ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCR6FSS0gpWsawNJN3Fz0Rn +dJkrN6N9I3AAcbxT38T6KhKPS38QVr2fcHK3YX/JSw8Xpz3jsARh7v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wxv/0Cti76R7CZGYZ4wUAc1oBmpjIXUDgIiKboHGhfKp +pC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmckejkk9u+UJueBPSZI9FoJA +zMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yLS0Zj/gA0QHDBw7mh3aZw4gSzQbzpgJHq +ZJx64SIDqZxubw5lT2yHh17zbqD5daWbQOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk52 +7RH89elWsn2/x20Kk4yl0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7I +LaZRfyHBNVOFBkpdn627G190 +-----END CERTIFICATE----- + +USERTrust RSA Certification Authority +===================================== +-----BEGIN CERTIFICATE----- +MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCBiDELMAkGA1UE +BhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQK +ExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UE +BhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQK +ExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCAEmUXNg7D2wiz +0KxXDXbtzSfTTK1Qg2HiqiBNCS1kCdzOiZ/MPans9s/B3PHTsdZ7NygRK0faOca8Ohm0X6a9fZ2j +Y0K2dvKpOyuR+OJv0OwW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JSFd5t0dCy5oGzuCr+yDZ4XUmFF0sbmZgIn/f3gZXHlKYC6SQK5MNyosycdi +yA5d9zZbyuAlJQG03RoHnHcAP9Dc1ew91Pq7P8yF1m9/qS3fuQL39ZeatTXaw2ewh0qpKJ4jjv9c +J2vhsE/zB+4ALtRZh8tSQZXq9EfX7mRBVXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGw +sAvgnEzDHNb842m1R0aBL6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gx +Q+6IHdfGjjxDah2nGN59PRbxYvnKkKj9 +-----END CERTIFICATE----- + +USERTrust ECC Certification Authority +===================================== +-----BEGIN CERTIFICATE----- +MIICjzCCAhWgAwIBAgIQXIuZxVqUxdJxVt7NiYDMJjAKBggqhkjOPQQDAzCBiDELMAkGA1UEBhMC +VVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU +aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMC +VVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU +aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQarFRaqfloI+d61SRvU8Za2EurxtW2 +0eZzca7dnNYMYf3boIkDuAUU7FfO7l0/4iGzzvfUinngo4N+LZfQYcTxmdwlkWOrfzCjtHDix6Ez +nPO/LlxTsV+zfTJ/ijTjeXmjQjBAMB0GA1UdDgQWBBQ64QmG1M8ZwpZ2dEl23OA1xmNjmjAOBgNV +HQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjA2Z6EWCNzklwBB +HU6+4WMBzzuqQhFkoJ2UOQIReVx7Hfpkue4WQrO/isIJxOzksU0CMQDpKmFHjFJKS04YcPbWRNZu +9YO6bVi9JNlWSOrvxKJGgYhqOkbRqZtNyWHa0V1Xahg= +-----END CERTIFICATE----- + +GlobalSign ECC Root CA - R4 +=========================== +-----BEGIN CERTIFICATE----- +MIIB4TCCAYegAwIBAgIRKjikHJYKBN5CsiilC+g0mAIwCgYIKoZIzj0EAwIwUDEkMCIGA1UECxMb +R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD +EwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMb +R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD +EwpHbG9iYWxTaWduMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuMZ5049sJQ6fLjkZHAOkrprl +OQcJFspjsbmG+IpXwVfOQvpzofdlQv8ewQCybnMO/8ch5RikqtlxP6jUuc6MHaNCMEAwDgYDVR0P +AQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFFSwe61FuOJAf/sKbvu+M8k8o4TV +MAoGCCqGSM49BAMCA0gAMEUCIQDckqGgE6bPA7DmxCGXkPoUVy0D7O48027KqGx2vKLeuwIgJ6iF +JzWbVsaj8kfSt24bAgAXqmemFZHe+pTsewv4n4Q= +-----END CERTIFICATE----- + +GlobalSign ECC Root CA - R5 +=========================== +-----BEGIN CERTIFICATE----- +MIICHjCCAaSgAwIBAgIRYFlJ4CYuu1X5CneKcflK2GwwCgYIKoZIzj0EAwMwUDEkMCIGA1UECxMb +R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD +EwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMb +R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD +EwpHbG9iYWxTaWduMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAER0UOlvt9Xb/pOdEh+J8LttV7HpI6 +SFkc8GIxLcB6KP4ap1yztsyX50XUWPrRd21DosCHZTQKH3rd6zwzocWdTaRvQZU4f8kehOvRnkmS +h5SHDDqFSmafnVmTTZdhBoZKo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAd +BgNVHQ4EFgQUPeYpSJvqB8ohREom3m7e0oPQn1kwCgYIKoZIzj0EAwMDaAAwZQIxAOVpEslu28Yx +uglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7 +yFz9SO8NdCKoCOJuxUnOxwy8p2Fp8fc74SrL+SvzZpA3 +-----END CERTIFICATE----- + +Staat der Nederlanden Root CA - G3 +================================== +-----BEGIN CERTIFICATE----- +MIIFdDCCA1ygAwIBAgIEAJiiOTANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE +CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g +Um9vdCBDQSAtIEczMB4XDTEzMTExNDExMjg0MloXDTI4MTExMzIzMDAwMFowWjELMAkGA1UEBhMC +TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l +ZGVybGFuZGVuIFJv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L8B3+A3MSs/mrBcDCw6Y5p4ixpgZQJut3+TcCDjJRYwEYgr5wfAvg1VUkvRtTA +8KCWAg8zxXHzniN9lLf9OtMJgwYh/WA9rjLA0u6NpvDntIJ8CsxwyXmA+P5M9zWEGYox+wrZ13+b +8KKaa8MFSu1BYBQw0aoRQm7TIwIEC8Zl3d1Sd9qBa7Ko+gE4uZbqKmxnl4mUnrzhVNXkanjvSr0r +mj1AfsbAddJu+2gw7OyLnflJNZoaLNmzlTnVHpL3prllL+U9bTpITAjc5CgSKL59NVzq4BZ+Extq +1z7XnvwtdbLBFNUjA9tbbws+eC8N3jONFrdI54OagQ97wUNNVQQXOEpR1VmiiXTTn74eS9fGbbeI +JG9gkaSChVtWQbzQRKtqE77RLFi3EjNYsjdj3BP1lB0/QFH1T/U67cjF68IeHRaVesd+QnGTbksV +tzDfqu1XhUisHWrdOWnk4Xl4vs4Fv6EM94B7IWcnMFk= +-----END CERTIFICATE----- + +Staat der Nederlanden EV Root CA +================================ +-----BEGIN CERTIFICATE----- +MIIFcDCCA1igAwIBAgIEAJiWjTANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJOTDEeMBwGA1UE +CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSkwJwYDVQQDDCBTdGFhdCBkZXIgTmVkZXJsYW5kZW4g +RVYgUm9vdCBDQTAeFw0xMDEyMDgxMTE5MjlaFw0yMjEyMDgxMTEwMjhaMFgxCzAJBgNVBAYTAk5M +MR4wHAYDVQQKDBVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xKTAnBgNVBAMMIFN0YWF0IGRlciBOZWRl +cmxhbmRlbiBFViBSb290IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA48d+ifkk +SzrSM4M1LGns3Amk41GoJSt5uAg94JG6hIXGhaTK5skuU6TJJB79VWZxXSzFYGgEt9nCUiY4iKTW +O0Cmws0/zZiTs1QUWJZV1VD+hq2kY39ch/aO5ieSZxeSAgMs3NZm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uD+nT3pajnnUk+S7aFKErGzp85hwVXIy+TSrK0m1zSBi +5Dp6Z2Orltxtrpfs/J92VoguZs9btsmksNcFuuEnL5O7Jiqik7Ab846+HUCjuTaPPoIaGl6I6lD4 +WeKDRikL40Rc4ZW2aZCaFG+XroHPaO+Zmr615+F/+PoTRxZMzG0IQOeLeG9QgkRQP2YGiqtDhFZK +DyAthg710tvSeopLzaXoTvFeJiUBWSOgftL2fiFX1ye8FVdMpEbB4IMeDExNH08GGeL5qPQ6gqGy +eUN51q1veieQA6TqJIc/2b3Z6fJfUEkc7uzXLg== +-----END CERTIFICATE----- + +IdenTrust Commercial Root CA 1 +============================== +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIQCgFCgAAAAUUjyES1AAAAAjANBgkqhkiG9w0BAQsFADBKMQswCQYDVQQG +EwJVUzESMBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBS +b290IENBIDEwHhcNMTQwMTE2MTgxMjIzWhcNMzQwMTE2MTgxMjIzWjBKMQswCQYDVQQGEwJVUzES +MBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBSb290IENB +IDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCnUBneP5k91DNG8W9RYYKyqU+PZ4ld +hNlT3Qwo2dfw/66VQ3KZ+bVdfIrBQuExUHTRgQ18zZshq0PirK1ehm7zCYofWjK9ouuU+ehcCuz/ +mNKvcbO0U59Oh++SvL3sTzIwiEsXXlfEU8L2ApeN2WIrvyQfYo3fw7gpS0l4PJNgiCL8mdo2yMKi +1CxUAGc1bnO/AljwpN3lsKImesrgNqUZFvX9t++uP0D1bVoE/c40yiTcdCMbXTMTEl3EASX2MN0C +XZ/g1Ue9tOsbobtJSdifWwLziuQkkORiT0/Br4sOdBeo0XKIanoBScy0RnnGF7HamB4HWfp1IYVl +3ZBWzvurpWCdx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8EIPGrd6ozRaOjfAHN3Gf8qv8QfXBi+wAN10J5U6A7/qxXDgGpRtK4dw4LTzcqx+QGtVKnO7R +cGzM7vRX+Bi6hG6H +-----END CERTIFICATE----- + +IdenTrust Public Sector Root CA 1 +================================= +-----BEGIN CERTIFICATE----- +MIIFZjCCA06gAwIBAgIQCgFCgAAAAUUjz0Z8AAAAAjANBgkqhkiG9w0BAQsFADBNMQswCQYDVQQG +EwJVUzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3Rv +ciBSb290IENBIDEwHhcNMTQwMTE2MTc1MzMyWhcNMzQwMTE2MTc1MzMyWjBNMQswCQYDVQQGEwJV +UzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3RvciBS +b290IENBIDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2IpT8pEiv6EdrCvsnduTy +P4o7ekosMSqMjbCpwzFrqHd2hCa2rIFCDQjrVVi7evi8ZX3yoG2LqEfpYnYeEe4IFNGyRBb06tD6 +Hi9e28tzQa68ALBKK0CyrOE7S8ItneShm+waOh7wCLPQ5CQ1B5+ctMlSbdsHyo+1W/CD80/HLaXI +rcuVIKQxKFdYWuSNG5qrng0M8gozOSI5Cpcu81N3uURF/YTLNiCBWS2ab21ISGHKTN9T0a9SvESf +qy9rg3LvdYDaBjMbXcjaY8ZNzaxmMc3R3j6HEDbhuaR672BQssvKplbgN6+rNBM5Jeg5ZuSYeqoS +mJxZZoY+rfGwyj4GD3vwEUs3oERte8uojHH01bWRNszwFcYr3lEXsZdMUD2xlVl8BX0tIdUAvwFn +ol57plzy9yLxkA2T26pEUWbMfXYD62qoKjgZl3YNa4ph+bz27nb9cCvdKTz4Ch5bQhyLVi9VGxyh +LrXHFub4qjySjmm2AcG1hp2JDws4lFTo6tyePSW8Uybt1as5qsVATFSrsrTZ2fjXctscvG29ZV/v +iDUqZi/u9rNl8DONfJhBaUYPQxxp+pu10GFqzcpL2UyQRqsVWaFHVCkugyhfHMKiq3IXAAaOReyL +4jM9f9oZRORicsPfIsbyVtTdX5Vy7W1f90gDW/3FKqD2cyOEEBsB5wIDAQABo0IwQDAOBgNVHQ8B +Af8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU43HgntinQtnbcZFrlJPrw6PRFKMw +DQYJKoZIhvcNAQELBQADggIBAEf63QqwEZE4rU1d9+UOl1QZgkiHVIyqZJnYWv6IAcVYpZmxI1Qj +t2odIFflAWJBF9MJ23XLblSQdf4an4EKwt3X9wnQW3IV5B4Jaj0z8yGa5hV+rVHVDRDtfULAj+7A +mgjVQdZcDiFpboBhDhXAuM/FSRJSzL46zNQuOAXeNf0fb7iAaJg9TaDKQGXSc3z1i9kKlT/YPyNt +GtEqJBnZhbMX73huqVjRI9PHE+1yJX9dsXNw0H8GlwmEKYBhHfpe/3OsoOOJuBxxFcbeMX8S3OFt +m6/n6J91eEyrRjuazr8FGF1NFTwWmhlQBJqymm9li1JfPFgEKCXAZmExfrngdbkaqIHWchezxQMx +NRF4eKLg6TCMf4DfWN88uieW4oA0beOY02QnrEh+KHdcxiVhJfiFDGX6xDIvpZgF5PgLZxYWxoK4 +Mhn5+bl53B/N66+rDt0b20XkeucC4pVd/GnwU2lhlXV5C15V5jgclKlZM57IcXR5f1GJtshquDDI +ajjDbp7hNxbqBWJMWxJH7ae0s1hWx0nzfxJoCTFx8G34Tkf71oXuxVhAGaQdp/lLQzfcaFpPz+vC +ZHTetBXZ9FRUGi8c15dxVJCO2SCdUyt/q4/i6jC8UDfv8Ue1fXwsBOxonbRJRBD0ckscZOf85muQ +3Wl9af0AVqW3rLatt8o+Ae+c +-----END CERTIFICATE----- + +Entrust Root Certification Authority - G2 +========================================= +-----BEGIN CERTIFICATE----- +MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMCVVMxFj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fThwMEYGprmi5Z +iXMRrEPR9RP/jTkrwPK9T3CMqS/qF8QLVJ7UG5aYMzyorWKiAHarWWluBh1+xLlEjZivEtRh2woZ +Rkfz6/djwUAFQKXSt/S1mja/qYh2iARVBCuch38aNzx+LaUa2NSJXsq9rD1s2G2v1fN2D807iDgi +nWyTmsQ9v4IbZT+mD12q/OWyFcq1rca8PdCE6OoGcrBNOTJ4vz4RnAuknZoh8/CbCzB428Hch0P+ +vGOaysXCHMnHjf87ElgI5rY97HosTvuDls4MPGmHVHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ19xO +e4pIb4tF9g== +-----END CERTIFICATE----- + +Entrust Root Certification Authority - EC1 +========================================== +-----BEGIN CERTIFICATE----- +MIIC+TCCAoCgAwIBAgINAKaLeSkAAAAAUNCR+TAKBggqhkjOPQQDAzCBvzELMAkGA1UEBhMCVVMx +FjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVn +YWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEyIEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXpl +ZCB1c2Ugb25seTEzMDEGA1UEAxMqRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +IC0gRUMxMB4XDTEyMTIxODE1MjUzNloXDTM3MTIxODE1NTUzNlowgb8xCzAJBgNVBAYTAlVTMRYw +FAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2Fs +LXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxMiBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6ZWQg +dXNlIG9ubHkxMzAxBgNVBAMTKkVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAt +IEVDMTB2MBAGByqGSM49AgEGBSuBBAAiA2IABIQTydC6bUF74mzQ61VfZgI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wYPZTISEEdQLpe/v5WOaHIz16eGWRGENoX +kbcFgKyLmZJ956LYBws2J+dIeWCKw9cTXPhyQN9Ky8+ZAAoACxGV2lZFA4gKn2fQ1XmxqI1AbQ3C +ekD6819kR5LLU7m7Wc5P/dAVUwHY3+vZ5nbv0CO7O6l5s9UCKc2Jo5YPSjXnTkLAdc0Hz+Ys63su +-----END CERTIFICATE----- + +OISTE WISeKey Global Root GB CA +=============================== +-----BEGIN CERTIFICATE----- +MIIDtTCCAp2gAwIBAgIQdrEgUnTwhYdGs/gjGvbCwDANBgkqhkiG9w0BAQsFADBtMQswCQYDVQQG +EwJDSDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNl +ZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQiBDQTAeFw0xNDEyMDExNTAw +MzJaFw0zOTEyMDExNTEwMzFaMG0xCzAJBgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNlS2V5MSIwIAYD +VQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5IEds +b2JhbCBSb290IEdCIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2Be3HEokKtaX +scriHvt9OO+Y9bI5mE4nuBFde9IllIiCFSZqGzG7qFshISvYD06fWvGxWuR51jIjK+FTzJlFXHtP +rby/h0oLS5daqPZI7H17Dc0hBt+eFf1Biki3IPShehtX1F1Q/7pn2COZH8g/497/b1t3sWtuuMlk +9+HKQUYOKXHQuSP8yYFfTvdv37+ErXNku7dCjmn21HYdfp2nuFeKUWdy19SouJVUQHMD9ur06/4o +Qnc/nSMbsrY9gBQHTC5P99UKFg29ZkM3fiNDecNAhvVMKdqOmq0NpQSHiB6F4+lT1ZvIiwNjeOvg +GUpuuy9rM2RYk61pv48b74JIxwIDAQABo1EwTzALBgNVHQ8EBAM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aE +2g0gv/pby6kWIK05YO4vdbbnl5z5Pv1+TW9NL++IDWr63fE9biCloBK0TXC5ztdyO4mTp4CEHCdJ +ckm1/zuVnsHMyAHs6A6KCpbns6aH5db5BSsNl0BwPLqsdVqc1U2dAgrSS5tmS0YHF2Wtn2yIANwi +ieDhZNRnvDF5YTy7ykHNXGoAyDw4jlivAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0P +AQH/BAQDAgEGMB0GA1UdDgQWBBQuFqlKGLXLzPVvUPMjX/hd56zwyDANBgkqhkiG9w0BAQsFAAOC +AQEAtXP4A9xZWx126aMqe5Aosk3AM0+qmrHUuOQn/6mWmc5G4G18TKI4pAZw8PRBEew/R40/cof5 +O/2kbytTAOD/OblqBw7rHRz2onKQy4I9EYKL0rufKq8h5mOGnXkZ7/e7DDWQw4rtTw/1zBLZpD67 +oPwglV9PJi8RI4NOdQcPv5vRtB3pEAT+ymCPoky4rc/hkA/NrgrHXXu3UNLUYfrVFdvXn4dRVOul +4+vJhaAlIDf7js4MNIThPIGyd05DpYhfhmehPea0XGG2Ptv+tyjFogeutcrKjSoS75ftwjCkySp6 ++/NNIxuZMzSgLvWpCz/UXeHPhJ/iGcJfitYgHuNztw== +-----END CERTIFICATE----- + +Certum Trusted Network CA 2 +=========================== +-----BEGIN CERTIFICATE----- +MIIF0jCCA7qgAwIBAgIQIdbQSk8lD8kyN/yqXhKN6TANBgkqhkiG9w0BAQ0FADCBgDELMAkGA1UE +BhMCUEwxIjAgBgNVBAoTGVVuaXpldG8gVGVjaG5vbG9naWVzIFMuQS4xJzAlBgNVBAsTHkNlcnR1 +bSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEkMCIGA1UEAxMbQ2VydHVtIFRydXN0ZWQgTmV0d29y +ayBDQSAyMCIYDzIwMTExMDA2MDgzOTU2WhgPMjA0NjEwMDYwODM5NTZaMIGAMQswCQYDVQQGEwJQ +TDEiMCAGA1UEChMZVW5pemV0byBUZWNobm9sb2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d1iHkTfCVn0W3cLN+mLIMb4Ck4uWBzrM9DPhmDJ2vuA +L55MYIR4PSFk1vtBHxgP58l1cb29XN40hz5BsA72udY/CROWFC/emh1auVbONTqwX3BNXuMp8SMo +clm2q8KMZiYcdywmdjWLKKdpoPk79SPdhRB0yZADVpHnr7pH1BKXESLjokmUbOe3lEu6LaTaM4tM +pkT/WjzGHWTYtTHkpjx6qFcL2+1hGsvxznN3Y6SHb0xRONbkX8eftoEq5IVIeVheO/jbAoJnwTnb +w3RLPTYe+SmTiGhbqEQZIfCn6IENLOiTNrQ3ssqwGyZ6miUfmpqAnksqP/ujmv5zMnHCnsZy4Ypo +J/HkD7TETKVhk/iXEAcqMCWpuchxuO9ozC1+9eB+D4Kob7a6bINDd82Kkhehnlt4Fj1F4jNy3eFm +ypnTycUm/Q1oBEauttmbjL4ZvrHG8hnjXALKLNhvSgfZyTXaQHXyxKcZb55CEJh15pWLYLztxRLX +is7VmFxWlgPF7ncGNf/P5O4/E2Hu29othfDNrp2yGAlFw5Khchf8R7agCyzxxN5DaAhqXzvwdmP7 +zAYspsbiDrW5viSP +-----END CERTIFICATE----- + +Hellenic Academic and Research Institutions RootCA 2015 +======================================================= +-----BEGIN CERTIFICATE----- +MIIGCzCCA/OgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBpjELMAkGA1UEBhMCR1IxDzANBgNVBAcT +BkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0 +aW9ucyBDZXJ0LiBBdXRob3JpdHkxQDA+BgNVBAMTN0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNl +YXJjaCBJbnN0aXR1dGlvbnMgUm9vdENBIDIwMTUwHhcNMTUwNzA3MTAxMTIxWhcNNDAwNjMwMTAx +MTIxWjCBpjELMAkGA1UEBhMCR1IxDzANBgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMg +QWNhZGVtaWMgYW5kIFJlc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1hYc2Ryx+hFjtyp8iY/xnmMsVMIM4GwVhO+5lFc2JsKT0ucVlMC6U/2DWDqTUJV6HwbISHTGzrM +d/K4kPFox/la/vot9L/J9UUbzjgQKjeKeaO04wlshYaT/4mWJ3iBj2fjRnRUjtkNaeJK9E10A/+y +d+2VZ5fkscWrv2oj6NSU4kQoYsRL4vDY4ilrGnB+JGGTe08DMiUNRSQrlrRGar9KC/eaj8GsGsVn +82800vpzY4zvFrCopEYq+OsS7HK07/grfoxSwIuEVPkvPuNVqNxmsdnhX9izjFk0WaSrT2y7Hxjb +davYy5LNlDhhDgcGH0tGEPEVvo2FXDtKK4F5D7Rpn0lQl033DlZdwJVqwjbDG2jJ9SrcR5q+ss7F +Jej6A7na+RZukYT1HCjI/CbM1xyQVqdfbzoEvM14iQuODy+jqk+iGxI9FghAD/FGTNeqewjBCvVt +J94Cj8rDtSvK6evIIVM4pcw72Hc3MKJP2W/R8kCtQXoXxdZKNYm3QdV8hn9VTYNKpXMgwDqvkPGa +JI7ZjnHKe7iG2rKPmT4dEw0SEe7Uq/DpFXYC5ODfqiAeW2GFZECpkJcNrVPSWh2HagCXZWK0vm9q +p/UsQu0yrbYhnr68 +-----END CERTIFICATE----- + +Hellenic Academic and Research Institutions ECC RootCA 2015 +=========================================================== +-----BEGIN CERTIFICATE----- +MIICwzCCAkqgAwIBAgIBADAKBggqhkjOPQQDAjCBqjELMAkGA1UEBhMCR1IxDzANBgNVBAcTBkF0 +aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9u +cyBDZXJ0LiBBdXRob3JpdHkxRDBCBgNVBAMTO0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJj +aCBJbnN0aXR1dGlvbnMgRUNDIFJvb3RDQSAyMDE1MB4XDTE1MDcwNzEwMzcxMloXDTQwMDYzMDEw +MzcxMlowgaoxCzAJBgNVBAYTAkdSMQ8wDQYDVQQHEwZBdGhlb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uNLwy+AwF+mWj2zs3gyLp1txyM/1d +8iC9djwj2ij3+RvrWWTV3F9yfiD8zYm1kGdNYno/Tq0dwzn+evQoFt9B9kiABdcPUXmsEKvU7ANm +5mqwujGSQkBqvjrTcuFqN1W8rB2Vt2lh8kORdOag0wokRqEIr9baRRmW1FMdW4R58MD3R++Lj8UG +rp1MYp3/RgT408m2ECVAdf4WqslKYIYvuu8wd+RU4riEmViAqhOLUTpPSPaLtrM= +-----END CERTIFICATE----- + +Amazon Root CA 1 +================ +-----BEGIN CERTIFICATE----- +MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsFADA5MQswCQYD +VQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSAxMB4XDTE1 +MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpv +bjEZMBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBALJ4gHHKeNXjca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgH +FzZM9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qwIFAGbHrQ +gLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6VOujw5H5SNz/0egwLX0t +dHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L93FcXmn/6pUCyziKrlA4b9v7LWIbxcce +VOF34GfID5yHI9Y/QCB/IIDEgEw+OyQmjgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB +/zAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3 +DQEBCwUAA4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDIU5PM +CCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUsN+gDS63pYaACbvXy +8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vvo/ufQJVtMVT8QtPHRh8jrdkPSHCa +2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2 +xJNDd2ZhwLnoQdeXeGADbkpyrqXRfboQnoZsG4q5WTP468SQvvG5 +-----END CERTIFICATE----- + +Amazon Root CA 2 +================ +-----BEGIN CERTIFICATE----- +MIIFQTCCAymgAwIBAgITBmyf0pY1hp8KD+WGePhbJruKNzANBgkqhkiG9w0BAQwFADA5MQswCQYD +VQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSAyMB4XDTE1 +MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpv +bjEZMBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC +ggIBAK2Wny2cSkxKgXlRmeyKy2tgURO8TW0G/LAIjd0ZEGrHJgw12MBvIITplLGbhQPDW9tK6Mj4 +kHbZW0/jTOgGNk3Mmqw9DJArktQGGWCsN0R5hYGCrVo34A3MnaZMUnbqQ523BNFQ9lXg1dKmSYXp +N+nKfq5clU1Imj+uIFptiJXZNLhSGkOQsL9sBbm2eLfq0OQ6PBJTYv9K8nu+NQWpEjTj82R0Yiw9 +AElaKP4yRLuH3WUnAnE72kr3H9rN9yFVkE8P7K6C4Z9r2UXTu/Bfh+08LDmG2j/e7HJV63mjrdvd +fLC6HM783k81ds8P+HgfajZRRidhW+mez/CiVX18JYpvL7TFz4QuK/0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kJMcYr07/R54H9jVlpNMKVv/1F2Rs76gi +JUmTtt8AF9pYfl3uxRuw0dFfIRDH+fO6AgonB8Xx1sfT4PsJYGw= +-----END CERTIFICATE----- + +Amazon Root CA 3 +================ +-----BEGIN CERTIFICATE----- +MIIBtjCCAVugAwIBAgITBmyf1XSXNmY/Owua2eiedgPySjAKBggqhkjOPQQDAjA5MQswCQYDVQQG +EwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSAzMB4XDTE1MDUy +NjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZ +MBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgMzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABCmXp8ZB +f8ANm+gBG1bG8lKlui2yEujSLtf6ycXYqm0fc4E7O5hrOXwzpcVOho6AF2hiRVd9RFgdszflZwjr +Zt6jQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSrttvXBp43 +rDCGB5Fwx5zEGbF4wDAKBggqhkjOPQQDAgNJADBGAiEA4IWSoxe3jfkrBqWTrBqYaGFy+uGh0Psc +eGCmQ5nFuMQCIQCcAu/xlJyzlvnrxir4tiz+OpAUFteMYyRIHN8wfdVoOw== +-----END CERTIFICATE----- + +Amazon Root CA 4 +================ +-----BEGIN CERTIFICATE----- +MIIB8jCCAXigAwIBAgITBmyf18G7EEwpQ+Vxe3ssyBrBDjAKBggqhkjOPQQDAzA5MQswCQYDVQQG +EwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSA0MB4XDTE1MDUy +NjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZ +MBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgNDB2MBAGByqGSM49AgEGBSuBBAAiA2IABNKrijdPo1MN +/sGKe0uoe0ZLY7Bi9i0b2whxIdIA6GO9mif78DluXeo9pcmBqqNbIJhFXRbb/egQbeOc4OO9X4Ri +83BkM6DLJC9wuoihKqB1+IGuYgbEgds5bimwHvouXKNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV +HQ8BAf8EBAMCAYYwHQYDVR0OBBYEFNPsxzplbszh2naaVvuc84ZtV+WBMAoGCCqGSM49BAMDA2gA +MGUCMDqLIfG9fhGt0O9Yli/W651+kI0rz2ZVwyzjKKlwCkcO8DdZEv8tmZQoTipPNU0zWgIxAOp1 +AE47xDqUEpHJWEadIRNyp4iciuRMStuW1KyLa2tJElMzrdfkviT8tQp21KW8EA== +-----END CERTIFICATE----- + +LuxTrust Global Root 2 +====================== +-----BEGIN CERTIFICATE----- +MIIFwzCCA6ugAwIBAgIUCn6m30tEntpqJIWe5rgV0xZ/u7EwDQYJKoZIhvcNAQELBQAwRjELMAkG +A1UEBhMCTFUxFjAUBgNVBAoMDUx1eFRydXN0IFMuQS4xHzAdBgNVBAMMFkx1eFRydXN0IEdsb2Jh +bCBSb290IDIwHhcNMTUwMzA1MTMyMTU3WhcNMzUwMzA1MTMyMTU3WjBGMQswCQYDVQQGEwJMVTEW +MBQGA1UECgwNTHV4VHJ1c3QgUy5BLjEfMB0GA1UEAwwWTHV4VHJ1c3QgR2xvYmFsIFJvb3QgMjCC +AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANeFl78RmOnwYoNMPIf5U2o3C/IPPIfOb9wm +Kb3FibrJgz337spbxm1Jc7TJRqMbNBM/wYlFV/TZsfs2ZUv7COJIcRHIbjuend+JZTemhfY7RBi2 +xjcwYkSSl2l9QjAk5A0MiWtj3sXh306pFGxT4GHO9hcvHTy95iJMHZP1EMShduxq3sVs35a0VkBC +wGKSMKEtFZSg0iAGCW5qbeXrt77U8PEVfIvmTroTzEsnXpk8F12PgX8zPU/TPxvsXD/wPEx1bvKm +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mx9xIX3eP/JEAdemrR +TxgKqpAd60Ae36EeRJIQmvKN4dFLRp7oRUKX6kWZ8+xm1QL68qZKJKrezrnK+T+Tb/mjuuqlPpmt +/f97mfVl7vBZKGfXkJWkE4SphMHozs51k2MavDzq1WQfLSoSOcbDWjLtR5EWDrw4wVDej8oqkDQc +7kGUnF4ZLvhFSZl0kbAEb+MEWrGrKqv+x9CWttrhSmQGbmBNvUJO/3jaJMobtNeWOWyu8Q6qp31I +iyBMz2TWuJdGsE7RKlY6oJO9r4Ak4Ap+58rVyuiFVdw2KuGUaJPHZnJED4AhMmwlxyOAgwrr +-----END CERTIFICATE----- + +TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1 +============================================= +-----BEGIN CERTIFICATE----- +MIIEYzCCA0ugAwIBAgIBATANBgkqhkiG9w0BAQsFADCB0jELMAkGA1UEBhMCVFIxGDAWBgNVBAcT +D0dlYnplIC0gS29jYWVsaTFCMEAGA1UEChM5VHVya2l5ZSBCaWxpbXNlbCB2ZSBUZWtub2xvamlr +IEFyYXN0aXJtYSBLdXJ1bXUgLSBUVUJJVEFLMS0wKwYDVQQLEyRLYW11IFNlcnRpZmlrYXN5b24g +TWVya2V6aSAtIEthbXUgU00xNjA0BgNVBAMTLVRVQklUQUsgS2FtdSBTTSBTU0wgS29rIFNlcnRp +ZmlrYXNpIC0gU3VydW0gMTAeFw0xMzExMjUwODI1NTVaFw00MzEwMjUwODI1NTVaMIHSMQswCQYD +VQQGEwJUUjEYMBYGA1UEBxMPR2ViemUgLSBLb2NhZWxpMUIwQAYDVQQKEzlUdXJraXllIEJpbGlt +c2VsIHZlIFRla25vbG9qaWsgQXJhc3Rpcm1hIEt1cnVtdSAtIFRVQklUQUsxLTArBgNVBAsTJEth +bXUgU2VydGlmaWthc3lvbiBNZXJrZXppIC0gS2FtdSBTTTE2MDQGA1UEAxMtVFVCSVRBSyBLYW11 +IFNNIFNTTCBLb2sgU2VydGlmaWthc2kgLSBTdXJ1bSAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAr3UwM6q7a9OZLBI3hNmNe5eA027n/5tQlT6QlVZC1xl8JoSNkvoBHToP4mQ4t4y8 +6Ij5iySrLqP1N+RAjhgleYN1Hzv/bKjFxlb4tO2KRKOrbEz8HdDc72i9z+SqzvBV96I01INrN3wc +wv61A+xXzry0tcXtAA9TNypN9E8Mg/uGz8v+jE69h/mniyFXnHrfA2eJLJ2XYacQuFWQfw4tJzh0 +3+f92k4S400VIgLI4OD8D62K18lUUMw7D8oWgITQUVbDjlZ/iSIzL+aFCr2lqBs23tPcLG07xxO9 +WSMs5uWk99gL7eqQQESolbuT1dCANLZGeA4fAJNG4e7p+exPFwIDAQABo0IwQDAdBgNVHQ4EFgQU +ZT/HiobGPN08VFw1+DrtUgxHV8gwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJ +KoZIhvcNAQELBQADggEBACo/4fEyjq7hmFxLXs9rHmoJ0iKpEsdeV31zVmSAhHqT5Am5EM2fKifh +AHe+SMg1qIGf5LgsyX8OsNJLN13qudULXjS99HMpw+0mFZx+CFOKWI3QSyjfwbPfIPP54+M638yc +lNhOT8NrF7f3cuitZjO1JVOr4PhMqZ398g26rrnZqsZr+ZO7rqu4lzwDGrpDxpa5RXI4s6ehlj2R +e37AIVNMh+3yC1SVUZPVIqUNivGTDj5UDrDYyU7c8jEyVupk+eq1nRZmQnLzf9OxMUP8pI4X8W0j +q5Rm+K37DwhuJi1/FwcJsoz7UMCflo3Ptv0AnVoUmr8CRPXBwp8iXqIPoeM= +-----END CERTIFICATE----- + +GDCA TrustAUTH R5 ROOT +====================== +-----BEGIN CERTIFICATE----- +MIIFiDCCA3CgAwIBAgIIfQmX/vBH6nowDQYJKoZIhvcNAQELBQAwYjELMAkGA1UEBhMCQ04xMjAw +BgNVBAoMKUdVQU5HIERPTkcgQ0VSVElGSUNBVEUgQVVUSE9SSVRZIENPLixMVEQuMR8wHQYDVQQD +D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mz3tQjtQJvLsznFhBmIhVE5/wZ0+ +fyCMgMsq2JdiyIMzkX2woloPV+g7zPIlstR8L+xNxqE6FXrntl019fZISjZFZtS6mFjBAgMBAAGj +YzBhMB0GA1UdDgQWBBREnkj1zG1I1KBLf/5ZJC+Dl5mahjAfBgNVHSMEGDAWgBREnkj1zG1I1KBL +f/5ZJC+Dl5mahjAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsF +AAOCAQEABT41XBVwm8nHc2FvcivUwo/yQ10CzsSUuZQRg2dd4mdsdXa/uwyqNsatR5Nj3B5+1t4u +/ukZMjgDfxT2AHMsWbEhBuH7rBiVDKP/mZb3Kyeb1STMHd3BOuCYRLDE5D53sXOpZCz2HAF8P11F +hcCF5yWPldwX8zyfGm6wyuMdKulMY/okYWLW2n62HGz1Ah3UKt1VkOsqEUc8Ll50soIipX1TH0Xs +J5F95yIW6MBoNtjG8U+ARDL54dHRHareqKucBK+tIA5kmE2la8BIWJZpTdwHjFGTot+fDz2LYLSC +jaoITmJF4PkL0uDgPFveXHEnJcLmA4GLEFPjx1WitJ/X5g== +-----END CERTIFICATE----- + +SSL.com Root Certification Authority RSA +======================================== +-----BEGIN CERTIFICATE----- +MIIF3TCCA8WgAwIBAgIIeyyb0xaAMpkwDQYJKoZIhvcNAQELBQAwfDELMAkGA1UEBhMCVVMxDjAM +BgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9TU0wgQ29ycG9yYXRpb24x +MTAvBgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBSU0EwHhcNMTYw +MjEyMTczOTM5WhcNNDEwMjEyMTczOTM5WjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMx +EDAOBgNVBAcMB0hvdXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NM +LmNv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yOabqG7B52B2ccETjit3E+ZUf +ijhDPwGFpUenPUayvOUiaPd7nNgsPgohyC0zrL/FgZkxdMF1ccW+sfAjRfSda/wZY52jvATGGAsl +u1OJD7OAUN5F7kR/q5R4ZJjT9ijdh9hwZXT7DrkT66cPYakylszeu+1jTBi7qUD3oFRuIIhxdRjq +erQ0cuAjJ3dctpDqhiVAq+8zD8ufgr6iIPv2tS0a5sKFsXQP+8hlAqRSAUfdSSLBv9jra6x+3uxj +MxW3IwiPxg+NQVrdjsW5j+VFP3jbutIbQLH+cU0/4IGiul607BXgk90IH37hVZkLId6Tngr75qNJ +vTYw/ud3sqB1l7UtgYgXZSD32pAAn8lSzDLKNXz1PQ/YK9f1JmzJBjSWFupwWRoyeXkLtoh/D1JI +Pb9s2KJELtFOt3JY04kTlf5Eq/jXixtunLwsoFvVagCvXzfh1foQC5ichucmj87w7G6KVwuA406y +wKBjYZC6VWg3dGq2ktufoYYitmUnDuy2n0Jg5GfCtdpBC8TTi2EbvPofkSvXRAdeuims2cXp71NI +WuuA8ShYIc2wBlX7Jz9TkHCpBB5XJ7k= +-----END CERTIFICATE----- + +SSL.com Root Certification Authority ECC +======================================== +-----BEGIN CERTIFICATE----- +MIICjTCCAhSgAwIBAgIIdebfy8FoW6gwCgYIKoZIzj0EAwIwfDELMAkGA1UEBhMCVVMxDjAMBgNV +BAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9TU0wgQ29ycG9yYXRpb24xMTAv +BgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBFQ0MwHhcNMTYwMjEy +MTgxNDAzWhcNNDEwMjEyMTgxNDAzWjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAO +BgNVBAcMB0hvdXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NMLmNv +bSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzB2MBAGByqGSM49AgEGBSuBBAAiA2IA +BEVuqVDEpiM2nl8ojRfLliJkP9x6jh3MCLOicSS6jkm5BBtHllirLZXI7Z4INcgn64mMU1jrYor+ +8FsPazFSY0E7ic3s7LaNGdM0B9y7xgZ/wkWV7Mt/qCPgCemB+vNH06NjMGEwHQYDVR0OBBYEFILR +hXMw5zUE044CkvvlpNHEIejNMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUgtGFczDnNQTT +jgKS++Wk0cQh6M0wDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA2cAMGQCMG/n61kRpGDPYbCW +e+0F+S8Tkdzt5fxQaxFGRrMcIQBiu77D5+jNB5n5DQtdcj7EqgIwH7y6C+IwJPt8bYBVCpk+gA0z +5Wajs6O7pdWLjwkspl1+4vAHCGht0nxpbl/f5Wpl +-----END CERTIFICATE----- + +SSL.com EV Root Certification Authority RSA R2 +============================================== +-----BEGIN CERTIFICATE----- +MIIF6zCCA9OgAwIBAgIIVrYpzTS8ePYwDQYJKoZIhvcNAQELBQAwgYIxCzAJBgNVBAYTAlVTMQ4w +DAYDVQQIDAVUZXhhczEQMA4GA1UEBwwHSG91c3RvbjEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9u +MTcwNQYDVQQDDC5TU0wuY29tIEVWIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgUlNBIFIy +MB4XDTE3MDUzMTE4MTQzN1oXDTQyMDUzMDE4MTQzN1owgYIxCzAJBgNVBAYTAlVTMQ4wDAYDVQQI +DAVUZXhhczEQMA4GA1UEBwwHSG91c3RvbjEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9uMTcwNQYD +VQQDDC5TU0wuY29tIEVWIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgUlNBIFIyMIICIjAN +BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAjzZlQOHWTcDXtOlG2mvqM0fNT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6OLk7K4S9ksrPJ/psEDz +OFSz/bdoyNrGj1E8svuR3Bznm53htw1yj+KkxKl4+esUrMZDBcJlOSgYAsOCsp0FvmXtll9ldDz7 +CTUue5wT/RsPXcdtgTpWD8w74a8CLyKsRspGPKAcTNZEtF4uXBVmCeEmKf7GUmG6sXP/wwyc5Wxq +lD8UykAWlYTzWamsX0xhk23RO8yilQwipmdnRC652dKKQbNmC1r7fSOl8hqw/96bg5Qu0T/fkreR +rwU7ZcegbLHNYhLDkBvjJc40vG93drEQw/cFGsDWr3RiSBd3kmmQYRzelYB0VI8YHMPzA9C/pEN1 +hlMYegouCRw2n5H9gooiS9EOUCXdywMMF8mDAAhONU2Ki+3wApRmLER/y5UnlhetCTCstnEXbosX +9hwJ1C07mKVx01QT2WDz9UtmT/rx7iASjbSsV7FFY6GsdqnC+w== +-----END CERTIFICATE----- + +SSL.com EV Root Certification Authority ECC +=========================================== +-----BEGIN CERTIFICATE----- +MIIClDCCAhqgAwIBAgIILCmcWxbtBZUwCgYIKoZIzj0EAwIwfzELMAkGA1UEBhMCVVMxDjAMBgNV +BAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9TU0wgQ29ycG9yYXRpb24xNDAy +BgNVBAMMK1NTTC5jb20gRVYgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBFQ0MwHhcNMTYw +MjEyMTgxNTIzWhcNNDEwMjEyMTgxNTIzWjB/MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMx +EDAOBgNVBAcMB0hvdXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjE0MDIGA1UEAwwrU1NM +LmNvbSBFViBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzB2MBAGByqGSM49AgEGBSuB +BAAiA2IABKoSR5CYG/vvw0AHgyBO8TCCogbR8pKGYfL2IWjKAMTH6kMAVIbc/R/fALhBYlzccBYy +3h+Z1MzFB8gIH2EWB1E9fVwHU+M1OIzfzZ/ZLg1KthkuWnBaBu2+8KGwytAJKaNjMGEwHQYDVR0O +BBYEFFvKXuXe0oGqzagtZFG22XKbl+ZPMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUW8pe +5d7SgarNqC1kUbbZcpuX5k8wDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA2gAMGUCMQCK5kCJ +N+vp1RPZytRrJPOwPYdGWBrssd9v+1a6cGvHOMzosYxPD/fxZ3YOg9AeUY8CMD32IygmTMZgh5Mm +m7I1HrrW9zzRHM76JTymGoEVW/MSD2zuZYrJh6j5B+BimoxcSg== +-----END CERTIFICATE----- + +GlobalSign Root CA - R6 +======================= +-----BEGIN CERTIFICATE----- +MIIFgzCCA2ugAwIBAgIORea7A4Mzw4VlSOb/RVEwDQYJKoZIhvcNAQEMBQAwTDEgMB4GA1UECxMX +R2xvYmFsU2lnbiBSb290IENBIC0gUjYxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkds +b2JhbFNpZ24wHhcNMTQxMjEwMDAwMDAwWhcNMzQxMjEwMDAwMDAwWjBMMSAwHgYDVQQLExdHbG9i +YWxTaWduIFJvb3QgQ0EgLSBSNjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFs +U2lnbjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJUH6HPKZvnsFMp7PPcNCPG0RQss +grRIxutbPK6DuEGSMxSkb3/pKszGsIhrxbaJ0cay/xTOURQh7ErdG1rG1ofuTToVBu1kZguSgMpE +3nOUTvOniX9PeGMIyBJQbUJmL025eShNUhqKGoC3GYEOfsSKvGRMIRxDaNc9PIrFsmbVkJq3MQbF +vuJtMgamHvm566qjuL++gmNQ0PAYid/kD3n16qIfKtJwLnvnvJO7bVPiSHyMEAc4/2ayd2F+4OqM +PKq0pPbzlUoSB239jLKJz9CgYXfIWHSw1CM69106yqLbnQneXUQtkPGBz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Du+6B5dpffItK +oZB0JaezPkvILFa9x8jvOOJckvB595yEunQtYQEgfn7R8k8HWV+LLUNS60YMlOH1Zkd5d9VUWx+t +JDfLRVpOoERIyNiwmcUVhAn21klJwGW45hpxbqCo8YLoRT5s1gLXCmeDBVrJpBA= +-----END CERTIFICATE----- + +OISTE WISeKey Global Root GC CA +=============================== +-----BEGIN CERTIFICATE----- +MIICaTCCAe+gAwIBAgIQISpWDK7aDKtARb8roi066jAKBggqhkjOPQQDAzBtMQswCQYDVQQGEwJD +SDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEo +MCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQyBDQTAeFw0xNzA1MDkwOTQ4MzRa +Fw00MjA1MDkwOTU4MzNaMG0xCzAJBgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNlS2V5MSIwIAYDVQQL +ExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5IEdsb2Jh +bCBSb290IEdDIENBMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAETOlQwMYPchi82PG6s4nieUqjFqdr +VCTbUf/q9Akkwwsin8tqJ4KBDdLArzHkdIJuyiXZjHWd8dvQmqJLIX4Wp2OQ0jnUsYd4XxiWD1Ab +NTcPasbc2RNNpI6QN+a9WzGRo1QwUjAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAd +BgNVHQ4EFgQUSIcUrOPDnpBgOtfKie7TrYy0UGYwEAYJKwYBBAGCNxUBBAMCAQAwCgYIKoZIzj0E +AwMDaAAwZQIwJsdpW9zV57LnyAyMjMPdeYwbY9XJUpROTYJKcx6ygISpJcBMWm1JKWB4E+J+SOtk +AjEA2zQgMgj/mkkCtojeFK9dbJlxjRo/i9fgojaGHAeCOnZT/cKi7e97sIBPWA9LUzm9 +-----END CERTIFIC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65FSWRQmx1WyRRK2EE46ajA2ADDL24Cej +QjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTB8Sa6oC2uhYHP +0/EqEr24Cmf9vDAKBggqhkjOPQQDAwNpADBmAjEAgFukfCPAlaUs3L6JbyO5o91lAFJekazInXJ0 +glMLfalAvWhgxeG4VDvBNhcl2MG9AjEAnjWSdIUlUfUk7GRSJFClH9voy8l27OyCbvWFGFPouOOa +KaqW04MjyaR7YbPMAuhd +-----END CERTIFICATE----- + +GTS Root R4 +=========== +-----BEGIN CERTIFICATE----- +MIICCjCCAZGgAwIBAgIQbkepyIuUtui7OyrYorLBmTAKBggqhkjOPQQDAzBHMQswCQYDVQQGEwJV +UzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3Qg +UjQwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UE +ChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjQwdjAQBgcq +hkjOPQIBBgUrgQQAIgNiAATzdHOnaItgrkO4NcWBMHtLSZ37wWHO5t5GvWvVYRg1rkDdc/eJkTBa +6zzuhXyiQHY7qca4R9gq55KRanPpsXI5nymfopjTX15YhmUPoYRlBtHci8nHc8iMai/lxKvRHYqj +QjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSATNbrdP9JNqPV +2Py1PsVq8JQdjDAKBggqhkjOPQQDAwNnADBkAjBqUFJ0CMRw3J5QdCHojXohw0+WbhXRIjVhLfoI +N+4Zba3bssx9BzT1YBkstTTZbyACMANxsbqjYAuG7ZoIapVon+Kz4ZNkfF6Tpt95LY2F45TPI11x +zPKwTdb+mciUqXWi4w== +-----END CERTIFICATE----- + +UCA Global G2 Root +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A1UdEwEB/wQFMAMBAf8wHQYDVR0O +BBYEFIHEjMz15DD/pQwIX4wVZyF0Ad/fMA0GCSqGSIb3DQEBCwUAA4ICAQATZSL1jiutROTL/7lo +5sOASD0Ee/ojL3rtNtqyzm325p7lX1iPyzcyochltq44PTUbPrw7tgTQvPlJ9Zv3hcU2tsu8+Mg5 +1eRfB70VVJd0ysrtT7q6ZHafgbiERUlMjW+i67HM0cOU2kTC5uLqGOiiHycFutfl1qnN3e92mI0A +Ds0b+gO3joBYDic/UvuUospeZcnWhNq5NXHzJsBPd+aBJ9J3O5oUb3n09tDh05S60FdRvScFDcH9 +yBIw7m+NESsIndTUv4BFFJqIRNow6rSn4+7vW4LVPtateJLbXDzz2K36uGt/xDYotgIVilQsnLAX +c47QN6MUPJiVAAwpBVueSUmxX8fjy88nZY41F7dXyDDZQVu5FLbowg+UMaeUmMxq67XhJ/UQqAHo +jhJi6IjMtX9Gl8CbEGY4GjZGXyJoPd/JxhMnq1MGrKI8hgZlb7F+sSlEmqO6SWkoaY/X5V+tBIZk +bxqgDMUIYs6Ao9Dz7GjevjPHF1t/gMRMTLGmhIrDO7gJzRSBuhjjVFc2/tsvfEehOjPI+Vg7RE+x +ygKJBJYoaMVLuCaJu9YzL1DV/pqJuhgyklTGW+Cd+V7lDSKb9triyCGyYiGqhkCyLmTTX8jjfhFn +RR8F/uOi77Oos/N9j/gMHyIfLXC0uAE0djAA5SN4p1bXUB+K+wb1whnw0A== +-----END CERTIFICATE----- + +UCA Extended Validation Root +============================ +-----BEGIN CERTIFICATE----- +MIIFWjCCA0KgAwIBAgIQT9Irj/VkyDOeTzRYZiNwYDANBgkqhkiG9w0BAQsFADBHMQswCQYDVQQG +EwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxJTAjBgNVBAMMHFVDQSBFeHRlbmRlZCBWYWxpZGF0aW9u +IFJvb3QwHhcNMTUwMzEzMDAwMDAwWhcNMzgxMjMxMDAwMDAwWjBHMQswCQYDVQQGEwJDTjERMA8G +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+OoldaDgvUSILSo3L6btdPrtcPbEo/uRTVRPPoZAbAh1fZkYJMyjhDSSXcNMQH+pkV5a7XdrnxIxP +TGRGHVyH41neQtGbqH6mid2PHMkwgu07nM3A6RngatgCdTer9zQoKJHyBApPNeNgJgH60BGM+RFq +7q89w1DTj18zeTyGqHNFkIwgtnJzFyO+B2XleJINugHA64wcZr+shncBlA2c5uk5jR+mUYyZDDl3 +4bSb+hxnV29qao6pK0xXeXpXIs/NX2NGjVxZOob4Mkdio2cNGJHc+6Zr9UhhcyNZjgKnvETq9Emd +8VRY+WCv2hikLyhF3HqgiIZd8zvn/yk1gPxkQ5Tm4xxvvq0OKmOZK8l+hfZx6AYDlf7ej0gcWtSS +6Cvu5zHbugRqh5jnxV/vfaci9wHYTfmJ0A6aBVmknpjZbyvKcL5kwlWj9Omvw5Ip3IgWJJk8jSaY +tlu3zM63Nwf9JtmYhST/WSMDmu2dnajkXjjO11INb9I/bbEFa0nOipFGc/T2L/Coc3cOZayhjWZS +aX5LaAzHHjcng6WMxwLkFM1JAbBzs/3GkDpv0mztO+7skb6iQ12LAEpmJURw3kAP+HwV96LOPNde +E4yBFxgX0b3xdxA61GU5wSesVywlVP+i2k+KYTlerj1KjL0= +-----END CERTIFICATE----- + +emSign Root CA - G1 +=================== +-----BEGIN CERTIFICATE----- +MIIDlDCCAnygAwIBAgIKMfXkYgxsWO3W2DANBgkqhkiG9w0BAQsFADBnMQswCQYDVQQGEwJJTjET +MBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNobm9sb2dpZXMgTGltaXRl +ZDEcMBoGA1UEAxMTZW1TaWduIFJvb3QgQ0EgLSBHMTAeFw0xODAyMTgxODMwMDBaFw00MzAyMTgx +ODMwMDBaMGcxCzAJBgNVBAYTAklOMRMwEQYDVQQLEwplbVNpZ24gUEtJMSUwIwYDVQQKExxlTXVk +aHJhIFRlY2hub2xvZ2llcyBMaW1pdGVkMRwwGgYDVQQDExNlbVNpZ24gUm9vdCBDQSAtIEcxMIIB +IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAk0u76WaK7p1b1TST0Bsew+eeuGQzf2N4aLTN +LnF115sgxk0pvLZoYIr3IZpWNVrzdr3YzZr/k1ZLpVkGoZM0Kd0WNHVO8oG0x5ZOrRkVUkr+PHB1 +cM2vK6sVmjM8qrOLqs1D/fXqcP/tzxE7lM5OMhbTI0Aqd7OvPAEsbO2ZLIvZTmmYsvePQbAyeGHW +DV/D+qJAkh1cF+ZwPjXnorfCYuKrpDhMtTk1b+oDafo6VGiFbdbyL0NVHpENDtjVaqSW0RM8LHhQ +6DqS0hdW5TUaQBw+jSztOd9C4INBdN+jzcKGYEho42kLVACL5HZpIQ15TjQIXhTCzLG3rdd8cIrH +hQIDAQABo0IwQDAdBgNVHQ4EFgQU++8Nhp6w492pufEhF38+/PB3KxowDgYDVR0PAQH/BAQDAgEG +MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAFn/8oz1h31xPaOfG1vR2vjTnGs2 +vZupYeveFix0PZ7mddrXuqe8QhfnPZHr5X3dPpzxz5KsbEjMwiI/aTvFthUvozXGaCocV685743Q +NcMYDHsAVhzNixl03r4PEuDQqqE/AjSxcM6dGNYIAwlG7mDgfrbESQRRfXBgvKqy/3lyeqYdPV8q ++Mri/Tm3R7nrft8EI6/6nAYH6ftjk4BAtcZsCjEozgyfz7MjNYBBjWzEN3uBL4ChQEKF6dk4jeih +U80Bv2noWgbyRQuQ+q7hv53yrlc8pa6yVvSLZUDp/TGBLPQ5Cdjua6e0ph0VpZj3AYHYhX3zUVxx +iN66zB+Afko= +-----END CERTIFICATE----- + +emSign ECC Root CA - G3 +======================= +-----BEGIN CERTIFICATE----- +MIICTjCCAdOgAwIBAgIKPPYHqWhwDtqLhDAKBggqhkjOPQQDAzBrMQswCQYDVQQGEwJJTjETMBEG +A1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNobm9sb2dpZXMgTGltaXRlZDEg +MB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0gRzMwHhcNMTgwMjE4MTgzMDAwWhcNNDMwMjE4 +MTgzMDAwWjBrMQswCQYDVQQGEwJJTjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11 +ZGhyYSBUZWNobm9sb2dpZXMgTGltaXRlZDEgMB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0g +RzMwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQjpQy4LRL1KPOxst3iAhKAnjlfSU2fySU0WXTsuwYc +58Byr+iuL+FBVIcUqEqy6HyC5ltqtdyzdc6LBtCGI79G1Y4PPwT01xySfvalY8L1X44uT6EYGQIr +MgqCZH0Wk9GjQjBAMB0GA1UdDgQWBBR8XQKEE9TMipuBzhccLikenEhjQjAOBgNVHQ8BAf8EBAMC +AQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNpADBmAjEAvvNhzwIQHWSVB7gYboiFBS+D +CBeQyh+KTOgNG3qxrdWBCUfvO6wIBHxcmbHtRwfSAjEAnbpV/KlK6O3t5nYBQnvI+GDZjVGLVTv7 +jHvrZQnD+JbNR6iC8hZVdyR+EhCVBCyj +-----END CERTIFICATE----- + +emSign Root CA - C1 +=================== +-----BEGIN CERTIFICATE----- +MIIDczCCAlugAwIBAgILAK7PALrEzzL4Q7IwDQYJKoZIhvcNAQELBQAwVjELMAkGA1UEBhMCVVMx +EzARBgNVBAsTCmVtU2lnbiBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMRwwGgYDVQQDExNlbVNp +Z24gUm9vdCBDQSAtIEMxMB4XDTE4MDIxODE4MzAwMFoXDTQzMDIxODE4MzAwMFowVjELMAkGA1UE +BhMCVVMxEzARBgNVBAsTCmVtU2lnbiBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMRwwGgYDVQQD +ExNlbVNpZ24gUm9vdCBDQSAtIEMxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAz+up +ufGZBczYKCFK83M0UYRWEPWgTywS4/oTmifQz/l5GnRfHXk5/Fv4cI7gklL35CX5VIPZHdPIWoU/ +Xse2B+4+wM6ar6xWQio5JXDWv7V7Nq2s9nPczdcdioOl+yuQFTdrHCZH3DspVpNqs8FqOp099cGX +OFgFixwR4+S0uF2FHYP+eF8LRWgYSKVGczQ7/g/IdrvHGPMF0Ybzhe3nudkyrVWIzqa2kbBPrH4V +I5b2P/AgNBbeCsbEBEV5f6f9vtKppa+cxSMq9zwhbL2vj07FOrLzNBL834AaSaTUqZX3noleooms +lMuoaJuvimUnzYnu3Yy1aylwQ6BpC+S5DwIDAQABo0IwQDAdBgNVHQ4EFgQU/qHgcB4qAzlSWkK+ +XJGFehiqTbUwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQAD +ggEBAMJKVvoVIXsoounlHfv4LcQ5lkFMOycsxGwYFYDGrK9HWS8mC+M2sO87/kOXSTKZEhVb3xEp +/6tT+LvBeA+snFOvV71ojD1pM/CjoCNjO2RnIkSt1XHLVip4kqNPEjE2NuLe/gDEo2APJ62gsIq1 +NnpSob0n9CAnYuhNlCQT5AoE6TyrLshDCUrGYQTlSTR+08TI9Q/Aqum6VF7zYytPT1DU/rl7mYw9 +wC68AivTxEDkigcxHpvOJpkT+xHqmiIMERnHXhuBUDDIlhJu58tBf5E7oke3VIAb3ADMmpDqw8NQ +BmIMMMAVSKeoWXzhriKi4gp6D/piq1JM4fHfyr6DDUI= +-----END CERTIFICATE----- + +emSign ECC Root CA - C3 +======================= +-----BEGIN CERTIFICATE----- +MIICKzCCAbGgAwIBAgIKe3G2gla4EnycqDAKBggqhkjOPQQDAzBaMQswCQYDVQQGEwJVUzETMBEG +A1UECxMKZW1TaWduIFBLSTEUMBIGA1UEChMLZU11ZGhyYSBJbmMxIDAeBgNVBAMTF2VtU2lnbiBF +Q0MgUm9vdCBDQSAtIEMzMB4XDTE4MDIxODE4MzAwMFoXDTQzMDIxODE4MzAwMFowWjELMAkGA1UE +BhMCVVMxEzARBgNVBAsTCmVtU2lnbiBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMSAwHgYDVQQD +ExdlbVNpZ24gRUNDIFJvb3QgQ0EgLSBDMzB2MBAGByqGSM49AgEGBSuBBAAiA2IABP2lYa57JhAd +6bciMK4G9IGzsUJxlTm801Ljr6/58pc1kjZGDoeVjbk5Wum739D+yAdBPLtVb4OjavtisIGJAnB9 +SMVK4+kiVCJNk7tCDK93nCOmfddhEc5lx/h//vXyqaNCMEAwHQYDVR0OBBYEFPtaSNCAIEDyqOkA +B2kZd6fmw/TPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MAoGCCqGSM49BAMDA2gA +MGUCMQC02C8Cif22TGK6Q04ThHK1rt0c3ta13FaPWEBaLd4gTCKDypOofu4SQMfWh0/434UCMBwU +ZOR8loMRnLDRWmFLpg9J0wD8ofzkpf9/rdcw0Md3f76BB1UwUCAU9Vc4CqgxUQ== +-----END CERTIFICATE----- + +Hongkong Post Root CA 3 +======================= +-----BEGIN CERTIFICATE----- +MIIFzzCCA7egAwIBAgIUCBZfikyl7ADJk0DfxMauI7gcWqQwDQYJKoZIhvcNAQELBQAwbzELMAkG +A1UEBhMCSEsxEjAQBgNVBAgTCUhvbmcgS29uZzESMBAGA1UEBxMJSG9uZyBLb25nMRYwFAYDVQQK +Ew1Ib25na29uZyBQb3N0MSAwHgYDVQQDExdIb25na29uZyBQb3N0IFJvb3QgQ0EgMzAeFw0xNzA2 +MDMwMjI5NDZaFw00MjA2MDMwMjI5NDZaMG8xCzAJBgNVBAYTAkhLMRIwEAYDVQQIEwlIb25nIEtv +bmcxEjAQBgNVBAcTCUhvbmcgS29uZzEWMBQGA1UEChMNSG9uZ2tvbmcgUG9zdDEgMB4GA1UEAxMX +SG9uZ2tvbmcgUG9zdCBSb290IENBIDM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kBZss4HTzfQx/0TW60uhdG/H39h4F5ag0zD/ov ++BS5gLNdTaqX4fnkGMX41TiMJjz98iji7lpJiCzfeT2OnpA8vUFKOt1b9pq0zj8lMH8yfaIDlNDc +eqFS3m6TjRgm/VWsvY+b0s+v54Ysyx8Jb6NvqYTUc79NoXQbTiNg8swOqn+knEwlqLJmOzj/2ZQw +9nKEvmhVEA/GcywWaZMH/rFF7buiVWqw2rVKAiUnhde3t4ZEFolsgCs+l6mc1X5VTMbeRRAc6uk7 +nwNT7u56AQIWeNTowr5GdogTPyK7SBIdUgC0An4hGh6cJfTzPV4e0hz5sy229zdcxsshTrD3mUcY +hcErulWuBurQB7Lcq9CClnXO0lD+mefPL5/ndtFhKvshuzHQqp9HpLIiyhY6UFfEW0NnxWViA0kB +60PZ2Pierc+xYw5F9KBaLJstxabArahH9CdMOA0uG0k7UvToiIMrVCjU8jVStDKDYmlkDJGcn5fq +dBb9HxEGmpv0 +-----END CERTIFICATE----- diff --git a/vendor/stripe/stripe-php/init.php b/vendor/stripe/stripe-php/init.php new file mode 100644 index 0000000..b242ddf --- /dev/null +++ b/vendor/stripe/stripe-php/init.php @@ -0,0 +1,247 @@ +create and manage Express or + * Custom accounts. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|\Stripe\StripeObject $business_profile Business information about the account. + * @property null|string $business_type The business type. + * @property \Stripe\StripeObject $capabilities + * @property bool $charges_enabled Whether the account can create live charges. + * @property \Stripe\StripeObject $company + * @property \Stripe\StripeObject $controller + * @property string $country The account's country. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $default_currency Three-letter ISO currency code representing the default currency for the account. This must be a currency that Stripe supports in the account's country. + * @property bool $details_submitted Whether account details have been submitted. Standard accounts cannot receive payouts before this is true. + * @property null|string $email An email address associated with the account. You can treat this as metadata: it is not used for authentication or messaging account holders. + * @property \Stripe\Collection $external_accounts External accounts (bank accounts and debit cards) currently attached to this account + * @property \Stripe\Person $individual

This is an object representing a person associated with a Stripe account.

A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. See the Standard onboarding or Express onboarding documentation for information about platform pre-filling and account onboarding steps.

Related guide: Handling Identity Verification with the API.

+ * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property bool $payouts_enabled Whether Stripe can send payouts to this account. + * @property \Stripe\StripeObject $requirements + * @property null|\Stripe\StripeObject $settings Options for customizing how the account functions within Stripe. + * @property \Stripe\StripeObject $tos_acceptance + * @property string $type The Stripe account type. Can be standard, express, or custom. + */ +class Account extends ApiResource +{ + const OBJECT_NAME = 'account'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\NestedResource; + use ApiOperations\Update; + + const BUSINESS_TYPE_COMPANY = 'company'; + const BUSINESS_TYPE_GOVERNMENT_ENTITY = 'government_entity'; + const BUSINESS_TYPE_INDIVIDUAL = 'individual'; + const BUSINESS_TYPE_NON_PROFIT = 'non_profit'; + + const CAPABILITY_CARD_PAYMENTS = 'card_payments'; + const CAPABILITY_LEGACY_PAYMENTS = 'legacy_payments'; + const CAPABILITY_PLATFORM_PAYMENTS = 'platform_payments'; + const CAPABILITY_TRANSFERS = 'transfers'; + + const CAPABILITY_STATUS_ACTIVE = 'active'; + const CAPABILITY_STATUS_INACTIVE = 'inactive'; + const CAPABILITY_STATUS_PENDING = 'pending'; + + const TYPE_CUSTOM = 'custom'; + const TYPE_EXPRESS = 'express'; + const TYPE_STANDARD = 'standard'; + + use ApiOperations\Retrieve { + retrieve as protected _retrieve; + } + + public static function getSavedNestedResources() + { + static $savedNestedResources = null; + if (null === $savedNestedResources) { + $savedNestedResources = new Util\Set([ + 'external_account', + 'bank_account', + ]); + } + + return $savedNestedResources; + } + + public function instanceUrl() + { + if (null === $this['id']) { + return '/v1/account'; + } + + return parent::instanceUrl(); + } + + public function serializeParameters($force = false) + { + $update = parent::serializeParameters($force); + if (isset($this->_values['legal_entity'])) { + $entity = $this['legal_entity']; + if (isset($entity->_values['additional_owners'])) { + $owners = $entity['additional_owners']; + $entityUpdate = isset($update['legal_entity']) ? $update['legal_entity'] : []; + $entityUpdate['additional_owners'] = $this->serializeAdditionalOwners($entity, $owners); + $update['legal_entity'] = $entityUpdate; + } + } + if (isset($this->_values['individual'])) { + $individual = $this['individual']; + if (($individual instanceof Person) && !isset($update['individual'])) { + $update['individual'] = $individual->serializeParameters($force); + } + } + + return $update; + } + + private function serializeAdditionalOwners($legalEntity, $additionalOwners) + { + if (isset($legalEntity->_originalValues['additional_owners'])) { + $originalValue = $legalEntity->_originalValues['additional_owners']; + } else { + $originalValue = []; + } + if (($originalValue) && (\count($originalValue) > \count($additionalOwners))) { + throw new Exception\InvalidArgumentException( + 'You cannot delete an item from an array, you must instead set a new array' + ); + } + + $updateArr = []; + foreach ($additionalOwners as $i => $v) { + $update = ($v instanceof StripeObject) ? $v->serializeParameters() : $v; + + if ([] !== $update) { + if (!$originalValue + || !\array_key_exists($i, $originalValue) + || ($update !== $legalEntity->serializeParamsValue($originalValue[$i], null, false, true))) { + $updateArr[$i] = $update; + } + } + } + + return $updateArr; + } + + /** + * @param null|array|string $id the ID of the account to retrieve, or an + * options array containing an `id` key + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Account + */ + public static function retrieve($id = null, $opts = null) + { + if (!$opts && \is_string($id) && 'sk_' === \substr($id, 0, 3)) { + $opts = $id; + $id = null; + } + + return self::_retrieve($id, $opts); + } + + /** + * @param null|array $clientId + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\StripeObject object containing the response from the API + */ + public function deauthorize($clientId = null, $opts = null) + { + $params = [ + 'client_id' => $clientId, + 'stripe_user_id' => $this->id, + ]; + + return OAuth::deauthorize($params, $opts); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of persons + */ + public function persons($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/persons'; + list($response, $opts) = $this->_request('get', $url, $params, $opts); + $obj = Util\Util::convertToStripeObject($response, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Account the rejected account + */ + public function reject($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/reject'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /* + * Capabilities methods + * We can not add the capabilities() method today as the Account object already has a + * capabilities property which is a hash and not the sub-list of capabilities. + */ + + const PATH_CAPABILITIES = '/capabilities'; + + /** + * @param string $id the ID of the account on which to retrieve the capabilities + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of capabilities + */ + public static function allCapabilities($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_CAPABILITIES, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the capability belongs + * @param string $capabilityId the ID of the capability to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Capability + */ + public static function retrieveCapability($id, $capabilityId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the capability belongs + * @param string $capabilityId the ID of the capability to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Capability + */ + public static function updateCapability($id, $capabilityId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts); + } + + const PATH_EXTERNAL_ACCOUNTS = '/external_accounts'; + + /** + * @param string $id the ID of the account on which to retrieve the external accounts + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of external accounts (BankAccount or Card) + */ + public static function allExternalAccounts($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_EXTERNAL_ACCOUNTS, $params, $opts); + } + + /** + * @param string $id the ID of the account on which to create the external account + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public static function createExternalAccount($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the external account belongs + * @param string $externalAccountId the ID of the external account to delete + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public static function deleteExternalAccount($id, $externalAccountId, $params = null, $opts = null) + { + return self::_deleteNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the external account belongs + * @param string $externalAccountId the ID of the external account to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public static function retrieveExternalAccount($id, $externalAccountId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the external account belongs + * @param string $externalAccountId the ID of the external account to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public static function updateExternalAccount($id, $externalAccountId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts); + } + + const PATH_LOGIN_LINKS = '/login_links'; + + /** + * @param string $id the ID of the account on which to create the login link + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\LoginLink + */ + public static function createLoginLink($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_LOGIN_LINKS, $params, $opts); + } + + const PATH_PERSONS = '/persons'; + + /** + * @param string $id the ID of the account on which to retrieve the persons + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of persons + */ + public static function allPersons($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_PERSONS, $params, $opts); + } + + /** + * @param string $id the ID of the account on which to create the person + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public static function createPerson($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_PERSONS, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the person belongs + * @param string $personId the ID of the person to delete + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public static function deletePerson($id, $personId, $params = null, $opts = null) + { + return self::_deleteNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the person belongs + * @param string $personId the ID of the person to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public static function retrievePerson($id, $personId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the person belongs + * @param string $personId the ID of the person to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public static function updatePerson($id, $personId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/AccountLink.php b/vendor/stripe/stripe-php/lib/AccountLink.php new file mode 100644 index 0000000..24a9e68 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/AccountLink.php @@ -0,0 +1,26 @@ +Connect + * Onboarding. + * + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property int $expires_at The timestamp at which this account link will expire. + * @property string $url The URL for the account link. + */ +class AccountLink extends ApiResource +{ + const OBJECT_NAME = 'account_link'; + + use ApiOperations\Create; +} diff --git a/vendor/stripe/stripe-php/lib/AlipayAccount.php b/vendor/stripe/stripe-php/lib/AlipayAccount.php new file mode 100644 index 0000000..1d6a509 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/AlipayAccount.php @@ -0,0 +1,75 @@ +json, $opts); + if (!($obj instanceof \Stripe\Collection)) { + throw new \Stripe\Exception\UnexpectedValueException( + 'Expected type ' . \Stripe\Collection::class . ', got "' . \get_class($obj) . '" instead.' + ); + } + $obj->setLastResponse($response); + $obj->setFilters($params); + + return $obj; + } +} diff --git a/vendor/stripe/stripe-php/lib/ApiOperations/Create.php b/vendor/stripe/stripe-php/lib/ApiOperations/Create.php new file mode 100644 index 0000000..c435132 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/ApiOperations/Create.php @@ -0,0 +1,31 @@ +json, $opts); + $obj->setLastResponse($response); + + return $obj; + } +} diff --git a/vendor/stripe/stripe-php/lib/ApiOperations/Delete.php b/vendor/stripe/stripe-php/lib/ApiOperations/Delete.php new file mode 100644 index 0000000..c6082ff --- /dev/null +++ b/vendor/stripe/stripe-php/lib/ApiOperations/Delete.php @@ -0,0 +1,30 @@ +instanceUrl(); + list($response, $opts) = $this->_request('delete', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/ApiOperations/NestedResource.php b/vendor/stripe/stripe-php/lib/ApiOperations/NestedResource.php new file mode 100644 index 0000000..180cacd --- /dev/null +++ b/vendor/stripe/stripe-php/lib/ApiOperations/NestedResource.php @@ -0,0 +1,135 @@ +json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param string $id + * @param string $nestedPath + * @param null|string $nestedId + * + * @return string + */ + protected static function _nestedResourceUrl($id, $nestedPath, $nestedId = null) + { + $url = static::resourceUrl($id) . $nestedPath; + if (null !== $nestedId) { + $url .= "/{$nestedId}"; + } + + return $url; + } + + /** + * @param string $id + * @param string $nestedPath + * @param null|array $params + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\StripeObject + */ + protected static function _createNestedResource($id, $nestedPath, $params = null, $options = null) + { + $url = static::_nestedResourceUrl($id, $nestedPath); + + return self::_nestedResourceOperation('post', $url, $params, $options); + } + + /** + * @param string $id + * @param string $nestedPath + * @param null|string $nestedId + * @param null|array $params + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\StripeObject + */ + protected static function _retrieveNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null) + { + $url = static::_nestedResourceUrl($id, $nestedPath, $nestedId); + + return self::_nestedResourceOperation('get', $url, $params, $options); + } + + /** + * @param string $id + * @param string $nestedPath + * @param null|string $nestedId + * @param null|array $params + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\StripeObject + */ + protected static function _updateNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null) + { + $url = static::_nestedResourceUrl($id, $nestedPath, $nestedId); + + return self::_nestedResourceOperation('post', $url, $params, $options); + } + + /** + * @param string $id + * @param string $nestedPath + * @param null|string $nestedId + * @param null|array $params + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\StripeObject + */ + protected static function _deleteNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null) + { + $url = static::_nestedResourceUrl($id, $nestedPath, $nestedId); + + return self::_nestedResourceOperation('delete', $url, $params, $options); + } + + /** + * @param string $id + * @param string $nestedPath + * @param null|array $params + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\StripeObject + */ + protected static function _allNestedResources($id, $nestedPath, $params = null, $options = null) + { + $url = static::_nestedResourceUrl($id, $nestedPath); + + return self::_nestedResourceOperation('get', $url, $params, $options); + } +} diff --git a/vendor/stripe/stripe-php/lib/ApiOperations/Request.php b/vendor/stripe/stripe-php/lib/ApiOperations/Request.php new file mode 100644 index 0000000..24c3741 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/ApiOperations/Request.php @@ -0,0 +1,102 @@ + 100, " + . "'currency' => 'usd', 'source' => 'tok_1234'])\")"; + + throw new \Stripe\Exception\InvalidArgumentException($message); + } + } + + /** + * @param string $method HTTP method ('get', 'post', etc.) + * @param string $url URL for the request + * @param array $params list of parameters for the request + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return array tuple containing (the JSON response, $options) + */ + protected function _request($method, $url, $params = [], $options = null) + { + $opts = $this->_opts->merge($options); + list($resp, $options) = static::_staticRequest($method, $url, $params, $opts); + $this->setLastResponse($resp); + + return [$resp->json, $options]; + } + + /** + * @param string $method HTTP method ('get', 'post', etc.) + * @param string $url URL for the request + * @param callable $readBodyChunk function that will receive chunks of data from a successful request body + * @param array $params list of parameters for the request + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return array tuple containing (the JSON response, $options) + */ + protected function _requestStream($method, $url, $readBodyChunk, $params = [], $options = null) + { + $opts = $this->_opts->merge($options); + static::_staticStreamingRequest($method, $url, $readBodyChunk, $params, $opts); + } + + /** + * @param string $method HTTP method ('get', 'post', etc.) + * @param string $url URL for the request + * @param array $params list of parameters for the request + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return array tuple containing (the JSON response, $options) + */ + protected static function _staticRequest($method, $url, $params, $options) + { + $opts = \Stripe\Util\RequestOptions::parse($options); + $baseUrl = isset($opts->apiBase) ? $opts->apiBase : static::baseUrl(); + $requestor = new \Stripe\ApiRequestor($opts->apiKey, $baseUrl); + list($response, $opts->apiKey) = $requestor->request($method, $url, $params, $opts->headers); + $opts->discardNonPersistentHeaders(); + + return [$response, $opts]; + } + + /** + * @param string $method HTTP method ('get', 'post', etc.) + * @param string $url URL for the request + * @param callable $readBodyChunk function that will receive chunks of data from a successful request body + * @param array $params list of parameters for the request + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + */ + protected static function _staticStreamingRequest($method, $url, $readBodyChunk, $params, $options) + { + $opts = \Stripe\Util\RequestOptions::parse($options); + $baseUrl = isset($opts->apiBase) ? $opts->apiBase : static::baseUrl(); + $requestor = new \Stripe\ApiRequestor($opts->apiKey, $baseUrl); + $requestor->requestStream($method, $url, $readBodyChunk, $params, $opts->headers); + } +} diff --git a/vendor/stripe/stripe-php/lib/ApiOperations/Retrieve.php b/vendor/stripe/stripe-php/lib/ApiOperations/Retrieve.php new file mode 100644 index 0000000..5170afb --- /dev/null +++ b/vendor/stripe/stripe-php/lib/ApiOperations/Retrieve.php @@ -0,0 +1,30 @@ +refresh(); + + return $instance; + } +} diff --git a/vendor/stripe/stripe-php/lib/ApiOperations/Update.php b/vendor/stripe/stripe-php/lib/ApiOperations/Update.php new file mode 100644 index 0000000..688f080 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/ApiOperations/Update.php @@ -0,0 +1,52 @@ +json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return static the saved resource + */ + public function save($opts = null) + { + $params = $this->serializeParameters(); + if (\count($params) > 0) { + $url = $this->instanceUrl(); + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + } + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/ApiRequestor.php b/vendor/stripe/stripe-php/lib/ApiRequestor.php new file mode 100644 index 0000000..98e4dfe --- /dev/null +++ b/vendor/stripe/stripe-php/lib/ApiRequestor.php @@ -0,0 +1,594 @@ +_apiKey = $apiKey; + if (!$apiBase) { + $apiBase = Stripe::$apiBase; + } + $this->_apiBase = $apiBase; + } + + /** + * Creates a telemetry json blob for use in 'X-Stripe-Client-Telemetry' headers. + * + * @static + * + * @param RequestTelemetry $requestTelemetry + * + * @return string + */ + private static function _telemetryJson($requestTelemetry) + { + $payload = [ + 'last_request_metrics' => [ + 'request_id' => $requestTelemetry->requestId, + 'request_duration_ms' => $requestTelemetry->requestDuration, + ], + ]; + + $result = \json_encode($payload); + if (false !== $result) { + return $result; + } + Stripe::getLogger()->error('Serializing telemetry payload failed!'); + + return '{}'; + } + + /** + * @static + * + * @param ApiResource|array|bool|mixed $d + * + * @return ApiResource|array|mixed|string + */ + private static function _encodeObjects($d) + { + if ($d instanceof ApiResource) { + return Util\Util::utf8($d->id); + } + if (true === $d) { + return 'true'; + } + if (false === $d) { + return 'false'; + } + if (\is_array($d)) { + $res = []; + foreach ($d as $k => $v) { + $res[$k] = self::_encodeObjects($v); + } + + return $res; + } + + return Util\Util::utf8($d); + } + + /** + * @param string $method + * @param string $url + * @param null|array $params + * @param null|array $headers + * + * @throws Exception\ApiErrorException + * + * @return array tuple containing (ApiReponse, API key) + */ + public function request($method, $url, $params = null, $headers = null) + { + $params = $params ?: []; + $headers = $headers ?: []; + list($rbody, $rcode, $rheaders, $myApiKey) = + $this->_requestRaw($method, $url, $params, $headers); + $json = $this->_interpretResponse($rbody, $rcode, $rheaders); + $resp = new ApiResponse($rbody, $rcode, $rheaders, $json); + + return [$resp, $myApiKey]; + } + + /** + * @param string $method + * @param string $url + * @param callable $readBodyChunk + * @param null|array $params + * @param null|array $headers + * + * @throws Exception\ApiErrorException + * + * @return array tuple containing (ApiReponse, API key) + */ + public function requestStream($method, $url, $readBodyChunk, $params = null, $headers = null) + { + $params = $params ?: []; + $headers = $headers ?: []; + list($rbody, $rcode, $rheaders, $myApiKey) = + $this->_requestRawStreaming($method, $url, $params, $headers, $readBodyChunk); + if ($rcode >= 300) { + $this->_interpretResponse($rbody, $rcode, $rheaders); + } + } + + /** + * @param string $rbody a JSON string + * @param int $rcode + * @param array $rheaders + * @param array $resp + * + * @throws Exception\UnexpectedValueException + * @throws Exception\ApiErrorException + */ + public function handleErrorResponse($rbody, $rcode, $rheaders, $resp) + { + if (!\is_array($resp) || !isset($resp['error'])) { + $msg = "Invalid response object from API: {$rbody} " + . "(HTTP response code was {$rcode})"; + + throw new Exception\UnexpectedValueException($msg); + } + + $errorData = $resp['error']; + + $error = null; + if (\is_string($errorData)) { + $error = self::_specificOAuthError($rbody, $rcode, $rheaders, $resp, $errorData); + } + if (!$error) { + $error = self::_specificAPIError($rbody, $rcode, $rheaders, $resp, $errorData); + } + + throw $error; + } + + /** + * @static + * + * @param string $rbody + * @param int $rcode + * @param array $rheaders + * @param array $resp + * @param array $errorData + * + * @return Exception\ApiErrorException + */ + private static function _specificAPIError($rbody, $rcode, $rheaders, $resp, $errorData) + { + $msg = isset($errorData['message']) ? $errorData['message'] : null; + $param = isset($errorData['param']) ? $errorData['param'] : null; + $code = isset($errorData['code']) ? $errorData['code'] : null; + $type = isset($errorData['type']) ? $errorData['type'] : null; + $declineCode = isset($errorData['decline_code']) ? $errorData['decline_code'] : null; + + switch ($rcode) { + case 400: + // 'rate_limit' code is deprecated, but left here for backwards compatibility + // for API versions earlier than 2015-09-08 + if ('rate_limit' === $code) { + return Exception\RateLimitException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param); + } + if ('idempotency_error' === $type) { + return Exception\IdempotencyException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); + } + + // no break + case 404: + return Exception\InvalidRequestException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param); + + case 401: + return Exception\AuthenticationException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); + + case 402: + return Exception\CardException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $declineCode, $param); + + case 403: + return Exception\PermissionException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); + + case 429: + return Exception\RateLimitException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param); + + default: + return Exception\UnknownApiErrorException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); + } + } + + /** + * @static + * + * @param bool|string $rbody + * @param int $rcode + * @param array $rheaders + * @param array $resp + * @param string $errorCode + * + * @return Exception\OAuth\OAuthErrorException + */ + private static function _specificOAuthError($rbody, $rcode, $rheaders, $resp, $errorCode) + { + $description = isset($resp['error_description']) ? $resp['error_description'] : $errorCode; + + switch ($errorCode) { + case 'invalid_client': + return Exception\OAuth\InvalidClientException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); + + case 'invalid_grant': + return Exception\OAuth\InvalidGrantException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); + + case 'invalid_request': + return Exception\OAuth\InvalidRequestException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); + + case 'invalid_scope': + return Exception\OAuth\InvalidScopeException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); + + case 'unsupported_grant_type': + return Exception\OAuth\UnsupportedGrantTypeException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); + + case 'unsupported_response_type': + return Exception\OAuth\UnsupportedResponseTypeException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); + + default: + return Exception\OAuth\UnknownOAuthErrorException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); + } + } + + /** + * @static + * + * @param null|array $appInfo + * + * @return null|string + */ + private static function _formatAppInfo($appInfo) + { + if (null !== $appInfo) { + $string = $appInfo['name']; + if (null !== $appInfo['version']) { + $string .= '/' . $appInfo['version']; + } + if (null !== $appInfo['url']) { + $string .= ' (' . $appInfo['url'] . ')'; + } + + return $string; + } + + return null; + } + + /** + * @static + * + * @param string $disabledFunctionsOutput - String value of the 'disable_function' setting, as output by \ini_get('disable_functions') + * @param string $functionName - Name of the function we are interesting in seeing whether or not it is disabled + * @param mixed $disableFunctionsOutput + * + * @return bool + */ + private static function _isDisabled($disableFunctionsOutput, $functionName) + { + $disabledFunctions = \explode(',', $disableFunctionsOutput); + foreach ($disabledFunctions as $disabledFunction) { + if (\trim($disabledFunction) === $functionName) { + return true; + } + } + + return false; + } + + /** + * @static + * + * @param string $apiKey + * @param null $clientInfo + * + * @return array + */ + private static function _defaultHeaders($apiKey, $clientInfo = null) + { + $uaString = 'Stripe/v1 PhpBindings/' . Stripe::VERSION; + + $langVersion = \PHP_VERSION; + $uname_disabled = static::_isDisabled(\ini_get('disable_functions'), 'php_uname'); + $uname = $uname_disabled ? '(disabled)' : \php_uname(); + + $appInfo = Stripe::getAppInfo(); + $ua = [ + 'bindings_version' => Stripe::VERSION, + 'lang' => 'php', + 'lang_version' => $langVersion, + 'publisher' => 'stripe', + 'uname' => $uname, + ]; + if ($clientInfo) { + $ua = \array_merge($clientInfo, $ua); + } + if (null !== $appInfo) { + $uaString .= ' ' . self::_formatAppInfo($appInfo); + $ua['application'] = $appInfo; + } + + return [ + 'X-Stripe-Client-User-Agent' => \json_encode($ua), + 'User-Agent' => $uaString, + 'Authorization' => 'Bearer ' . $apiKey, + ]; + } + + private function _prepareRequest($method, $url, $params, $headers) + { + $myApiKey = $this->_apiKey; + if (!$myApiKey) { + $myApiKey = Stripe::$apiKey; + } + + if (!$myApiKey) { + $msg = 'No API key provided. (HINT: set your API key using ' + . '"Stripe::setApiKey()". You can generate API keys from ' + . 'the Stripe web interface. See https://stripe.com/api for ' + . 'details, or email support@stripe.com if you have any questions.'; + + throw new Exception\AuthenticationException($msg); + } + + // Clients can supply arbitrary additional keys to be included in the + // X-Stripe-Client-User-Agent header via the optional getUserAgentInfo() + // method + $clientUAInfo = null; + if (\method_exists($this->httpClient(), 'getUserAgentInfo')) { + $clientUAInfo = $this->httpClient()->getUserAgentInfo(); + } + + if ($params && \is_array($params)) { + $optionKeysInParams = \array_filter( + static::$OPTIONS_KEYS, + function ($key) use ($params) { + return \array_key_exists($key, $params); + } + ); + if (\count($optionKeysInParams) > 0) { + $message = \sprintf('Options found in $params: %s. Options should ' + . 'be passed in their own array after $params. (HINT: pass an ' + . 'empty array to $params if you do not have any.)', \implode(', ', $optionKeysInParams)); + \trigger_error($message, \E_USER_WARNING); + } + } + + $absUrl = $this->_apiBase . $url; + $params = self::_encodeObjects($params); + $defaultHeaders = $this->_defaultHeaders($myApiKey, $clientUAInfo); + if (Stripe::$apiVersion) { + $defaultHeaders['Stripe-Version'] = Stripe::$apiVersion; + } + + if (Stripe::$accountId) { + $defaultHeaders['Stripe-Account'] = Stripe::$accountId; + } + + if (Stripe::$enableTelemetry && null !== self::$requestTelemetry) { + $defaultHeaders['X-Stripe-Client-Telemetry'] = self::_telemetryJson(self::$requestTelemetry); + } + + $hasFile = false; + foreach ($params as $k => $v) { + if (\is_resource($v)) { + $hasFile = true; + $params[$k] = self::_processResourceParam($v); + } elseif ($v instanceof \CURLFile) { + $hasFile = true; + } + } + + if ($hasFile) { + $defaultHeaders['Content-Type'] = 'multipart/form-data'; + } else { + $defaultHeaders['Content-Type'] = 'application/x-www-form-urlencoded'; + } + + $combinedHeaders = \array_merge($defaultHeaders, $headers); + $rawHeaders = []; + + foreach ($combinedHeaders as $header => $value) { + $rawHeaders[] = $header . ': ' . $value; + } + + return [$absUrl, $rawHeaders, $params, $hasFile, $myApiKey]; + } + + /** + * @param string $method + * @param string $url + * @param array $params + * @param array $headers + * + * @throws Exception\AuthenticationException + * @throws Exception\ApiConnectionException + * + * @return array + */ + private function _requestRaw($method, $url, $params, $headers) + { + list($absUrl, $rawHeaders, $params, $hasFile, $myApiKey) = $this->_prepareRequest($method, $url, $params, $headers); + + $requestStartMs = Util\Util::currentTimeMillis(); + + list($rbody, $rcode, $rheaders) = $this->httpClient()->request( + $method, + $absUrl, + $rawHeaders, + $params, + $hasFile + ); + + if (isset($rheaders['request-id']) + && \is_string($rheaders['request-id']) + && \strlen($rheaders['request-id']) > 0) { + self::$requestTelemetry = new RequestTelemetry( + $rheaders['request-id'], + Util\Util::currentTimeMillis() - $requestStartMs + ); + } + + return [$rbody, $rcode, $rheaders, $myApiKey]; + } + + /** + * @param string $method + * @param string $url + * @param array $params + * @param array $headers + * @param callable $readBodyChunk + * + * @throws Exception\AuthenticationException + * @throws Exception\ApiConnectionException + * + * @return array + */ + private function _requestRawStreaming($method, $url, $params, $headers, $readBodyChunk) + { + list($absUrl, $rawHeaders, $params, $hasFile, $myApiKey) = $this->_prepareRequest($method, $url, $params, $headers); + + $requestStartMs = Util\Util::currentTimeMillis(); + + list($rbody, $rcode, $rheaders) = $this->httpClient()->requestStream( + $method, + $absUrl, + $rawHeaders, + $params, + $hasFile, + $readBodyChunk + ); + + if (isset($rheaders['request-id']) + && \is_string($rheaders['request-id']) + && \strlen($rheaders['request-id']) > 0) { + self::$requestTelemetry = new RequestTelemetry( + $rheaders['request-id'], + Util\Util::currentTimeMillis() - $requestStartMs + ); + } + + return [$rbody, $rcode, $rheaders, $myApiKey]; + } + + /** + * @param resource $resource + * + * @throws Exception\InvalidArgumentException + * + * @return \CURLFile|string + */ + private function _processResourceParam($resource) + { + if ('stream' !== \get_resource_type($resource)) { + throw new Exception\InvalidArgumentException( + 'Attempted to upload a resource that is not a stream' + ); + } + + $metaData = \stream_get_meta_data($resource); + if ('plainfile' !== $metaData['wrapper_type']) { + throw new Exception\InvalidArgumentException( + 'Only plainfile resource streams are supported' + ); + } + + // We don't have the filename or mimetype, but the API doesn't care + return new \CURLFile($metaData['uri']); + } + + /** + * @param string $rbody + * @param int $rcode + * @param array $rheaders + * + * @throws Exception\UnexpectedValueException + * @throws Exception\ApiErrorException + * + * @return array + */ + private function _interpretResponse($rbody, $rcode, $rheaders) + { + $resp = \json_decode($rbody, true); + $jsonError = \json_last_error(); + if (null === $resp && \JSON_ERROR_NONE !== $jsonError) { + $msg = "Invalid response body from API: {$rbody} " + . "(HTTP response code was {$rcode}, json_last_error() was {$jsonError})"; + + throw new Exception\UnexpectedValueException($msg, $rcode); + } + + if ($rcode < 200 || $rcode >= 300) { + $this->handleErrorResponse($rbody, $rcode, $rheaders, $resp); + } + + return $resp; + } + + /** + * @static + * + * @param HttpClient\ClientInterface $client + */ + public static function setHttpClient($client) + { + self::$_httpClient = $client; + } + + /** + * @static + * + * Resets any stateful telemetry data + */ + public static function resetTelemetry() + { + self::$requestTelemetry = null; + } + + /** + * @return HttpClient\ClientInterface + */ + private function httpClient() + { + if (!self::$_httpClient) { + self::$_httpClient = HttpClient\CurlClient::instance(); + } + + return self::$_httpClient; + } +} diff --git a/vendor/stripe/stripe-php/lib/ApiResource.php b/vendor/stripe/stripe-php/lib/ApiResource.php new file mode 100644 index 0000000..521010b --- /dev/null +++ b/vendor/stripe/stripe-php/lib/ApiResource.php @@ -0,0 +1,120 @@ +{$k}; + if ((static::getSavedNestedResources()->includes($k)) + && ($v instanceof ApiResource)) { + $v->saveWithParent = true; + } + } + + /** + * @throws Exception\ApiErrorException + * + * @return ApiResource the refreshed resource + */ + public function refresh() + { + $requestor = new ApiRequestor($this->_opts->apiKey, static::baseUrl()); + $url = $this->instanceUrl(); + + list($response, $this->_opts->apiKey) = $requestor->request( + 'get', + $url, + $this->_retrieveOptions, + $this->_opts->headers + ); + $this->setLastResponse($response); + $this->refreshFrom($response->json, $this->_opts); + + return $this; + } + + /** + * @return string the base URL for the given class + */ + public static function baseUrl() + { + return Stripe::$apiBase; + } + + /** + * @return string the endpoint URL for the given class + */ + public static function classUrl() + { + // Replace dots with slashes for namespaced resources, e.g. if the object's name is + // "foo.bar", then its URL will be "/v1/foo/bars". + $base = \str_replace('.', '/', static::OBJECT_NAME); + + return "/v1/{$base}s"; + } + + /** + * @param null|string $id the ID of the resource + * + * @throws Exception\UnexpectedValueException if $id is null + * + * @return string the instance endpoint URL for the given class + */ + public static function resourceUrl($id) + { + if (null === $id) { + $class = static::class; + $message = 'Could not determine which URL to request: ' + . "{$class} instance has invalid ID: {$id}"; + + throw new Exception\UnexpectedValueException($message); + } + $id = Util\Util::utf8($id); + $base = static::classUrl(); + $extn = \urlencode($id); + + return "{$base}/{$extn}"; + } + + /** + * @return string the full API URL for this API resource + */ + public function instanceUrl() + { + return static::resourceUrl($this['id']); + } +} diff --git a/vendor/stripe/stripe-php/lib/ApiResponse.php b/vendor/stripe/stripe-php/lib/ApiResponse.php new file mode 100644 index 0000000..e7ee2e9 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/ApiResponse.php @@ -0,0 +1,45 @@ +body = $body; + $this->code = $code; + $this->headers = $headers; + $this->json = $json; + } +} diff --git a/vendor/stripe/stripe-php/lib/ApplePayDomain.php b/vendor/stripe/stripe-php/lib/ApplePayDomain.php new file mode 100644 index 0000000..5f9489d --- /dev/null +++ b/vendor/stripe/stripe-php/lib/ApplePayDomain.php @@ -0,0 +1,31 @@ +true if the object exists in live mode or the value false if the object exists in test mode. + */ +class ApplePayDomain extends ApiResource +{ + const OBJECT_NAME = 'apple_pay_domain'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + + /** + * @return string The class URL for this resource. It needs to be special + * cased because it doesn't fit into the standard resource pattern. + */ + public static function classUrl() + { + return '/v1/apple_pay/domains'; + } +} diff --git a/vendor/stripe/stripe-php/lib/ApplicationFee.php b/vendor/stripe/stripe-php/lib/ApplicationFee.php new file mode 100644 index 0000000..88aeed6 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/ApplicationFee.php @@ -0,0 +1,90 @@ +ISO currency code, in lowercase. Must be a supported currency. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string|\Stripe\Charge $originating_transaction ID of the corresponding charge on the platform account, if this fee was the result of a charge using the destination parameter. + * @property bool $refunded Whether the fee has been fully refunded. If the fee is only partially refunded, this attribute will still be false. + * @property \Stripe\Collection $refunds A list of refunds that have been applied to the fee. + */ +class ApplicationFee extends ApiResource +{ + const OBJECT_NAME = 'application_fee'; + + use ApiOperations\All; + use ApiOperations\NestedResource; + use ApiOperations\Retrieve; + + const PATH_REFUNDS = '/refunds'; + + /** + * @param string $id the ID of the application fee on which to retrieve the fee refunds + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of fee refunds + */ + public static function allRefunds($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_REFUNDS, $params, $opts); + } + + /** + * @param string $id the ID of the application fee on which to create the fee refund + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplicationFeeRefund + */ + public static function createRefund($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_REFUNDS, $params, $opts); + } + + /** + * @param string $id the ID of the application fee to which the fee refund belongs + * @param string $refundId the ID of the fee refund to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplicationFeeRefund + */ + public static function retrieveRefund($id, $refundId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_REFUNDS, $refundId, $params, $opts); + } + + /** + * @param string $id the ID of the application fee to which the fee refund belongs + * @param string $refundId the ID of the fee refund to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplicationFeeRefund + */ + public static function updateRefund($id, $refundId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_REFUNDS, $refundId, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/ApplicationFeeRefund.php b/vendor/stripe/stripe-php/lib/ApplicationFeeRefund.php new file mode 100644 index 0000000..dc7c34b --- /dev/null +++ b/vendor/stripe/stripe-php/lib/ApplicationFeeRefund.php @@ -0,0 +1,66 @@ +Application Fee Refund objects allow you to refund an application + * fee that has previously been created but not yet refunded. Funds will be + * refunded to the Stripe account from which the fee was originally collected. + * + * Related guide: Refunding + * Application Fees. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount, in %s. + * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string|\Stripe\ApplicationFee $fee ID of the application fee that was refunded. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ +class ApplicationFeeRefund extends ApiResource +{ + const OBJECT_NAME = 'fee_refund'; + + use ApiOperations\Update { + save as protected _save; + } + + /** + * @return string the API URL for this Stripe refund + */ + public function instanceUrl() + { + $id = $this['id']; + $fee = $this['fee']; + if (!$id) { + throw new Exception\UnexpectedValueException( + 'Could not determine which URL to request: ' . + "class instance has invalid ID: {$id}", + null + ); + } + $id = Util\Util::utf8($id); + $fee = Util\Util::utf8($fee); + + $base = ApplicationFee::classUrl(); + $feeExtn = \urlencode($fee); + $extn = \urlencode($id); + + return "{$base}/{$feeExtn}/refunds/{$extn}"; + } + + /** + * @param null|array|string $opts + * + * @return ApplicationFeeRefund the saved refund + */ + public function save($opts = null) + { + return $this->_save($opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Balance.php b/vendor/stripe/stripe-php/lib/Balance.php new file mode 100644 index 0000000..0fdc285 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Balance.php @@ -0,0 +1,45 @@ +transactions + * that contributed to the balance (charges, payouts, and so forth). + * + * The available and pending amounts for each currency are broken down further by + * payment source types. + * + * Related guide: Understanding Connect + * Account Balances. + * + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property \Stripe\StripeObject[] $available Funds that are available to be transferred or paid out, whether automatically by Stripe or explicitly via the Transfers API or Payouts API. The available balance for each currency and payment type can be found in the source_types property. + * @property \Stripe\StripeObject[] $connect_reserved Funds held due to negative balances on connected Custom accounts. The connect reserve balance for each currency and payment type can be found in the source_types property. + * @property \Stripe\StripeObject[] $instant_available Funds that can be paid out using Instant Payouts. + * @property \Stripe\StripeObject $issuing + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject[] $pending Funds that are not yet available in the balance, due to the 7-day rolling pay cycle. The pending balance for each currency, and for each payment type, can be found in the source_types property. + */ +class Balance extends SingletonApiResource +{ + const OBJECT_NAME = 'balance'; + + /** + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Balance + */ + public static function retrieve($opts = null) + { + return self::_singletonRetrieve($opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/BalanceTransaction.php b/vendor/stripe/stripe-php/lib/BalanceTransaction.php new file mode 100644 index 0000000..d7ddea4 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/BalanceTransaction.php @@ -0,0 +1,71 @@ +Balance + * Transaction Types. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Gross amount of the transaction, in %s. + * @property int $available_on The date the transaction's net funds will become available in the Stripe balance. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|float $exchange_rate The exchange rate used, if applicable, for this transaction. Specifically, if money was converted from currency A to currency B, then the amount in currency A, times exchange_rate, would be the amount in currency B. For example, suppose you charged a customer 10.00 EUR. Then the PaymentIntent's amount would be 1000 and currency would be eur. Suppose this was converted into 12.34 USD in your Stripe account. Then the BalanceTransaction's amount would be 1234, currency would be usd, and exchange_rate would be 1.234. + * @property int $fee Fees (in %s) paid for this transaction. + * @property \Stripe\StripeObject[] $fee_details Detailed breakdown of fees (in %s) paid for this transaction. + * @property int $net Net amount of the transaction, in %s. + * @property string $reporting_category Learn more about how reporting categories can help you understand balance transactions from an accounting perspective. + * @property null|string|\Stripe\StripeObject $source The Stripe object to which this transaction is related. + * @property string $status If the transaction's net funds are available in the Stripe balance yet. Either available or pending. + * @property string $type Transaction type: adjustment, advance, advance_funding, anticipation_repayment, application_fee, application_fee_refund, charge, connect_collection_transfer, contribution, issuing_authorization_hold, issuing_authorization_release, issuing_dispute, issuing_transaction, payment, payment_failure_refund, payment_refund, payout, payout_cancel, payout_failure, refund, refund_failure, reserve_transaction, reserved_funds, stripe_fee, stripe_fx_fee, tax_fee, topup, topup_reversal, transfer, transfer_cancel, transfer_failure, or transfer_refund. Learn more about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider reporting_category instead. + */ +class BalanceTransaction extends ApiResource +{ + const OBJECT_NAME = 'balance_transaction'; + + use ApiOperations\All; + use ApiOperations\Retrieve; + + const TYPE_ADJUSTMENT = 'adjustment'; + const TYPE_ADVANCE = 'advance'; + const TYPE_ADVANCE_FUNDING = 'advance_funding'; + const TYPE_ANTICIPATION_REPAYMENT = 'anticipation_repayment'; + const TYPE_APPLICATION_FEE = 'application_fee'; + const TYPE_APPLICATION_FEE_REFUND = 'application_fee_refund'; + const TYPE_CHARGE = 'charge'; + const TYPE_CONNECT_COLLECTION_TRANSFER = 'connect_collection_transfer'; + const TYPE_CONTRIBUTION = 'contribution'; + const TYPE_ISSUING_AUTHORIZATION_HOLD = 'issuing_authorization_hold'; + const TYPE_ISSUING_AUTHORIZATION_RELEASE = 'issuing_authorization_release'; + const TYPE_ISSUING_DISPUTE = 'issuing_dispute'; + const TYPE_ISSUING_TRANSACTION = 'issuing_transaction'; + const TYPE_PAYMENT = 'payment'; + const TYPE_PAYMENT_FAILURE_REFUND = 'payment_failure_refund'; + const TYPE_PAYMENT_REFUND = 'payment_refund'; + const TYPE_PAYOUT = 'payout'; + const TYPE_PAYOUT_CANCEL = 'payout_cancel'; + const TYPE_PAYOUT_FAILURE = 'payout_failure'; + const TYPE_REFUND = 'refund'; + const TYPE_REFUND_FAILURE = 'refund_failure'; + const TYPE_RESERVE_TRANSACTION = 'reserve_transaction'; + const TYPE_RESERVED_FUNDS = 'reserved_funds'; + const TYPE_STRIPE_FEE = 'stripe_fee'; + const TYPE_STRIPE_FX_FEE = 'stripe_fx_fee'; + const TYPE_TAX_FEE = 'tax_fee'; + const TYPE_TOPUP = 'topup'; + const TYPE_TOPUP_REVERSAL = 'topup_reversal'; + const TYPE_TRANSFER = 'transfer'; + const TYPE_TRANSFER_CANCEL = 'transfer_cancel'; + const TYPE_TRANSFER_FAILURE = 'transfer_failure'; + const TYPE_TRANSFER_REFUND = 'transfer_refund'; +} diff --git a/vendor/stripe/stripe-php/lib/BankAccount.php b/vendor/stripe/stripe-php/lib/BankAccount.php new file mode 100644 index 0000000..40eca41 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/BankAccount.php @@ -0,0 +1,132 @@ +Customer objects. + * + * On the other hand External Accounts are + * transfer destinations on Account objects for Custom accounts. They + * can be bank accounts or debit cards as well, and are documented in the links + * above. + * + * Related guide: Bank Debits and + * Transfers. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|string|\Stripe\Account $account The ID of the account that the bank account is associated with. + * @property null|string $account_holder_name The name of the person or business that owns the bank account. + * @property null|string $account_holder_type The type of entity that holds the account. This can be either individual or company. + * @property null|string[] $available_payout_methods A set of available payout methods for this bank account. Only values from this set should be passed as the method when creating a payout. + * @property null|string $bank_name Name of the bank associated with the routing number (e.g., WELLS FARGO). + * @property string $country Two-letter ISO code representing the country the bank account is located in. + * @property string $currency Three-letter ISO code for the currency paid out to the bank account. + * @property null|string|\Stripe\Customer $customer The ID of the customer that the bank account is associated with. + * @property null|bool $default_for_currency Whether this bank account is the default external account for its currency. + * @property null|string $fingerprint Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + * @property string $last4 The last four digits of the bank account number. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $routing_number The routing transit number for the bank account. + * @property string $status

For bank accounts, possible values are new, validated, verified, verification_failed, or errored. A bank account that hasn't had any activity or validation performed is new. If Stripe can determine that the bank account exists, its status will be validated. Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be verified. If the verification failed for any reason, such as microdeposit failure, the status will be verification_failed. If a transfer sent to this bank account fails, we'll set the status to errored and will not continue to send transfers until the bank details are updated.

For external accounts, possible values are new and errored. Validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply. If a transfer fails, the status is set to errored and transfers are stopped until account details are updated.

+ */ +class BankAccount extends ApiResource +{ + const OBJECT_NAME = 'bank_account'; + + use ApiOperations\Delete; + use ApiOperations\Update; + + /** + * Possible string representations of the bank verification status. + * + * @see https://stripe.com/docs/api/external_account_bank_accounts/object#account_bank_account_object-status + */ + const STATUS_NEW = 'new'; + const STATUS_VALIDATED = 'validated'; + const STATUS_VERIFIED = 'verified'; + const STATUS_VERIFICATION_FAILED = 'verification_failed'; + const STATUS_ERRORED = 'errored'; + + /** + * @return string The instance URL for this resource. It needs to be special + * cased because it doesn't fit into the standard resource pattern. + */ + public function instanceUrl() + { + if ($this['customer']) { + $base = Customer::classUrl(); + $parent = $this['customer']; + $path = 'sources'; + } elseif ($this['account']) { + $base = Account::classUrl(); + $parent = $this['account']; + $path = 'external_accounts'; + } else { + $msg = 'Bank accounts cannot be accessed without a customer ID or account ID.'; + + throw new Exception\UnexpectedValueException($msg, null); + } + $parentExtn = \urlencode(Util\Util::utf8($parent)); + $extn = \urlencode(Util\Util::utf8($this['id'])); + + return "{$base}/{$parentExtn}/{$path}/{$extn}"; + } + + /** + * @param array|string $_id + * @param null|array|string $_opts + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function retrieve($_id, $_opts = null) + { + $msg = 'Bank accounts cannot be retrieved without a customer ID or ' . + 'an account ID. Retrieve a bank account using ' . + "`Customer::retrieveSource('customer_id', " . + "'bank_account_id')` or `Account::retrieveExternalAccount(" . + "'account_id', 'bank_account_id')`."; + + throw new Exception\BadMethodCallException($msg); + } + + /** + * @param string $_id + * @param null|array $_params + * @param null|array|string $_options + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function update($_id, $_params = null, $_options = null) + { + $msg = 'Bank accounts cannot be updated without a customer ID or an ' . + 'account ID. Update a bank account using ' . + "`Customer::updateSource('customer_id', 'bank_account_id', " . + '$updateParams)` or `Account::updateExternalAccount(' . + "'account_id', 'bank_account_id', \$updateParams)`."; + + throw new Exception\BadMethodCallException($msg); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return BankAccount the verified bank account + */ + public function verify($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/verify'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/BaseStripeClient.php b/vendor/stripe/stripe-php/lib/BaseStripeClient.php new file mode 100644 index 0000000..5499fe3 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/BaseStripeClient.php @@ -0,0 +1,269 @@ + */ + private $config; + + /** @var \Stripe\Util\RequestOptions */ + private $defaultOpts; + + /** + * Initializes a new instance of the {@link BaseStripeClient} class. + * + * The constructor takes a single argument. The argument can be a string, in which case it + * should be the API key. It can also be an array with various configuration settings. + * + * Configuration settings include the following options: + * + * - api_key (null|string): the Stripe API key, to be used in regular API requests. + * - client_id (null|string): the Stripe client ID, to be used in OAuth requests. + * - stripe_account (null|string): a Stripe account ID. If set, all requests sent by the client + * will automatically use the {@code Stripe-Account} header with that account ID. + * - stripe_version (null|string): a Stripe API verion. If set, all requests sent by the client + * will include the {@code Stripe-Version} header with that API version. + * + * The following configuration settings are also available, though setting these should rarely be necessary + * (only useful if you want to send requests to a mock server like stripe-mock): + * + * - api_base (string): the base URL for regular API requests. Defaults to + * {@link DEFAULT_API_BASE}. + * - connect_base (string): the base URL for OAuth requests. Defaults to + * {@link DEFAULT_CONNECT_BASE}. + * - files_base (string): the base URL for file creation requests. Defaults to + * {@link DEFAULT_FILES_BASE}. + * + * @param array|string $config the API key as a string, or an array containing + * the client configuration settings + */ + public function __construct($config = []) + { + if (\is_string($config)) { + $config = ['api_key' => $config]; + } elseif (!\is_array($config)) { + throw new \Stripe\Exception\InvalidArgumentException('$config must be a string or an array'); + } + + $config = \array_merge($this->getDefaultConfig(), $config); + $this->validateConfig($config); + + $this->config = $config; + + $this->defaultOpts = \Stripe\Util\RequestOptions::parse([ + 'stripe_account' => $config['stripe_account'], + 'stripe_version' => $config['stripe_version'], + ]); + } + + /** + * Gets the API key used by the client to send requests. + * + * @return null|string the API key used by the client to send requests + */ + public function getApiKey() + { + return $this->config['api_key']; + } + + /** + * Gets the client ID used by the client in OAuth requests. + * + * @return null|string the client ID used by the client in OAuth requests + */ + public function getClientId() + { + return $this->config['client_id']; + } + + /** + * Gets the base URL for Stripe's API. + * + * @return string the base URL for Stripe's API + */ + public function getApiBase() + { + return $this->config['api_base']; + } + + /** + * Gets the base URL for Stripe's OAuth API. + * + * @return string the base URL for Stripe's OAuth API + */ + public function getConnectBase() + { + return $this->config['connect_base']; + } + + /** + * Gets the base URL for Stripe's Files API. + * + * @return string the base URL for Stripe's Files API + */ + public function getFilesBase() + { + return $this->config['files_base']; + } + + /** + * Sends a request to Stripe's API. + * + * @param string $method the HTTP method + * @param string $path the path of the request + * @param array $params the parameters of the request + * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request + * + * @return \Stripe\StripeObject the object returned by Stripe's API + */ + public function request($method, $path, $params, $opts) + { + $opts = $this->defaultOpts->merge($opts, true); + $baseUrl = $opts->apiBase ?: $this->getApiBase(); + $requestor = new \Stripe\ApiRequestor($this->apiKeyForRequest($opts), $baseUrl); + list($response, $opts->apiKey) = $requestor->request($method, $path, $params, $opts->headers); + $opts->discardNonPersistentHeaders(); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * Sends a request to Stripe's API. + * + * @param string $method the HTTP method + * @param string $path the path of the request + * @param array $params the parameters of the request + * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request + * + * @return \Stripe\Collection of ApiResources + */ + public function requestCollection($method, $path, $params, $opts) + { + $obj = $this->request($method, $path, $params, $opts); + if (!($obj instanceof \Stripe\Collection)) { + $received_class = \get_class($obj); + $msg = "Expected to receive `Stripe\\Collection` object from Stripe API. Instead received `{$received_class}`."; + + throw new \Stripe\Exception\UnexpectedValueException($msg); + } + $obj->setFilters($params); + + return $obj; + } + + /** + * @param \Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\AuthenticationException + * + * @return string + */ + private function apiKeyForRequest($opts) + { + $apiKey = $opts->apiKey ?: $this->getApiKey(); + + if (null === $apiKey) { + $msg = 'No API key provided. Set your API key when constructing the ' + . 'StripeClient instance, or provide it on a per-request basis ' + . 'using the `api_key` key in the $opts argument.'; + + throw new \Stripe\Exception\AuthenticationException($msg); + } + + return $apiKey; + } + + /** + * TODO: replace this with a private constant when we drop support for PHP < 5. + * + * @return array + */ + private function getDefaultConfig() + { + return [ + 'api_key' => null, + 'client_id' => null, + 'stripe_account' => null, + 'stripe_version' => null, + 'api_base' => self::DEFAULT_API_BASE, + 'connect_base' => self::DEFAULT_CONNECT_BASE, + 'files_base' => self::DEFAULT_FILES_BASE, + ]; + } + + /** + * @param array $config + * + * @throws \Stripe\Exception\InvalidArgumentException + */ + private function validateConfig($config) + { + // api_key + if (null !== $config['api_key'] && !\is_string($config['api_key'])) { + throw new \Stripe\Exception\InvalidArgumentException('api_key must be null or a string'); + } + + if (null !== $config['api_key'] && ('' === $config['api_key'])) { + $msg = 'api_key cannot be the empty string'; + + throw new \Stripe\Exception\InvalidArgumentException($msg); + } + + if (null !== $config['api_key'] && (\preg_match('/\s/', $config['api_key']))) { + $msg = 'api_key cannot contain whitespace'; + + throw new \Stripe\Exception\InvalidArgumentException($msg); + } + + // client_id + if (null !== $config['client_id'] && !\is_string($config['client_id'])) { + throw new \Stripe\Exception\InvalidArgumentException('client_id must be null or a string'); + } + + // stripe_account + if (null !== $config['stripe_account'] && !\is_string($config['stripe_account'])) { + throw new \Stripe\Exception\InvalidArgumentException('stripe_account must be null or a string'); + } + + // stripe_version + if (null !== $config['stripe_version'] && !\is_string($config['stripe_version'])) { + throw new \Stripe\Exception\InvalidArgumentException('stripe_version must be null or a string'); + } + + // api_base + if (!\is_string($config['api_base'])) { + throw new \Stripe\Exception\InvalidArgumentException('api_base must be a string'); + } + + // connect_base + if (!\is_string($config['connect_base'])) { + throw new \Stripe\Exception\InvalidArgumentException('connect_base must be a string'); + } + + // files_base + if (!\is_string($config['files_base'])) { + throw new \Stripe\Exception\InvalidArgumentException('files_base must be a string'); + } + + // check absence of extra keys + $extraConfigKeys = \array_diff(\array_keys($config), \array_keys($this->getDefaultConfig())); + if (!empty($extraConfigKeys)) { + // Wrap in single quote to more easily catch trailing spaces errors + $invalidKeys = "'" . \implode("', '", $extraConfigKeys) . "'"; + + throw new \Stripe\Exception\InvalidArgumentException('Found unknown key(s) in configuration array: ' . $invalidKeys); + } + } +} diff --git a/vendor/stripe/stripe-php/lib/BillingPortal/Configuration.php b/vendor/stripe/stripe-php/lib/BillingPortal/Configuration.php new file mode 100644 index 0000000..7ad1a03 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/BillingPortal/Configuration.php @@ -0,0 +1,31 @@ +overriden when creating the session. + * @property \Stripe\StripeObject $features + * @property bool $is_default Whether the configuration is the default. If true, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. + */ +class Configuration extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'billing_portal.configuration'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/BillingPortal/Session.php b/vendor/stripe/stripe-php/lib/BillingPortal/Session.php new file mode 100644 index 0000000..ea11d51 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/BillingPortal/Session.php @@ -0,0 +1,42 @@ +product + * overview and integration + * guide. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string|\Stripe\BillingPortal\Configuration $configuration The configuration used by this session, describing the features available. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $customer The ID of the customer for this session. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string $on_behalf_of The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this on_behalf_of account appear in the portal. For more information, see the docs. Use the Accounts API to modify the on_behalf_of account's branding settings, which the portal displays. + * @property string $return_url The URL to redirect customers to when they click on the portal's link to return to your website. + * @property string $url The short-lived URL of the session that gives customers access to the customer portal. + */ +class Session extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'billing_portal.session'; + + use \Stripe\ApiOperations\Create; +} diff --git a/vendor/stripe/stripe-php/lib/BitcoinReceiver.php b/vendor/stripe/stripe-php/lib/BitcoinReceiver.php new file mode 100644 index 0000000..208610a --- /dev/null +++ b/vendor/stripe/stripe-php/lib/BitcoinReceiver.php @@ -0,0 +1,71 @@ +currency that you are collecting as payment. + * @property int $amount_received The amount of currency to which bitcoin_amount_received has been converted. + * @property int $bitcoin_amount The amount of bitcoin that the customer should send to fill the receiver. The bitcoin_amount is denominated in Satoshi: there are 10^8 Satoshi in one bitcoin. + * @property int $bitcoin_amount_received The amount of bitcoin that has been sent by the customer to this receiver. + * @property string $bitcoin_uri This URI can be displayed to the customer as a clickable link (to activate their bitcoin client) or as a QR code (for mobile wallets). + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO code for the currency to which the bitcoin will be converted. + * @property null|string $customer The customer ID of the bitcoin receiver. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string $email The customer's email address, set by the API call that creates the receiver. + * @property bool $filled This flag is initially false and updates to true when the customer sends the bitcoin_amount to this receiver. + * @property string $inbound_address A bitcoin address that is specific to this receiver. The customer can send bitcoin to this address to fill the receiver. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $payment The ID of the payment created from the receiver, if any. Hidden when viewing the receiver with a publishable key. + * @property null|string $refund_address The refund address of this bitcoin receiver. + * @property \Stripe\Collection $transactions A list with one entry for each time that the customer sent bitcoin to the receiver. Hidden when viewing the receiver with a publishable key. + * @property bool $uncaptured_funds This receiver contains uncaptured funds that can be used for a payment or refunded. + * @property null|bool $used_for_payment Indicate if this source is used for payment. + */ +class BitcoinReceiver extends ApiResource +{ + const OBJECT_NAME = 'bitcoin_receiver'; + + use ApiOperations\All; + use ApiOperations\Retrieve; + + /** + * @return string The class URL for this resource. It needs to be special + * cased because it doesn't fit into the standard resource pattern. + */ + public static function classUrl() + { + return '/v1/bitcoin/receivers'; + } + + /** + * @return string The instance URL for this resource. It needs to be special + * cased because it doesn't fit into the standard resource pattern. + */ + public function instanceUrl() + { + if ($this['customer']) { + $base = Customer::classUrl(); + $parent = $this['customer']; + $path = 'sources'; + $parentExtn = \urlencode(Util\Util::utf8($parent)); + $extn = \urlencode(Util\Util::utf8($this['id'])); + + return "{$base}/{$parentExtn}/{$path}/{$extn}"; + } + + $base = BitcoinReceiver::classUrl(); + $extn = \urlencode(Util\Util::utf8($this['id'])); + + return "{$base}/{$extn}"; + } +} diff --git a/vendor/stripe/stripe-php/lib/BitcoinTransaction.php b/vendor/stripe/stripe-php/lib/BitcoinTransaction.php new file mode 100644 index 0000000..3aa7118 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/BitcoinTransaction.php @@ -0,0 +1,19 @@ +currency that the transaction was converted to in real-time. + * @property int $bitcoin_amount The amount of bitcoin contained in the transaction. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO code for the currency to which this transaction was converted. + * @property string $receiver The receiver to which this transaction was sent. + */ +class BitcoinTransaction extends ApiResource +{ + const OBJECT_NAME = 'bitcoin_transaction'; +} diff --git a/vendor/stripe/stripe-php/lib/Capability.php b/vendor/stripe/stripe-php/lib/Capability.php new file mode 100644 index 0000000..3580df6 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Capability.php @@ -0,0 +1,87 @@ +Account + * capabilities. + * + * @property string $id The identifier for the capability. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string|\Stripe\Account $account The account for which the capability enables functionality. + * @property bool $requested Whether the capability has been requested. + * @property null|int $requested_at Time at which the capability was requested. Measured in seconds since the Unix epoch. + * @property \Stripe\StripeObject $requirements + * @property string $status The status of the capability. Can be active, inactive, pending, or unrequested. + */ +class Capability extends ApiResource +{ + const OBJECT_NAME = 'capability'; + + use ApiOperations\Update; + + const STATUS_ACTIVE = 'active'; + const STATUS_INACTIVE = 'inactive'; + const STATUS_PENDING = 'pending'; + const STATUS_UNREQUESTED = 'unrequested'; + + /** + * @return string the API URL for this Stripe account reversal + */ + public function instanceUrl() + { + $id = $this['id']; + $account = $this['account']; + if (!$id) { + throw new Exception\UnexpectedValueException( + 'Could not determine which URL to request: ' . + "class instance has invalid ID: {$id}", + null + ); + } + $id = Util\Util::utf8($id); + $account = Util\Util::utf8($account); + + $base = Account::classUrl(); + $accountExtn = \urlencode($account); + $extn = \urlencode($id); + + return "{$base}/{$accountExtn}/capabilities/{$extn}"; + } + + /** + * @param array|string $_id + * @param null|array|string $_opts + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function retrieve($_id, $_opts = null) + { + $msg = 'Capabilities cannot be retrieved without an account ID. ' . + 'Retrieve a capability using `Account::retrieveCapability(' . + "'account_id', 'capability_id')`."; + + throw new Exception\BadMethodCallException($msg); + } + + /** + * @param string $_id + * @param null|array $_params + * @param null|array|string $_options + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function update($_id, $_params = null, $_options = null) + { + $msg = 'Capabilities cannot be updated without an account ID. ' . + 'Update a capability using `Account::updateCapability(' . + "'account_id', 'capability_id', \$updateParams)`."; + + throw new Exception\BadMethodCallException($msg); + } +} diff --git a/vendor/stripe/stripe-php/lib/Card.php b/vendor/stripe/stripe-php/lib/Card.php new file mode 100644 index 0000000..7f757d6 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Card.php @@ -0,0 +1,142 @@ +Card Payments + * with Sources. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|string|\Stripe\Account $account The account this card belongs to. This attribute will not be in the card object if the card belongs to a customer or recipient instead. + * @property null|string $address_city City/District/Suburb/Town/Village. + * @property null|string $address_country Billing address country, if provided when creating card. + * @property null|string $address_line1 Address line 1 (Street address/PO Box/Company name). + * @property null|string $address_line1_check If address_line1 was provided, results of the check: pass, fail, unavailable, or unchecked. + * @property null|string $address_line2 Address line 2 (Apartment/Suite/Unit/Building). + * @property null|string $address_state State/County/Province/Region. + * @property null|string $address_zip ZIP or postal code. + * @property null|string $address_zip_check If address_zip was provided, results of the check: pass, fail, unavailable, or unchecked. + * @property null|string[] $available_payout_methods A set of available payout methods for this card. Only values from this set should be passed as the method when creating a payout. + * @property string $brand Card brand. Can be American Express, Diners Club, Discover, JCB, MasterCard, UnionPay, Visa, or Unknown. + * @property null|string $country Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + * @property null|string $currency Three-letter ISO code for currency. Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. + * @property null|string|\Stripe\Customer $customer The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead. + * @property null|string $cvc_check If a CVC was provided, results of the check: pass, fail, unavailable, or unchecked. A result of unchecked indicates that CVC was provided but hasn't been checked yet. Checks are typically performed when attaching a card to a Customer object, or when creating a charge. For more details, see Check if a card is valid without a charge. + * @property null|bool $default_for_currency Whether this card is the default external account for its currency. + * @property null|string $dynamic_last4 (For tokenized numbers only.) The last four digits of the device account number. + * @property int $exp_month Two-digit number representing the card's expiration month. + * @property int $exp_year Four-digit number representing the card's expiration year. + * @property null|string $fingerprint

Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.

Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.

+ * @property string $funding Card funding type. Can be credit, debit, prepaid, or unknown. + * @property string $last4 The last four digits of the card. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $name Cardholder name. + * @property null|string|\Stripe\Recipient $recipient The recipient that this card belongs to. This attribute will not be in the card object if the card belongs to a customer or account instead. + * @property null|string $tokenization_method If the card number is tokenized, this is the method that was used. Can be android_pay (includes Google Pay), apple_pay, masterpass, visa_checkout, or null. + */ +class Card extends ApiResource +{ + const OBJECT_NAME = 'card'; + + use ApiOperations\Delete; + use ApiOperations\Update; + + /** + * Possible string representations of the CVC check status. + * + * @see https://stripe.com/docs/api/cards/object#card_object-cvc_check + */ + const CVC_CHECK_FAIL = 'fail'; + const CVC_CHECK_PASS = 'pass'; + const CVC_CHECK_UNAVAILABLE = 'unavailable'; + const CVC_CHECK_UNCHECKED = 'unchecked'; + + /** + * Possible string representations of the funding of the card. + * + * @see https://stripe.com/docs/api/cards/object#card_object-funding + */ + const FUNDING_CREDIT = 'credit'; + const FUNDING_DEBIT = 'debit'; + const FUNDING_PREPAID = 'prepaid'; + const FUNDING_UNKNOWN = 'unknown'; + + /** + * Possible string representations of the tokenization method when using Apple Pay or Google Pay. + * + * @see https://stripe.com/docs/api/cards/object#card_object-tokenization_method + */ + const TOKENIZATION_METHOD_APPLE_PAY = 'apple_pay'; + const TOKENIZATION_METHOD_GOOGLE_PAY = 'google_pay'; + + /** + * @return string The instance URL for this resource. It needs to be special + * cased because cards are nested resources that may belong to different + * top-level resources. + */ + public function instanceUrl() + { + if ($this['customer']) { + $base = Customer::classUrl(); + $parent = $this['customer']; + $path = 'sources'; + } elseif ($this['account']) { + $base = Account::classUrl(); + $parent = $this['account']; + $path = 'external_accounts'; + } elseif ($this['recipient']) { + $base = Recipient::classUrl(); + $parent = $this['recipient']; + $path = 'cards'; + } else { + $msg = 'Cards cannot be accessed without a customer ID, account ID or recipient ID.'; + + throw new Exception\UnexpectedValueException($msg); + } + $parentExtn = \urlencode(Util\Util::utf8($parent)); + $extn = \urlencode(Util\Util::utf8($this['id'])); + + return "{$base}/{$parentExtn}/{$path}/{$extn}"; + } + + /** + * @param array|string $_id + * @param null|array|string $_opts + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function retrieve($_id, $_opts = null) + { + $msg = 'Cards cannot be retrieved without a customer ID or an ' . + 'account ID. Retrieve a card using ' . + "`Customer::retrieveSource('customer_id', 'card_id')` or " . + "`Account::retrieveExternalAccount('account_id', 'card_id')`."; + + throw new Exception\BadMethodCallException($msg); + } + + /** + * @param string $_id + * @param null|array $_params + * @param null|array|string $_options + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function update($_id, $_params = null, $_options = null) + { + $msg = 'Cards cannot be updated without a customer ID or an ' . + 'account ID. Update a card using ' . + "`Customer::updateSource('customer_id', 'card_id', " . + '$updateParams)` or `Account::updateExternalAccount(' . + "'account_id', 'card_id', \$updateParams)`."; + + throw new Exception\BadMethodCallException($msg); + } +} diff --git a/vendor/stripe/stripe-php/lib/Charge.php b/vendor/stripe/stripe-php/lib/Charge.php new file mode 100644 index 0000000..b9fc301 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Charge.php @@ -0,0 +1,146 @@ +Charge object. You + * can retrieve and refund individual charges as well as list all charges. Charges + * are identified by a unique, random ID. + * + * Related guide: Accept a + * payment with the Charges API. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + * @property int $amount_captured Amount in %s captured (can be less than the amount attribute on the charge if a partial capture was made). + * @property int $amount_refunded Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund was issued). + * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the charge. + * @property null|string|\Stripe\ApplicationFee $application_fee The application fee (if any) for the charge. See the Connect documentation for details. + * @property null|int $application_fee_amount The amount of the application fee (if any) requested for the charge. See the Connect documentation for details. + * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes). + * @property \Stripe\StripeObject $billing_details + * @property null|string $calculated_statement_descriptor The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. + * @property bool $captured If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string|\Stripe\Customer $customer ID of the customer this charge is for if one exists. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string|\Stripe\Account $destination ID of an existing, connected Stripe account to transfer funds to if transfer_data was specified in the charge request. + * @property null|string|\Stripe\Dispute $dispute Details about the dispute if the charge has been disputed. + * @property bool $disputed Whether the charge has been disputed. + * @property null|string $failure_code Error code explaining reason for charge failure if available (see the errors section for a list of codes). + * @property null|string $failure_message Message to user further explaining reason for charge failure if available. + * @property null|\Stripe\StripeObject $fraud_details Information on fraud assessments for the charge. + * @property null|string|\Stripe\Invoice $invoice ID of the invoice this charge is for if one exists. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string|\Stripe\Account $on_behalf_of The account (if any) the charge was made on behalf of without triggering an automatic transfer. See the Connect documentation for details. + * @property null|string|\Stripe\Order $order ID of the order this charge is for if one exists. + * @property null|\Stripe\StripeObject $outcome Details about whether the payment was accepted, and why. See understanding declines for details. + * @property bool $paid true if the charge succeeded, or was successfully authorized for later capture. + * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent associated with this charge, if one exists. + * @property null|string $payment_method ID of the payment method used in this charge. + * @property null|\Stripe\StripeObject $payment_method_details Details about the payment method at the time of the transaction. + * @property null|string $receipt_email This is the email address that the receipt for this charge was sent to. + * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this charge. This attribute will be null until a receipt has been sent. + * @property null|string $receipt_url This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt. + * @property bool $refunded Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false. + * @property \Stripe\Collection $refunds A list of refunds that have been applied to the charge. + * @property null|string|\Stripe\Review $review ID of the review associated with this charge if one exists. + * @property null|\Stripe\StripeObject $shipping Shipping information for the charge. + * @property null|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $source This is a legacy field that will be removed in the future. It contains the Source, Card, or BankAccount object used for the charge. For details about the payment method used for this charge, refer to payment_method or payment_method_details instead. + * @property null|string|\Stripe\Transfer $source_transfer The transfer ID which created this charge. Only present if the charge came from another Stripe account. See the Connect documentation for details. + * @property null|string $statement_descriptor For card charges, use statement_descriptor_suffix instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters. + * @property null|string $statement_descriptor_suffix Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + * @property string $status The status of the payment is either succeeded, pending, or failed. + * @property string|\Stripe\Transfer $transfer ID of the transfer to the destination account (only applicable if the charge was created using the destination parameter). + * @property null|\Stripe\StripeObject $transfer_data An optional dictionary including the account to automatically transfer to as part of a destination charge. See the Connect documentation for details. + * @property null|string $transfer_group A string that identifies this transaction as part of a group. See the Connect documentation for details. + */ +class Charge extends ApiResource +{ + const OBJECT_NAME = 'charge'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const STATUS_FAILED = 'failed'; + const STATUS_PENDING = 'pending'; + const STATUS_SUCCEEDED = 'succeeded'; + + /** + * Possible string representations of decline codes. + * These strings are applicable to the decline_code property of the \Stripe\Exception\CardException exception. + * + * @see https://stripe.com/docs/declines/codes + */ + const DECLINED_AUTHENTICATION_REQUIRED = 'authentication_required'; + const DECLINED_APPROVE_WITH_ID = 'approve_with_id'; + const DECLINED_CALL_ISSUER = 'call_issuer'; + const DECLINED_CARD_NOT_SUPPORTED = 'card_not_supported'; + const DECLINED_CARD_VELOCITY_EXCEEDED = 'card_velocity_exceeded'; + const DECLINED_CURRENCY_NOT_SUPPORTED = 'currency_not_supported'; + const DECLINED_DO_NOT_HONOR = 'do_not_honor'; + const DECLINED_DO_NOT_TRY_AGAIN = 'do_not_try_again'; + const DECLINED_DUPLICATED_TRANSACTION = 'duplicate_transaction'; + const DECLINED_EXPIRED_CARD = 'expired_card'; + const DECLINED_FRAUDULENT = 'fraudulent'; + const DECLINED_GENERIC_DECLINE = 'generic_decline'; + const DECLINED_INCORRECT_NUMBER = 'incorrect_number'; + const DECLINED_INCORRECT_CVC = 'incorrect_cvc'; + const DECLINED_INCORRECT_PIN = 'incorrect_pin'; + const DECLINED_INCORRECT_ZIP = 'incorrect_zip'; + const DECLINED_INSUFFICIENT_FUNDS = 'insufficient_funds'; + const DECLINED_INVALID_ACCOUNT = 'invalid_account'; + const DECLINED_INVALID_AMOUNT = 'invalid_amount'; + const DECLINED_INVALID_CVC = 'invalid_cvc'; + const DECLINED_INVALID_EXPIRY_YEAR = 'invalid_expiry_year'; + const DECLINED_INVALID_NUMBER = 'invalid_number'; + const DECLINED_INVALID_PIN = 'invalid_pin'; + const DECLINED_ISSUER_NOT_AVAILABLE = 'issuer_not_available'; + const DECLINED_LOST_CARD = 'lost_card'; + const DECLINED_MERCHANT_BLACKLIST = 'merchant_blacklist'; + const DECLINED_NEW_ACCOUNT_INFORMATION_AVAILABLE = 'new_account_information_available'; + const DECLINED_NO_ACTION_TAKEN = 'no_action_taken'; + const DECLINED_NOT_PERMITTED = 'not_permitted'; + const DECLINED_OFFLINE_PIN_REQUIRED = 'offline_pin_required'; + const DECLINED_ONLINE_OR_OFFLINE_PIN_REQUIRED = 'online_or_offline_pin_required'; + const DECLINED_PICKUP_CARD = 'pickup_card'; + const DECLINED_PIN_TRY_EXCEEDED = 'pin_try_exceeded'; + const DECLINED_PROCESSING_ERROR = 'processing_error'; + const DECLINED_REENTER_TRANSACTION = 'reenter_transaction'; + const DECLINED_RESTRICTED_CARD = 'restricted_card'; + const DECLINED_REVOCATION_OF_ALL_AUTHORIZATIONS = 'revocation_of_all_authorizations'; + const DECLINED_REVOCATION_OF_AUTHORIZATION = 'revocation_of_authorization'; + const DECLINED_SECURITY_VIOLATION = 'security_violation'; + const DECLINED_SERVICE_NOT_ALLOWED = 'service_not_allowed'; + const DECLINED_STOLEN_CARD = 'stolen_card'; + const DECLINED_STOP_PAYMENT_ORDER = 'stop_payment_order'; + const DECLINED_TESTMODE_DECLINE = 'testmode_decline'; + const DECLINED_TRANSACTION_NOT_ALLOWED = 'transaction_not_allowed'; + const DECLINED_TRY_AGAIN_LATER = 'try_again_later'; + const DECLINED_WITHDRAWAL_COUNT_LIMIT_EXCEEDED = 'withdrawal_count_limit_exceeded'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Charge the captured charge + */ + public function capture($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/capture'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/Checkout/Session.php b/vendor/stripe/stripe-php/lib/Checkout/Session.php new file mode 100644 index 0000000..11a6908 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Checkout/Session.php @@ -0,0 +1,93 @@ +Checkout. We recommend + * creating a new Session each time your customer attempts to pay. + * + * Once payment is successful, the Checkout Session will contain a reference to the + * Customer, and either the + * successful PaymentIntent or an + * active Subscription. + * + * You can create a Checkout Session on your server and pass its ID to the client + * to begin Checkout. + * + * Related guide: Checkout + * Server Quickstart. + * + * @property string $id Unique identifier for the object. Used to pass to redirectToCheckout in Stripe.js. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|bool $allow_promotion_codes Enables user redeemable promotion codes. + * @property null|int $amount_subtotal Total of all items before discounts or taxes are applied. + * @property null|int $amount_total Total of all items after discounts and taxes are applied. + * @property \Stripe\StripeObject $automatic_tax + * @property null|string $billing_address_collection Describes whether Checkout should collect the customer's billing address. + * @property string $cancel_url The URL the customer will be directed to if they decide to cancel payment and return to your website. + * @property null|string $client_reference_id A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the Session with your internal systems. + * @property null|string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string|\Stripe\Customer $customer The ID of the customer for this Session. For Checkout Sessions in payment or subscription mode, Checkout will create a new customer object based on information provided during the payment flow unless an existing customer was provided when the Session was created. + * @property null|\Stripe\StripeObject $customer_details The customer details including the customer's tax exempt status and the customer's tax IDs. Only present on Sessions in payment or subscription mode. + * @property null|string $customer_email If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file. To access information about the customer once the payment flow is complete, use the customer attribute. + * @property \Stripe\Collection $line_items The line items purchased by the customer. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string $locale The IETF language tag of the locale Checkout is displayed in. If blank or auto, the browser's locale is used. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $mode The mode of the Checkout Session. + * @property null|string|\Stripe\PaymentIntent $payment_intent The ID of the PaymentIntent for Checkout Sessions in payment mode. + * @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. + * @property string[] $payment_method_types A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept. + * @property string $payment_status The payment status of the Checkout Session, one of paid, unpaid, or no_payment_required. You can use this value to decide when to fulfill your customer's order. + * @property null|string|\Stripe\SetupIntent $setup_intent The ID of the SetupIntent for Checkout Sessions in setup mode. + * @property null|\Stripe\StripeObject $shipping Shipping information for this Checkout Session. + * @property null|\Stripe\StripeObject $shipping_address_collection When set, provides configuration for Checkout to collect a shipping address from a customer. + * @property null|string $submit_type Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. submit_type can only be specified on Checkout Sessions in payment mode, but not Checkout Sessions in subscription or setup mode. + * @property null|string|\Stripe\Subscription $subscription The ID of the subscription for Checkout Sessions in subscription mode. + * @property string $success_url The URL the customer will be directed to after the payment or subscription creation is successful. + * @property \Stripe\StripeObject $tax_id_collection + * @property null|\Stripe\StripeObject $total_details Tax and discount details for the computed total amount. + * @property null|string $url The URL to the Checkout Session. + */ +class Session extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'checkout.session'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\NestedResource; + use \Stripe\ApiOperations\Retrieve; + + const BILLING_ADDRESS_COLLECTION_AUTO = 'auto'; + const BILLING_ADDRESS_COLLECTION_REQUIRED = 'required'; + + const PAYMENT_STATUS_NO_PAYMENT_REQUIRED = 'no_payment_required'; + const PAYMENT_STATUS_PAID = 'paid'; + const PAYMENT_STATUS_UNPAID = 'unpaid'; + + const SUBMIT_TYPE_AUTO = 'auto'; + const SUBMIT_TYPE_BOOK = 'book'; + const SUBMIT_TYPE_DONATE = 'donate'; + const SUBMIT_TYPE_PAY = 'pay'; + + const PATH_LINE_ITEMS = '/line_items'; + + /** + * @param string $id the ID of the session on which to retrieve the items + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of items + */ + public static function allLineItems($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_LINE_ITEMS, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Collection.php b/vendor/stripe/stripe-php/lib/Collection.php new file mode 100644 index 0000000..899299d --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Collection.php @@ -0,0 +1,281 @@ +filters; + } + + /** + * Sets the filters, removing paging options. + * + * @param array $filters the filters + */ + public function setFilters($filters) + { + $this->filters = $filters; + } + + public function offsetGet($k) + { + if (\is_string($k)) { + return parent::offsetGet($k); + } + $msg = "You tried to access the {$k} index, but Collection " . + 'types only support string keys. (HINT: List calls ' . + 'return an object with a `data` (which is the data ' . + "array). You likely want to call ->data[{$k}])"; + + throw new Exception\InvalidArgumentException($msg); + } + + public function all($params = null, $opts = null) + { + self::_validateParams($params); + list($url, $params) = $this->extractPathAndUpdateParams($params); + + list($response, $opts) = $this->_request('get', $url, $params, $opts); + $obj = Util\Util::convertToStripeObject($response, $opts); + if (!($obj instanceof \Stripe\Collection)) { + throw new \Stripe\Exception\UnexpectedValueException( + 'Expected type ' . \Stripe\Collection::class . ', got "' . \get_class($obj) . '" instead.' + ); + } + $obj->setFilters($params); + + return $obj; + } + + public function create($params = null, $opts = null) + { + self::_validateParams($params); + list($url, $params) = $this->extractPathAndUpdateParams($params); + + list($response, $opts) = $this->_request('post', $url, $params, $opts); + + return Util\Util::convertToStripeObject($response, $opts); + } + + public function retrieve($id, $params = null, $opts = null) + { + self::_validateParams($params); + list($url, $params) = $this->extractPathAndUpdateParams($params); + + $id = Util\Util::utf8($id); + $extn = \urlencode($id); + list($response, $opts) = $this->_request( + 'get', + "{$url}/{$extn}", + $params, + $opts + ); + + return Util\Util::convertToStripeObject($response, $opts); + } + + /** + * @return int the number of objects in the current page + */ + public function count() + { + return \count($this->data); + } + + /** + * @return \ArrayIterator an iterator that can be used to iterate + * across objects in the current page + */ + public function getIterator() + { + return new \ArrayIterator($this->data); + } + + /** + * @return \ArrayIterator an iterator that can be used to iterate + * backwards across objects in the current page + */ + public function getReverseIterator() + { + return new \ArrayIterator(\array_reverse($this->data)); + } + + /** + * @return \Generator|StripeObject[] A generator that can be used to + * iterate across all objects across all pages. As page boundaries are + * encountered, the next page will be fetched automatically for + * continued iteration. + */ + public function autoPagingIterator() + { + $page = $this; + + while (true) { + $filters = $this->filters ?: []; + if (\array_key_exists('ending_before', $filters) + && !\array_key_exists('starting_after', $filters)) { + foreach ($page->getReverseIterator() as $item) { + yield $item; + } + $page = $page->previousPage(); + } else { + foreach ($page as $item) { + yield $item; + } + $page = $page->nextPage(); + } + + if ($page->isEmpty()) { + break; + } + } + } + + /** + * Returns an empty collection. This is returned from {@see nextPage()} + * when we know that there isn't a next page in order to replicate the + * behavior of the API when it attempts to return a page beyond the last. + * + * @param null|array|string $opts + * + * @return Collection + */ + public static function emptyCollection($opts = null) + { + return Collection::constructFrom(['data' => []], $opts); + } + + /** + * Returns true if the page object contains no element. + * + * @return bool + */ + public function isEmpty() + { + return empty($this->data); + } + + /** + * Fetches the next page in the resource list (if there is one). + * + * This method will try to respect the limit of the current page. If none + * was given, the default limit will be fetched again. + * + * @param null|array $params + * @param null|array|string $opts + * + * @return Collection + */ + public function nextPage($params = null, $opts = null) + { + if (!$this->has_more) { + return static::emptyCollection($opts); + } + + $lastId = \end($this->data)->id; + + $params = \array_merge( + $this->filters ?: [], + ['starting_after' => $lastId], + $params ?: [] + ); + + return $this->all($params, $opts); + } + + /** + * Fetches the previous page in the resource list (if there is one). + * + * This method will try to respect the limit of the current page. If none + * was given, the default limit will be fetched again. + * + * @param null|array $params + * @param null|array|string $opts + * + * @return Collection + */ + public function previousPage($params = null, $opts = null) + { + if (!$this->has_more) { + return static::emptyCollection($opts); + } + + $firstId = $this->data[0]->id; + + $params = \array_merge( + $this->filters ?: [], + ['ending_before' => $firstId], + $params ?: [] + ); + + return $this->all($params, $opts); + } + + /** + * Gets the first item from the current page. Returns `null` if the current page is empty. + * + * @return null|\Stripe\StripeObject + */ + public function first() + { + return \count($this->data) > 0 ? $this->data[0] : null; + } + + /** + * Gets the last item from the current page. Returns `null` if the current page is empty. + * + * @return null|\Stripe\StripeObject + */ + public function last() + { + return \count($this->data) > 0 ? $this->data[\count($this->data) - 1] : null; + } + + private function extractPathAndUpdateParams($params) + { + $url = \parse_url($this->url); + if (!isset($url['path'])) { + throw new Exception\UnexpectedValueException("Could not parse list url into parts: {$url}"); + } + + if (isset($url['query'])) { + // If the URL contains a query param, parse it out into $params so they + // don't interact weirdly with each other. + $query = []; + \parse_str($url['query'], $query); + $params = \array_merge($params ?: [], $query); + } + + return [$url['path'], $params]; + } +} diff --git a/vendor/stripe/stripe-php/lib/CountrySpec.php b/vendor/stripe/stripe-php/lib/CountrySpec.php new file mode 100644 index 0000000..223afb3 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/CountrySpec.php @@ -0,0 +1,30 @@ +an online guide. + * + * @property string $id Unique identifier for the object. Represented as the ISO country code for this country. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string $default_currency The default currency for this country. This applies to both payment methods and bank accounts. + * @property \Stripe\StripeObject $supported_bank_account_currencies Currencies that can be accepted in the specific country (for transfers). + * @property string[] $supported_payment_currencies Currencies that can be accepted in the specified country (for payments). + * @property string[] $supported_payment_methods Payment methods available in the specified country. You may need to enable some payment methods (e.g., ACH) on your account before they appear in this list. The stripe payment method refers to charging through your platform. + * @property string[] $supported_transfer_countries Countries that can accept transfers from the specified country. + * @property \Stripe\StripeObject $verification_fields + */ +class CountrySpec extends ApiResource +{ + const OBJECT_NAME = 'country_spec'; + + use ApiOperations\All; + use ApiOperations\Retrieve; +} diff --git a/vendor/stripe/stripe-php/lib/Coupon.php b/vendor/stripe/stripe-php/lib/Coupon.php new file mode 100644 index 0000000..41afdcf --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Coupon.php @@ -0,0 +1,41 @@ +invoices or orders. Coupons do + * not work with conventional one-off charges. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|int $amount_off Amount (in the currency specified) that will be taken off the subtotal of any invoices for this customer. + * @property \Stripe\StripeObject $applies_to + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $currency If amount_off has been set, the three-letter ISO code for the currency of the amount to take off. + * @property string $duration One of forever, once, and repeating. Describes how long a customer who applies this coupon will get the discount. + * @property null|int $duration_in_months If duration is repeating, the number of months the coupon applies. Null if coupon duration is forever or once. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|int $max_redemptions Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $name Name of the coupon displayed to customers on for instance invoices or receipts. + * @property null|float $percent_off Percent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon. For example, a coupon with percent_off of 50 will make a %s100 invoice %s50 instead. + * @property null|int $redeem_by Date after which the coupon can no longer be redeemed. + * @property int $times_redeemed Number of times this coupon has been applied to a customer. + * @property bool $valid Taking account of the above properties, whether this coupon can still be applied to a customer. + */ +class Coupon extends ApiResource +{ + const OBJECT_NAME = 'coupon'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/CreditNote.php b/vendor/stripe/stripe-php/lib/CreditNote.php new file mode 100644 index 0000000..591c5d7 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/CreditNote.php @@ -0,0 +1,111 @@ +Credit Notes. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount The integer amount in %s representing the total amount of the credit note, including tax. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string|\Stripe\Customer $customer ID of the customer. + * @property null|string|\Stripe\CustomerBalanceTransaction $customer_balance_transaction Customer balance transaction related to this credit note. + * @property int $discount_amount The integer amount in %s representing the total amount of discount that was credited. + * @property \Stripe\StripeObject[] $discount_amounts The aggregate amounts calculated per discount for all line items. + * @property string|\Stripe\Invoice $invoice ID of the invoice. + * @property \Stripe\Collection $lines Line items that make up the credit note + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string $memo Customer-facing text that appears on the credit note PDF. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $number A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice. + * @property null|int $out_of_band_amount Amount that was credited outside of Stripe. + * @property string $pdf The link to download the PDF of the credit note. + * @property null|string $reason Reason for issuing this credit note, one of duplicate, fraudulent, order_change, or product_unsatisfactory + * @property null|string|\Stripe\Refund $refund Refund related to this credit note. + * @property string $status Status of this credit note, one of issued or void. Learn more about voiding credit notes. + * @property int $subtotal The integer amount in %s representing the amount of the credit note, excluding tax and invoice level discounts. + * @property \Stripe\StripeObject[] $tax_amounts The aggregate amounts calculated per tax rate for all line items. + * @property int $total The integer amount in %s representing the total amount of the credit note, including tax and all discount. + * @property string $type Type of this credit note, one of pre_payment or post_payment. A pre_payment credit note means it was issued when the invoice was open. A post_payment credit note means it was issued when the invoice was paid. + * @property null|int $voided_at The time that the credit note was voided. + */ +class CreditNote extends ApiResource +{ + const OBJECT_NAME = 'credit_note'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\NestedResource; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const REASON_DUPLICATE = 'duplicate'; + const REASON_FRAUDULENT = 'fraudulent'; + const REASON_ORDER_CHANGE = 'order_change'; + const REASON_PRODUCT_UNSATISFACTORY = 'product_unsatisfactory'; + + const STATUS_ISSUED = 'issued'; + const STATUS_VOID = 'void'; + + const TYPE_POST_PAYMENT = 'post_payment'; + const TYPE_PRE_PAYMENT = 'pre_payment'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote the previewed credit note + */ + public static function preview($params = null, $opts = null) + { + $url = static::classUrl() . '/preview'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote the voided credit note + */ + public function voidCreditNote($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/void'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + const PATH_LINES = '/lines'; + + /** + * @param string $id the ID of the credit note on which to retrieve the credit note line items + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of credit note line items + */ + public static function allLines($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_LINES, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/CreditNoteLineItem.php b/vendor/stripe/stripe-php/lib/CreditNoteLineItem.php new file mode 100644 index 0000000..254886b --- /dev/null +++ b/vendor/stripe/stripe-php/lib/CreditNoteLineItem.php @@ -0,0 +1,26 @@ +true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|int $quantity The number of units of product being credited. + * @property \Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item + * @property \Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item. + * @property string $type The type of the credit note line item, one of invoice_line_item or custom_line_item. When the type is invoice_line_item there is an additional invoice_line_item property on the resource the value of which is the id of the credited line item on the invoice. + * @property null|int $unit_amount The cost of each unit of product being credited. + * @property null|string $unit_amount_decimal Same as unit_amount, but contains a decimal value with at most 12 decimal places. + */ +class CreditNoteLineItem extends ApiResource +{ + const OBJECT_NAME = 'credit_note_line_item'; +} diff --git a/vendor/stripe/stripe-php/lib/Customer.php b/vendor/stripe/stripe-php/lib/Customer.php new file mode 100644 index 0000000..6cc983a --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Customer.php @@ -0,0 +1,277 @@ +Customer objects allow you to perform recurring charges, and to + * track multiple charges, that are associated with the same customer. The API + * allows you to create, delete, and update your customers. You can retrieve + * individual customers as well as a list of all your customers. + * + * Related guide: Save a card during + * payment. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|\Stripe\StripeObject $address The customer's address. + * @property int $balance Current balance, if any, being stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $currency Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes. + * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source

ID of the default payment source for the customer.

If you are using payment methods created via the PaymentMethods API, see the invoice_settings.default_payment_method field instead.

+ * @property null|bool $delinquent

When the customer's latest invoice is billed by charging automatically, delinquent is true if the invoice's latest charge failed. When the customer's latest invoice is billed by sending an invoice, delinquent is true if the invoice isn't paid by its due date.

If an invoice is marked uncollectible by dunning, delinquent doesn't get reset to false.

+ * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|\Stripe\Discount $discount Describes the current discount active on the customer, if there is one. + * @property null|string $email The customer's email address. + * @property null|string $invoice_prefix The prefix for the customer used to generate unique invoice numbers. + * @property \Stripe\StripeObject $invoice_settings + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $name The customer's full name or business name. + * @property int $next_invoice_sequence The suffix of the customer's next invoice number, e.g., 0001. + * @property null|string $phone The customer's phone number. + * @property null|string[] $preferred_locales The customer's preferred locales (languages), ordered by preference. + * @property null|\Stripe\StripeObject $shipping Mailing and shipping address for the customer. Appears on invoices emailed to this customer. + * @property \Stripe\Collection $sources The customer's payment sources, if any. + * @property \Stripe\Collection $subscriptions The customer's current subscriptions, if any. + * @property \Stripe\StripeObject $tax + * @property null|string $tax_exempt Describes the customer's tax exemption status. One of none, exempt, or reverse. When set to reverse, invoice and receipt PDFs include the text "Reverse charge". + * @property \Stripe\Collection $tax_ids The customer's tax IDs. + */ +class Customer extends ApiResource +{ + const OBJECT_NAME = 'customer'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\NestedResource; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const TAX_EXEMPT_EXEMPT = 'exempt'; + const TAX_EXEMPT_NONE = 'none'; + const TAX_EXEMPT_REVERSE = 'reverse'; + + public static function getSavedNestedResources() + { + static $savedNestedResources = null; + if (null === $savedNestedResources) { + $savedNestedResources = new Util\Set([ + 'source', + ]); + } + + return $savedNestedResources; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @return \Stripe\Customer the updated customer + */ + public function deleteDiscount($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/discount'; + list($response, $opts) = $this->_request('delete', $url, $params, $opts); + $this->refreshFrom(['discount' => null], $opts, true); + } + + const PATH_BALANCE_TRANSACTIONS = '/balance_transactions'; + + /** + * @param string $id the ID of the customer on which to retrieve the customer balance transactions + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of customer balance transactions + */ + public static function allBalanceTransactions($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts); + } + + /** + * @param string $id the ID of the customer on which to create the customer balance transaction + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CustomerBalanceTransaction + */ + public static function createBalanceTransaction($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the customer balance transaction belongs + * @param string $balanceTransactionId the ID of the customer balance transaction to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CustomerBalanceTransaction + */ + public static function retrieveBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the customer balance transaction belongs + * @param string $balanceTransactionId the ID of the customer balance transaction to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CustomerBalanceTransaction + */ + public static function updateBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts); + } + + const PATH_SOURCES = '/sources'; + + /** + * @param string $id the ID of the customer on which to retrieve the payment sources + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of payment sources (AlipayAccount, BankAccount, BitcoinReceiver, Card or Source) + */ + public static function allSources($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_SOURCES, $params, $opts); + } + + /** + * @param string $id the ID of the customer on which to create the payment source + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public static function createSource($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_SOURCES, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the payment source belongs + * @param string $sourceId the ID of the payment source to delete + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public static function deleteSource($id, $sourceId, $params = null, $opts = null) + { + return self::_deleteNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the payment source belongs + * @param string $sourceId the ID of the payment source to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public static function retrieveSource($id, $sourceId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the payment source belongs + * @param string $sourceId the ID of the payment source to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public static function updateSource($id, $sourceId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); + } + + const PATH_TAX_IDS = '/tax_ids'; + + /** + * @param string $id the ID of the customer on which to retrieve the tax ids + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of tax ids + */ + public static function allTaxIds($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_TAX_IDS, $params, $opts); + } + + /** + * @param string $id the ID of the customer on which to create the tax id + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxId + */ + public static function createTaxId($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_TAX_IDS, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the tax id belongs + * @param string $taxIdId the ID of the tax id to delete + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxId + */ + public static function deleteTaxId($id, $taxIdId, $params = null, $opts = null) + { + return self::_deleteNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the tax id belongs + * @param string $taxIdId the ID of the tax id to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxId + */ + public static function retrieveTaxId($id, $taxIdId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/CustomerBalanceTransaction.php b/vendor/stripe/stripe-php/lib/CustomerBalanceTransaction.php new file mode 100644 index 0000000..8c30676 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/CustomerBalanceTransaction.php @@ -0,0 +1,103 @@ +balance + * value, which denotes a debit or credit that's automatically applied to their + * next invoice upon finalization. You may modify the value directly by using the + * update customer API, + * or by creating a Customer Balance Transaction, which increments or decrements + * the customer's balance by the specified amount. + * + * Related guide: Customer Balance to + * learn more. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount The amount of the transaction. A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's balance. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string|\Stripe\CreditNote $credit_note The ID of the credit note (if any) related to the transaction. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string|\Stripe\Customer $customer The ID of the customer the transaction belongs to. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property int $ending_balance The customer's balance after the transaction was applied. A negative value decreases the amount due on the customer's next invoice. A positive value increases the amount due on the customer's next invoice. + * @property null|string|\Stripe\Invoice $invoice The ID of the invoice (if any) related to the transaction. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $type Transaction type: adjustment, applied_to_invoice, credit_note, initial, invoice_too_large, invoice_too_small, unspent_receiver_credit, or unapplied_from_invoice. See the Customer Balance page to learn more about transaction types. + */ +class CustomerBalanceTransaction extends ApiResource +{ + const OBJECT_NAME = 'customer_balance_transaction'; + + const TYPE_ADJUSTMENT = 'adjustment'; + const TYPE_APPLIED_TO_INVOICE = 'applied_to_invoice'; + const TYPE_CREDIT_NOTE = 'credit_note'; + const TYPE_INITIAL = 'initial'; + const TYPE_INVOICE_TOO_LARGE = 'invoice_too_large'; + const TYPE_INVOICE_TOO_SMALL = 'invoice_too_small'; + const TYPE_UNSPENT_RECEIVER_CREDIT = 'unspent_receiver_credit'; + + const TYPE_ADJUSTEMENT = 'adjustment'; + + /** + * @return string the API URL for this balance transaction + */ + public function instanceUrl() + { + $id = $this['id']; + $customer = $this['customer']; + if (!$id) { + throw new Exception\UnexpectedValueException( + "Could not determine which URL to request: class instance has invalid ID: {$id}", + null + ); + } + $id = Util\Util::utf8($id); + $customer = Util\Util::utf8($customer); + + $base = Customer::classUrl(); + $customerExtn = \urlencode($customer); + $extn = \urlencode($id); + + return "{$base}/{$customerExtn}/balance_transactions/{$extn}"; + } + + /** + * @param array|string $_id + * @param null|array|string $_opts + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function retrieve($_id, $_opts = null) + { + $msg = 'Customer Balance Transactions cannot be retrieved without a ' . + 'customer ID. Retrieve a Customer Balance Transaction using ' . + "`Customer::retrieveBalanceTransaction('customer_id', " . + "'balance_transaction_id')`."; + + throw new Exception\BadMethodCallException($msg); + } + + /** + * @param string $_id + * @param null|array $_params + * @param null|array|string $_options + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function update($_id, $_params = null, $_options = null) + { + $msg = 'Customer Balance Transactions cannot be updated without a ' . + 'customer ID. Update a Customer Balance Transaction using ' . + "`Customer::updateBalanceTransaction('customer_id', " . + "'balance_transaction_id', \$updateParams)`."; + + throw new Exception\BadMethodCallException($msg); + } +} diff --git a/vendor/stripe/stripe-php/lib/Discount.php b/vendor/stripe/stripe-php/lib/Discount.php new file mode 100644 index 0000000..f32e3c5 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Discount.php @@ -0,0 +1,23 @@ +Disputes and Fraud + * documentation. + * + * Related guide: Disputes and + * Fraud. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Disputed amount. Usually the amount of the charge, but can differ (usually because of currency fluctuation or because only part of the order is disputed). + * @property \Stripe\BalanceTransaction[] $balance_transactions List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute. + * @property string|\Stripe\Charge $charge ID of the charge that was disputed. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property \Stripe\StripeObject $evidence + * @property \Stripe\StripeObject $evidence_details + * @property bool $is_charge_refundable If true, it is still possible to refund the disputed payment. Once the payment has been fully refunded, no further funds will be withdrawn from your Stripe account as a result of this dispute. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $network_reason_code Network-dependent reason code for the dispute. + * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that was disputed. + * @property string $reason Reason given by cardholder for dispute. Possible values are bank_cannot_process, check_returned, credit_not_processed, customer_initiated, debit_not_authorized, duplicate, fraudulent, general, incorrect_account_details, insufficient_funds, product_not_received, product_unacceptable, subscription_canceled, or unrecognized. Read more about dispute reasons. + * @property string $status Current status of dispute. Possible values are warning_needs_response, warning_under_review, warning_closed, needs_response, under_review, charge_refunded, won, or lost. + */ +class Dispute extends ApiResource +{ + const OBJECT_NAME = 'dispute'; + + use ApiOperations\All; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const REASON_BANK_CANNOT_PROCESS = 'bank_cannot_process'; + const REASON_CHECK_RETURNED = 'check_returned'; + const REASON_CREDIT_NOT_PROCESSED = 'credit_not_processed'; + const REASON_CUSTOMER_INITIATED = 'customer_initiated'; + const REASON_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized'; + const REASON_DUPLICATE = 'duplicate'; + const REASON_FRAUDULENT = 'fraudulent'; + const REASON_GENERAL = 'general'; + const REASON_INCORRECT_ACCOUNT_DETAILS = 'incorrect_account_details'; + const REASON_INSUFFICIENT_FUNDS = 'insufficient_funds'; + const REASON_PRODUCT_NOT_RECEIVED = 'product_not_received'; + const REASON_PRODUCT_UNACCEPTABLE = 'product_unacceptable'; + const REASON_SUBSCRIPTION_CANCELED = 'subscription_canceled'; + const REASON_UNRECOGNIZED = 'unrecognized'; + + const STATUS_CHARGE_REFUNDED = 'charge_refunded'; + const STATUS_LOST = 'lost'; + const STATUS_NEEDS_RESPONSE = 'needs_response'; + const STATUS_UNDER_REVIEW = 'under_review'; + const STATUS_WARNING_CLOSED = 'warning_closed'; + const STATUS_WARNING_NEEDS_RESPONSE = 'warning_needs_response'; + const STATUS_WARNING_UNDER_REVIEW = 'warning_under_review'; + const STATUS_WON = 'won'; + + /** + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Dispute the closed dispute + */ + // TODO: add $params to standardize signature + public function close($opts = null) + { + $url = $this->instanceUrl() . '/close'; + list($response, $opts) = $this->_request('post', $url, null, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/EphemeralKey.php b/vendor/stripe/stripe-php/lib/EphemeralKey.php new file mode 100644 index 0000000..253256c --- /dev/null +++ b/vendor/stripe/stripe-php/lib/EphemeralKey.php @@ -0,0 +1,43 @@ +true if the object exists in live mode or the value false if the object exists in test mode. + * @property string $secret The key's secret. You can use this value to make authorized requests to the Stripe API. + * @property array $associated_objects + */ +class EphemeralKey extends ApiResource +{ + const OBJECT_NAME = 'ephemeral_key'; + + use ApiOperations\Create { + create as protected _create; + } + + use ApiOperations\Delete; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\InvalidArgumentException if stripe_version is missing + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\EphemeralKey the created key + */ + public static function create($params = null, $opts = null) + { + if (!$opts || !isset($opts['stripe_version'])) { + throw new Exception\InvalidArgumentException('stripe_version must be specified to create an ephemeral key'); + } + + return self::_create($params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/ErrorObject.php b/vendor/stripe/stripe-php/lib/ErrorObject.php new file mode 100644 index 0000000..a9fe1a3 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/ErrorObject.php @@ -0,0 +1,164 @@ + null, + 'code' => null, + 'decline_code' => null, + 'doc_url' => null, + 'message' => null, + 'param' => null, + 'payment_intent' => null, + 'payment_method' => null, + 'setup_intent' => null, + 'source' => null, + 'type' => null, + ], $values); + parent::refreshFrom($values, $opts, $partial); + } +} diff --git a/vendor/stripe/stripe-php/lib/Event.php b/vendor/stripe/stripe-php/lib/Event.php new file mode 100644 index 0000000..518c5d4 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Event.php @@ -0,0 +1,231 @@ +Event object. For example, when a charge succeeds, we create a + * charge.succeeded event; and when an invoice payment attempt fails, + * we create an invoice.payment_failed event. Note that many API + * requests may cause multiple events to be created. For example, if you create a + * new subscription for a customer, you will receive both a + * customer.subscription.created event and a + * charge.succeeded event. + * + * Events occur when the state of another API resource changes. The state of that + * resource at the time of the change is embedded in the event's data field. For + * example, a charge.succeeded event will contain a charge, and an + * invoice.payment_failed event will contain an invoice. + * + * As with other API resources, you can use endpoints to retrieve an individual event or a list of events from the API. + * We also have a separate webhooks system for sending the + * Event objects directly to an endpoint on your server. Webhooks are + * managed in your account + * settings, and our Using + * Webhooks guide will help you get set up. + * + * When using Connect, you can also + * receive notifications of events that occur in connected accounts. For these + * events, there will be an additional account attribute in the + * received Event object. + * + * NOTE: Right now, access to events through the Retrieve Event API is + * guaranteed only for 30 days. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string $account The connected account that originated the event. + * @property null|string $api_version The Stripe API version used to render data. Note: This property is populated only for events on or after October 31, 2014. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property \Stripe\StripeObject $data + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property int $pending_webhooks Number of webhooks that have yet to be successfully delivered (i.e., to return a 20x response) to the URLs you've specified. + * @property null|\Stripe\StripeObject $request Information on the API request that instigated the event. + * @property string $type Description of the event (e.g., invoice.created or charge.refunded). + */ +class Event extends ApiResource +{ + const OBJECT_NAME = 'event'; + + use ApiOperations\All; + use ApiOperations\Retrieve; + + /** + * Possible string representations of event types. + * + * @see https://stripe.com/docs/api#event_types + */ + const ACCOUNT_UPDATED = 'account.updated'; + const ACCOUNT_APPLICATION_AUTHORIZED = 'account.application.authorized'; + const ACCOUNT_APPLICATION_DEAUTHORIZED = 'account.application.deauthorized'; + const ACCOUNT_EXTERNAL_ACCOUNT_CREATED = 'account.external_account.created'; + const ACCOUNT_EXTERNAL_ACCOUNT_DELETED = 'account.external_account.deleted'; + const ACCOUNT_EXTERNAL_ACCOUNT_UPDATED = 'account.external_account.updated'; + const APPLICATION_FEE_CREATED = 'application_fee.created'; + const APPLICATION_FEE_REFUNDED = 'application_fee.refunded'; + const APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated'; + const BALANCE_AVAILABLE = 'balance.available'; + const CAPABILITY_UPDATED = 'capability.updated'; + const CHARGE_CAPTURED = 'charge.captured'; + const CHARGE_EXPIRED = 'charge.expired'; + const CHARGE_FAILED = 'charge.failed'; + const CHARGE_PENDING = 'charge.pending'; + const CHARGE_REFUNDED = 'charge.refunded'; + const CHARGE_SUCCEEDED = 'charge.succeeded'; + const CHARGE_UPDATED = 'charge.updated'; + const CHARGE_DISPUTE_CLOSED = 'charge.dispute.closed'; + const CHARGE_DISPUTE_CREATED = 'charge.dispute.created'; + const CHARGE_DISPUTE_FUNDS_REINSTATED = 'charge.dispute.funds_reinstated'; + const CHARGE_DISPUTE_FUNDS_WITHDRAWN = 'charge.dispute.funds_withdrawn'; + const CHARGE_DISPUTE_UPDATED = 'charge.dispute.updated'; + const CHARGE_REFUND_UPDATED = 'charge.refund.updated'; + const CHECKOUT_SESSION_ASYNC_PAYMENT_FAILED = 'checkout.session.async_payment_failed'; + const CHECKOUT_SESSION_ASYNC_PAYMENT_SUCCEEDED = 'checkout.session.async_payment_succeeded'; + const CHECKOUT_SESSION_COMPLETED = 'checkout.session.completed'; + const COUPON_CREATED = 'coupon.created'; + const COUPON_DELETED = 'coupon.deleted'; + const COUPON_UPDATED = 'coupon.updated'; + const CREDIT_NOTE_CREATED = 'credit_note.created'; + const CREDIT_NOTE_UPDATED = 'credit_note.updated'; + const CREDIT_NOTE_VOIDED = 'credit_note.voided'; + const CUSTOMER_CREATED = 'customer.created'; + const CUSTOMER_DELETED = 'customer.deleted'; + const CUSTOMER_UPDATED = 'customer.updated'; + const CUSTOMER_DISCOUNT_CREATED = 'customer.discount.created'; + const CUSTOMER_DISCOUNT_DELETED = 'customer.discount.deleted'; + const CUSTOMER_DISCOUNT_UPDATED = 'customer.discount.updated'; + const CUSTOMER_SOURCE_CREATED = 'customer.source.created'; + const CUSTOMER_SOURCE_DELETED = 'customer.source.deleted'; + const CUSTOMER_SOURCE_EXPIRING = 'customer.source.expiring'; + const CUSTOMER_SOURCE_UPDATED = 'customer.source.updated'; + const CUSTOMER_SUBSCRIPTION_CREATED = 'customer.subscription.created'; + const CUSTOMER_SUBSCRIPTION_DELETED = 'customer.subscription.deleted'; + const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_APPLIED = 'customer.subscription.pending_update_applied'; + const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_EXPIRED = 'customer.subscription.pending_update_expired'; + const CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END = 'customer.subscription.trial_will_end'; + const CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated'; + const CUSTOMER_TAX_ID_CREATED = 'customer.tax_id.created'; + const CUSTOMER_TAX_ID_DELETED = 'customer.tax_id.deleted'; + const CUSTOMER_TAX_ID_UPDATED = 'customer.tax_id.updated'; + const FILE_CREATED = 'file.created'; + const INVOICE_CREATED = 'invoice.created'; + const INVOICE_DELETED = 'invoice.deleted'; + const INVOICE_FINALIZATION_FAILED = 'invoice.finalization_failed'; + const INVOICE_FINALIZED = 'invoice.finalized'; + const INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible'; + const INVOICE_PAID = 'invoice.paid'; + const INVOICE_PAYMENT_ACTION_REQUIRED = 'invoice.payment_action_required'; + const INVOICE_PAYMENT_FAILED = 'invoice.payment_failed'; + const INVOICE_PAYMENT_SUCCEEDED = 'invoice.payment_succeeded'; + const INVOICE_SENT = 'invoice.sent'; + const INVOICE_UPCOMING = 'invoice.upcoming'; + const INVOICE_UPDATED = 'invoice.updated'; + const INVOICE_VOIDED = 'invoice.voided'; + const INVOICEITEM_CREATED = 'invoiceitem.created'; + const INVOICEITEM_DELETED = 'invoiceitem.deleted'; + const INVOICEITEM_UPDATED = 'invoiceitem.updated'; + const ISSUER_FRAUD_RECORD_CREATED = 'issuer_fraud_record.created'; + const ISSUING_AUTHORIZATION_CREATED = 'issuing_authorization.created'; + const ISSUING_AUTHORIZATION_REQUEST = 'issuing_authorization.request'; + const ISSUING_AUTHORIZATION_UPDATED = 'issuing_authorization.updated'; + const ISSUING_CARD_CREATED = 'issuing_card.created'; + const ISSUING_CARD_UPDATED = 'issuing_card.updated'; + const ISSUING_CARDHOLDER_CREATED = 'issuing_cardholder.created'; + const ISSUING_CARDHOLDER_UPDATED = 'issuing_cardholder.updated'; + const ISSUING_DISPUTE_CLOSED = 'issuing_dispute.closed'; + const ISSUING_DISPUTE_CREATED = 'issuing_dispute.created'; + const ISSUING_DISPUTE_FUNDS_REINSTATED = 'issuing_dispute.funds_reinstated'; + const ISSUING_DISPUTE_SUBMITTED = 'issuing_dispute.submitted'; + const ISSUING_DISPUTE_UPDATED = 'issuing_dispute.updated'; + const ISSUING_TRANSACTION_CREATED = 'issuing_transaction.created'; + const ISSUING_TRANSACTION_UPDATED = 'issuing_transaction.updated'; + const MANDATE_UPDATED = 'mandate.updated'; + const ORDER_CREATED = 'order.created'; + const ORDER_PAYMENT_FAILED = 'order.payment_failed'; + const ORDER_PAYMENT_SUCCEEDED = 'order.payment_succeeded'; + const ORDER_UPDATED = 'order.updated'; + const ORDER_RETURN_CREATED = 'order_return.created'; + const PAYMENT_INTENT_AMOUNT_CAPTURABLE_UPDATED = 'payment_intent.amount_capturable_updated'; + const PAYMENT_INTENT_CANCELED = 'payment_intent.canceled'; + const PAYMENT_INTENT_CREATED = 'payment_intent.created'; + const PAYMENT_INTENT_PAYMENT_FAILED = 'payment_intent.payment_failed'; + const PAYMENT_INTENT_PROCESSING = 'payment_intent.processing'; + const PAYMENT_INTENT_REQUIRES_ACTION = 'payment_intent.requires_action'; + const PAYMENT_INTENT_SUCCEEDED = 'payment_intent.succeeded'; + const PAYMENT_METHOD_ATTACHED = 'payment_method.attached'; + const PAYMENT_METHOD_AUTOMATICALLY_UPDATED = 'payment_method.automatically_updated'; + const PAYMENT_METHOD_CARD_AUTOMATICALLY_UPDATED = 'payment_method.card_automatically_updated'; + const PAYMENT_METHOD_DETACHED = 'payment_method.detached'; + const PAYMENT_METHOD_UPDATED = 'payment_method.updated'; + const PAYOUT_CANCELED = 'payout.canceled'; + const PAYOUT_CREATED = 'payout.created'; + const PAYOUT_FAILED = 'payout.failed'; + const PAYOUT_PAID = 'payout.paid'; + const PAYOUT_UPDATED = 'payout.updated'; + const PERSON_CREATED = 'person.created'; + const PERSON_DELETED = 'person.deleted'; + const PERSON_UPDATED = 'person.updated'; + const PING = 'ping'; + const PLAN_CREATED = 'plan.created'; + const PLAN_DELETED = 'plan.deleted'; + const PLAN_UPDATED = 'plan.updated'; + const PRICE_CREATED = 'price.created'; + const PRICE_DELETED = 'price.deleted'; + const PRICE_UPDATED = 'price.updated'; + const PRODUCT_CREATED = 'product.created'; + const PRODUCT_DELETED = 'product.deleted'; + const PRODUCT_UPDATED = 'product.updated'; + const PROMOTION_CODE_CREATED = 'promotion_code.created'; + const PROMOTION_CODE_DELETED = 'promotion_code.deleted'; + const PROMOTION_CODE_UPDATED = 'promotion_code.updated'; + const RADAR_EARLY_FRAUD_WARNING_CREATED = 'radar.early_fraud_warning.created'; + const RADAR_EARLY_FRAUD_WARNING_UPDATED = 'radar.early_fraud_warning.updated'; + const RECIPIENT_CREATED = 'recipient.created'; + const RECIPIENT_DELETED = 'recipient.deleted'; + const RECIPIENT_UPDATED = 'recipient.updated'; + const REPORTING_REPORT_RUN_FAILED = 'reporting.report_run.failed'; + const REPORTING_REPORT_RUN_SUCCEEDED = 'reporting.report_run.succeeded'; + const REPORTING_REPORT_TYPE_UPDATED = 'reporting.report_type.updated'; + const REVIEW_CLOSED = 'review.closed'; + const REVIEW_OPENED = 'review.opened'; + const SETUP_INTENT_CANCELED = 'setup_intent.canceled'; + const SETUP_INTENT_CREATED = 'setup_intent.created'; + const SETUP_INTENT_REQUIRES_ACTION = 'setup_intent.requires_action'; + const SETUP_INTENT_SETUP_FAILED = 'setup_intent.setup_failed'; + const SETUP_INTENT_SUCCEEDED = 'setup_intent.succeeded'; + const SIGMA_SCHEDULED_QUERY_RUN_CREATED = 'sigma.scheduled_query_run.created'; + const SKU_CREATED = 'sku.created'; + const SKU_DELETED = 'sku.deleted'; + const SKU_UPDATED = 'sku.updated'; + const SOURCE_CANCELED = 'source.canceled'; + const SOURCE_CHARGEABLE = 'source.chargeable'; + const SOURCE_FAILED = 'source.failed'; + const SOURCE_MANDATE_NOTIFICATION = 'source.mandate_notification'; + const SOURCE_REFUND_ATTRIBUTES_REQUIRED = 'source.refund_attributes_required'; + const SOURCE_TRANSACTION_CREATED = 'source.transaction.created'; + const SOURCE_TRANSACTION_UPDATED = 'source.transaction.updated'; + const SUBSCRIPTION_SCHEDULE_ABORTED = 'subscription_schedule.aborted'; + const SUBSCRIPTION_SCHEDULE_CANCELED = 'subscription_schedule.canceled'; + const SUBSCRIPTION_SCHEDULE_COMPLETED = 'subscription_schedule.completed'; + const SUBSCRIPTION_SCHEDULE_CREATED = 'subscription_schedule.created'; + const SUBSCRIPTION_SCHEDULE_EXPIRING = 'subscription_schedule.expiring'; + const SUBSCRIPTION_SCHEDULE_RELEASED = 'subscription_schedule.released'; + const SUBSCRIPTION_SCHEDULE_UPDATED = 'subscription_schedule.updated'; + const TAX_RATE_CREATED = 'tax_rate.created'; + const TAX_RATE_UPDATED = 'tax_rate.updated'; + const TOPUP_CANCELED = 'topup.canceled'; + const TOPUP_CREATED = 'topup.created'; + const TOPUP_FAILED = 'topup.failed'; + const TOPUP_REVERSED = 'topup.reversed'; + const TOPUP_SUCCEEDED = 'topup.succeeded'; + const TRANSFER_CREATED = 'transfer.created'; + const TRANSFER_REVERSED = 'transfer.reversed'; + const TRANSFER_UPDATED = 'transfer.updated'; +} diff --git a/vendor/stripe/stripe-php/lib/Exception/ApiConnectionException.php b/vendor/stripe/stripe-php/lib/Exception/ApiConnectionException.php new file mode 100644 index 0000000..33f2ede --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Exception/ApiConnectionException.php @@ -0,0 +1,12 @@ +setHttpStatus($httpStatus); + $instance->setHttpBody($httpBody); + $instance->setJsonBody($jsonBody); + $instance->setHttpHeaders($httpHeaders); + $instance->setStripeCode($stripeCode); + + $instance->setRequestId(null); + if ($httpHeaders && isset($httpHeaders['Request-Id'])) { + $instance->setRequestId($httpHeaders['Request-Id']); + } + + $instance->setError($instance->constructErrorObject()); + + return $instance; + } + + /** + * Gets the Stripe error object. + * + * @return null|\Stripe\ErrorObject + */ + public function getError() + { + return $this->error; + } + + /** + * Sets the Stripe error object. + * + * @param null|\Stripe\ErrorObject $error + */ + public function setError($error) + { + $this->error = $error; + } + + /** + * Gets the HTTP body as a string. + * + * @return null|string + */ + public function getHttpBody() + { + return $this->httpBody; + } + + /** + * Sets the HTTP body as a string. + * + * @param null|string $httpBody + */ + public function setHttpBody($httpBody) + { + $this->httpBody = $httpBody; + } + + /** + * Gets the HTTP headers array. + * + * @return null|array|\Stripe\Util\CaseInsensitiveArray + */ + public function getHttpHeaders() + { + return $this->httpHeaders; + } + + /** + * Sets the HTTP headers array. + * + * @param null|array|\Stripe\Util\CaseInsensitiveArray $httpHeaders + */ + public function setHttpHeaders($httpHeaders) + { + $this->httpHeaders = $httpHeaders; + } + + /** + * Gets the HTTP status code. + * + * @return null|int + */ + public function getHttpStatus() + { + return $this->httpStatus; + } + + /** + * Sets the HTTP status code. + * + * @param null|int $httpStatus + */ + public function setHttpStatus($httpStatus) + { + $this->httpStatus = $httpStatus; + } + + /** + * Gets the JSON deserialized body. + * + * @return null|array + */ + public function getJsonBody() + { + return $this->jsonBody; + } + + /** + * Sets the JSON deserialized body. + * + * @param null|array $jsonBody + */ + public function setJsonBody($jsonBody) + { + $this->jsonBody = $jsonBody; + } + + /** + * Gets the Stripe request ID. + * + * @return null|string + */ + public function getRequestId() + { + return $this->requestId; + } + + /** + * Sets the Stripe request ID. + * + * @param null|string $requestId + */ + public function setRequestId($requestId) + { + $this->requestId = $requestId; + } + + /** + * Gets the Stripe error code. + * + * Cf. the `CODE_*` constants on {@see \Stripe\ErrorObject} for possible + * values. + * + * @return null|string + */ + public function getStripeCode() + { + return $this->stripeCode; + } + + /** + * Sets the Stripe error code. + * + * @param null|string $stripeCode + */ + public function setStripeCode($stripeCode) + { + $this->stripeCode = $stripeCode; + } + + /** + * Returns the string representation of the exception. + * + * @return string + */ + public function __toString() + { + $statusStr = (null === $this->getHttpStatus()) ? '' : "(Status {$this->getHttpStatus()}) "; + $idStr = (null === $this->getRequestId()) ? '' : "(Request {$this->getRequestId()}) "; + + return "{$statusStr}{$idStr}{$this->getMessage()}"; + } + + protected function constructErrorObject() + { + if (null === $this->jsonBody || !\array_key_exists('error', $this->jsonBody)) { + return null; + } + + return \Stripe\ErrorObject::constructFrom($this->jsonBody['error']); + } +} diff --git a/vendor/stripe/stripe-php/lib/Exception/AuthenticationException.php b/vendor/stripe/stripe-php/lib/Exception/AuthenticationException.php new file mode 100644 index 0000000..9e5c718 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Exception/AuthenticationException.php @@ -0,0 +1,11 @@ +setDeclineCode($declineCode); + $instance->setStripeParam($stripeParam); + + return $instance; + } + + /** + * Gets the decline code. + * + * @return null|string + */ + public function getDeclineCode() + { + return $this->declineCode; + } + + /** + * Sets the decline code. + * + * @param null|string $declineCode + */ + public function setDeclineCode($declineCode) + { + $this->declineCode = $declineCode; + } + + /** + * Gets the parameter related to the error. + * + * @return null|string + */ + public function getStripeParam() + { + return $this->stripeParam; + } + + /** + * Sets the parameter related to the error. + * + * @param null|string $stripeParam + */ + public function setStripeParam($stripeParam) + { + $this->stripeParam = $stripeParam; + } +} diff --git a/vendor/stripe/stripe-php/lib/Exception/ExceptionInterface.php b/vendor/stripe/stripe-php/lib/Exception/ExceptionInterface.php new file mode 100644 index 0000000..c84f37d --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Exception/ExceptionInterface.php @@ -0,0 +1,22 @@ +setStripeParam($stripeParam); + + return $instance; + } + + /** + * Gets the parameter related to the error. + * + * @return null|string + */ + public function getStripeParam() + { + return $this->stripeParam; + } + + /** + * Sets the parameter related to the error. + * + * @param null|string $stripeParam + */ + public function setStripeParam($stripeParam) + { + $this->stripeParam = $stripeParam; + } +} diff --git a/vendor/stripe/stripe-php/lib/Exception/OAuth/ExceptionInterface.php b/vendor/stripe/stripe-php/lib/Exception/OAuth/ExceptionInterface.php new file mode 100644 index 0000000..dd42662 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Exception/OAuth/ExceptionInterface.php @@ -0,0 +1,10 @@ +jsonBody) { + return null; + } + + return \Stripe\OAuthErrorObject::constructFrom($this->jsonBody); + } +} diff --git a/vendor/stripe/stripe-php/lib/Exception/OAuth/UnknownOAuthErrorException.php b/vendor/stripe/stripe-php/lib/Exception/OAuth/UnknownOAuthErrorException.php new file mode 100644 index 0000000..c8dba29 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Exception/OAuth/UnknownOAuthErrorException.php @@ -0,0 +1,12 @@ +setHttpBody($httpBody); + $instance->setSigHeader($sigHeader); + + return $instance; + } + + /** + * Gets the HTTP body as a string. + * + * @return null|string + */ + public function getHttpBody() + { + return $this->httpBody; + } + + /** + * Sets the HTTP body as a string. + * + * @param null|string $httpBody + */ + public function setHttpBody($httpBody) + { + $this->httpBody = $httpBody; + } + + /** + * Gets the `Stripe-Signature` HTTP header. + * + * @return null|string + */ + public function getSigHeader() + { + return $this->sigHeader; + } + + /** + * Sets the `Stripe-Signature` HTTP header. + * + * @param null|string $sigHeader + */ + public function setSigHeader($sigHeader) + { + $this->sigHeader = $sigHeader; + } +} diff --git a/vendor/stripe/stripe-php/lib/Exception/UnexpectedValueException.php b/vendor/stripe/stripe-php/lib/Exception/UnexpectedValueException.php new file mode 100644 index 0000000..0a629ed --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Exception/UnexpectedValueException.php @@ -0,0 +1,7 @@ +Exchange Rate objects allow you to determine the rates that Stripe + * is currently using to convert from one currency to another. Since this number is + * variable throughout the day, there are various reasons why you might want to + * know the current rate (for example, to dynamically price an item for a user with + * a default payment in a foreign currency). + * + * If you want a guarantee that the charge is made with a certain exchange rate you + * expect is current, you can pass in exchange_rate to charges + * endpoints. If the value is no longer up to date, the charge won't go through. + * Please refer to our Exchange + * Rates API guide for more details. + * + * @property string $id Unique identifier for the object. Represented as the three-letter ISO currency code in lowercase. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property \Stripe\StripeObject $rates Hash where the keys are supported currencies and the values are the exchange rate at which the base id currency converts to the key currency. + */ +class ExchangeRate extends ApiResource +{ + const OBJECT_NAME = 'exchange_rate'; + + use ApiOperations\All; + use ApiOperations\Retrieve; +} diff --git a/vendor/stripe/stripe-php/lib/File.php b/vendor/stripe/stripe-php/lib/File.php new file mode 100644 index 0000000..9f60564 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/File.php @@ -0,0 +1,87 @@ +create file request (for + * example, when uploading dispute evidence) or it may have been created by Stripe + * (for example, the results of a Sigma scheduled + * query). + * + * Related guide: File Upload + * Guide. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|int $expires_at The time at which the file expires and is no longer available in epoch seconds. + * @property null|string $filename A filename for the file, suitable for saving to a filesystem. + * @property null|\Stripe\Collection $links A list of file links that point at this file. + * @property string $purpose The purpose of the uploaded file. + * @property int $size The size in bytes of the file object. + * @property null|string $title A user friendly title for the document. + * @property null|string $type The type of the file returned (e.g., csv, pdf, jpg, or png). + * @property null|string $url The URL from which the file can be downloaded using your live secret API key. + */ +class File extends ApiResource +{ + const OBJECT_NAME = 'file'; + + use ApiOperations\All; + use ApiOperations\Retrieve; + + const PURPOSE_ACCOUNT_REQUIREMENT = 'account_requirement'; + const PURPOSE_ADDITIONAL_VERIFICATION = 'additional_verification'; + const PURPOSE_BUSINESS_ICON = 'business_icon'; + const PURPOSE_BUSINESS_LOGO = 'business_logo'; + const PURPOSE_CUSTOMER_SIGNATURE = 'customer_signature'; + const PURPOSE_DISPUTE_EVIDENCE = 'dispute_evidence'; + const PURPOSE_DOCUMENT_PROVIDER_IDENTITY_DOCUMENT = 'document_provider_identity_document'; + const PURPOSE_FINANCE_REPORT_RUN = 'finance_report_run'; + const PURPOSE_IDENTITY_DOCUMENT = 'identity_document'; + const PURPOSE_IDENTITY_DOCUMENT_DOWNLOADABLE = 'identity_document_downloadable'; + const PURPOSE_PCI_DOCUMENT = 'pci_document'; + const PURPOSE_SELFIE = 'selfie'; + const PURPOSE_SIGMA_SCHEDULED_QUERY = 'sigma_scheduled_query'; + const PURPOSE_TAX_DOCUMENT_USER_UPLOAD = 'tax_document_user_upload'; + + // This resource can have two different object names. In latter API + // versions, only `file` is used, but since stripe-php may be used with + // any API version, we need to support deserializing the older + // `file_upload` object into the same class. + const OBJECT_NAME_ALT = 'file_upload'; + + use ApiOperations\Create { + create as protected _create; + } + + public static function classUrl() + { + return '/v1/files'; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\File the created file + */ + public static function create($params = null, $opts = null) + { + $opts = \Stripe\Util\RequestOptions::parse($opts); + if (null === $opts->apiBase) { + $opts->apiBase = Stripe::$apiUploadBase; + } + // Manually flatten params, otherwise curl's multipart encoder will + // choke on nested arrays. + $flatParams = \array_column(\Stripe\Util\Util::flattenParams($params), 1, 0); + + return static::_create($flatParams, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/FileLink.php b/vendor/stripe/stripe-php/lib/FileLink.php new file mode 100644 index 0000000..ce3b10b --- /dev/null +++ b/vendor/stripe/stripe-php/lib/FileLink.php @@ -0,0 +1,30 @@ +File object with non-Stripe users, you + * can create a FileLink. FileLinks contain a URL that + * can be used to retrieve the contents of the file without authentication. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property bool $expired Whether this link is already expired. + * @property null|int $expires_at Time at which the link expires. + * @property string|\Stripe\File $file The file object this link points to. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $url The publicly accessible URL to download the file. + */ +class FileLink extends ApiResource +{ + const OBJECT_NAME = 'file_link'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/HttpClient/ClientInterface.php b/vendor/stripe/stripe-php/lib/HttpClient/ClientInterface.php new file mode 100644 index 0000000..3c7861e --- /dev/null +++ b/vendor/stripe/stripe-php/lib/HttpClient/ClientInterface.php @@ -0,0 +1,22 @@ +defaultOptions = $defaultOptions; + $this->randomGenerator = $randomGenerator ?: new Util\RandomGenerator(); + $this->initUserAgentInfo(); + + $this->enableHttp2 = $this->canSafelyUseHttp2(); + } + + public function __destruct() + { + $this->closeCurlHandle(); + } + + public function initUserAgentInfo() + { + $curlVersion = \curl_version(); + $this->userAgentInfo = [ + 'httplib' => 'curl ' . $curlVersion['version'], + 'ssllib' => $curlVersion['ssl_version'], + ]; + } + + public function getDefaultOptions() + { + return $this->defaultOptions; + } + + public function getUserAgentInfo() + { + return $this->userAgentInfo; + } + + /** + * @return bool + */ + public function getEnablePersistentConnections() + { + return $this->enablePersistentConnections; + } + + /** + * @param bool $enable + */ + public function setEnablePersistentConnections($enable) + { + $this->enablePersistentConnections = $enable; + } + + /** + * @return bool + */ + public function getEnableHttp2() + { + return $this->enableHttp2; + } + + /** + * @param bool $enable + */ + public function setEnableHttp2($enable) + { + $this->enableHttp2 = $enable; + } + + /** + * @return null|callable + */ + public function getRequestStatusCallback() + { + return $this->requestStatusCallback; + } + + /** + * Sets a callback that is called after each request. The callback will + * receive the following parameters: + *
    + *
  1. string $rbody The response body
  2. + *
  3. integer $rcode The response status code
  4. + *
  5. \Stripe\Util\CaseInsensitiveArray $rheaders The response headers
  6. + *
  7. integer $errno The curl error number
  8. + *
  9. string|null $message The curl error message
  10. + *
  11. boolean $shouldRetry Whether the request will be retried
  12. + *
  13. integer $numRetries The number of the retry attempt
  14. + *
. + * + * @param null|callable $requestStatusCallback + */ + public function setRequestStatusCallback($requestStatusCallback) + { + $this->requestStatusCallback = $requestStatusCallback; + } + + // USER DEFINED TIMEOUTS + + const DEFAULT_TIMEOUT = 80; + const DEFAULT_CONNECT_TIMEOUT = 30; + + private $timeout = self::DEFAULT_TIMEOUT; + private $connectTimeout = self::DEFAULT_CONNECT_TIMEOUT; + + public function setTimeout($seconds) + { + $this->timeout = (int) \max($seconds, 0); + + return $this; + } + + public function setConnectTimeout($seconds) + { + $this->connectTimeout = (int) \max($seconds, 0); + + return $this; + } + + public function getTimeout() + { + return $this->timeout; + } + + public function getConnectTimeout() + { + return $this->connectTimeout; + } + + // END OF USER DEFINED TIMEOUTS + + private function constructRequest($method, $absUrl, $headers, $params, $hasFile) + { + $method = \strtolower($method); + + $opts = []; + if (\is_callable($this->defaultOptions)) { // call defaultOptions callback, set options to return value + $opts = \call_user_func_array($this->defaultOptions, \func_get_args()); + if (!\is_array($opts)) { + throw new Exception\UnexpectedValueException('Non-array value returned by defaultOptions CurlClient callback'); + } + } elseif (\is_array($this->defaultOptions)) { // set default curlopts from array + $opts = $this->defaultOptions; + } + + $params = Util\Util::objectsToIds($params); + + if ('get' === $method) { + if ($hasFile) { + throw new Exception\UnexpectedValueException( + 'Issuing a GET request with a file parameter' + ); + } + $opts[\CURLOPT_HTTPGET] = 1; + if (\count($params) > 0) { + $encoded = Util\Util::encodeParameters($params); + $absUrl = "{$absUrl}?{$encoded}"; + } + } elseif ('post' === $method) { + $opts[\CURLOPT_POST] = 1; + $opts[\CURLOPT_POSTFIELDS] = $hasFile ? $params : Util\Util::encodeParameters($params); + } elseif ('delete' === $method) { + $opts[\CURLOPT_CUSTOMREQUEST] = 'DELETE'; + if (\count($params) > 0) { + $encoded = Util\Util::encodeParameters($params); + $absUrl = "{$absUrl}?{$encoded}"; + } + } else { + throw new Exception\UnexpectedValueException("Unrecognized method {$method}"); + } + + // It is only safe to retry network failures on POST requests if we + // add an Idempotency-Key header + if (('post' === $method) && (Stripe::$maxNetworkRetries > 0)) { + if (!$this->hasHeader($headers, 'Idempotency-Key')) { + $headers[] = 'Idempotency-Key: ' . $this->randomGenerator->uuid(); + } + } + + // By default for large request body sizes (> 1024 bytes), cURL will + // send a request without a body and with a `Expect: 100-continue` + // header, which gives the server a chance to respond with an error + // status code in cases where one can be determined right away (say + // on an authentication problem for example), and saves the "large" + // request body from being ever sent. + // + // Unfortunately, the bindings don't currently correctly handle the + // success case (in which the server sends back a 100 CONTINUE), so + // we'll error under that condition. To compensate for that problem + // for the time being, override cURL's behavior by simply always + // sending an empty `Expect:` header. + $headers[] = 'Expect: '; + + $absUrl = Util\Util::utf8($absUrl); + $opts[\CURLOPT_URL] = $absUrl; + $opts[\CURLOPT_RETURNTRANSFER] = true; + $opts[\CURLOPT_CONNECTTIMEOUT] = $this->connectTimeout; + $opts[\CURLOPT_TIMEOUT] = $this->timeout; + $opts[\CURLOPT_HTTPHEADER] = $headers; + $opts[\CURLOPT_CAINFO] = Stripe::getCABundlePath(); + if (!Stripe::getVerifySslCerts()) { + $opts[\CURLOPT_SSL_VERIFYPEER] = false; + } + + if (!isset($opts[\CURLOPT_HTTP_VERSION]) && $this->getEnableHttp2()) { + // For HTTPS requests, enable HTTP/2, if supported + $opts[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_2TLS; + } + + // Stripe's API servers are only accessible over IPv4. Force IPv4 resolving to avoid + // potential issues (cf. https://github.com/stripe/stripe-php/issues/1045). + $opts[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V4; + + return [$opts, $absUrl]; + } + + public function request($method, $absUrl, $headers, $params, $hasFile) + { + list($opts, $absUrl) = $this->constructRequest($method, $absUrl, $headers, $params, $hasFile); + + list($rbody, $rcode, $rheaders) = $this->executeRequestWithRetries($opts, $absUrl); + + return [$rbody, $rcode, $rheaders]; + } + + public function requestStream($method, $absUrl, $headers, $params, $hasFile, $readBodyChunk) + { + list($opts, $absUrl) = $this->constructRequest($method, $absUrl, $headers, $params, $hasFile); + + $opts[\CURLOPT_RETURNTRANSFER] = false; + list($rbody, $rcode, $rheaders) = $this->executeStreamingRequestWithRetries($opts, $absUrl, $readBodyChunk); + + return [$rbody, $rcode, $rheaders]; + } + + /** + * Curl permits sending \CURLOPT_HEADERFUNCTION, which is called with lines + * from the header and \CURLOPT_WRITEFUNCTION, which is called with bytes + * from the body. You usually want to handle the body differently depending + * on what was in the header. + * + * This function makes it easier to specify different callbacks depending + * on the contents of the heeder. After the header has been completely read + * and the body begins to stream, it will call $determineWriteCallback with + * the array of headers. $determineWriteCallback should, based on the + * headers it receives, return a "writeCallback" that describes what to do + * with the incoming HTTP response body. + * + * @param array $opts + * @param callable $determineWriteCallback + * + * @return array + */ + private function useHeadersToDetermineWriteCallback($opts, $determineWriteCallback) + { + $rheaders = new Util\CaseInsensitiveArray(); + $headerCallback = function ($curl, $header_line) use (&$rheaders) { + return self::parseLineIntoHeaderArray($header_line, $rheaders); + }; + + $writeCallback = null; + $writeCallbackWrapper = function ($curl, $data) use (&$writeCallback, &$rheaders, &$determineWriteCallback) { + if (null === $writeCallback) { + $writeCallback = \call_user_func_array($determineWriteCallback, [$rheaders]); + } + + return \call_user_func_array($writeCallback, [$curl, $data]); + }; + + return [$headerCallback, $writeCallbackWrapper]; + } + + private static function parseLineIntoHeaderArray($line, &$headers) + { + if (false === \strpos($line, ':')) { + return \strlen($line); + } + list($key, $value) = \explode(':', \trim($line), 2); + $headers[\trim($key)] = \trim($value); + + return \strlen($line); + } + + /** + * Like `executeRequestWithRetries` except: + * 1. Does not buffer the body of a successful (status code < 300) + * response into memory -- instead, calls the caller-provided + * $readBodyChunk with each chunk of incoming data. + * 2. Does not retry if a network error occurs while streaming the + * body of a successful response. + * + * @param array $opts cURL options + * @param string $absUrl + * @param callable @readBodyChunk + * @param mixed $readBodyChunk + * + * @return array + */ + public function executeStreamingRequestWithRetries($opts, $absUrl, $readBodyChunk) + { + /** @var bool */ + $shouldRetry = false; + /** @var int */ + $numRetries = 0; + + // Will contain the bytes of the body of the last request + // if it was not successful and should not be retries + /** @var null|string */ + $rbody = null; + + // Status code of the last request + /** @var null|bool */ + $rcode = null; + + // Array of headers from the last request + /** @var null|array */ + $lastRHeaders = null; + + $errno = null; + $message = null; + + $determineWriteCallback = function ($rheaders) use ( + &$readBodyChunk, + &$shouldRetry, + &$rbody, + &$numRetries, + &$rcode, + &$lastRHeaders, + &$errno + ) { + $lastRHeaders = $rheaders; + $errno = \curl_errno($this->curlHandle); + + $rcode = \curl_getinfo($this->curlHandle, \CURLINFO_HTTP_CODE); + + // Send the bytes from the body of a successful request to the caller-provided $readBodyChunk. + if ($rcode < 300) { + $rbody = null; + + return function ($curl, $data) use (&$readBodyChunk) { + // Don't expose the $curl handle to the user, and don't require them to + // return the length of $data. + \call_user_func_array($readBodyChunk, [$data]); + + return \strlen($data); + }; + } + + $shouldRetry = $this->shouldRetry($errno, $rcode, $rheaders, $numRetries); + + // Discard the body from an unsuccessful request that should be retried. + if ($shouldRetry) { + return function ($curl, $data) { + return \strlen($data); + }; + } else { + // Otherwise, buffer the body into $rbody. It will need to be parsed to determine + // which exception to throw to the user. + $rbody = ''; + + return function ($curl, $data) use (&$rbody) { + $rbody .= $data; + + return \strlen($data); + }; + } + }; + + while (true) { + list($headerCallback, $writeCallback) = $this->useHeadersToDetermineWriteCallback($opts, $determineWriteCallback); + $opts[\CURLOPT_HEADERFUNCTION] = $headerCallback; + $opts[\CURLOPT_WRITEFUNCTION] = $writeCallback; + + $shouldRetry = false; + $rbody = null; + $this->resetCurlHandle(); + \curl_setopt_array($this->curlHandle, $opts); + $result = \curl_exec($this->curlHandle); + $errno = \curl_errno($this->curlHandle); + if (0 !== $errno) { + $message = \curl_error($this->curlHandle); + } + if (!$this->getEnablePersistentConnections()) { + $this->closeCurlHandle(); + } + + if (\is_callable($this->getRequestStatusCallback())) { + \call_user_func_array( + $this->getRequestStatusCallback(), + [$rbody, $rcode, $lastRHeaders, $errno, $message, $shouldRetry, $numRetries] + ); + } + + if ($shouldRetry) { + ++$numRetries; + $sleepSeconds = $this->sleepTime($numRetries, $lastRHeaders); + \usleep((int) ($sleepSeconds * 1000000)); + } else { + break; + } + } + + if (0 !== $errno) { + $this->handleCurlError($absUrl, $errno, $message, $numRetries); + } + + return [$rbody, $rcode, $lastRHeaders]; + } + + /** + * @param array $opts cURL options + * @param string $absUrl + */ + public function executeRequestWithRetries($opts, $absUrl) + { + $numRetries = 0; + + while (true) { + $rcode = 0; + $errno = 0; + $message = null; + + // Create a callback to capture HTTP headers for the response + $rheaders = new Util\CaseInsensitiveArray(); + $headerCallback = function ($curl, $header_line) use (&$rheaders) { + return CurlClient::parseLineIntoHeaderArray($header_line, $rheaders); + }; + $opts[\CURLOPT_HEADERFUNCTION] = $headerCallback; + + $this->resetCurlHandle(); + \curl_setopt_array($this->curlHandle, $opts); + $rbody = \curl_exec($this->curlHandle); + + if (false === $rbody) { + $errno = \curl_errno($this->curlHandle); + $message = \curl_error($this->curlHandle); + } else { + $rcode = \curl_getinfo($this->curlHandle, \CURLINFO_HTTP_CODE); + } + if (!$this->getEnablePersistentConnections()) { + $this->closeCurlHandle(); + } + + $shouldRetry = $this->shouldRetry($errno, $rcode, $rheaders, $numRetries); + + if (\is_callable($this->getRequestStatusCallback())) { + \call_user_func_array( + $this->getRequestStatusCallback(), + [$rbody, $rcode, $rheaders, $errno, $message, $shouldRetry, $numRetries] + ); + } + + if ($shouldRetry) { + ++$numRetries; + $sleepSeconds = $this->sleepTime($numRetries, $rheaders); + \usleep((int) ($sleepSeconds * 1000000)); + } else { + break; + } + } + + if (false === $rbody) { + $this->handleCurlError($absUrl, $errno, $message, $numRetries); + } + + return [$rbody, $rcode, $rheaders]; + } + + /** + * @param string $url + * @param int $errno + * @param string $message + * @param int $numRetries + * + * @throws Exception\ApiConnectionException + */ + private function handleCurlError($url, $errno, $message, $numRetries) + { + switch ($errno) { + case \CURLE_COULDNT_CONNECT: + case \CURLE_COULDNT_RESOLVE_HOST: + case \CURLE_OPERATION_TIMEOUTED: + $msg = "Could not connect to Stripe ({$url}). Please check your " + . 'internet connection and try again. If this problem persists, ' + . "you should check Stripe's service status at " + . 'https://twitter.com/stripestatus, or'; + + break; + + case \CURLE_SSL_CACERT: + case \CURLE_SSL_PEER_CERTIFICATE: + $msg = "Could not verify Stripe's SSL certificate. Please make sure " + . 'that your network is not intercepting certificates. ' + . "(Try going to {$url} in your browser.) " + . 'If this problem persists,'; + + break; + + default: + $msg = 'Unexpected error communicating with Stripe. ' + . 'If this problem persists,'; + } + $msg .= ' let us know at support@stripe.com.'; + + $msg .= "\n\n(Network error [errno {$errno}]: {$message})"; + + if ($numRetries > 0) { + $msg .= "\n\nRequest was retried {$numRetries} times."; + } + + throw new Exception\ApiConnectionException($msg); + } + + /** + * Checks if an error is a problem that we should retry on. This includes both + * socket errors that may represent an intermittent problem and some special + * HTTP statuses. + * + * @param int $errno + * @param int $rcode + * @param array|\Stripe\Util\CaseInsensitiveArray $rheaders + * @param int $numRetries + * + * @return bool + */ + private function shouldRetry($errno, $rcode, $rheaders, $numRetries) + { + if ($numRetries >= Stripe::getMaxNetworkRetries()) { + return false; + } + + // Retry on timeout-related problems (either on open or read). + if (\CURLE_OPERATION_TIMEOUTED === $errno) { + return true; + } + + // Destination refused the connection, the connection was reset, or a + // variety of other connection failures. This could occur from a single + // saturated server, so retry in case it's intermittent. + if (\CURLE_COULDNT_CONNECT === $errno) { + return true; + } + + // The API may ask us not to retry (eg; if doing so would be a no-op) + // or advise us to retry (eg; in cases of lock timeouts); we defer to that. + if (isset($rheaders['stripe-should-retry'])) { + if ('false' === $rheaders['stripe-should-retry']) { + return false; + } + if ('true' === $rheaders['stripe-should-retry']) { + return true; + } + } + + // 409 Conflict + if (409 === $rcode) { + return true; + } + + // Retry on 500, 503, and other internal errors. + // + // Note that we expect the stripe-should-retry header to be false + // in most cases when a 500 is returned, since our idempotency framework + // would typically replay it anyway. + if ($rcode >= 500) { + return true; + } + + return false; + } + + /** + * Provides the number of seconds to wait before retrying a request. + * + * @param int $numRetries + * @param array|\Stripe\Util\CaseInsensitiveArray $rheaders + * + * @return int + */ + private function sleepTime($numRetries, $rheaders) + { + // Apply exponential backoff with $initialNetworkRetryDelay on the + // number of $numRetries so far as inputs. Do not allow the number to exceed + // $maxNetworkRetryDelay. + $sleepSeconds = \min( + Stripe::getInitialNetworkRetryDelay() * 1.0 * 2 ** ($numRetries - 1), + Stripe::getMaxNetworkRetryDelay() + ); + + // Apply some jitter by randomizing the value in the range of + // ($sleepSeconds / 2) to ($sleepSeconds). + $sleepSeconds *= 0.5 * (1 + $this->randomGenerator->randFloat()); + + // But never sleep less than the base sleep seconds. + $sleepSeconds = \max(Stripe::getInitialNetworkRetryDelay(), $sleepSeconds); + + // And never sleep less than the time the API asks us to wait, assuming it's a reasonable ask. + $retryAfter = isset($rheaders['retry-after']) ? (float) ($rheaders['retry-after']) : 0.0; + if (\floor($retryAfter) === $retryAfter && $retryAfter <= Stripe::getMaxRetryAfter()) { + $sleepSeconds = \max($sleepSeconds, $retryAfter); + } + + return $sleepSeconds; + } + + /** + * Initializes the curl handle. If already initialized, the handle is closed first. + */ + private function initCurlHandle() + { + $this->closeCurlHandle(); + $this->curlHandle = \curl_init(); + } + + /** + * Closes the curl handle if initialized. Do nothing if already closed. + */ + private function closeCurlHandle() + { + if (null !== $this->curlHandle) { + \curl_close($this->curlHandle); + $this->curlHandle = null; + } + } + + /** + * Resets the curl handle. If the handle is not already initialized, or if persistent + * connections are disabled, the handle is reinitialized instead. + */ + private function resetCurlHandle() + { + if (null !== $this->curlHandle && $this->getEnablePersistentConnections()) { + \curl_reset($this->curlHandle); + } else { + $this->initCurlHandle(); + } + } + + /** + * Indicates whether it is safe to use HTTP/2 or not. + * + * @return bool + */ + private function canSafelyUseHttp2() + { + // Versions of curl older than 7.60.0 don't respect GOAWAY frames + // (cf. https://github.com/curl/curl/issues/2416), which Stripe use. + $curlVersion = \curl_version()['version']; + + return \version_compare($curlVersion, '7.60.0') >= 0; + } + + /** + * Checks if a list of headers contains a specific header name. + * + * @param string[] $headers + * @param string $name + * + * @return bool + */ + private function hasHeader($headers, $name) + { + foreach ($headers as $header) { + if (0 === \strncasecmp($header, "{$name}: ", \strlen($name) + 2)) { + return true; + } + } + + return false; + } +} diff --git a/vendor/stripe/stripe-php/lib/Identity/VerificationReport.php b/vendor/stripe/stripe-php/lib/Identity/VerificationReport.php new file mode 100644 index 0000000..f41007c --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Identity/VerificationReport.php @@ -0,0 +1,45 @@ +type and options parameters used. You can find the + * result of each verification check performed in the appropriate sub-resource: + * document, id_number, selfie. + * + * Each VerificationReport contains a copy of any data collected by the user as + * well as reference IDs which can be used to access collected images through the + * FileUpload API. To configure and + * create VerificationReports, use the VerificationSession + * API. + * + * Related guides: Accessing + * verification results. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property \Stripe\StripeObject $document Result from a document check + * @property \Stripe\StripeObject $id_number Result from an id_number check + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $options + * @property \Stripe\StripeObject $selfie Result from a selfie check + * @property string $type Type of report. + * @property null|string $verification_session ID of the VerificationSession that created this report. + */ +class VerificationReport extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'identity.verification_report'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + + const TYPE_DOCUMENT = 'document'; + const TYPE_ID_NUMBER = 'id_number'; +} diff --git a/vendor/stripe/stripe-php/lib/Identity/VerificationSession.php b/vendor/stripe/stripe-php/lib/Identity/VerificationSession.php new file mode 100644 index 0000000..7e2d6a0 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Identity/VerificationSession.php @@ -0,0 +1,88 @@ +verification check to perform. + * Only create one VerificationSession for each verification in your system. + * + * A VerificationSession transitions through multiple statuses throughout its + * lifetime as it progresses through the verification flow. The VerificationSession + * contains the user’s verified data after verification checks are complete. + * + * Related guide: The Verification + * Sessions API + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|string $client_secret The short-lived client secret used by Stripe.js to show a verification modal inside your app. This client secret expires after 24 hours and can only be used once. Don’t store it, log it, embed it in a URL, or expose it to anyone other than the user. Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs on passing the client secret to the frontend to learn more. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|\Stripe\StripeObject $last_error If present, this property tells you the last error encountered when processing the verification. + * @property null|string|\Stripe\Identity\VerificationReport $last_verification_report ID of the most recent VerificationReport. Learn more about accessing detailed verification results. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\StripeObject $options + * @property null|\Stripe\StripeObject $redaction Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null. + * @property string $status Status of this VerificationSession. Learn more about the lifecycle of sessions. + * @property string $type The type of verification check to be performed. + * @property null|string $url The short-lived URL that you use to redirect a user to Stripe to submit their identity information. This URL expires after 24 hours and can only be used once. Don’t store it, log it, send it in emails or expose it to anyone other than the user. Refer to our docs on verifying identity documents to learn how to redirect users to Stripe. + * @property null|\Stripe\StripeObject $verified_outputs The user’s verified data. + */ +class VerificationSession extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'identity.verification_session'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; + + const STATUS_CANCELED = 'canceled'; + const STATUS_PROCESSING = 'processing'; + const STATUS_REQUIRES_INPUT = 'requires_input'; + const STATUS_VERIFIED = 'verified'; + + const TYPE_DOCUMENT = 'document'; + const TYPE_ID_NUMBER = 'id_number'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\VerificationSession the canceled verification session + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\VerificationSession the redacted verification session + */ + public function redact($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/redact'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/Invoice.php b/vendor/stripe/stripe-php/lib/Invoice.php new file mode 100644 index 0000000..5ced41d --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Invoice.php @@ -0,0 +1,262 @@ +invoice + * items, and proration adjustments that may be caused by subscription + * upgrades/downgrades (if necessary). + * + * If your invoice is configured to be billed through automatic charges, Stripe + * automatically finalizes your invoice and attempts payment. Note that finalizing + * the invoice, when + * automatic, does not happen immediately as the invoice is created. Stripe + * waits until one hour after the last webhook was successfully sent (or the last + * webhook timed out after failing). If you (and the platforms you may have + * connected to) have no webhooks configured, Stripe waits one hour after creation + * to finalize the invoice. + * + * If your invoice is configured to be billed by sending an email, then based on + * your email + * settings, Stripe will email the invoice to your customer and await payment. + * These emails can contain a link to a hosted page to pay the invoice. + * + * Stripe applies any customer credit on the account before determining the amount + * due for the invoice (i.e., the amount that will be actually charged). If the + * amount due for the invoice is less than Stripe's minimum allowed + * charge per currency, the invoice is automatically marked paid, and we add + * the amount due to the customer's credit balance which is applied to the next + * invoice. + * + * More details on the customer's credit balance are here. + * + * Related guide: Send + * Invoices to Customers. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|string $account_country The country of the business associated with this invoice, most often the business creating the invoice. + * @property null|string $account_name The public name of the business associated with this invoice, most often the business creating the invoice. + * @property null|(string|\Stripe\TaxId)[] $account_tax_ids The account tax IDs associated with the invoice. Only editable when the invoice is a draft. + * @property int $amount_due Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the amount_due may be 0. If there is a positive starting_balance for the invoice (the customer owes money), the amount_due will also take that into account. The charge that gets generated for the invoice will be for the amount specified in amount_due. + * @property int $amount_paid The amount, in %s, that was paid. + * @property int $amount_remaining The amount remaining, in %s, that is due. + * @property null|int $application_fee_amount The fee in %s that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. + * @property int $attempt_count Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. + * @property bool $attempted Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the invoice.created webhook, for example, so you might not want to display that invoice as unpaid to your users. + * @property bool $auto_advance Controls whether Stripe will perform automatic collection of the invoice. When false, the invoice's state will not automatically advance without an explicit action. + * @property \Stripe\StripeObject $automatic_tax + * @property null|string $billing_reason Indicates the reason why the invoice was created. subscription_cycle indicates an invoice created by a subscription advancing into a new period. subscription_create indicates an invoice created due to creating a subscription. subscription_update indicates an invoice created due to updating a subscription. subscription is set for all old invoices to indicate either a change to a subscription or a period advancement. manual is set for all invoices unrelated to a subscription (for example: created via the invoice editor). The upcoming value is reserved for simulated invoices per the upcoming invoice endpoint. subscription_threshold indicates an invoice created due to a billing threshold being reached. + * @property null|string|\Stripe\Charge $charge ID of the latest charge generated for this invoice, if any. + * @property null|string $collection_method Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|\Stripe\StripeObject[] $custom_fields Custom fields displayed on the invoice. + * @property null|string|\Stripe\Customer $customer The ID of the customer who will be billed. + * @property null|\Stripe\StripeObject $customer_address The customer's address. Until the invoice is finalized, this field will equal customer.address. Once the invoice is finalized, this field will no longer be updated. + * @property null|string $customer_email The customer's email. Until the invoice is finalized, this field will equal customer.email. Once the invoice is finalized, this field will no longer be updated. + * @property null|string $customer_name The customer's name. Until the invoice is finalized, this field will equal customer.name. Once the invoice is finalized, this field will no longer be updated. + * @property null|string $customer_phone The customer's phone number. Until the invoice is finalized, this field will equal customer.phone. Once the invoice is finalized, this field will no longer be updated. + * @property null|\Stripe\StripeObject $customer_shipping The customer's shipping information. Until the invoice is finalized, this field will equal customer.shipping. Once the invoice is finalized, this field will no longer be updated. + * @property null|string $customer_tax_exempt The customer's tax exempt status. Until the invoice is finalized, this field will equal customer.tax_exempt. Once the invoice is finalized, this field will no longer be updated. + * @property null|\Stripe\StripeObject[] $customer_tax_ids The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as customer.tax_ids. Once the invoice is finalized, this field will no longer be updated. + * @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. + * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. + * @property \Stripe\TaxRate[] $default_tax_rates The tax rates applied to this invoice, if any. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. + * @property null|\Stripe\Discount $discount Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts. + * @property null|(string|\Stripe\Discount)[] $discounts The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. + * @property null|int $due_date The date on which payment for this invoice is due. This value will be null for invoices where collection_method=charge_automatically. + * @property null|int $ending_balance Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null. + * @property null|string $footer Footer displayed on the invoice. + * @property null|string $hosted_invoice_url The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null. + * @property null|string $invoice_pdf The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null. + * @property null|\Stripe\ErrorObject $last_finalization_error The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. + * @property \Stripe\Collection $lines The individual line items that make up the invoice. lines is sorted as follows: invoice items in reverse chronological order, followed by the subscription, if any. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|int $next_payment_attempt The time at which payment will next be attempted. This value will be null for invoices where collection_method=send_invoice. + * @property null|string $number A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified. + * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the Invoices with Connect documentation for details. + * @property bool $paid Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance. + * @property null|string|\Stripe\PaymentIntent $payment_intent The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel the PaymentIntent. + * @property \Stripe\StripeObject $payment_settings + * @property int $period_end End of the usage period during which invoice items were added to this invoice. + * @property int $period_start Start of the usage period during which invoice items were added to this invoice. + * @property int $post_payment_credit_notes_amount Total amount of all post-payment credit notes issued for this invoice. + * @property int $pre_payment_credit_notes_amount Total amount of all pre-payment credit notes issued for this invoice. + * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this invoice. + * @property int $starting_balance Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. + * @property null|string $statement_descriptor Extra information about an invoice for the customer's credit card statement. + * @property null|string $status The status of the invoice, one of draft, open, paid, uncollectible, or void. Learn more + * @property \Stripe\StripeObject $status_transitions + * @property null|string|\Stripe\Subscription $subscription The subscription that this invoice was prepared for, if any. + * @property int $subscription_proration_date Only set for upcoming invoices that preview prorations. The time used to calculate prorations. + * @property int $subtotal Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated + * @property null|int $tax The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice. + * @property \Stripe\StripeObject $threshold_reason + * @property int $total Total after discounts and taxes. + * @property null|\Stripe\StripeObject[] $total_discount_amounts The aggregate amounts calculated per discount across all line items. + * @property \Stripe\StripeObject[] $total_tax_amounts The aggregate amounts calculated per tax rate for all line items. + * @property null|int $webhooks_delivered_at Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have been exhausted. This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created. + */ +class Invoice extends ApiResource +{ + const OBJECT_NAME = 'invoice'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const BILLING_CHARGE_AUTOMATICALLY = 'charge_automatically'; + const BILLING_SEND_INVOICE = 'send_invoice'; + + const BILLING_REASON_MANUAL = 'manual'; + const BILLING_REASON_SUBSCRIPTION = 'subscription'; + const BILLING_REASON_SUBSCRIPTION_CREATE = 'subscription_create'; + const BILLING_REASON_SUBSCRIPTION_CYCLE = 'subscription_cycle'; + const BILLING_REASON_SUBSCRIPTION_THRESHOLD = 'subscription_threshold'; + const BILLING_REASON_SUBSCRIPTION_UPDATE = 'subscription_update'; + const BILLING_REASON_UPCOMING = 'upcoming'; + + const COLLECTION_METHOD_CHARGE_AUTOMATICALLY = 'charge_automatically'; + const COLLECTION_METHOD_SEND_INVOICE = 'send_invoice'; + + const STATUS_DELETED = 'deleted'; + const STATUS_DRAFT = 'draft'; + const STATUS_OPEN = 'open'; + const STATUS_PAID = 'paid'; + const STATUS_UNCOLLECTIBLE = 'uncollectible'; + const STATUS_VOID = 'void'; + + use ApiOperations\NestedResource; + + const PATH_LINES = '/lines'; + + /** + * @param string $id the ID of the invoice on which to retrieve the lines + * @param null|array $params + * @param null|array|string $opts + * + * @throws StripeExceptionApiErrorException if the request fails + * + * @return \Stripe\Collection the list of lines (InvoiceLineItem) + */ + public static function allLines($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_LINES, $params, $opts); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice the finalized invoice + */ + public function finalizeInvoice($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/finalize'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice the uncollectible invoice + */ + public function markUncollectible($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/mark_uncollectible'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice the paid invoice + */ + public function pay($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/pay'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice the sent invoice + */ + public function sendInvoice($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/send'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice the upcoming invoice + */ + public static function upcoming($params = null, $opts = null) + { + $url = static::classUrl() . '/upcoming'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice the voided invoice + */ + public function voidInvoice($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/void'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/InvoiceItem.php b/vendor/stripe/stripe-php/lib/InvoiceItem.php new file mode 100644 index 0000000..6153bbf --- /dev/null +++ b/vendor/stripe/stripe-php/lib/InvoiceItem.php @@ -0,0 +1,49 @@ +Subscription + * Invoices. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount (in the currency specified) of the invoice item. This should always be equal to unit_amount * quantity. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string|\Stripe\Customer $customer The ID of the customer who will be billed when this invoice item is billed. + * @property int $date Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property bool $discountable If true, discounts will apply to this invoice item. Always false for prorations. + * @property null|(string|\Stripe\Discount)[] $discounts The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. + * @property null|string|\Stripe\Invoice $invoice The ID of the invoice this invoice item belongs to. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\StripeObject $period + * @property null|\Stripe\Plan $plan If the invoice item is a proration, the plan of the subscription that the proration was computed for. + * @property null|\Stripe\Price $price The price of the invoice item. + * @property bool $proration Whether the invoice item was created automatically as a proration adjustment when the customer switched plans. + * @property int $quantity Quantity of units for the invoice item. If the invoice item is a proration, the quantity of the subscription that the proration was computed for. + * @property null|string|\Stripe\Subscription $subscription The subscription that this invoice item has been created for, if any. + * @property string $subscription_item The subscription item that this invoice item has been created for, if any. + * @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to the invoice item. When set, the default_tax_rates on the invoice do not apply to this invoice item. + * @property null|int $unit_amount Unit amount (in the currency specified) of the invoice item. + * @property null|string $unit_amount_decimal Same as unit_amount, but contains a decimal value with at most 12 decimal places. + */ +class InvoiceItem extends ApiResource +{ + const OBJECT_NAME = 'invoiceitem'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/InvoiceLineItem.php b/vendor/stripe/stripe-php/lib/InvoiceLineItem.php new file mode 100644 index 0000000..e579afb --- /dev/null +++ b/vendor/stripe/stripe-php/lib/InvoiceLineItem.php @@ -0,0 +1,33 @@ +ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|\Stripe\StripeObject[] $discount_amounts The amount of discount calculated per discount for this line item. + * @property bool $discountable If true, discounts will apply to this line item. Always false for prorations. + * @property null|(string|\Stripe\Discount)[] $discounts The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. + * @property string $invoice_item The ID of the invoice item associated with this line item if any. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with type=subscription this will reflect the metadata of the subscription that caused the line item to be created. + * @property \Stripe\StripeObject $period + * @property null|\Stripe\Plan $plan The plan of the subscription, if the line item is a subscription or a proration. + * @property null|\Stripe\Price $price The price of the line item. + * @property bool $proration Whether this is a proration. + * @property null|int $quantity The quantity of the subscription, if the line item is a subscription or a proration. + * @property null|string $subscription The subscription that the invoice item pertains to, if any. + * @property string $subscription_item The subscription item that generated this invoice item. Left empty if the line item is not an explicit result of a subscription. + * @property \Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item + * @property \Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item. + * @property string $type A string identifying the type of the source of this line item, either an invoiceitem or a subscription. + */ +class InvoiceLineItem extends ApiResource +{ + const OBJECT_NAME = 'line_item'; +} diff --git a/vendor/stripe/stripe-php/lib/Issuing/Authorization.php b/vendor/stripe/stripe-php/lib/Issuing/Authorization.php new file mode 100644 index 0000000..a649235 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Issuing/Authorization.php @@ -0,0 +1,81 @@ +issued card is used to + * make a purchase, an Issuing Authorization object is created. Authorizations + * must be approved for the purchase to be completed successfully. + * + * Related guide: Issued Card + * Authorizations. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount The total amount that was authorized or rejected. This amount is in the card's currency and in the smallest currency unit. + * @property null|\Stripe\StripeObject $amount_details Detailed breakdown of amount components. These amounts are denominated in currency and in the smallest currency unit. + * @property bool $approved Whether the authorization has been approved. + * @property string $authorization_method How the card details were provided. + * @property \Stripe\BalanceTransaction[] $balance_transactions List of balance transactions associated with this authorization. + * @property \Stripe\Issuing\Card $card You can create physical or virtual cards that are issued to cardholders. + * @property null|string|\Stripe\Issuing\Cardholder $cardholder The cardholder to whom this authorization belongs. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property int $merchant_amount The total amount that was authorized or rejected. This amount is in the merchant_currency and in the smallest currency unit. + * @property string $merchant_currency The currency that was presented to the cardholder for the authorization. Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property \Stripe\StripeObject $merchant_data + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|\Stripe\StripeObject $pending_request The pending authorization request. This field will only be non-null during an issuing_authorization.request webhook. + * @property \Stripe\StripeObject[] $request_history History of every time pending_request was approved/denied, either by you directly or by Stripe (e.g. based on your spending_controls). If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. + * @property string $status The current status of the authorization in its lifecycle. + * @property \Stripe\Issuing\Transaction[] $transactions List of transactions associated with this authorization. + * @property \Stripe\StripeObject $verification_data + * @property null|string $wallet What, if any, digital wallet was used for this authorization. One of apple_pay, google_pay, or samsung_pay. + */ +class Authorization extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'issuing.authorization'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Authorization the approved authorization + */ + public function approve($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/approve'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Authorization the declined authorization + */ + public function decline($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/decline'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/Issuing/Card.php b/vendor/stripe/stripe-php/lib/Issuing/Card.php new file mode 100644 index 0000000..e0ac774 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Issuing/Card.php @@ -0,0 +1,59 @@ +create physical or + * virtual cards that are issued to cardholders. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string $brand The brand of the card. + * @property null|string $cancellation_reason The reason why the card was canceled. + * @property \Stripe\Issuing\Cardholder $cardholder

An Issuing Cardholder object represents an individual or business entity who is issued cards.

Related guide: How to create a Cardholder

+ * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string $cvc The card's CVC. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with the expand parameter. Additionally, it's only available via the "Retrieve a card" endpoint, not via "List all cards" or any other endpoint. + * @property int $exp_month The expiration month of the card. + * @property int $exp_year The expiration year of the card. + * @property string $last4 The last 4 digits of the card number. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $number The full unredacted card number. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with the expand parameter. Additionally, it's only available via the "Retrieve a card" endpoint, not via "List all cards" or any other endpoint. + * @property null|string|\Stripe\Issuing\Card $replaced_by The latest card that replaces this card, if any. + * @property null|string|\Stripe\Issuing\Card $replacement_for The card this card replaces, if any. + * @property null|string $replacement_reason The reason why the previous card needed to be replaced. + * @property null|\Stripe\StripeObject $shipping Where and how the card will be shipped. + * @property \Stripe\StripeObject $spending_controls + * @property string $status Whether authorizations can be approved on this card. + * @property string $type The type of the card. + */ +class Card extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'issuing.card'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\CardDetails the card details associated with that issuing card + */ + public function details($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/details'; + list($response, $opts) = $this->_request('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); + $obj->setLastResponse($response); + + return $obj; + } +} diff --git a/vendor/stripe/stripe-php/lib/Issuing/CardDetails.php b/vendor/stripe/stripe-php/lib/Issuing/CardDetails.php new file mode 100644 index 0000000..98f4e0b --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Issuing/CardDetails.php @@ -0,0 +1,19 @@ +Cardholder object represents an individual or business + * entity who is issued cards. + * + * Related guide: How to create a + * Cardholder + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property \Stripe\StripeObject $billing + * @property null|\Stripe\StripeObject $company Additional information about a company cardholder. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $email The cardholder's email address. + * @property null|\Stripe\StripeObject $individual Additional information about an individual cardholder. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $name The cardholder's name. This will be printed on cards issued to them. + * @property null|string $phone_number The cardholder's phone number. + * @property \Stripe\StripeObject $requirements + * @property null|\Stripe\StripeObject $spending_controls Rules that control spending across this cardholder's cards. Refer to our documentation for more details. + * @property string $status Specifies whether to permit authorizations on this cardholder's cards. + * @property string $type One of individual or company. + */ +class Cardholder extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'issuing.cardholder'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/Issuing/Dispute.php b/vendor/stripe/stripe-php/lib/Issuing/Dispute.php new file mode 100644 index 0000000..2a80c3b --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Issuing/Dispute.php @@ -0,0 +1,53 @@ +card issuer, you can dispute + * transactions that the cardholder does not recognize, suspects to be fraudulent, + * or has other issues with. + * + * Related guide: Disputing + * Transactions + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Disputed amount. Usually the amount of the transaction, but can differ (usually because of currency fluctuation). + * @property null|\Stripe\BalanceTransaction[] $balance_transactions List of balance transactions associated with the dispute. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency The currency the transaction was made in. + * @property \Stripe\StripeObject $evidence + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $status Current status of the dispute. + * @property string|\Stripe\Issuing\Transaction $transaction The transaction being disputed. + */ +class Dispute extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'issuing.dispute'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Dispute the submited dispute + */ + public function submit($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/submit'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/Issuing/Transaction.php b/vendor/stripe/stripe-php/lib/Issuing/Transaction.php new file mode 100644 index 0000000..3c44d7e --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Issuing/Transaction.php @@ -0,0 +1,43 @@ +issued card that + * results in funds entering or leaving your Stripe account, such as a completed + * purchase or refund, is represented by an Issuing Transaction + * object. + * + * Related guide: Issued Card + * Transactions. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount The transaction amount, which will be reflected in your balance. This amount is in your currency and in the smallest currency unit. + * @property null|\Stripe\StripeObject $amount_details Detailed breakdown of amount components. These amounts are denominated in currency and in the smallest currency unit. + * @property null|string|\Stripe\Issuing\Authorization $authorization The Authorization object that led to this transaction. + * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction associated with this transaction. + * @property string|\Stripe\Issuing\Card $card The card used to make this transaction. + * @property null|string|\Stripe\Issuing\Cardholder $cardholder The cardholder to whom this transaction belongs. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string|\Stripe\Issuing\Dispute $dispute If you've disputed the transaction, the ID of the dispute. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property int $merchant_amount The amount that the merchant will receive, denominated in merchant_currency and in the smallest currency unit. It will be different from amount if the merchant is taking payment in a different currency. + * @property string $merchant_currency The currency with which the merchant is taking payment. + * @property \Stripe\StripeObject $merchant_data + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|\Stripe\StripeObject $purchase_details Additional purchase information that is optionally provided by the merchant. + * @property string $type The nature of the transaction. + */ +class Transaction extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'issuing.transaction'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/LineItem.php b/vendor/stripe/stripe-php/lib/LineItem.php new file mode 100644 index 0000000..0a41346 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/LineItem.php @@ -0,0 +1,26 @@ +ISO currency code, in lowercase. Must be a supported currency. + * @property string $description An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name. + * @property \Stripe\StripeObject[] $discounts The discounts applied to the line item. + * @property null|\Stripe\Price $price The price used to generate the line item. + * @property null|int $quantity The quantity of products being purchased. + * @property \Stripe\StripeObject[] $taxes The taxes applied to the line item. + */ +class LineItem extends ApiResource +{ + const OBJECT_NAME = 'item'; + + use ApiOperations\All; +} diff --git a/vendor/stripe/stripe-php/lib/LoginLink.php b/vendor/stripe/stripe-php/lib/LoginLink.php new file mode 100644 index 0000000..3351356 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/LoginLink.php @@ -0,0 +1,15 @@ +true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $multi_use + * @property string|\Stripe\PaymentMethod $payment_method ID of the payment method associated with this mandate. + * @property \Stripe\StripeObject $payment_method_details + * @property \Stripe\StripeObject $single_use + * @property string $status The status of the mandate, which indicates whether it can be used to initiate a payment. + * @property string $type The type of the mandate. + */ +class Mandate extends ApiResource +{ + const OBJECT_NAME = 'mandate'; + + use ApiOperations\Retrieve; +} diff --git a/vendor/stripe/stripe-php/lib/OAuth.php b/vendor/stripe/stripe-php/lib/OAuth.php new file mode 100644 index 0000000..7b0886e --- /dev/null +++ b/vendor/stripe/stripe-php/lib/OAuth.php @@ -0,0 +1,101 @@ +request( + 'post', + '/oauth/token', + $params, + null + ); + + return Util\Util::convertToStripeObject($response->json, $opts); + } + + /** + * Disconnects an account from your platform. + * + * @param null|array $params + * @param null|array $opts + * + * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails + * + * @return StripeObject object containing the response from the API + */ + public static function deauthorize($params = null, $opts = null) + { + $params = $params ?: []; + $base = ($opts && \array_key_exists('connect_base', $opts)) ? $opts['connect_base'] : Stripe::$connectBase; + $requestor = new ApiRequestor(null, $base); + $params['client_id'] = self::_getClientId($params); + list($response, $apiKey) = $requestor->request( + 'post', + '/oauth/deauthorize', + $params, + null + ); + + return Util\Util::convertToStripeObject($response->json, $opts); + } + + private static function _getClientId($params = null) + { + $clientId = ($params && \array_key_exists('client_id', $params)) ? $params['client_id'] : null; + if (null === $clientId) { + $clientId = Stripe::getClientId(); + } + if (null === $clientId) { + $msg = 'No client_id provided. (HINT: set your client_id using ' + . '"Stripe::setClientId()". You can find your client_ids ' + . 'in your Stripe dashboard at ' + . 'https://dashboard.stripe.com/account/applications/settings, ' + . 'after registering your account as a platform. See ' + . 'https://stripe.com/docs/connect/standard-accounts for details, ' + . 'or email support@stripe.com if you have any questions.'; + + throw new Exception\AuthenticationException($msg); + } + + return $clientId; + } +} diff --git a/vendor/stripe/stripe-php/lib/OAuthErrorObject.php b/vendor/stripe/stripe-php/lib/OAuthErrorObject.php new file mode 100644 index 0000000..620c5bb --- /dev/null +++ b/vendor/stripe/stripe-php/lib/OAuthErrorObject.php @@ -0,0 +1,31 @@ + null, + 'error_description' => null, + ], $values); + parent::refreshFrom($values, $opts, $partial); + } +} diff --git a/vendor/stripe/stripe-php/lib/Order.php b/vendor/stripe/stripe-php/lib/Order.php new file mode 100644 index 0000000..52fa2c7 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Order.php @@ -0,0 +1,81 @@ +products. You can + * create, retrieve, and pay individual orders, as well as list all orders. Orders + * are identified by a unique, random ID. + * + * Related guide: Tax, Shipping, and + * Inventory. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order. + * @property null|int $amount_returned The total amount that was returned to the customer. + * @property null|string $application ID of the Connect Application that created the order. + * @property null|int $application_fee A fee in cents that will be applied to the order and transferred to the application owner’s Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees documentation. + * @property null|string|\Stripe\Charge $charge The ID of the payment used to pay for the order. Present if the order status is paid, fulfilled, or refunded. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string|\Stripe\Customer $customer The customer used for the order. + * @property null|string $email The email address of the customer placing the order. + * @property string $external_coupon_code External coupon code to load for this order. + * @property \Stripe\OrderItem[] $items List of items constituting the order. An order can have up to 25 items. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|\Stripe\Collection $returns A list of returns that have taken place for this order. + * @property null|string $selected_shipping_method The shipping method that is currently selected for this order, if any. If present, it is equal to one of the ids of shipping methods in the shipping_methods array. At order creation time, if there are multiple shipping methods, Stripe will automatically selected the first method. + * @property null|\Stripe\StripeObject $shipping The shipping address for the order. Present if the order is for goods to be shipped. + * @property null|\Stripe\StripeObject[] $shipping_methods A list of supported shipping methods for this order. The desired shipping method can be specified either by updating the order, or when paying it. + * @property string $status Current order status. One of created, paid, canceled, fulfilled, or returned. More details in the Orders Guide. + * @property null|\Stripe\StripeObject $status_transitions The timestamps at which the order status was updated. + * @property null|int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. + * @property string $upstream_id The user's order ID if it is different from the Stripe order ID. + */ +class Order extends ApiResource +{ + const OBJECT_NAME = 'order'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\OrderReturn the newly created return + */ + public function returnOrder($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/returns'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + + return Util\Util::convertToStripeObject($response, $opts); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Order the paid order + */ + public function pay($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/pay'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/OrderItem.php b/vendor/stripe/stripe-php/lib/OrderItem.php new file mode 100644 index 0000000..e2e6e39 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/OrderItem.php @@ -0,0 +1,19 @@ +order items. Returns always + * belong to an order, and may optionally contain a refund. + * + * Related guide: Handling + * Returns. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the returned line item. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property \Stripe\OrderItem[] $items The items included in this order return. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string|\Stripe\Order $order The order that this return includes items from. + * @property null|string|\Stripe\Refund $refund The ID of the refund issued for this return. + */ +class OrderReturn extends ApiResource +{ + const OBJECT_NAME = 'order_return'; + + use ApiOperations\All; + use ApiOperations\Retrieve; +} diff --git a/vendor/stripe/stripe-php/lib/PaymentIntent.php b/vendor/stripe/stripe-php/lib/PaymentIntent.php new file mode 100644 index 0000000..7a02f1f --- /dev/null +++ b/vendor/stripe/stripe-php/lib/PaymentIntent.php @@ -0,0 +1,125 @@ +multiple + * statuses throughout its lifetime as it interfaces with Stripe.js to perform + * authentication flows and ultimately creates at most one successful charge. + * + * Related guide: Payment Intents API. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + * @property int $amount_capturable Amount that can be captured from this PaymentIntent. + * @property int $amount_received Amount that was collected by this PaymentIntent. + * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the PaymentIntent. + * @property null|int $application_fee_amount The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents use case for connected accounts. + * @property null|int $canceled_at Populated when status is canceled, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch. + * @property null|string $cancellation_reason Reason for cancellation of this PaymentIntent, either user-provided (duplicate, fraudulent, requested_by_customer, or abandoned) or generated by Stripe internally (failed_invoice, void_invoice, or automatic). + * @property string $capture_method Controls when the funds will be captured from the customer's account. + * @property \Stripe\Collection $charges Charges that were created by this PaymentIntent, if any. + * @property null|string $client_secret

The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key.

The client secret can be used to complete a payment from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.

Refer to our docs to accept a payment and learn about how client_secret should be handled.

+ * @property string $confirmation_method + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string|\Stripe\Customer $customer

ID of the Customer this PaymentIntent belongs to, if one exists.

Payment methods attached to other Customers cannot be used with this PaymentIntent.

If present in combination with setup_future_usage, this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete.

+ * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string|\Stripe\Invoice $invoice ID of the invoice that created this PaymentIntent, if it exists. + * @property null|\Stripe\ErrorObject $last_payment_error The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. For more information, see the documentation. + * @property null|\Stripe\StripeObject $next_action If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. + * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents use case for connected accounts for details. + * @property null|string|\Stripe\PaymentMethod $payment_method ID of the payment method used in this PaymentIntent. + * @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for this PaymentIntent. + * @property string[] $payment_method_types The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. + * @property null|string $receipt_email Email address that the receipt for the resulting payment will be sent to. If receipt_email is specified for a payment in live mode, a receipt will be sent regardless of your email settings. + * @property null|string|\Stripe\Review $review ID of the review associated with this PaymentIntent, if any. + * @property null|string $setup_future_usage

Indicates that you intend to make future payments with this PaymentIntent's payment method.

Providing this parameter will attach the payment method to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be attached to a Customer after the transaction completes.

When processing card payments, Stripe also uses setup_future_usage to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA.

+ * @property null|\Stripe\StripeObject $shipping Shipping information for this PaymentIntent. + * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $source This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied. + * @property null|string $statement_descriptor For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters. + * @property null|string $statement_descriptor_suffix Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + * @property string $status Status of this PaymentIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, requires_capture, canceled, or succeeded. Read more about each PaymentIntent status. + * @property null|\Stripe\StripeObject $transfer_data The data with which to automatically create a Transfer when the payment is finalized. See the PaymentIntents use case for connected accounts for details. + * @property null|string $transfer_group A string that identifies the resulting payment as part of a group. See the PaymentIntents use case for connected accounts for details. + */ +class PaymentIntent extends ApiResource +{ + const OBJECT_NAME = 'payment_intent'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const STATUS_CANCELED = 'canceled'; + const STATUS_PROCESSING = 'processing'; + const STATUS_REQUIRES_ACTION = 'requires_action'; + const STATUS_REQUIRES_CAPTURE = 'requires_capture'; + const STATUS_REQUIRES_CONFIRMATION = 'requires_confirmation'; + const STATUS_REQUIRES_PAYMENT_METHOD = 'requires_payment_method'; + const STATUS_SUCCEEDED = 'succeeded'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent the canceled payment intent + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent the captured payment intent + */ + public function capture($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/capture'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent the confirmed payment intent + */ + public function confirm($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/confirm'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/PaymentMethod.php b/vendor/stripe/stripe-php/lib/PaymentMethod.php new file mode 100644 index 0000000..36a01d3 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/PaymentMethod.php @@ -0,0 +1,90 @@ +PaymentIntents to + * collect payments or saved to Customer objects to store instrument details for + * future payments. + * + * Related guides: Payment Methods and + * More Payment + * Scenarios. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property \Stripe\StripeObject $acss_debit + * @property \Stripe\StripeObject $afterpay_clearpay + * @property \Stripe\StripeObject $alipay + * @property \Stripe\StripeObject $au_becs_debit + * @property \Stripe\StripeObject $bacs_debit + * @property \Stripe\StripeObject $bancontact + * @property \Stripe\StripeObject $billing_details + * @property \Stripe\StripeObject $boleto + * @property \Stripe\StripeObject $card + * @property \Stripe\StripeObject $card_present + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string|\Stripe\Customer $customer The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. + * @property \Stripe\StripeObject $eps + * @property \Stripe\StripeObject $fpx + * @property \Stripe\StripeObject $giropay + * @property \Stripe\StripeObject $grabpay + * @property \Stripe\StripeObject $ideal + * @property \Stripe\StripeObject $interac_present + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\StripeObject $oxxo + * @property \Stripe\StripeObject $p24 + * @property \Stripe\StripeObject $sepa_debit + * @property \Stripe\StripeObject $sofort + * @property string $type The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + * @property \Stripe\StripeObject $wechat_pay + */ +class PaymentMethod extends ApiResource +{ + const OBJECT_NAME = 'payment_method'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentMethod the attached payment method + */ + public function attach($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/attach'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentMethod the detached payment method + */ + public function detach($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/detach'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/Payout.php b/vendor/stripe/stripe-php/lib/Payout.php new file mode 100644 index 0000000..edbe492 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Payout.php @@ -0,0 +1,108 @@ +Payout object is created when you receive funds from Stripe, or + * when you initiate a payout to either a bank account or debit card of a connected Stripe account. You + * can retrieve individual payouts, as well as list all payouts. Payouts are made + * on varying schedules, + * depending on your country and industry. + * + * Related guide: Receiving Payouts. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount (in %s) to be transferred to your bank account or debit card. + * @property int $arrival_date Date the payout is expected to arrive in the bank. This factors in delays like weekends or bank holidays. + * @property bool $automatic Returns true if the payout was created by an automated payout schedule, and false if it was requested manually. + * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this payout on your account balance. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string|\Stripe\BankAccount|\Stripe\Card $destination ID of the bank account or card the payout was sent to. + * @property null|string|\Stripe\BalanceTransaction $failure_balance_transaction If the payout failed or was canceled, this will be the ID of the balance transaction that reversed the initial balance transaction, and puts the funds from the failed payout back in your balance. + * @property null|string $failure_code Error code explaining reason for payout failure if available. See Types of payout failures for a list of failure codes. + * @property null|string $failure_message Message to user further explaining reason for payout failure if available. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $method The method used to send this payout, which can be standard or instant. instant is only supported for payouts to debit cards. (See Instant payouts for marketplaces for more information.) + * @property null|string|\Stripe\Payout $original_payout If the payout reverses another, this is the ID of the original payout. + * @property null|string|\Stripe\Payout $reversed_by If the payout was reversed, this is the ID of the payout that reverses this payout. + * @property string $source_type The source balance this payout came from. One of card, fpx, or bank_account. + * @property null|string $statement_descriptor Extra information about a payout to be displayed on the user's bank statement. + * @property string $status Current status of the payout: paid, pending, in_transit, canceled or failed. A payout is pending until it is submitted to the bank, when it becomes in_transit. The status then changes to paid if the transaction goes through, or to failed or canceled (within 5 business days). Some failed payouts may initially show as paid but then change to failed. + * @property string $type Can be bank_account or card. + */ +class Payout extends ApiResource +{ + const OBJECT_NAME = 'payout'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const FAILURE_ACCOUNT_CLOSED = 'account_closed'; + const FAILURE_ACCOUNT_FROZEN = 'account_frozen'; + const FAILURE_BANK_ACCOUNT_RESTRICTED = 'bank_account_restricted'; + const FAILURE_BANK_OWNERSHIP_CHANGED = 'bank_ownership_changed'; + const FAILURE_COULD_NOT_PROCESS = 'could_not_process'; + const FAILURE_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized'; + const FAILURE_DECLINED = 'declined'; + const FAILURE_INCORRECT_ACCOUNT_HOLDER_NAME = 'incorrect_account_holder_name'; + const FAILURE_INSUFFICIENT_FUNDS = 'insufficient_funds'; + const FAILURE_INVALID_ACCOUNT_NUMBER = 'invalid_account_number'; + const FAILURE_INVALID_CURRENCY = 'invalid_currency'; + const FAILURE_NO_ACCOUNT = 'no_account'; + const FAILURE_UNSUPPORTED_CARD = 'unsupported_card'; + + const METHOD_INSTANT = 'instant'; + const METHOD_STANDARD = 'standard'; + + const STATUS_CANCELED = 'canceled'; + const STATUS_FAILED = 'failed'; + const STATUS_IN_TRANSIT = 'in_transit'; + const STATUS_PAID = 'paid'; + const STATUS_PENDING = 'pending'; + + const TYPE_BANK_ACCOUNT = 'bank_account'; + const TYPE_CARD = 'card'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Payout the canceled payout + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Payout the reversed payout + */ + public function reverse($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/reverse'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/Person.php b/vendor/stripe/stripe-php/lib/Person.php new file mode 100644 index 0000000..ad2b46f --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Person.php @@ -0,0 +1,120 @@ +Standard onboarding + * or Express onboarding + * documentation for information about platform pre-filling and account + * onboarding steps. + * + * Related guide: Handling + * Identity Verification with the API. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string $account The account the person is associated with. + * @property \Stripe\StripeObject $address + * @property null|\Stripe\StripeObject $address_kana The Kana variation of the person's address (Japan only). + * @property null|\Stripe\StripeObject $address_kanji The Kanji variation of the person's address (Japan only). + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property \Stripe\StripeObject $dob + * @property null|string $email The person's email address. + * @property null|string $first_name The person's first name. + * @property null|string $first_name_kana The Kana variation of the person's first name (Japan only). + * @property null|string $first_name_kanji The Kanji variation of the person's first name (Japan only). + * @property null|string $gender The person's gender (International regulations require either "male" or "female"). + * @property bool $id_number_provided Whether the person's id_number was provided. + * @property null|string $last_name The person's last name. + * @property null|string $last_name_kana The Kana variation of the person's last name (Japan only). + * @property null|string $last_name_kanji The Kanji variation of the person's last name (Japan only). + * @property null|string $maiden_name The person's maiden name. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $nationality The country where the person is a national. + * @property null|string $phone The person's phone number. + * @property string $political_exposure Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + * @property \Stripe\StripeObject $relationship + * @property null|\Stripe\StripeObject $requirements Information about the requirements for this person, including what information needs to be collected, and by when. + * @property bool $ssn_last_4_provided Whether the last four digits of the person's Social Security number have been provided (U.S. only). + * @property \Stripe\StripeObject $verification + */ +class Person extends ApiResource +{ + const OBJECT_NAME = 'person'; + + use ApiOperations\Delete; + use ApiOperations\Update; + + const GENDER_FEMALE = 'female'; + const GENDER_MALE = 'male'; + + const POLITICAL_EXPOSURE_EXISTING = 'existing'; + const POLITICAL_EXPOSURE_NONE = 'none'; + + const VERIFICATION_STATUS_PENDING = 'pending'; + const VERIFICATION_STATUS_UNVERIFIED = 'unverified'; + const VERIFICATION_STATUS_VERIFIED = 'verified'; + + /** + * @return string the API URL for this Stripe account reversal + */ + public function instanceUrl() + { + $id = $this['id']; + $account = $this['account']; + if (!$id) { + throw new Exception\UnexpectedValueException( + 'Could not determine which URL to request: ' . + "class instance has invalid ID: {$id}", + null + ); + } + $id = Util\Util::utf8($id); + $account = Util\Util::utf8($account); + + $base = Account::classUrl(); + $accountExtn = \urlencode($account); + $extn = \urlencode($id); + + return "{$base}/{$accountExtn}/persons/{$extn}"; + } + + /** + * @param array|string $_id + * @param null|array|string $_opts + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function retrieve($_id, $_opts = null) + { + $msg = 'Persons cannot be retrieved without an account ID. Retrieve ' . + "a person using `Account::retrievePerson('account_id', " . + "'person_id')`."; + + throw new Exception\BadMethodCallException($msg); + } + + /** + * @param string $_id + * @param null|array $_params + * @param null|array|string $_options + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function update($_id, $_params = null, $_options = null) + { + $msg = 'Persons cannot be updated without an account ID. Update ' . + "a person using `Account::updatePerson('account_id', " . + "'person_id', \$updateParams)`."; + + throw new Exception\BadMethodCallException($msg); + } +} diff --git a/vendor/stripe/stripe-php/lib/Plan.php b/vendor/stripe/stripe-php/lib/Plan.php new file mode 100644 index 0000000..2a818e4 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Plan.php @@ -0,0 +1,57 @@ +Prices API. It replaces the Plans + * API and is backwards compatible to simplify your migration. + * + * Plans define the base price, currency, and billing cycle for recurring purchases + * of products. Products help + * you track inventory or provisioning, and plans help you track pricing. Different + * physical goods or levels of service should be represented by products, and + * pricing options should be represented by plans. This approach lets you change + * prices without having to change your provisioning scheme. + * + * For example, you might have a single "gold" product that has plans for + * $10/month, $100/year, €9/month, and €90/year. + * + * Related guides: Set up + * a subscription and more about products and prices. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property bool $active Whether the plan can be used for new purchases. + * @property null|string $aggregate_usage Specifies a usage aggregation strategy for plans of usage_type=metered. Allowed values are sum for summing up all usage during a period, last_during_period for using the last usage record reported within a period, last_ever for using the last usage record ever (across period bounds) or max which uses the usage record with the maximum reported usage during a period. Defaults to sum. + * @property null|int $amount The unit amount in %s to be charged, represented as a whole integer if possible. Only set if billing_scheme=per_unit. + * @property null|string $amount_decimal The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if billing_scheme=per_unit. + * @property string $billing_scheme Describes how to compute the price per period. Either per_unit or tiered. per_unit indicates that the fixed amount (specified in amount) will be charged per unit in quantity (for plans with usage_type=licensed), or per unit of total usage (for plans with usage_type=metered). tiered indicates that the unit pricing will be computed using a tiering strategy as defined using the tiers and tiers_mode attributes. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string $interval The frequency at which a subscription is billed. One of day, week, month or year. + * @property int $interval_count The number of intervals (specified in the interval attribute) between subscription billings. For example, interval=month and interval_count=3 bills every 3 months. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $nickname A brief description of the plan, hidden from customers. + * @property null|string|\Stripe\Product $product The product whose pricing this plan determines. + * @property \Stripe\StripeObject[] $tiers Each element represents a pricing tier. This parameter requires billing_scheme to be set to tiered. See also the documentation for billing_scheme. + * @property null|string $tiers_mode Defines if the tiering price should be graduated or volume based. In volume-based tiering, the maximum quantity within a period determines the per unit price. In graduated tiering, pricing can change as the quantity grows. + * @property null|\Stripe\StripeObject $transform_usage Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with tiers. + * @property null|int $trial_period_days Default number of trial days when subscribing a customer to this plan using trial_from_plan=true. + * @property string $usage_type Configures how the quantity per period should be determined. Can be either metered or licensed. licensed automatically bills the quantity set when adding it to a subscription. metered aggregates the total usage based on usage records. Defaults to licensed. + */ +class Plan extends ApiResource +{ + const OBJECT_NAME = 'plan'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/Price.php b/vendor/stripe/stripe-php/lib/Price.php new file mode 100644 index 0000000..8f994d5 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Price.php @@ -0,0 +1,67 @@ +Products help you track + * inventory or provisioning, and prices help you track payment terms. Different + * physical goods or levels of service should be represented by products, and + * pricing options should be represented by prices. This approach lets you change + * prices without having to change your provisioning scheme. + * + * For example, you might have a single "gold" product that has prices + * for $10/month, $100/year, and €9 once. + * + * Related guides: Set up + * a subscription, create an invoice, + * and more about products + * and prices. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property bool $active Whether the price can be used for new purchases. + * @property string $billing_scheme Describes how to compute the price per period. Either per_unit or tiered. per_unit indicates that the fixed amount (specified in unit_amount or unit_amount_decimal) will be charged per unit in quantity (for prices with usage_type=licensed), or per unit of total usage (for prices with usage_type=metered). tiered indicates that the unit pricing will be computed using a tiering strategy as defined using the tiers and tiers_mode attributes. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string $lookup_key A lookup key used to retrieve prices dynamically from a static string. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $nickname A brief description of the price, hidden from customers. + * @property string|\Stripe\Product $product The ID of the product this price is associated with. + * @property null|\Stripe\StripeObject $recurring The recurring components of a price such as interval and usage_type. + * @property null|string $tax_behavior Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of inclusive, exclusive, or unspecified. Once specified as either inclusive or exclusive, it cannot be changed. + * @property \Stripe\StripeObject[] $tiers Each element represents a pricing tier. This parameter requires billing_scheme to be set to tiered. See also the documentation for billing_scheme. + * @property null|string $tiers_mode Defines if the tiering price should be graduated or volume based. In volume-based tiering, the maximum quantity within a period determines the per unit price. In graduated tiering, pricing can change as the quantity grows. + * @property null|\Stripe\StripeObject $transform_quantity Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with tiers. + * @property string $type One of one_time or recurring depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. + * @property null|int $unit_amount The unit amount in %s to be charged, represented as a whole integer if possible. Only set if billing_scheme=per_unit. + * @property null|string $unit_amount_decimal The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if billing_scheme=per_unit. + */ +class Price extends ApiResource +{ + const OBJECT_NAME = 'price'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const BILLING_SCHEME_PER_UNIT = 'per_unit'; + const BILLING_SCHEME_TIERED = 'tiered'; + + const TAX_BEHAVIOR_EXCLUSIVE = 'exclusive'; + const TAX_BEHAVIOR_INCLUSIVE = 'inclusive'; + const TAX_BEHAVIOR_UNSPECIFIED = 'unspecified'; + + const TIERS_MODE_GRADUATED = 'graduated'; + const TIERS_MODE_VOLUME = 'volume'; + + const TYPE_ONE_TIME = 'one_time'; + const TYPE_RECURRING = 'recurring'; +} diff --git a/vendor/stripe/stripe-php/lib/Product.php b/vendor/stripe/stripe-php/lib/Product.php new file mode 100644 index 0000000..3164096 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Product.php @@ -0,0 +1,54 @@ +Prices to + * configure pricing in Checkout and Subscriptions. + * + * Related guides: Set up + * a subscription or accept one-time + * payments with Checkout and more about Products and Prices + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property bool $active Whether the product is currently available for purchase. + * @property null|string[] $attributes A list of up to 5 attributes that each SKU can provide values for (e.g., ["color", "size"]). + * @property null|string $caption A short one-line description of the product, meant to be displayable to the customer. Only applicable to products of type=good. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string[] $deactivate_on An array of connect application identifiers that cannot purchase this product. Only applicable to products of type=good. + * @property null|string $description The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + * @property string[] $images A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $name The product's name, meant to be displayable to the customer. Whenever this product is sold via a subscription, name will show up on associated invoice line item descriptions. + * @property null|\Stripe\StripeObject $package_dimensions The dimensions of this product for shipping purposes. + * @property null|bool $shippable Whether this product is shipped (i.e., physical goods). + * @property null|string $statement_descriptor Extra information about a product which will appear on your customer's credit card statement. In the case that multiple products are billed at once, the first statement descriptor will be used. + * @property null|string|\Stripe\TaxCode $tax_code A tax code ID. + * @property string $type The type of the product. The product is either of type good, which is eligible for use with Orders and SKUs, or service, which is eligible for use with Subscriptions and Plans. + * @property null|string $unit_label A label that represents units of this product in Stripe and on customers’ receipts and invoices. When set, this will be included in associated invoice line item descriptions. + * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. + * @property null|string $url A URL of a publicly-accessible webpage for this product. + */ +class Product extends ApiResource +{ + const OBJECT_NAME = 'product'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const TYPE_GOOD = 'good'; + const TYPE_SERVICE = 'service'; +} diff --git a/vendor/stripe/stripe-php/lib/PromotionCode.php b/vendor/stripe/stripe-php/lib/PromotionCode.php new file mode 100644 index 0000000..f4bb0f4 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/PromotionCode.php @@ -0,0 +1,33 @@ +invoices or orders. Coupons do not work with conventional one-off charges. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string|\Stripe\Customer $customer The customer that this promotion code can be used by. + * @property null|int $expires_at Date at which the promotion code can no longer be redeemed. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|int $max_redemptions Maximum number of times this promotion code can be redeemed. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\StripeObject $restrictions + * @property int $times_redeemed Number of times this promotion code has been used. + */ +class PromotionCode extends ApiResource +{ + const OBJECT_NAME = 'promotion_code'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/Radar/EarlyFraudWarning.php b/vendor/stripe/stripe-php/lib/Radar/EarlyFraudWarning.php new file mode 100644 index 0000000..2dfd2ac --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Radar/EarlyFraudWarning.php @@ -0,0 +1,38 @@ +Early + * Fraud Warnings. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property bool $actionable An EFW is actionable if it has not received a dispute and has not been fully refunded. You may wish to proactively refund a charge that receives an EFW, in order to avoid receiving a dispute later. + * @property string|\Stripe\Charge $charge ID of the charge this early fraud warning is for, optionally expanded. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $fraud_type The type of fraud labelled by the issuer. One of card_never_received, fraudulent_card_application, made_with_counterfeit_card, made_with_lost_card, made_with_stolen_card, misc, unauthorized_use_of_card. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property string|\Stripe\PaymentIntent $payment_intent ID of the Payment Intent this early fraud warning is for, optionally expanded. + */ +class EarlyFraudWarning extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'radar.early_fraud_warning'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + + const FRAUD_TYPE_CARD_NEVER_RECEIVED = 'card_never_received'; + const FRAUD_TYPE_FRAUDULENT_CARD_APPLICATION = 'fraudulent_card_application'; + const FRAUD_TYPE_MADE_WITH_COUNTERFEIT_CARD = 'made_with_counterfeit_card'; + const FRAUD_TYPE_MADE_WITH_LOST_CARD = 'made_with_lost_card'; + const FRAUD_TYPE_MADE_WITH_STOLEN_CARD = 'made_with_stolen_card'; + const FRAUD_TYPE_MISC = 'misc'; + const FRAUD_TYPE_UNAUTHORIZED_USE_OF_CARD = 'unauthorized_use_of_card'; +} diff --git a/vendor/stripe/stripe-php/lib/Radar/ValueList.php b/vendor/stripe/stripe-php/lib/Radar/ValueList.php new file mode 100644 index 0000000..bcbef74 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Radar/ValueList.php @@ -0,0 +1,35 @@ +Default Stripe + * Lists. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string $alias The name of the value list for use in rules. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $created_by The name or email address of the user who created this value list. + * @property string $item_type The type of items in the value list. One of card_fingerprint, card_bin, email, ip_address, country, string, or case_sensitive_string. + * @property \Stripe\Collection $list_items List of items contained within this value list. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $name The name of the value list. + */ +class ValueList extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'radar.value_list'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Delete; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/Radar/ValueListItem.php b/vendor/stripe/stripe-php/lib/Radar/ValueListItem.php new file mode 100644 index 0000000..c4ab281 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Radar/ValueListItem.php @@ -0,0 +1,31 @@ +Managing List + * Items. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $created_by The name or email address of the user who added this item to the value list. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property string $value The value of the item. + * @property string $value_list The identifier of the value list this item belongs to. + */ +class ValueListItem extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'radar.value_list_item'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Delete; + use \Stripe\ApiOperations\Retrieve; +} diff --git a/vendor/stripe/stripe-php/lib/Recipient.php b/vendor/stripe/stripe-php/lib/Recipient.php new file mode 100644 index 0000000..8d5ad4c --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Recipient.php @@ -0,0 +1,44 @@ +Recipient objects, you can transfer money from your Stripe + * account to a third-party bank account or debit card. The API allows you to + * create, delete, and update your recipients. You can retrieve individual + * recipients as well as a list of all your recipients. + * + * Recipient objects have been deprecated in favor of Connect, specifically Connect's much + * more powerful Account objects. + * Stripe accounts that don't already use recipients can no longer begin doing so. + * Please use Account objects instead. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|\Stripe\BankAccount $active_account Hash describing the current account on the recipient, if there is one. + * @property null|\Stripe\Collection $cards + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string|\Stripe\Card $default_card The default card to use for creating transfers to this recipient. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string $email + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string|\Stripe\Account $migrated_to The ID of the Custom account this recipient was migrated to. If set, the recipient can no longer be updated, nor can transfers be made to it: use the Custom account instead. + * @property null|string $name Full, legal name of the recipient. + * @property string|\Stripe\Account $rolled_back_from + * @property string $type Type of the recipient, one of individual or corporation. + * @property bool $verified Whether the recipient has been verified. This field is non-standard, and maybe removed in the future + */ +class Recipient extends ApiResource +{ + const OBJECT_NAME = 'recipient'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/RecipientTransfer.php b/vendor/stripe/stripe-php/lib/RecipientTransfer.php new file mode 100644 index 0000000..5e2d436 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/RecipientTransfer.php @@ -0,0 +1,36 @@ +Refund objects allow you to refund a charge that has previously + * been created but not yet refunded. Funds will be refunded to the credit or debit + * card that was originally charged. + * + * Related guide: Refunds. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount, in %s. + * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance. + * @property null|string|\Stripe\Charge $charge ID of the charge that was refunded. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string $description An arbitrary string attached to the object. Often useful for displaying to users. (Available on non-card refunds only) + * @property string|\Stripe\BalanceTransaction $failure_balance_transaction If the refund failed, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction. + * @property string $failure_reason If the refund failed, the reason for refund failure if known. Possible values are lost_or_stolen_card, expired_or_canceled_card, or unknown. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that was refunded. + * @property null|string $reason Reason for the refund, either user-provided (duplicate, fraudulent, or requested_by_customer) or generated by Stripe internally (expired_uncaptured_charge). + * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this refund. + * @property null|string|\Stripe\TransferReversal $source_transfer_reversal The transfer reversal that is associated with the refund. Only present if the charge came from another Stripe account. See the Connect documentation for details. + * @property null|string $status Status of the refund. For credit card refunds, this can be pending, succeeded, or failed. For other types of refunds, it can be pending, succeeded, failed, or canceled. Refer to our refunds documentation for more details. + * @property null|string|\Stripe\TransferReversal $transfer_reversal If the accompanying transfer was reversed, the transfer reversal object. Only applicable if the charge was created using the destination parameter. + */ +class Refund extends ApiResource +{ + const OBJECT_NAME = 'refund'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const FAILURE_REASON_EXPIRED_OR_CANCELED_CARD = 'expired_or_canceled_card'; + const FAILURE_REASON_LOST_OR_STOLEN_CARD = 'lost_or_stolen_card'; + const FAILURE_REASON_UNKNOWN = 'unknown'; + + const REASON_DUPLICATE = 'duplicate'; + const REASON_FRAUDULENT = 'fraudulent'; + const REASON_REQUESTED_BY_CUSTOMER = 'requested_by_customer'; + + const STATUS_CANCELED = 'canceled'; + const STATUS_FAILED = 'failed'; + const STATUS_PENDING = 'pending'; + const STATUS_SUCCEEDED = 'succeeded'; + + /** + * @deprecated use FAILURE_REASON_EXPIRED_OR_CANCELED_CARD instead + */ + const FAILURE_REASON = 'expired_or_canceled_card'; +} diff --git a/vendor/stripe/stripe-php/lib/Reporting/ReportRun.php b/vendor/stripe/stripe-php/lib/Reporting/ReportRun.php new file mode 100644 index 0000000..7c3d2a9 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Reporting/ReportRun.php @@ -0,0 +1,37 @@ +API Access to + * Reports. + * + * Note that certain report types can only be run based on your live-mode data (not + * test-mode data), and will error when queried without a live-mode API key. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $error If something should go wrong during the run, a message about the failure (populated when status=failed). + * @property bool $livemode true if the report is run on live mode data and false if it is run on test mode data. + * @property \Stripe\StripeObject $parameters + * @property string $report_type The ID of the report type to run, such as "balance.summary.1". + * @property null|\Stripe\File $result The file object representing the result of the report run (populated when status=succeeded). + * @property string $status Status of this report run. This will be pending when the run is initially created. When the run finishes, this will be set to succeeded and the result field will be populated. Rarely, we may encounter an error, at which point this will be set to failed and the error field will be populated. + * @property null|int $succeeded_at Timestamp at which this run successfully finished (populated when status=succeeded). Measured in seconds since the Unix epoch. + */ +class ReportRun extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'reporting.report_run'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; +} diff --git a/vendor/stripe/stripe-php/lib/Reporting/ReportType.php b/vendor/stripe/stripe-php/lib/Reporting/ReportType.php new file mode 100644 index 0000000..3bb1460 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Reporting/ReportType.php @@ -0,0 +1,34 @@ +API Access to Reports + * documentation for those Report Type IDs, along with required and optional + * parameters. + * + * Note that certain report types can only be run based on your live-mode data (not + * test-mode data), and will error when queried without a live-mode API key. + * + * @property string $id The ID of the Report Type, such as balance.summary.1. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $data_available_end Most recent time for which this Report Type is available. Measured in seconds since the Unix epoch. + * @property int $data_available_start Earliest time for which this Report Type is available. Measured in seconds since the Unix epoch. + * @property null|string[] $default_columns List of column names that are included by default when this Report Type gets run. (If the Report Type doesn't support the columns parameter, this will be null.) + * @property string $name Human-readable name of the Report Type + * @property int $updated When this Report Type was latest updated. Measured in seconds since the Unix epoch. + * @property int $version Version of the Report Type. Different versions report with the same ID will have the same purpose, but may take different run parameters or have different result schemas. + */ +class ReportType extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'reporting.report_type'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; +} diff --git a/vendor/stripe/stripe-php/lib/RequestTelemetry.php b/vendor/stripe/stripe-php/lib/RequestTelemetry.php new file mode 100644 index 0000000..bf9074a --- /dev/null +++ b/vendor/stripe/stripe-php/lib/RequestTelemetry.php @@ -0,0 +1,26 @@ +requestId = $requestId; + $this->requestDuration = $requestDuration; + } +} diff --git a/vendor/stripe/stripe-php/lib/Review.php b/vendor/stripe/stripe-php/lib/Review.php new file mode 100644 index 0000000..7a79992 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Review.php @@ -0,0 +1,66 @@ +Radar and reviewing payments here. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|string $billing_zip The ZIP or postal code of the card used, if applicable. + * @property null|string|\Stripe\Charge $charge The charge associated with this review. + * @property null|string $closed_reason The reason the review was closed, or null if it has not yet been closed. One of approved, refunded, refunded_as_fraud, or disputed. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $ip_address The IP address where the payment originated. + * @property null|\Stripe\StripeObject $ip_address_location Information related to the location of the payment. Note that this information is an approximation and attempts to locate the nearest population center - it should not be used to determine a specific address. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $open If true, the review needs action. + * @property string $opened_reason The reason the review was opened. One of rule or manual. + * @property string|\Stripe\PaymentIntent $payment_intent The PaymentIntent ID associated with this review, if one exists. + * @property string $reason The reason the review is currently open or closed. One of rule, manual, approved, refunded, refunded_as_fraud, or disputed. + * @property null|\Stripe\StripeObject $session Information related to the browsing session of the user who initiated the payment. + */ +class Review extends ApiResource +{ + const OBJECT_NAME = 'review'; + + use ApiOperations\All; + use ApiOperations\Retrieve; + + /** + * Possible string representations of the current, the opening or the closure reason of the review. + * Not all of these enumeration apply to all of the ´reason´ fields. Please consult the Review object to + * determine where these are apply. + * + * @see https://stripe.com/docs/api/radar/reviews/object + */ + const REASON_APPROVED = 'approved'; + const REASON_DISPUTED = 'disputed'; + const REASON_MANUAL = 'manual'; + const REASON_REFUNDED = 'refunded'; + const REASON_REFUNDED_AS_FRAUD = 'refunded_as_fraud'; + const REASON_RULE = 'rule'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Review the approved review + */ + public function approve($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/approve'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/SKU.php b/vendor/stripe/stripe-php/lib/SKU.php new file mode 100644 index 0000000..b418c6c --- /dev/null +++ b/vendor/stripe/stripe-php/lib/SKU.php @@ -0,0 +1,44 @@ +stock keeping units. + * SKUs describe specific product variations, taking into account any combination + * of: attributes, currency, and cost. For example, a product may be a T-shirt, + * whereas a specific SKU represents the size: large, color: + * red version of that shirt. + * + * Can also be used to manage inventory. + * + * Related guide: Tax, Shipping, and + * Inventory. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property bool $active Whether the SKU is available for purchase. + * @property \Stripe\StripeObject $attributes A dictionary of attributes and values for the attributes defined by the product. If, for example, a product's attributes are ["size", "gender"], a valid SKU has the following dictionary of attributes: {"size": "Medium", "gender": "Unisex"}. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $image The URL of an image for this SKU, meant to be displayable to the customer. + * @property \Stripe\StripeObject $inventory + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|\Stripe\StripeObject $package_dimensions The dimensions of this SKU for shipping purposes. + * @property int $price The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency). + * @property string|\Stripe\Product $product The ID of the product this SKU is associated with. The product must be currently active. + * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. + */ +class SKU extends ApiResource +{ + const OBJECT_NAME = 'sku'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/Service/AbstractService.php b/vendor/stripe/stripe-php/lib/Service/AbstractService.php new file mode 100644 index 0000000..ed092c8 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/AbstractService.php @@ -0,0 +1,79 @@ +client = $client; + } + + /** + * Gets the client used by this service to send requests. + * + * @return \Stripe\StripeClientInterface + */ + public function getClient() + { + return $this->client; + } + + /** + * Translate null values to empty strings. For service methods, + * we interpret null as a request to unset the field, which + * corresponds to sending an empty string for the field to the + * API. + * + * @param null|array $params + */ + private static function formatParams($params) + { + if (null === $params) { + return null; + } + \array_walk_recursive($params, function (&$value, $key) { + if (null === $value) { + $value = ''; + } + }); + + return $params; + } + + protected function request($method, $path, $params, $opts) + { + return $this->getClient()->request($method, $path, static::formatParams($params), $opts); + } + + protected function requestCollection($method, $path, $params, $opts) + { + return $this->getClient()->requestCollection($method, $path, static::formatParams($params), $opts); + } + + protected function buildPath($basePath, ...$ids) + { + foreach ($ids as $id) { + if (null === $id || '' === \trim($id)) { + $msg = 'The resource ID cannot be null or whitespace.'; + + throw new \Stripe\Exception\InvalidArgumentException($msg); + } + } + + return \sprintf($basePath, ...\array_map('\urlencode', $ids)); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/AbstractServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/AbstractServiceFactory.php new file mode 100644 index 0000000..4aca686 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/AbstractServiceFactory.php @@ -0,0 +1,59 @@ + */ + private $services; + + /** + * @param \Stripe\StripeClientInterface $client + */ + public function __construct($client) + { + $this->client = $client; + $this->services = []; + } + + /** + * @param string $name + * + * @return null|string + */ + abstract protected function getServiceClass($name); + + /** + * @param string $name + * + * @return null|AbstractService|AbstractServiceFactory + */ + public function __get($name) + { + $serviceClass = $this->getServiceClass($name); + if (null !== $serviceClass) { + if (!\array_key_exists($name, $this->services)) { + $this->services[$name] = new $serviceClass($this->client); + } + + return $this->services[$name]; + } + + \trigger_error('Undefined property: ' . static::class . '::$' . $name); + + return null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/AccountLinkService.php b/vendor/stripe/stripe-php/lib/Service/AccountLinkService.php new file mode 100644 index 0000000..2e90492 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/AccountLinkService.php @@ -0,0 +1,25 @@ +request('post', '/v1/account_links', $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/AccountService.php b/vendor/stripe/stripe-php/lib/Service/AccountService.php new file mode 100644 index 0000000..50432a0 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/AccountService.php @@ -0,0 +1,381 @@ +Connect. If you’re not a platform, the list is empty. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/accounts', $params, $opts); + } + + /** + * Returns a list of capabilities associated with the account. The capabilities are + * returned sorted by creation date, with the most recent capability appearing + * first. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allCapabilities($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/accounts/%s/capabilities', $parentId), $params, $opts); + } + + /** + * List external accounts for an account. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allExternalAccounts($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/accounts/%s/external_accounts', $parentId), $params, $opts); + } + + /** + * Returns a list of people associated with the account’s legal entity. The people + * are returned sorted by creation date, with the most recent people appearing + * first. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allPersons($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/accounts/%s/persons', $parentId), $params, $opts); + } + + /** + * With Connect, you can create Stripe accounts for + * your users. To do this, you’ll first need to register your + * platform. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Account + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/accounts', $params, $opts); + } + + /** + * Create an external account for a given account. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public function createExternalAccount($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s/external_accounts', $parentId), $params, $opts); + } + + /** + * Creates a single-use login link for an Express account to access their Stripe + * dashboard. + * + * You may only create login links for Express accounts connected to your + * platform. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\LoginLink + */ + public function createLoginLink($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s/login_links', $parentId), $params, $opts); + } + + /** + * Creates a new person. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public function createPerson($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s/persons', $parentId), $params, $opts); + } + + /** + * With Connect, you can delete accounts you manage. + * + * Accounts created using test-mode keys can be deleted at any time. Custom or + * Express accounts created using live-mode keys can only be deleted once all + * balances are zero. + * + * If you want to delete your own account, use the account information tab in your + * account settings instead. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Account + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/accounts/%s', $id), $params, $opts); + } + + /** + * Delete a specified external account for a given account. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public function deleteExternalAccount($parentId, $id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/accounts/%s/external_accounts/%s', $parentId, $id), $params, $opts); + } + + /** + * Deletes an existing person’s relationship to the account’s legal entity. Any + * person with a relationship for an account can be deleted through the API, except + * if the person is the account_opener. If your integration is using + * the executive parameter, you cannot delete the only verified + * executive on file. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public function deletePerson($parentId, $id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/accounts/%s/persons/%s', $parentId, $id), $params, $opts); + } + + /** + * With Connect, you may flag accounts as suspicious. + * + * Test-mode Custom and Express accounts can be rejected at any time. Accounts + * created using live-mode keys may only be rejected once all balances are zero. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Account + */ + public function reject($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s/reject', $id), $params, $opts); + } + + /** + * Retrieves information about the specified Account Capability. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Capability + */ + public function retrieveCapability($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/accounts/%s/capabilities/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieve a specified external account for a given account. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public function retrieveExternalAccount($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/accounts/%s/external_accounts/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieves an existing person. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public function retrievePerson($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/accounts/%s/persons/%s', $parentId, $id), $params, $opts); + } + + /** + * Updates a connected account by setting the + * values of the parameters passed. Any parameters not provided are left unchanged. + * Most parameters can be changed only for Custom accounts. (These are marked + * Custom Only below.) Parameters marked Custom and + * Express are not supported for Standard accounts. + * + * To update your own account, use the Dashboard. Refer to our Connect documentation to learn more + * about updating accounts. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Account + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s', $id), $params, $opts); + } + + /** + * Updates an existing Account Capability. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Capability + */ + public function updateCapability($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s/capabilities/%s', $parentId, $id), $params, $opts); + } + + /** + * Updates the metadata, account holder name, and account holder type of a bank + * account belonging to a Custom + * account, and optionally sets it as the default for its currency. Other bank + * account details are not editable by design. + * + * You can re-enable a disabled bank account by performing an update call without + * providing any arguments or changes. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public function updateExternalAccount($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s/external_accounts/%s', $parentId, $id), $params, $opts); + } + + /** + * Updates an existing person. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public function updatePerson($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s/persons/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieves the details of an account. + * + * @param null|string $id + * @param null|array $params + * @param null|array|StripeUtilRequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Account + */ + public function retrieve($id = null, $params = null, $opts = null) + { + if (null === $id) { + return $this->request('get', '/v1/account', $params, $opts); + } + + return $this->request('get', $this->buildPath('/v1/accounts/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/ApplePayDomainService.php b/vendor/stripe/stripe-php/lib/Service/ApplePayDomainService.php new file mode 100644 index 0000000..6577b6b --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/ApplePayDomainService.php @@ -0,0 +1,70 @@ +requestCollection('get', '/v1/apple_pay/domains', $params, $opts); + } + + /** + * Create an apple pay domain. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplePayDomain + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/apple_pay/domains', $params, $opts); + } + + /** + * Delete an apple pay domain. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplePayDomain + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/apple_pay/domains/%s', $id), $params, $opts); + } + + /** + * Retrieve an apple pay domain. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplePayDomain + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/apple_pay/domains/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/ApplicationFeeService.php b/vendor/stripe/stripe-php/lib/Service/ApplicationFeeService.php new file mode 100644 index 0000000..c05c3cd --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/ApplicationFeeService.php @@ -0,0 +1,125 @@ +requestCollection('get', '/v1/application_fees', $params, $opts); + } + + /** + * You can see a list of the refunds belonging to a specific application fee. Note + * that the 10 most recent refunds are always available by default on the + * application fee object. If you need more than those 10, you can use this API + * method and the limit and starting_after parameters to + * page through additional refunds. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allRefunds($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/application_fees/%s/refunds', $parentId), $params, $opts); + } + + /** + * Refunds an application fee that has previously been collected but not yet + * refunded. Funds will be refunded to the Stripe account from which the fee was + * originally collected. + * + * You can optionally refund only part of an application fee. You can do so + * multiple times, until the entire fee has been refunded. + * + * Once entirely refunded, an application fee can’t be refunded again. This method + * will raise an error when called on an already-refunded application fee, or when + * trying to refund more money than is left on an application fee. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplicationFeeRefund + */ + public function createRefund($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/application_fees/%s/refunds', $parentId), $params, $opts); + } + + /** + * Retrieves the details of an application fee that your account has collected. The + * same information is returned when refunding the application fee. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplicationFee + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/application_fees/%s', $id), $params, $opts); + } + + /** + * By default, you can see the 10 most recent refunds stored directly on the + * application fee object, but you can also retrieve details about a specific + * refund stored on the application fee. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplicationFeeRefund + */ + public function retrieveRefund($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/application_fees/%s/refunds/%s', $parentId, $id), $params, $opts); + } + + /** + * Updates the specified application fee refund by setting the values of the + * parameters passed. Any parameters not provided will be left unchanged. + * + * This request only accepts metadata as an argument. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplicationFeeRefund + */ + public function updateRefund($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/application_fees/%s/refunds/%s', $parentId, $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/BalanceService.php b/vendor/stripe/stripe-php/lib/Service/BalanceService.php new file mode 100644 index 0000000..0f55385 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/BalanceService.php @@ -0,0 +1,26 @@ +Accounting + * for negative balances. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Balance + */ + public function retrieve($params = null, $opts = null) + { + return $this->request('get', '/v1/balance', $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/BalanceTransactionService.php b/vendor/stripe/stripe-php/lib/Service/BalanceTransactionService.php new file mode 100644 index 0000000..fb1da50 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/BalanceTransactionService.php @@ -0,0 +1,47 @@ +/v1/balance/history. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/balance_transactions', $params, $opts); + } + + /** + * Retrieves the balance transaction with the given ID. + * + * Note that this endpoint previously used the path + * /v1/balance/history/:id. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BalanceTransaction + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/balance_transactions/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/BillingPortal/BillingPortalServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/BillingPortal/BillingPortalServiceFactory.php new file mode 100644 index 0000000..23a4d30 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/BillingPortal/BillingPortalServiceFactory.php @@ -0,0 +1,27 @@ + + */ + private static $classMap = [ + 'configurations' => ConfigurationService::class, + 'sessions' => SessionService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/BillingPortal/ConfigurationService.php b/vendor/stripe/stripe-php/lib/Service/BillingPortal/ConfigurationService.php new file mode 100644 index 0000000..5a0d70d --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/BillingPortal/ConfigurationService.php @@ -0,0 +1,73 @@ +requestCollection('get', '/v1/billing_portal/configurations', $params, $opts); + } + + /** + * Creates a configuration that describes the functionality and behavior of a + * PortalSession. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BillingPortal\Configuration + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/billing_portal/configurations', $params, $opts); + } + + /** + * Retrieves a configuration that describes the functionality of the customer + * portal. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BillingPortal\Configuration + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/billing_portal/configurations/%s', $id), $params, $opts); + } + + /** + * Updates a configuration that describes the functionality of the customer portal. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BillingPortal\Configuration + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/billing_portal/configurations/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/BillingPortal/SessionService.php b/vendor/stripe/stripe-php/lib/Service/BillingPortal/SessionService.php new file mode 100644 index 0000000..6b3e602 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/BillingPortal/SessionService.php @@ -0,0 +1,23 @@ +request('post', '/v1/billing_portal/sessions', $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/ChargeService.php b/vendor/stripe/stripe-php/lib/Service/ChargeService.php new file mode 100644 index 0000000..f5321b8 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/ChargeService.php @@ -0,0 +1,101 @@ +requestCollection('get', '/v1/charges', $params, $opts); + } + + /** + * Capture the payment of an existing, uncaptured, charge. This is the second half + * of the two-step payment flow, where first you created a + * charge with the capture option set to false. + * + * Uncaptured payments expire exactly seven days after they are created. If they + * are not captured by that point in time, they will be marked as refunded and will + * no longer be capturable. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Charge + */ + public function capture($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/charges/%s/capture', $id), $params, $opts); + } + + /** + * To charge a credit card or other payment source, you create a + * Charge object. If your API key is in test mode, the supplied + * payment source (e.g., card) won’t actually be charged, although everything else + * will occur as if in live mode. (Stripe assumes that the charge would have + * completed successfully). + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Charge + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/charges', $params, $opts); + } + + /** + * Retrieves the details of a charge that has previously been created. Supply the + * unique charge ID that was returned from your previous request, and Stripe will + * return the corresponding charge information. The same information is returned + * when creating or refunding the charge. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Charge + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/charges/%s', $id), $params, $opts); + } + + /** + * Updates the specified charge by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Charge + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/charges/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Checkout/CheckoutServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/Checkout/CheckoutServiceFactory.php new file mode 100644 index 0000000..bb26a83 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Checkout/CheckoutServiceFactory.php @@ -0,0 +1,25 @@ + + */ + private static $classMap = [ + 'sessions' => SessionService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Checkout/SessionService.php b/vendor/stripe/stripe-php/lib/Service/Checkout/SessionService.php new file mode 100644 index 0000000..9da3788 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Checkout/SessionService.php @@ -0,0 +1,73 @@ +requestCollection('get', '/v1/checkout/sessions', $params, $opts); + } + + /** + * When retrieving a Checkout Session, there is an includable + * line_items property containing the first handful of those + * items. There is also a URL where you can retrieve the full (paginated) list of + * line items. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allLineItems($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/checkout/sessions/%s/line_items', $parentId), $params, $opts); + } + + /** + * Creates a Session object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Checkout\Session + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/checkout/sessions', $params, $opts); + } + + /** + * Retrieves a Session object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Checkout\Session + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/checkout/sessions/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/CoreServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/CoreServiceFactory.php new file mode 100644 index 0000000..41454bd --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/CoreServiceFactory.php @@ -0,0 +1,129 @@ + + */ + private static $classMap = [ + 'accountLinks' => AccountLinkService::class, + 'accounts' => AccountService::class, + 'applePayDomains' => ApplePayDomainService::class, + 'applicationFees' => ApplicationFeeService::class, + 'balance' => BalanceService::class, + 'balanceTransactions' => BalanceTransactionService::class, + 'billingPortal' => BillingPortal\BillingPortalServiceFactory::class, + 'charges' => ChargeService::class, + 'checkout' => Checkout\CheckoutServiceFactory::class, + 'countrySpecs' => CountrySpecService::class, + 'coupons' => CouponService::class, + 'creditNotes' => CreditNoteService::class, + 'customers' => CustomerService::class, + 'disputes' => DisputeService::class, + 'ephemeralKeys' => EphemeralKeyService::class, + 'events' => EventService::class, + 'exchangeRates' => ExchangeRateService::class, + 'fileLinks' => FileLinkService::class, + 'files' => FileService::class, + 'identity' => Identity\IdentityServiceFactory::class, + 'invoiceItems' => InvoiceItemService::class, + 'invoices' => InvoiceService::class, + 'issuing' => Issuing\IssuingServiceFactory::class, + 'mandates' => MandateService::class, + 'oauth' => OAuthService::class, + 'orderReturns' => OrderReturnService::class, + 'orders' => OrderService::class, + 'paymentIntents' => PaymentIntentService::class, + 'paymentMethods' => PaymentMethodService::class, + 'payouts' => PayoutService::class, + 'plans' => PlanService::class, + 'prices' => PriceService::class, + 'products' => ProductService::class, + 'promotionCodes' => PromotionCodeService::class, + 'radar' => Radar\RadarServiceFactory::class, + 'refunds' => RefundService::class, + 'reporting' => Reporting\ReportingServiceFactory::class, + 'reviews' => ReviewService::class, + 'setupAttempts' => SetupAttemptService::class, + 'setupIntents' => SetupIntentService::class, + 'sigma' => Sigma\SigmaServiceFactory::class, + 'skus' => SkuService::class, + 'sources' => SourceService::class, + 'subscriptionItems' => SubscriptionItemService::class, + 'subscriptions' => SubscriptionService::class, + 'subscriptionSchedules' => SubscriptionScheduleService::class, + 'taxCodes' => TaxCodeService::class, + 'taxRates' => TaxRateService::class, + 'terminal' => Terminal\TerminalServiceFactory::class, + 'tokens' => TokenService::class, + 'topups' => TopupService::class, + 'transfers' => TransferService::class, + 'webhookEndpoints' => WebhookEndpointService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/CountrySpecService.php b/vendor/stripe/stripe-php/lib/Service/CountrySpecService.php new file mode 100644 index 0000000..573444f --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/CountrySpecService.php @@ -0,0 +1,39 @@ +requestCollection('get', '/v1/country_specs', $params, $opts); + } + + /** + * Returns a Country Spec for a given Country code. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CountrySpec + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/country_specs/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/CouponService.php b/vendor/stripe/stripe-php/lib/Service/CouponService.php new file mode 100644 index 0000000..82a880f --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/CouponService.php @@ -0,0 +1,104 @@ +requestCollection('get', '/v1/coupons', $params, $opts); + } + + /** + * You can create coupons easily via the coupon management page of the + * Stripe dashboard. Coupon creation is also accessible via the API if you need to + * create coupons on the fly. + * + * A coupon has either a percent_off or an amount_off and + * currency. If you set an amount_off, that amount will + * be subtracted from any invoice’s subtotal. For example, an invoice with a + * subtotal of 100 will have a final total of + * 0 if a coupon with an amount_off of + * 200 is applied to it and an invoice with a subtotal of + * 300 will have a final total of 100 if + * a coupon with an amount_off of 200 is applied to + * it. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Coupon + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/coupons', $params, $opts); + } + + /** + * You can delete coupons via the coupon management page of the + * Stripe dashboard. However, deleting a coupon does not affect any customers who + * have already applied the coupon; it means that new customers can’t redeem the + * coupon. You can also delete coupons via the API. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Coupon + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); + } + + /** + * Retrieves the coupon with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Coupon + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); + } + + /** + * Updates the metadata of a coupon. Other coupon details (currency, duration, + * amount_off) are, by design, not editable. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Coupon + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/CreditNoteService.php b/vendor/stripe/stripe-php/lib/Service/CreditNoteService.php new file mode 100644 index 0000000..39807dc --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/CreditNoteService.php @@ -0,0 +1,156 @@ +requestCollection('get', '/v1/credit_notes', $params, $opts); + } + + /** + * When retrieving a credit note, you’ll get a lines property + * containing the the first handful of those items. There is also a URL where you + * can retrieve the full (paginated) list of line items. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allLines($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/credit_notes/%s/lines', $parentId), $params, $opts); + } + + /** + * Issue a credit note to adjust the amount of a finalized invoice. For a + * status=open invoice, a credit note reduces its + * amount_due. For a status=paid invoice, a credit note + * does not affect its amount_due. Instead, it can result in any + * combination of the following:. + * + *
  • Refund: create a new refund (using refund_amount) or link + * an existing refund (using refund).
  • Customer balance + * credit: credit the customer’s balance (using credit_amount) which + * will be automatically applied to their next invoice when it’s finalized.
  • + *
  • Outside of Stripe credit: record the amount that is or will be credited + * outside of Stripe (using out_of_band_amount).
+ * + * For post-payment credit notes the sum of the refund, credit and outside of + * Stripe amounts must equal the credit note total. + * + * You may issue multiple credit notes for an invoice. Each credit note will + * increment the invoice’s pre_payment_credit_notes_amount or + * post_payment_credit_notes_amount depending on its + * status at the time of credit note creation. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/credit_notes', $params, $opts); + } + + /** + * Get a preview of a credit note without creating it. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote + */ + public function preview($params = null, $opts = null) + { + return $this->request('get', '/v1/credit_notes/preview', $params, $opts); + } + + /** + * When retrieving a credit note preview, you’ll get a lines + * property containing the first handful of those items. This URL you can retrieve + * the full (paginated) list of line items. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote + */ + public function previewLines($params = null, $opts = null) + { + return $this->request('get', '/v1/credit_notes/preview/lines', $params, $opts); + } + + /** + * Retrieves the credit note object with the given identifier. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/credit_notes/%s', $id), $params, $opts); + } + + /** + * Updates an existing credit note. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/credit_notes/%s', $id), $params, $opts); + } + + /** + * Marks a credit note as void. Learn more about voiding credit notes. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote + */ + public function voidCreditNote($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/credit_notes/%s/void', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/CustomerService.php b/vendor/stripe/stripe-php/lib/Service/CustomerService.php new file mode 100644 index 0000000..fdc6a59 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/CustomerService.php @@ -0,0 +1,353 @@ +requestCollection('get', '/v1/customers', $params, $opts); + } + + /** + * Returns a list of transactions that updated the customer’s balances. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allBalanceTransactions($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/balance_transactions', $parentId), $params, $opts); + } + + /** + * List sources for a specified customer. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allSources($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/sources', $parentId), $params, $opts); + } + + /** + * Returns a list of tax IDs for a customer. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allTaxIds($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/tax_ids', $parentId), $params, $opts); + } + + /** + * Creates a new customer object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Customer + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/customers', $params, $opts); + } + + /** + * Creates an immutable transaction that updates the customer’s credit balance. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CustomerBalanceTransaction + */ + public function createBalanceTransaction($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/balance_transactions', $parentId), $params, $opts); + } + + /** + * When you create a new credit card, you must specify a customer or recipient on + * which to create it. + * + * If the card’s owner has no default card, then the new card will become the + * default. However, if the owner already has a default, then it will not change. + * To change the default, you should update the + * customer to have a new default_source. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public function createSource($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/sources', $parentId), $params, $opts); + } + + /** + * Creates a new TaxID object for a customer. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxId + */ + public function createTaxId($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/tax_ids', $parentId), $params, $opts); + } + + /** + * Permanently deletes a customer. It cannot be undone. Also immediately cancels + * any active subscriptions on the customer. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Customer + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/customers/%s', $id), $params, $opts); + } + + /** + * Removes the currently applied discount on a customer. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Customer + */ + public function deleteDiscount($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/customers/%s/discount', $id), $params, $opts); + } + + /** + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public function deleteSource($parentId, $id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/customers/%s/sources/%s', $parentId, $id), $params, $opts); + } + + /** + * Deletes an existing TaxID object. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxId + */ + public function deleteTaxId($parentId, $id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/customers/%s/tax_ids/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieves the details of an existing customer. You need only supply the unique + * customer identifier that was returned upon customer creation. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Customer + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/customers/%s', $id), $params, $opts); + } + + /** + * Retrieves a specific customer balance transaction that updated the customer’s balances. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CustomerBalanceTransaction + */ + public function retrieveBalanceTransaction($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/customers/%s/balance_transactions/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieve a specified source for a given customer. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public function retrieveSource($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/customers/%s/sources/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieves the TaxID object with the given identifier. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxId + */ + public function retrieveTaxId($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/customers/%s/tax_ids/%s', $parentId, $id), $params, $opts); + } + + /** + * Updates the specified customer by setting the values of the parameters passed. + * Any parameters not provided will be left unchanged. For example, if you pass the + * source parameter, that becomes the customer’s active source + * (e.g., a card) to be used for all charges in the future. When you update a + * customer to a new valid card source by passing the source + * parameter: for each of the customer’s current subscriptions, if the subscription + * bills automatically and is in the past_due state, then the latest + * open invoice for the subscription with automatic collection enabled will be + * retried. This retry will not count as an automatic retry, and will not affect + * the next regularly scheduled payment for the invoice. Changing the + * default_source for a customer will not trigger this behavior. + * + * This request accepts mostly the same arguments as the customer creation call. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Customer + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s', $id), $params, $opts); + } + + /** + * Most credit balance transaction fields are immutable, but you may update its + * description and metadata. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CustomerBalanceTransaction + */ + public function updateBalanceTransaction($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/balance_transactions/%s', $parentId, $id), $params, $opts); + } + + /** + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public function updateSource($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/sources/%s', $parentId, $id), $params, $opts); + } + + /** + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public function verifySource($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/sources/%s/verify', $parentId, $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/DisputeService.php b/vendor/stripe/stripe-php/lib/Service/DisputeService.php new file mode 100644 index 0000000..4eb1542 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/DisputeService.php @@ -0,0 +1,83 @@ +requestCollection('get', '/v1/disputes', $params, $opts); + } + + /** + * Closing the dispute for a charge indicates that you do not have any evidence to + * submit and are essentially dismissing the dispute, acknowledging it as lost. + * + * The status of the dispute will change from needs_response to + * lost. Closing a dispute is irreversible. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Dispute + */ + public function close($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/disputes/%s/close', $id), $params, $opts); + } + + /** + * Retrieves the dispute with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Dispute + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/disputes/%s', $id), $params, $opts); + } + + /** + * When you get a dispute, contacting your customer is always the best first step. + * If that doesn’t work, you can submit evidence to help us resolve the dispute in + * your favor. You can do this in your dashboard, but if you prefer, + * you can use the API to submit evidence programmatically. + * + * Depending on your dispute type, different evidence fields will give you a better + * chance of winning your dispute. To figure out which evidence fields to provide, + * see our guide to dispute types. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Dispute + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/disputes/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/EphemeralKeyService.php b/vendor/stripe/stripe-php/lib/Service/EphemeralKeyService.php new file mode 100644 index 0000000..3ca14c9 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/EphemeralKeyService.php @@ -0,0 +1,43 @@ +request('delete', $this->buildPath('/v1/ephemeral_keys/%s', $id), $params, $opts); + } + + /** + * Creates a short-lived API key for a given resource. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\EphemeralKey + */ + public function create($params = null, $opts = null) + { + if (!$opts || !isset($opts['stripe_version'])) { + throw new \Stripe\Exception\InvalidArgumentException('stripe_version must be specified to create an ephemeral key'); + } + + return $this->request('post', '/v1/ephemeral_keys', $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/EventService.php b/vendor/stripe/stripe-php/lib/Service/EventService.php new file mode 100644 index 0000000..430b35a --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/EventService.php @@ -0,0 +1,44 @@ +event object api_version + * attribute (not according to your current Stripe API version or + * Stripe-Version header). + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/events', $params, $opts); + } + + /** + * Retrieves the details of an event. Supply the unique identifier of the event, + * which you might have received in a webhook. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Event + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/events/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/ExchangeRateService.php b/vendor/stripe/stripe-php/lib/Service/ExchangeRateService.php new file mode 100644 index 0000000..fc78410 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/ExchangeRateService.php @@ -0,0 +1,41 @@ +requestCollection('get', '/v1/exchange_rates', $params, $opts); + } + + /** + * Retrieves the exchange rates from the given currency to every supported + * currency. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ExchangeRate + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/exchange_rates/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/FileLinkService.php b/vendor/stripe/stripe-php/lib/Service/FileLinkService.php new file mode 100644 index 0000000..7a3a435 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/FileLinkService.php @@ -0,0 +1,70 @@ +requestCollection('get', '/v1/file_links', $params, $opts); + } + + /** + * Creates a new file link object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FileLink + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/file_links', $params, $opts); + } + + /** + * Retrieves the file link with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FileLink + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/file_links/%s', $id), $params, $opts); + } + + /** + * Updates an existing file link object. Expired links can no longer be updated. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FileLink + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/file_links/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/FileService.php b/vendor/stripe/stripe-php/lib/Service/FileService.php new file mode 100644 index 0000000..1484288 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/FileService.php @@ -0,0 +1,66 @@ +requestCollection('get', '/v1/files', $params, $opts); + } + + /** + * Retrieves the details of an existing file object. Supply the unique file ID from + * a file, and Stripe will return the corresponding file object. To access file + * contents, see the File Upload + * Guide. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\File + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/files/%s', $id), $params, $opts); + } + + /** + * Create a file. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @return \Stripe\File + */ + public function create($params = null, $opts = null) + { + $opts = \Stripe\Util\RequestOptions::parse($opts); + if (!isset($opts->apiBase)) { + $opts->apiBase = $this->getClient()->getFilesBase(); + } + + // Manually flatten params, otherwise curl's multipart encoder will + // choke on nested null|arrays. + $flatParams = \array_column(\Stripe\Util\Util::flattenParams($params), 1, 0); + + return $this->request('post', '/v1/files', $flatParams, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Identity/IdentityServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/Identity/IdentityServiceFactory.php new file mode 100644 index 0000000..cf63146 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Identity/IdentityServiceFactory.php @@ -0,0 +1,27 @@ + + */ + private static $classMap = [ + 'verificationReports' => VerificationReportService::class, + 'verificationSessions' => VerificationSessionService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Identity/VerificationReportService.php b/vendor/stripe/stripe-php/lib/Service/Identity/VerificationReportService.php new file mode 100644 index 0000000..0393cd5 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Identity/VerificationReportService.php @@ -0,0 +1,39 @@ +requestCollection('get', '/v1/identity/verification_reports', $params, $opts); + } + + /** + * Retrieves an existing VerificationReport. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationReport + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/identity/verification_reports/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Identity/VerificationSessionService.php b/vendor/stripe/stripe-php/lib/Service/Identity/VerificationSessionService.php new file mode 100644 index 0000000..1a763be --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Identity/VerificationSessionService.php @@ -0,0 +1,146 @@ +requestCollection('get', '/v1/identity/verification_sessions', $params, $opts); + } + + /** + * A VerificationSession object can be canceled when it is in + * requires_input status. + * + * Once canceled, future submission attempts are disabled. This cannot be undone. + * Learn more. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/identity/verification_sessions/%s/cancel', $id), $params, $opts); + } + + /** + * Creates a VerificationSession object. + * + * After the VerificationSession is created, display a verification modal using the + * session client_secret or send your users to the session’s + * url. + * + * If your API key is in test mode, verification checks won’t actually process, + * though everything else will occur as if in live mode. + * + * Related guide: Verify your + * users’ identity documents. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/identity/verification_sessions', $params, $opts); + } + + /** + * Redact a VerificationSession to remove all collected information from Stripe. + * This will redact the VerificationSession and all objects related to it, + * including VerificationReports, Events, request logs, etc. + * + * A VerificationSession object can be redacted when it is in + * requires_input or verified status. Redacting a + * VerificationSession in requires_action state will automatically + * cancel it. + * + * The redaction process may take up to four days. When the redaction process is in + * progress, the VerificationSession’s redaction.status field will be + * set to processing; when the process is finished, it will change to + * redacted and an identity.verification_session.redacted + * event will be emitted. + * + * Redaction is irreversible. Redacted objects are still accessible in the Stripe + * API, but all the fields that contain personal data will be replaced by the + * string [redacted] or a similar placeholder. The + * metadata field will also be erased. Redacted objects cannot be + * updated or used for any purpose. + * + * Learn more. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession + */ + public function redact($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/identity/verification_sessions/%s/redact', $id), $params, $opts); + } + + /** + * Retrieves the details of a VerificationSession that was previously created. + * + * When the session status is requires_input, you can use this method + * to retrieve a valid client_secret or url to allow + * re-submission. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/identity/verification_sessions/%s', $id), $params, $opts); + } + + /** + * Updates a VerificationSession object. + * + * When the session status is requires_input, you can use this method + * to update the verification check and options. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/identity/verification_sessions/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/InvoiceItemService.php b/vendor/stripe/stripe-php/lib/Service/InvoiceItemService.php new file mode 100644 index 0000000..0f0b9e9 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/InvoiceItemService.php @@ -0,0 +1,93 @@ +requestCollection('get', '/v1/invoiceitems', $params, $opts); + } + + /** + * Creates an item to be added to a draft invoice (up to 250 items per invoice). If + * no invoice is specified, the item will be on the next invoice created for the + * customer specified. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\InvoiceItem + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/invoiceitems', $params, $opts); + } + + /** + * Deletes an invoice item, removing it from an invoice. Deleting invoice items is + * only possible when they’re not attached to invoices, or if it’s attached to a + * draft invoice. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\InvoiceItem + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/invoiceitems/%s', $id), $params, $opts); + } + + /** + * Retrieves the invoice item with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\InvoiceItem + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/invoiceitems/%s', $id), $params, $opts); + } + + /** + * Updates the amount or description of an invoice item on an upcoming invoice. + * Updating an invoice item is only possible before the invoice it’s attached to is + * closed. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\InvoiceItem + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoiceitems/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/InvoiceService.php b/vendor/stripe/stripe-php/lib/Service/InvoiceService.php new file mode 100644 index 0000000..f647b28 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/InvoiceService.php @@ -0,0 +1,272 @@ +requestCollection('get', '/v1/invoices', $params, $opts); + } + + /** + * When retrieving an invoice, you’ll get a lines property + * containing the total count of line items and the first handful of those items. + * There is also a URL where you can retrieve the full (paginated) list of line + * items. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allLines($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/invoices/%s/lines', $parentId), $params, $opts); + } + + /** + * This endpoint creates a draft invoice for a given customer. The draft invoice + * created pulls in all pending invoice items on that customer, including + * prorations. The invoice remains a draft until you finalize the invoice, which allows you to pay or send the invoice to + * your customers. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/invoices', $params, $opts); + } + + /** + * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to + * delete invoices that are no longer in a draft state will fail; once an invoice + * has been finalized or if an invoice is for a subscription, it must be voided. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/invoices/%s', $id), $params, $opts); + } + + /** + * Stripe automatically finalizes drafts before sending and attempting payment on + * invoices. However, if you’d like to finalize a draft invoice manually, you can + * do so using this method. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function finalizeInvoice($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/finalize', $id), $params, $opts); + } + + /** + * Marking an invoice as uncollectible is useful for keeping track of bad debts + * that can be written off for accounting purposes. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function markUncollectible($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/mark_uncollectible', $id), $params, $opts); + } + + /** + * Stripe automatically creates and then attempts to collect payment on invoices + * for customers on subscriptions according to your subscriptions + * settings. However, if you’d like to attempt payment on an invoice out of the + * normal collection schedule or for some other reason, you can do so. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function pay($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/pay', $id), $params, $opts); + } + + /** + * Retrieves the invoice with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/invoices/%s', $id), $params, $opts); + } + + /** + * Stripe will automatically send invoices to customers according to your subscriptions + * settings. However, if you’d like to manually send an invoice to your + * customer out of the normal schedule, you can do so. When sending invoices that + * have already been paid, there will be no reference to the payment in the email. + * + * Requests made in test-mode result in no emails being sent, despite sending an + * invoice.sent event. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function sendInvoice($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/send', $id), $params, $opts); + } + + /** + * At any time, you can preview the upcoming invoice for a customer. This will show + * you all the charges that are pending, including subscription renewal charges, + * invoice item charges, etc. It will also show you any discounts that are + * applicable to the invoice. + * + * Note that when you are viewing an upcoming invoice, you are simply viewing a + * preview – the invoice has not yet been created. As such, the upcoming invoice + * will not show up in invoice listing calls, and you cannot use the API to pay or + * edit the invoice. If you want to change the amount that your customer will be + * billed, you can add, remove, or update pending invoice items, or update the + * customer’s discount. + * + * You can preview the effects of updating a subscription, including a preview of + * what proration will take place. To ensure that the actual proration is + * calculated exactly the same as the previewed proration, you should pass a + * proration_date parameter when doing the actual subscription update. + * The value passed in should be the same as the + * subscription_proration_date returned on the upcoming invoice + * resource. The recommended way to get only the prorations being previewed is to + * consider only proration line items where period[start] is equal to + * the subscription_proration_date on the upcoming invoice resource. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function upcoming($params = null, $opts = null) + { + return $this->request('get', '/v1/invoices/upcoming', $params, $opts); + } + + /** + * When retrieving an upcoming invoice, you’ll get a lines + * property containing the total count of line items and the first handful of those + * items. There is also a URL where you can retrieve the full (paginated) list of + * line items. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function upcomingLines($params = null, $opts = null) + { + return $this->request('get', '/v1/invoices/upcoming/lines', $params, $opts); + } + + /** + * Draft invoices are fully editable. Once an invoice is finalized, monetary values, + * as well as collection_method, become uneditable. + * + * If you would like to stop the Stripe Billing engine from automatically + * finalizing, reattempting payments on, sending reminders for, or automatically reconciling + * invoices, pass auto_advance=false. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s', $id), $params, $opts); + } + + /** + * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is + * similar to deletion, however it only applies to + * finalized invoices and maintains a papertrail where the invoice can still be + * found. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function voidInvoice($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/void', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Issuing/AuthorizationService.php b/vendor/stripe/stripe-php/lib/Service/Issuing/AuthorizationService.php new file mode 100644 index 0000000..6fff70e --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Issuing/AuthorizationService.php @@ -0,0 +1,97 @@ +Authorization objects. The objects are + * sorted in descending order by creation date, with the most recently created + * object appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/authorizations', $params, $opts); + } + + /** + * Approves a pending Issuing Authorization object. This request + * should be made within the timeout window of the real-time + * authorization flow. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization + */ + public function approve($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/authorizations/%s/approve', $id), $params, $opts); + } + + /** + * Declines a pending Issuing Authorization object. This request + * should be made within the timeout window of the real time + * authorization flow. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization + */ + public function decline($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/authorizations/%s/decline', $id), $params, $opts); + } + + /** + * Retrieves an Issuing Authorization object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/authorizations/%s', $id), $params, $opts); + } + + /** + * Updates the specified Issuing Authorization object by setting the + * values of the parameters passed. Any parameters not provided will be left + * unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/authorizations/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Issuing/CardService.php b/vendor/stripe/stripe-php/lib/Service/Issuing/CardService.php new file mode 100644 index 0000000..346d54a --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Issuing/CardService.php @@ -0,0 +1,73 @@ +Card objects. The objects are sorted in + * descending order by creation date, with the most recently created object + * appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/cards', $params, $opts); + } + + /** + * Creates an Issuing Card object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Card + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/issuing/cards', $params, $opts); + } + + /** + * Retrieves an Issuing Card object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Card + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/cards/%s', $id), $params, $opts); + } + + /** + * Updates the specified Issuing Card object by setting the values of + * the parameters passed. Any parameters not provided will be left unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Card + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/cards/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Issuing/CardholderService.php b/vendor/stripe/stripe-php/lib/Service/Issuing/CardholderService.php new file mode 100644 index 0000000..5731b1b --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Issuing/CardholderService.php @@ -0,0 +1,74 @@ +Cardholder objects. The objects are + * sorted in descending order by creation date, with the most recently created + * object appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/cardholders', $params, $opts); + } + + /** + * Creates a new Issuing Cardholder object that can be issued cards. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Cardholder + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/issuing/cardholders', $params, $opts); + } + + /** + * Retrieves an Issuing Cardholder object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Cardholder + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/cardholders/%s', $id), $params, $opts); + } + + /** + * Updates the specified Issuing Cardholder object by setting the + * values of the parameters passed. Any parameters not provided will be left + * unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Cardholder + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/cardholders/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Issuing/DisputeService.php b/vendor/stripe/stripe-php/lib/Service/Issuing/DisputeService.php new file mode 100644 index 0000000..ab5df5f --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Issuing/DisputeService.php @@ -0,0 +1,99 @@ +Dispute objects. The objects are sorted + * in descending order by creation date, with the most recently created object + * appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/disputes', $params, $opts); + } + + /** + * Creates an Issuing Dispute object. Individual pieces of evidence + * within the evidence object are optional at this point. Stripe only + * validates that required evidence is present during submission. Refer to Dispute + * reasons and evidence for more details about evidence requirements. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Dispute + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/issuing/disputes', $params, $opts); + } + + /** + * Retrieves an Issuing Dispute object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Dispute + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/disputes/%s', $id), $params, $opts); + } + + /** + * Submits an Issuing Dispute to the card network. Stripe validates + * that all evidence fields required for the dispute’s reason are present. For more + * details, see Dispute + * reasons and evidence. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Dispute + */ + public function submit($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/disputes/%s/submit', $id), $params, $opts); + } + + /** + * Updates the specified Issuing Dispute object by setting the values + * of the parameters passed. Any parameters not provided will be left unchanged. + * Properties on the evidence object can be unset by passing in an + * empty string. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Dispute + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/disputes/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Issuing/IssuingServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/Issuing/IssuingServiceFactory.php new file mode 100644 index 0000000..a8d5d0f --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Issuing/IssuingServiceFactory.php @@ -0,0 +1,33 @@ + + */ + private static $classMap = [ + 'authorizations' => AuthorizationService::class, + 'cardholders' => CardholderService::class, + 'cards' => CardService::class, + 'disputes' => DisputeService::class, + 'transactions' => TransactionService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Issuing/TransactionService.php b/vendor/stripe/stripe-php/lib/Service/Issuing/TransactionService.php new file mode 100644 index 0000000..8fb0ee2 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Issuing/TransactionService.php @@ -0,0 +1,59 @@ +Transaction objects. The objects are + * sorted in descending order by creation date, with the most recently created + * object appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/transactions', $params, $opts); + } + + /** + * Retrieves an Issuing Transaction object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Transaction + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/transactions/%s', $id), $params, $opts); + } + + /** + * Updates the specified Issuing Transaction object by setting the + * values of the parameters passed. Any parameters not provided will be left + * unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Transaction + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/transactions/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/MandateService.php b/vendor/stripe/stripe-php/lib/Service/MandateService.php new file mode 100644 index 0000000..156bff0 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/MandateService.php @@ -0,0 +1,24 @@ +request('get', $this->buildPath('/v1/mandates/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/OAuthService.php b/vendor/stripe/stripe-php/lib/Service/OAuthService.php new file mode 100644 index 0000000..b745ad9 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/OAuthService.php @@ -0,0 +1,150 @@ +_parseOpts($opts); + $opts->apiBase = $this->_getBase($opts); + + return $this->request($method, $path, $params, $opts); + } + + /** + * Generates a URL to Stripe's OAuth form. + * + * @param null|array $params + * @param null|array $opts + * + * @return string the URL to Stripe's OAuth form + */ + public function authorizeUrl($params = null, $opts = null) + { + $params = $params ?: []; + + $opts = $this->_parseOpts($opts); + $base = $this->_getBase($opts); + + $params['client_id'] = $this->_getClientId($params); + if (!\array_key_exists('response_type', $params)) { + $params['response_type'] = 'code'; + } + $query = \Stripe\Util\Util::encodeParameters($params); + + return $base . '/oauth/authorize?' . $query; + } + + /** + * Use an authoriztion code to connect an account to your platform and + * fetch the user's credentials. + * + * @param null|array $params + * @param null|array $opts + * + * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails + * + * @return \Stripe\StripeObject object containing the response from the API + */ + public function token($params = null, $opts = null) + { + $params = $params ?: []; + $params['client_secret'] = $this->_getClientSecret($params); + + return $this->requestConnect('post', '/oauth/token', $params, $opts); + } + + /** + * Disconnects an account from your platform. + * + * @param null|array $params + * @param null|array $opts + * + * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails + * + * @return \Stripe\StripeObject object containing the response from the API + */ + public function deauthorize($params = null, $opts = null) + { + $params = $params ?: []; + $params['client_id'] = $this->_getClientId($params); + + return $this->requestConnect('post', '/oauth/deauthorize', $params, $opts); + } + + private function _getClientId($params = null) + { + $clientId = ($params && \array_key_exists('client_id', $params)) ? $params['client_id'] : null; + + if (null === $clientId) { + $clientId = $this->client->getClientId(); + } + if (null === $clientId) { + $msg = 'No client_id provided. (HINT: set your client_id using ' + . '`new \Stripe\StripeClient([clientId => + ])`)". You can find your client_ids ' + . 'in your Stripe dashboard at ' + . 'https://dashboard.stripe.com/account/applications/settings, ' + . 'after registering your account as a platform. See ' + . 'https://stripe.com/docs/connect/standard-accounts for details, ' + . 'or email support@stripe.com if you have any questions.'; + + throw new \Stripe\Exception\AuthenticationException($msg); + } + + return $clientId; + } + + private function _getClientSecret($params = null) + { + if (\array_key_exists('client_secret', $params)) { + return $params['client_secret']; + } + + return $this->client->getApiKey(); + } + + /** + * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request + * + * @throws \Stripe\Exception\InvalidArgumentException + * + * @return \Stripe\Util\RequestOptions + */ + private function _parseOpts($opts) + { + if (\is_array($opts)) { + if (\array_key_exists('connect_base', $opts)) { + // Throw an exception for the convenience of anybody migrating to + // \Stripe\Service\OAuthService from \Stripe\OAuth, where `connect_base` + // was the name of the parameter that behaves as `api_base` does here. + throw new \Stripe\Exception\InvalidArgumentException('Use `api_base`, not `connect_base`'); + } + } + + return \Stripe\Util\RequestOptions::parse($opts); + } + + /** + * @param \Stripe\Util\RequestOptions $opts + * + * @return string + */ + private function _getBase($opts) + { + return isset($opts->apiBase) ? + $opts->apiBase : + $this->client->getConnectBase(); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/OrderReturnService.php b/vendor/stripe/stripe-php/lib/Service/OrderReturnService.php new file mode 100644 index 0000000..6183166 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/OrderReturnService.php @@ -0,0 +1,42 @@ +requestCollection('get', '/v1/order_returns', $params, $opts); + } + + /** + * Retrieves the details of an existing order return. Supply the unique order ID + * from either an order return creation request or the order return list, and + * Stripe will return the corresponding order information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\OrderReturn + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/order_returns/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/OrderService.php b/vendor/stripe/stripe-php/lib/Service/OrderService.php new file mode 100644 index 0000000..fa658fa --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/OrderService.php @@ -0,0 +1,109 @@ +requestCollection('get', '/v1/orders', $params, $opts); + } + + /** + * Creates a new order object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Order + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/orders', $params, $opts); + } + + /** + * Pay an order by providing a source to create a payment. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Order + */ + public function pay($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/orders/%s/pay', $id), $params, $opts); + } + + /** + * Retrieves the details of an existing order. Supply the unique order ID from + * either an order creation request or the order list, and Stripe will return the + * corresponding order information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Order + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/orders/%s', $id), $params, $opts); + } + + /** + * Return all or part of an order. The order must have a status of + * paid or fulfilled before it can be returned. Once all + * items have been returned, the order will become canceled or + * returned depending on which status the order started in. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Order + */ + public function returnOrder($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/orders/%s/returns', $id), $params, $opts); + } + + /** + * Updates the specific order by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Order + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/orders/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/PaymentIntentService.php b/vendor/stripe/stripe-php/lib/Service/PaymentIntentService.php new file mode 100644 index 0000000..43aba46 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/PaymentIntentService.php @@ -0,0 +1,181 @@ +requestCollection('get', '/v1/payment_intents', $params, $opts); + } + + /** + * A PaymentIntent object can be canceled when it is in one of these statuses: + * requires_payment_method, requires_capture, + * requires_confirmation, or requires_action. + * + * Once canceled, no additional charges will be made by the PaymentIntent and any + * operations on the PaymentIntent will fail with an error. For PaymentIntents with + * status=’requires_capture’, the remaining + * amount_capturable will automatically be refunded. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_intents/%s/cancel', $id), $params, $opts); + } + + /** + * Capture the funds of an existing uncaptured PaymentIntent when its status is + * requires_capture. + * + * Uncaptured PaymentIntents will be canceled exactly seven days after they are + * created. + * + * Learn more about separate authorization + * and capture. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function capture($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_intents/%s/capture', $id), $params, $opts); + } + + /** + * Confirm that your customer intends to pay with current or provided payment + * method. Upon confirmation, the PaymentIntent will attempt to initiate a payment. + * + * If the selected payment method requires additional authentication steps, the + * PaymentIntent will transition to the requires_action status and + * suggest additional actions via next_action. If payment fails, the + * PaymentIntent will transition to the requires_payment_method + * status. If payment succeeds, the PaymentIntent will transition to the + * succeeded status (or requires_capture, if + * capture_method is set to manual). + * + * If the confirmation_method is automatic, payment may + * be attempted using our client SDKs and + * the PaymentIntent’s client_secret. After + * next_actions are handled by the client, no additional confirmation + * is required to complete the payment. + * + * If the confirmation_method is manual, all payment + * attempts must be initiated using a secret key. If any actions are required for + * the payment, the PaymentIntent will return to the + * requires_confirmation state after those actions are completed. Your + * server needs to then explicitly re-confirm the PaymentIntent to initiate the + * next payment attempt. Read the expanded documentation to + * learn more about manual confirmation. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function confirm($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_intents/%s/confirm', $id), $params, $opts); + } + + /** + * Creates a PaymentIntent object. + * + * After the PaymentIntent is created, attach a payment method and confirm to continue the payment. + * You can read more about the different payment flows available via the Payment + * Intents API here. + * + * When confirm=true is used during creation, it is equivalent to + * creating and confirming the PaymentIntent in the same call. You may use any + * parameters available in the confirm + * API when confirm=true is supplied. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/payment_intents', $params, $opts); + } + + /** + * Retrieves the details of a PaymentIntent that has previously been created. + * + * Client-side retrieval using a publishable key is allowed when the + * client_secret is provided in the query string. + * + * When retrieved with a publishable key, only a subset of properties will be + * returned. Please refer to the payment + * intent object reference for more details. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/payment_intents/%s', $id), $params, $opts); + } + + /** + * Updates properties on a PaymentIntent object without confirming. + * + * Depending on which properties you update, you may need to confirm the + * PaymentIntent again. For example, updating the payment_method will + * always require you to confirm the PaymentIntent again. If you prefer to update + * and confirm at the same time, we recommend updating properties via the confirm API instead. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_intents/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/PaymentMethodService.php b/vendor/stripe/stripe-php/lib/Service/PaymentMethodService.php new file mode 100644 index 0000000..7111b9e --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/PaymentMethodService.php @@ -0,0 +1,121 @@ +requestCollection('get', '/v1/payment_methods', $params, $opts); + } + + /** + * Attaches a PaymentMethod object to a Customer. + * + * To attach a new PaymentMethod to a customer for future payments, we recommend + * you use a SetupIntent or a PaymentIntent + * with setup_future_usage. + * These approaches will perform any necessary steps to ensure that the + * PaymentMethod can be used in a future payment. Using the + * /v1/payment_methods/:id/attach endpoint does not ensure that future + * payments can be made with the attached PaymentMethod. See Optimizing cards for future + * payments for more information about setting up future payments. + * + * To use this PaymentMethod as the default for invoice or subscription payments, + * set invoice_settings.default_payment_method, + * on the Customer to the PaymentMethod’s ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentMethod + */ + public function attach($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_methods/%s/attach', $id), $params, $opts); + } + + /** + * Creates a PaymentMethod object. Read the Stripe.js + * reference to learn how to create PaymentMethods via Stripe.js. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentMethod + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/payment_methods', $params, $opts); + } + + /** + * Detaches a PaymentMethod object from a Customer. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentMethod + */ + public function detach($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_methods/%s/detach', $id), $params, $opts); + } + + /** + * Retrieves a PaymentMethod object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentMethod + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/payment_methods/%s', $id), $params, $opts); + } + + /** + * Updates a PaymentMethod object. A PaymentMethod must be attached a customer to + * be updated. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentMethod + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_methods/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/PayoutService.php b/vendor/stripe/stripe-php/lib/Service/PayoutService.php new file mode 100644 index 0000000..547e22d --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/PayoutService.php @@ -0,0 +1,127 @@ +requestCollection('get', '/v1/payouts', $params, $opts); + } + + /** + * A previously created payout can be canceled if it has not yet been paid out. + * Funds will be refunded to your available balance. You may not cancel automatic + * Stripe payouts. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Payout + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payouts/%s/cancel', $id), $params, $opts); + } + + /** + * To send funds to your own bank account, you create a new payout object. Your Stripe balance must be able to cover the payout amount, or + * you’ll receive an “Insufficient Funds” error. + * + * If your API key is in test mode, money won’t actually be sent, though everything + * else will occur as if in live mode. + * + * If you are creating a manual payout on a Stripe account that uses multiple + * payment source types, you’ll need to specify the source type balance that the + * payout should draw from. The balance object + * details available and pending amounts by source type. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Payout + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/payouts', $params, $opts); + } + + /** + * Retrieves the details of an existing payout. Supply the unique payout ID from + * either a payout creation request or the payout list, and Stripe will return the + * corresponding payout information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Payout + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/payouts/%s', $id), $params, $opts); + } + + /** + * Reverses a payout by debiting the destination bank account. Only payouts for + * connected accounts to US bank accounts may be reversed at this time. If the + * payout is in the pending status, + * /v1/payouts/:id/cancel should be used instead. + * + * By requesting a reversal via /v1/payouts/:id/reverse, you confirm + * that the authorized signatory of the selected bank account has authorized the + * debit on the bank account and that no other authorization is required. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Payout + */ + public function reverse($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payouts/%s/reverse', $id), $params, $opts); + } + + /** + * Updates the specified payout by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. This request accepts only the + * metadata as arguments. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Payout + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payouts/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/PlanService.php b/vendor/stripe/stripe-php/lib/Service/PlanService.php new file mode 100644 index 0000000..16625d2 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/PlanService.php @@ -0,0 +1,91 @@ +requestCollection('get', '/v1/plans', $params, $opts); + } + + /** + * You can now model subscriptions more flexibly using the Prices + * API. It replaces the Plans API and is backwards compatible to simplify your + * migration. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Plan + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/plans', $params, $opts); + } + + /** + * Deleting plans means new subscribers can’t be added. Existing subscribers aren’t + * affected. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Plan + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/plans/%s', $id), $params, $opts); + } + + /** + * Retrieves the plan with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Plan + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/plans/%s', $id), $params, $opts); + } + + /** + * Updates the specified plan by setting the values of the parameters passed. Any + * parameters not provided are left unchanged. By design, you cannot change a + * plan’s ID, amount, currency, or billing cycle. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Plan + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/plans/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/PriceService.php b/vendor/stripe/stripe-php/lib/Service/PriceService.php new file mode 100644 index 0000000..cc44f69 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/PriceService.php @@ -0,0 +1,72 @@ +requestCollection('get', '/v1/prices', $params, $opts); + } + + /** + * Creates a new price for an existing product. The price can be recurring or + * one-time. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Price + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/prices', $params, $opts); + } + + /** + * Retrieves the price with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Price + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/prices/%s', $id), $params, $opts); + } + + /** + * Updates the specified price by setting the values of the parameters passed. Any + * parameters not provided are left unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Price + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/prices/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/ProductService.php b/vendor/stripe/stripe-php/lib/Service/ProductService.php new file mode 100644 index 0000000..850cea5 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/ProductService.php @@ -0,0 +1,92 @@ +requestCollection('get', '/v1/products', $params, $opts); + } + + /** + * Creates a new product object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Product + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/products', $params, $opts); + } + + /** + * Delete a product. Deleting a product is only possible if it has no prices + * associated with it. Additionally, deleting a product with type=good + * is only possible if it has no SKUs associated with it. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Product + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/products/%s', $id), $params, $opts); + } + + /** + * Retrieves the details of an existing product. Supply the unique product ID from + * either a product creation request or the product list, and Stripe will return + * the corresponding product information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Product + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/products/%s', $id), $params, $opts); + } + + /** + * Updates the specific product by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Product + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/products/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/PromotionCodeService.php b/vendor/stripe/stripe-php/lib/Service/PromotionCodeService.php new file mode 100644 index 0000000..1de5696 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/PromotionCodeService.php @@ -0,0 +1,72 @@ +requestCollection('get', '/v1/promotion_codes', $params, $opts); + } + + /** + * A promotion code points to a coupon. You can optionally restrict the code to a + * specific customer, redemption limit, and expiration date. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PromotionCode + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/promotion_codes', $params, $opts); + } + + /** + * Retrieves the promotion code with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PromotionCode + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/promotion_codes/%s', $id), $params, $opts); + } + + /** + * Updates the specified promotion code by setting the values of the parameters + * passed. Most fields are, by design, not editable. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PromotionCode + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/promotion_codes/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Radar/EarlyFraudWarningService.php b/vendor/stripe/stripe-php/lib/Service/Radar/EarlyFraudWarningService.php new file mode 100644 index 0000000..7b09734 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Radar/EarlyFraudWarningService.php @@ -0,0 +1,43 @@ +requestCollection('get', '/v1/radar/early_fraud_warnings', $params, $opts); + } + + /** + * Retrieves the details of an early fraud warning that has previously been + * created. + * + * Please refer to the early fraud + * warning object reference for more details. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\EarlyFraudWarning + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/radar/early_fraud_warnings/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Radar/RadarServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/Radar/RadarServiceFactory.php new file mode 100644 index 0000000..b093c67 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Radar/RadarServiceFactory.php @@ -0,0 +1,29 @@ + + */ + private static $classMap = [ + 'earlyFraudWarnings' => EarlyFraudWarningService::class, + 'valueListItems' => ValueListItemService::class, + 'valueLists' => ValueListService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Radar/ValueListItemService.php b/vendor/stripe/stripe-php/lib/Service/Radar/ValueListItemService.php new file mode 100644 index 0000000..89eba2a --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Radar/ValueListItemService.php @@ -0,0 +1,74 @@ +ValueListItem objects. The objects are sorted in + * descending order by creation date, with the most recently created object + * appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/radar/value_list_items', $params, $opts); + } + + /** + * Creates a new ValueListItem object, which is added to the specified + * parent value list. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\ValueListItem + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/radar/value_list_items', $params, $opts); + } + + /** + * Deletes a ValueListItem object, removing it from its parent value + * list. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\ValueListItem + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/radar/value_list_items/%s', $id), $params, $opts); + } + + /** + * Retrieves a ValueListItem object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\ValueListItem + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/radar/value_list_items/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Radar/ValueListService.php b/vendor/stripe/stripe-php/lib/Service/Radar/ValueListService.php new file mode 100644 index 0000000..64ac2ee --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Radar/ValueListService.php @@ -0,0 +1,93 @@ +ValueList objects. The objects are sorted in + * descending order by creation date, with the most recently created object + * appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/radar/value_lists', $params, $opts); + } + + /** + * Creates a new ValueList object, which can then be referenced in + * rules. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\ValueList + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/radar/value_lists', $params, $opts); + } + + /** + * Deletes a ValueList object, also deleting any items contained + * within the value list. To be deleted, a value list must not be referenced in any + * rules. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\ValueList + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/radar/value_lists/%s', $id), $params, $opts); + } + + /** + * Retrieves a ValueList object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\ValueList + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/radar/value_lists/%s', $id), $params, $opts); + } + + /** + * Updates a ValueList object by setting the values of the parameters + * passed. Any parameters not provided will be left unchanged. Note that + * item_type is immutable. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\ValueList + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/radar/value_lists/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/RefundService.php b/vendor/stripe/stripe-php/lib/Service/RefundService.php new file mode 100644 index 0000000..49b4267 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/RefundService.php @@ -0,0 +1,76 @@ +requestCollection('get', '/v1/refunds', $params, $opts); + } + + /** + * Create a refund. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Refund + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/refunds', $params, $opts); + } + + /** + * Retrieves the details of an existing refund. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Refund + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/refunds/%s', $id), $params, $opts); + } + + /** + * Updates the specified refund by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + * + * This request only accepts metadata as an argument. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Refund + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/refunds/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Reporting/ReportRunService.php b/vendor/stripe/stripe-php/lib/Service/Reporting/ReportRunService.php new file mode 100644 index 0000000..692420c --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Reporting/ReportRunService.php @@ -0,0 +1,55 @@ +requestCollection('get', '/v1/reporting/report_runs', $params, $opts); + } + + /** + * Creates a new object and begin running the report. (Certain report types require + * a live-mode API key.). + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Reporting\ReportRun + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/reporting/report_runs', $params, $opts); + } + + /** + * Retrieves the details of an existing Report Run. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Reporting\ReportRun + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/reporting/report_runs/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Reporting/ReportTypeService.php b/vendor/stripe/stripe-php/lib/Service/Reporting/ReportTypeService.php new file mode 100644 index 0000000..e1b4ea5 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Reporting/ReportTypeService.php @@ -0,0 +1,40 @@ +requestCollection('get', '/v1/reporting/report_types', $params, $opts); + } + + /** + * Retrieves the details of a Report Type. (Certain report types require a live-mode API key.). + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Reporting\ReportType + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/reporting/report_types/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Reporting/ReportingServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/Reporting/ReportingServiceFactory.php new file mode 100644 index 0000000..7832e91 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Reporting/ReportingServiceFactory.php @@ -0,0 +1,27 @@ + + */ + private static $classMap = [ + 'reportRuns' => ReportRunService::class, + 'reportTypes' => ReportTypeService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/ReviewService.php b/vendor/stripe/stripe-php/lib/Service/ReviewService.php new file mode 100644 index 0000000..ea152f2 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/ReviewService.php @@ -0,0 +1,58 @@ +Review objects that have open set to + * true. The objects are sorted in descending order by creation date, + * with the most recently created object appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/reviews', $params, $opts); + } + + /** + * Approves a Review object, closing it and removing it from the list + * of reviews. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Review + */ + public function approve($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/reviews/%s/approve', $id), $params, $opts); + } + + /** + * Retrieves a Review object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Review + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/reviews/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/SetupAttemptService.php b/vendor/stripe/stripe-php/lib/Service/SetupAttemptService.php new file mode 100644 index 0000000..7376ea1 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/SetupAttemptService.php @@ -0,0 +1,23 @@ +requestCollection('get', '/v1/setup_attempts', $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/SetupIntentService.php b/vendor/stripe/stripe-php/lib/Service/SetupIntentService.php new file mode 100644 index 0000000..3cbec50 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/SetupIntentService.php @@ -0,0 +1,127 @@ +requestCollection('get', '/v1/setup_intents', $params, $opts); + } + + /** + * A SetupIntent object can be canceled when it is in one of these statuses: + * requires_payment_method, requires_confirmation, or + * requires_action. + * + * Once canceled, setup is abandoned and any operations on the SetupIntent will + * fail with an error. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/setup_intents/%s/cancel', $id), $params, $opts); + } + + /** + * Confirm that your customer intends to set up the current or provided payment + * method. For example, you would confirm a SetupIntent when a customer hits the + * “Save” button on a payment method management page on your website. + * + * If the selected payment method does not require any additional steps from the + * customer, the SetupIntent will transition to the succeeded status. + * + * Otherwise, it will transition to the requires_action status and + * suggest additional actions via next_action. If setup fails, the + * SetupIntent will transition to the requires_payment_method status. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent + */ + public function confirm($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/setup_intents/%s/confirm', $id), $params, $opts); + } + + /** + * Creates a SetupIntent object. + * + * After the SetupIntent is created, attach a payment method and confirm to collect any required + * permissions to charge the payment method later. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/setup_intents', $params, $opts); + } + + /** + * Retrieves the details of a SetupIntent that has previously been created. + * + * Client-side retrieval using a publishable key is allowed when the + * client_secret is provided in the query string. + * + * When retrieved with a publishable key, only a subset of properties will be + * returned. Please refer to the SetupIntent + * object reference for more details. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/setup_intents/%s', $id), $params, $opts); + } + + /** + * Updates a SetupIntent object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/setup_intents/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Sigma/ScheduledQueryRunService.php b/vendor/stripe/stripe-php/lib/Service/Sigma/ScheduledQueryRunService.php new file mode 100644 index 0000000..9264175 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Sigma/ScheduledQueryRunService.php @@ -0,0 +1,39 @@ +requestCollection('get', '/v1/sigma/scheduled_query_runs', $params, $opts); + } + + /** + * Retrieves the details of an scheduled query run. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Sigma\ScheduledQueryRun + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/sigma/scheduled_query_runs/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Sigma/SigmaServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/Sigma/SigmaServiceFactory.php new file mode 100644 index 0000000..356750f --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Sigma/SigmaServiceFactory.php @@ -0,0 +1,25 @@ + + */ + private static $classMap = [ + 'scheduledQueryRuns' => ScheduledQueryRunService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/SkuService.php b/vendor/stripe/stripe-php/lib/Service/SkuService.php new file mode 100644 index 0000000..8934f20 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/SkuService.php @@ -0,0 +1,95 @@ +requestCollection('get', '/v1/skus', $params, $opts); + } + + /** + * Creates a new SKU associated with a product. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SKU + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/skus', $params, $opts); + } + + /** + * Delete a SKU. Deleting a SKU is only possible until it has been used in an + * order. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SKU + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/skus/%s', $id), $params, $opts); + } + + /** + * Retrieves the details of an existing SKU. Supply the unique SKU identifier from + * either a SKU creation request or from the product, and Stripe will return the + * corresponding SKU information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SKU + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/skus/%s', $id), $params, $opts); + } + + /** + * Updates the specific SKU by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + * + * Note that a SKU’s attributes are not editable. Instead, you would + * need to deactivate the existing SKU and create a new one with the new attribute + * values. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SKU + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/skus/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/SourceService.php b/vendor/stripe/stripe-php/lib/Service/SourceService.php new file mode 100644 index 0000000..c6cc059 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/SourceService.php @@ -0,0 +1,110 @@ +request('get', $this->buildPath('/v1/sources/%s/source_transactions', $id), $params, $opts); + } + + /** + * Creates a new source object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Source + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/sources', $params, $opts); + } + + /** + * Delete a specified source for a given customer. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Source + */ + public function detach($parentId, $id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/customers/%s/sources/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieves an existing source object. Supply the unique source ID from a source + * creation request and Stripe will return the corresponding up-to-date source + * object information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Source + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/sources/%s', $id), $params, $opts); + } + + /** + * Updates the specified source by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + * + * This request accepts the metadata and owner as + * arguments. It is also possible to update type specific information for selected + * payment methods. Please refer to our payment method + * guides for more detail. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Source + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/sources/%s', $id), $params, $opts); + } + + /** + * Verify a given source. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Source + */ + public function verify($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/sources/%s/verify', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/SubscriptionItemService.php b/vendor/stripe/stripe-php/lib/Service/SubscriptionItemService.php new file mode 100644 index 0000000..3b2aa2b --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/SubscriptionItemService.php @@ -0,0 +1,151 @@ +requestCollection('get', '/v1/subscription_items', $params, $opts); + } + + /** + * For the specified subscription item, returns a list of summary objects. Each + * object in the list provides usage information that’s been summarized from + * multiple usage records and over a subscription billing period (e.g., 15 usage + * records in the month of September). + * + * The list is sorted in reverse-chronological order (newest first). The first list + * item represents the most current usage period that hasn’t ended yet. Since new + * usage records can still be added, the returned summary information for the + * subscription item’s ID should be seen as unstable until the subscription billing + * period ends. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allUsageRecordSummaries($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/subscription_items/%s/usage_record_summaries', $parentId), $params, $opts); + } + + /** + * Adds a new item to an existing subscription. No existing items will be changed + * or replaced. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionItem + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/subscription_items', $params, $opts); + } + + /** + * Creates a usage record for a specified subscription item and date, and fills it + * with a quantity. + * + * Usage records provide quantity information that Stripe uses to + * track how much a customer is using your service. With usage information and the + * pricing model set up by the metered + * billing plan, Stripe helps you send accurate invoices to your customers. + * + * The default calculation for usage is to add up all the quantity + * values of the usage records within a billing period. You can change this default + * behavior with the billing plan’s aggregate_usage parameter. When + * there is more than one usage record with the same timestamp, Stripe adds the + * quantity values together. In most cases, this is the desired + * resolution, however, you can change this behavior with the action + * parameter. + * + * The default pricing model for metered billing is per-unit pricing. + * For finer granularity, you can configure metered billing to have a tiered pricing + * model. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\UsageRecord + */ + public function createUsageRecord($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/subscription_items/%s/usage_records', $parentId), $params, $opts); + } + + /** + * Deletes an item from the subscription. Removing a subscription item from a + * subscription will not cancel the subscription. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionItem + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/subscription_items/%s', $id), $params, $opts); + } + + /** + * Retrieves the subscription item with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionItem + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/subscription_items/%s', $id), $params, $opts); + } + + /** + * Updates the plan or quantity of an item on a current subscription. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionItem + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/subscription_items/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/SubscriptionScheduleService.php b/vendor/stripe/stripe-php/lib/Service/SubscriptionScheduleService.php new file mode 100644 index 0000000..9eed460 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/SubscriptionScheduleService.php @@ -0,0 +1,113 @@ +requestCollection('get', '/v1/subscription_schedules', $params, $opts); + } + + /** + * Cancels a subscription schedule and its associated subscription immediately (if + * the subscription schedule has an active subscription). A subscription schedule + * can only be canceled if its status is not_started or + * active. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionSchedule + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/subscription_schedules/%s/cancel', $id), $params, $opts); + } + + /** + * Creates a new subscription schedule object. Each customer can have up to 500 + * active or scheduled subscriptions. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionSchedule + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/subscription_schedules', $params, $opts); + } + + /** + * Releases the subscription schedule immediately, which will stop scheduling of + * its phases, but leave any existing subscription in place. A schedule can only be + * released if its status is not_started or active. If + * the subscription schedule is currently associated with a subscription, releasing + * it will remove its subscription property and set the subscription’s + * ID to the released_subscription property. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionSchedule + */ + public function release($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/subscription_schedules/%s/release', $id), $params, $opts); + } + + /** + * Retrieves the details of an existing subscription schedule. You only need to + * supply the unique subscription schedule identifier that was returned upon + * subscription schedule creation. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionSchedule + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/subscription_schedules/%s', $id), $params, $opts); + } + + /** + * Updates an existing subscription schedule. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionSchedule + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/subscription_schedules/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/SubscriptionService.php b/vendor/stripe/stripe-php/lib/Service/SubscriptionService.php new file mode 100644 index 0000000..f3ac768 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/SubscriptionService.php @@ -0,0 +1,124 @@ +status=canceled. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/subscriptions', $params, $opts); + } + + /** + * Cancels a customer’s subscription immediately. The customer will not be charged + * again for the subscription. + * + * Note, however, that any pending invoice items that you’ve created will still be + * charged for at the end of the period, unless manually deleted. If you’ve set the subscription to cancel + * at the end of the period, any pending prorations will also be left in place and + * collected at the end of the period. But if the subscription is set to cancel + * immediately, pending prorations will be removed. + * + * By default, upon subscription cancellation, Stripe will stop automatic + * collection of all finalized invoices for the customer. This is intended to + * prevent unexpected payment attempts after the customer has canceled a + * subscription. However, you can resume automatic collection of the invoices + * manually after subscription cancellation to have us proceed. Or, you could check + * for unpaid invoices before allowing the customer to cancel the subscription at + * all. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/subscriptions/%s', $id), $params, $opts); + } + + /** + * Creates a new subscription on an existing customer. Each customer can have up to + * 500 active or scheduled subscriptions. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/subscriptions', $params, $opts); + } + + /** + * Removes the currently applied discount on a subscription. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription + */ + public function deleteDiscount($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/subscriptions/%s/discount', $id), $params, $opts); + } + + /** + * Retrieves the subscription with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/subscriptions/%s', $id), $params, $opts); + } + + /** + * Updates an existing subscription on a customer to match the specified + * parameters. When changing plans or quantities, we will optionally prorate the + * price we charge next month to make up for any price changes. To preview how the + * proration will be calculated, use the upcoming + * invoice endpoint. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/subscriptions/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/TaxCodeService.php b/vendor/stripe/stripe-php/lib/Service/TaxCodeService.php new file mode 100644 index 0000000..007b771 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/TaxCodeService.php @@ -0,0 +1,41 @@ +all tax codes + * available to add to Products in order to allow specific tax calculations. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/tax_codes', $params, $opts); + } + + /** + * Retrieves the details of an existing tax code. Supply the unique tax code ID and + * Stripe will return the corresponding tax code information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxCode + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/tax_codes/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/TaxRateService.php b/vendor/stripe/stripe-php/lib/Service/TaxRateService.php new file mode 100644 index 0000000..7cee1fe --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/TaxRateService.php @@ -0,0 +1,71 @@ +requestCollection('get', '/v1/tax_rates', $params, $opts); + } + + /** + * Creates a new tax rate. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxRate + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/tax_rates', $params, $opts); + } + + /** + * Retrieves a tax rate with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxRate + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/tax_rates/%s', $id), $params, $opts); + } + + /** + * Updates an existing tax rate. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxRate + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/tax_rates/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Terminal/ConnectionTokenService.php b/vendor/stripe/stripe-php/lib/Service/Terminal/ConnectionTokenService.php new file mode 100644 index 0000000..7b25b23 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Terminal/ConnectionTokenService.php @@ -0,0 +1,25 @@ +request('post', '/v1/terminal/connection_tokens', $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Terminal/LocationService.php b/vendor/stripe/stripe-php/lib/Service/Terminal/LocationService.php new file mode 100644 index 0000000..8adc7a5 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Terminal/LocationService.php @@ -0,0 +1,87 @@ +Location objects. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/terminal/locations', $params, $opts); + } + + /** + * Creates a new Location object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Location + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/terminal/locations', $params, $opts); + } + + /** + * Deletes a Location object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Location + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts); + } + + /** + * Retrieves a Location object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Location + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts); + } + + /** + * Updates a Location object by setting the values of the parameters + * passed. Any parameters not provided will be left unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Location + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Terminal/ReaderService.php b/vendor/stripe/stripe-php/lib/Service/Terminal/ReaderService.php new file mode 100644 index 0000000..765015c --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Terminal/ReaderService.php @@ -0,0 +1,87 @@ +Reader objects. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/terminal/readers', $params, $opts); + } + + /** + * Creates a new Reader object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/terminal/readers', $params, $opts); + } + + /** + * Deletes a Reader object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts); + } + + /** + * Retrieves a Reader object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts); + } + + /** + * Updates a Reader object by setting the values of the parameters + * passed. Any parameters not provided will be left unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Terminal/TerminalServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/Terminal/TerminalServiceFactory.php new file mode 100644 index 0000000..c70ac87 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Terminal/TerminalServiceFactory.php @@ -0,0 +1,29 @@ + + */ + private static $classMap = [ + 'connectionTokens' => ConnectionTokenService::class, + 'locations' => LocationService::class, + 'readers' => ReaderService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/TokenService.php b/vendor/stripe/stripe-php/lib/Service/TokenService.php new file mode 100644 index 0000000..1c72759 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/TokenService.php @@ -0,0 +1,42 @@ +Custom + * account. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Token + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/tokens', $params, $opts); + } + + /** + * Retrieves the token with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Token + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/tokens/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/TopupService.php b/vendor/stripe/stripe-php/lib/Service/TopupService.php new file mode 100644 index 0000000..059dc20 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/TopupService.php @@ -0,0 +1,89 @@ +requestCollection('get', '/v1/topups', $params, $opts); + } + + /** + * Cancels a top-up. Only pending top-ups can be canceled. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Topup + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/topups/%s/cancel', $id), $params, $opts); + } + + /** + * Top up the balance of an account. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Topup + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/topups', $params, $opts); + } + + /** + * Retrieves the details of a top-up that has previously been created. Supply the + * unique top-up ID that was returned from your previous request, and Stripe will + * return the corresponding top-up information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Topup + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/topups/%s', $id), $params, $opts); + } + + /** + * Updates the metadata of a top-up. Other top-up details are not editable by + * design. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Topup + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/topups/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/TransferService.php b/vendor/stripe/stripe-php/lib/Service/TransferService.php new file mode 100644 index 0000000..150bbf7 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/TransferService.php @@ -0,0 +1,175 @@ +requestCollection('get', '/v1/transfers', $params, $opts); + } + + /** + * You can see a list of the reversals belonging to a specific transfer. Note that + * the 10 most recent reversals are always available by default on the transfer + * object. If you need more than those 10, you can use this API method and the + * limit and starting_after parameters to page through + * additional reversals. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allReversals($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/transfers/%s/reversals', $parentId), $params, $opts); + } + + /** + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Transfer + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/transfers/%s/cancel', $id), $params, $opts); + } + + /** + * To send funds from your Stripe account to a connected account, you create a new + * transfer object. Your Stripe balance must be able to + * cover the transfer amount, or you’ll receive an “Insufficient Funds” error. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Transfer + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/transfers', $params, $opts); + } + + /** + * When you create a new reversal, you must specify a transfer to create it on. + * + * When reversing transfers, you can optionally reverse part of the transfer. You + * can do so as many times as you wish until the entire transfer has been reversed. + * + * Once entirely reversed, a transfer can’t be reversed again. This method will + * return an error when called on an already-reversed transfer, or when trying to + * reverse more money than is left on a transfer. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TransferReversal + */ + public function createReversal($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/transfers/%s/reversals', $parentId), $params, $opts); + } + + /** + * Retrieves the details of an existing transfer. Supply the unique transfer ID + * from either a transfer creation request or the transfer list, and Stripe will + * return the corresponding transfer information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Transfer + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/transfers/%s', $id), $params, $opts); + } + + /** + * By default, you can see the 10 most recent reversals stored directly on the + * transfer object, but you can also retrieve details about a specific reversal + * stored on the transfer. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TransferReversal + */ + public function retrieveReversal($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/transfers/%s/reversals/%s', $parentId, $id), $params, $opts); + } + + /** + * Updates the specified transfer by setting the values of the parameters passed. + * Any parameters not provided will be left unchanged. + * + * This request accepts only metadata as an argument. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Transfer + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/transfers/%s', $id), $params, $opts); + } + + /** + * Updates the specified reversal by setting the values of the parameters passed. + * Any parameters not provided will be left unchanged. + * + * This request only accepts metadata and description as arguments. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TransferReversal + */ + public function updateReversal($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/transfers/%s/reversals/%s', $parentId, $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/WebhookEndpointService.php b/vendor/stripe/stripe-php/lib/Service/WebhookEndpointService.php new file mode 100644 index 0000000..01e6422 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/WebhookEndpointService.php @@ -0,0 +1,97 @@ +requestCollection('get', '/v1/webhook_endpoints', $params, $opts); + } + + /** + * A webhook endpoint must have a url and a list of + * enabled_events. You may optionally specify the Boolean + * connect parameter. If set to true, then a Connect webhook endpoint + * that notifies the specified url about events from all connected + * accounts is created; otherwise an account webhook endpoint that notifies the + * specified url only about events from your account is created. You + * can also create webhook endpoints in the webhooks settings + * section of the Dashboard. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\WebhookEndpoint + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/webhook_endpoints', $params, $opts); + } + + /** + * You can also delete webhook endpoints via the webhook endpoint + * management page of the Stripe dashboard. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\WebhookEndpoint + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts); + } + + /** + * Retrieves the webhook endpoint with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\WebhookEndpoint + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts); + } + + /** + * Updates the webhook endpoint. You may edit the url, the list of + * enabled_events, and the status of your endpoint. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\WebhookEndpoint + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/SetupAttempt.php b/vendor/stripe/stripe-php/lib/SetupAttempt.php new file mode 100644 index 0000000..6c83b68 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/SetupAttempt.php @@ -0,0 +1,32 @@ +application on the SetupIntent at the time of this confirmation. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string|\Stripe\Customer $customer The value of customer on the SetupIntent at the time of this confirmation. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string|\Stripe\Account $on_behalf_of The value of on_behalf_of on the SetupIntent at the time of this confirmation. + * @property string|\Stripe\PaymentMethod $payment_method ID of the payment method used with this SetupAttempt. + * @property \Stripe\StripeObject $payment_method_details + * @property null|\Stripe\ErrorObject $setup_error The error encountered during this attempt to confirm the SetupIntent, if any. + * @property string|\Stripe\SetupIntent $setup_intent ID of the SetupIntent that this attempt belongs to. + * @property string $status Status of this SetupAttempt, one of requires_confirmation, requires_action, processing, succeeded, failed, or abandoned. + * @property string $usage The value of usage on the SetupIntent at the time of this confirmation, one of off_session or on_session. + */ +class SetupAttempt extends ApiResource +{ + const OBJECT_NAME = 'setup_attempt'; + + use ApiOperations\All; +} diff --git a/vendor/stripe/stripe-php/lib/SetupIntent.php b/vendor/stripe/stripe-php/lib/SetupIntent.php new file mode 100644 index 0000000..081bb2d --- /dev/null +++ b/vendor/stripe/stripe-php/lib/SetupIntent.php @@ -0,0 +1,114 @@ +PaymentIntents to drive + * the payment flow. + * + * Create a SetupIntent as soon as you're ready to collect your customer's payment + * credentials. Do not maintain long-lived, unconfirmed SetupIntents as they may no + * longer be valid. The SetupIntent then transitions through multiple statuses as + * it guides you through the setup process. + * + * Successful SetupIntents result in payment credentials that are optimized for + * future payments. For example, cardholders in certain regions may need to be + * run through Strong Customer + * Authentication at the time of payment method collection in order to + * streamline later off-session payments. + * If the SetupIntent is used with a Customer, + * upon success, it will automatically attach the resulting payment method to that + * Customer. We recommend using SetupIntents or setup_future_usage + * on PaymentIntents to save payment methods in order to prevent saving invalid or + * unoptimized payment methods. + * + * By using SetupIntents, you ensure that your customers experience the minimum set + * of required friction, even as regulations change over time. + * + * Related guide: Setup + * Intents API. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the SetupIntent. + * @property null|string $cancellation_reason Reason for cancellation of this SetupIntent, one of abandoned, requested_by_customer, or duplicate. + * @property null|string $client_secret

The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.

The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.

+ * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string|\Stripe\Customer $customer

ID of the Customer this SetupIntent belongs to, if one exists.

If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.

+ * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|\Stripe\ErrorObject $last_setup_error The error encountered in the previous SetupIntent confirmation. + * @property null|string|\Stripe\SetupAttempt $latest_attempt The most recent SetupAttempt for this SetupIntent. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string|\Stripe\Mandate $mandate ID of the multi use Mandate generated by the SetupIntent. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|\Stripe\StripeObject $next_action If present, this property tells you what actions you need to take in order for your customer to continue payment setup. + * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the setup is intended. + * @property null|string|\Stripe\PaymentMethod $payment_method ID of the payment method used with this SetupIntent. + * @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for this SetupIntent. + * @property string[] $payment_method_types The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. + * @property null|string|\Stripe\Mandate $single_use_mandate ID of the single_use Mandate generated by the SetupIntent. + * @property string $status Status of this SetupIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, canceled, or succeeded. + * @property string $usage

Indicates how the payment method is intended to be used in the future.

Use on_session if you intend to only reuse the payment method when the customer is in your checkout flow. Use off_session if your customer may or may not be in your checkout flow. If not provided, this value defaults to off_session.

+ */ +class SetupIntent extends ApiResource +{ + const OBJECT_NAME = 'setup_intent'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const STATUS_CANCELED = 'canceled'; + const STATUS_PROCESSING = 'processing'; + const STATUS_REQUIRES_ACTION = 'requires_action'; + const STATUS_REQUIRES_CONFIRMATION = 'requires_confirmation'; + const STATUS_REQUIRES_PAYMENT_METHOD = 'requires_payment_method'; + const STATUS_SUCCEEDED = 'succeeded'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent the canceled setup intent + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent the confirmed setup intent + */ + public function confirm($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/confirm'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/Sigma/ScheduledQueryRun.php b/vendor/stripe/stripe-php/lib/Sigma/ScheduledQueryRun.php new file mode 100644 index 0000000..b109dde --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Sigma/ScheduledQueryRun.php @@ -0,0 +1,37 @@ +scheduled + * a Sigma query, you'll receive a + * sigma.scheduled_query_run.created webhook each time the query runs. + * The webhook contains a ScheduledQueryRun object, which you can use + * to retrieve the query results. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property int $data_load_time When the query was run, Sigma contained a snapshot of your Stripe data at this time. + * @property \Stripe\StripeObject $error + * @property null|\Stripe\File $file The file object representing the results of the query. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property int $result_available_until Time at which the result expires and is no longer available for download. + * @property string $sql SQL for the query. + * @property string $status The query's execution status, which will be completed for successful runs, and canceled, failed, or timed_out otherwise. + * @property string $title Title of the query. + */ +class ScheduledQueryRun extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'scheduled_query_run'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + + public static function classUrl() + { + return '/v1/sigma/scheduled_query_runs'; + } +} diff --git a/vendor/stripe/stripe-php/lib/SingletonApiResource.php b/vendor/stripe/stripe-php/lib/SingletonApiResource.php new file mode 100644 index 0000000..704cff8 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/SingletonApiResource.php @@ -0,0 +1,38 @@ +refresh(); + + return $instance; + } + + /** + * @return string the endpoint associated with this singleton class + */ + public static function classUrl() + { + // Replace dots with slashes for namespaced resources, e.g. if the object's name is + // "foo.bar", then its URL will be "/v1/foo/bar". + $base = \str_replace('.', '/', static::OBJECT_NAME); + + return "/v1/{$base}"; + } + + /** + * @return string the endpoint associated with this singleton API resource + */ + public function instanceUrl() + { + return static::classUrl(); + } +} diff --git a/vendor/stripe/stripe-php/lib/Source.php b/vendor/stripe/stripe-php/lib/Source.php new file mode 100644 index 0000000..75e7594 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Source.php @@ -0,0 +1,168 @@ +Source objects allow you to accept a variety of payment methods. + * They represent a customer's payment instrument, and can be used with the Stripe + * API just like a Card object: once chargeable, they can be charged, + * or can be attached to customers. + * + * Related guides: Sources API and Sources & Customers. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property \Stripe\StripeObject $ach_credit_transfer + * @property \Stripe\StripeObject $ach_debit + * @property \Stripe\StripeObject $acss_debit + * @property \Stripe\StripeObject $alipay + * @property null|int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for single_use sources. + * @property \Stripe\StripeObject $au_becs_debit + * @property \Stripe\StripeObject $bancontact + * @property \Stripe\StripeObject $card + * @property \Stripe\StripeObject $card_present + * @property string $client_secret The client secret of the source. Used for client-side retrieval using a publishable key. + * @property \Stripe\StripeObject $code_verification + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $currency Three-letter ISO code for the currency associated with the source. This is the currency for which the source will be chargeable once ready. Required for single_use sources. + * @property string $customer The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer. + * @property \Stripe\StripeObject $eps + * @property string $flow The authentication flow of the source. flow is one of redirect, receiver, code_verification, none. + * @property \Stripe\StripeObject $giropay + * @property \Stripe\StripeObject $ideal + * @property \Stripe\StripeObject $klarna + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\StripeObject $multibanco + * @property null|\Stripe\StripeObject $owner Information about the owner of the payment instrument that may be used or required by particular source types. + * @property \Stripe\StripeObject $p24 + * @property \Stripe\StripeObject $receiver + * @property \Stripe\StripeObject $redirect + * @property \Stripe\StripeObject $sepa_credit_transfer + * @property \Stripe\StripeObject $sepa_debit + * @property \Stripe\StripeObject $sofort + * @property \Stripe\StripeObject $source_order + * @property null|string $statement_descriptor Extra information about a source. This will appear on your customer's statement every time you charge the source. + * @property string $status The status of the source, one of canceled, chargeable, consumed, failed, or pending. Only chargeable sources can be used to create a charge. + * @property \Stripe\StripeObject $three_d_secure + * @property string $type The type of the source. The type is a payment method, one of ach_credit_transfer, ach_debit, alipay, bancontact, card, card_present, eps, giropay, ideal, multibanco, klarna, p24, sepa_debit, sofort, three_d_secure, or wechat. An additional hash is included on the source with a name matching this value. It contains additional information specific to the payment method used. + * @property null|string $usage Either reusable or single_use. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned. + * @property \Stripe\StripeObject $wechat + */ +class Source extends ApiResource +{ + const OBJECT_NAME = 'source'; + + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const FLOW_CODE_VERIFICATION = 'code_verification'; + const FLOW_NONE = 'none'; + const FLOW_RECEIVER = 'receiver'; + const FLOW_REDIRECT = 'redirect'; + + const STATUS_CANCELED = 'canceled'; + const STATUS_CHARGEABLE = 'chargeable'; + const STATUS_CONSUMED = 'consumed'; + const STATUS_FAILED = 'failed'; + const STATUS_PENDING = 'pending'; + + const USAGE_REUSABLE = 'reusable'; + const USAGE_SINGLE_USE = 'single_use'; + + use ApiOperations\NestedResource; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\UnexpectedValueException if the source is not attached to a customer + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Source the detached source + */ + public function detach($params = null, $opts = null) + { + self::_validateParams($params); + + $id = $this['id']; + if (!$id) { + $class = static::class; + $msg = "Could not determine which URL to request: {$class} instance " + . "has invalid ID: {$id}"; + + throw new Exception\UnexpectedValueException($msg, null); + } + + if ($this['customer']) { + $base = Customer::classUrl(); + $parentExtn = \urlencode(Util\Util::utf8($this['customer'])); + $extn = \urlencode(Util\Util::utf8($id)); + $url = "{$base}/{$parentExtn}/sources/{$extn}"; + + list($response, $opts) = $this->_request('delete', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + $message = 'This source object does not appear to be currently attached ' + . 'to a customer object.'; + + throw new Exception\UnexpectedValueException($message); + } + + /** + * @deprecated sourceTransactions is deprecated. Please use Source::allSourceTransactions instead. + * + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of source transactions + */ + public function sourceTransactions($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/source_transactions'; + list($response, $opts) = $this->_request('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param string $id + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of source transactions + */ + public static function allSourceTransactions($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, '/source_transactions', $params, $opts); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Source the verified source + */ + public function verify($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/verify'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/SourceTransaction.php b/vendor/stripe/stripe-php/lib/SourceTransaction.php new file mode 100644 index 0000000..281f2a7 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/SourceTransaction.php @@ -0,0 +1,20 @@ +coreServiceFactory) { + $this->coreServiceFactory = new \Stripe\Service\CoreServiceFactory($this); + } + + return $this->coreServiceFactory->__get($name); + } +} diff --git a/vendor/stripe/stripe-php/lib/StripeClientInterface.php b/vendor/stripe/stripe-php/lib/StripeClientInterface.php new file mode 100644 index 0000000..adcef3f --- /dev/null +++ b/vendor/stripe/stripe-php/lib/StripeClientInterface.php @@ -0,0 +1,56 @@ + "old_value"] + * + * If we update the object with `metadata[new]=new_value`, the server side + * object now has *both* fields: + * + * metadata = ["old" => "old_value", "new" => "new_value"] + * + * This is okay in itself because usually users will want to treat it as + * additive: + * + * $obj->metadata["new"] = "new_value"; + * $obj->save(); + * + * However, in other cases, they may want to replace the entire existing + * contents: + * + * $obj->metadata = ["new" => "new_value"]; + * $obj->save(); + * + * This is where things get a little bit tricky because in order to clear + * any old keys that may have existed, we actually have to send an explicit + * empty string to the server. So the operation above would have to send + * this form to get the intended behavior: + * + * metadata[old]=&metadata[new]=new_value + * + * This method allows us to track which parameters are considered additive, + * and lets us behave correctly where appropriate when serializing + * parameters to be sent. + * + * @return Util\Set Set of additive parameters + */ + public static function getAdditiveParams() + { + static $additiveParams = null; + if (null === $additiveParams) { + // Set `metadata` as additive so that when it's set directly we remember + // to clear keys that may have been previously set by sending empty + // values for them. + // + // It's possible that not every object has `metadata`, but having this + // option set when there is no `metadata` field is not harmful. + $additiveParams = new Util\Set([ + 'metadata', + ]); + } + + return $additiveParams; + } + + public function __construct($id = null, $opts = null) + { + list($id, $this->_retrieveOptions) = Util\Util::normalizeId($id); + $this->_opts = Util\RequestOptions::parse($opts); + $this->_originalValues = []; + $this->_values = []; + $this->_unsavedValues = new Util\Set(); + $this->_transientValues = new Util\Set(); + if (null !== $id) { + $this->_values['id'] = $id; + } + } + + // Standard accessor magic methods + public function __set($k, $v) + { + if (static::getPermanentAttributes()->includes($k)) { + throw new Exception\InvalidArgumentException( + "Cannot set {$k} on this object. HINT: you can't set: " . + \implode(', ', static::getPermanentAttributes()->toArray()) + ); + } + + if ('' === $v) { + throw new Exception\InvalidArgumentException( + 'You cannot set \'' . $k . '\'to an empty string. ' + . 'We interpret empty strings as NULL in requests. ' + . 'You may set obj->' . $k . ' = NULL to delete the property' + ); + } + + $this->_values[$k] = Util\Util::convertToStripeObject($v, $this->_opts); + $this->dirtyValue($this->_values[$k]); + $this->_unsavedValues->add($k); + } + + public function __isset($k) + { + return isset($this->_values[$k]); + } + + public function __unset($k) + { + unset($this->_values[$k]); + $this->_transientValues->add($k); + $this->_unsavedValues->discard($k); + } + + public function &__get($k) + { + // function should return a reference, using $nullval to return a reference to null + $nullval = null; + if (!empty($this->_values) && \array_key_exists($k, $this->_values)) { + return $this->_values[$k]; + } + if (!empty($this->_transientValues) && $this->_transientValues->includes($k)) { + $class = static::class; + $attrs = \implode(', ', \array_keys($this->_values)); + $message = "Stripe Notice: Undefined property of {$class} instance: {$k}. " + . "HINT: The {$k} attribute was set in the past, however. " + . 'It was then wiped when refreshing the object ' + . "with the result returned by Stripe's API, " + . 'probably as a result of a save(). The attributes currently ' + . "available on this object are: {$attrs}"; + Stripe::getLogger()->error($message); + + return $nullval; + } + $class = static::class; + Stripe::getLogger()->error("Stripe Notice: Undefined property of {$class} instance: {$k}"); + + return $nullval; + } + + // Magic method for var_dump output. Only works with PHP >= 5.6 + public function __debugInfo() + { + return $this->_values; + } + + // ArrayAccess methods + public function offsetSet($k, $v) + { + $this->{$k} = $v; + } + + public function offsetExists($k) + { + return \array_key_exists($k, $this->_values); + } + + public function offsetUnset($k) + { + unset($this->{$k}); + } + + public function offsetGet($k) + { + return \array_key_exists($k, $this->_values) ? $this->_values[$k] : null; + } + + // Countable method + public function count() + { + return \count($this->_values); + } + + public function keys() + { + return \array_keys($this->_values); + } + + public function values() + { + return \array_values($this->_values); + } + + /** + * This unfortunately needs to be public to be used in Util\Util. + * + * @param array $values + * @param null|array|string|Util\RequestOptions $opts + * + * @return static the object constructed from the given values + */ + public static function constructFrom($values, $opts = null) + { + $obj = new static(isset($values['id']) ? $values['id'] : null); + $obj->refreshFrom($values, $opts); + + return $obj; + } + + /** + * Refreshes this object using the provided values. + * + * @param array $values + * @param null|array|string|Util\RequestOptions $opts + * @param bool $partial defaults to false + */ + public function refreshFrom($values, $opts, $partial = false) + { + $this->_opts = Util\RequestOptions::parse($opts); + + $this->_originalValues = self::deepCopy($values); + + if ($values instanceof StripeObject) { + $values = $values->toArray(); + } + + // Wipe old state before setting new. This is useful for e.g. updating a + // customer, where there is no persistent card parameter. Mark those values + // which don't persist as transient + if ($partial) { + $removed = new Util\Set(); + } else { + $removed = new Util\Set(\array_diff(\array_keys($this->_values), \array_keys($values))); + } + + foreach ($removed->toArray() as $k) { + unset($this->{$k}); + } + + $this->updateAttributes($values, $opts, false); + foreach ($values as $k => $v) { + $this->_transientValues->discard($k); + $this->_unsavedValues->discard($k); + } + } + + /** + * Mass assigns attributes on the model. + * + * @param array $values + * @param null|array|string|Util\RequestOptions $opts + * @param bool $dirty defaults to true + */ + public function updateAttributes($values, $opts = null, $dirty = true) + { + foreach ($values as $k => $v) { + // Special-case metadata to always be cast as a StripeObject + // This is necessary in case metadata is empty, as PHP arrays do + // not differentiate between lists and hashes, and we consider + // empty arrays to be lists. + if (('metadata' === $k) && (\is_array($v))) { + $this->_values[$k] = StripeObject::constructFrom($v, $opts); + } else { + $this->_values[$k] = Util\Util::convertToStripeObject($v, $opts); + } + if ($dirty) { + $this->dirtyValue($this->_values[$k]); + } + $this->_unsavedValues->add($k); + } + } + + /** + * @param bool $force defaults to false + * + * @return array a recursive mapping of attributes to values for this object, + * including the proper value for deleted attributes + */ + public function serializeParameters($force = false) + { + $updateParams = []; + + foreach ($this->_values as $k => $v) { + // There are a few reasons that we may want to add in a parameter for + // update: + // + // 1. The `$force` option has been set. + // 2. We know that it was modified. + // 3. Its value is a StripeObject. A StripeObject may contain modified + // values within in that its parent StripeObject doesn't know about. + // + $original = \array_key_exists($k, $this->_originalValues) ? $this->_originalValues[$k] : null; + $unsaved = $this->_unsavedValues->includes($k); + if ($force || $unsaved || $v instanceof StripeObject) { + $updateParams[$k] = $this->serializeParamsValue( + $this->_values[$k], + $original, + $unsaved, + $force, + $k + ); + } + } + + // a `null` that makes it out of `serializeParamsValue` signals an empty + // value that we shouldn't appear in the serialized form of the object + return \array_filter( + $updateParams, + function ($v) { + return null !== $v; + } + ); + } + + public function serializeParamsValue($value, $original, $unsaved, $force, $key = null) + { + // The logic here is that essentially any object embedded in another + // object that had a `type` is actually an API resource of a different + // type that's been included in the response. These other resources must + // be updated from their proper endpoints, and therefore they are not + // included when serializing even if they've been modified. + // + // There are _some_ known exceptions though. + // + // For example, if the value is unsaved (meaning the user has set it), and + // it looks like the API resource is persisted with an ID, then we include + // the object so that parameters are serialized with a reference to its + // ID. + // + // Another example is that on save API calls it's sometimes desirable to + // update a customer's default source by setting a new card (or other) + // object with `->source=` and then saving the customer. The + // `saveWithParent` flag to override the default behavior allows us to + // handle these exceptions. + // + // We throw an error if a property was set explicitly but we can't do + // anything with it because the integration is probably not working as the + // user intended it to. + if (null === $value) { + return ''; + } + if (($value instanceof ApiResource) && (!$value->saveWithParent)) { + if (!$unsaved) { + return null; + } + if (isset($value->id)) { + return $value; + } + + throw new Exception\InvalidArgumentException( + "Cannot save property `{$key}` containing an API resource of type " . + \get_class($value) . ". It doesn't appear to be persisted and is " . + 'not marked as `saveWithParent`.' + ); + } + if (\is_array($value)) { + if (Util\Util::isList($value)) { + // Sequential array, i.e. a list + $update = []; + foreach ($value as $v) { + $update[] = $this->serializeParamsValue($v, null, true, $force); + } + // This prevents an array that's unchanged from being resent. + if ($update !== $this->serializeParamsValue($original, null, true, $force, $key)) { + return $update; + } + } else { + // Associative array, i.e. a map + return Util\Util::convertToStripeObject($value, $this->_opts)->serializeParameters(); + } + } elseif ($value instanceof StripeObject) { + $update = $value->serializeParameters($force); + if ($original && $unsaved && $key && static::getAdditiveParams()->includes($key)) { + $update = \array_merge(self::emptyValues($original), $update); + } + + return $update; + } else { + return $value; + } + } + + public function jsonSerialize() + { + return $this->toArray(); + } + + /** + * Returns an associative array with the key and values composing the + * Stripe object. + * + * @return array the associative array + */ + public function toArray() + { + $maybeToArray = function ($value) { + if (null === $value) { + return null; + } + + return \is_object($value) && \method_exists($value, 'toArray') ? $value->toArray() : $value; + }; + + return \array_reduce(\array_keys($this->_values), function ($acc, $k) use ($maybeToArray) { + if ('_' === \substr((string) $k, 0, 1)) { + return $acc; + } + $v = $this->_values[$k]; + if (Util\Util::isList($v)) { + $acc[$k] = \array_map($maybeToArray, $v); + } else { + $acc[$k] = $maybeToArray($v); + } + + return $acc; + }, []); + } + + /** + * Returns a pretty JSON representation of the Stripe object. + * + * @return string the JSON representation of the Stripe object + */ + public function toJSON() + { + return \json_encode($this->toArray(), \JSON_PRETTY_PRINT); + } + + public function __toString() + { + $class = static::class; + + return $class . ' JSON: ' . $this->toJSON(); + } + + /** + * Sets all keys within the StripeObject as unsaved so that they will be + * included with an update when `serializeParameters` is called. This + * method is also recursive, so any StripeObjects contained as values or + * which are values in a tenant array are also marked as dirty. + */ + public function dirty() + { + $this->_unsavedValues = new Util\Set(\array_keys($this->_values)); + foreach ($this->_values as $k => $v) { + $this->dirtyValue($v); + } + } + + protected function dirtyValue($value) + { + if (\is_array($value)) { + foreach ($value as $v) { + $this->dirtyValue($v); + } + } elseif ($value instanceof StripeObject) { + $value->dirty(); + } + } + + /** + * Produces a deep copy of the given object including support for arrays + * and StripeObjects. + * + * @param mixed $obj + */ + protected static function deepCopy($obj) + { + if (\is_array($obj)) { + $copy = []; + foreach ($obj as $k => $v) { + $copy[$k] = self::deepCopy($v); + } + + return $copy; + } + if ($obj instanceof StripeObject) { + return $obj::constructFrom( + self::deepCopy($obj->_values), + clone $obj->_opts + ); + } + + return $obj; + } + + /** + * Returns a hash of empty values for all the values that are in the given + * StripeObject. + * + * @param mixed $obj + */ + public static function emptyValues($obj) + { + if (\is_array($obj)) { + $values = $obj; + } elseif ($obj instanceof StripeObject) { + $values = $obj->_values; + } else { + throw new Exception\InvalidArgumentException( + 'empty_values got unexpected object type: ' . \get_class($obj) + ); + } + + return \array_fill_keys(\array_keys($values), ''); + } + + /** + * @return null|ApiResponse The last response from the Stripe API + */ + public function getLastResponse() + { + return $this->_lastResponse; + } + + /** + * Sets the last response from the Stripe API. + * + * @param ApiResponse $resp + */ + public function setLastResponse($resp) + { + $this->_lastResponse = $resp; + } + + /** + * Indicates whether or not the resource has been deleted on the server. + * Note that some, but not all, resources can indicate whether they have + * been deleted. + * + * @return bool whether the resource is deleted + */ + public function isDeleted() + { + return isset($this->_values['deleted']) ? $this->_values['deleted'] : false; + } +} diff --git a/vendor/stripe/stripe-php/lib/Subscription.php b/vendor/stripe/stripe-php/lib/Subscription.php new file mode 100644 index 0000000..a768ac1 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Subscription.php @@ -0,0 +1,117 @@ +Creating + * Subscriptions. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|float $application_fee_percent A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. + * @property \Stripe\StripeObject $automatic_tax + * @property int $billing_cycle_anchor Determines the date of the first full invoice, and, for plans with month or year intervals, the day of the month for subsequent invoices. + * @property null|\Stripe\StripeObject $billing_thresholds Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period + * @property null|int $cancel_at A date in the future at which the subscription will automatically get canceled + * @property bool $cancel_at_period_end If the subscription has been canceled with the at_period_end flag set to true, cancel_at_period_end on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period. + * @property null|int $canceled_at If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with cancel_at_period_end, canceled_at will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state. + * @property null|string $collection_method Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property int $current_period_end End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created. + * @property int $current_period_start Start of the current period that the subscription has been invoiced for. + * @property string|\Stripe\Customer $customer ID of the customer who owns the subscription. + * @property null|int $days_until_due Number of days a customer has to pay invoices generated by this subscription. This value will be null for subscriptions where collection_method=charge_automatically. + * @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over default_source. If neither are set, invoices will use the customer's invoice_settings.default_payment_method or default_source. + * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If default_payment_method is also set, default_payment_method will take precedence. If neither are set, invoices will use the customer's invoice_settings.default_payment_method or default_source. + * @property null|\Stripe\TaxRate[] $default_tax_rates The tax rates that will apply to any subscription item that does not have tax_rates set. Invoices created will have their default_tax_rates populated from the subscription. + * @property null|\Stripe\Discount $discount Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis. + * @property null|int $ended_at If the subscription has ended, the date the subscription ended. + * @property \Stripe\Collection $items List of subscription items, each with an attached price. + * @property null|string|\Stripe\Invoice $latest_invoice The most recent invoice this subscription has generated. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|int $next_pending_invoice_item_invoice Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at pending_invoice_item_interval. + * @property null|\Stripe\StripeObject $pause_collection If specified, payment collection for this subscription will be paused. + * @property null|\Stripe\StripeObject $pending_invoice_item_interval Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling Create an invoice for the given subscription at the specified interval. + * @property null|string|\Stripe\SetupIntent $pending_setup_intent You can use this SetupIntent to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the SCA Migration Guide. + * @property null|\Stripe\StripeObject $pending_update If specified, pending updates that will be applied to the subscription once the latest_invoice has been paid. + * @property null|string|\Stripe\SubscriptionSchedule $schedule The schedule attached to the subscription + * @property int $start_date Date when the subscription was first created. The date might differ from the created date due to backdating. + * @property string $status

Possible values are incomplete, incomplete_expired, trialing, active, past_due, canceled, or unpaid.

For collection_method=charge_automatically a subscription moves into incomplete if the initial payment attempt fails. A subscription in this state can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an active state. If the first invoice is not paid within 23 hours, the subscription transitions to incomplete_expired. This is a terminal state, the open invoice will be voided and no further invoices will be generated.

A subscription that is currently in a trial period is trialing and moves to active when the trial period is over.

If subscription collection_method=charge_automatically it becomes past_due when payment to renew it fails and canceled or unpaid (depending on your subscriptions settings) when Stripe has exhausted all payment retry attempts.

If subscription collection_method=send_invoice it becomes past_due when its invoice is not paid by the due date, and canceled or unpaid if it is still not paid by an additional deadline after that. Note that when a subscription has a status of unpaid, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices.

+ * @property null|int $trial_end If the subscription has a trial, the end of that trial. + * @property null|int $trial_start If the subscription has a trial, the beginning of that trial. + */ +class Subscription extends ApiResource +{ + const OBJECT_NAME = 'subscription'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const PAYMENT_BEHAVIOR_ALLOW_INCOMPLETE = 'allow_incomplete'; + const PAYMENT_BEHAVIOR_ERROR_IF_INCOMPLETE = 'error_if_incomplete'; + const PAYMENT_BEHAVIOR_PENDING_IF_INCOMPLETE = 'pending_if_incomplete'; + + const PRORATION_BEHAVIOR_ALWAYS_INVOICE = 'always_invoice'; + const PRORATION_BEHAVIOR_CREATE_PRORATIONS = 'create_prorations'; + const PRORATION_BEHAVIOR_NONE = 'none'; + + const STATUS_ACTIVE = 'active'; + const STATUS_CANCELED = 'canceled'; + const STATUS_INCOMPLETE = 'incomplete'; + const STATUS_INCOMPLETE_EXPIRED = 'incomplete_expired'; + const STATUS_PAST_DUE = 'past_due'; + const STATUS_TRIALING = 'trialing'; + const STATUS_UNPAID = 'unpaid'; + + use ApiOperations\Delete { + delete as protected _delete; + } + + public static function getSavedNestedResources() + { + static $savedNestedResources = null; + if (null === $savedNestedResources) { + $savedNestedResources = new Util\Set([ + 'source', + ]); + } + + return $savedNestedResources; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription the deleted subscription + */ + public function cancel($params = null, $opts = null) + { + return $this->_delete($params, $opts); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription the updated subscription + */ + public function deleteDiscount($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/discount'; + list($response, $opts) = $this->_request('delete', $url, $params, $opts); + $this->refreshFrom(['discount' => null], $opts, true); + } +} diff --git a/vendor/stripe/stripe-php/lib/SubscriptionItem.php b/vendor/stripe/stripe-php/lib/SubscriptionItem.php new file mode 100644 index 0000000..5bd25b2 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/SubscriptionItem.php @@ -0,0 +1,84 @@ +key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\Plan $plan

You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.

Plans define the base price, currency, and billing cycle for recurring purchases of products. Products help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.

For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year.

Related guides: Set up a subscription and more about products and prices.

+ * @property \Stripe\Price $price

Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. Products help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.

For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once.

Related guides: Set up a subscription, create an invoice, and more about products and prices.

+ * @property int $quantity The quantity of the plan to which the customer should be subscribed. + * @property string $subscription The subscription this subscription_item belongs to. + * @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to this subscription_item. When set, the default_tax_rates on the subscription do not apply to this subscription_item. + */ +class SubscriptionItem extends ApiResource +{ + const OBJECT_NAME = 'subscription_item'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\NestedResource; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const PATH_USAGE_RECORDS = '/usage_records'; + + /** + * @param null|string $id the ID of the subscription item on which to create the usage record + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\UsageRecord + */ + public static function createUsageRecord($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_USAGE_RECORDS, $params, $opts); + } + + /** + * @deprecated usageRecordSummaries is deprecated. Please use SubscriptionItem::allUsageRecordSummaries instead. + * + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of usage record summaries + */ + public function usageRecordSummaries($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/usage_record_summaries'; + list($response, $opts) = $this->_request('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + const PATH_USAGE_RECORD_SUMMARIES = '/usage_record_summaries'; + + /** + * @param string $id the ID of the subscription item on which to retrieve the usage record summaries + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of usage record summaries + */ + public static function allUsageRecordSummaries($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_USAGE_RECORD_SUMMARIES, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/SubscriptionSchedule.php b/vendor/stripe/stripe-php/lib/SubscriptionSchedule.php new file mode 100644 index 0000000..d10ea12 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/SubscriptionSchedule.php @@ -0,0 +1,74 @@ +Subscription + * Schedules. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|int $canceled_at Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. + * @property null|int $completed_at Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|\Stripe\StripeObject $current_phase Object representing the start and end dates for the current phase of the subscription schedule, if it is active. + * @property string|\Stripe\Customer $customer ID of the customer who owns the subscription schedule. + * @property \Stripe\StripeObject $default_settings + * @property string $end_behavior Behavior of the subscription schedule and underlying subscription when it ends. Possible values are release and cancel. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\StripeObject[] $phases Configuration for the subscription schedule's phases. + * @property null|int $released_at Time at which the subscription schedule was released. Measured in seconds since the Unix epoch. + * @property null|string $released_subscription ID of the subscription once managed by the subscription schedule (if it is released). + * @property string $status The present status of the subscription schedule. Possible values are not_started, active, completed, released, and canceled. You can read more about the different states in our behavior guide. + * @property null|string|\Stripe\Subscription $subscription ID of the subscription managed by the subscription schedule. + */ +class SubscriptionSchedule extends ApiResource +{ + const OBJECT_NAME = 'subscription_schedule'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionSchedule the canceled subscription schedule + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionSchedule the released subscription schedule + */ + public function release($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/release'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/TaxCode.php b/vendor/stripe/stripe-php/lib/TaxCode.php new file mode 100644 index 0000000..bfdbf03 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/TaxCode.php @@ -0,0 +1,22 @@ +Tax codes classify goods and + * services for tax purposes. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string $description A detailed description of which types of products the tax code represents. + * @property string $name A short name for the tax code. + */ +class TaxCode extends ApiResource +{ + const OBJECT_NAME = 'tax_code'; + + use ApiOperations\All; + use ApiOperations\Retrieve; +} diff --git a/vendor/stripe/stripe-php/lib/TaxId.php b/vendor/stripe/stripe-php/lib/TaxId.php new file mode 100644 index 0000000..2a78577 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/TaxId.php @@ -0,0 +1,112 @@ +customer. A customer's tax IDs + * are displayed on invoices and credit notes issued for the customer. + * + * Related guide: Customer + * Tax Identification Numbers. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|string $country Two-letter ISO code representing the country of the tax ID. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string|\Stripe\Customer $customer ID of the customer. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property string $type Type of the tax ID, one of ae_trn, au_abn, br_cnpj, br_cpf, ca_bn, ca_gst_hst, ca_pst_bc, ca_pst_mb, ca_pst_sk, ca_qst, ch_vat, cl_tin, es_cif, eu_vat, gb_vat, hk_br, id_npwp, il_vat, in_gst, jp_cn, jp_rn, kr_brn, li_uid, mx_rfc, my_frp, my_itn, my_sst, no_vat, nz_gst, ru_inn, ru_kpp, sa_vat, sg_gst, sg_uen, th_vat, tw_vat, us_ein, or za_vat. Note that some legacy tax IDs have type unknown + * @property string $value Value of the tax ID. + * @property null|\Stripe\StripeObject $verification Tax ID verification information. + */ +class TaxId extends ApiResource +{ + const OBJECT_NAME = 'tax_id'; + + use ApiOperations\Delete; + + const TYPE_AE_TRN = 'ae_trn'; + const TYPE_AU_ABN = 'au_abn'; + const TYPE_BR_CNPJ = 'br_cnpj'; + const TYPE_BR_CPF = 'br_cpf'; + const TYPE_CA_BN = 'ca_bn'; + const TYPE_CA_GST_HST = 'ca_gst_hst'; + const TYPE_CA_PST_BC = 'ca_pst_bc'; + const TYPE_CA_PST_MB = 'ca_pst_mb'; + const TYPE_CA_PST_SK = 'ca_pst_sk'; + const TYPE_CA_QST = 'ca_qst'; + const TYPE_CH_VAT = 'ch_vat'; + const TYPE_CL_TIN = 'cl_tin'; + const TYPE_ES_CIF = 'es_cif'; + const TYPE_EU_VAT = 'eu_vat'; + const TYPE_GB_VAT = 'gb_vat'; + const TYPE_HK_BR = 'hk_br'; + const TYPE_ID_NPWP = 'id_npwp'; + const TYPE_IL_VAT = 'il_vat'; + const TYPE_IN_GST = 'in_gst'; + const TYPE_JP_CN = 'jp_cn'; + const TYPE_JP_RN = 'jp_rn'; + const TYPE_KR_BRN = 'kr_brn'; + const TYPE_LI_UID = 'li_uid'; + const TYPE_MX_RFC = 'mx_rfc'; + const TYPE_MY_FRP = 'my_frp'; + const TYPE_MY_ITN = 'my_itn'; + const TYPE_MY_SST = 'my_sst'; + const TYPE_NO_VAT = 'no_vat'; + const TYPE_NZ_GST = 'nz_gst'; + const TYPE_RU_INN = 'ru_inn'; + const TYPE_RU_KPP = 'ru_kpp'; + const TYPE_SA_VAT = 'sa_vat'; + const TYPE_SG_GST = 'sg_gst'; + const TYPE_SG_UEN = 'sg_uen'; + const TYPE_TH_VAT = 'th_vat'; + const TYPE_TW_VAT = 'tw_vat'; + const TYPE_UNKNOWN = 'unknown'; + const TYPE_US_EIN = 'us_ein'; + const TYPE_ZA_VAT = 'za_vat'; + + const VERIFICATION_STATUS_PENDING = 'pending'; + const VERIFICATION_STATUS_UNAVAILABLE = 'unavailable'; + const VERIFICATION_STATUS_UNVERIFIED = 'unverified'; + const VERIFICATION_STATUS_VERIFIED = 'verified'; + + /** + * @return string the API URL for this tax id + */ + public function instanceUrl() + { + $id = $this['id']; + $customer = $this['customer']; + if (!$id) { + throw new Exception\UnexpectedValueException( + "Could not determine which URL to request: class instance has invalid ID: {$id}" + ); + } + $id = Util\Util::utf8($id); + $customer = Util\Util::utf8($customer); + + $base = Customer::classUrl(); + $customerExtn = \urlencode($customer); + $extn = \urlencode($id); + + return "{$base}/{$customerExtn}/tax_ids/{$extn}"; + } + + /** + * @param array|string $_id + * @param null|array|string $_opts + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function retrieve($_id, $_opts = null) + { + $msg = 'Tax IDs cannot be retrieved without a customer ID. Retrieve ' . + "a tax ID using `Customer::retrieveTaxId('customer_id', " . + "'tax_id_id')`."; + + throw new Exception\BadMethodCallException($msg); + } +} diff --git a/vendor/stripe/stripe-php/lib/TaxRate.php b/vendor/stripe/stripe-php/lib/TaxRate.php new file mode 100644 index 0000000..9033638 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/TaxRate.php @@ -0,0 +1,48 @@ +invoices, subscriptions and + * Checkout + * Sessions to collect tax. + * + * Related guide: Tax + * Rates. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property bool $active Defaults to true. When set to false, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. + * @property null|string $country Two-letter country code (ISO 3166-1 alpha-2). + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $description An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. + * @property string $display_name The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page. + * @property bool $inclusive This specifies if the tax rate is inclusive or exclusive. + * @property null|string $jurisdiction The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property float $percentage This represents the tax rate percent out of 100. + * @property null|string $state ISO 3166-2 subdivision code, without country prefix. For example, "NY" for New York, United States. + * @property null|string $tax_type The high-level tax type, such as vat or sales_tax. + */ +class TaxRate extends ApiResource +{ + const OBJECT_NAME = 'tax_rate'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const TAX_TYPE_GST = 'gst'; + const TAX_TYPE_HST = 'hst'; + const TAX_TYPE_PST = 'pst'; + const TAX_TYPE_QST = 'qst'; + const TAX_TYPE_SALES_TAX = 'sales_tax'; + const TAX_TYPE_VAT = 'vat'; +} diff --git a/vendor/stripe/stripe-php/lib/Terminal/ConnectionToken.php b/vendor/stripe/stripe-php/lib/Terminal/ConnectionToken.php new file mode 100644 index 0000000..c6405b0 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Terminal/ConnectionToken.php @@ -0,0 +1,22 @@ +Fleet Management. + * + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string $location The id of the location that this connection token is scoped to. Note that location scoping only applies to internet-connected readers. For more details, see the docs on scoping connection tokens. + * @property string $secret Your application should pass this token to the Stripe Terminal SDK. + */ +class ConnectionToken extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'terminal.connection_token'; + + use \Stripe\ApiOperations\Create; +} diff --git a/vendor/stripe/stripe-php/lib/Terminal/Location.php b/vendor/stripe/stripe-php/lib/Terminal/Location.php new file mode 100644 index 0000000..422cd75 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Terminal/Location.php @@ -0,0 +1,29 @@ +Fleet Management. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property \Stripe\StripeObject $address + * @property string $display_name The display name of the location. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ +class Location extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'terminal.location'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Delete; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/Terminal/Reader.php b/vendor/stripe/stripe-php/lib/Terminal/Reader.php new file mode 100644 index 0000000..44fe035 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Terminal/Reader.php @@ -0,0 +1,35 @@ +Connecting to a + * Reader. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|string $device_sw_version The current software version of the reader. + * @property string $device_type Type of reader, one of bbpos_chipper2x or verifone_P400. + * @property null|string $ip_address The local IP address of the reader. + * @property string $label Custom label given to the reader for easier identification. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string|\Stripe\Terminal\Location $location The location identifier of the reader. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $serial_number Serial number of the reader. + * @property null|string $status The networking status of the reader. + */ +class Reader extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'terminal.reader'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Delete; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/ThreeDSecure.php b/vendor/stripe/stripe-php/lib/ThreeDSecure.php new file mode 100644 index 0000000..51b5691 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/ThreeDSecure.php @@ -0,0 +1,37 @@ +3D + * Secure object. Once the object has been created, you can use it to + * authenticate the cardholder and create a charge. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount of the charge that you will create when authentication completes. + * @property bool $authenticated True if the cardholder went through the authentication flow and their bank indicated that authentication succeeded. + * @property \Stripe\Card $card

You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later.

Related guide: Card Payments with Sources.

+ * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string $redirect_url If present, this is the URL that you should send the cardholder to for authentication. If you are going to use Stripe.js to display the authentication page in an iframe, you should use the value "_callback". + * @property string $status Possible values are redirect_pending, succeeded, or failed. When the cardholder can be authenticated, the object starts with status redirect_pending. When liability will be shifted to the cardholder's bank (either because the cardholder was successfully authenticated, or because the bank has not implemented 3D Secure, the object wlil be in status succeeded. failed indicates that authentication was attempted unsuccessfully. + */ +class ThreeDSecure extends ApiResource +{ + const OBJECT_NAME = 'three_d_secure'; + + use ApiOperations\Create; + use ApiOperations\Retrieve; + + /** + * @return string the endpoint URL for the given class + */ + public static function classUrl() + { + return '/v1/3d_secure'; + } +} diff --git a/vendor/stripe/stripe-php/lib/Token.php b/vendor/stripe/stripe-php/lib/Token.php new file mode 100644 index 0000000..18b33e8 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Token.php @@ -0,0 +1,57 @@ +recommended payments integrations to + * perform this process client-side. This ensures that no sensitive card data + * touches your server, and allows your integration to operate in a PCI-compliant + * way. + * + * If you cannot use client-side tokenization, you can also create tokens using the + * API with either your publishable or secret API key. Keep in mind that if your + * integration uses this method, you are responsible for any PCI compliance that + * may be required, and you must keep your secret API key safe. Unlike with + * client-side tokenization, your customer's information is not sent directly to + * Stripe, so we cannot determine how it is handled or stored. + * + * Tokens cannot be stored or used more than once. To store card or bank account + * information for later use, you can create Customer objects or Custom accounts. Note + * that Radar, our integrated solution + * for automatic fraud protection, performs best with integrations that use + * client-side tokenization. + * + * Related guide: Accept + * a payment + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property \Stripe\BankAccount $bank_account

These bank accounts are payment methods on Customer objects.

On the other hand External Accounts are transfer destinations on Account objects for Custom accounts. They can be bank accounts or debit cards as well, and are documented in the links above.

Related guide: Bank Debits and Transfers.

+ * @property \Stripe\Card $card

You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later.

Related guide: Card Payments with Sources.

+ * @property null|string $client_ip IP address of the client that generated the token. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property string $type Type of the token: account, bank_account, card, or pii. + * @property bool $used Whether this token has already been used (tokens can be used only once). + */ +class Token extends ApiResource +{ + const OBJECT_NAME = 'token'; + + use ApiOperations\Create; + use ApiOperations\Retrieve; + + const TYPE_ACCOUNT = 'account'; + const TYPE_BANK_ACCOUNT = 'bank_account'; + const TYPE_CARD = 'card'; + const TYPE_PII = 'pii'; +} diff --git a/vendor/stripe/stripe-php/lib/Topup.php b/vendor/stripe/stripe-php/lib/Topup.php new file mode 100644 index 0000000..69cdd68 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Topup.php @@ -0,0 +1,63 @@ +Topping Up your + * Platform Account. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount transferred. + * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this top-up on your account balance. May not be specified depending on status of top-up. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|int $expected_availability_date Date the funds are expected to arrive in your Stripe account for payouts. This factors in delays like weekends or bank holidays. May not be specified depending on status of top-up. + * @property null|string $failure_code Error code explaining reason for top-up failure if available (see the errors section for a list of codes). + * @property null|string $failure_message Message to user further explaining reason for top-up failure if available. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\Source $source

Source objects allow you to accept a variety of payment methods. They represent a customer's payment instrument, and can be used with the Stripe API just like a Card object: once chargeable, they can be charged, or can be attached to customers.

Related guides: Sources API and Sources & Customers.

+ * @property null|string $statement_descriptor Extra information about a top-up. This will appear on your source's bank statement. It must contain at least one letter. + * @property string $status The status of the top-up is either canceled, failed, pending, reversed, or succeeded. + * @property null|string $transfer_group A string that identifies this top-up as part of a group. + */ +class Topup extends ApiResource +{ + const OBJECT_NAME = 'topup'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const STATUS_CANCELED = 'canceled'; + const STATUS_FAILED = 'failed'; + const STATUS_PENDING = 'pending'; + const STATUS_REVERSED = 'reversed'; + const STATUS_SUCCEEDED = 'succeeded'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Topup the canceled topup + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/Transfer.php b/vendor/stripe/stripe-php/lib/Transfer.php new file mode 100644 index 0000000..4fb0c6a --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Transfer.php @@ -0,0 +1,130 @@ +Transfer object is created when you move funds between Stripe + * accounts as part of Connect. + * + * Before April 6, 2017, transfers also represented movement of funds from a Stripe + * account to a card or bank account. This behavior has since been split out into a + * Payout object, with + * corresponding payout endpoints. For more information, read about the transfer/payout split. + * + * Related guide: Creating Separate + * Charges and Transfers. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount in %s to be transferred. + * @property int $amount_reversed Amount in %s reversed (can be less than the amount attribute on the transfer if a partial reversal was issued). + * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact of this transfer on your account balance. + * @property int $created Time that this record of the transfer was first created. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string|\Stripe\Account $destination ID of the Stripe account the transfer was sent to. + * @property string|\Stripe\Charge $destination_payment If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\Collection $reversals A list of reversals that have been applied to the transfer. + * @property bool $reversed Whether the transfer has been fully reversed. If the transfer is only partially reversed, this attribute will still be false. + * @property null|string|\Stripe\Charge $source_transaction ID of the charge or payment that was used to fund the transfer. If null, the transfer was funded from the available balance. + * @property null|string $source_type The source balance this transfer came from. One of card, fpx, or bank_account. + * @property null|string $transfer_group A string that identifies this transaction as part of a group. See the Connect documentation for details. + */ +class Transfer extends ApiResource +{ + const OBJECT_NAME = 'transfer'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\NestedResource; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const SOURCE_TYPE_ALIPAY_ACCOUNT = 'alipay_account'; + const SOURCE_TYPE_BANK_ACCOUNT = 'bank_account'; + const SOURCE_TYPE_CARD = 'card'; + const SOURCE_TYPE_FINANCING = 'financing'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Transfer the canceled transfer + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + const PATH_REVERSALS = '/reversals'; + + /** + * @param string $id the ID of the transfer on which to retrieve the transfer reversals + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of transfer reversals + */ + public static function allReversals($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_REVERSALS, $params, $opts); + } + + /** + * @param string $id the ID of the transfer on which to create the transfer reversal + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TransferReversal + */ + public static function createReversal($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_REVERSALS, $params, $opts); + } + + /** + * @param string $id the ID of the transfer to which the transfer reversal belongs + * @param string $reversalId the ID of the transfer reversal to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TransferReversal + */ + public static function retrieveReversal($id, $reversalId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_REVERSALS, $reversalId, $params, $opts); + } + + /** + * @param string $id the ID of the transfer to which the transfer reversal belongs + * @param string $reversalId the ID of the transfer reversal to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TransferReversal + */ + public static function updateReversal($id, $reversalId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_REVERSALS, $reversalId, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/TransferReversal.php b/vendor/stripe/stripe-php/lib/TransferReversal.php new file mode 100644 index 0000000..b6167db --- /dev/null +++ b/vendor/stripe/stripe-php/lib/TransferReversal.php @@ -0,0 +1,79 @@ +Stripe Connect platforms can + * reverse transfers made to a connected account, either entirely or partially, and + * can also specify whether to refund any related application fees. Transfer + * reversals add to the platform's balance and subtract from the destination + * account's balance. + * + * Reversing a transfer that was made for a destination charge is allowed only + * up to the amount of the charge. It is possible to reverse a transfer_group + * transfer only if the destination account has enough balance to cover the + * reversal. + * + * Related guide: Reversing + * Transfers. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount, in %s. + * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string|\Stripe\Refund $destination_payment_refund Linked payment refund for the transfer reversal. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string|\Stripe\Refund $source_refund ID of the refund responsible for the transfer reversal. + * @property string|\Stripe\Transfer $transfer ID of the transfer that was reversed. + */ +class TransferReversal extends ApiResource +{ + const OBJECT_NAME = 'transfer_reversal'; + + use ApiOperations\Update { + save as protected _save; + } + + /** + * @return string the API URL for this Stripe transfer reversal + */ + public function instanceUrl() + { + $id = $this['id']; + $transfer = $this['transfer']; + if (!$id) { + throw new Exception\UnexpectedValueException( + 'Could not determine which URL to request: ' . + "class instance has invalid ID: {$id}", + null + ); + } + $id = Util\Util::utf8($id); + $transfer = Util\Util::utf8($transfer); + + $base = Transfer::classUrl(); + $transferExtn = \urlencode($transfer); + $extn = \urlencode($id); + + return "{$base}/{$transferExtn}/reversals/{$extn}"; + } + + /** + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return TransferReversal the saved reversal + */ + public function save($opts = null) + { + return $this->_save($opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/UsageRecord.php b/vendor/stripe/stripe-php/lib/UsageRecord.php new file mode 100644 index 0000000..5522982 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/UsageRecord.php @@ -0,0 +1,25 @@ +Metered + * Billing. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property int $quantity The usage quantity for the specified date. + * @property string $subscription_item The ID of the subscription item this usage record contains data for. + * @property int $timestamp The timestamp when this usage occurred. + */ +class UsageRecord extends ApiResource +{ + const OBJECT_NAME = 'usage_record'; +} diff --git a/vendor/stripe/stripe-php/lib/UsageRecordSummary.php b/vendor/stripe/stripe-php/lib/UsageRecordSummary.php new file mode 100644 index 0000000..174e14e --- /dev/null +++ b/vendor/stripe/stripe-php/lib/UsageRecordSummary.php @@ -0,0 +1,19 @@ +true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $period + * @property string $subscription_item The ID of the subscription item this summary is describing. + * @property int $total_usage The total usage within this usage period. + */ +class UsageRecordSummary extends ApiResource +{ + const OBJECT_NAME = 'usage_record_summary'; +} diff --git a/vendor/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php b/vendor/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php new file mode 100644 index 0000000..670ab0b --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php @@ -0,0 +1,72 @@ +container = \array_change_key_case($initial_array, \CASE_LOWER); + } + + public function count() + { + return \count($this->container); + } + + public function getIterator() + { + return new \ArrayIterator($this->container); + } + + public function offsetSet($offset, $value) + { + $offset = static::maybeLowercase($offset); + if (null === $offset) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + public function offsetExists($offset) + { + $offset = static::maybeLowercase($offset); + + return isset($this->container[$offset]); + } + + public function offsetUnset($offset) + { + $offset = static::maybeLowercase($offset); + unset($this->container[$offset]); + } + + public function offsetGet($offset) + { + $offset = static::maybeLowercase($offset); + + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + private static function maybeLowercase($v) + { + if (\is_string($v)) { + return \strtolower($v); + } + + return $v; + } +} diff --git a/vendor/stripe/stripe-php/lib/Util/DefaultLogger.php b/vendor/stripe/stripe-php/lib/Util/DefaultLogger.php new file mode 100644 index 0000000..016cbe8 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Util/DefaultLogger.php @@ -0,0 +1,29 @@ + 0) { + throw new \Stripe\Exception\BadMethodCallException('DefaultLogger does not currently implement context. Please implement if you need it.'); + } + + if (null === $this->destination) { + \error_log($message, $this->messageType); + } else { + \error_log($message, $this->messageType, $this->destination); + } + } +} diff --git a/vendor/stripe/stripe-php/lib/Util/LoggerInterface.php b/vendor/stripe/stripe-php/lib/Util/LoggerInterface.php new file mode 100644 index 0000000..5603c81 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Util/LoggerInterface.php @@ -0,0 +1,34 @@ + \Stripe\Account::class, + \Stripe\AccountLink::OBJECT_NAME => \Stripe\AccountLink::class, + \Stripe\AlipayAccount::OBJECT_NAME => \Stripe\AlipayAccount::class, + \Stripe\ApplePayDomain::OBJECT_NAME => \Stripe\ApplePayDomain::class, + \Stripe\ApplicationFee::OBJECT_NAME => \Stripe\ApplicationFee::class, + \Stripe\ApplicationFeeRefund::OBJECT_NAME => \Stripe\ApplicationFeeRefund::class, + \Stripe\Balance::OBJECT_NAME => \Stripe\Balance::class, + \Stripe\BalanceTransaction::OBJECT_NAME => \Stripe\BalanceTransaction::class, + \Stripe\BankAccount::OBJECT_NAME => \Stripe\BankAccount::class, + \Stripe\BillingPortal\Configuration::OBJECT_NAME => \Stripe\BillingPortal\Configuration::class, + \Stripe\BillingPortal\Session::OBJECT_NAME => \Stripe\BillingPortal\Session::class, + \Stripe\BitcoinReceiver::OBJECT_NAME => \Stripe\BitcoinReceiver::class, + \Stripe\BitcoinTransaction::OBJECT_NAME => \Stripe\BitcoinTransaction::class, + \Stripe\Capability::OBJECT_NAME => \Stripe\Capability::class, + \Stripe\Card::OBJECT_NAME => \Stripe\Card::class, + \Stripe\Charge::OBJECT_NAME => \Stripe\Charge::class, + \Stripe\Checkout\Session::OBJECT_NAME => \Stripe\Checkout\Session::class, + \Stripe\Collection::OBJECT_NAME => \Stripe\Collection::class, + \Stripe\CountrySpec::OBJECT_NAME => \Stripe\CountrySpec::class, + \Stripe\Coupon::OBJECT_NAME => \Stripe\Coupon::class, + \Stripe\CreditNote::OBJECT_NAME => \Stripe\CreditNote::class, + \Stripe\CreditNoteLineItem::OBJECT_NAME => \Stripe\CreditNoteLineItem::class, + \Stripe\Customer::OBJECT_NAME => \Stripe\Customer::class, + \Stripe\CustomerBalanceTransaction::OBJECT_NAME => \Stripe\CustomerBalanceTransaction::class, + \Stripe\Discount::OBJECT_NAME => \Stripe\Discount::class, + \Stripe\Dispute::OBJECT_NAME => \Stripe\Dispute::class, + \Stripe\EphemeralKey::OBJECT_NAME => \Stripe\EphemeralKey::class, + \Stripe\Event::OBJECT_NAME => \Stripe\Event::class, + \Stripe\ExchangeRate::OBJECT_NAME => \Stripe\ExchangeRate::class, + \Stripe\File::OBJECT_NAME => \Stripe\File::class, + \Stripe\File::OBJECT_NAME_ALT => \Stripe\File::class, + \Stripe\FileLink::OBJECT_NAME => \Stripe\FileLink::class, + \Stripe\Identity\VerificationReport::OBJECT_NAME => \Stripe\Identity\VerificationReport::class, + \Stripe\Identity\VerificationSession::OBJECT_NAME => \Stripe\Identity\VerificationSession::class, + \Stripe\Invoice::OBJECT_NAME => \Stripe\Invoice::class, + \Stripe\InvoiceItem::OBJECT_NAME => \Stripe\InvoiceItem::class, + \Stripe\InvoiceLineItem::OBJECT_NAME => \Stripe\InvoiceLineItem::class, + \Stripe\Issuing\Authorization::OBJECT_NAME => \Stripe\Issuing\Authorization::class, + \Stripe\Issuing\Card::OBJECT_NAME => \Stripe\Issuing\Card::class, + \Stripe\Issuing\CardDetails::OBJECT_NAME => \Stripe\Issuing\CardDetails::class, + \Stripe\Issuing\Cardholder::OBJECT_NAME => \Stripe\Issuing\Cardholder::class, + \Stripe\Issuing\Dispute::OBJECT_NAME => \Stripe\Issuing\Dispute::class, + \Stripe\Issuing\Transaction::OBJECT_NAME => \Stripe\Issuing\Transaction::class, + \Stripe\LineItem::OBJECT_NAME => \Stripe\LineItem::class, + \Stripe\LoginLink::OBJECT_NAME => \Stripe\LoginLink::class, + \Stripe\Mandate::OBJECT_NAME => \Stripe\Mandate::class, + \Stripe\Order::OBJECT_NAME => \Stripe\Order::class, + \Stripe\OrderItem::OBJECT_NAME => \Stripe\OrderItem::class, + \Stripe\OrderReturn::OBJECT_NAME => \Stripe\OrderReturn::class, + \Stripe\PaymentIntent::OBJECT_NAME => \Stripe\PaymentIntent::class, + \Stripe\PaymentMethod::OBJECT_NAME => \Stripe\PaymentMethod::class, + \Stripe\Payout::OBJECT_NAME => \Stripe\Payout::class, + \Stripe\Person::OBJECT_NAME => \Stripe\Person::class, + \Stripe\Plan::OBJECT_NAME => \Stripe\Plan::class, + \Stripe\Price::OBJECT_NAME => \Stripe\Price::class, + \Stripe\Product::OBJECT_NAME => \Stripe\Product::class, + \Stripe\PromotionCode::OBJECT_NAME => \Stripe\PromotionCode::class, + \Stripe\Radar\EarlyFraudWarning::OBJECT_NAME => \Stripe\Radar\EarlyFraudWarning::class, + \Stripe\Radar\ValueList::OBJECT_NAME => \Stripe\Radar\ValueList::class, + \Stripe\Radar\ValueListItem::OBJECT_NAME => \Stripe\Radar\ValueListItem::class, + \Stripe\Recipient::OBJECT_NAME => \Stripe\Recipient::class, + \Stripe\RecipientTransfer::OBJECT_NAME => \Stripe\RecipientTransfer::class, + \Stripe\Refund::OBJECT_NAME => \Stripe\Refund::class, + \Stripe\Reporting\ReportRun::OBJECT_NAME => \Stripe\Reporting\ReportRun::class, + \Stripe\Reporting\ReportType::OBJECT_NAME => \Stripe\Reporting\ReportType::class, + \Stripe\Review::OBJECT_NAME => \Stripe\Review::class, + \Stripe\SetupAttempt::OBJECT_NAME => \Stripe\SetupAttempt::class, + \Stripe\SetupIntent::OBJECT_NAME => \Stripe\SetupIntent::class, + \Stripe\Sigma\ScheduledQueryRun::OBJECT_NAME => \Stripe\Sigma\ScheduledQueryRun::class, + \Stripe\SKU::OBJECT_NAME => \Stripe\SKU::class, + \Stripe\Source::OBJECT_NAME => \Stripe\Source::class, + \Stripe\SourceTransaction::OBJECT_NAME => \Stripe\SourceTransaction::class, + \Stripe\Subscription::OBJECT_NAME => \Stripe\Subscription::class, + \Stripe\SubscriptionItem::OBJECT_NAME => \Stripe\SubscriptionItem::class, + \Stripe\SubscriptionSchedule::OBJECT_NAME => \Stripe\SubscriptionSchedule::class, + \Stripe\TaxCode::OBJECT_NAME => \Stripe\TaxCode::class, + \Stripe\TaxId::OBJECT_NAME => \Stripe\TaxId::class, + \Stripe\TaxRate::OBJECT_NAME => \Stripe\TaxRate::class, + \Stripe\Terminal\ConnectionToken::OBJECT_NAME => \Stripe\Terminal\ConnectionToken::class, + \Stripe\Terminal\Location::OBJECT_NAME => \Stripe\Terminal\Location::class, + \Stripe\Terminal\Reader::OBJECT_NAME => \Stripe\Terminal\Reader::class, + \Stripe\ThreeDSecure::OBJECT_NAME => \Stripe\ThreeDSecure::class, + \Stripe\Token::OBJECT_NAME => \Stripe\Token::class, + \Stripe\Topup::OBJECT_NAME => \Stripe\Topup::class, + \Stripe\Transfer::OBJECT_NAME => \Stripe\Transfer::class, + \Stripe\TransferReversal::OBJECT_NAME => \Stripe\TransferReversal::class, + \Stripe\UsageRecord::OBJECT_NAME => \Stripe\UsageRecord::class, + \Stripe\UsageRecordSummary::OBJECT_NAME => \Stripe\UsageRecordSummary::class, + \Stripe\WebhookEndpoint::OBJECT_NAME => \Stripe\WebhookEndpoint::class, + ]; +} diff --git a/vendor/stripe/stripe-php/lib/Util/RandomGenerator.php b/vendor/stripe/stripe-php/lib/Util/RandomGenerator.php new file mode 100644 index 0000000..b11e445 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Util/RandomGenerator.php @@ -0,0 +1,36 @@ + a list of headers that should be persisted across requests + */ + public static $HEADERS_TO_PERSIST = [ + 'Stripe-Account', + 'Stripe-Version', + ]; + + /** @var array */ + public $headers; + + /** @var null|string */ + public $apiKey; + + /** @var null|string */ + public $apiBase; + + /** + * @param null|string $key + * @param array $headers + * @param null|string $base + */ + public function __construct($key = null, $headers = [], $base = null) + { + $this->apiKey = $key; + $this->headers = $headers; + $this->apiBase = $base; + } + + /** + * @return array + */ + public function __debugInfo() + { + return [ + 'apiKey' => $this->redactedApiKey(), + 'headers' => $this->headers, + 'apiBase' => $this->apiBase, + ]; + } + + /** + * Unpacks an options array and merges it into the existing RequestOptions + * object. + * + * @param null|array|RequestOptions|string $options a key => value array + * @param bool $strict when true, forbid string form and arbitrary keys in array form + * + * @return RequestOptions + */ + public function merge($options, $strict = false) + { + $other_options = self::parse($options, $strict); + if (null === $other_options->apiKey) { + $other_options->apiKey = $this->apiKey; + } + if (null === $other_options->apiBase) { + $other_options->apiBase = $this->apiBase; + } + $other_options->headers = \array_merge($this->headers, $other_options->headers); + + return $other_options; + } + + /** + * Discards all headers that we don't want to persist across requests. + */ + public function discardNonPersistentHeaders() + { + foreach ($this->headers as $k => $v) { + if (!\in_array($k, self::$HEADERS_TO_PERSIST, true)) { + unset($this->headers[$k]); + } + } + } + + /** + * Unpacks an options array into an RequestOptions object. + * + * @param null|array|RequestOptions|string $options a key => value array + * @param bool $strict when true, forbid string form and arbitrary keys in array form + * + * @throws \Stripe\Exception\InvalidArgumentException + * + * @return RequestOptions + */ + public static function parse($options, $strict = false) + { + if ($options instanceof self) { + return $options; + } + + if (null === $options) { + return new RequestOptions(null, [], null); + } + + if (\is_string($options)) { + if ($strict) { + $message = 'Do not pass a string for request options. If you want to set the ' + . 'API key, pass an array like ["api_key" => ] instead.'; + + throw new \Stripe\Exception\InvalidArgumentException($message); + } + + return new RequestOptions($options, [], null); + } + + if (\is_array($options)) { + $headers = []; + $key = null; + $base = null; + + if (\array_key_exists('api_key', $options)) { + $key = $options['api_key']; + unset($options['api_key']); + } + if (\array_key_exists('idempotency_key', $options)) { + $headers['Idempotency-Key'] = $options['idempotency_key']; + unset($options['idempotency_key']); + } + if (\array_key_exists('stripe_account', $options)) { + $headers['Stripe-Account'] = $options['stripe_account']; + unset($options['stripe_account']); + } + if (\array_key_exists('stripe_version', $options)) { + $headers['Stripe-Version'] = $options['stripe_version']; + unset($options['stripe_version']); + } + if (\array_key_exists('api_base', $options)) { + $base = $options['api_base']; + unset($options['api_base']); + } + + if ($strict && !empty($options)) { + $message = 'Got unexpected keys in options array: ' . \implode(', ', \array_keys($options)); + + throw new \Stripe\Exception\InvalidArgumentException($message); + } + + return new RequestOptions($key, $headers, $base); + } + + $message = 'The second argument to Stripe API method calls is an ' + . 'optional per-request apiKey, which must be a string, or ' + . 'per-request options, which must be an array. (HINT: you can set ' + . 'a global apiKey by "Stripe::setApiKey()")'; + + throw new \Stripe\Exception\InvalidArgumentException($message); + } + + private function redactedApiKey() + { + $pieces = \explode('_', $this->apiKey, 3); + $last = \array_pop($pieces); + $redactedLast = \strlen($last) > 4 + ? (\str_repeat('*', \strlen($last) - 4) . \substr($last, -4)) + : $last; + $pieces[] = $redactedLast; + + return \implode('_', $pieces); + } +} diff --git a/vendor/stripe/stripe-php/lib/Util/Set.php b/vendor/stripe/stripe-php/lib/Util/Set.php new file mode 100644 index 0000000..017f929 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Util/Set.php @@ -0,0 +1,44 @@ +_elts = []; + foreach ($members as $item) { + $this->_elts[$item] = true; + } + } + + public function includes($elt) + { + return isset($this->_elts[$elt]); + } + + public function add($elt) + { + $this->_elts[$elt] = true; + } + + public function discard($elt) + { + unset($this->_elts[$elt]); + } + + public function toArray() + { + return \array_keys($this->_elts); + } + + public function getIterator() + { + return new ArrayIterator($this->toArray()); + } +} diff --git a/vendor/stripe/stripe-php/lib/Util/Util.php b/vendor/stripe/stripe-php/lib/Util/Util.php new file mode 100644 index 0000000..4f39050 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Util/Util.php @@ -0,0 +1,265 @@ +id; + } + if (static::isList($h)) { + $results = []; + foreach ($h as $v) { + $results[] = static::objectsToIds($v); + } + + return $results; + } + if (\is_array($h)) { + $results = []; + foreach ($h as $k => $v) { + if (null === $v) { + continue; + } + $results[$k] = static::objectsToIds($v); + } + + return $results; + } + + return $h; + } + + /** + * @param array $params + * + * @return string + */ + public static function encodeParameters($params) + { + $flattenedParams = self::flattenParams($params); + $pieces = []; + foreach ($flattenedParams as $param) { + list($k, $v) = $param; + $pieces[] = self::urlEncode($k) . '=' . self::urlEncode($v); + } + + return \implode('&', $pieces); + } + + /** + * @param array $params + * @param null|string $parentKey + * + * @return array + */ + public static function flattenParams($params, $parentKey = null) + { + $result = []; + + foreach ($params as $key => $value) { + $calculatedKey = $parentKey ? "{$parentKey}[{$key}]" : $key; + + if (self::isList($value)) { + $result = \array_merge($result, self::flattenParamsList($value, $calculatedKey)); + } elseif (\is_array($value)) { + $result = \array_merge($result, self::flattenParams($value, $calculatedKey)); + } else { + \array_push($result, [$calculatedKey, $value]); + } + } + + return $result; + } + + /** + * @param array $value + * @param string $calculatedKey + * + * @return array + */ + public static function flattenParamsList($value, $calculatedKey) + { + $result = []; + + foreach ($value as $i => $elem) { + if (self::isList($elem)) { + $result = \array_merge($result, self::flattenParamsList($elem, $calculatedKey)); + } elseif (\is_array($elem)) { + $result = \array_merge($result, self::flattenParams($elem, "{$calculatedKey}[{$i}]")); + } else { + \array_push($result, ["{$calculatedKey}[{$i}]", $elem]); + } + } + + return $result; + } + + /** + * @param string $key a string to URL-encode + * + * @return string the URL-encoded string + */ + public static function urlEncode($key) + { + $s = \urlencode((string) $key); + + // Don't use strict form encoding by changing the square bracket control + // characters back to their literals. This is fine by the server, and + // makes these parameter strings easier to read. + $s = \str_replace('%5B', '[', $s); + + return \str_replace('%5D', ']', $s); + } + + public static function normalizeId($id) + { + if (\is_array($id)) { + $params = $id; + $id = $params['id']; + unset($params['id']); + } else { + $params = []; + } + + return [$id, $params]; + } + + /** + * Returns UNIX timestamp in milliseconds. + * + * @return int current time in millis + */ + public static function currentTimeMillis() + { + return (int) \round(\microtime(true) * 1000); + } +} diff --git a/vendor/stripe/stripe-php/lib/Webhook.php b/vendor/stripe/stripe-php/lib/Webhook.php new file mode 100644 index 0000000..b9db2d6 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Webhook.php @@ -0,0 +1,42 @@ +webhook + * endpoints via the API to be notified about events that happen in your Stripe + * account or connected accounts. + * + * Most users configure webhooks from the dashboard, which provides a + * user interface for registering and testing your webhook endpoints. + * + * Related guide: Setting up + * Webhooks. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|string $api_version The API version events are rendered as for this webhook endpoint. + * @property null|string $application The ID of the associated Connect application. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $description An optional description of what the webhook is used for. + * @property string[] $enabled_events The list of events to enable for this endpoint. ['*'] indicates that all events are enabled, except those that require explicit selection. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $secret The endpoint's secret, used to generate webhook signatures. Only returned at creation. + * @property string $status The status of the webhook. It can be enabled or disabled. + * @property string $url The URL of the webhook endpoint. + */ +class WebhookEndpoint extends ApiResource +{ + const OBJECT_NAME = 'webhook_endpoint'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/WebhookSignature.php b/vendor/stripe/stripe-php/lib/WebhookSignature.php new file mode 100644 index 0000000..46cbb28 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/WebhookSignature.php @@ -0,0 +1,140 @@ + 0) && (\abs(\time() - $timestamp) > $tolerance)) { + throw Exception\SignatureVerificationException::factory( + 'Timestamp outside the tolerance zone', + $payload, + $header + ); + } + + return true; + } + + /** + * Extracts the timestamp in a signature header. + * + * @param string $header the signature header + * + * @return int the timestamp contained in the header, or -1 if no valid + * timestamp is found + */ + private static function getTimestamp($header) + { + $items = \explode(',', $header); + + foreach ($items as $item) { + $itemParts = \explode('=', $item, 2); + if ('t' === $itemParts[0]) { + if (!\is_numeric($itemParts[1])) { + return -1; + } + + return (int) ($itemParts[1]); + } + } + + return -1; + } + + /** + * Extracts the signatures matching a given scheme in a signature header. + * + * @param string $header the signature header + * @param string $scheme the signature scheme to look for + * + * @return array the list of signatures matching the provided scheme + */ + private static function getSignatures($header, $scheme) + { + $signatures = []; + $items = \explode(',', $header); + + foreach ($items as $item) { + $itemParts = \explode('=', $item, 2); + if (\trim($itemParts[0]) === $scheme) { + $signatures[] = $itemParts[1]; + } + } + + return $signatures; + } + + /** + * Computes the signature for a given payload and secret. + * + * The current scheme used by Stripe ("v1") is HMAC/SHA-256. + * + * @param string $payload the payload to sign + * @param string $secret the secret used to generate the signature + * + * @return string the signature as a string + */ + private static function computeSignature($payload, $secret) + { + return \hash_hmac('sha256', $payload, $secret); + } +} diff --git a/vendor/stripe/stripe-php/phpdoc.dist.xml b/vendor/stripe/stripe-php/phpdoc.dist.xml new file mode 100644 index 0000000..b1ea92f --- /dev/null +++ b/vendor/stripe/stripe-php/phpdoc.dist.xml @@ -0,0 +1,31 @@ + + + + build/phpdoc + + + latest + + + lib + + api + + + php + + stripe-php + + +