#include <glib.h>
#include "lib/host_addr.h"
Go to the source code of this file.
Defines | |
#define | TOKEN_VERSION_SIZE (4 + 3 + 20) /**< stamp + seed + SHA1 */ |
stamp + seed + SHA1 | |
#define | TOKEN_START_DATE 1045868400 /**< When we started using tokens */ |
When we started using tokens. | |
Enumerations | |
enum | tok_error_t { TOK_OK = 0, TOK_BAD_LENGTH, TOK_BAD_STAMP, TOK_BAD_INDEX, TOK_INVALID, TOK_BAD_ENCODING, TOK_BAD_KEYS, TOK_BAD_VERSION, TOK_OLD_VERSION, TOK_BAD_LEVEL_ENCODING, TOK_BAD_LEVEL_LENGTH, TOK_SHORT_LEVEL, TOK_INVALID_LEVEL, TOK_MISSING_LEVEL } |
Error codes for token validation. More... | |
Functions | |
const gchar * | tok_strerror (tok_error_t errnum) |
gchar * | tok_version (void) |
Get a version token, base64-encoded. | |
gchar * | tok_short_version (void) |
Get a version token for the short version string, base64-encoded. | |
tok_error_t | tok_version_valid (const gchar *version, const gchar *tokenb64, gint len, host_addr_t addr) |
Validate a base64-encoded version token `tokenb64' of `len' bytes. | |
gboolean | tok_is_ancient (time_t now) |
Check whether the version is too ancient to be able to generate a proper token string identifiable by remote parties. |
|
When we started using tokens.
|
|
stamp + seed + SHA1
|
|
|
Check whether the version is too ancient to be able to generate a proper token string identifiable by remote parties.
|
|
Get a version token for the short version string, base64-encoded.
|
|
|
|
Get a version token, base64-encoded.
|
|
Validate a base64-encoded version token `tokenb64' of `len' bytes. The `ip' is given only for clock update operations.
|