Please review this trivial fix at http://cr.openjdk.java.net/~weijun/8185934/webrev.00/ KeyUtil.getSize() are also called elsewhere when they key is weak, where key length is not -1. Noreg-trivial. Thanks Max