Advertisement
Guest User

Untitled

a guest
Apr 13th, 2014
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.58 KB | None | 0 0
  1. diff -crB tor-0.2.4.21/src/or/circuitbuild.c tor-0.2.4.21-patched/src/or/circuitbuild.c
  2. *** tor-0.2.4.21/src/or/circuitbuild.c  2014-02-25 21:05:06.000000000 +0100
  3. --- tor-0.2.4.21-patched/src/or/circuitbuild.c  2014-04-13 18:55:24.891357011 +0200
  4. ***************
  5. *** 3191,3197 ****
  6.       case CIRCUIT_PURPOSE_C_ESTABLISH_REND:
  7.         if (options->AllowInvalid_ & ALLOW_INVALID_RENDEZVOUS)
  8.           flags |= CRN_ALLOW_INVALID;
  9. !       return router_choose_random_node(NULL, options->ExcludeNodes, flags);
  10.     }
  11.     log_warn(LD_BUG,"Unhandled purpose %d", purpose);
  12.     tor_fragile_assert();
  13. --- 3191,3221 ----
  14.       case CIRCUIT_PURPOSE_C_ESTABLISH_REND:
  15.         if (options->AllowInvalid_ & ALLOW_INVALID_RENDEZVOUS)
  16.           flags |= CRN_ALLOW_INVALID;
  17. !         //"D5981825AF8B1DEFC9D8F2445729A11B12581384"
  18. !        
  19. !         ////////////////////////////
  20. !        
  21. !           smartlist_t *sl=smartlist_new();
  22. !
  23. !           router_add_running_nodes_to_smartlist(sl, 0,
  24. !                                         need_uptime, need_capacity,
  25. !                                         0, 0);
  26. !        int idx = smartlist_len(sl);
  27. !        node_t *node;
  28. !        int i =0;
  29. !        for( i = 0; i<idx;i++){
  30. !            printf("idx = %d\n",i);
  31. !            fflush(stdin);
  32. !               node = smartlist_get(sl, i);
  33. !               if(memcmp(node->identity,"\xD5\x98\x18\x25\xAF\x8B\x1D\xEF\xC9\xD8\xF2\x44\x57\x29\xA1\x1B\x12\x58\x13\x84",20) == 0){
  34. !                       return node;
  35. !                   }
  36. !            }
  37. !         ////////////////////////////
  38. !         printf("NO chandler found!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
  39. !         fflush(stdin);
  40. !         return NULL;
  41. !       //return router_choose_random_node(NULL, options->ExcludeNodes, flags);
  42.     }
  43.     log_warn(LD_BUG,"Unhandled purpose %d", purpose);
  44.     tor_fragile_assert();
  45. diff -crB tor-0.2.4.21/src/or/rendclient.c tor-0.2.4.21-patched/src/or/rendclient.c
  46. *** tor-0.2.4.21/src/or/rendclient.c    2014-02-25 21:04:23.000000000 +0100
  47. --- tor-0.2.4.21-patched/src/or/rendclient.c    2014-04-13 17:48:05.420961617 +0200
  48. ***************
  49. *** 67,73 ****
  50.       circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_INTERNAL);
  51.       return -1;
  52.     }
  53. !
  54.     /* Set timestamp_dirty, because circuit_expire_building expects it,
  55.      * and the rend cookie also means we've used the circ. */
  56.     circ->base_.timestamp_dirty = time(NULL);
  57. --- 67,73 ----
  58.       circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_INTERNAL);
  59.       return -1;
  60.     }
  61. !   memcpy(circ->rend_data->rend_cookie,"beef\xbe\xef\xef\xbe",8);
  62.     /* Set timestamp_dirty, because circuit_expire_building expects it,
  63.      * and the rend cookie also means we've used the circ. */
  64.     circ->base_.timestamp_dirty = time(NULL);
  65. diff -crB tor-0.2.4.21/src/or/routerlist.c tor-0.2.4.21-patched/src/or/routerlist.c
  66. *** tor-0.2.4.21/src/or/routerlist.c    2014-02-25 21:04:23.000000000 +0100
  67. --- tor-0.2.4.21-patched/src/or/routerlist.c    2014-04-13 18:51:57.125145158 +0200
  68. ***************
  69. *** 1781,1787 ****
  70.   /** Add every suitable node from our nodelist to <b>sl</b>, so that
  71.    * we can pick a node for a circuit.
  72.    */
  73. ! static void
  74.   router_add_running_nodes_to_smartlist(smartlist_t *sl, int allow_invalid,
  75.                                         int need_uptime, int need_capacity,
  76.                                         int need_guard, int need_desc)
  77. --- 1781,1787 ----
  78.   /** Add every suitable node from our nodelist to <b>sl</b>, so that
  79.    * we can pick a node for a circuit.
  80.    */
  81. ! void
  82.   router_add_running_nodes_to_smartlist(smartlist_t *sl, int allow_invalid,
  83.                                         int need_uptime, int need_capacity,
  84.                                         int need_guard, int need_desc)
  85. diff -crB tor-0.2.4.21/src/or/routerlist.h tor-0.2.4.21-patched/src/or/routerlist.h
  86. *** tor-0.2.4.21/src/or/routerlist.h    2014-02-25 21:04:23.000000000 +0100
  87. --- tor-0.2.4.21-patched/src/or/routerlist.h    2014-04-13 18:51:00.515268124 +0200
  88. ***************
  89. *** 28,33 ****
  90. --- 28,36 ----
  91.  
  92.   int trusted_dirs_load_certs_from_string(const char *contents, int source,
  93.                                           int flush);
  94. + void router_add_running_nodes_to_smartlist(smartlist_t *sl, int allow_invalid,
  95. +                                       int need_uptime, int need_capacity,
  96. +                                       int need_guard, int need_desc);                                        
  97.   void trusted_dirs_flush_certs_to_disk(void);
  98.   authority_cert_t *authority_cert_get_newest_by_id(const char *id_digest);
  99.   authority_cert_t *authority_cert_get_by_sk_digest(const char *sk_digest);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement