|
| 1 | +From 2d01f68d7895c8fb5138f06375795fcb69855a62 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Timothy Legge <timlegge@gmail.com> |
| 3 | +Date: Thu, 26 Feb 2026 20:12:13 -0400 |
| 4 | +Subject: [PATCH] Replace Data::Rand::Obscure with Crypt::SysRandom |
| 5 | + |
| 6 | +--- |
| 7 | + Build.PL | 2 +- |
| 8 | + Changes | 4 ++++ |
| 9 | + META.json | 2 +- |
| 10 | + META.yml | 2 +- |
| 11 | + lib/Net/NSCA/Client/InitialPacket.pm | 8 +++----- |
| 12 | + 5 files changed, 10 insertions(+), 8 deletions(-) |
| 13 | + |
| 14 | +diff --git a/Build.PL b/Build.PL |
| 15 | +index d27da65..c8549db 100644 |
| 16 | +--- a/Build.PL |
| 17 | ++++ b/Build.PL |
| 18 | +@@ -41,7 +41,7 @@ my $build = Module::Build->new( |
| 19 | + 'perl' => '5.008001', |
| 20 | + 'Const::Fast' => 0, |
| 21 | + 'Convert::Binary::C' => '0.74', |
| 22 | +- 'Data::Rand::Obscure' => '0.020', |
| 23 | ++ 'Crypt::SysRandom' => '0.007', |
| 24 | + 'Data::Validate::Domain' => '0.02', |
| 25 | + 'Digest::CRC' => 0, |
| 26 | + 'English' => 0, |
| 27 | +diff --git a/Changes b/Changes |
| 28 | +index 996d26b..d327ff4 100644 |
| 29 | +--- a/Changes |
| 30 | ++++ b/Changes |
| 31 | +@@ -1,5 +1,9 @@ |
| 32 | + Revision history for Perl 5 distribution Net-NSCA-Client |
| 33 | + |
| 34 | ++TBD |
| 35 | ++ [BUG FIXES] |
| 36 | ++ - Use Crypt::SysRandom instead of Data::Rand::Obscure |
| 37 | ++ |
| 38 | + 0.009002 2011-10-24 |
| 39 | + [BUG FIXES] |
| 40 | + - Changed the shebang for the send_nsca script so on install, it will be |
| 41 | +diff --git a/META.json b/META.json |
| 42 | +index ae0a0d0..c66dfe6 100644 |
| 43 | +--- a/META.json |
| 44 | ++++ b/META.json |
| 45 | +@@ -42,7 +42,7 @@ |
| 46 | + "requires" : { |
| 47 | + "Const::Fast" : 0, |
| 48 | + "Convert::Binary::C" : "0.74", |
| 49 | +- "Data::Rand::Obscure" : "0.020", |
| 50 | ++ "Crypt::SysRandom" : "0.007", |
| 51 | + "Data::Validate::Domain" : "0.02", |
| 52 | + "Digest::CRC" : 0, |
| 53 | + "English" : 0, |
| 54 | +diff --git a/META.yml b/META.yml |
| 55 | +index c5020d9..19a03aa 100644 |
| 56 | +--- a/META.yml |
| 57 | ++++ b/META.yml |
| 58 | +@@ -53,7 +53,7 @@ provides: |
| 59 | + requires: |
| 60 | + Const::Fast: 0 |
| 61 | + Convert::Binary::C: 0.74 |
| 62 | +- Data::Rand::Obscure: 0.020 |
| 63 | ++ Crypt::SysRandom: 0.007 |
| 64 | + Data::Validate::Domain: 0.02 |
| 65 | + Digest::CRC: 0 |
| 66 | + English: 0 |
| 67 | +diff --git a/lib/Net/NSCA/Client/InitialPacket.pm b/lib/Net/NSCA/Client/InitialPacket.pm |
| 68 | +index 589cf35..5181e41 100644 |
| 69 | +--- a/lib/Net/NSCA/Client/InitialPacket.pm |
| 70 | ++++ b/lib/Net/NSCA/Client/InitialPacket.pm |
| 71 | +@@ -20,7 +20,7 @@ use Net::NSCA::Client::Library 0.009 qw(Bytes); |
| 72 | + |
| 73 | + ############################################################################### |
| 74 | + # MODULES |
| 75 | +-use Data::Rand::Obscure 0.020; |
| 76 | ++use Crypt::SysRandom 'random_bytes'; |
| 77 | + use Net::NSCA::Client::ServerConfig (); |
| 78 | + use Net::NSCA::Client::Utils qw(initialize_moose_attr_early); |
| 79 | + |
| 80 | +@@ -116,9 +116,7 @@ sub to_string { |
| 81 | + sub _build_initialization_vector { |
| 82 | + my ($self) = @_; |
| 83 | + |
| 84 | +- return Data::Rand::Obscure::create_bin( |
| 85 | +- length => $self->server_config->initialization_vector_length, |
| 86 | +- ); |
| 87 | ++ return random_bytes($self->server_config->initialization_vector_length); |
| 88 | + } |
| 89 | + sub _build_raw_packet { |
| 90 | + my ($self) = @_; |
| 91 | +@@ -259,7 +257,7 @@ string representation is what will be sent over the network. |
| 92 | + |
| 93 | + =over |
| 94 | + |
| 95 | +-=item * L<Data::Rand::Obscure|Data::Rand::Obscure> 0.020 |
| 96 | ++=item * L<Crypt::SysRandom> 0.007 |
| 97 | + |
| 98 | + =item * L<Moose|Moose> 0.89 |
| 99 | + |
0 commit comments