summaryrefslogtreecommitdiff
path: root/src/common/crypto.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2003-09-25 05:17:11 +0000
committerNick Mathewson <nickm@torproject.org>2003-09-25 05:17:11 +0000
commit3d4ccb781ae5d74f0e16a63c89e08459d15cccf1 (patch)
tree3e9f214701c4a09bc45b453374bd6806f253a1a4 /src/common/crypto.h
parenta3bd8b5483bfb3813ba814c8d73840ca993e0298 (diff)
downloadtor-3d4ccb781ae5d74f0e16a63c89e08459d15cccf1.tar.gz
tor-3d4ccb781ae5d74f0e16a63c89e08459d15cccf1.zip
Refactor buffers; implement descriptors.
'buf_t' is now an opaque type defined in buffers.c . Router descriptors now include all keys; routers generate keys as needed on startup (in a newly defined "data directory"), and generate their own descriptors. Descriptors are now self-signed. Implementation is not complete: descriptors are never published; and upon receiving a descriptor, the directory doesn't do anything with it. At least "routers.or" and orkeygen are now obsolete, BTW. svn:r483
Diffstat (limited to 'src/common/crypto.h')
-rw-r--r--src/common/crypto.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/crypto.h b/src/common/crypto.h
index f723e71952..ccd48fa56a 100644
--- a/src/common/crypto.h
+++ b/src/common/crypto.h
@@ -42,7 +42,7 @@ int crypto_pk_read_public_key_from_string(crypto_pk_env_t *env, char *src, int l
int crypto_pk_write_private_key_to_file(crypto_pk_env_t *env, FILE *dest);
int crypto_pk_write_public_key_to_file(crypto_pk_env_t *env, FILE *dest);
int crypto_pk_check_key(crypto_pk_env_t *env);
-int crypto_pk_read_private_key_from_filename(crypto_pk_env_t *env, unsigned char *keyfile);
+int crypto_pk_read_private_key_from_filename(crypto_pk_env_t *env, const char *keyfile);
int crypto_pk_set_key(crypto_pk_env_t *env, unsigned char *key);
int crypto_pk_cmp_keys(crypto_pk_env_t *a, crypto_pk_env_t *b);
@@ -53,6 +53,8 @@ int crypto_pk_public_encrypt(crypto_pk_env_t *env, unsigned char *from, int from
int crypto_pk_private_decrypt(crypto_pk_env_t *env, unsigned char *from, int fromlen, unsigned char *to, int padding);
int crypto_pk_private_sign(crypto_pk_env_t *env, unsigned char *from, int fromlen, unsigned char *to);
int crypto_pk_public_checksig(crypto_pk_env_t *env, unsigned char *from, int fromlen, unsigned char *to);
+#define FINGERPRINT_LEN 49
+int crypto_pk_get_fingerprint(crypto_pk_env_t *pk, char *fp_out);
int base64_encode(char *dest, int destlen, char *src, int srclen);
int base64_decode(char *dest, int destlen, char *src, int srclen);