8 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
Graham Eades
083a6a5cea Fixed new login with empty records 2017-05-27 14:50:05 +01:00
Graham Eades
a2a216f9c9 Check for NULL in value 2017-05-27 14:36:17 +01:00
Graham Eades
3df61ed87a Fixed POG 2017-05-27 11:24:07 +01:00
Graham Eades
63f5452107 Updated to use mysqli 2017-05-20 10:47:53 +01:00
13 changed files with 91 additions and 64 deletions

View File

@@ -1,5 +1,5 @@
{
"request.path": "../index.php",
"dump.path": "../dump.php",
"dump.path": "/../dump.php?frontend=",
"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.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();

View File

@@ -409,7 +409,11 @@ error_log("message");
$recordStats["updateDate"] = $record->update_date;
$recordsStats[$record->reference] = $recordStats;
}
$result["recordsStats"] = $recordsStats;
if ( isset( $recordsStats ) ) {
$result["recordsStats"] = $recordsStats;
} else {
$result["recordsStats"] = NULL;
}
$result["statistics"] = $user->statistics;
$result["version"] = $user->version;
@@ -543,7 +547,11 @@ error_log("message");
$user->Save();
$recordToDeleteReferenceList = $parameters["parameters"]["records"]["deleted"];
if (isset( $parameters["parameters"]["records"]["deleted"] ) ) {
$recordToDeleteReferenceList = $parameters["parameters"]["records"]["deleted"];
} else {
$recordToDeleteReferenceList = NULL;
}
$recordList = array();
$c = count($recordToDeleteReferenceList);
for ($i=0; $i<$c; $i++) {

View File

@@ -17,17 +17,10 @@
$databaseUser = $GLOBALS['configuration']['user'];
$databasePassword = $GLOBALS['configuration']['pass'];
$databasePort = $GLOBALS['configuration']['port'];
$this->connection = mysql_connect ($serverName.":".$databasePort, $databaseUser, $databasePassword);
if ($this->connection)
$this->connection = mysqli_connect ($serverName, $databaseUser, $databasePassword , $databaseName, $databasePort);
if (!$this->connection)
{
if (!mysql_select_db ($databaseName))
{
throw new Exception('I cannot find the specified database "'.$databaseName.'". Please edit configuration.php.');
}
}
else
{
throw new Exception('I cannot connect to the database. Please edit configuration.php with your database configuration.');
throw new Exception('I cannot find the specified database "'.$databaseName.'". Please edit configuration.php.');
}
}
@@ -43,19 +36,19 @@
public static function Reader($query, $connection)
{
$cursor = mysql_query($query, $connection);
$cursor = mysqli_query($connection, $query);
return $cursor;
}
public static function Read($cursor)
{
return mysql_fetch_assoc($cursor);
return mysqli_fetch_assoc($cursor);
}
public static function NonQuery($query, $connection)
{
mysql_query($query, $connection);
$result = mysql_affected_rows($connection);
mysqli_query($connection, $query);
$result = mysqli_affected_rows($connection);
if ($result == -1)
{
return false;
@@ -66,14 +59,14 @@
public static function Query($query, $connection)
{
$result = mysql_query($query, $connection);
return mysql_num_rows($result);
$result = mysqli_query($connection, $query);
return mysqli_num_rows($result);
}
public static function InsertOrUpdate($query, $connection)
{
$result = mysql_query($query, $connection);
return intval(mysql_insert_id($connection));
$result = mysqli_query($connection, $query);
return intval(mysqli_insert_id($connection));
}
}
?>

View File

@@ -92,10 +92,10 @@ class POG_Base
return $objectList;
}
private function CreateObjects($mysql_result, $objectClass, $lazyLoad = true)
private function CreateObjects($mysqli_result, $objectClass, $lazyLoad = true)
{
$objectList = array();
while ($row = mysql_fetch_assoc($mysql_result))
while ($row = mysqli_fetch_assoc($mysqli_result))
{
$pog_object = new $objectClass();
$this->PopulateObjectAttributes($row, $pog_object);

View File

@@ -164,24 +164,26 @@ if(count($_POST) > 0 && $_SESSION['diagnosticsSuccessful']==false)
if ($errors == 0)
{
AddTrace('File Structure....OK!');
if (!mysql_connect ($GLOBALS['configuration']['host'].":".$GLOBALS['configuration']['port'], $GLOBALS['configuration']['user'], $GLOBALS['configuration']['pass']))
#if (!mysql_connect ($GLOBALS['configuration']['host'].":".$GLOBALS['configuration']['port'], $GLOBALS['configuration']['user'], $GLOBALS['configuration']['pass']))
if (!mysqli_connect ($GLOBALS['configuration']['host'], $GLOBALS['configuration']['user'], $GLOBALS['configuration']['pass'],$GLOBALS['configuration']['db'], $GLOBALS['configuration']['port']))
{
$errors++;
AddError('Cannot connect to the specified database server. Edit configuration.php');
AddError('Cannot find the specified database "'.$GLOBALS['configuration']['db'].'". Edit configuration.php');
}
if (isset($GLOBALS['configuration']['db_encoding']) && $GLOBALS['configuration']['db_encoding'] == 1 && !Base64::IsBase64FunctionInstalled())
{
$errors++;
AddError('$configuration[db_encoding] needs to be set to 0 until you install the base64 plugin. Set db_encoding to 0 by editing configuration.php, run setup again and go to the "Manage Plugins" tab. Install the base64 plugin. Then you can set db_encoding = 1');
}
if ($errors == 0)
{
if (!@mysql_select_db ($GLOBALS['configuration']['db']))
{
$errors++;
AddError('Cannot find the specified database "'.$GLOBALS['configuration']['db'].'". Edit configuration.php');
}
}
# if ($errors == 0)
# {
# if (!@mysql_select_db ($GLOBALS['configuration']['db']))
# {
# $errors++;
# AddError('Cannot find the specified database "'.$GLOBALS['configuration']['db'].'". Edit configuration.php');
# }
# }
}
/**

View File

@@ -276,10 +276,10 @@
{
$link = '';
$content = file_get_contents($objectFilePath);
$contentParts = split("<b>",$content);
$contentParts = explode("<b>",$content);
if (isset($contentParts[1]))
{
$contentParts2 = split("</b>",$contentParts[1]);
$contentParts2 = explode("</b>",$contentParts[1]);
}
if (isset($contentParts2[0]))
{
@@ -287,8 +287,8 @@
}
if (isset($className))
{
$linkParts1 = split("\*\/", $contentParts[1]);
$linkParts2 = split("\@link", $linkParts1[0]);
$linkParts1 = explode("\*\/", $contentParts[1]);
$linkParts2 = explode("\@link", $linkParts1[0]);
if (isset($linkParts2[1]))
{
$link = $linkParts2[1];
@@ -313,10 +313,10 @@
function GetObjectName($objectFilePath)
{
$content = file_get_contents($objectFilePath);
$contentParts = split("<b>",$content);
$contentParts = explode("<b>",$content);
if (isset($contentParts[1]))
{
$contentParts2 = split("</b>",$contentParts[1]);
$contentParts2 = explode("</b>",$contentParts[1]);
}
if (isset($contentParts2[0]))
{
@@ -593,10 +593,10 @@
//extract sql
$content = file_get_contents($objectFilePath);
$contentParts = split("<b>",$content);
$contentParts = explode("<b>",$content);
if (isset($contentParts[1]))
{
$contentParts2 = split("</b>",$contentParts[1]);
$contentParts2 = explode("</b>",$contentParts[1]);
}
if (isset($contentParts2[0]))
{
@@ -604,8 +604,8 @@
}
if (isset($className))
{
$sqlParts = split(";",$contentParts[0]);
$sqlPart = split("CREATE",$sqlParts[0]);
$sqlParts = explode(";",$contentParts[0]);
$sqlPart = explode("CREATE",$sqlParts[0]);
$sql = "CREATE ".$sqlPart[1].";";
//execute sql

View File

@@ -13,7 +13,7 @@
<script>
Clipperz_IEisBroken = false;
Clipperz_normalizedNewLine = '\n';
Clipperz_dumpUrl = "@dump.path@/beta";
Clipperz_dumpUrl = "@dump.path@beta";
</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_b(new Clipperz.Crypto.BigInt(randomBytes, 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);
@@ -363,7 +364,7 @@ Clipperz.PM.Proxy.Offline.DataStore.prototype = MochiKit.Base.update(null, {
nextTollRequestType = 'CONNECT';
} 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) {
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);
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 = (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));
KK = new Clipperz.Crypto.BigInt(K,16);
M1 = stringHash(
"597626870978286801440197562148588907434001483655788865609375806439877501869636875571920406529" +
@@ -383,7 +386,7 @@ Clipperz.PM.Proxy.Offline.DataStore.prototype = MochiKit.Base.update(null, {
s.asString(10) +
A.asString(10) +
this.B().asString(10) +
K
KK.asString(10)
);
if (someParameters.parameters.M1 == M1) {
var M2;

View File

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

View File

@@ -434,7 +434,8 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
randomBytes = Clipperz.Crypto.Base.generateRandomSeed();
aConnection['b'] = new Clipperz.Crypto.BigInt(randomBytes, 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;
@@ -443,7 +444,7 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
nextTollRequestType = 'CONNECT';
} 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) {
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);
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 = (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));
KK = new Clipperz.Crypto.BigInt(K,16);
M1 = stringHash(
"597626870978286801440197562148588907434001483655788865609375806439877501869636875571920406529" +
@@ -462,7 +465,7 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
s.asString(10) +
A.asString(10) +
aConnection['B'].asString(10) +
K
KK.asString(10)
);
if (someParameters.parameters.M1 == M1) {
var M2;

View File

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

View File

@@ -329,7 +329,8 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
randomBytes = Clipperz.Crypto.Base.generateRandomSeed();
aConnection['b'] = new Clipperz.Crypto.BigInt(randomBytes, 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;
@@ -338,7 +339,7 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
nextTollRequestType = 'CONNECT';
} 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) {
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);
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 = (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));
KK = new Clipperz.Crypto.BigInt(K,16);
M1 = stringHash(
"597626870978286801440197562148588907434001483655788865609375806439877501869636875571920406529" +
@@ -357,7 +360,7 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
s.asString(10) +
A.asString(10) +
aConnection['B'].asString(10) +
K
KK.asString(10)
);
if (someParameters.parameters.M1 == M1) {
var M2;