--- a/jdk/src/share/classes/sun/security/pkcs11/P11Cipher.java Tue May 07 14:06:19 2013 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11Cipher.java Tue May 07 14:13:53 2013 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -460,7 +460,7 @@
}
int result = inLen + bytesBuffered;
- if (blockSize != 0) {
+ if (blockSize != 0 && blockMode != MODE_CTR) {
// minus the number of bytes in the last incomplete block.
result -= (result & (blockSize - 1));
}