More ECC Debugging logs

This commit is contained in:
emad-salah 2021-10-26 14:30:19 +01:00 committed by Daniel Lugo
parent 694b6334c5
commit c4a7e5a3fc
2 changed files with 12 additions and 2 deletions

View file

@ -164,6 +164,16 @@ const server = program => {
}
if (!authorized || process.env.SHOCK_ENCRYPTION_ECC === 'false') {
if (!authorized) {
logger.warn(
`An unauthorized Device ID is contacting the API: ${deviceId}`
)
logger.warn(
`Authorized Device IDs: ${[...ECC.devicePublicKeys.keys()].join(
', '
)}`
)
}
args[0] = JSON.stringify(args[0])
oldSend.apply(res, args)
}

View file

@ -13,8 +13,8 @@ const {
convertBase64ToBuffer
} = require('./crypto')
const nodeKeyPairs = new Map()
const devicePublicKeys = new Map()
export const nodeKeyPairs = new Map()
export const devicePublicKeys = new Map()
/**
* @typedef {object} EncryptedMessage