sender-key: credit original fix and fix key handling

This commit is contained in:
Rajeh Taher
2025-09-13 11:38:24 +03:00
parent f0dcc30e0f
commit e305d4848e
3 changed files with 10 additions and 4 deletions
+3 -1
View File
@@ -11,11 +11,13 @@ export class SenderChainKey {
constructor(iteration: number, chainKey: any) {
this.iteration = iteration
if (Buffer.isBuffer(chainKey)) {
// backported from @MartinSchere's PR
this.chainKey = chainKey
} else if (chainKey instanceof Uint8Array) {
this.chainKey = Buffer.from(chainKey)
} else if (chainKey && typeof chainKey === 'object') {
this.chainKey = Buffer.from(Object.values(chainKey))
// backported from @MartinSchere (#1741)
this.chainKey = Buffer.from(Object.values(chainKey)) // temp fix // backported from @MartinSchere (#1741)
} else {
this.chainKey = Buffer.alloc(0)
}