$OpenBSD: patch-random_rndarc4random_c,v 1.1 2018/12/02 11:24:15 robert Exp $

Index: random/rndarc4random.c
--- random/rndarc4random.c.orig
+++ random/rndarc4random.c
@@ -0,0 +1,33 @@
+#include <config.h>
+#include <stdlib.h>
+
+#include "types.h"
+#include "g10lib.h"
+#include "rand-internal.h"
+
+int
+_gcry_rndarc4random_gather_random (void (*add)(const void*, size_t,
+                                   enum random_origins),
+                                   enum random_origins origin,
+                                   size_t length, int level )
+{
+  byte buffer[768];
+  size_t nbytes;
+
+  if( !length || !level )
+    return 0;
+
+  while( length )
+    {
+      nbytes = length < sizeof(buffer) ? length : sizeof(buffer);
+      if (nbytes > 256)
+        nbytes = 256;
+      arc4random_buf(buffer, nbytes);
+      (*add)((void *)buffer, nbytes, origin);
+      length -= nbytes;
+    }
+
+  wipememory (buffer, sizeof buffer);
+
+  return 0; /* success */
+}
