lib/gpg: Correct missing line prefix with bad signatures
authorRobert McQueen <rob@endlessm.com>
Thu, 3 Aug 2017 09:23:39 +0000 (10:23 +0100)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 7 Sep 2017 19:56:31 +0000 (19:56 +0000)
In the case the signature time was bad, a line prefix was missing from the
result of `ostree_gpg_verify_result_describe_variant()`.

Closes: #1092
Approved by: cgwalters

src/libostree/ostree-gpg-verify-result.c

index ad160bc9fd7f21712ff917cdcd93705a0ce8c67a..5be6b2e1316d4884e9b60caa11cdd7f79b488803 100644 (file)
@@ -652,6 +652,9 @@ ostree_gpg_verify_result_describe_variant (GVariant *variant,
 
   if (exp_timestamp > 0)
     {
+      if (line_prefix != NULL)
+        g_string_append (output_buffer, line_prefix);
+
       date_time_utc = g_date_time_new_from_unix_utc (exp_timestamp);
       if (date_time_utc == NULL)
         {
@@ -664,9 +667,6 @@ ostree_gpg_verify_result_describe_variant (GVariant *variant,
       date_time_local = g_date_time_to_local (date_time_utc);
       formatted_date_time = g_date_time_format (date_time_local, "%c");
 
-      if (line_prefix != NULL)
-        g_string_append (output_buffer, line_prefix);
-
       if (sig_expired)
         {
           g_string_append_printf (output_buffer,