From ed7b39b035fa18b777b71ddc568deff2f7977c82 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 2 Aug 2021 11:46:53 +0200 Subject: -more documentation fixes --- src/stasis/plugin_anastasis_postgres.c | 101 ++++++++++++++++----------------- 1 file changed, 50 insertions(+), 51 deletions(-) (limited to 'src/stasis/plugin_anastasis_postgres.c') diff --git a/src/stasis/plugin_anastasis_postgres.c b/src/stasis/plugin_anastasis_postgres.c index 0ece276..0915d24 100644 --- a/src/stasis/plugin_anastasis_postgres.c +++ b/src/stasis/plugin_anastasis_postgres.c @@ -96,7 +96,7 @@ postgres_drop_tables (void *cls) /** * Check that the database connection is still up. * - * @param pg connection to check + * @param cls a `struct PostgresClosure` with connection to check */ static void check_connection (void *cls) @@ -271,11 +271,11 @@ postgres_gc (void *cls, * Store encrypted recovery document. * * @param cls closure - * @param anastasis_pub public key of the user's account + * @param account_pub public key of the user's account * @param account_sig signature affirming storage request - * @param data_hash hash of @a data - * @param data contains encrypted_recovery_document - * @param data_size size of data blob + * @param recovery_data_hash hash of @a data + * @param recovery_data contains encrypted_recovery_document + * @param recovery_data_size size of data blob * @param payment_secret identifier for the payment, used to later charge on uploads * @param[out] version set to the version assigned to the document by the database * @return transaction status, 0 if upload could not be finished because @a payment_secret @@ -284,7 +284,7 @@ postgres_gc (void *cls, static enum ANASTASIS_DB_StoreStatus postgres_store_recovery_document ( void *cls, - const struct ANASTASIS_CRYPTO_AccountPublicKeyP *anastasis_pub, + const struct ANASTASIS_CRYPTO_AccountPublicKeyP *account_pub, const struct ANASTASIS_AccountSignatureP *account_sig, const struct GNUNET_HashCode *recovery_data_hash, const void *recovery_data, @@ -311,7 +311,7 @@ postgres_store_recovery_document ( { struct GNUNET_HashCode dh; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type (anastasis_pub), + GNUNET_PQ_query_param_auto_from_type (account_pub), GNUNET_PQ_query_param_end }; struct GNUNET_PQ_ResultSpec rs[] = { @@ -358,7 +358,7 @@ postgres_store_recovery_document ( /* First, check if account exists */ { struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type (anastasis_pub), + GNUNET_PQ_query_param_auto_from_type (account_pub), GNUNET_PQ_query_param_end }; struct GNUNET_PQ_ResultSpec rs[] = { @@ -391,7 +391,7 @@ postgres_store_recovery_document ( /* lookup if the user has enough uploads left and decrement */ { struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type (anastasis_pub), + GNUNET_PQ_query_param_auto_from_type (account_pub), GNUNET_PQ_query_param_auto_from_type (payment_secret), GNUNET_PQ_query_param_end }; @@ -432,7 +432,7 @@ postgres_store_recovery_document ( { struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint32 (&postcounter), - GNUNET_PQ_query_param_auto_from_type (anastasis_pub), + GNUNET_PQ_query_param_auto_from_type (account_pub), GNUNET_PQ_query_param_auto_from_type (payment_secret), GNUNET_PQ_query_param_end }; @@ -465,7 +465,7 @@ postgres_store_recovery_document ( /* finally, actually insert the recovery document */ { struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type (anastasis_pub), + GNUNET_PQ_query_param_auto_from_type (account_pub), GNUNET_PQ_query_param_uint32 (version), GNUNET_PQ_query_param_auto_from_type (account_sig), GNUNET_PQ_query_param_auto_from_type (recovery_data_hash), @@ -508,7 +508,7 @@ retry: * Increment account lifetime. * * @param cls closure - * @param anastasis_pub which account received a payment + * @param account_pub which account received a payment * @param payment_identifier proof of payment, must be unique and match pending payment * @param lifetime for how long is the account now paid (increment) * @param[out] paid_until set to the end of the lifetime after the operation @@ -517,7 +517,7 @@ retry: static enum GNUNET_DB_QueryStatus postgres_increment_lifetime ( void *cls, - const struct ANASTASIS_CRYPTO_AccountPublicKeyP *anastasis_pub, + const struct ANASTASIS_CRYPTO_AccountPublicKeyP *account_pub, const struct ANASTASIS_PaymentSecretP *payment_identifier, struct GNUNET_TIME_Relative lifetime, struct GNUNET_TIME_Absolute *paid_until) @@ -539,7 +539,7 @@ postgres_increment_lifetime ( { struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_auto_from_type (payment_identifier), - GNUNET_PQ_query_param_auto_from_type (anastasis_pub), + GNUNET_PQ_query_param_auto_from_type (account_pub), GNUNET_PQ_query_param_end }; qs = GNUNET_PQ_eval_prepared_non_select (pg->conn, @@ -565,7 +565,7 @@ postgres_increment_lifetime ( { enum GNUNET_DB_QueryStatus qs2; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type (anastasis_pub), + GNUNET_PQ_query_param_auto_from_type (account_pub), GNUNET_PQ_query_param_end }; struct GNUNET_TIME_Absolute expiration; @@ -598,7 +598,7 @@ postgres_increment_lifetime ( { /* user does not exist, create new one */ struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type (anastasis_pub), + GNUNET_PQ_query_param_auto_from_type (account_pub), GNUNET_PQ_query_param_absolute_time (&expiration), GNUNET_PQ_query_param_end }; @@ -620,7 +620,7 @@ postgres_increment_lifetime ( rollback (pg); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Payment existed, lifetime of account %s unchanged at %s\n", - TALER_B2S (anastasis_pub), + TALER_B2S (account_pub), GNUNET_STRINGS_absolute_time_to_string (*paid_until)); return GNUNET_DB_STATUS_SUCCESS_NO_RESULTS; } @@ -629,7 +629,7 @@ postgres_increment_lifetime ( /* user exists, update expiration_date */ struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_absolute_time (&expiration), - GNUNET_PQ_query_param_auto_from_type (anastasis_pub), + GNUNET_PQ_query_param_auto_from_type (account_pub), GNUNET_PQ_query_param_end }; @@ -667,7 +667,7 @@ postgres_increment_lifetime ( return GNUNET_DB_STATUS_HARD_ERROR; GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Incremented lifetime of account %s to %s\n", - TALER_B2S (anastasis_pub), + TALER_B2S (account_pub), GNUNET_STRINGS_absolute_time_to_string (*paid_until)); return GNUNET_DB_STATUS_SUCCESS_ONE_RESULT; retry: @@ -690,7 +690,7 @@ retry: static enum GNUNET_DB_QueryStatus postgres_update_lifetime ( void *cls, - const struct ANASTASIS_CRYPTO_AccountPublicKeyP *anastasis_pub, + const struct ANASTASIS_CRYPTO_AccountPublicKeyP *account_pub, const struct ANASTASIS_PaymentSecretP *payment_identifier, struct GNUNET_TIME_Absolute eol) { @@ -711,7 +711,7 @@ postgres_update_lifetime ( { struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_auto_from_type (payment_identifier), - GNUNET_PQ_query_param_auto_from_type (anastasis_pub), + GNUNET_PQ_query_param_auto_from_type (account_pub), GNUNET_PQ_query_param_end }; qs = GNUNET_PQ_eval_prepared_non_select (pg->conn, @@ -726,14 +726,14 @@ postgres_update_lifetime ( rollback (pg); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Payment existed, lifetime of account %s unchanged\n", - TALER_B2S (anastasis_pub)); + TALER_B2S (account_pub)); return qs; } } { struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type (anastasis_pub), + GNUNET_PQ_query_param_auto_from_type (account_pub), GNUNET_PQ_query_param_end }; struct GNUNET_TIME_Absolute expiration; @@ -758,7 +758,7 @@ postgres_update_lifetime ( { /* user does not exist, create new one */ struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type (anastasis_pub), + GNUNET_PQ_query_param_auto_from_type (account_pub), GNUNET_PQ_query_param_absolute_time (&eol), GNUNET_PQ_query_param_end }; @@ -770,7 +770,7 @@ postgres_update_lifetime ( params); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Created new account %s with expiration %s\n", - TALER_B2S (anastasis_pub), + TALER_B2S (account_pub), GNUNET_STRINGS_absolute_time_to_string (eol)); } break; @@ -779,7 +779,7 @@ postgres_update_lifetime ( /* user exists, update expiration_date */ struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_absolute_time (&expiration), - GNUNET_PQ_query_param_auto_from_type (anastasis_pub), + GNUNET_PQ_query_param_auto_from_type (account_pub), GNUNET_PQ_query_param_end }; @@ -792,7 +792,7 @@ postgres_update_lifetime ( params); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Updated account %s to new expiration %s\n", - TALER_B2S (anastasis_pub), + TALER_B2S (account_pub), GNUNET_STRINGS_absolute_time_to_string (expiration)); } break; @@ -832,7 +832,7 @@ retry: * when we increment the account's lifetime.) * * @param cls closure - * @param anastasis_pub anastasis's public key + * @param account_pub anastasis's public key * @param post_counter how many uploads does @a amount pay for * @param payment_secret payment secret which the user must provide with every upload * @param amount how much we asked for @@ -841,7 +841,7 @@ retry: static enum GNUNET_DB_QueryStatus postgres_record_recdoc_payment ( void *cls, - const struct ANASTASIS_CRYPTO_AccountPublicKeyP *anastasis_pub, + const struct ANASTASIS_CRYPTO_AccountPublicKeyP *account_pub, uint32_t post_counter, const struct ANASTASIS_PaymentSecretP *payment_secret, const struct TALER_Amount *amount) @@ -850,7 +850,7 @@ postgres_record_recdoc_payment ( struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get (); struct GNUNET_TIME_Absolute expiration; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type (anastasis_pub), + GNUNET_PQ_query_param_auto_from_type (account_pub), GNUNET_PQ_query_param_uint32 (&post_counter), TALER_PQ_query_param_amount (amount), GNUNET_PQ_query_param_auto_from_type (payment_secret), @@ -866,7 +866,7 @@ postgres_record_recdoc_payment ( if user exists, and if not, create one */ { struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type (anastasis_pub), + GNUNET_PQ_query_param_auto_from_type (account_pub), GNUNET_PQ_query_param_end }; struct GNUNET_PQ_ResultSpec rs[] = { @@ -893,7 +893,7 @@ postgres_record_recdoc_payment ( struct GNUNET_TIME_Absolute exp = GNUNET_TIME_relative_to_absolute (TRANSIENT_LIFETIME); struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type (anastasis_pub), + GNUNET_PQ_query_param_auto_from_type (account_pub), GNUNET_PQ_query_param_absolute_time (&exp), GNUNET_PQ_query_param_end }; @@ -915,7 +915,7 @@ postgres_record_recdoc_payment ( /* successful, continue below */ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Created new account %s with transient life until %s\n", - TALER_B2S (anastasis_pub), + TALER_B2S (account_pub), GNUNET_STRINGS_absolute_time_to_string (exp)); break; } @@ -1004,7 +1004,7 @@ postgres_check_truth_upload_paid ( * Store payment for challenge. * * @param cls closure - * @param truth_key identifier of the challenge to pay + * @param truth_uuid identifier of the challenge to pay * @param payment_secret payment secret which the user must provide with every upload * @param amount how much we asked for * @return transaction status @@ -1037,7 +1037,7 @@ postgres_record_challenge_payment ( * Store refund granted for challenge. * * @param cls closure - * @param truth_key identifier of the challenge to pay + * @param truth_uuid identifier of the challenge to refund * @param payment_secret payment secret which the user must provide with every upload * @return transaction status */ @@ -1067,8 +1067,8 @@ postgres_record_challenge_refund ( * * @param cls closure * @param payment_secret payment secret which the user must provide with every upload + * @param truth_uuid which truth should we check the payment status of * @param[out] paid bool value to show if payment is paid - * @param[out] valid_counter bool value to show if post_counter is > 0 * @return transaction status */ static enum GNUNET_DB_QueryStatus @@ -1159,11 +1159,10 @@ postgres_check_payment_identifier ( * @param cls closure * @param truth_uuid the identifier for the Truth * @param key_share_data contains information of an EncryptedKeyShare - * @param method name of method - * @param nonce nonce used to compute encryption key for encrypted_truth - * @param aes_gcm_tag authentication tag of encrypted_truth + * @param mime_type presumed mime type of data in @a encrypted_truth * @param encrypted_truth contains the encrypted Truth which includes the ground truth i.e. H(challenge answer), phonenumber, SMS * @param encrypted_truth_size the size of the Truth + * @param method name of method * @param truth_expiration time till the according data will be stored * @return transaction status */ @@ -1284,7 +1283,7 @@ postgres_get_key_share ( * current @a recovery_document_hash. * * @param cls closure - * @param anastasis_pub account identifier + * @param account_pub account identifier * @param[out] paid_until until when is the account paid up? * @param[out] recovery_data_hash set to hash of @a recovery document * @param[out] version set to the recovery policy version @@ -1293,14 +1292,14 @@ postgres_get_key_share ( enum ANASTASIS_DB_AccountStatus postgres_lookup_account ( void *cls, - const struct ANASTASIS_CRYPTO_AccountPublicKeyP *anastasis_pub, + const struct ANASTASIS_CRYPTO_AccountPublicKeyP *account_pub, struct GNUNET_TIME_Absolute *paid_until, struct GNUNET_HashCode *recovery_data_hash, uint32_t *version) { struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type (anastasis_pub), + GNUNET_PQ_query_param_auto_from_type (account_pub), GNUNET_PQ_query_param_end }; enum GNUNET_DB_QueryStatus qs; @@ -1377,18 +1376,18 @@ postgres_lookup_account ( * Fetch latest recovery document for user. * * @param cls closure - * @param anastasis_pub public key of the user's account + * @param account_pub public key of the user's account * @param account_sig signature * @param recovery_data_hash hash of the current recovery data * @param data_size size of data blob * @param data blob which contains the recovery document - * @param version[OUT] set to the version number of the policy being returned + * @param[out] version set to the version number of the policy being returned * @return transaction status */ enum GNUNET_DB_QueryStatus postgres_get_latest_recovery_document ( void *cls, - const struct ANASTASIS_CRYPTO_AccountPublicKeyP *anastasis_pub, + const struct ANASTASIS_CRYPTO_AccountPublicKeyP *account_pub, struct ANASTASIS_AccountSignatureP *account_sig, struct GNUNET_HashCode *recovery_data_hash, size_t *data_size, @@ -1397,7 +1396,7 @@ postgres_get_latest_recovery_document ( { struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type (anastasis_pub), + GNUNET_PQ_query_param_auto_from_type (account_pub), GNUNET_PQ_query_param_end }; struct GNUNET_PQ_ResultSpec rs[] = { @@ -1426,7 +1425,7 @@ postgres_get_latest_recovery_document ( * Fetch recovery document for user according given version. * * @param cls closure - * @param anastasis_pub public key of the user's account + * @param account_pub public key of the user's account * @param version the version number of the policy the user requests * @param[out] account_sig signature * @param[out] recovery_data_hash hash of the current recovery data @@ -1437,7 +1436,7 @@ postgres_get_latest_recovery_document ( enum GNUNET_DB_QueryStatus postgres_get_recovery_document ( void *cls, - const struct ANASTASIS_CRYPTO_AccountPublicKeyP *anastasis_pub, + const struct ANASTASIS_CRYPTO_AccountPublicKeyP *account_pub, uint32_t version, struct ANASTASIS_AccountSignatureP *account_sig, struct GNUNET_HashCode *recovery_data_hash, @@ -1446,7 +1445,7 @@ postgres_get_recovery_document ( { struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type (anastasis_pub), + GNUNET_PQ_query_param_auto_from_type (account_pub), GNUNET_PQ_query_param_uint32 (&version), GNUNET_PQ_query_param_end }; @@ -1509,7 +1508,7 @@ struct CheckValidityContext * * @param cls closure of type `struct CheckValidityContext *` * @param result the postgres result - * @param num_result the number of results in @a result + * @param num_results the number of results in @a result */ static void check_valid_code (void *cls, @@ -1578,7 +1577,7 @@ check_valid_code (void *cls, * does not match, the retry counter will be decreased by one. * * @param cls closure - * @param truth_pub identification of the challenge which the code corresponds to + * @param truth_uuid identification of the challenge which the code corresponds to * @param hashed_code code which the user provided and wants to verify * @return code validity status */ -- cgit v1.2.3