Bug 1586176 - EncryptUpdate should use maxout not block size. r=franziskus
authorCraig Disselkoen <cdisselk@cs.ucsd.edu>
Tue, 19 Nov 2019 11:54:57 -0700
changeset 15397 1e22a0c93afe9f46545560c86caedef9dab6cfda
parent 15396 e8f2720c8254a5327260dec70153a3c3b7c745b9
child 15405 3147585149f0e907b39bda15e804ec8fb33a0138
push id3584
push userjjones@mozilla.com
push dateTue, 19 Nov 2019 18:56:26 +0000
reviewersfranziskus
bugs1586176
Bug 1586176 - EncryptUpdate should use maxout not block size. r=franziskus
lib/softoken/pkcs11c.c
--- a/lib/softoken/pkcs11c.c
+++ b/lib/softoken/pkcs11c.c
@@ -1346,17 +1346,17 @@ NSC_EncryptUpdate(CK_SESSION_HANDLE hSes
 
             /* not enough data to encrypt yet? then return */
             if (context->padDataLength != context->blockSize) {
                 *pulEncryptedPartLen = 0;
                 return CKR_OK;
             }
             /* encrypt the current padded data */
             rv = (*context->update)(context->cipherInfo, pEncryptedPart,
-                                    &padoutlen, context->blockSize, context->padBuf,
+                                    &padoutlen, maxout, context->padBuf,
                                     context->blockSize);
             if (rv != SECSuccess) {
                 return sftk_MapCryptError(PORT_GetError());
             }
             pEncryptedPart += padoutlen;
             maxout -= padoutlen;
         }
         /* save the residual */