work on #7099
This commit is contained in:
parent
ed6634f98e
commit
bab213e794
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of TALER
|
This file is part of TALER
|
||||||
Copyright (C) 2020 Taler Systems SA
|
Copyright (C) 2020, 2021 Taler Systems SA
|
||||||
|
|
||||||
TALER is free software; you can redistribute it and/or modify it under the
|
TALER is free software; you can redistribute it and/or modify it under the
|
||||||
terms of the GNU General Public License as published by the Free Software
|
terms of the GNU General Public License as published by the Free Software
|
||||||
|
@ -387,8 +387,8 @@ TALER_CRYPTO_helper_esign_sign_ (
|
|||||||
uint16_t msize;
|
uint16_t msize;
|
||||||
|
|
||||||
ret = recv (esh->sock,
|
ret = recv (esh->sock,
|
||||||
buf,
|
&buf[off],
|
||||||
sizeof (buf),
|
sizeof (buf) - off,
|
||||||
(finished && (0 == off))
|
(finished && (0 == off))
|
||||||
? MSG_DONTWAIT
|
? MSG_DONTWAIT
|
||||||
: 0);
|
: 0);
|
||||||
@ -410,6 +410,8 @@ TALER_CRYPTO_helper_esign_sign_ (
|
|||||||
if (0 == ret)
|
if (0 == ret)
|
||||||
{
|
{
|
||||||
GNUNET_break (0 == off);
|
GNUNET_break (0 == off);
|
||||||
|
if (finished)
|
||||||
|
return TALER_EC_NONE;
|
||||||
return TALER_EC_EXCHANGE_SIGNKEY_HELPER_BUG;
|
return TALER_EC_EXCHANGE_SIGNKEY_HELPER_BUG;
|
||||||
}
|
}
|
||||||
off += ret;
|
off += ret;
|
||||||
|
@ -445,8 +445,8 @@ TALER_CRYPTO_helper_rsa_sign (
|
|||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
|
|
||||||
ret = recv (dh->sock,
|
ret = recv (dh->sock,
|
||||||
buf,
|
&buf[off],
|
||||||
sizeof (buf),
|
sizeof (buf) - off,
|
||||||
(finished && (0 == off))
|
(finished && (0 == off))
|
||||||
? MSG_DONTWAIT
|
? MSG_DONTWAIT
|
||||||
: 0);
|
: 0);
|
||||||
@ -483,8 +483,14 @@ more:
|
|||||||
switch (ntohs (hdr->type))
|
switch (ntohs (hdr->type))
|
||||||
{
|
{
|
||||||
case TALER_HELPER_RSA_MT_RES_SIGNATURE:
|
case TALER_HELPER_RSA_MT_RES_SIGNATURE:
|
||||||
if ( (msize < sizeof (struct TALER_CRYPTO_SignResponse)) ||
|
if (msize < sizeof (struct TALER_CRYPTO_SignResponse))
|
||||||
(finished) )
|
{
|
||||||
|
GNUNET_break_op (0);
|
||||||
|
do_disconnect (dh);
|
||||||
|
*ec = TALER_EC_EXCHANGE_DENOMINATION_HELPER_BUG;
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if (finished)
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
do_disconnect (dh);
|
do_disconnect (dh);
|
||||||
@ -525,7 +531,8 @@ 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);
|
||||||
return ds;
|
finished = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case TALER_HELPER_RSA_MT_AVAIL:
|
case TALER_HELPER_RSA_MT_AVAIL:
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
|
@ -194,9 +194,6 @@ cleanup:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Send a signal to all clients to notify them about a key generation change.
|
|
||||||
*/
|
|
||||||
void
|
void
|
||||||
TES_wake_clients (void)
|
TES_wake_clients (void)
|
||||||
{
|
{
|
||||||
@ -216,13 +213,6 @@ TES_wake_clients (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Read work request from the client.
|
|
||||||
*
|
|
||||||
* @param cls a `struct TES_Client *`
|
|
||||||
* @param dispatch function to call with work requests received
|
|
||||||
* @return #GNUNET_OK on success
|
|
||||||
*/
|
|
||||||
enum GNUNET_GenericReturnValue
|
enum GNUNET_GenericReturnValue
|
||||||
TES_read_work (void *cls,
|
TES_read_work (void *cls,
|
||||||
TES_MessageDispatch dispatch)
|
TES_MessageDispatch dispatch)
|
||||||
@ -234,8 +224,6 @@ TES_read_work (void *cls,
|
|||||||
const struct GNUNET_MessageHeader *hdr;
|
const struct GNUNET_MessageHeader *hdr;
|
||||||
enum GNUNET_GenericReturnValue ret;
|
enum GNUNET_GenericReturnValue ret;
|
||||||
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
ssize_t recv_size;
|
ssize_t recv_size;
|
||||||
@ -268,6 +256,7 @@ TES_read_work (void *cls,
|
|||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
off += recv_size;
|
off += recv_size;
|
||||||
|
more:
|
||||||
if (off < sizeof (struct GNUNET_MessageHeader))
|
if (off < sizeof (struct GNUNET_MessageHeader))
|
||||||
continue;
|
continue;
|
||||||
hdr = (const struct GNUNET_MessageHeader *) buf;
|
hdr = (const struct GNUNET_MessageHeader *) buf;
|
||||||
@ -294,7 +283,7 @@ TES_read_work (void *cls,
|
|||||||
&buf[msize],
|
&buf[msize],
|
||||||
off - msize);
|
off - msize);
|
||||||
off -= msize;
|
off -= msize;
|
||||||
}
|
goto more;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user