Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP2:GA
wpa_supplicant
wpa_supplicant-getrandom.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File wpa_supplicant-getrandom.patch of Package wpa_supplicant
Index: wpa_supplicant-2.9/src/utils/os_unix.c =================================================================== --- wpa_supplicant-2.9.orig/src/utils/os_unix.c +++ wpa_supplicant-2.9/src/utils/os_unix.c @@ -6,11 +6,15 @@ * See README for more details. */ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif #include "includes.h" #include <time.h> #include <sys/wait.h> - +#include <sys/syscall.h> +#include <unistd.h> #ifdef ANDROID #include <sys/capability.h> #include <sys/prctl.h> @@ -257,6 +261,10 @@ int os_get_random(unsigned char *buf, si buf[i] = i & 0xff; return 0; #else /* TEST_FUZZ */ +#ifdef SYS_getrandom + int gr = TEMP_FAILURE_RETRY(syscall(SYS_getrandom, buf, len, 0)); + return (gr != -1 && gr == len) ? 0 : -1; +#else /* SYS_getrandom */ FILE *f; size_t rc; @@ -269,10 +277,13 @@ int os_get_random(unsigned char *buf, si return -1; } + setbuf(f, NULL); + rc = fread(buf, 1, len, f); fclose(f); return rc != len ? -1 : 0; +#endif /* SYS_getrandom */ #endif /* TEST_FUZZ */ }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor