diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-01-17 18:19:09 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-01-17 18:19:09 +0100 |
commit | c1f28638c9929424f9ad395c7016e6ea2022d751 (patch) | |
tree | c99637be9f515bee58f2791f74f3f70f11e29c68 /src/include | |
parent | 00612f5e19582db782832c69d093049c5f75dd9b (diff) |
working on #3888
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/taler_crypto_lib.h | 31 | ||||
-rw-r--r-- | src/include/taler_mintdb_plugin.h | 48 | ||||
-rw-r--r-- | src/include/taler_signatures.h | 19 |
3 files changed, 96 insertions, 2 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index 16240e5a3..87020fbbe 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -428,6 +428,37 @@ struct TALER_RefreshLinkDecrypted }; +/** + * Binary information encoded in Crockford's Base32 in wire transfer + * subjects of transfers from Taler to a merchant. The actual value + * is chosen by the mint and has no particular semantics, other than + * being unique so that the mint can lookup details about the wire + * transfer when needed. + */ +struct TALER_WireTransferIdentifierP +{ + + /** + * Raw value. Note that typical payment systems (SEPA, ACH) support + * at least two lines of 27 ASCII characters to encode a transaction + * subject or "details", for a total of 54 characters. (The payment + * system protocols often support more lines, but the forms presented + * to customers are usually limited to 54 characters.) + * + * With a Base32-encoding of 5 bit per character, this gives us 270 + * bits or (rounded down) 33 bytes. So we use the first 32 bytes to + * encode the actual value (i.e. a 256-bit / 32-byte public key or + * a hash code), and the last byte for a minimalistic checksum. + */ + uint8_t raw[32]; + + /** + * Checksum using CRC8 over the @e raw data. + */ + uint8_t crc8; +}; + + GNUNET_NETWORK_STRUCT_END diff --git a/src/include/taler_mintdb_plugin.h b/src/include/taler_mintdb_plugin.h index d9a1c6c85..a4a94faa9 100644 --- a/src/include/taler_mintdb_plugin.h +++ b/src/include/taler_mintdb_plugin.h @@ -571,7 +571,7 @@ typedef void /** * Function called with the results of the lookup of the * wire transfer identifier information. - * + * * @param cls closure * @param wtid base32-encoded wire transfer identifier, NULL * if the transaction was not yet done @@ -585,6 +585,31 @@ typedef void const char *wtid, struct GNUNET_TIME_Absolute execution_time); + +/** + * Function called with the results of the lookup of the + * transaction data associated with a wire transfer identifier. + * + * @param cls closure + * @param merchant_pub public key of the merchant (should be same for all callbacks with the same @e cls) + * @param h_wire hash of wire transfer details of the merchant (should be same for all callbacks with the same @e cls) + * @param h_contract which contract was this payment about + * @param transaction_id merchant's transaction ID for the payment + * @param coin_pub which public key was this payment about + * @param deposit_value amount contributed by this coin in total + * @param deposit_fee deposit fee charged by mint for this coin + */ +typedef void +(*TALER_MINTDB_TransactionDataCallback)(void *cls, + const struct TALER_MerchantPublicKeyP *merchant_pub, + const struct GNUNET_HashCode *h_wire, + const struct GNUNET_HashCode *h_contract, + uint64_t transaction_id, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + const struct TALER_Amount *deposit_value, + const struct TALER_Amount *deposit_fee); + + /** * @brief The plugin API, returned from the plugin's "init" function. * The argument given to "init" is simply a configuration handle. @@ -1195,10 +1220,29 @@ struct TALER_MINTDB_Plugin /** + * Lookup the list of Taler transactions that was aggregated + * into a wire transfer by the respective @a raw_wtid. + * + * @param cls the @e cls of this struct with the plugin-specific state + * @param raw_wtid the raw wire transfer identifier we used + * @param raw_len number of bytes in @a raw_wtid (right now always 32) + * @param cb function to call on each transaction found + * @param cb_cls closure for @a cb + * @return #GNUNET_OK on success, #GNUNET_SYSERR on database errors + */ + int + (*lookup_wire_transactions) (void *cls, + const void *raw_wtid, + size_t raw_len, + TALER_MINTDB_TransactionDataCallback cb, + void *cb_cls); + + + /** * Try to find the wire transfer details for a deposit operation. * If we did not execute the deposit yet, return when it is supposed * to be executed. - * + * * @param cls closure * @param h_contract hash of the contract * @param h_wire hash of merchant wire details diff --git a/src/include/taler_signatures.h b/src/include/taler_signatures.h index fb2916cff..ca8cf2dec 100644 --- a/src/include/taler_signatures.h +++ b/src/include/taler_signatures.h @@ -106,6 +106,11 @@ */ #define TALER_SIGNATURE_MINT_WIRE_TYPES 1036 +/** + * Signature where the Mint confirms the /deposit/wtid response. + */ +#define TALER_SIGNATURE_MINT_CONFIRM_WIRE 1036 + /*********************/ /* Wallet signatures */ @@ -863,6 +868,20 @@ struct TALER_ContractPS }; +/** + * Details affirmed by the mint about a wire transfer the mint + * claims to have done with respect to a deposit operation. + */ +struct TALER_ConfirmWirePS +{ + /** + * Purpose header for the signature over the contract with + * purpose #TALER_SIGNATURE_MINT_CONFIRM_WIRE. + */ + struct GNUNET_CRYPTO_EccSignaturePurpose purpose; + + +}; GNUNET_NETWORK_STRUCT_END |