mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: signal curve key update
This commit is contained in:
@@ -28,13 +28,13 @@ export const generateSignalPubKey = (pubKey: Uint8Array | Buffer) => (
|
|||||||
Buffer.concat([ KEY_BUNDLE_TYPE, pubKey ])
|
Buffer.concat([ KEY_BUNDLE_TYPE, pubKey ])
|
||||||
)
|
)
|
||||||
|
|
||||||
export const signedKeyPair = (keyPair: KeyPair, keyId: number) => {
|
export const signedKeyPair = (identityKeyPair: KeyPair, keyId: number) => {
|
||||||
const signKeys = Curve.generateKeyPair()
|
const preKey = Curve.generateKeyPair()
|
||||||
const pubKey = generateSignalPubKey(keyPair.public)
|
const pubKey = generateSignalPubKey(preKey.public)
|
||||||
|
|
||||||
const signature = Curve.sign(keyPair.private, pubKey)
|
const signature = Curve.sign(identityKeyPair.private, pubKey)
|
||||||
|
|
||||||
return { keyPair: signKeys, signature, keyId }
|
return { keyPair: preKey, signature, keyId }
|
||||||
}
|
}
|
||||||
|
|
||||||
/** decrypt AES 256 CBC; where the IV is prefixed to the buffer */
|
/** decrypt AES 256 CBC; where the IV is prefixed to the buffer */
|
||||||
|
|||||||
Reference in New Issue
Block a user