Ver código fonte

fix(e2ee) discards frames that cannot be decrypted

dev1
tmoldovan8x8 2 anos atrás
pai
commit
c29de010e8
Nenhuma conta vinculada ao e-mail do autor do commit
1 arquivos alterados com 3 adições e 7 exclusões
  1. 3
    7
      modules/e2ee/Context.js

+ 3
- 7
modules/e2ee/Context.js Ver arquivo

191
 
191
 
192
             return controller.enqueue(decodedFrame);
192
             return controller.enqueue(decodedFrame);
193
         }
193
         }
194
-
195
-        // TODO: this just passes through to the decoder. Is that ok? If we don't know the key yet
196
-        // we might want to buffer a bit but it is still unclear how to do that (and for how long etc).
197
-        controller.enqueue(encodedFrame);
198
     }
194
     }
199
 
195
 
200
     /**
196
     /**
253
             newUint8.set(new Uint8Array(plainText), frameHeader.byteLength);
249
             newUint8.set(new Uint8Array(plainText), frameHeader.byteLength);
254
 
250
 
255
             encodedFrame.data = newData;
251
             encodedFrame.data = newData;
252
+
253
+            return encodedFrame;
256
         } catch (error) {
254
         } catch (error) {
257
             if (this._sharedKey) {
255
             if (this._sharedKey) {
258
-                return encodedFrame;
256
+                return;
259
             }
257
             }
260
 
258
 
261
             if (ratchetCount < RATCHET_WINDOW_SIZE) {
259
             if (ratchetCount < RATCHET_WINDOW_SIZE) {
284
 
282
 
285
             // TODO: notify the application about error status.
283
             // TODO: notify the application about error status.
286
         }
284
         }
287
-
288
-        return encodedFrame;
289
     }
285
     }
290
 
286
 
291
 
287
 

Carregando…
Cancelar
Salvar