mirror of
https://github.com/Ylianst/MeshCommander
synced 2025-12-06 06:03:20 +00:00
IDE-Redirect improvements.
This commit is contained in:
@@ -25,10 +25,10 @@ function amtcert_linkCertPrivateKey(certs, keys) {
|
|||||||
|
|
||||||
// Check which key pair matches the public key in the certificate
|
// Check which key pair matches the public key in the certificate
|
||||||
function amtcert_linkCertPrivateKey(certs, keys) {
|
function amtcert_linkCertPrivateKey(certs, keys) {
|
||||||
|
if ((keys == null) || (keys.length == 0)) return;
|
||||||
for (var i in certs) {
|
for (var i in certs) {
|
||||||
var cert = certs[i];
|
var cert = certs[i];
|
||||||
try {
|
try {
|
||||||
if (keys.length == 0) return;
|
|
||||||
var publicKeyPEM = forge.pki.publicKeyToPem(forge.pki.certificateFromAsn1(forge.asn1.fromDer(cert.X509Certificate)).publicKey).substring(28 + 32).replace(/(\r\n|\n|\r)/gm, "");
|
var publicKeyPEM = forge.pki.publicKeyToPem(forge.pki.certificateFromAsn1(forge.asn1.fromDer(cert.X509Certificate)).publicKey).substring(28 + 32).replace(/(\r\n|\n|\r)/gm, "");
|
||||||
publicKeyPEM = publicKeyPEM.substring(0, publicKeyPEM.length - 24); // Remove the PEM footer
|
publicKeyPEM = publicKeyPEM.substring(0, publicKeyPEM.length - 24); // Remove the PEM footer
|
||||||
for (var j = 0; j < keys.length; j++) {
|
for (var j = 0; j < keys.length; j++) {
|
||||||
|
|||||||
@@ -64,6 +64,9 @@ var CreateAmtRemoteIder = function () {
|
|||||||
var IDE_ModeSence_Ls120Error_Recovery_Array = String.fromCharCode(0x00, 0x12, 0x31, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0A, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00);
|
var IDE_ModeSence_Ls120Error_Recovery_Array = String.fromCharCode(0x00, 0x12, 0x31, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0A, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00);
|
||||||
var IDE_ModeSence_CDError_Recovery_Array = String.fromCharCode(0x00, 0x0E, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00);
|
var IDE_ModeSence_CDError_Recovery_Array = String.fromCharCode(0x00, 0x0E, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00);
|
||||||
|
|
||||||
|
// CD info and performance
|
||||||
|
var RD_CD_DiskInfo = String.fromCharCode(0x00, 0x20, 0x0e, 0x01, 0x01, 0x01, 0x01, 0x20, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||||
|
var RD_CD_Performance = String.fromCharCode(0x00, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x00);
|
||||||
|
|
||||||
// Private method, called by parent when it change state
|
// Private method, called by parent when it change state
|
||||||
obj.xxStateChange = function (newstate) {
|
obj.xxStateChange = function (newstate) {
|
||||||
@@ -629,6 +632,12 @@ var CreateAmtRemoteIder = function () {
|
|||||||
obj.SendDataToHost(dev, true, r, featureRegister & 1);
|
obj.SendDataToHost(dev, true, r, featureRegister & 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 0x51: // READ_DISK_INFORMATION
|
||||||
|
obj.SendDataToHost(dev, true, RD_CD_DiskInfo, featureRegister & 1);
|
||||||
|
break;
|
||||||
|
case 0xAC: // GET_PERFORMANCE
|
||||||
|
obj.SendDataToHost(dev, true, RD_CD_Performance, featureRegister & 1);
|
||||||
|
break;
|
||||||
default: // UNKNOWN COMMAND
|
default: // UNKNOWN COMMAND
|
||||||
// ###BEGIN###{IDERDebug}
|
// ###BEGIN###{IDERDebug}
|
||||||
debug('IDER: Unknown SCSI command', cdb.charCodeAt(0));
|
debug('IDER: Unknown SCSI command', cdb.charCodeAt(0));
|
||||||
|
|||||||
@@ -127,9 +127,6 @@ var CreateAmtRedirect = function (module, authCookie) {
|
|||||||
cmdsize = 9 + authDataLen;
|
cmdsize = 9 + authDataLen;
|
||||||
// ###BEGIN###{!Mode-Firmware}
|
// ###BEGIN###{!Mode-Firmware}
|
||||||
if (authType == 0) {
|
if (authType == 0) {
|
||||||
|
|
||||||
console.log('aaa', authData);
|
|
||||||
|
|
||||||
// Query
|
// Query
|
||||||
if (authData.indexOf(4) >= 0) {
|
if (authData.indexOf(4) >= 0) {
|
||||||
// Good Digest Auth (With cnonce and all)
|
// Good Digest Auth (With cnonce and all)
|
||||||
|
|||||||
Reference in New Issue
Block a user