aboutsummaryrefslogtreecommitdiff
path: root/src/common/crypto.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-04-26 18:09:50 +0000
committerNick Mathewson <nickm@torproject.org>2004-04-26 18:09:50 +0000
commitf6dbe5a0d42dcf82d440ef24b7a879854c3da14f (patch)
tree94476491174ca63cc79c4d105b940def1ab9c8f4 /src/common/crypto.h
parentb410dff6c078022a7478ce2d17c07ccb38104081 (diff)
downloadtor-f6dbe5a0d42dcf82d440ef24b7a879854c3da14f.tar.gz
tor-f6dbe5a0d42dcf82d440ef24b7a879854c3da14f.zip
Refactor crypto error handling to be more like TLS error handling:
crypto_perror is a no-no, since an operation can set more than one error. Also, fix a bug in the unix crypto_seed_rng: mixing stdio with /dev/urandom is a bad idea, since fopen can make all kinds of weird extraneous syscalls (mmap, fcntl, stat64, etc.) and since fread tends to buffer data in big chunks, thus depleting the entropy pool. svn:r1717
Diffstat (limited to 'src/common/crypto.h')
-rw-r--r--src/common/crypto.h6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/common/crypto.h b/src/common/crypto.h
index f3bd0e6a8e..fd4c2d1a14 100644
--- a/src/common/crypto.h
+++ b/src/common/crypto.h
@@ -42,13 +42,9 @@ void crypto_free_cipher_env(crypto_cipher_env_t *env);
/* public key crypto */
int crypto_pk_generate_key(crypto_pk_env_t *env);
-int crypto_pk_read_private_key_from_file(crypto_pk_env_t *env, FILE *src);
-int crypto_pk_read_public_key_from_file(crypto_pk_env_t *env, FILE *src);
int crypto_pk_write_public_key_to_string(crypto_pk_env_t *env, char **dest, int *len);
int crypto_pk_read_public_key_from_string(crypto_pk_env_t *env, const char *src, int len);
-int crypto_pk_write_private_key_to_file(crypto_pk_env_t *env, FILE *dest);
int crypto_pk_write_private_key_to_filename(crypto_pk_env_t *env, const char *fname);
-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, const char *keyfile);
@@ -128,8 +124,6 @@ int crypto_rand(unsigned int n, unsigned char *to);
void crypto_pseudo_rand(unsigned int n, unsigned char *to);
int crypto_pseudo_rand_int(unsigned int max);
-/* errors */
-const char *crypto_perror();
#endif
/*