ESAPI-C 1.0
The OWASP Enterprise Security API for C
|
An Encrypted Properties module implementation. More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "crypto.h"
#include "properties.h"
#include "log.h"
#include "user.h"
Go to the source code of this file.
Defines | |
#define | LF 0x0A |
#define | CR 0x0D |
Functions | |
char * | getline (char *s, int n, FILE *f) |
int | putline (char *s, FILE *f) |
char * | get_property (map_t *map, struct esapi_ctx *ctx, const char *key) |
Get the plaintext property value for the given key from the given encrypted properties map. | |
char * | get_property_or_default (map_t *map, struct esapi_ctx *ctx, const char *key, const char *default_value) |
Get the plaintext property value for the given key from the given encrypted properties map. | |
char * | set_property (map_t **maph, struct esapi_ctx *ctx, const char *key, const char *value) |
Set the given property key-value pair in the given encrypted properties map. | |
char ** | keys (map_t *map) |
Get a list of all keys in the given encrypted properties map. | |
void | clear_properties (map_t *map) |
map_t * | load_properties (const char *filename) |
Read encrypted properties from the given file. | |
void | store_properties (map_t *map, const char *filename) |
Write encrypted properties to the given file. |
An Encrypted Properties module implementation.
Definition in file properties.c.
Get the plaintext property value for the given key from the given encrypted properties map.
The property value is Base64 decoded and decrypted for the caller.
Definition at line 38 of file properties.c.
References esapi_decrypt(), and esapi_log_error().
Referenced by get_property_or_default().
Get the plaintext property value for the given key from the given encrypted properties map.
If the property is not found, return the given default value.
Definition at line 58 of file properties.c.
References get_property().
char** keys | ( | map_t * | ) |
Get a list of all keys in the given encrypted properties map.
Definition at line 105 of file properties.c.
References keys().
Referenced by keys().
map_t* load_properties | ( | const char * | ) |
Read encrypted properties from the given file.
Definition at line 134 of file properties.c.
References MAX_PROPERTY_LINE_LENGTH.
Set the given property key-value pair in the given encrypted properties map.
The value is encrypted and Base64 encoded before it is added to the map.
Definition at line 69 of file properties.c.
References esapi_encrypt(), and esapi_log_error().