Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 1437 → Rev 1438

/trunk/changelog.json.php
3,6 → 3,16
"dummy": "<?php die(base64_decode('IgogICAgfQpdCg==')); /* for security reasons, do not show the current version @phpstan-ignore-line */ ?>"
},
{
"version": "2.0.1.7",
"date": "2023-11-18 21:38:00 +0100",
"author": "Daniel Marschall (ViaThinkSoft)",
"changes": [
"Implemented OID-to-R74n-Multiplane AltID",
"Implemented Microsoft OID-to-UUID AltID",
"Implemented Waterjuice OID-to-UUID AltID"
]
},
{
"version": "2.0.1.6",
"date": "2023-11-16 11:53:00 +0100",
"author": "Daniel Marschall (ViaThinkSoft)",
/trunk/dev/release.sh
24,7 → 24,7
 
DIR=$( dirname "$0" )
 
# 0. Search for SPONGE (why Sponge? See TempleOS)
# 0. Search for SPONGE (Marker invented by Terry A Davis)
echo "0. Checking for forgotten sponges"
grep -r "SPONGE" | grep -v "\.svn/pristine" | grep -v "dev/release.sh"
if [ $? -eq 0 ]; then
/trunk/plugins/viathinksoft/adminPages/902_systemfile_check/OIDplusPageAdminSystemFileCheck.class.php
109,6 → 109,10
# ) || (substr($filename_old, 0, strlen('plugins/')) !== 'plugins/')) &&
 
($filename_old !== 'composer.lock') &&
($filename_old !== 'phpstan.phar') &&
($filename_old !== 'phpstan.neon') &&
($filename_old !== 'phpstan.bat') &&
($filename_old !== 'phpstan.sh') &&
($filename_old !== 'plugins/viathinksoft/adminPages/902_systemfile_check/checksums.json')
){
$num++;
204,6 → 208,10
if (in_array($path,$exclude)) continue;
if (empty($path)) $path = $dir . DIRECTORY_SEPARATOR . $file;
if ($file == 'composer.lock') continue;
if ($file == 'phpstan.phar') continue;
if ($file == 'phpstan.neon') continue;
if ($file == 'phpstan.bat') continue;
if ($file == 'phpstan.sh') continue;
if (!is_dir($path)) {
$xpath = substr($path, strlen($basepath));
$xpath = str_replace('\\', '/', $xpath);
/trunk/plugins/viathinksoft/adminPages/902_systemfile_check/checksums.json
Cannot display: file marked as a binary type.
svn:mime-type = application/json
/trunk/plugins/viathinksoft/language/dede/messages.xml
6286,6 → 6286,14
</message>
<message>
<source><![CDATA[
R74n-Multiplane
]]></source>
<target><![CDATA[
R74n-Multiplane
]]></target>
</message>
<message>
<source><![CDATA[
RA
]]></source>
<target><![CDATA[
/trunk/plugins/viathinksoft/objectTypes/oid/OIDplusOid.class.php
628,7 → 628,35
if ($this->isRoot()) return array();
$ids = parent::getAltIds();
 
// TODO: Also support Waterjuice UUID-to-OID and Microsoft UUID-to-OID
// R74n "Multiplane", see https://r74n.com/multiplane/
// Vendor space:
// [0x2aabb] = 1.3.6.1.4.1.61117.1.[0x2aa00].[0xbb]
// Every other space:
// [0xcaabb] = 1.3.6.1.4.1.61117.1.[0xcaabb]
$multiplane = null;
$tmp_oid = oid_up($this->oid);
for ($i=0; $i<=0xFF; $i++) {
$vid = 0x20000 + ($i<<16);
if ($tmp_oid == '1.3.6.1.4.1.61117.1.'.$vid) {
$j = (int)substr($this->oid,strlen($tmp_oid)+1);
if (($j>=0) && ($j<=0xFF)) {
$xi = str_pad(dechex($i), 2, '0', STR_PAD_LEFT);
$xj = str_pad(dechex($j), 2, '0', STR_PAD_LEFT);
$multiplane = strtoupper('R2'.$xi.$xj);
}
break;
}
}
if ($tmp_oid == '1.3.6.1.4.1.61117.1') {
$ij = (int)substr($this->oid,strlen('1.3.6.1.4.1.61117.1.'));
if ((($ij>=0) && ($ij<=0x1FFFF)) || (($ij>0x30000) && ($ij<=0xFFFFF))) {
$multiplane = strtoupper('R'.str_pad(dechex($ij), 5, '0', STR_PAD_LEFT));
}
}
if (!is_null($multiplane)) {
$ids[] = new OIDplusAltId('r74n-multiplane', $multiplane, _L('R74n-Multiplane'));
}
 
if ($uuid = oid_to_uuid($this->oid)) {
// UUID-OIDs are representation of an UUID
$ids[] = new OIDplusAltId('guid', $uuid, _L('UUID representation of this OID'));
/trunk/vendor/composer/installed.json
392,18 → 392,18
"source": {
"type": "git",
"url": "https://github.com/danielmarschall/uuid_mac_utils.git",
"reference": "499e25760ea87439d4167266d76f01454282639b"
"reference": "e632024d5a60b0b038c321f23569607ea0897908"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/danielmarschall/uuid_mac_utils/zipball/499e25760ea87439d4167266d76f01454282639b",
"reference": "499e25760ea87439d4167266d76f01454282639b",
"url": "https://api.github.com/repos/danielmarschall/uuid_mac_utils/zipball/e632024d5a60b0b038c321f23569607ea0897908",
"reference": "e632024d5a60b0b038c321f23569607ea0897908",
"shasum": ""
},
"require": {
"php": ">=7.0"
},
"time": "2023-11-11T00:22:44+00:00",
"time": "2023-11-18T19:46:37+00:00",
"default-branch": true,
"type": "library",
"installation-source": "dist",
/trunk/vendor/composer/installed.php
95,7 → 95,7
'danielmarschall/uuid_mac_utils' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '499e25760ea87439d4167266d76f01454282639b',
'reference' => 'e632024d5a60b0b038c321f23569607ea0897908',
'type' => 'library',
'install_path' => __DIR__ . '/../danielmarschall/uuid_mac_utils',
'aliases' => array(
/trunk/vendor/danielmarschall/uuid_mac_utils/includes/uuid_utils.inc.php
3,7 → 3,7
/*
* UUID utils for PHP
* Copyright 2011 - 2023 Daniel Marschall, ViaThinkSoft
* Version 2023-11-11
* Version 2023-11-18
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
847,57 → 847,102
return oid_to_uuid(uuid_to_oid($uuid));
}
 
/*
assert(oid_to_uuid('2.25.111325678376819997685911819737516232943')=='53c08bb6-b2eb-5038-bf28-ad41a08c50ef');
assert(oid_to_uuid('1.2.840.113556.1.8000.2554.21440.35766.45803.20536.48936.11354528.9195759')=='53c08bb6-b2eb-5038-bf28-ad41a08c50ef');
assert(oid_to_uuid('1.3.6.1.4.1.54392.1.6034977117478539320.13774449957690691823')=='53c08bb6-b2eb-5038-bf28-ad41a08c50ef');
assert(oid_to_uuid('1.3.6.1.4.1.54392.2.1405127606.3001765944.3207114049.2693550319')=='53c08bb6-b2eb-5038-bf28-ad41a08c50ef');
assert(oid_to_uuid('1.3.6.1.4.1.54392.3.21440.35766.45803.20536.48936.44353.41100.20719')=='53c08bb6-b2eb-5038-bf28-ad41a08c50ef');
*/
function oid_to_uuid($oid) {
// TODO: Also support Non-2.25 base UUID-to-OID
if (!is_uuid_oid($oid,true)) return false;
if (substr($oid,0,1) == '.') $oid = substr($oid, 1); // remove leading dot
 
if (substr($oid,0,1) == '.') {
$oid = substr($oid, 1);
}
// Information about Microsoft and Waterjuice UUID-OID: https://waterjuiceweb.wordpress.com/2019/09/24/guids-to-oids/
 
$ary = explode('.', $oid);
 
if (!isset($ary[2])) return false;
 
if ((count($ary) == 3) && (strpos($oid, '2.25.') === 0)) {
// ISO/ITU-T UUID-to-OID
// Example: {53c08bb6-b2eb-5038-bf28-ad41a08c50ef} = 2.25.111325678376819997685911819737516232943
$val = $ary[2];
 
$x = gmp_init($val, 10);
$y = gmp_strval($x, 16);
$y = str_pad($y, 32, "0", STR_PAD_LEFT);
return substr($y, 0, 8).'-'.
substr($y, 8, 4).'-'.
substr($y, 12, 4).'-'.
substr($y, 16, 4).'-'.
substr($y, 20, 12);
$dec = gmp_init($val, 10);
$hex = gmp_strval($dec, 16);
$hex = str_pad($hex, 32, "0", STR_PAD_LEFT);
return substr($hex,0,8).'-'.substr($hex,8,4).'-'.substr($hex,12,4).'-'.substr($hex,16,4).'-'.substr($hex,20,12);
} else if ((count($ary) == 14) && (strpos($oid, '1.2.840.113556.1.8000.2554.') === 0)) {
// Microsoft UUID-to-OID
// Example: {53c08bb6-b2eb-5038-bf28-ad41a08c50ef} = 1.2.840.113556.1.8000.2554.21440.35766.45803.20536.48936.11354528.9195759
$a = $ary[7];
$b = $ary[8];
$c = $ary[9];
$d = $ary[10];
$e = $ary[11];
$f = $ary[12];
$g = $ary[13];
return dechex($a).dechex($b).'-'.dechex($c).'-'.dechex($d).'-'.dechex($e).'-'.dechex($f).dechex($g);
} else if ((count($ary) == 10) && (strpos($oid, '1.3.6.1.4.1.54392.1.') === 0)) {
// Waterjuice UUID-to-OID 2x64 Bits
// Example: {53c08bb6-b2eb-5038-bf28-ad41a08c50ef} = 1.3.6.1.4.1.54392.1.6034977117478539320.13774449957690691823
$a1 = gmp_strval(gmp_init($ary[8],10),16); if (strlen($a1)>16) return false;
$a2 = gmp_strval(gmp_init($ary[9],10),16); if (strlen($a2)>16) return false;
$hex =
str_pad($a1, 16, "0", STR_PAD_LEFT).
str_pad($a2, 16, "0", STR_PAD_LEFT);
return substr($hex,0,8).'-'.substr($hex,8,4).'-'.substr($hex,12,4).'-'.substr($hex,16,4).'-'.substr($hex,20,12);
} else if ((count($ary) == 12) && (strpos($oid, '1.3.6.1.4.1.54392.2.') === 0)) {
// Waterjuice UUID-to-OID 4x32 Bits
// Example: {53c08bb6-b2eb-5038-bf28-ad41a08c50ef} = 1.3.6.1.4.1.54392.2.1405127606.3001765944.3207114049.2693550319
$a1 = gmp_strval(gmp_init($ary[8],10),16); if (strlen($a1)>8) return false;
$a2 = gmp_strval(gmp_init($ary[9],10),16); if (strlen($a2)>8) return false;
$a3 = gmp_strval(gmp_init($ary[10],10),16); if (strlen($a3)>8) return false;
$a4 = gmp_strval(gmp_init($ary[11],10),16); if (strlen($a4)>8) return false;
$hex =
str_pad($a1, 8, "0", STR_PAD_LEFT).
str_pad($a2, 8, "0", STR_PAD_LEFT).
str_pad($a3, 8, "0", STR_PAD_LEFT).
str_pad($a4, 8, "0", STR_PAD_LEFT);
return substr($hex,0,8).'-'.substr($hex,8,4).'-'.substr($hex,12,4).'-'.substr($hex,16,4).'-'.substr($hex,20,12);
} else if ((count($ary) == 16) && (strpos($oid, '1.3.6.1.4.1.54392.3.') === 0)) {
// Waterjuice UUID-to-OID 8x16 Bits
// Example: {53c08bb6-b2eb-5038-bf28-ad41a08c50ef} = 1.3.6.1.4.1.54392.3.21440.35766.45803.20536.48936.44353.41100.20719
$a1 = gmp_strval(gmp_init($ary[8],10),16); if (strlen($a1)>4) return false;
$a2 = gmp_strval(gmp_init($ary[9],10),16); if (strlen($a2)>4) return false;
$a3 = gmp_strval(gmp_init($ary[10],10),16); if (strlen($a3)>4) return false;
$a4 = gmp_strval(gmp_init($ary[11],10),16); if (strlen($a4)>4) return false;
$a5 = gmp_strval(gmp_init($ary[12],10),16); if (strlen($a5)>4) return false;
$a6 = gmp_strval(gmp_init($ary[13],10),16); if (strlen($a6)>4) return false;
$a7 = gmp_strval(gmp_init($ary[14],10),16); if (strlen($a7)>4) return false;
$a8 = gmp_strval(gmp_init($ary[15],10),16); if (strlen($a8)>4) return false;
$hex =
str_pad($a1, 4, "0", STR_PAD_LEFT).
str_pad($a2, 4, "0", STR_PAD_LEFT).
str_pad($a3, 4, "0", STR_PAD_LEFT).
str_pad($a4, 4, "0", STR_PAD_LEFT).
str_pad($a5, 4, "0", STR_PAD_LEFT).
str_pad($a6, 4, "0", STR_PAD_LEFT).
str_pad($a7, 4, "0", STR_PAD_LEFT).
str_pad($a8, 4, "0", STR_PAD_LEFT);
return substr($hex,0,8).'-'.substr($hex,8,4).'-'.substr($hex,12,4).'-'.substr($hex,16,4).'-'.substr($hex,20,12);
} else {
return false;
}
}
 
function is_uuid_oid($oid, $only_allow_root=false) {
// TODO: Also support Non-2.25 base UUID-to-OID
if (substr($oid,0,1) == '.') $oid = substr($oid, 1); // remove leading dot
 
$ary = explode('.', $oid);
 
if ($only_allow_root) {
if (count($ary) != 3) return false;
return oid_to_uuid($oid) !== false;
} else {
if (count($ary) < 3) return false;
// TODO: Check range of the components (e.g. max 128 bits for 2.25)
if (strpos($oid,'2.25.') === 0) return true;
if (strpos($oid,'1.2.840.113556.1.8000.2554.') === 0) return true;
if (strpos($oid,'1.3.6.1.4.1.54392.1.') === 0) return true;
if (strpos($oid,'1.3.6.1.4.1.54392.2.') === 0) return true;
if (strpos($oid,'1.3.6.1.4.1.54392.3.') === 0) return true;
return false;
}
 
if ($ary[0] != '2') return false;
if ($ary[1] != '25') return false;
for ($i=2; $i<count($ary); $i++) {
$v = $ary[$i];
if (!is_numeric($v)) return false;
if ($i == 2) {
// Must be in the range of 128 bit UUID
$test = gmp_init($v, 10);
if (strlen(gmp_strval($test, 16)) > 32) return false;
}
if ($v < 0) return false;
}
 
return true;
}
 
function uuid_to_oid($uuid, $base='2.25') {
if (!uuid_valid($uuid)) return false;
#$base = oid_sanitize($base);
/trunk/vendor/licenses
16,8 → 16,8
danielmarschall/php-sha3 dev-master 5605bd5 MIT
danielmarschall/php_utils 9999999-dev 06a9716 Apache-2.0
danielmarschall/php_utils dev-master 06a9716 Apache-2.0
danielmarschall/uuid_mac_utils 9999999-dev 499e257 Apache-2.0
danielmarschall/uuid_mac_utils dev-master 499e257 Apache-2.0
danielmarschall/uuid_mac_utils 9999999-dev e632024 Apache-2.0
danielmarschall/uuid_mac_utils dev-master e632024 Apache-2.0
danielmarschall/vnag 9999999-dev 0d4b0b4 Apache-2.0
danielmarschall/vnag dev-master 0d4b0b4 Apache-2.0
dcodeio/bcrypt.js master master BSD-3-Clause, MIT