EDGESEC  0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
Functions
sqlite_crypt_writer.c File Reference

File containing the implementation of the sqlite crypt writer utilities. More...

#include <stdint.h>
#include <sqlite3.h>
#include "sqlite_crypt_writer.h"
#include "../utils/allocs.h"
#include "../utils/log.h"
#include "../utils/os.h"
#include "../utils/sqliteu.h"
Include dependency graph for sqlite_crypt_writer.c:

Functions

int open_sqlite_crypt_db (const char *db_path, sqlite3 **sql)
 Opens the sqlite crypt db. More...
 
void free_sqlite_crypt_db (sqlite3 *db)
 Closes the sqlite db. More...
 
int save_sqlite_store_entry (sqlite3 *db, struct store_row *row)
 Save a store entry into the sqlite db. More...
 
int save_sqlite_secrets_entry (sqlite3 *db, struct secrets_row *row)
 Save a secrets entry into the sqlite db. More...
 
void free_sqlite_store_row (struct store_row *row)
 Frees a store row entry. More...
 
struct store_rowget_sqlite_store_row (sqlite3 *db, const char *key)
 Get the sqlite store entry object. More...
 
void free_sqlite_secrets_row (struct secrets_row *row)
 Frees a secrets row entry. More...
 
struct secrets_rowget_sqlite_secrets_row (sqlite3 *db, const char *id)
 Get the sqlite secrets entry object. More...
 

Detailed Description

File containing the implementation of the sqlite crypt writer utilities.

Author
Alexandru Mereacre
Date
2021

Function Documentation

◆ free_sqlite_crypt_db()

void free_sqlite_crypt_db ( sqlite3 *  db)

Closes the sqlite db.

Parameters
dbThe sqlite db structure pointer

◆ free_sqlite_secrets_row()

void free_sqlite_secrets_row ( struct secrets_row row)

Frees a secrets row entry.

Parameters
rowThe secrets row value

◆ free_sqlite_store_row()

void free_sqlite_store_row ( struct store_row row)

Frees a store row entry.

Parameters
rowThe store row value

◆ get_sqlite_secrets_row()

struct secrets_row* get_sqlite_secrets_row ( sqlite3 *  db,
const char *  id 
)

Get the sqlite secrets entry object.

Parameters
dbThe sqlite db structure pointer
idThe secrets column id
Returns
struct secrets_row* row value, NULL on failure

◆ get_sqlite_store_row()

struct store_row* get_sqlite_store_row ( sqlite3 *  db,
const char *  key 
)

Get the sqlite store entry object.

Parameters
dbThe sqlite db structure pointer
keyThe store column key
Returns
struct store_row* row value, NULL on failure

◆ open_sqlite_crypt_db()

int open_sqlite_crypt_db ( const char *  db_path,
sqlite3 **  sql 
)

Opens the sqlite crypt db.

Parameters
db_pathThe sqlite db path
[out]sqlThe returned sqlite db structure pointer
Returns
0 on success, -1 on failure

◆ save_sqlite_secrets_entry()

int save_sqlite_secrets_entry ( sqlite3 *  db,
struct secrets_row row 
)

Save a secrets entry into the sqlite db.

Parameters
dbThe sqlite db structure pointer
rowThe secrets row structure
Returns
int 0 on success, -1 on failure

◆ save_sqlite_store_entry()

int save_sqlite_store_entry ( sqlite3 *  db,
struct store_row row 
)

Save a store entry into the sqlite db.

Parameters
dbThe sqlite db structure pointer
rowThe store row structure
Returns
int 0 on success, -1 on failure