changeset 540:3e16925cf138 draft

peer2anonet: * security checks more specific
author d3v1150m471c <d3v11@d3v1150m471c.ano>
date Sun, 10 Jul 2011 08:29:56 -0500
parents 7b9a87c560ef
children f64ce05c68af
files contrib/peer2anonet/README contrib/peer2anonet/peer2anonet
diffstat 2 files changed, 17 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/peer2anonet/README	Sun Jul 10 08:14:52 2011 -0500
+++ b/contrib/peer2anonet/README	Sun Jul 10 08:29:56 2011 -0500
@@ -63,15 +63,15 @@
       without including the following '<-- comments'.
 
 ================== Not Actual Line on File ============================
-anon        <--your peer's alias
+anon          <--your peer's alias
 1.2.3.0       <--your new anonet network address
 1.2.3.1       <--your new anonet router address
 1.2.3.2       <--your new anonet ip
-1001          <--your new anonet client port
-1230          <--you new asn
 11.22.33.44   <--your peer's remote ip
 3.5.7.9       <--your peer's anonet ip
+1001          <--your new anonet client port
 3571          <--your peer's client port
+1230          <--you new asn
 3570          <--your peer's asn
 3c6e0b8a9c15224a8228b9a98ca1531d <--your peer's public key
 ================== Not Actual Line on File ============================ 
@@ -106,6 +106,7 @@
       Sun Jul 10 08:13:17 CDT 2011 - d3v1150m471c
       * security checks changed to check acceptable data and exits
         showing offending info for violating data detections.
+      * security checks more specific
 
 
 
--- a/contrib/peer2anonet/peer2anonet	Sun Jul 10 08:14:52 2011 -0500
+++ b/contrib/peer2anonet/peer2anonet	Sun Jul 10 08:29:56 2011 -0500
@@ -30,11 +30,11 @@
 read -p "Enter your new network address: " YOURNET
 read -p "Enter your new network router address: " YOURROUTE
 read -p "Enter your new network ip address: " YOURIP
-read -p "Enter your new local port: " YOURPORT
-read -p "Enter your new asn: " YOURASN
 read -p "Enter your peer remote ip: " REMOTEIP
 read -p "Enter your peer anonet ip: " PEERIP
+read -p "Enter your new local port: " YOURPORT
 read -p "Enter your peer remote port: " PEERPORT
+read -p "Enter your new asn: " YOURASN
 read -p "Enter your peer asn: " PEERASN
 read -p "Enter your peer's public key: " PUBKEY
 
@@ -50,7 +50,7 @@
  exit 1
 fi
      
-for((X=1;X<=8;X++)); do
+for((X=1;X<=5;X++)); do
 if [[ $(echo ${TEST[$X]} | tr -d '0-9.' | wc -c) -gt 1 ]]; then
  echo "peer2anonet: fatal error: unacceptable data: ${TEST[$X]}
 "
@@ -58,8 +58,16 @@
 fi
 done
 
-if [[ $(echo ${TEST[9]} | tr -d 'a-zA-Z0-9' | wc -c) -gt 1 ]]; then
- echo "peer2anonet: fatal error: unacceptable data: ${TEST[9]}
+for((X=6;X<=9;X++)); do
+if [[ $(echo ${TEST[$X]} | tr -d '0-9' | wc -c) -gt 1 ]]; then
+ echo "peer2anonet: fatal error: unacceptable data: ${TEST[$X]}
+"
+ exit 1
+fi
+done
+
+if [[ $(echo ${TEST[10]} | tr -d 'a-zA-Z0-9' | wc -c) -gt 1 ]]; then
+ echo "peer2anonet: fatal error: unacceptable data: ${TEST[11]}
 "
  exit 1
 fi