Exploit databaseDownload repository ZIP
GH-8c7f0e4b0e998904a1d6f7dcd99e3e7d
d-xuan/cve-2024-52510
Sources for CVE-2024-52510
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files26
d-xuan/cve-2024-52510Revision 6c0d89756ae0
- ↑..Parent directory
- BMPString.php
- BitString.php
- Boolean.php
- CharacterString.php
- EOC.php
- Enumerated.php
- GeneralString.php
- GeneralizedTime.php
- GraphicString.php
- IA5String.php
- Integer.php
- NullType.php
- Number.php
- NumericString.php
- ObjectDescriptor.php
- ObjectIdentifier.php
- OctetString.php
- PrintableString.php
- Real.php
- RelativeOID.php
- T61String.php
- UTCTime.php
- UTF8String.php
- UniversalString.php
- VideotexString.php
- VisibleString.php
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
3rdparty/spomky-labs/pki-framework/src/ASN1/Type/Primitive/Boolean.php
PHP · 1,485 bytes<?php
declare(strict_types=1);
namespace SpomkyLabs\Pki\ASN1\Type\Primitive;
use SpomkyLabs\Pki\ASN1\Component\Identifier;
use SpomkyLabs\Pki\ASN1\Component\Length;
use SpomkyLabs\Pki\ASN1\Element;
use SpomkyLabs\Pki\ASN1\Exception\DecodeException;
use SpomkyLabs\Pki\ASN1\Feature\ElementBase;
use SpomkyLabs\Pki\ASN1\Type\PrimitiveType;
use SpomkyLabs\Pki\ASN1\Type\UniversalClass;
use function chr;
use function ord;
/**
* Implements *BOOLEAN* type.
*/
final class Boolean extends Element
{
use UniversalClass;
use PrimitiveType;
private function __construct(
private readonly bool $_bool
) {
parent::__construct(self::TYPE_BOOLEAN);
}
public static function create(bool $_bool): self
{
return new self($_bool);
}
/**
* Get the value.
*/
public function value(): bool
{
return $this->_bool;
}
protected function encodedAsDER(): string
{
return $this->_bool ? chr(0xff) : chr(0);
}
protected static function decodeFromDER(Identifier $identifier, string $data, int &$offset): ElementBase
{
$idx = $offset;
Length::expectFromDER($data, $idx, 1);
$byte = ord($data[$idx++]);
if ($byte !== 0) {
if ($byte !== 0xff) {
throw new DecodeException('DER encoded boolean true must have all bits set to 1.');
}
}
$offset = $idx;
return self::create($byte !== 0);
}
}