commit 6ff4a84f62fbc1b49ae006212b5df2e8e75704b4
parent db25a88c33706ea91ce730fd359600accd8ad82b
Author: lash <dev@holbrook.no>
Date: Tue, 7 May 2024 16:36:48 +0100
Ensure big-endian serialization of credit and collateral
Diffstat:
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/gtk/kee-entry.c b/src/gtk/kee-entry.c
@@ -273,7 +273,6 @@ static int kee_entry_apply_summary_widget(KeeEntry *o) {
return 1;
}
-
static int kee_entry_apply_display_widget(KeeEntry *o) {
char mask;
diff --git a/src/ledger.c b/src/ledger.c
@@ -694,6 +694,15 @@ int kee_ledger_item_serialize(struct kee_ledger_item_t *item, char *out, size_t
signature_request = item->alice_signature;
signature_response = item->bob_signature;
}
+ r = to_endian(TO_ENDIAN_BIG, sizeof(int), &credit_delta);
+ if (r) {
+ return ERR_FAIL;
+ }
+ r = to_endian(TO_ENDIAN_BIG, sizeof(int), &collateral_delta);
+ if (r) {
+ return ERR_FAIL;
+ }
+
c = 4;
r = asn1_write_value(node, "Kee.KeeEntry.creditDelta", &credit_delta, c);
if (r != ASN1_SUCCESS) {