commit 32e2989e7c992be9a3c67f616593bd0c085ca083 Author: MSVSphere Packaging Team Date: Tue Nov 26 17:59:47 2024 +0300 import perl-Net-SNMP-6.0.1-42.el10 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..634bd01 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/Net-SNMP-v6.0.1.tar.gz diff --git a/.perl-Net-SNMP.metadata b/.perl-Net-SNMP.metadata new file mode 100644 index 0000000..30120f9 --- /dev/null +++ b/.perl-Net-SNMP.metadata @@ -0,0 +1 @@ +492073bcf5206b56783e07c0603ff3b1f12707fa SOURCES/Net-SNMP-v6.0.1.tar.gz diff --git a/SOURCES/Net-SNMP-v6.0.1-Add_tests_for_another_usm_scenarios.patch b/SOURCES/Net-SNMP-v6.0.1-Add_tests_for_another_usm_scenarios.patch new file mode 100644 index 0000000..883fbf3 --- /dev/null +++ b/SOURCES/Net-SNMP-v6.0.1-Add_tests_for_another_usm_scenarios.patch @@ -0,0 +1,551 @@ +From 0ce1418f8261764c1b34c4379ed6af6ef8073678 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michal=20Josef=20=C5=A0pa=C4=8Dek?= + +Date: Mon, 11 Mar 2024 21:08:32 +0100 +Subject: [PATCH 08/11] Add tests for another usm scenarios + +--- + MANIFEST | 3 + + t/usm-sha1-3des.t | 164 +++++++++++++++++++++++++++++++++++++++ + t/usm-sha1-aes.t | 169 +++++++++++++++++++++++++++++++++++++++++ + t/usm-sha1-cfb192aes.t | 169 +++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 505 insertions(+) + create mode 100644 t/usm-sha1-3des.t + create mode 100644 t/usm-sha1-aes.t + create mode 100644 t/usm-sha1-cfb192aes.t + +diff --git a/MANIFEST b/MANIFEST +index c750573..3430564 100644 +--- a/MANIFEST ++++ b/MANIFEST +@@ -36,4 +36,7 @@ t/ber.t + t/dsp.t + t/mp.t + t/usm-md5-des.t ++t/usm-sha1-3des.t ++t/usm-sha1-aes.t ++t/usm-sha1-cfb192aes.t + t/usm-sha1-des.t +diff --git a/t/usm-sha1-3des.t b/t/usm-sha1-3des.t +new file mode 100644 +index 0000000..5921ccf +--- /dev/null ++++ b/t/usm-sha1-3des.t +@@ -0,0 +1,164 @@ ++# -*- mode: perl -*- ++# ============================================================================ ++ ++# Test of the SNMPv3 User-based Security Model. ++ ++# Copyright (c) 2001-2009 David M. Town . ++# Copyright (c) 2024 Michal Josef Špaček . ++# All rights reserved. ++ ++# This program is free software; you may redistribute it and/or modify it ++# under the same terms as the Perl 5 programming language system itself. ++ ++# ============================================================================ ++ ++use strict; ++use Test; ++ ++BEGIN ++{ ++ $| = 1; ++ $^W = 1; ++ plan tests => 7 ++} ++ ++use Net::SNMP::Message qw(SEQUENCE OCTET_STRING FALSE); ++ ++# ++# Load the Net::SNMP::Security::USM module ++# ++ ++eval 'use Net::SNMP::Security::USM'; ++ ++my $skip = ($@ =~ /locate (:?\S+\.pm)/) ? $@ : FALSE; ++ ++# ++# 1. Create the Net::SNMP::Security::USM object ++# ++ ++my ($u, $e); ++ ++eval ++{ ++ ($u, $e) = Net::SNMP::Security::USM->new( ++ -username => 'dtown', ++ -authpassword => 'maplesyrup', ++ -authprotocol => 'sha', ++ -privpassword => 'maplesyrup', ++ -privprotocol => '3des', ++ ); ++ ++ # "Perform" discovery... ++ $u->_engine_id_discovery(pack 'x11H2', '02'); ++ ++ # ...and synchronization ++ $u->_synchronize(10, time); ++}; ++ ++skip( ++ $skip, ($@ || $e), q{}, 'Failed to create Net::SNMP::Security::USM object' ++); ++ ++# ++# 2. Check the localized authKey ++# ++ ++eval ++{ ++ $e = unpack 'H*', $u->auth_key(); ++}; ++ ++skip( ++ $skip, ++ ($@ || $e), ++ '6695febc9288e36282235fc7151f128497b38f3f', ++ 'Invalid authKey calculated' ++); ++ ++# ++# 3. Check the localized privKey ++# ++ ++eval ++{ ++ $e = unpack 'H*', $u->priv_key(); ++}; ++ ++skip( ++ $skip, ++ ($@ || $e), ++ '6695febc9288e36282235fc7151f128497b38f3f9b8b6d78936ba6e7d19dfd9c', ++ 'Invalid privKey calculated' ++); ++ ++# ++# 4. Create and initalize a Message ++# ++ ++my $m; ++ ++eval ++{ ++ ($m, $e) = Net::SNMP::Message->new(); ++ $m->prepare(SEQUENCE, pack('H*', 'deadbeef') x 8); ++ $e = $m->error(); ++}; ++ ++skip($skip, ($@ || $e), q{}, 'Failed to create Net::SNMP::Message object'); ++ ++# ++# 5. Calculate the HMAC ++# ++ ++my $h; ++ ++eval ++{ ++ $h = unpack 'H*', $u->_auth_hmac($m); ++}; ++ ++skip($skip, $@, q{}, 'Calculate the HMAC failed'); ++ ++# ++# 6. Encrypt/descrypt the Message ++# ++ ++my $henc; ++ ++eval ++{ ++ my $salt; ++ my $len = $m->length(); ++ my $buff = $m->clear(); ++ my $encrypted = $u->_encrypt_data($m, $salt, $buff); ++ $henc = unpack 'H*', $encrypted; ++ $m->append($encrypted); ++ $u->_decrypt_data($m, $salt, $m->process(OCTET_STRING)); ++ $e = $u->error(); ++ # Remove padding if necessary ++ if ($len -= $m->length()) { ++ substr ${$m->reference()}, $len, -$len, q{}; ++ } ++}; ++ ++skip( ++ $skip, ++ ($@ || $e || $henc), ++ '042858d3a9fffa5afd8ef5cb338fdd79f452e13c0e77f4a918a069a84687c462726148c53198e6c97346', ++ 'Privacy failed', ++); ++ ++# ++# 7. Check the HMAC ++# ++ ++my $h2; ++ ++eval ++{ ++ $h2 = unpack 'H*', $u->_auth_hmac($m); ++}; ++ ++skip($skip, ($@ || $h2), $h, 'Authentication failed'); ++ ++# ============================================================================ +diff --git a/t/usm-sha1-aes.t b/t/usm-sha1-aes.t +new file mode 100644 +index 0000000..3e1b9f2 +--- /dev/null ++++ b/t/usm-sha1-aes.t +@@ -0,0 +1,169 @@ ++# -*- mode: perl -*- ++# ============================================================================ ++ ++# Test of the SNMPv3 User-based Security Model. ++ ++# Copyright (c) 2001-2009 David M. Town . ++# Copyright (c) 2024 Michal Josef Špaček . ++# All rights reserved. ++ ++# This program is free software; you may redistribute it and/or modify it ++# under the same terms as the Perl 5 programming language system itself. ++ ++# ============================================================================ ++ ++use strict; ++use Test; ++ ++BEGIN ++{ ++ $| = 1; ++ $^W = 1; ++ plan tests => 7 ++} ++ ++use Net::SNMP::Message qw(SEQUENCE OCTET_STRING FALSE); ++ ++# ++# Load the Net::SNMP::Security::USM module ++# ++ ++eval 'use Net::SNMP::Security::USM; use Crypt::Rijndael;'; ++ ++my $skip = ($@ =~ /locate (:?\S+\.pm)/) ? $@ : FALSE; ++ ++# ++# 1. Create the Net::SNMP::Security::USM object ++# ++ ++my ($u, $e); ++ ++eval ++{ ++ ($u, $e) = Net::SNMP::Security::USM->new( ++ -username => 'dtown', ++ -authpassword => 'maplesyrup', ++ -authprotocol => 'sha1', ++ -privpassword => 'maplesyrup', ++ -privprotocol => 'aes', ++ ); ++ ++ # "Perform" discovery... ++ $u->_engine_id_discovery(pack 'x11H2', '02'); ++ ++ # ...and synchronization ++ $u->_synchronize(10, time); ++}; ++ ++skip( ++ $skip, ($@ || $e), q{}, 'Failed to create Net::SNMP::Security::USM object' ++); ++ ++# ++# 2. Check the localized authKey ++# ++ ++eval ++{ ++ $e = unpack 'H*', $u->auth_key(); ++}; ++ ++skip( ++ $skip, ++ ($@ || $e), ++ '6695febc9288e36282235fc7151f128497b38f3f', ++ 'Invalid authKey calculated' ++); ++ ++# ++# 3. Check the localized privKey ++# ++ ++eval ++{ ++ $e = unpack 'H*', $u->priv_key(); ++}; ++ ++skip( ++ $skip, ++ ($@ || $e), ++ '6695febc9288e36282235fc7151f1284', ++ 'Invalid privKey calculated' ++); ++ ++# ++# 4. Create and initalize a Message ++# ++ ++my $m; ++ ++eval ++{ ++ ($m, $e) = Net::SNMP::Message->new(); ++ $m->prepare(SEQUENCE, pack('H*', 'deadbeef') x 8); ++ $e = $m->error(); ++}; ++ ++skip($skip, ($@ || $e), q{}, 'Failed to create Net::SNMP::Message object'); ++ ++# ++# 5. Calculate the HMAC ++# ++ ++my $h; ++ ++eval ++{ ++ $h = unpack 'H*', $u->_auth_hmac($m); ++}; ++ ++skip($skip, $@, q{}, 'Calculate the HMAC failed'); ++ ++# ++# 6. Encrypt/descrypt the Message ++# ++ ++my $henc; ++ ++eval ++{ ++ my $engine_boots = 0; ++ my $engine_time = 1710186219; ++ my $salt; ++ my $len = $m->length(); ++ my $buff = $m->clear(); ++ $u->{_engine_boots} = $engine_boots; ++ $u->{_engine_time} = $engine_time; ++ my $encrypted = $u->_encrypt_data($m, $salt, $buff); ++ $henc = unpack 'H*', $encrypted; ++ $m->append($encrypted); ++ substr $salt, 0, 0, pack 'NN', $engine_boots, $engine_time; ++ $u->_decrypt_data($m, $salt, $m->process(OCTET_STRING)); ++ $e = $u->error(); ++ # Remove padding if necessary ++ if ($len -= $m->length()) { ++ substr ${$m->reference()}, $len, -$len, q{}; ++ } ++}; ++ ++skip( ++ $skip, ++ ($@ || $e || $henc), ++ '0422c538d5445bbfb3a7b53b523349ce6ff3e38774bd14491703e6684aa485c48a9c217f', ++ 'Privacy failed', ++); ++ ++# ++# 7. Check the HMAC ++# ++ ++my $h2; ++ ++eval ++{ ++ $h2 = unpack 'H*', $u->_auth_hmac($m); ++}; ++ ++skip($skip, ($@ || $h2), $h, 'Authentication failed'); ++ ++# ============================================================================ +diff --git a/t/usm-sha1-cfb192aes.t b/t/usm-sha1-cfb192aes.t +new file mode 100644 +index 0000000..6f6898a +--- /dev/null ++++ b/t/usm-sha1-cfb192aes.t +@@ -0,0 +1,169 @@ ++# -*- mode: perl -*- ++# ============================================================================ ++ ++# Test of the SNMPv3 User-based Security Model. ++ ++# Copyright (c) 2001-2009 David M. Town . ++# Copyright (c) 2024 Michal Josef Špaček . ++# All rights reserved. ++ ++# This program is free software; you may redistribute it and/or modify it ++# under the same terms as the Perl 5 programming language system itself. ++ ++# ============================================================================ ++ ++use strict; ++use Test; ++ ++BEGIN ++{ ++ $| = 1; ++ $^W = 1; ++ plan tests => 7 ++} ++ ++use Net::SNMP::Message qw(SEQUENCE OCTET_STRING FALSE); ++ ++# ++# Load the Net::SNMP::Security::USM module ++# ++ ++eval 'use Net::SNMP::Security::USM; use Crypt::Rijndael;'; ++ ++my $skip = ($@ =~ /locate (:?\S+\.pm)/) ? $@ : FALSE; ++ ++# ++# 1. Create the Net::SNMP::Security::USM object ++# ++ ++my ($u, $e); ++ ++eval ++{ ++ ($u, $e) = Net::SNMP::Security::USM->new( ++ -username => 'dtown', ++ -authpassword => 'maplesyrup', ++ -authprotocol => 'sha', ++ -privpassword => 'maplesyrup', ++ -privprotocol => 'cfb192-aes', ++ ); ++ ++ # "Perform" discovery... ++ $u->_engine_id_discovery(pack 'x11H2', '02'); ++ ++ # ...and synchronization ++ $u->_synchronize(10, time); ++}; ++ ++skip( ++ $skip, ($@ || $e), q{}, 'Failed to create Net::SNMP::Security::USM object' ++); ++ ++# ++# 2. Check the localized authKey ++# ++ ++eval ++{ ++ $e = unpack 'H*', $u->auth_key(); ++}; ++ ++skip( ++ $skip, ++ ($@ || $e), ++ '6695febc9288e36282235fc7151f128497b38f3f', # RFC 3414 - A.3.2 ++ 'Invalid authKey calculated' ++); ++ ++# ++# 3. Check the localized privKey ++# ++ ++eval ++{ ++ $e = unpack 'H*', $u->priv_key(); ++}; ++ ++skip( ++ $skip, ++ ($@ || $e), ++ '6695febc9288e36282235fc7151f128497b38f3f505e07eb', ++ 'Invalid privKey calculated' ++); ++ ++# ++# 4. Create and initalize a Message ++# ++ ++my $m; ++ ++eval ++{ ++ ($m, $e) = Net::SNMP::Message->new(); ++ $m->prepare(SEQUENCE, pack('H*', 'deadbeef') x 8); ++ $e = $m->error(); ++}; ++ ++skip($skip, ($@ || $e), q{}, 'Failed to create Net::SNMP::Message object'); ++ ++# ++# 5. Calculate the HMAC ++# ++ ++my $h; ++ ++eval ++{ ++ $h = unpack 'H*', $u->_auth_hmac($m); ++}; ++ ++skip($skip, $@, q{}, 'Calculate the HMAC failed'); ++ ++# ++# 6. Encrypt/descrypt the Message ++# ++ ++my $henc; ++ ++eval ++{ ++ my $engine_boots = 0; ++ my $engine_time = 1710186219; ++ my $salt; ++ my $len = $m->length(); ++ my $buff = $m->clear(); ++ $u->{_engine_boots} = $engine_boots; ++ $u->{_engine_time} = $engine_time; ++ my $encrypted = $u->_encrypt_data($m, $salt, $buff); ++ $henc = unpack 'H*', $encrypted; ++ $m->append($encrypted); ++ substr $salt, 0, 0, pack 'NN', $engine_boots, $engine_time; ++ $u->_decrypt_data($m, $salt, $m->process(OCTET_STRING)); ++ $e = $u->error(); ++ # Remove padding if necessary ++ if ($len -= $m->length()) { ++ substr ${$m->reference()}, $len, -$len, q{}; ++ } ++}; ++ ++skip( ++ $skip, ++ ($@ || $e || $henc), ++ '042237eb7b044608e045878caba6d347f125edcad5b919d88d4c74d08b8040d105b3f29a', ++ 'Privacy failed', ++); ++ ++# ++# 7. Check the HMAC ++# ++ ++my $h2; ++ ++eval ++{ ++ $h2 = unpack 'H*', $u->_auth_hmac($m); ++}; ++ ++skip($skip, ($@ || $h2), $h, 'Authentication failed'); ++ ++# ============================================================================ +-- +2.45.1 + diff --git a/SOURCES/Net-SNMP-v6.0.1-Rewrite_from_Digest-SHA1-to-Digest-SHA.patch b/SOURCES/Net-SNMP-v6.0.1-Rewrite_from_Digest-SHA1-to-Digest-SHA.patch new file mode 100644 index 0000000..b82139b --- /dev/null +++ b/SOURCES/Net-SNMP-v6.0.1-Rewrite_from_Digest-SHA1-to-Digest-SHA.patch @@ -0,0 +1,127 @@ +From dbb8c0a1fe27bb250c8a34a8f83ace87de34eec3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michal=20Josef=20=C5=A0pa=C4=8Dek?= + +Date: Wed, 13 Mar 2024 12:13:44 +0100 +Subject: [PATCH 10/11] Rewrite from Digest::SHA1 to Digest::SHA + +Digest::SHA is most actual in CPAN. +All changes are covered by tests. +--- + Build.PL | 2 +- + META.yml | 2 +- + Makefile.PL | 2 +- + README | 2 +- + lib/Net/SNMP.pm | 4 ++-- + lib/Net/SNMP/Security/USM.pm | 8 ++++---- + 6 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/Build.PL b/Build.PL +index a8ae8dd..3140545 100644 +--- a/Build.PL ++++ b/Build.PL +@@ -38,7 +38,7 @@ Module::Build->new( + recommends => { + Crypt::DES => '2.03', # SNMPv3 + Digest::MD5 => '2.11', # SNMPv3 +- Digest::SHA1 => '1.02', # SNMPv3 ++ Digest::SHA => 0, # SNMPv3 + Digest::HMAC_MD5 => '1.01', # SNMPv3 + Digest::HMAC_SHA1 => '1.03', # SNMPv3 + Crypt::Rijndael => '1.02', # SNMPv3 - AES Cipher Algorithm +diff --git a/META.yml b/META.yml +index 0b1acd7..42fbc5f 100644 +--- a/META.yml ++++ b/META.yml +@@ -65,7 +65,7 @@ recommends: + Digest::HMAC_MD5: '1.01' + Digest::HMAC_SHA1: '1.03' + Digest::MD5: '2.11' +- Digest::SHA1: '1.02' ++ Digest::SHA: '0' + requires: + Carp: '0' + Errno: '0' +diff --git a/Makefile.PL b/Makefile.PL +index 516b2f9..3b134c4 100644 +--- a/Makefile.PL ++++ b/Makefile.PL +@@ -40,7 +40,7 @@ WriteMakefile( + Math::BigInt => 0, + Crypt::DES => '2.03', # SNMPv3 + Digest::MD5 => '2.11', # SNMPv3 +- Digest::SHA1 => '1.02', # SNMPv3 ++ Digest::SHA => 0, # SNMPv3 + Digest::HMAC_MD5 => '1.01', # SNMPv3 + Digest::HMAC_SHA1 => '1.03', # SNMPv3 + Socket => '2.000', +diff --git a/README b/README +index 7f23ea0..b5d02bc 100644 +--- a/README ++++ b/README +@@ -53,7 +53,7 @@ REQUIREMENTS + Net::SNMP uses syntax that is not supported in versions of Perl + earlier than v5.6.0. + +- The non-core modules Crypt::DES, Digest::MD5, Digest::SHA1, and ++ The non-core modules Crypt::DES, Digest::MD5, Digest::SHA, and + Digest::HMAC are needed to support SNMPv3. + + In order to support the AES Cipher Algorithm as a SNMPv3 privacy +diff --git a/lib/Net/SNMP.pm b/lib/Net/SNMP.pm +index 1f69630..53ddda9 100644 +--- a/lib/Net/SNMP.pm ++++ b/lib/Net/SNMP.pm +@@ -3550,8 +3550,8 @@ earlier than v5.6.0. + + =item * + +-The non-core modules F, F, F, and +-F are required to support SNMPv3. ++The non-core modules F, F, F, and ++F are required to support SNMPv3. + + =item * + +diff --git a/lib/Net/SNMP/Security/USM.pm b/lib/Net/SNMP/Security/USM.pm +index 0a2ab34..a76ef56 100644 +--- a/lib/Net/SNMP/Security/USM.pm ++++ b/lib/Net/SNMP/Security/USM.pm +@@ -25,7 +25,7 @@ use Net::SNMP::Message qw( + + use Crypt::DES(); + use Digest::MD5(); +-use Digest::SHA1(); ++use Digest::SHA(); + use Digest::HMAC_MD5(); + use Digest::HMAC_SHA1(); + +@@ -1392,7 +1392,7 @@ sub _priv_data_init_3desede + if ($this->{_auth_protocol} eq AUTH_PROTOCOL_HMACMD5) { + $this->{_priv_data}->{hash} = Digest::MD5->new(); + } elsif ($this->{_auth_protocol} eq AUTH_PROTOCOL_HMACSHA) { +- $this->{_priv_data}->{hash} = Digest::SHA1->new(); ++ $this->{_priv_data}->{hash} = Digest::SHA->new(); + } + + return TRUE; +@@ -1682,7 +1682,7 @@ sub _priv_key_generate + if ($this->{_auth_protocol} eq AUTH_PROTOCOL_HMACMD5) { + $hnnn = Digest::MD5->new(); + } elsif ($this->{_auth_protocol} eq AUTH_PROTOCOL_HMACSHA) { +- $hnnn = Digest::SHA1->new(); ++ $hnnn = Digest::SHA->new(); + } else { + return $this->_error( + 'The authProtocol "%s" is unknown', $this->{_auth_protocol} +@@ -1784,7 +1784,7 @@ sub _password_localize + my $digests = + { + AUTH_PROTOCOL_HMACMD5, 'Digest::MD5', +- AUTH_PROTOCOL_HMACSHA, 'Digest::SHA1', ++ AUTH_PROTOCOL_HMACSHA, 'Digest::SHA', + }; + + if (!exists $digests->{$this->{_auth_protocol}}) { +-- +2.45.1 + diff --git a/SOURCES/Net-SNMP-v6.0.1-Simple_rewrite_to_Digest-HMAC-helpers.patch b/SOURCES/Net-SNMP-v6.0.1-Simple_rewrite_to_Digest-HMAC-helpers.patch new file mode 100644 index 0000000..bd4968e --- /dev/null +++ b/SOURCES/Net-SNMP-v6.0.1-Simple_rewrite_to_Digest-HMAC-helpers.patch @@ -0,0 +1,93 @@ +From c84b7a235bdcaa37be39a927387c59429d2277c9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michal=20Josef=20=C5=A0pa=C4=8Dek?= + +Date: Tue, 5 Mar 2024 19:00:55 +0100 +Subject: [PATCH 03/11] Simple rewrite to Digest::HMAC helpers + +We need to concretize algorithms to defined place instead of composition +in code. Digest::HMAC_* helpers are in the same package as Digest::HMAC. + +Difference is that all code for algoritm is now in Digest::HMAC +distribution instead of previous situation when was composition +Digest::HMAC and Digest::SHA1 and Digest::MD5 in this code. +--- + Build.PL | 3 ++- + META.yml | 3 ++- + Makefile.PL | 3 ++- + lib/Net/SNMP/Security/USM.pm | 7 ++++--- + 4 files changed, 10 insertions(+), 6 deletions(-) + +diff --git a/Build.PL b/Build.PL +index 6002343..a8ae8dd 100644 +--- a/Build.PL ++++ b/Build.PL +@@ -39,7 +39,8 @@ Module::Build->new( + Crypt::DES => '2.03', # SNMPv3 + Digest::MD5 => '2.11', # SNMPv3 + Digest::SHA1 => '1.02', # SNMPv3 +- Digest::HMAC => '1.00', # SNMPv3 ++ Digest::HMAC_MD5 => '1.01', # SNMPv3 ++ Digest::HMAC_SHA1 => '1.03', # SNMPv3 + Crypt::Rijndael => '1.02', # SNMPv3 - AES Cipher Algorithm + }, + meta_merge => { +diff --git a/META.yml b/META.yml +index bf64bc6..0b1acd7 100644 +--- a/META.yml ++++ b/META.yml +@@ -62,7 +62,8 @@ provides: + recommends: + Crypt::DES: '2.03' + Crypt::Rijndael: '1.02' +- Digest::HMAC: '1.00' ++ Digest::HMAC_MD5: '1.01' ++ Digest::HMAC_SHA1: '1.03' + Digest::MD5: '2.11' + Digest::SHA1: '1.02' + requires: +diff --git a/Makefile.PL b/Makefile.PL +index a15243b..516b2f9 100644 +--- a/Makefile.PL ++++ b/Makefile.PL +@@ -41,7 +41,8 @@ WriteMakefile( + Crypt::DES => '2.03', # SNMPv3 + Digest::MD5 => '2.11', # SNMPv3 + Digest::SHA1 => '1.02', # SNMPv3 +- Digest::HMAC => '1.00', # SNMPv3 ++ Digest::HMAC_MD5 => '1.01', # SNMPv3 ++ Digest::HMAC_SHA1 => '1.03', # SNMPv3 + Socket => '2.000', + }, + dist => { +diff --git a/lib/Net/SNMP/Security/USM.pm b/lib/Net/SNMP/Security/USM.pm +index 4fb5742..0a2ab34 100644 +--- a/lib/Net/SNMP/Security/USM.pm ++++ b/lib/Net/SNMP/Security/USM.pm +@@ -26,7 +26,8 @@ use Net::SNMP::Message qw( + use Crypt::DES(); + use Digest::MD5(); + use Digest::SHA1(); +-use Digest::HMAC(); ++use Digest::HMAC_MD5(); ++use Digest::HMAC_SHA1(); + + ## Version of the Net::SNMP::Security::USM module + +@@ -1141,12 +1142,12 @@ sub _auth_data_init + if ($this->{_auth_protocol} eq AUTH_PROTOCOL_HMACMD5) { + + $this->{_auth_data} = +- Digest::HMAC->new($this->{_auth_key}, 'Digest::MD5'); ++ Digest::HMAC_MD5->new($this->{_auth_key}); + + } elsif ($this->{_auth_protocol} eq AUTH_PROTOCOL_HMACSHA) { + + $this->{_auth_data} = +- Digest::HMAC->new($this->{_auth_key}, 'Digest::SHA1'); ++ Digest::HMAC_SHA1->new($this->{_auth_key}); + + } else { + +-- +2.45.1 + diff --git a/SOURCES/Net-SNMP-v6.0.1-Split_usm.t_to_two_parts.patch b/SOURCES/Net-SNMP-v6.0.1-Split_usm.t_to_two_parts.patch new file mode 100644 index 0000000..3b8f16e --- /dev/null +++ b/SOURCES/Net-SNMP-v6.0.1-Split_usm.t_to_two_parts.patch @@ -0,0 +1,355 @@ +From 9b31754e1f3c456e15b81490b95604edf0c64cd7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michal=20Josef=20=C5=A0pa=C4=8Dek?= + +Date: Mon, 11 Mar 2024 20:56:17 +0100 +Subject: [PATCH 06/11] Split usm.t to two parts + +--- + MANIFEST | 3 +- + t/usm-md5-des.t | 153 ++++++++++++++++++++++++++++++++++++ + t/{usm.t => usm-sha1-des.t} | 121 +--------------------------- + 3 files changed, 159 insertions(+), 118 deletions(-) + create mode 100644 t/usm-md5-des.t + rename t/{usm.t => usm-sha1-des.t} (58%) + +diff --git a/MANIFEST b/MANIFEST +index 358e859..c750573 100644 +--- a/MANIFEST ++++ b/MANIFEST +@@ -35,4 +35,5 @@ snmpkey.PL + t/ber.t + t/dsp.t + t/mp.t +-t/usm.t ++t/usm-md5-des.t ++t/usm-sha1-des.t +diff --git a/t/usm-md5-des.t b/t/usm-md5-des.t +new file mode 100644 +index 0000000..2d8d8c0 +--- /dev/null ++++ b/t/usm-md5-des.t +@@ -0,0 +1,153 @@ ++# -*- mode: perl -*- ++# ============================================================================ ++ ++# Test of the SNMPv3 User-based Security Model. ++ ++# Copyright (c) 2001-2009 David M. Town . ++# All rights reserved. ++ ++# This program is free software; you may redistribute it and/or modify it ++# under the same terms as the Perl 5 programming language system itself. ++ ++# ============================================================================ ++ ++use strict; ++use Test; ++ ++BEGIN ++{ ++ $| = 1; ++ $^W = 1; ++ plan tests => 7 ++} ++ ++use Net::SNMP::Message qw(SEQUENCE OCTET_STRING FALSE); ++ ++# ++# Load the Net::SNMP::Security::USM module ++# ++ ++eval 'use Net::SNMP::Security::USM'; ++ ++my $skip = ($@ =~ /locate (:?\S+\.pm)/) ? $@ : FALSE; ++ ++# ++# 1. Create the Net::SNMP::Security::USM object ++# ++ ++my ($u, $e); ++ ++eval ++{ ++ ($u, $e) = Net::SNMP::Security::USM->new( ++ -username => 'dtown', ++ -authpassword => 'maplesyrup', ++ -privpassword => 'maplesyrup', ++ -privprotocol => 'des', ++ ); ++ ++ # "Perform" discovery... ++ $u->_engine_id_discovery(pack 'x11H2', '02'); ++ ++ # ...and synchronization ++ $u->_synchronize(10, time); ++}; ++ ++skip( ++ $skip, ($@ || $e), q{}, 'Failed to create Net::SNMP::Security::USM object' ++); ++ ++# ++# 2. Check the localized authKey ++# ++ ++eval ++{ ++ $e = unpack 'H*', $u->auth_key(); ++}; ++ ++skip( ++ $skip, ++ ($@ || $e), ++ '526f5eed9fcce26f8964c2930787d82b', # RFC 3414 - A.3.1 ++ 'Invalid authKey calculated' ++); ++ ++# ++# 3. Check the localized privKey ++# ++ ++eval ++{ ++ $e = unpack 'H*', $u->priv_key(); ++}; ++ ++skip( ++ $skip, ++ ($@ || $e), ++ '526f5eed9fcce26f8964c2930787d82b', ++ 'Invalid privKey calculated' ++); ++ ++# ++# 4. Create and initalize a Message ++# ++ ++my $m; ++ ++eval ++{ ++ ($m, $e) = Net::SNMP::Message->new(); ++ $m->prepare(SEQUENCE, pack('H*', 'deadbeef') x 8); ++ $e = $m->error(); ++}; ++ ++skip($skip, ($@ || $e), q{}, 'Failed to create Net::SNMP::Message object'); ++ ++# ++# 5. Calculate the HMAC ++# ++ ++my $h; ++ ++eval ++{ ++ $h = unpack 'H*', $u->_auth_hmac($m); ++}; ++ ++skip($skip, $@, q{}, 'Calculate the HMAC failed'); ++ ++# ++# 6. Encrypt/descrypt the Message ++# ++ ++eval ++{ ++ my $salt; ++ my $len = $m->length(); ++ my $buff = $m->clear(); ++ $m->append($u->_encrypt_data($m, $salt, $buff)); ++ $u->_decrypt_data($m, $salt, $m->process(OCTET_STRING)); ++ $e = $u->error(); ++ # Remove padding if necessary ++ if ($len -= $m->length()) { ++ substr ${$m->reference()}, $len, -$len, q{}; ++ } ++}; ++ ++skip($skip, ($@ || $e), q{}, 'Privacy failed'); ++ ++# ++# 7. Check the HMAC ++# ++ ++my $h2; ++ ++eval ++{ ++ $h2 = unpack 'H*', $u->_auth_hmac($m); ++}; ++ ++skip($skip, ($@ || $h2), $h, 'Authentication failed'); ++ ++# ============================================================================ +diff --git a/t/usm.t b/t/usm-sha1-des.t +similarity index 58% +rename from t/usm.t +rename to t/usm-sha1-des.t +index 1a0d5a8..2efff7f 100644 +--- a/t/usm.t ++++ b/t/usm-sha1-des.t +@@ -1,8 +1,6 @@ + # -*- mode: perl -*- + # ============================================================================ + +-# $Id: usm.t,v 6.0 2009/09/09 15:07:49 dtown Rel $ +- + # Test of the SNMPv3 User-based Security Model. + + # Copyright (c) 2001-2009 David M. Town . +@@ -20,7 +18,7 @@ BEGIN + { + $| = 1; + $^W = 1; +- plan tests => 14 ++ plan tests => 7 + } + + use Net::SNMP::Message qw(SEQUENCE OCTET_STRING FALSE); +@@ -44,6 +42,7 @@ eval + ($u, $e) = Net::SNMP::Security::USM->new( + -username => 'dtown', + -authpassword => 'maplesyrup', ++ -authprotocol => 'sha', + -privpassword => 'maplesyrup', + -privprotocol => 'des', + ); +@@ -71,7 +70,7 @@ eval + skip( + $skip, + ($@ || $e), +- '526f5eed9fcce26f8964c2930787d82b', # RFC 3414 - A.3.1 ++ '6695febc9288e36282235fc7151f128497b38f3f', # RFC 3414 - A.3.2 + 'Invalid authKey calculated' + ); + +@@ -87,7 +86,7 @@ eval + skip( + $skip, + ($@ || $e), +- '526f5eed9fcce26f8964c2930787d82b', ++ '6695febc9288e36282235fc7151f1284', + 'Invalid privKey calculated' + ); + +@@ -152,116 +151,4 @@ eval + + skip($skip, ($@ || $h2), $h, 'Authentication failed'); + +-# +-# 8. Create the Net::SNMP::Security::USM object +-# +- +-eval +-{ +- ($u, $e) = Net::SNMP::Security::USM->new( +- -username => 'dtown', +- -authpassword => 'maplesyrup', +- -authprotocol => 'sha', +- -privpassword => 'maplesyrup', +- -privprotocol => 'des', +- ); +- +- # "Perform" discovery... +- $u->_engine_id_discovery(pack 'x11H2', '02'); +- +- # ...and synchronization +- $u->_synchronize(10, time); +-}; +- +-skip( +- $skip, ($@ || $e), q{}, 'Failed to create Net::SNMP::Security::USM object' +-); +- +-# +-# 9. Check the localized authKey +-# +- +-eval +-{ +- $e = unpack 'H*', $u->auth_key(); +-}; +- +-skip( +- $skip, +- ($@ || $e), +- '6695febc9288e36282235fc7151f128497b38f3f', # RFC 3414 - A.3.2 +- 'Invalid authKey calculated' +-); +- +-# +-# 10. Check the localized privKey +-# +- +-eval +-{ +- $e = unpack 'H*', $u->priv_key(); +-}; +- +-skip( +- $skip, +- ($@ || $e), +- '6695febc9288e36282235fc7151f1284', +- 'Invalid privKey calculated' +-); +- +-# +-# 11. Create and initalize a Message +-# +- +-eval +-{ +- ($m, $e) = Net::SNMP::Message->new(); +- $m->prepare(SEQUENCE, pack('H*', 'deadbeef') x 8); +- $e = $m->error(); +-}; +- +-skip($skip, ($@ || $e), q{}, 'Failed to create Net::SNMP::Message object'); +- +-# +-# 12. Calculate the HMAC +-# +- +-eval +-{ +- $h = unpack 'H*', $u->_auth_hmac($m); +-}; +- +-skip($skip, $@, q{}, 'Calculate the HMAC failed'); +- +-# +-# 13. Encrypt/descrypt the Message +-# +- +-eval +-{ +- my $salt; +- my $len = $m->length(); +- my $buff = $m->clear(); +- $m->append($u->_encrypt_data($m, $salt, $buff)); +- $u->_decrypt_data($m, $salt, $m->process(OCTET_STRING)); +- $e = $u->error(); +- # Remove padding if necessary +- if ($len -= $m->length()) { +- substr ${$m->reference()}, $len, -$len, q{}; +- } +-}; +- +-skip($skip, ($@ || $e), q{}, 'Privacy failed'); +- +-# +-# 14. Check the HMAC +-# +- +-eval +-{ +- $h2 = unpack 'H*', $u->_auth_hmac($m); +-}; +- +-skip($skip, ($@ || $h2), $h, 'Authentication failed'); +- + # ============================================================================ +-- +2.45.1 + diff --git a/SOURCES/Net-SNMP-v6.0.1-Switch_from_Socket6_to_Socket.patch b/SOURCES/Net-SNMP-v6.0.1-Switch_from_Socket6_to_Socket.patch new file mode 100644 index 0000000..8ca6788 --- /dev/null +++ b/SOURCES/Net-SNMP-v6.0.1-Switch_from_Socket6_to_Socket.patch @@ -0,0 +1,220 @@ +diff -Naur A/Build.PL B/Build.PL +--- A/Build.PL ++++ B/Build.PL +@@ -33,6 +33,7 @@ Module::Build->new( + Exporter => 0, + IO::Socket => 0, + Math::BigInt => 0, ++ Socket => '2.000', + }, + recommends => { + Crypt::DES => '2.03', # SNMPv3 +@@ -40,7 +41,6 @@ Module::Build->new( + Digest::SHA1 => '1.02', # SNMPv3 + Digest::HMAC => '1.00', # SNMPv3 + Crypt::Rijndael => '1.02', # SNMPv3 - AES Cipher Algorithm +- Socket6 => '0.23', # UDP/IPv6 or TCP/IPv6 Transport Domain + }, + meta_merge => { + resources => { +diff -Naur A/META.yml B/META.yml +--- A/META.yml ++++ B/META.yml +@@ -3,14 +3,15 @@ abstract: 'Object oriented interface to SNMP' + author: + - 'David M. Town ' + build_requires: +- Test: 0 ++ Test: '0' + configure_requires: +- Module::Build: 0.36 +-generated_by: 'Module::Build version 0.3607' ++ Module::Build: '0.42' ++dynamic_config: 1 ++generated_by: 'Module::Build version 0.4234, CPAN::Meta::Converter version 2.150010' + license: perl + meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html +- version: 1.4 ++ version: '1.4' + name: Net-SNMP + provides: + Net::SNMP: +@@ -59,21 +60,22 @@ provides: + file: lib/Net/SNMP/Transport/IPv6/UDP.pm + version: v3.0.0 + recommends: +- Crypt::DES: 2.03 +- Crypt::Rijndael: 1.02 +- Digest::HMAC: 1.00 +- Digest::MD5: 2.11 +- Digest::SHA1: 1.02 +- Socket6: 0.23 ++ Crypt::DES: '2.03' ++ Crypt::Rijndael: '1.02' ++ Digest::HMAC: '1.00' ++ Digest::MD5: '2.11' ++ Digest::SHA1: '1.02' + requires: +- Carp: 0 +- Errno: 0 +- Exporter: 0 +- IO::Socket: 0 +- Math::BigInt: 0 +- perl: 5.006 ++ Carp: '0' ++ Errno: '0' ++ Exporter: '0' ++ IO::Socket: '0' ++ Math::BigInt: '0' ++ Socket: '2.000' ++ perl: '5.006' + resources: + CPANForum: http://www.cpanforum.com/dist/Net-SNMP + bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Net-SNMP + license: http://dev.perl.org/licenses/ + version: v6.0.1 ++x_serialization_backend: 'CPAN::Meta::YAML version 0.018' +diff -Naur A/Makefile.PL B/Makefile.PL +index 4678c32..a15243b 100644 +--- A/Makefile.PL ++++ B/Makefile.PL +@@ -42,6 +42,7 @@ WriteMakefile( + Digest::MD5 => '2.11', # SNMPv3 + Digest::SHA1 => '1.02', # SNMPv3 + Digest::HMAC => '1.00', # SNMPv3 ++ Socket => '2.000', + }, + dist => { + CI => 'ci -u -sRel -m\"Changes for $(VERSION)\"', +diff -Naur A/README B/README +--- A/README ++++ B/README +@@ -60,7 +60,7 @@ REQUIREMENTS + protocol, the non-core module Crypt::Rijndael is needed. + + To use UDP/IPv6 or TCP/IPv6 as a Transport Domain, the non-core +- module Socket6 is needed. ++ module Socket is needed. + + DOCUMENTATION + +diff -Naur A/lib/Net/SNMP.pm B/lib/Net/SNMP.pm +--- A/lib/Net/SNMP.pm ++++ B/lib/Net/SNMP.pm +@@ -3561,7 +3561,7 @@ non-core module F is needed. + =item * + + To use UDP/IPv6 or TCP/IPv6 as a Transport Domain, the non-core module +-F is needed. ++F is needed. + + =back + +diff -Naur A/lib/Net/SNMP/Transport/IPv6.pm B/lib/Net/SNMP/Transport/IPv6.pm +--- A/lib/Net/SNMP/Transport/IPv6.pm 2010-09-10 02:02:45.000000000 +0200 ++++ B/lib/Net/SNMP/Transport/IPv6.pm 2023-06-14 09:27:57.736399948 +0200 +@@ -19,9 +19,9 @@ + + use Net::SNMP::Transport qw( DEBUG_INFO ); + +-use Socket6 0.23 qw( +- PF_INET6 AF_INET6 in6addr_any in6addr_loopback getaddrinfo +- pack_sockaddr_in6_all unpack_sockaddr_in6_all inet_pton inet_ntop ++use Socket qw( ++ PF_INET6 AF_INET6 IN6ADDR_ANY IN6ADDR_LOOPBACK getaddrinfo ++ pack_sockaddr_in6 unpack_sockaddr_in6 inet_pton inet_ntop + ); + + ## Version of the Net::SNMP::Transport::IPv6 module +@@ -89,12 +89,12 @@ + + sub _addr_any + { +- return in6addr_any; ++ return IN6ADDR_ANY; + } + + sub _addr_loopback + { +- return in6addr_loopback; ++ return IN6ADDR_LOOPBACK; + } + + sub _hostname_resolve +@@ -117,23 +117,22 @@ + + # Resolve the address. + +- my @info = getaddrinfo(($_[1] = $host), q{}, PF_INET6); ++ my ($err, @addrs) = getaddrinfo(($_[1] = $host), q{}, {'family' => PF_INET6}); + +- if (@info >= 5) { ++ if (! $err) { + if ($host =~ s/(.*)%.*$/$1/) { #
% + $_[1] = $1; + } +- while (@info >= 5) { +- if ($info[0] == PF_INET6) { +- $nh->{flowinfo} = $this->_flowinfo($info[3]); +- $nh->{scope_id} ||= $this->_scope_id($info[3]); +- return $nh->{addr} = $this->_addr($info[3]); ++ while (my $addr = shift @addrs) { ++ if ($addr->{'family'} == PF_INET6) { ++ $nh->{flowinfo} = $this->_flowinfo($addr->{'addr'}); ++ $nh->{scope_id} ||= $this->_scope_id($addr->{'addr'}); ++ return $nh->{addr} = $this->_addr($addr->{'addr'}); + } +- DEBUG_INFO('family = %d, sin = %s', $info[0], unpack 'H*', $info[3]); +- splice @info, 0, 5; ++ DEBUG_INFO('family = %d, sin = %s', $addr->{'family'}, unpack 'H*', $addr->{'addr'}); + } + } else { +- DEBUG_INFO('getaddrinfo(): %s', $info[0]); ++ DEBUG_INFO('getaddrinfo(): %s', $err); + if ((my @host = split /:/, $host) == 2) { # : + $_[1] = sprintf '[%s]:%s', @host; + return $this->_hostname_resolve($_[1], $nh); +@@ -156,9 +155,9 @@ + + sub _name_pack + { +- return pack_sockaddr_in6_all( +- $_[1]->{port}, $_[1]->{flowinfo} || 0, +- $_[1]->{addr}, $_[1]->{scope_id} || 0 ++ return pack_sockaddr_in6( ++ $_[1]->{port}, $_[1]->{addr}, ++ $_[1]->{scope_id} || 0, $_[1]->{flowinfo} || 0 + ); + } + +@@ -169,12 +168,12 @@ + + sub _addr + { +- return (unpack_sockaddr_in6_all($_[1]))[2]; ++ return (unpack_sockaddr_in6($_[1]))[1]; + } + + sub _port + { +- return (unpack_sockaddr_in6_all($_[1]))[0]; ++ return (unpack_sockaddr_in6($_[1]))[0]; + } + + sub _taddress +@@ -193,12 +192,12 @@ + + sub _scope_id + { +- return (unpack_sockaddr_in6_all($_[1]))[3]; ++ return (unpack_sockaddr_in6($_[1]))[2]; + } + + sub _flowinfo + { +- return (unpack_sockaddr_in6_all($_[1]))[1]; ++ return (unpack_sockaddr_in6($_[1]))[3]; + } + + # ============================================================================ diff --git a/SPECS/perl-Net-SNMP.spec b/SPECS/perl-Net-SNMP.spec new file mode 100644 index 0000000..acb92b0 --- /dev/null +++ b/SPECS/perl-Net-SNMP.spec @@ -0,0 +1,287 @@ +Name: perl-Net-SNMP +Version: 6.0.1 +Release: 42%{?dist} +Summary: Object oriented interface to SNMP + +License: GPL-1.0-or-later OR Artistic-1.0-Perl +URL: https://metacpan.org/release/Net-SNMP +Source0: https://cpan.metacpan.org/authors/id/D/DT/DTOWN/Net-SNMP-v%{version}.tar.gz +Patch0: Net-SNMP-v6.0.1-Switch_from_Socket6_to_Socket.patch +Patch1: Net-SNMP-v6.0.1-Simple_rewrite_to_Digest-HMAC-helpers.patch +Patch2: Net-SNMP-v6.0.1-Split_usm.t_to_two_parts.patch +Patch3: Net-SNMP-v6.0.1-Add_tests_for_another_usm_scenarios.patch +Patch4: Net-SNMP-v6.0.1-Rewrite_from_Digest-SHA1-to-Digest-SHA.patch + +BuildArch: noarch +BuildRequires: coreutils +BuildRequires: findutils +BuildRequires: make +BuildRequires: perl-interpreter +BuildRequires: perl-generators +BuildRequires: perl(Config) +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 +BuildRequires: perl(strict) +BuildRequires: perl(warnings) +# Run-time: +BuildRequires: perl(base) +BuildRequires: perl(bytes) +# Carp not used at tests +# Crypt::DES 2.03 not used at tests +# Digest::HMAC_MD5 1.01 not used at tests +# Digest::HMAC_SHA1 1.03 not used at tests +# Digest::MD5 2.11 not used at tests +# Digest::SHA1 1.02 not used at tests +BuildRequires: perl(Errno) +BuildRequires: perl(Exporter) +BuildRequires: perl(IO::Socket) +BuildRequires: perl(Math::BigInt) +BuildRequires: perl(Socket) +# Optional run-time: +# Crypt::Rijndael 1.02 not used at tests +# Sys::Hostname not used at tests +# Tests: +BuildRequires: perl(Test) +Requires: perl(Carp) +Requires: perl(Crypt::DES) >= 2.03 +Requires: perl(Digest::HMAC_MD5) => 1.01 +Requires: perl(Digest::HMAC_SHA1) => 1.03 +Requires: perl(Digest::MD5) >= 2.11 +# Optional run-time: +# Crypt::Rijndael 1.02 + +# Filter under-specified dependencies +%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\((Crypt::DES|Digest::HMAC_MD5|Digest::HMAC_SHA1|Digest::MD5)\\)$ + +%description +The Net::SNMP module implements an object oriented interface to the +Simple Network Management Protocol. Perl applications can use the +module to retrieve or update information on a remote host using the +SNMP protocol. The module supports SNMP version-1, SNMP version-2c +(Community-Based SNMPv2), and SNMP version-3. The Net::SNMP module +assumes that the user has a basic understanding of the Simple Network +Management Protocol and related network management concepts. + + +%package tests +Summary: Tests for %{name} +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: perl-Test-Harness + + +%description tests +Tests from %{name}. Execute them +with "%{_libexecdir}/%{name}/test". + + +%prep +%setup -q -n Net-SNMP-v%{version} +%patch -P0 -p1 +%patch -P1 -p1 +%patch -P2 -p1 +%patch -P3 -p1 +%patch -P4 -p1 +perl -MConfig -pi -e 's|^#!.*perl|$Config{startperl}|' examples/*.pl + +chmod -c a-x examples/*.pl + +# Help generators to recognize Perl scripts +for F in t/*.t; do + perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!\s*perl}{$Config{startperl}}' "$F" + chmod +x "$F" +done + + +%build +perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 +%{make_build} + + +%install +%{make_install} +find $RPM_BUILD_ROOT -type d -depth -exec rmdir {} 2>/dev/null ';' +chmod -R u+w $RPM_BUILD_ROOT/* + +# Install tests +mkdir -p %{buildroot}%{_libexecdir}/%{name} +cp -a t %{buildroot}%{_libexecdir}/%{name} +cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF' +#!/bin/sh +cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)" +EOF +chmod +x %{buildroot}%{_libexecdir}/%{name}/test + + +%check +make test + + + +%files +%doc Changes README examples/ +%{_bindir}/* +%{perl_vendorlib}/Net/ +%{_mandir}/man1/*.1* +%{_mandir}/man3/*.3pm* + + +%files tests +%{_libexecdir}/%{name} + + +%changelog +* Tue Jun 27 2024 Michal Josef Špaček - 6.0.1-42 +- Add patch to add tests for other USM scenarios +- Add patch to rewrite from Digest::SHA1 to Digest::SHA +- Add patch to rewrite usage of HMAC with same dependencies +- Add patch to split test files for better readability +- Improve patch for switch from Socket6 to Socket +- Package tests +- Rename patch to better name with source dist version + +* Mon Jun 24 2024 Troy Dawson - 6.0.1-41 +- Bump release for June 2024 mass rebuild + +* Thu Jan 25 2024 Fedora Release Engineering - 6.0.1-40 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Jan 21 2024 Fedora Release Engineering - 6.0.1-39 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jul 21 2023 Fedora Release Engineering - 6.0.1-38 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Mon Jun 26 2023 Jitka Plesnikova - 6.0.1-37 +- Modernize spec +- Update license to SPDX format + +* Wed Jun 14 2023 Petr Salaba - 6.0.1-36 +- Switch from Socket6 to Socket + +* Fri Jan 20 2023 Fedora Release Engineering - 6.0.1-35 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Fri Jul 22 2022 Fedora Release Engineering - 6.0.1-34 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Mon May 30 2022 Jitka Plesnikova - 6.0.1-33 +- Perl 5.36 rebuild + +* Fri Jan 21 2022 Fedora Release Engineering - 6.0.1-32 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Jul 22 2021 Fedora Release Engineering - 6.0.1-31 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri May 21 2021 Jitka Plesnikova - 6.0.1-30 +- Perl 5.34 rebuild + +* Wed Jan 27 2021 Fedora Release Engineering - 6.0.1-29 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - 6.0.1-28 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon Jun 22 2020 Jitka Plesnikova - 6.0.1-27 +- Perl 5.32 rebuild + +* Thu Jan 30 2020 Fedora Release Engineering - 6.0.1-26 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Jul 26 2019 Fedora Release Engineering - 6.0.1-25 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu May 30 2019 Jitka Plesnikova - 6.0.1-24 +- Perl 5.30 rebuild + +* Fri Feb 01 2019 Fedora Release Engineering - 6.0.1-23 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jul 13 2018 Fedora Release Engineering - 6.0.1-22 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Thu Jun 28 2018 Jitka Plesnikova - 6.0.1-21 +- Perl 5.28 rebuild + +* Thu Feb 08 2018 Fedora Release Engineering - 6.0.1-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 6.0.1-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sun Jun 04 2017 Jitka Plesnikova - 6.0.1-18 +- Perl 5.26 rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 6.0.1-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Sat May 14 2016 Jitka Plesnikova - 6.0.1-16 +- Perl 5.24 rebuild + +* Thu Feb 04 2016 Fedora Release Engineering - 6.0.1-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Fri Jul 17 2015 Petr Pisar - 6.0.1-14 +- Specify all dependencies (bug #1243871) + +* Thu Jun 18 2015 Fedora Release Engineering - 6.0.1-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Thu Jun 04 2015 Jitka Plesnikova - 6.0.1-12 +- Perl 5.22 rebuild + +* Wed Aug 27 2014 Jitka Plesnikova - 6.0.1-11 +- Perl 5.20 rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 6.0.1-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sat Aug 03 2013 Fedora Release Engineering - 6.0.1-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Sun Jul 21 2013 Petr Pisar - 6.0.1-8 +- Perl 5.18 rebuild + +* Thu Feb 14 2013 Fedora Release Engineering - 6.0.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Fri Jul 20 2012 Fedora Release Engineering - 6.0.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Jun 12 2012 Petr Pisar - 6.0.1-5 +- Perl 5.16 rebuild + +* Fri Jan 13 2012 Fedora Release Engineering - 6.0.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon Jun 20 2011 Marcela Mašláňová - 6.0.1-3 +- Perl mass rebuild + +* Tue Feb 08 2011 Fedora Release Engineering - 6.0.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Wed Nov 17 2010 Tom "spot" Callaway - 6.0.1-1 +- update to 6.0.1, which removed all occurrences of the "locked" attribute, + deprecated in perl 5.12.0 +- okay to use Socket6 now. + +* Tue May 04 2010 Marcela Maslanova - 5.2.0-6 +- Mass rebuild with perl-5.12.0 + +* Mon Dec 7 2009 Stepan Kasal - 5.2.0-5 +- rebuild against perl 5.10.1 + +* Sun Jul 26 2009 Fedora Release Engineering - 5.2.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Thu Feb 26 2009 Fedora Release Engineering - 5.2.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Thu Mar 6 2008 Tom "spot" Callaway - 5.2.0-2 +- rebuild for new perl + +* Tue Oct 16 2007 Tom "spot" Callaway - 5.2.0-1.1 +- correct license tag +- add BR: perl(ExtUtils::MakeMaker) + +* Sat May 13 2006 Jose Pedro Oliveira - 5.2.0-1 +- First build.