remove no need password fn

This commit is contained in:
Marko Oldenburg 2021-04-22 08:41:02 +02:00
parent 388c6f6a2f
commit ad72e9a26d
2 changed files with 2 additions and 30 deletions

View File

@ -1 +1,2 @@
UPD 2021-04-21_10:01:00 6866 FHEM/46_TeslaPowerwall2AC.pm
UPD 2021-04-22_08:19:01 6866 FHEM/46_TeslaPowerwall2AC.pm
UPD 2021-04-22_08:24:27 29401 lib/FHEM/Tesla/Powerwall.pm

View File

@ -935,35 +935,6 @@ sub CreateUri {
return ( $uri, $method, $header, $data, $path );
}
sub StorePassword {
my $hash = shift;
my $name = shift;
my $password = shift;
my $index = $hash->{TYPE} . q{_} . $name . q{_passwd};
my $key = ::getUniqueId() . $index;
my $enc_pwd = q{};
if ( eval qq(use Digest::MD5;1) ) {
$key = Digest::MD5::md5_hex( unpack "H*", $key );
$key .= Digest::MD5::md5_hex($key);
}
for my $char ( split //, $password ) {
my $encode = chop($key);
$enc_pwd .= sprintf( "%.2x", ord($char) ^ ord($encode) );
$key = $encode . $key;
}
my $err = ::setKeyValue( $index, $enc_pwd );
return qq(error while saving the password - ${err})
if ( defined($err) );
return q{password successfully saved};
}
sub ReadPassword {
my $hash = shift;
my $name = shift;