[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r12300: A couple of small tweaks to karsten's latest patch, and note (in tor/trunk: . src/or)
Author: nickm
Date: 2007-10-31 16:48:08 -0400 (Wed, 31 Oct 2007)
New Revision: 12300
Modified:
tor/trunk/
tor/trunk/src/or/circuitlist.c
tor/trunk/src/or/config.c
tor/trunk/src/or/or.h
tor/trunk/src/or/rendservice.c
Log:
r16301@catbus: nickm | 2007-10-31 16:43:49 -0400
A couple of small tweaks to karsten's latest patch, and note an issue with using a bitmap to represent a single int.
Property changes on: tor/trunk
___________________________________________________________________
svk:merge ticket from /tor/trunk [r16301] on 8246c3cf-6607-4228-993b-4d95d33730f1
Modified: tor/trunk/src/or/circuitlist.c
===================================================================
--- tor/trunk/src/or/circuitlist.c 2007-10-31 20:48:06 UTC (rev 12299)
+++ tor/trunk/src/or/circuitlist.c 2007-10-31 20:48:08 UTC (rev 12300)
@@ -389,6 +389,8 @@
tor_free(ocirc->build_state);
circuit_free_cpath(ocirc->cpath);
+ if (ocirc->intro_key)
+ crypto_free_pk_env(ocirc->intro_key);
} else {
or_circuit_t *ocirc = TO_OR_CIRCUIT(circ);
Modified: tor/trunk/src/or/config.c
===================================================================
--- tor/trunk/src/or/config.c 2007-10-31 20:48:06 UTC (rev 12299)
+++ tor/trunk/src/or/config.c 2007-10-31 20:48:08 UTC (rev 12300)
@@ -192,6 +192,7 @@
VAR("HiddenServiceNodes", LINELIST_S, RendConfigLines, NULL),
VAR("HiddenServiceOptions",LINELIST_V, RendConfigLines, NULL),
VAR("HiddenServicePort", LINELIST_S, RendConfigLines, NULL),
+ /*DOCDOC in tor manpage*/
VAR("HiddenServiceVersion",LINELIST_S, RendConfigLines, NULL),
V(HSAuthoritativeDir, BOOL, "0"),
V(HSAuthorityRecordStats, BOOL, "0"),
Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h 2007-10-31 20:48:06 UTC (rev 12299)
+++ tor/trunk/src/or/or.h 2007-10-31 20:48:08 UTC (rev 12300)
@@ -1763,12 +1763,6 @@
*/
crypt_path_t *cpath;
- /** Stores the rendezvous descriptor version if purpose is S_* to
- * distinguish introduction and rendezvous points belonging to the same
- * rendezvous service ID, but different descriptor versions.
- */
- uint8_t rend_desc_version;
-
/** The rend_pk_digest field holds a hash of location-hidden service's
* PK if purpose is S_ESTABLISH_INTRO or S_RENDEZVOUSING.
*/
@@ -1786,6 +1780,14 @@
*/
char rend_query[REND_SERVICE_ID_LEN+1];
+ /** Stores the rendezvous descriptor version if purpose is S_*. Used to
+ * distinguish introduction and rendezvous points belonging to the same
+ * rendezvous service ID, but different descriptor versions.
+ * XXXX020 I believe this is a bitmap, but the doc doesn't say so. If so,
+ * why? A circuit can't be using two different rendezvous decriptors. -NM
+ */
+ uint8_t rend_desc_version;
+
/* The intro key replaces the hidden service's public key if purpose is
* S_ESTABLISH_INTRO or S_INTRO, provided that no unversioned rendezvous
* descriptor is used. */
Modified: tor/trunk/src/or/rendservice.c
===================================================================
--- tor/trunk/src/or/rendservice.c 2007-10-31 20:48:06 UTC (rev 12299)
+++ tor/trunk/src/or/rendservice.c 2007-10-31 20:48:08 UTC (rev 12300)
@@ -56,11 +56,14 @@
time_t intro_period_started;
int n_intro_circuits_launched; /**< count of intro circuits we have
* established in this period. */
+ /* DOCDOC undocumented versions */
rend_service_descriptor_t *desc;
time_t desc_is_dirty;
time_t next_upload_time;
+ /* XXXX020 A service never actually has both descriptor versions; perhaps
+ * this should be an int rather than in intmax. */
int descriptor_versions; /**< bitmask of rendezvous descriptor versions
- * that will be published. */
+ * that will be published. "0" means "default." */
} rend_service_t;
/** A list of rend_service_t's for services run on this OP.
@@ -454,9 +457,9 @@
return 0;
}
-/** Return the service whose public key has a digest of <b>digest</b>
- * and which publishes descriptors of the given <b>versions</b> bitmask.
- * Return NULL if no such service exists.
+/** Return the service whose public key has a digest of <b>digest</b> and
+ * which publishes exactly the descriptor of the given <b>versions</b>
+ * bitmask. Return NULL if no such service exists.
*/
static rend_service_t *
rend_service_get_by_pk_digest_and_version(const char* digest,
@@ -810,7 +813,8 @@
if (!(service->descriptor_versions & 1)) {
launched->intro_key = crypto_new_pk_env();
tor_assert(!crypto_pk_generate_key(launched->intro_key));
- strmap_set(service->intro_keys, nickname, launched->intro_key);
+ strmap_set(service->intro_keys, nickname,
+ crypto_pk_dup_key(launched->intro_key));
}
if (launched->_base.state == CIRCUIT_STATE_OPEN)
rend_service_intro_has_opened(launched);