![]() |
s/qmail 4.3.21
Next generation secure email transport
|
#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.
Macros | |
| #define | STRINGP(s) |
| #define | X(e, s) |
| #define | SRS_PARAM_DEFINE(n, t) |
| #define | SRS_TIME_PRECISION (60 * 60 * 24) /* One day */ |
| #define | SRS_TIME_BASEBITS 5 /* 2^5 = 32 = strlen(CHARS) */ |
| #define | SRS_TIME_SIZE 2 |
| #define | SRS_TIME_SLOTS (1<<(SRS_TIME_BASEBITS<<(SRS_TIME_SIZE-1))) |
Functions | |
| 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) |
Variables | |
| const char * | SRS_TIME_BASECHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" |
| const char * | SRS_HASH_BASECHARS |
| #define SRS_PARAM_DEFINE | ( | n, | |
| t ) |
| #define SRS_TIME_SLOTS (1<<(SRS_TIME_BASEBITS<<(SRS_TIME_SIZE-1))) |
| #define X | ( | e, | |
| s ) |
| int srs_add_secret | ( | srs_t * | srs, |
| const char * | secret ) |
| int srs_compile_guarded | ( | srs_t * | srs, |
| char * | buf, | ||
| int | buflen, | ||
| char * | sendhost, | ||
| char * | senduser, | ||
| const char * | aliashost ) |
| int srs_compile_shortcut | ( | srs_t * | srs, |
| char * | buf, | ||
| int | buflen, | ||
| char * | sendhost, | ||
| char * | senduser, | ||
| const char * | aliashost ) |
| 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_hash_check | ( | srs_t * | srs, |
| char * | hash, | ||
| int | nargs, | ||
| ... ) |
| int srs_hash_create | ( | srs_t * | srs, |
| char * | buf, | ||
| int | nargs, | ||
| ... ) |
| void srs_init | ( | srs_t * | srs | ) |
| srs_t * srs_new | ( | ) |
| int srs_parse_guarded | ( | srs_t * | srs, |
| char * | buf, | ||
| int | buflen, | ||
| char * | senduser ) |
| int srs_parse_shortcut | ( | srs_t * | srs, |
| char * | buf, | ||
| int | buflen, | ||
| char * | senduser ) |
| 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 ) |
| int srs_set_malloc | ( | srs_malloc_t | m, |
| srs_realloc_t | r, | ||
| srs_free_t | f ) |
| int srs_set_separator | ( | srs_t * | srs, |
| char | value ) |
| const char * srs_strerror | ( | int | code | ) |
| int srs_timestamp_check | ( | srs_t * | srs, |
| const char * | stamp ) |
| int srs_timestamp_create | ( | srs_t * | srs, |
| char * | buf, | ||
| time_t | now ) |
| const char* SRS_HASH_BASECHARS |