g10: Copy expiredate from primary key when marked expired.
authorNIIBE Yutaka <gniibe@fsij.org>
Thu, 23 May 2019 00:40:01 +0000 (09:40 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Thu, 23 May 2019 00:40:01 +0000 (09:40 +0900)
* g10/getkey.c (merge_selfsigs): Update ->expiredate of subkey.

--

GnuPG-bug-id: 3343
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
g10/getkey.c

index 1e73343..bb8486b 100644 (file)
@@ -3185,7 +3185,11 @@ merge_selfsigs (ctrl_t ctrl, kbnode_t keyblock)
                  memcpy (&pk->revoked, &rinfo, sizeof (rinfo));
                }
              if (main_pk->has_expired)
-               pk->has_expired = main_pk->has_expired;
+               {
+                 pk->has_expired = main_pk->has_expired;
+                 if (!pk->expiredate || pk->expiredate > main_pk->expiredate)
+                   pk->expiredate = main_pk->expiredate;
+               }
            }
        }
       return;