Browse Source

Take away the use of the address of main as a source of entropy. Causes

distractions to people testing and seeing link errors in some setups.
This will come back in another form
ok deraadt@
OPENBSD_5_6
beck 10 years ago
parent
commit
7f965a2eac
6 changed files with 30 additions and 6 deletions
  1. +5
    -1
      src/lib/libcrypto/arc4random/getentropy_linux.c
  2. +5
    -1
      src/lib/libcrypto/arc4random/getentropy_osx.c
  3. +5
    -1
      src/lib/libcrypto/arc4random/getentropy_solaris.c
  4. +5
    -1
      src/lib/libcrypto/crypto/getentropy_linux.c
  5. +5
    -1
      src/lib/libcrypto/crypto/getentropy_osx.c
  6. +5
    -1
      src/lib/libcrypto/crypto/getentropy_solaris.c

+ 5
- 1
src/lib/libcrypto/arc4random/getentropy_linux.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: getentropy_linux.c,v 1.21 2014/07/12 20:41:47 wouter Exp $ */
/* $OpenBSD: getentropy_linux.c,v 1.22 2014/07/13 08:24:20 beck Exp $ */
/* /*
* Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org> * Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org>
@ -69,7 +69,9 @@
int getentropy(void *buf, size_t len); int getentropy(void *buf, size_t len);
#if 0
extern int main(int, char *argv[]); extern int main(int, char *argv[]);
#endif
static int gotdata(char *buf, size_t len); static int gotdata(char *buf, size_t len);
static int getentropy_urandom(void *buf, size_t len); static int getentropy_urandom(void *buf, size_t len);
#ifdef CTL_MAXNAME #ifdef CTL_MAXNAME
@ -342,7 +344,9 @@ getentropy_fallback(void *buf, size_t len)
HX(sigprocmask(SIG_BLOCK, NULL, &sigset) == -1, HX(sigprocmask(SIG_BLOCK, NULL, &sigset) == -1,
sigset); sigset);
#if 0
HF(main); /* an addr in program */ HF(main); /* an addr in program */
#endif
HF(getentropy); /* an addr in this library */ HF(getentropy); /* an addr in this library */
HF(printf); /* an addr in libc */ HF(printf); /* an addr in libc */
p = (char *)&p; p = (char *)&p;


+ 5
- 1
src/lib/libcrypto/arc4random/getentropy_osx.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: getentropy_osx.c,v 1.4 2014/07/12 20:41:47 wouter Exp $ */
/* $OpenBSD: getentropy_osx.c,v 1.5 2014/07/13 08:24:20 beck Exp $ */
/* /*
* Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org> * Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org>
@ -74,7 +74,9 @@
int getentropy(void *buf, size_t len); int getentropy(void *buf, size_t len);
#if 0
extern int main(int, char *argv[]); extern int main(int, char *argv[]);
#endif
static int gotdata(char *buf, size_t len); static int gotdata(char *buf, size_t len);
static int getentropy_urandom(void *buf, size_t len); static int getentropy_urandom(void *buf, size_t len);
static int getentropy_fallback(void *buf, size_t len); static int getentropy_fallback(void *buf, size_t len);
@ -292,7 +294,9 @@ getentropy_fallback(void *buf, size_t len)
HX(sigprocmask(SIG_BLOCK, NULL, &sigset) == -1, HX(sigprocmask(SIG_BLOCK, NULL, &sigset) == -1,
sigset); sigset);
#if 0
HF(main); /* an addr in program */ HF(main); /* an addr in program */
#endif
HF(getentropy); /* an addr in this library */ HF(getentropy); /* an addr in this library */
HF(printf); /* an addr in libc */ HF(printf); /* an addr in libc */
p = (char *)&p; p = (char *)&p;


+ 5
- 1
src/lib/libcrypto/arc4random/getentropy_solaris.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: getentropy_solaris.c,v 1.4 2014/07/12 20:41:47 wouter Exp $ */
/* $OpenBSD: getentropy_solaris.c,v 1.5 2014/07/13 08:24:20 beck Exp $ */
/* /*
* Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org> * Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org>
@ -64,7 +64,9 @@
int getentropy(void *buf, size_t len); int getentropy(void *buf, size_t len);
#if 0
extern int main(int, char *argv[]); extern int main(int, char *argv[]);
#endif
static int gotdata(char *buf, size_t len); static int gotdata(char *buf, size_t len);
static int getentropy_urandom(void *buf, size_t len, const char *path, static int getentropy_urandom(void *buf, size_t len, const char *path,
int devfscheck); int devfscheck);
@ -297,7 +299,9 @@ getentropy_fallback(void *buf, size_t len)
HX(sigprocmask(SIG_BLOCK, NULL, &sigset) == -1, HX(sigprocmask(SIG_BLOCK, NULL, &sigset) == -1,
sigset); sigset);
#if 0
HF(main); /* an addr in program */ HF(main); /* an addr in program */
#endif
HF(getentropy); /* an addr in this library */ HF(getentropy); /* an addr in this library */
HF(printf); /* an addr in libc */ HF(printf); /* an addr in libc */
p = (char *)&p; p = (char *)&p;


+ 5
- 1
src/lib/libcrypto/crypto/getentropy_linux.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: getentropy_linux.c,v 1.21 2014/07/12 20:41:47 wouter Exp $ */
/* $OpenBSD: getentropy_linux.c,v 1.22 2014/07/13 08:24:20 beck Exp $ */
/* /*
* Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org> * Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org>
@ -69,7 +69,9 @@
int getentropy(void *buf, size_t len); int getentropy(void *buf, size_t len);
#if 0
extern int main(int, char *argv[]); extern int main(int, char *argv[]);
#endif
static int gotdata(char *buf, size_t len); static int gotdata(char *buf, size_t len);
static int getentropy_urandom(void *buf, size_t len); static int getentropy_urandom(void *buf, size_t len);
#ifdef CTL_MAXNAME #ifdef CTL_MAXNAME
@ -342,7 +344,9 @@ getentropy_fallback(void *buf, size_t len)
HX(sigprocmask(SIG_BLOCK, NULL, &sigset) == -1, HX(sigprocmask(SIG_BLOCK, NULL, &sigset) == -1,
sigset); sigset);
#if 0
HF(main); /* an addr in program */ HF(main); /* an addr in program */
#endif
HF(getentropy); /* an addr in this library */ HF(getentropy); /* an addr in this library */
HF(printf); /* an addr in libc */ HF(printf); /* an addr in libc */
p = (char *)&p; p = (char *)&p;


+ 5
- 1
src/lib/libcrypto/crypto/getentropy_osx.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: getentropy_osx.c,v 1.4 2014/07/12 20:41:47 wouter Exp $ */
/* $OpenBSD: getentropy_osx.c,v 1.5 2014/07/13 08:24:20 beck Exp $ */
/* /*
* Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org> * Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org>
@ -74,7 +74,9 @@
int getentropy(void *buf, size_t len); int getentropy(void *buf, size_t len);
#if 0
extern int main(int, char *argv[]); extern int main(int, char *argv[]);
#endif
static int gotdata(char *buf, size_t len); static int gotdata(char *buf, size_t len);
static int getentropy_urandom(void *buf, size_t len); static int getentropy_urandom(void *buf, size_t len);
static int getentropy_fallback(void *buf, size_t len); static int getentropy_fallback(void *buf, size_t len);
@ -292,7 +294,9 @@ getentropy_fallback(void *buf, size_t len)
HX(sigprocmask(SIG_BLOCK, NULL, &sigset) == -1, HX(sigprocmask(SIG_BLOCK, NULL, &sigset) == -1,
sigset); sigset);
#if 0
HF(main); /* an addr in program */ HF(main); /* an addr in program */
#endif
HF(getentropy); /* an addr in this library */ HF(getentropy); /* an addr in this library */
HF(printf); /* an addr in libc */ HF(printf); /* an addr in libc */
p = (char *)&p; p = (char *)&p;


+ 5
- 1
src/lib/libcrypto/crypto/getentropy_solaris.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: getentropy_solaris.c,v 1.4 2014/07/12 20:41:47 wouter Exp $ */
/* $OpenBSD: getentropy_solaris.c,v 1.5 2014/07/13 08:24:20 beck Exp $ */
/* /*
* Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org> * Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org>
@ -64,7 +64,9 @@
int getentropy(void *buf, size_t len); int getentropy(void *buf, size_t len);
#if 0
extern int main(int, char *argv[]); extern int main(int, char *argv[]);
#endif
static int gotdata(char *buf, size_t len); static int gotdata(char *buf, size_t len);
static int getentropy_urandom(void *buf, size_t len, const char *path, static int getentropy_urandom(void *buf, size_t len, const char *path,
int devfscheck); int devfscheck);
@ -297,7 +299,9 @@ getentropy_fallback(void *buf, size_t len)
HX(sigprocmask(SIG_BLOCK, NULL, &sigset) == -1, HX(sigprocmask(SIG_BLOCK, NULL, &sigset) == -1,
sigset); sigset);
#if 0
HF(main); /* an addr in program */ HF(main); /* an addr in program */
#endif
HF(getentropy); /* an addr in this library */ HF(getentropy); /* an addr in this library */
HF(printf); /* an addr in libc */ HF(printf); /* an addr in libc */
p = (char *)&p; p = (char *)&p;


Loading…
Cancel
Save