Changeset 285a41
- Timestamp:
- 07/12/07 10:31:29 (6 years ago)
- Branches:
- master
- Children:
- f932e5
- Parents:
- 861da5
- git-author:
- Erik Ekman <yarrick@…> (07/12/07 10:31:29)
- git-committer:
- Erik Ekman <erik@…> (02/04/12 20:33:55)
- Files:
-
- 4 edited
-
CHANGELOG (modified) (1 diff)
-
src/iodine.c (modified) (5 diffs)
-
src/iodined.c (modified) (1 diff)
-
src/version.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
r60e00a r285a41 13 13 - Fixed bug denying access if relay uses varying source ports 14 14 - All received error messages (RCODE field) are echoed 15 - Top domain limited to 128 chars 16 - Case preservation check sent after login to decide codec 15 17 16 18 2007-03-25: 0.4.0 "Run Home" -
src/iodine.c
r861da5 r285a41 50 50 const char *topdomain, struct encoder *encoder); 51 51 52 int running = 1;53 char password[33];54 55 st ruct sockaddr_in peer;52 static int running = 1; 53 static char password[33]; 54 55 static struct sockaddr_in peer; 56 56 static char *topdomain; 57 57 58 uint16_t rand_seed;58 static uint16_t rand_seed; 59 59 60 60 /* Current IP packet */ 61 61 static struct packet packet; 62 63 /* My userid at the server */ 62 64 static char userid; 65 66 /* DNS id for next packet */ 63 67 static uint16_t chunkid; 64 68 65 69 /* Base32 encoder used for non-data packets */ 66 70 static struct encoder *b32; 71 67 72 /* The encoder used for data packets 68 73 * Defaults to Base32, can be changed after handshake */ 69 74 static struct encoder *dataenc; 75 76 /* result of case preservation check done after login */ 77 static int case_preserved; 70 78 71 79 static void … … 350 358 } 351 359 360 void 361 send_case_check(int fd) 362 { 363 char buf[512] = "zZaAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyY123-4560789."; 364 365 strcat(buf, topdomain); 366 send_query(fd, buf); 367 } 368 352 369 static int 353 370 handshake(int dns_fd) … … 387 404 if (read >= 9) { 388 405 payload = (((in[4] & 0xff) << 24) | 389 ((in[5] & 0xff) << 16) |390 ((in[6] & 0xff) << 8) |391 ((in[7] & 0xff)));406 ((in[5] & 0xff) << 16) | 407 ((in[6] & 0xff) << 8) | 408 ((in[7] & 0xff))); 392 409 393 410 if (strncmp("VACK", in, 4) == 0) { … … 447 464 if (tun_setip(client) == 0 && 448 465 tun_setmtu(mtu) == 0) { 449 return 0;466 goto perform_case_check; 450 467 } else { 451 468 warnx("Received handshake with bad data"); … … 459 476 printf("Retrying login...\n"); 460 477 } 461 462 return 1; 463 } 464 465 static void 478 errx(1, "couldn't login to server"); 479 /* NOTREACHED */ 480 481 perform_case_check: 482 case_preserved = 0; 483 for (i=0; running && i<5 ;i++) { 484 tv.tv_sec = i + 1; 485 tv.tv_usec = 0; 486 487 send_case_check(dns_fd); 488 489 FD_ZERO(&fds); 490 FD_SET(dns_fd, &fds); 491 492 r = select(dns_fd + 1, &fds, NULL, NULL, &tv); 493 494 if(r > 0) { 495 read = read_dns(dns_fd, in, sizeof(in)); 496 497 if(read <= 0) { 498 warn("read"); 499 continue; 500 } 501 502 if (read > 0) { 503 if (in[0] == 'z' || in[0] == 'Z') { 504 if (read < (26 * 2)) { 505 printf("Received short case reply...\n"); 506 } else { 507 int k; 508 509 case_preserved = 1; 510 for (k = 0; k < 26 && case_preserved; k += 2) { 511 if (in[k] == in[k+1]) { 512 /* test string: zZaAbBcCdD... */ 513 case_preserved = 0; 514 } 515 } 516 return 0; 517 } 518 } else { 519 printf("Received bad case check reply\n"); 520 } 521 } 522 } 523 524 printf("Retrying case check...\n"); 525 } 526 527 printf("No reply on case check, continuing\n"); 528 return 0; 529 } 530 531 static void 466 532 set_target(const char *host) 467 533 { -
src/iodined.c
r861da5 r285a41 237 237 users[userid].last_pkt = time(NULL); 238 238 } 239 } else if(in[0] == 'Z' || in[0] == 'z') { 240 /* Case conservation check */ 241 242 /* Reply with received hostname as data */ 243 write_dns(dns_fd, &(dummy.q), in, read); 244 return 0; 239 245 } else if((in[0] >= '0' && in[0] <= '9') 240 246 || (in[0] >= 'a' && in[0] <= 'f') -
src/version.h
rdbfecb r285a41 20 20 /* This is the version of the network protocol 21 21 It is usually equal to the latest iodine version number */ 22 #define VERSION 0x0000040 122 #define VERSION 0x00000402 23 23 24 24 #endif /* _VERSION_H_ */
Note: See TracChangeset
for help on using the changeset viewer.
