Skip to content

Commit

Permalink
Add strict check
Browse files Browse the repository at this point in the history
  • Loading branch information
sop committed May 23, 2019
1 parent 1357b9f commit beb90ab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/CryptoBridge/Crypto/OpenSSLCrypto.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ protected function _checkSignatureAlgoAndKey(
*
* @param SignatureAlgorithmIdentifier $algo
*
* @throws \UnexpectedValueException
* @throws \UnexpectedValueException If digest method is not supported
*
* @return int
*/
Expand All @@ -199,7 +199,7 @@ protected function _algoToDigest(SignatureAlgorithmIdentifier $algo): int
*
* @param CipherAlgorithmIdentifier $algo
*
* @throws \UnexpectedValueException
* @throws \UnexpectedValueException If cipher method is not supported
*
* @return string
*/
Expand All @@ -209,7 +209,7 @@ protected function _algoToCipher(CipherAlgorithmIdentifier $algo): string
if (array_key_exists($oid, self::MAP_CIPHER_OID)) {
return self::MAP_CIPHER_OID[$oid];
}
if (AlgorithmIdentifier::OID_RC2_CBC == $oid) {
if (AlgorithmIdentifier::OID_RC2_CBC === $oid) {
if (!$algo instanceof RC2CBCAlgorithmIdentifier) {
throw new \UnexpectedValueException('Not an RC2-CBC algorithm.');
}
Expand All @@ -224,7 +224,7 @@ protected function _algoToCipher(CipherAlgorithmIdentifier $algo): string
*
* @param RC2CBCAlgorithmIdentifier $algo
*
* @throws \UnexpectedValueException
* @throws \UnexpectedValueException If cipher's key size is not supported
*
* @return string
*/
Expand Down

0 comments on commit beb90ab

Please sign in to comment.