commit 3af8924f7d657ffad2bdc6dc0e9d19a75c00a7b7
Author: Christophe Fergeau <[email protected]>
Date:   Mon Oct 19 14:25:24 2009 +0200

    don't regenerate HashInfo file if we already have a valid one

 src/itdb_hash72.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/itdb_hash72.c b/src/itdb_hash72.c
index 23c0b3d..0c22665 100644
--- a/src/itdb_hash72.c
+++ b/src/itdb_hash72.c
@@ -245,11 +245,21 @@ gboolean itdb_hash72_extract_hash_info (const Itdb_Device 
*device,
     guchar random_bytes[12];
     MhbdHeader *header;
     int iv_extracted;
+    struct Hash78Info *hash_info;
 
     if (itdb_len < 0x6c) {
        return FALSE;
     }
 
+    hash_info = read_hash_info (device);
+    g_free (hash_info);
+    if (hash_info != NULL) {
+       /* We already have what we need to generate signatures for this device,
+        * no need to go on
+        */
+       return TRUE;
+    }
+
     header = (MhbdHeader *)itdb_data;
     g_assert (strncmp (header->header_id, "mhbd", strlen ("mhbd")) == 0);
     memcpy (hash72, &header->hash72, sizeof (hash72));

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to