ports/databases/mariadb101-server/files/patch-mysys__ssl_my__crypt.cc
Bernard Spil 8624f83c6b databases/mariadb101-server: Security update to 10.1.31
PR:		225758
Reported by:	Pascal Christen <pascal christen hostpoint.ch>
MFH:		2018Q1
Security:	e3445736-fd01-11e7-ac58-b499baebfeaf
2018-02-12 14:45:12 +00:00

20 lines
573 B
C++

--- mysys_ssl/my_crypt.cc.orig 2018-02-04 02:30:31 UTC
+++ mysys_ssl/my_crypt.cc
@@ -27,6 +27,7 @@
#include <openssl/aes.h>
#include <openssl/err.h>
#include <openssl/rand.h>
+#include <openssl/opensslv.h>
#ifdef HAVE_ERR_remove_thread_state
#define ERR_remove_state(X) ERR_remove_thread_state(NULL)
@@ -295,6 +296,9 @@ unsigned int my_aes_ctx_size(enum my_aes
int my_random_bytes(uchar *buf, int num)
{
+#ifdef LIBRESSL_VERSION_NUMBER
+ arc4random_buf(buf, num);
+#endif
if (RAND_bytes(buf, num) != 1)
return MY_AES_OPENSSL_ERROR;
return MY_AES_OK;