mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 03:50:57 +01:00
fixed key export: now using big endian byte order for exported
keys, so they're platform independent when transported.
This commit is contained in:
@@ -322,6 +322,8 @@ int pcp_importsecret (vault_t *vault, FILE *in) {
|
||||
|
||||
// all good now
|
||||
pcp_key_t *key = (pcp_key_t *)z85decoded;
|
||||
key2native(key);
|
||||
|
||||
if(debug)
|
||||
pcp_dumpkey(key);
|
||||
|
||||
@@ -371,6 +373,8 @@ int pcp_importpublic (vault_t *vault, FILE *in) {
|
||||
|
||||
// all good now
|
||||
pcp_pubkey_t *pub = (pcp_pubkey_t *)z85decoded;
|
||||
pubkey2native(pub);
|
||||
|
||||
if(debug)
|
||||
pcp_dumppubkey(pub);
|
||||
if(pcp_sanitycheck_pub(pub) == 0) {
|
||||
|
||||
@@ -62,7 +62,9 @@ void pcppubkey_printlineinfo(pcp_pubkey_t *key) {
|
||||
|
||||
void pcpkey_print(pcp_key_t *key, FILE* out) {
|
||||
size_t zlen;
|
||||
key2be(key);
|
||||
char *z85encoded = pcp_z85_encode((unsigned char*)key, sizeof(pcp_key_t), &zlen);
|
||||
key2native(key);
|
||||
|
||||
struct tm *c;
|
||||
time_t t = (time_t)key->ctime;
|
||||
@@ -94,7 +96,9 @@ void pcpkey_print(pcp_key_t *key, FILE* out) {
|
||||
|
||||
void pcppubkey_print(pcp_pubkey_t *key, FILE* out) {
|
||||
size_t zlen;
|
||||
pubkey2be(key);
|
||||
char *z85encoded = pcp_z85_encode((unsigned char*)key, sizeof(pcp_pubkey_t), &zlen);
|
||||
pubkey2native(key);
|
||||
|
||||
struct tm *c;
|
||||
time_t t = (time_t)key->ctime;
|
||||
|
||||
Reference in New Issue
Block a user