gwenhywfar 5.10.1
Functions
cryptdefs.c File Reference
#include "cryptdefs_p.h"
#include <gwenhywfar/misc.h>
#include <gwenhywfar/debug.h>
#include <gwenhywfar/mdigest.h>
#include <gcrypt.h>
Include dependency graph for cryptdefs.c:

Go to the source code of this file.

Functions

static int GWEN_Crypt__KeyDataFromText (const char *text, unsigned char *buffer, unsigned int bufLength)
 
int GWEN_Crypt__TransformFromBCD (unsigned char *buffer, unsigned int bufLength, unsigned int *pinLength)
 
int GWEN_Crypt__TransformFromBin (unsigned char *buffer, unsigned int bufLength, unsigned int *pinLength)
 
int GWEN_Crypt__TransformFromFPIN2 (unsigned char *buffer, unsigned int bufLength, unsigned int *pinLength)
 
int GWEN_Crypt__TransformToBCD (unsigned char *buffer, unsigned int bufLength, unsigned int *pinLength)
 
int GWEN_Crypt__TransformToBin (unsigned char *buffer, unsigned int bufLength, unsigned int *pinLength)
 
int GWEN_Crypt__TransformToFPIN2 (unsigned char *buffer, unsigned int bufLength, unsigned int *pinLength)
 
int GWEN_Crypt_KeyDataFromText (const char *text, unsigned char *buffer, unsigned int bufLength)
 
GWEN_CRYPT_PINENCODING GWEN_Crypt_PinEncoding_fromString (const char *s)
 
const char * GWEN_Crypt_PinEncoding_toString (GWEN_CRYPT_PINENCODING pe)
 
GWEN_CRYPT_PINTYPE GWEN_Crypt_PinType_fromString (const char *s)
 
const char * GWEN_Crypt_PinType_toString (GWEN_CRYPT_PINTYPE pt)
 
void GWEN_Crypt_Random (int quality, uint8_t *buffer, uint32_t len)
 
int GWEN_Crypt_TransformPin (GWEN_CRYPT_PINENCODING peSrc, GWEN_CRYPT_PINENCODING peDst, unsigned char *buffer, unsigned int bufLength, unsigned int *pinLength)
 

Function Documentation

◆ GWEN_Crypt__KeyDataFromText()

static int GWEN_Crypt__KeyDataFromText ( const char *  text,
unsigned char *  buffer,
unsigned int  bufLength 
)
static

Definition at line 476 of file cryptdefs.c.

References DBG_ERROR, DBG_INFO, GWEN_ERROR_BAD_SIZE, GWEN_LOGDOMAIN, GWEN_MDigest_Begin(), GWEN_MDigest_End(), GWEN_MDigest_free(), GWEN_MDigest_GetDigestPtr(), GWEN_MDigest_Md5_new(), GWEN_MDigest_Rmd160_new(), and GWEN_MDigest_Update().

Referenced by GWEN_Crypt_KeyDataFromText().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Crypt__TransformFromBCD()

int GWEN_Crypt__TransformFromBCD ( unsigned char *  buffer,
unsigned int  bufLength,
unsigned int *  pinLength 
)

Definition at line 97 of file cryptdefs.c.

References DBG_ERROR, GWEN_ERROR_BUFFER_OVERFLOW, and GWEN_LOGDOMAIN.

Referenced by GWEN_Crypt_TransformPin().

Here is the caller graph for this function:

◆ GWEN_Crypt__TransformFromBin()

int GWEN_Crypt__TransformFromBin ( unsigned char *  buffer,
unsigned int  bufLength,
unsigned int *  pinLength 
)

Definition at line 207 of file cryptdefs.c.

References DBG_ERROR, GWEN_ERROR_INVALID, and GWEN_LOGDOMAIN.

Referenced by GWEN_Crypt_TransformPin().

Here is the caller graph for this function:

◆ GWEN_Crypt__TransformFromFPIN2()

int GWEN_Crypt__TransformFromFPIN2 ( unsigned char *  buffer,
unsigned int  bufLength,
unsigned int *  pinLength 
)

Definition at line 148 of file cryptdefs.c.

References DBG_ERROR, GWEN_ERROR_BUFFER_OVERFLOW, GWEN_ERROR_INVALID, and GWEN_LOGDOMAIN.

Referenced by GWEN_Crypt_TransformPin().

Here is the caller graph for this function:

◆ GWEN_Crypt__TransformToBCD()

int GWEN_Crypt__TransformToBCD ( unsigned char *  buffer,
unsigned int  bufLength,
unsigned int *  pinLength 
)

Definition at line 243 of file cryptdefs.c.

References DBG_ERROR, GWEN_ERROR_BUFFER_OVERFLOW, GWEN_ERROR_INVALID, and GWEN_LOGDOMAIN.

Referenced by GWEN_Crypt_TransformPin().

Here is the caller graph for this function:

◆ GWEN_Crypt__TransformToBin()

int GWEN_Crypt__TransformToBin ( unsigned char *  buffer,
unsigned int  bufLength,
unsigned int *  pinLength 
)

Definition at line 375 of file cryptdefs.c.

References DBG_ERROR, GWEN_ERROR_INVALID, and GWEN_LOGDOMAIN.

Referenced by GWEN_Crypt_TransformPin().

Here is the caller graph for this function:

◆ GWEN_Crypt__TransformToFPIN2()

int GWEN_Crypt__TransformToFPIN2 ( unsigned char *  buffer,
unsigned int  bufLength,
unsigned int *  pinLength 
)

Definition at line 307 of file cryptdefs.c.

References DBG_ERROR, GWEN_ERROR_BUFFER_OVERFLOW, GWEN_ERROR_INVALID, and GWEN_LOGDOMAIN.

Referenced by GWEN_Crypt_TransformPin().

Here is the caller graph for this function:

◆ GWEN_Crypt_KeyDataFromText()

int GWEN_Crypt_KeyDataFromText ( const char *  text,
unsigned char *  buffer,
unsigned int  bufLength 
)

Definition at line 532 of file cryptdefs.c.

References GWEN_Crypt__KeyDataFromText().

Referenced by GWEN_Crypt_TokenOHBCI__EnsurePassword().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Crypt_PinEncoding_fromString()

GWEN_CRYPT_PINENCODING GWEN_Crypt_PinEncoding_fromString ( const char *  s)

◆ GWEN_Crypt_PinEncoding_toString()

const char * GWEN_Crypt_PinEncoding_toString ( GWEN_CRYPT_PINENCODING  pe)

Definition at line 77 of file cryptdefs.c.

References GWEN_Crypt_PinEncoding_Ascii, GWEN_Crypt_PinEncoding_Bcd, GWEN_Crypt_PinEncoding_Bin, GWEN_Crypt_PinEncoding_FPin2, and GWEN_Crypt_PinEncoding_None.

Referenced by GWEN_Crypt_TransformPin().

Here is the caller graph for this function:

◆ GWEN_Crypt_PinType_fromString()

GWEN_CRYPT_PINTYPE GWEN_Crypt_PinType_fromString ( const char *  s)

◆ GWEN_Crypt_PinType_toString()

const char * GWEN_Crypt_PinType_toString ( GWEN_CRYPT_PINTYPE  pt)

◆ GWEN_Crypt_Random()

void GWEN_Crypt_Random ( int  quality,
uint8_t *  buffer,
uint32_t  len 
)

◆ GWEN_Crypt_TransformPin()

int GWEN_Crypt_TransformPin ( GWEN_CRYPT_PINENCODING  peSrc,
GWEN_CRYPT_PINENCODING  peDst,
unsigned char *  buffer,
unsigned int  bufLength,
unsigned int *  pinLength 
)