浏览代码

added perl-Net-SNMP module patch to support sha512 in AltLinux

Dmitriev Roman 4 月之前
父节点
当前提交
582e7d58a6

+ 3 - 11
docs/addons/dnsmasq.conf

@@ -1,11 +1,11 @@
 bogus-priv
 
-user=nobody
-group=nobody
+#user=nobody
+#group=nobody
 
 no-resolv
 
-port=0
+port=53
 
 log-facility=/var/log/dnsmasq.log
 log-dhcp
@@ -27,13 +27,6 @@ dhcp-option=6,192.168.1.100
 dhcp-option=option:domain-name,"lan"
 dhcp-option=119,"lan"
 
-#wins
-#dhcp-option=44,192.168.1.100
-#dhcp-option=46,8
-
-dhcp-range=office,192.168.1.10,192.168.1.200,255.255.255.0,4h
-dhcp-option=net:office,option:router,192.168.1.1
-
 dhcp-script=/opt/Eye/scripts/dnsmasq-hook.sh
 
 dhcp-lease-max=4000
@@ -44,4 +37,3 @@ dhcp-option=vendor:MSFT,2,1i
 
 #log option82 fields
 dhcp-match=set:full,option:agent-id,*
-

+ 3 - 3
docs/cron/stat

@@ -6,7 +6,7 @@
 #refresh dnsmasq dhcp server config's
 02 * * * * root /opt/Eye/scripts/update-dnsmasq
 
-#maybe any user
+#maybe user
 
 #garbage trash
 01 0 * * * eye /opt/Eye/scripts/garbage.pl
@@ -15,7 +15,7 @@
 #03 * * * * eye /opt/Eye/scripts/sync_mikrotik.pl
 
 #passive scan network => 2 * arp_timeout (default min: 2 * 5m)
-*/25 * * * * eye /opt/Eye/scripts/fetch_new_arp.pl
+*/11 * * * * eye /opt/Eye/scripts/fetch_new_arp.pl
 
 #active scan network (with fping subnets before analyze)
-20 10,13,19 * * * eye /opt/Eye/scripts/fetch_new_arp.pl 1
+20 10,13,16,19 * * * eye /opt/Eye/scripts/fetch_new_arp.pl 1

二进制
docs/legacy/mysql/2-6-3.tar.gz


二进制
docs/legacy/mysql/2-7-0.tar.gz


二进制
docs/legacy/mysql/2-7-1.tar.gz


二进制
docs/legacy/mysql/2-7-2.tar.gz


二进制
docs/legacy/mysql/2-7-3.tar.gz


二进制
docs/legacy/mysql/2-7-4.tar.gz


二进制
docs/legacy/mysql/2-7-5.tar.gz


二进制
docs/legacy/mysql/2-7-6.tar.gz


二进制
docs/legacy/mysql/2-7-7.tar.gz


二进制
docs/legacy/mysql/2-7-8.tar.gz


二进制
docs/legacy/mysql/2-7-9.tar.gz


二进制
docs/legacy/updates/2-6-3.tar.gz


二进制
docs/legacy/updates/2-7-0.tar.gz


二进制
docs/legacy/updates/2-7-1.tar.gz


二进制
docs/legacy/updates/2-7-2.tar.gz


二进制
docs/legacy/updates/2-7-3.tar.gz


二进制
docs/legacy/updates/2-7-4.tar.gz


二进制
docs/legacy/updates/2-7-5.tar.gz


二进制
docs/legacy/updates/2-7-6.tar.gz


二进制
docs/legacy/updates/2-7-7.tar.gz


二进制
docs/legacy/updates/2-7-8.tar.gz


二进制
docs/legacy/updates/2-7-9.tar.gz


+ 215 - 0
docs/patches/sha512.alt.patch

@@ -0,0 +1,215 @@
+--- USM.pm	2018-06-29 21:06:28.000000000 +0300
++++ USM.sha512.pm	2025-12-03 11:58:04.962638800 +0300
+@@ -25,8 +25,8 @@
+ 
+ use Crypt::DES();
+ use Digest::MD5();
+-use Digest::SHA1();
+-use Digest::HMAC();
++use Digest::SHA qw( hmac_sha1 hmac_sha224 hmac_sha256 hmac_sha384 hmac_sha512 );
++use Digest::HMAC_MD5 qw ( hmac_md5 );
+ 
+ ## Version of the Net::SNMP::Security::USM module
+ 
+@@ -40,7 +40,9 @@
+ 
+ our %EXPORT_TAGS = (
+    authprotos => [
+-      qw( AUTH_PROTOCOL_NONE AUTH_PROTOCOL_HMACMD5 AUTH_PROTOCOL_HMACSHA )
++      qw( AUTH_PROTOCOL_NONE AUTH_PROTOCOL_HMACMD5 AUTH_PROTOCOL_HMACSHA
++          AUTH_PROTOCOL_HMACSHA224 AUTH_PROTOCOL_HMACSHA256.
++          AUTH_PROTOCOL_HMACSHA384 AUTH_PROTOCOL_HMACSHA512 )
+    ],
+    levels     => [
+       qw( SECURITY_LEVEL_NOAUTHNOPRIV SECURITY_LEVEL_AUTHNOPRIV
+@@ -63,9 +65,13 @@
+ 
+ ## RCC 3414 - Authentication protocols
+ 
+-sub AUTH_PROTOCOL_NONE    { '1.3.6.1.6.3.10.1.1.1' } # usmNoAuthProtocol
+-sub AUTH_PROTOCOL_HMACMD5 { '1.3.6.1.6.3.10.1.1.2' } # usmHMACMD5AuthProtocol
+-sub AUTH_PROTOCOL_HMACSHA { '1.3.6.1.6.3.10.1.1.3' } # usmHMACSHAAuthProtocol
++sub AUTH_PROTOCOL_NONE       { '1.3.6.1.6.3.10.1.1.1' } # usmNoAuthProtocol
++sub AUTH_PROTOCOL_HMACMD5    { '1.3.6.1.6.3.10.1.1.2' } # usmHMACMD5AuthProtocol
++sub AUTH_PROTOCOL_HMACSHA    { '1.3.6.1.6.3.10.1.1.3' } # usmHMACSHAAuthProtocol
++sub AUTH_PROTOCOL_HMACSHA224 { '1.3.6.1.6.3.10.1.1.4' } # usmHMAC128SHA224AuthProtocol
++sub AUTH_PROTOCOL_HMACSHA256 { '1.3.6.1.6.3.10.1.1.5' } # usmHMAC192SHA256AuthProtocol
++sub AUTH_PROTOCOL_HMACSHA384 { '1.3.6.1.6.3.10.1.1.6' } # usmHMAC256SHA384AuthProtocol
++sub AUTH_PROTOCOL_HMACSHA512 { '1.3.6.1.6.3.10.1.1.7' } # usmHMAC384SHA512AuthProtocol
+ 
+ ## RFC 3414 - Privacy protocols
+ 
+@@ -124,6 +130,7 @@
+       '_time_epoc'          => time(),                # snmpEngineBoots epoc
+       '_user_name'          => q{},                   # securityName 
+       '_auth_data'          => undef,                 # Authentication data
++      '_auth_maclen'        => undef,                 # MAC length
+       '_auth_key'           => undef,                 # authKey 
+       '_auth_password'      => undef,                 # Authentication password 
+       '_auth_protocol'      => AUTH_PROTOCOL_HMACMD5, # authProtocol
+@@ -280,10 +287,10 @@
+    if ($pdu->security_level() > SECURITY_LEVEL_NOAUTHNOPRIV) {
+ 
+       # Save the location to fill in msgAuthenticationParameters later
+-      $auth_location = $msg->length() + 12 + length $pdu_buffer;
++      $auth_location = $msg->length() + $this->{_auth_maclen} + length $pdu_buffer;
+ 
+       # Set the msgAuthenticationParameters to all zeros
+-      $auth_params = pack 'x12';
++      $auth_params = pack "x$this->{_auth_maclen}";
+    }
+ 
+    if (!defined $msg->prepare(OCTET_STRING, $auth_params)) {
+@@ -418,12 +425,12 @@
+    # to compute the HMAC properly.
+ 
+    if (my $len = length $auth_params) {
+-      if ($len != 12) {
++      if ($len != $this->{_auth_maclen}) {
+          return $this->_error(
+             'The msgAuthenticationParameters length of %d is invalid', $len
+          );
+       }
+-      substr ${$msg->reference}, ($msg->index() - 12), 12, pack 'x12';
++         substr ${$msg->reference}, ($msg->index() - $this->{_auth_maclen}), $this->{_auth_maclen}, pack "x$this->{_auth_maclen}";
+    }
+ 
+    # msgPrivacyParameters::=OCTET STRING
+@@ -747,6 +754,18 @@
+       quotemeta AUTH_PROTOCOL_HMACMD5,   AUTH_PROTOCOL_HMACMD5,
+       '(?:hmac-)?sha(?:-?1|-96)?',       AUTH_PROTOCOL_HMACSHA,
+       quotemeta AUTH_PROTOCOL_HMACSHA,   AUTH_PROTOCOL_HMACSHA,
++      '(?:hmac-)?sha(?:-?224)',          AUTH_PROTOCOL_HMACSHA224,
++      'usmHMAC128SHA224AuthProtocol',    AUTH_PROTOCOL_HMACSHA224,
++      quotemeta AUTH_PROTOCOL_HMACSHA224,AUTH_PROTOCOL_HMACSHA224,
++      '(?:hmac-)?sha(?:-?256)',          AUTH_PROTOCOL_HMACSHA256,
++      'usmHMAC192SHA256AuthProtocol',    AUTH_PROTOCOL_HMACSHA256,
++      quotemeta AUTH_PROTOCOL_HMACSHA256,AUTH_PROTOCOL_HMACSHA256,
++      '(?:hmac-)?sha(?:-?384)',          AUTH_PROTOCOL_HMACSHA384,
++      'usmHMAC256SHA384AuthProtocol',    AUTH_PROTOCOL_HMACSHA384,
++      quotemeta AUTH_PROTOCOL_HMACSHA384,AUTH_PROTOCOL_HMACSHA384,
++      '(?:hmac-)?sha(?:-?512)',          AUTH_PROTOCOL_HMACSHA512,
++      'usmHMAC384SHA512AuthProtocol',    AUTH_PROTOCOL_HMACSHA512,
++      quotemeta AUTH_PROTOCOL_HMACSHA512,AUTH_PROTOCOL_HMACSHA512,
+    };
+ 
+    sub _auth_protocol
+@@ -1099,8 +1118,7 @@
+    }
+ 
+    # Set the msgAuthenticationParameters
+-   substr ${$msg->reference}, -$auth_location, 12, $this->_auth_hmac($msg);
+-
++   substr ${$msg->reference}, -$auth_location, $this->{_auth_maclen}, $this->_auth_hmac($msg);
+    return TRUE;
+ }
+ 
+@@ -1125,7 +1143,7 @@
+    return q{} if (!defined($this->{_auth_data}) || !defined $msg);
+ 
+    return substr
+-      $this->{_auth_data}->reset()->add(${$msg->reference()})->digest(), 0, 12;
++      $this->{_auth_data}(${$msg->reference()}, $this->{_auth_key}), 0, $this->{_auth_maclen};
+ }
+ 
+ sub _auth_data_init
+@@ -1140,13 +1158,33 @@
+ 
+    if ($this->{_auth_protocol} eq AUTH_PROTOCOL_HMACMD5) {
+ 
+-      $this->{_auth_data} =
+-         Digest::HMAC->new($this->{_auth_key}, 'Digest::MD5');
++      $this->{_auth_data} = \&hmac_md5;
++      $this->{_auth_maclen} = 12;
+ 
+    } elsif ($this->{_auth_protocol} eq AUTH_PROTOCOL_HMACSHA) {
+ 
+-      $this->{_auth_data} =
+-         Digest::HMAC->new($this->{_auth_key}, 'Digest::SHA1');
++      $this->{_auth_data} = \&hmac_sha1;
++      $this->{_auth_maclen} = 12;
++
++   } elsif ($this->{_auth_protocol} eq AUTH_PROTOCOL_HMACSHA224) {
++
++      $this->{_auth_data} = \&hmac_sha224;
++      $this->{_auth_maclen} = 16;
++
++   } elsif ($this->{_auth_protocol} eq AUTH_PROTOCOL_HMACSHA256) {
++
++      $this->{_auth_data} = \&hmac_sha256;
++      $this->{_auth_maclen} = 24;
++
++   } elsif ($this->{_auth_protocol} eq AUTH_PROTOCOL_HMACSHA384) {
++
++      $this->{_auth_data} = \&hmac_sha384;
++      $this->{_auth_maclen} = 32;
++
++   } elsif ($this->{_auth_protocol} eq AUTH_PROTOCOL_HMACSHA512) {
++
++      $this->{_auth_data} = \&hmac_sha512;
++      $this->{_auth_maclen} = 48;
+ 
+    } else {
+ 
+@@ -1391,7 +1429,7 @@
+    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;
+@@ -1626,7 +1664,11 @@
+    my $key_len =
+    {
+       AUTH_PROTOCOL_HMACMD5,    [ 16, 'HMAC-MD5'  ],
+-      AUTH_PROTOCOL_HMACSHA,    [ 20, 'HMAC-SHA1' ],
++      AUTH_PROTOCOL_HMACSHA,    [ 20, 'HMAC-SHA' ],
++      AUTH_PROTOCOL_HMACSHA224, [ 28, 'HMAC-SHA224' ],
++      AUTH_PROTOCOL_HMACSHA256, [ 32, 'HMAC-SHA256' ],
++      AUTH_PROTOCOL_HMACSHA384, [ 48, 'HMAC-SHA384' ],
++      AUTH_PROTOCOL_HMACSHA512, [ 64, 'HMAC-SHA512' ],
+    };
+ 
+    if (!exists $key_len->{$this->{_auth_protocol}}) {
+@@ -1681,7 +1723,7 @@
+       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}
+@@ -1782,9 +1824,13 @@
+ 
+    my $digests =
+    {
+-      AUTH_PROTOCOL_HMACMD5,  'Digest::MD5',
+-      AUTH_PROTOCOL_HMACSHA,  'Digest::SHA1',
+-   };
++      AUTH_PROTOCOL_HMACMD5,    ['Digest::MD5', ],
++      AUTH_PROTOCOL_HMACSHA,    ['Digest::SHA', 1],
++      AUTH_PROTOCOL_HMACSHA224, ['Digest::SHA', 224],
++      AUTH_PROTOCOL_HMACSHA256, ['Digest::SHA', 256],
++      AUTH_PROTOCOL_HMACSHA384, ['Digest::SHA', 384],
++      AUTH_PROTOCOL_HMACSHA512, ['Digest::SHA', 512],
++  };
+ 
+    if (!exists $digests->{$this->{_auth_protocol}}) {
+       return $this->_error(
+@@ -1792,7 +1838,12 @@
+       );
+    }
+ 
+-   my $digest = $digests->{$this->{_auth_protocol}}->new;
++   my $digest;
++   if (!defined($digests->{$this->{_auth_protocol}}[1])) {
++       $digest = $digests->{$this->{_auth_protocol}}[0]->new;
++       } else {
++       $digest = $digests->{$this->{_auth_protocol}}[0]->new($digests->{$this->{_auth_protocol}}[1]);
++       }
+ 
+    # Create the initial digest using the password
+