more logging

This commit is contained in:
Christian Grothoff 2021-12-03 16:16:19 +01:00
parent dfe245814c
commit ec45eaae18
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
2 changed files with 22 additions and 1 deletions

View File

@ -83,6 +83,8 @@ try_connect (struct TALER_CRYPTO_RsaDenominationHelper *dh)
{ {
if (-1 != dh->sock) if (-1 != dh->sock)
return GNUNET_OK; return GNUNET_OK;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Establishing connection!\n");
dh->sock = socket (AF_UNIX, dh->sock = socket (AF_UNIX,
SOCK_STREAM, SOCK_STREAM,
0); 0);
@ -103,6 +105,7 @@ try_connect (struct TALER_CRYPTO_RsaDenominationHelper *dh)
do_disconnect (dh); do_disconnect (dh);
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
TALER_CRYPTO_helper_rsa_poll (dh);
return GNUNET_OK; return GNUNET_OK;
} }
@ -153,7 +156,6 @@ TALER_CRYPTO_helper_rsa_connect (
TALER_CRYPTO_helper_rsa_disconnect (dh); TALER_CRYPTO_helper_rsa_disconnect (dh);
return NULL; return NULL;
} }
TALER_CRYPTO_helper_rsa_poll (dh);
return dh; return dh;
} }
@ -397,6 +399,8 @@ TALER_CRYPTO_helper_rsa_sign (
.cipher = TALER_DENOMINATION_INVALID .cipher = TALER_DENOMINATION_INVALID
}; };
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Starting signature process\n");
if (GNUNET_OK != if (GNUNET_OK !=
try_connect (dh)) try_connect (dh))
{ {
@ -406,6 +410,8 @@ TALER_CRYPTO_helper_rsa_sign (
return ds; return ds;
} }
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Requesting signature\n");
{ {
char buf[sizeof (struct TALER_CRYPTO_SignRequest) + msg_size]; char buf[sizeof (struct TALER_CRYPTO_SignRequest) + msg_size];
struct TALER_CRYPTO_SignRequest *sr struct TALER_CRYPTO_SignRequest *sr
@ -431,6 +437,8 @@ TALER_CRYPTO_helper_rsa_sign (
} }
} }
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Awaiting reply\n");
{ {
char buf[UINT16_MAX]; char buf[UINT16_MAX];
size_t off = 0; size_t off = 0;
@ -512,6 +520,8 @@ more:
*ec = TALER_EC_EXCHANGE_DENOMINATION_HELPER_BUG; *ec = TALER_EC_EXCHANGE_DENOMINATION_HELPER_BUG;
goto end; goto end;
} }
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Received signature\n");
*ec = TALER_EC_NONE; *ec = TALER_EC_NONE;
finished = true; finished = true;
ds.cipher = TALER_DENOMINATION_RSA; ds.cipher = TALER_DENOMINATION_RSA;
@ -531,10 +541,14 @@ more:
(const struct TALER_CRYPTO_SignFailure *) buf; (const struct TALER_CRYPTO_SignFailure *) buf;
*ec = (enum TALER_ErrorCode) ntohl (sf->ec); *ec = (enum TALER_ErrorCode) ntohl (sf->ec);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Signing failed!\n");
finished = true; finished = true;
break; break;
} }
case TALER_HELPER_RSA_MT_AVAIL: case TALER_HELPER_RSA_MT_AVAIL:
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Received new key!\n");
if (GNUNET_OK != if (GNUNET_OK !=
handle_mt_avail (dh, handle_mt_avail (dh,
hdr)) hdr))
@ -546,6 +560,8 @@ more:
} }
break; /* while(1) loop ensures we recvfrom() again */ break; /* while(1) loop ensures we recvfrom() again */
case TALER_HELPER_RSA_MT_PURGE: case TALER_HELPER_RSA_MT_PURGE:
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Received revocation!\n");
if (GNUNET_OK != if (GNUNET_OK !=
handle_mt_purge (dh, handle_mt_purge (dh,
hdr)) hdr))

View File

@ -388,6 +388,11 @@ handle_sign_request (struct TES_Client *client,
GNUNET_YES)); GNUNET_YES));
ret = TES_transmit (client->csock, ret = TES_transmit (client->csock,
&sr->header); &sr->header);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Sent RSA signature after %s\n",
GNUNET_STRINGS_relative_time_to_string (
GNUNET_TIME_absolute_get_duration (now),
GNUNET_YES));
GNUNET_free (sr); GNUNET_free (sr);
return ret; return ret;
} }