diff options
author | d3v1150m471c <d3v11@d3v1150m471c.ano> | 2011-07-10 19:01:26 -0500 |
---|---|---|
committer | d3v1150m471c <d3v11@d3v1150m471c.ano> | 2011-07-10 19:01:26 -0500 |
commit | 73af7f181868260ccf5c36081170c9f400ae010b (patch) | |
tree | 8f40260394ca5854c2017cdc5f325e4b4f786378 /contrib/peer2anonet | |
parent | 98500003c867196358e7f860913c00b0081da5cc (diff) | |
download | resdb-73af7f181868260ccf5c36081170c9f400ae010b.tar.gz resdb-73af7f181868260ccf5c36081170c9f400ae010b.zip |
peer2anonet: made security enhancements for input data
Diffstat (limited to 'contrib/peer2anonet')
-rw-r--r-- | contrib/peer2anonet/README | 6 | ||||
-rw-r--r-- | contrib/peer2anonet/peer2anonet | 10 |
2 files changed, 13 insertions, 3 deletions
diff --git a/contrib/peer2anonet/README b/contrib/peer2anonet/README index 41decf8..e775a9e 100644 --- a/contrib/peer2anonet/README +++ b/contrib/peer2anonet/README @@ -74,7 +74,11 @@ anon <--your peer's alias 1230 <--you new asn 3570 <--your peer's asn 3c6e0b8a9c15224a8228b9a98ca1531d <--your peer's public key -================== Not Actual Line on File ============================ +================== Not Actual Line on File ============================ + + At your discretion, you may exclude the public key from the + bottom of an autoconfig file and post installation of your new + peer service, peer2anonet will prompt for it. CHANGES: diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index be56c8f..a4bdb93 100644 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -40,7 +40,7 @@ read -p "Enter your peer asn: " PEERASN # Do some security checks on variables: TEST[0]=$PEERNAME; TEST[1]=$YOURNET; TEST[2]=$YOURROUTE; TEST[3]=$YOURIP TEST[4]=$REMOTEIP; TEST[5]=$PEERIP; TEST[6]=$YOURPORT; TEST[7]=$PEERPORT - TEST[8]=$YOURASN; TEST[9]=$PEERASN; TEST[10]=$PUBKEY + TEST[8]=$YOURASN; TEST[9]=$PEERASN; for((X=0;X<=5;X++)); do if [[ $(echo ${TEST[$X]} | tr -d 'a-zA-Z0-9._-' | wc -c) -gt 1 ]]; then @@ -53,7 +53,7 @@ done 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:$X ${TEST[$X]} + echo "peer2anonet: fatal error: unacceptable data: ${TEST[$X]} " exit 1 fi @@ -159,7 +159,13 @@ ln -s /services/"$PEERNAME" /service/ echo "peer2anonet: New peering session configured " read -p "Enter your peer's public key: " PUBKEY +if [[ $(echo "$PUBKEY" | tr -d 'a-zA-Z0-9' | wc -c) -gt 1 ]]; then + echo "peer2anonet: fatal error: unacceptable data: $PUBKEY +" + exit 1 +fi echo "$PUBKEY" > /services/"$PEERNAME"/pubkey + exit 0 |