Commit Graph

4798 Commits

Author SHA1 Message Date
Christian Grothoff
aea7fc36c3
-style fix 2022-02-05 00:13:51 +01:00
Christian Grothoff
d81a6c7cf2
-work on reveal 2022-02-05 00:12:58 +01:00
Christian Grothoff
41acdf11b8
make API actually workable, sketch out melt 2022-02-05 00:02:38 +01:00
Christian Grothoff
b30765c7d0
make API actually workable, sketch out melt 2022-02-04 23:58:41 +01:00
Christian Grothoff
cfc6c3fcd0
make API actually workable: 2022-02-04 23:09:19 +01:00
Christian Grothoff
d833966d52
-API work 2022-02-04 22:02:48 +01:00
Christian Grothoff
bd5a25aff2
-fix comment 2022-02-04 21:20:26 +01:00
Christian Grothoff
57dc3cd232
new API 2022-02-04 21:12:54 +01:00
Christian Grothoff
ed136c1f2d
sync 2022-02-04 20:02:16 +01:00
Gian Demarmels
30c92a9b9e
Merge branch 'master' of ssh://git.taler.net/exchange 2022-02-04 19:50:40 +01:00
Gian Demarmels
752c0aca43
uncrustify 2022-02-04 19:50:21 +01:00
Gian Demarmels
37f54d3e5d
exchangedb fix 2022-02-04 19:50:12 +01:00
Christian Grothoff
03fd154a69
messing with CS/RSA fixes 2022-02-04 19:30:15 +01:00
Lucien Heuzeveldt
7d2a1a596a
split .conf files into rsa and cs 2022-02-04 19:24:30 +01:00
Christian Grothoff
9d40bd5a1e
split tests by rsa/cs 2022-02-04 18:45:42 +01:00
Gian Demarmels
a67786078b
resolves merge conflicts 2022-02-04 16:50:32 +01:00
Gian Demarmels
8674f32aec
denomination CIPHER field per denom 2022-02-04 15:39:57 +01:00
Gian Demarmels
086cf05794
refactor TALER_coin_ev_hash 2022-02-04 15:37:34 +01:00
Gian Demarmels
2213012866
include denom_pub into coin_ev_hash 2022-02-04 15:37:34 +01:00
Gian Demarmels
be50c084f8
fixed nonce check, renamed WithdrawNonce 2022-02-04 15:37:33 +01:00
Gian Demarmels
ae5f082c75
repair nonce check 2022-02-04 15:37:33 +01:00
Gian Demarmels
bcc159de17
introduce new type for security module pubkeys 2022-02-04 15:37:32 +01:00
Christian Grothoff
3510f953b0
-make picky gcc happy 2022-02-04 15:37:32 +01:00
Lucien Heuzeveldt
8d85c8b5b6
implement feedback 2022-02-04 15:37:30 +01:00
Christian Grothoff
ea97729ba8
-scope needed 2022-02-04 15:36:51 +01:00
Lucien Heuzeveldt
74ce114b83
change TEH_keys_denomination_sign message parameter 2022-02-04 15:36:48 +01:00
Gian Demarmels
5b7e8f9ac5
refactoring 2022-02-04 15:36:11 +01:00
Lucien Heuzeveldt
daa7fdcfb1
implement spend 2022-02-04 15:36:10 +01:00
Gian Demarmels
9c2aefaa51
removed varargs 2022-02-04 15:36:08 +01:00
Lucien Heuzeveldt
9074e66ebc
implement withdraw (nonce reuse check missing) 2022-02-04 15:35:31 +01:00
Gian Demarmels
4c7aa09784
cleanup 2022-02-04 15:34:22 +01:00
Gian Demarmels
2d70c8c6d0
secmod CS sign implementation 2022-02-04 15:34:21 +01:00
Lucien Heuzeveldt
82405b0ce5
implement CS key handling and csr endpoint 2022-02-04 15:34:19 +01:00
Lucien Heuzeveldt
36f551ff33
set planchet detail cipher, add cipher checks 2022-02-04 15:33:14 +01:00
Lucien Heuzeveldt
106664ed0c
implement TALER_CRYPTO_helper_cs_r_derive and related tests 2022-02-04 15:33:13 +01:00
Lucien Heuzeveldt
875a8b397e
implement secmod cs derive R 2022-02-04 15:33:13 +01:00
Gian Demarmels
d1fd3a485b
revocation 2022-02-04 15:33:13 +01:00
Gian Demarmels
9d9d4413df
setup_key for cs secmod helper 2022-02-04 15:33:12 +01:00
Gian Demarmels
18db69be2d
initial cs_secmod implementation 2022-02-04 15:33:11 +01:00
Gian Demarmels
f239b01be1
secmod cs signatures implementation 2022-02-04 15:33:11 +01:00
Lucien Heuzeveldt
fbb6d03f69
fix const due to changes in TALER_planchet_prepare 2022-02-04 15:33:10 +01:00
Lucien Heuzeveldt
75eff1524a
clean up cs implementation 2022-02-04 15:33:10 +01:00
Lucien Heuzeveldt
cf4fd36cc4
remove varargs in cs crypto implementation 2022-02-04 15:33:09 +01:00
Gian Demarmels
4bcbd704df
utility functions 2022-02-04 15:33:09 +01:00
Gian Demarmels
ca247f6f58
fixed CS signatures and cleanup/refactoring 2022-02-04 15:33:09 +01:00
Lucien Heuzeveldt
3225566c93
implement exchange_api_csr 2022-02-04 15:33:07 +01:00
Gian Demarmels
db9b84970d
add sign and verify implementation 2022-02-04 15:31:50 +01:00
Gian Demarmels
5d2157a8f6
sign_blinded implementation 2022-02-04 15:31:49 +01:00
Gian Demarmels
f1ec1e70a0
implemented planchet_prepare for CS 2022-02-04 15:31:49 +01:00
Gian Demarmels
a02ab8f81b
added CS get R functionality and planchet setup 2022-02-04 15:31:48 +01:00
Gian Demarmels
385eb51e93
CS planchet create and withdraw create 2022-02-04 15:31:48 +01:00
Gian Demarmels
f3fb7c29e6
added CS data structures, implemented CS keypair 2022-02-04 15:31:45 +01:00
e6e0cabf08
test and hopefully fix JSON canonicalization 2022-01-27 20:25:40 +01:00
32f1276b8c
fix RFC 8785 JSON normalization 2022-01-27 15:29:55 +01:00
8684a9bfea
[age_restriction] progress 13/n
- major refactoring of extensions
  - extensions live now in a separate library, libtalerextensions
  - refactored all components using age_restriction accordingly
  - plumbing for plugin support for extensions roughly layed down
2022-01-23 01:36:21 +01:00
1962ed6b0b
improvements in extension handling
- extensions_sig is needed globally
- keep original json with config of extension
- fixed various bugs re: extension handling
2022-01-22 00:26:43 +01:00
0b56de6c99
[age restriction] progress 12/n
- taler-offline-tool now handles extensions
  - command "extensions" added with subcommands "show" and "sign"
  - parses extensions from taler config
  - shows and signs of extensions and their configurations
  - creates signed set of configurations for upload
  - added test for retrieval of extension config

- simplified signature verification for extensions
  - remove per-extension signatures, also from DB schema
  - adjust prepared statements accordingly
  - adjust DB event handler for extensions
  - allow NULL for config for extension in DB schema
  - handler for /management/extensions adjusted to new datastructures

- changed test for TALER_denom_blind/TALER_denom_sign_blinded with and
  without TALER_AgeHash

- minor updates and various fixes
2022-01-21 15:41:02 +01:00
Thien-Thi Nguyen
0b6ebc6160
fix FTBFS (Linux) for 2022-01-18, "use 'pipe' instead of 'eventfd' on non-Linux systems"
add back #include <sys/eventfd.h>, but conditionalize on #ifdef __linux__

(This fix follows the spirit of the other changes (i.e.,
adding #ifdef __linux__) but might not be the best solution.)
2022-01-18 19:34:41 -05:00
Jonathan Buchanan
c10b783521
use 'pipe' instead of 'eventfd' on non-Linux systems 2022-01-18 09:15:54 -05:00
Christian Grothoff
766a291151
fix #7143 2022-01-11 17:56:32 +01:00
Christian Grothoff
e7aeec04f4
The current recoup API is broken. I guess this is another example where "trivial" API changes turn out to have (multiple!) unexpected consequences.
The current "/recoup" API does not have clear idempotency semantics, as we've discussed on the phone.  This is already bad by itself, as it makes it hard to write down what the API does other than "whatever the implementation does".

However, it actually breaks correctness in this (admittedly kinda contrived, but not impossible) case:

Say that we have a coin A obtained via withdrawal and a coin B obtained via refreshing coin A. Now the denominations of A gets revoked..

The wallet does a recoup of A for EUR:1.

Now the denomination of B also gets revoked.  The wallet recoups B (incidentally also for EUR:1) and now A can be recouped again for EUR:1.  But now the exchange is in a state where it will refuse a legitimate recoup request for A because the detection for an idempotent request kicks in.

This is IMHO bad API design, and the exchange should simply always recoup the maximum amount.

Furthermore, we usually follow the principle of "API calls that take up DB space are paid".  With the current recoup API, I can do many tiny recoup requests which the exchange then has to store, right?

I guess it would not be a big change to remove the "amount" value from the recoup/recoup-refresh request bodies, right?

- Florian
2022-01-11 12:47:35 +01:00
Christian Grothoff
aaaaa9a103
fix amount denormalization issue 2022-01-10 09:04:09 +01:00
14efa23a2b
improve error response for withdrawal 2022-01-10 01:23:46 +01:00
e30989c930
[age restriction] progress 11/n
Parse age restriction information from "/keys"
- parse "age_restriction" extension, extract mask for age groups
- parse denominations from "age_restricted_denoms", too, if available
2022-01-10 00:04:23 +01:00
d91750ca0f
drop extensions table 2022-01-08 19:45:19 +01:00
d6bf20028d
Fixed prepared statement for extensions 2022-01-08 19:45:00 +01:00
cc7d7707ab
[age restriction] progress 10/n
More work towards support for extensions:
- Prepared statements and DB-plugin-functions for setting and retrieving
  configurations from the database added.
- primitive "registry" of extensions for age restrictions and peer2peer
  (stub)
- TALER_Extensions now with FP for parsing, setting and converting a
  configuration.
- /management/extensions handler now verifies signature of the (opaque)
  json object for all extensions.
- /management/extensions handler calls the FP in the corrensponding
  TALER_Extension for parsing and setting the configuration of a
  particular extension

More work towards age restriction:
- TALER_Extensions interfaces for config-parser, -setter and converter
  implemented for age restriction
- DB event handler now retrieves config from database, parses it and
  sets it (the age mask) in the global extension.
- load_age_mask now loads age mask from the global extension (and not
  from the config file)
- add age_restricted_denoms to /keys response
2022-01-08 14:40:20 +01:00
Christian Grothoff
b49fac3d58
-introduce new convenience macro 2021-12-31 11:23:42 +01:00
Christian Grothoff
5cd2bc5de3
-cleanup 2021-12-28 15:36:26 +01:00
ef4238874f
[age restriction] progress 9/n
More worke towards support for extensions and age restriction:

- taler-exchange-httpd_management_extensions.c almost completed
  - handling of request implemented
  - stub "set_extensions" for database transaction added

- utility functions added
  - TALER_exchange_offline_extension_agemask_{sign,verify}
  - TALER_agemask_parse_json
2021-12-27 23:24:48 +01:00
Christian Grothoff
070f442a11
resolve #7124: ensure -s also deletes work_shards 2021-12-26 13:05:39 +01:00
Christian Grothoff
e7d4183d1c
-fix FTBFS 2021-12-25 17:22:54 +01:00
Christian Grothoff
74e4c6429a
clean up refresh-reveal logic, reducing local copying 2021-12-25 16:13:06 +01:00
Christian Grothoff
f6ecb6c895
-eliminate redundant hash operation on link signatures 2021-12-25 15:39:01 +01:00
Christian Grothoff
84c9adf5a6
v12: also do not sign over merchant_pub in REFUND signature, centralize logic 2021-12-25 14:58:04 +01:00
Christian Grothoff
1c34489905
-add missing #include 2021-12-25 14:08:47 +01:00
Christian Grothoff
87376e02eb
protocol v12 changes (/recoup split, signature changes) plus database sharding plus O(n^2)=>O(n) worst-case complexity reduction on coin balance checks 2021-12-25 13:56:40 +01:00
Christian Grothoff
2c14d33870
deduplicate melt signing logic, remove coin_pub from data being signed over 2021-12-25 13:56:40 +01:00
1b23857f2c
[age restriction] progress 8/n
More work towards support for extensions and age restriction

- updated gana
- added handler for DB-Event
- added TEH_extensions_init() and _done()
- added global for age restriction
- added stub for post handler
- added SQL-table for extension metadata
- added enum type for extensions and other data structures

Also:
- fixed some warnings -Wmaybe-unitialized
2021-12-23 15:15:33 +01:00
Christian Grothoff
62444504f7
denormalize reserve_pub in reserve tables to enable sharding 2021-12-19 13:43:33 +01:00
Christian Grothoff
527d903678
add new wrappers around merchant hash codes for tips and pickups 2021-12-19 11:54:07 +01:00
Christian Grothoff
1acc851deb
-fix recoup ugliness 2021-12-16 20:18:44 +01:00
Christian Grothoff
3b6a0dd599
compat 2021-12-15 17:02:11 +01:00
Christian Grothoff
110fe5b640
-fix FTBFS 2021-12-15 11:38:57 +01:00
Christian Grothoff
fdfcb29027
-fix FTBFS 2021-12-15 11:36:36 +01:00
Christian Grothoff
8cb0b890d3
fix test_sq: 2021-12-15 10:28:52 +01:00
Christian Grothoff
f4e3d9f716
-die pthread.h 2021-12-14 17:01:52 +01:00
Christian Grothoff
4cd70bc0a7
fix shard delay calculation also for 'transfer' tool 2021-12-14 16:26:10 +01:00
Christian Grothoff
1a1fafbd43
introducing GNUNET_TIME_Timestamp, recoup now with amounts 2021-12-14 16:04:40 +01:00
Christian Grothoff
bf54ee30d4
experiment 2021-12-13 12:28:28 +01:00
Christian Grothoff
a25429cadd
fix #7123 2021-12-11 20:06:15 +01:00
Christian Grothoff
40175318e9
towards simplified / more efficient /recoup 2021-12-11 15:39:24 +01:00
Christian Grothoff
4eb958846f
-more logging, less hanging ;-) 2021-12-11 14:03:08 +01:00
Christian Grothoff
386301d1cf
-was integrated 2021-12-09 23:17:15 +01:00
Christian Grothoff
4c8b99f333
-note FIXME 2021-12-09 23:16:55 +01:00
Christian Grothoff
fba91c63d5
introduce stored procedure for coin balance check 2021-12-09 23:13:39 +01:00
Christian Grothoff
889625a90f
fix idle transaction issue introduced earlier 2021-12-09 22:15:30 +01:00
Christian Grothoff
6dd4a90abd
fix fakebank issue with timeouts in multi-threaded mode resulting in NPE 2021-12-09 22:14:42 +01:00
Christian Grothoff
6c57b33746
-fix warning 2021-12-09 16:44:40 +01:00
Christian Grothoff
ac4247f53a
-note on #7124 2021-12-09 14:40:06 +01:00
Christian Grothoff
a7b4cc97ec
minimize idle in transaction from wirewatcher 2021-12-09 14:05:23 +01:00
Christian Grothoff
ce28d3b8e4
add latency logging 2021-12-09 13:29:07 +01:00
dcb73693dd
crypto worker: eddsa signing 2021-12-09 10:38:12 +01:00
Christian Grothoff
5433c2a475
be more backwards-compatible 2021-12-08 21:14:36 +01:00
Christian Grothoff
7fdcec4c3c
-complete 'melt.sql', in theory 2021-12-08 20:52:23 +01:00
Christian Grothoff
e0700ad916
optimize /deposit logic to minimize serialization failures (presumably) 2021-12-08 20:33:14 +01:00
Christian Grothoff
21951eacc2
quick hack to see about improving melt serialization failures 2021-12-08 18:22:07 +01:00
Christian Grothoff
7e84b5570a
fix error handling for very large uploads, fix re-generation of /keys response after Expires expires 2021-12-08 18:12:28 +01:00
Christian Grothoff
ed7379d235
consider key rotation frequency instead of earliest expiration for Expire header 2021-12-08 16:11:52 +01:00
Christian Grothoff
b64f718037
more aggressive rollback on failures 2021-12-08 16:11:52 +01:00
54177c6e1d
crypto worker: remove unused args 2021-12-08 16:05:21 +01:00
ec4c531cc6
crypto worker: fix refresh planchet setup 2021-12-08 16:01:57 +01:00
a00cebcced
put crypto worker in exchange-tools, re-enable build 2021-12-08 15:54:48 +01:00
Christian Grothoff
9d3f7d3a56
move ensure_coin_known for melt and recoup outside of transaction, more logging 2021-12-08 15:18:40 +01:00
Christian Grothoff
2e6e2387b8
logging 2021-12-08 14:53:22 +01:00
Boss Marco
5d765a294a
fix prometheus metric labels 2021-12-08 14:43:12 +01:00
Christian Grothoff
32e185978f
tolerate missing 'Expire' header better 2021-12-08 14:33:13 +01:00
Christian Grothoff
c1aaafca91
-fix syntax 2021-12-08 14:32:54 +01:00
Christian Grothoff
98e44f33a7
add missing preflight 2021-12-08 12:42:22 +01:00
Christian Grothoff
a727348638
-wip 2021-12-08 11:53:27 +01:00
Christian Grothoff
be9cd04150
-fix ftbfs 2021-12-08 09:21:08 +01:00
Christian Grothoff
356c59ebb6
-improve graphana compatibility 2021-12-08 08:57:09 +01:00
Christian Grothoff
add2d29acf
implement basic /metrics 2021-12-07 21:27:08 +01:00
Christian Grothoff
71933dd2e9
add basic metrics collection logic 2021-12-07 21:16:38 +01:00
Christian Grothoff
8be9de6675
implement dummy /metrics handler 2021-12-07 21:02:36 +01:00
Christian Grothoff
175f5b2495
-comment 2021-12-07 13:57:39 +01:00
Christian Grothoff
7dcd217b60
-fix balance calculation 2021-12-06 16:37:32 +01:00
Christian Grothoff
f3629bdafc
improve SQL comments 2021-12-06 15:15:59 +01:00
Christian Grothoff
6ba9f934c4
-add FIXMEs 2021-12-05 19:23:16 +01:00
Christian Grothoff
bb6c11ad9e
take insertion into known_coins outside of main melt transaction to reduce conflict potential 2021-12-05 18:14:48 +01:00
Christian Grothoff
19de0f604f
change order of statements when making coin known to possibly reduce serialization failures 2021-12-05 17:59:02 +01:00
Christian Grothoff
67de20d26e
major rework of withdraw transaction to use stored procedure and (presumably) reduce serialization failures by avoiding SELECT before INSERT 2021-12-05 17:16:00 +01:00
Christian Grothoff
c0d2af8a49
-fix withdraw logic idempotency broken yesterday: did not handle expired DKs nicely 2021-12-05 08:58:12 +01:00
Christian Grothoff
e61a53806e
save 2ms on deposit by not doing idempotency check twice 2021-12-04 23:24:50 +01:00
Christian Grothoff
ec45eaae18
more logging 2021-12-03 16:16:19 +01:00
Christian Grothoff
dfe245814c
reduce lock contention in RSA secmod 2021-12-02 17:25:57 +01:00
Christian Grothoff
ae866fc45d
-fix FTBFS 2021-12-02 14:35:45 +01:00
Christian Grothoff
3a5eb9285c
-fix FTBFS 2021-12-02 14:33:22 +01:00
Christian Grothoff
5ad1d0d3dd
-add disable invariants 2021-12-02 14:32:05 +01:00
Christian Grothoff
b3e4159c2e
more perf debug messages 2021-12-02 14:11:14 +01:00
Christian Grothoff
bbdc7649f7
add -I command line option 2021-12-02 13:31:20 +01:00
Christian Grothoff
5a7dd00125
improve suicide logic 2021-12-02 08:02:20 +01:00
Christian Grothoff
e8fc5d8d5c
-fix command to avoid timing-dependent assertion failure 2021-12-02 06:41:49 +01:00
Christian Grothoff
170402203a
make check case-insensitive 2021-12-01 17:56:47 +01:00
7373bbc5c8
Merge branch 'master' of ssh://git.taler.net/exchange 2021-12-01 15:27:56 +01:00
54c62f3ab9
[age restriction] progress 6/n
lift logic for detection of age restriction of a denomination out from
taler-exchange-secmod-rsa.c to taler-exchange_httpd_keys.c
2021-12-01 15:25:33 +01:00
bed2a422a5
-basedb 2021-12-01 15:04:57 +01:00
ebc5f4f986
fix auditor test case, re-generate basedbs 2021-12-01 14:21:35 +01:00
Thien-Thi Nguyen
41aba39f0f
move var decl to proper scope (where it's used) 2021-12-01 02:54:50 -05:00
Christian Grothoff
c47cb65fb8
-nicer suicide 2021-11-30 22:57:20 +01:00