-fix derivation, logging
This commit is contained in:
parent
17a00ef22d
commit
9a05781ab3
@ -201,8 +201,8 @@ TALER_age_commitment_derive (
|
|||||||
{
|
{
|
||||||
GNUNET_CRYPTO_edx25519_public_key_derive (
|
GNUNET_CRYPTO_edx25519_public_key_derive (
|
||||||
&orig->commitment.keys[i].pub,
|
&orig->commitment.keys[i].pub,
|
||||||
&salt,
|
salt,
|
||||||
sizeof(salt),
|
sizeof(*salt),
|
||||||
&newacp->commitment.keys[i].pub);
|
&newacp->commitment.keys[i].pub);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,13 +199,21 @@ test_attestation (void)
|
|||||||
age_group,
|
age_group,
|
||||||
min_group);
|
min_group);
|
||||||
|
|
||||||
|
GNUNET_break (GNUNET_OK == ret);
|
||||||
|
|
||||||
if (min_group <= age_group &&
|
if (min_group <= age_group &&
|
||||||
GNUNET_OK != ret)
|
GNUNET_OK != ret)
|
||||||
|
{
|
||||||
|
GNUNET_break (0);
|
||||||
ret = GNUNET_SYSERR;
|
ret = GNUNET_SYSERR;
|
||||||
|
}
|
||||||
|
|
||||||
if (min_group > age_group &&
|
if (min_group > age_group &&
|
||||||
GNUNET_NO != ret)
|
GNUNET_NO != ret)
|
||||||
|
{
|
||||||
|
GNUNET_break (0);
|
||||||
ret = GNUNET_SYSERR;
|
ret = GNUNET_SYSERR;
|
||||||
|
}
|
||||||
|
|
||||||
if (min_group > age_group)
|
if (min_group > age_group)
|
||||||
continue;
|
continue;
|
||||||
@ -224,14 +232,20 @@ test_attestation (void)
|
|||||||
min_group);
|
min_group);
|
||||||
|
|
||||||
if (GNUNET_OK != ret)
|
if (GNUNET_OK != ret)
|
||||||
|
{
|
||||||
|
GNUNET_break (0);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TALER_age_commitment_proof_free (&acp[i]);
|
TALER_age_commitment_proof_free (&acp[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GNUNET_SYSERR == ret)
|
if (GNUNET_SYSERR == ret)
|
||||||
|
{
|
||||||
|
GNUNET_break (0);
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
@ -243,10 +257,16 @@ main (int argc,
|
|||||||
{
|
{
|
||||||
(void) argc;
|
(void) argc;
|
||||||
(void) argv;
|
(void) argv;
|
||||||
|
GNUNET_log_setup ("test-age-restriction",
|
||||||
|
"INFO",
|
||||||
|
NULL);
|
||||||
if (GNUNET_OK != test_groups ())
|
if (GNUNET_OK != test_groups ())
|
||||||
return 1;
|
return 1;
|
||||||
if (GNUNET_OK != test_attestation ())
|
if (GNUNET_OK != test_attestation ())
|
||||||
|
{
|
||||||
|
GNUNET_break (0);
|
||||||
return 2;
|
return 2;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user