From 689b3dd4461094caec858c9016bc346ec26019d2 Mon Sep 17 00:00:00 2001 From: Paolo Stivanin Date: Wed, 14 Jun 2023 11:40:16 +0200 Subject: [PATCH] Fix importing Aegis plain json this fixes #296 --- CMakeLists.txt | 2 +- data/com.github.paolostivanin.OTPClient.appdata.xml | 8 ++++++++ src/common/aegis.c | 4 +++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 24ea456..a7c986e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.16) -project(OTPClient VERSION "3.1.7" LANGUAGES "C") +project(OTPClient VERSION "3.1.8" LANGUAGES "C") include(GNUInstallDirs) configure_file("src/common/version.h.in" "version.h") diff --git a/data/com.github.paolostivanin.OTPClient.appdata.xml b/data/com.github.paolostivanin.OTPClient.appdata.xml index e5da36b..0324577 100644 --- a/data/com.github.paolostivanin.OTPClient.appdata.xml +++ b/data/com.github.paolostivanin.OTPClient.appdata.xml @@ -84,6 +84,14 @@ + + +

OTPClient 3.1.8 brings a single fix

+
    +
  • Fix importing Aegis plain json
  • +
+
+

OTPClient 3.1.7 brings many fixes

diff --git a/src/common/aegis.c b/src/common/aegis.c index fe8d7ff..38e914a 100644 --- a/src/common/aegis.c +++ b/src/common/aegis.c @@ -53,7 +53,9 @@ get_otps_from_plain_backup (const gchar *path, return NULL; } - GSList *otps = parse_json_data (json_string_value (json_object_get (json, "db")), err); + gchar *dumped_json = json_dumps(json_object_get (json, "db"), 0); + GSList *otps = parse_json_data (dumped_json, err); + gcry_free (dumped_json); return otps; }