2 changed files with 95 additions and 12 deletions
@ -0,0 +1,56 @@
|
||||
Index: apr-util-1.2.6/crypto/getuuid.c
|
||||
--- apr-util-1.2.6/crypto/getuuid.c.orig 2005-02-04 21:45:35 +0100
|
||||
+++ apr-util-1.2.6/crypto/getuuid.c 2006-04-04 19:49:37 +0200
|
||||
@@ -131,7 +131,7 @@
|
||||
|
||||
/* crap. this isn't crypto quality, but it will be Good Enough */
|
||||
|
||||
- get_system_time(&time_now);
|
||||
+ time_now = apr_time_now();
|
||||
srand((unsigned int)(((time_now >> 32) ^ time_now) & 0xffffffff));
|
||||
|
||||
return rand() & 0x0FFFF;
|
||||
@@ -151,7 +151,7 @@
|
||||
static apr_interval_time_t time_last = 0;
|
||||
static apr_interval_time_t fudge = 0;
|
||||
|
||||
- time_now = apr_time_now();
|
||||
+ get_system_time(&time_now);
|
||||
|
||||
/* if clock reading changed since last UUID generated... */
|
||||
if (time_last != time_now) {
|
||||
@@ -188,17 +188,26 @@
|
||||
|
||||
get_current_time(×tamp);
|
||||
|
||||
- d[0] = (unsigned char)timestamp;
|
||||
- d[1] = (unsigned char)(timestamp >> 8);
|
||||
- d[2] = (unsigned char)(timestamp >> 16);
|
||||
- d[3] = (unsigned char)(timestamp >> 24);
|
||||
- d[4] = (unsigned char)(timestamp >> 32);
|
||||
- d[5] = (unsigned char)(timestamp >> 40);
|
||||
- d[6] = (unsigned char)(timestamp >> 48);
|
||||
- d[7] = (unsigned char)(((timestamp >> 56) & 0x0F) | 0x10);
|
||||
+ /* UUID field: time_low */
|
||||
+ d[0] = (unsigned char)(timestamp >> (8*3));
|
||||
+ d[1] = (unsigned char)(timestamp >> (8*2));
|
||||
+ d[2] = (unsigned char)(timestamp >> (8*1));
|
||||
+ d[3] = (unsigned char)(timestamp);
|
||||
+
|
||||
+ /* UUID field: time_mid */
|
||||
+ d[4] = (unsigned char)(timestamp >> (8*5));
|
||||
+ d[5] = (unsigned char)(timestamp >> (8*4));
|
||||
+
|
||||
+ /* UUID field: time_hi_and_version */
|
||||
+ d[6] = (unsigned char)(((timestamp >> (8*7)) & 0x0F) | 0x10);
|
||||
+ d[7] = (unsigned char)(timestamp >> (8*6));
|
||||
|
||||
+ /* UUID field: clk_seq_hi_res */
|
||||
d[8] = (unsigned char)(((uuid_state_seqnum >> 8) & 0x3F) | 0x80);
|
||||
+
|
||||
+ /* UUID field: clk_seq_low */
|
||||
d[9] = (unsigned char)uuid_state_seqnum;
|
||||
|
||||
+ /* UUID field: node */
|
||||
memcpy(&d[10], uuid_state_node, NODE_LENGTH);
|
||||
}
|
Loading…
Reference in new issue