diff options
| author | deraadt <> | 2014-07-17 14:30:41 +0000 |
|---|---|---|
| committer | deraadt <> | 2014-07-17 14:30:41 +0000 |
| commit | abc31963b47bed637894a360dd9ea17999dcd644 (patch) | |
| tree | f573d1bfb18ae2e48f8a5c44ca07100fcab330fc /src/lib/libc/crypt/arc4random.c | |
| parent | db1ff260ad2b880f1b909cdc640fc7c3cf21fb0c (diff) | |
| download | openbsd-abc31963b47bed637894a360dd9ea17999dcd644.tar.gz openbsd-abc31963b47bed637894a360dd9ea17999dcd644.tar.bz2 openbsd-abc31963b47bed637894a360dd9ea17999dcd644.zip | |
"Race-free because we're running single-threaded in a new
address space, and once allocated rs is never deallocated."
document the forkhandler to save reviewers time, with matthew
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libc/crypt/arc4random.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/libc/crypt/arc4random.c b/src/lib/libc/crypt/arc4random.c index 3b7f34faed..565bfa0333 100644 --- a/src/lib/libc/crypt/arc4random.c +++ b/src/lib/libc/crypt/arc4random.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: arc4random.c,v 1.45 2014/07/16 00:18:54 deraadt Exp $ */ | 1 | /* $OpenBSD: arc4random.c,v 1.46 2014/07/17 14:30:41 deraadt Exp $ */ |
| 2 | 2 | ||
| 3 | /* | 3 | /* |
| 4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> | 4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> |
| @@ -69,6 +69,10 @@ static inline void _rs_rekey(u_char *dat, size_t datlen); | |||
| 69 | static inline void | 69 | static inline void |
| 70 | _rs_forkhandler(void) | 70 | _rs_forkhandler(void) |
| 71 | { | 71 | { |
| 72 | /* | ||
| 73 | * Race-free because we're running single-threaded in a new | ||
| 74 | * address space, and once allocated rs is never deallocated. | ||
| 75 | */ | ||
| 72 | if (rs) | 76 | if (rs) |
| 73 | rs->rs_count = 0; | 77 | rs->rs_count = 0; |
| 74 | } | 78 | } |
