gwenhywfar 5.14.1
cryptkeysym.c File Reference
#include "cryptkeysym_p.h"
#include <gwenhywfar/misc.h>
#include <gwenhywfar/debug.h>
#include <gwenhywfar/cryptdefs.h>
#include <gwenhywfar/text.h>
Include dependency graph for cryptkeysym.c:

Go to the source code of this file.

Macros

#define DISABLE_DEBUGLOG

Functions

GWEN_CRYPT_KEYGWEN_Crypt_KeyAes128_fromData (GWEN_CRYPT_CRYPTMODE mode, int keySize, const uint8_t *kd, uint32_t kl)
GWEN_CRYPT_KEYGWEN_Crypt_KeyAes128_fromDb (GWEN_CRYPT_CRYPTMODE mode, GWEN_DB_NODE *db)
GWEN_CRYPT_KEYGWEN_Crypt_KeyAes128_Generate (GWEN_CRYPT_CRYPTMODE mode, int keySize, int quality)
uint32_t GWEN_Crypt_KeyAes128_GetKeyDataLen (const GWEN_CRYPT_KEY *k)
uint8_t * GWEN_Crypt_KeyAes128_GetKeyDataPtr (const GWEN_CRYPT_KEY *k)
int GWEN_Crypt_KeyAes128_SetIV (GWEN_CRYPT_KEY *k, const uint8_t *kd, uint32_t kl)
int GWEN_Crypt_KeyAes128_SetKeyData (GWEN_CRYPT_KEY *k, const uint8_t *kd, uint32_t kl)
int GWEN_Crypt_KeyAes128_toDb (const GWEN_CRYPT_KEY *k, GWEN_DB_NODE *db)
GWEN_CRYPT_KEYGWEN_Crypt_KeyAes256_fromData (GWEN_CRYPT_CRYPTMODE mode, int keySize, const uint8_t *kd, uint32_t kl)
GWEN_CRYPT_KEYGWEN_Crypt_KeyAes256_fromDb (GWEN_CRYPT_CRYPTMODE mode, GWEN_DB_NODE *db)
GWEN_CRYPT_KEYGWEN_Crypt_KeyAes256_Generate (GWEN_CRYPT_CRYPTMODE mode, int keySize, int quality)
uint32_t GWEN_Crypt_KeyAes256_GetKeyDataLen (const GWEN_CRYPT_KEY *k)
uint8_t * GWEN_Crypt_KeyAes256_GetKeyDataPtr (const GWEN_CRYPT_KEY *k)
int GWEN_Crypt_KeyAes256_SetIV (GWEN_CRYPT_KEY *k, const uint8_t *kd, uint32_t kl)
int GWEN_Crypt_KeyAes256_SetKeyData (GWEN_CRYPT_KEY *k, const uint8_t *kd, uint32_t kl)
int GWEN_Crypt_KeyAes256_toDb (const GWEN_CRYPT_KEY *k, GWEN_DB_NODE *db)
GWEN_CRYPT_KEYGWEN_Crypt_KeyBlowFish_fromData (GWEN_CRYPT_CRYPTMODE mode, int keySize, const uint8_t *kd, uint32_t kl)
GWEN_CRYPT_KEYGWEN_Crypt_KeyBlowFish_fromDb (GWEN_CRYPT_CRYPTMODE mode, GWEN_DB_NODE *db)
GWEN_CRYPT_KEYGWEN_Crypt_KeyBlowFish_Generate (GWEN_CRYPT_CRYPTMODE mode, int keySize, int quality)
uint32_t GWEN_Crypt_KeyBlowFish_GetKeyDataLen (const GWEN_CRYPT_KEY *k)
uint8_t * GWEN_Crypt_KeyBlowFish_GetKeyDataPtr (const GWEN_CRYPT_KEY *k)
int GWEN_Crypt_KeyBlowFish_SetKeyData (GWEN_CRYPT_KEY *k, const uint8_t *kd, uint32_t kl)
int GWEN_Crypt_KeyBlowFish_toDb (const GWEN_CRYPT_KEY *k, GWEN_DB_NODE *db)
GWEN_CRYPT_KEYGWEN_Crypt_KeyDes3K_fromData (GWEN_CRYPT_CRYPTMODE mode, int keySize, const uint8_t *kd, uint32_t kl)
GWEN_CRYPT_KEYGWEN_Crypt_KeyDes3K_fromDb (GWEN_CRYPT_CRYPTMODE mode, GWEN_DB_NODE *db)
GWEN_CRYPT_KEYGWEN_Crypt_KeyDes3K_Generate (GWEN_CRYPT_CRYPTMODE mode, int keySize, int quality)
uint32_t GWEN_Crypt_KeyDes3K_GetKeyDataLen (const GWEN_CRYPT_KEY *k)
uint8_t * GWEN_Crypt_KeyDes3K_GetKeyDataPtr (const GWEN_CRYPT_KEY *k)
int GWEN_Crypt_KeyDes3K_SetIV (GWEN_CRYPT_KEY *k, const uint8_t *kd, uint32_t kl)
int GWEN_Crypt_KeyDes3K_SetKeyData (GWEN_CRYPT_KEY *k, const uint8_t *kd, uint32_t kl)
int GWEN_Crypt_KeyDes3K_toDb (const GWEN_CRYPT_KEY *k, GWEN_DB_NODE *db)
GWEN_CRYPT_KEYGWEN_Crypt_KeySym__fromDb (GWEN_CRYPT_CRYPTALGOID cryptAlgoId, GWEN_CRYPT_CRYPTMODE mode, int algo, unsigned int flags, const char *gname, GWEN_DB_NODE *db)
enum gcry_cipher_modes GWEN_Crypt_KeySym__MyMode2GMode (GWEN_CRYPT_CRYPTMODE mode)
int GWEN_Crypt_KeySym__toDb (const GWEN_CRYPT_KEY *k, GWEN_DB_NODE *db, const char *gname)
GWENHYWFAR_CB int GWEN_Crypt_KeySym_Decipher (GWEN_CRYPT_KEY *k, const uint8_t *pInData, uint32_t inLen, uint8_t *pOutData, uint32_t *pOutLen)
GWEN_CRYPT_KEYGWEN_Crypt_KeySym_dup (const GWEN_CRYPT_KEY *k)
GWENHYWFAR_CB int GWEN_Crypt_KeySym_Encipher (GWEN_CRYPT_KEY *k, const uint8_t *pInData, uint32_t inLen, uint8_t *pOutData, uint32_t *pOutLen)
GWENHYWFAR_CB void GWEN_Crypt_KeySym_freeData (GWEN_UNUSED void *bp, void *p)
GWEN_CRYPT_KEYGWEN_Crypt_KeySym_fromData (GWEN_CRYPT_CRYPTALGOID cryptAlgoId, int keySize, GWEN_CRYPT_CRYPTMODE mode, int algo, unsigned int flags, const uint8_t *kd, uint32_t kl)
GWEN_CRYPT_KEYGWEN_Crypt_KeySym_fromDb (GWEN_CRYPT_CRYPTMODE mode, GWEN_DB_NODE *db)
GWEN_CRYPT_KEYGWEN_Crypt_KeySym_Generate (GWEN_CRYPT_CRYPTALGOID cryptAlgoId, int keySize, GWEN_CRYPT_CRYPTMODE mode, int algo, unsigned int flags, int quality)
uint32_t GWEN_Crypt_KeySym_GetKeyDataLen (const GWEN_CRYPT_KEY *k)
uint8_t * GWEN_Crypt_KeySym_GetKeyDataPtr (const GWEN_CRYPT_KEY *k)
int GWEN_Crypt_KeySym_SetKeyData (GWEN_CRYPT_KEY *k, const uint8_t *kd, uint32_t kl)
int GWEN_Crypt_KeySym_toDb (const GWEN_CRYPT_KEY *k, GWEN_DB_NODE *db)

Macro Definition Documentation

◆ DISABLE_DEBUGLOG

#define DISABLE_DEBUGLOG

Definition at line 14 of file cryptkeysym.c.

Function Documentation

◆ GWEN_Crypt_KeyAes128_fromData()

GWEN_CRYPT_KEY * GWEN_Crypt_KeyAes128_fromData ( GWEN_CRYPT_CRYPTMODE mode,
int keySize,
const uint8_t * kd,
uint32_t kl )

Definition at line 745 of file cryptkeysym.c.

References GWEN_Crypt_KeySym_fromData().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyAes128_fromDb()

GWEN_CRYPT_KEY * GWEN_Crypt_KeyAes128_fromDb ( GWEN_CRYPT_CRYPTMODE mode,
GWEN_DB_NODE * db )

Definition at line 755 of file cryptkeysym.c.

References GWEN_Crypt_KeySym__fromDb().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyAes128_Generate()

GWEN_CRYPT_KEY * GWEN_Crypt_KeyAes128_Generate ( GWEN_CRYPT_CRYPTMODE mode,
int keySize,
int quality )

Definition at line 735 of file cryptkeysym.c.

References GWEN_Crypt_KeySym_Generate().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyAes128_GetKeyDataLen()

uint32_t GWEN_Crypt_KeyAes128_GetKeyDataLen ( const GWEN_CRYPT_KEY * k)

Definition at line 785 of file cryptkeysym.c.

References GWEN_Crypt_KeySym_GetKeyDataLen().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyAes128_GetKeyDataPtr()

uint8_t * GWEN_Crypt_KeyAes128_GetKeyDataPtr ( const GWEN_CRYPT_KEY * k)

Definition at line 778 of file cryptkeysym.c.

References GWEN_Crypt_KeySym_GetKeyDataPtr().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyAes128_SetIV()

int GWEN_Crypt_KeyAes128_SetIV ( GWEN_CRYPT_KEY * k,
const uint8_t * kd,
uint32_t kl )

Definition at line 792 of file cryptkeysym.c.

References DBG_INFO, GWEN_ERROR_GENERIC, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, and NULL.

◆ GWEN_Crypt_KeyAes128_SetKeyData()

int GWEN_Crypt_KeyAes128_SetKeyData ( GWEN_CRYPT_KEY * k,
const uint8_t * kd,
uint32_t kl )

Definition at line 771 of file cryptkeysym.c.

References GWEN_Crypt_KeySym_SetKeyData().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyAes128_toDb()

int GWEN_Crypt_KeyAes128_toDb ( const GWEN_CRYPT_KEY * k,
GWEN_DB_NODE * db )

Definition at line 764 of file cryptkeysym.c.

References GWEN_Crypt_KeySym__toDb().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyAes256_fromData()

GWEN_CRYPT_KEY * GWEN_Crypt_KeyAes256_fromData ( GWEN_CRYPT_CRYPTMODE mode,
int keySize,
const uint8_t * kd,
uint32_t kl )

Definition at line 832 of file cryptkeysym.c.

References GWEN_Crypt_KeySym_fromData().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyAes256_fromDb()

GWEN_CRYPT_KEY * GWEN_Crypt_KeyAes256_fromDb ( GWEN_CRYPT_CRYPTMODE mode,
GWEN_DB_NODE * db )

Definition at line 842 of file cryptkeysym.c.

References GWEN_Crypt_KeySym__fromDb().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyAes256_Generate()

GWEN_CRYPT_KEY * GWEN_Crypt_KeyAes256_Generate ( GWEN_CRYPT_CRYPTMODE mode,
int keySize,
int quality )

Definition at line 822 of file cryptkeysym.c.

References GWEN_Crypt_KeySym_Generate().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyAes256_GetKeyDataLen()

uint32_t GWEN_Crypt_KeyAes256_GetKeyDataLen ( const GWEN_CRYPT_KEY * k)

Definition at line 872 of file cryptkeysym.c.

References GWEN_Crypt_KeySym_GetKeyDataLen().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyAes256_GetKeyDataPtr()

uint8_t * GWEN_Crypt_KeyAes256_GetKeyDataPtr ( const GWEN_CRYPT_KEY * k)

Definition at line 865 of file cryptkeysym.c.

References GWEN_Crypt_KeySym_GetKeyDataPtr().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyAes256_SetIV()

int GWEN_Crypt_KeyAes256_SetIV ( GWEN_CRYPT_KEY * k,
const uint8_t * kd,
uint32_t kl )

Definition at line 877 of file cryptkeysym.c.

References DBG_INFO, GWEN_ERROR_GENERIC, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, and NULL.

◆ GWEN_Crypt_KeyAes256_SetKeyData()

int GWEN_Crypt_KeyAes256_SetKeyData ( GWEN_CRYPT_KEY * k,
const uint8_t * kd,
uint32_t kl )

Definition at line 858 of file cryptkeysym.c.

References GWEN_Crypt_KeySym_SetKeyData().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyAes256_toDb()

int GWEN_Crypt_KeyAes256_toDb ( const GWEN_CRYPT_KEY * k,
GWEN_DB_NODE * db )

Definition at line 851 of file cryptkeysym.c.

References GWEN_Crypt_KeySym__toDb().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyBlowFish_fromData()

GWEN_CRYPT_KEY * GWEN_Crypt_KeyBlowFish_fromData ( GWEN_CRYPT_CRYPTMODE mode,
int keySize,
const uint8_t * kd,
uint32_t kl )

Definition at line 687 of file cryptkeysym.c.

References GWEN_Crypt_KeySym_fromData().

Referenced by _decodeData(), _encodeData(), GWEN_Crypt_TokenOHBCI__DecryptFile(), GWEN_Crypt_TokenOHBCI_Write(), and GWEN_CryptMgr_Decrypt().

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

◆ GWEN_Crypt_KeyBlowFish_fromDb()

GWEN_CRYPT_KEY * GWEN_Crypt_KeyBlowFish_fromDb ( GWEN_CRYPT_CRYPTMODE mode,
GWEN_DB_NODE * db )

Definition at line 697 of file cryptkeysym.c.

References GWEN_Crypt_KeySym__fromDb().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyBlowFish_Generate()

GWEN_CRYPT_KEY * GWEN_Crypt_KeyBlowFish_Generate ( GWEN_CRYPT_CRYPTMODE mode,
int keySize,
int quality )

Definition at line 677 of file cryptkeysym.c.

References GWEN_Crypt_KeySym_Generate().

Referenced by _encode(), and GWEN_CryptMgr_Encrypt().

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

◆ GWEN_Crypt_KeyBlowFish_GetKeyDataLen()

uint32_t GWEN_Crypt_KeyBlowFish_GetKeyDataLen ( const GWEN_CRYPT_KEY * k)

Definition at line 727 of file cryptkeysym.c.

References GWEN_Crypt_KeySym_GetKeyDataLen().

Referenced by GWEN_CryptMgr_Encrypt().

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

◆ GWEN_Crypt_KeyBlowFish_GetKeyDataPtr()

uint8_t * GWEN_Crypt_KeyBlowFish_GetKeyDataPtr ( const GWEN_CRYPT_KEY * k)

Definition at line 720 of file cryptkeysym.c.

References GWEN_Crypt_KeySym_GetKeyDataPtr().

Referenced by _encode(), and GWEN_CryptMgr_Encrypt().

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

◆ GWEN_Crypt_KeyBlowFish_SetKeyData()

int GWEN_Crypt_KeyBlowFish_SetKeyData ( GWEN_CRYPT_KEY * k,
const uint8_t * kd,
uint32_t kl )

Definition at line 713 of file cryptkeysym.c.

References GWEN_Crypt_KeySym_SetKeyData().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyBlowFish_toDb()

int GWEN_Crypt_KeyBlowFish_toDb ( const GWEN_CRYPT_KEY * k,
GWEN_DB_NODE * db )

Definition at line 706 of file cryptkeysym.c.

References GWEN_Crypt_KeySym__toDb().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyDes3K_fromData()

GWEN_CRYPT_KEY * GWEN_Crypt_KeyDes3K_fromData ( GWEN_CRYPT_CRYPTMODE mode,
int keySize,
const uint8_t * kd,
uint32_t kl )

Definition at line 573 of file cryptkeysym.c.

References GWEN_Crypt_KeySym_fromData().

Referenced by GWEN_Crypt_KeyDes3K_Generate(), GWEN_Crypt_TokenOHBCI__DecryptFile(), and GWEN_Crypt_TokenOHBCI_Write().

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

◆ GWEN_Crypt_KeyDes3K_fromDb()

GWEN_CRYPT_KEY * GWEN_Crypt_KeyDes3K_fromDb ( GWEN_CRYPT_CRYPTMODE mode,
GWEN_DB_NODE * db )

Definition at line 595 of file cryptkeysym.c.

References GWEN_Crypt_KeySym__fromDb().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyDes3K_Generate()

GWEN_CRYPT_KEY * GWEN_Crypt_KeyDes3K_Generate ( GWEN_CRYPT_CRYPTMODE mode,
int keySize,
int quality )

Definition at line 557 of file cryptkeysym.c.

References GWEN_Crypt_KeyDes3K_fromData(), and GWEN_Crypt_Random().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyDes3K_GetKeyDataLen()

uint32_t GWEN_Crypt_KeyDes3K_GetKeyDataLen ( const GWEN_CRYPT_KEY * k)

Definition at line 637 of file cryptkeysym.c.

References GWEN_Crypt_KeySym_GetKeyDataLen().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyDes3K_GetKeyDataPtr()

uint8_t * GWEN_Crypt_KeyDes3K_GetKeyDataPtr ( const GWEN_CRYPT_KEY * k)

Definition at line 630 of file cryptkeysym.c.

References GWEN_Crypt_KeySym_GetKeyDataPtr().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyDes3K_SetIV()

int GWEN_Crypt_KeyDes3K_SetIV ( GWEN_CRYPT_KEY * k,
const uint8_t * kd,
uint32_t kl )

Definition at line 644 of file cryptkeysym.c.

References DBG_INFO, GWEN_ERROR_GENERIC, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, and NULL.

◆ GWEN_Crypt_KeyDes3K_SetKeyData()

int GWEN_Crypt_KeyDes3K_SetKeyData ( GWEN_CRYPT_KEY * k,
const uint8_t * kd,
uint32_t kl )

Definition at line 611 of file cryptkeysym.c.

References GWEN_Crypt_KeySym_SetKeyData().

Here is the call graph for this function:

◆ GWEN_Crypt_KeyDes3K_toDb()

int GWEN_Crypt_KeyDes3K_toDb ( const GWEN_CRYPT_KEY * k,
GWEN_DB_NODE * db )

Definition at line 604 of file cryptkeysym.c.

References GWEN_Crypt_KeySym__toDb().

Here is the call graph for this function:

◆ GWEN_Crypt_KeySym__fromDb()

◆ GWEN_Crypt_KeySym__MyMode2GMode()

enum gcry_cipher_modes GWEN_Crypt_KeySym__MyMode2GMode ( GWEN_CRYPT_CRYPTMODE mode)

◆ GWEN_Crypt_KeySym__toDb()

int GWEN_Crypt_KeySym__toDb ( const GWEN_CRYPT_KEY * k,
GWEN_DB_NODE * db,
const char * gname )

◆ GWEN_Crypt_KeySym_Decipher()

GWENHYWFAR_CB int GWEN_Crypt_KeySym_Decipher ( GWEN_CRYPT_KEY * k,
const uint8_t * pInData,
uint32_t inLen,
uint8_t * pOutData,
uint32_t * pOutLen )

◆ GWEN_Crypt_KeySym_dup()

GWEN_CRYPT_KEY * GWEN_Crypt_KeySym_dup ( const GWEN_CRYPT_KEY * k)

This functions creates a copy of the given key. The given key must have been created by one of the functions in this group (e.g. GWEN_Crypt_KeyBlowFish_fromDb(), GWEN_Crypt_KeyDes3K_Generate() etc. For other kinds of keys other functions must be used (like GWEN_Crypt_KeyRsa_dup() for RSA keys).

Definition at line 100 of file cryptkeysym.c.

References GWEN_Crypt_Key_GetCryptAlgoId(), GWEN_Crypt_Key_GetKeySize(), GWEN_Crypt_KeySym_fromData(), and GWEN_INHERIT_GETDATA.

Here is the call graph for this function:

◆ GWEN_Crypt_KeySym_Encipher()

GWENHYWFAR_CB int GWEN_Crypt_KeySym_Encipher ( GWEN_CRYPT_KEY * k,
const uint8_t * pInData,
uint32_t inLen,
uint8_t * pOutData,
uint32_t * pOutLen )

Definition at line 32 of file cryptkeysym.c.

References DBG_INFO, GWEN_Crypt_KeySym_Encipher(), GWEN_ERROR_GENERIC, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, and GWENHYWFAR_CB.

Referenced by GWEN_Crypt_KeySym__fromDb(), GWEN_Crypt_KeySym_Encipher(), GWEN_Crypt_KeySym_fromData(), GWEN_Crypt_KeySym_fromDb(), and GWEN_Crypt_KeySym_Generate().

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

◆ GWEN_Crypt_KeySym_freeData()

GWENHYWFAR_CB void GWEN_Crypt_KeySym_freeData ( GWEN_UNUSED void * bp,
void * p )

Definition at line 82 of file cryptkeysym.c.

References GWEN_FREE_OBJECT, GWEN_UNUSED, GWENHYWFAR_CB, and NULL.

Referenced by GWEN_Crypt_KeySym__fromDb(), GWEN_Crypt_KeySym_fromData(), GWEN_Crypt_KeySym_fromDb(), and GWEN_Crypt_KeySym_Generate().

Here is the caller graph for this function:

◆ GWEN_Crypt_KeySym_fromData()

◆ GWEN_Crypt_KeySym_fromDb()

◆ GWEN_Crypt_KeySym_Generate()

◆ GWEN_Crypt_KeySym_GetKeyDataLen()

uint32_t GWEN_Crypt_KeySym_GetKeyDataLen ( const GWEN_CRYPT_KEY * k)

◆ GWEN_Crypt_KeySym_GetKeyDataPtr()

uint8_t * GWEN_Crypt_KeySym_GetKeyDataPtr ( const GWEN_CRYPT_KEY * k)

◆ GWEN_Crypt_KeySym_SetKeyData()

int GWEN_Crypt_KeySym_SetKeyData ( GWEN_CRYPT_KEY * k,
const uint8_t * kd,
uint32_t kl )

Definition at line 492 of file cryptkeysym.c.

References DBG_ERROR, DBG_INFO, GWEN_Crypt_Key_free(), GWEN_ERROR_GENERIC, GWEN_ERROR_INVALID, GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.

Referenced by GWEN_Crypt_KeyAes128_SetKeyData(), GWEN_Crypt_KeyAes256_SetKeyData(), GWEN_Crypt_KeyBlowFish_SetKeyData(), and GWEN_Crypt_KeyDes3K_SetKeyData().

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

◆ GWEN_Crypt_KeySym_toDb()