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
103a32fd
Commit
103a32fd
authored
Jan 18, 2019
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ed25519: better error message for an incorrect password hash
parent
c94ec9fc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
2 deletions
+17
-2
mysql-test/suite/plugins/r/auth_ed25519.result
mysql-test/suite/plugins/r/auth_ed25519.result
+4
-0
mysql-test/suite/plugins/t/auth_ed25519.test
mysql-test/suite/plugins/t/auth_ed25519.test
+4
-0
plugin/auth_ed25519/server_ed25519.c
plugin/auth_ed25519/server_ed25519.c
+8
-1
sql/sql_acl.cc
sql/sql_acl.cc
+1
-1
No files found.
mysql-test/suite/plugins/r/auth_ed25519.result
View file @
103a32fd
...
...
@@ -39,6 +39,10 @@ show grants for test1@localhost;
Grants for test1@localhost
GRANT USAGE ON *.* TO 'test1'@'localhost' IDENTIFIED VIA ed25519 USING 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY'
drop user test1@localhost;
create user test1@localhost identified via ed25519 using 'foo';
ERROR HY000: Password hash should be 43 characters long
create user test1@localhost identified via ed25519 using '>>>1234567890123456789012345678901234567890';
ERROR HY000: Password hash should be base64 encoded
create user test1@localhost identified via ed25519 using password('foo');
show grants for test1@localhost;
Grants for test1@localhost
...
...
mysql-test/suite/plugins/t/auth_ed25519.test
View file @
103a32fd
...
...
@@ -29,6 +29,10 @@ let $pwd=`select ed25519_password("secret")`;
eval
create
user
test1
@
localhost
identified
via
ed25519
using
'$pwd'
;
show
grants
for
test1
@
localhost
;
drop
user
test1
@
localhost
;
--
error
ER_PASSWD_LENGTH
create
user
test1
@
localhost
identified
via
ed25519
using
'foo'
;
--
error
ER_PASSWD_LENGTH
create
user
test1
@
localhost
identified
via
ed25519
using
'>>>1234567890123456789012345678901234567890'
;
create
user
test1
@
localhost
identified
via
ed25519
using
password
(
'foo'
);
show
grants
for
test1
@
localhost
;
select
ed25519_password
(
'foo'
);
...
...
plugin/auth_ed25519/server_ed25519.c
View file @
103a32fd
...
...
@@ -15,6 +15,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
#include <mysql/plugin_auth.h>
#include <mysqld_error.h>
#include "common.h"
#if !defined(__attribute__) && !defined(__GNUC__)
...
...
@@ -77,12 +78,18 @@ static int digest_to_binary(const char *d, size_t dlen,
char
pw
[
PASSWORD_LEN_BUF
];
if
(
*
blen
<
CRYPTO_PUBLICKEYBYTES
||
dlen
!=
PASSWORD_LEN
)
{
my_printf_error
(
ER_PASSWD_LENGTH
,
"Password hash should be %d characters long"
,
0
,
PASSWORD_LEN
);
return
1
;
}
*
blen
=
CRYPTO_PUBLICKEYBYTES
;
memcpy
(
pw
,
d
,
PASSWORD_LEN
);
pw
[
PASSWORD_LEN
]
=
'='
;
return
my_base64_decode
(
pw
,
PASSWORD_LEN_BUF
,
b
,
0
,
0
)
!=
CRYPTO_PUBLICKEYBYTES
;
if
(
my_base64_decode
(
pw
,
PASSWORD_LEN_BUF
,
b
,
0
,
0
)
==
CRYPTO_PUBLICKEYBYTES
)
return
0
;
my_printf_error
(
ER_PASSWD_LENGTH
,
"Password hash should be base64 encoded"
,
0
);
return
1
;
}
static
struct
st_mysql_auth
info
=
...
...
sql/sql_acl.cc
View file @
103a32fd
...
...
@@ -1792,7 +1792,7 @@ static int set_user_salt(ACL_USER *acl_user, plugin_ref plugin)
size_t
len
=
sizeof
(
buf
);
if
(
auth
->
preprocess_hash
(
acl_user
->
auth_string
.
str
,
acl_user
->
auth_string
.
length
,
buf
,
&
len
))
return
1
;
// ER_PASSWD_LENGTH?
return
1
;
acl_user
->
salt
.
str
=
(
char
*
)
memdup_root
(
&
acl_memroot
,
buf
,
len
);
acl_user
->
salt
.
length
=
len
;
}
...
...
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