Permalink
Browse files

never default to a low port when generating a cjdroute.conf

  • Loading branch information...
1 parent 1339606 commit 992ecd0caaa07ad90507b5decce2d25ee6127d80 Caleb James DeLisle committed Jun 25, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 cjdroute.c
View
@@ -100,8 +100,11 @@ static int genconf()
uint8_t adminPassword[32];
randomBase32(adminPassword);
- uint16_t port;
- randombytes((uint8_t*) &port, 2);
+ uint16_t port = 0;
+ while (port <= 1024) {
+ randombytes((uint8_t*) &port, 2);
+ }
+
uint8_t publicKeyBase32[53];
uint8_t address[40];
uint8_t privateKeyHex[65];

0 comments on commit 992ecd0

Please sign in to comment.