summaryrefslogtreecommitdiffstats
path: root/src/file_gpg.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2009-07-03 07:37:51 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2009-07-03 07:37:51 +0200
commitf06c9edf800203d21feb90fce69c4c014242e2db (patch)
treed4d3bd9f16acaf2dbff754b4eb2b81996c268643 /src/file_gpg.c
parent6c32033a49fb849c4e0706d24e1e4e8af2fcf109 (diff)
PhotoRec .gpg: check publickey algo for Public-Key Encrypted Session Key Packet v3
Diffstat (limited to 'src/file_gpg.c')
-rw-r--r--src/file_gpg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/file_gpg.c b/src/file_gpg.c
index 36b4fab..53e7d7a 100644
--- a/src/file_gpg.c
+++ b/src/file_gpg.c
@@ -48,6 +48,8 @@ const file_hint_t file_hint_gpg= {
.register_header_check=&register_header_check_gpg
};
+/* See rfc4880 OpenPGP Message Format */
+
static const unsigned char gpg_header_pkey_enc[1]= {0x85};
static const unsigned char gpg_header_seckey[1]= {0x95};
#if 0
@@ -198,7 +200,7 @@ static int header_check_gpg(const unsigned char *buffer, const unsigned int buff
}
#endif
/* Public-Key Encrypted Session Key Packet v3 */
- if(buffer[0]==0x85 && buffer[3]==0x03)
+ if(buffer[0]==0x85 && buffer[3]==0x03 && is_valid_pubkey_algo(buffer[3+1+8]))
{
for(i=1;i<nbr;i++)
{