Changeset 147 for trunk/src/sh_entropy.c
- Timestamp:
- Nov 26, 2007, 8:34:29 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_entropy.c
r138 r147 295 295 if (0 == sh_unix_device_readable(fd2)) 296 296 { 297 m_count = sl_read_timeout_fd(fd2, &nbuf, nbytes,297 m_count = sl_read_timeout_fd(fd2, nbuf, nbytes, 298 298 timeout_val, SL_FALSE); 299 299 if (m_count < 0) … … 387 387 SH_MUTEX_UNLOCK_UNSAFE(mutex_skey); 388 388 memset (keybuf, '\0', KEY_BYT); 389 memset (kbuf, '\0', sizeof(kbuf)); 389 390 390 391 SL_RETURN(0, _("sh_entropy")); … … 960 961 #endif 961 962 962 963 964 965 966 967 963 #ifdef SH_CUTEST 964 #include "CuTest.h" 965 966 void Test_entropy (CuTest *tc) 967 { 968 char bufx[9 * sizeof(UINT32) + 1]; 969 char bufy[9 * sizeof(UINT32) + 1]; 970 int status; 971 972 memset(skey->poolv, '\0', KEY_BYT); 973 974 status = sh_entropy (24, bufx); 975 CuAssertTrue(tc, 0 == status); 976 977 memset(skey->poolv, '\0', KEY_BYT); 978 979 status = sh_entropy (24, bufy); 980 CuAssertTrue(tc, 0 == status); 981 982 CuAssertTrue(tc, 0 != memcmp(bufx, bufy, 24)); 983 } 984 #endif 985 986 987 988 989 990 991 992
Note:
See TracChangeset
for help on using the changeset viewer.