2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

72_XiaomiDevice: requested fix for crash

git-svn-id: https://svn.fhem.de/fhem/trunk@29324 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
moises 2024-11-01 02:06:39 +00:00
parent 280366a8b8
commit e6fed0e21f
2 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it
- bugfix: 72_XiaomiDevice: requested fix for crash
- change: 76_SolarForecast: attr setupInverterDevXX: new key 'limit',
the key 'capacity' is now mandatory! Attr affect70percentRule,
ctrlAutoRefresh, ctrlAutoRefreshFW are deleted

View File

@ -3974,7 +3974,11 @@ sub XiaomiDevice_Read($) {
$Crypt::Rijndael_PP::DEFAULT_KEYSIZE = 128;
$cbc = Crypt::CBC->new(-key => $key, -cipher => 'Crypt::Rijndael_PP',-iv => $iv, -literal_key => 1, -header => "none", -keysize => 16 );
}
my $return = $cbc->decrypt_hex($data);
my $return = 00000000000000000000000000000000;
if(length($data)%32 == 0)
{
$return = $cbc->decrypt_hex($data);
}
Log3 $name, 5, "$name: decrypted \n".$return;
if( length($data) == 48 && $return !~ m/^{.*}/ )