handle double-revoke gracefully
This commit is contained in:
parent
bab213e794
commit
414237c335
@ -454,7 +454,14 @@ handle_revoke_request (struct TES_Client *client,
|
|||||||
"Revocation request ignored, key unknown\n");
|
"Revocation request ignored, key unknown\n");
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
if (key->purge)
|
||||||
|
{
|
||||||
|
GNUNET_assert (0 == pthread_mutex_unlock (&keys_lock));
|
||||||
|
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
||||||
|
"Revocation request ignored, key %s already revoked\n",
|
||||||
|
TALER_B2S (&key->exchange_pub));
|
||||||
|
return GNUNET_OK;
|
||||||
|
}
|
||||||
key_gen++;
|
key_gen++;
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
"Revoking key %s, bumping generation to %llu\n",
|
"Revoking key %s, bumping generation to %llu\n",
|
||||||
|
@ -573,11 +573,19 @@ handle_revoke_request (struct TES_Client *client,
|
|||||||
GNUNET_h2s (&rr->h_rsa.hash));
|
GNUNET_h2s (&rr->h_rsa.hash));
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
if (dk->purge)
|
||||||
|
{
|
||||||
|
GNUNET_assert (0 == pthread_mutex_unlock (&keys_lock));
|
||||||
|
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
||||||
|
"Revocation request ignored, denomination key %s already revoked\n",
|
||||||
|
GNUNET_h2s (&rr->h_rsa.hash));
|
||||||
|
return GNUNET_OK;
|
||||||
|
}
|
||||||
|
|
||||||
key_gen++;
|
key_gen++;
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
"Revoking key %p, bumping generation to %llu\n",
|
"Revoking key %s, bumping generation to %llu\n",
|
||||||
dk,
|
GNUNET_h2s (&rr->h_rsa.hash),
|
||||||
(unsigned long long) key_gen);
|
(unsigned long long) key_gen);
|
||||||
purge_key (dk);
|
purge_key (dk);
|
||||||
|
|
||||||
|
@ -197,8 +197,9 @@ test_revocation (struct TALER_CRYPTO_ExchangeSignHelper *esh)
|
|||||||
}
|
}
|
||||||
keys[j].revoked = true;
|
keys[j].revoked = true;
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
"Revoking key %s ...",
|
"Revoking key %s (%u) ...",
|
||||||
TALER_B2S (&keys[j].exchange_pub));
|
TALER_B2S (&keys[j].exchange_pub),
|
||||||
|
j);
|
||||||
TALER_CRYPTO_helper_esign_revoke (esh,
|
TALER_CRYPTO_helper_esign_revoke (esh,
|
||||||
&keys[j].exchange_pub);
|
&keys[j].exchange_pub);
|
||||||
for (unsigned int k = 0; k<1000; k++)
|
for (unsigned int k = 0; k<1000; k++)
|
||||||
|
Loading…
Reference in New Issue
Block a user