summaryrefslogtreecommitdiff
path: root/src/common/crypto.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-12-07 10:44:04 -0500
committerNick Mathewson <nickm@torproject.org>2017-12-08 14:47:19 -0500
commit285632a61b4e4aeec07b26004396473e0d8f4a43 (patch)
treeec6b0363f3072ba5e5c13ac1fb7cb2fb3c44db50 /src/common/crypto.h
parent95531ddfbfb6cb30760523d91fd4dfc966d2f6a5 (diff)
downloadtor-285632a61b4e4aeec07b26004396473e0d8f4a43.tar.gz
tor-285632a61b4e4aeec07b26004396473e0d8f4a43.zip
Replace all FREE_AND_NULL* uses to take a type and a free function.
This commit was made mechanically by this perl script: \#!/usr/bin/perl -w -i -p next if /^#define FREE_AND_NULL/; s/\bFREE_AND_NULL\((\w+),/FREE_AND_NULL\(${1}_t, ${1}_free_,/; s/\bFREE_AND_NULL_UNMATCHED\(/FREE_AND_NULL\(/;
Diffstat (limited to 'src/common/crypto.h')
-rw-r--r--src/common/crypto.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/crypto.h b/src/common/crypto.h
index f1061467d5..30023bad9f 100644
--- a/src/common/crypto.h
+++ b/src/common/crypto.h
@@ -148,7 +148,7 @@ int crypto_global_cleanup(void);
/* environment setup */
MOCK_DECL(crypto_pk_t *,crypto_pk_new,(void));
void crypto_pk_free_(crypto_pk_t *env);
-#define crypto_pk_free(pk) FREE_AND_NULL(crypto_pk, (pk))
+#define crypto_pk_free(pk) FREE_AND_NULL(crypto_pk_t, crypto_pk_free_, (pk))
void crypto_set_tls_dh_prime(void);
crypto_cipher_t *crypto_cipher_new(const char *key);
@@ -158,7 +158,7 @@ crypto_cipher_t *crypto_cipher_new_with_iv_and_bits(const uint8_t *key,
const uint8_t *iv,
int bits);
void crypto_cipher_free_(crypto_cipher_t *env);
-#define crypto_cipher_free(c) FREE_AND_NULL(crypto_cipher, (c))
+#define crypto_cipher_free(c) FREE_AND_NULL(crypto_cipher_t, crypto_cipher_free_, (c))
/* public key crypto */
MOCK_DECL(int, crypto_pk_generate_key_with_bits,(crypto_pk_t *env, int bits));
@@ -262,7 +262,7 @@ crypto_digest_t *crypto_digest_new(void);
crypto_digest_t *crypto_digest256_new(digest_algorithm_t algorithm);
crypto_digest_t *crypto_digest512_new(digest_algorithm_t algorithm);
void crypto_digest_free_(crypto_digest_t *digest);
-#define crypto_digest_free(d) FREE_AND_NULL(crypto_digest, (d))
+#define crypto_digest_free(d) FREE_AND_NULL(crypto_digest_t, crypto_digest_free_, (d))
void crypto_digest_add_bytes(crypto_digest_t *digest, const char *data,
size_t len);
void crypto_digest_get_digest(crypto_digest_t *digest,
@@ -281,7 +281,7 @@ crypto_xof_t *crypto_xof_new(void);
void crypto_xof_add_bytes(crypto_xof_t *xof, const uint8_t *data, size_t len);
void crypto_xof_squeeze_bytes(crypto_xof_t *xof, uint8_t *out, size_t len);
void crypto_xof_free_(crypto_xof_t *xof);
-#define crypto_xof_free(xof) FREE_AND_NULL(crypto_xof, (xof))
+#define crypto_xof_free(xof) FREE_AND_NULL(crypto_xof_t, crypto_xof_free_, (xof))
/* Key negotiation */
#define DH_TYPE_CIRCUIT 1
@@ -297,7 +297,7 @@ ssize_t crypto_dh_compute_secret(int severity, crypto_dh_t *dh,
const char *pubkey, size_t pubkey_len,
char *secret_out, size_t secret_out_len);
void crypto_dh_free_(crypto_dh_t *dh);
-#define crypto_dh_free(dh) FREE_AND_NULL(crypto_dh, (dh))
+#define crypto_dh_free(dh) FREE_AND_NULL(crypto_dh_t, crypto_dh_free_, (dh))
int crypto_expand_key_material_TAP(const uint8_t *key_in,
size_t key_in_len,