Commit Graph

678 Commits

Author SHA1 Message Date
Christian Grothoff
982b60c93c
-more minor bugfixes 2022-06-07 17:04:23 +02:00
Christian Grothoff
b9a30d29cb
-fix minor bugs 2022-06-07 15:02:16 +02:00
60f609135d
fixed typo 2022-06-05 14:46:26 +02:00
Christian Grothoff
a17781ba8d
-more work on p2p payments and tests thereof 2022-06-04 22:00:02 +02:00
Christian Grothoff
f86eead6d6
-log invalid URI 2022-05-31 14:56:34 +02:00
Christian Grothoff
d55b093de8
-fix reserve history, include in tests 2022-05-30 19:31:49 +02:00
Christian Grothoff
7b25787a4b
-generate 404 on non-existing accounts for fakebank, use payto://-URIs with receiver-name in tests 2022-05-30 16:31:24 +02:00
Christian Grothoff
7f902c0fc9
-sketch API for RSA parallel signing 2022-05-30 13:34:39 +02:00
Christian Grothoff
d40da21e90
add batch signing support to taler-exchange-secmod-rsa 2022-05-29 22:25:04 +02:00
Christian Grothoff
a509a91f92
-more reserve history fixes 2022-05-23 15:29:35 +02:00
Christian Grothoff
c471ae447b
-log where it failed 2022-05-21 01:39:59 +02:00
Sebastian
68b155aab5
missing plus sign for image data uris 2022-05-20 10:09:54 -03:00
Christian Grothoff
99a844e52e
check reserve balance after p2p merges 2022-05-09 13:25:10 +02:00
Christian Grothoff
d3a6388199
pass purse_fee to determine how purse creation is paid for 2022-05-08 11:37:37 +02:00
Christian Grothoff
5f6d5bc3fc
-online 2022-05-07 23:43:39 +02:00
Christian Grothoff
2d84d7f6dd
add function for purse status signing 2022-05-07 23:27:56 +02:00
Christian Grothoff
4199e4438d
rename function that is for the merchant signature to have merchant in the name 2022-05-07 23:21:27 +02:00
Christian Grothoff
31e554ad46
-remove FIXMEs 2022-05-02 20:53:29 +02:00
1bb992d777
-logging 2022-04-27 21:00:23 +02:00
Christian Grothoff
3e8c797bb7
-get p2p test to pass 2022-04-27 13:28:28 +02:00
Christian Grothoff
d623cab1a3
-work on p2p payments 2022-04-27 13:09:41 +02:00
9a05781ab3
-fix derivation, logging 2022-04-27 00:00:15 +02:00
17a00ef22d
age restriction: make seed a HashCode due to endianess and security level concerns 2022-04-26 23:34:14 +02:00
47e276e11a
-remove debug logging 2022-04-26 23:10:50 +02:00
be536de23c
various age restriction fixes, some of them half-baked 2022-04-26 23:10:12 +02:00
a92d3aae7b
-use uint32_t instead of uint8_t + padding for the age 2022-04-26 11:23:27 +02:00
f24fc18564
use htonl, not GNUNET_htonll 2022-04-26 01:50:31 +02:00
38fcca16c8
fix age attestation signature padding and endianess 2022-04-26 01:28:36 +02:00
Christian Grothoff
aedd2014ec
-misc p2p fixes 2022-04-24 15:29:58 +02:00
Christian Grothoff
345c141bad
-work on p2p payments 2022-04-23 20:50:27 +02:00
Christian Grothoff
cf358f9546
-uncrustify 2022-04-23 18:13:15 +02:00
Thien-Thi Nguyen
a72337a5f3
Add abstractions: TALER_exchange_deposit_{sign,verify}
This change also removes ‘struct TALER_DepositTrackPS’
from the public API.

* src/include/taler_signatures.h (struct TALER_DepositTrackPS): Delete.

* src/util/exchange_signatures.c (struct TALER_DepositTrackPS): New.
  (TALER_exchange_deposit_sign): New func.
  (TALER_exchange_deposit_verify): New func.

* src/include/taler_crypto_lib.h
  (TALER_exchange_deposit_sign): New func decl.
  (TALER_exchange_deposit_verify): New func decl.

* src/exchange/taler-exchange-httpd_deposits_get.c
  (TEH_handler_deposits_get): Rework to use ‘TALER_exchange_deposit_verify’.

* src/lib/exchange_api_deposits_get.c
  (TALER_EXCHANGE_deposits_get): Rework to use ‘taler_exchange_deposit_sign’.
2022-04-22 20:29:45 -04:00
31c545b9e8
-fixed tests for age restriction, now using correct seed 2022-04-22 15:15:57 +02:00
b84c88fc04
Fixed seed size for TALER_age_restriction_commit
Also, added src/util/tv_age_restriction.{c,json} for/as test vectors for
age restriction.
2022-04-21 14:27:29 +02:00
Christian Grothoff
4af1772f12
-work on create purse with merge 2022-04-20 23:07:44 +02:00
Thien-Thi Nguyen
509657bfef
Add abstraction: TALER_merchant_contract_sign
Additionally, this change removes ‘struct TALER_ProposalDataPS’
from the public API.

* src/include/taler_crypto_lib.h
  (TALER_merchant_contract_sign): New func decl.

* src/include/taler_signatures.h
  (struct TALER_ProposalDataPS): Delete.

* src/util/merchant_signatures.c
  (struct TALER_ProposalDataPS): Move here from taler_signatures.h.
  (TALER_merchant_contract_sign): New func.
2022-04-17 19:53:17 -04:00
Thien-Thi Nguyen
a7ad5a07e2
Add abstractions: TALER_merchant_pay_{sign,verify}
Additionally, this change removes ‘struct TALER_PaymentResponsePS’
from the public API.

* src/include/taler_crypto_lib.h
  (TALER_merchant_pay_sign): New func decl.
  (TALER_merchant_pay_verify): New func decl.

* src/include/taler_signatures.h
  (struct TALER_PaymentResponsePS): Delete.

* src/util/merchant_signatures.c
  (struct TALER_PaymentResponsePS): Move here from taler_signatures.h.
  (TALER_merchant_pay_sign): New func.
  (TALER_merchant_pay_verify): New func.
2022-04-17 04:53:17 -04:00
Christian Grothoff
b91a406525
-finish first implementaation of exchange_api_contracts_get.c 2022-04-11 19:22:30 +02:00
Christian Grothoff
c8c1005297
-add draft handler for purse merge client request 2022-04-11 15:34:45 +02:00
Christian Grothoff
72dd9514aa
-draft implementation of /purses//merge endpoint 2022-04-11 13:52:06 +02:00
Christian Grothoff
6f027fc130
add additinal signature 2022-04-02 17:25:18 +02:00
Christian Grothoff
caf66486e7
work on purse creation logic 2022-04-01 16:39:07 +02:00
Christian Grothoff
747ae5ef09
privatize more signature structs, simplify code 2022-03-31 12:37:39 +02:00
Christian Grothoff
6040c9ff0f
make struct private again 2022-03-30 01:36:52 +02:00
Sebastian
adc9dae4cc
make TALER_RefundConfirmationPS public 2022-03-29 14:12:45 -03:00
Christian Grothoff
074ea7502e
centralize exchange online signature logic 2022-03-29 15:21:49 +02:00
Christian Grothoff
3249687b2a
rename to avoid symbol conflict with musl 2022-03-28 18:18:08 +02:00
Christian Grothoff
a227ee6d1b
-first cut at contract encryption and decryption 2022-03-28 13:57:43 +02:00
Christian Grothoff
ee4077ef80
starting with purse creation client API 2022-03-28 13:19:40 +02:00
30985c0975
-rename variable 2022-03-28 12:34:14 +02:00
ccf2d69dfb
-fix leak in test_age_restriction.c 2022-03-28 12:33:41 +02:00
488d217381
-fix leaks in test_crypto.c 2022-03-28 11:17:49 +02:00
a2386abadb
[age restriction] progress 19/19 (final) - Use Edx25519 for crypto
We switch from EcDSA to Edx25519 for the underlying signature scheme.

Edx25519 is implemented in gnunet, starting with (gnunet-)commit
ce38d1f6c9bd7857a1c3bc2094a0ee9752b86c32.
2022-03-28 11:04:00 +02:00
Christian Grothoff
646c9ad061
fix leak 2022-03-27 05:02:21 +02:00
Christian Grothoff
c782dfe2aa
first draft of service API for p2p payments 2022-03-24 13:06:04 +01:00
Christian Grothoff
41399bc224
revise P2P signatures and signing schema to address recently discovered design concern resulting in the split of the purse key into purse-contract and purse-merge keys 2022-03-23 06:54:43 +01:00
Christian Grothoff
6505f69869
add one more p2p signature 2022-03-22 12:12:00 +01:00
Christian Grothoff
6868b78692
fix typo 2022-03-22 12:06:12 +01:00
Christian Grothoff
e200e86032
implement helper functions for p2p signatures, clean up existing signature logic 2022-03-22 02:33:51 +01:00
Christian Grothoff
1bb5a77c8d
add new reserve status/history signatures 2022-03-20 02:39:28 +01:00
Christian Grothoff
eac8b8c0da
-re-enable test-revocation.sh, works again 2022-03-17 15:06:58 +01:00
Christian Grothoff
12809b28ec
-misc fixes 2022-03-17 14:16:34 +01:00
cd5ee2338c
-ensure label has no zero bytes 2022-03-08 11:47:51 +01:00
Christian Grothoff
5fa977cc05
work on global fee structure 2022-03-05 15:13:07 +01:00
Christian Grothoff
7ff58c3d8f
refactor /wire to include logic to return the wad fee (for W2W payments) 2022-03-05 14:36:55 +01:00
Christian Grothoff
43f8ab6b48
add signing/verifying functions for global fees 2022-03-05 12:04:13 +01:00
Christian Grothoff
4835ddf60b
introduce sets for wire fees and global fees 2022-03-05 11:56:58 +01:00
d0b27833b2
[age restriction] added unit test for get_age_group 2022-03-04 17:00:28 +01:00
Christian Grothoff
1643b745af
use 32 byte hash for hpayto, use that for joins on queries to better align queries with partitions 2022-03-03 23:52:08 +01:00
4c53d42e44
[age restriction] progress 18/n - attestation tested
- Unit-tests for commit, derive, attest and verify added, with multiple
  combinations of minimum age and commited age.
- Fixed crypto implementation (eddsa -> ecdsa)
- Using now standard functionality from GNUNET:
  GNUNET_CRYPTO_ecdsa_{private,public}_key_derive

All tests pass (unit tests in util/ and 'make check' in testing).
2022-03-03 19:35:24 +01:00
10d7d93ad8
-tests now with age restriction 2022-03-02 11:59:21 +01:00
7624db4efd
-refactor TALER_AgeMask.mask -> TALER_AgeMask.bits
also: fix off-by-one in TALER_age_restriction_commit
2022-03-02 10:59:42 +01:00
4978b1e966
-amend missing parts to commit b20ddf0c8
- functions TALER_age_commitment_attest and
      TALER_age_commitment_verify
      implemented.
    - age restriction implementation moved into util/age_restriction.c
2022-03-02 07:58:55 +01:00
b20ddf0c8a
[age restriction] progress 17/n - attestation implemented
- functions TALER_age_commitment_attest and TALER_age_commitment_verify
  implemented.
- age restriction implementation moved into util/age_restriction.c
2022-03-01 19:30:57 +01:00
e9eb00e285
Refactoring TALER_AgeCommitment
Instead of a single struct TALER_AgeCommitment, we now use
 1. TALER_AgeCommitment for the age mask and list public keys for age
    restriciton.
 2. TALER_AgeProof for list of private keys for age restriction
 3. TALER_AgeCommitmentProof for the aggregation of the former two.

Also, we introduce TALER_AgeAttestation as the EDDSA signature to attest
a particular age group, along with the function prototypes
TALER_age_commitment_attest and TALER_age_commitment_verify.
2022-03-01 17:02:37 +01:00
Christian Grothoff
8f77bda2e0
-towards getting auditor tests to pass again with new logic 2022-02-28 16:13:30 +01:00
26158fc725
[age restriction] progress 16/n - refresh/reveal/link tests
Age restriction works now with withdraw, melt/refresh/reveal and link,
including tests.

However, there is still a problem with the tests:  The melting operation
"refresh-melt-failing-age" that should fail (because of conflict), but
currently fails for other reasons.  I decided to disable that particular
test (and the next) and submit the patch I have so far.
2022-02-22 14:34:47 +01:00
3cd6156513
do not clamp EdDSA private keys 2022-02-21 16:08:45 +01:00
Christian Grothoff
544ba42f44
-big renaming of structs for consistent naming with P suffix 2022-02-21 00:23:23 +01:00
Christian Grothoff
19624fd776
-ensure different HKDF is used in melt vs. withdraw 2022-02-20 21:51:46 +01:00
f4f502d037
-minor merge conflict resolves 2022-02-18 00:50:31 +01:00
a78b3345fb
[age restriction] progress 15/n - melt/refresh/reveal and recoup
Added age restriction support for
  - melt/refresh/reveal
  - recoup

However, tests are not yet implemented for those flows.

Also: minor fixes and refactoring.
2022-02-18 00:30:19 +01:00
Christian Grothoff
668342cd41
-fix test_crypto FTBFS 2022-02-17 15:23:05 +01:00
Christian Grothoff
a351bfc4b4
-fix CS nonce reuse check logic 2022-02-17 15:18:09 +01:00
8bdf6ab19d
[age restriction] progress 14/n - withdraw and deposit
Age restriction support for
  - withdraw is done and tested
  - deposit is done and tested

TODOs:
  - melt/refresh/reveal
  - link

------

Added functions
 - TALER_age_restriction_commit
 - TALER_age_commitment_derive
 - TALER_age_commitment_hash
 - TALER_age_restriction_commitment_free_inside
 - Hash of age commitment passed around API boundaries

Exchangedb adjustments for denominations
 - all prepared statements re: denominations now handle age_mask
 - signature parameters adjusted

Hash and signature verification of /keys adjusted
 - Hashes of (normal) denominations and age-restricted denominations are
   calculated seperately
 - The hash of the age-restricted ones will then be added to the other
   hash
 - The total hash is signed/verified

Tests for withdraw with age restriction added
 - TALER_EXCHANGE_DenomPublickey now carries age_mask
 - TALER_TESTING_cmd_withdraw_amount* takes age parameter
 - TALER_TESTING_find_pk takes boolean age_restricted
 - WithdrawState carries age_commitment and its hash
 - withdraw_run derives new age commitment, if applicable
 - Added age parameter to testing (13 as example)

Various Fixes and changes
 - Fixes of post handler for /management/extensions
 - Fixes for offline tool extensions signing
 - Slight refactoring of extensions
 - Age restriction extension simplified
   - config is now global to extension
   - added global TEH_age_restriction_enabled and TEH_age_mask in
     taler-exchange-httpd
   - helper functions and macros introduced
2022-02-16 22:01:05 +01:00
Christian Grothoff
ef938e0f7a
-correctly implement CS idempotency check on withdraw 2022-02-15 17:07:13 +01:00
Christian Grothoff
8ecbdeb55b
-actually, commit phase does take care of this 2022-02-14 23:15:29 +01:00
Christian Grothoff
bd77bcb52d
-towards fixing the protocol 2022-02-14 23:02:25 +01:00
Christian Grothoff
f4f40a31ef
-fixmes 2022-02-14 13:03:26 +01:00
Christian Grothoff
a0d9d59b73
-refactor to address FIXME 2022-02-12 12:20:12 +01:00
Christian Grothoff
88033aa15e
-removed confused TODOs 2022-02-12 12:15:02 +01:00
Christian Grothoff
d581729443
-removed confused TODOs 2022-02-12 12:14:24 +01:00
Christian Grothoff
ea4be7ba6f
-swap argument/rval for nicer code 2022-02-12 11:42:25 +01:00
Christian Grothoff
bc14c215b3
-doxygen fixes 2022-02-12 11:12:33 +01:00
Christian Grothoff
819b67426c
-doxygen fixes 2022-02-12 10:33:23 +01:00
Christian Grothoff
2cdbf58006
-remove redundant comments 2022-02-12 10:05:45 +01:00
Christian Grothoff
c93150b8cd
-work on more FIXMEs 2022-02-12 01:00:31 +01:00
Christian Grothoff
94a5359494
-address misc. fixmes 2022-02-12 00:52:19 +01:00
Christian Grothoff
3b1e742dde
-simplify: nonce no longer hashed 2022-02-11 18:00:20 +01:00
Christian Grothoff
9f77398fe2
-fix use of uninit memory in test 2022-02-11 17:44:18 +01:00