summaryrefslogtreecommitdiffstats
path: root/src/file_gpg.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2011-10-30 12:14:55 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2011-10-30 12:14:55 +0100
commita0a5105a3b16c3662fef193da61181f60eba627f (patch)
tree6720fddca3bc5507d3762d3971ac9a816e0d77b1 /src/file_gpg.c
parented0df8fb10491d84ed41ca9a4ae42203a30a446c (diff)
PhotoRec: allow more crypto algorithms in .gpg detection
Diffstat (limited to 'src/file_gpg.c')
-rw-r--r--src/file_gpg.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/file_gpg.c b/src/file_gpg.c
index 0d67887..715a623 100644
--- a/src/file_gpg.c
+++ b/src/file_gpg.c
@@ -176,9 +176,9 @@ static int is_valid_pubkey_algo(const int algo)
* 19 - Reserved for ECDSA
* 20 - Elgamal (Encrypt or Sign)
* 21 - Reserved for Diffie-Hellman (X9.42, as defined for IETF-S/MIME)
- * 100 to 110 - Private/Experimental algorith
+ * 100 to 110 - Private/Experimental algorithm
*/
- if(algo>=100 && algo<=100)
+ if(algo>=100 && algo<=110)
return 1;
switch(algo)
{
@@ -293,6 +293,10 @@ static int header_check_gpg(const unsigned char *buffer, const unsigned int buff
/* Secret-Key Packet v4 followed by User ID Packet */
if(buffer[0]==0x95 && buffer[3]==0x04 && packet_tag[1]==OPENPGP_TAG_USER_ID && is_valid_pubkey_algo(buffer[8])>0)
{
+ /* 3: version
+ * 4: time
+ * 8: public-key algorithm
+ */
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_gpg.extension;
file_recovery_new->data_check=&data_check_gpg;