diff --git a/src/Common/Config.php b/src/Common/Config.php index 345083f..ee7b2da 100644 --- a/src/Common/Config.php +++ b/src/Common/Config.php @@ -25,16 +25,11 @@ final class Config { const VERSION = "PHP Privacy v2"; - const COMMENT = "https://github.com/web-of-trust/php-privacy"; + const COMMENT = "The PHP OpenPGP library"; const CIPHER_MODE = "cfb"; const HKDF_ALGO = "sha256"; - const PADDING_MIN = 16; - const PADDING_MAX = 32; - - const SALT_NOTATION = "salt@openpgp.org"; - const AEAD_SUPPORTED = true; const AEAD_CHUNK_SIZE_MIN = 10; const AEAD_CHUNK_SIZE_MAX = 16; diff --git a/src/Key/AbstractKey.php b/src/Key/AbstractKey.php index f7d5823..4989670 100644 --- a/src/Key/AbstractKey.php +++ b/src/Key/AbstractKey.php @@ -9,7 +9,6 @@ namespace OpenPGP\Key; use DateTimeInterface; -use OpenPGP\Common\Config; use OpenPGP\Enum\{KeyAlgorithm, PacketTag, RevocationReasonTag, SignatureType}; use OpenPGP\Packet\{PacketList, Padding, Signature}; use OpenPGP\Packet\Signature\{ @@ -119,7 +118,7 @@ public function getPacketList(): PacketListInterface ]; if ($this->getVersion() === 6) { $packets[] = Padding::createPadding( - random_int(Config::PADDING_MIN, Config::PADDING_MAX) + random_int(Padding::PADDING_MIN, Padding::PADDING_MAX) ); } diff --git a/src/Packet/Padding.php b/src/Packet/Padding.php index 50ddc14..b3f1806 100644 --- a/src/Packet/Padding.php +++ b/src/Packet/Padding.php @@ -23,6 +23,9 @@ */ class Padding extends AbstractPacket { + const PADDING_MIN = 16; + const PADDING_MAX = 32; + /** * Constructor * diff --git a/src/Packet/Signature.php b/src/Packet/Signature.php index 65cfa8e..5eeff75 100644 --- a/src/Packet/Signature.php +++ b/src/Packet/Signature.php @@ -225,7 +225,7 @@ public static function createSignature( $salt = Random::string($hashAlgorithm->saltSize()); } else { $hashedSubpackets[] = Signature\NotationData::fromNotation( - Config::SALT_NOTATION, + NotationData::SALT_NOTATION, Random::string($hashAlgorithm->saltSize()) ); } diff --git a/src/Packet/Signature/NotationData.php b/src/Packet/Signature/NotationData.php index 0aff149..fb9033c 100644 --- a/src/Packet/Signature/NotationData.php +++ b/src/Packet/Signature/NotationData.php @@ -27,6 +27,8 @@ class NotationData extends SignatureSubpacket implements NotationDataInterface const NAME_LENGTH = 2; const VALUE_LENGTH = 2; + const SALT_NOTATION = "salt@php-openpgp.org"; + /** * Constructor *