Skip to content

Commit 8686b0a

Browse files
committed
- Changes to compat/getentropy_solaris.c for,
ifdef stdint.h inclusion for older systems. ifdef sha2.h inclusion for older systems.
1 parent d68ece2 commit 8686b0a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

compat/getentropy_solaris.c

+11
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1717
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1818
*/
19+
#include "config.h"
1920

2021
#include <sys/types.h>
2122
#include <sys/param.h>
@@ -29,7 +30,9 @@
2930
#include <sys/stat.h>
3031
#include <sys/time.h>
3132
#include <stdlib.h>
33+
#ifdef HAVE_STDINT_H
3234
#include <stdint.h>
35+
#endif
3336
#include <stdio.h>
3437
#include <termios.h>
3538
#include <fcntl.h>
@@ -38,10 +41,14 @@
3841
#include <errno.h>
3942
#include <unistd.h>
4043
#include <time.h>
44+
#ifdef HAVE_SYS_SHA2_H
4145
#include <sys/sha2.h>
4246
#define SHA512_Init SHA512Init
4347
#define SHA512_Update SHA512Update
4448
#define SHA512_Final SHA512Final
49+
#else
50+
#include "openssl/sha.h"
51+
#endif
4552

4653
#include <sys/vfs.h>
4754
#include <sys/statfs.h>
@@ -64,7 +71,9 @@
6471

6572
int getentropy(void *buf, size_t len);
6673

74+
#ifdef CAN_REFERENCE_MAIN
6775
extern int main(int, char *argv[]);
76+
#endif
6877
static int gotdata(char *buf, size_t len);
6978
static int getentropy_urandom(void *buf, size_t len, const char *path,
7079
int devfscheck);
@@ -297,7 +306,9 @@ getentropy_fallback(void *buf, size_t len)
297306
HX(sigprocmask(SIG_BLOCK, NULL, &sigset) == -1,
298307
sigset);
299308

309+
#ifdef CAN_REFERENCE_MAIN
300310
HF(main); /* an addr in program */
311+
#endif
301312
HF(getentropy); /* an addr in this library */
302313
HF(printf); /* an addr in libc */
303314
p = (char *)&p;

doc/Changelog

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
- Downgrade compat/getentropy_solaris.c to version 1.4 from OpenBSD.
33
The dl_iterate_phdr() function introduced in newer versions raises
44
compilation errors on solaris 10.
5+
- Changes to compat/getentropy_solaris.c for,
6+
ifdef stdint.h inclusion for older systems.
7+
ifdef sha2.h inclusion for older systems.
58

69
6 January 2020: Wouter
710
- Merge #135 from Florian Obser: Use passed in neg and key cache

0 commit comments

Comments
 (0)