Skip to content
Snippets Groups Projects
Commit 02a8a6f8 authored by Jenny Farstad Blindheimsvik's avatar Jenny Farstad Blindheimsvik
Browse files

Oppdateringer userDAO

parent 8538418d
No related branches found
No related tags found
No related merge requests found
Pipeline #72172 passed
...@@ -183,14 +183,16 @@ public class UserDAO { ...@@ -183,14 +183,16 @@ public class UserDAO {
* @return a random salt * @return a random salt
*/ */
public byte[] generateSalt() { public byte[] generateSalt() {
byte[] bytes = new byte[16];
try{ try{
SecureRandom random = SecureRandom.getInstance("SHA-256"); SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
byte[] bytes = new byte[20];
random.nextBytes(bytes); random.nextBytes(bytes);
return bytes;} }
catch (NoSuchAlgorithmException e){ catch (NoSuchAlgorithmException e){
return null; e.printStackTrace();
} }
return bytes;
} }
/** /**
......
...@@ -132,6 +132,7 @@ public class UserDAOTest extends JerseyTest { ...@@ -132,6 +132,7 @@ public class UserDAOTest extends JerseyTest {
} }
} }
@After @After
public void tearDown () { public void tearDown () {
try { try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment