]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/loclass/ikeys.c
ADD: Holimans new changes in master.
[proxmark3-svn] / client / loclass / ikeys.c
index cd2b72ee0e8d0c26872888b025ba7ca479eed102..fccd71d864f485d062ca4dfc3d736f8a829862f9 100644 (file)
@@ -1,5 +1,17 @@
 /*****************************************************************************
- * This file is part of iClassCipher. It is a reconstructon of the cipher engine
+ * WARNING
+ *
+ * THIS CODE IS CREATED FOR EXPERIMENTATION AND EDUCATIONAL USE ONLY. 
+ * 
+ * USAGE OF THIS CODE IN OTHER WAYS MAY INFRINGE UPON THE INTELLECTUAL 
+ * PROPERTY OF OTHER PARTIES, SUCH AS INSIDE SECURE AND HID GLOBAL, 
+ * AND MAY EXPOSE YOU TO AN INFRINGEMENT ACTION FROM THOSE PARTIES. 
+ * 
+ * THIS CODE SHOULD NEVER BE USED TO INFRINGE PATENTS OR INTELLECTUAL PROPERTY RIGHTS. 
+ *
+ *****************************************************************************
+ *
+ * This file is part of loclass. It is a reconstructon of the cipher engine
  * used in iClass, and RFID techology.
  *
  * The implementation is based on the work performed by
@@ -725,16 +737,18 @@ int doTestsWithKnownInputs()
 
 int readKeyFile(uint8_t key[8])
 {
-
        FILE *f;
-
+       int retval = 1;
        f = fopen("iclass_key.bin", "rb");
        if (f)
        {
-               if(fread(key, sizeof(key), 1, f) == 1) return 0;
+               if(fread(key, sizeof(uint8_t), 8, f) == 1) 
+               {
+                       retval = 0;     
+               }
+               fclose(f);
        }
-       return 1;
-
+       return retval;
 }
 
 
Impressum, Datenschutz