mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
mobile: deprecation.
This commit is contained in:
@@ -16,13 +16,11 @@ const generateIV = (counter: number) => {
|
||||
export const makeNoiseHandler = ({
|
||||
keyPair: { private: privateKey, public: publicKey },
|
||||
NOISE_HEADER,
|
||||
mobile,
|
||||
logger,
|
||||
routingInfo
|
||||
}: {
|
||||
keyPair: KeyPair
|
||||
NOISE_HEADER: Uint8Array
|
||||
mobile: boolean
|
||||
logger: Logger
|
||||
routingInfo?: Buffer | undefined
|
||||
}) => {
|
||||
@@ -113,16 +111,12 @@ export const makeNoiseHandler = ({
|
||||
|
||||
const certDecoded = decrypt(serverHello!.payload!)
|
||||
|
||||
if(mobile) {
|
||||
proto.CertChain.NoiseCertificate.decode(certDecoded)
|
||||
} else {
|
||||
const { intermediate: certIntermediate } = proto.CertChain.decode(certDecoded)
|
||||
const { intermediate: certIntermediate } = proto.CertChain.decode(certDecoded)
|
||||
|
||||
const { issuerSerial } = proto.CertChain.NoiseCertificate.Details.decode(certIntermediate!.details!)
|
||||
const { issuerSerial } = proto.CertChain.NoiseCertificate.Details.decode(certIntermediate!.details!)
|
||||
|
||||
if(issuerSerial !== WA_CERT_DETAILS.SERIAL) {
|
||||
throw new Boom('certification match failed', { statusCode: 400 })
|
||||
}
|
||||
if(issuerSerial !== WA_CERT_DETAILS.SERIAL) {
|
||||
throw new Boom('certification match failed', { statusCode: 400 })
|
||||
}
|
||||
|
||||
const keyEnc = encrypt(noiseKey.public)
|
||||
@@ -183,11 +177,11 @@ export const makeNoiseHandler = ({
|
||||
inBytes = inBytes.slice(size + 3)
|
||||
|
||||
if(isFinished) {
|
||||
const result = decrypt(frame as Uint8Array)
|
||||
const result = decrypt(frame)
|
||||
frame = await decodeBinaryNode(result)
|
||||
}
|
||||
|
||||
logger.trace({ msg: (frame as any)?.attrs?.id }, 'recv frame')
|
||||
logger.trace({ msg: (frame as BinaryNode)?.attrs?.id }, 'recv frame')
|
||||
|
||||
onFrame(frame)
|
||||
size = getBytesSize()
|
||||
|
||||
Reference in New Issue
Block a user