Mercurial > hg > anonet-resdb
changeset 547:76d0f12e2125 draft
peer2anonet: made security enhancements for input data
author | d3v1150m471c <d3v11@d3v1150m471c.ano> |
---|---|
date | Sun, 10 Jul 2011 19:01:26 -0500 |
parents | b19b3e973065 |
children | dcedb70c723d |
files | contrib/peer2anonet/README contrib/peer2anonet/peer2anonet |
diffstat | 2 files changed, 13 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/peer2anonet/README Sun Jul 10 18:53:15 2011 -0500 +++ b/contrib/peer2anonet/README Sun Jul 10 19:01:26 2011 -0500 @@ -74,7 +74,11 @@ 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:
--- a/contrib/peer2anonet/peer2anonet Sun Jul 10 18:53:15 2011 -0500 +++ b/contrib/peer2anonet/peer2anonet Sun Jul 10 19:01:26 2011 -0500 @@ -40,7 +40,7 @@ # 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 @@ 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 @@ 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