From c93beedc46c0495a45c449fc66a7eb04630567f4 Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Tue, 16 Feb 2010 17:28:50 +0100 Subject: Work against the dreadful habit of concatenatingallmywords in identifiers. --- emergencyc.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'emergencyc.pl') diff --git a/emergencyc.pl b/emergencyc.pl index b8bebb6..296297f 100755 --- a/emergencyc.pl +++ b/emergencyc.pl @@ -10,8 +10,8 @@ # Options recognized: # -# -K specifies the key to use; or -k specifies a -# keyfile (the client will use the first line as key). +# -K specifies the key to use; or -k specifies a key +# file (the client will use the first line as key). # # -h and -p specifies the host and port to connect # to. @@ -39,10 +39,10 @@ my $key; if ( defined($opts{K}) ) { $key = $opts{K}; } elsif ( defined($opts{k}) ) { - open my $keyfile, "<", $opts{k} or die "Cannot open key file $opts{k}: $!"; - $key = <$keyfile>; + open my $key_file, "<", $opts{k} or die "Cannot open key file $opts{k}: $!"; + $key = <$key_file>; chomp $key; - close $keyfile; + close $key_file; } die "No key specified (use -K or -k option)" unless defined($key); @@ -65,8 +65,8 @@ sub curtime { my $command = $ARGV[0] // "PING"; my $timestamp = $opts{t} // curtime; my $validate = "$command|$timestamp"; -my $maccheck = hmac_sha256_hex($validate, $key); -send $socket, "$command|$timestamp|$maccheck", 0, $haddr; +my $mac_check = hmac_sha256_hex($validate, $key); +send $socket, "$command|$timestamp|$mac_check", 0, $haddr; my $buf; my $sender; -- cgit v1.2.3