jdk/test/com/oracle/security/ucrypto/TestAES.java
changeset 43698 e3e3ae809ab4
parent 41550 563c1d911dcb
child 45891 55e3ff5a7b08
equal deleted inserted replaced
43694:fcc6fff17bfa 43698:e3e3ae809ab4
     1 /*
     1 /*
     2  * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug 7088989 8014374 8167512
    26  * @bug 7088989 8014374 8167512 8173708
    27  * @summary Ensure the AES ciphers of OracleUcrypto provider works correctly
    27  * @summary Ensure the AES ciphers of OracleUcrypto provider works correctly
    28  * @key randomness
    28  * @key randomness
    29  * @run main TestAES
    29  * @run main TestAES
    30  * @run main/othervm/java.security.policy==empty.policy TestAES
    30  * @run main/othervm/java.security.policy==empty.policy TestAES
    31  */
    31  */
   175                     k = c.update(eout, 0, firstPartLen, dout, 0);
   175                     k = c.update(eout, 0, firstPartLen, dout, 0);
   176                     k += c.update(eout, firstPartLen, 1, dout, k);
   176                     k += c.update(eout, firstPartLen, 1, dout, k);
   177                     k += c.doFinal(eout, firstPartLen+1, eout.length - firstPartLen - 1, dout, k);
   177                     k += c.doFinal(eout, firstPartLen+1, eout.length - firstPartLen - 1, dout, k);
   178                     if (!checkArrays(in, in.length, dout, k)) testPassed = false;
   178                     if (!checkArrays(in, in.length, dout, k)) testPassed = false;
   179                 } catch(Exception ex) {
   179                 } catch(Exception ex) {
       
   180                     if (ex instanceof BadPaddingException &&
       
   181                             algos[i].indexOf("CFB128") != -1 &&
       
   182                             p.getName().equals("OracleUcrypto")) {
       
   183                         System.out.println("Ignore due to a pre-S11.3 bug: " + ex);
       
   184                         continue;
       
   185                     }
   180                     System.out.println("Unexpected Exception: " + algos[i]);
   186                     System.out.println("Unexpected Exception: " + algos[i]);
   181                     ex.printStackTrace();
   187                     ex.printStackTrace();
   182                     testPassed = false;
   188                     testPassed = false;
   183                 }
   189                 }
   184             }
   190             }