[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] branch master updated: Fixed compiler warnings
From: |
gnunet |
Subject: |
[taler-anastasis] branch master updated: Fixed compiler warnings |
Date: |
Mon, 11 May 2020 19:09:17 +0200 |
This is an automated email from the git hooks/post-receive script.
dennis-neufeld pushed a commit to branch master
in repository anastasis.
The following commit(s) were added to refs/heads/master by this push:
new 887abc9 Fixed compiler warnings
887abc9 is described below
commit 887abc9cf1d6332b6d537d003337e71578898e20
Author: Dennis Neufeld <address@hidden>
AuthorDate: Mon May 11 14:22:17 2020 +0000
Fixed compiler warnings
---
src/include/anastasis.h | 8 +-
src/include/anastasis_crypto_lib.h | 2 +-
src/lib/anastasis.c | 138 +++++++++++++++--------------------
src/lib/testing_cmd_policy_create.c | 6 +-
src/lib/testing_cmd_recover_secret.c | 44 +++++------
src/lib/testing_cmd_secret_share.c | 22 +++---
src/util/anastasis_crypto.c | 14 ++--
7 files changed, 107 insertions(+), 127 deletions(-)
diff --git a/src/include/anastasis.h b/src/include/anastasis.h
index 7ebb98d..7824c0a 100644
--- a/src/include/anastasis.h
+++ b/src/include/anastasis.h
@@ -58,7 +58,7 @@ struct ANASTASIS_RecoveryInformation
unsigned int dps_len;
- struct ANASTASIS_Challenge **cs;
+ const struct ANASTASIS_Challenge **cs;
unsigned int cs_len;
@@ -325,7 +325,7 @@ struct ANASTASIS_Policy;
* @param truths_len amount of truths in this policy
*/
struct ANASTASIS_Policy *
-ANASTASIS_policy_create (struct ANASTASIS_Truth *truths[],
+ANASTASIS_policy_create (const struct ANASTASIS_Truth *truths[],
unsigned int truths_len);
/**
@@ -344,8 +344,8 @@ ANASTASIS_policy_destroy (struct ANASTASIS_Policy *p);
*/
typedef void
(*ANASTASIS_ShareResultCallback)(void *cls,
- struct GNUNET_HashCode *current_etag[],
- enum TALER_ErrorCode *ec[]);
+ const struct GNUNET_HashCode current_etags[],
+ const enum TALER_ErrorCode ecs[]);
/**
* Callback for a payment process for uploading a policy
*
diff --git a/src/include/anastasis_crypto_lib.h
b/src/include/anastasis_crypto_lib.h
index 6fe6490..9906402 100644
--- a/src/include/anastasis_crypto_lib.h
+++ b/src/include/anastasis_crypto_lib.h
@@ -192,7 +192,7 @@ ANASTASIS_CRYPTO_account_public_key_derive (
void
ANASTASIS_CRYPTO_account_private_key_derive (
const struct ANASTASIS_CRYPTO_UserIdentifierP *id,
- struct GNUNET_CRYPTO_EddsaPrivateKey *priv_key);
+ struct ANASTASIS_CRYPTO_AccountPrivateKeyP *priv_key);
/**
* Encrypt and signs the recovery document with AES256, the recovery document
is
diff --git a/src/lib/anastasis.c b/src/lib/anastasis.c
index 2a6f823..69a81cc 100644
--- a/src/lib/anastasis.c
+++ b/src/lib/anastasis.c
@@ -528,7 +528,7 @@ policy_lookup_cb (void *cls,
r->dps = GNUNET_new_array (ri->dps_len, struct ANASTASIS_DecryptionPolicy);
r->solved_challenges = GNUNET_new_array (ri->cs_len, struct
ANASTASIS_Challenge);
- struct ANASTASIS_Challenge cs[ri->cs_len];
+ struct ANASTASIS_Challenge *cs[ri->cs_len];
for (unsigned int i = 0; i < ri->cs_len; i++)
{
@@ -539,12 +539,12 @@ policy_lookup_cb (void *cls,
" s:o," /* truth key */
" s:o," /* truth salt */
" s:s}", /* escrow method */
- "uuid", cs[i].challenge_uuid,
- "url", cs[i].url,
- "truth_key",cs[i].truth_key,
- "salt",cs[i].truth_salt,
- "escrow_method", cs[i].escrow_method));
- cs[i].recovery = r;
+ "uuid", cs[i]->challenge_uuid,
+ "url", cs[i]->url,
+ "truth_key",cs[i]->truth_key,
+ "salt",cs[i]->truth_salt,
+ "escrow_method", cs[i]->escrow_method));
+ cs[i]->recovery = r;
}
for (unsigned int j = 0; j < ri->dps_len; j++ )
@@ -561,7 +561,7 @@ policy_lookup_cb (void *cls,
r->solved_challenge_pos = 0;
// SETUP POLICY CALLBACK
ri->dps = r->dps;
- ri->cs = &cs;
+ ri->cs = cs;
if (NULL != r->pc)
{
r->pc (r->pc_cls,
@@ -629,6 +629,7 @@ ANASTASIS_recovery_begin (struct GNUNET_CURL_Context *ctx,
&policy_lookup_cb,
r);
}
+
return r;
}
@@ -685,12 +686,12 @@ struct ANASTASIS_Truth
/**
* keyshare of this truth, used to generate policy keys
*/
- const struct ANASTASIS_CRYPTO_KeyShareP *key_share;
+ struct ANASTASIS_CRYPTO_KeyShareP key_share;
/**
* key used to encrypt this truth
*/
- const struct ANASTASIS_CRYPTO_TruthKeyP *truth_key;
+ struct ANASTASIS_CRYPTO_TruthKeyP truth_key;
/**
* server salt used to derive user identifier
@@ -859,7 +860,7 @@ ANASTASIS_truth_upload (struct GNUNET_CURL_Context *ctx,
// FIXME Challenge
struct ANASTASIS_TruthUpload *tu;
struct ANASTASIS_Truth *t;
- struct SaltState *ss;
+ // struct SaltState *ss; FIXME unused
struct ANASTASIS_CRYPTO_EncryptedKeyShareP *encrypted_key_share;
void *encrypted_truth;
size_t encrypted_truth_size;
@@ -867,8 +868,6 @@ ANASTASIS_truth_upload (struct GNUNET_CURL_Context *ctx,
tu = GNUNET_new (struct ANASTASIS_TruthUpload);
t = GNUNET_new (struct ANASTASIS_Truth);
- t->key_share = GNUNET_new (struct ANASTASIS_CRYPTO_KeyShareP);
- t->truth_key = GNUNET_new (struct ANASTASIS_CRYPTO_TruthKeyP);
tu->tc_cls = tc_cls;
tu->tpc_cls = tpc_cls;
tu->tpc = tpc;
@@ -892,11 +891,11 @@ ANASTASIS_truth_upload (struct GNUNET_CURL_Context *ctx,
"At %s:%d server salt is %s-%llu b\n", __FILE__, __LINE__,
TALER_B2S (salt),
(unsigned long long) sizeof (*salt));
- ANASTASIS_CRYPTO_keyshare_create (t->key_share);
+ ANASTASIS_CRYPTO_keyshare_create (&t->key_share);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"At %s:%d keyshare is %s-%llu b\n", __FILE__, __LINE__,
- TALER_B2S (t->key_share),
- (unsigned long long) sizeof (*t->key_share));
+ TALER_B2S (&t->key_share),
+ (unsigned long long) sizeof (t->key_share));
ANASTASIS_CRYPTO_user_identifier_derive (id_data,
salt,
&tu->id);
@@ -904,7 +903,7 @@ ANASTASIS_truth_upload (struct GNUNET_CURL_Context *ctx,
"At %s:%d user identifier is %s-%llu b\n", __FILE__, __LINE__,
TALER_B2S (&tu->id),
(unsigned long long) sizeof (tu->id));
- ANASTASIS_CRYPTO_keyshare_encrypt (t->key_share,
+ ANASTASIS_CRYPTO_keyshare_encrypt (&t->key_share,
&tu->id,
&encrypted_key_share);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -913,13 +912,13 @@ ANASTASIS_truth_upload (struct GNUNET_CURL_Context *ctx,
(unsigned long long) sizeof (*encrypted_key_share));
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_STRONG,
- t->truth_key,
+ &t->truth_key,
sizeof (struct ANASTASIS_CRYPTO_TruthKeyP));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"At %s:%d truth key is %s-%llu b\n", __FILE__, __LINE__,
- TALER_B2S (t->truth_key),
- (unsigned long long) sizeof (*t->truth_key));
- ANASTASIS_CRYPTO_truth_encrypt (t->truth_key,
+ TALER_B2S (&t->truth_key),
+ (unsigned long long) sizeof (t->truth_key));
+ ANASTASIS_CRYPTO_truth_encrypt (&t->truth_key,
truth_data,
truth_data_size,
&encrypted_truth,
@@ -1016,7 +1015,7 @@ struct ANASTASIS_Policy
/**
* array of truths
*/
- struct ANASTASIS_Truth **truths;
+ const struct ANASTASIS_Truth **truths;
};
/**
@@ -1026,11 +1025,11 @@ struct ANASTASIS_Policy
* @param truths_len amount of truths in this policy
*/
struct ANASTASIS_Policy *
-ANASTASIS_policy_create (struct ANASTASIS_Truth *truths[],
+ANASTASIS_policy_create (const struct ANASTASIS_Truth *truths[],
unsigned int truths_len)
{
struct ANASTASIS_Policy *p;
- struct ANASTASIS_Truth *truth;
+ const struct ANASTASIS_Truth *truth;
struct ANASTASIS_CRYPTO_KeyShareP key_shares[truths_len];
uuid_t uuids[truths_len];
@@ -1051,7 +1050,7 @@ ANASTASIS_policy_create (struct ANASTASIS_Truth *truths[],
TALER_B2S (truth),
(unsigned long long) sizeof (struct ANASTASIS_Truth));
GNUNET_memcpy (&key_shares[i],
- truth->key_share,
+ &truth->key_share,
sizeof (struct ANASTASIS_CRYPTO_KeyShareP));
// key_shares[i] = truth->key_share;
GNUNET_assert (NULL != &key_shares[i]);
@@ -1159,7 +1158,7 @@ struct PolicyStoreState
/**
* Eddsa Privatekey.
*/
- struct GNUNET_CRYPTO_EddsaPrivateKey anastasis_priv;
+ struct ANASTASIS_CRYPTO_AccountPrivateKeyP anastasis_priv;
/**
* Hash of the previous upload (maybe bogus if
@@ -1344,38 +1343,24 @@ static unsigned int
ANASTASIS_get_num_urls (const struct ANASTASIS_Policy *policies[],
unsigned int policies_len)
{
- struct ANASTASIS_Policy *policy;
unsigned int len = 0;
unsigned int unique_urls_len = 0;
for (unsigned int i = 0; i < policies_len; i++)
{
- policy = policies[i];
-
- len += policy->uuids_length;
+ len += policies[i]->uuids_length;
}
{
- char *provider[len];
- for (unsigned int i = 0; i < len; i++)
- {
- // allocate space for each url
- provider[i] = GNUNET_malloc (SIZE_URL * sizeof (char));
- }
+ const char *provider[len];
for (unsigned int l = 0; l < policies_len; l++)
{
- struct ANASTASIS_Truth *truth;
-
- policy = policies[l];
-
- for (unsigned int j = 0; j < policy->uuids_length; j++)
+ for (unsigned int j = 0; j < policies[l]->uuids_length; j++)
{
- truth = policy->truths[j];
-
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"At %s:%d truth is %s-%llu b\n", __FILE__, __LINE__,
- TALER_B2S (truth),
+ TALER_B2S (policies[l]->truths[j]),
(unsigned long long) sizeof (struct ANASTASIS_Truth));
int contains_url = 0;
@@ -1384,11 +1369,11 @@ ANASTASIS_get_num_urls (const struct ANASTASIS_Policy
*policies[],
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"At %s:%d provider url from truth is %s\n", __FILE__,
__LINE__,
- truth->url);
+ policies[l]->truths[j]->url);
if (NULL != provider[k])
{
if (0 ==
- strcmp (truth->url, provider[k]))
+ strcmp (policies[l]->truths[j]->url, provider[k]))
{
contains_url = 1;
break;
@@ -1398,7 +1383,7 @@ ANASTASIS_get_num_urls (const struct ANASTASIS_Policy
*policies[],
if (0 == contains_url)
{
- provider[unique_urls_len] = truth->url;
+ provider[unique_urls_len] = policies[l]->truths[j]->url;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"At %s:%d unique provider url is %s\n", __FILE__,
__LINE__,
@@ -1481,10 +1466,7 @@ ANASTASIS_secret_share (struct GNUNET_CURL_Context *ctx,
for (unsigned int i = 0; i < policies_len; i++)
{
- struct ANASTASIS_Policy *policy;
-
- policy = policies[i];
- policy_keys[i] = policy->policy_key;
+ policy_keys[i] = policies[i]->policy_key;
}
ANASTASIS_CRYPTO_core_secret_encrypt (policy_keys,
@@ -1499,12 +1481,9 @@ ANASTASIS_secret_share (struct GNUNET_CURL_Context *ctx,
int index_pss = 0;
for (unsigned int k = 0; k < policies_len; k++ )
{
- struct ANASTASIS_Policy *policy;
-
- policy = policies[k];
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"At %s:%d policy is %s-%llu b\n", __FILE__, __LINE__,
- TALER_B2S (policy),
+ TALER_B2S (policies[k]),
(unsigned long long) sizeof (struct ANASTASIS_Policy));
if (0 !=
json_array_append_new (
@@ -1516,12 +1495,12 @@ ANASTASIS_secret_share (struct GNUNET_CURL_Context *ctx,
GNUNET_JSON_from_data_auto (
&encrypted_master_keys[k]),
"uuids",
- GNUNET_JSON_from_data (policy->uuids,
- policy->
+ GNUNET_JSON_from_data (policies[k]->uuids,
+ policies[k]->
uuids_length
* sizeof(uuid_t)),
"uuids_length",
- policy->uuids_length)))
+ policies[k]->uuids_length)))
{
GNUNET_break (0);
json_decref (dec_policies);
@@ -1534,35 +1513,34 @@ ANASTASIS_secret_share (struct GNUNET_CURL_Context *ctx,
json_dumps (dec_policies, JSON_COMPACT));
// FIXME CHALLENGE
- for (unsigned int l = 0; l < policy->uuids_length; l++)
+ for (unsigned int l = 0; l < policies[k]->uuids_length; l++)
{
- struct ANASTASIS_Truth *truth;
-
- truth = policy->truths[l];
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"At %s:%d truth is %s-%llu b\n", __FILE__, __LINE__,
- TALER_B2S (truth),
+ TALER_B2S (policies[k]->truths[l]),
(unsigned long long) sizeof (struct ANASTASIS_Truth));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"At %s:%d keyshare is %s-%llu b\n", __FILE__, __LINE__,
- TALER_B2S (truth->key_share),
- (unsigned long long) sizeof (*truth->key_share));
+ TALER_B2S (&policies[k]->truths[l]->key_share),
+ (unsigned long
+ long) sizeof (policies[k]->truths[l]->key_share));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"At %s:%d truthkey is %s-%llu b\n", __FILE__, __LINE__,
- TALER_B2S (truth->truth_key),
- (unsigned long long) sizeof (*truth->truth_key));
+ TALER_B2S (&policies[k]->truths[l]->truth_key),
+ (unsigned long
+ long) sizeof (policies[k]->truths[l]->truth_key));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"At %s:%d uuid is %s-%llu b\n", __FILE__, __LINE__,
- TALER_B2S (&truth->uuid),
- (unsigned long long) sizeof (truth->uuid));
+ TALER_B2S (&policies[k]->truths[l]->uuid),
+ (unsigned long long) sizeof (policies[k]->truths[l]->uuid));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"At %s:%d server salt is %s-%llu b\n", __FILE__, __LINE__,
- TALER_B2S (truth->salt),
- (unsigned long long) sizeof (*truth->salt));
+ TALER_B2S (policies[k]->truths[l]->salt),
+ (unsigned long long) sizeof (*policies[k]->truths[l]->salt));
// creates a json array for saving
if (0 !=
@@ -1574,15 +1552,16 @@ ANASTASIS_secret_share (struct GNUNET_CURL_Context *ctx,
" s:o," /* truth salt */
" s:s}", /* escrow method */
"uuid",
- GNUNET_JSON_from_data_auto (&truth->uuid),
+ GNUNET_JSON_from_data_auto (
+ &policies[k]->truths[l]->uuid),
"url",
- truth->url,
+ policies[k]->truths[l]->url,
"truth_key", GNUNET_JSON_from_data_auto (
- truth->truth_key),
+ &policies[k]->truths[l]->truth_key),
"salt", GNUNET_JSON_from_data_auto (
- truth->salt),
+ policies[k]->truths[l]->salt),
"escrow_method",
- truth->method)))
+ policies[k]->truths[l]->method)))
{
GNUNET_break (0);
json_decref (esc_methods);
@@ -1601,7 +1580,7 @@ ANASTASIS_secret_share (struct GNUNET_CURL_Context *ctx,
if (NULL != ss->pss[j]->anastasis_url)
{
if (0 == strcmp (ss->pss[j]->anastasis_url,
- truth->url))
+ policies[k]->truths[l]->url))
{
contains_url = 1;
break;
@@ -1610,10 +1589,10 @@ ANASTASIS_secret_share (struct GNUNET_CURL_Context *ctx,
}
if (0 == contains_url)
{
- ss->pss[index_pss]->anastasis_url = truth->url;
+ ss->pss[index_pss]->anastasis_url = policies[k]->truths[l]->url;
if (NULL != last_etag)
ss->pss[index_pss]->prev_hash = *last_etag;
- ss->pss[index_pss]->server_salt = truth->salt;
+ ss->pss[index_pss]->server_salt = policies[k]->truths[l]->salt;
index_pss++;
}
}
@@ -1685,6 +1664,7 @@ ANASTASIS_secret_share (struct GNUNET_CURL_Context *ctx,
}
// FIXME: clean up PSS, UUIDS, TRUTHS etc. !!!
// SETUP SHARE RESULT CALLBACK
+
if (NULL != ss->src)
{
ss->src (ss->src_cls,
diff --git a/src/lib/testing_cmd_policy_create.c
b/src/lib/testing_cmd_policy_create.c
index dba47b4..d80f087 100644
--- a/src/lib/testing_cmd_policy_create.c
+++ b/src/lib/testing_cmd_policy_create.c
@@ -72,7 +72,7 @@ policy_create_run (void *cls,
struct TALER_TESTING_Interpreter *is)
{
struct PolicyCreateState *pcs = cls;
- struct Truth *truths[pcs->cmd_label_array_length];
+ const struct ANASTASIS_Truth *truths[pcs->cmd_label_array_length];
GNUNET_assert (pcs->cmd_label_array_length > 0);
GNUNET_assert (NULL != pcs->cmd_label_array);
@@ -87,7 +87,7 @@ policy_create_run (void *cls,
for (unsigned int i = 0; i < pcs->cmd_label_array_length; i++)
{
const struct TALER_TESTING_Command *ref;
- const struct Truth *truth;
+ const struct ANASTASIS_Truth *truth;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"At %s:%d truth upload cmd is %s\n", __FILE__, __LINE__,
@@ -193,7 +193,7 @@ ANASTASIS_TESTING_cmd_policy_create (const char *label,
pcs->label = label;
va_start (ap, label);
- char *truth_upload_cmd;
+ const char *truth_upload_cmd;
while (NULL != (truth_upload_cmd = va_arg (ap, const char *)))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/lib/testing_cmd_recover_secret.c
b/src/lib/testing_cmd_recover_secret.c
index 086b8a0..3778c3d 100644
--- a/src/lib/testing_cmd_recover_secret.c
+++ b/src/lib/testing_cmd_recover_secret.c
@@ -79,7 +79,7 @@ struct RecoverSecretState
/**
* Recovery information from the lookup
*/
- struct ANASTASIS_RecoveryInformation *ri;
+ const struct ANASTASIS_RecoveryInformation *ri;
/**
* Coresecret to check if decryption worked
*/
@@ -109,7 +109,7 @@ core_secret_cb (void *cls,
size_t secret_size)
{
struct RecoverSecretState *rss = cls;
- if (0 != memcmp(secret, rss->core_secret, secret_size))
+ if (0 != memcmp (secret, rss->core_secret, secret_size))
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (rss->is);
@@ -156,27 +156,27 @@ recover_secret_run (void *cls,
return;
}
}
- if (NULL != rss->core_secret_reference)
+ if (NULL != rss->core_secret_reference)
+ {
+ ref = TALER_TESTING_interpreter_lookup_command
+ (is,
+ rss->core_secret_reference);
+ if (NULL == ref)
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (rss->is);
+ return;
+ }
+ if (GNUNET_OK !=
+ ANASTASIS_TESTING_get_trait_core_secret (ref,
+ 0,
+ &rss->core_secret))
{
- ref = TALER_TESTING_interpreter_lookup_command
- (is,
- rss->core_secret_reference);
- if (NULL == ref)
- {
- GNUNET_break (0);
- TALER_TESTING_interpreter_fail (rss->is);
- return;
- }
- if (GNUNET_OK !=
- ANASTASIS_TESTING_get_trait_core_secret (ref,
- 0,
- &rss->core_secret))
- {
- GNUNET_break (0);
- TALER_TESTING_interpreter_fail (rss->is);
- return;
- }
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (rss->is);
+ return;
}
+ }
rss->recovery = ANASTASIS_recovery_begin (is->ctx,
rss->id_data,
rss->version,
@@ -208,7 +208,7 @@ recover_secret_cleanup (void *cls,
{
// FIXME: Cleanup logic
struct RecoverSecretState *rss = cls;
- ANASTASIS_recovery_abort(rss->recovery);
+ ANASTASIS_recovery_abort (rss->recovery);
GNUNET_free (rss);
}
diff --git a/src/lib/testing_cmd_secret_share.c
b/src/lib/testing_cmd_secret_share.c
index 9e18d99..ee099f4 100644
--- a/src/lib/testing_cmd_secret_share.c
+++ b/src/lib/testing_cmd_secret_share.c
@@ -108,13 +108,13 @@ struct SecretShareState
* Function called for payment routine.
*
* @param cls closure
- * @param etag etag of upload
- * @param ec ANASTASIS error code
+ * @param taler_pay_url url for the payment (taler://pay/Foo)
+ * @param ec status of the request
*/
static void
secret_share_payment_cb (void *cls,
- struct GNUNET_HashCode *etags,
- enum ANASTASIS_ErrorCode *ec)
+ const char *taler_pay_url,
+ enum TALER_ErrorCode ec)
{
struct SecretShareState *sss = cls;
sss->sso = NULL;
@@ -125,13 +125,13 @@ secret_share_payment_cb (void *cls,
* Function called with the results of a #secret_share().
*
* @param cls closure
- * @param etag etag of upload
- * @param ec ANASTASIS error code
+ * @param @param current_etags sends back the etag of the upload (used to
prevent redundant uploads)
+ * @param ecs status code of the request
*/
static void
secret_share_result_cb (void *cls,
- struct GNUNET_HashCode *etag,
- enum ANASTASIS_ErrorCode *ec)
+ const struct GNUNET_HashCode *current_etags,
+ const enum TALER_ErrorCode *ecs)
{
struct SecretShareState *sss = cls;
sss->sso = NULL;
@@ -150,7 +150,7 @@ secret_share_run (void *cls,
struct TALER_TESTING_Interpreter *is)
{
struct SecretShareState *sss = cls;
- struct Policy *policies[sss->cmd_label_array_length];
+ const struct ANASTASIS_Policy *policies[sss->cmd_label_array_length];
GNUNET_assert (sss->cmd_label_array_length > 0);
GNUNET_assert (NULL != sss->cmd_label_array);
@@ -165,7 +165,7 @@ secret_share_run (void *cls,
for (unsigned int i = 0; i < sss->cmd_label_array_length; i++)
{
const struct TALER_TESTING_Command *ref;
- struct Policy *policy;
+ const struct ANASTASIS_Policy *policy;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"At %s:%d policy create cmd is %s\n", __FILE__, __LINE__,
@@ -299,7 +299,7 @@ ANASTASIS_TESTING_cmd_secret_share (const char *label,
sss->core_secret_size = core_secret_size;
va_start (ap, sso);
- char *policy_create_cmd;
+ const char *policy_create_cmd;
while (NULL != (policy_create_cmd = va_arg (ap, const char *)))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/util/anastasis_crypto.c b/src/util/anastasis_crypto.c
index dfc6de3..6a8ab14 100644
--- a/src/util/anastasis_crypto.c
+++ b/src/util/anastasis_crypto.c
@@ -348,12 +348,12 @@ ANASTASIS_CRYPTO_user_identifier_derive (
void
ANASTASIS_CRYPTO_account_private_key_derive (
const struct ANASTASIS_CRYPTO_UserIdentifierP *id,
- struct GNUNET_CRYPTO_EddsaPrivateKey *priv_key)
+ struct ANASTASIS_CRYPTO_AccountPrivateKeyP *priv_key)
{
/* priv_key = ver_secret */
if (GNUNET_YES !=
- GNUNET_CRYPTO_hkdf (priv_key,
- sizeof (*priv_key),
+ GNUNET_CRYPTO_hkdf (&priv_key->priv,
+ sizeof (priv_key->priv),
GCRY_MD_SHA512,
GCRY_MD_SHA256,
id,
@@ -367,8 +367,8 @@ ANASTASIS_CRYPTO_account_private_key_derive (
return;
}
/* go from ver_secret to proper private key (eddsa_d_to_a() in spec) */
- priv_key->d[0] = (priv_key->d[0] & 0x7f) | 0x40;
- priv_key->d[31] &= 0xf8;
+ priv_key->priv.d[0] = (priv_key->priv.d[0] & 0x7f) | 0x40;
+ priv_key->priv.d[31] &= 0xf8;
}
@@ -382,10 +382,10 @@ ANASTASIS_CRYPTO_account_public_key_derive (
const struct ANASTASIS_CRYPTO_UserIdentifierP *id,
struct ANASTASIS_CRYPTO_AccountPublicKeyP *pub_key)
{
- struct GNUNET_CRYPTO_EddsaPrivateKey priv;
+ struct ANASTASIS_CRYPTO_AccountPrivateKeyP priv;
ANASTASIS_CRYPTO_account_private_key_derive (id,
&priv);
- GNUNET_CRYPTO_eddsa_key_get_public (&priv,
+ GNUNET_CRYPTO_eddsa_key_get_public (&priv.priv,
&pub_key->pub);
}
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-anastasis] branch master updated: Fixed compiler warnings,
gnunet <=