aboutsummaryrefslogtreecommitdiff
path: root/src/mint/taler-mint-httpd_keys.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mint/taler-mint-httpd_keys.c')
-rw-r--r--src/mint/taler-mint-httpd_keys.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/mint/taler-mint-httpd_keys.c b/src/mint/taler-mint-httpd_keys.c
index fc425876f..71d7f077e 100644
--- a/src/mint/taler-mint-httpd_keys.c
+++ b/src/mint/taler-mint-httpd_keys.c
@@ -72,41 +72,6 @@ TALER_MINT_handler_keys (struct RequestHandler *rh,
72} 72}
73 73
74 74
75/**
76 * Check if a coin is valid; that is, whether the denomination key exists,
77 * is not expired, and the signature is correct.
78 *
79 * @param key_state the key state to use for checking the coin's validity
80 * @param coin_public_info the coin public info to check for validity
81 * @return #GNUNET_YES if the coin is valid,
82 * #GNUNET_NO if it is invalid
83 * #GNUNET_SYSERROR if an internal error occured
84 */
85int
86TALER_MINT_test_coin_valid (const struct MintKeyState *key_state,
87 const struct TALER_CoinPublicInfo *coin_public_info)
88{
89 struct TALER_MINT_DenomKeyIssuePriv *dki;
90 struct GNUNET_HashCode c_hash;
91
92 dki = TALER_MINT_get_denom_key (key_state, coin_public_info->denom_pub);
93 if (NULL == dki)
94 return GNUNET_NO;
95 /* FIXME: we had envisioned a more complex scheme... */
96 GNUNET_CRYPTO_hash (&coin_public_info->coin_pub,
97 sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
98 &c_hash);
99 if (GNUNET_OK !=
100 GNUNET_CRYPTO_rsa_verify (&c_hash,
101 coin_public_info->denom_sig,
102 dki->issue.denom_pub))
103 {
104 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
105 "coin signature is invalid\n");
106 return GNUNET_NO;
107 }
108 return GNUNET_YES;
109}
110 75
111 76
112/** 77/**