aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-03-27 19:58:40 +0100
committerChristian Grothoff <christian@grothoff.org>2015-03-27 19:58:40 +0100
commiteae1896a4bfc02b5d7586f81bbedfea69b29acc8 (patch)
treec3927c09435b74fb547a37fe0c75d01dd7b7f234 /src/util
parent7730a083494c0d49705f87b32fc85dfa6ed6809a (diff)
major rename-fest for more constent symbol names
Diffstat (limited to 'src/util')
-rw-r--r--src/util/crypto.c52
-rw-r--r--src/util/json.c40
-rw-r--r--src/util/os_installation.c2
-rw-r--r--src/util/test_json_validations.c4
4 files changed, 49 insertions, 49 deletions
diff --git a/src/util/crypto.c b/src/util/crypto.c
index ffc12fed9..eca4e407a 100644
--- a/src/util/crypto.c
+++ b/src/util/crypto.c
@@ -40,7 +40,7 @@ fatal_error_handler (void *cls,
int wtf,
const char *msg)
{
- LOG_ERROR ("Fatal error in libgcrypt: %s\n",
+ TALER_LOG_ERROR ("Fatal error in libgcrypt: %s\n",
msg);
abort();
}
@@ -71,7 +71,7 @@ TALER_gcrypt_init ()
* @param[out] skey set to session key
*/
static void
-derive_refresh_key (const struct TALER_LinkSecret *secret,
+derive_refresh_key (const struct TALER_LinkSecretP *secret,
struct GNUNET_CRYPTO_SymmetricInitializationVector *iv,
struct GNUNET_CRYPTO_SymmetricSessionKey *skey)
{
@@ -81,12 +81,12 @@ derive_refresh_key (const struct TALER_LinkSecret *secret,
GNUNET_assert (GNUNET_YES ==
GNUNET_CRYPTO_kdf (skey, sizeof (struct GNUNET_CRYPTO_SymmetricSessionKey),
ctx_key, strlen (ctx_key),
- secret, sizeof (struct TALER_LinkSecret),
+ secret, sizeof (struct TALER_LinkSecretP),
NULL, 0));
GNUNET_assert (GNUNET_YES ==
GNUNET_CRYPTO_kdf (iv, sizeof (struct GNUNET_CRYPTO_SymmetricInitializationVector),
ctx_iv, strlen (ctx_iv),
- secret, sizeof (struct TALER_LinkSecret),
+ secret, sizeof (struct TALER_LinkSecretP),
NULL, 0));
}
@@ -100,7 +100,7 @@ derive_refresh_key (const struct TALER_LinkSecret *secret,
* @param[out] skey set to session key
*/
static void
-derive_transfer_key (const struct TALER_TransferSecret *secret,
+derive_transfer_key (const struct TALER_TransferSecretP *secret,
struct GNUNET_CRYPTO_SymmetricInitializationVector *iv,
struct GNUNET_CRYPTO_SymmetricSessionKey *skey)
{
@@ -110,12 +110,12 @@ derive_transfer_key (const struct TALER_TransferSecret *secret,
GNUNET_assert (GNUNET_YES ==
GNUNET_CRYPTO_kdf (skey, sizeof (struct GNUNET_CRYPTO_SymmetricSessionKey),
ctx_key, strlen (ctx_key),
- secret, sizeof (struct TALER_TransferSecret),
+ secret, sizeof (struct TALER_TransferSecretP),
NULL, 0));
GNUNET_assert (GNUNET_YES ==
GNUNET_CRYPTO_kdf (iv, sizeof (struct GNUNET_CRYPTO_SymmetricInitializationVector),
ctx_iv, strlen (ctx_iv),
- secret, sizeof (struct TALER_TransferSecret),
+ secret, sizeof (struct TALER_TransferSecretP),
NULL, 0));
}
@@ -130,18 +130,18 @@ derive_transfer_key (const struct TALER_TransferSecret *secret,
* @return #GNUNET_OK on success
*/
int
-TALER_transfer_decrypt (const struct TALER_EncryptedLinkSecret *secret_enc,
- const struct TALER_TransferSecret *trans_sec,
- struct TALER_LinkSecret *secret)
+TALER_transfer_decrypt (const struct TALER_EncryptedLinkSecretP *secret_enc,
+ const struct TALER_TransferSecretP *trans_sec,
+ struct TALER_LinkSecretP *secret)
{
struct GNUNET_CRYPTO_SymmetricInitializationVector iv;
struct GNUNET_CRYPTO_SymmetricSessionKey skey;
- GNUNET_assert (sizeof (struct TALER_EncryptedLinkSecret) ==
- sizeof (struct TALER_LinkSecret));
+ GNUNET_assert (sizeof (struct TALER_EncryptedLinkSecretP) ==
+ sizeof (struct TALER_LinkSecretP));
derive_transfer_key (trans_sec, &iv, &skey);
return GNUNET_CRYPTO_symmetric_decrypt (secret_enc,
- sizeof (struct TALER_LinkSecret),
+ sizeof (struct TALER_LinkSecretP),
&skey,
&iv,
secret);
@@ -158,18 +158,18 @@ TALER_transfer_decrypt (const struct TALER_EncryptedLinkSecret *secret_enc,
* @return #GNUNET_OK on success
*/
int
-TALER_transfer_encrypt (const struct TALER_LinkSecret *secret,
- const struct TALER_TransferSecret *trans_sec,
- struct TALER_EncryptedLinkSecret *secret_enc)
+TALER_transfer_encrypt (const struct TALER_LinkSecretP *secret,
+ const struct TALER_TransferSecretP *trans_sec,
+ struct TALER_EncryptedLinkSecretP *secret_enc)
{
struct GNUNET_CRYPTO_SymmetricInitializationVector iv;
struct GNUNET_CRYPTO_SymmetricSessionKey skey;
- GNUNET_assert (sizeof (struct TALER_EncryptedLinkSecret) ==
- sizeof (struct TALER_LinkSecret));
+ GNUNET_assert (sizeof (struct TALER_EncryptedLinkSecretP) ==
+ sizeof (struct TALER_LinkSecretP));
derive_transfer_key (trans_sec, &iv, &skey);
return GNUNET_CRYPTO_symmetric_encrypt (secret,
- sizeof (struct TALER_LinkSecret),
+ sizeof (struct TALER_LinkSecretP),
&skey,
&iv,
secret_enc);
@@ -183,11 +183,11 @@ TALER_transfer_encrypt (const struct TALER_LinkSecret *secret,
* @param secret shared secret to use for decryption
* @return NULL on error
*/
-struct TALER_RefreshLinkDecrypted *
+struct TALER_RefreshLinkDecryptedP *
TALER_refresh_decrypt (const struct TALER_RefreshLinkEncrypted *input,
- const struct TALER_LinkSecret *secret)
+ const struct TALER_LinkSecretP *secret)
{
- struct TALER_RefreshLinkDecrypted *ret;
+ struct TALER_RefreshLinkDecryptedP *ret;
struct GNUNET_CRYPTO_SymmetricInitializationVector iv;
struct GNUNET_CRYPTO_SymmetricSessionKey skey;
size_t buf_size = input->blinding_key_enc_size
@@ -203,10 +203,10 @@ TALER_refresh_decrypt (const struct TALER_RefreshLinkEncrypted *input,
&iv,
buf))
return NULL;
- ret = GNUNET_new (struct TALER_RefreshLinkDecrypted);
+ ret = GNUNET_new (struct TALER_RefreshLinkDecryptedP);
memcpy (&ret->coin_priv,
buf,
- sizeof (struct TALER_CoinSpendPrivateKey));
+ sizeof (union TALER_CoinSpendPrivateKeyP));
ret->blinding_key.rsa_blinding_key
= GNUNET_CRYPTO_rsa_blinding_key_decode (&buf[sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)],
input->blinding_key_enc_size);
@@ -227,8 +227,8 @@ TALER_refresh_decrypt (const struct TALER_RefreshLinkEncrypted *input,
* @return NULL on error (should never happen)
*/
struct TALER_RefreshLinkEncrypted *
-TALER_refresh_encrypt (const struct TALER_RefreshLinkDecrypted *input,
- const struct TALER_LinkSecret *secret)
+TALER_refresh_encrypt (const struct TALER_RefreshLinkDecryptedP *input,
+ const struct TALER_LinkSecretP *secret)
{
char *b_buf;
size_t b_buf_size;
diff --git a/src/util/json.c b/src/util/json.c
index 7390eb474..d3496c42c 100644
--- a/src/util/json.c
+++ b/src/util/json.c
@@ -36,7 +36,7 @@
*/
#define UNPACK_EXITIF(cond) \
do { \
- if (cond) { TALER_JSON_warn (error); goto EXITIF_exit; } \
+ if (cond) { TALER_json_warn (error); goto EXITIF_exit; } \
} while (0)
@@ -48,7 +48,7 @@
* @return a json object describing the amount
*/
json_t *
-TALER_JSON_from_amount (const struct TALER_Amount *amount)
+TALER_json_from_amount (const struct TALER_Amount *amount)
{
json_t *j;
@@ -79,7 +79,7 @@ TALER_JSON_from_amount (const struct TALER_Amount *amount)
* @return a json string with the timestamp in @a stamp
*/
json_t *
-TALER_JSON_from_abs (struct GNUNET_TIME_Absolute stamp)
+TALER_json_from_abs (struct GNUNET_TIME_Absolute stamp)
{
json_t *j;
char *mystr;
@@ -101,7 +101,7 @@ TALER_JSON_from_abs (struct GNUNET_TIME_Absolute stamp)
* @return the JSON reporesentation of the signature with purpose
*/
json_t *
-TALER_JSON_from_eddsa_sig (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
+TALER_json_from_eddsa_sig (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
const struct GNUNET_CRYPTO_EddsaSignature *signature)
{
json_t *root;
@@ -115,11 +115,11 @@ TALER_JSON_from_eddsa_sig (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpo
el = json_integer ((json_int_t) ntohl (purpose->purpose));
json_object_set_new (root, "purpose", el);
- el = TALER_JSON_from_data (purpose,
+ el = TALER_json_from_data (purpose,
ntohl (purpose->size));
json_object_set_new (root, "eddsa-val", el);
- el = TALER_JSON_from_data (signature,
+ el = TALER_json_from_data (signature,
sizeof (struct GNUNET_CRYPTO_EddsaSignature));
json_object_set_new (root, "eddsa-sig", el);
@@ -135,7 +135,7 @@ TALER_JSON_from_eddsa_sig (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpo
* @return the JSON reporesentation of the signature with purpose
*/
json_t *
-TALER_JSON_from_ecdsa_sig (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
+TALER_json_from_ecdsa_sig (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
const struct GNUNET_CRYPTO_EcdsaSignature *signature)
{
json_t *root;
@@ -149,11 +149,11 @@ TALER_JSON_from_ecdsa_sig (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpo
el = json_integer ((json_int_t) ntohl (purpose->purpose));
json_object_set_new (root, "purpose", el);
- el = TALER_JSON_from_data (purpose,
+ el = TALER_json_from_data (purpose,
ntohl (purpose->size));
json_object_set_new (root, "ecdsa-val", el);
- el = TALER_JSON_from_data (signature,
+ el = TALER_json_from_data (signature,
sizeof (struct GNUNET_CRYPTO_EddsaSignature));
json_object_set_new (root, "ecdsa-sig", el);
@@ -168,7 +168,7 @@ TALER_JSON_from_ecdsa_sig (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpo
* @return corresponding JSON encoding
*/
json_t *
-TALER_JSON_from_rsa_public_key (struct GNUNET_CRYPTO_rsa_PublicKey *pk)
+TALER_json_from_rsa_public_key (struct GNUNET_CRYPTO_rsa_PublicKey *pk)
{
char *buf;
size_t buf_len;
@@ -176,7 +176,7 @@ TALER_JSON_from_rsa_public_key (struct GNUNET_CRYPTO_rsa_PublicKey *pk)
buf_len = GNUNET_CRYPTO_rsa_public_key_encode (pk,
&buf);
- ret = TALER_JSON_from_data (buf,
+ ret = TALER_json_from_data (buf,
buf_len);
GNUNET_free (buf);
return ret;
@@ -190,7 +190,7 @@ TALER_JSON_from_rsa_public_key (struct GNUNET_CRYPTO_rsa_PublicKey *pk)
* @return corresponding JSON encoding
*/
json_t *
-TALER_JSON_from_rsa_signature (struct GNUNET_CRYPTO_rsa_Signature *sig)
+TALER_json_from_rsa_signature (struct GNUNET_CRYPTO_rsa_Signature *sig)
{
char *buf;
size_t buf_len;
@@ -198,7 +198,7 @@ TALER_JSON_from_rsa_signature (struct GNUNET_CRYPTO_rsa_Signature *sig)
buf_len = GNUNET_CRYPTO_rsa_signature_encode (sig,
&buf);
- ret = TALER_JSON_from_data (buf,
+ ret = TALER_json_from_data (buf,
buf_len);
GNUNET_free (buf);
return ret;
@@ -214,7 +214,7 @@ TALER_JSON_from_rsa_signature (struct GNUNET_CRYPTO_rsa_Signature *sig)
* @return json string that encodes @a data
*/
json_t *
-TALER_JSON_from_data (const void *data, size_t size)
+TALER_json_from_data (const void *data, size_t size)
{
char *buf;
json_t *json;
@@ -234,9 +234,9 @@ TALER_JSON_from_data (const void *data, size_t size)
* @return json string that encodes @a hc
*/
json_t *
-TALER_JSON_from_hash (const struct GNUNET_HashCode *hc)
+TALER_json_from_hash (const struct GNUNET_HashCode *hc)
{
- return TALER_JSON_from_data (hc, sizeof (struct GNUNET_HashCode));
+ return TALER_json_from_data (hc, sizeof (struct GNUNET_HashCode));
}
@@ -248,7 +248,7 @@ TALER_JSON_from_hash (const struct GNUNET_HashCode *hc)
* @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
*/
int
-TALER_JSON_to_amount (json_t *json,
+TALER_json_to_amount (json_t *json,
struct TALER_Amount *r_amount)
{
char *currency;
@@ -279,7 +279,7 @@ TALER_JSON_to_amount (json_t *json,
* @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
*/
int
-TALER_JSON_to_abs (json_t *json,
+TALER_json_to_abs (json_t *json,
struct GNUNET_TIME_Absolute *abs)
{
const char *str;
@@ -304,7 +304,7 @@ TALER_JSON_to_abs (json_t *json,
* @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
*/
int
-TALER_JSON_to_data (json_t *json,
+TALER_json_to_data (json_t *json,
void *out,
size_t out_size)
{
@@ -563,7 +563,7 @@ validate_iban (const char *iban)
* @return #GNUNET_YES if correctly formatted; #GNUNET_NO if not
*/
int
-TALER_JSON_validate_wireformat (const char *type,
+TALER_json_validate_wireformat (const char *type,
const json_t *wire)
{
json_error_t error;
diff --git a/src/util/os_installation.c b/src/util/os_installation.c
index 82dc49180..5abd64493 100644
--- a/src/util/os_installation.c
+++ b/src/util/os_installation.c
@@ -454,7 +454,7 @@ os_get_exec_path ()
* @return a pointer to the dir path (to be freed by the caller)
*/
char *
-TALER_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind)
+TALER_os_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind)
{
size_t n;
const char *dirname;
diff --git a/src/util/test_json_validations.c b/src/util/test_json_validations.c
index a5747c94a..26ec4b79f 100644
--- a/src/util/test_json_validations.c
+++ b/src/util/test_json_validations.c
@@ -44,10 +44,10 @@ int main(int argc, const char *const argv[])
wire = json_loads (json_wire_str, 0, &error);
if (NULL == wire)
{
- TALER_JSON_warn (error);
+ TALER_json_warn (error);
return 2;
}
- ret = TALER_JSON_validate_wireformat ("SEPA", wire);
+ ret = TALER_json_validate_wireformat ("SEPA", wire);
if (1 == ret)
return 0;
return 1;