File tree Expand file tree Collapse file tree 2 files changed +2
-12
lines changed
Expand file tree Collapse file tree 2 files changed +2
-12
lines changed Original file line number Diff line number Diff line change 1515use function chr ;
1616use function mb_strlen ;
1717use function openssl_cipher_iv_length ;
18+ use function openssl_cipher_key_length ;
1819use function openssl_decrypt ;
1920use function openssl_encrypt ;
2021use function openssl_sign ;
@@ -251,7 +252,7 @@ public function setCipher(string $cipher): void
251252 default :
252253 $ this ->cipher = C::$ BLOCK_CIPHER_ALGORITHMS [$ cipher ];
253254 $ this ->blocksize = C::$ BLOCK_SIZES [$ cipher ];
254- $ this ->keysize = C::$ BLOCK_CIPHER_KEY_SIZES [$ cipher ];
255+ $ this ->keysize = openssl_cipher_key_length ( C::$ BLOCK_CIPHER_ALGORITHMS [$ cipher ]) ;
255256 }
256257 }
257258
Original file line number Diff line number Diff line change @@ -117,17 +117,6 @@ class Constants extends \SimpleSAML\XML\Constants
117117 self ::BLOCK_ENC_AES256_GCM => 16 ,
118118 ];
119119
120- /** @var array<string, positive-int> */
121- public static array $ BLOCK_CIPHER_KEY_SIZES = [
122- self ::BLOCK_ENC_3DES => 24 ,
123- self ::BLOCK_ENC_AES128 => 16 ,
124- self ::BLOCK_ENC_AES192 => 24 ,
125- self ::BLOCK_ENC_AES256 => 32 ,
126- self ::BLOCK_ENC_AES128_GCM => 16 ,
127- self ::BLOCK_ENC_AES192_GCM => 24 ,
128- self ::BLOCK_ENC_AES256_GCM => 32 ,
129- ];
130-
131120
132121 /**
133122 * Key transport algorithms
You can’t perform that action at this time.
0 commit comments