]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Changes to compat/getentropy_solaris.c for,
authorGeorge Thessalonikefs <george@nlnetlabs.nl>
Tue, 7 Jan 2020 13:19:15 +0000 (15:19 +0200)
committerGeorge Thessalonikefs <george@nlnetlabs.nl>
Tue, 7 Jan 2020 13:19:15 +0000 (15:19 +0200)
  ifdef stdint.h inclusion for older systems.
  ifdef sha2.h inclusion for older systems.

compat/getentropy_solaris.c
doc/Changelog

index cfd5b70475e31cdf89853520c2dcbdde40903b3a..5e3b1cbbbd3085e45b3a2b2a4d2eeea2425465bd 100644 (file)
@@ -16,6 +16,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
+#include "config.h"
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -29,7 +30,9 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <stdlib.h>
+#ifdef HAVE_STDINT_H
 #include <stdint.h>
+#endif
 #include <stdio.h>
 #include <termios.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <time.h>
+#ifdef HAVE_SYS_SHA2_H
 #include <sys/sha2.h>
 #define SHA512_Init SHA512Init
 #define SHA512_Update SHA512Update
 #define SHA512_Final SHA512Final
+#else
+#include "openssl/sha.h"
+#endif
 
 #include <sys/vfs.h>
 #include <sys/statfs.h>
@@ -64,7 +71,9 @@
 
 int    getentropy(void *buf, size_t len);
 
+#ifdef CAN_REFERENCE_MAIN
 extern int main(int, char *argv[]);
+#endif
 static int gotdata(char *buf, size_t len);
 static int getentropy_urandom(void *buf, size_t len, const char *path,
     int devfscheck);
@@ -297,7 +306,9 @@ getentropy_fallback(void *buf, size_t len)
                        HX(sigprocmask(SIG_BLOCK, NULL, &sigset) == -1,
                            sigset);
 
+#ifdef CAN_REFERENCE_MAIN
                        HF(main);               /* an addr in program */
+#endif
                        HF(getentropy); /* an addr in this library */
                        HF(printf);             /* an addr in libc */
                        p = (char *)&p;
index 6626bcc0c13b00c4d4d91b31fbcc70b1b4b64b3b..e6d42a2e88f7da5c7c155fd825e0c352a48edc2e 100644 (file)
@@ -2,6 +2,9 @@
        - Downgrade compat/getentropy_solaris.c to version 1.4 from OpenBSD.
          The dl_iterate_phdr() function introduced in newer versions raises
          compilation errors on solaris 10.
+       - Changes to compat/getentropy_solaris.c for,
+         ifdef stdint.h inclusion for older systems.
+         ifdef sha2.h inclusion for older systems.
 
 6 January 2020: Wouter
        - Merge #135 from Florian Obser: Use passed in neg and key cache