Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP4
libXdmcp
U_Fix-compilation-error-when-arc4random_buf-is-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File U_Fix-compilation-error-when-arc4random_buf-is-not-ava.patch of Package libXdmcp
From 6d1aee0310001eca8f6ded9814a2a70b3a774896 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires <benjamin.tissoires@gmail.com> Date: Thu, 4 May 2017 11:12:13 +0200 Subject: [PATCH 2/2] Fix compilation error when arc4random_buf is not available Not sure how I missed that, but I did. Also rename emulate_getrandom_buf() into insecure_getrandom_buf() as requested in the previous patch reviews. Last, getbits() expects an unsigned char, so remove the warning. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> --- Key.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Key.c b/Key.c index 70607d0..d61ad0e 100644 --- a/Key.c +++ b/Key.c @@ -65,15 +65,15 @@ getbits (long data, unsigned char *dst) #ifndef HAVE_ARC4RANDOM_BUF static void -emulate_getrandom_buf (char *auth, int len) +insecure_getrandom_buf (unsigned char *auth, int len) { long lowbits, highbits; srandom ((int)getpid() ^ time((Time_t *)0)); lowbits = random (); highbits = random (); - getbits (lowbits, key->data); - getbits (highbits, key->data + 4); + getbits (lowbits, auth); + getbits (highbits, auth + 4); } static void @@ -88,7 +88,7 @@ arc4random_buf (void *auth, int len) return; #endif /* HAVE_GETENTROPY */ - emulate_getrandom_buf (auth, len); + insecure_getrandom_buf (auth, len); } #endif /* !defined(HAVE_ARC4RANDOM_BUF) */ -- 2.12.3
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