This commit is contained in:
Christopher Jeffrey 2016-06-09 16:23:21 -07:00
parent ca3dade3b1
commit e12a8bb21c
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
3 changed files with 8 additions and 4 deletions

View File

@ -516,7 +516,7 @@ AESCipher.prototype.update = function update(data) {
*/
AESCipher.prototype.final = function final() {
var i, block, left, pad;
var block, left, pad;
// Handle padding on the last block.
if (!this.waiting) {

View File

@ -545,9 +545,6 @@ AEAD.prototype.finish = function finish() {
var len = new Buffer(16);
var lo, hi;
if (this.cipherLen === 0)
this.pad16(this.aadLen);
// The RFC says these are supposed to be
// uint32le, but their own fucking test
// cases fail unless they are uint64le's.
@ -561,6 +558,9 @@ AEAD.prototype.finish = function finish() {
len.writeUInt32LE(lo, 8, true);
len.writeUInt32LE(hi, 12, true);
if (this.cipherLen === 0)
this.pad16(this.aadLen);
this.pad16(this.cipherLen);
this.poly1305.update(len);

View File

@ -601,6 +601,8 @@ Pool.prototype.startSync = function startSync() {
};
Pool.prototype.sync = function sync() {
var i;
if (this.peers.load)
this.peers.load.sync();
@ -613,6 +615,8 @@ Pool.prototype.sync = function sync() {
*/
Pool.prototype.stopSync = function stopSync() {
var i;
if (!this.syncing)
return;