$ivsize = \openssl_cipher_iv_length($config['CIPHER_METHOD']);
$iv = \fread($inputHandle, $ivsize);
if ($iv === false ) {
throw new Ex\CannotPerformOperation(
'Cannot read input file'
);
}
None of the code below that checks if $iv is actually the correct length, so if EOF was encountered (or some other weird condition), we'll get a wrong size IV. The same bug probably exists for other parameters read from the file too.