summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-10-12 15:52:57 +0000
committerNick Mathewson <nickm@torproject.org>2004-10-12 15:52:57 +0000
commit43ef5a3e374cef58bb86cdf8b66e660046b01abc (patch)
treedcf22c3cbe47b6d4d925f01134bfd5f8eda3f7d5
parent0383afac9a3369fc8f16fe247dae2b909d1f2800 (diff)
downloadtor-43ef5a3e374cef58bb86cdf8b66e660046b01abc.tar.gz
tor-43ef5a3e374cef58bb86cdf8b66e660046b01abc.zip
Add long-term format for dir-signing-key fields (commented out)
svn:r2442
-rw-r--r--src/or/dirserv.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 39dc7bc89a..7b34d645a4 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -570,10 +570,19 @@ dirserv_dump_directory_to_string(char *s, unsigned int maxlen,
* everyone is running 0.0.9pre3 or later, we can shift to using a
* PEM-encoded key instead.
*/
+#if 1
if(crypto_pk_DER64_encode_public_key(private_key, &identity_pkey)<0) {
log_fn(LOG_WARN,"write identity_pkey to string failed!");
return -1;
}
+#else
+ { int l;
+ if(crypto_pk_write_public_key_to_string(private_key, &identity_pkey, &l)<0){
+ log_fn(LOG_WARN,"write identity_pkey to string failed!");
+ return -1;
+ }
+ }
+#endif
dirserv_remove_old_servers(ROUTER_MAX_AGE);
published_on = time(NULL);
format_iso_time(published, published_on);
@@ -774,11 +783,20 @@ static int generate_runningrouters(crypto_pk_env_t *private_key)
* everyone is running 0.0.9pre3 or later, we can shift to using a
* PEM-encoded key instead.
*/
+#if 1
if(crypto_pk_DER64_encode_public_key(private_key, &identity_pkey)<0) {
log_fn(LOG_WARN,"write identity_pkey to string failed!");
tor_free(cp);
return -1;
}
+#else
+ { int l;
+ if(crypto_pk_write_public_key_to_string(private_key, &identity_pkey, &l)<0){
+ log_fn(LOG_WARN,"write identity_pkey to string failed!");
+ return -1;
+ }
+ }
+#endif
published_on = time(NULL);
format_iso_time(published, published_on);
sprintf(s, "network-status\n"