7199941: test about AES/ECB mode fails

Fixed the problem of field "blockMode" not having correct value for AES algorithms.

Reviewed-by: vinnie
This commit is contained in:
Valerie Peng 2012-09-25 11:27:42 -07:00
parent 360754471c
commit 0733ebe2f2

View File

@ -193,9 +193,9 @@ final class P11Cipher extends CipherSpi {
} else { // DES, DESede, Blowfish
blockSize = 8;
}
this.blockMode =
(algoParts.length > 1 ? parseMode(algoParts[1]) : MODE_ECB);
}
this.blockMode =
(algoParts.length > 1 ? parseMode(algoParts[1]) : MODE_ECB);
String defPadding = (blockSize == 0 ? "NoPadding" : "PKCS5Padding");
String paddingStr =
(algoParts.length > 2 ? algoParts[2] : defPadding);