diff options
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/circuit.c | 2 | ||||
-rw-r--r-- | src/or/router.c | 4 | ||||
-rw-r--r-- | src/or/test.c | 14 |
3 files changed, 7 insertions, 13 deletions
diff --git a/src/or/circuit.c b/src/or/circuit.c index f2a94d8a1..731e54742 100644 --- a/src/or/circuit.c +++ b/src/or/circuit.c @@ -683,7 +683,7 @@ static int relay_crypt_one_payload(crypto_cipher_env_t *cipher, char *in, // log_fn(LOG_DEBUG,"before crypt: %d",rh.recognized); if(( encrypt_mode && crypto_cipher_encrypt(cipher, in, CELL_PAYLOAD_SIZE, out)) || (!encrypt_mode && crypto_cipher_decrypt(cipher, in, CELL_PAYLOAD_SIZE, out))) { - log_fn(LOG_WARN,"Error during crypt: %s", crypto_perror()); + log_fn(LOG_WARN,"Error during relay encryption"); return -1; } memcpy(in,out,CELL_PAYLOAD_SIZE); diff --git a/src/or/router.c b/src/or/router.c index 76bd3afb9..a1e0e4ce3 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -62,7 +62,7 @@ void rotate_onion_key(void) goto error; } if (crypto_pk_generate_key(prkey)) { - log(LOG_ERR, "Error generating key: %s", crypto_perror()); + log(LOG_ERR, "Error generating onion key"); goto error; } if (crypto_pk_write_private_key_to_filename(prkey, fname)) { @@ -104,7 +104,7 @@ crypto_pk_env_t *init_key_from_file(const char *fname) case FN_NOENT: log(LOG_INFO, "No key found in %s; generating fresh key.", fname); if (crypto_pk_generate_key(prkey)) { - log(LOG_ERR, "Error generating key: %s", crypto_perror()); + log(LOG_ERR, "Error generating onion key"); goto error; } if (crypto_pk_check_key(prkey) <= 0) { diff --git a/src/or/test.c b/src/or/test.c index c773e86a4..48e4a4f9a 100644 --- a/src/or/test.c +++ b/src/or/test.c @@ -242,7 +242,6 @@ test_crypto() crypto_cipher_env_t *env1, *env2; crypto_pk_env_t *pk1, *pk2; char *data1, *data2, *data3, *cp; - FILE *f; int i, j, p, len; data1 = tor_malloc(1024); @@ -376,16 +375,11 @@ test_crypto() PK_PKCS1_OAEP_PADDING)); /* File operations: save and load private key */ - f = fopen("/tmp/tor_test/pkey1", "wb"); - test_assert(! crypto_pk_write_private_key_to_file(pk1, f)); - fclose(f); - f = fopen("/tmp/tor_test/pkey1", "rb"); - test_assert(! crypto_pk_read_private_key_from_file(pk2, f)); - fclose(f); - test_eq(15, crypto_pk_private_decrypt(pk2, data1, 128, data3, - PK_PKCS1_OAEP_PADDING)); + test_assert(! crypto_pk_write_private_key_to_filename(pk1, + "/tmp/tor_test/pke1y")); + test_assert(! crypto_pk_read_private_key_from_filename(pk2, - "/tmp/tor_test/pkey1")); + "/tmp/tor_test/pke1y")); test_eq(15, crypto_pk_private_decrypt(pk2, data1, 128, data3, PK_PKCS1_OAEP_PADDING)); |