11/*
2- * Copyright (c) 2005, 2024 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2005, 2025 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
3636import java .security .InvalidAlgorithmParameterException ;
3737import javax .crypto .KeyGenerator ;
3838import javax .crypto .SecretKey ;
39+
40+ import jtreg .SkippedException ;
3941import sun .security .internal .spec .TlsRsaPremasterSecretParameterSpec ;
4042
4143public class TestPremaster extends PKCS11Test {
@@ -48,8 +50,7 @@ public static void main(String[] args) throws Exception {
4850 public void main (Provider provider ) throws Exception {
4951 if (provider .getService (
5052 "KeyGenerator" , "SunTlsRsaPremasterSecret" ) == null ) {
51- System .out .println ("Not supported by provider, skipping" );
52- return ;
53+ throw new SkippedException ("Not supported by provider, skipping" );
5354 }
5455 KeyGenerator kg ;
5556 kg = KeyGenerator .getInstance ("SunTlsRsaPremasterSecret" , provider );
@@ -87,8 +88,7 @@ private static void test(KeyGenerator kg,
8788 } catch (InvalidAlgorithmParameterException iape ) {
8889 // S12 removed support for SSL v3.0
8990 if (clientVersion == 0x300 || serverVersion == 0x300 ) {
90- System .out .println ("Skip testing SSLv3 due to no support" );
91- return ;
91+ throw new SkippedException ("Skip testing SSLv3 due to no support" );
9292 }
9393 // unexpected, pass it up
9494 throw iape ;
0 commit comments