We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4365c8f commit a1fc7e7Copy full SHA for a1fc7e7
src/main/java/com/gitblit/models/UserModel.java
@@ -17,6 +17,7 @@
17
18
import java.io.Serializable;
19
import java.security.Principal;
20
+import java.security.SecureRandom;
21
import java.util.ArrayList;
22
import java.util.Collections;
23
import java.util.HashSet;
@@ -662,6 +663,9 @@ public boolean isMyPersonalRepository(String repository) {
662
663
}
664
665
public String createCookie() {
- return StringUtils.getSHA1(String.valueOf(Math.random()));
666
+ SecureRandom random = new SecureRandom();
667
+ byte[] values = new byte[20];
668
+ random.nextBytes(values);
669
+ return StringUtils.getSHA1(String.valueOf(values));
670
671
0 commit comments