Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
DemiMarie authored and dmnks committed Jun 7, 2022

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent 5bc03a6 commit fae06f6
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
@@ -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);

0 comments on commit fae06f6

Please sign in to comment.