mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 20:00:58 +01:00
using secure memory where applicable using sodium_malloc or sodium_mlock, where not
This commit is contained in:
@@ -31,10 +31,9 @@
|
||||
#include "defines.h"
|
||||
#include "platform.h"
|
||||
#include "mem.h"
|
||||
#include "mac.h"
|
||||
#include "crypto.h"
|
||||
#include "randomart.h"
|
||||
#include "version.h"
|
||||
//#include "z85.h"
|
||||
#include "uthash.h"
|
||||
#include "jenhash.h"
|
||||
#include "structs.h"
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sodium.h>
|
||||
#include "defines.h"
|
||||
#include "platform.h"
|
||||
|
||||
@@ -36,13 +37,22 @@
|
||||
/* available. */
|
||||
void *ucmalloc(size_t s);
|
||||
|
||||
/* same as ucmalloc, but uses secure allocation */
|
||||
void *smalloc(size_t s);
|
||||
|
||||
/* the same but it fills the pointer with random values */
|
||||
void *urmalloc(size_t s);
|
||||
|
||||
/* same as urmalloc(), but uses secure allocation using sodium_malloc() */
|
||||
void *srmalloc(size_t s);
|
||||
|
||||
/* resize a a pointer and fill the added remainder with zeroes */
|
||||
void *ucrealloc(void *d, size_t oldlen, size_t newlen);
|
||||
|
||||
/* clear and free */
|
||||
void ucfree(void *d, size_t len);
|
||||
|
||||
/* same, but free a sodium pointer */
|
||||
void sfree(void *d);
|
||||
|
||||
#endif /* _HAVE_PCP_MEM */
|
||||
|
||||
Reference in New Issue
Block a user