mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8180392: SunJCE provider should throw exceptions for unsupported mode and padding combinations
Change JCA Cipher class to create obj to ensure the mode and padding combination is supported Reviewed-by: xuelei
This commit is contained in:
parent
74c3432b28
commit
6b662abe74
8 changed files with 188 additions and 69 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2019, 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
|
||||
|
@ -271,7 +271,9 @@ final class CipherCore {
|
|||
padding = null;
|
||||
} else if (paddingScheme.equalsIgnoreCase("ISO10126Padding")) {
|
||||
padding = new ISO10126Padding(blockSize);
|
||||
} else if (!paddingScheme.equalsIgnoreCase("PKCS5Padding")) {
|
||||
} else if (paddingScheme.equalsIgnoreCase("PKCS5Padding")) {
|
||||
padding = new PKCS5Padding(blockSize);
|
||||
} else {
|
||||
throw new NoSuchPaddingException("Padding: " + paddingScheme
|
||||
+ " not implemented");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue