#include "platform.h"
#include "pabc_helper.h"
#include <pwd.h>
#include <stdlib.h>
#include <unistd.h>
Go to the source code of this file.
Functions | |
static const char * | get_homedir () |
static enum GNUNET_GenericReturnValue | write_file (char const *const filename, const char *buffer) |
static enum GNUNET_GenericReturnValue | init_pabc_dir () |
static const char * | get_pabcdir () |
enum GNUNET_GenericReturnValue | read_file (char const *const filename, char **buffer) |
struct pabc_public_parameters * | PABC_read_issuer_ppfile (const char *f, struct pabc_context *const ctx) |
enum GNUNET_GenericReturnValue | PABC_load_public_parameters (struct pabc_context *const ctx, char const *const pp_name, struct pabc_public_parameters **pp) |
enum GNUNET_GenericReturnValue | PABC_write_public_parameters (char const *const pp_name, struct pabc_public_parameters *const pp) |
enum GNUNET_GenericReturnValue | PABC_write_usr_ctx (char const *const usr_name, char const *const pp_name, struct pabc_context const *const ctx, struct pabc_public_parameters const *const pp, struct pabc_user_context *const usr_ctx) |
enum GNUNET_GenericReturnValue | PABC_read_usr_ctx (char const *const usr_name, char const *const pp_name, struct pabc_context const *const ctx, struct pabc_public_parameters const *const pp, struct pabc_user_context **usr_ctx) |
Variables | |
static char | pabc_dir [4096+1] |
|
static |
Definition at line 16 of file pabc_helper.c.
References getenv().
Referenced by init_pabc_dir().
|
static |
Definition at line 28 of file pabc_helper.c.
References filename, GNUNET_DISK_file_close(), GNUNET_DISK_file_open(), GNUNET_DISK_file_write(), GNUNET_DISK_OPEN_CREATE, GNUNET_DISK_OPEN_TRUNCATE, GNUNET_DISK_OPEN_WRITE, GNUNET_DISK_PERM_USER_READ, GNUNET_DISK_PERM_USER_WRITE, GNUNET_OK, and GNUNET_SYSERR.
Referenced by PABC_write_public_parameters(), and PABC_write_usr_ctx().
|
static |
Definition at line 52 of file pabc_helper.c.
References get_homedir(), GNUNET_DISK_directory_create(), and pabc_dir.
Referenced by get_pabcdir().
|
static |
Definition at line 63 of file pabc_helper.c.
References init_pabc_dir(), and pabc_dir.
Referenced by PABC_load_public_parameters(), PABC_read_usr_ctx(), PABC_write_public_parameters(), and PABC_write_usr_ctx().
enum GNUNET_GenericReturnValue read_file | ( | char const *const | filename, |
char ** | buffer | ||
) |
Definition at line 71 of file pabc_helper.c.
References filename, GNUNET_DISK_file_close(), GNUNET_DISK_file_open(), GNUNET_DISK_file_read(), GNUNET_DISK_file_seek(), GNUNET_DISK_file_test(), GNUNET_DISK_OPEN_READ, GNUNET_DISK_PERM_USER_READ, GNUNET_DISK_SEEK_END, GNUNET_DISK_SEEK_SET, GNUNET_free, GNUNET_OK, GNUNET_SYSERR, and GNUNET_YES.
Referenced by PABC_read_issuer_ppfile(), and PABC_read_usr_ctx().
struct pabc_public_parameters * PABC_read_issuer_ppfile | ( | const char * | f, |
struct pabc_context *const | ctx | ||
) |
Definition at line 106 of file pabc_helper.c.
References ctx, removetrailingwhitespace::f, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_OK, and read_file().
Referenced by PABC_load_public_parameters().
enum GNUNET_GenericReturnValue PABC_load_public_parameters | ( | struct pabc_context *const | ctx, |
char const *const | pp_name, | ||
struct pabc_public_parameters ** | pp | ||
) |
Definition at line 135 of file pabc_helper.c.
References ctx, get_pabcdir(), GNUNET_DISK_directory_test(), GNUNET_DISK_file_test(), GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_OK, GNUNET_STRINGS_urlencode(), GNUNET_SYSERR, GNUNET_YES, PABC_PP_EXT, PABC_read_issuer_ppfile(), and PATH_MAX.
Referenced by pabc_create_presentation().
enum GNUNET_GenericReturnValue PABC_write_public_parameters | ( | char const *const | pp_name, |
struct pabc_public_parameters *const | pp | ||
) |
Definition at line 173 of file pabc_helper.c.
References ctx, filename, get_pabcdir(), GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_malloc, GNUNET_OK, GNUNET_STRINGS_urlencode(), GNUNET_SYSERR, PABC_PP_EXT, status, and write_file().
Referenced by cr_cont().
enum GNUNET_GenericReturnValue PABC_write_usr_ctx | ( | char const *const | usr_name, |
char const *const | pp_name, | ||
struct pabc_context const *const | ctx, | ||
struct pabc_public_parameters const *const | pp, | ||
struct pabc_user_context *const | usr_ctx | ||
) |
Definition at line 227 of file pabc_helper.c.
References ctx, get_pabcdir(), GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_malloc, GNUNET_OK, GNUNET_STRINGS_urlencode(), GNUNET_SYSERR, PABC_USR_EXT, status, and write_file().
Referenced by cr_cont().
enum GNUNET_GenericReturnValue PABC_read_usr_ctx | ( | char const *const | usr_name, |
char const *const | pp_name, | ||
struct pabc_context const *const | ctx, | ||
struct pabc_public_parameters const *const | pp, | ||
struct pabc_user_context ** | usr_ctx | ||
) |
Definition at line 301 of file pabc_helper.c.
References ctx, get_pabcdir(), GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_malloc, GNUNET_OK, GNUNET_STRINGS_urlencode(), GNUNET_SYSERR, PABC_USR_EXT, read_file(), and status.
Referenced by cr_cont(), and pabc_create_presentation().
|
static |
Definition at line 13 of file pabc_helper.c.
Referenced by get_pabcdir(), and init_pabc_dir().