Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
ad0013c8
Commit
ad0013c8
authored
Jan 29, 2018
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-14343 Server crash on FIPS with openssl-1.0.2k
don't use internal undocumented OpenSSL functionality
parent
fb24eb87
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
21 deletions
+3
-21
mysys_ssl/my_crypt.cc
mysys_ssl/my_crypt.cc
+2
-21
mysys_ssl/yassl.cc
mysys_ssl/yassl.cc
+1
-0
No files found.
mysys_ssl/my_crypt.cc
View file @
ad0013c8
...
...
@@ -26,6 +26,7 @@
#include <openssl/evp.h>
#include <openssl/aes.h>
#include <openssl/err.h>
#include <openssl/rand.h>
#ifdef HAVE_ERR_remove_thread_state
#define ERR_remove_state(X) ERR_remove_thread_state(NULL)
...
...
@@ -292,31 +293,11 @@ unsigned int my_aes_ctx_size(enum my_aes_mode)
return
MY_AES_CTX_SIZE
;
}
#ifdef HAVE_YASSL
#include <random.hpp>
int
my_random_bytes
(
uchar
*
buf
,
int
num
)
{
TaoCrypt
::
RandomNumberGenerator
rand
;
rand
.
GenerateBlock
((
TaoCrypt
::
byte
*
)
buf
,
num
);
return
MY_AES_OK
;
}
#else
#include <openssl/rand.h>
int
my_random_bytes
(
uchar
*
buf
,
int
num
)
{
/*
Unfortunately RAND_bytes manual page does not provide any guarantees
in relation to blocking behavior. Here we explicitly use SSLeay random
instead of whatever random engine is currently set in OpenSSL. That way
we are guaranteed to have a non-blocking random.
*/
RAND_METHOD
*
rand
=
RAND_SSLeay
();
if
(
rand
==
NULL
||
rand
->
bytes
(
buf
,
num
)
!=
1
)
if
(
RAND_bytes
(
buf
,
num
)
!=
1
)
return
MY_AES_OPENSSL_ERROR
;
return
MY_AES_OK
;
}
#endif
}
mysys_ssl/yassl.cc
View file @
ad0013c8
...
...
@@ -26,6 +26,7 @@
#include "aes.hpp"
using
yaSSL
::
yaERR_remove_state
;
using
yaSSL
::
yaRAND_bytes
;
#define EVP_CIPH_ECB_MODE 0x1
#define EVP_CIPH_CBC_MODE 0x2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment