summaryrefslogtreecommitdiff
path: root/src/util/taler-exchange-secmod-rsa.c
diff options
context:
space:
mode:
authorGian Demarmels <gian@demarmels.org>2022-01-29 12:57:25 +0100
committerGian Demarmels <gian@demarmels.org>2022-02-04 15:39:57 +0100
commit8674f32aec8113ced6b2c2be625728b31158fff8 (patch)
tree32dbf9b07c6cccd8b72fc068ed6f66a6d9e50d80 /src/util/taler-exchange-secmod-rsa.c
parent086cf05794e2936370223c97b35c1909fbc1a2c1 (diff)
downloadexchange-8674f32aec8113ced6b2c2be625728b31158fff8.tar.gz
exchange-8674f32aec8113ced6b2c2be625728b31158fff8.tar.bz2
exchange-8674f32aec8113ced6b2c2be625728b31158fff8.zip
denomination CIPHER field per denom
Diffstat (limited to 'src/util/taler-exchange-secmod-rsa.c')
-rw-r--r--src/util/taler-exchange-secmod-rsa.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/util/taler-exchange-secmod-rsa.c b/src/util/taler-exchange-secmod-rsa.c
index 433879299..fef20524d 100644
--- a/src/util/taler-exchange-secmod-rsa.c
+++ b/src/util/taler-exchange-secmod-rsa.c
@@ -41,6 +41,7 @@
#include "secmod_common.h"
#include <poll.h>
+#define TALER_CFG_CIPHER_LEN 3
/**
* Information we keep per denomination.
@@ -1340,6 +1341,7 @@ load_denominations (void *cls,
struct LoadContext *ctx = cls;
struct Denomination *denom;
bool wake = true;
+ char *cipher;
if ( (0 != strncasecmp (denomination_alias,
"coin_",
@@ -1348,6 +1350,25 @@ load_denominations (void *cls,
"coin-",
strlen ("coin-"))) )
return; /* not a denomination type definition */
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_string (ctx->cfg,
+ denomination_alias,
+ "CIPHER",
+ &cipher))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ denomination_alias,
+ "CIPHER");
+ return;
+ }
+ if (strlen (cipher) > TALER_CFG_CIPHER_LEN)
+ {
+ return; /* Cipher length must be smaller than TALER_CFG_CIPHER_LEN */
+ }
+ if (0 != strcmp (cipher, "RSA"))
+ {
+ return; /* Ignore denominations of other types than CS */
+ }
denom = GNUNET_new (struct Denomination);
if (GNUNET_OK !=
parse_denomination_cfg (ctx->cfg,