aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorNeal H. Walfield <[email protected]>2015-12-15 19:05:20 +0000
committerNeal H. Walfield <[email protected]>2015-12-22 14:03:51 +0000
commitdc417bf0c555a7416d0aedde6645fd1087660f92 (patch)
tree4cee54836db3b65ea727a6528625b461d6995515 /common
parentOnly add the user supplied CFLAGS after running any autoconf tests. (diff)
downloadgnupg-dc417bf0c555a7416d0aedde6645fd1087660f92.tar.gz
gnupg-dc417bf0c555a7416d0aedde6645fd1087660f92.zip
gpg: Fix TOCTTOU when updating keyblocks.
* g10/keydb.c (keydb_update_keyblock): Don't replace the record at the current offset. After taking the lock, extract the fingerprint from the keyblock, find it and then replace it. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 2193 Between locating the record to update and actually updating the keyblock, it is possible that another process modifies the keyring, which causes the update to corrupt the keyring. This is due to a time of check to time of use bug. The fix is straightforward: both operations must be done while holding the lock. This changes the semantics of the function slightly, but no callers need to be modified. Further, it now becomes impossible to replace key A with B; this function will only ever update B.
Diffstat (limited to 'common')
0 files changed, 0 insertions, 0 deletions