From 7120118a5e97477778715ebdc8e4fba548a6dc87 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 5 Mar 2017 16:18:16 +0100 Subject: MDEV-12160 Modern alternative to the SHA1 authentication plugin ED25519 authentication plugin --- plugin/auth_ed25519/common.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 plugin/auth_ed25519/common.h (limited to 'plugin/auth_ed25519/common.h') diff --git a/plugin/auth_ed25519/common.h b/plugin/auth_ed25519/common.h new file mode 100644 index 00000000000..df317535d01 --- /dev/null +++ b/plugin/auth_ed25519/common.h @@ -0,0 +1,32 @@ +/* + Copyright (c) 2017, MariaDB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include + +#include "ref10/api.h" +#include "crypto_sign.h" +#include "crypto_hash_sha256.h" + +#define NONCE_BYTES 32 + +static inline void pw_to_sk_and_pk(const char *pw, size_t pwlen, + unsigned char *sk, unsigned char *pk) +{ + crypto_hash_sha256(sk, pw, pwlen); + crypto_sign_keypair(pk, sk); +} + -- cgit v1.2.1 From e0a03ca30aa6f91daf7ea519a57d85e54dc49927 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 6 Mar 2017 01:27:34 +0100 Subject: ed25519 plugin: simplify the api various ed25519/ref10 api simplifications for our specific use case --- plugin/auth_ed25519/common.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'plugin/auth_ed25519/common.h') diff --git a/plugin/auth_ed25519/common.h b/plugin/auth_ed25519/common.h index df317535d01..77f8699322c 100644 --- a/plugin/auth_ed25519/common.h +++ b/plugin/auth_ed25519/common.h @@ -19,14 +19,5 @@ #include "ref10/api.h" #include "crypto_sign.h" -#include "crypto_hash_sha256.h" #define NONCE_BYTES 32 - -static inline void pw_to_sk_and_pk(const char *pw, size_t pwlen, - unsigned char *sk, unsigned char *pk) -{ - crypto_hash_sha256(sk, pw, pwlen); - crypto_sign_keypair(pk, sk); -} - -- cgit v1.2.1 From f0ec34002a98eeb669cb254eaba6a3d678a58cc1 Mon Sep 17 00:00:00 2001 From: iangilfillan Date: Fri, 10 Feb 2017 13:26:55 +0200 Subject: Correct FSF address --- plugin/auth_ed25519/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugin/auth_ed25519/common.h') diff --git a/plugin/auth_ed25519/common.h b/plugin/auth_ed25519/common.h index 77f8699322c..4a52f7742f5 100644 --- a/plugin/auth_ed25519/common.h +++ b/plugin/auth_ed25519/common.h @@ -12,7 +12,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ #include #include -- cgit v1.2.1