diff options
author | Christian Blättler <blatc2@bfh.ch> | 2024-04-20 10:53:42 +0200 |
---|---|---|
committer | Christian Blättler <blatc2@bfh.ch> | 2024-04-20 10:53:42 +0200 |
commit | fe9a1da369a9e46dcad373ff2ffa935ea3ae8278 (patch) | |
tree | c1d12b8d5a4fee24ea5da4d84a9b75da207b2914 /src/backend/taler-merchant-httpd_private-post-orders.c | |
parent | 105974b59fea2a475e15e455de57ab9f07a6841e (diff) |
rename keys
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-post-orders.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_private-post-orders.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c b/src/backend/taler-merchant-httpd_private-post-orders.c index 4ac997ae..e959b221 100644 --- a/src/backend/taler-merchant-httpd_private-post-orders.c +++ b/src/backend/taler-merchant-httpd_private-post-orders.c @@ -1518,12 +1518,12 @@ set_token_family (struct OrderContext *oc, return GNUNET_SYSERR; } - if (GNUNET_CRYPTO_BSA_INVALID == key_details.pub.public_key.cipher) + if (NULL == key_details.pub.public_key) { /* There is no matching key for this token family yet. */ /* We have to generate one. */ /* If public key is invalid, private key must also be invalid */ - GNUNET_assert (GNUNET_CRYPTO_BSA_INVALID == key_details.priv.private_key.cipher); + GNUNET_assert (NULL == key_details.priv.private_key); enum GNUNET_DB_QueryStatus iqs; struct GNUNET_CRYPTO_BlindSignPrivateKey *priv; @@ -1539,16 +1539,13 @@ set_token_family (struct OrderContext *oc, GNUNET_CRYPTO_BSA_RSA, 4096); - struct TALER_TokenFamilyPublicKey token_pub = { - .public_key = *pub, + struct TALER_TokenIssuePublicKey token_pub = { + .public_key = pub, }; - struct TALER_TokenFamilyPrivateKey token_priv = { - .private_key = *priv, + struct TALER_TokenIssuePrivateKey token_priv = { + .private_key = priv, }; - // TODO: Check if I have to decref pub and priv here. - // GNUNET_CRYPTO_blind_sign_pub_decref (pub); - iqs = TMH_db->insert_token_family_key (TMH_db->cls, slug, &token_pub, @@ -1706,14 +1703,14 @@ serialize_order (struct OrderContext *oc) for (unsigned int j = 0; j<family->keys_len; j++) { struct TALER_MerchantContractTokenFamilyKey key = family->keys[j]; - cipher = key.pub.public_key.cipher; + cipher = key.pub.public_key->cipher; json_t *jkey = GNUNET_JSON_PACK ( GNUNET_JSON_pack_data_auto ("h_pub", - &key.pub.public_key.pub_key_hash), + &key.pub.public_key->pub_key_hash), GNUNET_JSON_pack_allow_null( GNUNET_JSON_pack_rsa_public_key ("rsa_pub", - key.pub.public_key.details.rsa_public_key)), + key.pub.public_key->details.rsa_public_key)), // GNUNET_JSON_pack_allow_null( // GNUNET_JSON_pack_data_auto ("cs_pub", // &key.pub.public_key.details.cs_public_key)), |