mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 03:50:57 +01:00
fixed yet another endianess problem, now always using the raw key values for export, sotrage and checksum calculation
This commit is contained in:
@@ -45,12 +45,12 @@ typedef unsigned int qbyte; // Quad byte = 32 bits
|
||||
|
||||
#define PCP_ME "Pretty Curved Privacy"
|
||||
|
||||
#define PCP_KEY_VERSION 0x00000003U
|
||||
#define PCP_KEY_VERSION 4
|
||||
#define PCP_KEY_PRIMITIVE "CURVE25519-ED25519-SALSA20-POLY1305"
|
||||
|
||||
#define PCP_KEY_TYPE_MAINSECRET 0x01
|
||||
#define PCP_KEY_TYPE_SECRET 0x02
|
||||
#define PCP_KEY_TYPE_PUBLIC 0x03
|
||||
#define PCP_KEY_TYPE_MAINSECRET 1
|
||||
#define PCP_KEY_TYPE_SECRET 2
|
||||
#define PCP_KEY_TYPE_PUBLIC 3
|
||||
|
||||
// how many times do we hash a passphrase
|
||||
#define HCYCLES 128000
|
||||
@@ -59,11 +59,11 @@ typedef unsigned int qbyte; // Quad byte = 32 bits
|
||||
#define PCP_ENCRYPT_PAD crypto_secretbox_ZEROBYTES + crypto_secretbox_NONCEBYTES
|
||||
|
||||
// vault id
|
||||
#define PCP_VAULT_ID 0xC4
|
||||
#define PCP_VAULT_VERSION 0x02
|
||||
#define PCP_VAULT_ID 14
|
||||
#define PCP_VAULT_VERSION 2
|
||||
|
||||
// sigs
|
||||
#define PCP_SIG_VERSION 0x01
|
||||
#define PCP_SIG_VERSION 1
|
||||
|
||||
char *PCP_ERR;
|
||||
byte PCP_ERRSET;
|
||||
|
||||
@@ -87,10 +87,10 @@ struct _pcp_key_t {
|
||||
char owner[255];
|
||||
char mail[255];
|
||||
char id[17];
|
||||
long ctime;
|
||||
uint32_t version;
|
||||
uint32_t serial;
|
||||
uint8_t type;
|
||||
uint64_t ctime; // 8
|
||||
uint32_t version; // 4
|
||||
uint32_t serial; // 4
|
||||
UT_hash_handle hh;
|
||||
};
|
||||
|
||||
@@ -100,7 +100,7 @@ struct _pcp_pubkey_t {
|
||||
char owner[255];
|
||||
char mail[255];
|
||||
char id[17];
|
||||
long ctime;
|
||||
uint64_t ctime;
|
||||
uint32_t version;
|
||||
uint32_t serial;
|
||||
uint8_t type;
|
||||
@@ -110,6 +110,9 @@ struct _pcp_pubkey_t {
|
||||
typedef struct _pcp_key_t pcp_key_t;
|
||||
typedef struct _pcp_pubkey_t pcp_pubkey_t;
|
||||
|
||||
#define PCP_RAW_KEYSIZE sizeof(pcp_key_t) - sizeof(UT_hash_handle)
|
||||
#define PCP_RAW_PUBKEYSIZE sizeof(pcp_pubkey_t) - sizeof(UT_hash_handle)
|
||||
|
||||
void pcp_cleanhashes();
|
||||
pcp_key_t *pcpkey_new ();
|
||||
|
||||
@@ -156,6 +159,10 @@ unsigned char *pcp_derivekey(char *passphrase);
|
||||
|
||||
pcp_key_t *pcp_derive_pcpkey (pcp_key_t *ours, char *theirs);
|
||||
|
||||
void pcp_seckeyblob(void *blob, pcp_key_t *k);
|
||||
void pcp_pubkeyblob(void *blob, pcp_pubkey_t *k);
|
||||
void *pcp_keyblob(void *k, int type); // allocates blob
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -69,7 +69,7 @@ vault_t *pcpvault_init(char *filename);
|
||||
vault_t *pcpvault_new(char *filename, int is_tmp);
|
||||
int pcpvault_create(vault_t *vault);
|
||||
int pcpvault_additem(vault_t *vault, void *item, size_t itemsize, uint8_t type, uint8_t do_hash);
|
||||
int pcpvault_addkey(vault_t *vault, void *item, size_t itemsize, uint8_t type);
|
||||
int pcpvault_addkey(vault_t *vault, void *item, uint8_t type);
|
||||
int pcpvault_close(vault_t *vault);
|
||||
int pcpvault_fetchall(vault_t *vault);
|
||||
int pcpvault_writeall(vault_t *vault);
|
||||
|
||||
Reference in New Issue
Block a user