Verify PGP key packet sizes and number of MPIs match expectations
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 1 Nov 2011 07:44:31 +0000 (09:44 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 1 Nov 2011 07:44:31 +0000 (09:44 +0200)
commit807b402d95702f3f91e9e2bfbd2b5ca8c9964ed9
treea5affe6e30b2c6dc99f94de2120e51e945499428
parentc1141ec3f31ce20a071e9be064baa079119637f6
Verify PGP key packet sizes and number of MPIs match expectations

- A key packet must be larger than the "intro" structure to have
  room for the trailing MPIs, ie in order to be valid. This also
  ensures we can safely access the pubkey algorithm data.
- Verify the number of trailing MPI's and their total size matches
  the expectations and packet size exactly before bothering with
  digest calculations.
- Also use sizeof(keyid) instead of "magic eight" and memcpy()
  instead of memmove(), the argument keyid and memory returned
  from rpmDigestFinal() cannot overlap.
rpmio/rpmpgp.c