Skip to content

Commit fe578cf

Browse files
committed
Merge ed25519 authentication into master.
2 parents e4dbf4f + 429fcaf commit fe578cf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+4081
-15
lines changed

.ci/config/config.compression.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"ConnectionString": "server=127.0.0.1;user id=mysqltest;password='test;key=\"val';port=3306;database=mysqltest;ssl mode=none;UseCompression=true;DefaultCommandTimeout=3600",
44
"PasswordlessUser": "no_password",
55
"SecondaryDatabase": "testdb2",
6-
"UnsupportedFeatures": "RsaEncryption,CachingSha2Password,Tls12,UuidToBin",
6+
"UnsupportedFeatures": "Ed25519,RsaEncryption,CachingSha2Password,Tls12,UuidToBin",
77
"MySqlBulkLoaderLocalCsvFile": "../../../../TestData/LoadData_UTF8_BOM_Unix.CSV",
88
"MySqlBulkLoaderLocalTsvFile": "../../../../TestData/LoadData_UTF8_BOM_Unix.TSV"
99
}

.ci/config/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"ConnectionString": "server=127.0.0.1;user id=mysqltest;password='test;key=\"val';port=3306;database=mysqltest;ssl mode=none;DefaultCommandTimeout=3600",
44
"PasswordlessUser": "no_password",
55
"SecondaryDatabase": "testdb2",
6-
"UnsupportedFeatures": "RsaEncryption,CachingSha2Password,Tls12,UuidToBin",
6+
"UnsupportedFeatures": "Ed25519,RsaEncryption,CachingSha2Password,Tls12,UuidToBin",
77
"MySqlBulkLoaderLocalCsvFile": "../../../../TestData/LoadData_UTF8_BOM_Unix.CSV",
88
"MySqlBulkLoaderLocalTsvFile": "../../../../TestData/LoadData_UTF8_BOM_Unix.TSV"
99
}

.ci/docker-run.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ for i in `seq 1 30`; do
6060
if [ $? -ne 0 ]; then continue; fi
6161
fi
6262

63+
if [[ $OMIT_FEATURES != *"Ed25519"* ]]; then
64+
docker exec -it $NAME bash -c 'mysql -uroot -ptest < /etc/mysql/conf.d/init_ed25519.sql' >/dev/null 2>&1
65+
if [ $? -ne 0 ]; then continue; fi
66+
fi
67+
6368
# exit if successful
6469
docker exec -it $NAME mysql -ussltest -ptest \
6570
--ssl-mode=REQUIRED \

.ci/server/init_ed25519.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
INSTALL SONAME 'auth_ed25519';
2+
CREATE USER 'ed25519user'@'%' IDENTIFIED VIA ed25519 USING PASSWORD('Ed255!9');
3+
GRANT ALL PRIVILEGES ON *.* TO 'ed25519user'@'%';

.travis.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,23 @@ services: docker
55
env:
66
- IMAGE=mysql:5.6
77
NAME=mysql
8-
OMIT_FEATURES=Json,Sha256Password,RsaEncryption,LargePackets,CachingSha2Password,SessionTrack,Tls11,Tls12,UuidToBin
8+
OMIT_FEATURES=Ed25519,Json,Sha256Password,RsaEncryption,LargePackets,CachingSha2Password,SessionTrack,Tls11,Tls12,UuidToBin
99
- IMAGE=mysql:5.7
1010
NAME=mysql
11-
OMIT_FEATURES=RsaEncryption,CachingSha2Password,Tls12,UuidToBin
11+
OMIT_FEATURES=Ed25519,RsaEncryption,CachingSha2Password,Tls12,UuidToBin
1212
- IMAGE=mysql:8.0
1313
NAME=mysql
14-
OMIT_FEATURES=None
14+
OMIT_FEATURES=Ed25519
1515
- IMAGE=percona:5.7.22
1616
NAME=percona
17-
OMIT_FEATURES=CachingSha2Password,UuidToBin
17+
OMIT_FEATURES=CachingSha2Password,Ed25519,UuidToBin
1818
- IMAGE=mariadb:10.2
1919
NAME=mariadb
20-
OMIT_FEATURES=Json,Sha256Password,CachingSha2Password,RoundDateTime,UuidToBin
20+
OMIT_FEATURES=Ed25519,Json,Sha256Password,CachingSha2Password,RoundDateTime,UuidToBin
2121
- IMAGE=mariadb:10.3
22+
NAME=mariadb
23+
OMIT_FEATURES=Ed25519,Json,Sha256Password,CachingSha2Password,RoundDateTime,UuidToBin
24+
- IMAGE=mariadb:10.4
2225
NAME=mariadb
2326
OMIT_FEATURES=Json,Sha256Password,CachingSha2Password,RoundDateTime,UuidToBin
2427

MySqlConnector.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MySqlConnector.Logging.Seri
2020
EndProject
2121
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MySqlConnector.Logging.NLog", "src\MySqlConnector.Logging.NLog\MySqlConnector.Logging.NLog.csproj", "{92015BEE-563A-4595-9243-0510D2B8767F}"
2222
EndProject
23+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MySqlConnector.Authentication.Ed25519", "src\MySqlConnector.Authentication.Ed25519\MySqlConnector.Authentication.Ed25519.csproj", "{5DB4FA2E-910B-47CE-B467-F6852104D567}"
24+
EndProject
2325
Global
2426
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2527
Debug|Any CPU = Debug|Any CPU
@@ -62,6 +64,10 @@ Global
6264
{92015BEE-563A-4595-9243-0510D2B8767F}.Debug|Any CPU.Build.0 = Debug|Any CPU
6365
{92015BEE-563A-4595-9243-0510D2B8767F}.Release|Any CPU.ActiveCfg = Release|Any CPU
6466
{92015BEE-563A-4595-9243-0510D2B8767F}.Release|Any CPU.Build.0 = Release|Any CPU
67+
{5DB4FA2E-910B-47CE-B467-F6852104D567}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
68+
{5DB4FA2E-910B-47CE-B467-F6852104D567}.Debug|Any CPU.Build.0 = Debug|Any CPU
69+
{5DB4FA2E-910B-47CE-B467-F6852104D567}.Release|Any CPU.ActiveCfg = Release|Any CPU
70+
{5DB4FA2E-910B-47CE-B467-F6852104D567}.Release|Any CPU.Build.0 = Release|Any CPU
6571
EndGlobalSection
6672
GlobalSection(SolutionProperties) = preSolution
6773
HideSolutionNode = FALSE
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
3+
namespace Chaos.NaCl.Internal.Ed25519Ref10
4+
{
5+
internal struct FieldElement
6+
{
7+
internal int x0;
8+
internal int x1;
9+
internal int x2;
10+
internal int x3;
11+
internal int x4;
12+
internal int x5;
13+
internal int x6;
14+
internal int x7;
15+
internal int x8;
16+
internal int x9;
17+
18+
//public static readonly FieldElement Zero = new FieldElement();
19+
//public static readonly FieldElement One = new FieldElement() { x0 = 1 };
20+
21+
internal FieldElement(params int[] elements)
22+
{
23+
InternalAssert.Assert(elements.Length == 10, "elements.Length != 10");
24+
x0 = elements[0];
25+
x1 = elements[1];
26+
x2 = elements[2];
27+
x3 = elements[3];
28+
x4 = elements[4];
29+
x5 = elements[5];
30+
x6 = elements[6];
31+
x7 = elements[7];
32+
x8 = elements[8];
33+
x9 = elements[9];
34+
}
35+
}
36+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
using System;
2+
3+
namespace Chaos.NaCl.Internal.Ed25519Ref10
4+
{
5+
/*
6+
ge means group element.
7+
8+
Here the group is the set of pairs (x,y) of field elements (see fe.h)
9+
satisfying -x^2 + y^2 = 1 + d x^2y^2
10+
where d = -121665/121666.
11+
12+
Representations:
13+
ge_p2 (projective): (X:Y:Z) satisfying x=X/Z, y=Y/Z
14+
ge_p3 (extended): (X:Y:Z:T) satisfying x=X/Z, y=Y/Z, XY=ZT
15+
ge_p1p1 (completed): ((X:Z),(Y:T)) satisfying x=X/Z, y=Y/T
16+
ge_precomp (Duif): (y+x,y-x,2dxy)
17+
*/
18+
19+
internal struct GroupElementP2
20+
{
21+
public FieldElement X;
22+
public FieldElement Y;
23+
public FieldElement Z;
24+
} ;
25+
26+
internal struct GroupElementP3
27+
{
28+
public FieldElement X;
29+
public FieldElement Y;
30+
public FieldElement Z;
31+
public FieldElement T;
32+
} ;
33+
34+
internal struct GroupElementP1P1
35+
{
36+
public FieldElement X;
37+
public FieldElement Y;
38+
public FieldElement Z;
39+
public FieldElement T;
40+
} ;
41+
42+
internal struct GroupElementPreComp
43+
{
44+
public FieldElement yplusx;
45+
public FieldElement yminusx;
46+
public FieldElement xy2d;
47+
48+
public GroupElementPreComp(FieldElement yplusx, FieldElement yminusx, FieldElement xy2d)
49+
{
50+
this.yplusx = yplusx;
51+
this.yminusx = yminusx;
52+
this.xy2d = xy2d;
53+
}
54+
} ;
55+
}

0 commit comments

Comments
 (0)