Fix crash on PGP packets/armors with more than one key (RhBug:667582)
authorPanu Matilainen <Panu Matilainen pmatilai@redhat.com>
Wed, 13 Jul 2011 13:05:34 +0000 (16:05 +0300)
committerPanu Matilainen <Panu Matilainen pmatilai@redhat.com>
Wed, 13 Jul 2011 13:05:34 +0000 (16:05 +0300)
commit3cad28715bcdcf1bc92171bc560cb24ea87d9d74
treeb19b1ffb2930e4dfac5c884b13b5ec914c9f4bc3
parent612579c6f656f6f8268ed6a05dcdb151477ddaf0
Fix crash on PGP packets/armors with more than one key (RhBug:667582)

- While OpenPGP permits arbitrary number of keys per packet/armor,
  we can't handle more than one, error out early.  The poor user
  wont get much of a clue as to what went wrong, but thats still
  better than crashing and burning.
- Return NULL from pgpPrtPubkeyParams() on errors and pass it onwards
  from pgpPrtKey() which propagates it up to callers. Besides
  the crash, this also fixes the error path from pgpNewPublicKey()
  failures.
rpmio/rpmpgp.c