]>
Commit | Line | Data |
---|---|---|
b1322259 | 1 | /* |
0d664759 | 2 | * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. |
0c61e299 | 3 | * |
b1322259 RS |
4 | * Licensed under the OpenSSL license (the "License"). You may not use |
5 | * this file except in compliance with the License. You can obtain a copy | |
6 | * in the file LICENSE in the source distribution or at | |
7 | * https://www.openssl.org/source/license.html | |
0c61e299 | 8 | */ |
b1322259 | 9 | |
14879629 | 10 | #define _GNU_SOURCE |
da0616cd | 11 | #include "e_os.h" |
07016a8a | 12 | #include <stdio.h> |
b39fc560 | 13 | #include "internal/cryptlib.h" |
0c61e299 RL |
14 | #include <openssl/rand.h> |
15 | #include "rand_lcl.h" | |
6decf943 | 16 | #include "internal/rand_int.h" |
8389ec4b | 17 | #include <stdio.h> |
cf0891b8 | 18 | #include "internal/dso.h" |
14879629 KR |
19 | #if defined(__linux) |
20 | # include <sys/syscall.h> | |
21 | #endif | |
22 | #if defined(__FreeBSD__) | |
23 | # include <sys/types.h> | |
24 | # include <sys/sysctl.h> | |
25 | # include <sys/param.h> | |
26 | #endif | |
8f576627 | 27 | #if defined(__OpenBSD__) || defined(__NetBSD__) |
14879629 KR |
28 | # include <sys/param.h> |
29 | #endif | |
5bc6bcf8 DMSP |
30 | #ifdef OPENSSL_SYS_UNIX |
31 | # include <sys/types.h> | |
32 | # include <unistd.h> | |
33 | # include <sys/time.h> | |
34 | ||
35 | static uint64_t get_time_stamp(void); | |
36 | static uint64_t get_timer_bits(void); | |
37 | ||
38 | /* Macro to convert two thirty two bit values into a sixty four bit one */ | |
39 | # define TWO32TO64(a, b) ((((uint64_t)(a)) << 32) + (b)) | |
40 | ||
41 | /* | |
42 | * Check for the existence and support of POSIX timers. The standard | |
43 | * says that the _POSIX_TIMERS macro will have a positive value if they | |
44 | * are available. | |
45 | * | |
46 | * However, we want an additional constraint: that the timer support does | |
47 | * not require an extra library dependency. Early versions of glibc | |
48 | * require -lrt to be specified on the link line to access the timers, | |
49 | * so this needs to be checked for. | |
50 | * | |
51 | * It is worse because some libraries define __GLIBC__ but don't | |
52 | * support the version testing macro (e.g. uClibc). This means | |
53 | * an extra check is needed. | |
54 | * | |
55 | * The final condition is: | |
56 | * "have posix timers and either not glibc or glibc without -lrt" | |
57 | * | |
58 | * The nested #if sequences are required to avoid using a parameterised | |
59 | * macro that might be undefined. | |
60 | */ | |
61 | # undef OSSL_POSIX_TIMER_OKAY | |
62 | # if defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0 | |
63 | # if defined(__GLIBC__) | |
64 | # if defined(__GLIBC_PREREQ) | |
65 | # if __GLIBC_PREREQ(2, 17) | |
66 | # define OSSL_POSIX_TIMER_OKAY | |
67 | # endif | |
68 | # endif | |
69 | # else | |
70 | # define OSSL_POSIX_TIMER_OKAY | |
71 | # endif | |
72 | # endif | |
73 | #endif | |
0c61e299 | 74 | |
14879629 KR |
75 | int syscall_random(void *buf, size_t buflen); |
76 | ||
c16de9d8 | 77 | #if (defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_UEFI)) && \ |
8389ec4b | 78 | !defined(OPENSSL_RAND_SEED_NONE) |
c16de9d8 DMSP |
79 | # error "UEFI and VXWorks only support seeding NONE" |
80 | #endif | |
81 | ||
82 | #if !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) \ | |
83 | || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_VXWORKS) \ | |
84 | || defined(OPENSSL_SYS_UEFI)) | |
0f113f3e MC |
85 | |
86 | # if defined(OPENSSL_SYS_VOS) | |
87 | ||
8389ec4b RS |
88 | # ifndef OPENSSL_RAND_SEED_OS |
89 | # error "Unsupported seeding method configured; must be os" | |
90 | # endif | |
91 | ||
92 | # if defined(OPENSSL_SYS_VOS_HPPA) && defined(OPENSSL_SYS_VOS_IA32) | |
93 | # error "Unsupported HP-PA and IA32 at the same time." | |
94 | # endif | |
95 | # if !defined(OPENSSL_SYS_VOS_HPPA) && !defined(OPENSSL_SYS_VOS_IA32) | |
96 | # error "Must have one of HP-PA or IA32" | |
97 | # endif | |
98 | ||
0f113f3e MC |
99 | /* |
100 | * The following algorithm repeatedly samples the real-time clock (RTC) to | |
101 | * generate a sequence of unpredictable data. The algorithm relies upon the | |
102 | * uneven execution speed of the code (due to factors such as cache misses, | |
103 | * interrupts, bus activity, and scheduling) and upon the rather large | |
104 | * relative difference between the speed of the clock and the rate at which | |
75e2c877 RS |
105 | * it can be read. If it is ported to an environment where execution speed |
106 | * is more constant or where the RTC ticks at a much slower rate, or the | |
107 | * clock can be read with fewer instructions, it is likely that the results | |
108 | * would be far more predictable. This should only be used for legacy | |
109 | * platforms. | |
0f113f3e | 110 | * |
c16de9d8 | 111 | * As a precaution, we assume only 2 bits of entropy per byte. |
0f113f3e | 112 | */ |
6decf943 | 113 | size_t rand_pool_acquire_entropy(RAND_POOL *pool) |
cc7399e7 | 114 | { |
0f113f3e | 115 | short int code; |
0f113f3e | 116 | int i, k; |
c16de9d8 | 117 | size_t bytes_needed; |
0f113f3e MC |
118 | struct timespec ts; |
119 | unsigned char v; | |
0f113f3e MC |
120 | # ifdef OPENSSL_SYS_VOS_HPPA |
121 | long duration; | |
122 | extern void s$sleep(long *_duration, short int *_code); | |
123 | # else | |
0f113f3e MC |
124 | long long duration; |
125 | extern void s$sleep2(long long *_duration, short int *_code); | |
8389ec4b | 126 | # endif |
0f113f3e | 127 | |
6ebb49f3 | 128 | bytes_needed = rand_pool_bytes_needed(pool, 4 /*entropy_factor*/); |
c16de9d8 DMSP |
129 | |
130 | for (i = 0; i < bytes_needed; i++) { | |
0f113f3e MC |
131 | /* |
132 | * burn some cpu; hope for interrupts, cache collisions, bus | |
133 | * interference, etc. | |
134 | */ | |
135 | for (k = 0; k < 99; k++) | |
136 | ts.tv_nsec = random(); | |
137 | ||
138 | # ifdef OPENSSL_SYS_VOS_HPPA | |
139 | /* sleep for 1/1024 of a second (976 us). */ | |
140 | duration = 1; | |
141 | s$sleep(&duration, &code); | |
142 | # else | |
0f113f3e MC |
143 | /* sleep for 1/65536 of a second (15 us). */ |
144 | duration = 1; | |
145 | s$sleep2(&duration, &code); | |
8389ec4b | 146 | # endif |
0f113f3e | 147 | |
8389ec4b | 148 | /* Get wall clock time, take 8 bits. */ |
0f113f3e | 149 | clock_gettime(CLOCK_REALTIME, &ts); |
8389ec4b | 150 | v = (unsigned char)(ts.tv_nsec & 0xFF); |
6decf943 | 151 | rand_pool_add(pool, arg, &v, sizeof(v) , 2); |
0f113f3e | 152 | } |
6decf943 | 153 | return rand_pool_entropy_available(pool); |
cc7399e7 | 154 | } |
8389ec4b | 155 | |
810ef917 | 156 | # else |
8389ec4b RS |
157 | |
158 | # if defined(OPENSSL_RAND_SEED_EGD) && \ | |
159 | (defined(OPENSSL_NO_EGD) || !defined(DEVRANDOM_EGD)) | |
160 | # error "Seeding uses EGD but EGD is turned off or no device given" | |
0f113f3e MC |
161 | # endif |
162 | ||
8389ec4b RS |
163 | # if defined(OPENSSL_RAND_SEED_DEVRANDOM) && !defined(DEVRANDOM) |
164 | # error "Seeding uses urandom but DEVRANDOM is not configured" | |
165 | # endif | |
0f113f3e | 166 | |
8389ec4b | 167 | # if defined(OPENSSL_RAND_SEED_OS) |
72960279 | 168 | # if !defined(DEVRANDOM) |
8389ec4b | 169 | # error "OS seeding requires DEVRANDOM to be configured" |
0f113f3e | 170 | # endif |
14879629 | 171 | # define OPENSSL_RAND_SEED_GETRANDOM |
72960279 | 172 | # define OPENSSL_RAND_SEED_DEVRANDOM |
8389ec4b | 173 | # endif |
0f113f3e | 174 | |
8389ec4b RS |
175 | # if defined(OPENSSL_RAND_SEED_LIBRANDOM) |
176 | # error "librandom not (yet) supported" | |
177 | # endif | |
0f113f3e | 178 | |
8f576627 | 179 | # if (defined(__FreeBSD__) || defined(__NetBSD__)) && defined(KERN_ARND) |
14879629 KR |
180 | /* |
181 | * sysctl_random(): Use sysctl() to read a random number from the kernel | |
182 | * Returns the size on success, 0 on failure. | |
183 | */ | |
184 | static size_t sysctl_random(char *buf, size_t buflen) | |
185 | { | |
186 | int mib[2]; | |
187 | size_t done = 0; | |
188 | size_t len; | |
189 | ||
190 | /* | |
8f576627 KR |
191 | * On FreeBSD old implementations returned longs, newer versions support |
192 | * variable sizes up to 256 byte. The code below would not work properly | |
193 | * when the sysctl returns long and we want to request something not a | |
194 | * multiple of longs, which should never be the case. | |
14879629 | 195 | */ |
5b820d78 KR |
196 | if (!ossl_assert(buflen % sizeof(long) == 0)) |
197 | return 0; | |
14879629 | 198 | |
8f576627 KR |
199 | /* |
200 | * On NetBSD before 4.0 KERN_ARND was an alias for KERN_URND, and only | |
201 | * filled in an int, leaving the rest uninitialized. Since NetBSD 4.0 | |
202 | * it returns a variable number of bytes with the current version supporting | |
203 | * up to 256 bytes. | |
204 | * Just return an error on older NetBSD versions. | |
205 | */ | |
206 | #if defined(__NetBSD__) && __NetBSD_Version__ < 400000000 | |
207 | return 0; | |
208 | #endif | |
209 | ||
14879629 KR |
210 | mib[0] = CTL_KERN; |
211 | mib[1] = KERN_ARND; | |
212 | ||
213 | do { | |
214 | len = buflen; | |
215 | if (sysctl(mib, 2, buf, &len, NULL, 0) == -1) | |
216 | return done; | |
217 | done += len; | |
218 | buf += len; | |
219 | buflen -= len; | |
220 | } while (buflen > 0); | |
221 | ||
222 | return done; | |
223 | } | |
224 | # endif | |
225 | ||
226 | /* | |
227 | * syscall_random(): Try to get random data using a system call | |
228 | * returns the number of bytes returned in buf, or <= 0 on error. | |
229 | */ | |
230 | int syscall_random(void *buf, size_t buflen) | |
231 | { | |
cf0891b8 KR |
232 | union { |
233 | void *p; | |
234 | int (*f)(void *buffer, size_t length); | |
235 | } p_getentropy; | |
236 | ||
237 | /* | |
238 | * Do runtime detection to find getentropy(). | |
239 | * | |
240 | * We could cache the result of the lookup, but we normally don't | |
241 | * call this function often. | |
242 | * | |
243 | * Known OSs that should support this: | |
244 | * - Darwin since 16 (OSX 10.12, IOS 10.0). | |
245 | * - Solaris since 11.3 | |
246 | * - OpenBSD since 5.6 | |
247 | * - Linux since 3.17 with glibc 2.25 | |
248 | * - FreeBSD since 12.0 (1200061) | |
249 | */ | |
250 | p_getentropy.p = DSO_global_lookup("getentropy"); | |
251 | if (p_getentropy.p != NULL) | |
1e653d0f | 252 | return p_getentropy.f(buf, buflen) == 0 ? buflen : 0; |
cf0891b8 | 253 | |
cf0891b8 | 254 | /* Linux supports this since version 3.17 */ |
14879629 KR |
255 | # if defined(__linux) && defined(SYS_getrandom) |
256 | return (int)syscall(SYS_getrandom, buf, buflen, 0); | |
257 | # endif | |
258 | ||
8f576627 | 259 | # if (defined(__FreeBSD__) || defined(__NetBSD__)) && defined(KERN_ARND) |
14879629 KR |
260 | return (int)sysctl_random(buf, buflen); |
261 | # endif | |
262 | ||
14879629 KR |
263 | return -1; |
264 | } | |
265 | ||
75e2c877 | 266 | /* |
c16de9d8 DMSP |
267 | * Try the various seeding methods in turn, exit when successful. |
268 | * | |
269 | * TODO(DRBG): If more than one entropy source is available, is it | |
270 | * preferable to stop as soon as enough entropy has been collected | |
271 | * (as favored by @rsalz) or should one rather be defensive and add | |
272 | * more entropy than requested and/or from different sources? | |
273 | * | |
274 | * Currently, the user can select multiple entropy sources in the | |
275 | * configure step, yet in practice only the first available source | |
276 | * will be used. A more flexible solution has been requested, but | |
277 | * currently it is not clear how this can be achieved without | |
278 | * overengineering the problem. There are many parameters which | |
279 | * could be taken into account when selecting the order and amount | |
280 | * of input from the different entropy sources (trust, quality, | |
281 | * possibility of blocking). | |
75e2c877 | 282 | */ |
6decf943 | 283 | size_t rand_pool_acquire_entropy(RAND_POOL *pool) |
8389ec4b RS |
284 | { |
285 | # ifdef OPENSSL_RAND_SEED_NONE | |
6decf943 | 286 | return rand_pool_entropy_available(pool); |
8389ec4b | 287 | # else |
c16de9d8 DMSP |
288 | size_t bytes_needed; |
289 | size_t entropy_available = 0; | |
290 | unsigned char *buffer; | |
0f113f3e | 291 | |
75e2c877 | 292 | # ifdef OPENSSL_RAND_SEED_GETRANDOM |
6ebb49f3 | 293 | bytes_needed = rand_pool_bytes_needed(pool, 1 /*entropy_factor*/); |
6decf943 | 294 | buffer = rand_pool_add_begin(pool, bytes_needed); |
c16de9d8 DMSP |
295 | if (buffer != NULL) { |
296 | size_t bytes = 0; | |
0f113f3e | 297 | |
14879629 | 298 | if (syscall_random(buffer, bytes_needed) == (int)bytes_needed) |
c16de9d8 DMSP |
299 | bytes = bytes_needed; |
300 | ||
8e2bec9b RL |
301 | rand_pool_add_end(pool, bytes, 8 * bytes); |
302 | entropy_available = rand_pool_entropy_available(pool); | |
75e2c877 | 303 | } |
c16de9d8 DMSP |
304 | if (entropy_available > 0) |
305 | return entropy_available; | |
0f113f3e MC |
306 | # endif |
307 | ||
75e2c877 | 308 | # if defined(OPENSSL_RAND_SEED_LIBRANDOM) |
8389ec4b | 309 | { |
75e2c877 | 310 | /* Not yet implemented. */ |
0f113f3e | 311 | } |
8389ec4b | 312 | # endif |
0f113f3e | 313 | |
8389ec4b | 314 | # ifdef OPENSSL_RAND_SEED_DEVRANDOM |
6ebb49f3 | 315 | bytes_needed = rand_pool_bytes_needed(pool, 1 /*entropy_factor*/); |
c16de9d8 | 316 | if (bytes_needed > 0) { |
8389ec4b RS |
317 | static const char *paths[] = { DEVRANDOM, NULL }; |
318 | FILE *fp; | |
319 | int i; | |
0f113f3e | 320 | |
8389ec4b RS |
321 | for (i = 0; paths[i] != NULL; i++) { |
322 | if ((fp = fopen(paths[i], "rb")) == NULL) | |
323 | continue; | |
324 | setbuf(fp, NULL); | |
6decf943 | 325 | buffer = rand_pool_add_begin(pool, bytes_needed); |
c16de9d8 DMSP |
326 | if (buffer != NULL) { |
327 | size_t bytes = 0; | |
328 | if (fread(buffer, 1, bytes_needed, fp) == bytes_needed) | |
329 | bytes = bytes_needed; | |
330 | ||
8e2bec9b RL |
331 | rand_pool_add_end(pool, bytes, 8 * bytes); |
332 | entropy_available = rand_pool_entropy_available(pool); | |
8389ec4b | 333 | } |
75e2c877 | 334 | fclose(fp); |
c16de9d8 DMSP |
335 | if (entropy_available > 0) |
336 | return entropy_available; | |
337 | ||
6ebb49f3 | 338 | bytes_needed = rand_pool_bytes_needed(pool, 1 /*entropy_factor*/); |
8389ec4b | 339 | } |
0f113f3e | 340 | } |
8389ec4b | 341 | # endif |
0f113f3e | 342 | |
75e2c877 | 343 | # ifdef OPENSSL_RAND_SEED_RDTSC |
c16de9d8 DMSP |
344 | entropy_available = rand_acquire_entropy_from_tsc(pool); |
345 | if (entropy_available > 0) | |
346 | return entropy_available; | |
75e2c877 RS |
347 | # endif |
348 | ||
349 | # ifdef OPENSSL_RAND_SEED_RDCPU | |
c16de9d8 DMSP |
350 | entropy_available = rand_acquire_entropy_from_cpu(pool); |
351 | if (entropy_available > 0) | |
352 | return entropy_available; | |
75e2c877 RS |
353 | # endif |
354 | ||
355 | # ifdef OPENSSL_RAND_SEED_EGD | |
6ebb49f3 | 356 | bytes_needed = rand_pool_bytes_needed(pool, 1 /*entropy_factor*/); |
c16de9d8 | 357 | if (bytes_needed > 0) { |
75e2c877 RS |
358 | static const char *paths[] = { DEVRANDOM_EGD, NULL }; |
359 | int i; | |
0f113f3e | 360 | |
75e2c877 | 361 | for (i = 0; paths[i] != NULL; i++) { |
6decf943 | 362 | buffer = rand_pool_add_begin(pool, bytes_needed); |
c16de9d8 DMSP |
363 | if (buffer != NULL) { |
364 | size_t bytes = 0; | |
365 | int num = RAND_query_egd_bytes(paths[i], | |
366 | buffer, (int)bytes_needed); | |
367 | if (num == (int)bytes_needed) | |
368 | bytes = bytes_needed; | |
369 | ||
8e2bec9b RL |
370 | rand_pool_add_end(pool, bytes, 8 * bytes); |
371 | entropy_available = rand_pool_entropy_available(pool); | |
75e2c877 | 372 | } |
c16de9d8 DMSP |
373 | if (entropy_available > 0) |
374 | return entropy_available; | |
8389ec4b RS |
375 | } |
376 | } | |
377 | # endif | |
0f113f3e | 378 | |
6decf943 | 379 | return rand_pool_entropy_available(pool); |
0f113f3e | 380 | # endif |
0c61e299 | 381 | } |
8389ec4b | 382 | # endif |
5bc6bcf8 DMSP |
383 | #endif |
384 | ||
385 | #ifdef OPENSSL_SYS_UNIX | |
386 | int rand_pool_add_nonce_data(RAND_POOL *pool) | |
387 | { | |
388 | struct { | |
389 | pid_t pid; | |
390 | CRYPTO_THREAD_ID tid; | |
391 | uint64_t time; | |
392 | } data = { 0 }; | |
393 | ||
394 | /* | |
395 | * Add process id, thread id, and a high resolution timestamp to | |
396 | * ensure that the nonce is unique whith high probability for | |
397 | * different process instances. | |
398 | */ | |
399 | data.pid = getpid(); | |
400 | data.tid = CRYPTO_THREAD_get_current_id(); | |
401 | data.time = get_time_stamp(); | |
402 | ||
403 | return rand_pool_add(pool, (unsigned char *)&data, sizeof(data), 0); | |
404 | } | |
405 | ||
406 | int rand_pool_add_additional_data(RAND_POOL *pool) | |
407 | { | |
408 | struct { | |
409 | CRYPTO_THREAD_ID tid; | |
410 | uint64_t time; | |
411 | } data = { 0 }; | |
412 | ||
413 | /* | |
414 | * Add some noise from the thread id and a high resolution timer. | |
415 | * The thread id adds a little randomness if the drbg is accessed | |
416 | * concurrently (which is the case for the <master> drbg). | |
417 | */ | |
418 | data.tid = CRYPTO_THREAD_get_current_id(); | |
419 | data.time = get_timer_bits(); | |
420 | ||
421 | return rand_pool_add(pool, (unsigned char *)&data, sizeof(data), 0); | |
422 | } | |
423 | ||
424 | ||
425 | ||
426 | /* | |
427 | * Get the current time with the highest possible resolution | |
428 | * | |
429 | * The time stamp is added to the nonce, so it is optimized for not repeating. | |
430 | * The current time is ideal for this purpose, provided the computer's clock | |
431 | * is synchronized. | |
432 | */ | |
433 | static uint64_t get_time_stamp(void) | |
434 | { | |
435 | # if defined(OSSL_POSIX_TIMER_OKAY) | |
436 | { | |
437 | struct timespec ts; | |
438 | ||
439 | if (clock_gettime(CLOCK_REALTIME, &ts) == 0) | |
440 | return TWO32TO64(ts.tv_sec, ts.tv_nsec); | |
441 | } | |
442 | # endif | |
443 | # if defined(__unix__) \ | |
444 | || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) | |
445 | { | |
446 | struct timeval tv; | |
447 | ||
448 | if (gettimeofday(&tv, NULL) == 0) | |
449 | return TWO32TO64(tv.tv_sec, tv.tv_usec); | |
450 | } | |
451 | # endif | |
452 | return time(NULL); | |
453 | } | |
454 | ||
455 | /* | |
456 | * Get an arbitrary timer value of the highest possible resolution | |
457 | * | |
458 | * The timer value is added as random noise to the additional data, | |
459 | * which is not considered a trusted entropy sourec, so any result | |
460 | * is acceptable. | |
461 | */ | |
462 | static uint64_t get_timer_bits(void) | |
463 | { | |
464 | uint64_t res = OPENSSL_rdtsc(); | |
465 | ||
466 | if (res != 0) | |
467 | return res; | |
468 | ||
469 | # if defined(__sun) || defined(__hpux) | |
470 | return gethrtime(); | |
471 | # elif defined(_AIX) | |
472 | { | |
473 | timebasestruct_t t; | |
474 | ||
475 | read_wall_time(&t, TIMEBASE_SZ); | |
476 | return TWO32TO64(t.tb_high, t.tb_low); | |
477 | } | |
478 | # elif defined(OSSL_POSIX_TIMER_OKAY) | |
479 | { | |
480 | struct timespec ts; | |
481 | ||
482 | # ifdef CLOCK_BOOTTIME | |
483 | # define CLOCK_TYPE CLOCK_BOOTTIME | |
484 | # elif defined(_POSIX_MONOTONIC_CLOCK) | |
485 | # define CLOCK_TYPE CLOCK_MONOTONIC | |
486 | # else | |
487 | # define CLOCK_TYPE CLOCK_REALTIME | |
488 | # endif | |
489 | ||
490 | if (clock_gettime(CLOCK_TYPE, &ts) == 0) | |
491 | return TWO32TO64(ts.tv_sec, ts.tv_nsec); | |
492 | } | |
493 | # endif | |
494 | # if defined(__unix__) \ | |
495 | || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) | |
496 | { | |
497 | struct timeval tv; | |
0c61e299 | 498 | |
5bc6bcf8 DMSP |
499 | if (gettimeofday(&tv, NULL) == 0) |
500 | return TWO32TO64(tv.tv_sec, tv.tv_usec); | |
501 | } | |
502 | # endif | |
503 | return time(NULL); | |
504 | } | |
57d8ff79 | 505 | #endif |