From 907b393fe2467e12f9c2e185422c44f2ed7e8c4a Mon Sep 17 00:00:00 2001 From: Valerie Peng Date: Wed, 8 Feb 2017 19:20:09 +0000 Subject: [PATCH] 8173708: Re-enable AES cipher with CFB128 mode for Ucrypto provider Updated Ucrypto config file to remove the disabled mechanisms Reviewed-by: wetmore --- .../solaris/conf/security/ucrypto-solaris.cfg | 3 --- jdk/test/com/oracle/security/ucrypto/TestAES.java | 10 ++++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/conf/security/ucrypto-solaris.cfg b/jdk/src/jdk.crypto.ucrypto/solaris/conf/security/ucrypto-solaris.cfg index 5ccefad1369..cba2ffc94f8 100644 --- a/jdk/src/jdk.crypto.ucrypto/solaris/conf/security/ucrypto-solaris.cfg +++ b/jdk/src/jdk.crypto.ucrypto/solaris/conf/security/ucrypto-solaris.cfg @@ -2,8 +2,5 @@ # Configuration file for the OracleUcrypto provider # disabledServices = { - # disabled due to Solaris bug 7121679 - Cipher.AES/CFB128/PKCS5Padding - Cipher.AES/CFB128/NoPadding } diff --git a/jdk/test/com/oracle/security/ucrypto/TestAES.java b/jdk/test/com/oracle/security/ucrypto/TestAES.java index 717e3186d97..bf460d420a6 100644 --- a/jdk/test/com/oracle/security/ucrypto/TestAES.java +++ b/jdk/test/com/oracle/security/ucrypto/TestAES.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 7088989 8014374 8167512 + * @bug 7088989 8014374 8167512 8173708 * @summary Ensure the AES ciphers of OracleUcrypto provider works correctly * @key randomness * @run main TestAES @@ -177,6 +177,12 @@ public class TestAES extends UcryptoTest { k += c.doFinal(eout, firstPartLen+1, eout.length - firstPartLen - 1, dout, k); if (!checkArrays(in, in.length, dout, k)) testPassed = false; } catch(Exception ex) { + if (ex instanceof BadPaddingException && + algos[i].indexOf("CFB128") != -1 && + p.getName().equals("OracleUcrypto")) { + System.out.println("Ignore due to a pre-S11.3 bug: " + ex); + continue; + } System.out.println("Unexpected Exception: " + algos[i]); ex.printStackTrace(); testPassed = false;