Compare commits

...

19 Commits

Author SHA1 Message Date
9865febb17
Merge branch 'master' of ssh://git.taler.net/exchange 2022-06-26 17:10:41 +02:00
Christian Grothoff
372a103a80
-more doxygen 2022-06-26 17:09:33 +02:00
Christian Grothoff
2443ee672d
-more typos 2022-06-26 17:09:33 +02:00
Christian Grothoff
7b62174d00
-fix typos 2022-06-26 17:09:30 +02:00
Christian Grothoff
2508d4bb5c
-add missing comments 2022-06-26 17:08:17 +02:00
Christian Grothoff
fd9fc9f0cd
-fix misc doxygen warnings, code clean up 2022-06-26 17:08:17 +02:00
Christian Grothoff
646c410ace
-add auditor_priv_file 2022-06-26 17:08:16 +02:00
Christian Grothoff
5575194afd
-fix path 2022-06-26 17:08:16 +02:00
Christian Grothoff
ea21572b54
-fix path 2022-06-26 17:08:16 +02:00
Christian Grothoff
ce515a1f75
-make econtract optional as per design 2022-06-26 17:08:16 +02:00
Christian Grothoff
eb4c765e30
-more doxygen 2022-06-26 15:37:38 +02:00
Christian Grothoff
07be0fd21d
-more typos 2022-06-26 15:05:37 +02:00
Christian Grothoff
3b9e9eed11
-fix typos 2022-06-25 21:50:32 +02:00
Christian Grothoff
76ad5baec7
-add missing comments 2022-06-25 21:18:40 +02:00
Christian Grothoff
5b800f800a
-fix misc doxygen warnings, code clean up 2022-06-25 20:38:31 +02:00
Christian Grothoff
64ad01dba7
-add auditor_priv_file 2022-06-24 13:10:23 +02:00
Christian Grothoff
40856734e8
-fix path 2022-06-24 13:08:57 +02:00
Christian Grothoff
6dfa18c2c4
-fix path 2022-06-24 13:08:27 +02:00
Christian Grothoff
b390d1a6e6
-make econtract optional as per design 2022-06-23 23:09:45 +02:00
52 changed files with 482 additions and 251 deletions

View File

@ -22,6 +22,12 @@
<anchorfile>microhttpd.h</anchorfile> <anchorfile>microhttpd.h</anchorfile>
<arglist></arglist> <arglist></arglist>
</member> </member>
<member kind="define">
<type>#define</type>
<name>MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS</name>
<anchorfile>microhttpd.h</anchorfile>
<arglist></arglist>
</member>
<member kind="define"> <member kind="define">
<type>#define</type> <type>#define</type>
<name>MHD_HTTP_BAD_REQUEST</name> <name>MHD_HTTP_BAD_REQUEST</name>

View File

@ -6,7 +6,7 @@
% %
% %
% Glossareintraege --> referenz, name, beschreibung % Glossareintraege --> reference, name, beschreibung
% Aufruf mit \gls{...} % Aufruf mit \gls{...}
% %
% \newglossaryentry{non-repudiation}{name={non-repudiation},plural={non-repudiation},description={After a message is signed, one can not dispute that a message was signed}} % \newglossaryentry{non-repudiation}{name={non-repudiation},plural={non-repudiation},description={After a message is signed, one can not dispute that a message was signed}}

View File

@ -51,7 +51,7 @@ In scope are all necessary changes on the protocol(s) and components for the fol
\item design and implement a protocol where the user proves to the exchange the knowledge of the coin that is to be signed (optional) \item design and implement a protocol where the user proves to the exchange the knowledge of the coin that is to be signed (optional)
\end{itemize} \end{itemize}
Out of scope is production readyness of the implementation. Out of scope is production readiness of the implementation.
This is because changes in the protocos and code need to be thoroughly vetted to ensure that no weaknesses or security vulnerabilities were introduced. This is because changes in the protocos and code need to be thoroughly vetted to ensure that no weaknesses or security vulnerabilities were introduced.
Such an audit is out of scope for the thesis and is recommended to be performed in the future. Such an audit is out of scope for the thesis and is recommended to be performed in the future.
The iOS wallet will not be considered in this work. The iOS wallet will not be considered in this work.

View File

@ -141,7 +141,6 @@ This can be used to detect compromised signing keys or a malicious exchange.
\subsection{Properties} \subsection{Properties}
\label{sec:taler-properties} \label{sec:taler-properties}
%Alle Taler Eigenschaften die wir angreifen wollen auflisten und bezug nehmen wie diese erreicht werden
This section describes Taler's properties. This section describes Taler's properties.
\subsubsection{Free Software} \subsubsection{Free Software}
@ -299,7 +298,7 @@ If verification is successful, only Alice knows her private key and Bob uses Ali
A digital signature scheme has a message space M, a signature space S and three algorithms: A digital signature scheme has a message space M, a signature space S and three algorithms:
\begin{itemize} \begin{itemize}
\item Key generation: $(pk,sk) \gets keyGen()$ \item Key generation: $(pk,sk) \gets keyGen()$
\item Signatue generation: $s \gets $sign$_sk(m)$ \item Signature generation: $s \gets $sign$_sk(m)$
\item Verification: $ v \gets $verify$_pk(m,s)$ where $v \in {0,1}$ \item Verification: $ v \gets $verify$_pk(m,s)$ where $v \in {0,1}$
\end{itemize} \end{itemize}
If the result of the verification algorithm equals 1, a signature for m is called valid. If the result of the verification algorithm equals 1, a signature for m is called valid.
@ -783,7 +782,7 @@ A good introduction to cut and choose protocols gives the Paper from Claude Cré
The expression cut-and-choose was later introduced by David Chaum in analogy to a popular cake sharing problem: The expression cut-and-choose was later introduced by David Chaum in analogy to a popular cake sharing problem:
Given a complete cake to be shared among two parties distrusting of each other (for reasons of serious appetite). Given a complete cake to be shared among two parties distrusting of each other (for reasons of serious appetite).
A fair way for them to share the cake is to have one of them cut the cake in two equals hares, and let the other one choose his favourite share. A fair way for them to share the cake is to have one of them cut the cake in two equals hares, and let the other one choose his favourite share.
This solution guarantes that it is in the formers best interest to cut the shares as evenly as possible." This solution guarantees that it is in the formers best interest to cut the shares as evenly as possible."
} }
\end{center} \end{center}
@ -870,10 +869,10 @@ Figure \ref{fig:withdraw-loophole-exploit} explains how such a payment would wor
Note that we omitted the parts leading up to the coin creation (contract, agreement of price, number of coins and their denominations). Note that we omitted the parts leading up to the coin creation (contract, agreement of price, number of coins and their denominations).
This is how it works on a high level: This is how it works on a high level:
\begin{enumerate} \begin{enumerate}
\item The malicous merchant generates and blinds coins, which are then transmitted to the customer \item The malicious merchant generates and blinds coins, which are then transmitted to the customer
\item The customer authorizes the withdraw from his reserve by signing the blinded coins with the private key of his reserve, thus generating withdraw confirmations. \item The customer authorizes the withdraw from his reserve by signing the blinded coins with the private key of his reserve, thus generating withdraw confirmations.
\item The withdraw confirmations are transmitted to the exchange, which generates the signatures and returns them to the malicous merchant. \item The withdraw confirmations are transmitted to the exchange, which generates the signatures and returns them to the malicious merchant.
\item The malicous merchant unblinds the signatures. \item The malicious merchant unblinds the signatures.
He is now in possession of the coin, thus the payment is completed. He is now in possession of the coin, thus the payment is completed.
\end{enumerate} \end{enumerate}
@ -882,7 +881,7 @@ This is how it works on a high level:
\resizebox{1.0\textwidth}{!}{$\displaystyle \resizebox{1.0\textwidth}{!}{$\displaystyle
\begin{array}{ l c l} \begin{array}{ l c l}
% preliminaries % preliminaries
\textbf{Customer} & & \textbf{malicous Merchant} \textbf{Customer} & & \textbf{malicious Merchant}
\\ \text{knows:} & & \text{knows:} \\ \text{knows:} & & \text{knows:}
\\ \text{reserve keys } w_s, W_p \\ \text{reserve keys } w_s, W_p
\\ \text{denomination public key } D_p = \langle e, N \rangle & & \text{denomination public key } D_p = \langle e, N \rangle \\ \text{denomination public key } D_p = \langle e, N \rangle & & \text{denomination public key } D_p = \langle e, N \rangle
@ -903,7 +902,7 @@ This is how it works on a high level:
\\ \\
\hline \hline
\\ \\
\textbf{malicous Merchant} & & \textbf{Exchange} \textbf{malicious Merchant} & & \textbf{Exchange}
\\\text{knows:} & & \text{knows:} \\\text{knows:} & & \text{knows:}
\\& & \text{reserve public key } W_p \\& & \text{reserve public key } W_p
\\ \text{denomination public key } D_p = \langle e, N \rangle & & \text{denomination keys } d_s, D_p \\ \text{denomination public key } D_p = \langle e, N \rangle & & \text{denomination keys } d_s, D_p
@ -949,7 +948,6 @@ Chapter 4.1.4 describes more general aspects as well as the contract header and
\subsubsection{Spend Protocol} \subsubsection{Spend Protocol}
The payment process begins when a customer submits a shopping cart (one or more items to buy) and commits his intent to buy them. The payment process begins when a customer submits a shopping cart (one or more items to buy) and commits his intent to buy them.
The merchant has a key pair skM, pkM of which the customer knows the public key. The merchant has a key pair skM, pkM of which the customer knows the public key.
% besseres Wort als commit?
Note that certain details contained in contract header or deposit permission like merchant \ac{KYC} information, deposit and refund deadlines and fees are left out. Note that certain details contained in contract header or deposit permission like merchant \ac{KYC} information, deposit and refund deadlines and fees are left out.
The deposit state machine can be seen in figure \ref{fig:deposit:states}. The deposit state machine can be seen in figure \ref{fig:deposit:states}.
\begin{figure}[htp] \begin{figure}[htp]
@ -1033,7 +1031,7 @@ In cases where there are multiple deposit permissions (meaning that multiple coi
\item Is the signature of the coin valid? \item Is the signature of the coin valid?
\item Is $ f $ (the value to be spent) smaller or equal the residual value of the coin (check for overspending attempt)? \item Is $ f $ (the value to be spent) smaller or equal the residual value of the coin (check for overspending attempt)?
\end{itemize} \end{itemize}
If all checks are successful, the exchange saves the deposit record containing the deposit permission and its signature in a database, substracts the spent value from the residual value of the coin and schedules the money transfer to the merchant's account $ A_m $ (grouping payments is done to reduce payment fees). If all checks are successful, the exchange saves the deposit record containing the deposit permission and its signature in a database, subtracts the spent value from the residual value of the coin and schedules the money transfer to the merchant's account $ A_m $ (grouping payments is done to reduce payment fees).
\\The exchange calculates a deposit confirmation signature $ \sigma_{DC} $ for the deposit permission with the exchange signing private key and returns them to the merchant. \\The exchange calculates a deposit confirmation signature $ \sigma_{DC} $ for the deposit permission with the exchange signing private key and returns them to the merchant.
\\This signature is also used to prove that a merchant was the first to receive payment from a certain coin. \\This signature is also used to prove that a merchant was the first to receive payment from a certain coin.
Without this, an evil exchange could later deny confirming a payment and claim double spending. Without this, an evil exchange could later deny confirming a payment and claim double spending.

View File

@ -370,7 +370,7 @@ GNUNET_CRYPTO_cs_unblind (
struct GNUNET_CRYPTO_CsS *signature_scalar); struct GNUNET_CRYPTO_CsS *signature_scalar);
\end{lstlisting} \end{lstlisting}
The verify API takes the message and its signature with the public key and returns GNUNET\_OK for a valid signature and GNUNET\_SYSERR otherwhise. The verify API takes the message and its signature with the public key and returns GNUNET\_OK for a valid signature and GNUNET\_SYSERR otherwise.
See listing \ref{lst:crypto-verify-api}. See listing \ref{lst:crypto-verify-api}.
\begin{lstlisting}[style=bfh-c,language=C,, caption={GNUnet verify API}, label={lst:crypto-verify-api}] \begin{lstlisting}[style=bfh-c,language=C,, caption={GNUnet verify API}, label={lst:crypto-verify-api}]
@ -411,7 +411,7 @@ In crypto.c many utility functions are provided to create planchets (for planche
One difference between \gls{RSABS} and \gls{CSBS} is, that the coin private key and RSA blinding secret can be created at the same point in time, since the RSA blinding secret is created randomly. One difference between \gls{RSABS} and \gls{CSBS} is, that the coin private key and RSA blinding secret can be created at the same point in time, since the RSA blinding secret is created randomly.
However, for Clause Blind Schnorr secrets an additional step is needed, the public $R_0$ and $R_1$ are required to calculate the blinding seed to derive the secrets. However, for Clause Blind Schnorr secrets an additional step is needed, the public $R_0$ and $R_1$ are required to calculate the blinding seed to derive the secrets.
A planchet in the Clause Blind Schnorr Signature Scheme can be created as followed (implementation details ommited). A planchet in the Clause Blind Schnorr Signature Scheme can be created as followed (implementation details omitted).
\begin{enumerate} \begin{enumerate}
\item Create planchet with new \ac{EdDSA} private key \item Create planchet with new \ac{EdDSA} private key

View File

@ -94,8 +94,8 @@ The corresponding crypto helper, that talks with the security module, and its te
\item \texttt{src/util/test\_helper\_cs.c}: Tests and benchmarks for the \gls{CSBS} crypto helper \item \texttt{src/util/test\_helper\_cs.c}: Tests and benchmarks for the \gls{CSBS} crypto helper
\end{itemize} \end{itemize}
% Crypto API offene Punkte: % Crypto API offene Punkte:
%Input-Validierung von Punkten und Skalar %Input-validation of points and scalars:
% Clamping beschreiben: https://neilmadden.blog/2020/05/28/whats-the-curve25519-clamping-all-about/ % describe clamping: https://neilmadden.blog/2020/05/28/whats-the-curve25519-clamping-all-about/
% Testing: inverse operations, blinded signature test % Testing: inverse operations, blinded signature test

View File

@ -112,7 +112,7 @@ RSA 1024 is in some situations faster than the \gls{CSBS} implementation.
Note that 1024 bit keys are not recommended for many use cases, but the highest currently known RSA factorization done is 829 bits \cite{enwiki:1055393696}. Note that 1024 bit keys are not recommended for many use cases, but the highest currently known RSA factorization done is 829 bits \cite{enwiki:1055393696}.
The following section \ref{sec:disc-risk} explains the risk running RSA 1024 or \gls{CSBS} denominations further.\\ The following section \ref{sec:disc-risk} explains the risk running RSA 1024 or \gls{CSBS} denominations further.\\
The blind and unblind operations are running in a wallet implementation, therefore the comparison with RSA 1024 is very interesting for devices with less CPU power. The blind and unblind operations are running in a wallet implementation, therefore the comparison with RSA 1024 is very interesting for devices with less CPU power.
Comparison of such hardware can be found in appendix \ref{chap:app-perf}, these comparison results come to the same conlcusion.\\ Comparison of such hardware can be found in appendix \ref{chap:app-perf}, these comparison results come to the same conclusion.\\
Although RSA 1024 bit is much faster in the blinding operation, \gls{CSBS} still perform better when calculating the blinding and unblinding operations together. Although RSA 1024 bit is much faster in the blinding operation, \gls{CSBS} still perform better when calculating the blinding and unblinding operations together.
\gls{CSBS} unblinding computes only an addition of two scalars $s + \alpha \mod p$, while RSA computes $s * r^{-1}$. \gls{CSBS} unblinding computes only an addition of two scalars $s + \alpha \mod p$, while RSA computes $s * r^{-1}$.
To conclude, \gls{CSBS} are faster than RSA 1024 bit and provide a better level of security. To conclude, \gls{CSBS} are faster than RSA 1024 bit and provide a better level of security.
@ -205,7 +205,7 @@ The disk space comparison for a wallet can be found in \ref{tab:comp-wallet-spac
These are theoretical calculations, implementations may choose to persist additional values. These are theoretical calculations, implementations may choose to persist additional values.
\end{bfhWarnBox} \end{bfhWarnBox}
The reasons that \gls{CSBS} use less bandwidth is mostly because the signature/key sizes are much smaller. The reasons that \gls{CSBS} use less bandwidth is mostly because the signature/key sizes are much smaller.
The bandwith improvements for the \texttt{/keys} API is the same as specified in the table with disk space comparison \ref{tab:comp-sign-space}. The bandwidth improvements for the \texttt{/keys} API is the same as specified in the table with disk space comparison \ref{tab:comp-sign-space}.
For \gls{CSBS} many calculations are performed twice, therefore also two values are submitted. For \gls{CSBS} many calculations are performed twice, therefore also two values are submitted.
Table \ref{tab:comp-band-withd} compares the bandwidth used in a withdrawal. Table \ref{tab:comp-band-withd} compares the bandwidth used in a withdrawal.
The 32 byte values $2 * n_w, 2 * D_p, R_0, R_1, s,W_p, c_0, c_1, \sigma_W$ as well as an integer $b$ are transmitted for \gls{CSBS}.\\ The 32 byte values $2 * n_w, 2 * D_p, R_0, R_1, s,W_p, c_0, c_1, \sigma_W$ as well as an integer $b$ are transmitted for \gls{CSBS}.\\
@ -222,14 +222,14 @@ Depending on the hash size another 32 byte (or 64 byte) value is transmitted.
\setupBfhTabular \setupBfhTabular
\begin{tabular}{lccr} \begin{tabular}{lccr}
\rowcolor{BFH-tablehead} \rowcolor{BFH-tablehead}
\textbf{Signature Scheme} & \textbf{Bandwith used} & \textbf{Factor} & \textbf{1M coins}\\\hline \textbf{Signature Scheme} & \textbf{Bandwidth used} & \textbf{Factor} & \textbf{1M coins}\\\hline
CS 256 bits & 356 bytes & 1x & 324 MB\\\hline CS 256 bits & 356 bytes & 1x & 324 MB\\\hline
RSA 1024 bit & 448 bytes & 1.3x & 448 MB \\\hline RSA 1024 bit & 448 bytes & 1.3x & 448 MB \\\hline
RSA 2048 bit & 832 bytes & 2.5x & 832 MB\\\hline RSA 2048 bit & 832 bytes & 2.5x & 832 MB\\\hline
RSA 3072 bit & 1216 bytes & 3.75x & 1216 MB\\\hline RSA 3072 bit & 1216 bytes & 3.75x & 1216 MB\\\hline
RSA 4096 bit & 1600 bytes & 4.9x & 1600 MB\\\hline RSA 4096 bit & 1600 bytes & 4.9x & 1600 MB\\\hline
\end{tabular} \end{tabular}
\caption{Bandwith comparison withdrawal} \caption{Bandwidth comparison withdrawal}
\label{tab:comp-band-withd} \label{tab:comp-band-withd}
\end{table} \end{table}

View File

@ -25,7 +25,7 @@ The thesis provides several results to add support for Schnorr's blind signature
\end{itemize} \end{itemize}
\item Comparison and Analysis \item Comparison and Analysis
\begin{itemize} \begin{itemize}
\item Performance (speed, space, latency \& bandwith) \item Performance (speed, space, latency \& bandwidth)
\item Security \item Security
\item Scheme Comparison \item Scheme Comparison
\end{itemize} \end{itemize}
@ -58,7 +58,7 @@ A security audit should always be made when implementing big changes like these.
As mentioned in the scope section, the optional goal to find and implement a good solution for the withdraw loophole was dropped. As mentioned in the scope section, the optional goal to find and implement a good solution for the withdraw loophole was dropped.
This was due to the scope shift and because the analysis of the problem showed that finding a good solution needs more research and is a whole project in itself (see \ref{sec:scope} for more information).\\ This was due to the scope shift and because the analysis of the problem showed that finding a good solution needs more research and is a whole project in itself (see \ref{sec:scope} for more information).\\
Furthermore, \gls{CSBS} could be implemented on other curves. Furthermore, \gls{CSBS} could be implemented on other curves.
For example Curve448 \cite{cryptoeprint:2015:625} could be used, as it provides 224 bits of security, wheras \gls{25519} \cite{bern:curve25519} provides about 128 bits of security. For example Curve448 \cite{cryptoeprint:2015:625} could be used, as it provides 224 bits of security, whereas \gls{25519} \cite{bern:curve25519} provides about 128 bits of security.
Curve secp256k1 could further improve \gls{CSBS} performance. Curve secp256k1 could further improve \gls{CSBS} performance.
While providing support for Curve448 should not be problematic, a potential implementation for secp256k1 needs further analysis (see \cite{bernlange:safecurves} and \cite{bip:schnorr-bitc} for more information). While providing support for Curve448 should not be problematic, a potential implementation for secp256k1 needs further analysis (see \cite{bernlange:safecurves} and \cite{bip:schnorr-bitc} for more information).

View File

@ -1,6 +1,3 @@
[arm]
CONFIG = /research/taler/exchange/src/auditor/auditor-basedb.conf
[benchmark] [benchmark]
MERCHANT_DETAILS = merchant_details.json MERCHANT_DETAILS = merchant_details.json
BANK_DETAILS = bank_details.json BANK_DETAILS = bank_details.json
@ -184,4 +181,3 @@ TALER_CACHE_HOME = $TALER_HOME/.cache/taler/
TALER_CONFIG_HOME = $TALER_HOME/.config/taler/ TALER_CONFIG_HOME = $TALER_HOME/.config/taler/
TALER_DATA_HOME = $TALER_HOME/.local/share/taler/ TALER_DATA_HOME = $TALER_HOME/.local/share/taler/
TALER_HOME = ${PWD}/generate_auditordb_home/ TALER_HOME = ${PWD}/generate_auditordb_home/

View File

@ -1442,7 +1442,7 @@ BEGIN
PERFORM create_partitioned_table( PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I' 'CREATE TABLE IF NOT EXISTS %I'
'(aggregation_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE' '(aggregation_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE'
',deposit_serial_id INT8 PRIMARY KEY' -- REFERENCES deposits (deposit_serial_id) ON DELETE CASCADE' -- FIXME chnage to coint_pub + deposit_serial_id for more efficient depost -- or something else ??? ',deposit_serial_id INT8 PRIMARY KEY' -- REFERENCES deposits (deposit_serial_id) ON DELETE CASCADE' -- FIXME change to coint_pub + deposit_serial_id for more efficient depost -- or something else ???
',wtid_raw BYTEA NOT NULL' -- CONSTRAINT wire_out_ref REFERENCES wire_out(wtid_raw) ON DELETE CASCADE DEFERRABLE' ',wtid_raw BYTEA NOT NULL' -- CONSTRAINT wire_out_ref REFERENCES wire_out(wtid_raw) ON DELETE CASCADE DEFERRABLE'
') %s ;' ') %s ;'
,table_name ,table_name
@ -16989,4 +16989,3 @@ ALTER TABLE ONLY public.signkey_revocations
-- --
-- PostgreSQL database dump complete -- PostgreSQL database dump complete
-- --

View File

@ -1,6 +1,3 @@
[arm]
CONFIG = /research/taler/exchange/src/auditor/batch.conf
[benchmark] [benchmark]
MERCHANT_DETAILS = merchant_details.json MERCHANT_DETAILS = merchant_details.json
BANK_DETAILS = bank_details.json BANK_DETAILS = bank_details.json

View File

@ -3,6 +3,9 @@ DB = postgres
TINY_AMOUNT = TESTKUDOS:0.01 TINY_AMOUNT = TESTKUDOS:0.01
BASE_URL = http://localhost:8083/ BASE_URL = http://localhost:8083/
# Where do we store the auditor's private key?
AUDITOR_PRIV_FILE = ${TALER_DATA_HOME}/auditor/offline-keys/auditor.priv
[exchange-account-1] [exchange-account-1]
PAYTO_URI = payto://x-taler-bank/localhost/Exchange PAYTO_URI = payto://x-taler-bank/localhost/Exchange
enable_debit = yes enable_debit = yes

View File

@ -1442,7 +1442,7 @@ BEGIN
PERFORM create_partitioned_table( PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I' 'CREATE TABLE IF NOT EXISTS %I'
'(aggregation_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE' '(aggregation_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE'
',deposit_serial_id INT8 PRIMARY KEY' -- REFERENCES deposits (deposit_serial_id) ON DELETE CASCADE' -- FIXME chnage to coint_pub + deposit_serial_id for more efficient depost -- or something else ??? ',deposit_serial_id INT8 PRIMARY KEY' -- REFERENCES deposits (deposit_serial_id) ON DELETE CASCADE' -- FIXME change to coint_pub + deposit_serial_id for more efficient depost -- or something else ???
',wtid_raw BYTEA NOT NULL' -- CONSTRAINT wire_out_ref REFERENCES wire_out(wtid_raw) ON DELETE CASCADE DEFERRABLE' ',wtid_raw BYTEA NOT NULL' -- CONSTRAINT wire_out_ref REFERENCES wire_out(wtid_raw) ON DELETE CASCADE DEFERRABLE'
') %s ;' ') %s ;'
,table_name ,table_name
@ -17001,4 +17001,3 @@ ALTER TABLE ONLY public.signkey_revocations
-- --
-- PostgreSQL database dump complete -- PostgreSQL database dump complete
-- --

View File

@ -1207,6 +1207,7 @@ check_known_coin (
* @param cls closure * @param cls closure
* @param rowid unique serial ID for the refresh session in our DB * @param rowid unique serial ID for the refresh session in our DB
* @param denom_pub denomination public key of @a coin_pub * @param denom_pub denomination public key of @a coin_pub
* @param h_age_commitment hash of the age commitment for the coin
* @param coin_pub public key of the coin * @param coin_pub public key of the coin
* @param coin_sig signature from the coin * @param coin_sig signature from the coin
* @param amount_with_fee amount that was deposited including fee * @param amount_with_fee amount that was deposited including fee
@ -2281,7 +2282,7 @@ recoup_refresh_cb (void *cls,
* *
* @param cls closure, NULL * @param cls closure, NULL
* @param denom_pub public key, sometimes NULL (!) * @param denom_pub public key, sometimes NULL (!)
* @param validity issuing information with value, fees and other info about the denomination. * @param issue issuing information with value, fees and other info about the denomination.
*/ */
static void static void
check_denomination ( check_denomination (

View File

@ -1262,7 +1262,6 @@ verify_reserve_balance (void *cls,
* @param rowid unique serial ID for the deposit in our DB * @param rowid unique serial ID for the deposit in our DB
* @param deposit deposit details * @param deposit deposit details
* @param reserve_pub which reserve is the purse merged into, NULL if unknown * @param reserve_pub which reserve is the purse merged into, NULL if unknown
* @param auditor_balance balance of the purse calculated by auditor
* @param flags purse flags * @param flags purse flags
* @param auditor_balance purse balance (according to the * @param auditor_balance purse balance (according to the
* auditor during auditing) * auditor during auditing)
@ -1530,6 +1529,16 @@ handle_purse_merged (
* *
* @param cls closure * @param cls closure
* @param rowid unique serial ID for the deposit in our DB * @param rowid unique serial ID for the deposit in our DB
* @param reserve_pub reserve affected by the merge
* @param purse_pub purse being merged
* @param h_contract_terms hash over contract of the purse
* @param purse_expiration when would the purse expire
* @param amount total amount in the purse
* @param min_age minimum age of all coins deposited into the purse
* @param flags how was the purse created
* @param purse_fee if a purse fee was paid, how high is it
* @param merge_timestamp when was the merge approved
* @param reserve_sig signature by reserve approving the merge
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
*/ */
static enum GNUNET_GenericReturnValue static enum GNUNET_GenericReturnValue
@ -1604,6 +1613,10 @@ handle_account_merged (
* *
* @param cls closure * @param cls closure
* @param rowid unique serial ID for the deposit in our DB * @param rowid unique serial ID for the deposit in our DB
* @param history_fee fee paid for the request
* @param ts timestamp of the request
* @param reserve_pub reserve history was requested for
* @param reserve_sig signature approving the @a history_fee
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
*/ */
static enum GNUNET_GenericReturnValue static enum GNUNET_GenericReturnValue

View File

@ -2068,6 +2068,8 @@ postgres_insert_reserve_summary (
* @param reserve_balance amount stored in the reserve * @param reserve_balance amount stored in the reserve
* @param withdraw_fee_balance amount the exchange gained in withdraw fees * @param withdraw_fee_balance amount the exchange gained in withdraw fees
* due to withdrawals from this reserve * due to withdrawals from this reserve
* @param purse_fee_balance amount the exchange gained in purse fees
* @param history_fee_balance amount the exchange gained in history fees
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus

View File

@ -252,7 +252,7 @@ main (int argc,
GNUNET_GETOPT_option_uint ('R', GNUNET_GETOPT_option_uint ('R',
"reset-shard", "reset-shard",
"OLD_SHARD_IDX", "OLD_SHARD_IDX",
"reset a shard database, does not reinitialize i.e. call taler-exchange-dbinit -S afterwards (DANGEROUS: all existsing data is lost!)", "reset a shard database, does not reinitialize i.e. call taler-exchange-dbinit -S afterwards (DANGEROUS: all existing data is lost!)",
&reset_shard_db), &reset_shard_db),
GNUNET_GETOPT_option_flag ('f', GNUNET_GETOPT_option_flag ('f',
"force", "force",

View File

@ -729,7 +729,7 @@ do_shutdown (void *cls)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Aborting incomplete extensions signature upload #%u\n", "Aborting incomplete extensions signature upload #%u\n",
(unsigned int) uer->idx); (unsigned int) uer->idx);
TALER_EXCHANGE_post_management_extensions_cancel (uer->h); TALER_EXCHANGE_management_post_extensions_cancel (uer->h);
GNUNET_CONTAINER_DLL_remove (uer_head, GNUNET_CONTAINER_DLL_remove (uer_head,
uer_tail, uer_tail,
uer); uer);

View File

@ -426,7 +426,7 @@ handle_post_reserves (struct TEH_RequestContext *rc,
/** /**
* Signature of functions that handle operations on purses. * Signature of functions that handle operations on purses.
* *
* @param rc request context * @param connection HTTP request handle
* @param purse_pub the public key of the purse * @param purse_pub the public key of the purse
* @param root uploaded JSON data * @param root uploaded JSON data
* @return MHD result code * @return MHD result code

View File

@ -246,7 +246,6 @@ TEH_keys_denomination_by_hash2 (
* *
* @param h_denom_pub hash of the public key to use to sign * @param h_denom_pub hash of the public key to use to sign
* @param bp blinded planchet to sign * @param bp blinded planchet to sign
* @param is_melt should we use the KDF for melting?
* @param[out] bs set to the blind signature on success * @param[out] bs set to the blind signature on success
* @return #TALER_EC_NONE on success * @return #TALER_EC_NONE on success
*/ */
@ -263,7 +262,6 @@ TEH_keys_denomination_sign_withdraw (
* *
* @param h_denom_pub hash of the public key to use to sign * @param h_denom_pub hash of the public key to use to sign
* @param bp blinded planchet to sign * @param bp blinded planchet to sign
* @param is_melt should we use the KDF for melting?
* @param[out] bs set to the blind signature on success * @param[out] bs set to the blind signature on success
* @return #TALER_EC_NONE on success * @return #TALER_EC_NONE on success
*/ */

View File

@ -101,17 +101,17 @@ extern unsigned long long TEH_METRICS_batch_withdraw_num_coins;
extern unsigned long long TEH_METRICS_num_conflict[TEH_MT_REQUEST_COUNT]; extern unsigned long long TEH_METRICS_num_conflict[TEH_MT_REQUEST_COUNT];
/** /**
* Number of signatures created by the respecitve cipher. * Number of signatures created by the respective cipher.
*/ */
extern unsigned long long TEH_METRICS_num_signatures[TEH_MT_SIGNATURE_COUNT]; extern unsigned long long TEH_METRICS_num_signatures[TEH_MT_SIGNATURE_COUNT];
/** /**
* Number of signatures verified by the respecitve cipher. * Number of signatures verified by the respective cipher.
*/ */
extern unsigned long long TEH_METRICS_num_verifications[TEH_MT_SIGNATURE_COUNT]; extern unsigned long long TEH_METRICS_num_verifications[TEH_MT_SIGNATURE_COUNT];
/** /**
* Number of key exchnages done with the respective cipher. * Number of key exchanges done with the respective cipher.
*/ */
extern unsigned long long TEH_METRICS_num_keyexchanges[TEH_MT_KEYX_COUNT]; extern unsigned long long TEH_METRICS_num_keyexchanges[TEH_MT_KEYX_COUNT];

View File

@ -135,6 +135,12 @@ struct PurseCreateContext
* Minimum age for deposits into this purse. * Minimum age for deposits into this purse.
*/ */
uint32_t min_age; uint32_t min_age;
/**
* Do we have an @e econtract?
*/
bool no_econtract;
}; };
@ -370,61 +376,64 @@ create_transaction (void *cls,
} }
} }
/* 3) if present, persist contract */ /* 3) if present, persist contract */
in_conflict = true; if (! pcc->no_econtract)
qs = TEH_plugin->insert_contract (TEH_plugin->cls,
pcc->purse_pub,
&pcc->econtract,
&in_conflict);
if (qs < 0)
{ {
if (GNUNET_DB_STATUS_SOFT_ERROR == qs) in_conflict = true;
return qs; qs = TEH_plugin->insert_contract (TEH_plugin->cls,
TALER_LOG_WARNING ("Failed to store purse information in database\n"); pcc->purse_pub,
*mhd_ret = TALER_MHD_reply_with_error (connection, &pcc->econtract,
MHD_HTTP_INTERNAL_SERVER_ERROR, &in_conflict);
TALER_EC_GENERIC_DB_STORE_FAILED, if (qs < 0)
"purse create contract");
return GNUNET_DB_STATUS_HARD_ERROR;
}
if (in_conflict)
{
struct TALER_EncryptedContract econtract;
struct GNUNET_HashCode h_econtract;
qs = TEH_plugin->select_contract_by_purse (
TEH_plugin->cls,
pcc->purse_pub,
&econtract);
if (qs <= 0)
{ {
if (GNUNET_DB_STATUS_SOFT_ERROR == qs) if (GNUNET_DB_STATUS_SOFT_ERROR == qs)
return qs; return qs;
GNUNET_break (0 != qs); TALER_LOG_WARNING ("Failed to store purse information in database\n");
TALER_LOG_WARNING (
"Failed to store fetch contract information from database\n");
*mhd_ret = TALER_MHD_reply_with_error (connection, *mhd_ret = TALER_MHD_reply_with_error (connection,
MHD_HTTP_INTERNAL_SERVER_ERROR, MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_GENERIC_DB_FETCH_FAILED, TALER_EC_GENERIC_DB_STORE_FAILED,
"select contract"); "purse create contract");
return GNUNET_DB_STATUS_HARD_ERROR;
}
if (in_conflict)
{
struct TALER_EncryptedContract econtract;
struct GNUNET_HashCode h_econtract;
qs = TEH_plugin->select_contract_by_purse (
TEH_plugin->cls,
pcc->purse_pub,
&econtract);
if (qs <= 0)
{
if (GNUNET_DB_STATUS_SOFT_ERROR == qs)
return qs;
GNUNET_break (0 != qs);
TALER_LOG_WARNING (
"Failed to store fetch contract information from database\n");
*mhd_ret = TALER_MHD_reply_with_error (connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_GENERIC_DB_FETCH_FAILED,
"select contract");
return GNUNET_DB_STATUS_HARD_ERROR;
}
GNUNET_CRYPTO_hash (econtract.econtract,
econtract.econtract_size,
&h_econtract);
*mhd_ret
= TALER_MHD_REPLY_JSON_PACK (
connection,
MHD_HTTP_CONFLICT,
TALER_JSON_pack_ec (
TALER_EC_EXCHANGE_PURSE_ECONTRACT_CONFLICTING_META_DATA),
GNUNET_JSON_pack_data_auto ("h_econtract",
&h_econtract),
GNUNET_JSON_pack_data_auto ("econtract_sig",
&econtract.econtract_sig),
GNUNET_JSON_pack_data_auto ("contract_pub",
&econtract.contract_pub));
GNUNET_free (econtract.econtract);
return GNUNET_DB_STATUS_HARD_ERROR; return GNUNET_DB_STATUS_HARD_ERROR;
} }
GNUNET_CRYPTO_hash (econtract.econtract,
econtract.econtract_size,
&h_econtract);
*mhd_ret
= TALER_MHD_REPLY_JSON_PACK (
connection,
MHD_HTTP_CONFLICT,
TALER_JSON_pack_ec (
TALER_EC_EXCHANGE_PURSE_ECONTRACT_CONFLICTING_META_DATA),
GNUNET_JSON_pack_data_auto ("h_econtract",
&h_econtract),
GNUNET_JSON_pack_data_auto ("econtract_sig",
&econtract.econtract_sig),
GNUNET_JSON_pack_data_auto ("contract_pub",
&econtract.contract_pub));
GNUNET_free (econtract.econtract);
return GNUNET_DB_STATUS_HARD_ERROR;
} }
return qs; return qs;
} }
@ -434,8 +443,8 @@ create_transaction (void *cls,
* Parse a coin and check signature of the coin and the denomination * Parse a coin and check signature of the coin and the denomination
* signature over the coin. * signature over the coin.
* *
* @param[in,out] our HTTP connection * @param[in,out] connection our HTTP connection
* @param[in,out] request context * @param[in,out] pcc request context
* @param[out] coin coin to initialize * @param[out] coin coin to initialize
* @param jcoin coin to parse * @param jcoin coin to parse
* @return #GNUNET_OK on success, #GNUNET_NO if an error was returned, * @return #GNUNET_OK on success, #GNUNET_NO if an error was returned,
@ -664,7 +673,6 @@ TEH_handler_purses_create (
json_t *deposits; json_t *deposits;
json_t *deposit; json_t *deposit;
unsigned int idx; unsigned int idx;
bool no_econtract = true;
struct GNUNET_JSON_Specification spec[] = { struct GNUNET_JSON_Specification spec[] = {
TALER_JSON_spec_amount ("amount", TALER_JSON_spec_amount ("amount",
TEH_currency, TEH_currency,
@ -674,7 +682,7 @@ TEH_handler_purses_create (
GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_mark_optional (
TALER_JSON_spec_econtract ("econtract", TALER_JSON_spec_econtract ("econtract",
&pcc.econtract), &pcc.econtract),
&no_econtract), &pcc.no_econtract),
GNUNET_JSON_spec_fixed_auto ("merge_pub", GNUNET_JSON_spec_fixed_auto ("merge_pub",
&pcc.merge_pub), &pcc.merge_pub),
GNUNET_JSON_spec_fixed_auto ("purse_sig", GNUNET_JSON_spec_fixed_auto ("purse_sig",
@ -815,7 +823,7 @@ TEH_handler_purses_create (
TALER_EC_EXCHANGE_PURSE_CREATE_SIGNATURE_INVALID, TALER_EC_EXCHANGE_PURSE_CREATE_SIGNATURE_INVALID,
NULL); NULL);
} }
if ( (! no_econtract) && if ( (! pcc.no_econtract) &&
(GNUNET_OK != (GNUNET_OK !=
TALER_wallet_econtract_upload_verify (pcc.econtract.econtract, TALER_wallet_econtract_upload_verify (pcc.econtract.econtract,
pcc.econtract.econtract_size, pcc.econtract.econtract_size,

View File

@ -287,8 +287,8 @@ deposit_transaction (void *cls,
* Parse a coin and check signature of the coin and the denomination * Parse a coin and check signature of the coin and the denomination
* signature over the coin. * signature over the coin.
* *
* @param[in,out] our HTTP connection * @param[in,out] connection our HTTP connection
* @param[in,out] request context * @param[in,out] pcc request context
* @param[out] coin coin to initialize * @param[out] coin coin to initialize
* @param jcoin coin to parse * @param jcoin coin to parse
* @return #GNUNET_OK on success, #GNUNET_NO if an error was returned, * @return #GNUNET_OK on success, #GNUNET_NO if an error was returned,

View File

@ -166,6 +166,7 @@ recoup_refresh_transaction (void *cls,
* @param exchange_vals values contributed by the exchange * @param exchange_vals values contributed by the exchange
* during refresh * during refresh
* @param coin_bks blinding data of the coin (to be checked) * @param coin_bks blinding data of the coin (to be checked)
* @param nonce withdraw nonce (if CS is used)
* @param coin_sig signature of the coin * @param coin_sig signature of the coin
* @return MHD result code * @return MHD result code
*/ */

View File

@ -169,6 +169,7 @@ recoup_transaction (void *cls,
* @param exchange_vals values contributed by the exchange * @param exchange_vals values contributed by the exchange
* during withdrawal * during withdrawal
* @param coin_bks blinding data of the coin (to be checked) * @param coin_bks blinding data of the coin (to be checked)
* @param nonce coin's nonce if CS is used
* @param coin_sig signature of the coin * @param coin_sig signature of the coin
* @return MHD result code * @return MHD result code
*/ */

View File

@ -111,7 +111,7 @@ struct RevealContext
/** /**
* Array of information about fresh coins being revealed. * Array of information about fresh coins being revealed.
*/ */
/* FIXME: const would be nicer here, but we initalize /* FIXME: const would be nicer here, but we initialize
the 'alg_values' in the verification the 'alg_values' in the verification
routine; suboptimal to be fixed... */ routine; suboptimal to be fixed... */
struct TALER_EXCHANGEDB_RefreshRevealedCoin *rrcs; struct TALER_EXCHANGEDB_RefreshRevealedCoin *rrcs;

View File

@ -80,7 +80,7 @@ struct ReserveHistoryContext
* Send reserve history to client. * Send reserve history to client.
* *
* @param connection connection to the client * @param connection connection to the client
* @param rh reserve history to return * @param rhc reserve history to return
* @return MHD result code * @return MHD result code
*/ */
static MHD_RESULT static MHD_RESULT

View File

@ -33,7 +33,7 @@
* will ultimately lead to the "purses create" being executed, or rejected. * will ultimately lead to the "purses create" being executed, or rejected.
* *
* @param rc request context * @param rc request context
* @param purse_pub public key of the purse * @param reserve_pub public key of the reserve
* @param root uploaded JSON data * @param root uploaded JSON data
* @return MHD result code * @return MHD result code
*/ */

View File

@ -69,7 +69,7 @@ struct ReserveStatusContext
* Send reserve status to client. * Send reserve status to client.
* *
* @param connection connection to the client * @param connection connection to the client
* @param rh reserve history to return * @param rhc reserve history to return
* @return MHD result code * @return MHD result code
*/ */
static MHD_RESULT static MHD_RESULT

View File

@ -70,7 +70,7 @@ BEGIN
END END
$$; $$;
-- We need a seperate function for this, as we call create_table only once but need to add -- We need a separate function for this, as we call create_table only once but need to add
-- those constraints to each partition which gets created -- those constraints to each partition which gets created
CREATE OR REPLACE FUNCTION add_constraints_to_wire_targets_partition( CREATE OR REPLACE FUNCTION add_constraints_to_wire_targets_partition(
IN partition_suffix VARCHAR IN partition_suffix VARCHAR
@ -866,7 +866,7 @@ BEGIN
PERFORM create_partitioned_table( PERFORM create_partitioned_table(
'CREATE TABLE IF NOT EXISTS %I' 'CREATE TABLE IF NOT EXISTS %I'
'(aggregation_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE' '(aggregation_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE'
',deposit_serial_id INT8 PRIMARY KEY' -- REFERENCES deposits (deposit_serial_id) ON DELETE CASCADE' -- FIXME chnage to coint_pub + deposit_serial_id for more efficient depost -- or something else ??? ',deposit_serial_id INT8 PRIMARY KEY' -- REFERENCES deposits (deposit_serial_id) ON DELETE CASCADE' -- FIXME change to coin_pub + deposit_serial_id for more efficient depost -- or something else ???
',wtid_raw BYTEA NOT NULL' -- CONSTRAINT wire_out_ref REFERENCES wire_out(wtid_raw) ON DELETE CASCADE DEFERRABLE' ',wtid_raw BYTEA NOT NULL' -- CONSTRAINT wire_out_ref REFERENCES wire_out(wtid_raw) ON DELETE CASCADE DEFERRABLE'
') %s ;' ') %s ;'
,table_name ,table_name

View File

@ -6188,6 +6188,7 @@ postgres_do_deposit (
* of the coin and possibly persisting the melt details. * of the coin and possibly persisting the melt details.
* *
* @param cls the `struct PostgresClosure` with the plugin-specific state * @param cls the `struct PostgresClosure` with the plugin-specific state
* @param rms client-contributed input for CS denominations that must be checked for idempotency, or NULL for non-CS withdrawals
* @param[in,out] refresh refresh operation details; the noreveal_index * @param[in,out] refresh refresh operation details; the noreveal_index
* is set in case the coin was already melted before * is set in case the coin was already melted before
* @param known_coin_id row of the coin in the known_coins table * @param known_coin_id row of the coin in the known_coins table
@ -9694,12 +9695,14 @@ postgres_insert_wire_fee (void *cls,
* Insert global fee data into database. * Insert global fee data into database.
* *
* @param cls closure * @param cls closure
* @param start_date when does the fee go into effect * @param start_date when does the fees go into effect
* @param end_date when does the fees end being valid
* @param fees how high is are the global fees * @param fees how high is are the global fees
* @param purse_timeout when do purses time out * @param purse_timeout when do purses time out
* @param kyc_timeout when do reserves without KYC time out * @param kyc_timeout when do reserves without KYC time out
* @param history_expiration how long are account histories preserved * @param history_expiration how long are account histories preserved
* @param purse_account_limit how many purses are free per account * @param master_sig signature over the above by the exchange master key * @param purse_account_limit how many purses are free per account
* @param master_sig signature over the above by the exchange master key
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
@ -14967,7 +14970,7 @@ postgres_delete_shard_locks (void *cls)
/** /**
* Function called to save the configuration of an extension * Function called to save the configuration of an extension
* (age-restriction, peer2peer, ...). After succesfull storage of the * (age-restriction, peer2peer, ...). After successful storage of the
* configuration it triggers the corresponding event. * configuration it triggers the corresponding event.
* *
* @param cls the @e cls of this struct with the plugin-specific state * @param cls the @e cls of this struct with the plugin-specific state
@ -15222,7 +15225,7 @@ postgres_insert_contract (
/** /**
* Function called to reutrn meta data about a purse by the * Function called to return meta data about a purse by the
* purse public key. * purse public key.
* *
* @param cls the @e cls of this struct with the plugin-specific state * @param cls the @e cls of this struct with the plugin-specific state
@ -15293,7 +15296,7 @@ postgres_select_purse_request (
* @param[out] in_conflict set to true if the meta data * @param[out] in_conflict set to true if the meta data
* conflicts with an existing purse; * conflicts with an existing purse;
* in this case, the return value will be * in this case, the return value will be
* #GNUNET_DB_STATUS_SUCCESS_ONE despite the failure * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT despite the failure
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
@ -15541,7 +15544,9 @@ postgres_select_purse_by_merge_pub (
* @param[out] balance_ok set to false if the coin's * @param[out] balance_ok set to false if the coin's
* remaining balance is below @a amount; * remaining balance is below @a amount;
* in this case, the return value will be * in this case, the return value will be
* #GNUNET_DB_STATUS_SUCCESS_ONE despite the failure * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT despite the failure
* @param[out] conflict set to true if the deposit failed due to a conflict (coin already spent,
* or deposited into this purse with a different amount)
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
@ -15891,7 +15896,7 @@ postgres_insert_history_request (
const struct TALER_ReservePublicKeyP *reserve_pub, const struct TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_ReserveSignatureP *reserve_sig, const struct TALER_ReserveSignatureP *reserve_sig,
struct GNUNET_TIME_Timestamp request_timestamp, struct GNUNET_TIME_Timestamp request_timestamp,
const struct TALER_Amount *history, const struct TALER_Amount *history_fee,
bool *balance_ok, bool *balance_ok,
bool *idempotent) bool *idempotent)
{ {
@ -15900,7 +15905,7 @@ postgres_insert_history_request (
GNUNET_PQ_query_param_auto_from_type (reserve_pub), GNUNET_PQ_query_param_auto_from_type (reserve_pub),
GNUNET_PQ_query_param_auto_from_type (reserve_sig), GNUNET_PQ_query_param_auto_from_type (reserve_sig),
GNUNET_PQ_query_param_timestamp (&request_timestamp), GNUNET_PQ_query_param_timestamp (&request_timestamp),
TALER_PQ_query_param_amount (history), TALER_PQ_query_param_amount (history_fee),
GNUNET_PQ_query_param_end GNUNET_PQ_query_param_end
}; };
struct GNUNET_PQ_ResultSpec rs[] = { struct GNUNET_PQ_ResultSpec rs[] = {

View File

@ -136,7 +136,7 @@ TALER_age_mask_to_string (
/* ================================================== /* ==================================================
* *
* Age Restriction TALER_Extension imlementation * Age Restriction TALER_Extension implementation
* *
* ================================================== * ==================================================
*/ */

View File

@ -1762,7 +1762,7 @@ TALER_test_coin_valid (const struct TALER_CoinPublicInfo *coin_public_info,
* @param blinded_planchet blinded planchet * @param blinded_planchet blinded planchet
* @param denom_hash hash of the denomination publick key * @param denom_hash hash of the denomination publick key
* @param[out] bch where to write the hash * @param[out] bch where to write the hash
* @return #GNUNET_OK when successful, #GNUNET_SYSERR if an internal error occured * @return #GNUNET_OK when successful, #GNUNET_SYSERR if an internal error occurred
*/ */
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_coin_ev_hash (const struct TALER_BlindedPlanchet *blinded_planchet, TALER_coin_ev_hash (const struct TALER_BlindedPlanchet *blinded_planchet,
@ -2872,7 +2872,7 @@ TALER_wallet_purse_status_sign (
* Verify a purse status request signature. * Verify a purse status request signature.
* *
* @param purse_pub purses public key * @param purse_pub purses public key
* @param purse_sig the signature made with purpose #TALER_SIGNATURE_WALLET_PURSE_STATUS_REQUEST * @param purse_sig the signature made with purpose #TALER_SIGNATURE_WALLET_PURSE_STATUS
* @return #GNUNET_OK if the signature is valid * @return #GNUNET_OK if the signature is valid
*/ */
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
@ -3155,7 +3155,7 @@ TALER_wallet_deposit_verify (
const struct TALER_Amount *deposit_fee, const struct TALER_Amount *deposit_fee,
const struct TALER_MerchantWireHashP *h_wire, const struct TALER_MerchantWireHashP *h_wire,
const struct TALER_PrivateContractHashP *h_contract_terms, const struct TALER_PrivateContractHashP *h_contract_terms,
const struct TALER_AgeCommitmentHash *h_commitment_hash, const struct TALER_AgeCommitmentHash *h_age_commitment,
const struct TALER_ExtensionContractHashP *h_extensions, const struct TALER_ExtensionContractHashP *h_extensions,
const struct TALER_DenominationHashP *h_denom_pub, const struct TALER_DenominationHashP *h_denom_pub,
struct GNUNET_TIME_Timestamp wallet_timestamp, struct GNUNET_TIME_Timestamp wallet_timestamp,
@ -3389,7 +3389,7 @@ TALER_wallet_reserve_history_verify (
* *
* @param ts timestamp used * @param ts timestamp used
* @param history_fee how much do we expect to pay * @param history_fee how much do we expect to pay
* @param reserve_pub reserve the history request is for * @param reserve_priv private key of the reserve the history request is for
* @param[out] reserve_sig resulting signature * @param[out] reserve_sig resulting signature
*/ */
void void
@ -3419,7 +3419,7 @@ TALER_wallet_reserve_status_verify (
* Create reserve status request signature. * Create reserve status request signature.
* *
* @param ts timestamp used * @param ts timestamp used
* @param reserve_pub reserve the status request is for * @param reserve_priv private key of the reserve the status request is for
* @param[out] reserve_sig resulting signature * @param[out] reserve_sig resulting signature
*/ */
void void
@ -3481,7 +3481,6 @@ TALER_merchant_refund_verify (
* @param h_contract_terms hash of contract terms * @param h_contract_terms hash of contract terms
* @param h_wire hash of the merchant account details * @param h_wire hash of the merchant account details
* @param coin_pub coin to be deposited * @param coin_pub coin to be deposited
* @param merchant_pub merchant public key
* @param merchant_priv private key to sign with * @param merchant_priv private key to sign with
* @param[out] merchant_sig where to write the signature * @param[out] merchant_sig where to write the signature
*/ */
@ -3490,15 +3489,15 @@ TALER_merchant_deposit_sign (
const struct TALER_PrivateContractHashP *h_contract_terms, const struct TALER_PrivateContractHashP *h_contract_terms,
const struct TALER_MerchantWireHashP *h_wire, const struct TALER_MerchantWireHashP *h_wire,
const struct TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct TALER_MerchantPublicKeyP *merchant_pub,
const struct TALER_MerchantPrivateKeyP *merchant_priv, const struct TALER_MerchantPrivateKeyP *merchant_priv,
struct TALER_MerchantSignatureP *merchant_sig); struct TALER_MerchantSignatureP *merchant_sig);
/** /**
* Verify a deposit. * Verify a deposit.
* *
* @param merchant merchant public key * @param merchant merchant public key
* @param public key of the deposited coin * @param coin_pub public key of the deposited coin
* @param h_contract_terms hash of contract terms * @param h_contract_terms hash of contract terms
* @param h_wire hash of the merchant account details * @param h_wire hash of the merchant account details
* @param merchant_sig signature of the merchant * @param merchant_sig signature of the merchant
@ -3571,6 +3570,7 @@ typedef enum TALER_ErrorCode
* @param merchant_pub the public key of the merchant (used to identify the merchant for refund requests) * @param merchant_pub the public key of the merchant (used to identify the merchant for refund requests)
* @param[out] pub where to write the public key * @param[out] pub where to write the public key
* @param[out] sig where to write the signature * @param[out] sig where to write the signature
* @return #TALER_EC_NONE on success
*/ */
enum TALER_ErrorCode enum TALER_ErrorCode
TALER_exchange_online_deposit_confirmation_sign ( TALER_exchange_online_deposit_confirmation_sign (
@ -3602,6 +3602,7 @@ TALER_exchange_online_deposit_confirmation_sign (
* @param merchant_pub the public key of the merchant (used to identify the merchant for refund requests) * @param merchant_pub the public key of the merchant (used to identify the merchant for refund requests)
* @param pub where to write the public key * @param pub where to write the public key
* @param sig where to write the signature * @param sig where to write the signature
* @return #GNUNET_OK if the signature is valid
*/ */
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_exchange_online_deposit_confirmation_verify ( TALER_exchange_online_deposit_confirmation_verify (
@ -3622,9 +3623,14 @@ TALER_exchange_online_deposit_confirmation_verify (
* Create refund confirmation signature. * Create refund confirmation signature.
* *
* @param scb function to call to create the signature * @param scb function to call to create the signature
* @param XXX wire transfer subject used * @param h_contract_terms hash of contract being refunded
* @param[out] pub where to write the public key * @param coin_pub public key of the coin receiving the refund
* @param[out] sig where to write the signature * @param merchant public key of the merchant that granted the refund
* @param rtransaction_id refund transaction ID used by the merchant
* @param refund_amount amount refunded
* @param[out] pub where to write the exchange public key
* @param[out] sig where to write the exchange signature
* @return #TALER_EC_NONE on success
*/ */
enum TALER_ErrorCode enum TALER_ErrorCode
TALER_exchange_online_refund_confirmation_sign ( TALER_exchange_online_refund_confirmation_sign (
@ -3641,8 +3647,14 @@ TALER_exchange_online_refund_confirmation_sign (
/** /**
* Verify refund confirmation signature. * Verify refund confirmation signature.
* *
* @param h_contract_terms hash of contract being refunded
* @param coin_pub public key of the coin receiving the refund
* @param merchant public key of the merchant that granted the refund
* @param rtransaction_id refund transaction ID used by the merchant
* @param refund_amount amount refunded
* @param pub where to write the public key * @param pub where to write the public key
* @param sig where to write the signature * @param sig where to write the signature
* @return #GNUNET_OK if the signature is valid
*/ */
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_exchange_online_refund_confirmation_verify ( TALER_exchange_online_refund_confirmation_verify (
@ -3659,9 +3671,11 @@ TALER_exchange_online_refund_confirmation_verify (
* Create refresh melt confirmation signature. * Create refresh melt confirmation signature.
* *
* @param scb function to call to create the signature * @param scb function to call to create the signature
* @param XXX * @param rc refresh commitment that identifies the melt operation
* @param[out] pub where to write the public key * @param noreveal_index gamma cut-and-choose value chosen by the exchange
* @param[out] sig where to write the signature * @param[out] pub where to write the exchange public key
* @param[out] sig where to write the exchange signature
* @return #TALER_EC_NONE on success
*/ */
enum TALER_ErrorCode enum TALER_ErrorCode
TALER_exchange_online_melt_confirmation_sign ( TALER_exchange_online_melt_confirmation_sign (
@ -3675,8 +3689,11 @@ TALER_exchange_online_melt_confirmation_sign (
/** /**
* Verify refresh melt confirmation signature. * Verify refresh melt confirmation signature.
* *
* @param rc refresh commitment that identifies the melt operation
* @param noreveal_index gamma cut-and-choose value chosen by the exchange
* @param pub where to write the public key * @param pub where to write the public key
* @param sig where to write the signature * @param sig where to write the signature
* @return #GNUNET_OK if the signature is valid
*/ */
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_exchange_online_melt_confirmation_verify ( TALER_exchange_online_melt_confirmation_verify (
@ -3690,10 +3707,12 @@ TALER_exchange_online_melt_confirmation_verify (
* Create exchange key set signature. * Create exchange key set signature.
* *
* @param scb function to call to create the signature * @param scb function to call to create the signature
* @param cls closure for @a scb
* @param timestamp time when the key set was issued * @param timestamp time when the key set was issued
* @param hc hash over all the keys * @param hc hash over all the keys
* @param[out] pub where to write the public key * @param[out] pub where to write the public key
* @param[out] sig where to write the signature * @param[out] sig where to write the signature
* @return #TALER_EC_NONE on success
*/ */
enum TALER_ErrorCode enum TALER_ErrorCode
TALER_exchange_online_key_set_sign ( TALER_exchange_online_key_set_sign (
@ -3712,6 +3731,7 @@ TALER_exchange_online_key_set_sign (
* @param hc hash over all the keys * @param hc hash over all the keys
* @param pub where to write the public key * @param pub where to write the public key
* @param sig where to write the signature * @param sig where to write the signature
* @return #GNUNET_OK if the signature is valid
*/ */
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_exchange_online_key_set_verify ( TALER_exchange_online_key_set_verify (
@ -3729,6 +3749,7 @@ TALER_exchange_online_key_set_verify (
* @param timestamp time when the KYC was confirmed * @param timestamp time when the KYC was confirmed
* @param[out] pub where to write the public key * @param[out] pub where to write the public key
* @param[out] sig where to write the signature * @param[out] sig where to write the signature
* @return #TALER_EC_NONE on success
*/ */
enum TALER_ErrorCode enum TALER_ErrorCode
TALER_exchange_online_account_setup_success_sign ( TALER_exchange_online_account_setup_success_sign (
@ -3746,6 +3767,7 @@ TALER_exchange_online_account_setup_success_sign (
* @param timestamp time when the KYC was confirmed * @param timestamp time when the KYC was confirmed
* @param pub where to write the public key * @param pub where to write the public key
* @param sig where to write the signature * @param sig where to write the signature
* @return #GNUNET_OK if the signature is valid
*/ */
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_exchange_online_account_setup_success_verify ( TALER_exchange_online_account_setup_success_verify (
@ -3755,6 +3777,17 @@ TALER_exchange_online_account_setup_success_verify (
const struct TALER_ExchangeSignatureP *sig); const struct TALER_ExchangeSignatureP *sig);
/**
* Update the @a hash_context in the computation of the
* h_details for a wire status signature.
*
* @param[in,out] hash_context context to update
* @param h_contract_terms hash of the contract
* @param execution_time when was the wire transfer initiated
* @param coin_pub deposited coin
* @param deposit_value contribution of the coin
* @param deposit_fee how high was the deposit fee
*/
void void
TALER_exchange_online_wire_deposit_append ( TALER_exchange_online_wire_deposit_append (
struct GNUNET_HashContext *hash_context, struct GNUNET_HashContext *hash_context,
@ -3769,9 +3802,14 @@ TALER_exchange_online_wire_deposit_append (
* Create wire deposit signature. * Create wire deposit signature.
* *
* @param scb function to call to create the signature * @param scb function to call to create the signature
* @param XXX * @param total amount the merchant was credited
* @param wire_fee fee charged by the exchange for the wire transfer
* @param merchant_pub which merchant was credited
* @param payto payto://-URI of the merchant account
* @param h_details hash over the aggregation details
* @param[out] pub where to write the public key * @param[out] pub where to write the public key
* @param[out] sig where to write the signature * @param[out] sig where to write the signature
* @return #TALER_EC_NONE on success
*/ */
enum TALER_ErrorCode enum TALER_ErrorCode
TALER_exchange_online_wire_deposit_sign ( TALER_exchange_online_wire_deposit_sign (
@ -3788,8 +3826,14 @@ TALER_exchange_online_wire_deposit_sign (
/** /**
* Verify wire deposit signature. * Verify wire deposit signature.
* *
* @param total amount the merchant was credited
* @param wire_fee fee charged by the exchange for the wire transfer
* @param merchant_pub which merchant was credited
* @param h_payto hash of the payto://-URI of the merchant account
* @param h_details hash over the aggregation details
* @param pub where to write the public key * @param pub where to write the public key
* @param sig where to write the signature * @param sig where to write the signature
* @return #GNUNET_OK if the signature is valid
*/ */
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_exchange_online_wire_deposit_verify ( TALER_exchange_online_wire_deposit_verify (
@ -3806,9 +3850,15 @@ TALER_exchange_online_wire_deposit_verify (
* Create wire confirmation signature. * Create wire confirmation signature.
* *
* @param scb function to call to create the signature * @param scb function to call to create the signature
* @param XXX * @param h_wire hash of the merchant's account
* @param h_contract_terms hash of the contract
* @param wtid wire transfer this deposit was aggregated into
* @param coin_pub public key of the deposited coin
* @param execution_time when was wire transfer initiated
* @param coin_contribution what was @a coin_pub's contribution to the wire transfer
* @param[out] pub where to write the public key * @param[out] pub where to write the public key
* @param[out] sig where to write the signature * @param[out] sig where to write the signature
* @return #TALER_EC_NONE on success
*/ */
enum TALER_ErrorCode enum TALER_ErrorCode
TALER_exchange_online_confirm_wire_sign ( TALER_exchange_online_confirm_wire_sign (
@ -3826,8 +3876,15 @@ TALER_exchange_online_confirm_wire_sign (
/** /**
* Verify confirm wire signature. * Verify confirm wire signature.
* *
* @param h_wire hash of the merchant's account
* @param h_contract_terms hash of the contract
* @param wtid wire transfer this deposit was aggregated into
* @param coin_pub public key of the deposited coin
* @param execution_time when was wire transfer initiated
* @param coin_contribution what was @a coin_pub's contribution to the wire transfer
* @param pub where to write the public key * @param pub where to write the public key
* @param sig where to write the signature * @param sig where to write the signature
* @return #GNUNET_OK if the signature is valid
*/ */
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_exchange_online_confirm_wire_verify ( TALER_exchange_online_confirm_wire_verify (
@ -3845,9 +3902,13 @@ TALER_exchange_online_confirm_wire_verify (
* Create confirm recoup signature. * Create confirm recoup signature.
* *
* @param scb function to call to create the signature * @param scb function to call to create the signature
* @param XXX * @param timestamp when was the recoup done
* @param recoup_amount how much was recouped
* @param coin_pub coin that was recouped
* @param reserve_pub reserve that was credited
* @param[out] pub where to write the public key * @param[out] pub where to write the public key
* @param[out] sig where to write the signature * @param[out] sig where to write the signature
* @return #TALER_EC_NONE on success
*/ */
enum TALER_ErrorCode enum TALER_ErrorCode
TALER_exchange_online_confirm_recoup_sign ( TALER_exchange_online_confirm_recoup_sign (
@ -3863,8 +3924,13 @@ TALER_exchange_online_confirm_recoup_sign (
/** /**
* Verify confirm recoup signature. * Verify confirm recoup signature.
* *
* @param timestamp when was the recoup done
* @param recoup_amount how much was recouped
* @param coin_pub coin that was recouped
* @param reserve_pub reserve that was credited
* @param pub where to write the public key * @param pub where to write the public key
* @param sig where to write the signature * @param sig where to write the signature
* @return #GNUNET_OK if the signature is valid
*/ */
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_exchange_online_confirm_recoup_verify ( TALER_exchange_online_confirm_recoup_verify (
@ -3880,9 +3946,13 @@ TALER_exchange_online_confirm_recoup_verify (
* Create confirm recoup refresh signature. * Create confirm recoup refresh signature.
* *
* @param scb function to call to create the signature * @param scb function to call to create the signature
* @param XXX * @param timestamp when was the recoup done
* @param recoup_amount how much was recouped
* @param coin_pub coin that was recouped
* @param old_coin_pub old coin that was credited
* @param[out] pub where to write the public key * @param[out] pub where to write the public key
* @param[out] sig where to write the signature * @param[out] sig where to write the signature
* @return #TALER_EC_NONE on success
*/ */
enum TALER_ErrorCode enum TALER_ErrorCode
TALER_exchange_online_confirm_recoup_refresh_sign ( TALER_exchange_online_confirm_recoup_refresh_sign (
@ -3898,8 +3968,13 @@ TALER_exchange_online_confirm_recoup_refresh_sign (
/** /**
* Verify confirm recoup refresh signature. * Verify confirm recoup refresh signature.
* *
* @param timestamp when was the recoup done
* @param recoup_amount how much was recouped
* @param coin_pub coin that was recouped
* @param old_coin_pub old coin that was credited
* @param pub where to write the public key * @param pub where to write the public key
* @param sig where to write the signature * @param sig where to write the signature
* @return #GNUNET_OK if the signature is valid
*/ */
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_exchange_online_confirm_recoup_refresh_verify ( TALER_exchange_online_confirm_recoup_refresh_verify (
@ -3915,9 +3990,11 @@ TALER_exchange_online_confirm_recoup_refresh_verify (
* Create denomination unknown signature. * Create denomination unknown signature.
* *
* @param scb function to call to create the signature * @param scb function to call to create the signature
* @param XXX * @param timestamp when was the error created
* @param h_denom_pub hash of denomination that is unknown
* @param[out] pub where to write the public key * @param[out] pub where to write the public key
* @param[out] sig where to write the signature * @param[out] sig where to write the signature
* @return #TALER_EC_NONE on success
*/ */
enum TALER_ErrorCode enum TALER_ErrorCode
TALER_exchange_online_denomination_unknown_sign ( TALER_exchange_online_denomination_unknown_sign (
@ -3931,8 +4008,11 @@ TALER_exchange_online_denomination_unknown_sign (
/** /**
* Verify denomination unknown signature. * Verify denomination unknown signature.
* *
* @param timestamp when was the error created
* @param h_denom_pub hash of denomination that is unknown
* @param pub where to write the public key * @param pub where to write the public key
* @param sig where to write the signature * @param sig where to write the signature
* @return #GNUNET_OK if the signature is valid
*/ */
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_exchange_online_denomination_unknown_verify ( TALER_exchange_online_denomination_unknown_verify (
@ -3946,9 +4026,13 @@ TALER_exchange_online_denomination_unknown_verify (
* Create denomination expired signature. * Create denomination expired signature.
* *
* @param scb function to call to create the signature * @param scb function to call to create the signature
* @param XXX * @param timestamp when was the error created
* @param h_denom_pub hash of denomination that is expired
* @param op character string describing the operation for which
* the denomination is expired
* @param[out] pub where to write the public key * @param[out] pub where to write the public key
* @param[out] sig where to write the signature * @param[out] sig where to write the signature
* @return #TALER_EC_NONE on success
*/ */
enum TALER_ErrorCode enum TALER_ErrorCode
TALER_exchange_online_denomination_expired_sign ( TALER_exchange_online_denomination_expired_sign (
@ -3963,8 +4047,13 @@ TALER_exchange_online_denomination_expired_sign (
/** /**
* Verify denomination expired signature. * Verify denomination expired signature.
* *
* @param timestamp when was the error created
* @param h_denom_pub hash of denomination that is expired
* @param op character string describing the operation for which
* the denomination is expired
* @param pub where to write the public key * @param pub where to write the public key
* @param sig where to write the signature * @param sig where to write the signature
* @return #GNUNET_OK if the signature is valid
*/ */
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_exchange_online_denomination_expired_verify ( TALER_exchange_online_denomination_expired_verify (
@ -3987,6 +4076,7 @@ TALER_exchange_online_denomination_expired_verify (
* @param reserve_pub public key of the closed reserve * @param reserve_pub public key of the closed reserve
* @param[out] pub where to write the public key * @param[out] pub where to write the public key
* @param[out] sig where to write the signature * @param[out] sig where to write the signature
* @return #TALER_EC_NONE on success
*/ */
enum TALER_ErrorCode enum TALER_ErrorCode
TALER_exchange_online_reserve_closed_sign ( TALER_exchange_online_reserve_closed_sign (
@ -4010,8 +4100,9 @@ TALER_exchange_online_reserve_closed_sign (
* @param payto target of the wire transfer * @param payto target of the wire transfer
* @param wtid wire transfer subject used * @param wtid wire transfer subject used
* @param reserve_pub public key of the closed reserve * @param reserve_pub public key of the closed reserve
* @param pub where to write the public key * @param pub the public key of the exchange to check against
* @param sig where to write the signature * @param sig the signature to check
* @return #GNUNET_OK if the signature is valid
*/ */
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_exchange_online_reserve_closed_verify ( TALER_exchange_online_reserve_closed_verify (
@ -4025,6 +4116,20 @@ TALER_exchange_online_reserve_closed_verify (
const struct TALER_ExchangeSignatureP *sig); const struct TALER_ExchangeSignatureP *sig);
/**
* Create signature by exchange affirming that a purse was created.
*
* @param scb function to call to create the signature
* @param exchange_time our time
* @param purse_expiration when will the purse expire
* @param amount_without_fee total amount to be put into the purse (without deposit fees)
* @param total_deposited total currently in the purse
* @param purse_pub public key of the purse
* @param h_contract_terms hash of the contract for the purse
* @param[out] pub where to write the public key
* @param[out] sig where to write the signature
* @return #TALER_EC_NONE on success
*/
enum TALER_ErrorCode enum TALER_ErrorCode
TALER_exchange_online_purse_created_sign ( TALER_exchange_online_purse_created_sign (
TALER_ExchangeSignCallback scb, TALER_ExchangeSignCallback scb,
@ -4038,6 +4143,19 @@ TALER_exchange_online_purse_created_sign (
struct TALER_ExchangeSignatureP *sig); struct TALER_ExchangeSignatureP *sig);
/**
* Verify exchange signature about a purse creation and balance.
*
* @param exchange_time our time
* @param purse_expiration when will the purse expire
* @param amount_without_fee total amount to be put into the purse (without deposit fees)
* @param total_deposited total currently in the purse
* @param purse_pub public key of the purse
* @param h_contract_terms hash of the contract for the purse
* @param pub the public key of the exchange to check against
* @param sig the signature to check
* @return #GNUNET_OK if the signature is valid
*/
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_exchange_online_purse_created_verify ( TALER_exchange_online_purse_created_verify (
struct GNUNET_TIME_Timestamp exchange_time, struct GNUNET_TIME_Timestamp exchange_time,
@ -4050,6 +4168,21 @@ TALER_exchange_online_purse_created_verify (
const struct TALER_ExchangeSignatureP *sig); const struct TALER_ExchangeSignatureP *sig);
/**
* Sign affirmation that a purse was merged.
*
* @param scb function to call to create the signature
* @param exchange_time our time
* @param purse_expiration when does the purse expire
* @param amount_without_fee total amount that should be in the purse without deposit fees
* @param purse_pub public key of the purse
* @param h_contract_terms hash of the contract of the purse
* @param reserve_pub reserve the purse will be merged into
* @param exchange_url exchange at which the @a reserve_pub lives
* @param[out] pub where to write the public key
* @param[out] sig where to write the signature
* @return #TALER_EC_NONE on success
*/
enum TALER_ErrorCode enum TALER_ErrorCode
TALER_exchange_online_purse_merged_sign ( TALER_exchange_online_purse_merged_sign (
TALER_ExchangeSignCallback scb, TALER_ExchangeSignCallback scb,
@ -4064,6 +4197,20 @@ TALER_exchange_online_purse_merged_sign (
struct TALER_ExchangeSignatureP *sig); struct TALER_ExchangeSignatureP *sig);
/**
* Verify affirmation that a purse will be merged.
*
* @param exchange_time our time
* @param purse_expiration when does the purse expire
* @param amount_without_fee total amount that should be in the purse without deposit fees
* @param purse_pub public key of the purse
* @param h_contract_terms hash of the contract of the purse
* @param reserve_pub reserve the purse will be merged into
* @param exchange_url exchange at which the @a reserve_pub lives
* @param pub the public key of the exchange to check against
* @param sig the signature to check
* @return #GNUNET_OK if the signature is valid
*/
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_exchange_online_purse_merged_verify ( TALER_exchange_online_purse_merged_verify (
struct GNUNET_TIME_Timestamp exchange_time, struct GNUNET_TIME_Timestamp exchange_time,
@ -4077,6 +4224,17 @@ TALER_exchange_online_purse_merged_verify (
const struct TALER_ExchangeSignatureP *sig); const struct TALER_ExchangeSignatureP *sig);
/**
* Sign information about the status of a purse.
*
* @param scb function to call to create the signature
* @param merge_timestamp when was the purse merged (can be never)
* @param deposit_timestamp when was the purse fully paid up (can be never)
* @param balance current balance of the purse
* @param[out] pub where to write the public key
* @param[out] sig where to write the signature
* @return #TALER_EC_NONE on success
*/
enum TALER_ErrorCode enum TALER_ErrorCode
TALER_exchange_online_purse_status_sign ( TALER_exchange_online_purse_status_sign (
TALER_ExchangeSignCallback scb, TALER_ExchangeSignCallback scb,
@ -4087,6 +4245,16 @@ TALER_exchange_online_purse_status_sign (
struct TALER_ExchangeSignatureP *sig); struct TALER_ExchangeSignatureP *sig);
/**
* Verify signature over information about the status of a purse.
*
* @param merge_timestamp when was the purse merged (can be never)
* @param deposit_timestamp when was the purse fully paid up (can be never)
* @param balance current balance of the purse
* @param exchange_pub the public key of the exchange to check against
* @param exchange_sig the signature to check
* @return #GNUNET_OK if the signature is valid
*/
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_exchange_online_purse_status_verify ( TALER_exchange_online_purse_status_verify (
struct GNUNET_TIME_Timestamp merge_timestamp, struct GNUNET_TIME_Timestamp merge_timestamp,
@ -4321,7 +4489,18 @@ TALER_exchange_offline_denom_validity_verify (
const struct TALER_MasterSignatureP *master_sig); const struct TALER_MasterSignatureP *master_sig);
// FIXME: document /**
* Create offline signature about an exchange's partners.
*
* @param partner_pub master public key of the partner
* @param start_date validity period start
* @param end_date validity period end
* @param wad_frequency how often will we do wad transfers to this partner
* @param wad_fee what is the wad fee to this partner
* @param partner_base_url what is the base URL of the @a partner_pub exchange
* @param master_priv private key to sign with
* @param[out] master_sig where to write the signature
*/
void void
TALER_exchange_offline_partner_details_sign ( TALER_exchange_offline_partner_details_sign (
const struct TALER_MasterPublicKeyP *partner_pub, const struct TALER_MasterPublicKeyP *partner_pub,
@ -4334,7 +4513,19 @@ TALER_exchange_offline_partner_details_sign (
struct TALER_MasterSignatureP *master_sig); struct TALER_MasterSignatureP *master_sig);
// FIXME: document /**
* Verify signature about an exchange's partners.
*
* @param partner_pub master public key of the partner
* @param start_date validity period start
* @param end_date validity period end
* @param wad_frequency how often will we do wad transfers to this partner
* @param wad_fee what is the wad fee to this partner
* @param partner_base_url what is the base URL of the @a partner_pub exchange
* @param master_pub public key to verify against
* @param master_sig the signature the signature
* @return #GNUNET_OK if the signature is valid
*/
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_exchange_offline_partner_details_verify ( TALER_exchange_offline_partner_details_verify (
const struct TALER_MasterPublicKeyP *partner_pub, const struct TALER_MasterPublicKeyP *partner_pub,
@ -4780,6 +4971,7 @@ TALER_merchant_pay_sign (
const struct TALER_MerchantPrivateKeyP *merch_priv, const struct TALER_MerchantPrivateKeyP *merch_priv,
struct GNUNET_CRYPTO_EddsaSignature *merch_sig); struct GNUNET_CRYPTO_EddsaSignature *merch_sig);
/** /**
* Verify payment confirmation signature. * Verify payment confirmation signature.
* *
@ -4841,7 +5033,8 @@ TALER_exchange_offline_extension_config_hash_verify (
const struct TALER_MasterSignatureP *master_sig const struct TALER_MasterSignatureP *master_sig
); );
/*
/**
* @brief Representation of an age commitment: one public key per age group. * @brief Representation of an age commitment: one public key per age group.
* *
* The number of keys must be be the same as the number of bits set in the * The number of keys must be be the same as the number of bits set in the
@ -4850,30 +5043,37 @@ TALER_exchange_offline_extension_config_hash_verify (
struct TALER_AgeCommitment struct TALER_AgeCommitment
{ {
/* The age mask defines the age groups that were a parameter during the /**
* generation of this age commitment */ * The age mask defines the age groups that were a parameter during the
* generation of this age commitment
*/
struct TALER_AgeMask mask; struct TALER_AgeMask mask;
/* The number of public keys, which must be the same as the number of /**
* The number of public keys, which must be the same as the number of
* groups in the mask. * groups in the mask.
*/ */
size_t num; size_t num;
/* The list of #num_pub public keys. In must have same size as the number of /**
* The list of @e num public keys. In must have same size as the number of
* age groups defined in the mask. * age groups defined in the mask.
* *
* A hash of this list is the hashed commitment that goes into FDC * A hash of this list is the hashed commitment that goes into FDC
* calculation during the withdraw and refresh operations for new coins. That * calculation during the withdraw and refresh operations for new coins. That
* way, the particular age commitment becomes mandatory and bound to a coin. * way, the particular age commitment becomes mandatory and bound to a coin.
* *
* The list has been allocated via GNUNET_malloc. * The list has been allocated via GNUNET_malloc().
*/ */
struct TALER_AgeCommitmentPublicKeyP *keys; struct TALER_AgeCommitmentPublicKeyP *keys;
}; };
// FIXME-oec: document!
struct TALER_AgeProof struct TALER_AgeProof
{ {
/* The number of private keys, which must be at most num_pub_keys. One minus /**
* The number of private keys, which must be at most num_pub_keys. One minus
* this number corresponds to the largest age group that is supported with * this number corresponds to the largest age group that is supported with
* this age commitment. * this age commitment.
* **Note**, that this and the next field are only relevant on the wallet * **Note**, that this and the next field are only relevant on the wallet
@ -4881,7 +5081,8 @@ struct TALER_AgeProof
*/ */
size_t num; size_t num;
/* List of #num_priv private keys. /**
* List of @e num private keys.
* *
* Note that the list can be _smaller_ than the corresponding list of public * Note that the list can be _smaller_ than the corresponding list of public
* keys. In that case, the wallet can sign off only for a subset of the age * keys. In that case, the wallet can sign off only for a subset of the age
@ -4892,9 +5093,13 @@ struct TALER_AgeProof
struct TALER_AgeCommitmentPrivateKeyP *keys; struct TALER_AgeCommitmentPrivateKeyP *keys;
}; };
// FIXME-oec: document!
struct TALER_AgeCommitmentProof struct TALER_AgeCommitmentProof
{ {
// FIXME-oec: document!
struct TALER_AgeCommitment commitment; struct TALER_AgeCommitment commitment;
// FIXME-oec: document!
struct TALER_AgeProof proof; struct TALER_AgeProof proof;
}; };
@ -4916,8 +5121,8 @@ TALER_age_commitment_hash (
* *
* @param mask The age mask the defines the age groups * @param mask The age mask the defines the age groups
* @param age The actual age for which an age commitment is generated * @param age The actual age for which an age commitment is generated
* @param seed The seed that goes into the key generation. MUST be choosen uniformly random. * @param seed The seed that goes into the key generation. MUST be chosen uniformly random.
* @param comm_proof[out] The generated age commitment, ->priv and ->pub allocated via GNUNET_malloc on success * @param[out] comm_proof The generated age commitment, ->priv and ->pub allocated via GNUNET_malloc() on success
* @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
*/ */
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
@ -4933,7 +5138,7 @@ TALER_age_restriction_commit (
* *
* @param orig Original age commitment * @param orig Original age commitment
* @param salt Salt to randomly move the points on the elliptic curve in order to generate another, equivalent commitment. * @param salt Salt to randomly move the points on the elliptic curve in order to generate another, equivalent commitment.
* @param[out] derived The resulting age commitment, ->priv and ->pub allocated via GNUNET_malloc on success. * @param[out] derived The resulting age commitment, ->priv and ->pub allocated via GNUNET_malloc() on success.
* @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
*/ */
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
@ -4957,13 +5162,14 @@ TALER_age_commitment_attest (
uint8_t age, uint8_t age,
struct TALER_AgeAttestation *attest); struct TALER_AgeAttestation *attest);
/*
/**
* @brief Verify the attestation for an given age and age commitment * @brief Verify the attestation for an given age and age commitment
* *
* @param commitent The age commitment that went into the attestation. Only the public keys are needed. * @param commitment The age commitment that went into the attestation. Only the public keys are needed.
* @param age Age (not age group) for which the an attestation should be done * @param age Age (not age group) for which the an attestation should be done
* @param attest Signature of the age with the appropriate key from the age commitment for the corresponding age group, if applicaple. * @param attest Signature of the age with the appropriate key from the age commitment for the corresponding age group, if applicaple.
* @return GNUNET_OK when the attestation was successfull, GNUNET_NO no attestation couldn't be verified, GNUNET_SYSERR otherwise * @return #GNUNET_OK when the attestation was successful, #GNUNET_NO no attestation couldn't be verified, #GNUNET_SYSERR otherwise
*/ */
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_age_commitment_verify ( TALER_age_commitment_verify (
@ -4971,7 +5177,8 @@ TALER_age_commitment_verify (
uint8_t age, uint8_t age,
const struct TALER_AgeAttestation *attest); const struct TALER_AgeAttestation *attest);
/*
/**
* @brief helper function to free memory of a struct TALER_AgeCommitment * @brief helper function to free memory of a struct TALER_AgeCommitment
* *
* @param p the commitment from which all memory should be freed. * @param p the commitment from which all memory should be freed.
@ -4980,7 +5187,8 @@ void
TALER_age_commitment_free ( TALER_age_commitment_free (
struct TALER_AgeCommitment *p); struct TALER_AgeCommitment *p);
/*
/**
* @brief helper function to free memory of a struct TALER_AgeProof * @brief helper function to free memory of a struct TALER_AgeProof
* *
* @param p the proof of commitment from which all memory should be freed. * @param p the proof of commitment from which all memory should be freed.
@ -4989,7 +5197,8 @@ void
TALER_age_proof_free ( TALER_age_proof_free (
struct TALER_AgeProof *p); struct TALER_AgeProof *p);
/*
/**
* @brief helper function to free memory of a struct TALER_AgeCommitmentProof * @brief helper function to free memory of a struct TALER_AgeCommitmentProof
* *
* @param p the commitment and its proof from which all memory should be freed. * @param p the commitment and its proof from which all memory should be freed.

View File

@ -1170,6 +1170,7 @@ struct TALER_EXCHANGE_NonceKey
* Get a set of CS R values using a /csr-melt request. * Get a set of CS R values using a /csr-melt request.
* *
* @param exchange the exchange handle; the exchange must be ready to operate * @param exchange the exchange handle; the exchange must be ready to operate
* @param rms master key used for the derivation of the CS values
* @param nks_len length of the @a nks array * @param nks_len length of the @a nks array
* @param nks array of denominations and nonces * @param nks array of denominations and nonces
* @param res_cb the callback to call when the final result for this request is available * @param res_cb the callback to call when the final result for this request is available
@ -1263,7 +1264,7 @@ typedef void
* Get a CS R using a /csr-withdraw request. * Get a CS R using a /csr-withdraw request.
* *
* @param exchange the exchange handle; the exchange must be ready to operate * @param exchange the exchange handle; the exchange must be ready to operate
* @param dk Which denomination key is the /csr request for * @param pk Which denomination key is the /csr request for
* @param nonce client nonce for the request * @param nonce client nonce for the request
* @param res_cb the callback to call when the final result for this request is available * @param res_cb the callback to call when the final result for this request is available
* @param res_cb_cls closure for the above callback * @param res_cb_cls closure for the above callback
@ -2377,7 +2378,7 @@ struct TALER_EXCHANGE_MeltResponse
union union
{ {
/** /**
* Results for status #MHD_HTTP_SUCCESS. * Results for status #MHD_HTTP_OK.
*/ */
struct struct
{ {
@ -2512,7 +2513,7 @@ struct TALER_EXCHANGE_RevealResult
union union
{ {
/** /**
* Results for status #MHD_HTTP_SUCCESS. * Results for status #MHD_HTTP_OK.
*/ */
struct struct
{ {
@ -2660,7 +2661,7 @@ struct TALER_EXCHANGE_LinkResult
union union
{ {
/** /**
* Results for status #MHD_HTTP_SUCCESS. * Results for status #MHD_HTTP_OK.
*/ */
struct struct
{ {
@ -2704,7 +2705,7 @@ typedef void
* *
* @param exchange the exchange handle; the exchange must be ready to operate * @param exchange the exchange handle; the exchange must be ready to operate
* @param coin_priv private key to request link data for * @param coin_priv private key to request link data for
* @param age_commitment age commitment to the corresponding coin, might be NULL * @param age_commitment_proof age commitment to the corresponding coin, might be NULL
* @param link_cb the callback to call with the useful result of the * @param link_cb the callback to call with the useful result of the
* refresh operation the @a coin_priv was involved in (if any) * refresh operation the @a coin_priv was involved in (if any)
* @param link_cb_cls closure for @a link_cb * @param link_cb_cls closure for @a link_cb
@ -3773,13 +3774,14 @@ TALER_EXCHANGE_management_post_extensions (
TALER_EXCHANGE_ManagementPostExtensionsCallback cb, TALER_EXCHANGE_ManagementPostExtensionsCallback cb,
void *cb_cls); void *cb_cls);
/** /**
* Cancel #TALER_EXCHANGE_post_management_extensions() operation. * Cancel #TALER_EXCHANGE_management_post_extensions() operation.
* *
* @param ph handle of the operation to cancel * @param ph handle of the operation to cancel
*/ */
void void
TALER_EXCHANGE_post_management_extensions_cancel ( TALER_EXCHANGE_management_post_extensions_cancel (
struct TALER_EXCHANGE_ManagementPostExtensionsHandle *ph); struct TALER_EXCHANGE_ManagementPostExtensionsHandle *ph);
@ -4205,7 +4207,7 @@ TALER_EXCHANGE_management_set_global_fees (
/** /**
* Cancel #TALER_EXCHANGE_management_enable_wire() operation. * Cancel #TALER_EXCHANGE_management_enable_wire() operation.
* *
* @param swfh handle of the operation to cancel * @param sgfh handle of the operation to cancel
*/ */
void void
TALER_EXCHANGE_management_set_global_fees_cancel ( TALER_EXCHANGE_management_set_global_fees_cancel (
@ -4637,7 +4639,7 @@ struct TALER_EXCHANGE_AccountMergeResponse
* operation. * operation.
* *
* @param cls closure * @param cls closure
* @param pcr HTTP response data * @param amr HTTP response data
*/ */
typedef void typedef void
(*TALER_EXCHANGE_AccountMergeCallback) ( (*TALER_EXCHANGE_AccountMergeCallback) (
@ -4663,7 +4665,7 @@ struct TALER_EXCHANGE_AccountMergeHandle;
* @param h_contract_terms hash of the purses' contract * @param h_contract_terms hash of the purses' contract
* @param min_age minimum age of deposits into the purse * @param min_age minimum age of deposits into the purse
* @param purse_value_after_fees amount that should be in the purse * @param purse_value_after_fees amount that should be in the purse
* @paran purse_expiration when will the purse expire * @param purse_expiration when will the purse expire
* @param merge_timestamp when is the merge happening (current time) * @param merge_timestamp when is the merge happening (current time)
* @param cb function to call with the exchange's result * @param cb function to call with the exchange's result
* @param cb_cls closure for @a cb * @param cb_cls closure for @a cb
@ -4758,7 +4760,7 @@ struct TALER_EXCHANGE_PurseCreateMergeHandle;
* @param contract_terms contract the purse is about * @param contract_terms contract the purse is about
* @param upload_contract true to upload the contract * @param upload_contract true to upload the contract
* @param pay_for_purse true to pay for purse creation * @param pay_for_purse true to pay for purse creation
* @paran merge_timestamp when should the merge happen (use current time) * @param merge_timestamp when should the merge happen (use current time)
* @param cb function to call with the exchange's result * @param cb function to call with the exchange's result
* @param cb_cls closure for @a cb * @param cb_cls closure for @a cb
* @return the request handle; NULL upon error * @return the request handle; NULL upon error

View File

@ -1420,7 +1420,7 @@ struct TALER_EXCHANGEDB_DepositListEntry
struct TALER_DenominationHashP h_denom_pub; struct TALER_DenominationHashP h_denom_pub;
/** /**
* Age commitment hash, if applicable ot the denomination. Should be all * Age commitment hash, if applicable to the denomination. Should be all
* zeroes if age commitment is not applicable to the denonimation. * zeroes if age commitment is not applicable to the denonimation.
*/ */
struct TALER_AgeCommitmentHash h_age_commitment; struct TALER_AgeCommitmentHash h_age_commitment;
@ -2017,6 +2017,16 @@ typedef enum GNUNET_GenericReturnValue
* *
* @param cls closure * @param cls closure
* @param rowid unique serial ID for the deposit in our DB * @param rowid unique serial ID for the deposit in our DB
* @param reserve_pub reserve affected by the merge
* @param purse_pub purse being merged
* @param h_contract_terms hash over contract of the purse
* @param purse_expiration when would the purse expire
* @param amount total amount in the purse
* @param min_age minimum age of all coins deposited into the purse
* @param flags how was the purse created
* @param purse_fee if a purse fee was paid, how high is it
* @param merge_timestamp when was the merge approved
* @param reserve_sig signature by reserve approving the merge
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
*/ */
typedef enum GNUNET_GenericReturnValue typedef enum GNUNET_GenericReturnValue
@ -2075,6 +2085,10 @@ typedef enum GNUNET_GenericReturnValue
* *
* @param cls closure * @param cls closure
* @param rowid unique serial ID for the deposit in our DB * @param rowid unique serial ID for the deposit in our DB
* @param history_fee fee paid for the request
* @param ts timestamp of the request
* @param reserve_pub reserve history was requested for
* @param reserve_sig signature approving the @a history_fee
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
*/ */
typedef enum GNUNET_GenericReturnValue typedef enum GNUNET_GenericReturnValue
@ -2108,6 +2122,7 @@ typedef enum GNUNET_GenericReturnValue
* the goal of auditing the purse refund's execution. * the goal of auditing the purse refund's execution.
* *
* @param cls closure * @param cls closure
* @param rowid row of the refund event
* @param amount_with_fee amount of the deposit into the purse * @param amount_with_fee amount of the deposit into the purse
* @param coin_pub coin that is to be refunded the @a given amount_with_fee * @param coin_pub coin that is to be refunded the @a given amount_with_fee
* @param denom_pub denomination of @a coin_pub * @param denom_pub denomination of @a coin_pub
@ -3935,8 +3950,8 @@ struct TALER_EXCHANGEDB_Plugin
* Insert global fee set into database. * Insert global fee set into database.
* *
* @param cls closure * @param cls closure
* @param start_date when does the fee go into effect * @param start_date when does the fees go into effect
* @param end_date when does the fee end being valid * @param end_date when does the fees end being valid
* @param fees how high is are the global fees * @param fees how high is are the global fees
* @param purse_timeout when do purses time out * @param purse_timeout when do purses time out
* @param kyc_timeout when do reserves without KYC time out * @param kyc_timeout when do reserves without KYC time out
@ -5101,7 +5116,7 @@ struct TALER_EXCHANGEDB_Plugin
* @param[out] in_conflict set to true if @a econtract * @param[out] in_conflict set to true if @a econtract
* conflicts with an existing contract; * conflicts with an existing contract;
* in this case, the return value will be * in this case, the return value will be
* #GNUNET_DB_STATUS_SUCCESS_ONE despite the failure * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT despite the failure
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
@ -5163,7 +5178,7 @@ struct TALER_EXCHANGEDB_Plugin
* @param[out] in_conflict set to true if the meta data * @param[out] in_conflict set to true if the meta data
* conflicts with an existing purse; * conflicts with an existing purse;
* in this case, the return value will be * in this case, the return value will be
* #GNUNET_DB_STATUS_SUCCESS_ONE despite the failure * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT despite the failure
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
@ -5220,7 +5235,7 @@ struct TALER_EXCHANGEDB_Plugin
/** /**
* Function called to reutrn meta data about a purse by the * Function called to return meta data about a purse by the
* purse public key. * purse public key.
* *
* @param cls the @e cls of this struct with the plugin-specific state * @param cls the @e cls of this struct with the plugin-specific state
@ -5292,7 +5307,7 @@ struct TALER_EXCHANGEDB_Plugin
* @param[out] balance_ok set to false if the coin's * @param[out] balance_ok set to false if the coin's
* remaining balance is below @a amount; * remaining balance is below @a amount;
* in this case, the return value will be * in this case, the return value will be
* #GNUNET_DB_STATUS_SUCCESS_ONE despite the failure * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT despite the failure
* @param[out] conflict the same coin was deposited into * @param[out] conflict the same coin was deposited into
* this purse with a different amount already * this purse with a different amount already
* @return transaction status code * @return transaction status code

View File

@ -99,8 +99,8 @@ TALER_extensions_is_json_config (
* he JSON object must be of type ExchangeKeysResponse as described in * he JSON object must be of type ExchangeKeysResponse as described in
* https://docs.taler.net/design-documents/006-extensions.html#exchange * https://docs.taler.net/design-documents/006-extensions.html#exchange
* *
* @param cfg JSON object containting the configuration for all extensions * @param cfg JSON object containing the configuration for all extensions
* @return GNUNET_OK on success, GNUNET_SYSERR if unknown extensions were found * @return #GNUNET_OK on success, #GNUNET_SYSERR if unknown extensions were found
* or any particular configuration couldn't be parsed. * or any particular configuration couldn't be parsed.
*/ */
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
@ -267,7 +267,7 @@ TALER_extensions_age_restriction_num_groups ();
* Parses a JSON object { "age_groups": "a:b:...y:z" }. * Parses a JSON object { "age_groups": "a:b:...y:z" }.
* *
* @param root is the json object * @param root is the json object
* @param[out] mask on succes, will contain the age mask * @param[out] mask on success, will contain the age mask
* @return #GNUNET_OK on success and #GNUNET_SYSERR on failure. * @return #GNUNET_OK on success and #GNUNET_SYSERR on failure.
*/ */
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue

View File

@ -2229,6 +2229,7 @@ TALER_TESTING_cmd_auditor_add_denom_sig (const char *label,
* @param wire_method wire method to set wire fees for * @param wire_method wire method to set wire fees for
* @param wire_fee the wire fee to affirm * @param wire_fee the wire fee to affirm
* @param closing_fee the closing fee to affirm * @param closing_fee the closing fee to affirm
* @param wad_fee wad fee to charge
* @param expected_http_status expected HTTP status from exchange * @param expected_http_status expected HTTP status from exchange
* @param bad_sig should we use a bogus signature? * @param bad_sig should we use a bogus signature?
* @return the command * @return the command

View File

@ -494,12 +494,12 @@ TALER_yna_to_string (enum TALER_EXCHANGE_YesNoAll yna);
#ifdef __APPLE__ #ifdef __APPLE__
/** /**
* Returns the first occurence of `c` in `s`, or returns the null-byte * Returns the first occurrence of `c` in `s`, or returns the null-byte
* terminating the string if it does not occur. * terminating the string if it does not occur.
* *
* @param s the string to search in * @param s the string to search in
* @param c the character to search for * @param c the character to search for
* @return char* the first occurence of `c` in `s` * @return char* the first occurrence of `c` in `s`
*/ */
char *strchrnul (const char *s, int c); char *strchrnul (const char *s, int c);

View File

@ -156,6 +156,7 @@ handle_deposit_confirmation_finished (void *cls,
* @param h_extensions hash over the extensions, if any * @param h_extensions hash over the extensions, if any
* @param h_contract_terms hash of the contact of the merchant with the customer (further details are never disclosed to the auditor) * @param h_contract_terms hash of the contact of the merchant with the customer (further details are never disclosed to the auditor)
* @param exchange_timestamp timestamp when the deposit was received by the wallet * @param exchange_timestamp timestamp when the deposit was received by the wallet
* @param wire_deadline by what time must the amount be wired to the merchant
* @param refund_deadline date until which the merchant can issue a refund to the customer via the auditor (can be zero if refunds are not allowed); must not be after the @a wire_deadline * @param refund_deadline date until which the merchant can issue a refund to the customer via the auditor (can be zero if refunds are not allowed); must not be after the @a wire_deadline
* @param amount_without_fee the amount confirmed to be wired by the exchange to the merchant * @param amount_without_fee the amount confirmed to be wired by the exchange to the merchant
* @param coin_pub coins public key * @param coin_pub coins public key

View File

@ -145,7 +145,8 @@ struct TALER_EXCHANGE_BatchWithdrawHandle
* *
* @param cls the `struct TALER_EXCHANGE_BatchWithdrawHandle` * @param cls the `struct TALER_EXCHANGE_BatchWithdrawHandle`
* @param hr HTTP response data * @param hr HTTP response data
* @param blind_sig blind signature over the coin, NULL on error * @param blind_sigs array of blind signatures over the coins, NULL on error
* @param blind_sigs_length length of the @a blind_sigs array
*/ */
static void static void
handle_reserve_batch_withdraw_finished ( handle_reserve_batch_withdraw_finished (

View File

@ -50,6 +50,7 @@ TALER_EXCHANGE_check_purse_create_conflict_ (
* not match the signature from the proof) * not match the signature from the proof)
* @param merge_pub the public key (must match * @param merge_pub the public key (must match
* the signature from the proof) * the signature from the proof)
* @param purse_pub the public key of the purse
* @param exchange_url the base URL of this exchange * @param exchange_url the base URL of this exchange
* @param proof the proof to check * @param proof the proof to check
* @return #GNUNET_OK if the @a proof is OK for @a purse_pub and @a merge_pub and conflicts with @a cmerge_sig * @return #GNUNET_OK if the @a proof is OK for @a purse_pub and @a merge_pub and conflicts with @a cmerge_sig
@ -93,7 +94,6 @@ TALER_EXCHANGE_check_purse_coin_conflict_ (
* @param ccontract_sig conflicting signature (must * @param ccontract_sig conflicting signature (must
* not match the signature from the proof) * not match the signature from the proof)
* @param purse_pub public key of the purse * @param purse_pub public key of the purse
* @param exchange_url the base URL of this exchange
* @param proof the proof to check * @param proof the proof to check
* @return #GNUNET_OK if the @a proof is OK for @a purse_pub and conflicts with @a ccontract_sig * @return #GNUNET_OK if the @a proof is OK for @a purse_pub and conflicts with @a ccontract_sig
*/ */

View File

@ -323,7 +323,6 @@ TALER_EXCHANGE_deposits_get (
TALER_merchant_deposit_sign (h_contract_terms, TALER_merchant_deposit_sign (h_contract_terms,
h_wire, h_wire,
coin_pub, coin_pub,
&merchant,
merchant_priv, merchant_priv,
&merchant_sig); &merchant_sig);
{ {

View File

@ -118,7 +118,7 @@ handle_post_extensions_finished (void *cls,
&hr); &hr);
ph->cb = NULL; ph->cb = NULL;
} }
TALER_EXCHANGE_post_management_extensions_cancel (ph); TALER_EXCHANGE_management_post_extensions_cancel (ph);
} }
@ -180,7 +180,7 @@ TALER_EXCHANGE_management_post_extensions (
ph); ph);
if (NULL == ph->job) if (NULL == ph->job)
{ {
TALER_EXCHANGE_post_management_extensions_cancel (ph); TALER_EXCHANGE_management_post_extensions_cancel (ph);
return NULL; return NULL;
} }
return ph; return ph;
@ -188,7 +188,7 @@ TALER_EXCHANGE_management_post_extensions (
void void
TALER_EXCHANGE_post_management_extensions_cancel ( TALER_EXCHANGE_management_post_extensions_cancel (
struct TALER_EXCHANGE_ManagementPostExtensionsHandle *ph) struct TALER_EXCHANGE_ManagementPostExtensionsHandle *ph)
{ {
if (NULL != ph->job) if (NULL != ph->job)

View File

@ -417,6 +417,7 @@ start_melt (struct TALER_EXCHANGE_MeltHandle *mh)
* the application and cancel the operation. * the application and cancel the operation.
* *
* @param[in] mh melt request that failed * @param[in] mh melt request that failed
* @param ec error code to fail with
*/ */
static void static void
fail_mh (struct TALER_EXCHANGE_MeltHandle *mh, fail_mh (struct TALER_EXCHANGE_MeltHandle *mh,

View File

@ -62,7 +62,7 @@ struct PurseMergeState
const char *merge_ref; const char *merge_ref;
/** /**
* Refernece to the reserve, or NULL (!). * Reference to the reserve, or NULL (!).
*/ */
const char *reserve_ref; const char *reserve_ref;

View File

@ -348,15 +348,7 @@ do_reveal_retry (void *cls)
* coming from the exchange, namely the fresh coins. * coming from the exchange, namely the fresh coins.
* *
* @param cls closure, a `struct RefreshRevealState` * @param cls closure, a `struct RefreshRevealState`
* @param hr HTTP response details * @param rr HTTP response details
* @param num_coins number of fresh coins created, length of the
* @a sigs and @a coin_privs arrays, 0 if the operation
* failed.
* @param coin_privs array of @a num_coins private keys for the
* coins that were created, NULL on error.
* @param psa array of @a num_coins planchet secrets (derived from the transfer secret) for each of the coins
* @param sigs array of signature over @a num_coins coins,
* NULL on error.
*/ */
static void static void
reveal_cb (void *cls, reveal_cb (void *cls,
@ -594,16 +586,7 @@ do_link_retry (void *cls)
* withdrawn by the "refresh reveal" CMD. * withdrawn by the "refresh reveal" CMD.
* *
* @param cls closure. * @param cls closure.
* @param hr HTTP response details * @param lr HTTP response details
* @param num_coins number of fresh coins created, length of the
* @a sigs and @a coin_privs arrays, 0 if the operation
* failed.
* @param coin_privs array of @a num_coins private keys for the
* coins that were created, NULL on error.
* @param sigs array of signature over @a num_coins coins, NULL on
* error.
* @param pubs array of public keys for the @a sigs,
* NULL on error.
*/ */
static void static void
link_cb (void *cls, link_cb (void *cls,

View File

@ -17,7 +17,7 @@
<http://www.gnu.org/licenses/> <http://www.gnu.org/licenses/>
*/ */
/** /**
* @file testing/testing_api_cmd_history.c * @file testing/testing_api_cmd_reserve_history.c
* @brief Implement the /reserve/history test command. * @brief Implement the /reserve/history test command.
* @author Marcello Stanisci * @author Marcello Stanisci
*/ */

View File

@ -103,7 +103,7 @@ struct ReservePurseState
json_t *contract_terms; json_t *contract_terms;
/** /**
* Refernece to the reserve, or NULL (!). * Reference to the reserve, or NULL (!).
*/ */
const char *reserve_ref; const char *reserve_ref;

View File

@ -17,7 +17,7 @@
<http://www.gnu.org/licenses/> <http://www.gnu.org/licenses/>
*/ */
/** /**
* @file testing/testing_api_cmd_status.c * @file testing/testing_api_cmd_reserve_status.c
* @brief Implement the /reserve/$RID/status test command. * @brief Implement the /reserve/$RID/status test command.
* @author Marcello Stanisci * @author Marcello Stanisci
*/ */

View File

@ -46,12 +46,6 @@ struct TALER_DepositTrackPS
*/ */
struct TALER_MerchantWireHashP h_wire GNUNET_PACKED; struct TALER_MerchantWireHashP h_wire GNUNET_PACKED;
/**
* The Merchant's public key. The deposit inquiry request is to be
* signed by the corresponding private key (using EdDSA).
*/
struct TALER_MerchantPublicKeyP merchant;
/** /**
* The coin's public key. This is the value that must have been * The coin's public key. This is the value that must have been
* signed (blindly) by the Exchange. * signed (blindly) by the Exchange.
@ -68,7 +62,6 @@ TALER_merchant_deposit_sign (
const struct TALER_PrivateContractHashP *h_contract_terms, const struct TALER_PrivateContractHashP *h_contract_terms,
const struct TALER_MerchantWireHashP *h_wire, const struct TALER_MerchantWireHashP *h_wire,
const struct TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct TALER_MerchantPublicKeyP *merchant_pub,
const struct TALER_MerchantPrivateKeyP *merchant_priv, const struct TALER_MerchantPrivateKeyP *merchant_priv,
struct TALER_MerchantSignatureP *merchant_sig) struct TALER_MerchantSignatureP *merchant_sig)
{ {
@ -77,9 +70,9 @@ TALER_merchant_deposit_sign (
.purpose.size = htonl (sizeof (dtp)), .purpose.size = htonl (sizeof (dtp)),
.h_contract_terms = *h_contract_terms, .h_contract_terms = *h_contract_terms,
.h_wire = *h_wire, .h_wire = *h_wire,
.merchant = *merchant_pub,
.coin_pub = *coin_pub .coin_pub = *coin_pub
}; };
GNUNET_CRYPTO_eddsa_sign (&merchant_priv->eddsa_priv, GNUNET_CRYPTO_eddsa_sign (&merchant_priv->eddsa_priv,
&dtp, &dtp,
&merchant_sig->eddsa_sig); &merchant_sig->eddsa_sig);
@ -97,7 +90,6 @@ TALER_merchant_deposit_verify (
struct TALER_DepositTrackPS tps = { struct TALER_DepositTrackPS tps = {
.purpose.size = htonl (sizeof (tps)), .purpose.size = htonl (sizeof (tps)),
.purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION), .purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION),
.merchant = *merchant,
.coin_pub = *coin_pub, .coin_pub = *coin_pub,
.h_contract_terms = *h_contract_terms, .h_contract_terms = *h_contract_terms,
.h_wire = *h_wire .h_wire = *h_wire
@ -107,7 +99,7 @@ TALER_merchant_deposit_verify (
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION,
&tps, &tps,
&merchant_sig->eddsa_sig, &merchant_sig->eddsa_sig,
&tps.merchant.eddsa_pub); &merchant->eddsa_pub);
} }

View File

@ -162,7 +162,7 @@ generate (
sizeof(seed)); sizeof(seed));
json_object_set (j_top, json_object_set (j_top,
"commited_age", "committed_age",
json_integer (age)); json_integer (age));
ret = TALER_age_restriction_commit (mask, ret = TALER_age_restriction_commit (mask,
@ -214,7 +214,7 @@ generate (
"not required: age group is 0"); "not required: age group is 0");
else if (min_group > age_group) else if (min_group > age_group)
j_reason = json_string ( j_reason = json_string (
"not applicable: commited age too small"); "not applicable: committed age too small");
else else
j_reason = GNUNET_JSON_PACK ( j_reason = GNUNET_JSON_PACK (
GNUNET_JSON_pack_data_auto (NULL, &at)); GNUNET_JSON_pack_data_auto (NULL, &at));

View File

@ -640,7 +640,7 @@ struct TALER_ReserveHistoryRequestPS
struct GNUNET_CRYPTO_EccSignaturePurpose purpose; struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
/** /**
* When did the wallet make the requst. * When did the wallet make the request.
*/ */
struct GNUNET_TIME_TimestampNBO request_timestamp; struct GNUNET_TIME_TimestampNBO request_timestamp;
@ -708,7 +708,7 @@ struct TALER_ReserveStatusRequestPS
struct GNUNET_CRYPTO_EccSignaturePurpose purpose; struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
/** /**
* When did the wallet make the requst. * When did the wallet make the request.
*/ */
struct GNUNET_TIME_TimestampNBO request_timestamp; struct GNUNET_TIME_TimestampNBO request_timestamp;