Skip to content

Commit 5a51d70

Browse files
author
Sibabrata Sahoo
committed
8247895: SHA1PRNGReseed.java is calling setSeed(0)
Reviewed-by: weijun, rhalade
1 parent b2a52ea commit 5a51d70

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/jdk/sun/security/provider/SecureRandom/SHA1PRNGReseed.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2021, 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
@@ -28,14 +28,14 @@
2828

2929
/**
3030
* @test
31-
* @bug 8154523
31+
* @bug 8154523 8247895
3232
* @summary SHA1PRNG output should change after setSeed
3333
*/
3434
public class SHA1PRNGReseed {
3535

3636
public static void main(String[] args) throws Exception {
3737
SecureRandom sr = SecureRandom.getInstance("SHA1PRNG");
38-
sr.setSeed(0);
38+
sr.setSeed(1);
3939
sr.nextInt();
4040

4141
ByteArrayOutputStream bout = new ByteArrayOutputStream();
@@ -45,7 +45,7 @@ public static void main(String[] args) throws Exception {
4545
new ByteArrayInputStream(bout.toByteArray())).readObject();
4646

4747
int i1 = sr.nextInt();
48-
sr2.setSeed(1);
48+
sr2.setSeed(2);
4949
int i2 = sr2.nextInt();
5050

5151
if (i1 == i2) {

0 commit comments

Comments
 (0)