kee

Offline IOU signer with QR as transport
git clone https://holbrook.no/src/kee
Info | Log | Files | Refs | README | LICENSE

commit b0fe20f21ce44e624c7156a81066f02d6395d6c2
parent a7c454679a92a4bc6fbc9d4442cf7c9cb173435b
Author: lash <dev@holbrook.no>
Date:   Thu, 13 Jun 2024 14:55:50 +0100

Append transport encoding for ledger countersign output

Diffstat:
Msrc/cmd/sign.c | 26++++++++++++++++++++++++++
1 file changed, 26 insertions(+), 0 deletions(-)

diff --git a/src/cmd/sign.c b/src/cmd/sign.c @@ -101,5 +101,31 @@ int main(int argc, char **argv) { return cli_exit(&cli, ERR_FAIL); } + c = KEE_CLI_BUFMAX; + r = kee_ledger_serialize_open(&ledger, b, &c); + if (r) { + debug_logerr(LLOG_CRITICAL, ERR_FAIL, "cannot serialize ledger"); + return cli_exit(&cli, ERR_FAIL); + } + + r = kee_transport_single(&trans, KEE_TRANSPORT_BASE64, KEE_CMD_LEDGER, KEE_CLI_BUFMAX); + if (r) { + debug_logerr(LLOG_CRITICAL, ERR_FAIL, "transport output init fail"); + return cli_exit(&cli, ERR_FAIL); + } + + r = kee_transport_write(&trans, b, c); + if (r) { + debug_logerr(LLOG_CRITICAL, ERR_FAIL, "transport output process fail"); + return cli_exit(&cli, ERR_FAIL); + } + + c = KEE_CLI_BUFMAX; + r = kee_transport_next(&trans, b, &c); + if (r) { + debug_logerr(LLOG_CRITICAL, ERR_FAIL, "transport output writeout fail"); + return cli_exit(&cli, ERR_FAIL); + } + return cli_exit(&cli, 0); }