#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
#include <time.h>
#include <sys/types.h>
#include <sys/time.h>
#include <string.h>
#include "srs2.h"
#include "sha1.h"
#include <alloca.h>
Go to the source code of this file.
|
| int | srs_set_malloc (srs_malloc_t m, srs_realloc_t r, srs_free_t f) |
| const char * | srs_strerror (int code) |
| srs_t * | srs_new () |
| void | srs_init (srs_t *srs) |
| void | srs_free (srs_t *srs) |
| int | srs_add_secret (srs_t *srs, const char *secret) |
| const char * | srs_get_secret (srs_t *srs, int idx) |
| int | srs_set_separator (srs_t *srs, char value) |
| char | srs_get_separator (srs_t *srs) |
| int | srs_timestamp_create (srs_t *srs, char *buf, time_t now) |
| int | srs_timestamp_check (srs_t *srs, const char *stamp) |
| int | srs_hash_create (srs_t *srs, char *buf, int nargs,...) |
| int | srs_hash_check (srs_t *srs, char *hash, int nargs,...) |
| int | srs_compile_shortcut (srs_t *srs, char *buf, int buflen, char *sendhost, char *senduser, const char *aliashost) |
| int | srs_compile_guarded (srs_t *srs, char *buf, int buflen, char *sendhost, char *senduser, const char *aliashost) |
| int | srs_parse_shortcut (srs_t *srs, char *buf, int buflen, char *senduser) |
| int | srs_parse_guarded (srs_t *srs, char *buf, int buflen, char *senduser) |
| int | srs_forward (srs_t *srs, char *buf, int buflen, const char *sender, const char *alias) |
| int | srs_forward_alloc (srs_t *srs, char **sptr, const char *sender, const char *alias) |
| int | srs_reverse (srs_t *srs, char *buf, int buflen, const char *sender) |
| int | srs_reverse_alloc (srs_t *srs, char **sptr, const char *sender) |
◆ SRS_PARAM_DEFINE
| #define SRS_PARAM_DEFINE |
( |
| n, |
|
|
| t ) |
Value: int srs_set_ ## n (
srs_t *srs, t value) { \
srs->n = value; \
} \
t srs_get_ ## n (
srs_t *srs) { \
return srs->n; \
}
Definition at line 152 of file srs2.c.
◆ SRS_TIME_BASEBITS
| #define SRS_TIME_BASEBITS 5 /* 2^5 = 32 = strlen(CHARS) */ |
◆ SRS_TIME_PRECISION
| #define SRS_TIME_PRECISION (60 * 60 * 24) /* One day */ |
◆ SRS_TIME_SIZE
◆ SRS_TIME_SLOTS
◆ STRINGP
Value:((s != NULL) && (*(s) != '\0'))
Definition at line 56 of file srs2.c.
Value:
Definition at line 72 of file srs2.c.
◆ srs_add_secret()
| int srs_add_secret |
( |
srs_t * | srs, |
|
|
const char * | secret ) |
◆ srs_compile_guarded()
| int srs_compile_guarded |
( |
srs_t * | srs, |
|
|
char * | buf, |
|
|
int | buflen, |
|
|
char * | sendhost, |
|
|
char * | senduser, |
|
|
const char * | aliashost ) |
◆ srs_compile_shortcut()
| int srs_compile_shortcut |
( |
srs_t * | srs, |
|
|
char * | buf, |
|
|
int | buflen, |
|
|
char * | sendhost, |
|
|
char * | senduser, |
|
|
const char * | aliashost ) |
◆ srs_forward()
| int srs_forward |
( |
srs_t * | srs, |
|
|
char * | buf, |
|
|
int | buflen, |
|
|
const char * | sender, |
|
|
const char * | alias ) |
◆ srs_forward_alloc()
| int srs_forward_alloc |
( |
srs_t * | srs, |
|
|
char ** | sptr, |
|
|
const char * | sender, |
|
|
const char * | alias ) |
◆ srs_free()
| void srs_free |
( |
srs_t * | srs | ) |
|
◆ srs_get_secret()
| const char * srs_get_secret |
( |
srs_t * | srs, |
|
|
int | idx ) |
◆ srs_get_separator()
| char srs_get_separator |
( |
srs_t * | srs | ) |
|
◆ srs_hash_check()
| int srs_hash_check |
( |
srs_t * | srs, |
|
|
char * | hash, |
|
|
int | nargs, |
|
|
| ... ) |
◆ srs_hash_create()
| int srs_hash_create |
( |
srs_t * | srs, |
|
|
char * | buf, |
|
|
int | nargs, |
|
|
| ... ) |
◆ srs_init()
| void srs_init |
( |
srs_t * | srs | ) |
|
◆ srs_new()
◆ srs_parse_guarded()
| int srs_parse_guarded |
( |
srs_t * | srs, |
|
|
char * | buf, |
|
|
int | buflen, |
|
|
char * | senduser ) |
◆ srs_parse_shortcut()
| int srs_parse_shortcut |
( |
srs_t * | srs, |
|
|
char * | buf, |
|
|
int | buflen, |
|
|
char * | senduser ) |
◆ srs_reverse()
| int srs_reverse |
( |
srs_t * | srs, |
|
|
char * | buf, |
|
|
int | buflen, |
|
|
const char * | sender ) |
◆ srs_reverse_alloc()
| int srs_reverse_alloc |
( |
srs_t * | srs, |
|
|
char ** | sptr, |
|
|
const char * | sender ) |
◆ srs_set_malloc()
◆ srs_set_separator()
| int srs_set_separator |
( |
srs_t * | srs, |
|
|
char | value ) |
◆ srs_strerror()
| const char * srs_strerror |
( |
int | code | ) |
|
◆ srs_timestamp_check()
| int srs_timestamp_check |
( |
srs_t * | srs, |
|
|
const char * | stamp ) |
◆ srs_timestamp_create()
| int srs_timestamp_create |
( |
srs_t * | srs, |
|
|
char * | buf, |
|
|
time_t | now ) |
◆ SRS_HASH_BASECHARS
| const char* SRS_HASH_BASECHARS |
Initial value:= "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/"
Definition at line 232 of file srs2.c.
◆ SRS_TIME_BASECHARS
| const char* SRS_TIME_BASECHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" |