Skip to content

Commit

Permalink
Avoid clobbering existing saved time
Browse files Browse the repository at this point in the history
The public key parser needs to set PGPDIG_SAVED_TIME, so that future
iterations in pgpDigParams() do not clobber the key’s creation time.

Fixes rpm-software-management#2004.

Backported from commit 2b48aa7
  • Loading branch information
DemiMarie authored and dmnks committed Jun 30, 2022
1 parent 713d5c9 commit 6cc4daf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rpmio/rpmpgp.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,10 @@ static int pgpPrtKey(pgpTag tag, const uint8_t *h, size_t hlen,
/* If _digp->hash is not NULL then signature is already loaded */
if (_digp->hash == NULL) {
_digp->version = v->version;
_digp->time = pgpGrab(v->time, sizeof(v->time));
if (!(_digp->saved & PGPDIG_SAVED_TIME))
_digp->time = pgpGrab(v->time, sizeof(v->time));
_digp->pubkey_algo = v->pubkey_algo;
_digp->saved |= PGPDIG_SAVED_TIME | PGPDIG_SIG_HAS_CREATION_TIME;
}

p = ((uint8_t *)v) + sizeof(*v);
Expand Down

0 comments on commit 6cc4daf

Please sign in to comment.