arc4random.c (302408) | arc4random.c (323129) |
---|---|
1/* OPENBSD ORIGINAL: lib/libc/crypto/arc4random.c */ 2 3/* $OpenBSD: arc4random.c,v 1.25 2013/10/01 18:34:57 markus Exp $ */ 4 5/* 6 * Copyright (c) 1996, David Mazieres <dm@uun.org> 7 * Copyright (c) 2008, Damien Miller <djm@openbsd.org> 8 * Copyright (c) 2013, Markus Friedl <markus@openbsd.org> --- 96 unchanged lines hidden (view full) --- 105 106static void 107_rs_stir(void) 108{ 109 u_char rnd[KEYSZ + IVSZ]; 110 111#ifdef WITH_OPENSSL 112 if (RAND_bytes(rnd, sizeof(rnd)) <= 0) | 1/* OPENBSD ORIGINAL: lib/libc/crypto/arc4random.c */ 2 3/* $OpenBSD: arc4random.c,v 1.25 2013/10/01 18:34:57 markus Exp $ */ 4 5/* 6 * Copyright (c) 1996, David Mazieres <dm@uun.org> 7 * Copyright (c) 2008, Damien Miller <djm@openbsd.org> 8 * Copyright (c) 2013, Markus Friedl <markus@openbsd.org> --- 96 unchanged lines hidden (view full) --- 105 106static void 107_rs_stir(void) 108{ 109 u_char rnd[KEYSZ + IVSZ]; 110 111#ifdef WITH_OPENSSL 112 if (RAND_bytes(rnd, sizeof(rnd)) <= 0) |
113 fatal("Couldn't obtain random bytes (error %ld)", 114 ERR_get_error()); | 113 fatal("Couldn't obtain random bytes (error 0x%lx)", 114 (unsigned long)ERR_get_error()); |
115#else 116 getrnd(rnd, sizeof(rnd)); 117#endif 118 119 if (!rs_initialized) { 120 rs_initialized = 1; 121 _rs_init(rnd, sizeof(rnd)); 122 } else --- 206 unchanged lines hidden --- | 115#else 116 getrnd(rnd, sizeof(rnd)); 117#endif 118 119 if (!rs_initialized) { 120 rs_initialized = 1; 121 _rs_init(rnd, sizeof(rnd)); 122 } else --- 206 unchanged lines hidden --- |