cryptlib  3.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
Classes | Macros | Functions
sec_mem.c File Reference
#include "crypt.h"
#include "kernel/acl.h"
#include "kernel/kernel.h"

Go to the source code of this file.

Classes

struct  MEMLOCK_INFO
 

Macros

#define MIN_ALLOC_SIZE   8
 
#define MAX_ALLOC_SIZE   8192
 
#define CANARY_SIZE   4 /* Size of canary used to spot overwrites */
 
#define MEMLOCK_HEADERSIZE   roundUp( sizeof( MEMLOCK_INFO ), 4 )
 
#define CANARY_STARTVALUE   "\xC0\xED\xBA\xBE" /* More fun than dead beef */
 
#define CANARY_ENDVALUE   "\x36\xDD\x24\x36"
 
#define adjustMemCanary(size)   size += CANARY_SIZE /* Other canary is in MEMLOCK_INFO header */
 
#define insertMemCanary(memBlockPtr, memPtr)
 
#define checkMemCanary(memBlockPtr, memPtr)
 

Functions

CHECK_RETVAL STDC_NONNULL_ARG ((1))
 
CHECK_RETVAL STDC_NONNULL_ARG ((1, 2, 3))
 
void endAllocation (void)
 

Macro Definition Documentation

#define adjustMemCanary (   size)    size += CANARY_SIZE /* Other canary is in MEMLOCK_INFO header */

Definition at line 67 of file sec_mem.c.

#define CANARY_ENDVALUE   "\x36\xDD\x24\x36"

Definition at line 65 of file sec_mem.c.

#define CANARY_SIZE   4 /* Size of canary used to spot overwrites */

Definition at line 39 of file sec_mem.c.

#define CANARY_STARTVALUE   "\xC0\xED\xBA\xBE" /* More fun than dead beef */

Definition at line 64 of file sec_mem.c.

#define checkMemCanary (   memBlockPtr,
  memPtr 
)
Value:
REQUIRES( !memcmp( memBlockPtr->canary, CANARY_STARTVALUE, CANARY_SIZE ) ); \
REQUIRES( !memcmp( memPtr + memBlockPtr->size - CANARY_SIZE, \

Definition at line 73 of file sec_mem.c.

#define insertMemCanary (   memBlockPtr,
  memPtr 
)
Value:
memcpy( memBlockPtr->canary, CANARY_STARTVALUE, CANARY_SIZE ); \
memcpy( memPtr + memBlockPtr->size - CANARY_SIZE, CANARY_ENDVALUE, \

Definition at line 69 of file sec_mem.c.

#define MAX_ALLOC_SIZE   8192

Definition at line 27 of file sec_mem.c.

#define MEMLOCK_HEADERSIZE   roundUp( sizeof( MEMLOCK_INFO ), 4 )

Definition at line 53 of file sec_mem.c.

#define MIN_ALLOC_SIZE   8

Definition at line 26 of file sec_mem.c.

Function Documentation

void endAllocation ( void  )

Definition at line 299 of file sec_mem.c.

CHECK_RETVAL STDC_NONNULL_ARG ( (1)  )

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 86 of file sec_mem.c.

CHECK_RETVAL STDC_NONNULL_ARG ( (1, 2, 3)  )

Definition at line 103 of file sec_mem.c.