4 Commits

Author SHA1 Message Date
Graham Eades
5b1a1c57df Updated dump.path 2018-11-28 16:09:39 +00:00
Graham Eades
d66e7b9aa5 Updated Frontend templates 2018-11-28 16:08:35 +00:00
Graham Eades
22fb8b0cf9 Update dump php page 2018-11-28 15:54:01 +00:00
Graham Eades
29ebc61627 Fix offline password authentication 2018-11-28 14:48:07 +00:00
8 changed files with 45 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
{ {
"request.path": "../index.php", "request.path": "../index.php",
"dump.path": "../dump.php", "dump.path": "/../dump.php?frontend=",
"should.pay.toll": "false" "should.pay.toll": "false"
} }

View File

@@ -11,7 +11,22 @@ header('Content-Disposition: attachment; filename=Clipperz_'.date("Ymd").'.html'
include "./objects/class.onetimepassword.php"; include "./objects/class.onetimepassword.php";
include "./objects/class.onetimepasswordstatus.php"; include "./objects/class.onetimepasswordstatus.php";
$htmlContent = file_get_contents("../index.html"); //$htmlContent = file_get_contents("../index.html");
switch ($_GET["frontend"]) {
case 'beta':
$htmlContent = file_get_contents("beta/index.html");
break;
case 'gamma':
$htmlContent = file_get_contents("gamma/index.html");
break;
case 'delta':
$htmlContent = file_get_contents("delta/index.html");
break;
default:
exit ("Invalid Frontend");
}
session_start(); session_start();
@@ -100,4 +115,4 @@ header('Content-Disposition: attachment; filename=Clipperz_'.date("Ymd").'.html'
session_write_close(); session_write_close();
echo str_replace("/*offline_data_placeholder*/", $data, $htmlContent); echo str_replace("/*offline_data_placeholder*/", $data, $htmlContent);
?> ?>

View File

@@ -13,7 +13,7 @@
<script> <script>
Clipperz_IEisBroken = false; Clipperz_IEisBroken = false;
Clipperz_normalizedNewLine = '\n'; Clipperz_normalizedNewLine = '\n';
Clipperz_dumpUrl = "@dump.path@/beta"; Clipperz_dumpUrl = "@dump.path@beta";
</script> </script>
<!--[if IE]><script> <!--[if IE]><script>

View File

@@ -354,7 +354,8 @@ Clipperz.PM.Proxy.Offline.DataStore.prototype = MochiKit.Base.update(null, {
this.set_C(someParameters.parameters.C); this.set_C(someParameters.parameters.C);
this.set_b(new Clipperz.Crypto.BigInt(randomBytes, 16)); this.set_b(new Clipperz.Crypto.BigInt(randomBytes, 16));
v = new Clipperz.Crypto.BigInt(this.userData()['v'], 16); v = new Clipperz.Crypto.BigInt(this.userData()['v'], 16);
this.set_B((Clipperz.Crypto.SRP.k().multiply(v)).add(Clipperz.Crypto.SRP.g().powerModule(this.b(), Clipperz.Crypto.SRP.n()))); //this.set_B((Clipperz.Crypto.SRP.k().multiply(v)).add(Clipperz.Crypto.SRP.g().powerModule(this.b(), Clipperz.Crypto.SRP.n())));
this.set_B((Clipperz.Crypto.SRP.k().multiply(v)).add(Clipperz.Crypto.SRP.g().powerModule(this.b(), Clipperz.Crypto.SRP.n())).module(Clipperz.Crypto.SRP.n()));
this.set_A(someParameters.parameters.A); this.set_A(someParameters.parameters.A);
@@ -363,7 +364,7 @@ Clipperz.PM.Proxy.Offline.DataStore.prototype = MochiKit.Base.update(null, {
nextTollRequestType = 'CONNECT'; nextTollRequestType = 'CONNECT';
} else if (someParameters.message == "credentialCheck") { } else if (someParameters.message == "credentialCheck") {
var v, u, s, S, A, K, M1; var v, u, s, S, A, K, M1, KK;
var stringHash = function (aValue) { var stringHash = function (aValue) {
return Clipperz.PM.Crypto.encryptingFunctions.versions[someParameters.version].hash(new Clipperz.ByteArray(aValue)).toHexString().substring(2); return Clipperz.PM.Crypto.encryptingFunctions.versions[someParameters.version].hash(new Clipperz.ByteArray(aValue)).toHexString().substring(2);
}; };
@@ -373,9 +374,11 @@ Clipperz.PM.Proxy.Offline.DataStore.prototype = MochiKit.Base.update(null, {
A = new Clipperz.Crypto.BigInt(this.A(), 16); A = new Clipperz.Crypto.BigInt(this.A(), 16);
u = new Clipperz.Crypto.BigInt(Clipperz.PM.Crypto.encryptingFunctions.versions[someParameters.version].hash(new Clipperz.ByteArray(A.asString(10) + this.B().asString(10))).toHexString(), 16); u = new Clipperz.Crypto.BigInt(Clipperz.PM.Crypto.encryptingFunctions.versions[someParameters.version].hash(new Clipperz.ByteArray(A.asString(10) + this.B().asString(10))).toHexString(), 16);
s = new Clipperz.Crypto.BigInt(this.userData()['s'], 16); s = new Clipperz.Crypto.BigInt(this.userData()['s'], 16);
S = (A.multiply(v.powerModule(u, Clipperz.Crypto.SRP.n()))).powerModule(this.b(), Clipperz.Crypto.SRP.n()); //S = (A.multiply(v.powerModule(u, Clipperz.Crypto.SRP.n()))).powerModule(this.b(), Clipperz.Crypto.SRP.n());
S = v.powerModule(u, Clipperz.Crypto.SRP.n()).multiply(A).module(Clipperz.Crypto.SRP.n()).powerModule(this.b(), Clipperz.Crypto.SRP.n())
K = stringHash(S.asString(10)); K = stringHash(S.asString(10));
KK = new Clipperz.Crypto.BigInt(K,16);
M1 = stringHash( M1 = stringHash(
"597626870978286801440197562148588907434001483655788865609375806439877501869636875571920406529" + "597626870978286801440197562148588907434001483655788865609375806439877501869636875571920406529" +
@@ -383,7 +386,7 @@ Clipperz.PM.Proxy.Offline.DataStore.prototype = MochiKit.Base.update(null, {
s.asString(10) + s.asString(10) +
A.asString(10) + A.asString(10) +
this.B().asString(10) + this.B().asString(10) +
K KK.asString(10)
); );
if (someParameters.parameters.M1 == M1) { if (someParameters.parameters.M1 == M1) {
var M2; var M2;
@@ -823,4 +826,4 @@ Clipperz.PM.Proxy.Offline.DataStore.prototype = MochiKit.Base.update(null, {
Clipperz.PM.Proxy.Offline.DataStore['exception'] = { Clipperz.PM.Proxy.Offline.DataStore['exception'] = {
'ReadOnly': new MochiKit.Base.NamedError("Clipperz.PM.Proxy.Offline.DataStore.exception.ReadOnly") 'ReadOnly': new MochiKit.Base.NamedError("Clipperz.PM.Proxy.Offline.DataStore.exception.ReadOnly")
}; };

View File

@@ -41,7 +41,7 @@
// Clipperz_IEisBroken = false; // Clipperz_IEisBroken = false;
// Clipperz_normalizedNewLine = '\n'; // Clipperz_normalizedNewLine = '\n';
MochiKit = {}; MochiKit.__export__ = false; MochiKit = {}; MochiKit.__export__ = false;
Clipperz_dumpUrl = "@dump.path@/delta"; Clipperz_dumpUrl = "@dump.path@delta";
Clipperz_version = "@application.version@"; Clipperz_version = "@application.version@";
Clipperz_PM_UI_availableStyles = ['extra-short', 'narrow', 'wide', 'extra-wide']; Clipperz_PM_UI_availableStyles = ['extra-short', 'narrow', 'wide', 'extra-wide'];
"use strict"; "use strict";

View File

@@ -434,7 +434,8 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
randomBytes = Clipperz.Crypto.Base.generateRandomSeed(); randomBytes = Clipperz.Crypto.Base.generateRandomSeed();
aConnection['b'] = new Clipperz.Crypto.BigInt(randomBytes, 16); aConnection['b'] = new Clipperz.Crypto.BigInt(randomBytes, 16);
v = new Clipperz.Crypto.BigInt(aConnection['userData']['v'], 16); v = new Clipperz.Crypto.BigInt(aConnection['userData']['v'], 16);
aConnection['B'] = (Clipperz.Crypto.SRP.k().multiply(v)).add(Clipperz.Crypto.SRP.g().powerModule(aConnection['b'], Clipperz.Crypto.SRP.n())); //aConnection['B'] = (Clipperz.Crypto.SRP.k().multiply(v)).add(Clipperz.Crypto.SRP.g().powerModule(aConnection['b'], Clipperz.Crypto.SRP.n()));
aConnection['B'] = ((Clipperz.Crypto.SRP.k().multiply(v)).add(Clipperz.Crypto.SRP.g().powerModule(aConnection['b'], Clipperz.Crypto.SRP.n())).module(Clipperz.Crypto.SRP.n()));
aConnection['A'] = someParameters.parameters.A; aConnection['A'] = someParameters.parameters.A;
@@ -443,7 +444,7 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
nextTollRequestType = 'CONNECT'; nextTollRequestType = 'CONNECT';
} else if (someParameters.message == "credentialCheck") { } else if (someParameters.message == "credentialCheck") {
var v, u, s, S, A, K, M1; var v, u, s, S, A, K, M1, KK;
var stringHash = function (aValue) { var stringHash = function (aValue) {
return Clipperz.PM.Crypto.encryptingFunctions.versions[someParameters.version].hash(new Clipperz.ByteArray(aValue)).toHexString().substring(2); return Clipperz.PM.Crypto.encryptingFunctions.versions[someParameters.version].hash(new Clipperz.ByteArray(aValue)).toHexString().substring(2);
}; };
@@ -452,9 +453,11 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
A = new Clipperz.Crypto.BigInt(aConnection['A'], 16); A = new Clipperz.Crypto.BigInt(aConnection['A'], 16);
u = new Clipperz.Crypto.BigInt(Clipperz.PM.Crypto.encryptingFunctions.versions[someParameters.version].hash(new Clipperz.ByteArray(A.asString(10) + aConnection['B'].asString(10))).toHexString(), 16); u = new Clipperz.Crypto.BigInt(Clipperz.PM.Crypto.encryptingFunctions.versions[someParameters.version].hash(new Clipperz.ByteArray(A.asString(10) + aConnection['B'].asString(10))).toHexString(), 16);
s = new Clipperz.Crypto.BigInt(aConnection['userData']['s'], 16); s = new Clipperz.Crypto.BigInt(aConnection['userData']['s'], 16);
S = (A.multiply(v.powerModule(u, Clipperz.Crypto.SRP.n()))).powerModule(aConnection['b'], Clipperz.Crypto.SRP.n()); //S = (A.multiply(v.powerModule(u, Clipperz.Crypto.SRP.n()))).powerModule(aConnection['b'], Clipperz.Crypto.SRP.n());
S = v.powerModule(u, Clipperz.Crypto.SRP.n()).multiply(A).module(Clipperz.Crypto.SRP.n()).powerModule(aConnection['b'], Clipperz.Crypto.SRP.n());
K = stringHash(S.asString(10)); K = stringHash(S.asString(10));
KK = new Clipperz.Crypto.BigInt(K,16);
M1 = stringHash( M1 = stringHash(
"597626870978286801440197562148588907434001483655788865609375806439877501869636875571920406529" + "597626870978286801440197562148588907434001483655788865609375806439877501869636875571920406529" +
@@ -462,7 +465,7 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
s.asString(10) + s.asString(10) +
A.asString(10) + A.asString(10) +
aConnection['B'].asString(10) + aConnection['B'].asString(10) +
K KK.asString(10)
); );
if (someParameters.parameters.M1 == M1) { if (someParameters.parameters.M1 == M1) {
var M2; var M2;
@@ -1047,4 +1050,4 @@ Clipperz.PM.Proxy.Offline.DataStore.defaultAccountInfo = {
'referenceDate': 'Fri, 03 April 2015 08:17:46 UTC', 'referenceDate': 'Fri, 03 April 2015 08:17:46 UTC',
'isExpired': false, 'isExpired': false,
'expirationDate': 'Mon, 01 January 4001 00:00:00 UTC' 'expirationDate': 'Mon, 01 January 4001 00:00:00 UTC'
}; };

View File

@@ -13,7 +13,7 @@
<script> <script>
Clipperz_IEisBroken = false; Clipperz_IEisBroken = false;
Clipperz_normalizedNewLine = '\n'; Clipperz_normalizedNewLine = '\n';
Clipperz_dumpUrl = "@dump.path@/gamma"; Clipperz_dumpUrl = "@dump.path@gamma";
Clipperz_version = "@application.version@"; Clipperz_version = "@application.version@";
"use strict"; "use strict";
</script> </script>

View File

@@ -329,7 +329,8 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
randomBytes = Clipperz.Crypto.Base.generateRandomSeed(); randomBytes = Clipperz.Crypto.Base.generateRandomSeed();
aConnection['b'] = new Clipperz.Crypto.BigInt(randomBytes, 16); aConnection['b'] = new Clipperz.Crypto.BigInt(randomBytes, 16);
v = new Clipperz.Crypto.BigInt(aConnection['userData']['v'], 16); v = new Clipperz.Crypto.BigInt(aConnection['userData']['v'], 16);
aConnection['B'] = (Clipperz.Crypto.SRP.k().multiply(v)).add(Clipperz.Crypto.SRP.g().powerModule(aConnection['b'], Clipperz.Crypto.SRP.n())); //aConnection['B'] = (Clipperz.Crypto.SRP.k().multiply(v)).add(Clipperz.Crypto.SRP.g().powerModule(aConnection['b'], Clipperz.Crypto.SRP.n()));
aConnection['B'] = ((Clipperz.Crypto.SRP.k().multiply(v)).add(Clipperz.Crypto.SRP.g().powerModule(aConnection['b'], Clipperz.Crypto.SRP.n())).module(Clipperz.Crypto.SRP.n()));
aConnection['A'] = someParameters.parameters.A; aConnection['A'] = someParameters.parameters.A;
@@ -338,7 +339,7 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
nextTollRequestType = 'CONNECT'; nextTollRequestType = 'CONNECT';
} else if (someParameters.message == "credentialCheck") { } else if (someParameters.message == "credentialCheck") {
var v, u, s, S, A, K, M1; var v, u, s, S, A, K, M1, KK;
var stringHash = function (aValue) { var stringHash = function (aValue) {
return Clipperz.PM.Crypto.encryptingFunctions.versions[someParameters.version].hash(new Clipperz.ByteArray(aValue)).toHexString().substring(2); return Clipperz.PM.Crypto.encryptingFunctions.versions[someParameters.version].hash(new Clipperz.ByteArray(aValue)).toHexString().substring(2);
}; };
@@ -347,9 +348,11 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
A = new Clipperz.Crypto.BigInt(aConnection['A'], 16); A = new Clipperz.Crypto.BigInt(aConnection['A'], 16);
u = new Clipperz.Crypto.BigInt(Clipperz.PM.Crypto.encryptingFunctions.versions[someParameters.version].hash(new Clipperz.ByteArray(A.asString(10) + aConnection['B'].asString(10))).toHexString(), 16); u = new Clipperz.Crypto.BigInt(Clipperz.PM.Crypto.encryptingFunctions.versions[someParameters.version].hash(new Clipperz.ByteArray(A.asString(10) + aConnection['B'].asString(10))).toHexString(), 16);
s = new Clipperz.Crypto.BigInt(aConnection['userData']['s'], 16); s = new Clipperz.Crypto.BigInt(aConnection['userData']['s'], 16);
S = (A.multiply(v.powerModule(u, Clipperz.Crypto.SRP.n()))).powerModule(aConnection['b'], Clipperz.Crypto.SRP.n()); //S = (A.multiply(v.powerModule(u, Clipperz.Crypto.SRP.n()))).powerModule(aConnection['b'], Clipperz.Crypto.SRP.n());
S = v.powerModule(u, Clipperz.Crypto.SRP.n()).multiply(A).module(Clipperz.Crypto.SRP.n()).powerModule(aConnection['b'], Clipperz.Crypto.SRP.n());
K = stringHash(S.asString(10)); K = stringHash(S.asString(10));
KK = new Clipperz.Crypto.BigInt(K,16);
M1 = stringHash( M1 = stringHash(
"597626870978286801440197562148588907434001483655788865609375806439877501869636875571920406529" + "597626870978286801440197562148588907434001483655788865609375806439877501869636875571920406529" +
@@ -357,7 +360,7 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
s.asString(10) + s.asString(10) +
A.asString(10) + A.asString(10) +
aConnection['B'].asString(10) + aConnection['B'].asString(10) +
K KK.asString(10)
); );
if (someParameters.parameters.M1 == M1) { if (someParameters.parameters.M1 == M1) {
var M2; var M2;
@@ -800,4 +803,4 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
Clipperz.PM.Proxy.Offline.DataStore['exception'] = { Clipperz.PM.Proxy.Offline.DataStore['exception'] = {
'ReadOnly': new MochiKit.Base.NamedError("Clipperz.PM.Proxy.Offline.DataStore.exception.ReadOnly") 'ReadOnly': new MochiKit.Base.NamedError("Clipperz.PM.Proxy.Offline.DataStore.exception.ReadOnly")
}; };