]> asedeno.scripts.mit.edu Git - pssh.git/commitdiff
My 2006-09-18 release:
authorAlejandro R. Sedeño <asedeno@mit.edu>
Sun, 18 Mar 2007 18:49:45 +0000 (18:49 +0000)
committerAlejandro R. Sedeño <asedeno@mit.edu>
Sun, 18 Mar 2007 18:49:45 +0000 (18:49 +0000)
Treo 650 native RNG added, taken from:
http://www.nekito.net/~sachs/palm/pssh-notes.html

arm/crypto/rand.c
arm/crypto/rand_time.S
arm/crypto/rand_time.h
forms/about.c
rsrc/rsrc.h

index 6cfa84ec2886f9d1b15549697e9de574673aaadf..894e74cb85913dca61719770723e58d38a27301b 100644 (file)
@@ -46,9 +46,15 @@ static uint32_t RAND_time(void)
     rand_log(__PRETTY_FUNCTION__);
 
     assert(useARMTime != -1);
-    if (useARMTime) {
-        lastTime = ARM_time(lastTime);
-    } else {
+    switch(useARMTime)
+    {
+    case 1: // T|C
+       lastTime = ARM_time(lastTime);
+       break;
+    case 2: // Treo650
+       lastTime = ARM_time2(lastTime);
+       break;
+    default:
         lastTime = TimGetTicks();
     }
     return lastTime;
@@ -125,6 +131,8 @@ void RAND_init(void)
         uint32_t value32;
         uint8_t value8;
         uint32_t warned = 0;
+       uint32_t t1 = 0;
+       uint32_t t2 = 0;
 
         if (!rng) rng = fortuna_create();
 
@@ -134,7 +142,27 @@ void RAND_init(void)
             uint32_t deviceID = 0;
             FtrGet(sysFtrCreator, sysFtrNumOEMCompanyID, &companyID);
             FtrGet(sysFtrCreator, sysFtrNumOEMDeviceID, &deviceID);
-            useARMTime = (companyID == 'palm'  &&  deviceID == 'MT64'); // T|C
+           if (companyID == 'palm'  &&  deviceID == 'MT64')// T|C
+           {
+                useARMTime = 1;
+           }
+           else if (deviceID == 'H102')
+           {
+                useARMTime = 2;
+           }
+           else
+           {
+                useARMTime = 0;
+           }
+
+           // check if ARM time is working
+           RAND_time();
+           t1 = RAND_time();
+           t2 = RAND_time();
+           if (t1 == t2)
+           {
+               useARMTime = 0;
+           }
             
             if (!useARMTime) {
                 // Entropy sources suck - complain
index 08effb3ba43dac1a73238a354ef223111df54d03..fc500798090a362278c1414da23def83bab1e200 100644 (file)
@@ -13,3 +13,19 @@ ARM_time:
         mcreq p14, 0, r2, c0, c0, 0    //     enable timer
        mov   r0, r1                   // return new time
        bx    lr                       // return to caller (ARM or Thumb)
+
+
+.global ARM_time2
+.thumb_func
+ARM_time2:
+       // switch to ARM
+       mov   r3, pc
+       bx    r3
+       
+.code 32       
+        mrc   p14, 0, r1, c1, c1, 0    // read timer
+        cmp   r1, r0                   // if (time == oldtime) {
+        ldreq r2, =0x00000005          //     enable timer
+        mcreq p14, 0, r2, c0, c1, 0    //     enable timer
+       mov   r0, r1                   // return new time
+       bx    lr                       // return to caller (ARM or Thumb)
index cb262feaf42c74b00dc9e7f0a60fa0549bd601b0..dabe733b2fd6faff4d18ecefe010787db3418ce5 100644 (file)
@@ -28,5 +28,6 @@
 #include "includes.h"
 
 uint32_t ARM_time(uint32_t param);
+uint32_t ARM_time2(uint32_t param);
 
 #endif
index 4ea9dcd885c99f66361c52b8da53bbe3169f6a59..f4ebd875a07b6a7bf901efd47f6f2e89274095ec 100644 (file)
@@ -64,6 +64,9 @@ Boolean AboutFormHandleEvent(EventPtr e)
     "Alex Pruss: sf.net/projects/palmresize\n\n" \
     "Lauri Aarnio: www.nixu.fi/~lauri/\n\n" \
     "Walter Francis, Ton van Overbeek, David Carrel, Brian Wingerter, David Nolan, Jason Perry, Dan Vollmer, Olaf Kolling, Chris Weiss, Alexander Burke, Andreas Amann, Duncan Hudson, Jon Winters, Brian Parker, Ronny Hippler, Guy Davies, Thomas Arendsen Hein, Stefan Braunstein, Michael Bongartz, Olaf Ippisch, Michael Frotscher, Daniel Arvesen, and everyone else who has reported bugs and tested bug fixes\n\n" \
+    "Treo 650 RNG customizations by Daniel Grobe Sachs <dgsachs@nekito.net>\n" \
+    "Treo 650 Keyboard (ALT) customizations by Jeffrey Hutzelman\n" \
+    "Treo 650 features combined by Alejandro Sedeno\n"\
     "---\n\n" \
     "This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)\n" \
     "This product contains cryptographic software written by Eric Young (eay@cryptsoft.com)"
index 9b7ef8c8a1cab7a971e3c163f6e127bb5c66d9f6..5f3c350924736904fee43b659f76945296159e7d 100644 (file)
@@ -22,8 +22,8 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  **********/
 
-#define PSSH_VERSION "2005-06-23-asedeno1"
-#define PSSH_UVERSION "2005_06_23-asedeno1"
+#define PSSH_VERSION "2006-09-18-asedeno1"
+#define PSSH_UVERSION "2006_09_18-asedeno1"
 
 #define PSSH_CREATOR 'GPss'