[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] 08/08: packed structs in crypto lib
From: |
gnunet |
Subject: |
[taler-anastasis] 08/08: packed structs in crypto lib |
Date: |
Sun, 26 Apr 2020 21:33:51 +0200 |
This is an automated email from the git hooks/post-receive script.
dennis-neufeld pushed a commit to branch master
in repository anastasis.
commit 432c38c3bc7ed9f12c4178f1acd5d790f8f2f6e8
Author: Dennis Neufeld <address@hidden>
AuthorDate: Sun Apr 26 19:33:18 2020 +0000
packed structs in crypto lib
---
src/backend/anastasis-httpd_policy.c | 6 +-
src/backend/anastasis-httpd_policy.h | 2 +-
src/backend/anastasis-httpd_policy_upload.c | 4 +-
src/backend/anastasis-httpd_salt.c | 2 +-
src/backend/anastasis-httpd_truth.c | 4 +-
src/include/anastasis_crypto_lib.h | 92 +++++++++----------
src/include/anastasis_database_plugin.h | 22 ++---
src/include/anastasis_service.h | 12 +--
src/include/anastasis_testing_lib.h | 15 ++--
src/lib/anastasis.c | 36 ++++----
src/lib/anastasis_api_keyshare_lookup.c | 6 +-
src/lib/anastasis_api_policy_lookup.c | 6 +-
src/lib/anastasis_api_policy_store.c | 4 +-
src/lib/testing_api_cmd_keyshare_lookup.c | 4 +-
src/lib/testing_api_cmd_policy_lookup.c | 4 +-
src/lib/testing_api_cmd_policy_store.c | 10 +--
src/lib/testing_api_cmd_salt.c | 2 +-
src/lib/testing_api_cmd_truth_store.c | 10 +--
src/lib/testing_api_trait_account_priv.c | 4 +-
src/lib/testing_api_trait_account_pub.c | 4 +-
src/stasis/plugin_anastasis_postgres.c | 18 ++--
src/stasis/test_anastasis_db.c | 4 +-
src/util/anastasis_crypto.c | 132 ++++++++++++++--------------
src/util/test_anastasis_crypto.c | 51 ++++++-----
24 files changed, 230 insertions(+), 224 deletions(-)
diff --git a/src/backend/anastasis-httpd_policy.c
b/src/backend/anastasis-httpd_policy.c
index c3327ba..2717783 100644
--- a/src/backend/anastasis-httpd_policy.c
+++ b/src/backend/anastasis-httpd_policy.c
@@ -50,7 +50,7 @@
*/
MHD_RESULT
AH_return_policy (struct MHD_Connection *connection,
- const struct ANASTASIS_CRYPTO_AccountPublicKey *account_pub,
+ const struct ANASTASIS_CRYPTO_AccountPublicKeyP *account_pub,
unsigned int default_http_status)
{
enum ANASTASIS_DB_QueryStatus qs;
@@ -191,7 +191,7 @@ AH_policy_get (struct MHD_Connection *connection,
struct GNUNET_HashCode recovery_data_hash;
enum ANASTASIS_DB_QueryStatus qs;
MHD_RESULT ret;
- struct ANASTASIS_CRYPTO_AccountPublicKey account_pub;
+ struct ANASTASIS_CRYPTO_AccountPublicKeyP account_pub;
GNUNET_assert (0 == strncmp (url,
"/policy/",
@@ -205,7 +205,7 @@ AH_policy_get (struct MHD_Connection *connection,
strlen (account),
&account_pub,
sizeof (struct
-
ANASTASIS_CRYPTO_AccountPublicKey)))
+
ANASTASIS_CRYPTO_AccountPublicKeyP)))
{
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_BAD_REQUEST,
diff --git a/src/backend/anastasis-httpd_policy.h
b/src/backend/anastasis-httpd_policy.h
index 0eb9566..1373cf0 100644
--- a/src/backend/anastasis-httpd_policy.h
+++ b/src/backend/anastasis-httpd_policy.h
@@ -68,7 +68,7 @@ AH_handler_policy_post (struct MHD_Connection *connection,
*/
MHD_RESULT
AH_return_policy (struct MHD_Connection *connection,
- const struct ANASTASIS_CRYPTO_AccountPublicKey *account,
+ const struct ANASTASIS_CRYPTO_AccountPublicKeyP *account,
unsigned int default_http_status);
diff --git a/src/backend/anastasis-httpd_policy_upload.c
b/src/backend/anastasis-httpd_policy_upload.c
index f13d809..cb665e2 100644
--- a/src/backend/anastasis-httpd_policy_upload.c
+++ b/src/backend/anastasis-httpd_policy_upload.c
@@ -57,7 +57,7 @@ struct PolicyUploadContext
/**
* Public key of the account holder.
*/
- struct ANASTASIS_CRYPTO_AccountPublicKey account;
+ struct ANASTASIS_CRYPTO_AccountPublicKeyP account;
/**
* Hash of the previous upload, or zeros if first upload.
@@ -650,7 +650,7 @@ AH_handler_policy_post (struct MHD_Connection *connection,
size_t *recovery_data_size)
{
struct PolicyUploadContext *puc;
- struct ANASTASIS_CRYPTO_AccountPublicKey accountPubP;
+ struct ANASTASIS_CRYPTO_AccountPublicKeyP accountPubP;
puc = *con_cls;
if (NULL == puc)
diff --git a/src/backend/anastasis-httpd_salt.c
b/src/backend/anastasis-httpd_salt.c
index 497a480..4c0c47a 100644
--- a/src/backend/anastasis-httpd_salt.c
+++ b/src/backend/anastasis-httpd_salt.c
@@ -38,7 +38,7 @@ AH_handler_salt (struct MHD_Connection *connection,
const char *url,
void **con_cls)
{
- struct ANASTASIS_CRYPTO_Salt salt;
+ struct ANASTASIS_CRYPTO_SaltP salt;
GNUNET_CRYPTO_hash (AH_server_salt,
strlen (AH_server_salt),
diff --git a/src/backend/anastasis-httpd_truth.c
b/src/backend/anastasis-httpd_truth.c
index 4c2059d..350d621 100644
--- a/src/backend/anastasis-httpd_truth.c
+++ b/src/backend/anastasis-httpd_truth.c
@@ -41,7 +41,7 @@ AH_handler_truth_get (struct MHD_Connection *connection,
{
// FIXME: Handle truth get
uuid_t uuid;
- struct ANASTASIS_CRYPTO_TruthKey truth_key;
+ struct ANASTASIS_CRYPTO_TruthKeyP truth_key;
struct GNUNET_HashCode challenge_response;
const char *challenge_response_s;
void *encrypted_truth;
@@ -92,7 +92,7 @@ AH_handler_truth_get (struct MHD_Connection *connection,
strlen (tdk),
&truth_key,
sizeof (struct
- ANASTASIS_CRYPTO_TruthKey))))
+ ANASTASIS_CRYPTO_TruthKeyP))))
{
GNUNET_break_op (0);
return TALER_MHD_reply_with_error (connection,
diff --git a/src/include/anastasis_crypto_lib.h
b/src/include/anastasis_crypto_lib.h
index 44018e4..a7e21f4 100644
--- a/src/include/anastasis_crypto_lib.h
+++ b/src/include/anastasis_crypto_lib.h
@@ -25,10 +25,12 @@
#include <jansson.h>
#include <gnunet/gnunet_crypto_lib.h>
+GNUNET_NETWORK_STRUCT_BEGIN
+
/**
* An EdDSA public key that is used to identify a user's account.
*/
-struct ANASTASIS_CRYPTO_AccountPublicKey
+struct ANASTASIS_CRYPTO_AccountPublicKeyP
{
struct GNUNET_CRYPTO_EddsaPublicKey pub;
};
@@ -37,7 +39,7 @@ struct ANASTASIS_CRYPTO_AccountPublicKey
/**
* An EdDSA private key that is used to identify a user's account.
*/
-struct ANASTASIS_CRYPTO_AccountPrivateKey
+struct ANASTASIS_CRYPTO_AccountPrivateKeyP
{
struct GNUNET_CRYPTO_EddsaPrivateKey priv;
};
@@ -46,43 +48,43 @@ struct ANASTASIS_CRYPTO_AccountPrivateKey
/**
* Specifies a TruthKey which is used to decrypt the Truth stored by the user.
*/
-struct ANASTASIS_CRYPTO_TruthKey
+struct ANASTASIS_CRYPTO_TruthKeyP
{
- struct GNUNET_HashCode key;
+ struct GNUNET_HashCode key GNUNET_PACKED;
};
/**
* Specifies a Salt value as a hash.
*/
-struct ANASTASIS_CRYPTO_Salt
+struct ANASTASIS_CRYPTO_SaltP
{
- struct GNUNET_HashCode salt;
+ struct GNUNET_HashCode salt GNUNET_PACKED;
};
/**
* Specifies a policy key which is used to decrypt the master key
*/
-struct ANASTASIS_CRYPTO_PolicyKey
+struct ANASTASIS_CRYPTO_PolicyKeyP
{
- struct GNUNET_HashCode key;
+ struct GNUNET_HashCode key GNUNET_PACKED;
};
/**
* Specifies an encrypted master key, the key is used to encrypt the core
secret from the user
*/
-struct ANASTASIS_CRYPTO_EncryptedMasterKey
+struct ANASTASIS_CRYPTO_EncryptedMasterKeyP
{
- struct GNUNET_HashCode key;
+ struct GNUNET_HashCode key GNUNET_PACKED;
};
/**
* Specifies a Nonce used for the AES encryption, here defined as 32Byte large.
*/
-struct ANASTASIS_CRYPTO_Nonce
+struct ANASTASIS_CRYPTO_NonceP
{
uint32_t nonce[8];
};
@@ -91,7 +93,7 @@ struct ANASTASIS_CRYPTO_Nonce
/**
* Specifies an IV used for the AES encryption, here defined as 16Byte large.
*/
-struct ANASTASIS_CRYPTO_Iv
+struct ANASTASIS_CRYPTO_IvP
{
uint32_t iv[4];
};
@@ -100,7 +102,7 @@ struct ANASTASIS_CRYPTO_Iv
/**
* Specifies an symmetric key used for the AES encryption, here defined as
32Byte large.
*/
-struct ANASTASIS_CRYPTO_SymKey
+struct ANASTASIS_CRYPTO_SymKeyP
{
uint32_t key[8];
};
@@ -109,7 +111,7 @@ struct ANASTASIS_CRYPTO_SymKey
/**
* Specifies an AES Tag used for the AES authentication, here defined as 16
Byte large.
*/
-struct ANASTASIS_CRYPTO_AesTag
+struct ANASTASIS_CRYPTO_AesTagP
{
uint32_t aes_tag[4];
};
@@ -119,7 +121,7 @@ struct ANASTASIS_CRYPTO_AesTag
* Specifies a Key Share from an escrow provider, the combined keyshares
generate the EscrowMasterKey
* which is used to decrypt the Secret from the user.
*/
-struct ANASTASIS_CRYPTO_KeyShare
+struct ANASTASIS_CRYPTO_KeyShareP
{
uint32_t key[8];
};
@@ -128,18 +130,18 @@ struct ANASTASIS_CRYPTO_KeyShare
/**
* Specifies an encrypted KeyShare
*/
-struct ANASTASIS_CRYPTO_EncryptedKeyShare
+struct ANASTASIS_CRYPTO_EncryptedKeyShareP
{
- struct ANASTASIS_CRYPTO_Nonce nonce;
- struct ANASTASIS_CRYPTO_AesTag tag;
- struct ANASTASIS_CRYPTO_KeyShare keyshare;
+ struct ANASTASIS_CRYPTO_NonceP nonce;
+ struct ANASTASIS_CRYPTO_AesTagP tag;
+ struct ANASTASIS_CRYPTO_KeyShareP keyshare;
};
/**
* The escrow master key is the key used to encrypt the user secret
(MasterKey).
*/
-struct ANASTASIS_CRYPTO_EscrowMasterKey
+struct ANASTASIS_CRYPTO_EscrowMasterKeyP
{
uint32_t key[8];
};
@@ -149,11 +151,13 @@ struct ANASTASIS_CRYPTO_EscrowMasterKey
* The user identifier consists of user information and the server salt. It is
used as
* entropy source to generate the account public key and the encryption keys.
*/
-struct ANASTASIS_CRYPTO_UserIdentifier
+struct ANASTASIS_CRYPTO_UserIdentifierP
{
uint32_t hash[8];
};
+GNUNET_NETWORK_STRUCT_END
+
/**
* Creates the UserIdentifier, it is used as entropy source for the encryption
keys and
@@ -165,8 +169,8 @@ struct ANASTASIS_CRYPTO_UserIdentifier
void
ANASTASIS_CRYPTO_user_identifier_derive (
const json_t *id_data,
- const struct ANASTASIS_CRYPTO_Salt *server_salt,
- struct ANASTASIS_CRYPTO_UserIdentifier *id);
+ const struct ANASTASIS_CRYPTO_SaltP *server_salt,
+ struct ANASTASIS_CRYPTO_UserIdentifierP *id);
/**
@@ -176,8 +180,8 @@ ANASTASIS_CRYPTO_user_identifier_derive (
*/
void
ANASTASIS_CRYPTO_account_public_key_derive (
- const struct ANASTASIS_CRYPTO_UserIdentifier *id,
- struct ANASTASIS_CRYPTO_AccountPublicKey *pub_key);
+ const struct ANASTASIS_CRYPTO_UserIdentifierP *id,
+ struct ANASTASIS_CRYPTO_AccountPublicKeyP *pub_key);
/**
* //FIXME combine these two
@@ -187,7 +191,7 @@ ANASTASIS_CRYPTO_account_public_key_derive (
*/
void
ANASTASIS_CRYPTO_account_private_key_derive (
- const struct ANASTASIS_CRYPTO_UserIdentifier *id,
+ const struct ANASTASIS_CRYPTO_UserIdentifierP *id,
struct GNUNET_CRYPTO_EddsaPrivateKey *priv_key);
/**
@@ -203,7 +207,7 @@ ANASTASIS_CRYPTO_account_private_key_derive (
*/
void
ANASTASIS_CRYPTO_recovery_document_encrypt (
- const struct ANASTASIS_CRYPTO_UserIdentifier *id,
+ const struct ANASTASIS_CRYPTO_UserIdentifierP *id,
const void *rec_doc,
size_t rd_size,
void **enc_rec_doc,
@@ -224,7 +228,7 @@ ANASTASIS_CRYPTO_recovery_document_encrypt (
*/
void
ANASTASIS_CRYPTO_recovery_document_decrypt (
- const struct ANASTASIS_CRYPTO_UserIdentifier *id,
+ const struct ANASTASIS_CRYPTO_UserIdentifierP *id,
const void *enc_rec_doc,
size_t erd_size,
void **rec_doc,
@@ -240,9 +244,9 @@ ANASTASIS_CRYPTO_recovery_document_decrypt (
*/
void
ANASTASIS_CRYPTO_keyshare_encrypt (
- const struct ANASTASIS_CRYPTO_KeyShare *key_share,
- const struct ANASTASIS_CRYPTO_UserIdentifier *id,
- struct ANASTASIS_CRYPTO_EncryptedKeyShare **enc_key_share);
+ const struct ANASTASIS_CRYPTO_KeyShareP *key_share,
+ const struct ANASTASIS_CRYPTO_UserIdentifierP *id,
+ struct ANASTASIS_CRYPTO_EncryptedKeyShareP **enc_key_share);
/**
@@ -254,9 +258,9 @@ ANASTASIS_CRYPTO_keyshare_encrypt (
*/
void
ANASTASIS_CRYPTO_keyshare_decrypt (
- const struct ANASTASIS_CRYPTO_EncryptedKeyShare *enc_key_share,
- const struct ANASTASIS_CRYPTO_UserIdentifier *id,
- struct ANASTASIS_CRYPTO_KeyShare **key_share);
+ const struct ANASTASIS_CRYPTO_EncryptedKeyShareP *enc_key_share,
+ const struct ANASTASIS_CRYPTO_UserIdentifierP *id,
+ struct ANASTASIS_CRYPTO_KeyShareP **key_share);
/**
@@ -273,7 +277,7 @@ ANASTASIS_CRYPTO_keyshare_decrypt (
*/
void
ANASTASIS_CRYPTO_truth_encrypt (
- const struct ANASTASIS_CRYPTO_TruthKey *truth_enc_key,
+ const struct ANASTASIS_CRYPTO_TruthKeyP *truth_enc_key,
const void *truth,
size_t truth_size,
void **enc_truth,
@@ -293,7 +297,7 @@ ANASTASIS_CRYPTO_truth_encrypt (
*/
void
ANASTASIS_CRYPTO_truth_decrypt (
- const struct ANASTASIS_CRYPTO_TruthKey *truth_enc_key,
+ const struct ANASTASIS_CRYPTO_TruthKeyP *truth_enc_key,
const void *enc_truth,
size_t ect_size,
void **truth,
@@ -308,7 +312,7 @@ ANASTASIS_CRYPTO_truth_decrypt (
*/
void
ANASTASIS_CRYPTO_keyshare_create (
- struct ANASTASIS_CRYPTO_KeyShare *key_share);
+ struct ANASTASIS_CRYPTO_KeyShareP *key_share);
/**
@@ -322,10 +326,10 @@ ANASTASIS_CRYPTO_keyshare_create (
*/
void
ANASTASIS_CRYPTO_policy_key_derive (
- const struct ANASTASIS_CRYPTO_KeyShare *key_shares,
+ const struct ANASTASIS_CRYPTO_KeyShareP *key_shares,
unsigned int keyshare_length,
- const struct ANASTASIS_CRYPTO_Salt *salt,
- struct ANASTASIS_CRYPTO_PolicyKey *policy_key);
+ const struct ANASTASIS_CRYPTO_SaltP *salt,
+ struct ANASTASIS_CRYPTO_PolicyKeyP *policy_key);
/**
@@ -344,12 +348,12 @@ ANASTASIS_CRYPTO_policy_key_derive (
*/
void
ANASTASIS_CRYPTO_core_secret_encrypt (
- const struct ANASTASIS_CRYPTO_PolicyKey *policy_keys,
+ const struct ANASTASIS_CRYPTO_PolicyKeyP *policy_keys,
unsigned int policy_keys_length,
const void *core_secret,
size_t core_secret_size,
void **enc_core_secret,
- struct ANASTASIS_CRYPTO_EncryptedMasterKey *encrypted_master_keys);
+ struct ANASTASIS_CRYPTO_EncryptedMasterKeyP *encrypted_master_keys);
/**
@@ -365,8 +369,8 @@ ANASTASIS_CRYPTO_core_secret_encrypt (
*/
void
ANASTASIS_CRYPTO_core_secret_recover (
- const struct ANASTASIS_CRYPTO_EncryptedMasterKey *encrypted_master_key,
- const struct ANASTASIS_CRYPTO_PolicyKey policy_key,
+ const struct ANASTASIS_CRYPTO_EncryptedMasterKeyP *encrypted_master_key,
+ const struct ANASTASIS_CRYPTO_PolicyKeyP policy_key,
const void *encrypted_core_secret,
size_t encrypted_core_secret_size,
void **core_secret,
diff --git a/src/include/anastasis_database_plugin.h
b/src/include/anastasis_database_plugin.h
index b58a3e8..407eae0 100644
--- a/src/include/anastasis_database_plugin.h
+++ b/src/include/anastasis_database_plugin.h
@@ -33,12 +33,12 @@
*/
struct ANASTASIS_DB_Truth
{
- struct ANASTASIS_CRYPTO_EncryptedKeyShare keyshare_data;
+ struct ANASTASIS_CRYPTO_EncryptedKeyShareP keyshare_data;
- struct ANASTASIS_CRYPTO_Nonce nonce;
+ struct ANASTASIS_CRYPTO_NonceP nonce;
// AES_GCM_Tag
- struct ANASTASIS_CRYPTO_AesTag aes_gcm_tag;
+ struct ANASTASIS_CRYPTO_AesTagP aes_gcm_tag;
void *encrypted_truth;
@@ -179,7 +179,7 @@ struct ANASTASIS_DatabasePlugin
enum ANASTASIS_DB_QueryStatus
(*store_recovery_document)(void *cls,
const struct
- ANASTASIS_CRYPTO_AccountPublicKey *anastasis_pub,
+ ANASTASIS_CRYPTO_AccountPublicKeyP *anastasis_pub,
const struct
ANASTASIS_AccountSignatureP *account_sig,
const struct
@@ -205,7 +205,7 @@ struct ANASTASIS_DatabasePlugin
enum ANASTASIS_DB_QueryStatus
(*get_recovery_document)(void *cls,
const struct
- ANASTASIS_CRYPTO_AccountPublicKey *anastasis_pub,
+ ANASTASIS_CRYPTO_AccountPublicKeyP *anastasis_pub,
struct
ANASTASIS_AccountSignatureP *account_sig,
struct
@@ -229,7 +229,7 @@ struct ANASTASIS_DatabasePlugin
enum ANASTASIS_DB_QueryStatus
(*get_latest_recovery_document)(void *cls,
const struct
- ANASTASIS_CRYPTO_AccountPublicKey *
+ ANASTASIS_CRYPTO_AccountPublicKeyP *
anastasis_pub,
struct
ANASTASIS_AccountSignatureP *account_sig,
@@ -257,7 +257,7 @@ struct ANASTASIS_DatabasePlugin
(*store_truth)(void *cls,
const uuid_t *uuid,
const struct
- ANASTASIS_CRYPTO_EncryptedKeyShare *key_share_data,
+ ANASTASIS_CRYPTO_EncryptedKeyShareP *key_share_data,
const char *mime_type,
const void *encrypted_truth,
size_t encrypted_truth_size,
@@ -304,7 +304,7 @@ struct ANASTASIS_DatabasePlugin
enum ANASTASIS_DB_QueryStatus
(*lookup_account)(void *cls,
const struct
- ANASTASIS_CRYPTO_AccountPublicKey *anastasis_pub,
+ ANASTASIS_CRYPTO_AccountPublicKeyP *anastasis_pub,
struct GNUNET_HashCode *recovery_data_hash);
/**
@@ -318,7 +318,7 @@ struct ANASTASIS_DatabasePlugin
enum ANASTASIS_DB_QueryStatus
(*lookup_pending_payments_by_account)(void *cls,
const struct
- ANASTASIS_CRYPTO_AccountPublicKey *
+ ANASTASIS_CRYPTO_AccountPublicKeyP *
anastasis_pub,
ANASTASIS_DB_PaymentPendingIterator it,
void *it_cls);
@@ -335,7 +335,7 @@ struct ANASTASIS_DatabasePlugin
enum ANASTASIS_DB_QueryStatus
(*increment_lifetime)(void *cls,
const struct
- ANASTASIS_CRYPTO_AccountPublicKey *anastasis_pub,
+ ANASTASIS_CRYPTO_AccountPublicKeyP *anastasis_pub,
const struct
ANASTASIS_PaymentSecretP *payment_identifier,
struct GNUNET_TIME_Relative lifetime);
@@ -356,7 +356,7 @@ struct ANASTASIS_DatabasePlugin
enum ANASTASIS_DB_QueryStatus
(*record_payment)(void *cls,
const struct
- ANASTASIS_CRYPTO_AccountPublicKey *anastasis_pub,
+ ANASTASIS_CRYPTO_AccountPublicKeyP *anastasis_pub,
uint32_t post_counter,
const struct ANASTASIS_PaymentSecretP *payment_secret,
const struct TALER_Amount *amount);
diff --git a/src/include/anastasis_service.h b/src/include/anastasis_service.h
index 1b8e9d9..c21ed9d 100644
--- a/src/include/anastasis_service.h
+++ b/src/include/anastasis_service.h
@@ -253,7 +253,7 @@ struct ANASTASIS_UploadDetails
typedef void
(*ANASTASIS_SaltCallback)(void *cls,
unsigned int http_status,
- const struct ANASTASIS_CRYPTO_Salt *salt);
+ const struct ANASTASIS_CRYPTO_SaltP *salt);
struct ANASTASIS_SaltOperation *
@@ -300,7 +300,7 @@ struct ANASTASIS_SaltOperation
/**
* Server salt.
*/
- struct ANASTASIS_CRYPTO_Salt salt;
+ struct ANASTASIS_CRYPTO_SaltP salt;
};
@@ -339,7 +339,7 @@ struct ANASTASIS_PolicyLookupOperation *
ANASTASIS_policy_lookup (struct GNUNET_CURL_Context *ctx,
const char *backend_url,
const struct
- ANASTASIS_CRYPTO_AccountPublicKey *anastasis_pub,
+ ANASTASIS_CRYPTO_AccountPublicKeyP *anastasis_pub,
ANASTASIS_PolicyLookupCallback cb,
void *cb_cls);
@@ -358,7 +358,7 @@ struct ANASTASIS_PolicyLookupOperation *
ANASTASIS_policy_lookup_version (struct GNUNET_CURL_Context *ctx,
const char *backend_url,
const struct
- ANASTASIS_CRYPTO_AccountPublicKey *
+ ANASTASIS_CRYPTO_AccountPublicKeyP *
anastasis_pub,
ANASTASIS_PolicyLookupCallback cb,
void *cb_cls,
@@ -415,7 +415,7 @@ struct ANASTASIS_PolicyStoreOperation *
ANASTASIS_policy_store (struct GNUNET_CURL_Context *ctx,
const char *backend_url,
const struct
- ANASTASIS_CRYPTO_AccountPrivateKey *anastasis_priv,
+ ANASTASIS_CRYPTO_AccountPrivateKeyP *anastasis_priv,
const struct
GNUNET_HashCode *prev_recovery_data_hash,
const void *recovery_data,
@@ -473,7 +473,7 @@ struct ANASTASIS_KeyShareLookupOperation *
ANASTASIS_keyshare_lookup (struct GNUNET_CURL_Context *ctx,
const char *backend_url,
const uuid_t *truth_uuid,
- const struct ANASTASIS_CRYPTO_TruthKey *truth_key,
+ const struct ANASTASIS_CRYPTO_TruthKeyP *truth_key,
const struct GNUNET_HashCode *hashed_answer,
ANASTASIS_KeyShareLookupCallback cb,
void *cb_cls);
diff --git a/src/include/anastasis_testing_lib.h
b/src/include/anastasis_testing_lib.h
index f708771..9ab793d 100644
--- a/src/include/anastasis_testing_lib.h
+++ b/src/include/anastasis_testing_lib.h
@@ -83,7 +83,8 @@ ANASTASIS_TESTING_get_trait_account_pub (const struct
TALER_TESTING_Command *cmd,
unsigned int index,
const struct
- ANASTASIS_CRYPTO_AccountPublicKey
**pub);
+ ANASTASIS_CRYPTO_AccountPublicKeyP **
+ pub);
/**
@@ -96,7 +97,7 @@ ANASTASIS_TESTING_get_trait_account_pub (const struct
struct TALER_TESTING_Trait
ANASTASIS_TESTING_make_trait_account_pub (unsigned int index,
const struct
- ANASTASIS_CRYPTO_AccountPublicKey
*h);
+ ANASTASIS_CRYPTO_AccountPublicKeyP
*h);
/**
@@ -112,7 +113,7 @@ ANASTASIS_TESTING_get_trait_account_priv (const struct
TALER_TESTING_Command *cmd,
unsigned int index,
const struct
- ANASTASIS_CRYPTO_AccountPrivateKey **
+ ANASTASIS_CRYPTO_AccountPrivateKeyP
**
priv);
@@ -126,7 +127,7 @@ ANASTASIS_TESTING_get_trait_account_priv (const struct
struct TALER_TESTING_Trait
ANASTASIS_TESTING_make_trait_account_priv (unsigned int index,
const struct
- ANASTASIS_CRYPTO_AccountPrivateKey *
+ ANASTASIS_CRYPTO_AccountPrivateKeyP
*
priv);
/**
@@ -346,7 +347,7 @@ enum ANASTASIS_TESTING_TruthStoreOption
* @param key_str a str you want to be a truth key
* @return truthkey
*/
-struct ANASTASIS_CRYPTO_TruthKey
+struct ANASTASIS_CRYPTO_TruthKeyP
ANASTASIS_TESTING_make_truthkey (const char *key_str);
/**
@@ -374,7 +375,7 @@ ANASTASIS_TESTING_make_truth_example (const char *method,
const char *mime_type,
const struct GNUNET_HashCode answer,
const struct
- ANASTASIS_CRYPTO_TruthKey key);
+ ANASTASIS_CRYPTO_TruthKeyP key);
/**
* Make the "truth store" command.
@@ -412,7 +413,7 @@ ANASTASIS_TESTING_cmd_keyshare_lookup (const char *label,
unsigned int http_status,
const struct GNUNET_HashCode answer,
const struct
- ANASTASIS_CRYPTO_TruthKey key,
+ ANASTASIS_CRYPTO_TruthKeyP key,
const char *upload_ref);
/**
diff --git a/src/lib/anastasis.c b/src/lib/anastasis.c
index aca4e78..22db6f7 100644
--- a/src/lib/anastasis.c
+++ b/src/lib/anastasis.c
@@ -58,7 +58,7 @@ struct SaltState
static void
salt_cb (void *cls,
unsigned int http_status,
- const struct ANASTASIS_CRYPTO_Salt *salt)
+ const struct ANASTASIS_CRYPTO_SaltP *salt)
{
struct SaltState *ss = cls;
@@ -118,11 +118,11 @@ struct ANASTASIS_Challenge
/**
* Key used to encrypt the truth passed to the server
*/
- struct ANASTASIS_CRYPTO_TruthKey truth_key;
+ struct ANASTASIS_CRYPTO_TruthKeyP truth_key;
/**
* Salt used to encrypt the truth
*/
- struct ANASTASIS_CRYPTO_Salt truth_salt;
+ struct ANASTASIS_CRYPTO_SaltP truth_salt;
/**
* plaintext challenge which is sent to the client
*/
@@ -210,11 +210,11 @@ struct ANASTASIS_Recovery
/**
* Identity key material used for the derivation of keys
*/
- struct ANASTASIS_CRYPTO_UserIdentifier id;
+ struct ANASTASIS_CRYPTO_UserIdentifierP id;
/**
* Public key for a request
*/
- struct ANASTASIS_CRYPTO_AccountPublicKey pub_key;
+ struct ANASTASIS_CRYPTO_AccountPublicKeyP pub_key;
/**
* Curl context
*/
@@ -436,15 +436,15 @@ struct ANASTASIS_Truth
/**
* keyshare of this truth, used to generate policy keys
*/
- struct ANASTASIS_CRYPTO_KeyShare key_share;
+ struct ANASTASIS_CRYPTO_KeyShareP key_share;
/**
* key used to encrypt this truth
*/
- struct ANASTASIS_CRYPTO_TruthKey truth_key;
+ struct ANASTASIS_CRYPTO_TruthKeyP truth_key;
/**
* salt used to encrypt the truth
*/
- struct ANASTASIS_CRYPTO_Salt *salt;
+ struct ANASTASIS_CRYPTO_SaltP *salt;
};
/**
@@ -463,7 +463,7 @@ struct ANASTASIS_TruthUpload
/**
* User identifier used for the keyshare encryption
*/
- struct ANASTASIS_CRYPTO_UserIdentifier id;
+ struct ANASTASIS_CRYPTO_UserIdentifierP id;
/**
* Callback which tells the user the payment details for the upload
*/
@@ -599,7 +599,7 @@ ANASTASIS_truth_upload (const json_t *id_data,
tu = GNUNET_new (struct ANASTASIS_TruthUpload);
struct ANASTASIS_Truth *t;
t = GNUNET_new (struct ANASTASIS_Truth);
- struct ANASTASIS_CRYPTO_EncryptedKeyShare *encrypted_key_share;
+ struct ANASTASIS_CRYPTO_EncryptedKeyShareP *encrypted_key_share;
void *encrypted_truth;
size_t encrypted_truth_size;
json_t *truth;
@@ -627,7 +627,7 @@ ANASTASIS_truth_upload (const json_t *id_data,
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_STRONG,
&t->truth_key,
- sizeof (struct ANASTASIS_CRYPTO_TruthKey));
+ sizeof (struct ANASTASIS_CRYPTO_TruthKeyP));
ANASTASIS_CRYPTO_truth_encrypt (&t->truth_key,
truth_data,
@@ -702,11 +702,11 @@ struct ANASTASIS_Policy
/**
* Encrypted policy master key
*/
- struct ANASTASIS_CRYPTO_PolicyKey policy_key;
+ struct ANASTASIS_CRYPTO_PolicyKeyP policy_key;
/**
* salt used to encrypt the master key
*/
- struct ANASTASIS_CRYPTO_Salt salt;
+ struct ANASTASIS_CRYPTO_SaltP salt;
/**
* set of truths inside this policy
*/
@@ -729,7 +729,7 @@ ANASTASIS_policy_create (struct ANASTASIS_Truth *truths[],
{
struct ANASTASIS_Policy *p;
p = GNUNET_new (struct ANASTASIS_Policy);
- struct ANASTASIS_CRYPTO_KeyShare key_shares[truths_len];
+ struct ANASTASIS_CRYPTO_KeyShareP key_shares[truths_len];
uuid_t uuids[truths_len];
for (unsigned int i = 0; i < truths_len; i++)
{
@@ -800,7 +800,7 @@ struct PolicyStoreState
/**
* User identifier used as entropy source for the account public key
*/
- struct ANASTASIS_CRYPTO_UserIdentifier id;
+ struct ANASTASIS_CRYPTO_UserIdentifierP id;
/**
* Struct to obtain the salt from the server
*/
@@ -820,7 +820,7 @@ struct PolicyStoreState
/**
* Eddsa Publickey.
*/
- struct ANASTASIS_CRYPTO_AccountPublicKey anastasis_pub;
+ struct ANASTASIS_CRYPTO_AccountPublicKeyP anastasis_pub;
/**
* Eddsa Privatekey.
*/
@@ -995,9 +995,9 @@ ANASTASIS_secret_share (const json_t *id_data,
struct PolicyStoreState pss[truths_len];
ss->pss = &pss;
ss->pss_length = truths_len;
- struct ANASTASIS_CRYPTO_EncryptedMasterKey
+ struct ANASTASIS_CRYPTO_EncryptedMasterKeyP
encrypted_master_keys[policies_len];
- struct ANASTASIS_CRYPTO_PolicyKey policy_keys[policies_len];
+ struct ANASTASIS_CRYPTO_PolicyKeyP policy_keys[policies_len];
void *encrypted_core_secret;
// Recovery document contains the array decryption policies and the array
escrow methods
diff --git a/src/lib/anastasis_api_keyshare_lookup.c
b/src/lib/anastasis_api_keyshare_lookup.c
index 653e858..8e0dcaf 100644
--- a/src/lib/anastasis_api_keyshare_lookup.c
+++ b/src/lib/anastasis_api_keyshare_lookup.c
@@ -72,7 +72,7 @@ struct ANASTASIS_KeyShareLookupOperation
/**
* Key to decrypt the truth on the server
*/
- const struct ANASTASIS_CRYPTO_TruthKey *truth_key;
+ const struct ANASTASIS_CRYPTO_TruthKeyP *truth_key;
/**
* Hash of the response (security question)
@@ -216,7 +216,7 @@ handle_header (char *buffer,
strlen (hdr_val),
&kslo->truth_key,
sizeof (struct
- ANASTASIS_CRYPTO_TruthKey)))
+ ANASTASIS_CRYPTO_TruthKeyP)))
{
GNUNET_break_op (0);
GNUNET_free (ndup);
@@ -244,7 +244,7 @@ struct ANASTASIS_KeyShareLookupOperation *
ANASTASIS_keyshare_lookup (struct GNUNET_CURL_Context *ctx,
const char *backend_url,
const uuid_t *truth_uuid,
- const struct ANASTASIS_CRYPTO_TruthKey *truth_key,
+ const struct ANASTASIS_CRYPTO_TruthKeyP *truth_key,
const struct GNUNET_HashCode *hashed_answer,
ANASTASIS_KeyShareLookupCallback cb,
void *cb_cls)
diff --git a/src/lib/anastasis_api_policy_lookup.c
b/src/lib/anastasis_api_policy_lookup.c
index f5b3c84..0f89741 100644
--- a/src/lib/anastasis_api_policy_lookup.c
+++ b/src/lib/anastasis_api_policy_lookup.c
@@ -72,7 +72,7 @@ struct ANASTASIS_PolicyLookupOperation
/**
* Public key of the account we are downloading from.
*/
- struct ANASTASIS_CRYPTO_AccountPublicKey account_pub;
+ struct ANASTASIS_CRYPTO_AccountPublicKeyP account_pub;
/**
* Signature returned in the "Sync-Signature"
@@ -294,7 +294,7 @@ struct ANASTASIS_PolicyLookupOperation *
ANASTASIS_policy_lookup (struct GNUNET_CURL_Context *ctx,
const char *backend_url,
const struct
- ANASTASIS_CRYPTO_AccountPublicKey *anastasis_pub,
+ ANASTASIS_CRYPTO_AccountPublicKeyP *anastasis_pub,
ANASTASIS_PolicyLookupCallback cb,
void *cb_cls)
{
@@ -350,7 +350,7 @@ struct ANASTASIS_PolicyLookupOperation *
ANASTASIS_policy_lookup_version (struct GNUNET_CURL_Context *ctx,
const char *backend_url,
const struct
- ANASTASIS_CRYPTO_AccountPublicKey *
+ ANASTASIS_CRYPTO_AccountPublicKeyP *
anastasis_pub,
ANASTASIS_PolicyLookupCallback cb,
void *cb_cls,
diff --git a/src/lib/anastasis_api_policy_store.c
b/src/lib/anastasis_api_policy_store.c
index df6e1ec..e4036b3 100644
--- a/src/lib/anastasis_api_policy_store.c
+++ b/src/lib/anastasis_api_policy_store.c
@@ -273,7 +273,7 @@ struct ANASTASIS_PolicyStoreOperation *
ANASTASIS_policy_store (struct GNUNET_CURL_Context *ctx,
const char *backend_url,
const struct
- ANASTASIS_CRYPTO_AccountPrivateKey *anastasis_priv,
+ ANASTASIS_CRYPTO_AccountPrivateKeyP *anastasis_priv,
const struct
GNUNET_HashCode *prev_recovery_data_hash,
const void *recovery_data,
@@ -394,7 +394,7 @@ ANASTASIS_policy_store (struct GNUNET_CURL_Context *ctx,
{
char *acc_pub_str;
char *path;
- struct ANASTASIS_CRYPTO_AccountPublicKey pub;
+ struct ANASTASIS_CRYPTO_AccountPublicKeyP pub;
GNUNET_CRYPTO_eddsa_key_get_public (&anastasis_priv->priv,
&pub.pub);
diff --git a/src/lib/testing_api_cmd_keyshare_lookup.c
b/src/lib/testing_api_cmd_keyshare_lookup.c
index 8aafc81..37f21a6 100644
--- a/src/lib/testing_api_cmd_keyshare_lookup.c
+++ b/src/lib/testing_api_cmd_keyshare_lookup.c
@@ -60,7 +60,7 @@ struct KeyShareLookupState
/**
* Key to decrypt truth
*/
- struct ANASTASIS_CRYPTO_TruthKey truth_key;
+ struct ANASTASIS_CRYPTO_TruthKeyP truth_key;
/**
* Identification of the Truth Object
@@ -245,7 +245,7 @@ ANASTASIS_TESTING_cmd_keyshare_lookup (const char *label,
unsigned int http_status,
const struct GNUNET_HashCode answer,
const struct
- ANASTASIS_CRYPTO_TruthKey key,
+ ANASTASIS_CRYPTO_TruthKeyP key,
const char *upload_ref)
{
struct KeyShareLookupState *ksls;
diff --git a/src/lib/testing_api_cmd_policy_lookup.c
b/src/lib/testing_api_cmd_policy_lookup.c
index 744466d..1b3f1dc 100644
--- a/src/lib/testing_api_cmd_policy_lookup.c
+++ b/src/lib/testing_api_cmd_policy_lookup.c
@@ -39,7 +39,7 @@ struct PolicyLookupState
/**
* Eddsa Publickey.
*/
- struct ANASTASIS_CRYPTO_AccountPublicKey anastasis_pub;
+ struct ANASTASIS_CRYPTO_AccountPublicKeyP anastasis_pub;
/**
* Hash of the upload (all zeros if there was no upload).
@@ -139,7 +139,7 @@ policy_lookup_run (void *cls,
if (NULL != pls->upload_reference)
{
const struct TALER_TESTING_Command *upload_cmd;
- const struct ANASTASIS_CRYPTO_AccountPublicKey *anastasis_pub;
+ const struct ANASTASIS_CRYPTO_AccountPublicKeyP *anastasis_pub;
upload_cmd = TALER_TESTING_interpreter_lookup_command
(is,
diff --git a/src/lib/testing_api_cmd_policy_store.c
b/src/lib/testing_api_cmd_policy_store.c
index b4e24e1..ca1ad3d 100644
--- a/src/lib/testing_api_cmd_policy_store.c
+++ b/src/lib/testing_api_cmd_policy_store.c
@@ -52,12 +52,12 @@ struct PolicyStoreState
/**
* Eddsa Publickey.
*/
- struct ANASTASIS_CRYPTO_AccountPublicKey anastasis_pub;
+ struct ANASTASIS_CRYPTO_AccountPublicKeyP anastasis_pub;
/**
* Eddsa Privatekey.
*/
- struct ANASTASIS_CRYPTO_AccountPrivateKey anastasis_priv;
+ struct ANASTASIS_CRYPTO_AccountPrivateKeyP anastasis_priv;
/**
* Hash of the previous upload (maybe bogus if
@@ -79,7 +79,7 @@ struct PolicyStoreState
/**
* The nonce.
*/
- struct ANASTASIS_CRYPTO_Nonce nonce;
+ struct ANASTASIS_CRYPTO_NonceP nonce;
/**
* URL of the anastasis backend.
@@ -293,7 +293,7 @@ policy_store_run (void *cls,
pss->prev_hash = *h;
}
{
- const struct ANASTASIS_CRYPTO_AccountPrivateKey *priv;
+ const struct ANASTASIS_CRYPTO_AccountPrivateKeyP *priv;
if (GNUNET_OK !=
ANASTASIS_TESTING_get_trait_account_priv (ref,
@@ -307,7 +307,7 @@ policy_store_run (void *cls,
pss->anastasis_priv = *priv;
}
{
- const struct ANASTASIS_CRYPTO_AccountPublicKey *pub;
+ const struct ANASTASIS_CRYPTO_AccountPublicKeyP *pub;
if (GNUNET_OK !=
ANASTASIS_TESTING_get_trait_account_pub (ref,
diff --git a/src/lib/testing_api_cmd_salt.c b/src/lib/testing_api_cmd_salt.c
index 31dd81d..6360408 100644
--- a/src/lib/testing_api_cmd_salt.c
+++ b/src/lib/testing_api_cmd_salt.c
@@ -63,7 +63,7 @@ struct SaltState
static void
salt_cb (void *cls,
unsigned int http_status,
- const struct ANASTASIS_CRYPTO_Salt *salt)
+ const struct ANASTASIS_CRYPTO_SaltP *salt)
{
struct SaltState *ss = cls;
diff --git a/src/lib/testing_api_cmd_truth_store.c
b/src/lib/testing_api_cmd_truth_store.c
index ddaa2cf..5dfc0d5 100644
--- a/src/lib/testing_api_cmd_truth_store.c
+++ b/src/lib/testing_api_cmd_truth_store.c
@@ -356,10 +356,10 @@ truth_store_traits (void *cls,
* @param key_str a str you want to be a truth key
* @return truthkey (must be freed)
*/
-struct ANASTASIS_CRYPTO_TruthKey
+struct ANASTASIS_CRYPTO_TruthKeyP
ANASTASIS_TESTING_make_truthkey (const char *key_str)
{
- struct ANASTASIS_CRYPTO_TruthKey key;
+ struct ANASTASIS_CRYPTO_TruthKeyP key;
GNUNET_CRYPTO_hash (key_str,
strlen (key_str),
@@ -385,10 +385,10 @@ ANASTASIS_TESTING_make_truth_example (const char *method,
const char *mime_type,
const struct GNUNET_HashCode answer,
const struct
- ANASTASIS_CRYPTO_TruthKey key)
+ ANASTASIS_CRYPTO_TruthKeyP key)
{
json_t *truth_data;
- struct ANASTASIS_CRYPTO_EncryptedKeyShare keyshare_data;
+ struct ANASTASIS_CRYPTO_EncryptedKeyShareP keyshare_data;
void *encrypted_truth;
size_t size_encrypted_truth;
@@ -406,7 +406,7 @@ ANASTASIS_TESTING_make_truth_example (const char *method,
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
&keyshare_data,
sizeof (struct
- ANASTASIS_CRYPTO_EncryptedKeyShare));
+ ANASTASIS_CRYPTO_EncryptedKeyShareP));
GNUNET_assert (NULL != &keyshare_data);
ANASTASIS_CRYPTO_truth_encrypt (&key,
diff --git a/src/lib/testing_api_trait_account_priv.c
b/src/lib/testing_api_trait_account_priv.c
index 2fb701d..4860e82 100644
--- a/src/lib/testing_api_trait_account_priv.c
+++ b/src/lib/testing_api_trait_account_priv.c
@@ -39,7 +39,7 @@ int
ANASTASIS_TESTING_get_trait_account_priv
(const struct TALER_TESTING_Command *cmd,
unsigned int index,
- const struct ANASTASIS_CRYPTO_AccountPrivateKey **priv)
+ const struct ANASTASIS_CRYPTO_AccountPrivateKeyP **priv)
{
return cmd->traits (cmd->cls,
(const void **) priv,
@@ -58,7 +58,7 @@ ANASTASIS_TESTING_get_trait_account_priv
struct TALER_TESTING_Trait
ANASTASIS_TESTING_make_trait_account_priv
(unsigned int index,
- const struct ANASTASIS_CRYPTO_AccountPrivateKey *priv)
+ const struct ANASTASIS_CRYPTO_AccountPrivateKeyP *priv)
{
struct TALER_TESTING_Trait ret = {
.index = index,
diff --git a/src/lib/testing_api_trait_account_pub.c
b/src/lib/testing_api_trait_account_pub.c
index ddf5d0d..5a3632e 100644
--- a/src/lib/testing_api_trait_account_pub.c
+++ b/src/lib/testing_api_trait_account_pub.c
@@ -39,7 +39,7 @@ int
ANASTASIS_TESTING_get_trait_account_pub
(const struct TALER_TESTING_Command *cmd,
unsigned int index,
- const struct ANASTASIS_CRYPTO_AccountPublicKey **pub)
+ const struct ANASTASIS_CRYPTO_AccountPublicKeyP **pub)
{
return cmd->traits (cmd->cls,
(const void **) pub,
@@ -58,7 +58,7 @@ ANASTASIS_TESTING_get_trait_account_pub
struct TALER_TESTING_Trait
ANASTASIS_TESTING_make_trait_account_pub
(unsigned int index,
- const struct ANASTASIS_CRYPTO_AccountPublicKey *h)
+ const struct ANASTASIS_CRYPTO_AccountPublicKeyP *h)
{
struct TALER_TESTING_Trait ret = {
.index = index,
diff --git a/src/stasis/plugin_anastasis_postgres.c
b/src/stasis/plugin_anastasis_postgres.c
index 68d0ae7..661ae65 100644
--- a/src/stasis/plugin_anastasis_postgres.c
+++ b/src/stasis/plugin_anastasis_postgres.c
@@ -355,7 +355,8 @@ payment_by_account_cb (void *cls,
static enum ANASTASIS_DB_QueryStatus
postgres_lookup_pending_payments_by_account (void *cls,
const struct
- ANASTASIS_CRYPTO_AccountPublicKey
*
+ ANASTASIS_CRYPTO_AccountPublicKeyP
+ *
anastasis_pub,
ANASTASIS_DB_PaymentPendingIterator
it,
@@ -404,7 +405,7 @@ postgres_lookup_pending_payments_by_account (void *cls,
static enum ANASTASIS_DB_QueryStatus
postgres_store_recovery_document (void *cls,
const struct
- ANASTASIS_CRYPTO_AccountPublicKey *
+ ANASTASIS_CRYPTO_AccountPublicKeyP *
anastasis_pub,
const struct
ANASTASIS_AccountSignatureP *account_sig,
@@ -682,7 +683,7 @@ postgres_store_recovery_document (void *cls,
static enum ANASTASIS_DB_QueryStatus
postgres_increment_lifetime (void *cls,
const struct
- ANASTASIS_CRYPTO_AccountPublicKey *anastasis_pub,
+ ANASTASIS_CRYPTO_AccountPublicKeyP *anastasis_pub,
const struct
ANASTASIS_PaymentSecretP *payment_identifier,
struct GNUNET_TIME_Relative lifetime)
@@ -839,7 +840,7 @@ postgres_increment_lifetime (void *cls,
static enum ANASTASIS_DB_QueryStatus
postgres_record_payment (void *cls,
const struct
- ANASTASIS_CRYPTO_AccountPublicKey *anastasis_pub,
+ ANASTASIS_CRYPTO_AccountPublicKeyP *anastasis_pub,
uint32_t post_counter,
const struct ANASTASIS_PaymentSecretP *payment_secret,
const struct TALER_Amount *amount)
@@ -980,7 +981,7 @@ static enum ANASTASIS_DB_QueryStatus
postgres_store_truth (void *cls,
const uuid_t *uuid,
const struct
- ANASTASIS_CRYPTO_EncryptedKeyShare *key_share_data,
+ ANASTASIS_CRYPTO_EncryptedKeyShareP *key_share_data,
const char *mime_type,
const void *encrypted_truth,
size_t encrypted_truth_size,
@@ -1133,7 +1134,7 @@ postgres_get_key_share (void *cls,
enum ANASTASIS_DB_QueryStatus
postgres_lookup_account (void *cls,
const struct
- ANASTASIS_CRYPTO_AccountPublicKey *anastasis_pub,
+ ANASTASIS_CRYPTO_AccountPublicKeyP *anastasis_pub,
struct GNUNET_HashCode *recovery_data_hash)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1226,7 +1227,7 @@ postgres_lookup_account (void *cls,
enum ANASTASIS_DB_QueryStatus
postgres_get_latest_recovery_document (void *cls,
const struct
- ANASTASIS_CRYPTO_AccountPublicKey *
+ ANASTASIS_CRYPTO_AccountPublicKeyP *
anastasis_pub,
struct
ANASTASIS_AccountSignatureP
*account_sig,
@@ -1294,7 +1295,8 @@ postgres_get_latest_recovery_document (void *cls,
enum ANASTASIS_DB_QueryStatus
postgres_get_recovery_document (void *cls,
const struct
- ANASTASIS_CRYPTO_AccountPublicKey
*anastasis_pub,
+ ANASTASIS_CRYPTO_AccountPublicKeyP *
+ anastasis_pub,
struct
ANASTASIS_AccountSignatureP *account_sig,
struct
diff --git a/src/stasis/test_anastasis_db.c b/src/stasis/test_anastasis_db.c
index cb557b5..63a6bfc 100644
--- a/src/stasis/test_anastasis_db.c
+++ b/src/stasis/test_anastasis_db.c
@@ -59,12 +59,12 @@ static struct ANASTASIS_PaymentSecretP paymentSecretP;
/**
* User public key, set to a random value
*/
-static struct ANASTASIS_CRYPTO_AccountPublicKey accountPubP;
+static struct ANASTASIS_CRYPTO_AccountPublicKeyP accountPubP;
/**
* User private key
*/
-static struct ANASTASIS_CRYPTO_AccountPrivateKey accountPrivP;
+static struct ANASTASIS_CRYPTO_AccountPrivateKeyP accountPrivP;
/**
* Signature
diff --git a/src/util/anastasis_crypto.c b/src/util/anastasis_crypto.c
index 338dd4f..8dfe23f 100644
--- a/src/util/anastasis_crypto.c
+++ b/src/util/anastasis_crypto.c
@@ -49,13 +49,13 @@
static void
get_iv_key (const void *key_material,
size_t key_m_len,
- const struct ANASTASIS_CRYPTO_Nonce *nonce,
+ const struct ANASTASIS_CRYPTO_NonceP *nonce,
const char *salt,
- const struct ANASTASIS_CRYPTO_SymKey *key,
- struct ANASTASIS_CRYPTO_Iv *iv)
+ const struct ANASTASIS_CRYPTO_SymKeyP *key,
+ struct ANASTASIS_CRYPTO_IvP *iv)
{
- char res[sizeof (struct ANASTASIS_CRYPTO_SymKey)
- + sizeof (struct ANASTASIS_CRYPTO_Iv)];
+ char res[sizeof (struct ANASTASIS_CRYPTO_SymKeyP)
+ + sizeof (struct ANASTASIS_CRYPTO_IvP)];
if (GNUNET_YES !=
GNUNET_CRYPTO_hkdf (res,
@@ -65,7 +65,7 @@ get_iv_key (const void *key_material,
key_material,
key_m_len,
nonce,
- sizeof (struct ANASTASIS_CRYPTO_Nonce),
+ sizeof (struct ANASTASIS_CRYPTO_NonceP),
salt,
strlen (salt),
NULL,
@@ -103,12 +103,12 @@ anastasis_encrypt (const void *key,
void **res,
size_t *res_size)
{
- struct ANASTASIS_CRYPTO_Nonce *nonce;
+ struct ANASTASIS_CRYPTO_NonceP *nonce;
gcry_cipher_hd_t cipher;
- struct ANASTASIS_CRYPTO_SymKey sym_key;
- struct ANASTASIS_CRYPTO_Iv iv;
+ struct ANASTASIS_CRYPTO_SymKeyP sym_key;
+ struct ANASTASIS_CRYPTO_IvP iv;
int rc;
- struct ANASTASIS_CRYPTO_AesTag *tag;
+ struct ANASTASIS_CRYPTO_AesTagP *tag;
char *ciphertext;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -121,8 +121,8 @@ anastasis_encrypt (const void *key,
(unsigned long long) data_size);
*res_size = data_size
- + sizeof (struct ANASTASIS_CRYPTO_Nonce)
- + sizeof (struct ANASTASIS_CRYPTO_AesTag);
+ + sizeof (struct ANASTASIS_CRYPTO_NonceP)
+ + sizeof (struct ANASTASIS_CRYPTO_AesTagP);
if (*res_size <= data_size)
{
GNUNET_break (0);
@@ -130,18 +130,18 @@ anastasis_encrypt (const void *key,
}
*res = GNUNET_malloc (*res_size);
if (*res_size != data_size
- + sizeof (struct ANASTASIS_CRYPTO_Nonce)
- + sizeof (struct ANASTASIS_CRYPTO_AesTag))
+ + sizeof (struct ANASTASIS_CRYPTO_NonceP)
+ + sizeof (struct ANASTASIS_CRYPTO_AesTagP))
{
GNUNET_break (0);
return;
}
- nonce = (struct ANASTASIS_CRYPTO_Nonce *) *res;
- tag = (struct ANASTASIS_CRYPTO_AesTag *) &nonce[1];
+ nonce = (struct ANASTASIS_CRYPTO_NonceP *) *res;
+ tag = (struct ANASTASIS_CRYPTO_AesTagP *) &nonce[1];
ciphertext = (char *) &tag[1];
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE,
nonce,
- sizeof (struct ANASTASIS_CRYPTO_Nonce));
+ sizeof (struct ANASTASIS_CRYPTO_NonceP));
get_iv_key (key,
key_len,
nonce,
@@ -179,7 +179,7 @@ anastasis_encrypt (const void *key,
GNUNET_assert (0 ==
gcry_cipher_gettag (cipher,
tag,
- sizeof (struct ANASTASIS_CRYPTO_AesTag)));
+ sizeof (struct
ANASTASIS_CRYPTO_AesTagP)));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"At %s:%d TAG_E is %s-%llu b\n", __FILE__, __LINE__,
TALER_B2S (tag),
@@ -213,12 +213,12 @@ anastasis_decrypt (const void *key,
void **res,
size_t *res_size)
{
- const struct ANASTASIS_CRYPTO_Nonce *nonce;
+ const struct ANASTASIS_CRYPTO_NonceP *nonce;
gcry_cipher_hd_t cipher;
- const struct ANASTASIS_CRYPTO_SymKey sym_key;
- struct ANASTASIS_CRYPTO_Iv iv;
+ const struct ANASTASIS_CRYPTO_SymKeyP sym_key;
+ struct ANASTASIS_CRYPTO_IvP iv;
int rc;
- const struct ANASTASIS_CRYPTO_AesTag *tag;
+ const struct ANASTASIS_CRYPTO_AesTagP *tag;
const char *ciphertext;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -231,8 +231,8 @@ anastasis_decrypt (const void *key,
(unsigned long long) data_size);
*res_size = data_size
- - sizeof (struct ANASTASIS_CRYPTO_Nonce)
- - sizeof (struct ANASTASIS_CRYPTO_AesTag);
+ - sizeof (struct ANASTASIS_CRYPTO_NonceP)
+ - sizeof (struct ANASTASIS_CRYPTO_AesTagP);
if (*res_size >= data_size)
{
GNUNET_break (0);
@@ -240,21 +240,21 @@ anastasis_decrypt (const void *key,
}
*res = GNUNET_malloc (*res_size);
if (*res_size != data_size
- - sizeof (struct ANASTASIS_CRYPTO_Nonce)
- - sizeof (struct ANASTASIS_CRYPTO_AesTag))
+ - sizeof (struct ANASTASIS_CRYPTO_NonceP)
+ - sizeof (struct ANASTASIS_CRYPTO_AesTagP))
{
GNUNET_break (0);
GNUNET_free (*res);
return;
}
- nonce = (const struct ANASTASIS_CRYPTO_Nonce *) data;
+ nonce = (const struct ANASTASIS_CRYPTO_NonceP *) data;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"At %s:%d NONCE_D is %s-%llu b\n", __FILE__, __LINE__,
TALER_B2S (nonce),
(unsigned long long) sizeof (*nonce));
- tag = (struct ANASTASIS_CRYPTO_AesTag *) &nonce[1];
+ tag = (struct ANASTASIS_CRYPTO_AesTagP *) &nonce[1];
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"At %s:%d TAG_D is %s-%llu b\n", __FILE__, __LINE__,
TALER_B2S (tag),
@@ -299,7 +299,7 @@ anastasis_decrypt (const void *key,
gcry_cipher_checktag (cipher,
tag,
sizeof (struct
- ANASTASIS_CRYPTO_AesTag)))
+ ANASTASIS_CRYPTO_AesTagP)))
{
GNUNET_break (0);
GNUNET_free (*res);
@@ -319,8 +319,8 @@ anastasis_decrypt (const void *key,
void
ANASTASIS_CRYPTO_user_identifier_derive (
const json_t *id_data,
- const struct ANASTASIS_CRYPTO_Salt *server_salt,
- struct ANASTASIS_CRYPTO_UserIdentifier *id)
+ const struct ANASTASIS_CRYPTO_SaltP *server_salt,
+ struct ANASTASIS_CRYPTO_UserIdentifierP *id)
{
char *json_enc;
json_enc = json_dumps (id_data, 0);
@@ -332,7 +332,7 @@ ANASTASIS_CRYPTO_user_identifier_derive (
server_salt,
sizeof (*server_salt),
SCRYPT_ITERATION, // iterations
- sizeof (struct ANASTASIS_CRYPTO_UserIdentifier),
+ sizeof (struct ANASTASIS_CRYPTO_UserIdentifierP),
id))
{
GNUNET_break (0);
@@ -349,7 +349,7 @@ ANASTASIS_CRYPTO_user_identifier_derive (
*/
void
ANASTASIS_CRYPTO_account_private_key_derive (
- const struct ANASTASIS_CRYPTO_UserIdentifier *id,
+ const struct ANASTASIS_CRYPTO_UserIdentifierP *id,
struct GNUNET_CRYPTO_EddsaPrivateKey *priv_key)
{
/* priv_key = ver_secret */
@@ -359,7 +359,7 @@ ANASTASIS_CRYPTO_account_private_key_derive (
GCRY_MD_SHA512,
GCRY_MD_SHA256,
id,
- sizeof (struct ANASTASIS_CRYPTO_UserIdentifier),
+ sizeof (struct ANASTASIS_CRYPTO_UserIdentifierP),
"ver",
strlen ("ver"),
NULL,
@@ -381,8 +381,8 @@ ANASTASIS_CRYPTO_account_private_key_derive (
*/
void
ANASTASIS_CRYPTO_account_public_key_derive (
- const struct ANASTASIS_CRYPTO_UserIdentifier *id,
- struct ANASTASIS_CRYPTO_AccountPublicKey *pub_key)
+ const struct ANASTASIS_CRYPTO_UserIdentifierP *id,
+ struct ANASTASIS_CRYPTO_AccountPublicKeyP *pub_key)
{
struct GNUNET_CRYPTO_EddsaPrivateKey priv;
ANASTASIS_CRYPTO_account_private_key_derive (id,
@@ -405,7 +405,7 @@ ANASTASIS_CRYPTO_account_public_key_derive (
*/
void
ANASTASIS_CRYPTO_recovery_document_encrypt (
- const struct ANASTASIS_CRYPTO_UserIdentifier *id,
+ const struct ANASTASIS_CRYPTO_UserIdentifierP *id,
const void *rec_doc,
size_t rd_size,
void **enc_rec_doc,
@@ -413,7 +413,7 @@ ANASTASIS_CRYPTO_recovery_document_encrypt (
{
const char *salt = "erd";
anastasis_encrypt (id,
- sizeof (struct ANASTASIS_CRYPTO_UserIdentifier),
+ sizeof (struct ANASTASIS_CRYPTO_UserIdentifierP),
rec_doc,
rd_size,
salt,
@@ -436,7 +436,7 @@ ANASTASIS_CRYPTO_recovery_document_encrypt (
*/
void
ANASTASIS_CRYPTO_recovery_document_decrypt (
- const struct ANASTASIS_CRYPTO_UserIdentifier *id,
+ const struct ANASTASIS_CRYPTO_UserIdentifierP *id,
const void *enc_rec_doc,
size_t erd_size,
void **rec_doc,
@@ -444,7 +444,7 @@ ANASTASIS_CRYPTO_recovery_document_decrypt (
{
const char *salt = "erd";
anastasis_decrypt (id,
- sizeof (struct ANASTASIS_CRYPTO_UserIdentifier),
+ sizeof (struct ANASTASIS_CRYPTO_UserIdentifierP),
enc_rec_doc,
erd_size,
salt,
@@ -462,9 +462,9 @@ ANASTASIS_CRYPTO_recovery_document_decrypt (
*/
void
ANASTASIS_CRYPTO_keyshare_encrypt (
- const struct ANASTASIS_CRYPTO_KeyShare *key_share,
- const struct ANASTASIS_CRYPTO_UserIdentifier *id,
- struct ANASTASIS_CRYPTO_EncryptedKeyShare **enc_key_share)
+ const struct ANASTASIS_CRYPTO_KeyShareP *key_share,
+ const struct ANASTASIS_CRYPTO_UserIdentifierP *id,
+ struct ANASTASIS_CRYPTO_EncryptedKeyShareP **enc_key_share)
{
const char *salt = "eks";
size_t eks_size;
@@ -473,14 +473,14 @@ ANASTASIS_CRYPTO_keyshare_encrypt (
security question, see 12.6.-> interface EncryptedKeyShare in spec)
*/
anastasis_encrypt (id,
- sizeof (struct ANASTASIS_CRYPTO_UserIdentifier),
+ sizeof (struct ANASTASIS_CRYPTO_UserIdentifierP),
key_share,
- sizeof (struct ANASTASIS_CRYPTO_KeyShare),
+ sizeof (struct ANASTASIS_CRYPTO_KeyShareP),
salt,
(void **) enc_key_share,
&eks_size);
if (eks_size !=
- sizeof (struct ANASTASIS_CRYPTO_EncryptedKeyShare))
+ sizeof (struct ANASTASIS_CRYPTO_EncryptedKeyShareP))
{
GNUNET_break (0);
return;
@@ -497,21 +497,21 @@ ANASTASIS_CRYPTO_keyshare_encrypt (
*/
void
ANASTASIS_CRYPTO_keyshare_decrypt (
- const struct ANASTASIS_CRYPTO_EncryptedKeyShare *enc_key_share,
- const struct ANASTASIS_CRYPTO_UserIdentifier *id,
- struct ANASTASIS_CRYPTO_KeyShare **key_share)
+ const struct ANASTASIS_CRYPTO_EncryptedKeyShareP *enc_key_share,
+ const struct ANASTASIS_CRYPTO_UserIdentifierP *id,
+ struct ANASTASIS_CRYPTO_KeyShareP **key_share)
{
const char *salt = "eks";
size_t ks_size;
anastasis_decrypt (id,
- sizeof (struct ANASTASIS_CRYPTO_UserIdentifier),
+ sizeof (struct ANASTASIS_CRYPTO_UserIdentifierP),
enc_key_share,
- sizeof (struct ANASTASIS_CRYPTO_EncryptedKeyShare),
+ sizeof (struct ANASTASIS_CRYPTO_EncryptedKeyShareP),
salt,
(void **) key_share,
&ks_size);
if (ks_size !=
- sizeof (struct ANASTASIS_CRYPTO_KeyShare))
+ sizeof (struct ANASTASIS_CRYPTO_KeyShareP))
{
GNUNET_break (0);
return;
@@ -533,7 +533,7 @@ ANASTASIS_CRYPTO_keyshare_decrypt (
*/
void
ANASTASIS_CRYPTO_truth_encrypt (
- const struct ANASTASIS_CRYPTO_TruthKey *truth_enc_key,
+ const struct ANASTASIS_CRYPTO_TruthKeyP *truth_enc_key,
const void *truth,
size_t truth_size,
void **enc_truth,
@@ -541,7 +541,7 @@ ANASTASIS_CRYPTO_truth_encrypt (
{
const char *salt = "ect";
anastasis_encrypt (truth_enc_key,
- sizeof (struct ANASTASIS_CRYPTO_TruthKey),
+ sizeof (struct ANASTASIS_CRYPTO_TruthKeyP),
truth,
truth_size,
salt,
@@ -563,7 +563,7 @@ ANASTASIS_CRYPTO_truth_encrypt (
*/
void
ANASTASIS_CRYPTO_truth_decrypt (
- const struct ANASTASIS_CRYPTO_TruthKey *truth_enc_key,
+ const struct ANASTASIS_CRYPTO_TruthKeyP *truth_enc_key,
const void *enc_truth,
size_t ect_size,
void **truth,
@@ -571,7 +571,7 @@ ANASTASIS_CRYPTO_truth_decrypt (
{
const char *salt = "ect";
anastasis_decrypt (truth_enc_key,
- sizeof (struct ANASTASIS_CRYPTO_TruthKey),
+ sizeof (struct ANASTASIS_CRYPTO_TruthKeyP),
enc_truth,
ect_size,
salt,
@@ -588,11 +588,11 @@ ANASTASIS_CRYPTO_truth_decrypt (
*/
void
ANASTASIS_CRYPTO_keyshare_create (
- struct ANASTASIS_CRYPTO_KeyShare *key_share)
+ struct ANASTASIS_CRYPTO_KeyShareP *key_share)
{
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_STRONG,
key_share,
- sizeof (struct ANASTASIS_CRYPTO_KeyShare));
+ sizeof (struct ANASTASIS_CRYPTO_KeyShareP));
}
@@ -607,10 +607,10 @@ ANASTASIS_CRYPTO_keyshare_create (
*/
void
ANASTASIS_CRYPTO_policy_key_derive (
- const struct ANASTASIS_CRYPTO_KeyShare *key_shares,
+ const struct ANASTASIS_CRYPTO_KeyShareP *key_shares,
unsigned int keyshare_length,
- const struct ANASTASIS_CRYPTO_Salt *salt,
- struct ANASTASIS_CRYPTO_PolicyKey *policy_key)
+ const struct ANASTASIS_CRYPTO_SaltP *salt,
+ struct ANASTASIS_CRYPTO_PolicyKeyP *policy_key)
{
GNUNET_CRYPTO_hkdf (policy_key,
sizeof (*policy_key),
@@ -640,12 +640,12 @@ ANASTASIS_CRYPTO_policy_key_derive (
*/
void
ANASTASIS_CRYPTO_core_secret_encrypt (
- const struct ANASTASIS_CRYPTO_PolicyKey *policy_keys,
+ const struct ANASTASIS_CRYPTO_PolicyKeyP *policy_keys,
unsigned int policy_keys_length,
const void *core_secret,
size_t core_secret_size,
void **enc_core_secret,
- struct ANASTASIS_CRYPTO_EncryptedMasterKey *encrypted_master_keys)
+ struct ANASTASIS_CRYPTO_EncryptedMasterKeyP *encrypted_master_keys)
{
struct GNUNET_CRYPTO_SymmetricSessionKey sk;
struct GNUNET_CRYPTO_SymmetricInitializationVector iv;
@@ -692,8 +692,8 @@ ANASTASIS_CRYPTO_core_secret_encrypt (
*/
void
ANASTASIS_CRYPTO_core_secret_recover (
- const struct ANASTASIS_CRYPTO_EncryptedMasterKey *encrypted_master_key,
- const struct ANASTASIS_CRYPTO_PolicyKey policy_key,
+ const struct ANASTASIS_CRYPTO_EncryptedMasterKeyP *encrypted_master_key,
+ const struct ANASTASIS_CRYPTO_PolicyKeyP policy_key,
const void *encrypted_core_secret,
size_t encrypted_core_secret_size,
void **core_secret,
@@ -711,7 +711,7 @@ ANASTASIS_CRYPTO_core_secret_recover (
GNUNET_SYSERR !=
GNUNET_CRYPTO_symmetric_decrypt (
encrypted_master_key,
- sizeof (struct ANASTASIS_CRYPTO_EncryptedMasterKey),
+ sizeof (struct ANASTASIS_CRYPTO_EncryptedMasterKeyP),
&mk_sk,
&mk_iv,
&master_key));
diff --git a/src/util/test_anastasis_crypto.c b/src/util/test_anastasis_crypto.c
index ab81c3f..6a43fdf 100644
--- a/src/util/test_anastasis_crypto.c
+++ b/src/util/test_anastasis_crypto.c
@@ -38,10 +38,10 @@ test_user_identifier_derive (void)
json_t *id_data_1;
json_t *id_data_2;
json_t *id_data_3;
- struct ANASTASIS_CRYPTO_UserIdentifier id_1;
- struct ANASTASIS_CRYPTO_UserIdentifier id_2;
- struct ANASTASIS_CRYPTO_UserIdentifier id_3;
- struct ANASTASIS_CRYPTO_Salt salt;
+ struct ANASTASIS_CRYPTO_UserIdentifierP id_1;
+ struct ANASTASIS_CRYPTO_UserIdentifierP id_2;
+ struct ANASTASIS_CRYPTO_UserIdentifierP id_3;
+ struct ANASTASIS_CRYPTO_SaltP salt;
GNUNET_CRYPTO_hash_from_string2 ("Server Salt",
strlen ("Server Salt"),
@@ -95,8 +95,8 @@ test_recovery_document (void)
size_t size_ciphertext;
void *plaintext;
size_t size_plaintext;
- struct ANASTASIS_CRYPTO_UserIdentifier id;
- struct ANASTASIS_CRYPTO_Salt salt;
+ struct ANASTASIS_CRYPTO_UserIdentifierP id;
+ struct ANASTASIS_CRYPTO_SaltP salt;
int ret;
json_t *id_data = json_object ();
@@ -141,18 +141,18 @@ test_recovery_document (void)
static int
test_key_share (void)
{
- struct ANASTASIS_CRYPTO_EncryptedKeyShare *ciphertext;
- struct ANASTASIS_CRYPTO_KeyShare *plaintext;
- struct ANASTASIS_CRYPTO_UserIdentifier id;
- struct ANASTASIS_CRYPTO_KeyShare key_share;
- struct ANASTASIS_CRYPTO_KeyShare key_share_1;
- struct ANASTASIS_CRYPTO_KeyShare key_share_2;
+ struct ANASTASIS_CRYPTO_EncryptedKeyShareP *ciphertext;
+ struct ANASTASIS_CRYPTO_KeyShareP *plaintext;
+ struct ANASTASIS_CRYPTO_UserIdentifierP id;
+ struct ANASTASIS_CRYPTO_KeyShareP key_share;
+ struct ANASTASIS_CRYPTO_KeyShareP key_share_1;
+ struct ANASTASIS_CRYPTO_KeyShareP key_share_2;
int ret;
// testing of enc-/decryption of a keyshare
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE,
&id,
- sizeof (struct ANASTASIS_CRYPTO_UserIdentifier));
+ sizeof (struct
ANASTASIS_CRYPTO_UserIdentifierP));
ANASTASIS_CRYPTO_keyshare_create (&key_share);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"KEYSHARE_BEFORE: %s\n",
@@ -188,12 +188,12 @@ test_truth (void)
size_t size_ciphertext;
void *plaintext;
size_t size_plaintext;
- struct ANASTASIS_CRYPTO_TruthKey truth_enc_key;
+ struct ANASTASIS_CRYPTO_TruthKeyP truth_enc_key;
int ret;
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE,
&truth_enc_key,
- sizeof (struct ANASTASIS_CRYPTO_TruthKey));
+ sizeof (struct ANASTASIS_CRYPTO_TruthKeyP));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"TRUTH_BEFORE: %s\n",
@@ -228,21 +228,21 @@ test_core_secret (void)
const char *test_wrong = "TEST_CORE_WRONG";
void *enc_core_secret;
unsigned int policy_keys_length = 5;
- struct ANASTASIS_CRYPTO_Salt salt;
- struct ANASTASIS_CRYPTO_EncryptedMasterKey
+ struct ANASTASIS_CRYPTO_SaltP salt;
+ struct ANASTASIS_CRYPTO_EncryptedMasterKeyP
encrypted_master_keys[policy_keys_length];
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
&salt,
- sizeof (struct ANASTASIS_CRYPTO_Salt));
+ sizeof (struct ANASTASIS_CRYPTO_SaltP));
// construction of PolicyKey-array
- struct ANASTASIS_CRYPTO_PolicyKey policy_keys[policy_keys_length];
+ struct ANASTASIS_CRYPTO_PolicyKeyP policy_keys[policy_keys_length];
for (unsigned int i = 0; i < policy_keys_length; i++)
{
// construction of KeyShare-array
unsigned int keyshare_length = 5;
- struct ANASTASIS_CRYPTO_KeyShare keyshares[keyshare_length];
+ struct ANASTASIS_CRYPTO_KeyShareP keyshares[keyshare_length];
for (unsigned int j = 0; j < keyshare_length; j++)
{
ANASTASIS_CRYPTO_keyshare_create (&keyshares[j]);
@@ -253,7 +253,7 @@ test_core_secret (void)
// derive policy-keys
ANASTASIS_CRYPTO_policy_key_derive ((struct
- ANASTASIS_CRYPTO_KeyShare *)
+ ANASTASIS_CRYPTO_KeyShareP *)
keyshares,
keyshare_length,
&salt,
@@ -274,7 +274,7 @@ test_core_secret (void)
strlen (test),
&enc_core_secret,
(struct
- ANASTASIS_CRYPTO_EncryptedMasterKey *)
+ ANASTASIS_CRYPTO_EncryptedMasterKeyP
*)
&encrypted_master_keys);
// test recover of core secret
@@ -309,9 +309,9 @@ test_core_secret (void)
static int
test_public_key_derive ()
{
- struct ANASTASIS_CRYPTO_UserIdentifier id;
- struct ANASTASIS_CRYPTO_AccountPublicKey pub_key;
- struct ANASTASIS_CRYPTO_Salt server_salt;
+ struct ANASTASIS_CRYPTO_UserIdentifierP id;
+ struct ANASTASIS_CRYPTO_AccountPublicKeyP pub_key;
+ struct ANASTASIS_CRYPTO_SaltP server_salt;
json_t *id_data = json_object ();
@@ -351,7 +351,6 @@ main (int argc,
return 1;
return 0;
-
}
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [taler-anastasis] branch master updated (0ca921b -> 432c38c), gnunet, 2020/04/26
- [taler-anastasis] 04/08: const in decryption routine, gnunet, 2020/04/26
- [taler-anastasis] 06/08: fixed salt api, gnunet, 2020/04/26
- [taler-anastasis] 08/08: packed structs in crypto lib,
gnunet <=
- [taler-anastasis] 03/08: ANASTASIS_CRYPTO_Iv set to 16 Byte length, gnunet, 2020/04/26
- [taler-anastasis] 05/08: modified salt api, gnunet, 2020/04/26
- [taler-anastasis] 02/08: ANASTASIS_CRYPTO_Iv set to 16 Byte length, gnunet, 2020/04/26
- [taler-anastasis] 07/08: fix json_pack, gnunet, 2020/04/26
- [taler-anastasis] 01/08: optimized error handling in anastasis_crypto, gnunet, 2020/04/26