27#include "gnunet_signatures.h"
70 "Revocation query MQ error\n");
90 "Revocation query result: %d\n",
204 "Revocation MQ error\n");
205 h->func (
h->func_cls,
224 "Revocation transmission result: %d\n",
226 h->func (
h->func_cls,
309 h->func_cls = func_cls;
316 memcpy (&rm[1], pow, extra_len);
struct GNUNET_MQ_MessageHandlers handlers[]
struct GNUNET_MQ_Envelope * env
static struct GNUNET_ARM_Handle * h
Connection with ARM.
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
struct GNUNET_HashCode key
The key used in the DHT.
static struct GNUNET_REVOCATION_Query * q
Handle for revocation query.
static struct GNUNET_TIME_Relative epoch_duration
Epoch length.
static unsigned long long matching_bits
Number of matching bits required for revocation.
Constants for network protocols.
API to perform and access key revocations.
struct GNUNET_MQ_Handle * GNUNET_CLIENT_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *service_name, const struct GNUNET_MQ_MessageHandler *handlers, GNUNET_MQ_ErrorHandler error_handler, void *error_handler_cls)
Create a message queue to connect to a GNUnet service.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_number(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, unsigned long long *number)
Get a configuration value that should be a number.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_time(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, struct GNUNET_TIME_Relative *time)
Get a configuration value that should be a relative time.
size_t GNUNET_GNSRECORD_proof_get_size(const struct GNUNET_GNSRECORD_PowP *pow)
enum GNUNET_GenericReturnValue GNUNET_GNSRECORD_check_pow(const struct GNUNET_GNSRECORD_PowP *pow, unsigned int matching_bits, struct GNUNET_TIME_Relative epoch_duration)
Check if the given proof-of-work is valid.
ssize_t GNUNET_CRYPTO_public_key_get_length(const struct GNUNET_CRYPTO_PublicKey *key)
Get the compacted length of a GNUNET_CRYPTO_PublicKey.
#define GNUNET_log(kind,...)
ssize_t GNUNET_CRYPTO_write_public_key_to_buffer(const struct GNUNET_CRYPTO_PublicKey *key, void *buffer, size_t len)
Writes a GNUNET_CRYPTO_PublicKey to a compact buffer.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
GNUNET_MQ_Error
Error codes for the queue.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct.
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
#define GNUNET_MESSAGE_TYPE_REVOCATION_QUERY
Client to service: was this key revoked?
#define GNUNET_MESSAGE_TYPE_REVOCATION_REVOKE
Client to service OR peer-to-peer: revoke this key!
#define GNUNET_MESSAGE_TYPE_REVOCATION_REVOKE_RESPONSE
Service to client: revocation confirmed.
#define GNUNET_MESSAGE_TYPE_REVOCATION_QUERY_RESPONSE
Service to client: answer if key was revoked!
struct GNUNET_REVOCATION_Handle * GNUNET_REVOCATION_revoke(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_GNSRECORD_PowP *pow, GNUNET_REVOCATION_Callback func, void *func_cls)
Perform key revocation.
void GNUNET_REVOCATION_query_cancel(struct GNUNET_REVOCATION_Query *q)
Cancel key revocation check.
void GNUNET_REVOCATION_revoke_cancel(struct GNUNET_REVOCATION_Handle *h)
Cancel key revocation.
struct GNUNET_REVOCATION_Query * GNUNET_REVOCATION_query(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_CRYPTO_PublicKey *key, GNUNET_REVOCATION_Callback func, void *func_cls)
Check if a key was revoked.
void(* GNUNET_REVOCATION_Callback)(void *cls, enum GNUNET_GenericReturnValue is_valid)
Callback to call with the result of a key revocation query.
messages for key revocation
static void query_mq_error_handler(void *cls, enum GNUNET_MQ_Error error)
Generic error handler, called with the appropriate error code and the same closure specified at the c...
static void revocation_mq_error_handler(void *cls, enum GNUNET_MQ_Error error)
Generic error handler, called with the appropriate error code and the same closure specified at the c...
static void handle_revocation_query_response(void *cls, const struct QueryResponseMessage *qrm)
Handle response to our revocation query.
static void handle_revocation_response(void *cls, const struct RevocationResponseMessage *rrm)
Handle response to our revocation query.
struct GNUNET_MQ_Handle * mq
Our connection to the ARM service.
An identity key as per LSD0001.
Struct for a proof of work as part of the revocation.
Handle to a message queue.
Message handler for a specific message type.
Handle for the key revocation operation.
struct GNUNET_MQ_Handle * mq
Message queue to the service.
GNUNET_REVOCATION_Callback func
Function to call once we are done.
void * func_cls
Closure for func.
Handle for the key revocation query.
void * func_cls
Closure for func.
struct GNUNET_MQ_Handle * mq
Message queue to the service.
GNUNET_REVOCATION_Callback func
Function to call with the result.
Time for relative time used by GNUnet, in microseconds.
Query key revocation status.
uint32_t key_len
Key length.
uint32_t is_valid
GNUNET_NO if revoked, GNUNET_YES if valid.
uint32_t is_valid
GNUNET_NO if revocation failed for internal reasons (e.g.
uint32_t pow_size
Length of PoW with signature.