< prev index next >

test/jdk/sun/security/pkcs11/Mac/MacSameTest.java

Print this page
rev 59383 : [mq]: final

*** 1,7 **** /* ! * Copyright (c) 1998, 2018, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 1998, 2020, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 84,106 **** private void doTest(String algo, Provider provider) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeyException { System.out.println("Test " + algo); ! Mac mac; ! try { ! mac = Mac.getInstance(algo, provider); ! } catch (NoSuchAlgorithmException nsae) { ! if ("SunPKCS11-Solaris".equals(provider.getName())) { ! // depending on Solaris configuration, ! // it can support HMAC or not with Mac ! System.out.println("Expected NoSuchAlgorithmException thrown: " ! + nsae); ! return; ! } ! throw nsae; ! } byte[] plain = new byte[MESSAGE_SIZE]; for (int i = 0; i < MESSAGE_SIZE; i++) { plain[i] = (byte) (i % 256); } --- 84,94 ---- private void doTest(String algo, Provider provider) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeyException { System.out.println("Test " + algo); ! Mac mac = Mac.getInstance(algo, provider); byte[] plain = new byte[MESSAGE_SIZE]; for (int i = 0; i < MESSAGE_SIZE; i++) { plain[i] = (byte) (i % 256); }
< prev index next >