Qr generator create bug fix

This commit is contained in:
lockbitchat
2025-10-08 01:24:04 -04:00
parent 60db79d2ae
commit 75fa1cd27d
7 changed files with 56 additions and 33 deletions

9
dist/app-boot.js vendored
View File

@@ -1807,7 +1807,7 @@ var EnhancedSecureCryptoUtils = class _EnhancedSecureCryptoUtils {
throw new Error("Challenge mismatch - possible replay attack");
}
const responseAge = Date.now() - proof.responseTimestamp;
if (responseAge > 3e5) {
if (responseAge > 18e5) {
throw new Error("Proof response expired");
}
const expectedHash = await _EnhancedSecureCryptoUtils.hashPublicKey(publicKey);
@@ -1966,7 +1966,7 @@ var EnhancedSecureCryptoUtils = class _EnhancedSecureCryptoUtils {
throw new Error("Invalid metadata structure");
}
const messageAge = Date.now() - metadata.timestamp;
if (messageAge > 3e5) {
if (messageAge > 18e5) {
throw new Error("Message expired (older than 5 minutes)");
}
if (expectedSequenceNumber !== null) {
@@ -6566,7 +6566,7 @@ var EnhancedSecureWebRTCManager = class _EnhancedSecureWebRTCManager {
}
const now = Date.now();
const messageAge = now - aad.timestamp;
if (messageAge > 3e5) {
if (messageAge > 18e5) {
throw new Error("AAD timestamp too old - possible replay attack");
}
return aad;
@@ -11226,7 +11226,7 @@ var EnhancedSecureWebRTCManager = class _EnhancedSecureWebRTCManager {
throw new Error("Missing required security fields in offer data \u2013 possible MITM attack");
}
const offerAge = Date.now() - timestamp;
const MAX_OFFER_AGE = 3e5;
const MAX_OFFER_AGE = 18e5;
if (offerAge > MAX_OFFER_AGE) {
this._secureLog("error", "Offer data is too old - possible replay attack", {
operationId,
@@ -13873,7 +13873,6 @@ var SecureMasterKeyManager = class {
this._onPasswordRequired = null;
this._onSessionExpired = null;
this._onUnlocked = null;
this._setupEventListeners();
}
/**
* Set callback for password requests

File diff suppressed because one or more lines are too long

26
dist/app.js vendored
View File

@@ -2429,12 +2429,15 @@ var EnhancedSecureP2PChat = () => {
if (typeof window.encodeBinaryToPrefixed === "function") {
const bin = window.encodeBinaryToPrefixed(offerString);
const TARGET_CHUNKS = 4;
let FRAME_MAX = Math.max(200, Math.floor(bin.length / TARGET_CHUNKS));
let total = TARGET_CHUNKS;
let FRAME_MAX = Math.max(200, Math.ceil(bin.length / TARGET_CHUNKS));
if (FRAME_MAX <= 0) FRAME_MAX = 200;
let total = Math.ceil(bin.length / FRAME_MAX);
if (total < 2) {
total = 2;
FRAME_MAX = Math.ceil(bin.length / 2) || 1;
if (bin.length <= FRAME_MAX) {
total = 1;
FRAME_MAX = bin.length;
} else {
FRAME_MAX = Math.ceil(bin.length / TARGET_CHUNKS);
total = TARGET_CHUNKS;
}
const id = `bin_${Date.now()}_${Math.random().toString(36).slice(2)}`;
const chunks = [];
@@ -2549,12 +2552,15 @@ var EnhancedSecureP2PChat = () => {
if (typeof window.encodeBinaryToPrefixed === "function") {
const bin = window.encodeBinaryToPrefixed(answerString);
const TARGET_CHUNKS = 4;
let FRAME_MAX = Math.max(200, Math.floor(bin.length / TARGET_CHUNKS));
let total = TARGET_CHUNKS;
let FRAME_MAX = Math.max(200, Math.ceil(bin.length / TARGET_CHUNKS));
if (FRAME_MAX <= 0) FRAME_MAX = 200;
let total = Math.ceil(bin.length / FRAME_MAX);
if (total < 2) {
total = 2;
FRAME_MAX = Math.ceil(bin.length / 2) || 1;
if (bin.length <= FRAME_MAX) {
total = 1;
FRAME_MAX = bin.length;
} else {
FRAME_MAX = Math.ceil(bin.length / TARGET_CHUNKS);
total = TARGET_CHUNKS;
}
const id = `ans_${Date.now()}_${Math.random().toString(36).slice(2)}`;
const chunks = [];

4
dist/app.js.map vendored

File diff suppressed because one or more lines are too long