Req #81668 [Com]: Implement ED25519 auth for mysqlnd
| From: | samira dot akhlaqi314 at gmail dot com | Date: | Fri, 21 Apr 2023 08:48:20 +0000 |
| Subject: | Req #81668 [Com]: Implement ED25519 auth for mysqlnd | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-244241@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81668&edit=1
ID: 81668
Comment by: samira dot akhlaqi314 at gmail dot com
Reported by: arnouxguillaume54 at hotmail dot fr
Summary: Implement ED25519 auth for mysqlnd
Status: Open
Type: Feature/Change Request
Package: MySQLi related
Operating System: Windows 11
PHP Version: 8.1.0
Block user comment: N
Private report: N
New Comment:
To implement ED25519 authentication for mysqlnd, you will need to perform the following steps:
Install the libsodium library: ED25519 uses the libsodium library for its implementation, so you
will need to install it on your system if you haven't already done so.
Generate a public/private key pair: You will need to generate a public/private key pair using the
ED25519 algorithm. You can use the sodium_crypto_sign_keypair() function from the libsodium library
to generate the key pair.
Store the public key in MySQL: You will need to store the public key in MySQL so that it can be used
for authentication. You can store it in a dedicated table or in the user table, depending on your
preference.
Modify the client authentication plugin: You will need to modify the client authentication plugin in
mysqlnd to use the ED25519 algorithm for authentication. You can use the
sodium_crypto_sign_detached() function from the libsodium library to sign the authentication data
using the private key, and then compare it with the stored public key to authenticate the user.
(https://www.wyndhamrewards.us/)github.com
Previous Comments:
------------------------------------------------------------------------
[2021-11-29 11:23:54] cmb@php.net
Related To: Bug #81672
------------------------------------------------------------------------
[2021-11-29 11:22:46] cmb@php.net
client_ed25519 is indeed not supported by mysqlnd yet[1].
[1] <https://github.com/php/php-src/blob/php-8.1.0/ext/mysqlnd/mysqlnd_auth.c#L1315-L1326>
------------------------------------------------------------------------
[2021-11-28 21:52:55] williamdes at wdes dot fr
FTR: https://github.com/phpmyadmin/phpmyadmin/issues/17200
------------------------------------------------------------------------
[2021-11-28 13:07:20] arnouxguillaume54 at hotmail dot fr
Description:
------------
Hello,
I opened a request to phpMyAdmin in which I asked them if it was possible to implement the ed25519
authentication method to connect and I got a response informing me that this authentication system
was not implemented in mysqli.
So I made the request here.
Thank you
Test script:
---------------
-- Connect into phpMA with the ed25519 method
Expected result:
----------------
-- Login successfully
Actual result:
--------------
The server requested authentication method unknown to the client [client_ed25519]
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81668&edit=1