fixed unsafe array access in component
This commit is contained in:
@@ -28,15 +28,14 @@ export const Security = () => {
|
|||||||
privateKey: fromByteArray(config.security?.privateKey ?? new Uint8Array(0)),
|
privateKey: fromByteArray(config.security?.privateKey ?? new Uint8Array(0)),
|
||||||
privateKeyVisible: false,
|
privateKeyVisible: false,
|
||||||
adminKeyVisible: false,
|
adminKeyVisible: false,
|
||||||
privateKeyBitCount: config.security?.privateKey.length ?? 32,
|
privateKeyBitCount: config.security?.privateKey?.length ?? 32,
|
||||||
adminKeyBitCount: config.security?.adminKey.at(0).length ?? 32,
|
adminKeyBitCount: config.security?.adminKey?.at(0)?.length ?? 32,
|
||||||
publicKey: fromByteArray(config.security?.publicKey ?? new Uint8Array(0)),
|
publicKey: fromByteArray(config.security?.publicKey ?? new Uint8Array(0)),
|
||||||
adminKey: fromByteArray(
|
adminKey: fromByteArray(
|
||||||
config.security?.adminKey.at(0) ?? new Uint8Array(0),
|
config.security?.adminKey?.at(0) ?? new Uint8Array(0),
|
||||||
),
|
),
|
||||||
privateKeyDialogOpen: false,
|
privateKeyDialogOpen: false,
|
||||||
});
|
});
|
||||||
console.log(config.security.adminKey);
|
|
||||||
|
|
||||||
const validateKey = (
|
const validateKey = (
|
||||||
input: string,
|
input: string,
|
||||||
@@ -242,7 +241,7 @@ export const Security = () => {
|
|||||||
? getErrorMessage("adminKey")
|
? getErrorMessage("adminKey")
|
||||||
: "",
|
: "",
|
||||||
inputChange: adminKeyInputChangeEvent,
|
inputChange: adminKeyInputChangeEvent,
|
||||||
selectChange: () => {},
|
selectChange: () => { },
|
||||||
bits: [{ text: "256 bit", value: "32", key: "bit256" }],
|
bits: [{ text: "256 bit", value: "32", key: "bit256" }],
|
||||||
devicePSKBitCount: state.privateKeyBitCount,
|
devicePSKBitCount: state.privateKeyBitCount,
|
||||||
hide: !state.adminKeyVisible,
|
hide: !state.adminKeyVisible,
|
||||||
|
|||||||
Reference in New Issue
Block a user