mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-12 13:46:41 +02:00
https://metacpan.org/release/Net-Jabber/ Access the Jabber protocol with Perl Needed by testing/perl-net-jabber-bot
42 lines
1.3 KiB
Diff
42 lines
1.3 KiB
Diff
Use Digest::SHA bundled with Perl so we don't need to depend on perl-digest-sha1
|
|
|
|
--- a/lib/Net/Jabber/Component.pm
|
|
+++ b/lib/Net/Jabber/Component.pm
|
|
@@ -219,7 +219,7 @@
|
|
|
|
$self->{STREAM}->SetCallBacks(node=>undef);
|
|
|
|
- $self->Send("<handshake>".Digest::SHA1::sha1_hex($self->{SESSION}->{id}.$args{secret})."</handshake>");
|
|
+ $self->Send("<handshake>".Digest::SHA::sha1_hex($self->{SESSION}->{id}.$args{secret})."</handshake>");
|
|
my $handshake = $self->Process();
|
|
|
|
if (!defined($handshake) ||
|
|
--- a/lib/Net/Jabber/Key.pm
|
|
+++ b/lib/Net/Jabber/Key.pm
|
|
@@ -103,14 +103,14 @@
|
|
|
|
$self->{CACHE} = {};
|
|
|
|
- if (eval "require Digest::SHA1")
|
|
+ if (eval "require Digest::SHA")
|
|
{
|
|
$self->{DIGEST} = 1;
|
|
- Digest::SHA1->import(qw(sha1 sha1_hex sha1_base64));
|
|
+ Digest::SHA->import(qw(sha1 sha1_hex sha1_base64));
|
|
}
|
|
else
|
|
{
|
|
- print "ERROR: You cannot use Key.pm unless you have Digest::SHA1 installed.\n";
|
|
+ print "ERROR: You cannot use Key.pm unless you have Digest::SHA installed.\n";
|
|
exit(0);
|
|
}
|
|
|
|
@@ -131,7 +131,7 @@
|
|
my $self = shift;
|
|
|
|
my $string = $$.time.rand(1000000);
|
|
- $string = Digest::SHA1::sha1_hex($string);
|
|
+ $string = Digest::SHA::sha1_hex($string);
|
|
$self->{DEBUG}->Log1("Generate: key($string)");
|
|
return $string;
|
|
}
|