From 03b88f1171efa1baad48cf891fec0d7646c03a5c Mon Sep 17 00:00:00 2001 From: Joni Eskelinen Date: Wed, 15 May 2019 14:36:40 +0300 Subject: [PATCH] Tweak formatting --- .../AlgorithmIdentifier/PBES1AlgorithmIdentifier.php | 8 ++------ .../AlgorithmIdentifier/PBKDF2AlgorithmIdentifier.php | 10 +++------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/lib/PKCS5/ASN1/AlgorithmIdentifier/PBES1AlgorithmIdentifier.php b/lib/PKCS5/ASN1/AlgorithmIdentifier/PBES1AlgorithmIdentifier.php index d04f029..7b873ea 100644 --- a/lib/PKCS5/ASN1/AlgorithmIdentifier/PBES1AlgorithmIdentifier.php +++ b/lib/PKCS5/ASN1/AlgorithmIdentifier/PBES1AlgorithmIdentifier.php @@ -70,12 +70,8 @@ public static function fromASN1Params( throw new \UnexpectedValueException('No parameters.'); } $seq = $params->asSequence(); - $salt = $seq->at(0) - ->asOctetString() - ->string(); - $iteration_count = $seq->at(1) - ->asInteger() - ->intNumber(); + $salt = $seq->at(0)->asOctetString()->string(); + $iteration_count = $seq->at(1)->asInteger()->intNumber(); return new static($salt, $iteration_count); } diff --git a/lib/PKCS5/ASN1/AlgorithmIdentifier/PBKDF2AlgorithmIdentifier.php b/lib/PKCS5/ASN1/AlgorithmIdentifier/PBKDF2AlgorithmIdentifier.php index 4bd8f6d..01ed3d6 100644 --- a/lib/PKCS5/ASN1/AlgorithmIdentifier/PBKDF2AlgorithmIdentifier.php +++ b/lib/PKCS5/ASN1/AlgorithmIdentifier/PBKDF2AlgorithmIdentifier.php @@ -131,16 +131,12 @@ public static function fromASN1Params( default: throw new \UnexpectedValueException('Invalid salt encoding.'); } - $iteration_count = $seq->at(1) - ->asInteger() - ->intNumber(); + $iteration_count = $seq->at(1)->asInteger()->intNumber(); $key_length = null; $prf_algo = null; $idx = 2; if ($seq->has($idx, Element::TYPE_INTEGER)) { - $key_length = $seq->at($idx++) - ->asInteger() - ->intNumber(); + $key_length = $seq->at($idx++)->asInteger()->intNumber(); } if ($seq->has($idx, Element::TYPE_SEQUENCE)) { $prf_algo = AlgorithmIdentifier::fromASN1( @@ -222,7 +218,7 @@ protected function _paramsASN1(): ?Element if (isset($this->_keyLength)) { $elements[] = new Integer($this->_keyLength); } - if (AlgorithmIdentifier::OID_HMAC_WITH_SHA1 != $this->_prfAlgo->oid()) { + if (AlgorithmIdentifier::OID_HMAC_WITH_SHA1 !== $this->_prfAlgo->oid()) { $elements[] = $this->_prfAlgo->toASN1(); } return new Sequence(...$elements);