JCE: add support for SecureRandom.getInstance("DEFAULT"), maps to HashDRBG
parent
430b8b7503
commit
45deb2802f
|
@ -34,6 +34,7 @@ The JCE provider currently supports the following algorithms:
|
||||||
SHA-512
|
SHA-512
|
||||||
|
|
||||||
SecureRandom Class
|
SecureRandom Class
|
||||||
|
DEFAULT (maps to HashDRBG)
|
||||||
HashDRBG
|
HashDRBG
|
||||||
|
|
||||||
Cipher Class
|
Cipher Class
|
||||||
|
|
|
@ -65,6 +65,8 @@ public final class WolfCryptProvider extends Provider {
|
||||||
/* SecureRandom */
|
/* SecureRandom */
|
||||||
/* TODO: May need to add "SHA1PRNG" alias, other JCA consumemrs may
|
/* TODO: May need to add "SHA1PRNG" alias, other JCA consumemrs may
|
||||||
* explicitly request it? Needs more testing. */
|
* explicitly request it? Needs more testing. */
|
||||||
|
put("SecureRandom.DEFAULT",
|
||||||
|
"com.wolfssl.provider.jce.WolfCryptRandom");
|
||||||
put("SecureRandom.HashDRBG",
|
put("SecureRandom.HashDRBG",
|
||||||
"com.wolfssl.provider.jce.WolfCryptRandom");
|
"com.wolfssl.provider.jce.WolfCryptRandom");
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,13 @@ public class WolfCryptRandomTest {
|
||||||
public void testGetRandomFromProvider()
|
public void testGetRandomFromProvider()
|
||||||
throws NoSuchProviderException, NoSuchAlgorithmException {
|
throws NoSuchProviderException, NoSuchAlgorithmException {
|
||||||
|
|
||||||
SecureRandom rand = SecureRandom.getInstance("HashDRBG", "wolfJCE");
|
SecureRandom rand = null;
|
||||||
|
|
||||||
|
/* HashDRBG */
|
||||||
|
rand = SecureRandom.getInstance("HashDRBG", "wolfJCE");
|
||||||
|
|
||||||
|
/* DEFAULT */
|
||||||
|
rand = SecureRandom.getInstance("DEFAULT", "wolfJCE");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue